@sma1lboy/rove 0.9.305-next.430 → 0.9.305
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/dist/cli/{chunk-2agspgfq.js → chunk-0rm5essq.js} +1 -1
- package/dist/cli/{chunk-vat1vjkk.js → chunk-0tgvsnfw.js} +1 -1
- package/dist/cli/{chunk-vjejmwzj.js → chunk-0y7btzkb.js} +1 -1
- package/dist/cli/{chunk-qwqa75g1.js → chunk-17f1k5g1.js} +1 -1
- package/dist/cli/{chunk-me70fpec.js → chunk-1jff1zbz.js} +1 -1
- package/dist/cli/{chunk-gz0x179r.js → chunk-20ya2bwa.js} +1 -1
- package/dist/cli/{chunk-1bertmzz.js → chunk-228cg4e1.js} +1 -1
- package/dist/cli/{chunk-5dv7pw3w.js → chunk-22mzajwm.js} +2 -2
- package/dist/cli/{chunk-b7rxn7c9.js → chunk-2an5bkk2.js} +1 -1
- package/dist/cli/{chunk-hct98wxq.js → chunk-2hd9yc39.js} +1 -1
- package/dist/cli/{chunk-dab3kttb.js → chunk-34yry2y8.js} +1 -1
- package/dist/cli/{chunk-2gpr5dm4.js → chunk-3r544y4v.js} +1 -1
- package/dist/cli/{chunk-zze1pw22.js → chunk-48q16gte.js} +1 -1
- package/dist/cli/{chunk-t8gt3kq8.js → chunk-4acjw6wk.js} +1 -1
- package/dist/cli/{chunk-z1fpd4k2.js → chunk-4fr4az7p.js} +1 -1
- package/dist/cli/chunk-4q7hm4jh.js +3 -0
- package/dist/cli/{chunk-yk3we30f.js → chunk-4xtapamr.js} +1 -1
- package/dist/cli/{chunk-p4rhkv3k.js → chunk-547xfzwg.js} +1 -1
- package/dist/cli/{chunk-7yhekmvy.js → chunk-57rtb9mf.js} +1 -1
- package/dist/cli/{chunk-h2xantkm.js → chunk-5jwhjn9b.js} +1 -1
- package/dist/cli/{chunk-0s7j1xps.js → chunk-5p0rd52x.js} +1 -1
- package/dist/cli/{chunk-7ezpcrkf.js → chunk-5rq2x11k.js} +1 -1
- package/dist/cli/{chunk-8hfkcjxm.js → chunk-6153jj5t.js} +1 -1
- package/dist/cli/{chunk-vwynmap6.js → chunk-67mnh6f2.js} +1 -1
- package/dist/cli/{chunk-8wejvvsz.js → chunk-6ewh2d6q.js} +1 -1
- package/dist/cli/{chunk-xj3034s1.js → chunk-73bn2t5z.js} +1 -1
- package/dist/cli/{chunk-6cggsxpr.js → chunk-75j5mted.js} +1 -1
- package/dist/cli/chunk-78rtznxy.js +16 -0
- package/dist/cli/{chunk-am70fwd0.js → chunk-7gv7yt9m.js} +1 -1
- package/dist/cli/{chunk-d35ctfpd.js → chunk-7yv9n60a.js} +1 -1
- package/dist/cli/{chunk-cvcp1aye.js → chunk-888sg2t5.js} +1 -1
- package/dist/cli/{chunk-9tke0g8m.js → chunk-8d8nxya2.js} +1 -1
- package/dist/cli/{chunk-s129kc10.js → chunk-8pr6mn2t.js} +1 -1
- package/dist/cli/{chunk-ggjg0h5c.js → chunk-9knnk0py.js} +1 -1
- package/dist/cli/{chunk-n15p38e5.js → chunk-c7vs657h.js} +1 -1
- package/dist/cli/{chunk-vd9670dy.js → chunk-cdaqwvcb.js} +1 -1
- package/dist/cli/{chunk-3jh1cfdj.js → chunk-d7z4smjj.js} +1 -1
- package/dist/cli/{chunk-pf3nzz87.js → chunk-dkqdctbn.js} +1 -1
- package/dist/cli/{chunk-59ff10tt.js → chunk-e45vfect.js} +1 -1
- package/dist/cli/{chunk-gvs8sbp2.js → chunk-ejzcfjy4.js} +1 -1
- package/dist/cli/{chunk-sffdpzfv.js → chunk-fjbxagq6.js} +1 -1
- package/dist/cli/{chunk-6azsw0ry.js → chunk-fqnz65z7.js} +4 -4
- package/dist/cli/{chunk-a5pd9fk3.js → chunk-fsamf4mg.js} +1 -1
- package/dist/cli/{chunk-t4reqv8m.js → chunk-gkvpgath.js} +1 -1
- package/dist/cli/{chunk-gafj4yp3.js → chunk-gxb2cx4t.js} +4 -4
- package/dist/cli/{chunk-19n8y9xp.js → chunk-hf10xgs6.js} +2 -2
- package/dist/cli/{chunk-qaznc1bg.js → chunk-hf8dswph.js} +1 -1
- package/dist/cli/{chunk-s6wqbs6y.js → chunk-hqr1g388.js} +1 -1
- package/dist/cli/{chunk-sggsdk9s.js → chunk-jqc18yt1.js} +2 -2
- package/dist/cli/{chunk-ga448pv8.js → chunk-kbs4ttp9.js} +1 -1
- package/dist/cli/{chunk-weah9492.js → chunk-kj929z6t.js} +1 -1
- package/dist/cli/{chunk-nhsem71y.js → chunk-mvcfxz7c.js} +1 -1
- package/dist/cli/{chunk-zp4efbtb.js → chunk-ncr2aqwh.js} +1 -1
- package/dist/cli/{chunk-mavyyarb.js → chunk-nkddj071.js} +1 -1
- package/dist/cli/{chunk-1et3gskx.js → chunk-phzem4ep.js} +1 -1
- package/dist/cli/{chunk-yzz6vx5j.js → chunk-pjbg2bax.js} +1 -1
- package/dist/cli/{chunk-a8j2x5pf.js → chunk-pw9wcs34.js} +1 -1
- package/dist/cli/{chunk-3da0g8md.js → chunk-q2vz3m8b.js} +1 -1
- package/dist/cli/{chunk-g70rcpsp.js → chunk-q5t33vtx.js} +1 -1
- package/dist/cli/{chunk-zc67sqet.js → chunk-qzbs252j.js} +1 -1
- package/dist/cli/{chunk-29e7x3qx.js → chunk-r1npkr2s.js} +1 -1
- package/dist/cli/{chunk-8nbvsger.js → chunk-ramz2x04.js} +1 -1
- package/dist/cli/{chunk-ragdpajw.js → chunk-s6pbgb9q.js} +1 -1
- package/dist/cli/{chunk-cs7m5f61.js → chunk-tfpt0rna.js} +1 -1
- package/dist/cli/{chunk-06vsvvtr.js → chunk-tmxy5xd5.js} +1 -1
- package/dist/cli/{chunk-6wzb9c2x.js → chunk-txe974cf.js} +1 -1
- package/dist/cli/{chunk-m5ddrj6q.js → chunk-v1t13rzp.js} +1 -1
- package/dist/cli/{chunk-t7qj639x.js → chunk-v9bkgasj.js} +1 -1
- package/dist/cli/{chunk-8ag7qs90.js → chunk-w3czf347.js} +1 -1
- package/dist/cli/{chunk-nyr8zxgd.js → chunk-wk4h2zm5.js} +2 -2
- package/dist/cli/{chunk-kvwneanp.js → chunk-wm3ps4tc.js} +1 -1
- package/dist/cli/{chunk-9b42t2wf.js → chunk-wwvqvrax.js} +1 -1
- package/dist/cli/{chunk-7gk8g1ae.js → chunk-x23cchn4.js} +1 -1
- package/dist/cli/{chunk-7dah6dc9.js → chunk-xbn448m0.js} +1 -1
- package/dist/cli/{chunk-fmhnw1nz.js → chunk-xjt62dxr.js} +2 -2
- package/dist/cli/chunk-xtqc3xcr.js +3 -0
- package/dist/cli/{chunk-aejb41e3.js → chunk-y8p2e1n0.js} +1 -1
- package/dist/cli/{chunk-4nzf8w3e.js → chunk-yepm9ww9.js} +2 -2
- package/dist/cli/{chunk-2bapg0v2.js → chunk-zq3tbpm7.js} +10 -9
- package/dist/cli/{chunk-2nddryb2.js → chunk-zvp9f75r.js} +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/cli/pty-host-node.mjs +11 -1
- package/dist/cli/rove.js +3 -3
- package/dist/web/assets/index-Dfq3buJH.js +84 -0
- package/dist/web/assets/{term-mount-OMVJnrk8.js → term-mount-C6rfINle.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +3 -3
- package/dist/cli/chunk-750rk2xz.js +0 -16
- package/dist/cli/chunk-7bgbansg.js +0 -3
- package/dist/cli/chunk-s2eezz0a.js +0 -3
- package/dist/web/assets/index-7xgjby6F.js +0 -84
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/term-mount-OMVJnrk8.js","assets/rolldown-runtime-hePW80VL.js","assets/term-mount-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,t}from"./rolldown-runtime-hePW80VL.js";(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 n=`rove.bridge.token`;if(typeof window<`u`){let e=new URLSearchParams(window.location.hash.slice(1)).get(`token`);e&&(localStorage.setItem(n,e),history.replaceState(null,``,window.location.pathname+window.location.search))}function r(){return localStorage.getItem(n)}function i(e){localStorage.setItem(n,e)}function a(){localStorage.removeItem(n)}var o=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=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)},I={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),s=t(((e,t)=>{t.exports=o()})),c=t((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}}}})),l=t(((e,t)=>{t.exports=c()})),u=t((e=>{var t=s();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),d=t(((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=u()})),f=t((e=>{var t=l(),n=s(),r=d();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(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(o(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return f(a),e;if(s===r)return f(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=s;break}if(l===r){c=!0,r=a,n=s;break}l=l.sibling}if(!c){for(l=s.child;l;){if(l===n){c=!0,n=s,r=a;break}if(l===r){c=!0,r=s,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var P=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],L=-1;function re(e){return{current:e}}function ie(e){0>L||(e.current=ne[L],ne[L]=null,L--)}function ae(e,t){L++,ne[L]=e.current,e.current=t}var R=re(null),oe=re(null),se=re(null),z=re(null);function ce(e,t){switch(ae(se,t),ae(oe,e),ae(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(R),ae(R,e)}function le(){ie(R),ie(oe),ie(se)}function B(e){e.memoizedState!==null&&ae(z,e);var t=R.current,n=Wd(t,e.type);t!==n&&(ae(oe,e),ae(R,n))}function ue(e){oe.current===e&&(ie(R),ie(oe)),z.current===e&&(ie(z),ep._currentValue=te)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+de+e+fe}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var 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(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);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=`
|
|
7
|
-
`+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{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return pe(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var V=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,Se=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(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=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(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 Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(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 Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(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-Pe(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&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(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 $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=I.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function tt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,it=`__reactProps$`+nt,at=`__reactContainer$`+nt,ot=`__reactEvents$`+nt,st=`__reactListeners$`+nt,ct=`__reactHandles$`+nt,lt=`__reactResources$`+nt,ut=`__reactMarker$`+nt;function dt(e){delete e[rt],delete e[it],delete e[ot],delete e[st],delete e[ct]}function ft(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[rt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function pt(e){if(e=e[rt]||e[at]){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(i(33))}function ht(e){var t=e[lt];return t||=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[ut]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=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]*$`),St={},Ct={};function wt(e){return V.call(Ct,e)?!0:V.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(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 Et(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 Dt(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 Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(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 jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function H(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=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):U(e,o,Ot(n)):U(e,o,Ot(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=``+Ot(s):e.removeAttribute(`name`)}function It(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)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(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),jt(e)}function U(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(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=``+Ot(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 Rt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(P(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=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 Ht(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||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(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 Gt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Kt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=pt(e);if(t&&(e=t.stateNode)){var n=e[it]||null;a:switch(e=t.stateNode,t.type){case`input`:if(H(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="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[it]||null;if(!a)throw Error(i(90));H(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(xu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[it]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,"passive",{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.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 ln=i.slice(e,1<r?1-r:void 0)}function dn(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 fn(){return!0}function pn(){return!1}function mn(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)?fn:pn,this.isPropagationStopped=pn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=h({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=h({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(h({},Sn,{dataTransfer:0})),Tn=mn(h({},_n,{relatedTarget:0})),En=mn(h({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(h({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(h({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(h({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(h({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(h({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(h({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(h({},Sn,{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})),zn=mn(h({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Dd(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){yd(e,0)}function ir(e){if(Mt(mt(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(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(!V.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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=yr(n)}}function W(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?W(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(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=Nt(e.document)}return t}function Sr(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 Cr=rn&&`documentMode`in document&&11>=document.documentMode,G=null,wr=null,Tr=null,Er=!1;function Dr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Er||G==null||G!==Nt(r)||(r=G,`selectionStart`in r&&Sr(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}),Tr&&vr(Tr,r)||(Tr=r,r=Dd(wr,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=G)))}function Or(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var kr={animationend:Or(`Animation`,`AnimationEnd`),animationiteration:Or(`Animation`,`AnimationIteration`),animationstart:Or(`Animation`,`AnimationStart`),transitionrun:Or(`Transition`,`TransitionRun`),transitionstart:Or(`Transition`,`TransitionStart`),transitioncancel:Or(`Transition`,`TransitionCancel`),transitionend:Or(`Transition`,`TransitionEnd`)},Ar={},jr={};rn&&(jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),`TransitionEvent`in window||delete kr.transitionend.transition);function Mr(e){if(Ar[e])return Ar[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jr)return Ar[e]=t[n];return e}var Nr=Mr(`animationend`),Pr=Mr(`animationiteration`),Fr=Mr(`animationstart`),Ir=Mr(`transitionrun`),Lr=Mr(`transitionstart`),Rr=Mr(`transitioncancel`),zr=Mr(`transitionend`),Br=new Map,Vr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),yt(t,[e])}var Ur=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)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[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&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(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-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(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 ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ii(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,R.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Pe(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function K(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function Ci(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function wi(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ti=null,q=null,Ei=!1,Di=null,Oi=!1,ki=Error(i(519));function Ai(e){throw Ii(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ki}function ji(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[it]=r,n){case`dialog`:bd(`cancel`,t),bd(`close`,t);break;case`iframe`:case`object`:case`embed`:bd(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)bd(_d[n],t);break;case`source`:bd(`error`,t);break;case`img`:case`image`:case`link`:bd(`error`,t),bd(`load`,t);break;case`details`:bd(`toggle`,t);break;case`input`:bd(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:bd(`invalid`,t);break;case`textarea`:bd(`invalid`,t),zt(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||Nd(t.textContent,n)?(r.popover!=null&&(bd(`beforetoggle`,t),bd(`toggle`,t)),r.onScroll!=null&&bd(`scroll`,t),r.onScrollEnd!=null&&bd(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Ai(e,!0)}function Mi(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:Ti=Ti.return}}function Ni(e){if(e!==Ti)return!1;if(!Ei)return Mi(e),Ei=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Gd(e.type,e.memoizedProps)),n=!n),n&&q&&Ai(e),Mi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));q=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));q=ff(e)}else t===27?(t=q,$d(e.type)?(e=df,df=null,q=e):q=t):q=Ti?uf(e.stateNode.nextSibling):null;return!0}function Pi(){q=Ti=null,Ei=!1}function Fi(){var e=Di;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Di=null),e}function Ii(e){Di===null?Di=[e]:Di.push(e)}var Li=re(null),Ri=null,zi=null;function Bi(e,t,n){ae(Li,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Li.current,ie(Li)}function Hi(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 Ui(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Hi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Hi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Wi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===z.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Ri=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Ri,e)}function Ji(e,t){return Ri===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Xi=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()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ra=0,ia=0,J=null;function aa(e,t){if(na===null){var n=na=[];ra=0,ia=dd(),J={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ra++,t.then(oa,oa),t}function oa(){if(--ra===0&&na!==null){J!==null&&(J.status=`fulfilled`);var e=na;na=null,ia=0,J=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ca=F.S;F.S=function(e,t){tu=Se(),typeof t==`object`&&t&&typeof t.then==`function`&&aa(e,t),ca!==null&&ca(e,t)};var la=re(null);function ua(){var e=la.current;return e===null?Il.pooledCache:e}function da(e,t){t===null?ae(la,la.current):ae(la,t.pool)}function fa(){var e=ua();return e===null?null:{parent:$i._currentValue,pool:e}}var pa=Error(i(460)),ma=Error(i(474)),ha=Error(i(542)),ga={then:function(){}};function _a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function va(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e}throw ba=t,pa}}function ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ba=e,pa):e}}var ba=null;function xa(){if(ba===null)throw Error(i(459));var e=ba;return ba=null,e}function Sa(e){if(e===pa||e===ha)throw Error(i(483))}var Ca=null,wa=0;function Ta(e){var t=wa;return wa+=1,Ca===null&&(Ca=[]),va(Ca,e,t)}function Ea(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Da(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Oa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&ya(i)===t.type)?(t=a(t,n.props),Ea(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),Ea(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=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=oi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),Ea(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=ya(t),f(e,t,n)}if(P(t)||M(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ta(t),n);if(t.$$typeof===C)return f(e,Ji(e,t),n);Da(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=ya(n),p(e,t,n,r)}if(P(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ta(n),r);if(n.$$typeof===C)return p(e,t,Ji(e,n),r);Da(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=ya(r),m(e,t,n,r,i)}if(P(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ta(r),i);if(r.$$typeof===C)return m(e,t,n,Ji(t,r),i);Da(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ei&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ei&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ei&&xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ei&&xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ei&&xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ei&&xi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ea(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),Ea(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ya(o),b(e,r,o,c)}if(P(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ta(o),c);if(o.$$typeof===C)return b(e,r,Ji(e,o),c);Da(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var i=b(e,t,n,r);return Ca=null,i}catch(t){if(t===pa||t===ha)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function Ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function La(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ra=!1;function za(){if(Ra){var e=J;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var i=e.updateQueue;ja=!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?(Rl&f)===f:(r&f)===f){f!==0&&f===ia&&(Ra=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:ja=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Va(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Va(n[e],t)}var Ua=re(null),Wa=re(0);function Ga(e,t){e=Wl,ae(Wa,e),ae(Ua,t),Wl=e|t.baseLanes}function Ka(){ae(Wa,Wl),ae(Ua,Ua.current)}function qa(){Wl=Wa.current,ie(Ua),ie(Wa)}var Ja=re(null),Ya=null;function Xa(e){var t=e.alternate;ae(to,to.current&1),ae(Ja,e),Ya===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ya=e)}function Za(e){ae(to,to.current),ae(Ja,e),Ya===null&&(Ya=e)}function Qa(e){e.tag===22?(ae(to,to.current),ae(Ja,e),Ya===null&&(Ya=e)):$a(e)}function $a(){ae(to,to.current),ae(Ja,Ja.current)}function eo(e){ie(Ja),Ya===e&&(Ya=null),ie(to)}var to=re(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sf(n)||cf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ro=0,Y=null,io=null,ao=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(i(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,a){return ro=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ns:Ps,co=!1,a=n(r,i),co=!1,so&&(a=vo(t,n,r,i)),_o(e),a}function _o(e){F.H=Ms;var t=io!==null&&io.next!==null;if(ro=0,ao=io=Y=null,oo=!1,uo=0,fo=null,t)throw Error(i(300));e===null||Zs||(e=e.dependencies,e!==null&&Gi(e)&&(Zs=!0))}function vo(e,t,n,r){Y=e;var a=0;do{if(so&&(fo=null),uo=0,so=!1,25<=a)throw Error(i(301));if(a+=1,ao=io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Fs,o=t(n,r)}while(so);return o}function yo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(io===null?null:io.memoizedState)!==e&&(Y.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}ro=0,ao=io=Y=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ao===null?Y.memoizedState=ao=e:ao=ao.next=e,ao}function wo(){if(io===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=io.next;var t=ao===null?Y.memoizedState:ao.next;if(t!==null)ao=t,io=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));io=e,e={memoizedState:io.memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},ao===null?Y.memoizedState=ao=e:ao=ao.next=e}return ao}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=va(fo,e,t),t=Y,(ao===null?t.memoizedState:ao.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===C)return qi(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=To(),Y.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),io,e)}function jo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ro&f)===f:(Rl&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===ia&&(d=!0);else if((ro&p)===p){u=u.next,p===ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Y.lanes|=p,Kl|=p;f=u.action,co&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Y.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(Zs=!0,d&&(n=J,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Mo(e){var t=wo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(Zs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=Y,a=wo(),o=Ei;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((io||a).memoizedState,n);if(s&&(a.memoizedState=n,Zs=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ao!==null&&ao.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||ro&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=To(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ro(e){var t=Xr(e,2);t!==null&&gu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),co){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,io,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(ks(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(Ei){var n=Il.formState;if(n!==null){a:{var r=Y;if(Ei){if(q){b:{for(var i=q,a=Oi;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){q=uf(i.nextSibling),r=i.data===`F!`;break a}}Ai(r)}r=!1}r&&(t=n[0])}}return n=Co(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,Y,r),r.dispatch=n,r=zo(!1),a=Os.bind(null,Y,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),io,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===pa?ha:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,i,n),null)),[r,a,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=io;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=To(),Y.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function es(){return wo().memoizedState}function ts(e,t,n,r){var i=Co();Y.flags|=e,i.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;io!==null&&r!==null&&ho(r,io.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(Y.flags|=e,i.memoizedState=$o(1|t,a,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=To(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ho(t,r[1]))return r[0];if(r=e(),co){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ro&1073741824&&!(Rl&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),Y.lanes|=e,Kl|=e,n)}function hs(e,t,n,r){return _r(n,t)?n:Ua.current===null?!(ro&42)||ro&1073741824&&!(Rl&261930)?(Zs=!0,e.memoizedState=n):(e=hu(),Y.lanes|=e,Kl|=e,t):(e=ms(e,n,r),_r(e,t)||(Zs=!0),e)}function gs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Os(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,sa(c,r),mu(e)):Ds(e,t,r,mu(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,te,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},mu())}function xs(){return qi(ep)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Pa(n);var r=Fa(t,e,n);r!==null&&(gu(r,t,n),Ia(r,t,n)),t={cache:ea()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=Yr(e,t,n,r),n!==null&&(gu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,mu())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(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,_r(s,o))return Jr(e,t,i,0),Il===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return gu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&gu(t,e,2)}function ks(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function As(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var Ms={readContext:qi,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};Ms.useEffectEvent=mo;var Ns={readContext:qi,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:qi,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Ne(!0);try{n(t)}finally{Ne(!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=Ts.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,Y,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=Co();if(Ei){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Rl&127||Po(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Il.identifierPrefix;if(Ei){var n=bi,r=yi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,Y)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:qi,use:Do,useCallback:fs,useContext:qi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),io.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var Fs={readContext:qi,use:Do,useCallback:fs,useContext:qi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return io===null?ms(n,e,t):hs(n,io.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return io===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Fs.useEffectEvent=os;function Is(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ls={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Pa(r);i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(gu(t,e,r),Ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Pa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(gu(t,e,r),Ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Pa(n);r.tag=2,t!=null&&(r.callback=t),t=Fa(e,r,n),t!==null&&(gu(t,e,n),Ia(t,e,n))}};function Rs(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?!vr(n,r)||!vr(i,a):!0}function zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ls.enqueueReplaceState(t,t.state,null)}function Bs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Vs(e){Ur(e)}function Hs(e){console.error(e)}function Us(e){Ur(e)}function Ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ks(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ws(e,t)},n}function qs(e){return e=Pa(e),e.tag=3,e}function Js(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Gs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Gs(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ys(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ja.current,n!==null){switch(n.tag){case 31:case 13:return Ya===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(Ei)return t=Ja.current,t===null?(r!==ki&&(t=Error(i(423),{cause:r}),Ii(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ks(e.stateNode,r,a),La(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ki&&(e=Error(i(422),{cause:r}),Ii(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ks(n.stateNode,r,e),La(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=qs(a),Js(a,e,n,r),La(n,a),!1}n=n.return}while(n!==null);return!1}var Xs=Error(i(461)),Zs=!1;function Qs(e,t,n,r){t.child=e===null?Aa(t,null,n,r):ka(t,e.child,n,r)}function $s(e,t,n,r,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 Ki(t),r=go(e,t,n,o,a,i),s=bo(),e!==null&&!Zs?(xo(e,t,i),Cc(e,t,i)):(Ei&&s&&K(t),t.flags|=1,Qs(e,t,r,i),t.child)}function ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,tc(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function tc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref){if(Zs=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&(Zs=!0);else return t.lanes=e.lanes,Cc(e,t,i)}}return lc(e,t,n,r,i)}function nc(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 ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&da(t,a===null?null:a.cachePool),a===null?Ka():Ga(t,a),Qa(t);else return r=t.lanes=536870912,ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&da(t,null),Ka(),$a(t)):(da(t,a.cachePool),Ga(t,a),$a(t),t.memoizedState=null);return Qs(e,t,i,n),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ic(e,t,n,r,i){var a=ua();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&da(t,null),Ka(),Qa(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function ac(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oc(e,t,n){return ka(t,e.child,null,n),e=ac(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function sc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ei){if(r.mode===`hidden`)return e=ac(t,r),t.lanes=536870912,rc(null,e);if(Za(t),(e=q)?(e=of(e,Oi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,q=null)):e=null,e===null)throw Ai(t);return t.lanes=536870912,null}return ac(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Za(t),a){if(t.flags&256)t.flags&=-257,t=oc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Zs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Zs||a){if(r=Il,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),gu(r,e,s),Xs;Ou(),t=oc(e,t,n)}else e=o.treeContext,q=uf(s.nextSibling),Ti=t,Ei=!0,Di=null,Oi=!1,e!==null&&wi(t,e),t=ac(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function lc(e,t,n,r,i){return Ki(t),n=go(e,t,n,r,void 0,i),r=bo(),e!==null&&!Zs?(xo(e,t,i),Cc(e,t,i)):(Ei&&r&&K(t),t.flags|=1,Qs(e,t,n,i),t.child)}function uc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=vo(t,r,n,i),_o(e),r=bo(),e!==null&&!Zs?(xo(e,t,a),Cc(e,t,a)):(Ei&&r&&K(t),t.flags|=1,Qs(e,t,n,a),t.child)}function dc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ls,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ma(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Is(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&&Ls.enqueueReplaceState(a,a.state,null),Ba(t,r,a,i),za(),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=Bs(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=qi(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)&&zs(t,a,r,o),ja=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),za(),l=t.memoizedState,s||f!==l||ja?(typeof d==`function`&&(Is(t,n,d,r),l=t.memoizedState),(c=ja||Rs(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,Na(e,t),o=t.memoizedProps,u=Bs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=qi(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)&&zs(t,a,r,c),ja=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i),za();var p=t.memoizedState;o!==d||f!==p||ja||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Is(t,n,s,r),p=t.memoizedState),(u=ja||Rs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(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,cc(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=ka(t,e.child,null,i),t.child=ka(t,null,n,i)):Qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function fc(e,t,n,r){return Pi(),t.flags|=256,Qs(e,t,n,r),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mc(e){return{baseLanes:e,cachePool:fa()}}function hc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function gc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(to.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Ei){if(a?Xa(t):$a(t),(e=q)?(e=of(e,Oi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,q=null)):e=null,e===null)throw Ai(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(null,r)):(Xa(t),_c(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Xa(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ka(t,e.child,null,n),r=t.child,r.memoizedState=mc(n),r.childLanes=hc(e,s,n),t.memoizedState=pc,t=rc(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ii({value:r,source:null,stack:null}),t=yc(e,t,n)}else if(Zs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Zs||s){if(s=Il,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),gu(s,e,r),Xs;sf(c)||Ou(),t=yc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,q=uf(c.nextSibling),Ti=t,Ei=!0,Di=null,Oi=!1,e!==null&&wi(t,e),t=_c(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,rc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=mc(n):(a=c.cachePool,a===null?a=fa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=hc(e,s,n),t.memoizedState=pc,rc(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function _c(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return ka(t,e.child,null,n),e=_c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function xc(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 Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ae(to,o),Qs(e,t,r,n),r=Ei?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Wi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Gi(e)))}function Tc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Bi(t,$i,e.memoizedState.cache),Pi();break;case 27:case 5:B(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=Cc(e,t,n),e===null?null:e.sibling):gc(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ae(to,to.current),r)break;return null;case 22:return t.lanes=0,nc(e,t,n,t.pendingProps);case 24:Bi(t,$i,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Zs=!0;else{if(!wc(e,n)&&!(t.flags&128))return Zs=!1,Tc(e,t,n);Zs=!!(e.flags&131072)}}else Zs=!1,Ei&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=Bs(e,r),t.tag=1,t=dc(null,t,e,r,n)):(t.tag=0,t=lc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=$s(null,t,e,r,n);break a}if(a===D){t.tag=14,t=ec(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return lc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Bs(r,t.pendingProps),dc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Na(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),za(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=fc(e,t,r,n);break a}if(r!==a){a=di(Error(i(424)),t),Ii(a),t=fc(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(q=uf(e.firstChild),Ti=t,Ei=!0,Di=null,Oi=!0,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pi(),r===a){t=Cc(e,t,n);break a}Qs(e,t,r,n)}t=t.child}return t;case 26:return cc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ei||(n=t.type,e=t.pendingProps,r=Hd(se.current).createElement(n),r[rt]=t,r[it]=e,Id(r,n,e),gt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return B(t),e===null&&Ei&&(r=t.stateNode=mf(t.type,t.pendingProps,se.current),Ti=t,Oi=!0,a=q,$d(t.type)?(df=a,q=uf(r.firstChild)):q=a),Qs(e,t,t.pendingProps.children,n),cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ei&&((a=r=q)&&(r=rf(r,t.type,t.pendingProps,Oi),r===null?a=!1:(t.stateNode=r,Ti=t,q=uf(r.firstChild),Oi=!1,a=!0)),a||Ai(t)),B(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=go(e,t,yo,null,null,n),ep._currentValue=a),cc(e,t),Qs(e,t,r,n),t.child;case 6:return e===null&&Ei&&((e=n=q)&&(n=af(n,t.pendingProps,Oi),n===null?e=!1:(t.stateNode=n,Ti=t,q=null,e=!0)),e||Ai(t)),null;case 13:return gc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ka(t,null,r,n):Qs(e,t,r,n),t.child;case 11:return $s(e,t,t.type,t.pendingProps,n);case 7:return Qs(e,t,t.pendingProps,n),t.child;case 8:return Qs(e,t,t.pendingProps.children,n),t.child;case 12:return Qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),Qs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,Qs(e,t,r,n),t.child;case 14:return ec(e,t,t.type,t.pendingProps,n);case 15:return tc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return sc(e,t,n);case 22:return nc(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=ua(),a===null&&(a=Il,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ma(t),Bi(t,$i,a)):((e.lanes&n)!==0&&(Na(e,t),Ba(t,null,null,n),za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,$i,r))),Qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw ba=ga,ma}}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t)){if(Tu())e.flags|=8192;else throw ba=ga,ma}}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Xl|=t)}function jc(e,t){if(!Ei)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi($i),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fi())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(ue(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=R.current,Ni(t)?ji(t,e):(e=mf(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(ue(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=R.current,Ni(t))ji(t,o);else{var s=Hd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[rt]=t,o[it]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Ai(t,!0)}else e=Hd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ni(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[rt]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ni(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[rt]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null);case 4:return le(),e===null&&Cd(t.stateNode.containerInfo),Mc(t),null;case 10:return Vi(t.type),Mc(t),null;case 19:if(ie(to),r=t.memoizedState,r===null)return Mc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)jc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return ae(to,to.current&1|2),Ei&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Se()>nu&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ei)return Mc(t),null}else 2*Se()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Se(),e.sibling=null,n=to.current,ae(to,a?n&1|2:n&1),Ei&&xi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ie(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi($i),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi($i),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(to),null;case 4:return le(),null;case 10:return Vi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&ie(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi($i),null;case 25:return null;default:return null}}function Fc(e,t){switch(Ci(t),t.tag){case 3:Vi($i),le();break;case 26:case 27:case 5:ue(t);break;case 4:le();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:ie(to);break;case 10:Vi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&ie(la);break;case 24:Vi($i)}}function Ic(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){Ku(t,t.return,e)}}function Lc(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){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Ku(e,e.return,t)}}}function zc(e,t,n){n.props=Bs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ku(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ku(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){Ku(e,t,n)}else n.current=null}}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ku(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[it]=t}catch(t){Ku(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&$d(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[rt]=e,t[it]=n}catch(t){Ku(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Bd=lp,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Vd={focusedElem:e,selectionRange:n},lp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Bs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Bs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ha(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),lf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,!!(n.subtreeFlags&8772)):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;$d(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),hf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null){if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}}break;case 18:rl!==null&&(il?(e=rl,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):ef(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Ku(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Ku(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if($d(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ut]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[rt]=e,gt(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[rt]=e,gt(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode)}else e.stateNode=Rf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Hf=null,a=fl,fl=vf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Ku(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=vf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=Se()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){Ku(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:hf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Va(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ta(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ku(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(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:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(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:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&qf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=vf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,Ll=null,Rl=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Fl&2&&Rl!==0?Rl&-Rl:F.T===null?et():dd()}function hu(){if(Yl===0){if(!(Rl&536870912)||Ei){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),Yl=e}else Yl=536870912}return e=Ja.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Il&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Rl,Yl,!1)),qe(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(ql|=n),Gl===4&&bu(e,Rl,Yl,!1)),Z(e))}function _u(e,t,n){if(Fl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ue(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}if(n=e.current.alternate,o&&!yu(n)){a=ku(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-Se(),10<a)){if(bu(r,t,Yl,!Vl),He(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Jd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}break}while(1);Z(e)}function vu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Dl(t,a,d);var m=(a&62914560)===a?eu-Se():(a&4194048)===a?tu-Se():0;if(m=Yf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(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(!_r(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 bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function xu(){return Fl&6?!0:(id(0,!1),!1)}function Su(){if(Ll!==null){if(zl===0)var e=Ll.return;else e=Ll,zi=Ri=null,So(e),Ca=null,wa=0,e=Ll;for(;e!==null;)Fc(e.alternate,e),e=e.return;Ll=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Il=e,Ll=n=ri(e.current,null),Rl=t,zl=0,Bl=null,Vl=!1,Hl=Ue(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,qr(),n}function wu(e,t){Y=null,F.H=Ms,t===pa||t===ha?(t=xa(),zl=3):t===ma?(t=xa(),zl=4):zl=t===Xs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,Ll===null&&(Gl=1,Ws(e,di(t,e.current)))}function Tu(){var e=Ja.current;return e===null?!0:(Rl&4194048)===Rl?Ya===null:(Rl&62914560)===Rl||Rl&536870912?e===Ya:!1}function Eu(){var e=F.H;return F.H=Ms,e===null?Ms:e}function Du(){var e=F.A;return F.A=Nl,e}function Ou(){Gl=4,Vl||(Rl&4194048)!==Rl&&Ja.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Il===null||bu(Il,Rl,Yl,!1)}function ku(e,t,n){var r=Fl;Fl|=2;var i=Eu(),a=Du();(Il!==e||Rl!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&Ll!==null){var s=Ll,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Ja.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=Ri=null,Fl=r,F.H=i,F.A=a,Ll===null&&(Il=null,Rl=0,qr()),o}function Au(){for(;Ll!==null;)Nu(Ll)}function ju(e,t){var n=Fl;Fl|=2;var r=Eu(),a=Du();Il!==e||Rl!==t?(ru=null,nu=Se()+500,Cu(e,t)):Hl=Ue(e,t);a:do try{if(zl!==0&&Ll!==null){t=Ll;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(_a(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Il!==e||(zl=7),Z(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:_a(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(Ll.tag){case 26:s=Ll.memoizedState;case 5:case 27:var c=Ll;if(s?Kf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)Ll=l;else{var u=c.return;u===null?Ll=null:(Ll=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return zi=Ri=null,F.H=r,F.A=a,Fl=n,Ll===null?(Il=null,Rl=0,qr(),Gl):0}function Mu(){for(;Ll!==null&&!be();)Nu(Ll)}function Nu(e){var t=Ec(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=uc(n,t,t.pendingProps,t.type,void 0,Rl);break;case 11:t=uc(n,t,t.pendingProps,t.type.render,t.ref,Rl);break;case 5:So(t);default:Fc(n,t),t=Ll=ii(t,Wl),t=Ec(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Fu(e,t,n,r){zi=Ri=null,So(t),Ca=null,wa=0;var i=t.return;try{if(Ys(e,i,t,n,Rl)){Gl=1,Ws(e,di(n,e.current)),Ll=null;return}}catch(t){if(i!==null)throw Ll=i,t;Gl=1,Ws(e,di(n,e.current)),Ll=null;return}t.flags&32768?(Ei||r===1?e=!0:Hl||Rl&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Nc(t.alternate,t,Wl);if(n!==null){Ll=n;return}if(t=t.sibling,t!==null){Ll=t;return}Ll=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Ll=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ll=e;return}Ll=e=n}while(e!==null);Gl=6,Ll=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Fl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Je(e,n,o,s,c,l),e===Il&&(Ll=Il=null,Rl=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Ee,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Fl,Fl|=4;try{el(e,t,n)}finally{Fl=s,I.p=a,F.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Fl;Fl|=4;try{pl(t,e);var a=Vd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&W(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(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 _=br(s,h),v=br(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}}lp=!!Bd,Vd=Bd=null}finally{Fl=i,I.p=r,F.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Fl;Fl|=4;try{tl(e,t.alternate,t)}finally{Fl=i,I.p=r,F.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,xe();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),$e(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}cu&3&&Uu(),Z(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,id(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ta(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=$e(cu),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Fl&6)throw Error(i(331));var c=Fl;if(Fl|=4,Al(o.current),Sl(o,o.current,s,n),Fl=c,id(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{I.p=a,F.T=r,Hu(e,t)}}function Gu(e,t,n){t=di(n,t),t=Ks(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(qe(e,2),Z(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=di(n,e),n=qs(2),r=Fa(t,n,2),r!==null&&(Js(n,r,t,e),qe(r,2),Z(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;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)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Rl&n)===n&&(Gl===4||Gl===3&&(Rl&62914560)===Rl&&300>Se()-eu?!(Fl&2)&&Cu(e,0):Jl|=n,Xl===Rl&&(Xl=0)),Z(e)}function Yu(e,t){t===0&&(t=Ge()),e=Xr(e,t),e!==null&&(qe(e,t),Z(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Yu(e,n)}function Qu(e,t){return ve(e,t)}var $u=null,ed=null,td=!1,nd=!1,X=!1,rd=0;function Z(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,ud())}function id(e,t){if(!X&&nd){X=!0;do for(var n=!1,r=$u;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-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Rl,a=He(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);X=!1}}function ad(){od()}function od(){nd=td=!1;var e=0;rd!==0&&qd()&&(e=rd);for(var t=Se(),n=null,r=$u;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||id(e,!1),rd!==0&&(rd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Rl,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ye(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ye(r),$e(n)){case 2:case 8:n=Te;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=cd.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Rl;return r=He(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),sd(e,Se()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Uu())return null;_u(e,t,!0)}function ud(){Zd(function(){Fl&6?ve(we,ad):od()})}function dd(){if(rd===0){var e=ia;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),rd=e}return rd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[it]||null).action),o=r.submitter;o&&(t=(t=o[it]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(rd!==0){var e=o?pd(i,o):new FormData(i);vs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),vs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Vr.length;hd++){var gd=Vr[hd];Hr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Hr(Nr,`onAnimationEnd`),Hr(Pr,`onAnimationIteration`),Hr(Fr,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Ir,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=!!(t&4);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){Ur(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){Ur(e)}i.currentTarget=null,a=c}}}}function bd(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,_t.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!an||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 Td(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Nr:case Pr:case Fr:l=En;break;case zr:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(Ed(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ft(u)||u[at]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ft(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:mt(l),h=u==null?c:mt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ft(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Od,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&U(c,`number`,c.value)}switch(y=r?mt(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(G=y,wr=r,Tr=null);break;case`focusout`:Tr=wr=G=null;break;case`mousedown`:Er=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Er=!1,Dr(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Dr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Dd(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(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=nn(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=nn(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(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=nn(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
|
|
10
|
-
`).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:bd(`beforetoggle`,e),bd(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Tt(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[it]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:bd(`error`,e),bd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:bd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Pd(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in bd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Pd(e,t,l,r,n,null)}return;case`dialog`:bd(`beforetoggle`,e),bd(`toggle`,e),bd(`cancel`,e),bd(`close`,e);break;case`iframe`:case`object`:bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)bd(_d[r],e);break;case`image`:bd(`error`,e),bd(`load`,e);break;case`details`:bd(`toggle`,e);break;case`embed`:case`source`:case`link`:bd(`error`,e),bd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Pd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}H(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}Rt(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:Pd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Pd(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)&&Pd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(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||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(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||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){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&&Rd(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&&Rd(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 Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(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 Gd(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 Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e!==Kd&&(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ut]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body)}n=i}while(n);Fp(t)}function tf(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 nf(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`:nf(n),dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(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[ut])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=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(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 uf(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 df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(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 mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=I.d;I.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=xu();return e||t}function xf(e){var t=pt(e);t!==null&&t.tag===5&&t.type===`form`?bs(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),gt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),gt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=ht(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);gt(c),Id(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=ht(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=h({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),gt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=ht(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),gt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=se.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=ht(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var o=ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=ht(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+Ft(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),gt(t),e.head.appendChild(t))}function If(e){return`[src="`+Ft(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),gt(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,gt(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,gt(a),a):(r=n,(a=gf.get(o))&&(r=h({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),gt(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[ut]||a[rt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function tp(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=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ma(a),e}function rp(e){return e?(e=$r,e):$r}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Pa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Fa(e,r,t),n!==null&&(gu(n,e,t),Ia(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&gu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=mu();t=Qe(t);var n=Xr(e,t);n!==null&&gu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,fp(e,t,n,r)}finally{I.p=a,F.T=i}}function dp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,fp(e,t,n,r)}finally{I.p=a,F.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Td(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}Z(a),!(Fl&6)&&(nu=Se()+500,id(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&gu(s,a,2),xu(),op(a,2)}if(a=pp(r),a===null&&Td(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function pp(e){return e=Xt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=u(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 mp=e,null}function gp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=pt(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,tt(e.priority,function(){cp(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,tt(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=pt(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=pt(n);a!==null&&(e.splice(t,3),t-=3,vs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[it]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[it]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,mu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),xu(),t[at]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.8`)throw Error(i(527,zp,`19.2.8`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{je=Vp.inject(Bp),Me=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Vs,s=Hs,c=Us;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[at]=t.current,Cd(e),new Lp(t)}})),p=t(((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=f()})),m=s(),h=p(),g=70;function _(e){return e.focusedPane===`sidebar`?`sidebar`:e.hasSelection||e.hasOpenPage?`content`:`sidebar`}function v(e){let t=e,n=new Set;return{get:()=>t,set(e){if(!Object.is(e,t)){t=e;for(let e of n)e()}},subscribe(e){return n.add(e),()=>n.delete(e)}}}function y(e){return(0,m.useSyncExternalStore)(e.subscribe,e.get)}var b=[`orbit`,`comet`,`rings`,`starlings`],x=`rove.web.lastSky`;function S(){try{return sessionStorage.getItem(x)}catch{return null}}var C=S();function w(){let e=b[(b.findIndex(e=>e===C)+1)%b.length];C=e;try{sessionStorage.setItem(x,e)}catch{}return e}function T(e,t){let n=e.filter(e=>e.rare&&!e.children);if(n.length===0)return[...e];let r=e.filter(e=>!n.includes(e)),i={label:t,section:`more`,children:n.map(({section:e,...t})=>t)},a=r.findIndex(e=>e.section===`danger`);return a<0?[...r,i]:[...r.slice(0,a),i,...r.slice(a)]}function E(e,t){for(let n of e){if(n.binding===t)return n;let e=n.children&&E(n.children,t);if(e)return e}}var D=v(null),O=v(null),k=null;O.subscribe(()=>{let e=document.activeElement;if(O.get()!==null){!k&&e instanceof HTMLElement&&!e.closest(`.dialog`)&&(k=e);return}let t=k;k=null,window.setTimeout(()=>{t?.isConnected&&(!document.activeElement||document.activeElement===document.body)&&t.focus()},0)});var A=v([]),j=[`worktrees`,`update`,`kanban`,`routines`,`issues`,`mods`,`compare`,`usage`,`sessions`];function M(e,t){let n=null;try{n=t(JSON.parse(sessionStorage.getItem(e)??`null`))}catch{}let r=v(n);return r.subscribe(()=>{try{let t=r.get();t===null?sessionStorage.removeItem(e):sessionStorage.setItem(e,JSON.stringify(t))}catch{}}),r}var N=M(`rove.web.page`,e=>j.find(t=>t===e)??null),ee=v(null),P=M(`rove.web.compareGroup`,e=>typeof e==`string`?e:null),F=M(`rove.web.sessionsRepo`,e=>typeof e==`string`?e:null),I=v(null),te=`rove.web.newSession`;function ne(){try{let e=JSON.parse(sessionStorage.getItem(te)??`null`);return e&&typeof e==`object`?e:null}catch{return null}}var L=v(ne());L.subscribe(()=>{try{let e=L.get();if(!e)return sessionStorage.removeItem(te);let{prompt:t,...n}=e;sessionStorage.setItem(te,JSON.stringify(n))}catch{}});function re(e,t,n,r,i){ie({...e?{repo:e}:{},...t?{baseBranch:t}:{},...n?{machine:n}:{},...r?{prompt:r}:{},...i?{ungrouped:!0}:{}})}function ie(e){N.set(null),O.set(null),L.set({...e,sky:w()})}function ae(){let e=new URLSearchParams(window.location.search),t=e.get(`prompt`);if(t===null)return;let n=e.get(`repo`)??void 0;e.delete(`prompt`),e.delete(`repo`);let r=e.toString();history.replaceState(null,``,`${window.location.pathname}${r?`?${r}`:``}${window.location.hash}`),re(n,void 0,void 0,t)}var R=1,oe=4e3,se=8e3;function z(e,t=`info`,n,r){let i=R++;A.set([...A.get(),{id:i,text:e,tone:t,...n?{action:n}:{}}].slice(-3)),window.setTimeout(()=>le(i),r??(n?se:oe))}function ce(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}function le(e){if(!A.get().some(t=>t.id===e&&!t.leaving))return;let t=()=>A.set(A.get().filter(t=>t.id!==e));if(ce()){t();return}A.set(A.get().map(t=>t.id===e?{...t,leaving:!0}:t)),window.setTimeout(t,140)}function B(){O.set(null)}var ue=v(null),de=null;function fe(){ue.get()!==`drag`&&(de!==null&&window.clearTimeout(de),ue.set(`slide`),de=window.setTimeout(()=>ue.set(null),240))}function pe(e){de!==null&&window.clearTimeout(de),de=null,ue.set(e?`drag`:null)}var me=`(max-width: ${g*8-1}px)`,he=v(`sidebar`),ge=()=>he.set(`workspace`),_e=()=>he.set(`sidebar`);function V(e){N.set(e),ge()}function ve(e){P.set(e),V(`compare`)}function ye(e){F.set(e),V(`sessions`)}var be,xe=()=>(be??=window.matchMedia(me),be),Se=()=>xe().matches,Ce=e=>{let t=xe();return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)};function we(){return(0,m.useSyncExternalStore)(e=>{let t=xe();return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},()=>xe().matches)}function Te(e,t,n){return _({focusedPane:e,hasSelection:t,hasOpenPage:n})}var Ee=10,De=200,Oe=`input, textarea, select, [contenteditable]`,ke=`[data-back-panel]`,Ae=v(null),je=e=>t=>{if(t)return t.dataset.backPanel=``,t.addEventListener(`backswipe`,e),()=>{delete t.dataset.backPanel,t.removeEventListener(`backswipe`,e)}};function Me(e){return e.closest(ke)||(e.closest(`dialog`)||he.get()!==`workspace`?null:document.querySelector(`.app > main`))}var Ne=(e,t)=>e>0&&e>Math.abs(t),Pe=(e,t,n)=>e>=t/3||e>=40&&n<250;function Fe(e){for(let t=e;t;t=t.parentElement)if(t.scrollWidth>t.clientWidth&&/auto|scroll/.test(getComputedStyle(t).overflowX))return!0;return!1}function Ie(){let e=null,t=(e,t,n)=>{let r=()=>{n?e.matches(ke)?e.dispatchEvent(new Event(`backswipe`)):_e():e.style.removeProperty(`--back-x`),Ae.set(null)},i=n?e.offsetWidth:0;e.style.setProperty(`--back-x`,`${i}px`);let a=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;e.animate({translate:[`${t}px`,`${i}px`]},{duration:a?0:De,easing:`cubic-bezier(0.2, 0, 0, 1)`}).finished.then(r,r)};document.addEventListener(`touchstart`,t=>{let{target:n}=t;if(e=null,Ae.get()||t.touches.length!==1||!Se()||!(n instanceof Element)||n.closest(Oe)||Fe(n))return;let r=Me(n);r&&(e={panel:r,x:t.touches[0].clientX,y:t.touches[0].clientY,at:t.timeStamp,dx:0,on:!1})},{passive:!0}),document.addEventListener(`touchmove`,t=>{if(!e)return;let n=t.touches[0].clientX-e.x;if(!e.on){let r=t.touches[0].clientY-e.y;if(Math.hypot(n,r)<Ee)return;if(t.touches.length!==1||!Ne(n,r)||!document.getSelection()?.isCollapsed){e=null;return}e.on=!0,Ae.set(e.panel.matches(ke)?`panel`:`app`)}t.preventDefault(),t.stopPropagation(),e.dx=Math.max(0,n),e.panel.style.setProperty(`--back-x`,`${e.dx}px`)},{capture:!0,passive:!1});let n=n=>{let r=e;if(e=null,!r?.on)return;let i=n.type===`touchend`&&Pe(r.dx,window.innerWidth,n.timeStamp-r.at);t(r.panel,r.dx,i)};document.addEventListener(`touchend`,n),document.addEventListener(`touchcancel`,n)}var Le=e({en:()=>Re,zh:()=>ze}),Re={artifact:{preview:`preview`,source:`source`,open:`[ open ]`,loading:`Loading…`,tooLarge:`Too large to preview ({size}); the source view reads it as text.`,notPreviewable:`This file cannot be previewed.`,gone:`The file is gone.`,failed:`Could not read the file: {error}`}},ze={artifact:{preview:`预览`,source:`源码`,open:`[ 打开 ]`,loading:`加载中…`,tooLarge:`文件太大,无法预览({size});可在源码视图中按文本查看。`,notPreviewable:`这个文件无法预览。`,gone:`文件已不存在。`,failed:`无法读取文件:{error}`}},Be=e({en:()=>Ve,zh:()=>He}),Ve={compare:{title:`Compare attempts`,menu:`Compare attempts`,severalEngines:`[ compare engines ]`,oneEngine:`[ one engine ]`,needsPrompt:`Compare runs the prompt, so it needs one`,empty:`No attempts left in this round.`,noReply:`no reply yet`,noChanges:`no changes`,status:{working:`working`,waiting:`waiting for you`,error:`needs a look`,done:`done`,idle:`idle`},files:`files: {count}`,attempts:`attempts: {count}`,moreLines:`[ {count} more lines in the diff ]`,kept:`kept`,strip:`[ compare ]`,stackLabel:`Stacked tasks`,landBottom:`[ land bottom ]`,terminal:`[ terminal ]`,diff:`[ diff ]`,keep:`Keep this one`,unkeep:`[ unkeep ]`,keptToast:`kept {title}`,unkeptToast:`no longer kept: {title}`,keepFailed:`could not mark it kept: {error}`,archiveTitle:`Archive the other attempts?`,archiveBody:`Hides the other {count} from the rail and closes their sessions. Their worktrees and branches stay.`,archiveConfirm:`Archive`,archiveBusyTitle:`Some attempts are still working`,archiveBusyBody:`Archive them anyway? They are stopped; their worktrees and branches stay.`,archiveBusyConfirm:`Archive anyway`,archived:`archived {count} attempts`,archiveFailed:`could not archive: {error}`}},He={compare:{title:`对比方案`,menu:`对比方案`,severalEngines:`[ 多引擎对比 ]`,oneEngine:`[ 单引擎 ]`,needsPrompt:`对比要运行提示词,请先写一个`,empty:`这一轮没有剩下的方案。`,noReply:`还没有回复`,noChanges:`没有改动`,status:{working:`运行中`,waiting:`等你处理`,error:`需要看一眼`,done:`已完成`,idle:`空闲`},files:`文件:{count}`,attempts:`方案:{count}`,moreLines:`[ diff 里还有 {count} 行 ]`,kept:`已保留`,strip:`[ 对比 ]`,stackLabel:`堆叠任务`,landBottom:`[ 合并底部 ]`,terminal:`[ 终端 ]`,diff:`[ diff ]`,keep:`保留这个`,unkeep:`[ 取消保留 ]`,keptToast:`已保留 {title}`,unkeptToast:`已取消保留:{title}`,keepFailed:`无法标记保留:{error}`,archiveTitle:`归档其他方案?`,archiveBody:`把其余 {count} 个从侧栏收起,并结束它们的会话。worktree 和分支都保留。`,archiveConfirm:`归档`,archiveBusyTitle:`有方案还在运行`,archiveBusyBody:`仍要归档吗?它们会被停掉,worktree 和分支都保留。`,archiveBusyConfirm:`仍然归档`,archived:`已归档 {count} 个方案`,archiveFailed:`无法归档:{error}`}},Ue=e({en:()=>We,zh:()=>Ge}),We={context:{used:`{percent} used`,usedTokens:`{tokens} used`,loading:`Reading context…`,none:`No context reading for this conversation: its engine records none, or it has not answered yet.`,failed:`Couldn't read context: {error}`,probing:`Reading what fills it…`,more:`+{count} more`,part:{system:`System prompt & tools`,system_prompt:`System prompt`,system_tools:`System tools`,mcp_tools:`MCP tools`,mcp_instructions:`MCP server instructions`,mcp_tools_deferred:`MCP tools (deferred)`,system_tools_deferred:`System tools (deferred)`,custom_agents:`Custom agents`,memory_files:`Memory files`,skills:`Skills`,messages:`Messages`,used:`Used`,free:`Free space`}}},Ge={context:{used:`已用 {percent}`,usedTokens:`已用 {tokens}`,loading:`正在读取上下文…`,none:`这个会话没有上下文读数:它的引擎不记录,或者还没回复过。`,failed:`读取上下文失败:{error}`,probing:`正在读取构成…`,more:`另有 {count} 项`,part:{system:`系统提示与工具`,system_prompt:`系统提示`,system_tools:`系统工具`,mcp_tools:`MCP 工具`,mcp_instructions:`MCP 服务器说明`,mcp_tools_deferred:`MCP 工具(按需加载)`,system_tools_deferred:`系统工具(按需加载)`,custom_agents:`自定义 agent`,memory_files:`记忆文件`,skills:`技能`,messages:`消息`,used:`已用`,free:`剩余空间`}}},Ke=e({en:()=>qe,zh:()=>Je}),qe={dialog:{cancel:`cancel`,save:`save`,close:`close`},crash:{title:`This page hit an error. Copy the report below before reloading.`,copy:`Copy report`,copied:`Copied`,reload:`Reload`},updatePrompt:{title:`Rove {version} is available`,body:`This computer runs {current}. Update installs the new version on it.`,yes:`Update`,later:`Not now`,skip:`Skip this version`},whatsNew:{continue:`Continue`,openRelease:`Open release notes`,keys:`q / esc`},menu:{closeTab:`Close tab`,newChat:`New conversation`,newChatPick:`New conversation with…`,retryEdit:`Retry with edited prompt…`,retryNoPrompt:`This task has no stored prompt`,startNow:`Start now`,cancelStart:`Cancel scheduled start`,continueEngine:`Continue in another engine…`,newShell:`New shell`,newChatNoFolder:`New conversation (no folder)`,renameTab:`Rename tab`,splitRight:`Split right`,splitDown:`Split down`,renamePane:`Rename pane`,closePane:`Close pane`,newTask:`New task`,rename:`Rename`,pin:`Pin`,unpin:`Unpin`,setStatus:`Set status`,copy:`Copy`,copyWhat:{id:`Task ID`,branch:`Branch name`,path:`Worktree path`},renameBranch:`Rename branch`,changeEngine:`Change engine`,land:`Land into base branch`,delete:`Delete`,removeSession:`Remove session`,viewSessions:`View all sessions`,more:`More`,copied:`copied {text}`,copyFailed:`the browser refused the clipboard`,nothingToCopy:`this task has no {what} yet`,what:{id:`id`,branch:`branch`,path:`worktree path`}},confirm:{closeTabTitle:`Close "{tab}"?`,closeTabBody:`Stops the session in this tab. The task and its worktree stay.`,closePaneTitle:`Close "{pane}"?`,closePaneBody:`The engine session in this pane ends. The tab's other panes stay.`,delete:`delete`,forceDelete:`force delete`},newTask:{title:`new task`,repo:`project`,engine:`engine`,notReady:`not installed or not signed in`,taskTitle:`title`,titlePlaceholder:`optional; derived from the prompt otherwise`,prompt:`first message`,promptPlaceholder:`optional; ⌘↵ creates`,create:`create`,needRepo:`pick a project first`},newChat:{title:`new conversation`,prompt:`first message`,start:`start`,promptPlaceholder:`optional; empty opens the engine without a message`},newSession:{title:`New session`,tagline:`Pick a project and a model, then describe the task. The session starts with your first message.`,placeholder:`Describe a task or ask a question`,start:`Start session`,later:`Later…`,laterConfirm:`Start later`,laterPlaceholder:`22:30 · tomorrow 9:00 · +30m`,laterBad:`That is not a time ahead. Try 22:30, tomorrow 9:00 or +2h.`,laterSet:`Starts at {time}. Until then it waits under Routines, where you can cancel it.`,retryArchiveTitle:`Archive "{title}"?`,retryArchiveBody:`The retry has started. Archive the original? Its session is closed; nothing is deleted.`,needRepo:`Pick a project first`,needPrompt:`Describe the task first`,repo:`Project`,repoSearch:`Search projects or type a path`,repoMultiHint:`Shift-click adds another`,repoEmpty:`No matching project`,noFolder:`No folder`,cloneRow:`Clone {source}`,cloning:`Cloning {source}`,githubGroup:`Your GitHub repositories`,branch:`Branch`,branchSearch:`Search branches`,branches:`Branches`,branchName:`Branch name, shared by every repo`,branchNamePlaceholder:`derived from the prompt`,primary:`primary`,repoCount:`{count} repos: the first is the primary`,branchEmpty:`No matching branch`,model:`Model`,modelHeading:`Model for this session`,engine:`Engine`,shell:`Shell`,shellPlaceholder:`A command to run first, or leave empty for a plain terminal`,shellOneLine:`A shell command is one line`,modelDefault:`Default`,more:`More`,attach:`Attach`,attachHint:`Add files to the first message; you can also paste or drop them on the prompt`,removeAttachment:`Remove {name}`,worktree:`Worktree`,worktreeOn:`Runs in its own worktree and branch. Click to run in the project's checkout instead`,worktreeOff:`Runs in the project's checkout as it is, on its current branch. Click for a worktree`,worktreeMulti:`A task across several repos always gets a worktree in each`,worktreeNoGit:`Not a git repository: the session runs in the folder itself`,worktreeRemoteRequired:`An agent running on that machine, or a repo it still has to clone, always gets a worktree`,plainMulti:`A folder without git can't join a task across several repos`,machine:`Machine`,thisMachine:`This machine`,machineAuto:`Auto`,machineAutoNote:`Starts on the least busy machine that has this project.`,startedOn:`Started on {machine}`,retry:`Retry`,agentPlace:`Agent runs on`,agentHereNote:`Uses this machine's engines and sign-in. Only the files and commands are on {machine}.`,agentThereNote:`The engine runs on {machine}, so it must be installed and signed in there.`,cloneRowOn:`Clone {source} on {machine}`,cloningOn:`Cloning {source} on {machine}`,startingOn:`Starting the task on {machine}`,engineMissing:`{engine} · not installed`,engineMissingOn:`{engine} is not installed on {machine}. Install it there, or pick another engine.`,repoSearchRemote:`Search or type owner/repo`,remoteOffline:`{machine} is offline`,remoteOutdated:`{machine} runs a Rove too old to list its projects`,remoteFailed:`Could not read {machine}'s projects: {message}`,remoteNone:`{machine} has no projects yet. Type owner/repo to clone one there`,remoteLoading:`Reading {machine}'s projects…`,branchTypeRef:`Type a branch or ref to start from`,branchRemoteDefault:`Its current branch`},sessions:{title:`Sessions`,active:`Active`,archived:`Archived`,allProjects:`all projects`,emptyActive:`No sessions here. Start one from New task.`,emptyArchived:`Nothing archived here. Archive a session from its row menu.`,keys:`tab project · a archived · enter open · q close`},search:{tasks:`Tasks`,archived:`{repo} · archived, pick to unarchive`,commands:`Commands`,inConversations:`In conversations`,searching:`searching…`,none:`Nothing said matches “{query}”.`,you:`you`,agent:`agent`,truncated:`Stopped early to stay fast; add a word to narrow it.`,skipped:`{count} task(s) not searched: another machine's, or an engine Rove cannot read.`},taskops:{publishTitle:`publish to the remote`,publishBody:`{branch} lives on {host}. Push it from there and open a pull request?`,publishButton:`push & open PR`,publishedPr:`pushed {branch} — PR {url}`,publishedNoPr:`pushed {branch}, but no PR: {reason}`,set:`set`,retire:`delete`,close:`close`,moveHint:`j/k move · enter or esc done`,fixSent:`asked the agent to fix the failing checks`,forkNeedsMessage:`a message is required to fork a task`,forkLeftBehind:`Started from the last commit — uncommitted work stays in the original task ({reason})`,forkBranch:`fork from branch`,openedExternal:`opened in the Mac's app`}},Je={dialog:{cancel:`取消`,save:`保存`,close:`关闭`},crash:{title:`页面出错了。刷新前先把下面的报告复制下来。`,copy:`复制报告`,copied:`已复制`,reload:`刷新`},updatePrompt:{title:`Rove {version} 可以更新了`,body:`这台电脑运行的是 {current}。点更新会在它上面安装新版本。`,yes:`更新`,later:`暂不`,skip:`跳过这个版本`},whatsNew:{continue:`继续`,openRelease:`打开发布说明`,keys:`q / esc`},menu:{closeTab:`关闭该标签页`,newChat:`新建会话`,newChatPick:`选择引擎新建会话…`,retryEdit:`改提示词后重试…`,retryNoPrompt:`这个任务没有保存的提示词`,startNow:`立即启动`,cancelStart:`取消定时启动`,continueEngine:`换个引擎继续…`,newShell:`新建终端`,newChatNoFolder:`新建会话(无文件夹)`,renameTab:`重命名标签页`,splitRight:`向右分屏`,splitDown:`向下分屏`,renamePane:`重命名分屏`,closePane:`关闭分屏`,newTask:`新建任务`,rename:`重命名`,pin:`置顶`,unpin:`取消置顶`,setStatus:`设置状态`,copy:`复制`,copyWhat:{id:`任务 ID`,branch:`分支名`,path:`worktree 路径`},renameBranch:`重命名分支`,changeEngine:`切换引擎`,land:`合入基础分支`,delete:`删除`,removeSession:`移除会话`,viewSessions:`查看全部会话`,more:`更多`,copied:`已复制 {text}`,copyFailed:`浏览器拒绝了剪贴板访问`,nothingToCopy:`这个任务还没有{what}`,what:{id:`ID`,branch:`分支`,path:`worktree 路径`}},confirm:{closeTabTitle:`关闭「{tab}」?`,closeTabBody:`停止这个标签里的会话。任务和它的 worktree 会保留。`,closePaneTitle:`关闭「{pane}」?`,closePaneBody:`这个分屏里的引擎会话会结束。标签里的其他分屏会保留。`,delete:`删除`,forceDelete:`强制删除`},newTask:{title:`新建任务`,repo:`项目`,engine:`引擎`,notReady:`未安装或未登录`,taskTitle:`标题`,titlePlaceholder:`可选;不填就从第一条消息生成`,prompt:`第一条消息`,promptPlaceholder:`可选;⌘↵ 创建`,create:`创建`,needRepo:`先选一个项目`},newChat:{title:`新建会话`,prompt:`第一条消息`,start:`开始`,promptPlaceholder:`可选;留空则直接打开引擎,不发消息`},newSession:{title:`新会话`,tagline:`选好项目和模型,再描述任务。会话从你的第一条消息开始。`,placeholder:`描述一个任务,或提个问题`,start:`开始会话`,later:`稍后…`,laterConfirm:`稍后启动`,laterPlaceholder:`22:30 · 明天 9:00 · +30m`,laterBad:`这不是一个未来的时间。试试 22:30、明天 9:00 或 +2h。`,laterSet:`{time} 启动。在那之前它列在「例行任务」里,可以在那里取消。`,retryArchiveTitle:`归档「{title}」?`,retryArchiveBody:`重试已经开始。要把原来的会话归档吗?它的进程会结束,不会删除任何东西。`,needRepo:`先选一个项目`,needPrompt:`先描述一下任务`,repo:`项目`,repoSearch:`搜索项目,或输入路径`,repoMultiHint:`按住 Shift 点击可多选`,repoEmpty:`没有匹配的项目`,noFolder:`无文件夹`,cloneRow:`克隆 {source}`,cloning:`正在克隆 {source}`,githubGroup:`你的 GitHub 仓库`,branch:`分支`,branchSearch:`搜索分支`,branches:`分支`,branchName:`分支名,所有仓库共用`,branchNamePlaceholder:`不填就从提示词生成`,primary:`主仓库`,repoCount:`{count} 个仓库,第一个是主仓库`,branchEmpty:`没有匹配的分支`,model:`模型`,modelHeading:`本次会话的模型`,engine:`引擎`,shell:`Shell`,shellPlaceholder:`先运行的命令,留空就只开一个终端`,shellOneLine:`Shell 命令只能写一行`,modelDefault:`默认`,more:`更多`,attach:`附件`,attachHint:`给第一条消息加文件;也可以直接粘贴或拖到输入框里`,removeAttachment:`移除 {name}`,worktree:`Worktree`,worktreeOn:`在独立的 worktree 和分支里运行。点击改为直接在项目目录里运行`,worktreeOff:`直接在项目目录里运行,用它当前的分支。点击改为独立 worktree`,worktreeMulti:`跨多个仓库的任务每个仓库都会有 worktree`,worktreeNoGit:`不是 git 仓库:会话直接在这个文件夹里运行`,worktreeRemoteRequired:`agent 跑在那台机器上,或仓库还要先克隆时,总会建 worktree`,plainMulti:`没有 git 的文件夹不能加入跨多个仓库的任务`,machine:`机器`,thisMachine:`本机`,machineAuto:`自动`,machineAutoNote:`在有这个项目、且最空闲的机器上启动。`,startedOn:`已在 {machine} 上启动`,retry:`重试`,agentPlace:`agent 运行在`,agentHereNote:`用本机的引擎和登录,只有文件和命令在 {machine} 上。`,agentThereNote:`引擎在 {machine} 上运行,那边要装好并登录。`,cloneRowOn:`在 {machine} 上克隆 {source}`,cloningOn:`正在 {machine} 上克隆 {source}`,startingOn:`正在 {machine} 上启动任务`,engineMissing:`{engine} · 未安装`,engineMissingOn:`{machine} 上没有安装 {engine}。在那台机器上装好,或者换一个引擎。`,repoSearchRemote:`搜索,或输入 owner/repo`,remoteOffline:`{machine} 已离线`,remoteOutdated:`{machine} 上的 Rove 太旧,列不出它的项目`,remoteFailed:`读不到 {machine} 上的项目:{message}`,remoteNone:`{machine} 上还没有项目。输入 owner/repo 就能在那里克隆`,remoteLoading:`正在读取 {machine} 上的项目…`,branchTypeRef:`输入要基于的分支或 ref`,branchRemoteDefault:`它当前的分支`},sessions:{title:`会话`,active:`进行中`,archived:`已归档`,allProjects:`全部项目`,emptyActive:`这里还没有会话。从「新建任务」开始一个。`,emptyArchived:`这里没有已归档的会话。在会话的右键菜单里归档。`,keys:`tab 切换项目 · a 已归档 · enter 打开 · q 关闭`},search:{tasks:`任务`,archived:`{repo} · 已归档,选中即恢复`,commands:`命令`,inConversations:`在对话里`,searching:`搜索中…`,none:`没有说过「{query}」。`,you:`你`,agent:`agent`,truncated:`为了快提前停了;多加一个词缩小范围。`,skipped:`有 {count} 个任务没搜:在别的机器上,或 Rove 读不了它的引擎记录。`},taskops:{publishTitle:`推送到远端`,publishBody:`{branch} 在 {host} 上。要从那台机器推送它并开一个 PR 吗?`,publishButton:`推送并开 PR`,publishedPr:`已推送 {branch} — PR {url}`,publishedNoPr:`已推送 {branch},但没开成 PR:{reason}`,set:`设置`,retire:`删除`,close:`关闭`,moveHint:`j/k 移动 · enter 或 esc 完成`,fixSent:`已请 agent 修复失败的检查`,forkNeedsMessage:`fork 任务需要填写消息`,forkLeftBehind:`已从最近一次提交开始——未提交的改动留在原任务里({reason})`,forkBranch:`基于分支`,openedExternal:`已在 Mac 上用系统应用打开`}},Ye=e({en:()=>Xe,zh:()=>Ze}),Xe={machines:{title:`Machines`,open:`[ machines ]`,none:"No other machines registered. Add one with `rove machine add`.",newHere:`[ new task here ]`,tasks:`[ tasks ]`,repos:`[ repos ]`,hide:`[ hide ]`,noTasks:`no tasks`,noRepos:`no repos`,loading:`…`,reposFailed:`couldn't read its repos: {message}`,update:`[ update rove ]`,updating:`updating… this can take a few minutes`,updated:`updated: v{from} → v{to}`,upToDate:`already on the newest build of this machine's channel (v{to})`,updateFailed:`couldn't update it: {message}`,reason:{refused:`ssh was refused (nothing is listening or a firewall is in the way)`,timeout:`ssh timed out`,"host-key-changed":`its ssh host key changed; check it, then update known_hosts`,"host-key-unverified":`its ssh host key is not known yet; connect once by hand to trust it`,"auth-denied":`ssh refused the login (no key or password accepted)`,unresolved:`its hostname does not resolve`,"ssh-failed":`ssh failed`,"no-rove":`rove is not installed there`,"no-daemon":`its rove daemon is not running`,"bad-status":`it answered with something rove could not read`,handshake:`the link came up but the handshake failed`,"no-forwarding":`ssh forwarding is disabled there`,lost:`the link dropped; reconnecting`}}},Ze={machines:{title:`机器`,open:`[ 机器 ]`,none:"没有注册其他机器。用 `rove machine add` 添加。",newHere:`[ 在这台新建任务 ]`,tasks:`[ 任务 ]`,repos:`[ 仓库 ]`,hide:`[ 收起 ]`,noTasks:`没有任务`,noRepos:`没有仓库`,loading:`…`,reposFailed:`读不到它的仓库:{message}`,update:`[ 更新 rove ]`,updating:`正在更新…可能要几分钟`,updated:`已更新:v{from} → v{to}`,upToDate:`已经是这台机器所在通道的最新版(v{to})`,updateFailed:`更新失败:{message}`,reason:{refused:`ssh 被拒绝(没有进程在监听,或被防火墙挡住)`,timeout:`ssh 超时`,"host-key-changed":`它的 ssh 主机密钥变了;确认无误后更新 known_hosts`,"host-key-unverified":`还不认识它的 ssh 主机密钥;先手动连一次以信任它`,"auth-denied":`ssh 拒绝了登录(没有被接受的密钥或密码)`,unresolved:`它的主机名解析不了`,"ssh-failed":`ssh 失败`,"no-rove":`那里没有安装 rove`,"no-daemon":`它的 rove 守护进程没在运行`,"bad-status":`它返回了 rove 读不懂的内容`,handshake:`链路通了但握手失败`,"no-forwarding":`那里禁用了 ssh 端口转发`,lost:`链路断了;正在重连`}}},Qe=e({en:()=>$e,zh:()=>et}),$e={files:{autoFix:{on:`[ auto-fix CI ]`,off:`[ turn off ]`,count:`auto-fix {n}/{max}`,stopped:`auto-fix stopped {n}/{max}`,hint:`When checks fail on a new push and the agent is idle, send it the failing logs. At most once per push, 3 times in all, then it stops and tells your Inbox.`},stripCreate:`[ create PR ]`,stripFixCi:`[ fix CI ]`,stripConflicts:`[ resolve conflicts ]`,stripComments:`[ address comments ]`,stripArchive:`[ archive ]`,stripFilled:`prompt is in the input; edit it and press Enter`,stripNoEngine:`No engine session open in this task — nowhere to put the prompt.`,stripUnavailable:`couldn't read the PR's checks: {detail}`,stripNothing:`nothing to ask the agent about right now`,openPort:`[ open :{port} ]`,checks:{title:`checks`,summary:`{pass}/{total} passed`,failed:`{count} failed`,running:`{count} running`,none:`no checks`,refresh:`[ refresh ]`,loading:`…`,unavailable:`couldn't read the PR: {detail}`,log:`[ log ]`,hideLog:`[ hide ]`,noLog:`no log excerpt for this job`,logUnavailable:`couldn't read the log: {detail}`,more:`{count} more not shown`,took:`{duration}`,tookAgo:`{duration} · {age} ago`,finishedAgo:`{age} ago`,runningFor:`running {elapsed}`},merge:{draft:`draft`,conflicts:`conflicts`,behind:`behind base`,unstable:`checks not passing`,blocked:`blocked`,clean:`mergeable`,approved:`approved`,changes:`changes requested`,reviewRequired:`review required`},stripCommit:`[ commit ]`,prRequested:`asked the agent to create the PR`,remoteNoExternal:`this file is on {host}; open it there`,mentionNoEngine:`No engine session open in this task — nothing to mention into.`,menu:{attach:`Attach as context`,diff:`Open diff`,copy:`Copy`,copyRelative:`Relative path`,copyAbsolute:`Absolute path`,copyName:`Filename`,openExternal:`Open in the Mac's app`,reveal:`Show in Finder`,terminal:`Open in terminal`},landTodos:`{count} todo(s) on this task are still unchecked.`,emptyAll:`(empty worktree)`,state:{conflict:`conflict`,deleted:`deleted`,modified:`modified`,untracked:`untracked`,added:`added`,renamed:`renamed`}},preview:{loading:`loading…`,whole:`whole worktree`,unknown:`nothing to show`,binary:`binary file — not shown as text`,empty:`no changes`,noHunks:`no text changes ({kind})`,modeFile:`[ file ]`,modeDiff:`[ diff ]`,askInChat:`ask in chat`,askInChatHint:`Put the selected lines in the engine's prompt`,sent:`sent {count} notes to the engine`,notSent:`notes not sent: {reason}`},review:{comment:`comment`,range:`range`,count:`{count} comments`,countOne:`1 comment`,send:`send {count}`,sending:`sending…`,edit:`edit`,drop:`drop`,moved:`moved`,movedHint:`The code under this comment changed since it was written.`,show:`Show in the diff`,noteOn:`note on {location}`,noteEditOn:`edit note on {location}`,noteAdd:`[ add note ]`,noteSave:`[ save note ]`,noteCancel:`[ cancel ]`,fold:`Fold {path}`,unfold:`Unfold {path}`,foldAll:`fold all`,unfoldAll:`unfold all`,ignoreWs:`[ ws ]`,ignoreWsHint:`Hide whitespace-only changes (git diff -w)`,viewed:`[ viewed ]`,markViewed:`Mark {path} viewed`,viewedOn:`[x] viewed`,unmarkViewed:`Unmark {path} viewed`,totals:`{files} files · +{added} −{removed}`,viewedCount:`{done}/{files} viewed`,nextFile:`[ next file ]`,nextComment:`[ next comment ]`,scopeMenu:`{base} → {scope} ▾`,compareAgainst:`Compare against {base}…`,baseDefault:`task base`,baseBranch:`branch`,baseRemote:`remote`,baseTag:`tag`,basePlaceholder:`branch, tag or commit`,shape:{effort:`effort {n}/5`,lockfile:`{count} lockfile`,lockfiles:`{count} lockfiles`,generated:`{count} generated`,tests:`{count} tests`,config:`{count} config`,docs:`{count} docs`,source:`{count} source`},scopeWorking:`Uncommitted changes`,scopeBranch:`Committed changes`,scopeTask:`All changes`,lineClipped:`… {count} more characters`,notSupported:`This bridge is older than the page and can't do that; restart it.`},panel:{tabs:`Browser tabs`,files:`Files`,chat:`Chat`,diff:`Diff`,browser:`Browser`,quota:`Context`,resize:`Drag to resize the panel, double-click to reset`,new:`New tab`,close:`Close`,expand:`Expand the side panel`,restore:`Restore the side panel size`,closeOthers:`Close others`,resizeSplit:`Drag to resize, double-click to split evenly`},browser:{address:`Address`,placeholder:`https://… or localhost:3000`,back:`Back`,forward:`Forward`,reload:`Reload`,openTab:`Open in a new tab`,invalid:`That is not a web address; only http and https pages open here.`,outside:`Only files inside this task's directory open here.`,empty:`Enter a web address, or a local dev server.`,emptyPorts:`Enter a web address. A dev server started in this task is listed here.`,noFrame:`Only https pages open here; this address uses plain http. Use ↗ to open it in a new tab.`,self:`That address is Rove itself, which can't be framed. Use ↗ to open it in a new tab.`,refuses:`{host} doesn't allow being shown inside another page.`,unreachable:`{host} can't be reached from here.`,remote:`{host} runs on the Rove machine, not on this one.`,annotate:`Mark up this page`,pen:`Pen`,box:`Box`,text:`Text`,undo:`Undo the last mark`,addToChat:`Add to chat`,annotateDone:`Stop marking`,noEngine:`Open an agent session in this task first; the picture goes into its prompt.`,captureFailed:`Couldn't take a picture of the page: {error}`}},et={files:{autoFix:{on:`[ 自动修复 CI ]`,off:`[ 关闭 ]`,count:`自动修复 {n}/{max}`,stopped:`自动修复已停止 {n}/{max}`,hint:`检查在新提交上失败且代理空闲时,自动把失败日志发给它。每次提交最多一次、总共 3 次,之后停止并通知收件箱。`},stripCreate:`[ 创建 PR ]`,stripFixCi:`[ 修复 CI ]`,stripConflicts:`[ 解决冲突 ]`,stripComments:`[ 处理评论 ]`,stripArchive:`[ 归档 ]`,stripFilled:`提示词已放进输入框,修改后按 Enter 发送`,stripNoEngine:`这个任务没有打开的引擎会话,提示词无处可放。`,stripUnavailable:`读不到 PR 的检查结果:{detail}`,stripNothing:`现在没有需要让代理处理的事`,openPort:`[ 打开 :{port} ]`,checks:{title:`检查`,summary:`{pass}/{total} 通过`,failed:`{count} 个失败`,running:`{count} 个进行中`,none:`没有检查`,refresh:`[ 刷新 ]`,loading:`…`,unavailable:`读不到这个 PR:{detail}`,log:`[ 日志 ]`,hideLog:`[ 收起 ]`,noLog:`这个作业没有日志摘录`,logUnavailable:`读不到日志:{detail}`,more:`还有 {count} 个未显示`,took:`{duration}`,tookAgo:`{duration} · {age}前`,finishedAgo:`{age}前`,runningFor:`已运行 {elapsed}`},merge:{draft:`草稿`,conflicts:`有冲突`,behind:`落后于基线`,unstable:`检查未通过`,blocked:`被阻塞`,clean:`可合并`,approved:`已批准`,changes:`要求修改`,reviewRequired:`需要评审`},stripCommit:`[ 提交 ]`,prRequested:`已让代理去创建 PR`,remoteNoExternal:`这个文件在 {host} 上,请到那台机器上打开`,mentionNoEngine:`这个任务没有打开的引擎会话——没有地方可以提及。`,menu:{attach:`作为上下文附加`,diff:`打开 diff`,copy:`复制`,copyRelative:`相对路径`,copyAbsolute:`绝对路径`,copyName:`文件名`,openExternal:`用 Mac 上的应用打开`,reveal:`在 Finder 中显示`,terminal:`在终端中打开`},landTodos:`此任务还有 {count} 条待办未完成。`,emptyAll:`(空工作区)`,state:{conflict:`有冲突`,deleted:`已删除`,modified:`已修改`,untracked:`未跟踪`,added:`已新增`,renamed:`已重命名`}},preview:{loading:`加载中…`,whole:`整个工作区`,unknown:`没有可显示的内容`,binary:`二进制文件——不以文本显示`,empty:`没有变更`,noHunks:`没有文本变更({kind})`,modeFile:`[ 文件 ]`,modeDiff:`[ 差异 ]`,askInChat:`在对话里问`,askInChatHint:`把选中的几行放进引擎的输入框`,sent:`已把 {count} 条批注发给引擎`,notSent:`批注没有发出:{reason}`},review:{comment:`批注`,range:`选范围`,count:`{count} 条批注`,countOne:`1 条批注`,send:`发送 {count} 条`,sending:`发送中…`,edit:`编辑`,drop:`删除`,moved:`已移位`,movedHint:`这条批注下面的代码在写下之后变了。`,show:`在差异里定位`,noteOn:`批注 {location}`,noteEditOn:`编辑批注 {location}`,noteAdd:`[ 添加批注 ]`,noteSave:`[ 保存批注 ]`,noteCancel:`[ 取消 ]`,fold:`折叠 {path}`,unfold:`展开 {path}`,foldAll:`全部折叠`,unfoldAll:`全部展开`,ignoreWs:`[ ws ]`,ignoreWsHint:`隐藏仅空白的改动 (git diff -w)`,viewed:`[ 已看 ]`,markViewed:`标记 {path} 为已看`,viewedOn:`[x] 已看`,unmarkViewed:`取消 {path} 的已看`,totals:`{files} 个文件 · +{added} −{removed}`,viewedCount:`已看 {done}/{files}`,nextFile:`[ 下个文件 ]`,nextComment:`[ 下条评论 ]`,scopeMenu:`{base} → {scope} ▾`,compareAgainst:`对比基准:{base}…`,baseDefault:`任务基准`,baseBranch:`分支`,baseRemote:`远程`,baseTag:`标签`,basePlaceholder:`分支、标签或提交`,shape:{effort:`评审量 {n}/5`,lockfile:`{count} 个锁文件`,lockfiles:`{count} 个锁文件`,generated:`{count} 个生成文件`,tests:`{count} 个测试`,config:`{count} 个配置`,docs:`{count} 个文档`,source:`{count} 个源码`},scopeWorking:`未提交的改动`,scopeBranch:`已提交的改动`,scopeTask:`全部改动`,lineClipped:`…还有 {count} 个字符`,notSupported:`这个 bridge 比页面旧,做不了这个;请重启它。`},panel:{tabs:`浏览器标签页`,files:`文件`,chat:`对话`,diff:`差异`,browser:`浏览器`,quota:`上下文`,resize:`拖动调整侧边栏宽度,双击复位`,new:`新建标签页`,close:`关闭`,expand:`展开侧边栏`,restore:`还原侧边栏大小`,closeOthers:`关闭其他`,resizeSplit:`拖动调整宽度,双击恢复均分`},browser:{address:`地址`,placeholder:`https://… 或 localhost:3000`,back:`后退`,forward:`前进`,reload:`刷新`,openTab:`在新标签页打开`,invalid:`这不是网页地址;这里只能打开 http 和 https 页面。`,outside:`这里只能打开这个任务目录里的文件。`,empty:`输入网页地址,或本地开发服务器的地址。`,emptyPorts:`输入网页地址。在这个任务里启动的开发服务器会列在这里。`,noFrame:`这里只能打开 https 页面;这个地址用的是 http。点 ↗ 在新标签页打开。`,self:`这个地址就是 Rove 本身,不能嵌入。点 ↗ 在新标签页打开。`,refuses:`{host} 不允许嵌入其他页面。`,unreachable:`从这里访问不到 {host}。`,remote:`{host} 运行在 Rove 所在的机器上,不在这台设备上。`,annotate:`在页面上标注`,pen:`画笔`,box:`方框`,text:`文字`,undo:`撤销上一笔`,addToChat:`加到对话`,annotateDone:`结束标注`,noEngine:`先在这个任务里打开一个 agent 会话;截图会进它的输入框。`,captureFailed:`没能截下这个页面:{error}`}},tt=e({en:()=>nt,zh:()=>rt}),nt={quote:{action:`[ quote ]`,title:`Put the selection in the prompt as a quote`,atMenu:`The agent is waiting on a choice. Answer it first, then quote.`,notReady:`The agent's prompt is not taking pasted text yet. Try again in a moment.`},snippets:{empty:`No snippets yet.`,name:`Name`,namePlaceholder:`review`,text:`Text`,textPlaceholder:`Review this change for bugs and missing tests.`,add:`[ add ]`,save:`[ save ]`,edit:`[ edit ]`,cancel:`[ cancel ]`,remove:`[ remove ]`,removed:`Removed @{name}`,badName:`A name is letters, digits, - or _, up to 32.`}},rt={quote:{action:`[ 引用 ]`,title:`把选中的内容作为引用放进提示词`,atMenu:`agent 正在等你做选择。先回答它,再引用。`,notReady:`agent 的输入框暂时还不接受粘贴。稍等一下再试。`},snippets:{empty:`还没有片段。`,name:`名称`,namePlaceholder:`review`,text:`内容`,textPlaceholder:`检查这次改动有没有 bug,有没有漏掉的测试。`,add:`[ 添加 ]`,save:`[ 保存 ]`,edit:`[ 编辑 ]`,cancel:`[ 取消 ]`,remove:`[ 删除 ]`,removed:`已删除 @{name}`,badName:`名称只能是字母、数字、- 或 _,最长 32 位。`}},it=e({en:()=>at,zh:()=>ot}),at={rail:{markNotice:`Task rows now start with the engine's icon. Change it in Settings → Appearance.`,markNoticeUndo:`Old look`,inbox:`inbox {count}`,empty:`no tasks yet`,skillCue:`skill missing`,newTask:`New task`,update:`Update`,settings:`Settings`,noProject:`Ungrouped`,expandGroup:`Expand {name}`,collapseGroup:`Collapse {name}`,state:{needs:`needs you`,working:`working`,ready:`ready`,idle:`idle`},extraRepos:`{count} more repos in this task`,todos:`{done} of {total} todos done`,startsAt:`Starts {time}`,pr:{state:{open:`open`,merged:`merged`,closed:`closed`},many:`{count} PRs in this task and its children`,checks:{conflict:`conflicts with its base`,failing:`checks failing`,passing:`checks passing`,pending:`checks running`}},searchPlaceholder:`fuzzy filter`,engineSwitched:`Engine → {engine} (applies on reopen)`,engineSwitchFailed:`could not switch engine: {error}`},inbox:{title:`inbox`,hints:`↑↓ move · enter open · d ack · esc close`,ackAll:`[ ack all ]`,attention:`attention`,recent:`recent`,empty:`no pending attention`,reply:`[ reply ]`,hide:`[ hide ]`,send:`[ send ]`,openTab:`[ open ]`,noOutput:`no output yet`,replyPlaceholder:`reply to this session`,gateKept:`Saved; the engine isn't running and will get it with its next message.`,state:{done:`done`,needsInput:`needs input`,error:`error`,rateLimited:`rate limited`,dead:`engine exited`,restored:`restored after restart`,routineFailed:`routine needs you`,decision:`needs a decision`,reportMissing:`report missing`}}},ot={rail:{markNotice:`任务行现在以引擎图标开头。可在设置 → 外观里更改。`,markNoticeUndo:`换回旧样式`,inbox:`收件箱 {count}`,empty:`还没有任务`,skillCue:`缺少技能`,newTask:`新建任务`,update:`更新`,settings:`设置`,noProject:`未分组`,expandGroup:`展开{name}`,collapseGroup:`收起{name}`,state:{needs:`等你处理`,working:`进行中`,ready:`待收尾`,idle:`空闲`},extraRepos:`这个任务还含 {count} 个仓库`,todos:`{done}/{total} 条待办已完成`,startsAt:`{time} 启动`,pr:{state:{open:`进行中`,merged:`已合并`,closed:`已关闭`},many:`这个任务及子任务共 {count} 个 PR`,checks:{conflict:`与基础分支冲突`,failing:`检查未通过`,passing:`检查已通过`,pending:`检查进行中`}},searchPlaceholder:`模糊搜索`,engineSwitched:`引擎 → {engine}(重新打开后生效)`,engineSwitchFailed:`切换引擎失败:{error}`},inbox:{title:`收件箱`,hints:`↑↓ 移动 · enter 打开 · d 已阅 · esc 关闭`,ackAll:`[ 全部已阅 ]`,attention:`待处理`,recent:`最近使用`,empty:`暂无待处理`,reply:`[ 回复 ]`,hide:`[ 收起 ]`,send:`[ 发送 ]`,openTab:`[ 打开 ]`,noOutput:`还没有输出`,replyPlaceholder:`回复这个会话`,gateKept:`已记下;引擎没在运行,下次发消息时一并送达。`,state:{done:`完成`,needsInput:`需要输入`,error:`出错`,rateLimited:`限流`,dead:`引擎已退出`,restored:`重启后已恢复`,routineFailed:`例行任务需要处理`,decision:`等你决定`,reportMissing:`未回报`}}},st=e({en:()=>ct,zh:()=>lt}),ct={reviewQueue:{sourceIssues:`[ issues ]`,sourceReviews:`[ PRs waiting on me ]`,palette:`Review queue`,title:`PRs waiting on me`,empty:`No open PR asks for your review in your projects.`,other:`{count} more in projects Rove doesn't know.`,draft:`draft`,fork:`fork`,checksPassing:`checks passing`,checksFailing:`checks failing`,checksPending:`checks running`,start:`[ review ]`,preparing:`Fetching #{number}…`,failed:`Could not start the review of #{number}: {error}`,gh:{missing:"The `gh` CLI is not installed or not on PATH.",unauthenticated:"`gh` is not signed in: run `gh auth login` on this Mac.",failed:`GitHub could not be read just now. Press r to retry.`},prompt:`Review pull request #{number} in {repo}: {title}
|
|
11
|
-
{url}
|
|
12
|
-
|
|
13
|
-
This worktree is at the PR's head ({head}, going into {base}). Read the change against {base} (git diff origin/{base}...HEAD), then tell me what you find: bugs, risks, missing tests, anything unclear. Do not push, comment on or approve the PR; report here.`}},lt={reviewQueue:{sourceIssues:`[ 议题 ]`,sourceReviews:`[ 等我评审的 PR ]`,palette:`评审队列`,title:`等我评审的 PR`,empty:`你的项目里没有等你评审的 PR。`,other:`另有 {count} 个在 Rove 不认识的项目里。`,draft:`草稿`,fork:`fork`,checksPassing:`检查通过`,checksFailing:`检查未通过`,checksPending:`检查进行中`,start:`[ 评审 ]`,preparing:`正在获取 #{number}…`,failed:`无法开始评审 #{number}:{error}`,gh:{missing:"没有安装 `gh` 命令行,或不在 PATH 中。",unauthenticated:"`gh` 未登录:请在这台 Mac 上运行 `gh auth login`。",failed:`暂时读不到 GitHub。按 r 重试。`},prompt:`评审 {repo} 的拉取请求 #{number}:{title}
|
|
14
|
-
{url}
|
|
15
|
-
|
|
16
|
-
这个 worktree 在该 PR 的头部({head},合入 {base})。对照 {base} 阅读改动(git diff origin/{base}...HEAD),然后告诉我你的发现:bug、风险、缺失的测试、不清楚的地方。不要推送、评论或批准这个 PR;在这里汇报。`}},ut=e({en:()=>dt,zh:()=>ft}),dt={runLog:{title:`Runs`,all:`all`,outcome:{ok:`ok`,blocked:`blocked`,failed:`failed`,skipped:`skipped`},source:{schedule:`schedule`,manual:`manual`,webhook:`webhook`},blocked:{"task-missing":`task is gone`,"awaiting-owner":`waiting on a decision`,"report-missing":`last run never reported`,quota:`rate limited`,"engine-error":`engine error`,"engine-dead":`engine stopped`,"awaiting-permission":`waiting on a permission`,busy:`still working`},blockedRun:`blocked: {reason}`,empty:`No runs match.`,more:`+{count} more`}},ft={runLog:{title:`运行记录`,all:`全部`,outcome:{ok:`成功`,blocked:`受阻`,failed:`失败`,skipped:`跳过`},source:{schedule:`定时`,manual:`手动`,webhook:`Webhook`},blocked:{"task-missing":`任务已不存在`,"awaiting-owner":`等你做决定`,"report-missing":`上次运行没有汇报`,quota:`触发限流`,"engine-error":`引擎出错`,"engine-dead":`引擎已停止`,"awaiting-permission":`等你授权`,busy:`仍在运行`},blockedRun:`受阻:{reason}`,empty:`没有符合条件的运行。`,more:`另有 {count} 条`}},pt=e({en:()=>mt,zh:()=>ht}),mt={settings:{title:`Settings`,open:`settings`,sections:{connectors:`Connectors`,appearance:`Appearance`,notifications:`Notifications`,snippets:`Snippets`,about:`About`,voice:`Voice`},groups:{preferences:`Preferences`,agents:`Agents and tools`,more:`More`},pages:{general:`Language, layout, and where Rove opens files and creates worktrees.`,appearance:`Theme, colours, and how tasks and panes look.`,notifications:`When Rove tells you a task finished or needs you.`,keys:`Rebind chords in your own file, and how the prefix guide behaves.`,engines:`The coding agents Rove can start, and how it plugs into them.`,autoRouting:`What each depth tier starts, and who picks the tier.`,voice:`Dictation: the recognizer that turns what you say into prompts.`,connectors:`Accounts Rove uses, here and on your other machines.`,plugins:`Built-in pages and registered plugins.`,about:`Versions, updates, and this browser.`,feedback:`Send a note to the Rove team.`,dev:`Experimental switches, restarts and resets.`,snippets:`Prompt text you reuse. Type @name in a prompt to insert it.`},connectors:{githubDescription:`Clone, push and open PRs on every machine with one GitHub account`,connect:`Connect`,disconnect:`Disconnect`,disconnectBody:`Signs this machine's gh out of GitHub, for every tool that uses gh and not only Rove. Other machines keep their own sign-ins.`,machines:`Machines`,thisMachine:`This machine`,machinesHint:`Each machine signs in to GitHub by itself. The mark says whether it uses the same account as this one.`,refresh:`Check again`,refreshing:`Checking…`,useRove:`Use Rove's account`,loginThere:`Log in there`,codeHint:`Enter this code at GitHub (click the code to copy it)`,openGithub:`Open github.com/login/device`,codeCopied:`Code copied`,syncing:`Signed in. Bringing the other machines along…`,loginFailed:`Sign-in failed: {error}`,dismiss:`Dismiss`,loading:`checking…`,markSame:`✓ same account`,markDifferent:`⚠ @{login}`,markSignedOut:`✗ signed out`,markNoGh:`gh is not installed`,markOutdated:`Rove there is outdated`,markOffline:`offline`,markDenied:`refuses credential changes`,markFailed:`could not check`,detail:`git over {protocol} · SSH key {ssh}`,synced:`{machine} now uses @{login}`},general:{groupInterface:`Interface`,tuiKeyHints:`Show shortcut reminders in the Rove terminal interface.`,groupFiles:`Worktrees`,groupTerminal:`Terminal`,tabStrip:`Tab strip`,scrollback:`Scrollback`},appearance:{groupColours:`Colours`,groupTasks:`Tasks and panes`,taskColorsNote:`Gives each task its own hue on the working border and in the list.`,colorblindNote:`Shows added and removed lines in blue and red instead of green and red.`,workingBorderNote:`The pane's border while the selected task is working.`,railGroup:`Task list`,railGroupProject:`By project`,railGroupState:`By state`,statusMark:`Task status`,statusMarkEngine:`Engine icon`,statusMarkBoth:`Icon and dots`,statusMarkDots:`Dots only`,previewWorking:`Working`,previewDone:`Finished, unread`,previewIdle:`Idle`,previewWaiting:`Waiting for you`,previewBroken:`Broken`,previewTitle:`Fix the login redirect`},notifications:{toastNote:`A popup in the corner of this page.`,volume:`Chime volume`},about:{groupRove:`Rove`,daemon:`Daemon`,daemonCurrent:`rove {version}, same build as this page`,daemonStale:"rove {version} is out of date; run `rove daemon restart`",updates:`Updates`,browser:`This browser`,browserHint:`Forget this browser's token. A login token is revoked on the host too.`,access:`Access`,signIn:`Sign-in`,signInMode:{open:`None`,password:`Password`,token:`Token link`},signInHint:{open:`A browser on this computer opens Rove with no link or password. Phones and other computers still need a token.`,password:`A browser without a token signs in with the password. Token links keep working.`,token:`Only the link rove printed, or a device token, gets in. Password sign-in is off.`},passwordSet:`Set a password`,passwordChange:`Change the password`,passwordHint:`At least {min} characters. It is stored hashed on this computer.`,passwordField:`New password`,passwordSave:`Save`,signOut:`Sign out`},engines:{enabled:`Offer {name} when picking an engine`,default:`Make {name} the default engine`,namePlaceholder:`Display name (blank = default)`,rename:`Rename`,reset:`Reset to defaults`,remove:`Remove engine`,save:`Save`,cancel:`Cancel`},plugins:{builtIn:`Built in`,builtInHint:`First-party pages. Turning one off removes its entry from the rail.`,registered:`Registered plugins`,empty:`No other plugins registered.`,linked:`linked`,unsupportedPlatform:`unsupported platform`,turnOn:`Install {name}`},feedback:{hint:"Files a public GitHub issue on the Rove repo, through `gh` on the machine running rove. Without a signed-in `gh` you get a prefilled link to open instead.",kindLabel:`Kind`,kindBug:`Bug`,kindIdea:`Idea`,kindQuestion:`Question`,titleLabel:`Title`,body:`What happened`,send:`File issue`,sent:`Filed issue #{number}`,notFiled:`Not filed yet. {hint}`,openLink:`Open the prefilled issue`,report:`Report a problem with an agent`,reportNote:`An agent asks what went wrong, drafts the issue with you and files it.`,reportFailed:`Could not start the conversation.`,reportPrompt:"You are helping the user report a problem with Rove itself (not their own project) as a GitHub issue. First ask what they were doing and what felt wrong: one to three short questions, one at a time. Then collect context: run `rove --version` and `rove daemon status`, and read the last ~50 lines of `${ROVE_HOME_DIR:-$HOME}/.rove/daemon.log` only if the problem could involve the daemon. Draft an issue title and body (what happened, what they expected, steps, relevant output) and show it to the user. Only after they say OK, file it with a heredoc: `rove feedback --kind bug|idea|question --title \"...\" --body-file - <<'EOF'` followed by the body and `EOF`. Then share the issue URL. If it prints a prefilled link instead (gh missing or signed out), give the user that link and tell them to run `gh auth login`."}},prefs:{languageHint:`Display language, shared with the TUI.`,soundHint:`chime, plus a desktop notification while this tab is in the background`,soundVolumeHint:`Plays the new level when you pick it.`,push:`Notify when this page is closed`,pushHint:`This browser gets a notification when a task finishes, needs you or fails, even with no Rove page open. Follows the cross-task switch.`,pushUnsupported:`This browser can't receive push here: it needs https (or localhost), and on iPhone/iPad the page added to the home screen.`,pushBlocked:`Notifications are blocked for this site; allow them in the browser's site settings.`,pushFailed:`Couldn't turn it on: {error}`,editInTui:`Edit it in the TUI.`,tierModel:`model`,tierEdit:`Edit`,tierEffort:`Reasoning effort`,classifierConnection:`Classifier connection`,unset:`(none)`,modeAuto:`Auto (follow the browser)`,themePreviewHint:`Point at a theme to see this page in it; click to keep it. The TUI follows.`,themeUser:`yours`,themeInstalled:`Installed`,themeMoreHint:`Not installed yet: point to preview, click to install and switch.`,themeBrowse:`Browse {count} more from rove.run`,themeHide:`Hide themes from rove.run`,themeGet:`get`,themeInstalling:`installing…`,themeInstallFailed:`failed, retry`,themeAgent:`Make one with an agent`,themeAgentHint:`opens a Scratch session; reopen Settings to see what it wrote.`,themeAgentFailed:`couldn't open the session; try again.`,themeAgentPrompt:"Make me a new Rove color theme. Ask me first what look I want, unless I already said. Save it as one JSON file in {dir} (for example {dir}/my-theme.json); the file name is the theme's name. The format is in https://github.com/sma1lboy/rove/blob/main/docs/themes.md and the JSON schema is https://raw.githubusercontent.com/sma1lboy/rove/main/packages/rove/src/tui/context/theme/theme.schema.json. Start from https://raw.githubusercontent.com/sma1lboy/rove/main/packages/rove/src/tui/context/theme/claude.json, give each color slot a { dark, light } pair, and keep text readable on every background. When it's saved, run `rove theme list` to check it loads, then tell me the name: it appears in Settings → Appearance.",resetButton:`Reset`,resetHint:`Clears this Mac's saved settings and task list, restarts the Rove daemon, then reloads this page. Worktrees on disk and engine session history are not touched.`,resetBody:`Wipes ~/.config/rove/state.json and ~/.rove/tasks.json and restarts the daemon, then reloads this page with an empty task list. Worktrees on disk and engine session history are NOT touched.`,restartButton:`Restart`,restartHint:`Stops the Rove daemon and starts a fresh one; this page reconnects on its own. Running engine sessions live in the PTY host and survive it.`,restartBody:`Stops the Rove daemon and starts a fresh one, picking up daemon edits. This page reconnects in a few seconds. Running engine sessions survive.`,keysYaml:`The file is read on the Mac; changes apply when you come back to this page.`},keys:{editHint:`Click a key to record a new one, then press the key you want. To put it behind the prefix, press the prefix key first. The × removes it.`,reset:`Reset`,recordFor:`Record a key for {name}`,removeFor:`Remove the key for {name}`,pluginNoTask:`Select a task before using a plugin chord.`,pluginChords:`Plugin chords`,agent:`Change them with an agent`,agentHint:`opens a Scratch session; reopen Settings to see what it changed.`,agentFailed:`couldn't open the session; try again.`,agentPrompt:"Change my Rove keybindings. Ask me first what I want changed, unless I already said. Edit {path} (create it if it is missing; keep existing entries and comments you were not asked to change). The format, every binding id and its default chord are in https://github.com/sma1lboy/rove/blob/main/docs/KEYBINDINGS.md (see Customizing). Only use binding ids listed there; a direct override replaces that binding's whole chord list, and null unbinds. The file must stay valid YAML: check it parses (for example with `ruby -ryaml -e 'YAML.load_file(ARGV[0])' {path}` or any YAML parser you have). Rove reloads it live, and unknown ids or invalid chords are ignored with a warning, so when you are done tell me what you changed and ask me to reopen Settings → Keybindings: it lists every applied override and every warning."},pages:{attachTooLarge:`{name} is larger than 500 MB`,new:`[ new ]`,routinePause:`[ pause ]`,routineEnable:`[ enable ]`,delete:`[ delete ]`,routinesNeedYou:`NEEDS YOU`,routinesActive:`ACTIVE`,routinesPaused:`PAUSED`,laterStarts:`LATER`,laterCancel:`[ cancel ]`,laterFailed:`Did not start: {error}`,laterCancelFailed:`Could not cancel the start: {error}`,routineSchedule:`Schedule`,routineNext:`Next run`,routineProject:`Project`,routineDelivers:`Delivers to`,routineEngine:`Engine`,routineChangeEngine:`[ change ]`,routinePrompt:`PROMPT`,routineScript:`SCRIPT`,cronDown:`Decrease {field}`,cronUp:`Increase {field}`,storySave:`save`,storySaveStart:`save & start`,storyStart:`start`,attachHintTouch:`paste a path / a screenshot → inserts an image placeholder`}},ht={settings:{title:`设置`,open:`设置`,sections:{connectors:`连接器`,appearance:`外观`,notifications:`通知`,snippets:`片段`,about:`关于`,voice:`语音`},groups:{preferences:`偏好`,agents:`智能体与工具`,more:`更多`},pages:{general:`语言、布局,以及 Rove 在哪里打开文件、创建 worktree。`,appearance:`主题、颜色,以及任务和面板的外观。`,notifications:`任务完成或需要你时,Rove 怎么提醒。`,keys:`在你自己的文件里重绑快捷键,以及前缀引导的行为。`,engines:`Rove 能启动的编码智能体,以及它如何接入它们。`,autoRouting:`每个深度档位启动什么,以及由谁选择档位。`,voice:`口述:把你说的话变成提示词的识别器。`,connectors:`Rove 使用的账号,本机和你的其他机器。`,plugins:`内置页面和已注册的插件。`,about:`版本、更新,以及此浏览器。`,feedback:`给 Rove 团队留一条意见。`,dev:`实验开关、重启和重置。`,snippets:`常用的提示词文本。在提示词里输入 @名称 即可插入。`},connectors:{githubDescription:`用同一个 GitHub 账号在每台机器上克隆、推送和开 PR`,connect:`连接`,disconnect:`断开`,disconnectBody:`把这台机器的 gh 从 GitHub 退出登录,所有用 gh 的工具都会受影响,不只是 Rove。其他机器保持各自的登录。`,machines:`机器`,thisMachine:`本机`,machinesHint:`每台机器各自登录 GitHub。右边的标记表示它和本机用的是不是同一个账号。`,refresh:`重新检查`,refreshing:`检查中…`,useRove:`使用 Rove 的账号`,loginThere:`在那里登录`,codeHint:`到 GitHub 输入这个验证码(点击验证码可复制)`,openGithub:`打开 github.com/login/device`,codeCopied:`验证码已复制`,syncing:`已登录,正在同步其他机器…`,loginFailed:`登录失败:{error}`,dismiss:`关闭`,loading:`检查中…`,markSame:`✓ 同一账号`,markDifferent:`⚠ @{login}`,markSignedOut:`✗ 未登录`,markNoGh:`未安装 gh`,markOutdated:`那边的 Rove 版本过旧`,markOffline:`离线`,markDenied:`拒绝修改凭据`,markFailed:`无法检查`,detail:`git 走 {protocol} · SSH 密钥 {ssh}`,synced:`{machine} 现在使用 @{login}`},general:{groupInterface:`界面`,tuiKeyHints:`在 Rove 终端界面显示快捷键提示。`,groupFiles:`Worktree`,groupTerminal:`终端`,tabStrip:`标签栏`,scrollback:`回滚行数`},appearance:{groupColours:`颜色`,groupTasks:`任务与面板`,taskColorsNote:`让每个任务在工作边框和列表里有自己的色调。`,colorblindNote:`新增和删除的行用蓝色和红色,而不是绿色和红色。`,workingBorderNote:`所选任务工作时,面板边框的样子。`,railGroup:`任务列表`,railGroupProject:`按项目`,railGroupState:`按状态`,statusMark:`任务状态`,statusMarkEngine:`引擎图标`,statusMarkBoth:`图标加点阵`,statusMarkDots:`只有点阵`,previewWorking:`正在跑`,previewDone:`完成未读`,previewIdle:`空闲`,previewWaiting:`等你回答`,previewBroken:`出错`,previewTitle:`修复登录跳转`},notifications:{toastNote:`本页角落里的弹出提示。`,volume:`提示音音量`},about:{groupRove:`Rove`,daemon:`守护进程`,daemonCurrent:`rove {version},与本页同一版本`,daemonStale:"rove {version} 版本过旧;运行 `rove daemon restart`",updates:`更新`,browser:`此浏览器`,browserHint:`忘掉此浏览器的令牌。登录得到的令牌也会在主机上吊销。`,access:`访问`,signIn:`登录方式`,signInMode:{open:`免登录`,password:`密码`,token:`Token 链接`},signInHint:{open:`本机浏览器不用链接或密码就能打开 Rove。手机和其他电脑仍然需要 token。`,password:`没有 token 的浏览器用密码登录。Token 链接照常可用。`,token:`只有 rove 打印的链接或设备 token 能进。密码登录关闭。`},passwordSet:`设置密码`,passwordChange:`修改密码`,passwordHint:`至少 {min} 个字符。以哈希形式存在本机。`,passwordField:`新密码`,passwordSave:`保存`,signOut:`退出登录`},engines:{enabled:`选引擎时列出 {name}`,default:`把 {name} 设为默认引擎`,namePlaceholder:`显示名称(留空 = 默认)`,rename:`重命名`,reset:`恢复默认`,remove:`移除引擎`,save:`保存`,cancel:`取消`},plugins:{builtIn:`内置`,builtInHint:`官方页面。关掉后,它在侧栏的入口会消失。`,registered:`已注册的插件`,empty:`没有其他已注册的插件。`,linked:`已链接`,unsupportedPlatform:`平台不支持`,turnOn:`安装 {name}`},feedback:{hint:"通过运行 rove 那台机器上的 `gh`,在 Rove 仓库提一个公开的 GitHub issue。没有登录 `gh` 时会给你一条预填好的链接。",kindLabel:`类型`,kindBug:`缺陷`,kindIdea:`想法`,kindQuestion:`问题`,titleLabel:`标题`,body:`发生了什么`,send:`提交 issue`,sent:`已提交 issue #{number}`,notFiled:`还没提交。{hint}`,openLink:`打开预填好的 issue`,report:`让 agent 帮我报告问题`,reportNote:`由 agent 问清哪里不对,和你一起起草 issue 并提交。`,reportFailed:`没能开始对话。`,reportPrompt:"你在帮用户把 Rove 本身的问题(不是他们自己项目的问题)提成一个 GitHub issue。先问清楚他们当时在做什么、哪里不对劲:一到三个简短的问题,一次问一个。然后收集上下文:运行 `rove --version` 和 `rove daemon status`,只有问题可能和 daemon 有关时才读 `${ROVE_HOME_DIR:-$HOME}/.rove/daemon.log` 的最后约 50 行。起草 issue 的标题和正文(发生了什么、期望什么、复现步骤、相关输出)并展示给用户。用户确认之后才提交,用 heredoc:`rove feedback --kind bug|idea|question --title \"...\" --body-file - <<'EOF'`,接正文,最后一行 `EOF`。然后把 issue 链接发给用户。如果输出的是预填链接(没装 gh 或没登录),把链接给用户,并告诉他运行 `gh auth login`。"}},prefs:{languageHint:`显示语言,与 TUI 共用同一设置。`,soundHint:`提示音;本页在后台时另发桌面通知`,soundVolumeHint:`选中后会播放新音量。`,push:`页面关闭时也通知`,pushHint:`任务完成、需要你或出错时,即使没有打开任何 Rove 页面,这个浏览器也会收到通知。跟随「跨任务通知」开关。`,pushUnsupported:`这个浏览器在这里收不到推送:需要 https(或 localhost),iPhone/iPad 上还要先把页面添加到主屏幕。`,pushBlocked:`这个网站的通知被浏览器屏蔽了,去浏览器的网站设置里允许。`,pushFailed:`没能开启:{error}`,editInTui:`请在 TUI 中编辑`,tierModel:`模型`,tierEdit:`编辑`,tierEffort:`推理强度`,classifierConnection:`分类器连接`,unset:`(无)`,modeAuto:`自动(跟随浏览器)`,themePreviewHint:`鼠标指向一个主题,整页就换成它看看;点一下就定下来。TUI 也会跟着换。`,themeUser:`自装`,themeInstalled:`已安装`,themeMoreHint:`尚未安装:指向即预览,点一下安装并切换。`,themeBrowse:`浏览 rove.run 上的另外 {count} 个主题`,themeHide:`收起 rove.run 的主题`,themeGet:`安装`,themeInstalling:`安装中…`,themeInstallFailed:`失败,重试`,themeAgent:`让 agent 做一个`,themeAgentHint:`会开一个 Scratch 会话;做好后重新打开设置就能看到。`,themeAgentFailed:`会话没打开,再试一次。`,themeAgentPrompt:"帮我做一个新的 Rove 配色主题。先问我想要什么风格,除非我已经说过。把它存成 {dir} 下的一个 JSON 文件(比如 {dir}/my-theme.json),文件名就是主题名。格式说明见 https://github.com/sma1lboy/rove/blob/main/docs/themes.md,JSON schema 是 https://raw.githubusercontent.com/sma1lboy/rove/main/packages/rove/src/tui/context/theme/theme.schema.json。以 https://raw.githubusercontent.com/sma1lboy/rove/main/packages/rove/src/tui/context/theme/claude.json 为起点,每个颜色槽都给 { dark, light } 两个值,并保证文字在每种背景上都看得清。存好后运行 `rove theme list` 确认能加载,然后告诉我主题名:它会出现在 设置 → 外观 里。",resetButton:`重置`,resetHint:`清空这台 Mac 上保存的设置和任务列表,重启 Rove 守护进程,然后刷新本页。磁盘上的工作树和引擎会话历史不受影响。`,resetBody:`清空 ~/.config/rove/state.json 和 ~/.rove/tasks.json 并重启守护进程,然后刷新本页,任务列表为空。磁盘上的工作树和引擎会话历史不会被动。`,restartButton:`重启`,restartHint:`停止 Rove 守护进程并启动新的进程,本页会自动重连。运行中的引擎会话在 PTY 宿主里,不受影响。`,restartBody:`停止 Rove 守护进程并启动新的进程,载入守护进程的改动。本页几秒后自动重连,运行中的引擎会话不受影响。`,keysYaml:`该文件在 Mac 上读取,改动会在你回到本页时生效。`},keys:{editHint:`点一个按键开始录入,再按你想要的键。想放到 prefix 后面,就先按 prefix 键。× 是删掉它。`,reset:`恢复默认`,recordFor:`为「{name}」录入按键`,removeFor:`删掉「{name}」的按键`,pluginNoTask:`使用插件快捷键前请先选中一个任务。`,pluginChords:`插件快捷键`,agent:`让 agent 来改`,agentHint:`会开一个 Scratch 会话;改好后重新打开设置就能看到。`,agentFailed:`会话没打开,再试一次。`,agentPrompt:"帮我改 Rove 的快捷键。先问我想改什么,除非我已经说过。编辑 {path}(不存在就新建;没让你改的条目和注释都保留)。格式、每个 binding id 及其默认按键见 https://github.com/sma1lboy/rove/blob/main/docs/KEYBINDINGS.md(Customizing 一节)。只用那里列出的 binding id;直接覆盖会替换该 binding 的整个按键列表,null 表示解绑。文件必须保持合法 YAML:确认它能解析(比如 `ruby -ryaml -e 'YAML.load_file(ARGV[0])' {path}`,或任何你有的 YAML 解析器)。Rove 会实时重新加载它,未知 id 或无效按键会被忽略并给出警告,所以改完后告诉我改了什么,并请我重新打开 设置 → 快捷键:那里会列出所有生效的覆盖和所有警告。"},pages:{attachTooLarge:`{name} 超过 500 MB`,new:`[ 新建 ]`,routinePause:`[ 暂停 ]`,routineEnable:`[ 启用 ]`,delete:`[ 删除 ]`,routinesNeedYou:`需要处理`,routinesActive:`运行中`,routinesPaused:`已暂停`,laterStarts:`稍后启动`,laterCancel:`[ 取消 ]`,laterFailed:`没有启动:{error}`,laterCancelFailed:`取消失败:{error}`,routineSchedule:`调度`,routineNext:`下次执行`,routineProject:`项目`,routineDelivers:`投递到`,routineEngine:`引擎`,routineChangeEngine:`[ 更换 ]`,routinePrompt:`提示词`,routineScript:`脚本`,cronDown:`减小{field}`,cronUp:`增大{field}`,storySave:`保存`,storySaveStart:`保存并启动`,storyStart:`启动`,attachHintTouch:`粘贴路径 / 截图 → 插入图片占位行`}},gt=e({en:()=>_t,zh:()=>vt}),_t={transcript:{you:`You`,agent:`Agent`,system:`System`,copy:`[ copy ]`,copied:`Copied`,export:`[ export .md ]`,findPlaceholder:`Find in this conversation`,findCount:`{at} / {total}`,findNone:`no match`,prev:`[ prev ]`,next:`[ next ]`,older:`[ load earlier ]`,loading:`Reading the conversation…`,empty:`Nothing said yet.`,failed:`failed`,error:`Could not read the conversation: {error}`,retry:`[ retry ]`,noHistory:`This engine keeps no history Rove can read. Showing its terminal tail.`,tail:`Terminal tail`}},vt={transcript:{you:`你`,agent:`智能体`,system:`系统`,copy:`[ 复制 ]`,copied:`已复制`,export:`[ 导出 .md ]`,findPlaceholder:`在这段对话中查找`,findCount:`{at} / {total}`,findNone:`没有匹配`,prev:`[ 上一个 ]`,next:`[ 下一个 ]`,older:`[ 加载更早 ]`,loading:`正在读取对话…`,empty:`还没有对话内容。`,failed:`失败`,error:`读不到这段对话:{error}`,retry:`[ 重试 ]`,noHistory:`这个引擎没有 Rove 能读取的历史记录,显示的是它的终端末尾。`,tail:`终端末尾`}},yt=e({en:()=>bt,zh:()=>xt}),bt={usage:{title:`Usage`,receipt:`Usage receipt`,total:`Total tokens`,thanks:`Thank you, burn again soon`,open:`Open usage`,range:`last {days} days · tokens are input + output`,perDay:`Per day`,byModel:`By engine and model`,topTasks:`Top tasks`,quota:`Quota`,turns:`{count} turns`,loading:`Loading…`,empty:`No turns recorded in this window.`,failed:`Could not read usage: {error}`,cutoff:`The daemon returns at most {count} turns: {day} and earlier are partial.`,noReader:`{engines}: no turn reader, so their work is not counted here.`,removedTask:`(removed task)`,full:`at this pace full around {time}, before it resets`,lasts:`at this pace it lasts until the reset`}},xt={usage:{title:`用量`,receipt:`用量小票`,total:`合计 token`,thanks:`谢谢惠顾,欢迎再烧`,open:`打开用量`,range:`最近 {days} 天 · token 为输入加输出`,perDay:`按天`,byModel:`按引擎和模型`,topTasks:`用量最高的任务`,quota:`额度`,turns:`{count} 轮`,loading:`加载中…`,empty:`这段时间没有记录到任何一轮。`,failed:`无法读取用量:{error}`,cutoff:`守护进程最多返回 {count} 轮:{day} 及更早的数据不完整。`,noReader:`{engines}:没有轮次读取器,这里不统计它们的工作。`,removedTask:`(已删除的任务)`,full:`按当前速度约 {time} 用完,早于重置时间`,lasts:`按当前速度可撑到重置`}},St=e({en:()=>Ct,zh:()=>wt}),Ct={voice:{say:`Say`,stop:`Stop {time}`,release:`Release {time}`,working:`Hearing…`,hint:`Dictate: tap to start and stop, or hold to talk and let go`,slideToSend:`Slide up to send`,tipSend:`Let go to send`,hold:`Hold to talk`,holdOrType:`Hold to talk, tap to type`,learned:`Learned {pairs}`,learnedPair:`{spoken} → {term}`,undo:`undo`,unlearned:`Forgotten`,unlearnFailed:`Couldn't undo: the voice sidecar isn't answering`,setup:{dictation:`Dictation`,backend:{off:`Off`,local:`On this Mac`,cloud:`Cloud`},unavailable:`This Rove cannot set up dictation`,offHint:`The mic is hidden. Nothing runs in the background.`,localNeeded:`Install the model below; the mic shows once it is ready.`,localInstalling:`Installing the model; the mic shows once it is ready.`,cloudNeeded:`Save an endpoint below to turn dictation on.`,ready:`{model} · ready`,starting:`Starting…`,localTitle:`Whisper large-v3`,localHint:`Runs on this Mac's GPU, about 3.5 GB to download. Audio never leaves the Mac.`,install:`Install`,installing:`Installing…`,installed:`Installed, about 4 GB on disk.`,failed:`Install failed: {line}`,uninstall:`Uninstall`,uninstallAsk:`Remove the model?`,cancel:`Cancel`,cloudTitle:`Cloud endpoint`,cloudHint:`Any OpenAI-compatible /audio/transcriptions service. The audio and your terms go there; the key stays on the Mac.`,baseURL:`Base URL`,model:`Model`,apiKey:`API key`,keySaved:`Saved; leave empty to keep it`,save:`Save`,saveAndUse:`Save and use`,forget:`Forget`,forgetAsk:`Remove the endpoint and its key?`}}},wt={voice:{say:`说`,stop:`停 {time}`,release:`松手 {time}`,working:`在听…`,hint:`口述:点一下开始、再点一下结束,或按住说话、松手结束`,slideToSend:`上滑发送`,tipSend:`松手发送`,hold:`按住说话`,holdOrType:`按住说话,轻点打字`,learned:`记住了 {pairs}`,learnedPair:`{spoken} → {term}`,undo:`撤销`,unlearned:`已撤销`,unlearnFailed:`没能撤销:语音服务没有响应`,setup:{dictation:`语音输入`,backend:{off:`关闭`,local:`本机`,cloud:`云端`},unavailable:`这个 Rove 无法设置语音输入`,offHint:`不显示麦克风,后台也不运行任何东西。`,localNeeded:`在下面安装模型,就绪后显示麦克风。`,localInstalling:`正在安装模型,就绪后显示麦克风。`,cloudNeeded:`在下面保存一个服务地址后开启。`,ready:`{model} · 就绪`,starting:`启动中…`,localTitle:`Whisper large-v3`,localHint:`在这台 Mac 的 GPU 上运行,约需下载 3.5 GB。音频不离开这台 Mac。`,install:`安装`,installing:`安装中…`,installed:`已安装,约占 4 GB 磁盘。`,failed:`安装失败:{line}`,uninstall:`卸载`,uninstallAsk:`删除模型?`,cancel:`取消`,cloudTitle:`云端服务`,cloudHint:`任何兼容 OpenAI /audio/transcriptions 的服务。音频和你的术语会发到那里;密钥只存在这台 Mac 上。`,baseURL:`Base URL`,model:`模型`,apiKey:`API 密钥`,keySaved:`已保存;留空则保留原密钥`,save:`保存`,saveAndUse:`保存并使用`,forget:`删除`,forgetAsk:`删除这个服务地址和密钥?`}}},Tt=e({en:()=>Et,zh:()=>Dt}),Et={workspace:{pickTask:`pick a task on the left`,noTabs:`no open sessions in this task`,startEngine:`Start {engine}`,startSession:`Start session`,tabNotLive:`this tab has no running session`,restored:`restored session, read-only until reopened`,exited:`session ended (exit {code})`,attachFailed:`could not open this session: {message}`,reopen:`Reopen session`,reopening:`Reopening…`,reopenFailed:`could not reopen this session: {message}`,engineExited:`engine exited (code {code})`,retry:`Retry`,engineSettings:`Settings → Engines`,usageLimitUntil:`usage limit reached — rove resumes this task at {time}`,resumeQuota:`resume now`,resumingQuota:`resuming…`,usageLimit:`usage limit reached`,dismiss:`Dismiss`,openTask:`Open`},tab:{shell:`shell`,engine:`engine`},firstRun:{title:`All your coding agents, in one place`,body:`When one runs out of quota, switch the task to another. Agents talk to each other directly, and every task gets its own worktree and branch.`,start:`Start your first task`},status:{connecting:`connecting`,retrying:`reconnecting, attempt {count}`,retry:`retry now`,backlog:`Backlog`,inProgress:`In progress`,inReview:`In review`,done:`Done`,canceled:`Canceled`,error:`Error`},connect:{title:`open the link rove printed`,body:"Run `rove --web` and open the link it prints, or paste it here.",placeholder:`http://127.0.0.1:7878/#token=…`,submit:`connect`,invalid:"that is not a `rove --web` link",failing:"can't reach rove. Is `rove --web` still running? After `--rotate-token`, open the new link.",forget:`forget this link`,notConnected:`not connected to rove — reconnecting (the view refreshes on its own)`},relay:{unpaired:"open the relay link that `rove --web --preset relay` printed on your computer",connecting:`connecting to your computer through the relay…`,loading:`loading rove…`,offline:"your computer is not answering on this relay. Is `rove --web --preset relay` still running? After `--rotate-relay`, open the new link. Reload to retry.",failed:`can't reach your computer through the relay ({error}). Reload to retry.`},login:{title:`sign in`,body:`Enter this Rove's password.`,field:`password`,submit:`sign in`,checking:`checking…`,wrong:`that did not work`,locked:`too many tries from here; try again in {minutes} min`,lockedHost:"password login is locked; run `rove --web --unlock` on the host",unreachable:"can't reach rove. Is `rove --web` still running?"},layout:{splitTooSmall:`Not enough room to split here`,railFold:`Fold the task list`,navBack:`Back`,navForward:`Forward`,railUnfold:`Unfold the task list`,dropUploading:`Uploading {name}…`,pasteNoImage:`No image on this browser's clipboard`,pasteNoAccess:`Can't read this browser's clipboard: {error}`,pasteNeedsHttps:`the page needs https or localhost`,refreshRove:`Refresh Rove`,refreshConfirm:`Rove will restart the daemon and reconnect. Your running sessions will keep going.`,refreshVersions:`bridge {bridge} · daemon {daemon}`,unknownVersion:`unknown`,refreshTimeout:"The daemon did not come back on the new build in time; check `rove daemon status`",railResize:`Drag to resize the task list, click to fold it, double-click to reset`,composerPlaceholder:`Message the agent`,composerSend:`Send`,composerAttach:`Attach a file`,composerNotSent:`Not sent: {reason}`,composerOldBridge:`This Mac's rove --web is older than this page; restart it to send from here.`,composerAtMenu:`The agent is waiting on a choice. Answer it with the 1–4 and ⏎ keys below; your message is kept.`,termKeys:`Terminal keys`,termKeyUp:`Up arrow`,termKeyDown:`Down arrow`,termKeyLeft:`Left arrow`,termKeyRight:`Right arrow`,termKeyInterrupt:`Ctrl+C, interrupt`,termKeyEnter:`Enter`,narrowTerminal:`Terminal`}},Dt={workspace:{pickTask:`从左边选一个任务`,noTabs:`这个任务没有打开的会话`,startEngine:`启动 {engine}`,startSession:`启动会话`,tabNotLive:`这个标签没有在运行的会话`,restored:`已恢复的会话,重新打开前只读`,exited:`会话已结束(退出码 {code})`,attachFailed:`打不开这个会话:{message}`,reopen:`重新打开会话`,reopening:`正在重新打开…`,reopenFailed:`重新打开失败:{message}`,engineExited:`引擎已退出(退出码 {code})`,retry:`重试`,engineSettings:`设置 → 引擎`,usageLimitUntil:`已达到用量上限 —— rove 会在 {time} 自动继续这个任务`,resumeQuota:`现在继续`,resumingQuota:`正在继续…`,usageLimit:`已达到用量上限`,dismiss:`忽略`,openTask:`打开`},tab:{shell:`终端`,engine:`引擎`},firstRun:{title:`所有编程 agent,都在一个地方`,body:`一个额度用完了,换另一个接着干;agent 之间直接对话。每个任务有独立的 worktree 和分支,互不覆盖。`,start:`开始第一个任务`},status:{connecting:`连接中`,retrying:`重连中,第 {count} 次`,retry:`立即重试`,backlog:`待办`,inProgress:`进行中`,inReview:`待评审`,done:`已完成`,canceled:`已取消`,error:`出错`},connect:{title:`打开 rove 打印的链接`,body:"运行 `rove --web`,打开它打印的链接,或者把链接粘贴到这里。",placeholder:`http://127.0.0.1:7878/#token=…`,submit:`连接`,invalid:"这不是 `rove --web` 打印的链接",failing:"连不上 rove。`rove --web` 还在运行吗?用过 `--rotate-token` 的话,请打开新的链接。",forget:`忘掉这个链接`,notConnected:`没有连上 rove,正在重连(连上后这里会自动刷新)`},relay:{unpaired:"打开电脑上 `rove --web --preset relay` 打印的 relay 链接",connecting:`正在通过 relay 连接你的电脑…`,loading:`正在加载 rove…`,offline:"你的电脑没有在这个 relay 上应答。`rove --web --preset relay` 还在运行吗?用过 `--rotate-relay` 的话,请打开新的链接。刷新重试。",failed:`无法通过 relay 连到你的电脑({error})。刷新重试。`},login:{title:`登录`,body:`输入这台 Rove 的密码。`,field:`密码`,submit:`登录`,checking:`验证中…`,wrong:`登录失败`,locked:`这里尝试次数过多;{minutes} 分钟后再试`,lockedHost:"密码登录已锁定;在主机上运行 `rove --web --unlock`",unreachable:"连不上 rove。`rove --web` 还在运行吗?"},layout:{splitTooSmall:`这里放不下分屏了`,railFold:`折叠任务列表`,navBack:`后退`,navForward:`前进`,railUnfold:`展开任务列表`,dropUploading:`正在上传 {name}…`,pasteNoImage:`浏览器剪贴板里没有图片`,pasteNoAccess:`读不到浏览器剪贴板:{error}`,pasteNeedsHttps:`页面要走 https 或 localhost`,refreshRove:`刷新 Rove`,refreshConfirm:`Rove 会重启守护进程并重新连接。正在运行的会话会继续。`,refreshVersions:`桥接服务 {bridge} · 守护进程 {daemon}`,unknownVersion:`版本未知`,refreshTimeout:"守护进程没能及时以新版本重新上线,请检查 `rove daemon status`",railResize:`拖动调整任务列表宽度,单击折叠,双击还原`,composerPlaceholder:`给 agent 发消息`,composerSend:`发送`,composerAttach:`附加文件`,composerNotSent:`没发出去:{reason}`,composerOldBridge:`这台 Mac 上的 rove --web 比页面旧,重启它之后才能从这里发送。`,composerAtMenu:`agent 正在等你选择。用下方的 1–4 和 ⏎ 键回答;你的消息已保留。`,termKeys:`终端按键`,termKeyUp:`上方向键`,termKeyDown:`下方向键`,termKeyLeft:`左方向键`,termKeyRight:`右方向键`,termKeyInterrupt:`Ctrl+C 中断`,termKeyEnter:`回车`,narrowTerminal:`终端`}},Ot=[it,Tt,Ke,Qe,pt,Be,tt,ut,yt,gt,Ye,Le,st,Ue,St],kt=Object.assign({},...Ot.map(e=>e.en)),At={en:kt,zh:Object.assign({},...Ot.map(e=>e.zh))};function jt(){try{let e=JSON.parse(localStorage.getItem(`rove.prefs`)??`null`);if(e&&typeof e==`object`&&`prefs`in e){let t=e.prefs;if(t&&typeof t==`object`&&`locale`in t&&(t.locale===`en`||t.locale===`zh`))return t.locale}}catch{}return globalThis.navigator?.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`}var Mt=v(jt());function Nt(){let e=typeof document>`u`?void 0:document.documentElement;e&&(e.lang=Mt.get()===`zh`?`zh-CN`:`en`)}Nt(),Mt.subscribe(Nt);function Pt(e,t){let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`||!(e in n))return;n=Reflect.get(n,e)}return typeof n==`string`?n:void 0}function Ft(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e)):e}function H(e,t){return Ft(Pt(At[Mt.get()],e)??Pt(kt,e)??e,t)}function It(e,t,n){return Ft(Pt(e[Mt.get()],t)??Pt(e.en,t)??t,n)}function U(){return y(Mt)}function Lt(e){let t=e.trim(),n=t.indexOf(`#`),r=n>=0?new URLSearchParams(t.slice(n+1)).get(`token`):t;return r&&/^[A-Za-z0-9_-]{43}$/.test(r)?r:null}var Rt=(...e)=>e.filter(Boolean).join(` `),zt=`text-meta leading-[inherit]`,Bt=`font-normal normal-nums`,Vt=`touch:relative touch:after:absolute touch:after:content-['']`,Ht=`flex h-full flex-col`,Ut=e=>[`app relative grid min-h-0 flex-1 grid-rows-[1fr_auto] transition-[grid-template-columns] duration-220 ease-snap motion-reduce:transition-none`,e.surface?`is-narrow narrow-${e.surface} grid-cols-[minmax(0,1fr)]`:e.panel?`grid-cols-[var(--rail-w,minmax(220px,280px))_minmax(0,1fr)_minmax(0,var(--panel-w,33%))]`:`grid-cols-[var(--rail-w,minmax(220px,280px))_1fr]`,e.expanded?`is-panel-expanded`:``,e.folded?`is-rail-folded`:``,e.peek?`is-rail-peek`:``,e.dragging?`is-dragging transition-none`:``].join(` `),Wt=[`relative narrow-content:hidden narrow-back:col-1 narrow-back:row-1 touch:select-none touch:touch-callout-none`,`wide:overflow-x-clip wide:pt-8.5 wide:[&>:not([data-grip])]:min-w-(--rail-open-w)`,`rail-folded:absolute rail-folded:inset-y-1.5 rail-folded:left-1.5 rail-folded:z-6 rail-folded:col-1 rail-folded:row-1 rail-folded:box-border rail-folded:w-(--rail-open-w) rail-folded:-translate-x-[calc(100%+12px)] rail-folded:rounded-md rail-folded:border-hairline rail-folded:border-line rail-folded:bg-surface rail-folded:shadow-none rail-folded:transition-[translate] rail-folded:duration-200 rail-folded:ease-snap rail-folded:motion-reduce:transition-none rail-folded:[&>:not([data-grip])]:min-w-0`,`rail-peek:translate-none rail-peek:shadow-dialog`].join(` `),Gt=`rail-folded:col-2 panel-expanded:invisible panel-expanded:col-2 narrow-sidebar:hidden narrow-back:z-1 narrow-back:col-1 narrow-back:translate-x-(--back-x) narrow-back:bg-paper narrow-back:shadow-dialog`,Kt=`rail-folded:col-3 panel-expanded:z-2 panel-expanded:col-[2/-1] panel-expanded:bg-paper panel-expanded:pl-2`,qt=`${Vt} touch:after:-inset-x-1.5 touch:after:-inset-y-3`,Jt=`flex items-center gap-2`,Yt=`flex min-w-0 items-baseline gap-1.5 px-1.5 py-0.5 text-meta font-bold ${Vt} touch:after:-inset-2.5 touch:after:-bottom-1`,Xt=`flex items-center rounded-sm px-2.5 py-1.5 text-muted aria-selected:bg-inset aria-selected:text-ink [&_svg]:size-4 ${Vt} touch:after:-inset-x-px touch:after:-top-2 touch:after:-bottom-1.5`,Zt=e=>`shortcut-badge absolute top-1/2 z-8 -translate-y-1/2 cursor-pointer rounded-sm border-hairline border-accent bg-surface px-1.25 py-px text-meta text-accent ${e?`right-full mr-1.5`:`right-1`}`,Qt=`relative min-w-0 flex-1`,$t={left:[`[border-left:var(--hairline)_solid_var(--line)]`,`[border-left:var(--hairline)_solid_var(--accent)]`],top:[`[border-top:var(--hairline)_solid_var(--line)]`,`[border-top:var(--hairline)_solid_var(--accent)]`]},en=(e,t)=>$t[e][+!!t],tn=(e,t)=>{let n=`split-leaf absolute box-border flex min-h-0 min-w-0 ${t.active?`is-active`:``}`,r=t.active?`border-accent`:``;return e===`box`?`${n} rounded-[calc(var(--radius)-1px)] border-hairline ${t.active?`border-accent`:`border-line`}`:e===`line`?`${n} ${t.left?en(`left`,t.active):``} ${t.top?en(`top`,t.active):``} ${t.left||t.top?r:``}`:e===`rail`?`${n} ${en(`left`,t.active)} ${r} ${t.top?`[--mt:6px]`:``}`:e===`rule`?`${n} ${en(`top`,t.active)} ${r} ${t.left?`[--ml:8px]`:``}`:n},nn=(e,t)=>`absolute right-2 z-3 bg-paper px-1 font-mono text-meta ${Bt} ${e?`-top-2`:`top-0.5`} ${t?`text-accent`:`text-subtle`}`,rn=`hidden gap-1 overflow-x-auto scrollbar-none [border-top:var(--hairline)_solid_var(--line)] bg-surface px-1.5 py-1 touch:flex`,an=e=>`h-10 min-w-max touch-manipulation [flex:1_1_0] rounded-sm border-hairline bg-inset px-0.5 py-0 font-mono text-meta ${Bt} ${e?`border-accent text-accent`:`border-line text-ink`}`,on=`prefix-guide fixed bottom-19 left-3 z-40 max-h-[60vh] w-[min(560px,calc(100vw-24px))] overflow-y-auto rounded-sm border-hairline border-line bg-surface px-3 py-2 text-meta shadow-popover motion-safe:animate-rise-in [&.is-leaving]:pointer-events-none [&.is-leaving]:animate-sink-out`,sn=`min-w-[3ch] text-accent`,cn=`mb-1.5 flex justify-between gap-4`,ln=`columns-[2_220px] gap-x-5`,un=`mb-2 break-inside-avoid`,dn=`flex w-full gap-2.5 px-0 py-px text-left text-ink enabled:hover:bg-hover disabled:cursor-default touch:py-2.5`,fn=`mx-0 my-2 overflow-x-hidden overflow-y-auto scrollbar-none`,pn=e=>`flex w-full min-w-0 justify-between gap-4 rounded-sm px-1.5 py-0.75 text-left font-mono text-meta ${Bt} whitespace-pre text-ink touch:py-2.5 ${e?`is-selected bg-hover`:``}`,mn=`min-w-0 overflow-hidden text-ellipsis`,hn=`w-full rounded-none border-0 [border-bottom:var(--hairline)_solid_var(--line)] bg-transparent px-1.5 py-2 font-mono text-meta font-normal normal-nums text-ink focus-visible:outline-none`,gn=`flex justify-between gap-4`,_n=`flex flex-col items-end ${zt}`,vn=`mt-2 max-h-[52vh] overflow-y-auto`,yn=`mb-2.5`,bn=`m-0 mb-1 font-sans text-meta font-bold normal-nums text-accent`,xn=`flex gap-3 py-px ${zt}`,Sn=`min-w-[14ch] text-ink`,Cn=`keys-only fixed bottom-[34px] left-3 z-40 min-w-55 rounded-sm border-hairline border-line bg-surface px-3 py-2 font-mono text-meta ${Bt} text-ink shadow-popover`,wn=e=>`mb-0.5 ${e?`motion-safe:[animation:sink-out_140ms_ease-in_var(--hud-out,3860ms)_forwards]`:`motion-safe:[animation:rise-in_140ms_ease-out,sink-out_140ms_ease-in_var(--hud-out,3860ms)_forwards]`}`,Tn=`m-auto font-mono text-meta ${Bt} text-subtle`,En=`${Tn} flex flex-col items-center gap-3 [&_p]:m-0`,Dn=`workspace isolate row-1 flex min-h-0 min-w-0 flex-col gap-1.5 px-1 pt-2 pb-1`,On=`flex min-h-0 flex-1 overflow-hidden rounded-md border-hairline border-line bg-paper focus-within:border-focus`,kn=`working-flow:border-transparent working-flow:[background:linear-gradient(var(--paper),var(--paper))_0_0/100%_100%_padding-box,linear-gradient(90deg,var(--line),var(--task-ink,var(--focus)),var(--line),var(--task-ink,var(--focus)),var(--line))_0_0/300%_100%_border-box] working-flow:motion-safe:animate-flow-border`,An=`relative flex min-w-0 flex-1 flex-col`,jn=`relative flex min-h-0 min-w-0 flex-1 flex-col`,Mn=`term-host relative min-h-0 min-w-0 flex-1 touch-none overflow-clip`,Nn=`pointer-events-none absolute inset-0 z-5 h-full w-full`,Pn=`relative h-full [&.is-leaving]:pointer-events-none [&.is-leaving]:absolute [&.is-leaving]:inset-0 [&.is-leaving]:z-6`,Fn=`pointer-events-none absolute inset-0 z-1 overflow-hidden [&_pre]:m-0 [&_pre>div>div]:overflow-hidden [&_pre>div>div]:[height:var(--row-h,1.15em)] [&_pre>div>div]:[line-height:var(--row-h,1.15em)]`,In=e=>`absolute right-2.5 bottom-2.5 z-5 flex max-w-[calc(100%-20px)] flex-wrap items-center gap-x-3 gap-y-1 rounded-sm border-hairline border-line bg-inset px-2.5 py-1.25 font-mono text-meta ${Bt} ${e?`text-error`:`text-muted`} [&_.link:disabled]:pointer-events-none [&_.link:disabled]:opacity-60 [&_button]:whitespace-nowrap`,Ln=`col-span-full touch:[&_.link]:after:inset-[-2px_-6px_-4px] flex min-w-0 items-center gap-2 [border-top:var(--hairline)_solid_var(--line)] bg-surface px-3 py-1 font-mono text-meta ${Bt} whitespace-nowrap text-muted`,Rn=e=>`size-1.5 rounded-full ${e?`bg-warning`:`bg-subtle`}`,zn=`grid min-w-0 grid-cols-[auto_minmax(2rem,1fr)_auto] gap-x-2.5 gap-y-1 pt-2 pb-1 font-sans whitespace-nowrap text-meta text-subtle normal-nums`,Bn=`col-span-3 grid cursor-pointer grid-cols-subgrid items-center text-left hover:text-ink`,Vn={ok:`text-muted`,warn:`text-warning`,crit:`text-error`},Hn={ok:`text-success`,warn:`text-warning`,crit:`text-error`},Un=e=>`relative h-0.75 overflow-hidden rounded-full bg-[color-mix(in_srgb,currentColor_18%,transparent)] after:absolute after:inset-y-0 after:left-0 after:w-(--fill) after:rounded-full after:bg-current after:content-[''] ${Hn[e]??Hn.ok}`,Wn=`font-mono text-title font-bold normal-nums tracking-[0.02em] whitespace-nowrap`,Gn=`text-accent`,Kn=`grid h-full place-items-center p-6`,qn=`flex w-[min(460px,100%)] flex-col gap-3 rounded-md border-hairline border-line bg-surface p-6 [&_p]:m-0`,Jn=`flex flex-col gap-2 p-3.5 text-left font-sans text-meta ${Bt} leading-[1.5]`,Yn=`flex-none fill-none stroke-current [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:1.25]`,Xn=(e={})=>`relative grid cursor-pointer place-items-center rounded-sm border-none p-0 disabled:cursor-default disabled:opacity-35 [&_svg]:fill-none [&_svg]:stroke-current [&_svg]:[stroke-linecap:round] [&_svg]:[stroke-linejoin:round] [&_svg]:[stroke-width:1.25] touch:after:absolute touch:after:-inset-x-px touch:after:-top-2 touch:after:-bottom-1.25 touch:after:content-[''] touch:first:after:-left-2 ${e.tool?`size-5.5 flex-none`:`size-6.5`} ${e.tool||e.small?`[&_svg]:size-3.5`:`[&_svg]:size-4`} ${e.on?`bg-accent-soft text-accent`:`bg-transparent text-subtle enabled:hover:bg-hover enabled:hover:text-ink`}`,Zn=`absolute top-2 left-[calc(--spacing(2)+var(--shell-inset-left,0px))] z-7 flex items-center gap-0.5`,Qn=`[&.is-resizing_iframe]:pointer-events-none`,$n=e=>`side-panel ${Kt} relative row-1 flex min-h-0 min-w-0 flex-col ${Qn} ${e?`flex-1 p-0`:`pt-2 pr-1 pb-1 pl-0`}`,er=`grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)] [--divider:5px] ${Qn}`,tr=`side-col row-1 flex min-h-0 min-w-0 flex-col`,nr=e=>`side-head flex min-h-6.5 min-w-0 items-center gap-0.5 pb-1.5 font-mono text-meta normal-nums ${e?`px-2 pt-0`:`narrow:px-2 narrow:pt-0`}`,rr=`min-w-0 flex-1 truncate px-2 text-ink`,ir=`flex min-w-0 flex-1 items-center gap-0.5`,ar=`scrollbar-none flex min-w-0 gap-0.5 overflow-x-auto`,or=e=>`group/ptab relative flex min-w-12 max-w-40 items-center hover:text-ink ${e.active?`is-active text-ink`:`text-muted`} ${e.compact&&!e.active?`max-w-24 flex-none`:`flex-initial`}`,sr=e=>`flex min-w-0 cursor-pointer items-center gap-1.5 border-none bg-transparent py-1 pl-1.5 text-inherit [font:inherit] ${e?`pr-0.5`:`pr-1.5`}`,cr=`truncate`,lr=e=>`touch:relative size-4 flex-none cursor-pointer rounded-xs border-none p-0 font-mono text-title leading-none text-subtle hover:bg-hover hover:text-ink touch:after:absolute touch:after:-inset-1.5 touch:after:-left-1 touch:after:content-[''] ${e?`mr-0.5 bg-transparent`:`absolute top-1/2 right-0.5 -translate-y-1/2 bg-paper opacity-0 group-hover/ptab:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`}`,ur=`ml-auto flex gap-0.5`,dr=`relative row-1 cursor-col-resize touch-none before:absolute before:inset-y-0 before:left-[calc(var(--divider)/2)] before:w-px before:bg-line before:content-[''] hover:before:bg-line-active after:absolute after:inset-x-[-3px] after:inset-y-0 after:content-['']`,fr=`side-view flex min-h-0 min-w-0 flex-1 flex-col [&[hidden]]:hidden`,pr=`m-auto flex max-w-[44ch] flex-col items-center gap-2.5 p-4 text-center font-mono text-meta leading-[1.5] text-subtle normal-nums`,mr=`flex min-h-0 flex-1 flex-col gap-1.5`,hr=`flex items-center gap-0.5 [&_svg]:flex-none`,gr=`mx-0.5 min-w-0 flex-1 rounded-sm border-none bg-inset px-2 py-1 text-ink [font-size:var(--fs-meta)] focus:bg-hover focus:outline-none aria-invalid:text-muted`,_r=`min-w-0 flex-1 rounded-sm border-none bg-paper`,vr=`relative flex min-h-0 min-w-0 flex-1`,yr=`absolute inset-0 size-full cursor-crosshair touch-none fill-none stroke-accent [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:2.5]`,br=t((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})),W=t(((e,t)=>{t.exports=br()}))(),xr=({danger:e=!1}={})=>`rounded-sm font-sans text-meta not-italic normal-nums text-paper active:scale-97 motion-reduce:active:scale-none disabled:cursor-default disabled:opacity-50 touch:min-h-10 ${e?`bg-error`:`bg-accent`} px-3.5 py-1.5 font-semibold`,Sr={link:`text-accent hover:underline`,filled:xr(),danger:xr({danger:!0}),action:`rounded-sm border-hairline border-line bg-inset px-3 py-1.5 font-sans text-meta text-ink hover:border-line-active hover:bg-menu active:scale-97 motion-reduce:active:scale-none disabled:cursor-default disabled:opacity-50 touch:min-h-10 focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,floating:`whitespace-nowrap rounded-sm border-hairline border-line-active bg-surface px-2 py-0.5 font-mono text-meta text-ink shadow-popover`,row:``,pill:`inline-flex flex-none items-center gap-1.5 whitespace-nowrap font-mono text-meta text-muted hover:text-ink aria-[current=true]:text-accent`,icon:Xn({small:!0}),iconOn:Xn({small:!0,on:!0}),card:`flex min-w-0 flex-col gap-1.5 rounded-sm border-hairline p-1.5 text-left focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`},Cr={roomy:`relative touch:after:absolute touch:after:content-[''] touch:after:-inset-x-1.5 touch:after:-inset-y-3`,tight:`relative touch:after:absolute touch:after:content-[''] touch:after:-inset-x-0.75 touch:after:-inset-y-0.5`,none:``};function G({variant:e=`link`,hit:t=e===`link`?`roomy`:`none`,className:n,type:r=`button`,...i}){return(0,W.jsx)(`button`,{type:r,className:Rt(Sr[e],Cr[t],n),...i})}var wr=`mx-2.5 my-3 font-mono text-meta text-subtle`,Tr=`font-sans text-meta text-subtle`,Er=`m-0 max-h-[38vh] overflow-auto rounded-sm border-hairline border-line bg-paper px-3 py-2.5 font-mono text-meta leading-[1.5] whitespace-pre-wrap wrap-anywhere`,Dr=e=>`flex w-full flex-col gap-0.5 rounded-sm px-2.5 py-1.5 text-left focus-visible:bg-accent-soft focus-visible:outline-none ${e?`bg-accent-soft`:``}`,Or=`mx-0 mt-1 mb-0 max-h-47 list-none overflow-y-auto rounded-sm border-hairline border-line bg-inset p-0.5 font-mono text-meta`,kr=e=>`block w-full cursor-pointer overflow-hidden rounded-[calc(var(--radius-sm)-2px)] px-2 py-0.75 text-left text-ellipsis whitespace-nowrap [font:inherit] touch:py-2.5 ${e.cursor?`bg-hover`:``} ${e.accent?`text-accent`:e.cursor?`text-ink`:`text-muted`}`,Ar=`m-0 font-sans text-meta font-medium normal-nums`,jr=`link text-accent [&:hover]:underline touch-hit`,Mr=`rounded-sm border-hairline border-line bg-paper font-mono text-meta font-normal normal-nums text-ink focus-visible:border-line-active focus-visible:outline-none`,Nr=`${Mr} w-full px-2.5 py-2`,Pr=`actions flex items-center justify-end gap-3.5`;function Fr({failing:e=!1}){U();let[t,n]=(0,m.useState)(``),[r,o]=(0,m.useState)(!1);return(0,W.jsx)(`div`,{className:Kn,children:(0,W.jsxs)(`form`,{className:qn,onSubmit:e=>{e.preventDefault();let n=Lt(t);if(!n){o(!0);return}i(n),window.location.reload()},children:[(0,W.jsxs)(`span`,{className:Wn,children:[(0,W.jsx)(`span`,{className:Gn,children:`[`}),` rove `,(0,W.jsx)(`span`,{className:Gn,children:`]`})]}),(0,W.jsx)(`h1`,{className:`${Ar} text-muted`,children:H(`connect.title`)}),(0,W.jsx)(`p`,{className:e?`text-error`:`text-muted`,children:H(e?`connect.failing`:`connect.body`)}),(0,W.jsx)(`input`,{className:Nr,autoFocus:!0,spellCheck:!1,placeholder:H(`connect.placeholder`),value:t,onChange:e=>{n(e.target.value),o(!1)}}),r&&(0,W.jsx)(`p`,{className:`text-error`,children:H(`connect.invalid`)}),(0,W.jsxs)(`div`,{className:Pr,children:[e&&(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>{a(),window.location.reload()},children:H(`connect.forget`)}),(0,W.jsx)(`button`,{type:`submit`,className:xr(),children:H(`connect.submit`)})]})]})})}var Ir=`flex flex-col gap-1.5`,Lr=`min-h-18 max-h-[50vh] leading-[1.45]`,Rr=`flex flex-wrap gap-1.5`,zr=(e=!1,t=!1)=>`rounded-sm border-hairline px-2.5 py-1 font-mono text-meta font-normal not-italic normal-nums ${e?`border-accent bg-accent-soft text-ink`:`border-line hover:bg-hover ${t?`text-subtle`:`text-muted`}`}`,Br=`m-0 list-none p-0`,Vr=`overlay fixed inset-0 z-20 grid justify-items-center [align-items:start] bg-(--scrim) pt-[12vh] motion-safe:animate-fade-in [&.is-leaving]:pointer-events-none [&.is-leaving]:animate-fade-out short:pt-3`,Hr=(e=!1)=>`dialog static m-0 flex max-h-[76vh] ${e?`w-[min(620px,calc(100vw-32px))]`:`w-[min(440px,calc(100vw-32px))]`} flex-col gap-3 rounded-md border-hairline border-line bg-surface px-5 py-4.5 text-inherit shadow-dialog focus:outline-none motion-safe:animate-rise-in [.is-leaving_&]:animate-sink-out short:max-h-[calc(100dvh-24px)] short:px-4 short:py-3`,Ur=`flex items-center justify-between gap-3`,Wr=`m-0 min-w-0 font-sans text-title leading-[1.4] font-semibold normal-nums text-ink wrap-anywhere`,Gr=`grid size-6 place-items-center -my-1 mr-[-6px] ml-0 rounded-sm text-display leading-none text-muted hover:bg-inset hover:text-ink focus-visible:bg-inset focus-visible:text-ink touch:relative touch:after:absolute touch:after:-inset-2.5 touch:after:content-['']`,Kr=`dialog-body -m-0.5 flex min-h-0 flex-col gap-3 overflow-y-auto p-0.5 [&_p]:m-0 [&>.actions]:sticky [&>.actions]:-bottom-0.5 [&>.actions]:bg-surface [.dialog-body+div>&]:mt-3.5`,qr=(e=!1)=>`menu fixed z-30 flex max-h-[calc(100vh-16px)] ${e?`min-w-40`:`min-w-50`} origin-top-left flex-col overflow-y-auto rounded-md border-hairline border-line bg-surface p-1 shadow-popover motion-safe:animate-menu-in [&.is-leaving]:pointer-events-none [&.is-leaving]:animate-sink-out`,Jr=e=>`flex items-baseline justify-between gap-6 rounded-[calc(var(--radius)-4px)] px-2.5 py-1.25 text-left text-body leading-[inherit] touch:py-2.5 ${e.danger&&e.selected?`bg-error text-paper`:e.selected||e.open?`bg-hover`:``} ${e.danger&&!e.selected?`text-error`:``} ${e.selected?`forced-colors:outline-2 forced-colors:-outline-offset-2 forced-colors:outline-[Highlight] forced-colors:outline-solid`:``}`,Yr=`font-mono text-meta normal-nums`,Xr=e=>`${Yr} ${e.danger&&e.selected?`text-inherit`:e.selected?`text-muted`:`text-subtle`} touch:hidden!`,Zr=e=>`${Yr} ${e?`text-ink`:`text-subtle`}`,Qr=`${Yr} text-accent`,$r=`fixed right-3.5 bottom-8.5 z-40 flex flex-col gap-1.5 narrow:pointer-events-none narrow:top-12 narrow:bottom-auto narrow:left-3.5 narrow:items-end narrow:*:pointer-events-auto`,ei=`flex cursor-default items-baseline gap-x-3`,ti=`min-w-0 flex-1`,ni=`flex-none whitespace-nowrap font-mono`,ri=e=>`toast max-w-105 cursor-pointer rounded-sm border-hairline border-line bg-inset px-3 py-1.5 text-left font-sans text-meta normal-nums wrap-anywhere ${e?`text-error`:`text-ink`} motion-safe:animate-rise-in [&.is-leaving]:pointer-events-none [&.is-leaving]:animate-sink-out`,ii=`text-subtle`,ai=`flex items-baseline justify-between gap-3`,oi=`mt-1`,si=`m-0 flex list-none flex-col gap-0.5 p-0`,ci=`flex min-w-0 items-baseline gap-2.5`,li=`flex-none font-mono text-meta font-normal normal-nums min-w-[3ch] text-right text-subtle`,ui=`flex items-baseline gap-1`,di=`min-w-0 flex-1`,fi=`flex-none min-w-[calc(9ch+0.5rem)] whitespace-nowrap pr-2 text-right font-mono text-meta`,pi=`font-mono [&:hover]:text-accent`,mi={row:`min-h-6.5 touch:min-h-10`,file:`min-h-6 font-mono text-meta touch:min-h-10`,"file-narrow":`min-h-9 font-mono text-meta`,pane:`min-h-5.5 touch:min-h-10`},hi=`bg-hover cursor-grabbing scale-[1.02] motion-reduce:scale-none`;function gi(e){let t=e.stack?`flex-col items-stretch gap-0.5 px-2.5 py-1.5`:`items-center gap-2 px-2 py-0.75`,n=e.lifted?hi:e.moving?`bg-accent-soft`:e.selected?`bg-menu`:`hover:bg-hover data-menu-open:bg-hover`;return`relative flex w-full rounded-sm text-left ${e.lifted?``:`active:scale-97 motion-reduce:active:scale-none`} ${e.grab&&!e.lifted?`cursor-grab`:``} ${t} ${mi[e.size??`row`]} ${n}`}var _i=`row-title min-w-0 flex-1 truncate`,vi=`row-title min-w-0 flex-auto truncate text-(length:--fs-title)`,yi=`running-shimmer:bg-[linear-gradient(90deg,var(--ink)_0%,var(--ink)_35%,var(--accent)_50%,var(--ink)_65%,var(--ink)_100%)] running-shimmer:bg-size-[300%_100%] running-shimmer:bg-clip-text running-shimmer:text-transparent running-shimmer:animate-shimmer`,bi=`w-[1ch] flex-none text-center font-mono`,xi=`grid w-[2ch] flex-none place-items-center font-mono text-subtle`,Si=`flex flex-none gap-1.5 font-mono text-meta`;function K(e){return e instanceof Error?e.message:String(e)}function Ci(e){U();let t=(0,m.useRef)(null);return(0,m.useEffect)(()=>{t.current&&!t.current.contains(document.activeElement)&&t.current.focus();let e=e=>{e.key===`Escape`&&(e.preventDefault(),B())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.jsx)(`div`,{className:Vr,onMouseDown:e=>e.target===e.currentTarget&&B(),children:(0,W.jsxs)(`dialog`,{ref:t,tabIndex:-1,open:!0,className:Hr(e.wide),"aria-label":e.title,children:[(0,W.jsxs)(`div`,{className:Ur,children:[(0,W.jsx)(`h1`,{className:Wr,children:e.title}),(0,W.jsx)(`button`,{type:`button`,className:Gr,"aria-label":H(`dialog.close`),title:H(`dialog.close`),onClick:B,children:`×`})]}),e.children]})})}function wi(){let[e,t]=(0,m.useState)(!1),[n,r]=(0,m.useState)(null);return{busy:e,error:n,setError:r,submit:async e=>{t(!0),r(null);try{await e(),B()}catch(e){r(K(e))}finally{t(!1)}}}}function Ti(e){let[t,n]=(0,m.useState)(e.initial??``),{busy:r,error:i,submit:a}=wi();return(0,W.jsx)(Ci,{title:e.title,children:(0,W.jsxs)(`form`,{className:Kr,onSubmit:n=>{n.preventDefault(),(t.trim()||e.allowEmpty)&&a(()=>e.onSubmit(t.trim()))},children:[e.multiline?(0,W.jsx)(`textarea`,{className:`${Nr} ${Lr}`,"aria-label":e.title,autoFocus:!0,rows:4,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},onFocus:e=>e.currentTarget.setSelectionRange(t.length,t.length)}):(0,W.jsx)(`input`,{className:Nr,"aria-label":e.title,autoFocus:!0,spellCheck:!1,value:t,onChange:e=>n(e.target.value),onFocus:e=>e.currentTarget.select()}),i&&(0,W.jsx)(`p`,{className:`text-error`,children:i}),(0,W.jsx)(Di,{busy:r,submitLabel:e.submitLabel})]})})}function q(e){let{busy:t,error:n,setError:r,submit:i}=wi(),[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(null),[l,u]=(0,m.useState)(!1),d=(0,m.useRef)(null);(0,m.useEffect)(()=>d.current?.focus(),[]);let f=t=>void i(async()=>{try{a&&e.escalate?await e.escalate.run(l):await(t&&e.secondary?e.secondary.onConfirm():e.onConfirm())}catch(n){throw!a&&e.escalate?.when(n)&&(o(!0),c(n),u(t),r(K(n))),n}});return(0,W.jsx)(Ci,{title:a&&e.escalate?.title||e.title,children:(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsx)(`p`,{className:`whitespace-pre-line text-muted`,children:a&&e.escalate?.body?e.escalate.body(s):e.body}),n&&!(a&&e.escalate?.body)&&(0,W.jsx)(`p`,{className:`text-error`,children:n}),(0,W.jsxs)(`div`,{className:Pr,children:[(0,W.jsx)(`button`,{type:`button`,className:jr,onClick:B,children:H(`dialog.cancel`)}),e.secondary&&!a&&(0,W.jsx)(`button`,{type:`button`,className:xr({danger:!0}),disabled:t,onClick:()=>f(!0),children:e.secondary.label}),(0,W.jsx)(`button`,{ref:d,type:`button`,className:xr({danger:!0}),disabled:t,onClick:()=>f(!1),children:a&&e.escalate?e.escalate.label:e.confirmLabel})]})]})})}function Ei(e){let t=Math.max(0,e.choices.findIndex(t=>t.value===e.current)),[n,r]=(0,m.useState)(t),{busy:i,error:a,submit:o}=wi(),s=t=>void o(()=>e.onPick(t));return(0,m.useEffect)(()=>{let t=t=>{if(t.key===`ArrowDown`||t.key===`j`)r(t=>Math.min(e.choices.length-1,t+1));else if(t.key===`ArrowUp`||t.key===`k`)r(e=>Math.max(0,e-1));else if(t.key===`Enter`){let t=e.choices[n];t&&s(t.value)}else return;t.preventDefault()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)}),(0,W.jsx)(Ci,{title:e.title,children:(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsx)(`ul`,{className:Br,children:e.choices.map((t,a)=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"aria-pressed":t.value===e.current,disabled:i,className:gi({selected:a===n}),onMouseEnter:()=>r(a),onClick:()=>s(t.value),children:[(0,W.jsx)(`span`,{className:`${bi} text-accent`,children:t.value===e.current?`●`:` `}),(0,W.jsx)(`span`,{className:_i,children:t.label})]})},t.value))}),a&&(0,W.jsx)(`p`,{className:`text-error`,children:a})]})})}function Di({busy:e,submitLabel:t}){return(0,W.jsxs)(`div`,{className:Pr,children:[(0,W.jsx)(`button`,{type:`button`,className:jr,onClick:B,children:H(`dialog.cancel`)}),(0,W.jsx)(`button`,{type:`submit`,className:xr(),disabled:e,children:t})]})}function Oi(e,t){let n=window.setInterval(()=>{(typeof document>`u`||document.visibilityState===`visible`)&&t()},e),r=()=>{document.visibilityState===`visible`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{window.clearInterval(n),document.removeEventListener(`visibilitychange`,r)}}var ki={cancel:`Cancel`,failureHint:"Run `{command}` for diagnosis and next steps.",toastFailureHint:`Next: run rove doctor`,loading:`Loading…`,create:`create`,confirm:`Confirm`,paneCrash:{title:`This pane crashed`,hint:`The error was logged to client.log. Retry, or restart Rove if it keeps happening.`,regionTitle:`The {region} hit an error`,regionHint:"The rest of Rove keeps working. Retry below; if it persists, inspect client.log and run `rove doctor`.",retry:`[ retry ]`,region:{sidebar:`task list`,workspace:`workspace`,files:`file tree`,page:`page`}},rename:{defaultTitle:`Rename task`,defaultFieldLabel:`TITLE`,footerHint:`enter {submitLabel} · esc cancel`,defaultSubmitLabel:`rename`},prompt:{fieldLabel:`input`,submitLabel:`submit`}},Ai={cancel:`取消`,failureHint:"运行 `{command}` 查看诊断和后续步骤。",toastFailureHint:`下一步:运行 rove doctor`,loading:`加载中…`,create:`创建`,confirm:`确认`,paneCrash:{title:`此面板已崩溃`,hint:`错误已记录到 client.log。可重试;若反复出现请重启 Rove。`,regionTitle:`{region}出错了`,regionHint:"Rove 的其余部分仍可正常使用。请在下方重试;若问题持续,请查看 client.log 并运行 `rove doctor`。",retry:`[ 重试 ]`,region:{sidebar:`任务列表`,workspace:`工作区`,files:`文件树`,page:`页面`}},rename:{defaultTitle:`重命名任务`,defaultFieldLabel:`名称`,footerHint:`enter {submitLabel} · esc 取消`,defaultSubmitLabel:`重命名`},prompt:{fieldLabel:`输入`,submitLabel:`提交`}},ji={fix:{hint:"{count} finding(s) above have a known fix — run `{command}` to review them one by one",none:`fix: nothing to fix — no known remediation applies to this report`,header:`fixes — each one asks before running:`,willRun:`will run: {command}`,confirmPrompt:`apply this fix? [y/N] `,done:`✓ done`,failed:`✗ exited with code {code}; inspect the command output above, then rerun rove doctor`,skipped:`· skipped`,nonInteractive:`no interactive terminal — nothing was executed; run the commands above yourself`,manualHeader:`manual steps — doctor prints these but never runs them:`,daemonRestartWhy:`safe to run: engine sessions live in the separate PTY host and survive a daemon restart`,daemonStale:`restart the daemon — it is running an older build than this CLI`,daemonDown:`start the daemon — it is not running`,hooksDown:`restart the daemon to re-establish the engine hook channel`,inspectStale:`restart the daemon — it predates the hook-channel check`,skillInstallWhy:`safe to run: installs skill files only; re-running is idempotent`,skillMissing:`install the Rove agent skill`,skillStale:`update the Rove agent skill to the version this build expects`,spawnHelper:`restore the exec bit on node-pty's spawn-helper — every node-pty PTY spawn fails without it`,spawnHelperWhy:"safe to run: chmod on two prebuilt binaries; idempotent, and `bun install` does the same",resetWhy:`stops the daemon, the PTY host, and every live session — not undoable, so doctor only prints it`,resetDaemonWedged:`the daemon process is alive but unreachable (wedged)`,resetPty:`the PTY host process is alive but its socket is unreachable (wedged)`,resetPtyStale:`the PTY host is still running an older build than the one you launched`,resetLegacy:`pre-v0.8 tmux sessions are still holding processes and memory`,orphans:`{count} process(es) outlived the PTY session that spawned them and are still running`,orphansWhy:`kills processes, which is not undoable — and a task you backgrounded on purpose looks the same; read the list, then run it yourself`,engineTabs:`engine tabs may hold a stale daemon socket path`,engineTabsAction:`close and reopen the affected engine tabs in the TUI`,engineTabsWhy:`kills that tab's live engine session — your call, not doctor's`,staleInstall:`the install this Rove runs from no longer exists on disk`,staleInstallAction:`npm install -g @sma1lboy/rove, then relaunch Rove`,staleInstallWhy:`doctor cannot reinstall Rove over the running process — a human has to, then relaunch`,humanOnlyWhy:`doctor does not install software or log in to accounts for you`,git:`git is not on PATH`,gitAction:`install git with your OS package manager`,noEngine:`no usable engine — no engine CLI is both installed and logged in`,noEngineAction:`install an engine CLI (claude, codex, copilot, or kimi) and log in`,noEngineLogin:`no usable engine — an engine CLI is installed but not signed in`,noEngineLoginAction:`run one of the installed engine CLIs ({list}) in a shell and complete its login`,windowsNode:`Node.js is missing — the Windows PTY host cannot start`,windowsNodeAction:`install Node.js from https://nodejs.org`,staleBun:`the Bun running Rove is older than this build supports — terminals will not paint`,staleBunAction:"upgrade Bun (`bun upgrade`, `brew upgrade bun`, or `npm install -g bun@latest`), then relaunch Rove"}},Mi={fix:{hint:"上面有 {count} 项发现存在已知修法 — 运行 `{command}` 逐条查看",none:`fix: 无可修项 — 本次报告没有匹配到已知修法`,header:`修复项 — 每一条都会先询问再执行:`,willRun:`将执行: {command}`,confirmPrompt:`执行这条修复吗? [y/N] `,done:`✓ 完成`,failed:`✗ 退出码 {code};请检查上方命令输出,再运行 rove doctor`,skipped:`· 已跳过`,nonInteractive:`没有交互终端 — 未执行任何命令; 请自行运行上面的命令`,manualHeader:`人工步骤 — doctor 只打印, 永远不会替你执行:`,daemonRestartWhy:`可安全执行: 引擎会话在独立的 PTY host 里, daemon 重启后仍然存活`,daemonStale:`重启 daemon — 它运行的构建比当前 CLI 旧`,daemonDown:`启动 daemon — 它当前没有在运行`,hooksDown:`重启 daemon 以重建引擎 hook 通道`,inspectStale:`重启 daemon — 它的版本早于 hook 通道检查`,skillInstallWhy:`可安全执行: 只写入 skill 文件; 重复运行是幂等的`,skillMissing:`安装 Rove agent skill`,skillStale:`把 Rove agent skill 更新到当前构建期望的版本`,spawnHelper:`恢复 node-pty spawn-helper 的可执行位 — 缺了它 node-pty 的每次 PTY 启动都会失败`,spawnHelperWhy:"可安全执行: 只对两个预编译二进制做 chmod; 幂等, `bun install` 也会做同样的事",resetWhy:`会停掉 daemon、PTY host 和所有活动会话 — 不可撤销, 所以 doctor 只打印`,resetDaemonWedged:`daemon 进程存活但无法连接 (卡死)`,resetPty:`PTY host 进程存活但 socket 无法连接 (卡死)`,resetPtyStale:`PTY host 仍在跑比你启动的版本更旧的构建`,resetLegacy:`v0.8 之前的 tmux 会话仍占用进程和内存`,orphans:`有 {count} 个进程比启动它们的 PTY 会话活得更久, 现在还在运行`,orphansWhy:`会杀进程, 不可撤销 — 而且你故意放后台的任务看起来一模一样; 先看清单, 再自己执行`,engineTabs:`引擎 tab 可能持有过期的 daemon socket 路径`,engineTabsAction:`在 TUI 里关闭并重开受影响的引擎 tab`,engineTabsWhy:`会杀掉该 tab 的活动引擎会话 — 由你决定, doctor 不代劳`,staleInstall:`当前 Rove 所在的安装已从磁盘删除`,staleInstallAction:`npm install -g @sma1lboy/rove, 然后重新启动 Rove`,staleInstallWhy:`doctor 无法在运行中的进程上重装 Rove — 需要人工重装后重新启动`,humanOnlyWhy:`doctor 不会替你安装软件或登录账号`,git:`PATH 上找不到 git`,gitAction:`用你的系统包管理器安装 git`,noEngine:`没有可用引擎 — 没有任何引擎 CLI 同时满足已安装且已登录`,noEngineAction:`安装任一引擎 CLI(claude、codex、copilot 或 kimi)并登录`,noEngineLogin:`没有可用引擎 — 引擎 CLI 已安装, 但没有登录`,noEngineLoginAction:`在 shell 里运行已安装的引擎 CLI({list})之一并完成登录`,windowsNode:`缺少 Node.js — Windows PTY host 无法启动`,windowsNodeAction:`从 https://nodejs.org 安装 Node.js`,staleBun:`运行 Rove 的 Bun 版本低于本构建的要求 — 终端不会有任何输出`,staleBunAction:"升级 Bun (`bun upgrade` / `brew upgrade bun` / `npm install -g bun@latest`), 然后重新启动 Rove"}},Ni={mentionNoEngine:`No engine session in this task — nothing to mention into. Open one with ctrl+t.`,tabs:{all:`All`,changes:`Changes`},actions:{diffAll:`[D] diff everything`},legend:{changes:`M modified · A added · D deleted · ? untracked`},scope:{working:`scope: working tree`,branch:`scope: vs {base}`,toggleHint:`b to toggle`,noBase:`no base ref for branch scope (no origin/HEAD, main or master)`},empty:{noTask:`(no task — press n to create)`,noFiles:`(empty worktree)`,noChanges:`(no changes — clean worktree)`},error:{retryHint:`press r to retry`,notGitRepo:"not a git repository — run `git init` here, or open a task in a repo",pathMissing:`the worktree directory is gone — reopen the task to re-create it`,permissionDenied:`permission denied reading the worktree — check the directory's owner and mode`,gitNotInstalled:`git is not on PATH — install it with your OS package manager`,gitFailed:"git command failed; run `git status` in this worktree to diagnose"},toast:{prOnTargetBranch:`Already on the target branch ({branch}) — ask the agent to create the PR from a task branch`,noPausedOperation:`Nothing to resolve — no merge, rebase or cherry-pick is paused here`,conflictReadFailed:`Git could not read the conflicted files. Run git status in this worktree, then retry.`,conflictSendFailed:`Could not send the conflict prompt. Open an engine tab in this task, then retry.`,ciNoFailingChecks:`No failing check logs to read — the run may have expired, or the checks are no longer red`,ciChecksUnavailable:"gh could not read this PR's checks: {detail}. Run `gh auth status`, then retry."}},Pi={mentionNoEngine:`这个任务没有引擎会话——没有地方可以提及。用 ctrl+t 开一个。`,tabs:{all:`全部`,changes:`改动`},actions:{diffAll:`[D] 查看全部改动`},legend:{changes:`M 已修改 · A 已添加 · D 已删除 · ? 未跟踪`},scope:{working:`范围:工作区改动`,branch:`范围:对比 {base}`,toggleHint:`按 b 切换`,noBase:`分支范围没有基准 ref(没有 origin/HEAD、main 或 master)`},empty:{noTask:`(暂无任务 — 按 n 创建)`,noFiles:`(worktree 为空)`,noChanges:`(无改动 — worktree 干净)`},error:{retryHint:`按 r 重试`,notGitRepo:"不是 git 仓库——在这里执行 `git init`,或改为打开仓库里的任务",pathMissing:`worktree 目录已不存在——重新打开该任务会重建它`,permissionDenied:`读取 worktree 时权限不足——请检查该目录的属主和权限`,gitNotInstalled:`PATH 上找不到 git——请用系统包管理器安装`,gitFailed:"git 命令失败;请在此 worktree 运行 `git status` 诊断"},toast:{prOnTargetBranch:`当前就在目标分支({branch})— 请在任务分支上让 agent 创建 PR`,noPausedOperation:`没有要解决的冲突——这里没有暂停中的合并、变基或拣选`,conflictReadFailed:`Git 无法读取冲突文件。请在此 worktree 运行 git status,然后重试。`,conflictSendFailed:`无法发送冲突提示。请在此任务中打开一个引擎标签页,然后重试。`,ciNoFailingChecks:`没有可读的失败检查日志——运行记录可能已过期,或检查已不再是红的`,ciChecksUnavailable:"gh 读不到这个 PR 的检查状态:{detail}。请运行 `gh auth status`,然后重试。"}},Fi={retryHint:`Correct the field above, then choose Create again.`,title:`New task`,legend:`{enter} · tab complete/fields · ctrl+[ ] mode · ctrl+e engine · esc cancel`,enterCreate:`enter create`,hero:`Pick a project and an engine, then describe the task. It starts with your first message.`,chipWorktree:`Worktree`,chipProject:`Project`,enterNext:`enter next field`,tabs:{existing:`For Existing`,clone:`For New Repo`,adopt:`Adopt Worktree`},field:{mode:`MODE`,tier:`DEPTH`,engine:`ENGINE`,effort:`EFFORT`,repo:`REPO`,fromBranch:`FROM BRANCH`,prompt:`FIRST MESSAGE`,extras:`ALSO INCLUDE`,gitUrl:`GIT URL`,parentDir:`PARENT DIR`,folderName:`FOLDER NAME`,baseBranch:`BASE BRANCH`,adoptFilter:`FILTER (PATH GLOB)`,opens:`OPENS`},intent:{task:`a new task worktree`,project:`the project itself`},placeholder:{folderName:`auto from url`,adoptFilter:`* — type e.g. feature-* to narrow`,prompt:`Describe a task or ask a question (optional)`},hint:{modeCycle:`ctrl+[ ]`,engineCycle:`ctrl+e`,remembered:`(remembered — next clone defaults to this dir)`,currentDir:`(current dir)`,noBranchesFound:`(no local branches found — typed text will be used as ref)`,noMatchBranch:`(no match — typed text will be used as ref)`,scanningWorktrees:`scanning worktrees…`,extrasNone:`(none — enter picks a repo; the first is the primary)`,extrasPicked:`{count} more repo(s) in this task`},picker:{moreAbove:`↑ {count} more`,moreBelow:`↓ {count} more`},scroll:{moreAbove:`↑ {count} more rows`,moreBelow:`↓ {count} more rows`},open:{failed:`Couldn't open the project: {error}`},adopt:{repoLine:`repo: {path}`,repoNone:`(none)`,noUnlinked:`no unlinked worktrees — every git worktree here is already a task`,noMatch:`no worktrees match the filter`,hintSelected:`{count} selected · enter toggles · ctrl+a all · Create imports`,hintDefault:`enter toggles · ctrl+a all · Create imports the highlighted row`,summaryAll:`Adopted {count} worktree(s)`,summaryPartial:`Adopted {done}/{total} worktrees — the rest failed (see log)`,summaryNone:`Couldn't adopt any worktree: {error}`},clone:{progressFallback:`Cloning…`,progressInto:`Cloning into {target}…`},button:{create:`Create`,cloning:`Cloning…`},error:{gitUrlRequired:`git URL is required`,gitUrlInvalid:`does not look like a git URL: {url}`,folderRequired:`folder name is required`,folderHasSeparator:`folder name cannot contain path separators`,parentRequired:`parent directory is required`,parentNotFound:`parent directory does not exist: {path}`,parentNotDir:`not a directory: {path}`,targetExists:`target already exists: {path}`,cloneFailed:`git clone failed: {error}`,noAdoptable:`no adoptable worktrees to import`,repoAmbiguous:`more than one saved repo is named {name} — pick the one you mean from the list`,tierUnavailable:`{tier} points at engine {engine}, which is not available here — retarget it in Settings → Auto routing`}},Ii={retryHint:`请修正上方字段,然后再次选择创建。`,title:`新建任务`,legend:`{enter} · tab 补全/切字段 · ctrl+[ ] 切模式 · ctrl+e 引擎 · esc 取消`,enterCreate:`enter 创建`,hero:`选好项目和引擎,再描述任务。任务从你的第一条消息开始。`,chipWorktree:`工作树`,chipProject:`项目`,enterNext:`enter 下一个字段`,tabs:{existing:`已有仓库`,clone:`克隆新仓库`,adopt:`接管 Worktree`},field:{mode:`模式`,tier:`深度`,engine:`引擎`,effort:`推理强度`,repo:`仓库`,fromBranch:`基准分支`,prompt:`第一条消息`,extras:`同时包含`,gitUrl:`git 地址`,parentDir:`父目录`,folderName:`文件夹名`,baseBranch:`基准分支`,adoptFilter:`过滤(路径 glob)`,opens:`打开`},intent:{task:`新建任务 worktree`,project:`项目本身`},placeholder:{folderName:`自动从地址推导`,adoptFilter:`* — 输入如 feature-* 来缩小范围`,prompt:`描述一个任务,或提个问题(可选)`},hint:{modeCycle:`ctrl+[ ]`,engineCycle:`ctrl+e`,remembered:`(已记住 — 下次克隆默认使用此目录)`,currentDir:`(当前目录)`,noBranchesFound:`(未找到本地分支 — 将直接使用输入文本作为 ref)`,noMatchBranch:`(无匹配 — 将直接使用输入文本作为 ref)`,scanningWorktrees:`正在扫描 worktree…`,extrasNone:`(未选 — 回车选一个仓库,第一个是主仓库)`,extrasPicked:`任务里另含 {count} 个仓库`},picker:{moreAbove:`↑ 还有 {count} 项`,moreBelow:`↓ 还有 {count} 项`},scroll:{moreAbove:`↑ 上方还有 {count} 行`,moreBelow:`↓ 下方还有 {count} 行`},open:{failed:`无法打开项目:{error}`},adopt:{repoLine:`仓库:{path}`,repoNone:`(无)`,noUnlinked:`没有未关联的 worktree — 此仓库所有 git worktree 均已是任务`,noMatch:`没有 worktree 匹配此过滤条件`,hintSelected:`已选 {count} 项 · enter 切换选中 · ctrl+a 全选 · 创建 导入`,hintDefault:`enter 切换选中 · ctrl+a 全选 · 创建 将导入高亮行`,summaryAll:`已接管 {count} 个 worktree`,summaryPartial:`已接管 {done}/{total} 个 worktree — 其余失败(详见日志)`,summaryNone:`没有 worktree 接管成功:{error}`},clone:{progressFallback:`克隆中…`,progressInto:`正在克隆到 {target}…`},button:{create:`创建`,cloning:`克隆中…`},error:{gitUrlRequired:`git 地址不能为空`,gitUrlInvalid:`不像是有效的 git 地址:{url}`,folderRequired:`文件夹名不能为空`,folderHasSeparator:`文件夹名不能包含路径分隔符`,parentRequired:`父目录不能为空`,parentNotFound:`父目录不存在:{path}`,parentNotDir:`不是目录:{path}`,targetExists:`目标路径已存在:{path}`,cloneFailed:`git clone 失败:{error}`,noAdoptable:`没有可接管的 worktree`,repoAmbiguous:`有多个已保存仓库都叫 {name} — 请从列表中选择你要的那个`,tierUnavailable:`{tier} 指向的引擎 {engine} 在这台机器上不可用——去 设置 → 自动路由 重新指定`}},Li={engineTitle:`Engine and account`,engineChecking:`Checking installed engines and accounts…`,engineReady:`✓ Ready to start a task`,engineMissing:`No usable engine yet`,engineUsable:`✓ {engine}: ready`,engineSignedOut:`! {engine}: installed, not signed in`,engineSetup:"Install an engine using docs.rove.run/rove/engines, then run its CLI and sign in. Run `rove doctor --fix` to check setup; Settings → Engines lists integrations.",engineContinue:`❯ Continue to optional setup`,engineLegend:`enter continue · esc skip optional setup`,quickStart:`Start a task with a prompt`,quickIntent:`Creates an isolated worktree and branch. Use {key} for the full task dialog.`,tabShared:`New conversations share this task’s files`,tabIsolated:`{key}: new task, isolated worktree`,title:`Welcome to Rove`,subtitle:`Managed tasks get isolated worktrees and branches. Directory and project tasks reuse existing files.`,completionsLabel:`Shell completions for {shell}`,completionsExplain:`Tab-completes rove subcommands. One line is added to your shell config.`,skillLabel:`Rove agent skill`,skillExplain:`Lets the coding agents on this machine drive Rove themselves: start tasks, read other sessions, message them.`,optionYes:`Install`,recommended:`recommended`,stepCounter:`{n} / {total}`,optionNo:`Not now`,queued:`Queued — installs when you quit Rove`,skillInstalled:`Installed for {engines}`,skillFailed:`Install failed: {reason}`,skillNoEngines:`No coding agent here takes the skill`,skipped:`Skipped`,installFailed:`! {item} failed: {reason}. Retry: {command} (or quit Rove again).`,legend:`↑↓ select · enter confirm · esc close`,keysTitle:`Keyboard basics`,keysBare:`Bare keys act in the focused pane — {nav} moves, {open} opens.`,keysOnePress:`A few one-press chords are Rove's own — {newTab} new tab, {focusNext} next pane.`,keysPrefix:`{prefix} opens the command map — hold it a beat and a guide appears.`,keysHelp:`{help} shows the full live reference anytime.`,keysNext:`Next: Settings → Engines lists every engine and installs its activity hooks.`,keysLegend:`enter finish`,appliedCompletions:`✓ completions hooked into {path} (takes effect in new shells)`,keptCompletions:`· {path} already has a completions block — left untouched`},Ri={engineTitle:`引擎与账户`,engineChecking:`正在检查引擎与账户…`,engineReady:`✓ 可以开始任务`,engineMissing:`还没有可用的引擎`,engineUsable:`✓ {engine}:可用`,engineSignedOut:`! {engine}:已安装,未登录`,engineSetup:"从 docs.rove.run/rove/engines 安装引擎,然后运行其 CLI 并登录。运行 `rove doctor --fix` 检查配置;设置 → 引擎 可查看集成。",engineContinue:`❯ 继续可选设置`,engineLegend:`enter 继续 · esc 跳过可选设置`,quickStart:`输入提示词开始任务`,quickIntent:`创建独立 worktree 和分支。按 {key} 打开完整任务对话框。`,tabShared:`新对话共享当前任务的文件`,tabIsolated:`{key}:新建任务,使用独立 worktree`,title:`欢迎使用 Rove`,subtitle:`托管任务使用独立的 worktree 和分支;目录与项目任务复用现有文件。`,completionsLabel:`{shell} 的 shell 补全`,completionsExplain:`让 rove 子命令支持 Tab 补全,会在你的 shell 配置里加一行。`,skillLabel:`Rove agent skill`,skillExplain:`让本机的编码 agent 自己操作 Rove:开任务、读其他会话、给它们发消息。`,optionYes:`安装`,recommended:`推荐`,stepCounter:`{n} / {total}`,optionNo:`跳过`,queued:`已排队 — 退出 Rove 后安装`,skillInstalled:`已为 {engines} 安装`,skillFailed:`安装失败:{reason}`,skillNoEngines:`这台机器上没有能装 skill 的编码 agent`,skipped:`已跳过`,installFailed:`! {item} 安装失败:{reason}。重试:{command}(或再次退出 Rove)。`,legend:`↑↓ 选择 · enter 确认 · esc 关闭`,keysTitle:`键盘基础`,keysBare:`裸键作用于当前聚焦面板 — {nav} 移动,{open} 打开。`,keysOnePress:`少量单次快捷键属于 Rove 自己 — {newTab} 新标签页,{focusNext} 切换面板。`,keysPrefix:`{prefix} 打开命令层 — 按住稍等会出现命令指南。`,keysHelp:`随时按 {help} 查看完整的实时键位表。`,keysNext:`接下来:设置 → 引擎 里列出每个引擎,并可在那里安装它们的活动钩子。`,keysLegend:`enter 完成`,appliedCompletions:`✓ 补全已写入 {path}(新开的 shell 生效)`,keptCompletions:`· {path} 里已有补全配置 — 未改动`},zi={title:`Quick task · {repoLabel}`,promptLabel:`PROMPT`,promptPlaceholder:`what should this task do?`,attemptsLabel:`ATTEMPTS`,engineLabel:`ENGINE`,branchLabel:`BRANCH`,legend:`enter create · tab fields · ctrl+e engine · ctrl+v attach · esc cancel`,startedRound:`Started {count} attempts`,roundPartial:`Started {ok}/{count} attempts — {failed} failed`},Bi={title:`快速任务 · {repoLabel}`,promptLabel:`提示词`,promptPlaceholder:`这个任务要做什么?`,attemptsLabel:`尝试次数`,engineLabel:`引擎`,branchLabel:`分支`,legend:`enter 创建 · tab 切换字段 · ctrl+e 引擎 · ctrl+v 附件 · esc 取消`,startedRound:`已启动 {count} 个尝试`,roundPartial:`已启动 {ok}/{count} 个尝试 —— {failed} 个失败`},Vi={cancel:`cancel`,forgetProjectTitle:`Remove project "{title}"?`,forgetProjectBody:"Forgets it from the projects list. The repo, its branches, worktrees and the sessions under it stay — re-add it with `rove add`.",forgetProjectConfirm:`remove`,deleteTitle:`Remove session "{title}"?`,deleteTitleDir:`Remove session "{title}"?`,deleteBodyDir:`Ends this session and closes all its tabs. Nothing on disk changes: the folder and its files stay.`,deleteBodyTask:`Ends this session, closes all its tabs and removes its worktree folder. The git branch stays.`,deleteBodyTaskBranch:`Ends this session, closes all its tabs and removes its worktree folder, and its git branch if it is merged. An unmerged branch stays.`,deleteConfirm:`remove`,childrenTitle:`"{title}" has {count} child tasks`,childrenBody:`Promote moves them up one level and keeps their worktrees and sessions. Remove with children removes them too.`,childrenPromote:`promote children`,childrenCascade:`remove with children`,archiveChildrenBody:`Promote moves them up one level and keeps them running. Archive with children hides them too and ends their sessions.`,archiveChildrenAll:`archive with children`,forceDeleteTitle:`"{title}" has uncommitted changes`,forceDeleteConfirm:`force remove`,legacyAdoptTitle:`Remove {count} sessions Rove added by itself?`,legacyAdoptBody:`An older Rove added a session whenever a worktree was created outside it. It no longer does. These look like leftovers:
|
|
17
|
-
{list}
|
|
18
|
-
|
|
19
|
-
An agent can list them, remove the ones you confirm, and take out any old Rove worktree hook still in your settings.`,legacyAdoptMore:`… and {count} more`,legacyAdoptClean:`ask an agent`,legacyAdoptLater:`not now`,legacyAdoptNever:`don't ask again`,legacyAdoptSessionTitle:`Remove leftover sessions`,legacyAdoptPrompt:`An older Rove version added sessions to the sidebar by itself whenever a git worktree was created outside Rove. These look like leftovers:
|
|
20
|
-
|
|
21
|
-
{list}
|
|
22
|
-
|
|
23
|
-
Show me this list and ask which ones to remove, then wait for my answer. For each one I confirm, first run \`git -C <path> status --short\`. If it has uncommitted changes, tell me and ask again. Otherwise run \`rove api delete --task-id <id> --wait\`. Remove nothing I did not confirm, and never pass --force.
|
|
24
|
-
|
|
25
|
-
Then look for the hook that older version installed. Check my engine settings files, both the global ones and the ones in each repo above, for any hook whose command runs \`rove hook worktree-created\`. Show me each entry you find and its file, and remove it only after I confirm. Leave every other hook as it is.`,legacyAdoptFailed:`Couldn't start the cleanup session: {message}`},Hi={cancel:`取消`,forgetProjectTitle:`从列表中移除项目「{title}」?`,forgetProjectBody:"把它从项目列表里移除。仓库、分支、worktree 以及它下面的会话都会保留,之后可以用 `rove add` 重新加回来。",forgetProjectConfirm:`移除`,deleteTitle:`移除会话「{title}」?`,deleteTitleDir:`移除会话「{title}」?`,deleteBodyDir:`结束这个会话,关闭它的所有标签页。磁盘上什么都不动:文件夹和里面的文件都会保留。`,deleteBodyTask:`结束这个会话,关闭它的所有标签页,并删除它的 worktree 文件夹。git 分支会保留。`,deleteBodyTaskBranch:`结束这个会话,关闭它的所有标签页,删除它的 worktree 文件夹,以及已合并的 git 分支。未合并的分支会保留。`,deleteConfirm:`移除`,childrenTitle:`「{title}」有 {count} 个子任务`,childrenBody:`提升会把它们上移一级,并保留它们的 worktree 和会话。连同子任务移除会把它们一并移除。`,childrenPromote:`提升子任务`,childrenCascade:`连同子任务移除`,archiveChildrenBody:`提升会把它们上移一级,并让它们继续运行。连同子任务归档会把它们一并隐藏,并结束它们的会话。`,archiveChildrenAll:`连同子任务归档`,forceDeleteTitle:`「{title}」有未提交的改动`,forceDeleteConfirm:`强制移除`,legacyAdoptTitle:`移除 {count} 个 Rove 自己加进来的会话?`,legacyAdoptBody:`旧版 Rove 会在别处创建 worktree 时自动加一个会话,现在已经不会了。下面这些看起来是当时留下的:
|
|
26
|
-
{list}
|
|
27
|
-
|
|
28
|
-
可以交给 agent:它先列出来,你确认哪些就删哪些,并把设置里还留着的旧版 Rove worktree hook 一起清掉。`,legacyAdoptMore:`……还有 {count} 个`,legacyAdoptClean:`交给 agent`,legacyAdoptLater:`以后再说`,legacyAdoptNever:`不再提示`,legacyAdoptSessionTitle:`移除残留会话`,legacyAdoptPrompt:`旧版 Rove 会在 Rove 之外创建 git worktree 时自动往侧栏加会话。下面这些看起来是当时留下的:
|
|
29
|
-
|
|
30
|
-
{list}
|
|
31
|
-
|
|
32
|
-
先把这份清单给我看,问我要删哪些,然后等我回答。对我确认的每一个,先运行 \`git -C <path> status --short\`;有未提交的改动就告诉我并再问一次,没有就运行 \`rove api delete --task-id <id> --wait\`。我没确认的一个都不要删,也不要加 --force。
|
|
33
|
-
|
|
34
|
-
然后找一下那个旧版本装的 hook。检查我的引擎设置文件,包括全局的和上面每个仓库里的,找命令里运行 \`rove hook worktree-created\` 的 hook。把找到的每一条连同所在文件给我看,我确认后再删。其他 hook 一律不动。`,legacyAdoptFailed:`清理会话没能启动:{message}`},Ui={open:`Open`,collapseChildren:`Collapse children`,expandChildren:`Expand children`,newChat:`New conversation`,newShell:`New shell`,continueEngine:`Continue in another engine…`,newScratchChat:`New conversation (no folder)`,newTask:`New task`,newTaskFromBranch:`New task from this branch`,forgetProject:`Remove project`,fieldNotes:`Field notes`,rename:`Rename`,pin:`Pin`,unpin:`Unpin`,reorder:`Reorder row`,moveToTop:`Move to top`,moveProjectUp:`Move up`,moveProjectDown:`Move down`,runAgain:`Run again`,setStatus:`Set status`,moveToProject:`Move to project…`,copy:`Copy`,more:`More`,copyId:`Copy task ID`,copyBranch:`Copy branch name`,copyPath:`Copy path`,openEditor:`Open in editor`,renameBranch:`Rename branch`,changeEngine:`Change engine`,fixChecks:`Fix failing checks`,rerunChecks:`Re-run failed checks`,syncBase:`Sync with base`,resolveConflicts:`Resolve conflicts`,land:`Land into base branch`,muteNotifications:`Mute notifications`,unmuteNotifications:`Unmute notifications`,archive:`Archive`,unarchive:`Unarchive`,delete:`Remove session`},Wi={open:`打开`,collapseChildren:`折叠子任务`,expandChildren:`展开子任务`,newChat:`新建会话`,newShell:`新建终端`,continueEngine:`换个引擎继续…`,newScratchChat:`新建会话(无文件夹)`,newTask:`新建任务`,newTaskFromBranch:`基于此分支新建任务`,forgetProject:`移除项目`,fieldNotes:`现场笔记`,rename:`重命名`,pin:`置顶`,unpin:`取消置顶`,reorder:`重新排序`,moveToTop:`移到顶部`,moveProjectUp:`上移`,moveProjectDown:`下移`,runAgain:`重新运行`,setStatus:`设置状态`,moveToProject:`移到其他项目…`,copy:`复制`,more:`更多`,copyId:`复制任务 ID`,copyBranch:`复制分支名`,copyPath:`复制路径`,openEditor:`在编辑器中打开`,renameBranch:`重命名分支`,changeEngine:`切换引擎`,fixChecks:`修复失败的检查`,rerunChecks:`重新运行失败的检查`,syncBase:`同步基础分支`,resolveConflicts:`让 agent 解决冲突`,land:`合入基础分支`,muteNotifications:`静音通知`,unmuteNotifications:`取消静音通知`,archive:`归档`,unarchive:`取消归档`,delete:`移除会话`},Gi={noDaemonWorktree:"No daemon running — can't create the worktree. Start it with `rove daemon restart`.",noEditor:`No editor found — set ROVE_OPEN_EDITOR (e.g. 'code', 'cursor', 'nvim')`,openWorktreeFailed:`Couldn't open worktree with {label}`,worktreeErrorDeleting:`This task is being deleted — it can't be opened`,worktreeErrorNotGit:"This project isn't a git repo yet — a task needs a git branch. Run `git init` (+ a first commit) in the project, then open the task. Non-git support is coming.",worktreeErrorGeneric:`Couldn't create the worktree: {message}`,noDiskSpace:`The disk is full, so the checkout could not be created. Free some space, then try again.`,scratchAdopted:`Adopted into {repo} — save it as a project from New Task if you want it in the picker`,scratchOpenFailed:`Couldn't open a scratch shell: {message}`,scratchCloseFailed:`Couldn't close the scratch task: {message}`,worktreeGoneTitle:`Worktree for "{title}" is gone`,worktreeGoneBody:`Closed {count} tab(s). The branch {branch} is still there — reopen the task to re-create its worktree.`,checksPassingTitle:`Checks passed for "{title}"`,checksFailingTitle:`Checks failed for "{title}"`,checksResolvedBody:`PR {pr} on {branch}`,copiedId:`Copied task ID {text}`,copiedTab:`Copied tab address {text}`,copiedSession:`Copied session ID {text}`,copiedBranch:`Copied branch {text}`,copiedPath:`Copied path {text}`,copyFailed:`Couldn't reach a clipboard — no clipboard command on PATH, and this terminal refused OSC 52.`,forgetProjectFailed:`Couldn't remove the project: {error}`,deleteFailed:`Couldn't delete "{title}": {error}`,createFailed:`Couldn't create the task: {error}`,engineStartFailed:`Task created; engine did not start`,engineStartRetry:`{error}. Press ⏎ on the task to retry.`,forkFailed:`Couldn't fork the task: {error}`,forkLeftBehind:`Started from the last commit — uncommitted work stays in the original task ({reason})`,childFailed:`Couldn't start the new conversation: {error}`,renameFailed:`Couldn't rename the task: {error}`,renameBranchFailed:`Couldn't rename the branch: {error}`,switchEngineFailed:`Couldn't switch the engine: {error}`,setStatusFailed:`Couldn't set the status: {error}`,pinFailed:`Couldn't change the pin: {error}`,moveFailed:`Couldn't move the task: {error}`,moveToProjectFailed:`Couldn't move the task to that project: {error}`,movedToProject:`Moved to {project}`,issueChatFailed:`Couldn't start the issue chat: {error}`,inboxMarkReadFailed:`Couldn't mark it read: {error}`,inboxDismissFailed:`Couldn't dismiss it: {error}`,engineSwitched:`Engine → {engine} (applies on reopen)`,statusSet:`Status → {status}`},Ki={noDaemonWorktree:"守护进程未运行——无法创建 worktree。请运行 `rove daemon restart` 启动它。",noEditor:`未找到编辑器——请设置 ROVE_OPEN_EDITOR(如 'code'、'cursor'、'nvim')`,openWorktreeFailed:`无法用 {label} 打开 worktree`,worktreeErrorDeleting:`该任务正在删除中——无法打开`,worktreeErrorNotGit:"该项目尚非 git 仓库——任务需要 git 分支。请在项目中执行 `git init`(+ 首次提交)后再打开任务。非 git 项目的支持即将推出。",worktreeErrorGeneric:`无法创建 worktree:{message}`,noDiskSpace:`磁盘空间不足,没法创建工作目录。清理出一些空间后再重试。`,scratchAdopted:`已归入 {repo}——若要出现在项目选择器里,可在新建任务中保存为项目`,scratchOpenFailed:`无法打开临时 Shell:{message}`,scratchCloseFailed:`无法关闭临时任务:{message}`,worktreeGoneTitle:`"{title}" 的 worktree 已消失`,worktreeGoneBody:`已关闭 {count} 个标签页。分支 {branch} 仍在——重新打开该任务会重建 worktree。`,checksPassingTitle:`「{title}」的 PR 检查已通过`,checksFailingTitle:`「{title}」的 PR 检查失败了`,checksResolvedBody:`PR {pr},分支 {branch}`,copiedId:`已复制任务 ID {text}`,copiedTab:`已复制标签页地址 {text}`,copiedSession:`已复制会话 ID {text}`,copiedBranch:`已复制分支 {text}`,copiedPath:`已复制路径 {text}`,copyFailed:`无法访问剪贴板——PATH 上没有剪贴板命令,这个终端也拒绝了 OSC 52。`,forgetProjectFailed:`移除项目失败:{error}`,deleteFailed:`删除「{title}」失败:{error}`,createFailed:`创建任务失败:{error}`,engineStartFailed:`任务已创建,引擎没有启动`,engineStartRetry:`{error}。在任务上按 ⏎ 重试。`,forkFailed:`fork 任务失败:{error}`,forkLeftBehind:`已从最近一次提交开始——未提交的改动留在原任务里({reason})`,childFailed:`无法开始新对话:{error}`,renameFailed:`重命名任务失败:{error}`,renameBranchFailed:`重命名分支失败:{error}`,switchEngineFailed:`切换引擎失败:{error}`,setStatusFailed:`设置状态失败:{error}`,pinFailed:`修改置顶状态失败:{error}`,moveFailed:`移动任务失败:{error}`,moveToProjectFailed:`移到该项目失败:{error}`,movedToProject:`已移到 {project}`,issueChatFailed:`启动议题会话失败:{error}`,inboxMarkReadFailed:`标记为已读失败:{error}`,inboxDismissFailed:`忽略失败:{error}`,engineSwitched:`引擎 → {engine}(重新打开后生效)`,statusSet:`状态 → {status}`},qi={nav:{kanban:`Kanban`,automations:`Routines`,issues:`Issues`,mods:`Mods`},header:{scratch:`Ungrouped`},search:{placeholder:`fuzzy filter`},sort:{label:`sort: {mode}`,hint:`Change the order (manual → newest → attention → name)`,reorderSwitched:`Reorder needs manual order — switched`,modes:{default:`manual`,recent:`newest`,attention:`attention`,name:`name`}},menu:Ui,status:{backlog:`Backlog`,inProgress:`In progress`,inReview:`In review`,done:`Done`,canceled:`Canceled`,error:`Error`},setStatus:{title:`Set status`,current:`current`,footer:`↑↓ choose · enter set · esc cancel`},moveToProject:{title:`Move to project`,empty:"No other project yet — add one first, or run `rove api update --project PATH`",footer:`↑↓ choose · enter move · esc cancel`},sync:{done:`Merged {base} into this worktree`,alreadyCurrent:`Already up to date with {base}`,conflict:`Merge conflict — resolve then commit: {files}`,dirty:`Commit the worktree's changes first, then sync: {files}`,failed:`Sync failed: {error}`},archive:{done:`Archived {title}`,restored:`Restored {title}`,busyTitle:`Archive while it's working?`,busyBody:`An engine in {title} is still working or waiting on you. Archiving stops it.`,busyConfirm:`Archive anyway`,failed:`Couldn't archive: {error}`,restoreFailed:`Couldn't restore: {error}`},rerun:{started:`Re-running failed checks`,none:`No failed checks to re-run`,external:`These checks didn't run on GitHub Actions; re-run them where they ran`,refused:`Re-run refused: {detail}`},changeEngine:{title:`Change engine`,current:`current`,effortLabel:`EFFORT`,noEffort:`engine default`,footer:{engine:`↑↓ engine`,effort:`←→ effort`,model:`tab model`,set:`enter set`,cancel:`esc cancel`}},engineModel:{label:`MODEL`,placeholder:`engine default`,loading:`listing models…`},tier:{swift:`swift`,standard:`standard`,deep:`deep`,manual:`manual`},tierDesc:{swift:`small, well-specified edits — the fastest, cheapest setting`,standard:`everyday feature work and bug fixes`,deep:`hard problems: unclear root causes, large refactors, design decisions`},runAgain:{title:`Run again`,source:`Brief from “{title}”`,hint:`Runs this brief again in a new task, on its own branch and worktree.`,confirm:`Run again`,footer:`↑↓ scroll · ←→ choose · enter run · esc cancel`},fieldNotes:{title:`Field notes`,empty:"No field notes for this repo yet — agents file one with `rove api note`.",loading:`Loading…`,footer:`↑↓ scroll · esc close`,footerDeletable:`↑↓ select · d delete · esc close`,confirmDelete:{title:`Delete this field note?`,body:`“{text}” stops being injected into new sessions on this repo. Nothing else changes.`}},confirm:Vi,renameBranch:{title:`Rename branch`,fieldLabel:`branch`},moveChip:` move`,recentJump:`Recent: {title}`,archivedHit:`{title} · archived, enter unarchives`,machine:{connecting:`connecting…`,offline:`offline`,unsupported:`unsupported`,mismatch:`protocol mismatch`,filesElsewhere:`on {host}`,filesHint:`{host} is unreachable right now; its files show here again when it reconnects.`,terminalElsewhere:`This task runs on {host}, which is unreachable right now.`,runsOn:`on {host}`,noTabs:`No tabs on {host} yet — prefix t opens one there.`},empty:{noMatchSearch:`No matching tasks — esc to clear.`,noActiveProject:`No active tasks for this project.`,noActive:`No active tasks — create one above.`},activity:{working:`working`,rateLimited:`rate limited`,permissionNeeded:`needs permission`,error:`error`,dead:`engine exited`},group:{waitingOnYou:`needs you`,landing:`ready to land`,readyForReview:`needs review`,working:`working`},subtitle:{noTracking:`no activity tracking`,materializing:`materializing`,deleting:`deleting`,deleteFailed:`delete failed`},reBranch:{title:`Set branch`,fieldLabel:`branch`,hintNoBranches:`(no local branches — type a new name)`,hintNoMatch:`(no match — enter renames to this branch)`,footer:`↑↓ pick · enter set · esc cancel`},toast:Gi},Ji={nav:{kanban:`看板`,automations:`例行任务`,issues:`议题`,mods:`Mods`},header:{scratch:`未分组`},search:{placeholder:`模糊搜索`},sort:{label:`排序:{mode}`,hint:`切换排序(手动 → 最新 → 关注 → 名称)`,reorderSwitched:`调整顺序需手动排序,已切换`,modes:{default:`手动`,recent:`最新`,attention:`关注`,name:`名称`}},menu:Wi,status:{backlog:`待办`,inProgress:`进行中`,inReview:`待评审`,done:`已完成`,canceled:`已取消`,error:`出错`},setStatus:{title:`设置状态`,current:`当前`,footer:`↑↓ 选择 · enter 设置 · esc 取消`},moveToProject:{title:`移到其他项目`,empty:"还没有其他项目——先添加一个,或运行 `rove api update --project PATH`",footer:`↑↓ 选择 · enter 移动 · esc 取消`},sync:{done:`已把 {base} 合并进该工作树`,alreadyCurrent:`已经和 {base} 同步`,conflict:`合并冲突——解决后提交:{files}`,dirty:`请先提交工作树里的改动,再同步:{files}`,failed:`同步失败:{error}`},archive:{done:`已归档 {title}`,restored:`已恢复 {title}`,busyTitle:`它还在工作,仍要归档?`,busyBody:`{title} 里有引擎仍在工作或在等你。归档会把它停掉。`,busyConfirm:`仍要归档`,failed:`归档失败:{error}`,restoreFailed:`恢复失败:{error}`},rerun:{started:`正在重新运行失败的检查`,none:`没有可重新运行的失败检查`,external:`这些检查不是在 GitHub Actions 上运行的,请到它们运行的地方重新运行`,refused:`无法重新运行:{detail}`},changeEngine:{title:`切换引擎`,current:`当前`,effortLabel:`推理强度`,noEffort:`引擎默认`,footer:{engine:`↑↓ 引擎`,effort:`←→ 强度`,model:`tab 模型`,set:`enter 设置`,cancel:`esc 取消`}},engineModel:{label:`模型`,placeholder:`引擎默认`,loading:`正在列出模型…`},tier:{swift:`轻快`,standard:`标准`,deep:`深入`,manual:`手动`},tierDesc:{swift:`小而明确的改动——最快、最省的一档`,standard:`日常的功能开发和修 bug`,deep:`难题:根因不明、大重构、设计决策`},runAgain:{title:`重新运行`,source:`来自任务「{title}」的指令`,hint:`在新任务里重新执行这段指令,新任务有自己的分支和工作树。`,confirm:`重新运行`,footer:`↑↓ 滚动 · ←→ 选择 · enter 运行 · esc 取消`},confirm:Hi,renameBranch:{title:`重命名分支`,fieldLabel:`分支`},fieldNotes:{title:`现场笔记`,empty:"该仓库暂无现场笔记——agent 可用 `rove api note` 记录。",loading:`加载中…`,footer:`↑↓ 滚动 · esc 关闭`,footerDeletable:`↑↓ 选择 · d 删除 · esc 关闭`,confirmDelete:{title:`删除这条现场笔记?`,body:`「{text}」将不再注入该仓库的新会话。其他内容不受影响。`}},moveChip:` 移动`,recentJump:`最近:{title}`,archivedHit:`{title} · 已归档,回车恢复`,machine:{connecting:`连接中…`,offline:`离线`,unsupported:`不支持`,mismatch:`协议不兼容`,filesElsewhere:`在 {host} 上`,filesHint:`{host} 暂时连不上;重新连上后这里会再显示它的文件。`,terminalElsewhere:`这个任务跑在 {host} 上,暂时连不上。`,runsOn:`在 {host} 上`,noTabs:`{host} 上还没有 tab——按 prefix t 在那里新开一个。`},empty:{noMatchSearch:`无匹配任务——按 esc 清除。`,noActiveProject:`该项目暂无活跃任务。`,noActive:`暂无活跃任务——在上方新建。`},activity:{working:`运行中`,rateLimited:`请求受限`,permissionNeeded:`等待授权`,error:`错误`,dead:`引擎已退出`},group:{waitingOnYou:`等你处理`,landing:`可以合了`,readyForReview:`待你验收`,working:`运行中`},subtitle:{noTracking:`不跟踪活动`,materializing:`正在创建 worktree`,deleting:`正在删除`,deleteFailed:`删除失败`},reBranch:{title:`设置分支`,fieldLabel:`分支`,hintNoBranches:`(没有本地分支——输入新名称)`,hintNoMatch:`(无匹配——回车将分支重命名为此名)`,footer:`↑↓ 选择 · enter 设置 · esc 取消`},toast:Ki},Yi={noTask:`(no task — press n to create)`,exited:`process exited — F5 restarts it`,engineExit:{title:`Engine exited`,titleCode:`Engine exited (code {code})`,retry:`Retry`,settings:`Settings → Engines`,another:`Another engine`,continueIn:`Continue in another engine`},usageLimit:{title:`Usage limit reached`,dismiss:`Dismiss`},restoring:`restoring session…`,recovery:{live:`Live process reattached`,relaunched:`Command relaunched in a new process. Any restored output is historical; check the engine to resume or continue your conversation.`,restored:`Historical screen restored; previous process ended. Restart and check the engine before continuing.`},tab:{groupTitle:`group {n}`,renameTitle:`Rename tab`,renameField:`TAB TITLE`,renameSubmit:`rename`,chooseEngineHint:`←/→ or h/l choose, enter confirm, esc cancel`,newChat:{title:`New conversation`,engine:`ENGINE`,destLabel:`DESTINATION`,destTab:`child task, same directory`,destFork:`fork a child task (new worktree)`,destScratch:`new scratch task ($HOME)`,ctxLabel:`CONTEXT`,ctxFresh:`fresh conversation`,ctxContinue:`continue this conversation`},cannotCloseLast:`Cannot close the only tab`,tabGone:`That tab is no longer there`,closeOthersTitle:`Close the other tabs?`,closeOthersBody:`Closing {count} · their sessions end, this tab stays open.`,closeOthersConfirm:`close tabs`,closeOthersCancel:`cancel`,menu:{rename:`Rename tab`,copyAddress:`Copy tab address`,copySessionId:`Copy session ID`,continueEngine:`Continue in another engine…`,closeOthers:`Close other tabs`,close:`Close tab`},nothingToFork:`No conversation in this tab to fork yet`,noSessionYet:`No conversation in this tab yet`,noSessionYetHint:`Send the engine a prompt; its session ID exists once the conversation starts.`,noTranscriptToHandOff:`{engine} keeps no readable transcript to hand over`},split:{renameTitle:`Rename split`,renameField:`SPLIT NAME`},scrolledBack:`↑ scrolled {lines}L`,scrollFirst:`[first]`,scrollLatest:`[latest]`,unavailable:{shellMissing:`terminal unavailable — the shell named by $SHELL isn't on this machine. Point $SHELL at one that exists, or unset it to fall back to the system default.`,spawnFailed:`terminal unavailable — the shell exited immediately. Its error is in ~/.rove/pty.log.`,retry:`F5 tries again`},reset:{title:`Reset terminal?`,body:`The running shell will be killed and a fresh one will spawn at the worktree. Any in-flight processes (vim, htop, paused jobs) end immediately.`}},Xi={recovery:{live:`已重新连接仍在运行的进程`,relaunched:`命令已在新进程中重启。如有恢复的输出,它属于历史记录;请在引擎内确认会话恢复或继续操作。`,restored:`已恢复历史画面;原进程已结束。请重启并确认引擎状态后继续。`},noTask:`(无任务 —— 按 n 创建)`,exited:`进程已退出 —— 按 F5 重启`,engineExit:{title:`引擎已退出`,titleCode:`引擎已退出(退出码 {code})`,retry:`重试`,settings:`设置 → 引擎`,another:`换个引擎`,continueIn:`换个引擎继续`},usageLimit:{title:`已达到用量上限`,dismiss:`忽略`},restoring:`正在恢复会话…`,tab:{groupTitle:`group {n}`,renameTitle:`重命名标签页`,renameField:`标签页名称`,renameSubmit:`重命名`,chooseEngineHint:`←/→ 或 h/l 选择,enter 确认,esc 取消`,newChat:{title:`新建对话`,engine:`引擎`,destLabel:`落点`,destTab:`子任务,同一目录`,destFork:`fork 子任务(新 worktree)`,destScratch:`新临时任务($HOME)`,ctxLabel:`上下文`,ctxFresh:`全新对话`,ctxContinue:`接着当前对话`},cannotCloseLast:`无法关闭唯一的标签页`,tabGone:`这个标签页已经不在了`,closeOthersTitle:`关闭其他标签页?`,closeOthersBody:`将关闭 {count} 个,它们的会话会结束,只保留这个标签页。`,closeOthersConfirm:`关闭标签页`,closeOthersCancel:`取消`,menu:{rename:`重命名标签页`,copyAddress:`复制标签页地址`,copySessionId:`复制会话 ID`,continueEngine:`换个引擎继续…`,closeOthers:`关闭其他标签页`,close:`关闭标签页`},nothingToFork:`这个标签页还没有可派生的对话`,noSessionYet:`这个标签页还没有对话`,noSessionYetHint:`先给引擎发一条消息,对话开始后才有会话 ID。`,noTranscriptToHandOff:`{engine} 没有可读的对话记录,无法交接`},split:{renameTitle:`重命名分屏`,renameField:`分屏名称`},scrolledBack:`↑ 已回滚 {lines} 行`,scrollFirst:`[最早]`,scrollLatest:`[最新]`,unavailable:{shellMissing:`终端不可用 —— $SHELL 指向的 shell 在这台机器上不存在。请把 $SHELL 指向一个真实存在的 shell,或取消设置以回退到系统默认。`,spawnFailed:`终端不可用 —— shell 启动后立即退出。具体错误见 ~/.rove/pty.log。`,retry:`按 F5 重试`},reset:{title:`重置终端?`,body:`正在运行的 shell 会被杀掉并在 worktree 重新启动,进行中的进程(vim、htop、暂停的任务)会立即结束。`}},Zi={pageTitle:`ROVE UPDATE`,closeHint:`q / esc close`,chip:`↑ {version}`,current:`current`,available:`v{version} available`,latest:`latest`,latestUnknown:`unknown — could not reach the registry`,registryRetry:`Check your connection, then close and reopen Update to retry.`,upToDate:`No newer release — nothing to install.`,releaseUrlUnavailable:`release URL unavailable; visit github.com/Sma1lboy/rove/releases`,statusReleaseOpened:`Opened release page in your browser.`,statusReleaseError:`Could not open release URL. Visit github.com/Sma1lboy/rove/releases in your browser.`,statusRunningUpdater:`Closing the TUI and running the updater in this terminal...`,loadingNotes:`Loading release notes...`,notesUnavailable:`Release notes are unavailable. Use Open release to view the GitHub release page.`,changesSectionHeader:`── changes from v{from} to v{to} ──`,updateComplete:`Rove update complete. Relaunch Rove to use the new version.`,updateFailed:"Rove update failed with exit code {code}. Check the output above, then run `rove update` to retry.",pressAnyKey:`Press any key to close this update window.`,webRunning:`Running {command} …`,webInstalled:`Installed. Restart Rove to run v{latest}; this page reloads itself when it is back.`,webRestart:`Restart Rove`,webRestarting:`Restarting Rove… this page reloads itself when it is back.`,webStartFailed:`Could not start the updater: {error}`,actions:{updateNow:`Update now`,openRelease:`Open release`,close:`Close`,closeDetail:`return to the workspace`},whatsNew:{title:`WHAT'S NEW 🎉`,closeHint:`q / esc continue`,upgraded:`You're now on Rove v{to}, up from v{from}. Here's what changed.`,notesUnavailable:`Could not load the release notes — check your connection, or read them on GitHub.`,sourceHint:`release notes: {url}`},skew:{title:`⚠ DAEMON OUT OF DATE`,olderBuild:`an older build`,hint:`daemon is {daemon} — you launched v{clientVersion}. Press {keys} to refresh Rove onto the installed build`,hintNoKey:"daemon is {daemon} — you launched v{clientVersion}. Run `rove daemon restart`, then relaunch Rove"},refresh:{confirmTitle:`Refresh Rove?`,confirmBody:`Rove restarts the daemon and relaunches itself on the installed build. Running engine sessions live in the PTY host and keep going; open tabs come back.`,confirmLabel:`Refresh`,relaunching:`rove: restarting on the installed build...`,alreadyCurrent:`Rove and the daemon already run the same build — nothing to refresh.`,installGone:"This Rove was installed from a directory that no longer exists, so it cannot relaunch itself. Reinstall with `npm install -g @sma1lboy/rove`."},staleInstall:{title:`✕ ROVE INSTALL IS GONE`,hint:"this Rove is running from an install that no longer exists on disk, so it cannot start a daemon. Reinstall (`npm install -g @sma1lboy/rove`) and relaunch Rove"},versions:{pageTitle:`ROVE VERSIONS`,loading:`Loading releases...`,unavailable:`Could not fetch releases. Check your connection or wait for the rate limit, then reopen this page.`,tagCurrent:`current`,tagLatest:`latest`,tagBreaking:`breaking`,breakingWarning:"⚠ installing this crosses breaking version(s) {versions}. Rove will refuse to start until you run `rove reset`, which stops the daemon, the PTY host, and every live session. Tasks and worktrees are kept.",footerHint:`j/k select · enter install · q close`,closeHint:`q / esc close`}},Qi={pageTitle:`ROVE 更新`,closeHint:`q / esc 关闭`,chip:`↑ {version}`,current:`当前`,available:`有新版本 v{version}`,latest:`最新`,latestUnknown:`未知 —— 无法连接到 registry`,registryRetry:`请检查网络,然后关闭并重新打开更新页重试。`,upToDate:`没有更新的版本 —— 无需安装。`,releaseUrlUnavailable:`发布链接不可用;请访问 github.com/Sma1lboy/rove/releases`,statusReleaseOpened:`已在浏览器中打开发布说明页面。`,statusReleaseError:`无法打开发布链接。请在浏览器访问 github.com/Sma1lboy/rove/releases。`,statusRunningUpdater:`正在关闭 TUI,并在当前终端中运行更新程序……`,loadingNotes:`正在加载发布说明……`,notesUnavailable:`发布说明不可用。请使用「打开发布页」查看 GitHub 发布页面。`,changesSectionHeader:`── v{from} 至 v{to} 的变更 ──`,updateComplete:`Rove 更新完成。请重新启动 Rove 以使用新版本。`,updateFailed:"Rove 更新失败,退出码为 {code}。请检查上方输出,再运行 `rove update` 重试。",pressAnyKey:`按任意键关闭此更新窗口。`,webRunning:`正在运行 {command} …`,webInstalled:`已安装。重启 Rove 后运行 v{latest};恢复后页面会自动刷新。`,webRestart:`重启 Rove`,webRestarting:`正在重启 Rove… 恢复后页面会自动刷新。`,webStartFailed:`无法启动更新程序:{error}`,actions:{updateNow:`立即更新`,openRelease:`打开发布页`,close:`关闭`,closeDetail:`返回工作区`},whatsNew:{title:`更新内容 🎉`,closeHint:`q / esc 继续`,upgraded:`Rove 已从 v{from} 更新到 v{to},本次变更如下。`,notesUnavailable:`无法加载发布说明 —— 请检查网络连接,或到 GitHub 上查看。`,sourceHint:`发布说明:{url}`},skew:{title:`⚠ DAEMON 版本不一致`,olderBuild:`旧版本构建`,hint:`daemon 运行的是 {daemon},而你启动的是 v{clientVersion}。按 {keys} 可让 Rove 刷新到已安装的版本`,hintNoKey:"daemon 运行的是 {daemon},而你启动的是 v{clientVersion}。请运行 `rove daemon restart`,然后重新启动 Rove"},refresh:{confirmTitle:`刷新 Rove?`,confirmBody:`Rove 会重启 daemon,并以已安装的版本重新启动自身。正在运行的引擎会话由 PTY host 托管,不会中断;已打开的标签页会恢复。`,confirmLabel:`刷新`,relaunching:`rove:正在以已安装的版本重新启动……`,alreadyCurrent:`Rove 与 daemon 已经是同一个版本 —— 无需刷新。`,installGone:"当前 Rove 的安装目录已不存在,无法重新启动自身。请运行 `npm install -g @sma1lboy/rove` 重新安装。"},staleInstall:{title:`✕ ROVE 安装已不存在`,hint:"当前 Rove 运行自一份已从磁盘删除的安装,因此无法启动 daemon。请重新安装(`npm install -g @sma1lboy/rove`)并重新启动 Rove"},versions:{pageTitle:`ROVE 版本列表`,loading:`正在加载发布列表……`,unavailable:`无法获取发布列表。请检查网络或等待限流解除,然后重新打开本页。`,tagCurrent:`当前`,tagLatest:`最新`,tagBreaking:`breaking`,breakingWarning:"⚠ 安装该版本会跨过 breaking 版本 {versions}。更新后 Rove 会拒绝启动,直到你运行 `rove reset`——它会停掉 daemon、PTY host 和所有活动会话。任务和 worktree 会保留。",footerHint:`j/k 选择 · enter 安装 · q 关闭`,closeHint:`q / esc 关闭`}},$i={quit:{confirmTitle:`Quit Rove?`,confirmBody:`The daemon and task sessions keep running. This closes only the native workspace.`,confirmLabel:`Quit`},narrowBack:`Tasks`,noPreviousTask:`No previous task to go back to`,empty:{selectTask:`Select a task with a worktree`,noSessions:`No sessions here — press ⏎ to start {engine}, or ctrl+e to pick another`,noSessionsShell:`No sessions here — press ⏎ to start a shell, or ctrl+e to pick another`,remoteUnsupported:`Hosted engine launch over SSH is not implemented — this task's worktree is on {host}`},welcome:{title:`Welcome to Rove`,tagline:`All your coding agents in one place: when one runs out of quota, switch the task to another, and agents talk to each other directly.`,worktreeExplain:`Managed tasks create isolated worktrees and branches. Directory and project tasks reuse existing files; tabs within a task share its directory.`,stepNew:`creates your first task — pick a repo, a base branch, an engine`,stepHelp:`shows every shortcut reachable from the current focus`,stepPrefix:`opens the command menu`,enginesFound:`✓ engines: {list}`,enginesSignedOut:`✗ installed but not signed in: {list} — run one of them in a shell and log in`,enginesMissing:`✗ no engine CLI found — install claude, codex, copilot, or kimi, then restart Rove`,gitMissing:`✗ git not found on PATH — Rove needs git to create worktrees`,doctorHint:"run `rove doctor` in a shell for the full diagnosis",docsHint:`docs: https://docs.rove.run`},attention:{none:`No available Inbox items`},inbox:{title:`INBOX`,chip:`inbox {count}`,empty:`No pending attention`,openHint:`enter open`,clearHint:`d ack`,clearAllHint:`D ack all`,more:`+{count} more`,section:{attention:`ATTENTION`,recent:`RECENT`},state:{done:`done`,needsInput:`needs input`,error:`error`,rateLimited:`rate limited`,running:`running`,dead:`engine exited`,restored:`restored after restart`,routineFailed:`routine needs you`,reportMissing:`report missing`,decisionNeeded:`decision needed`,gateAnswered:`answered · engine not running`},resumesAt:`resumes {time}`}},ea={quit:{confirmTitle:`退出 Rove?`,confirmBody:`守护进程和任务会话会继续运行,这里只关闭原生工作区。`,confirmLabel:`退出`},narrowBack:`任务`,noPreviousTask:`没有可以回去的上一个任务`,empty:{selectTask:`请选择一个带 worktree 的任务`,noSessions:`这里没有会话——按 ⏎ 启动 {engine},或按 ctrl+e 另选一个`,noSessionsShell:`这里没有会话——按 ⏎ 启动 shell,或按 ctrl+e 另选一个`,remoteUnsupported:`尚未实现通过 SSH 启动托管引擎——该任务的 worktree 在 {host} 上`},welcome:{title:`欢迎使用 Rove`,tagline:`所有编程 agent 都在一个地方:一个额度用完了,换另一个接着干;agent 之间直接对话,不用你传话。`,worktreeExplain:`托管任务创建独立的 worktree 和分支。目录与项目任务复用现有文件;同一任务内的标签页共享目录。`,stepNew:`创建你的第一个任务——选仓库、基础分支和引擎`,stepHelp:`查看当前焦点下的全部快捷键`,stepPrefix:`打开命令菜单`,enginesFound:`✓ 已检测到引擎:{list}`,enginesSignedOut:`✗ 已安装但未登录:{list}——请在 shell 里运行其中之一并完成登录`,enginesMissing:`✗ 未找到引擎 CLI——请安装 claude、codex、copilot 或 kimi 后重启 Rove`,gitMissing:`✗ PATH 上没有 git——Rove 需要 git 来创建 worktree`,doctorHint:"在 shell 里运行 `rove doctor` 查看完整诊断",docsHint:`文档:https://docs.rove.run`},attention:{none:`收件箱中没有可打开的项目`},inbox:{title:`收件箱`,chip:`收件箱 {count}`,empty:`暂无待处理`,openHint:`enter 打开`,clearHint:`d 已阅`,clearAllHint:`D 全部已阅`,more:`还有 {count} 条`,section:{attention:`待处理`,recent:`最近使用`},state:{done:`完成`,needsInput:`需要输入`,error:`出错`,rateLimited:`限流`,running:`进行中`,dead:`引擎已退出`,restored:`重启后已恢复`,routineFailed:`例行任务需要处理`,reportMissing:`未回报`,decisionNeeded:`等你决定`,gateAnswered:`已回答 · 引擎未运行`},resumesAt:`{time} 恢复`}},ta={title:`Worktrees`,loading:`Loading worktrees…`,noProjects:`No local projects known to Rove yet.`,loadFailed:`Could not read the worktrees: {message}`,noWorktrees:`No worktrees.`,badge:{roveManaged:`rove`,dirty:`dirty`,dirtyUnknown:`dirty?`,remoteOn:`on remote`,remoteOff:`not pushed`,remoteUnknown:`remote unknown`},verdict:{prOpen:`PR open`,prMerged:`merged (PR)`,inMain:`in main`,prClosed:`PR closed`,idle:`stale`},row:{detached:`(detached)`,created:`created {age} ago`},delete:{button:`Delete`,confirmTitle:`Delete worktree?`,confirmBody:`Delete the worktree for "{branch}"? This removes the working directory; the branch itself is kept.`,forceTitle:`Force delete worktree?`,forceBody:'"{branch}" has uncommitted, untracked, or gitignored work. Force delete removes the worktree, but the work is snapshotted first to a salvage ref — list them with `git for-each-ref refs/rove/salvage`. Force delete anyway?',forceReason:`Refused because: {reason}`,failed:`Failed to delete worktree: {error}`,residue:`Git deregistered the worktree, but couldn't delete {path} ({reason}). Rove is done with it — retrying won't help; delete the directory by hand if you want the space.`},land:{button:`Land`,confirmTitle:`Land branch?`,confirmBody:`Merge "{branch}" into {landedOn} ({commits} commits), then remove this worktree? The branch is kept. Conflicts abort with a file list.`,confirmBodyOne:`Merge "{branch}" into {landedOn} (1 commit), then remove this worktree? The branch is kept. Conflicts abort with a file list.`,noTask:`This worktree isn't tracked as a Rove task — nothing to land.`,conflict:`Land hit conflicts (merge aborted). Resolve by hand: {files}`,dirtyBase:"The base checkout has uncommitted changes — commit them, then land. Never `git stash` here: the stash stack lives in the repo's common dir and is shared by every linked worktree, so a stash can entangle other tasks' work.",failed:`Land failed: {error}`,done:`Landed "{branch}" onto {landedOn} ({commit}).`,worktreeKept:`Landed, but the worktree was kept: {reason}`,worktreePathStale:`Landed and removed the worktree, but the task still points at it: {reason}`,worktreeResidue:`Landed. Git deregistered the worktree, but couldn't delete {path} ({reason}) — delete the directory by hand if you want the space.`},hint:{}},na={title:`工作树`,loading:`正在加载 worktree…`,noProjects:`Rove 还没有已知的本地项目。`,loadFailed:`读不到 worktree 列表:{message}`,noWorktrees:`没有 worktree。`,badge:{roveManaged:`rove`,dirty:`有改动`,dirtyUnknown:`改动未知`,remoteOn:`已推送`,remoteOff:`未推送`,remoteUnknown:`远端未知`},verdict:{prOpen:`PR 评审中`,prMerged:`已合入 (PR)`,inMain:`已在主分支`,prClosed:`PR 已关闭`,idle:`陈旧`},row:{detached:`(游离状态)`,created:`{age}前创建`},delete:{button:`删除`,confirmTitle:`删除 worktree?`,confirmBody:`确定删除 "{branch}" 对应的 worktree?工作目录会被移除,分支本身会保留。`,forceTitle:`强制删除 worktree?`,forceBody:'"{branch}" 存在未提交、未跟踪或被 gitignore 的改动。强制删除会移除 worktree,但这些改动会先被快照到一个 salvage ref——用 `git for-each-ref refs/rove/salvage` 可以列出它们。仍要强制删除吗?',forceReason:`拒绝原因:{reason}`,failed:`删除 worktree 失败:{error}`,residue:`Git 已注销该 worktree,但没能删掉 {path}({reason})。Rove 这边已经处理完了——重试没有用;想要回磁盘空间请手动删除该目录。`},land:{button:`合入`,confirmTitle:`合入分支?`,confirmBody:`把 "{branch}" 合入 {landedOn}({commits} 个提交),然后移除这个 worktree?分支会保留。冲突会中止并给出文件清单。`,confirmBodyOne:`把 "{branch}" 合入 {landedOn}(1 个提交),然后移除这个 worktree?分支会保留。冲突会中止并给出文件清单。`,noTask:`该 worktree 未作为 Rove 任务被跟踪——没有可合入的对象。`,conflict:`合入遇到冲突(已中止)。请手动解决:{files}`,dirtyBase:"基础检出有未提交改动——请先提交再合入。绝不要在这里 `git stash`:stash 栈存放在仓库的 common dir 中,该仓库所有 linked worktree 共享,一次 stash 可能纠缠其他任务的工作。",failed:`合入失败:{error}`,done:`已把 "{branch}" 合入 {landedOn}({commit})。`,worktreeKept:`已合入,但 worktree 保留了:{reason}`,worktreePathStale:`已合入并移除 worktree,但任务仍指向它:{reason}`,worktreeResidue:`已合入。Git 已注销该 worktree,但没能删掉 {path}({reason})——想要回磁盘空间请手动删除该目录。`},hint:{}},ra={common:{en:ki,zh:Ai},doctor:{en:ji,zh:Mi},files:{en:Ni,zh:Pi},newTask:{en:Fi,zh:Ii},onboarding:{en:Li,zh:Ri},quickTask:{en:zi,zh:Bi},tasks:{en:qi,zh:Ji},terminal:{en:Yi,zh:Xi},update:{en:Zi,zh:Qi},workspace:{en:$i,zh:ea},worktrees:{en:ta,zh:na}};function ia(e,t){let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`||!(e in n))return;n=Reflect.get(n,e)}return typeof n==`string`?n:void 0}function J(e,t,n){let r=ra[e],i=ia(r[Mt.get()],t)??ia(r.en,t)??t;return n?i.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??e)):i}var aa=v({stale:!1,daemonVersion:null,bridgeVersion:null}),oa=2e4;async function sa(e){try{let t=await e.request(`daemon.info`);return aa.set({stale:t.stale,daemonVersion:t.daemonVersion,bridgeVersion:t.bridgeVersion}),t.stale}catch{return aa.get().stale}}function ca(e){(0,m.useEffect)(()=>{let t=e.onOpen(()=>void sa(e)),n=Oi(oa,()=>void sa(e));return()=>{t(),n()}},[e])}function la(e){if(!aa.get().stale){z(J(`update`,`refresh.alreadyCurrent`),`error`);return}O.set((0,W.jsx)(q,{title:J(`update`,`refresh.confirmTitle`),body:H(`layout.refreshConfirm`),confirmLabel:J(`update`,`refresh.confirmLabel`),onConfirm:async()=>{await e.request(`daemon.restart`),z(J(`update`,`refresh.relaunching`));for(let t=0;t<20;t++)if(await new Promise(e=>window.setTimeout(e,1e3)),!await sa(e))return;throw Error(H(`layout.refreshTimeout`))}}))}var ua=[`info`,`success`,`warning`,`error`,`muted`],da=4e3,fa=4e3,pa=/^[A-Za-z0-9._:-]{1,64}$/,ma={box:new Set([`type`,`direction`,`gap`,`padding`,`border`,`children`]),text:new Set([`type`,`text`,`tone`,`bold`]),button:new Set([`type`,`key`,`label`,`tone`]),input:new Set([`type`,`key`,`placeholder`,`value`])};function ha(e){return typeof e==`string`&&ua.includes(e)}function ga(e){return e===0||e===1||e===2||e===3}var _a=class extends Error{};function va(e){let t=0,n=new Set,r=(e,i,a)=>{if(a>12)throw new _a(`${i}: deeper than 12`);if(++t>400)throw new _a(`more than 400 elements`);if(!e||typeof e!=`object`||Array.isArray(e))throw new _a(`${i}: not an element`);let o=e,s=o.type;if(s!==`box`&&s!==`text`&&s!==`button`&&s!==`input`)throw new _a(`${i}: unknown element ${JSON.stringify(s)}`);for(let e of Object.keys(o))if(!ma[s].has(e))throw new _a(`${i}: ${s} has no prop "${e}"`);if(o.tone!==void 0&&!ha(o.tone))throw new _a(`${i}: tone must be one of ${ua.join(`, `)}`);if(s===`text`){if(typeof o.text!=`string`||o.text.length>4e3)throw new _a(`${i}: text must be a string of at most ${da} chars`);if(o.bold!==void 0&&typeof o.bold!=`boolean`)throw new _a(`${i}: bold must be boolean`);return{type:s,text:o.text,...o.tone===void 0?{}:{tone:o.tone},...o.bold?{bold:!0}:{}}}if(s===`button`||s===`input`){if(typeof o.key!=`string`||!pa.test(o.key))throw new _a(`${i}: bad ${s} key`);if(n.has(o.key))throw new _a(`${i}: duplicate key "${o.key}"`);n.add(o.key)}if(s===`input`){for(let e of[`placeholder`,`value`]){let t=o[e];if(t!==void 0&&(typeof t!=`string`||t.length>4e3))throw new _a(`${i}: ${e} must be a string of at most ${fa} chars`)}return{type:s,key:o.key,...o.placeholder===void 0?{}:{placeholder:o.placeholder},...o.value===void 0?{}:{value:o.value}}}if(s===`button`){if(typeof o.label!=`string`||o.label.length===0||o.label.length>40)throw new _a(`${i}: label must be 1-40 chars`);return{type:s,key:o.key,label:o.label,...o.tone===void 0?{}:{tone:o.tone}}}if(o.direction!==void 0&&o.direction!==`row`&&o.direction!==`column`)throw new _a(`${i}: direction must be "row" or "column"`);for(let e of[`gap`,`padding`])if(o[e]!==void 0&&!ga(o[e]))throw new _a(`${i}: ${e} must be 0-3`);if(o.border!==void 0&&typeof o.border!=`boolean`)throw new _a(`${i}: border must be boolean`);if(!Array.isArray(o.children))throw new _a(`${i}: box needs children`);return{type:s,...o.direction===void 0?{}:{direction:o.direction},...o.gap===void 0?{}:{gap:o.gap},...o.padding===void 0?{}:{padding:o.padding},...o.border?{border:!0}:{},children:o.children.map((e,t)=>r(e,`${i}.children[${t}]`,a+1))}};try{return{ok:!0,tree:r(e,`tree`,1)}}catch(e){if(e instanceof _a)return{ok:!1,error:e.message};throw e}}function ya(e){let t=e?.panes;if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e;if(typeof t.plugin!=`string`||typeof t.id!=`string`||typeof t.title!=`string`)continue;let r=va(t.tree);r.ok&&n.push({plugin:t.plugin,id:t.id,title:t.title,tree:r.tree})}return n}function ba(e){let t=[],n=(e,r,i)=>{if(e.type===`button`||e.type===`input`)t.push({kind:e.type,plugin:r,pane:i,key:e.key});else if(e.type===`box`)for(let t of e.children)n(t,r,i)};for(let t of e)n(t.tree,t.plugin,t.id);return t}function xa(e,t){return e!==null&&t!==null&&e.plugin===t.plugin&&e.pane===t.pane&&e.key===t.key}function Sa(e,t){return e.find(e=>xa(e,t))??e[0]??null}function Ca(e,t,n){if(e.length===0)return null;let r=e.findIndex(e=>xa(e,t));return r<0?e[0]??null:e[(r+n+e.length)%e.length]??null}function wa(e,t){if(!t)return e;let n=new Map(e.map(e=>[e.id,e]));for(let e of t.remove)n.delete(e);for(let e of t.upsert)n.set(e.id,e);return t.order?t.order.flatMap(e=>n.get(e)??[]):e.map(e=>n.get(e.id)??e)}function Ta(e,t){return{...e,rev:t.rev,tasks:wa(e.tasks,t.tasks),...t.archived?{archived:wa(e.archived??[],t.archived)}:{},...t.attention?{attention:t.attention}:{},...t.gates?{gates:t.gates}:{}}}function Ea(e){return!!e&&typeof e==`object`&&typeof e.from==`number`}var Da=(e,t)=>n=>({...n,tasks:n.tasks.map(n=>n.id===e?{...n,...t}:n)}),Oa=(e,t)=>n=>({...n,tasks:n.tasks.map(n=>n.id===e?{...n,title:t,label:n.label===n.title?t:n.label}:n)});function ka(e,t){let n=new Set([t]);for(let t=!0;t;){t=!1;for(let r of e)r.parentTaskId&&n.has(r.parentTaskId)&&!n.has(r.id)&&(n.add(r.id),t=!0)}return n}var Aa=(e,t,n=!1)=>r=>{let i=t?r.tasks:r.archived??[],a=n?new Set([e]):ka(i,e),o=i.find(t=>t.id===e)?.parentTaskId,s=i.filter(e=>a.has(e.id)).map(e=>({...e,archived:t})),c=i.filter(e=>!a.has(e.id)).map(t=>n&&t.parentTaskId===e?{...t,parentTaskId:o}:t);return t?{...r,tasks:c,archived:[...r.archived??[],...s]}:{...r,tasks:[...r.tasks,...s],archived:c}},ja=(e,t)=>n=>{let r=[...n.tasks,...n.archived??[]],i=t?ka(r,e):new Set([e]),a=r.find(t=>t.id===e)?.parentTaskId,o=t=>t.filter(e=>!i.has(e.id)).map(t=>t.parentTaskId===e?{...t,parentTaskId:a}:t);return{...n,tasks:o(n.tasks),...n.archived?{archived:o(n.archived)}:{}}},Ma={"task.pin":(e,t)=>Da(e,{pinned:t.pinned===!0}),"task.keep":(e,t)=>Da(e,{kept:t.kept===!0}),"task.setStatus":(e,t)=>Da(e,{status:t.status}),"task.rename":(e,t)=>Oa(e,String(t.title)),"task.archive":(e,t)=>Aa(e,t.archived===!0,t.promote===!0),"task.delete":(e,t)=>ja(e,t.cascade===!0)};Object.keys(Ma);function Na(e,t){return Ma[e]?.(String(t.taskId),t)??null}var Pa=`rove.web.selection`,Fa=`null`,Ia=300;function La(){try{let e=JSON.parse(localStorage.getItem(Pa)??`null`);if(e&&typeof e==`object`&&`taskId`in e&&typeof e.taskId==`string`)return{taskId:e.taskId,tabId:`tabId`in e&&typeof e.tabId==`string`?e.tabId:null}}catch{}return{taskId:null,tabId:null}}function Ra(e){if(!e||typeof e!=`object`||!(`taskIds`in e))return;let t=e.taskIds;return Array.isArray(t)?t.filter(e=>typeof e==`string`):void 0}function za(e){return!!e&&typeof e==`object`&&`tasks`in e&&Array.isArray(e.tasks)}var Ba=`rove.web.visits`,Va=20;function Ha(){try{let e=JSON.parse(localStorage.getItem(Ba)??`[]`);return Array.isArray(e)?e.filter(e=>!!e&&typeof e==`object`&&typeof e.taskId==`string`):[]}catch{return[]}}function Ua(e,t){if(t)return e?.tasks.find(e=>e.id===t)??e?.archived?.find(e=>e.id===t)}function Wa(e,t,n,r){let i=(e,t)=>e.some(e=>e.id===t&&!e.deleting),a=n.taskId;if(a===null||!i(e,a)||i(t,a))return null;let o=r.find(e=>e.taskId!==a&&i(t,e.taskId));return o?{taskId:o.taskId,tabId:o.tabId}:{taskId:null,tabId:null}}var Ga=class{client;tasks=v(null);remote=v([]);tabs=v({});tabsSettled=v(!1);mods=v([]);installedMods=v(new Set);selection=v(La());visits=v(Ha());tabTimer=null;tabsReadAt=-1/0;tabScope=new Set;tabSets=new Map;tabReads=new Map;syncing=null;served=null;edits=new Map;pendingSelect=null;selectIntent=0;provisioning=new Map;viewingSent=Fa;taskShown=!0;viewingExtras=()=>({});constructor(e){this.client=e,e.onOpen(()=>{this.resync(),this.viewingSent=Fa,this.reportViewing(),this.refreshMods()}),typeof document<`u`&&typeof document.addEventListener==`function`&&document.addEventListener(`visibilitychange`,()=>{this.reportViewing(),document.visibilityState===`visible`&&this.refreshMods()}),typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`pagehide`,()=>this.reportViewing(!0)),e.on(`tasks`,e=>{za(e)&&this.acceptTasks(e)}),e.on(`tasks.patch`,e=>{let t=this.served;t&&Ea(e)&&e.from===t.rev?this.acceptTasks(Ta(t,e)):this.resync()}),e.on(`tabs`,e=>this.scheduleTabRefresh(Ra(e))),e.on(`mods`,e=>this.mods.set(ya(e)??[]))}resync(){return this.syncing??=this.client.request(`tasks.subscribe`,{patches:!0}).then(e=>this.acceptTasks(e)).catch(()=>{}).finally(()=>{this.syncing=null}),this.syncing}async refreshMods(){try{let{mods:e}=await this.client.request(`builtinMods.list`);this.installedMods.set(new Set(e.filter(e=>e.installed).map(e=>e.id)))}catch{}}onSelect=()=>{};setTaskShown(e){this.taskShown!==e&&(this.taskShown=e,this.reportViewing())}select(e,t=null){this.onSelect();let n=++this.selectIntent;if(this.tasks.get()?.tasks.find(t=>t.id===e)?.noWorktree){this.provisioning.has(e)?this.provisioning.set(e,{intent:n,tabId:t}):this.provisionThenSelect(e,{intent:n,tabId:t});return}this.commitSelection(e,t)}commitSelection(e,t){let n=this.tabs.get()[e]??[],r={taskId:e,tabId:t??Ka(n)?.id??null};this.selection.set(r),localStorage.setItem(Pa,JSON.stringify(r));let i=[{...r,at:Date.now()},...this.visits.get().filter(e=>e.taskId!==r.taskId||e.tabId!==r.tabId)].slice(0,Va);this.visits.set(i),localStorage.setItem(Ba,JSON.stringify(i)),this.reportViewing(),e in this.tabs.get()||this.scheduleTabRefresh([e])}reportViewing(e=!1){let{taskId:t,tabId:n}=this.selection.get(),r=e||typeof document<`u`&&document.visibilityState===`hidden`||!t||!this.taskShown?null:{taskId:t,...n?{tabId:n}:{},...this.viewingExtras()},i=JSON.stringify(r);i!==this.viewingSent&&(this.viewingSent=i,this.client.request(`ui.viewing`,r??{taskId:null}).catch(()=>{this.viewingSent===i&&(this.viewingSent=Fa)}))}async provisionThenSelect(e,t){this.provisioning.set(e,t);let n=!0;try{await this.client.request(`task.ensureWorktree`,{taskId:e})}catch(e){n=!1,z(e instanceof Error?e.message:String(e),`error`)}let r=this.provisioning.get(e)??t;this.provisioning.delete(e),n&&(this.markProvisioned(e),(this.tasks.get()?.tasks.some(t=>t.id===e)??!1)&&r.intent===this.selectIntent&&this.commitSelection(e,r.tabId))}markProvisioned(e){let t=this.tasks.get();if(!t)return;let n=t.tasks.map(t=>t.id===e?{...t,noWorktree:void 0}:t);this.tasks.set({...t,tasks:n})}selectWhenListed(e){this.tasks.get()?.tasks.some(t=>t.id===e)?this.select(e):this.pendingSelect=e}engineTarget(e){let{taskId:t,tabId:n}=this.selection.get(),r=t===e?this.tabs.get()[e]?.find(e=>e.id===n):void 0;return r?.kind===`engine`?{taskId:e,tabId:r.id}:{taskId:e}}async refreshTabsNow(e){await this.refreshTabs([e])}tabbedTasks(){let e=this.tasks.get(),t=e?.archived?.find(e=>e.id===this.selection.get().taskId);return[...e?.tasks??[],...t?[t]:[],...this.remote.get().filter(e=>!e.machine?.stale)]}act(e,t){let n=Na(e,t),r=()=>this.client.request(e,t);return n?this.optimistic(n,r):r()}closeTab(e,t){return this.tabAct(e,`tab.close`,{taskId:e,tabId:t},e=>e.filter(e=>e.id!==t))}renameTab(e,t,n){return this.tabAct(e,`tab.rename`,{taskId:e,tabId:t,title:n},e=>e.map(e=>e.id===t?{...e,title:n}:e))}async tabAct(e,t,n,r){let i=this.tabs.get()[e];i&&(this.tabReads.set(e,(this.tabReads.get(e)??0)+1),this.tabs.set({...this.tabs.get(),[e]:r(i)}),this.reselectIfClosed(e));try{await this.client.request(t,n)}finally{await this.refreshTabs([e])}}async optimistic(e,t){this.edits.set(e,!1);let n=this.selection.get();this.served&&this.acceptTasks(this.served,!0);try{let n=await t();return this.edits.has(e)&&this.edits.set(e,!0),n}catch(t){throw this.edits.delete(e),this.served&&this.acceptTasks(this.served,!0),n.taskId!==null&&this.selection.get().taskId!==n.taskId&&Ua(this.tasks.get(),n.taskId)&&this.commitSelection(n.taskId,n.tabId),t}}acceptTasks(e,t=!1){this.served=e;let n=e;for(let[e,r]of this.edits)r&&!t?this.edits.delete(e):n=e(n);let r=[...this.tasks.get()?.tasks??[],...this.remote.get()];this.remote.set(n.tasks.filter(e=>e.machine)),this.tasks.set({...n,tasks:n.tasks.filter(e=>!e.machine)});let i=Wa(r,n.tasks,this.selection.get(),this.visits.get());i?.taskId?this.commitSelection(i.taskId,i.tabId):i&&(this.selection.set(i),localStorage.setItem(Pa,JSON.stringify(i)),this.reportViewing()),this.pendingSelect&&n.tasks.some(e=>e.id===this.pendingSelect)&&(this.select(this.pendingSelect),this.pendingSelect=null);let a=this.tabbedTasks(),o=new Set(a.map(e=>e.id)),s=this.tabs.get();Object.keys(s).some(e=>!o.has(e))&&this.tabs.set(Object.fromEntries(Object.entries(s).filter(([e])=>o.has(e))));for(let e of this.tabSets.keys())o.has(e)||this.tabSets.delete(e);let c=a.filter(e=>{let t=Object.keys(e.tabStatus??{}).sort().join(` `);return this.tabSets.get(e.id)!==t&&(this.tabSets.set(e.id,t),!0)});c.length>0&&this.scheduleTabRefresh(c.map(e=>e.id))}scheduleTabRefresh(e){if(!e)this.tabScope=null;else for(let t of e)this.tabScope?.add(t);if(this.tabTimer!==null)return;let t=Math.max(0,this.tabsReadAt+Ia-Date.now());this.tabTimer=window.setTimeout(()=>{this.tabTimer=null,this.tabsReadAt=Date.now();let e=this.tabScope;this.tabScope=new Set,this.refreshTabs(e?[...e]:this.tabbedTasks().map(e=>e.id))},t)}async refreshTabs(e){await Promise.all(e.map(async e=>{let t=(this.tabReads.get(e)??0)+1;this.tabReads.set(e,t);let n;try{n=(await this.client.request(`task.tabs`,{taskId:e})).tabs}catch{return}this.tabReads.get(e)===t&&(this.tabs.set({...this.tabs.get(),[e]:n}),this.reselectIfClosed(e))})),this.tabsSettled.get()||this.tabsSettled.set(!0)}reselectIfClosed(e){let t=this.selection.get();t.taskId===e&&((this.tabs.get()[e]??[]).some(e=>e.id===t.tabId)||this.commitSelection(e,null))}};function Ka(e){return e.find(e=>e.alive!==!1)??e[0]}function qa({model:e}){let t=y(e.selection),n=y(e.tasks),r=y(e.remote),i=Ua(n,t.taskId)??r.find(e=>e.id===t.taskId),a=n?.attention.filter(e=>e.unread).length??0,o=`${a>0?`(${a}) `:``}${i?`${i.label} - `:``}rove`;return(0,m.useEffect)(()=>{document.title=o},[o]),null}var Ja=[`sidebar`,`workspace`,`files`];function Ya(e,t,n){let r=Ja.filter(e=>e!==`files`||n.filesVisible),i=r.indexOf(e);if(i<0)return(t>0?r[r.length-1]:r[0])??null;let a=Math.min(Math.max(i+t,0),r.length-1);return a===i?null:r[a]??null}var Xa=`.split-leaf.is-active textarea.xterm-helper-textarea`,Za={sidebar:[`.rail`,`.rail`],workspace:[`.workspace`,Xa],files:[`.side-panel`,`.side-view:not([hidden]) :is([tabindex='0'], input)`]};function Qa(){for(let e of document.querySelectorAll(Xa))if(e.closest(`[data-stream]`)?.getClientRects().length)return e;return null}function $a(){let e=Qa();return e?.focus(),e!==null}function eo(e){let t=Ya(Object.keys(Za).find(e=>document.activeElement?.closest(Za[e][0]))??`sidebar`,e,{filesVisible:document.querySelector(Za.files[0])!==null});t&&document.querySelector(Za[t][1])?.focus()}var to=[{id:`chat.tab.new`,scope:`workspace`,keys:[`ctrl+t`],category:`Workspace`,description:`New chat tab`,hint:{keys:`ctrl+t`},presentation:`onePress`},{id:`chat.tab.chooseEngine`,scope:`workspace`,keys:[`ctrl+e`],category:`Workspace`,description:`New conversation — engine/shell picker with destination + context toggles`,hint:{keys:`ctrl+e`},presentation:`onePress`},{id:`chat.tab.fork`,scope:`workspace`,keys:[],prefixKeys:[`c`],category:`Workspace`,description:`Fork this chat into a new tab (same Task directory, keeps the conversation)`,hint:{keys:`ctrl+a c`}},{id:`chat.fork.new`,scope:`workspace`,keys:[],prefixKeys:[`f`],category:`Workspace`,description:`Quick-fork: create child task seeded with current repo/branch/model`,hint:{keys:`ctrl+a f`}},{id:`chat.tab.close`,scope:`workspace`,keys:[`ctrl+w`],prefixKeys:[`w`],category:`Workspace`,description:`Close chat tab`,hint:{keys:`ctrl+w`},presentation:`onePress`},{id:`workspace.reopenSession`,scope:`workspace`,keys:[`return`],category:`Workspace`,description:`Reopen a session in a task whose tabs are all closed`,hint:{keys:`enter`},presentation:`onePress`},{id:`chat.tab.rename`,scope:`workspace`,keys:[`f2`],category:`Workspace`,description:`Rename active chat tab`,hint:{keys:`f2`},presentation:`onePress`},{id:`chat.tab.cycle-next`,scope:`workspace`,keys:[`ctrl+]`],category:`Workspace`,description:`Next chat tab`,hint:{keys:`ctrl+]`},presentation:`onePress`},{id:`chat.tab.cycle-prev`,scope:`workspace`,keys:[`ctrl+[`],category:`Workspace`,description:`Previous chat tab`,hint:{keys:`ctrl+[`},presentation:`onePress`},{id:`chat.tab.goto`,scope:`workspace`,keys:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].map(e=>`ctrl+${e}`),category:`Workspace`,description:`Go to chat tab N`,hint:{keys:`ctrl+1-9`},presentation:`onePress`},{id:`workspace.split.right`,scope:`workspace`,keys:[`ctrl+\\`],category:`Workspace`,description:`Split right`,hint:{keys:`ctrl+\\`},presentation:`onePress`},{id:`workspace.split.down`,scope:`workspace`,keys:[`ctrl+=`],category:`Workspace`,description:`Split down`,hint:{keys:`ctrl+=`},presentation:`onePress`},{id:`workspace.split.focus-next`,scope:`workspace`,keys:[`f3`],category:`Workspace`,description:`Focus next split`,hint:{keys:`f3`},presentation:`onePress`},{id:`workspace.split.close`,scope:`workspace`,keys:[`ctrl+w`],prefixKeys:[`w`],category:`Workspace`,description:`Close active split (tab when unsplit)`,hint:{keys:`ctrl+w`},presentation:`onePress`},{id:`workspace.split.rename`,scope:`workspace`,keys:[`f2`],category:`Workspace`,description:`Rename active split (tab when unsplit)`,hint:{keys:`f2`},presentation:`onePress`}],no=[{id:`files.nav`,scope:`files`,keys:[`j`,`k`,`down`,`up`],category:`Files`,description:`Move cursor up/down`,hint:{keys:`j/k`}},{id:`files.hierarchy`,scope:`files`,keys:[`h`,`l`,`left`,`right`],category:`Files`,description:`Collapse / expand tree level`,hint:{keys:`h/l`}},{id:`files.open`,scope:`files`,keys:[`return`],category:`Files`,description:`Open file in configured editor (diff when supported)`,hint:{keys:`enter`}},{id:`files.tab`,scope:`files`,keys:[`[`,`]`],category:`Files`,description:`Switch tab (cycle All / Changes)`,hint:{keys:`[/]`}},{id:`files.refresh`,scope:`files`,keys:[`r`],category:`Files`,description:`Refresh`,hint:{keys:`r`}},{id:`files.scope`,scope:`files`,keys:[`b`],category:`Files`,description:`Toggle Changes scope (working ↔ branch vs base)`,hint:{keys:`b`}},{id:`files.diff`,scope:`files`,keys:[`d`],category:`Files`,description:`Open read-only diff in a workspace tab`,hint:{keys:`d`}},{id:`files.diffAll`,scope:`files`,keys:[`shift+d`],category:`Files`,description:`Open the whole worktree's diff in one workspace tab`,hint:{keys:`D`}},{id:`files.openExternal`,scope:`files`,keys:[`o`],category:`Files`,description:`Open file in system default app (audio / video / pdf preview)`,hint:{keys:`o`}},{id:`files.mention`,scope:`files`,keys:[`a`],category:`Files`,description:`Inject @<path> mention into the engine pane`,hint:{keys:`a`}},{id:`files.createPR`,scope:`global`,keys:[],prefixKeys:[`p`,`shift+p`],category:`Files`,description:`Ask the agent to create a PR from the current task`},{id:`files.fixChecks`,scope:`global`,keys:[],prefixKeys:[`k`],category:`Files`,description:`Ask the agent to fix the failing PR checks`},{id:`files.syncBase`,scope:`global`,keys:[],prefixKeys:[`u`],category:`Files`,description:`Merge the base branch into this task's worktree`},{id:`diff.review.cursor`,scope:`workspace`,keys:[`j`,`k`,`down`,`up`],bareKeys:!0,category:`Diff review`,description:`Move the line cursor over the diff`,hint:{keys:`j/k`}},{id:`diff.review.range`,scope:`workspace`,keys:[`v`],bareKeys:!0,category:`Diff review`,description:`Toggle range anchor at the cursor`,hint:{keys:`v`}},{id:`diff.review.note`,scope:`workspace`,keys:[`c`],bareKeys:!0,category:`Diff review`,description:`Add a review note at the cursor`,hint:{keys:`c`}},{id:`diff.review.send`,scope:`workspace`,keys:[`s`],bareKeys:!0,category:`Diff review`,description:`Send all unsent review notes to the engine`,hint:{keys:`s`}},{id:`diff.review.drop`,scope:`workspace`,keys:[`x`],bareKeys:!0,category:`Diff review`,description:`Drop the review note the cursor sits inside`,hint:{keys:`x`}},{id:`diff.review.reload`,scope:`workspace`,keys:[`r`],bareKeys:!0,category:`Diff review`,description:`Reload the previewed file from disk`,hint:{keys:`r`}}],ro=[{id:`inbox.show`,scope:`global`,keys:[],prefixKeys:[`i`],category:`Global`,description:`Open Inbox`},{id:`inbox.nav`,scope:`inbox`,keys:[`j`,`k`,`down`,`up`],category:`Inbox`,description:`Move cursor up/down`,hint:{keys:`j/k`}},{id:`inbox.open`,scope:`inbox`,keys:[`return`],category:`Inbox`,description:`Open the selected Task and Terminal Tab`,hint:{keys:`enter`}},{id:`inbox.delete`,scope:`inbox`,keys:[`d`],category:`Inbox`,description:`Ack the selected Inbox item`,hint:{keys:`d`}},{id:`inbox.deleteAll`,scope:`inbox`,keys:[`shift+d`],category:`Inbox`,description:`Ack every ATTENTION item`,hint:{keys:`D`}}],Y=[{id:`palette.open`,scope:`global`,keys:[],prefixKeys:[`/`],category:`Global`,description:`Search commands`},{id:`help.open`,scope:`global`,keys:[`f1`],category:`Global`,description:`Show keybindings help`,hint:{keys:`F1`},presentation:`onePress`},{id:`task.new`,scope:`sidebar`,keys:[`n`],category:`Sidebar`,description:`New task`,hint:{keys:`n`}},{id:`task.new.global`,scope:`global`,keys:[],prefixKeys:[`n`],category:`Global`,description:`New task`},{id:`task.openEditor`,scope:`global`,keys:[],prefixKeys:[`o`],category:`Global`,description:`Open active Task directory in editor`},{id:`task.moveMode`,scope:`global`,keys:[],prefixKeys:[`m`],category:`Global`,description:`Reorder sidebar rows (then j/k)`},{id:`settings.open`,scope:`global`,keys:[],prefixKeys:[`,`],category:`Global`,description:`Open settings`},{id:`app.refresh`,scope:`global`,keys:[],prefixKeys:[`r`],category:`Global`,description:`Refresh Rove onto the installed build (after an update)`},{id:`settings.open.sidebar`,scope:`sidebar`,keys:[`s`],category:`Sidebar`,description:`Open settings`,hint:{keys:`s`}},{id:`worktrees.open.sidebar`,scope:`sidebar`,keys:[`x`],category:`Sidebar`,description:`Open worktrees`,hint:{keys:`x`}},{id:`kanban.open`,scope:`global`,keys:[],prefixKeys:[`1`],category:`Global`,description:`Open kanban (issues board)`},{id:`automations.open`,scope:`global`,keys:[],prefixKeys:[`2`],category:`Global`,description:`Open routines (scheduled tasks)`},{id:`workItems.open`,scope:`global`,keys:[],prefixKeys:[`3`],category:`Global`,description:`Open GitHub issues (external tracker)`},{id:`app.quit`,scope:`sidebar`,keys:[`q`,`ctrl+q`],category:`Sidebar`,description:`Quit (with confirm)`,hint:{keys:`q`}},{id:`focus.sidebar`,scope:`workspace`,keys:[`ctrl+q`],prefixKeys:[`q`],category:`Workspace`,description:`Back to sidebar (tasks)`,hint:{keys:`ctrl+q`},presentation:`onePress`},{id:`focus.previous`,scope:`global`,keys:[],prefixKeys:[`h`],category:`Navigation`,description:`Focus previous pane (files → workspace → sidebar)`},{id:`focus.next`,scope:`global`,keys:[`f4`],prefixKeys:[`l`],category:`Navigation`,description:`Focus next pane (sidebar → workspace → files)`,hint:{keys:`f4`},presentation:`onePress`},{id:`attention.next`,scope:`global`,keys:[`f7`],category:`Navigation`,description:`Jump to the next available Inbox item`,hint:{keys:`f7`},presentation:`onePress`},{id:`task.previous`,scope:`global`,keys:[],prefixKeys:[`tab`],category:`Navigation`,description:`Back to the previous task`},{id:`workspace.filesToggle`,scope:`global`,keys:[],prefixKeys:[`z`],category:`Navigation`,description:`Show or hide the Files pane`},{id:`view.redraw`,scope:`global`,keys:[],prefixKeys:[`r`],category:`Global`,description:`Redraw the screen`},{id:`sidebar.nav`,scope:`sidebar`,keys:[`j`,`k`,`down`,`up`],category:`Sidebar`,description:`Move cursor up/down`,hint:{keys:`j/k`}},{id:`sidebar.select`,scope:`sidebar`,keys:[`return`],category:`Sidebar`,description:`Open the selected task`,hint:{keys:`enter`}},{id:`sidebar.tree.open`,scope:`sidebar`,keys:[`l`,`space`],category:`Sidebar`,description:`Open the row under the cursor (a tab row enters its chat)`,hint:{keys:`l`}},{id:`sidebar.goto`,scope:`sidebar`,keys:[`g`,`shift+g`],category:`Sidebar`,description:`Top / bottom of list (gg or shift-G)`},{id:`sidebar.rename`,scope:`sidebar`,keys:[`r`],category:`Sidebar`,description:`Rename task`,hint:{keys:`r`}},{id:`sidebar.localMerge`,scope:`sidebar`,keys:[`shift+m`],category:`Sidebar`,description:`Reorder row (Shift+M, then j/k)`,hint:{keys:`M`}},{id:`sidebar.pin`,scope:`sidebar`,keys:[`shift+p`],category:`Sidebar`,description:`Pin / unpin task at top (Shift+P)`,hint:{keys:`P`}},{id:`sidebar.sort`,scope:`sidebar`,keys:[`t`],category:`Sidebar`,description:`Cycle task sort (default → recent → attention → name)`,hint:{keys:`t`}},{id:`sidebar.delete`,scope:`sidebar`,keys:[`d`],category:`Sidebar`,description:`Remove session (with confirm)`,hint:{keys:`d`}},{id:`sidebar.search.enter`,scope:`sidebar`,keys:[`/`],category:`Sidebar`,description:`Search tasks (fuzzy filter)`,hint:{keys:`/`}},{id:`sidebar.search.nav`,scope:`sidebar`,keys:[`down`,`up`],category:`Sidebar`,description:`Move highlight in search results`},{id:`sidebar.search.submit`,scope:`sidebar`,keys:[`return`],category:`Sidebar`,description:`Select search match and exit search`},{id:`sidebar.search.cancel`,scope:`sidebar`,keys:[`escape`],category:`Sidebar`,description:`Cancel search (restore prior selection)`},{id:`tasks.openWorktree`,scope:`sidebar`,keys:[`o`],category:`Tasks pane`,description:`Open selected Task directory in your editor`,hint:{keys:`o`}},{id:`tasks.renameBranch`,scope:`sidebar`,keys:[`b`],category:`Tasks pane`,description:`Rename the selected task's git branch`,hint:{keys:`b`}},{id:`tasks.cycleEngine`,scope:`sidebar`,keys:[`v`],category:`Tasks pane`,description:`Cycle engine vendor — applies on reopen`,hint:{keys:`v`}},{id:`tasks.update`,scope:`sidebar`,keys:[`u`],category:`Tasks pane`,description:`Open the update page — version check + release notes`,hint:{keys:`u`}},{id:`tasks.focusEngine`,scope:`sidebar`,keys:[`right`],category:`Tasks pane`,description:`Focus the engine pane of the current window`,hint:{keys:`→`}},...to,...no,...ro,{id:`terminal.scroll-up`,scope:`terminal`,keys:[`ctrl+pageup`],category:`Terminal`,description:`Scroll scrollback up`,hint:{keys:`ctrl+pgup`}},{id:`terminal.scroll-down`,scope:`terminal`,keys:[`ctrl+pagedown`],category:`Terminal`,description:`Scroll scrollback down`},{id:`terminal.reset`,scope:`terminal`,keys:[`f5`],category:`Terminal`,description:`Reset terminal — kill the current shell and respawn`,hint:{keys:`f5`},presentation:`onePress`}],io={ctrl:`⌃`,control:`⌃`,alt:`⌥`,opt:`⌥`,option:`⌥`,shift:`⇧`,cmd:`⌘`,command:`⌘`,meta:`⌘`,super:`⌘`},ao={enter:`⏎`,return:`⏎`,esc:`⎋`,escape:`⎋`,space:`␣`,up:`↑`,down:`↓`,left:`←`,right:`→`,backspace:`⌫`,delete:`⌦`,del:`⌦`,pgup:`⇞`,pageup:`⇞`,pgdn:`⇟`,pagedown:`⇟`,home:`↖`,end:`↘`};function oo(e,t){if(e.includes(`/`))return e.split(`/`).map(e=>oo(e,t)).join(`/`);let n=e.toLowerCase();return n===`tab`?`tab`:ao[n]||(/^f\d{1,2}$/.test(n)?n.toUpperCase():t?/^[a-z]$/.test(n)?e.toUpperCase():e.replace(/[a-z]+/gi,e=>e.toUpperCase()):e)}function so(e,t=`⌃A`){let n=e.trim();if(!n)return n;let r=/^prefix\s+(.+)$/i.exec(n);if(r){let e=r[1]??``;return`${t} ${e.includes(`+`)?so(e,t):oo(e,!0)}`}let i=n.split(`+`);if(i.length===1)return oo(i[0]??``,!1);let a=i[i.length-1]??``;return`${i.slice(0,-1).map(e=>io[e.toLowerCase().trim()]??e).join(``)} ${oo(a,!0)}`}var co={path:``,exists:!1,rows:[],prefix:{key:`ctrl+a`,firstStrokes:[`ctrl+a`],timeoutMs:5e3},plugins:[],applied:[],warnings:[]},lo=v(co),uo=new Map(Y.map(e=>[e.id,{keys:[...e.keys],prefixKeys:e.prefixKeys&&[...e.prefixKeys],hint:e.hint&&{...e.hint}}]));function fo(e){for(let e of Y){let t=uo.get(e.id);if(!t)continue;let n=e;n.keys=[...t.keys],n.prefixKeys=t.prefixKeys&&[...t.prefixKeys],n.hint=t.hint&&{...t.hint}}for(let t of e.rows){let e=Y.find(e=>e.id===t.id);e&&(e.keys=[...t.keys],e.prefixKeys=t.prefixKeys&&[...t.prefixKeys],e.hint=t.hint&&{...t.hint})}lo.set(e)}async function po(e){try{fo(await e.request(`keybindings.get`))}catch{}}function mo(e){let t=y(e.conn).hello;(0,m.useEffect)(()=>{if(!t)return;let n=()=>void po(e);return n(),window.addEventListener(`focus`,n),()=>window.removeEventListener(`focus`,n)},[t,e])}var ho=()=>lo.get().prefix.key,go=()=>{let e=ho();return e===null?``:so(e)};function _o(e,t=`direct`){let n=Y.find(t=>t.id===e),r=t===`prefix`?n?.prefixKeys?.[0]:n?.keys[0];return r===void 0?void 0:so(r)}var vo=e=>Y.find(t=>t.id===e)?.keys??[];function yo(e){let t=go(),n=_o(e,`prefix`);return t&&n?`${t} ${n}`:``}var bo=e=>uo.get(e)?.prefixKeys??[];function xo(e,t){let n=lo.get().rows.find(t=>t.id===e),r=uo.get(e),i=t===`prefix`?n?.prefixKeys:n?.keys,a=t===`prefix`?r?.prefixKeys:r?.keys;return i&&JSON.stringify(i)!==JSON.stringify(a??[])?i:void 0}function So(e,t){for(let n of t){let t=e.find(e=>e.chord===n);if(t)return t}}function Co(e){return!e.dialog&&e.page!==`worktrees`&&e.page!==`update`}var wo=[];function To(e){wo.push(e)}var Eo={workspace:`workspace`,sidebar:`sidebar`,files:`files`,terminal:`terminal`};function Do(){let e=wo.flatMap(e=>e()),t=new Set(e.filter(e=>!e.prefix).map(e=>e.id)),n=e.map(e=>{let t=xo(e.id,e.prefix?`prefix`:`direct`);return t?{...e,chords:t}:e});for(let r of e){let e=r.prefix?xo(r.id,`direct`):void 0;if(!e||e.length===0||t.has(r.id))continue;t.add(r.id);let i=Y.find(e=>e.id===r.id)?.scope??`global`;n.push({...r,prefix:!1,chords:e,...Eo[i]?{surface:Eo[i]}:{}})}return n}function Oo(e,t){return!e.surface||e.surface===t||t===`terminal`&&e.surface===`workspace`}function ko(e,t){return e.surface===t?0:e.surface?1:2}function Ao(){let e=document.activeElement;return e instanceof Element?e.closest(`.xterm`)?`terminal`:e.closest(`.rail`)?`sidebar`:e.closest(`.files`)?`files`:e.closest(`.workspace, .side-panel`)?`workspace`:null:null}function jo(e,t){let n=new Set,r=new Set;for(let i of Do())!Oo(i,t)||i.live?.(e)===!1||(i.prefix?r:n).add(i.id);return{direct:n,prefix:r,inputPassthrough:t===`terminal`}}function Mo(){let e=new Set(Do().map(e=>e.id));return Y.filter(t=>e.has(t.id))}var No=new Map,Po=v(null);function Fo(e){return No.set(e.stream,e),()=>{No.get(e.stream)===e&&No.delete(e.stream),Po.get()===e&&Po.set(null)}}function Io(e){return No.get(e)}To(()=>[{id:`terminal.scroll-up`,chords:[`ctrl+pageup`],prefix:!1,surface:`terminal`,run:()=>Po.get()?.scrollPages(-1)},{id:`terminal.scroll-down`,chords:[`ctrl+pagedown`],prefix:!1,surface:`terminal`,run:()=>Po.get()?.scrollPages(1)},{id:`terminal.reset`,chords:[`f5`],prefix:!1,surface:`terminal`,run:()=>Po.get()?.reset()}]);var Lo={INPUT:!0,TEXTAREA:!0,SELECT:!0},Ro=`.rail, .side-panel, dialog, [role=dialog], [role=menu], [role=listbox]`;function zo(e){return!e||e.tagName===`BODY`||e.tagName===`HTML`?`none`:e.closest(`.xterm`)?`terminal`:Lo[e.tagName]===!0||e.isContentEditable?`field`:e.closest(Ro)?`pane`:`loose`}function Bo(e,t,n){return e.key!==`Escape`||e.defaultPrevented||e.isComposing||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||n.overlay||!n.terminal?!1:t===`none`||t===`loose`}function Vo(){(0,m.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=Qa(),n=document.activeElement;if(!Bo(e,zo(n instanceof HTMLElement?n:null),{overlay:O.get()!==null||D.get()!==null||N.get()!==null||L.get()!==null,terminal:t!==null}))return;let r=t?.closest(`[data-stream]`)?.dataset.stream,i=r?Io(r):void 0;!t||!i||(e.preventDefault(),t.focus(),i.input(`\x1B`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}var Ho=Reflect.get(globalThis,`__roveRelay`);function Uo(e,t){return Ho?Ho.fetch(e,t):fetch(e,t)}function Wo(e,t){return Ho?new Ho.WebSocket(e,t):new WebSocket(e,t)}var Go=class extends Error{code;detail;constructor(e,t,n){super(t),this.code=e,this.detail=n}},Ko=[500,1e3,2e3,4e3,8e3,15e3],qo=4e3,Jo=1e4,Yo=class{url;token;conn=v({state:`connecting`,hello:null,failures:0});ws=null;nextId=1;pending=new Map;listeners=new Map;openHooks=new Set;retryTimer=null;deadline=null;constructor(e,t){this.url=e,this.token=t}start(){this.connect();let e=()=>{document.visibilityState===`visible`&&this.checkNow()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`online`,e),window.addEventListener(`pageshow`,e)}checkNow(){if(this.retryTimer!==null){this.retryNow();return}let e=this.ws;!e||this.conn.get().state!==`open`||this.deadline!==null||(this.armDeadline(e,qo),this.request(`hello`).then(()=>this.clearDeadline(),e=>{e instanceof Go&&e.code!==`NOT_CONNECTED`&&this.clearDeadline()}))}armDeadline(e,t){this.clearDeadline(),this.deadline=window.setTimeout(()=>this.lost(e),t)}clearDeadline(){this.deadline!==null&&window.clearTimeout(this.deadline),this.deadline=null}onOpen(e){return this.openHooks.add(e),this.conn.get().state===`open`&&e(),()=>this.openHooks.delete(e)}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),()=>n.delete(t)}request(e,t={},n){let r=this.ws;if(!r||r.readyState!==WebSocket.OPEN)return Promise.reject(new Go(`NOT_CONNECTED`,`not connected to rove`));let i=this.nextId++;return new Promise((a,o)=>{this.pending.set(i,{resolve:e=>a(e),reject:o,progress:n}),r.send(JSON.stringify({id:i,op:e,args:t}))})}connect(){this.retryTimer=null;let e=Wo(this.url,this.token?[`rove.v1`,`rove.bearer.${this.token}`]:[`rove.v1`]);this.ws=e,this.armDeadline(e,Jo),e.onmessage=e=>this.receive(String(e.data)),e.onopen=()=>{this.request(`hello`).then(e=>{this.clearDeadline(),this.conn.set({state:`open`,hello:e,failures:0});for(let e of this.openHooks)e()},()=>this.lost(e))},e.onclose=t=>this.lost(e,t?.code)}lost(e,t){if(this.ws!==e)return;this.ws=null,this.clearDeadline(),e.onopen=null,e.onclose=null,e.onmessage=null,e.close();for(let e of this.pending.values())e.reject(new Go(`NOT_CONNECTED`,`connection lost`));if(this.pending.clear(),t===4401){a(),this.conn.set({state:`retrying`,hello:null,failures:2});return}let n=this.conn.get().failures+1;this.conn.set({state:`retrying`,hello:this.conn.get().hello,failures:n});let r=Ko[Math.min(n-1,Ko.length-1)];this.retryTimer=window.setTimeout(()=>this.connect(),r)}receive(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!=`object`)return;if(`event`in t&&typeof t.event==`string`){let e=`data`in t?t.data:void 0;if(t.event===`op.progress`){let t=e;typeof t?.id==`number`&&typeof t.line==`string`&&this.pending.get(t.id)?.progress?.(t.line);return}for(let n of this.listeners.get(t.event)??[])n(e);return}if(!(`id`in t)||typeof t.id!=`number`)return;let n=this.pending.get(t.id);if(!n)return;if(this.pending.delete(t.id),`ok`in t&&t.ok===!0){n.resolve(`result`in t?t.result:void 0);return}let r=`error`in t&&t.error&&typeof t.error==`object`?t.error:{},i=`code`in r&&typeof r.code==`string`?r.code:`INTERNAL`,a=`message`in r&&typeof r.message==`string`?r.message:i;n.reject(new Go(i,a,r))}retryNow(){this.retryTimer!==null&&(window.clearTimeout(this.retryTimer),this.connect())}};function Xo(){return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`}function Zo(e){return e instanceof Go&&e.code===`NOT_CONNECTED`?H(`workspace.connect.notConnected`):e instanceof Error?e.message:String(e)}var Qo=`rove.web.legacyAdopt.dismissed`,$o=6,es=!1,ts=e=>e.replace(/[\\/]+$/,``).split(/[\\/]/).at(-1)??e;function ns(){try{return localStorage.getItem(Qo)===`1`}catch{return!1}}function rs(){try{localStorage.setItem(Qo,`1`)}catch{}}function is(e){let t=e.slice(0,$o).map(e=>` ${ts(e.repo)}/${e.title}`);return e.length>$o&&t.push(` ${J(`tasks`,`confirm.legacyAdoptMore`,{count:e.length-$o})}`),t.join(`
|
|
35
|
-
`)}function as(e){return J(`tasks`,`confirm.legacyAdoptPrompt`,{list:e.map(e=>`- ${e.id} · ${e.title} · ${e.worktreePath}`).join(`
|
|
36
|
-
`)})}async function os(e){if(es||ns())return;es=!0;let{tasks:t}=await e.client.request(`worktree.legacyAdopted`,{}).catch(()=>({tasks:[]}));t.length!==0&&O.get()===null&&O.set((0,W.jsx)(ss,{model:e,tasks:t}))}function ss(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(null),a=async()=>{n(!0),i(null);try{let{taskId:t}=await e.model.client.request(`worktree.legacyCleanup`,{title:J(`tasks`,`confirm.legacyAdoptSessionTitle`),prompt:as(e.tasks)});B(),e.model.selectWhenListed(t)}catch(e){i(J(`tasks`,`confirm.legacyAdoptFailed`,{message:Zo(e)}))}finally{n(!1)}};return(0,W.jsx)(Ci,{title:J(`tasks`,`confirm.legacyAdoptTitle`,{count:e.tasks.length}),children:(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsx)(`p`,{className:`text-muted whitespace-pre-wrap`,children:J(`tasks`,`confirm.legacyAdoptBody`,{list:is(e.tasks)})}),r&&(0,W.jsx)(`p`,{className:`text-error`,children:r}),(0,W.jsxs)(`div`,{className:Pr,children:[(0,W.jsx)(G,{onClick:()=>{rs(),B()},children:J(`tasks`,`confirm.legacyAdoptNever`)}),(0,W.jsx)(G,{onClick:B,children:J(`tasks`,`confirm.legacyAdoptLater`)}),(0,W.jsx)(G,{variant:`filled`,disabled:t,autoFocus:!0,onClick:()=>void a(),children:J(`tasks`,`confirm.legacyAdoptClean`)})]})]})})}function cs(e,t){let n=t&&typeof t==`object`?t:{};if(e===200&&typeof n.token==`string`&&/^[A-Za-z0-9_-]{43}$/.test(n.token))return{kind:`ok`,token:n.token};if(e===429){if(n.locked===`global`)return{kind:`lockedHost`};let e=typeof n.retryAfterSeconds==`number`?n.retryAfterSeconds:900;return{kind:`locked`,minutes:Math.max(1,Math.ceil(e/60))}}return e===401?{kind:`wrong`}:{kind:`unreachable`}}async function ls(e=Uo){try{let t=await e(`/login`,{headers:{Accept:`application/json`},cache:`no-store`});return!t.ok||!(t.headers.get(`content-type`)??``).includes(`application/json`)?!1:(await t.json()).password===!0}catch{return!1}}async function us(e=Uo){try{let t=await e(`/auth`,{headers:{Accept:`application/json`},cache:`no-store`});return!t.ok||!(t.headers.get(`content-type`)??``).includes(`application/json`)?!1:(await t.json()).open===!0}catch{return!1}}async function ds(e,t=Uo){try{let n=await t(`/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:e}),credentials:`omit`}),r=cs(n.status,await n.json().catch(()=>null));return r.kind===`ok`&&i(r.token),r}catch{return{kind:`unreachable`}}}async function fs(e=Uo){let t=r();a(),t&&await e(`/logout`,{method:`POST`,headers:{Authorization:`Bearer ${t}`}}).catch(()=>{})}function ps(e){if(!e)return null;switch(e.kind){case`ok`:return null;case`wrong`:return H(`login.wrong`);case`locked`:return H(`login.locked`,{minutes:e.minutes});case`lockedHost`:return H(`login.lockedHost`);case`unreachable`:return H(`login.unreachable`)}}function ms(){U();let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null),o=ps(i);return(0,W.jsx)(`div`,{className:Kn,children:(0,W.jsxs)(`form`,{className:qn,onSubmit:async i=>{if(i.preventDefault(),n||!e)return;r(!0);let o=await ds(e);if(o.kind===`ok`){window.location.reload();return}t(``),a(o),r(!1)},children:[(0,W.jsxs)(`span`,{className:Wn,children:[(0,W.jsx)(`span`,{className:Gn,children:`[`}),` rove `,(0,W.jsx)(`span`,{className:Gn,children:`]`})]}),(0,W.jsx)(`h1`,{className:`${Ar} text-muted`,children:H(`login.title`)}),(0,W.jsx)(`p`,{className:`text-muted`,children:H(`login.body`)}),(0,W.jsx)(`input`,{className:Nr,type:`password`,autoComplete:`current-password`,"aria-label":H(`login.field`),placeholder:H(`login.field`),autoFocus:!0,value:e,disabled:n,onChange:e=>{t(e.target.value),a(null)}}),o&&(0,W.jsx)(`p`,{className:`text-error`,role:`alert`,children:o}),(0,W.jsx)(`div`,{className:Pr,children:(0,W.jsx)(`button`,{type:`submit`,className:xr(),disabled:n||!e,children:H(n?`login.checking`:`login.submit`)})})]})})}function hs(e){return(0,W.jsx)(`svg`,{className:`block size-2.5 flex-none transition-[rotate,opacity] duration-120 ease-[ease] motion-reduce:transition-none ${e.right?`-rotate-90 is-right`:``} ${e.className??``}`,viewBox:`0 0 10 10`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M2.5 3.75 5 6.25l2.5-2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var gs=120;function _s(e,t,n,r=e-t){return e+t+8<=n?e:Math.max(8,Math.min(r,n-t-8))}function vs(e){let{item:t}=e;return(0,W.jsxs)(`button`,{ref:e.rowRef,type:`button`,role:t.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":t.checked,"aria-haspopup":t.children?`menu`:void 0,"aria-expanded":t.children?!!e.open:void 0,className:Jr({selected:e.selected,open:e.open,danger:t.danger}),onMouseEnter:e.onEnter,onMouseLeave:e.onLeave,onClick:e.onPick,children:[(0,W.jsx)(`span`,{children:t.label}),t.children?(0,W.jsx)(hs,{right:!0,className:Zr(!!(e.selected||e.open))}):t.checked?(0,W.jsx)(`span`,{className:Qr,"aria-hidden":!0,children:`✓`}):t.key&&(0,W.jsx)(`span`,{className:Xr({selected:e.selected,danger:t.danger}),children:t.key})]})}function ys(){let e=y(D),[t,n]=(0,m.useState)(0),[r,i]=(0,m.useState)(null),[a,o]=(0,m.useState)(-1),[s,c]=(0,m.useState)(!1),l=(0,m.useRef)(null),u=(0,m.useRef)(null),d=(0,m.useRef)([]),f=(0,m.useRef)(void 0),[p,h]=(0,m.useState)({x:0,y:0}),[g,_]=(0,m.useState)({x:0,y:0});if((0,m.useLayoutEffect)(()=>{if(!e||!l.current)return;n(e.start??(e.fromKeyboard?0:-1)),i(null),c(!1);let{width:t,height:r}=l.current.getBoundingClientRect(),a=e.right===void 0?e.x:Math.max(e.right-l.current.offsetWidth,0);h({x:_s(a,t,window.innerWidth),y:_s(e.y,r,window.innerHeight)});let o=e.target;return o?.setAttribute(`data-menu-open`,``),()=>o?.removeAttribute(`data-menu-open`)},[e]),(0,m.useLayoutEffect)(()=>{let e=r===null?null:d.current[r];if(!e||!l.current||!u.current)return;let t=l.current.getBoundingClientRect(),n=e.getBoundingClientRect(),{width:i,height:a}=u.current.getBoundingClientRect();_({x:_s(t.right+2,i,window.innerWidth,t.left-i-2),y:_s(n.top-5,a,window.innerHeight,n.bottom+5-a)})},[r]),(0,m.useEffect)(()=>()=>window.clearTimeout(f.current),[]),(0,m.useEffect)(()=>{if(!e)return;let d=e.items,f=r===null?[]:d[r]?.children??[],p=()=>D.set(null),m=e=>{e?.run&&(p(),e.run())},h=(e,t,n)=>e(e=>n===1?e>=t?0:e+1:e<=0?t:e-1),g=e=>{let l=e.key;if(s&&r!==null){let t=f.length-1;if(l===`Escape`||l===`ArrowLeft`||l===`h`)i(null),c(!1);else if(l===`ArrowDown`||l===`j`)h(o,t,1);else if(l===`ArrowUp`||l===`k`)h(o,t,-1);else if(l===`Home`)o(0);else if(l===`End`)o(t);else if(l===`Enter`)m(f[a]);else return;e.preventDefault(),e.stopPropagation();return}let u=d.length-1,g=d[t],_=()=>{i(t),c(!0),o(0)};if(l===`Escape`)p();else if(l===`ArrowDown`||l===`j`)h(n,u,1);else if(l===`ArrowUp`||l===`k`)h(n,u,-1);else if(l===`Home`)n(0);else if(l===`End`)n(u);else if((l===`ArrowRight`||l===`l`)&&g?.children)_();else if(l===`Enter`)g?.children?_():m(g);else return;e.preventDefault(),e.stopPropagation()},_=e=>{e.target instanceof Node&&(l.current?.contains(e.target)||u.current?.contains(e.target))||p()};return window.addEventListener(`keydown`,g,!0),window.addEventListener(`mousedown`,_),()=>{window.removeEventListener(`keydown`,g,!0),window.removeEventListener(`mousedown`,_)}},[e,t,r,a,s]),!e)return null;let v=r===null?null:e.items[r]?.children,b=e=>{e.run&&(D.set(null),e.run())},x=e=>{window.clearTimeout(f.current),i(e),c(!1),o(-1)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{ref:l,className:qr(),role:`menu`,style:{left:p.x,top:p.y,minWidth:e.minWidth},children:e.items.map((a,o)=>(0,W.jsxs)(m.Fragment,{children:[o>0&&a.section!==e.items[o-1]?.section&&(0,W.jsx)(`hr`,{className:`-mx-1 my-1 h-px flex-none border-none bg-line`}),(0,W.jsx)(vs,{item:a,rowRef:e=>{d.current[o]=e},selected:o===t,open:o===r,onEnter:()=>{n(o),window.clearTimeout(f.current),a.children?f.current=window.setTimeout(()=>x(o),gs):i(null)},onLeave:()=>{window.clearTimeout(f.current),o!==r&&n(-1)},onPick:()=>a.children?x(o):b(a)})]},a.label))}),v&&(0,W.jsx)(`div`,{ref:u,className:qr(!0),role:`menu`,style:{left:g.x,top:g.y},children:v.map((e,t)=>(0,W.jsx)(vs,{item:e,selected:t===a,onEnter:()=>{o(t),c(!0)},onLeave:()=>o(-1),onPick:()=>b(e)},e.label))})]})}function bs(){let e=y(O),t=y(A);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ys,{}),e,(0,W.jsx)(`div`,{className:$r,"aria-live":`polite`,children:t.map(e=>{let t=`${ri(e.tone===`error`)} ${e.leaving?`is-leaving`:``}`,n=e.action;return n?(0,W.jsxs)(`div`,{className:`${t} ${ei}`,children:[(0,W.jsx)(`span`,{className:ti,children:e.text}),(0,W.jsx)(G,{className:ni,onClick:()=>{le(e.id),n.run()},children:`[ ${n.label} ]`})]},e.id):(0,W.jsx)(`button`,{type:`button`,className:t,onClick:()=>le(e.id),children:e.text},e.id)})})]})}var xs=`file:`,Ss=e=>`${xs}${e}`,Cs=e=>e.startsWith(xs)?e.slice(5):null;function ws(e,t){return t?`${t.replace(/\/$/,``)}/${e}`:e}function Ts(e,t){let n=e.trim().replace(/^file:\/\//i,``),r;if(n.startsWith(`./`))r=n.slice(2);else if(n.startsWith(`/`)){let e=t?.replace(/\/$/,``);if(!e||!n.startsWith(`${e}/`))return`outside`;r=n.slice(e.length+1)}else return null;return r&&!r.split(`/`).includes(`..`)?Ss(r):`outside`}function Es(e){return e===`localhost`||e.endsWith(`.localhost`)||e===`[::1]`||/^127(\.\d{1,3}){3}$/.test(e)}var Ds=/^(localhost|127(\.\d{1,3}){3}|\[::1\])(:\d+)?([/?#]|$)/i,Os=/^[a-z][a-z0-9+.-]*:(?!\d+([/?#]|$))/i;function ks(e){let t=e.trim();if(!t||/\s/.test(t)||Os.test(t)&&!/^https?:\/\//i.test(t))return null;let n=/^https?:\/\//i.test(t)?t:Ds.test(t)?`http://${t}`:`https://${t.replace(/^\/\//,``)}`;try{let e=new URL(n);return e.hostname===`[::1]`&&(e.hostname=`localhost`),e.hostname?e.href:null}catch{return null}}function As(e,t,n=Es(t.hostname)){let r=new URL(e);return r.origin===t.origin?`self`:Es(r.hostname)?n?`yes`:`remote`:r.protocol===`https:`?`yes`:`unreachable`}function js(e,t,n){let r=new URL(e).host;return t===`self`?{key:`self`,host:r}:t===`remote`?{key:`remote`,host:r}:t===`unreachable`?{key:`noFrame`,host:r}:n&&!n.reachable?{key:`unreachable`,host:r}:n&&!n.frameable?{key:`refuses`,host:r}:null}function Ms(e){return e.urls[e.at]??``}function Ns(e){let t=Cs(e);if(t!==null)return t.slice(t.lastIndexOf(`/`)+1);try{return new URL(e).host.replace(/^www\./,``)}catch{return e}}function Ps(){return{kind:`browser`,tabs:[{id:`t1`,urls:[],at:-1}],active:`t1`,recent:[`t1`],next:2}}function Fs(e,t){return!e.tabs.some(e=>e.id===t)||e.active===t&&e.recent.at(-1)===t?e:{...e,active:t,recent:[...e.recent.filter(e=>e!==t),t]}}function Is(e){let t=e;for(;t.tabs.length>12;){let e=t.tabs.filter(e=>e.id!==t.active).sort((e,n)=>t.recent.indexOf(e.id)-t.recent.indexOf(n.id))[0];if(!e)break;t=Ws(t,e.id)??t}return t}function Ls(e,t){let n=`t${e.next}`,r={id:n,urls:t,at:t.length-1};return Is(Fs({...e,tabs:[...e.tabs,r],next:e.next+1},n))}function Rs(e){return Ls(e,[])}function zs(e,t){return{...e,tabs:e.tabs.map(e=>e.id===t.id?t:e)}}function Bs(e,t,n){let r=e.tabs.find(e=>e.id===t);if(!r||Ms(r)===n)return e;let i=[...r.urls.slice(0,r.at+1),n].slice(-30);return zs(e,{...r,urls:i,at:i.length-1})}function Vs(e,t,n){let r=e.tabs.find(e=>e.id===t);return!r||n===r.at||n<0||n>=r.urls.length?e:zs(e,{...r,at:n})}function Hs(e,t){let n=e.tabs.find(e=>Ms(e)===t);if(n)return Fs(e,n.id);let r=e.tabs.find(e=>Ms(e)===``);return r?Bs(Fs(e,r.id),r.id,t):Ls(e,[t])}function Us(e,t,n){let r=e.tabs.find(e=>Ms(e)===t),i=e.tabs.find(t=>t.id===e.active),a=i&&(Ms(i)===``||Cs(Ms(i))!==null),o=r?Fs(e,r.id):a?Bs(e,i.id,t):Hs(e,t),s=o.tabs.find(e=>e.id===o.active);return n===void 0||!s||s.read===n?o:zs(o,{...s,read:n})}function Ws(e,t){let n=e.tabs.filter(e=>e.id!==t);if(n.length===0)return null;let r=e.recent.filter(e=>e!==t);if(e.active!==t)return{...e,tabs:n,recent:r};let i=[...r].reverse().find(e=>n.some(t=>t.id===e))??n[0].id;return{...e,tabs:n,active:i,recent:[...r.filter(e=>e!==i),i]}}function Gs(e,t){return e.tabs.some(e=>e.id===t)?Ws(e,t):e}function Ks(e,t){let n=e.tabs.find(e=>e.id===t);return n?{...e,tabs:[n],active:t,recent:[t]}:e}function qs(e,t,n){let r=new Set(n.map(e=>e.id)),i=[...e.filter(e=>r.has(e)&&e!==t),...r.has(t)?[t]:[]];return i.slice(Math.max(0,i.length-3))}function Js(e,t,n,r){if(!Array.isArray(e))return null;let i=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(typeof e.id!=`string`||!/^t\d+$/.test(e.id)||i.some(t=>t.id===e.id))continue;let n=Array.isArray(e.urls)?e.urls.filter(e=>typeof e==`string`&&e!==``).slice(-30):[],r=typeof e.at==`number`&&Number.isInteger(e.at)?e.at:n.length-1;i.push({id:e.id,urls:n,at:n.length===0?-1:Math.min(n.length-1,Math.max(0,r))})}let a=i[0];if(!a)return null;let o=new Set(i.map(e=>e.id)),s=Array.isArray(n)?n.filter(e=>typeof e==`string`&&o.has(e)):[],c=typeof t==`string`&&o.has(t)?t:s.at(-1)??a.id,l=Math.max(...i.map(e=>Number(e.id.slice(1))));return{kind:`browser`,tabs:i,active:c,recent:[...s.filter(e=>e!==c),c],next:Math.max(l+1,typeof r==`number`&&Number.isInteger(r)?r:0)}}var Ys=[`quota`,`files`,`diff`,`chat`,`browser`],Xs=1e3;function Zs(){return{columns:[{kind:`files`}],weights:{}}}function Qs(e,t){return e.columns.find(e=>e.kind===t)}function $s(e){return e.slice(e.lastIndexOf(`/`)+1)}function ec(e,t){return{...e,columns:e.columns.map(e=>e.kind===t.kind?t:e)}}function tc(e){return[...e].sort((e,t)=>Ys.indexOf(e.kind)-Ys.indexOf(t.kind))}function nc(e,t){return{...e,columns:tc([...e.columns,t])}}function rc(e,t){return Qs(e,t)?e:nc(e,t===`diff`?{kind:t,path:`.`,scope:`working`}:t===`browser`?Ps():{kind:t})}function ic(e,t,n){let r=Qs(e,`browser`);if(r?.kind!==`browser`)return nc(e,Us(Ps(),Ss(t),n));let i=Us(r,Ss(t),n);return i===r?e:ec(e,i)}function ac(e,t,n,r){let i=r===void 0?{kind:`diff`,path:t,scope:n}:{kind:`diff`,path:t,scope:n,at:r},a=Qs(e,`diff`);return a?a.kind===`diff`&&a.path===t&&a.scope===n&&(r===void 0||a.at===r)?e:ec(e,i):nc(e,i)}function oc(e,t){let n=Qs(e,`browser`);return n?.kind===`browser`?ec(e,Hs(n,t)):nc(e,Hs(Ps(),t))}function sc(e,t){if(!Qs(e,t))return e;let{[t]:n,...r}=e.weights;return{columns:e.columns.filter(e=>e.kind!==t),weights:r}}function cc(e,t){let n=Qs(e,`browser`);if(n?.kind!==`browser`)return e;let r=t(n);return r===n?e:r?ec(e,r):sc(e,`browser`)}function lc(e,t,n){if(!t){let t=e.columns.filter(e=>e.kind===n);return{panel:rc({...e,columns:t},n),open:!0}}if(Qs(e,n)){let t=sc(e,n);return{panel:t,open:t.columns.length>0}}return{panel:rc(e,n),open:!0}}function uc(e){let t=e.columns.flatMap(t=>{let n=e.weights[t.kind];return n!==void 0&&n>0?[n]:[]}),n=t.length>0?t.reduce((e,t)=>e+t,0)/t.length:1,r=e.columns.map(t=>e.weights[t.kind]||n),i=r.reduce((e,t)=>e+t,0);return r.map(e=>e/i*Xs)}function dc(e,t){let n=t.reduce((e,t)=>e+t,0);if(t.length!==e.columns.length||!(n>0))return e;let r=Object.fromEntries(e.columns.map((e,r)=>[e.kind,Math.round(t[r]/n*1e3)/1e3]));return e.columns.every(t=>Math.abs((e.weights[t.kind]??0)-(r[t.kind]??0))<.001)?e:{...e,weights:r}}function fc(e){return Object.keys(e.weights).length===0?e:{...e,weights:{}}}function pc(e,t,n,r){let i=e[t],a=e[t+1];if(i===void 0||a===void 0)return[...e];let o=i+a,s=Math.min(r,o/2),c=Math.max(s,Math.min(o-s,i+n));return e.map((e,n)=>n===t?c:n===t+1?o-c:e)}var mc=Ys.filter(e=>e!==`chat`),hc=v(`terminal`),gc=`rove.web.panelWidth`,_c=`rove.web.panelOpen`,vc=v((()=>{let e=Number(localStorage.getItem(gc));return Number.isFinite(e)&&e>0?e:null})());vc.subscribe(()=>{let e=vc.get();e===null?localStorage.removeItem(gc):localStorage.setItem(gc,String(Math.round(e)))}),vc.subscribe(fe);var yc=v(localStorage.getItem(_c)===`1`);yc.subscribe(()=>localStorage.setItem(_c,yc.get()?`1`:`0`));var bc=v(!1);yc.subscribe(()=>{yc.get()||bc.set(!1)});function xc(e,t,n=window.innerWidth){let r=Math.max(280,n-t-320);return Math.max(280,Math.min(r,Math.round(e)))}var Sc=[`files`,`diff`,`browser`];function Cc(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.taskId==`string`&&t.taskId!==``&&Sc.includes(t.view)&&typeof t.at==`number`&&(t.url===void 0||typeof t.url==`string`)&&(t.path===void 0||typeof t.path==`string`)}function wc(e){return e.narrow?{panel:!1,panelOpen:!1,narrow:!0}:{panel:!0,panelOpen:e.panelOpen,narrow:!1}}function Tc(e,t){return{tab:e.path?e.view===`files`?`browser`:`diff`:e.view,...e.view===`browser`&&e.url?{url:e.url}:{},...e.view!==`browser`&&e.path?{path:e.path}:{},show:t.taskId===e.taskId&&!t.narrow}}function Ec(e,t,n){return t.url?oc(e,t.url):t.path?t.tab===`browser`?ic(e,t.path,n):ac(e,t.path,`working`,n):rc(e,t.tab)}var Dc=[`files`,`chat`,`diff`,`browser`,`quota`],Oc=e=>e===`branch`||e===`task`?e:`working`;function kc(e){if(!e||typeof e!=`object`)return null;let t=e;return t.kind===`files`||t.kind===`chat`||t.kind===`quota`?{kind:t.kind}:t.kind===`diff`&&typeof t.path==`string`&&t.path!==``?{kind:`diff`,path:t.path,scope:Oc(t.scope)}:t.kind===`browser`?Js(t.tabs,t.active,t.recent,t.next):null}function Ac(e,t){if(!e||typeof e!=`object`)return{};let n=e,r=t.flatMap(({kind:e})=>{let t=n[e];return typeof t==`number`&&Number.isFinite(t)&&t>0?[[e,t]]:[]});return Object.fromEntries(r)}function jc(e){let t=[e.top,e.bottom].map(e=>e&&typeof e==`object`&&`tabs`in e&&Array.isArray(e.tabs)?e.tabs:null);return t[0]?{tabs:t.flatMap(e=>e??[]).filter(e=>!!e&&typeof e==`object`&&/^t\d+$/.test(String(e.id))),recent:Array.isArray(e.recent)?e.recent.filter(e=>typeof e==`string`):[]}:null}function Mc(e){let t=jc(e);if(!t)return null;let n=[...new Set(t.tabs.map(e=>e.kind))],r=[];for(let i of n){if((i===`files`||i===`chat`||i===`quota`)&&r.push({kind:i}),i===`diff`){let e=t.tabs.filter(e=>e.kind===`diff`&&typeof e.path==`string`&&e.path!==``),n=[...t.recent].reverse().map(t=>e.find(e=>e.id===t)).find(e=>e)??e[0];n&&r.push({kind:`diff`,path:n.path,scope:Oc(n.scope)})}if(i===`browser`){let n=Js(t.tabs.filter(e=>e.kind===`browser`),void 0,t.recent,e.next);n&&r.push(n)}}return{columns:tc(r),weights:{}}}function Nc(e){if(!e||typeof e!=`object`)return null;let t=e;if(!Array.isArray(t.columns))return Mc(t);let n=[];for(let e of t.columns){let t=kc(e);t&&!n.some(e=>e.kind===t.kind)&&n.push(t)}let r={columns:tc(n),weights:Ac(t.weights,n)},i=t.columns.find(e=>e?.kind===`file`&&typeof e.path==`string`&&e.path!==``);return i?ic(r,i.path):r}function Pc(e,t){let n=Zs(),r=typeof t==`string`&&t!==``?t:``;return e!==`browser`&&!r?n:{...n,columns:[...n.columns,r?Hs(Ps(),r):Ps()]}}function Fc(e){try{let t=JSON.parse(e??`{}`);return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t):[]}catch{return[]}}function Ic(e,t,n){let r=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));r[t]=n;for(let e of Object.keys(r).slice(0,-50))delete r[e];return r}function Lc(e,t){let n={};for(let[t,r]of Fc(e)){let e=Nc(r);e&&(n[t]=e)}let r=new Map(Fc(t.tab).filter(([,e])=>Dc.includes(e))),i=new Map(Fc(t.url)),a=[...new Set([...r.keys(),...i.keys()])].filter(e=>!(e in n));n={...Object.fromEntries(a.map(e=>[e,Pc(r.get(e),i.get(e))])),...n};for(let e of Object.keys(n).slice(0,-50))delete n[e];return n}var Rc=`rove.web.panels`,zc=`rove.web.panelTab`,Bc=`rove.web.panelUrl`;function Vc(){let e={tab:localStorage.getItem(zc),url:localStorage.getItem(Bc)},t=Lc(localStorage.getItem(Rc),e);return(e.tab!==null||e.url!==null)&&(localStorage.setItem(Rc,JSON.stringify(t)),localStorage.removeItem(zc),localStorage.removeItem(Bc)),t}var Hc=v(Vc()),Uc={columns:[],weights:{}};function Wc(e){return y(Hc)[e]??Uc}function Gc(e){let t=Wc(e??``),n=y(yc),r=y(L)!==null,i=y(N)!==null;return n&&!r&&!i&&(e===null||t.columns.length>0)}function Kc(e){return!yc.get()||L.get()!==null||N.get()!==null?!1:e===null||(Hc.get()[e]??Uc).columns.length>0}var qc=e=>Hc.subscribe(e);function Jc(e,t){let n=Hc.get()[e]??Uc,r=t(n);if(r===n)return;let i=Ic(Hc.get(),e,r);Hc.set(i),localStorage.setItem(Rc,JSON.stringify(i))}function Yc(e,t){Jc(e,e=>rc(e,t)),yc.set(!0),Se()&&hc.set(t)}function Xc(e,t){let n=yc.get(),r=lc(Hc.get()[e]??Uc,n,t);Jc(e,()=>r.panel),r.open?yc.set(!0):bc.set(!1)}function Zc(e){Jc(e.taskId,t=>ac(t,e.path,e.scope)),yc.set(!0),Se()&&hc.set(`diff`)}function Qc(e,t){Jc(e,e=>ic(e,t)),yc.set(!0),Se()&&hc.set(`browser`)}function $c(e,t){Jc(e,e=>oc(e,t)),yc.set(!0),Se()&&hc.set(`browser`)}function el(e,t){let n=Hc.get()[e]??Uc;!Se()&&n.columns.length===0&&bc.set(!1),Se()&&hc.get()===t&&!Qs(n,t)&&Yc(e,`files`)}function tl(e,t){Jc(e,e=>sc(e,t)),el(e,t)}function nl(e,t){Jc(e,e=>cc(e,t)),el(e,`browser`)}function rl(e,t){nl(e,e=>Gs(e,t))}function il(e,t){let n=Tc(e,{taskId:t,narrow:Se()});Jc(e.taskId,t=>Ec(t,n,e.at)),n.show&&yc.set(!0)}var al={Enter:`return`," ":`space`,Escape:`escape`,ArrowUp:`up`,ArrowDown:`down`,ArrowLeft:`left`,ArrowRight:`right`,PageUp:`pageup`,PageDown:`pagedown`};function ol(e){if(e.altKey&&e.code){let t=/^Key([A-Z])$/.exec(e.code);if(t?.[1])return t[1].toLowerCase();let n=/^Digit(\d)$/.exec(e.code);if(n?.[1])return n[1]}return al[e.key]??e.key.toLowerCase()}function sl(e){let t=ol(e),n=t===`return`?[`return`,`enter`]:[t],r=[];e.ctrlKey&&r.push(`ctrl`),e.metaKey&&r.push(`cmd`),e.altKey&&r.push(`alt`);let i=t.length===1;return e.shiftKey&&!i&&r.push(`shift`),r.length===0?e.shiftKey&&i?[...n.map(e=>`shift+${e}`),...n]:n:e.shiftKey&&i?[]:n.map(e=>`${r.join(`+`)}+${e}`)}function cl(e){return e.startsWith(`shift+`)&&e.length===7?e.slice(6).toUpperCase():e}var ll=new Map(Y.map(e=>[e.id,{keys:[...e.keys],prefixKeys:e.prefixKeys&&[...e.prefixKeys],hint:e.hint?{...e.hint}:void 0}]));function ul(){return Y.map(e=>{let t=ll.get(e.id);return{id:e.id,scope:e.scope,category:e.category,...e.bareKeys?{bareKeys:!0}:{},keys:[...t?.keys??[]],...t?.prefixKeys?{prefixKeys:[...t.prefixKeys]}:{},...t?.hint?{hint:{...t.hint}}:{}}})}var dl=new Map(Y.map(e=>[e.id,e]));function fl(e){return dl.get(e)}function pl(e,t){if(!e)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e=0;e<r.length&&i<n.length;e++)r.charCodeAt(e)===n.charCodeAt(i)&&i++;return i===n.length}function ml(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.category);e||(e=[],n.set(r.category,e),t.push({category:r.category,rows:e})),e.push(r)}return t}function hl(e){return e.hint?.keys??e.keys[0]}function gl(e){let t=fl(e);if(!t)return null;let n=hl(t);return n&&n.length>0?n:null}function _l(e){return e.keys.length>0?e.hint?.keys??e.keys[0]??null:e.prefixKeys?.length?null:e.hint?.keys??null}function vl(e,t){return e.scope===`global`?!0:t===null?!1:e.scope===t||t===`terminal`&&e.scope===`workspace`}function yl(e,t,n,r){let i=[],a=[],o=[],s=new Map;for(let c of e){let e=_l(c),l=vl(c,t),u=r?r.direct.has(c.id):l,d=r?r.prefix.has(c.id):l;if(e){let t={binding:c,primary:e,aliases:c.keys.filter(t=>t!==e)};if(u&&(l||c.presentation===`onePress`))c.presentation===`onePress`?a.push(t):i.push(t);else if(!l&&c.scope!==`global`){let e=s.get(c.scope);e?e.push(t):s.set(c.scope,[t])}}n&&d&&c.prefixKeys?.length&&o.push({binding:c,primary:`${n} + ${c.prefixKeys[0]}`,aliases:c.prefixKeys.slice(1).map(e=>`${n} + ${e}`)})}let c=[];i.length&&c.push({kind:`here`,scope:t??void 0,rows:i}),a.length&&c.push({kind:`direct`,rows:a}),o.length&&c.push({kind:`prefix`,rows:o});for(let[e,t]of s)c.push({kind:`other`,scope:e,rows:t});return c}var bl={global:`Global`,sidebar:`Sidebar`,workspace:`Workspace`,files:`Files`,inbox:`Inbox`,terminal:`Terminal`};function xl(e){return e?bl[e]:`Global`}function Sl(e){return[`kanban.open`,`automations.open`,`workItems.open`].includes(e)?`Views`:e.startsWith(`focus.`)?`Navigation`:e.startsWith(`inbox.`)||e.startsWith(`attention.`)?`Attention`:e.startsWith(`chat.tab.`)||e.startsWith(`chat.session.`)?`Sessions`:e.startsWith(`chat.fork.`)||e.startsWith(`task.`)?`Tasks`:e.startsWith(`settings.`)||e===`workspace.filesToggle`?`Tools`:fl(e)?.category??`Global`}function Cl(e,t,n){let r=e.trim();return pl(r,t)||pl(r,n)}var wl={title:`Rove — keybindings`,palette:`Search commands`,search:`Type an action name or chord…`,filter:`/ filter actions`,noResults:`No matching actions. Try another name or clear the filter.`,run:`↑↓ select · enter run · esc cancel`,reportProblem:`Report a problem`,reportPrompt:"You are helping the user report a problem with Rove itself (not their own project) as a GitHub issue. First ask what they were doing and what felt wrong: one to three short questions, one at a time. Then collect context: run `rove --version` and `rove daemon status`, and read the last ~50 lines of {logPath} only if the problem could involve the daemon. Draft an issue title and body (what happened, what they expected, steps, relevant output) and show it to the user. Only after they say OK, file it with a heredoc: `rove feedback --kind bug|idea|question --title \"...\" --body-file - <<'EOF'` followed by the body and `EOF`. Then share the issue URL. If it prints a prefilled link instead (gh missing or signed out), give the user that link and tell them to run `gh auth login`.",unavailable:`This action is no longer available. Close and reopen the palette.`,esc:`esc`,scrollKeys:`↑↓ ⇞⇟ scroll`,commandLayer:`{prefix} — more Rove commands`,escCancel:`esc cancel`,directLayer:`Hold ctrl — Rove shortcuts`,releaseCtrl:`release ctrl to close`,overflow:`… F1 for all shortcuts`,moreCommandsPrefix:`More commands (prefix)`,focused:`Focused: {surface}`,allBindings:`All keybinding contexts`,grammar:`Use keys here · one-press Rove shortcuts · {prefix} for more commands · right-click a row for its menu`,disabled:`prefix disabled`,here:`HERE — only in {surface}`,direct:`ONE PRESS — Rove shortcuts`,afterPrefix:`AFTER PREFIX — more Rove commands`,otherPane:`OTHER PANE — {surface}`,marks:{rows:`MARKS — task and tab rows`,inbox:`MARKS — tab strip and Inbox`},mark:{spinner:`working: an engine turn or a task job is running`,needsInput:`waiting on your answer: a permission prompt or a question`,attention:`needs you: an error, a rate limit, an exited engine or a failed deletion`,unseen:`a turn finished and you have not looked yet`,idle:`quiet`,subagent:`running subagents, in front of the branch`,remote:`the task lives on another machine`,done:`the turn finished`,rateLimited:`rate limited; it resumes on its own`,dead:`the engine process exited`,routineFailed:`a routine run failed`}},Tl={title:`Rove — 快捷键`,palette:`搜索命令`,search:`输入操作名称或快捷键…`,filter:`/ 筛选操作`,noResults:`没有匹配的操作。请换个名称或清空筛选。`,run:`↑↓ 选择 · enter 执行 · esc 取消`,reportProblem:`报告问题`,reportPrompt:"你在帮用户把 Rove 本身的问题(不是他们自己项目的问题)提成一个 GitHub issue。先问清楚他们当时在做什么、哪里不对劲:一到三个简短的问题,一次问一个。然后收集上下文:运行 `rove --version` 和 `rove daemon status`,只有问题可能和 daemon 有关时才读 {logPath} 的最后约 50 行。起草 issue 的标题和正文(发生了什么、期望什么、复现步骤、相关输出)并展示给用户。用户确认之后才提交,用 heredoc:`rove feedback --kind bug|idea|question --title \"...\" --body-file - <<'EOF'`,接正文,最后一行 `EOF`。然后把 issue 链接发给用户。如果输出的是预填链接(没装 gh 或没登录),把链接给用户,并告诉他运行 `gh auth login`。",unavailable:`此操作已不可用。请关闭并重新打开命令面板。`,esc:`esc`,scrollKeys:`↑↓ ⇞⇟ 滚动`,commandLayer:`{prefix} — 更多 Rove 命令`,escCancel:`esc 取消`,directLayer:`按住 ctrl — Rove 快捷键`,releaseCtrl:`松开 ctrl 关闭`,overflow:`… 按 F1 查看全部快捷键`,moreCommandsPrefix:`更多命令(prefix)`,focused:`当前焦点:{surface}`,allBindings:`所有快捷键上下文`,grammar:`当前区域直接按 · Rove 单次快捷键 · {prefix} 打开更多命令 · 右键任务行打开菜单`,disabled:`Prefix 已禁用`,here:`当前区域 — 仅在{surface}`,direct:`一次按下 — Rove 快捷键`,afterPrefix:`按下 Prefix 后 — 更多 Rove 命令`,otherPane:`其他区域 — {surface}`,marks:{rows:`标记 — 任务行和标签行`,inbox:`标记 — 标签栏和收件箱`},mark:{spinner:`运行中:引擎正在执行一轮,或任务作业正在运行`,needsInput:`等你回答:权限确认或提问`,attention:`需要你处理:出错、限流、引擎已退出或删除失败`,unseen:`一轮已结束,你还没看过`,idle:`空闲`,subagent:`正在运行的子代理,显示在分支名前`,remote:`任务在另一台机器上`,done:`这一轮已结束`,rateLimited:`被限流,会自动恢复`,dead:`引擎进程已退出`,routineFailed:`例行任务运行失败`}},El={category:{Global:`Global`,Sidebar:`Sidebar`,Workspace:`Workspace`,Navigation:`Navigation`,"Tasks pane":`Tasks pane`,Files:`Files`,Terminal:`Terminal`,Views:`Views`,Tasks:`Tasks`,Sessions:`Sessions`,Attention:`Attention`,Tools:`Tools`,"Diff review":`Diff review`,Inbox:`Inbox`},desc:{"palette.open":`Search commands`,"help.open":`Show keybindings help`,"task.new":`New task`,"task.new.global":`New task`,"task.openEditor":`Open active Task directory in editor`,"task.moveMode":`Reorder sidebar rows (then j/k — tab, task, or project)`,"settings.open":`Open settings`,"app.refresh":`Refresh Rove onto the installed build (after an update)`,"settings.open.sidebar":`Open settings`,"inbox.show":`Open Inbox`,"worktrees.open.sidebar":`Open worktrees`,"kanban.open":`Open kanban (issues board)`,"automations.open":`Open routines (scheduled tasks)`,"workItems.open":`Open GitHub issues (external tracker)`,"app.quit":`Quit (with confirm)`,"focus.sidebar":`Back to sidebar (tasks)`,"focus.previous":`Focus previous pane (files → workspace → sidebar)`,"focus.next":`Focus next pane (sidebar → workspace → files)`,"workspace.filesToggle":`Show or hide Files`,"view.redraw":`Redraw the screen`,"attention.next":`Jump to the next Inbox item`,"task.previous":`Back to the previous task`,"sidebar.nav":`Move cursor up/down`,"sidebar.select":`Open the selected task`,"sidebar.tree.open":`Open the row under the cursor`,"sidebar.goto":`Top / bottom of list (gg or shift-G)`,"sidebar.rename":`Rename task`,"sidebar.localMerge":`Reorder row (Shift+M, then j/k — tab, task, or project)`,"sidebar.pin":`Pin / unpin task at top (Shift+P)`,"sidebar.sort":`Cycle task sort (default → recent → attention → name)`,"sidebar.delete":`Remove session (with confirm)`,"sidebar.search.enter":`Search tasks (fuzzy filter)`,"sidebar.search.nav":`Move highlight in search results`,"sidebar.search.submit":`Select search match and exit search`,"sidebar.search.cancel":`Cancel search (restore prior selection)`,"tasks.openWorktree":`Open selected Task directory in your editor`,"tasks.renameBranch":`Rename the selected task's git branch`,"tasks.cycleEngine":`Cycle engine vendor — applies on reopen`,"tasks.update":`Open the update page (when a new version is available)`,"tasks.focusEngine":`Focus the engine pane of the current window`,"chat.tab.new":`New conversation here (a child task sharing this directory)`,"chat.tab.chooseEngine":`New conversation — engine/shell picker with destination + context toggles`,"chat.tab.fork":`Continue this chat in a new child task (same directory, keeps the conversation)`,"chat.fork.new":`Quick-fork: create child task seeded with current repo/branch/model`,"chat.tab.close":`Close chat tab`,"chat.tab.rename":`Rename active chat tab`,"chat.tab.cycle-next":`Next chat tab`,"chat.tab.cycle-prev":`Previous chat tab`,"chat.tab.goto":`Go to chat tab N`,"workspace.split.right":`Split right`,"workspace.split.down":`Split down`,"workspace.split.focus-next":`Focus next split`,"workspace.split.close":`Close active split (tab when unsplit)`,"workspace.split.rename":`Rename active split (tab when unsplit)`,"workspace.reopenSession":`Reopen a session in a task whose tabs are all closed`,"files.nav":`Move cursor up/down`,"files.hierarchy":`Collapse / expand tree level`,"files.open":`Open file in configured editor (diff when supported)`,"files.tab":`Switch tab (cycle All / Changes)`,"files.refresh":`Refresh`,"files.scope":`Toggle Changes scope (working ↔ branch vs base)`,"files.diff":`Open a read-only diff in a workspace tab`,"files.diffAll":`Open the whole worktree's diff in one workspace tab`,"files.openExternal":`Open file in system default app (audio / video / pdf preview)`,"files.mention":`Inject @<path> mention into the engine pane`,"files.createPR":`Ask the agent to create a PR from the current task`,"files.fixChecks":`Ask the agent to fix the failing PR checks`,"files.syncBase":`Merge the base branch into this task's worktree`,"diff.review.cursor":`Move the line cursor over the diff`,"diff.review.range":`Toggle range anchor at the cursor`,"diff.review.note":`Add a review note at the cursor`,"diff.review.send":`Send all unsent review notes to the engine`,"diff.review.drop":`Drop the review note the cursor sits inside`,"diff.review.reload":`Reload the previewed file from disk`,"inbox.nav":`Move through Inbox items`,"inbox.open":`Open the selected Inbox item`,"inbox.delete":`Ack the selected Inbox item`,"inbox.deleteAll":`Ack every ATTENTION item`,"terminal.scroll-up":`Scroll scrollback up`,"terminal.scroll-down":`Scroll scrollback down`,"terminal.reset":`Reset terminal — kill the current shell and respawn`}},Dl={category:{Global:`全局`,Sidebar:`侧边栏`,Workspace:`工作区`,Navigation:`导航`,"Tasks pane":`任务面板`,Files:`文件`,Terminal:`终端`,Views:`视图`,Tasks:`任务`,Sessions:`会话`,Attention:`提醒`,Tools:`工具`,"Diff review":`差异审阅`,Inbox:`收件箱`},desc:{"palette.open":`搜索命令`,"help.open":`显示快捷键帮助`,"task.new":`新建任务`,"task.new.global":`新建任务`,"task.openEditor":`在编辑器中打开当前 Task 的目录`,"task.moveMode":`调整侧边栏行顺序(然后 j/k——tab / 任务 / 项目)`,"settings.open":`打开设置`,"app.refresh":`让 Rove 刷新到已安装的版本(更新之后)`,"settings.open.sidebar":`打开设置`,"inbox.show":`打开收件箱`,"worktrees.open.sidebar":`打开 worktrees`,"kanban.open":`打开看板(issues)`,"automations.open":`打开例行任务(定时任务)`,"workItems.open":`打开 GitHub issues(外部跟踪器)`,"app.quit":`退出(需确认)`,"focus.sidebar":`返回侧边栏(任务列表)`,"focus.previous":`聚焦上一个面板(文件 → 工作区 → 侧边栏)`,"focus.next":`聚焦下一个面板(侧边栏 → 工作区 → 文件)`,"workspace.filesToggle":`显示或收起文件栏`,"view.redraw":`重绘屏幕`,"attention.next":`跳到下一个收件箱条目`,"task.previous":`回到上一个任务`,"sidebar.nav":`上下移动光标`,"sidebar.select":`打开选中的任务`,"sidebar.tree.open":`打开光标所在行`,"sidebar.goto":`跳到列表顶部 / 底部(gg 或 shift-G)`,"sidebar.rename":`重命名任务`,"sidebar.localMerge":`调整当前行顺序(Shift+M,然后 j/k——tab / 任务 / 项目)`,"sidebar.pin":`置顶 / 取消置顶任务(Shift+P)`,"sidebar.sort":`切换任务排序方式(默认 → 最近 → 关注 → 名称)`,"sidebar.delete":`移除会话(需确认)`,"sidebar.search.enter":`搜索任务(模糊过滤)`,"sidebar.search.nav":`在搜索结果中移动高亮`,"sidebar.search.submit":`选中搜索匹配项并退出搜索`,"sidebar.search.cancel":`取消搜索(恢复之前的选中项)`,"tasks.openWorktree":`在编辑器中打开选中 Task 的目录`,"tasks.renameBranch":`重命名选中任务的 git 分支`,"tasks.cycleEngine":`循环切换引擎厂商——重新打开后生效`,"tasks.update":`打开更新页面(有新版本时)`,"tasks.focusEngine":`聚焦当前窗口的引擎面板`,"chat.tab.new":`在此新建对话(共享当前目录的子任务)`,"chat.tab.chooseEngine":`新建对话 —— 选择引擎或 shell,可切换落点与上下文`,"chat.tab.fork":`把当前对话接到新子任务(同一目录,带上已有对话)`,"chat.fork.new":`快速派生:以当前仓库/分支/模型创建子任务`,"chat.tab.close":`关闭聊天标签页`,"chat.tab.rename":`重命名当前聊天标签页`,"chat.tab.cycle-next":`下一个聊天标签页`,"chat.tab.cycle-prev":`上一个聊天标签页`,"chat.tab.goto":`跳到第 N 个聊天标签页`,"workspace.split.right":`向右分屏`,"workspace.split.down":`向下分屏`,"workspace.split.focus-next":`聚焦下一个分屏`,"workspace.split.close":`关闭当前分屏(未分屏时关闭标签页)`,"workspace.split.rename":`重命名当前分屏(未分屏时重命名标签页)`,"workspace.reopenSession":`在标签页全部关闭的任务中重新打开会话`,"files.nav":`上下移动光标`,"files.hierarchy":`折叠 / 展开树层级`,"files.open":`在已配置的编辑器中打开文件(支持时显示 diff)`,"files.tab":`切换标签页(循环 全部 / 变更)`,"files.refresh":`刷新`,"files.scope":`切换变更范围(工作区 ↔ 分支对比 base)`,"files.diff":`在工作区标签页中打开只读 diff`,"files.diffAll":`把整个 worktree 的 diff 打开在一个工作区标签页里`,"files.openExternal":`在系统默认应用中打开文件(音频 / 视频 / pdf 预览)`,"files.mention":`将 @<path> 提及注入引擎面板`,"files.createPR":`让 agent 从当前任务创建 PR`,"files.fixChecks":`让 agent 修复失败的 PR 检查`,"files.syncBase":`把基础分支合并进该任务的工作树`,"diff.review.cursor":`在 diff 中移动行光标`,"diff.review.range":`在光标处切换范围锚点`,"diff.review.note":`在光标处添加审阅备注`,"diff.review.send":`将所有未发送的审阅备注发给引擎`,"diff.review.drop":`删除光标所在的评审备注`,"diff.review.reload":`从磁盘重新加载当前预览的文件`,"inbox.nav":`在收件箱条目之间移动`,"inbox.open":`打开选中的收件箱条目`,"inbox.delete":`将选中的收件箱条目标为已阅`,"inbox.deleteAll":`将所有待处理条目标为已阅`,"terminal.scroll-up":`向上滚动回滚`,"terminal.scroll-down":`向下滚动回滚`,"terminal.reset":`重置终端——关闭当前 shell 并重新启动`}};function Ol(e,t){let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`||!(e in n))return;n=Reflect.get(n,e)}return typeof n==`string`?n:void 0}function kl(e,t){return Mt.get()===`zh`?t:e}function Al(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e)):e}var jl=(e,t)=>Al(Ol(kl(wl,Tl),e)??Ol(wl,e)??e,t),Ml=(e,t)=>Al(Ol(kl(Yi,Xi),e)??Ol(Yi,e)??e,t);function Nl(e){return kl(El,Dl).desc[e]??El.desc[e]??e}function Pl(e){let t=Nl(e),n=t.search(/\s—\s|——/);return n>0?t.slice(0,n):t}function Fl(e){return kl(El,Dl).category[e]??e}var Il=(e,t)=>Al(Ol(kl($i,ea),e)??Ol($i,e)??e,t),Ll=(e,t)=>Al(Ol(kl(qi,Ji),e)??Ol(qi,e)??e,t),Rl=e=>e.split(` + `).map(e=>so(e)).join(` + `);function zl(e){let t=Fl(xl(e.scope));return e.kind===`here`?jl(`here`,{surface:t}):e.kind===`direct`?jl(`direct`):e.kind===`prefix`?jl(`afterPrefix`):jl(`otherPane`,{surface:t})}function Bl(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null;O.set((0,W.jsx)(Vl,{model:e,surface:Ao(),origin:t}))}function Vl({model:e,surface:t,origin:n}){U();let r=y(lo),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=(0,m.useRef)(null),l=(0,m.useMemo)(()=>jo(e,t),[e,t]),u=(0,m.useMemo)(()=>yl(Mo(),t===`terminal`?`terminal`:t,ho(),l),[l,t,r]).map(e=>({...e,rows:e.rows.filter(e=>Cl(o,Nl(e.binding.id),e.primary))})).filter(e=>e.rows.length>0);return(0,m.useEffect)(()=>()=>n?.focus(),[n]),(0,m.useEffect)(()=>{let e=c.current,t=t=>{if(!e||t.ctrlKey||t.metaKey||t.altKey)return;let n=e.clientHeight;if(t.key===`ArrowUp`)e.scrollBy({top:-24});else if(t.key===`ArrowDown`)e.scrollBy({top:24});else if(t.key===`PageUp`)e.scrollBy({top:-n});else if(t.key===`PageDown`)e.scrollBy({top:n});else if(t.key===`Home`)e.scrollTo({top:0});else if(t.key===`End`)e.scrollTo({top:e.scrollHeight});else if(!i&&t.key===`?`)B();else if(!i&&t.key===`/`)a(!0);else return;t.preventDefault()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[i]),(0,W.jsx)(Ci,{title:jl(`title`),wide:!0,children:(0,W.jsxs)(`div`,{className:`${Kr} help`,children:[(0,W.jsxs)(`div`,{className:gn,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-muted`,children:t?jl(`focused`,{surface:Fl(xl(t))}):jl(`allBindings`)}),(0,W.jsx)(`p`,{className:`text-muted`,children:jl(`grammar`,{prefix:go()})})]}),(0,W.jsxs)(`div`,{className:_n,children:[(0,W.jsx)(`span`,{className:`subtle`,children:jl(`scrollKeys`)}),(0,W.jsx)(`button`,{type:`button`,className:jr,onClick:B,children:jl(`esc`)})]})]}),i?(0,W.jsx)(`input`,{className:Nr,autoFocus:!0,spellCheck:!1,value:o,placeholder:jl(`search`),onChange:e=>{s(e.target.value),c.current?.scrollTo({top:0})}}):(0,W.jsx)(`p`,{className:`text-muted`,children:jl(`filter`)}),u.length===0&&(0,W.jsx)(`p`,{className:`text-muted`,children:jl(`noResults`)}),(0,W.jsx)(`div`,{className:vn,ref:c,children:u.map((e,t)=>(0,W.jsxs)(`section`,{className:yn,children:[(0,W.jsx)(`h2`,{className:bn,children:zl(e)}),e.rows.map(t=>(0,W.jsxs)(`div`,{className:xn,children:[(0,W.jsx)(`span`,{className:`mono ${Sn}`,children:Rl(t.primary)}),(0,W.jsx)(`span`,{className:`flex-1`,children:Nl(t.binding.id)}),t.aliases.length>0&&(0,W.jsx)(`span`,{className:`text-muted`,children:`(${t.aliases.map(Rl).join(`, `)})`})]},`${e.kind}-${t.binding.id}`))]},`${e.kind}-${e.scope??t}`))})]})})}function Hl(e){switch(e){case`permission_needed`:return{glyph:`?`,tone:`warning`,stateKey:`inbox.state.needsInput`};case`turn_complete`:return{glyph:`✓`,tone:`success`,stateKey:`inbox.state.done`};case`rate_limited`:return{glyph:`◷`,tone:`warning`,stateKey:`inbox.state.rateLimited`};case`dead`:return{glyph:`†`,tone:`attention`,stateKey:`inbox.state.dead`};case`restored`:return{glyph:`!`,tone:`attention`,stateKey:`inbox.state.restored`};case`decision_needed`:return{glyph:`?`,tone:`warning`,stateKey:`inbox.state.decision`};case`routine_failed`:return{glyph:`↻`,tone:`attention`,stateKey:`inbox.state.routineFailed`};case`report_missing`:return{glyph:`!`,tone:`warning`,stateKey:`inbox.state.reportMissing`};default:return{glyph:`!`,tone:`attention`,stateKey:`inbox.state.error`}}}function Ul(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}var Wl=e=>e===`routine_failed`,Gl=e=>`${e.taskId??``}:${e.tabId??``}`;function Kl(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=e=>+(e.state===`turn_complete`),i=e=>n.get(e.taskId??``)??2**53-1;return[...e].sort((e,t)=>r(e)-r(t)||e.at-t.at||i(e)-i(t)||Gl(e).localeCompare(Gl(t)))}function ql(e,t,n){let r=new Set(t),i=Kl(e,t).filter(e=>e.taskId===null||r.has(e.taskId));if(i.length===0)return null;let a=n.taskId===null?-1:i.findIndex(e=>Gl(e)===Gl(n));return a<0||i.length===1?i[0]??null:i[(a+1)%i.length]??null}function Jl(e){let t=(e.terminal?.tail??[]).map(e=>e.trimEnd()),n=t.length;for(;n>0&&t[n-1]===``;)n--;let r=0;for(;r<n&&t[r]===``;)r++;return t.slice(Math.max(r,n-12),n)}async function Yl(e,t,n=!1){let r=`attention.dismiss`,i;if(Wl(t.state)){if(!t.automationId)return;r=`attention.dismissRoutine`,i={automationId:t.automationId}}else{if(t.gateId||t.state===`decision_needed`||t.state===`report_missing`&&!n||t.taskId===null)return;i={taskId:t.taskId,...t.tabId?{tabId:t.tabId}:{},...t.deliveryId?{deliveryId:t.deliveryId}:{}}}await e.client.request(r,i).catch(e=>z(String(e),`error`))}function Xl(e,t){Yl(e,t),B(),ee.set(t.automationId??null),N.set(`routines`)}var Zl=524288e3,Ql=1048576;function $l(e,t){return/\.pdf$/i.test(e)?`pdf[${t}]`:/\.(png|jpe?g|gif|webp)$/i.test(e)?`images[${t}]`:`files[${t}]`}function eu(e){let t=-1;for(let n of e.matchAll(/^(?:images|pdf|files)\[(\d+)\]:/gm)){let e=Number.parseInt(n[1],10);e>t&&(t=e)}return t+1}function tu(e,t){let n=e.replace(/\s+$/,``),r=eu(e);for(let e of t){let t=`${$l(e,r)}: ${e}`;n=n.length>0?`${n}\n${t}`:t,r+=1}return n}function nu(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}async function ru(e,t,n){if(t.size>524288e3)throw Error(H(`pages.attachTooLarge`,{name:t.name}));let r={mime:t.type,name:t.name,...n?{task:n}:{}},i=async(e,n)=>nu(new Uint8Array(await t.slice(e,n).arrayBuffer()));if(t.size<=1048576)return e.request(`attachment.put`,{...r,data:await i(0,t.size)});let a;for(let n=0;;){let o=Math.min(n+Ql,t.size),s=await e.request(`attachment.part`,{...r,...a?{upload:a}:{},offset:n,data:await i(n,o),done:o===t.size});if(s.path!==void 0)return{path:s.path,kind:s.kind??`file`};a=s.upload,n=o}}async function iu(e,t,n){return(await ru(e,t,n)).path}function au(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1023.5&&r<t.length-1;)n/=1024,r++;let i=n.toFixed(1);return`${Number(i)>=100?Math.round(n):i} ${t[r]}`}var ou=`size-14 rounded-sm border-hairline border-line object-cover`;function su({name:e,thumb:t}){if(t)return(0,W.jsx)(`img`,{src:t,alt:``,draggable:!1,className:ou});let n=e.includes(`.`)?e.split(`.`).pop()??``:``;return(0,W.jsx)(`span`,{className:`${ou} flex items-center justify-center font-mono text-meta uppercase text-muted`,children:n.slice(0,4)||`file`})}function cu({item:e,onRemove:t}){let[n]=(0,m.useState)(e.pending);return(0,W.jsxs)(`li`,{className:`group relative size-14 shrink-0 ${n?`motion-safe:animate-rise-in`:``}`,title:`${e.name} · ${au(e.size)}`,children:[(0,W.jsx)(`div`,{className:`transition-opacity duration-150 motion-reduce:transition-none ${e.pending?`opacity-50`:``}`,children:(0,W.jsx)(su,{...e})}),(0,W.jsx)(`button`,{type:`button`,"aria-label":H(`newSession.removeAttachment`,{name:e.name}),className:`absolute top-0.5 right-0.5 flex size-5 cursor-pointer items-center justify-center rounded-full border-hairline border-line bg-paper p-0 text-meta leading-none text-ink opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 touch:size-7 touch:opacity-100 touch:after:absolute touch:after:-inset-2 touch:after:content-['']`,onClick:()=>t(e.id),children:`×`})]})}function lu({items:e,onRemove:t}){return e.length===0?null:(0,W.jsx)(`ul`,{className:`m-0 flex min-w-0 list-none flex-wrap gap-1.5 p-0`,"data-field":`attachments`,children:e.map(e=>(0,W.jsx)(cu,{item:e,onRemove:t},e.id))})}function uu(e){return{drop:{onDragOver:e=>e.dataTransfer.types.includes(`Files`)&&e.preventDefault(),onDrop:t=>{t.dataTransfer.files.length!==0&&(t.preventDefault(),e(Array.from(t.dataTransfer.files)))}},onPaste:t=>{let n=Array.from(t.clipboardData.files);n.length!==0&&(t.preventDefault(),e(n))}}}function du(e){return(0,W.jsxs)(`label`,{className:e.className,title:e.title,children:[e.children,(0,W.jsx)(`input`,{type:`file`,multiple:!0,className:`sr-only`,disabled:e.disabled,onChange:t=>{let n=Array.from(t.target.files??[]);t.target.value=``,n.length>0&&e.onFiles(n)}})]})}var fu={image:`images`,pdf:`pdf`};function pu(e,t){let n=t.filter(e=>e.path!==void 0);return n.length===0?e:`${e}\n\n${n.map((e,t)=>`${fu[e.kind??`image`]??`files`}[${t}]: ${e.path}`).join(`
|
|
37
|
-
`)}`}var mu=112;async function hu(e){if(e.type.startsWith(`image/`))try{let t=await createImageBitmap(e),n=Math.min(1,mu/Math.min(t.width,t.height)),r=document.createElement(`canvas`);return r.width=Math.round(t.width*n),r.height=Math.round(t.height*n),r.getContext(`2d`)?.drawImage(t,0,0,r.width,r.height),t.close(),r.toDataURL(`image/webp`,.8)}catch{return}}function gu(e){if(!e)return[];try{let t=JSON.parse(sessionStorage.getItem(e)??`[]`);return Array.isArray(t)?t:[]}catch{return[]}}var _u=0;function vu(e,t,n,r){let[i,a]=(0,m.useState)(()=>gu(n)),o=(0,m.useRef)(i),s=(0,m.useRef)(new Set),c=e=>{if(o.current=e(o.current),a(o.current),n)try{sessionStorage.setItem(n,JSON.stringify(o.current.filter(e=>e.path!==void 0)))}catch{}},l=async n=>{let i=`${Date.now()}-${_u++}`,a=await hu(n);c(e=>[...e,{id:i,name:n.name,size:n.size,mime:n.type,...a?{thumb:a}:{}}]);try{let t=await ru(e.client,n,r);c(e=>e.map(e=>e.id===i?{...e,path:t.path,kind:t.kind}:e))}catch(e){c(e=>e.filter(e=>e.id!==i)),t(e instanceof Error?e.message:String(e))}};return{attachments:i,attach:e=>{for(let t of e){let e=l(t);s.current.add(e),e.finally(()=>s.current.delete(e))}},remove:e=>c(t=>t.filter(t=>t.id!==e)),ready:async()=>(await Promise.all(s.current),o.current),clear:()=>c(()=>[])}}function yu(e){return(0,W.jsx)(lu,{items:e.attachments.map(e=>({...e,pending:e.path===void 0})),onRemove:e.onRemove})}function bu(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(e.value);n.current=e.value;let r=(r,i)=>{r.preventDefault();let a=e.choices.findIndex(e=>e.id===n.current),o=e.choices[(a+i+e.choices.length)%e.choices.length];o&&(n.current=o.id,e.onChange(o.id),requestAnimationFrame(()=>t.current?.querySelector(`[aria-pressed=true]`)?.focus()))};return(0,W.jsx)(`div`,{ref:t,className:Rr,"aria-label":e.label,"data-field":e.field,onKeyDown:t=>{t.ctrlKey||t.metaKey||t.altKey||e.choices.length===0||(t.key===`ArrowRight`||t.key===`l`?r(t,1):(t.key===`ArrowLeft`||t.key===`h`)&&r(t,-1))},children:e.choices.map(t=>(0,W.jsx)(`button`,{type:`button`,"aria-pressed":t.id===e.value,tabIndex:t.id===e.value||!e.choices.some(t=>t.id===e.value)?0:-1,className:zr(t.id===e.value,t.dim),title:t.title,onClick:()=>e.onChange(t.id),children:t.label},t.id))})}function xu(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(hover: none) and (pointer: coarse)`).matches}var Su=/^(?:enter|return|tab|esc|space|shift|ctrl\+\S+|cmd\+\S+|alt\+\S+|[↑↓←→]+(?:\/[↑↓←→]+)?|[b-hj-z](?:\/[b-hj-z])?)(?:\/\S+)?(?:\s|$)/i;function Cu(e){return e.split(`·`).map(e=>e.trim()).filter(e=>e&&!Su.test(e)).join(` · `)}function wu(e){return xu()?Cu(e):e}function Tu(e){if(typeof e!=`string`)return``;let t=e.replace(/\s+/g,` `).trim();if(t.length===0)return``;let n=[...t];return n.length<=40?t:`${n.slice(0,40).join(``)}…`}function Eu(e){let t=Ou(e);return t<0||t===e.length-1?{base:e,dir:``}:{base:e.slice(t+1),dir:e.slice(0,t+1)}}function Du(e){return/^(?:[A-Za-z]:(?:[\\/]|$)|\\\\)/.test(e)}function Ou(e){return Du(e)||/^~\\/.test(e)?Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)):e.lastIndexOf(`/`)}function ku(e){return e.startsWith(`/`)||Du(e)}function Au(e){return e.startsWith(`~`)||e.includes(`/`)||Du(e)}function ju(e,t){return t?e===`~`?t:e.startsWith(`~/`)||e.startsWith(`~\\`)?t+e.slice(1):e:e}function Mu(e){let t=Du(e),n=t&&/^[A-Za-z]:/.test(e)?3:1,r=e.length;for(;r>n&&(e[r-1]===`/`||t&&e[r-1]===`\\`);)r--;return e.slice(0,r)}var Nu=/^(?:(?:https?|ssh|git):\/\/[A-Za-z0-9[]\S*|[A-Za-z0-9._-]+@[A-Za-z0-9][A-Za-z0-9.-]*:\S+)$/i,Pu=/^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/(?![.]+(?:git)?$)[A-Za-z0-9._-]{1,100}$/i;function Fu(e){let t=e.trim();return Nu.test(t)||Pu.test(t)?t:null}var Iu=/^(?:https?:\/\/(?:www\.)?github\.com\/|(?:ssh:\/\/)?git@github\.com[:/])/i;function Lu(e){let t=e.trim(),n=t.replace(Iu,``);if(n===t)return Pu.test(t)?t.replace(/\.git$/i,``).toLowerCase():null;let[r,i]=n.split(/[/?#]/),a=i?.replace(/\.git$/i,``);return r&&a?`${r}/${a}`.toLowerCase():null}function Ru(e,t){return e.filter(e=>e.enabled!==!1||e.id===t)}function zu(e,t){return(e.find(e=>e.id===t)??e.find(e=>e.ready!==!1)??e[0])?.id??``}function Bu(e,t){return!e||e.acceptsModel===!1?[]:[{id:``,label:t},...(e.models??[]).map(e=>({id:e.id,label:e.label??e.id}))]}function Vu(e,t,n){return t?e.find(e=>e.id===t)?.label??t:n}function Hu(e,t){return e.includes(t)?e.length>1?e.filter(e=>e!==t):e:[...e,t]}function Uu(e){let[t,n,...r]=e;return!t||!n?t??``:r.length>0?`${t} + ${n} +${r.length}`:`${t} + ${n}`}function Wu(e){if(!(e instanceof Error)||!(`code`in e)||e.code!==`PARTIAL_FANOUT`)return;let t=`detail`in e&&e.detail&&typeof e.detail==`object`?e.detail:void 0;return t&&`groupId`in t&&typeof t.groupId==`string`&&t.groupId?t.groupId:void 0}function Gu(e){let[t,...n]=e;if(!t)return``;let r=Eu(t).base;return n.length>0?`${r} +${n.length}`:r}function Ku(e,t){return e.includes(t)?e.filter(e=>e!==t):e.length>=8?e:[...e,t]}function qu(e,t){if(!/^[1-9]$/.test(e))return null;let n=Number(e)-1;return n<t?n:null}function Ju(e){let[t,...n]=e.repos;if(!t)throw Error(`no repo`);let r=e.at?Tu(e.prompt):``,i=(e.engines?.length??0)>1;return{repo:t.repo,...t.baseRef?{baseBranch:t.baseRef}:{},...n.length>0?{extraRepos:n.map(e=>({repo:e.repo,...e.baseRef?{baseRef:e.baseRef}:{}}))}:{},...!i&&n.length>0&&e.branch?{branch:e.branch}:{},...e.at?{scheduleAt:e.at.toISOString(),schedulePrompt:e.prompt}:e.prompt?{prompt:e.prompt}:{},...r?{title:r}:{},...i?{agents:(e.engines??[]).map(e=>`${e}:1`).join(`,`)}:{},...!i&&e.engine?{engine:e.engine}:{},...!i&&e.engine&&e.commandFrom?{commandFrom:e.commandFrom}:{},...!i&&e.model?{model:e.model}:{}}}async function Yu(e,t,n,r=``){let i=t?{engine:t}:{},{taskId:a}=await e(`task.openScratch`,{...i,...r?{model:r}:{}});return await e(`tab.new`,{taskId:a,kind:`engine`,...i,prompt:n.trim()}),a}async function Xu(e,t,n,r,i=r.trim(),a,o=``){let s=n?{engine:n}:{},c=r.trim()?Tu(r):``,{taskId:l}=await e(`task.openCheckout`,{repo:t,...s,...c?{title:c}:{},...o?{model:o}:{},...a?{scheduleAt:a.toISOString(),schedulePrompt:i}:{}});if(!(a||!l))return await e(`tab.new`,{taskId:l,kind:`engine`,...s,prompt:i}),l}function Zu(e,t){let n=e.querySelector(`[data-field="${t}"]`);(n?.matches(`input, textarea`)?n:n?.querySelector(`[tabindex='0']`))?.focus()}function Qu(e,t,n){let r=document.activeElement?.closest(`[data-field]`)?.getAttribute(`data-field`),i=t.findIndex(e=>e===r),a=t[i<0?0:(i+n+t.length)%t.length];a&&Zu(e,a)}var $u=new WeakMap,ed=200,td=e=>`client`in e?e.client:e,nd=(e,t)=>t?`${e} ${JSON.stringify(t)}`:e;function X(e,t,n){return $u.get(td(e))?.get(nd(t,n))}function rd(e,t,n,r){let i=td(e),a=$u.get(i)??new Map,o=nd(t,n);a.delete(o),a.set(o,r),$u.set(i,a);for(let e of a.keys()){if(a.size<=ed)break;a.delete(e)}return r}function Z(e,t,n){return td(e).request(t,n).then(r=>rd(e,t,n,r))}function id(e,t,n){return n&&n!==`leaf-1`?`${e}::${t}::${n}`:`${e}::${t}`}var ad=`rove.web.engines`;function od(){try{let e=JSON.parse(localStorage.getItem(ad)??`null`);return Array.isArray(e)?{engines:e}:void 0}catch{return}}function sd(e){try{localStorage.setItem(ad,JSON.stringify(e))}catch{}}function cd(e,t,n){let r=t?{repo:t}:{},[i]=(0,m.useState)(()=>{let t=X(e,`engines.list`,r)??X(e,`engines.list`)??od(),i=t?Ru(t.engines):[];return{offered:i,engine:t?zu(i,n??t.preferred):``}}),[a,o]=(0,m.useState)(i.offered),[s,c]=(0,m.useState)(i.engine);return(0,m.useEffect)(()=>e.client.onOpen(()=>{Z(e,`engines.list`,r).then(e=>{sd(e.engines);let t=Ru(e.engines);o(t),c(zu(t,n??e.preferred))}).catch(()=>{})}),[e]),{engines:a,engine:s,setEngine:c}}var ld=`shell`,ud=`pane:`,dd=e=>e.startsWith(ud),fd=e=>e.slice(5);function pd(e){let[t,n]=(0,m.useState)(()=>X(e,`plugin.panes`)?.panes??[]);return(0,m.useEffect)(()=>{Z(e,`plugin.panes`).then(e=>n(e.panes)).catch(()=>n([]))},[e]),t}function md(e){let t=[...e.engines,...e.withShell?[{id:ld,name:H(`tab.shell`)}]:[],...(e.panes??[]).map(e=>({id:ud+e.id,name:e.title}))];return(0,W.jsx)(bu,{label:H(`newTask.engine`),field:`engine`,value:e.value,onChange:e.onChange,choices:t.map(e=>({id:e.id,label:e.name,dim:`ready`in e&&e.ready===!1,title:`ready`in e&&e.ready===!1?H(`newTask.notReady`):void 0}))})}function hd(e,t){return gd(e,t,{kind:`engine`,latest:!0}).catch(e=>z(String(e),`error`))}async function gd(e,t,n){let{tabId:r,taskId:i}=await e.client.request(`tab.new`,{taskId:t,kind:n.kind,...n.engine?{engine:n.engine}:{},...n.prompt?{prompt:n.prompt}:{},...n.latest?{latest:!0}:{},...n.replaceTab?{replaceTab:n.replaceTab}:{}});if(i){e.selectWhenListed(i);return}await e.refreshTabsNow(t),n.replaceTab&&await Io(id(t,r))?.reattach(),e.select(t,r)}async function _d(e){await gd(e,(await e.client.request(`task.openScratch`,{})).taskId,{kind:`shell`})}var vd=[`1`,`2`,`3`,`4`,`5`],yd=[`tab`,`fork`,`scratch`],bd=[`message`,`attempts`,`engine`,`fork-base`,`destination`];function xd(e){U();let{model:t,taskId:n}=e,r=t.tasks.get()?.tasks.find(e=>e.id===n),i=cd(t,r?.repo),[a,o]=(0,m.useState)(e.destination??`tab`),[s,c]=(0,m.useState)(e.context??`fresh`),[l,u]=(0,m.useState)(``),[d,f]=(0,m.useState)(`1`),[p,h]=(0,m.useState)(r?.branch??`main`),{busy:g,error:_,setError:v,submit:y}=wi(),{attachments:b,attach:x,remove:S,ready:C}=vu(t,v,void 0,n),w=s===`fresh`&&a!==`fork`,T=a===`tab`&&s===`fresh`,E=pd(t),D=i.engine===`shell`&&!w||dd(i.engine)&&!T?``:i.engine,O=D===ld,k=dd(D),A=a===`fork`,j=(e,t)=>{let n=e===`scratch`&&t===`continue`&&a===`scratch`?`tab`:e;o(n),c(n===`scratch`?`fresh`:t)},M=()=>{let r=t.selection.get();return e.sourceTabId??(r.taskId===n?r.tabId:null)??`tab-1`},N=()=>t.tasks.get()?.tasks.find(e=>e.id===n)?.tabStatus?.[M()]?.reason===`dead`,ee=async()=>{let e=await t.client.request(`tab.handoff`,{taskId:n,tabId:M()});if(e.kind===`handoff`&&e.prompt)return e.prompt;throw Error(e.kind===`no-transcript`?J(`terminal`,`tab.noTranscriptToHandOff`,{engine:e.engine??``}):J(`terminal`,`tab.nothingToFork`))},P=()=>y(async()=>{let e=s===`continue`&&a===`tab`&&!O&&!k&&N(),i=[s===`continue`&&!e?await ee():``,pu(l.trim(),await C())].filter(Boolean).join(`
|
|
38
|
-
|
|
39
|
-
`);if(a===`scratch`){let e=await t.client.request(`task.openScratch`,O?{}:{engine:D});O?await gd(t,e.taskId,{kind:`shell`}):t.selectWhenListed(e.taskId)}else if(A){if(!r)throw Error(J(`terminal`,`tab.tabGone`));if(!l.trim())throw Error(H(`taskops.forkNeedsMessage`));let e=p.trim()||r.branch,a;try{a=await t.client.request(`tab.forkTask`,{repo:r.repo,baseBranch:e,prompt:i,...D?{engine:D}:{},...Number(d)>1?{count:Number(d)}:{},...e===r.branch?{forkFrom:n}:{}})}catch(e){let t=Wu(e);if(!t)throw e;z(e instanceof Error?e.message:String(e),`error`),ve(t);return}a.forkRefused&&z(H(`taskops.forkLeftBehind`,{reason:a.forkRefused}));let o=a.taskIds[0];a.groupId?ve(a.groupId):o&&t.selectWhenListed(o)}else if(O)await gd(t,n,{kind:`shell`});else if(k){let{selection:e}=t,r=e.get().taskId===n?e.get().tabId:null,i=await t.client.request(`plugin.paneOpen`,{taskId:n,pane:fd(D),...r?{tabId:r}:{}});await t.refreshTabsNow(n),t.select(n,i.tabId)}else await gd(t,n,{kind:`engine`,engine:D,prompt:i,...e?{replaceTab:M()}:{}})});return(0,W.jsx)(Ci,{title:J(`terminal`,`tab.newChat.title`),wide:!0,children:(0,W.jsxs)(`form`,{className:Kr,onKeyDown:e=>{if(e.key===`Tab`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(A||!e.shiftKey))e.preventDefault(),e.stopPropagation(),A?Qu(e.currentTarget,bd,e.shiftKey?-1:1):j(yd[(yd.indexOf(a)+1)%yd.length]??`tab`,s);else if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`e`){e.preventDefault(),e.stopPropagation();let t=i.engines.filter(e=>e.ready!==!1),n=t[(t.findIndex(e=>e.id===i.engine)+1)%t.length];n&&i.setEngine(n.id)}else e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`f`?(e.preventDefault(),e.stopPropagation(),j(a,s===`fresh`?`continue`:`fresh`)):e.key===`Enter`&&A&&e.target.closest(`[data-field=attempts], [data-field=engine]`)&&(e.preventDefault(),e.currentTarget.requestSubmit())},onSubmit:e=>{e.preventDefault(),P()},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),x(Array.from(e.dataTransfer.files))},children:[(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsx)(`span`,{className:`${Ar} text-muted`,children:J(`terminal`,`tab.newChat.engine`)}),(0,W.jsx)(md,{engines:i.engines,value:D,onChange:i.setEngine,withShell:w,panes:T?E:[]})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsx)(`span`,{className:`${Ar} text-muted`,children:J(`terminal`,`tab.newChat.destLabel`)}),(0,W.jsx)(bu,{label:J(`terminal`,`tab.newChat.destLabel`),field:`destination`,value:a,onChange:e=>j(e,s),choices:yd.map(e=>({id:e,label:J(`terminal`,`tab.newChat.dest${e===`tab`?`Tab`:e===`fork`?`Fork`:`Scratch`}`)}))})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted`,children:[J(`terminal`,`tab.newChat.ctxLabel`),` `,(0,W.jsx)(`span`,{className:`keys-only`,children:`ctrl+f`})]}),(0,W.jsx)(bu,{label:J(`terminal`,`tab.newChat.ctxLabel`),field:`context`,value:s,onChange:e=>j(a,e===`continue`?`continue`:`fresh`),choices:[`fresh`,`continue`].map(e=>({id:e,label:J(`terminal`,`tab.newChat.ctx${e===`fresh`?`Fresh`:`Continue`}`)}))})]}),A&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:J(`quickTask`,`attemptsLabel`)}),(0,W.jsx)(bu,{label:J(`quickTask`,`attemptsLabel`),field:`attempts`,value:d,onChange:f,choices:vd.map(e=>({id:e,label:e}))})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:H(`taskops.forkBranch`)}),(0,W.jsx)(`input`,{className:Nr,"data-field":`fork-base`,spellCheck:!1,value:p,onChange:e=>h(e.target.value)})]})]}),!O&&!k&&a!==`scratch`&&(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:H(`newChat.prompt`)}),(0,W.jsx)(`textarea`,{className:`${Nr} min-h-18 max-h-[50vh] leading-[1.45]`,"data-field":`message`,autoFocus:!0,rows:4,placeholder:H(`newChat.promptPlaceholder`),value:l,onChange:e=>u(e.target.value),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),x(t))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()}})]}),(0,W.jsx)(yu,{attachments:b,onRemove:S}),xu()?(0,W.jsx)(`p`,{className:`text-muted`,children:H(`pages.attachHintTouch`)}):(0,W.jsx)(`p`,{className:`keys-only mx-0 mt-2 mb-0 ${Tr}`,children:J(`quickTask`,`legend`)}),_&&(0,W.jsx)(`p`,{className:`text-error`,children:_}),(0,W.jsx)(Di,{busy:g,submitLabel:H(`newChat.start`)})]})})}var Sd=e=>e.split(/[\\/]/).filter(Boolean),Cd=e=>Sd(e).pop()??e;function wd(e,t,n=``){let r=Cd(e),i=t.filter(t=>(t.repo!==e||t.host!==n)&&Cd(t.repo)===r);if(i.length===0)return r;let a=e=>Sd(e).slice(-2).join(`/`);return i.some(e=>e.host===n)?i.some(t=>t.host!==n&&a(t.repo)===a(e))&&n?`${n}:${a(e)}`:a(e):n?`${n}:${r}`:r}var Td=e=>e.startsWith(`root:`)?null:e.split(`/`).slice(-2).join(`/`);function Ed(e,t){let n=Cd(e.repo),r=t.filter(t=>t!==e&&Cd(t.repo)===n);if(r.length===0)return n;let i=e.repoId,a=i?Td(i):null;return i&&a?r.some(e=>e.repoId&&e.repoId!==i&&Td(e.repoId)===a)?i:a:wd(e.repo,[e,...r].map(e=>({repo:e.repo,host:``})))}var Dd=/\s+#\d+\/\d+$/,Od=(e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``)||e.id.localeCompare(t.id),kd=e=>e.groupId?`${e.machine?.id??``}\0${e.groupId}`:null;function Ad(e){let t=new Map;for(let n of e){let e=kd(n);if(e===null)continue;let r=t.get(e);r?r.push(n):t.set(e,[n])}for(let[e,n]of t)n.length<2?t.delete(e):n.sort(Od);return t}function jd(e){return(e[0]?.label??``).replace(Dd,``)}function Md(e){let t=e=>e.engine?.name??e.label,n=new Map;for(let r of e)n.set(t(r),(n.get(t(r))??0)+1);let r=new Map;return new Map(e.map(e=>{let i=t(e),a=(r.get(i)??0)+1;return r.set(i,a),[e.id,(n.get(i)??0)>1?`${i} #${a}`:i]}))}var Nd=[`default`,`recent`,`attention`,`name`],Pd={folded:new Set,opened:new Set},Fd=e=>{let t=Date.parse(e??``);return Number.isFinite(t)?t:0},Id=e=>Fd(e.updatedAt??e.createdAt),Ld=e=>Fd(e.createdAt),Rd=(e,t)=>Ld(t)-Ld(e)||t.id.localeCompare(e.id),zd=(e,t)=>Id(t)-Id(e)||t.id.localeCompare(e.id),Bd=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),Vd={default:null,recent:Rd,attention:(e,t)=>e.rank-t.rank||zd(e,t),name:(e,t)=>Bd.compare(e.label.trim(),t.label.trim())||e.id.localeCompare(t.id)},Hd=`~scratch`,Ud=e=>e.kind===`dir`&&(e.scratch===!0||e.noProject===!0);function Wd(e,t){return[...e].sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)).sort(qd(Vd[t]))}function Gd(e,t=`default`){let n=[...e].sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)),r=new Map;for(let e of n){let t=Ud(e)?Hd:e.repo,n=r.get(t);n?n.push(e):r.set(t,[e])}let i=Vd[t],a=[...r].map(([e,t])=>{let n=t.sort(qd(i));if(e===`~scratch`&&t.every(Ud))return{repo:``,label:H(`rail.noProject`),tasks:n,key:Hd,noProject:!0};let r=t.find(e=>e.repoId)?.repoId;return{repo:e,label:Cd(e),tasks:n,...r?{repoId:r}:{}}});return[...a.filter(e=>e.noProject),...a.filter(e=>!e.noProject)]}var Kd=e=>+!e.pinned,qd=e=>(t,n)=>Kd(t)-Kd(n)||(e?e(t,n):0);function Jd(e,t){let n=new Set([e.id]);for(let r=e.parentTaskId;r!==void 0;r=t.get(r)?.parentTaskId){if(n.has(r))return r===e.id;n.add(r)}return!1}function Yd(e){let t=new Map;for(let n of e)for(let e of n.tasks)t.set(e.id,e);let n=new Map,r=new Set;for(let e of t.values()){let i=e.parentTaskId;if(i===void 0||!t.has(i)||Jd(e,t))continue;r.add(e.id);let a=n.get(i);a?a.push(e):n.set(i,[e])}return{children:n,nested:r}}function Xd(e,t,n=[]){for(let r of e.get(t)??[])n.push(r.id),Xd(e,r.id,n);return n}function Zd(e,t,n,r){return r.folded.has(e)?!0:r.opened.has(e)||t<=5?!1:r.selectedId===void 0||!n.includes(r.selectedId)}function Qd(e,t=``,n=Pd,r=0,i=!0){let a=t.trim(),o=(...e)=>e.some(e=>e!==``&&pl(a,e)),{children:s,nested:c}=Yd(e),l=[];for(let t of e){let e=a===``||o(t.label),u=t.machine===void 0?{}:{machine:t.machine},d=t.key??t.repo,f=t=>e||o(t.label,t.title,t.branch,Cd(t.repo)),p=e=>f(e)||(s.get(e.id)??[]).some(p),m=(e,t,r,i=!1,o)=>{let c=r+1,l=t.machine?{machine:t.machine.id}:{},u=s.get(t.id),d=u?Xd(s,t.id):[],m=u!==void 0&&a===``&&Zd(t.id,u.length,d,n);e.push({id:t.id,kind:`task`,task:t,depth:Math.min(c,3),...c>3?{level:c}:{},...u?{fold:{count:d.length,collapsed:m,descendantIds:d}}:{},...o===void 0?{}:{attempt:o},...l});let g=i||f(t);m||h(e,(u??[]).filter(e=>g||p(e)),r+1,g)},h=(e,t,n,r)=>{let a=i?Ad(t):new Map,o=new Set;for(let i of t){let t=kd(i),s=t===null?void 0:a.get(t);if(t===null||!s){m(e,i,n,r);continue}if(o.has(t))continue;o.add(t);let c=s[0];if(!c)continue;let l=n+1;e.push({id:`round:${c.machine?.id??``}:${c.groupId}`,kind:`round`,groupId:c.groupId??``,title:jd(s),tasks:s,depth:Math.min(l,3),...c.machine?{machine:c.machine.id}:{}});let u=Md(s);for(let t of s)m(e,t,n+1,r,u.get(t.id))}},g=[];h(g,t.tasks.filter(e=>!c.has(e.id)&&p(e)),r,!1),!(g.length===0&&!e)&&l.push({id:`project:${d}`,kind:`project`,repo:t.repo,label:t.label,...t.noProject?{noProject:!0}:{},...u},...g)}return l}var $d=e=>Math.max(0,...e.tasks.map(Ld));function ef(e){let t=e.tasks.filter(e=>!e.routine),n=e.remote.filter(e=>!e.routine),r=[...Gd(t,e.sort).map(e=>({group:e})),...e.machines.flatMap(t=>Gd(n.filter(e=>e.machine?.id===t.alias),e.sort).map(e=>({group:e,machine:t.alias})))],i=new Map;for(let e of r){let{repoId:t,repo:n}=e.group,r=e.group.noProject?Hd:t??(e.machine===void 0?n:`${e.machine}\0${n}`),a=i.get(r);a?a.push(e):i.set(r,[e])}let a=Vd[e.sort],o=new Map,s=[];for(let[e,t]of i){let n=t[0];if(!n)continue;let r=t.flatMap(e=>e.group.tasks),i=n.group.noProject===!0,c={repo:n.group.repo,label:i?n.group.label:``,key:e,tasks:t.length===1?n.group.tasks:r.sort(qd(a)),...n.group.repoId?{repoId:n.group.repoId}:{},...n.machine===void 0||i?{}:{machine:n.machine},...i?{noProject:!0}:{}};s.push(c);for(let e of t)o.set(e,c)}let c=new Map(s.map(e=>[e,e.noProject?e.label:Ed(e,s)])),l=s.map(e=>({...e,label:c.get(e)??e.label}));return e.sort===`recent`&&l.sort((e,t)=>$d(t)-$d(e)),e.sort===`name`&&l.sort((e,t)=>Bd.compare(e.label,t.label)),l.sort((e,t)=>Number(t.noProject===!0)-Number(e.noProject===!0)),{rows:Qd(l,e.query,e.fold),groups:r.filter(e=>e.machine===void 0).map(e=>{let t=o.get(e);return{...e.group,label:(t&&c.get(t))??e.group.label}})}}function tf(e){return e.title??e.engineName??(e.kind===`engine`?H(`tab.engine`):H(`tab.shell`))}function nf(e,t){if(t.size===0)return e;let n=!1;return e.filter(e=>e.kind===`project`||e.kind===`state`?(n=t.has(e.id),!0):!n)}function rf(e){return e.kind===`leaf`?[e]:e.children.flatMap(rf)}function af(e){return!!e&&rf(e.root).length>1}function of(e){let t=[],n=(e,r,i,a,o,s,c)=>{if(e.kind===`leaf`){t.push({id:e.id,x:r,y:i,w:a,h:o,left:s,top:c});return}let l=e.children.length;e.children.forEach((t,u)=>{e.orientation===`row`?n(t,r+a*u/l,i,a/l,o,u>0||s,c):n(t,r,i+o*u/l,a,o/l,s,u>0||c)})};return n(e,0,0,1,1,!1,!1),t}function sf(e,t,n=1){let r=rf(e.root).map(e=>e.id),i=r.indexOf(t);return r[(Math.max(0,i)+n+r.length)%r.length]??t}function cf(e,t){let n=new Map,r=new Map;for(let i of rf(e.root)){if(i.title){r.set(i.id,i.title);continue}let e=i.own?t:i.engineName??`shell`,a=(n.get(e)??0)+1;n.set(e,a),r.set(i.id,a===1?e:`${e} ${a}`)}return r}function lf(e,t,n){return e.kind===`engine`&&rf(t.root).some(e=>e.id===n&&e.own)}function uf(e){return e.alive!==!1||!!e.split&&!rf(e.split.root).some(e=>e.own)}function df(e){return rf(e.root).map(e=>e.id).join(`,`)}function ff(e){return!(e instanceof HTMLElement)||e.closest(`.xterm`)?!1:e.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName)}function pf(e){return e instanceof HTMLElement&&!!e.closest(`.rail, button, a`)}var mf=e=>e.tabs.get()[e.selection.get().taskId??``]??[];function hf(e){let{taskId:t,tabId:n}=e.selection.get(),r=mf(e);return{taskId:t,tabs:r,at:r.findIndex(e=>e.id===n)}}function gf(e,t){let{taskId:n,tabs:r}=hf(e),i=r[t];!n||!i||e.select(n,i.id)}function _f(e){let{taskId:t,tabs:n,at:r}=hf(e),i=n[r];!t||!i||O.set((0,W.jsx)(Ti,{title:H(`menu.renameTab`),initial:tf(i),submitLabel:H(`dialog.save`),onSubmit:async n=>{await e.renameTab(t,i.id,n)}}))}var vf=e=>!!e.selection.get().taskId,yf=e=>mf(e).length>0,bf=[{id:`help.open`,chords:[`f1`],prefix:!1,run:Bl},{id:`focus.next`,chords:[`f4`],prefix:!1,run:()=>eo(1)},{id:`chat.tab.chooseEngine`,chords:[`ctrl+e`],prefix:!1,surface:`workspace`,live:vf,run:e=>{let{taskId:t}=e.selection.get();t&&O.set((0,W.jsx)(xd,{model:e,taskId:t}))}},{id:`chat.tab.rename`,chords:[`f2`],prefix:!1,surface:`workspace`,live:e=>{let{tabs:t,at:n}=hf(e);return!!t[n]&&!af(t[n]?.split)},run:_f},{id:`chat.tab.cycle-next`,chords:[`ctrl+]`],prefix:!1,surface:`workspace`,live:yf,run:e=>gf(e,(hf(e).at+1)%mf(e).length)},{id:`chat.tab.cycle-prev`,chords:[`ctrl+[`],prefix:!1,surface:`workspace`,live:yf,run:e=>gf(e,(hf(e).at-1+mf(e).length)%mf(e).length)},{id:`chat.tab.goto`,chords:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].map(e=>`ctrl+${e}`),prefix:!1,surface:`workspace`,live:yf,run:(e,t=``)=>{let n=Do().find(e=>e.id===`chat.tab.goto`&&!e.prefix)?.chords.indexOf(t)??-1;n>=0&&gf(e,n)}},{id:`attention.next`,chords:[`f7`],prefix:!1,run:e=>Sf(e)}];To(()=>bf);function xf(e){(0,m.useEffect)(()=>{let t=t=>{if(O.get()||ff(t.target))return;let n=N.get();if(n===`worktrees`)return;let r=Ao()??(vf(e)?`workspace`:`sidebar`),{taskId:i}=e.selection.get();if(!n&&i&&!t.ctrlKey&&!t.shiftKey&&!t.metaKey&&!t.altKey&&t.key===`Enter`&&!yf(e)&&!pf(t.target)){t.preventDefault(),t.stopPropagation(),O.set((0,W.jsx)(xd,{model:e,taskId:i}));return}let a=sl(t),o=Do().filter(t=>!t.prefix&&!t.native&&t.chords.some(e=>a.includes(e))&&Oo(t,r)&&!(n&&t.surface)&&t.live?.(e)!==!1).sort((e,t)=>ko(e,r)-ko(t,r))[0];o&&(t.preventDefault(),t.stopPropagation(),o.run(e,a.find(e=>o.chords.includes(e))))};return window.addEventListener(`keydown`,t,{capture:!0}),()=>window.removeEventListener(`keydown`,t,{capture:!0})},[e])}function Sf(e){let t=e.tasks.get();if(!t)return;let n=ql(t.attention,t.tasks.map(e=>e.id),e.selection.get());if(!n){z(H(`inbox.empty`));return}if(Wl(n.state)){Xl(e,n);return}n.taskId!==null&&(e.select(n.taskId,n.tabId),Yl(e,n))}async function Cf(e,t){try{if(t.kind===`action`){await e.client.request(`plugin.chordAction`,{chord:t.chord});return}let{taskId:n,tabId:r}=e.selection.get();if(!n){z(H(`keys.pluginNoTask`),`error`);return}let i=await e.client.request(`plugin.paneOpen`,{taskId:n,pane:t.target,...r?{tabId:r}:{}});await e.refreshTabsNow(n),e.select(n,i.tabId)}catch(e){z(K(e),`error`)}}function wf(e){(0,m.useEffect)(()=>{let t=t=>{let n=lo.get().plugins;if(n.length===0||!Co({dialog:O.get()!==null,page:N.get()})||ff(t.target))return;let r=So(n,sl(t));r&&(t.preventDefault(),t.stopImmediatePropagation(),Cf(e,r))};return window.addEventListener(`keydown`,t,{capture:!0}),()=>window.removeEventListener(`keydown`,t,{capture:!0})},[e])}var Tf=`prefix.moreCommands`,Ef=/^ctrl\+[^+]+$/;function Df(e){return Ef.test(e)?e.slice(5):null}function Of(e){let t=fl(e.bindingId);if(!t)return null;if(e.reachability.direct.has(e.bindingId)){let e=t.keys[0];if(e)return so(e)}if(e.prefixKey&&e.reachability.prefix.has(e.bindingId)){let n=t.prefixKeys?.[0];if(n)return`${so(e.prefixKey)} ${so(n)}`}return null}function kf(e,t){let n=Y.filter(t=>e.direct.has(t.id)).flatMap(e=>{let t=e.keys.flatMap(e=>Df(e)??[]);return t.length>2?[{stroke:`${t[0]}-${t.at(-1)}`,action:e.id}]:t.map(t=>({stroke:t,action:e.id}))}),r=t?Df(t):null;return r&&e.prefix.size>0&&n.push({stroke:r,action:Tf}),n}var Af=4e3,jf=180,Mf=Af,Nf=v({guide:null,entries:[]}),Pf=1;function Ff(e,t){let n={id:Pf++,stroke:e,action:t,at:Date.now()};Nf.set({guide:null,entries:[...Nf.get().entries,n].slice(-3)})}var If=`modulepreload`,Lf=function(e){return`/`+e},Rf={},zf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Lf(t,n),t=s(t),t in Rf)return;Rf[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:If,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Bf=8,Vf=32,Hf=3e3,Uf=100,Wf=new WeakMap,Gf=null;function Kf(e){let t=Wf.get(e);return t||(t={entries:new Map,snapshots:new Map,left:null},Wf.set(e,t)),t}function qf(){return Gf||(Gf=document.createElement(`div`),Gf.style.display=`none`,document.body.append(Gf)),Gf}function Jf(e,t,n){e.snapshots.delete(t),e.snapshots.set(t,n);for(let t of e.snapshots.keys()){if(e.snapshots.size<=Vf)break;e.snapshots.delete(t)}}function Yf(e,t,n){e.entries.delete(t.key),t.leaving!==null&&window.clearTimeout(t.leaving),t.leaving=null,n?Jf(e,t.key,t.handle.snapshot()):e.snapshots.delete(t.key),t.handle.dispose(),t.box.remove()}function Xf(e){let t=[...e.entries.values()].filter(e=>e.slot.parkedAt!==null);t.sort((e,t)=>(e.slot.parkedAt??0)-(t.slot.parkedAt??0));for(let n of t.slice(0,Math.max(0,t.length-Bf)))Yf(e,n,!0)}function Zf(e,t){return Kf(e).entries.get(t)?.handle??null}function Qf(e,t,n,r){return Kf(e).entries.get(id(t,n,r))?.slot.parkedAt!=null}async function $f(e,t){let n=Kf(e.client),r=id(e.taskId,e.tabId,e.leafId),i=n.entries.get(r);if(i&&i.slot.parkedAt!==null){let{slot:r,handle:a,box:o}=i;return r.parkedAt=null,r.binding=t,i.leaving!==null&&(window.clearTimeout(i.leaving),i.leaving=null,o.classList.remove(`is-leaving`)),n.left=null,rp(n),e.host.append(o),t.setNotice(r.notice),t.onScrolled(r.scrolled),a.term.refresh(0,a.term.rows-1),e.focusOnMount&&a.term.focus(),{handle:a,release:()=>ep(n,i)}}let a=document.createElement(`div`);a.className=Pn,e.host.append(a),tp(n,e.host);let o=!i,s={binding:t,notice:{kind:`none`},scrolled:0,parkedAt:null},c=null,l=o?n.snapshots.get(r):void 0;l&&n.snapshots.delete(r);let{mountTerminal:u}=await zf(async()=>{let{mountTerminal:e}=await import(`./term-mount-OMVJnrk8.js`);return{mountTerminal:e}},__vite__mapDeps([0,1,2])),d=u({...e,el:a,snapshot:l,onPainted:()=>rp(n),setNotice:e=>{s.notice=e,s.binding?.setNotice(e)},onScrolled:e=>{s.scrolled=e,s.binding?.onScrolled(e)},onFocusChange:e=>s.binding?.onFocusChange(e),onExit:e=>{s.binding?s.binding.onExit(e):c&&n.entries.get(r)===c&&Yf(n,c,!1)},copyText:e=>s.binding?.copyText(e)??Promise.resolve(!1),pasteImage:()=>s.binding?.pasteImage()??Promise.resolve()});if(!o)return{handle:d,release:()=>{d.dispose(),a.remove()}};let f={key:r,handle:d,box:a,slot:s,leaving:null};return c=f,n.entries.set(r,f),{handle:d,release:()=>ep(n,f)}}function ep(e,t){let{slot:n}=t;e.entries.get(t.key)===t&&n.parkedAt===null&&(n.binding?.onFocusChange(!1),n.binding=null,t.handle.term.blur(),n.parkedAt=performance.now(),qf().append(t.box),e.left=t,Xf(e))}function tp(e,t){let n=e.left;e.left=null,!(!n||n.slot.parkedAt===null||performance.now()-n.slot.parkedAt>Uf)&&e.entries.get(n.key)===n&&(n.box.classList.add(`is-leaving`),t.append(n.box),n.leaving=window.setTimeout(()=>np(e,n),Hf))}function np(e,t){t.leaving!==null&&(window.clearTimeout(t.leaving),t.leaving=null,t.box.classList.remove(`is-leaving`),e.entries.get(t.key)===t&&t.slot.parkedAt!==null&&qf().append(t.box))}function rp(e){for(let t of e.entries.values())np(e,t)}async function ip(e,t,n){return Jl(await e.request(`output.read`,{taskId:t,tab:n,source:`terminal`,limit:12}))}async function ap(e,t,n,r){try{let i=await e.client.request(`tab.send`,{taskId:t,tabId:n,prompt:r});return i.delivered?!0:(z(H(`layout.composerNotSent`,{reason:i.reason??``}),`error`),!1)}catch(e){let t=e instanceof Go?e.code:void 0;return z(t===`UNKNOWN_OP`?H(`layout.composerOldBridge`):t===`AWAITING_PERMISSION`?H(`layout.composerAtMenu`):e instanceof Error?e.message:String(e),`error`),!1}}async function op(e,t,n,r){let{client:i}=e,a=id(t,n),o=Io(a)!==void 0||Qf(i,t,n);try{return o||await i.request(`term.attach`,{taskId:t,tabId:n}),await i.request(`term.input`,{stream:a,data:r}),!0}catch(e){return z(e instanceof Error?e.message:String(e),`error`),!1}finally{o||await i.request(`term.detach`,{stream:a}).catch(()=>{})}}async function sp(e,t,n){try{return(await e.client.request(`gate.answer`,{gateId:t,...n})).delivered||z(H(`inbox.gateKept`)),!0}catch(e){return z(e instanceof Error?e.message:String(e),`error`),!1}}var cp=(e,t,n)=>({id:e,cap:t,bytes:e=>`\x1b${e?`O`:`[`}${n}`}),lp={id:`enter`,cap:`⏎`,bytes:()=>`\r`},up=[{id:`esc`,cap:`esc`,bytes:()=>`\x1B`},{id:`tab`,cap:`tab`,bytes:()=>` `},{id:`backtab`,cap:`⇧tab`,bytes:()=>`\x1B[Z`},{id:`interrupt`,cap:`^C`,bytes:()=>``},cp(`up`,`↑`,`A`),cp(`down`,`↓`,`B`),cp(`left`,`←`,`D`),cp(`right`,`→`,`C`),lp],dp=e=>({id:`option-${e}`,cap:String(e),bytes:()=>String(e)}),fp=[dp(1),dp(2),dp(3),dp(4),lp];function pp(e){if(e.length!==1)return e;let t=e.toUpperCase().charCodeAt(0);return t===32?`\0`:t===63?``:t>=64&&t<=95?String.fromCharCode(t&31):e}var mp=`\x1B[27;2;13~`;function hp(e){return e.key!==`Enter`||!e.shiftKey||e.ctrlKey||e.metaKey||e.altKey?!1:!e.isComposing&&e.keyCode!==229}function gp(e){return e.type!==`keydown`||e.key.toLowerCase()!==`c`||e.altKey?null:e.metaKey||e.ctrlKey&&e.shiftKey?`copy`:e.ctrlKey?`interrupt-or-copy`:null}var _p=`mx-2.5 mt-0.5 mb-1.5 flex min-w-0 flex-col gap-1.5 font-mono text-meta`,vp=2e3;function yp(e,t,n){let[r,i]=(0,m.useState)(null),[a,o]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(!n)return;let r=!0,a=0,o=async()=>{try{let a=await ip(e.client,t,n);r&&i(a)}catch{r&&i(e=>e??[])}r&&(a=window.setTimeout(o,vp))};return o(),()=>{r=!1,window.clearTimeout(a)}},[e,t,n,a]),{lines:r,refresh:()=>o(e=>e+1)}}function bp(e){U();let{model:t,taskId:n,tabId:r,mode:i,gate:a}=e,{lines:o,refresh:s}=yp(t,n,r),c=(0,m.useRef)(null),[l,u]=(0,m.useState)(``),[d,f]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let e=c.current;e&&(e.scrollTop=e.scrollHeight)},[o]);let p=async e=>{f(!0);let t=await e();return f(!1),t&&window.setTimeout(s,600),t},h=async()=>{let e=l.trim();!e||d||await p(()=>i===`gate`&&a?sp(t,a.id,{text:e}):r?ap(t,n,r,e):Promise.resolve(!1))&&u(``)};return(0,W.jsxs)(`div`,{className:_p,children:[a&&(0,W.jsx)(`p`,{className:`m-0 whitespace-pre-wrap wrap-anywhere text-ink`,children:a.question}),r&&(0,W.jsx)(`pre`,{ref:c,className:`m-0 max-h-60 overflow-y-auto rounded-sm border-hairline border-line bg-inset px-2 py-1.5 text-ink whitespace-pre-wrap wrap-anywhere`,"data-peek-lines":12,children:o===null?`…`:o.length===0?H(`inbox.noOutput`):o.join(`
|
|
40
|
-
`)}),i===`gate`&&a&&(0,W.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:a.options.map(e=>(0,W.jsxs)(G,{disabled:d,title:e.detail,onClick:()=>void p(()=>sp(t,a.id,{option:e.key})),children:[`[ `,e.key===a.recommended?`★ `:``,e.label,` ]`]},e.key))}),i===`menu`&&r&&(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[fp.map(e=>(0,W.jsxs)(G,{disabled:d,onClick:()=>void p(()=>op(t,n,r,e.bytes(!1))),children:[`[ `,e.cap,` ]`]},e.id)),(0,W.jsx)(G,{onClick:e.onOpenTab,children:H(`inbox.openTab`)})]}),(i===`reply`||i===`gate`)&&(0,W.jsxs)(`form`,{className:`flex min-w-0 items-center gap-2`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,W.jsx)(`input`,{className:`min-w-0 flex-1 rounded-sm border-hairline border-line bg-paper px-2 py-1.5 font-mono text-ink focus-visible:border-line-active focus-visible:outline-none touch:min-h-10 touch:text-display`,value:l,disabled:d,placeholder:H(`inbox.replyPlaceholder`),"aria-label":H(`inbox.replyPlaceholder`),autoComplete:`off`,enterKeyHint:`send`,onChange:e=>u(e.target.value)}),(0,W.jsx)(G,{type:`submit`,disabled:d||l.trim()===``,children:H(`inbox.send`)})]})]})}function xp({text:e}){return(0,W.jsx)(`span`,{className:`inline-flex flex-wrap gap-x-3 gap-y-0`,children:e.split(`·`).map(e=>e.trim()).filter(Boolean).map(e=>(0,W.jsx)(`span`,{children:e},e))})}var Sp={accent:`text-accent`,muted:`text-subtle`,attention:`text-error`,warning:`text-warning`,info:`text-info`,success:`text-success`,added:`text-diff-added`,removed:`text-diff-removed`},Cp={accent:`text-accent`,muted:`text-subtle`,attention:`text-error`,warning:`text-warning`,success:`text-success`,info:`text-accent`,ink:`text-ink`},wp=6;function Tp(e,t){return e?`${Cd(e.repo)} › ${e.label}`:t}function Ep({model:e}){U();let t=y(e.tasks),n=y(e.visits),r=y(e.tabs),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)(Date.now());(0,m.useEffect)(()=>{let e=window.setInterval(()=>l(Date.now()),3e4);return()=>window.clearInterval(e)},[]);let u=new Map((t?.tasks??[]).map(e=>[e.id,e])),d=(e,t)=>e&&t&&r[e]?.find(e=>e.id===t)?.title||``,f=Kl(t?.attention??[],t?.tasks.map(e=>e.id)??[]).map((e,t)=>{let n=e.taskId?u.get(e.taskId):void 0;return{key:`a${t}:${e.taskId}:${e.tabId}`,section:`attention`,taskId:e.taskId,tabId:e.tabId,identity:Tp(n,e.label??e.taskId??``),subtitle:d(e.taskId,e.tabId)||n?.branch||``,at:e.at,attention:e}}),p=new Set(f.map(e=>`${e.taskId}:${e.tabId}`)),h=n.filter(e=>u.has(e.taskId)&&!p.has(`${e.taskId}:${e.tabId}`)).slice(0,wp).map(e=>({key:`r:${e.taskId}:${e.tabId}`,section:`recent`,taskId:e.taskId,tabId:e.tabId,identity:Tp(u.get(e.taskId),e.taskId),subtitle:d(e.taskId,e.tabId)||u.get(e.taskId)?.branch||``,at:e.at})),g=[...f,...h],_=g[Math.min(i,g.length-1)],v=t=>{if(t.attention&&Wl(t.attention.state))return Xl(e,t.attention);t.attention&&Yl(e,t.attention),t.taskId&&u.has(t.taskId)&&(e.select(t.taskId,t.tabId),B())},b=()=>void Promise.all(f.map(t=>t.attention&&Yl(e,t.attention,!0)));(0,m.useEffect)(()=>{let t=t=>{if(!(t.target instanceof HTMLElement&&t.target.closest(`input, textarea`))){if(t.key===`ArrowDown`||t.key===`j`)a(e=>Math.min(g.length-1,e+1));else if(t.key===`ArrowUp`||t.key===`k`)a(e=>Math.max(0,e-1));else if(t.key===`Enter`&&_)v(_);else if(t.key===`d`&&_?.attention)Yl(e,_.attention,!0);else if(t.key===`D`)b();else return;t.preventDefault()}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)});let x=n=>{let r=n.attention?Hl(n.attention.state):null,i=n===_,l=n.attention,d=n.taskId?u.get(n.taskId):void 0,f=l?.gateId?t?.gates?.find(e=>e.id===l.gateId&&e.status===`open`):void 0,p=n.tabId??f?.tabId??null,m=!!l&&!!d&&!d.machine&&!Wl(l.state)&&(!l.gateId||!!f)&&(!!p||!!f),h=l?.state===`permission_needed`||!!p&&d?.tabStatus?.[p]?.kind===`needs-input`,y=f?`gate`:l?.state===`dead`?`readonly`:h?`menu`:`reply`,b=`${n.taskId}:${n.tabId}:${l?.gateId??``}`,x=m&&o===b;return(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`div`,{className:ui,children:[(0,W.jsxs)(`button`,{type:`button`,className:`${gi({selected:i,stack:!0})} ${di}`,onMouseEnter:()=>a(g.indexOf(n)),onClick:()=>v(n),children:[(0,W.jsxs)(`span`,{className:ci,children:[(0,W.jsx)(`span`,{className:_i,children:n.identity}),r&&(0,W.jsxs)(`span`,{className:`flex-none font-mono text-meta font-normal normal-nums ${Cp[r.tone]}`,children:[r.glyph,` `,H(r.stateKey)]}),(0,W.jsx)(`span`,{className:li,children:Ul(c-n.at)})]}),n.subtitle&&(0,W.jsx)(`span`,{className:`truncate font-mono text-meta font-normal normal-nums text-muted`,children:n.subtitle})]}),m?(0,W.jsx)(G,{className:fi,"aria-expanded":x,onClick:()=>{a(g.indexOf(n)),s(x?null:b)},children:H(x?`inbox.hide`:`inbox.reply`)}):(0,W.jsx)(`span`,{"aria-hidden":!0,className:fi})]}),x&&n.taskId&&(0,W.jsx)(bp,{model:e,taskId:n.taskId,tabId:p,mode:y,gate:f,onOpenTab:()=>v(n)})]},n.key)};return(0,W.jsx)(Ci,{title:H(`inbox.title`),wide:!0,children:(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsxs)(`div`,{className:ai,children:[(0,W.jsx)(`p`,{className:`${Ar} text-muted ${ii} touch:hidden!`,children:(0,W.jsx)(xp,{text:H(`inbox.hints`)})}),f.length>0&&(0,W.jsx)(G,{className:`flex-none min-w-[calc(9ch+0.5rem)] whitespace-nowrap pr-2 text-right font-mono text-meta`,onClick:b,children:H(`inbox.ackAll`)})]}),(0,W.jsx)(`h2`,{className:`${Ar} text-muted ${oi}`,children:H(`inbox.attention`)}),f.length===0?(0,W.jsx)(`p`,{className:`mono text-muted`,children:H(`inbox.empty`)}):(0,W.jsx)(`ul`,{className:si,children:f.map(x)}),h.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted mt-1`,children:H(`inbox.recent`)}),(0,W.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-0.5 p-0`,children:h.map(x)})]})]})})}var Dp=`rove.prefs`,Op={locale:`en`,theme:`claude`,themeMode:`dark`,transparent:!0,focusAccent:`primary`,splitStyle:`line`,railFold:`glyphs`,workingBorder:`flow`,taskColors:`on`,glyphSet:`braille`,colorblind:`off`,runningTitle:`shimmer`,statusMark:`both`,statusMarkNoticeSeen:!0,railSort:`recent`,railGroup:`project`,toast:!0,sound:!0,soundVolume:.4,crossTask:!0,finishedAlerts:!0,keyHints:!0,editorKind:`auto`,worktreeBase:`default`,scrollbackRows:1e3,tabStrip:`never`,prefixTap:`local`,remoteProjects:!1,autoStatus:!1,dispatcher:!1,updateChannel:`latest`,updateNotify:!0};function kp(){try{let e=JSON.parse(localStorage.getItem(Dp)??`null`);if(e&&typeof e==`object`&&`prefs`in e&&`themes`in e){let t=e;return{...t,prefs:{...Op,...t.prefs},loaded:!0}}}catch{}return{loaded:!1,prefs:Op,options:{},info:{editorCustomSet:!1,worktreeCustomPath:``},themes:[],glyphSets:{}}}var Ap=v(kp());function jp(e){(e.locale===`en`||e.locale===`zh`)&&Mt.set(e.locale)}jp(Ap.get().prefs);function Mp(e){let t={loaded:!0,prefs:e.prefs,options:e.options,info:e.info,themes:e.themes,glyphSets:e.glyphSets};Ap.set(t),jp(t.prefs),localStorage.setItem(Dp,JSON.stringify(t))}var Np=null;async function Pp(e){Np=e,Mp(await e.request(`prefs.get`))}async function Fp(e,t,n){let r=Ap.get();Ap.set({...r,prefs:{...r.prefs,[t]:n}}),jp(Ap.get().prefs);try{let r=await e.request(`prefs.set`,{key:t,value:n});Mp({...Ap.get(),prefs:r.prefs})}catch(e){Ap.set(r),jp(r.prefs),z(e instanceof Error?e.message:String(e),`error`)}}function Ip(e,t){if(Np)return void Fp(Np,e,t);let n=Ap.get();Ap.set({...n,prefs:{...n.prefs,[e]:t}})}function Lp(){return y(Ap)}function Rp(e,t){let n=e.options[t];return Array.isArray(n)?n:[]}var zp=[`project`,`state`],Bp=`rove.railGroup`,Vp=v(zp.find(e=>e===localStorage.getItem(Bp))??`project`);function Hp(e){e!==Vp.get()&&(Vp.set(e),localStorage.setItem(Bp,e))}Ap.subscribe(()=>{let{loaded:e,prefs:t}=Ap.get();e&&zp.includes(t.railGroup)&&Hp(t.railGroup)});function Up(e){Hp(e),Ip(`railGroup`,e)}var Wp=`rove.activeSortMode`;function Gp(){let e=localStorage.getItem(Wp);return Nd.find(t=>t===e)??`recent`}var Kp=v(Gp());function qp(e){e!==Kp.get()&&(Kp.set(e),localStorage.setItem(Wp,e))}Ap.subscribe(()=>{let{loaded:e,prefs:t}=Ap.get();e&&Nd.includes(t.railSort)&&qp(t.railSort)});function Jp(e){qp(e),Ip(`railSort`,e)}function Yp(){Jp(Nd[(Nd.indexOf(Kp.get())+1)%Nd.length]??`default`)}var Xp=v(!1);function Zp(e){e&&(Kp.get()!=="default"||Vp.get()===`state`)&&(Jp(`default`),Up(`project`),z(J(`tasks`,`sort.reorderSwitched`))),Xp.set(e)}async function Qp(e,t,n){let r=n<0?`up`:`down`;try{await e.client.request(`task.move`,{taskId:t.task.id,direction:r})}catch(e){z(J(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}}async function $p(e,t,n){let r=n<0?`up`:`down`;try{for(let i=0;i<Math.abs(n);i++)await e.client.request(`task.move`,{taskId:t,direction:r})}catch(e){z(J(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}}var em=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5],tm=Array.from({length:64},(e,t)=>{let n=t%8,r=t>>3;return(4*(em[(r&3)*4+(n&3)]??0)+([0,2,3,1][(r>>2)*2+(n>>2)]??0)+.5)/64}),nm=(e,t)=>tm[(t&7)*8+(e&7)]??1,rm=[[6,9,.3],[22,68,2.1],[37,4,4],[95,7,1.2],[118,20,3.3],[122,62,5.1],[11,40,2.8],[83,75,.9]];function im(e,t){e.fill(0);for(let[n,r,i]of rm)Math.sin(t*.8+i)>-.5&&(e[r*128+n]=1)}var am=64,om=40,sm=25,cm=(1-1.2/sm)**2,lm=[{radius:1.55,lift:.3,roll:-.42,speed:.9,phase:.4,ink:4},{radius:1.95,lift:.22,roll:.3,speed:-.55,phase:2.6,ink:3},{radius:2.4,lift:.36,roll:-.12,speed:.38,phase:4.4,ink:3}],um=1.9;function dm(e,t){im(e,t);let n=(t,n,r)=>{t>=0&&t<128&&n>=0&&n<80&&(e[n*128+t]=r)},r=-.55+.25*Math.sin(t*.3),i=-.5,a=.67,o=Math.hypot(r,i,a),s=t*.35,c=Math.sin(s),l=Math.cos(s),u=.4,d=Math.sin(u),f=Math.cos(u);for(let e=0;e<80;e++)for(let t=0;t<128;t++){let s=(t+.5-am)/sm,u=(e+.5-om)/sm,p=s*s+u*u;if(p>=1)continue;let m=Math.sqrt(1-p),h=Math.max(0,(s*r+u*i+m*a)/o),g=s*f+u*d,_=u*f-s*d,v=Math.atan2(g*l+m*c,m*l-g*c),y=Math.asin(Math.max(-1,Math.min(1,_))),b=.5+.5*Math.sin(y*9+1.3*Math.sin(v*2+y*3));h**.75*(.4+.6*b)>nm(t,e)?n(t,e,h>.4?3:2):p>cm&&n(t,e,1)}for(let e of lm){let r=Math.sin(e.roll),i=Math.cos(e.roll),a=t=>{let n=e.radius*Math.cos(t),a=e.radius*Math.sin(t),o=a*e.lift,s=n*i-o*r,c=n*r+o*i,l=s*s+c*c<1;return a<0&&l?null:[Math.floor(am+s*sm),Math.floor(om+c*sm),l]},o=Math.round(Math.PI*e.radius*sm);for(let e=0;e<o;e++){let t=a(e/o*Math.PI*2);t&&!t[2]&&n(t[0],t[1],1)}let s=e.phase+t*e.speed,c=.5/(e.radius*sm),l=-Math.sign(e.speed)*c;for(let e=um/c;e>=0;e--){let t=a(s+e*l);if(t?.[2])for(let e=-2;e<=2;e++)for(let r=-2;r<=2;r++)n(t[0]+r,t[1]+e,0)}for(let t=um/c;t>0;t--){let r=a(s+t*l),i=1-t*c/um;r&&i>nm(r[0],r[1])&&n(r[0],r[1],i>.6?e.ink:2)}let u=a(s);if(u)for(let t=-1;t<=1;t++)for(let r=-1;r<=1;r++)n(u[0]+r,u[1]+t,e.ink)}}var fm=-.38,pm=Math.cos(fm),mm=Math.sin(fm),hm=.3;function gm(e,t){im(e,t);let n=t*.21,r=55*Math.cos(n),i=21*Math.sin(n),a=r*pm-i*mm,o=r*mm+i*pm;for(let t=0;t<80;t++)for(let r=0;r<128;r++){let s=t*128+r,c=r+.5-64,l=t+.5-40,u=c*pm+l*mm,d=l*pm-c*mm,f=nm(r,t),p=(u*u+d*d)/441;if(p<1){let t=Math.sqrt(1-p),r=Math.max(0,-.57*u/21-.68*d/21+.56*t),i=d/21+.17*t;e[s]=r*(.73+.23*Math.cos(i*18+.5*Math.sin(n+u/9)))>f?3:+(p>.94&&f<.68)}let m=Math.hypot(u,d/hm);if(m>=28&&m<53&&(p>=1||d>0)){let t=.61+.29*Math.cos(m*1.4)+.1*Math.sin(m*3-n);e[s]=(m>41.5&&m<44.5?0:t*(u>10&&d<0&&Math.abs(d)<7?.32:1)*(m<31||m>49?.55:1))>f?m>45&&m<47&&u<-8&&d>0?4:d>0?3:2:0}let h=Math.hypot(c-a,l-o);h<2&&(p>=1||i>0)&&(e[s]=h<1.45?4:2)}}var _m=[[-.33,-.34,.22],[.22,-.5,.11],[-.48,.2,.13],[.15,.34,.27]];function vm(e,t){im(e,t);let n=t*.27,r=26+6*Math.cos(n),i=49+3*Math.sin(n);for(let t=0;t<80;t++)for(let a=0;a<128;a++){let o=t*128+a,s=nm(a,t),c=(a-94)/15,l=(t-55)/15,u=c*c+l*l;if(u<1){let t=Math.sqrt(1-u),n=-.83*c-.49*l+.19*t;for(let[e,t,r]of _m){let i=Math.hypot(c-e,l-t)/r;i<1&&(n+=i>.72?.22:-.3)}e[o]=n>s?n>.54?3:2:+(u>.92&&s<.28)}let d=a-r,f=t-i,p=d/80;if(p>0&&p<1){let t=-d*.63+28*p*p,r=3+13*p,i=(f-t)/r,a=Math.max(0,1-Math.abs(i)),c=.58+.42*Math.cos(i*14+p*5-n),l=Math.max(0,1-Math.abs(f+d*.54)/1.65);(a*c+l*.75)*(1-p)>s&&(e[o]=l>.55&&p<.68?4:p<.56?3:2)}let m=Math.hypot(d,f);m<2.8?e[o]=3:m<8&&.84*(1-m/8)**1.3>s&&(e[o]=4)}}var ym=`flex min-h-0 w-full flex-1 flex-col overflow-y-auto`,bm=`mx-auto mt-[clamp(0rem,calc(50dvh-13rem),12rem)] flex w-full max-w-130 flex-col items-center gap-4 px-5 py-7 text-center narrow:mt-0`,xm=`relative mb-3 aspect-[760/335] min-h-0 w-full max-w-[830px] shrink narrow:aspect-[760/465]`;function Sm(e){let t=e;return()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967296)}var Cm=Sm(892671),wm=Array.from({length:104},(e,t)=>({along:Cm()+Cm()-1,across:Cm()+Cm()-1,depth:Cm(),phase:Cm()*2*Math.PI,pace:Cm(),starX:44+Cm()*672,starY:23+Cm()*284,copper:t===2||t===61||t===24,near:t===2||t===30||t===82,lead:t===2,glint:t===59})).sort((e,t)=>Number(e.near)-Number(t.near)||e.depth-t.depth),Tm=Array.from({length:12},()=>({x:15+Cm()*730,y:12+Cm()*300,phase:Cm()*2*Math.PI})),Em=[[-2,174,174],[0,222,172],[2,262,167],[4,372,149],[5.8,485,96],[6.9,555,101],[7.8,551,143],[8.9,484,174],[10.4,351,204],[11.7,246,177],[13,217,128],[14.3,285,100],[16,459,103],[18,642,132],[20,826,135]];function Dm(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function Om(e){let t=0;for(;t<Em.length-2&&e>Em[t+1][0];)t++;let n=Em[t],r=Em[t+1],i=Em[Math.max(0,t-1)],a=Em[Math.min(Em.length-1,t+2)],o=r[0]-n[0],s=Math.max(0,Math.min(1,(e-n[0])/o)),c=s*s,l=c*s;function u(e){let t=(r[e]-i[e])*o/(r[0]-i[0]),u=(a[e]-n[e])*o/(a[0]-n[0]);return(2*l-3*c+1)*n[e]+(l-2*c+s)*t+(3*c-2*l)*r[e]+(l-c)*u}return[u(1),u(2)]}function km(e,t){let n=t+e.along*1.43+(e.depth-.5)*.32,[r,i]=Om(n),[a,o]=Om(n+.045),s=Math.hypot(a-r,o-i)||1,c=(a-r)/s,l=(o-i)/s,u=Math.sin(n*1.25+e.along*2.2),d=43+15*Math.sin(t*.61)+17*u,f=e.along*67+8*Math.sin(t*.58+e.phase),p=e.across*d+u*18+(e.depth-.5)*25+6*Math.sin(t*.72+e.phase),m=e.near?Dm((t-5)/3)*(1-Dm((t-11.6)/2.1)):0;return{x:r+c*f-l*p+m*(e.depth-.5)*135,y:i+l*f+c*p+m*(e.lead?58:36),near:m}}function Am(e,t,n,r,i,a,o,s,c){let l=Math.cos(r),u=Math.sin(r),d=(e,r,a=0)=>[t+i*(e*l-r*u+.22*a),n+i*(e*u+r*l*.67-a*.7)];function f(t,n,...r){e.fillStyle=t,e.beginPath(),e.moveTo(...n);for(let t of r)e.lineTo(...t);e.closePath(),e.fill()}function p(e,t){let n=1+e*o*.42,r=a*.85+e*o*.5,i=(t,i,a)=>d(t,e*i*n,a*r);f(t,d(3,e*.4),i(3,3,.8),i(1.4,6.3,3.8),i(-4.9,10.6,6),i(-3.7,6.2,3.9),i(-4.3,6.5,3.5),i(-2.3,2.7,.5),d(-2,e*.45))}p(-1,s),p(1,c),f(c,d(6,0),d(3.1,-.95),d(.8,-1.05),d(-2.4,-.75),d(-5.9,-1.35),d(-5.6,.85),d(-2.2,.55),d(.8,1.18),d(2.8,.72))}function jm(e,t,n,r,i,a,o,s,c){let l=1-a,u=.5+.5*Math.sin(i*(1.6+t.pace)+t.phase);if(e.save(),e.setTransform(1,0,0,1,Math.round(n*e.canvas.width/760),Math.round(r*e.canvas.height/335)),t.lead||t.glint||t.depth>.945){let n=(t.lead?6:3)+Math.round(u*2),r=Math.max(2,Math.round(n*l*.82));e.fillStyle=c,e.globalAlpha=l*(.69+.18*u),e.fillRect(-r,0,2*r+1,1),e.fillRect(0,-r-1,1,2*r+3),e.globalAlpha=l*(.38+.14*u),e.fillRect(-2,-2,1,1),e.fillRect(2,2,1,1),e.fillRect(-2,2,1,1),e.fillRect(2,-2,1,1),e.fillStyle=s,e.globalAlpha=l,e.fillRect(-1,-1,3,3)}else{let n=t.depth>.54||t.copper;e.fillStyle=n?s:c,e.globalAlpha=l*(n?.83+.17*u:.56+.2*u);let r=n||o?2:1;e.fillRect(0,0,r,r)}e.restore()}function Mm(e,t,n,r){let i=r.getPropertyValue(`--color-ink`).trim(),a=r.getPropertyValue(`--color-muted`).trim(),o=r.getPropertyValue(`--color-accent`).trim(),s=r.getPropertyValue(`--color-subtle`).trim(),c=`color-mix(in srgb, ${i} 60%, ${r.colorScheme===`light`?`black`:`white`})`,l=`color-mix(in srgb, ${a} 60%, ${i})`,u=`color-mix(in srgb, ${i} 55%, ${o})`,d=`color-mix(in srgb, ${o} 70%, ${r.getPropertyValue(`--color-paper`)})`;e.setTransform(e.canvas.width/760,0,0,e.canvas.height/335,0,0),e.clearRect(0,0,760,335),e.fillStyle=s;for(let n of Tm)e.globalAlpha=.33+.18*Math.sin(t*.52+n.phase),e.fillRect(n.x,n.y,1.9,1.9);for(let r of wm){let f=Dm((t-1.8-r.along*.59-r.depth*.56)/2.25)*(1-Dm((t-14.85-r.along*.36)/1.87)),p=f>0?km(r,t):{x:r.starX,y:r.starY,near:0},m=r.starX+(p.x-r.starX)*f,h=r.starY+(p.y-r.starY)*f;if(f<.97&&jm(e,r,m,h,t,f,n,r.copper?u:c,r.copper?o:l),f<.04)continue;let g=km(r,t+.05),_=Math.atan2(g.y-p.y,g.x-p.x),v=Math.sin(t*(3.9+r.pace*2.4)+r.phase),y=.74*Math.sin(t*1.18+r.along*2.4+.26*r.phase),b=(.31+.51*r.depth**1.8+p.near*(r.lead?2.7:1.55))*(n?1.18:1)*(.28+.72*f);e.globalAlpha=f*(.68+.32*r.depth),Am(e,m,h,_,b,v,y,r.copper?d:s,r.copper?o:r.depth>.5?i:a)}e.globalAlpha=1}var Nm=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];function Pm(e){let t=document.createElement(`canvas`),n=t.getContext(`2d`,{willReadFrequently:!0}),r=e.getContext(`2d`),i=getComputedStyle(e);return a=>{if(!n||!r||!e.clientWidth||!e.clientHeight)return;let o=e.clientWidth<550,s=o?460:440;t.width!==s&&(t.width=s,t.height=Math.round(s*335/760)),Mm(n,a%17,o,i);let c=n.getImageData(0,0,t.width,t.height),l=3;for(let e=0;e<t.height;e++)for(let n=0;n<t.width;n++,l+=4){let t=c.data[l];if(!t)continue;let r=Nm[(n&3)+4*(e&3)];c.data[l]=t>12+7*r?Math.max(135,t)*(r>12?.45:1):0}n.putImageData(c,0,0);let u=Math.min(window.devicePixelRatio||1,2),d=Math.round(e.clientWidth*u),f=Math.round(e.clientHeight*u);(e.width!==d||e.height!==f)&&(e.width=d,e.height=f),r.clearRect(0,0,d,f),r.imageSmoothingEnabled=!1;let p=Math.min(d/760,f/335)*(o?1.24:1),m=760*p,h=335*p;r.drawImage(t,(d-m)/2,(f-h)/2,m,h)}}var Fm=3,Im=2,Lm=[``,`--color-subtle`,`--color-muted`,`--color-ink`,`--color-accent`],Rm={orbit:dm,rings:gm,comet:vm},zm=7;function Bm(e,t){let n=e.getContext(`2d`);if(!n)return;let r=window.devicePixelRatio||1,i=Math.round(128*Fm*r);e.width!==i&&(e.width=i,e.height=Math.round(80*Fm*r)),n.setTransform(r,0,0,r,0,0),n.clearRect(0,0,128*Fm,80*Fm);let a=getComputedStyle(e);for(let e=1;e<=4;e++){n.fillStyle=a.getPropertyValue(Lm[e]??``)||a.color;for(let r=0;r<t.length;r++)t[r]===e&&n.fillRect(r%128*Fm,Math.floor(r/128)*Fm,Im,Im)}}function Vm(e,t){let n=new Uint8Array(10240),r=Rm[t]??dm;return t=>{r(n,t),Bm(e,n)}}function Hm({scene:e}){let t=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let n=t.current;if(!n)return;let r=window.matchMedia(`(prefers-reduced-motion: reduce)`),i=e===`starlings`,a=i?Pm(n):Vm(n,e),o=i?8.7:zm,s=!1,c=0,l=i?0:zm,u=0,d=()=>a(r.matches?o:l),f=e=>{c=requestAnimationFrame(f),!(e-u<1e3/24)&&(l+=(e-u)/1e3,u=e,d())},p=()=>{cancelAnimationFrame(c),!(!s||document.hidden)&&(d(),r.matches||(u=performance.now(),c=requestAnimationFrame(f)))},m=new IntersectionObserver(([e])=>{s=!!e?.isIntersecting,p()});m.observe(n);let h=new MutationObserver(()=>{s&&r.matches&&d()}),g=i?new ResizeObserver(()=>{s&&!document.hidden&&r.matches&&d()}):null;return g?.observe(n),h.observe(document.documentElement,{attributes:!0,attributeFilter:[`style`]}),r.addEventListener(`change`,p),document.addEventListener(`visibilitychange`,p),()=>{cancelAnimationFrame(c),m.disconnect(),g?.disconnect(),h.disconnect(),r.removeEventListener(`change`,p),document.removeEventListener(`visibilitychange`,p)}},[e]),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:e===`starlings`?xm:`mb-3 w-96 max-w-full shrink-0 narrow:w-72`,children:(0,W.jsx)(`canvas`,{ref:t,"data-plate":e,width:128*Fm,height:80*Fm,className:e===`starlings`?`absolute inset-0 block h-full w-full text-muted`:`block h-auto w-full text-muted`},e)})}function Um(e,t){let n=t.trim().toLowerCase(),r=e.toLowerCase();if(r.includes(n))return`substring`;if(!n.includes(`/`))return null;let i=n.split(`/`),a=0;for(let e of r.split(`/`))a<i.length&&e.startsWith(i[a]??``)&&a++;return a===i.length?`segments`:null}function Wm(e,t){if(!t.trim())return e;let n=[],r=[];for(let i of e){let e=Um(i,t);e===`substring`?n.push(i):e===`segments`&&r.push(i)}return[...n,...r]}var Gm=`flex min-h-0 min-w-0 flex-1 flex-col p-4 font-mono text-meta leading-[1.5] font-normal not-italic normal-nums`,Km=`flex min-h-0 flex-1 flex-col items-center justify-center gap-1.5 overflow-hidden text-center keyboard:hidden`,qm=`relative mx-auto flex w-full max-w-[104ch] flex-none flex-col gap-2 keyboard:mt-auto`,Jm=`pointer-events-none absolute bottom-full left-0 mb-2 flex flex-col gap-1`,Ym=`flex flex-col gap-2 rounded-md border-hairline border-line bg-surface px-3 py-2.5 focus-within:border-line-active`,Xm=`flex flex-wrap items-center justify-end gap-1.5`,Zm=`max-h-[40vh] min-h-[4.5em] w-full bg-transparent text-ink [border:0] [outline:0]`,Qm=`flex items-center gap-1.5 px-1`,$m=`flex min-w-0 items-center gap-1.5 narrow:contents`,eh=`${$m} group/end ml-auto narrow:ml-0`,th=(e=!1)=>`flex h-7 min-w-7 cursor-pointer items-center justify-center rounded-sm px-1 has-[:disabled]:opacity-60 disabled:opacity-60 [&:hover]:bg-hover [&:hover]:text-ink ${e?`text-accent`:`text-muted`}`,nh=`size-3.25 flex-none fill-none stroke-current [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:1.3]`,rh=`narrow:sr-only`,ih=`min-w-8.5`,ah=(e=!1)=>`inline-flex max-w-[28ch] ${ih} items-center gap-1.5 overflow-hidden rounded-full border-hairline px-2.5 py-0.75 text-ellipsis whitespace-nowrap touch:py-1.75 [&:hover]:bg-hover [&:hover]:text-ink aria-expanded:bg-hover aria-expanded:text-ink ${e?`border-[color-mix(in_srgb,var(--accent)_45%,transparent)] bg-accent-soft text-accent`:`border-line text-muted`}`,oh=`disabled:cursor-default disabled:opacity-60`,sh=e=>`${ah(e)} min-w-[9ch] justify-center ${oh}`,ch=`touch-none select-none [-webkit-touch-callout:none]`,lh=(e=!1)=>`group/chip relative inline-flex ${ih} ${e?`narrow:max-w-fit narrow:flex-[1_1_0]`:``}`,uh=`flex min-h-0 flex-col gap-1 overflow-x-hidden overflow-y-auto p-1.5 [outline:0]`,dh=`flex min-h-0 flex-col overflow-x-hidden overflow-y-auto`,fh=`sticky top-0 z-1 m-0 bg-surface px-1.5 pt-1.5 pb-0.5 text-left`,ph=e=>`flex w-full items-baseline gap-2 rounded-[calc(var(--radius)-6px)] px-2 py-1 text-left touch:py-2.5 disabled:cursor-default disabled:opacity-50 ${e.dim?`text-subtle`:`text-ink`} ${e.cursor?`bg-hover`:``}`,mh=`flex-[0_0_1.5ch] text-accent`,hh=`ml-auto pl-3 inline-flex items-center gap-1`,gh=`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,_h=`${gh} narrow:max-w-[13ch]`,vh=`${gh} [direction:rtl]`,yh=`flex-none whitespace-nowrap`,bh=`mx-2 my-1`,xh=`flex flex-col gap-0.5 px-1.5 py-0.5`,Sh=`min-w-[36ch]`,Ch=`flex items-center gap-1.5 p-1.5`;function wh(){return(0,W.jsx)(`svg`,{className:nh,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M2 4.5a1 1 0 0 1 1-1h3l1.5 1.5H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z`})})}function Th(){return(0,W.jsxs)(`svg`,{className:nh,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`4.5`,cy:`3.5`,r:`1.5`}),(0,W.jsx)(`circle`,{cx:`4.5`,cy:`12.5`,r:`1.5`}),(0,W.jsx)(`circle`,{cx:`11.5`,cy:`5`,r:`1.5`}),(0,W.jsx)(`path`,{d:`M4.5 5v6M11.5 6.5c0 3-7 2-7 4.5`})]})}function Eh(e){return e instanceof Error?e.message:String(e)}function Dh(e){return/no space left on device|ENOSPC|disk quota exceeded/i.test(Eh(e))}var Oh=[`..##..`,`##..#.`,`#....#`,`.####.`],kh=`-my-0.75 -mr-0.5 ml-0 flex flex-none self-stretch`,Ah=`before:absolute before:top-0 before:left-1 before:content-[''] before:[border-left:var(--hairline)_solid_var(--line-active)]`,jh={blank:``,pipe:`${Ah} before:bottom-0`,tee:`${Ah} before:bottom-0`,elbow:`${Ah} before:right-0 before:bottom-1/2 before:rounded-bl-[6px] before:[border-bottom:var(--hairline)_solid_var(--line-active)]`},Mh=e=>`relative w-3 ${jh[e]}`,Nh=`-mx-1 inline-flex min-w-6 cursor-pointer items-center justify-center gap-1 self-stretch rounded-xs px-2 font-mono hover:bg-hover`,Ph=`inline-flex items-center gap-1`,Fh=e=>`fixed z-35 flex max-h-[min(380px,60vh)] w-85 max-w-[calc(100vw-24px)] animate-pr-list-in flex-col overflow-y-auto overscroll-contain rounded-md border-hairline border-line bg-surface p-1.5 shadow-popover transition-[opacity,translate] duration-120 ease-in motion-reduce:animate-none motion-reduce:transition-none ${e?`-translate-x-1 opacity-0`:``}`,Ih=`inline-flex flex-none items-center text-subtle`,Lh=`group/rail rail @container row-1 flex min-h-0 flex-col focus:outline-none ${Wt}`,Rh=`flex min-w-0 items-center gap-2.5 overflow-hidden px-3.5 pt-3.5 pb-2.5 whitespace-nowrap`,zh=`flex gap-1 px-3.5 pb-2 text-meta`,Bh=`min-w-0 flex-1 border-none bg-transparent p-0 text-ink [font:inherit] outline-none placeholder:text-subtle`,Vh=e=>`flex-1 overflow-y-auto px-1.5 pt-1 pb-3 scrollbar-none ${e?`[&>[data-row]]:[transition:transform_150ms_ease-out,scale_150ms_ease-out,opacity_150ms_ease-out] motion-reduce:[&>[data-row]]:transition-none [&>[data-row]]:[box-shadow:none]! [&>[data-row]:not([data-lifted])]:opacity-45`:``}`,Hh=`group-focus-within/rail:[box-shadow:inset_0_0_0_1px_var(--focus)]`,Uh=e=>`group/head mx-2 mt-1.5 mb-1 flex items-center gap-1 font-mono text-meta font-semibold normal-nums not-first:mt-4.5 ${e.dragging?`origin-left scale-[1.03] cursor-grabbing text-ink motion-reduce:scale-none`:`text-subtle`} ${e.grab&&!e.dragging?`cursor-grab [&>button:first-child]:cursor-grab`:``} ${e.moving?`bg-accent-soft after:font-mono after:text-meta after:font-medium after:normal-nums after:text-accent after:content-['move']`:``}`,Wh=`touch:relative touch:after:absolute touch:after:-inset-x-1.5 touch:after:-inset-y-3 touch:after:content-['']`,Gh=`inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-xs border-none bg-transparent px-1 py-0.5 text-inherit [font:inherit] hover:text-ink touch:relative touch:after:absolute touch:after:inset-x-0 touch:after:-inset-y-3 touch:after:content-['']`,Kh=`-ml-1 ${Gh}`,qh=`group/toggle ${Gh}`,Jh=e=>e?``:`opacity-0 group-hover/head:opacity-100 group-focus-visible/toggle:opacity-100 touch:opacity-100`,Yh=`-mr-[4.5px] ml-auto size-5 shrink-0 cursor-pointer rounded-xs border-none bg-transparent text-muted opacity-0 [font:400_var(--fs-display)/1_var(--sans)] group-hover/head:opacity-100 hover:bg-hover hover:text-ink focus-visible:opacity-100 touch:opacity-100 ${Wh}`,Xh=1e4;function Zh(e,t){let n=e.hostLabel||e.alias;if(e.state===`online`)return e.version?`${n} · v${e.version}`:n;let r=t[e.state];return e.state===`mismatch`?e.version?`${n} · ⚠ v${e.version} (${r})`:`${n} · ⚠ ${r}`:`${n} · ${r}`}function Qh(e,t,n,r=e){let i=t?.hostLabel&&t.hostLabel!==e?` (${t.hostLabel})`:``,a=n.runsOn.replace(`{host}`,t?`${e}${i}`:r);return!t||t.state===`online`?a:`${a}${Zh(t,n).slice((t.hostLabel||t.alias).length)}`}function $h(e,t,n){if(e.kind!==`task`)return null;let r=e.machine??e.task.workspaceOn;return r===void 0?null:Qh(r,t.find(e=>e.alias===r),n,e.task.machine?.label)}var eg=Oh.flatMap((e,t)=>[...e].flatMap((e,n)=>e===`#`?[[n,t]]:[]));function tg({label:e}){return(0,W.jsx)(`span`,{className:Ih,title:e,role:`img`,"aria-label":e,children:(0,W.jsx)(`svg`,{viewBox:`0 0 11.5 7.5`,width:`11.5`,height:`7.5`,fill:`currentColor`,"aria-hidden":`true`,children:eg.map(([e,t])=>(0,W.jsx)(`circle`,{cx:e*2+.75,cy:t*2+.75,r:`0.75`},`${e}.${t}`))})})}function ng({host:e,onMachines:t}){return U(),(0,W.jsxs)(`div`,{className:Jn,children:[(0,W.jsx)(`p`,{className:`text-muted`,children:J(`tasks`,`machine.filesElsewhere`,{host:e})}),(0,W.jsx)(`p`,{className:`text-muted`,children:J(`tasks`,`machine.filesHint`,{host:e})}),(0,W.jsx)(`div`,{children:(0,W.jsx)(G,{hit:`tight`,onClick:t,children:H(`machines.open`)})})]})}function rg(e){let t=y(e.client.conn),n=y(e.remote),[r,i]=(0,m.useState)(()=>X(e,`machines.list`)?.machines??[]),a=[...new Set(n.map(e=>`${e.machine?.id}:${e.machine?.stale??!1}`))].join();return(0,m.useEffect)(()=>{if(t.state!==`open`)return;let n=!0,r=()=>Z(e,`machines.list`).then(e=>n&&i(e.machines),()=>{});r();let a=Oi(Xh,r);return()=>{n=!1,a()}},[e.client,t.state,a]),r}function ig(e){let[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(e.onClose);r.current=e.onClose,(0,m.useEffect)(()=>{t||r.current?.()},[t]);let i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null);(0,m.useLayoutEffect)(()=>{let e=o.current;if(!t||!e)return;let n=e.getBoundingClientRect(),r=n.right>window.innerWidth-8?window.innerWidth-8-n.right:n.left<8?8-n.left:0;r&&(e.style.transform=`translateX(${Math.round(r)}px)`)},[t]);let s=()=>{n(!1),a.current?.focus()};return(0,m.useEffect)(()=>{if(!t)return;let e=e=>{i.current?.contains(e.target)||n(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[t]),(0,W.jsxs)(`span`,{ref:i,className:lh(e.yields),onKeyDown:e=>{e.key!==`Escape`||!t||(e.preventDefault(),e.stopPropagation(),s())},children:[(0,W.jsx)(`button`,{ref:a,type:`button`,className:ah(),"data-field":e.field,title:e.title,"aria-haspopup":`menu`,"aria-expanded":t,disabled:e.disabled,onClick:()=>n(e=>!e),children:typeof e.label==`string`?(0,W.jsx)(`span`,{className:gh,children:e.label}):e.label}),t&&(0,W.jsx)(`div`,{ref:o,className:`absolute bottom-[calc(100%+6px)] left-0 z-20 flex max-h-[min(50vh,420px)] max-w-[min(52ch,calc(100vw-16px))] min-w-[min(34ch,calc(100vw-16px))] flex-col overflow-hidden rounded-md border-hairline border-line-active bg-surface shadow-popover group-[&]/end:group-last-of-type/chip:right-0 group-[&]/end:group-last-of-type/chip:left-auto`,children:e.children(s)})]})}function ag(e){let[t,n]=(0,m.useState)(0),r=[...e.extra?[e.extra]:[],...e.rows,...e.more??[]],i=Math.min(t,Math.max(0,r.length-1)),a=(0,m.useRef)(null);return(0,m.useEffect)(()=>{a.current?.scrollIntoView({block:`nearest`})},[i,e.rows]),(0,W.jsxs)(`div`,{className:uh,children:[(0,W.jsx)(`input`,{className:hn,autoFocus:!0,spellCheck:!1,placeholder:e.placeholder,value:e.query,onChange:t=>{n(0),e.onQuery(t.target.value)},onKeyDown:t=>{if(!t.nativeEvent.isComposing){if(t.key===`ArrowDown`||t.key===`ArrowUp`)t.preventDefault(),n(Math.max(0,Math.min(r.length-1,i+(t.key===`ArrowDown`?1:-1))));else if(t.key===`Enter`){t.preventDefault();let n=r[i];n&&e.onPick(n.key,t.shiftKey||t.metaKey||t.ctrlKey)}}}}),(0,W.jsxs)(`div`,{className:dh,children:[r.length===0&&(0,W.jsx)(`p`,{className:`mx-2 my-1 text-muted`,children:e.empty}),r.map((t,r)=>(0,W.jsxs)(m.Fragment,{children:[e.moreLabel&&t===e.more?.[0]&&(0,W.jsx)(`p`,{className:`mx-2 mt-2 mb-0.5 text-muted`,children:e.moreLabel}),t.ruled&&r>0&&(0,W.jsx)(`div`,{className:`mx-2 my-1 flex-none border-t-hairline border-t-line`}),(0,W.jsxs)(`button`,{type:`button`,"aria-current":t.checked===!0,ref:r===i?a:void 0,tabIndex:-1,title:t.title,className:ph({cursor:r===i}),onMouseMove:()=>n(r),onClick:n=>e.onPick(t.key,n.shiftKey||n.metaKey||n.ctrlKey),children:[(0,W.jsx)(`span`,{className:mh,children:t.checked?`✓`:``}),(0,W.jsx)(`span`,{className:yh,children:t.text}),t.dim&&(0,W.jsx)(`span`,{className:`ml-auto pl-3 text-muted ${t.dimPath?vh:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`}`,children:t.dimPath?(0,W.jsx)(`bdi`,{children:t.dim}):t.dim})]})]},t.key))]}),e.hint&&(0,W.jsx)(`p`,{className:`m-0 flex-none border-t-hairline border-t-line px-2 pt-1.5 pb-0.5 text-subtle`,children:e.hint})]})}function og(e){return(0,W.jsxs)(`button`,{type:`button`,role:e.multi?`menuitemcheckbox`:`menuitemradio`,"aria-checked":e.checked,tabIndex:-1,disabled:e.option.disabled,className:ph({cursor:e.cursor,dim:e.option.dim}),onMouseMove:e.onHover,onClick:e.onPick,children:[(0,W.jsx)(`span`,{className:mh,children:e.checked?`✓`:``}),(0,W.jsx)(`span`,{children:e.option.label}),!e.checked&&e.digit!==void 0&&!e.option.disabled&&(0,W.jsx)(`span`,{className:`ml-auto pl-3 text-muted`,children:e.digit})]})}function sg(e){let[t,n]=(0,m.useState)(()=>Math.max(0,e.options.findIndex(t=>t.id===e.value))),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>r.current?.focus(),[]),(0,W.jsxs)(`div`,{ref:r,role:`menu`,tabIndex:-1,className:uh,onKeyDown:r=>{if(!(r.ctrlKey||r.metaKey||r.altKey||r.nativeEvent.isComposing)){if(r.key===`ArrowDown`||r.key===`ArrowUp`)r.preventDefault(),n(Math.max(0,Math.min(e.options.length-1,t+(r.key===`ArrowDown`?1:-1))));else if(r.key===`Enter`){r.preventDefault();let n=e.options[t];n&&!n.disabled&&e.onPick(n.id)}else if(e.onBack&&(r.key===`Escape`||r.key===`ArrowLeft`))r.preventDefault(),r.stopPropagation(),e.onBack();else{let t=e.digits?qu(r.key,e.options.length):null,n=t===null?void 0:e.options[t];if(!n||n.disabled)return;r.preventDefault(),e.onPick(n.id)}}},children:[e.onBack?(0,W.jsxs)(`button`,{type:`button`,className:`${fh} ${Ar} text-muted`,tabIndex:-1,onClick:e.onBack,children:[`‹ `,e.heading]}):(0,W.jsx)(`p`,{className:`${fh} ${Ar} text-muted`,children:e.heading}),e.options.map((r,i)=>(0,W.jsx)(og,{option:r,checked:e.values?e.values.includes(r.id):r.id===e.value,multi:e.values!==void 0,cursor:i===t,digit:e.digits&&i<9?i+1:void 0,onHover:()=>n(i),onPick:()=>e.onPick(r.id)},r.id)),e.footer]})}function cg(e){return(0,W.jsxs)(`div`,{className:`${uh} ${Sh}`,children:[(0,W.jsx)(`p`,{className:`${fh} ${Ar} text-muted`,children:H(`newSession.branches`)}),(0,W.jsxs)(`label`,{className:xh,children:[(0,W.jsx)(`span`,{className:`text-muted`,children:H(`newSession.branchName`)}),(0,W.jsx)(`input`,{className:Nr,autoFocus:!0,spellCheck:!1,placeholder:H(`newSession.branchNamePlaceholder`),value:e.branch,onChange:t=>e.onBranch(t.target.value)})]}),e.repos.map(t=>(0,W.jsxs)(`label`,{className:xh,children:[(0,W.jsxs)(`span`,{children:[t.name,t.primary&&(0,W.jsxs)(`span`,{className:`text-muted`,children:[` `,H(`newSession.primary`)]})]}),(0,W.jsx)(`select`,{className:Nr,"aria-label":t.name,value:t.base||t.current,onChange:n=>e.onBase(t.path,n.target.value),children:(t.branches.includes(t.base||t.current)?t.branches:[t.base||t.current,...t.branches]).filter(e=>e!==``).map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))})]},t.path))]})}function lg(e){return e.replace(/\.git$/,``).split(/[/:]/).filter(Boolean).slice(-2).join(`/`)}function ug(e){return e.id.startsWith(`root:`)?e.primary??e.checkouts[0]??e.id:e.id}function dg(e,t){if(!e||e.clone)return null;if(ku(e.ref))return e.ref;let n=t.find(t=>t.id===e.ref);return n?.primary??n?.checkouts[0]??null}function fg(e,t){if(!e)return null;let n=t.find(t=>t.id===e||t.checkouts.includes(e));return n?{ref:ug(n),clone:!1}:ku(e)?{ref:e,clone:!1}:null}function pg(e,t,n){let r=t.toLowerCase();return n?e.some(e=>e.toLowerCase()===`github.com/${r}`):e.some(e=>Eu(e).base.toLowerCase()===(r.split(`/`)[1]??``))}function mg(e,t,n){let r=t.find(t=>t.id===e||t.checkouts.includes(e))?.id??e,i=n.find(e=>e.id===r);return i?{ref:ug(i),clone:!1}:r.startsWith(`root:`)||ku(r)?null:{ref:r,clone:!0}}function hg(e,t){let n=new Set(t.filter(e=>e.installed!==!1).map(e=>e.id)),r=new Set(t.length>0?e.filter(e=>!n.has(e.id)).map(e=>e.id):[]),i=new Set(e.map(e=>e.id)),a=t.filter(e=>n.has(e.id)&&!i.has(e.id)).map(e=>({id:e.id,name:e.name??e.id}));return{rows:[...e,...a],missing:r}}function gg(e){return{repo:e.checkout??e.pick.ref,machine:e.machine,...e.checkout?{noWorktree:!0}:{},...e.pick.clone?{clone:!0}:{},...e.baseRef&&!e.checkout?{baseBranch:e.baseRef}:{},...e.prompt?{prompt:e.prompt}:{},...e.engine?{engine:e.engine}:{},...e.engineThere?{engineThere:!0}:{},...!e.engineThere&&e.model?{model:e.model}:{}}}function _g(e){switch(e?.kind){case`busy`:case`running`:return`working`;case`needs-input`:return`waiting`;case`attention`:return e.reason===`rate_limited`?`waiting`:`error`;case`unseen`:return`done`;default:return`idle`}}var vg={error:[0,4,8,2,6],done:[3,7,5,2],idle:[1,2,5,8,7,6,3,0]},yg=1.2,bg=[0,1,4,5];function xg(e){return bg.includes((Math.floor(e)%20+20)%20)}var Sg=.3,Cg=.35,wg=.25,Tg=.12,Eg=2,Dg=1,Og={error:{dots:vg.error,bright:1},done:{dots:vg.done,bright:1},idle:{dots:vg.idle,bright:.6}},kg=Array.from({length:9},(e,t)=>Math.hypot(t%3-1,Math.floor(t/3)-1));function Ag(e){return Cg+.65*(.5+.5*Math.cos(2*Math.PI*e/yg))}function jg(e,t,n,r=1){switch(e){case`working`:{let e=t*80/1e3/r;return kg.map(t=>Ag(e-t*Sg))}case`waiting`:{let e=xg(t/r);return Array(9).fill(e?wg:1)}default:{let t=Og[e],r=Array(9).fill(Tg);return t?.dots.forEach((e,i)=>{let a=Math.min(Math.max(n-i*Dg,0),Eg)/Eg;r[e]=t.bright*a+Tg*(1-a)}),r}}}function Mg(e,t){let n=Og[e];return!n||t<(n.dots.length-1)*Dg+Eg}var Ng={working:`info`,waiting:`warning`,error:`attention`,done:`success`,idle:`muted`},Pg={prOpen:``,prMerged:``,prClosed:``};function Fg(e){let t=_g(e);return{look:t,tone:Ng[t]}}function Ig(e){return e.rowStatus?.kind===`needs-input`||e.rowStatus?.kind===`attention`}var Lg={busy:0,attention:1,"needs-input":2,running:3,unseen:4,idle:5};function Rg(e){let t;for(let{rowStatus:n}of e)n&&(!t||Lg[n.kind]<Lg[t.kind]||n.kind===t.kind&&n.since>t.since)&&(t=n);return t}function zg(e,t){if(!e)return null;if(e.lifecycle===`merged`)return{glyph:Pg.prMerged,tone:`text-merged`,state:`merged`};if(e.lifecycle===`closed`)return{glyph:Pg.prClosed,tone:`text-muted`,state:`closed`};if(e.lifecycle!==`open`&&e.lifecycle!==`ready_to_merge`&&e.lifecycle!==`unknown`)return null;let n=t===`conflict`?`conflict`:t===`failing`?`failing`:t===`passing`?`passing`:e.checkState===`pending`?`pending`:void 0,r=n===`conflict`?`text-warning`:n===`failing`?`text-error`:`text-success`;return{glyph:Pg.prOpen,tone:r,state:`open`,...n?{checks:n}:{}}}function Bg(e){return zg(e.pr,e.prChip)}function Vg(e){return zg(e,(e.mergeable??``).toUpperCase()===`CONFLICTING`?`conflict`:e.checkState===`failing`?`failing`:e.checkState===`passing`?`passing`:null)}function Hg(e){let t=e=>e.state===`open`?e.checks===`conflict`||e.checks===`failing`?0:1:e.state===`merged`?2:3;return[...e].sort((e,n)=>t(e)-t(n))[0]}var Ug=3,Wg=new Set,Gg;function Kg(e,t){let n=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,r=1/0,i=e.held+t-e.step,a=Mg(e.look,n?r:i);return jg(e.look,t,n?r:i,n?Ug:1).forEach((t,n)=>{let r=e.el.children[n].style;r.opacity=t.toFixed(3)}),a}function qg(){let e=Math.floor(performance.now()/80);for(let t of Wg)Kg(t,e)||Wg.delete(t);Jg()}function Jg(){Gg=Wg.size?window.setTimeout(qg,80-performance.now()%80+2):void 0}function Yg(e,t,n){let r=Math.floor(performance.now()/80),i=n>0?Math.max(Date.now()-n,0):1/0,a={el:e,look:t,step:r,held:Math.floor(i/80)};return Kg(a,r)&&(Wg.add(a),Gg===void 0&&Jg()),()=>{Wg.delete(a)}}function Xg({status:e}){let{look:t,tone:n}=Fg(e);return(0,W.jsx)($g,{look:t,tone:n,since:e?.since??0},t)}var Zg=e=>e===`muted`?`text-muted`:e===`ink`?`text-ink`:Sp[e];function Qg(){return(0,W.jsx)($g,{look:`working`,tone:`info`,since:Date.now()})}function $g({look:e,tone:t,since:n}){let r=(0,m.useRef)(null),[i]=(0,m.useState)(n);return(0,m.useLayoutEffect)(()=>{let t=r.current;return t?Yg(t,e,i):void 0},[e,i]),(0,W.jsx)(`span`,{ref:r,className:`inline-grid flex-none grid-cols-[repeat(3,3px)] auto-rows-[3px] gap-px self-center ${Zg(t)}`,"aria-hidden":`true`,children:Array.from({length:9},(e,t)=>(0,W.jsx)(`i`,{className:`rounded-full bg-current opacity-12`},t))})}var e_={offline:`newSession.remoteOffline`,outdated:`newSession.remoteOutdated`},t_=`local`,n_=`auto`,r_=`rove.newSession.autoMachine`;function i_(){try{return localStorage.getItem(r_)===`1`}catch{return!1}}var a_=(e,t)=>Z(e,`machines.repos`,{machine:t});function o_(e,t){let n=t.filter(e=>e.state===`online`).map(e=>e.alias).join(`
|
|
41
|
-
`);(0,m.useEffect)(()=>{for(let t of n?[t_,...n.split(`
|
|
42
|
-
`)]:[])a_(e,t).catch(()=>{})},[e,n])}function s_(e,t){let[n,r]=(0,m.useState)(null);return(0,m.useEffect)(()=>{if(!t)return;let n=!1;return Z(e,`machines.engines`,{machine:t}).then(e=>!n&&r({machine:t,reply:e})).catch(()=>{}),()=>{n=!0}},[e,t]),t?(n?.machine===t?n.reply:X(e,`machines.engines`,{machine:t}))?.engines??[]:[]}function c_(e,t,n){let r=hg(n.engines,s_(e,t)),i=r.rows.filter(e=>!r.missing.has(e.id)),a=i.some(e=>e.id===n.engine)?n.engine:i[0]?.id??n.engine;return{engines:r.rows,engine:a,setEngine:n.setEngine,missing:t?r.missing:void 0}}function l_(e,t,n){let[r,i]=(0,m.useState)(null),a=d_(e,r?.from??``);return(0,m.useEffect)(()=>{!r||!a.loaded||!t.loaded||(t.problem||n(mg(r.ref,a.repos,t.repos)),i(null))},[r,a,t,n]),(e,t)=>i(e&&t?{from:e,ref:t}:null)}function u_(e,t,n){let r=rg(e),[i,a]=(0,m.useState)(t.machine??``),[o,s]=(0,m.useState)(()=>!t.machine&&i_()),c=d_(e,i),[l,u]=(0,m.useState)(!1),d=c_(e,l?i:``,n);o_(e,r);let[f,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(``),_=l_(e,c,e=>p(t=>t??e));return(0,m.useEffect)(()=>{!i||!c.loaded||i!==t.machine||p(e=>e??fg(t.repo,c.repos))},[c.loaded]),{machines:r,machine:i,auto:o,remote:i!==``,machineName:r.find(e=>e.alias===i)?.hostLabel||i,remoteList:c,engineThere:l,setEngineThere:u,shown:d,pick:f,setPick:p,base:h,setBase:g,switchTo(e,t){let n=e===`auto`?``:e;s(e===n_);try{localStorage.setItem(r_,e===`auto`?`1`:`0`)}catch{}_(n&&(i||`local`),i?f?.ref:t),a(n),p(null),g(``)}}}function d_(e,t){U();let[n,r]=(0,m.useState)(null);if((0,m.useEffect)(()=>{if(!t)return;let n=!1;return a_(e,t).then(e=>!n&&r({machine:t,reply:e,failed:``})).catch(e=>!n&&r({machine:t,reply:null,failed:String(e)})),()=>{n=!0}},[e,t]),!t)return{repos:[],loaded:!0,problem:``};let i=n?.machine===t?n:void 0,a=X(e,`machines.repos`,{machine:t});if(!i&&!a)return{repos:[],loaded:!1,problem:``};let o=i?i.reply:a;if(!o)return{repos:[],loaded:!0,problem:H(`newSession.remoteFailed`,{machine:t,message:i?.failed??``})};let s=o.reason?e_[o.reason]:void 0,c=o.reason?s?H(s,{machine:t}):H(`newSession.remoteFailed`,{machine:t,message:o.message??o.reason}):``;return{repos:o.repos,loaded:!0,problem:c}}function f_(e,t){return t.problem?t.problem:t.loaded?H(`newSession.remoteNone`,{machine:e}):H(`newSession.remoteLoading`,{machine:e})}function p_(){return(0,W.jsxs)(`svg`,{className:nh,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`8`,rx:`1`}),(0,W.jsx)(`path`,{d:`M5.5 13.5h5M8 11v2.5`})]})}function m_(e){let t=(U()===`zh`?Ji:qi).machine,n=e.machines.find(t=>t.alias===e.value),r=e.value===`auto`?H(`newSession.machineAuto`):e.value?n?.hostLabel||e.value:H(`newSession.thisMachine`);return(0,W.jsx)(ig,{field:`machine`,title:H(`newSession.machine`),label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(p_,{}),(0,W.jsx)(`span`,{className:rh,children:r})]}),children:n=>(0,W.jsx)(sg,{heading:H(`newSession.machine`),options:[{id:n_,label:H(`newSession.machineAuto`)},{id:``,label:H(`newSession.thisMachine`)},...e.machines.map(e=>({id:e.alias,label:Zh(e,t),disabled:e.state!==`online`}))],footer:e.value===`auto`?(0,W.jsx)(`p`,{className:`${bh} text-muted`,children:H(`newSession.machineAutoNote`)}):null,value:e.value,digits:!0,onPick:t=>{e.onPick(t),n()}})})}function h_(e){let{machine:t}=e;return(0,W.jsx)(sg,{heading:H(`newSession.agentPlace`),options:[{id:``,label:H(`newSession.thisMachine`)},{id:`there`,label:t}],value:e.there?`there`:``,digits:!0,onBack:e.onBack,onPick:t=>e.onPick(t!==``),footer:(0,W.jsx)(`p`,{className:`${bh} text-muted`,children:H(e.there?`newSession.agentThereNote`:`newSession.agentHereNote`,{machine:t})})})}function g_(e){let[t,n]=(0,m.useState)(``),r=t.trim();return(0,W.jsx)(ig,{field:`branch`,title:H(`newSession.branch`),label:e.value||H(`newSession.branch`),children:i=>(0,W.jsx)(ag,{placeholder:H(`newSession.branchTypeRef`),empty:``,rows:[{key:``,text:H(`newSession.branchRemoteDefault`),checked:e.value===``}],query:t,onQuery:n,extra:r?{key:r,text:r,checked:e.value===r}:null,onPick:t=>{e.onPick(t),n(``),i()}})})}async function __(e,t){return(await e.client.request(`task.spawn`,gg(t))).taskIds[0]}function v_(e){let{progress:t,error:n}=e;return!t&&!n?null:(0,W.jsxs)(`div`,{className:Jm,children:[t&&(0,W.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-muted`,"data-field":`clone-progress`,children:[(0,W.jsx)(Qg,{}),(0,W.jsx)(`span`,{className:`running-shimmer:bg-[linear-gradient(90deg,var(--ink)_0%,var(--ink)_35%,var(--accent)_50%,var(--ink)_65%,var(--ink)_100%)] running-shimmer:bg-size-[300%_100%] running-shimmer:bg-clip-text running-shimmer:text-transparent running-shimmer:animate-shimmer`,children:t})]}),n&&!Dh(n)&&(0,W.jsxs)(`p`,{className:`m-0 text-error`,children:[`※ `,n]}),n&&Dh(n)&&(0,W.jsxs)(`p`,{className:`pointer-events-auto m-0 text-error`,"data-field":`no-disk-space`,children:[`※ `,J(`tasks`,`toast.noDiskSpace`),` `,(0,W.jsx)(G,{hit:`tight`,disabled:e.busy,onClick:e.onRetry,children:H(`newSession.retry`)})]})]})}function y_(e){return e instanceof Go&&e.code===`CLONE_FAILED`?J(`newTask`,`error.cloneFailed`,{error:e.message}):e instanceof Error?e.message:String(e)}function b_({on:e,...t}){return(0,W.jsx)(`button`,{type:`button`,className:`${ah(e)} ${oh}`,"aria-pressed":e,...t})}function x_(e){let[t,n]=(0,m.useState)(``);if(e.ungrouped)return null;if(e.remote){if(!e.remotePick)return null;let t=e.remoteWorktree;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(S_,{on:t!==`off`,disabled:t===`required`,title:H(t===`required`?`newSession.worktreeRemoteRequired`:t===`off`?`newSession.worktreeOff`:`newSession.worktreeOn`),onClick:e.onToggleWorktree}),t!==`off`&&(0,W.jsx)(g_,{value:e.remoteBase,onPick:e.onRemoteBase})]})}let{repos:r,bases:i,inPlace:a}=e,o=r[0]??``,s=e.probes[o]??null,c=i[o]||s?.current||``,l=Wm(s?.branches??[],t).map(e=>({key:e,text:e,checked:e===(i[o]||s?.current)})),u=r.map(t=>({path:t,name:Eu(t).base,primary:t===o,branches:e.probes[t]?.branches??[],current:e.probes[t]?.current??``,base:i[t]??``}));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(S_,{on:!a,disabled:r.length>1||e.plain,title:e.plain?H(`newSession.worktreeNoGit`):r.length>1?H(`newSession.worktreeMulti`):H(a?`newSession.worktreeOff`:`newSession.worktreeOn`),onClick:e.onToggleWorktree}),r.length>1?(0,W.jsx)(ig,{field:`branch`,title:H(`newSession.branches`),label:H(`newSession.branches`),children:()=>(0,W.jsx)(cg,{repos:u,branch:e.branchName,onBranch:e.onBranchName,onBase:e.onBase})}):!a&&s?.ok&&c&&(0,W.jsx)(ig,{field:`branch`,title:H(`newSession.branch`),label:c,children:r=>(0,W.jsx)(ag,{placeholder:H(`newSession.branchSearch`),empty:H(`newSession.branchEmpty`),rows:l,query:t,onQuery:n,onPick:t=>{e.onBase(o,t),n(``),r()}})})]})}function S_(e){return(0,W.jsxs)(b_,{on:e.on,disabled:e.disabled,title:e.title,onClick:e.onClick,children:[(0,W.jsx)(Th,{}),(0,W.jsx)(`span`,{className:rh,children:H(`newSession.worktree`)})]})}var C_=`rove.web.newSession.prompt`,w_=`rove.web.newSession.attachments`,T_=sessionStorage.getItem(C_)??``;function E_(){return T_}function D_(e){T_=e;try{sessionStorage.setItem(C_,e)}catch{}}function O_(e,t){let[n,r]=(0,m.useState)(null),i=t&&n!==null,a=i?n:e.engine?[e.engine]:[];return{ids:a,comparing:i,setComparing:e=>r(e?a:null),toggle(t){let n=Hu(a,t);r(n),n[0]&&n[0]!==e.engine&&e.setEngine(n[0])}}}function k_(e){let{picks:t,choice:n}=e,r=n.engines;if(r.length<2)return null;let i=t.ids.map(e=>r.find(t=>t.id===e)?.name??e);return(0,W.jsx)(ig,{field:`engine`,title:H(`newSession.engine`),label:Uu(i)||H(`newSession.engine`),children:i=>(0,W.jsx)(sg,{heading:H(`newSession.engine`),options:r.map(t=>{if(!e.missing)return{id:t.id,label:t.name,dim:t.ready===!1};let n=e.missing.has(t.id);return{id:t.id,label:n?H(`newSession.engineMissing`,{engine:t.name}):t.name,disabled:n}}),value:n.engine,...t.comparing?{values:t.ids}:{},onPick:e=>{if(t.comparing)return t.toggle(e);n.setEngine(e),i()},footer:e.available&&r.length>1?(0,W.jsx)(G,{className:`mx-2 mt-1 mb-0.5 self-start font-mono`,"data-field":`compare-engines`,hit:`tight`,onClick:()=>t.setComparing(!t.comparing),children:H(t.comparing?`compare.oneEngine`:`compare.severalEngines`)}):null})})}function A_(e){return(0,W.jsx)(ig,{field:`model`,title:H(`newSession.model`),label:Vu(e.models,e.model,H(`newSession.modelDefault`)),children:t=>(0,W.jsx)(sg,{heading:H(`newSession.modelHeading`),options:e.models,value:e.model,digits:!0,onPick:n=>{e.onModel(n),t()}})})}var j_=6e4,M_=/^(?:(today|tomorrow|今天|明天)\s*)?(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/i,N_=/^\+\s*(?:(\d+)\s*h)?\s*(?:(\d+)\s*m)?$/i;function P_(e,t){let n=e.trim(),r=N_.exec(n);if(r&&(r[1]||r[2])){let e=Number(r[1]??0)*60+Number(r[2]??0);return e>0?new Date(t.getTime()+e*j_):null}let i=M_.exec(n);if(!i)return null;let a=i[1]?.toLowerCase(),o=Number(i[2]),s=Number(i[3]??0),c=i[4]?.toLowerCase();if(c){if(o<1||o>12)return null;o=o%12+(c===`pm`?12:0)}if(o>23||s>59)return null;let l=new Date(t.getFullYear(),t.getMonth(),t.getDate(),o,s);if(a===`tomorrow`||a===`明天`)l.setDate(l.getDate()+1);else if(l.getTime()<=t.getTime()){if(a)return null;l.setDate(l.getDate()+1)}return l.getTime()>t.getTime()?l:null}function F_(e,t=new Date){let n=e.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});return e.toDateString()===t.toDateString()?n:`${e.toLocaleDateString([],{weekday:`short`})} ${n}`}function I_(e){let[t,n]=(0,m.useState)(``),r=()=>{let n=P_(t,new Date);if(!n)return e.onInvalid(H(`newSession.laterBad`));e.onSchedule(n)};return(0,W.jsxs)(`div`,{className:Ch,children:[(0,W.jsx)(`input`,{className:`${Nr} min-w-0 flex-1`,value:t,placeholder:H(`newSession.laterPlaceholder`),"aria-label":H(`newSession.later`),spellCheck:!1,autoComplete:`off`,autoFocus:!0,onChange:e=>n(e.target.value),onKeyDown:t=>{if(t.key===`Escape`)return t.preventDefault(),t.stopPropagation(),e.onBack();t.key!==`Enter`||t.nativeEvent.isComposing||(t.preventDefault(),t.stopPropagation(),r())}}),(0,W.jsx)(G,{variant:`filled`,disabled:!t.trim(),onClick:r,children:H(`newSession.laterConfirm`)})]})}function L_(e){let[t,n]=(0,m.useState)(`root`),r=e.agentPlace;return(0,W.jsx)(ig,{field:`more`,title:H(`newSession.more`),label:(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`⋯`}),onClose:()=>n(`root`),children:i=>t===`later`?(0,W.jsxs)(`div`,{className:uh,children:[(0,W.jsxs)(`button`,{type:`button`,className:`${fh} ${Ar} text-muted`,onClick:()=>n(`root`),children:[`‹ `,H(`newSession.later`)]}),(0,W.jsx)(I_,{onBack:()=>n(`root`),onInvalid:e.onInvalid,onSchedule:t=>{i(),e.onLater?.(t)}})]}):t===`agent`&&r?(0,W.jsx)(h_,{...r,onBack:()=>n(`root`),onPick:e=>{r.onPick(e),i()}}):(0,W.jsxs)(`div`,{role:`menu`,className:uh,children:[r&&(0,W.jsx)(R_,{label:H(`newSession.agentPlace`),dim:r.there?r.machine:H(`newSession.thisMachine`),sub:!0,disabled:e.busy,onClick:()=>n(`agent`)}),e.onLater&&(0,W.jsx)(R_,{label:H(`newSession.later`),sub:!0,disabled:e.busy,onClick:()=>n(`later`)})]})})}function R_(e){return(0,W.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${ph({cursor:!1})} [&:hover:not(:disabled)]:bg-hover`,disabled:e.disabled,onClick:e.onClick,children:[(0,W.jsx)(`span`,{className:gh,children:e.label}),(e.dim!==void 0||e.sub)&&(0,W.jsxs)(`span`,{className:`${hh} text-muted`,children:[e.dim,e.sub&&(0,W.jsx)(hs,{right:!0})]})]})}var z_=`clone:`;function B_(e){let{model:t,saved:n,picked:r,primary:i,home:a,query:o,remote:s}=e,[c,l]=(0,m.useState)(()=>X(t,`github.repos`)??null);(0,m.useEffect)(()=>{let e=!1,n=t.client.onOpen(()=>{Z(t,`github.repos`).then(t=>!e&&l(t)).catch(()=>!e&&l(e=>e??{repos:[],reason:`failed`}))});return()=>{e=!0,n()}},[t]);let u=o.trim(),d=u.toLowerCase(),f=Lu(u),p=n.filter(e=>e.toLowerCase().includes(d)||f!==null&&`/${Eu(e).base.toLowerCase()}`===f.slice(f.indexOf(`/`))),h=H(`newSession.noFolder`),g=e.ungrouped&&(!u||h.toLowerCase().includes(u.toLowerCase()))?[{key:Hd,text:h,checked:e.ungrouped.on}]:[],_=p.map((e,t)=>{let{base:n,dir:a}=Eu(e);return{key:e,text:n,dim:e===i&&r.length>1?`${H(`newSession.primary`)}, ${a}`:a,dimPath:!0,title:e,checked:r.includes(e),ruled:t===0&&g.length>0}}),v=Fu(u),y=v&&(v.includes(`:`)||p.length===0)?v:null,b=!y&&Au(u)&&!n.includes(u)&&(!s||ku(u))?Mu(ju(u,a)):``,x=(c?.repos??[]).filter(e=>e.nameWithOwner.toLowerCase().includes(f??d)).filter(e=>!pg(n,e.nameWithOwner,s!==void 0)).sort((e,t)=>Number(t.nameWithOwner.toLowerCase()===f)-Number(e.nameWithOwner.toLowerCase()===f)).map(t=>({key:z_+t.nameWithOwner,text:t.nameWithOwner,dim:t.description,title:t.description,checked:e.cloning===t.nameWithOwner})),S=f!==null&&!/^(?:ssh:|git@)/i.test(u)&&x[0]?.text.toLowerCase()===f?null:y?{key:z_+y,text:s?H(`newSession.cloneRowOn`,{source:y,machine:s.name}):H(`newSession.cloneRow`,{source:y})}:b?{key:b,text:b,checked:r.includes(b)}:null;return(0,W.jsx)(ag,{placeholder:H(s?`newSession.repoSearchRemote`:`newSession.repoSearch`),empty:s?.empty??H(`newSession.repoEmpty`),rows:s?.blocked?[]:[...g,..._],query:o,onQuery:e.onQuery,extra:s?.blocked?null:S,more:s?.blocked?[]:x,moreLabel:H(`newSession.githubGroup`),hint:s?void 0:H(`newSession.repoMultiHint`),onPick:(t,n)=>{if(t===`~scratch`)return e.ungrouped?.pick(),e.close();if(!t.startsWith(`clone:`))return e.onToggle(t,n);e.onClone(t.slice(6)),e.close()}})}var V_=`:shell`;function H_(e,t){let[n,r]=(0,m.useState)(!1),i=t&&n;return t?{on:i,choice:{...e,engines:[...e.engines,{id:V_,name:H(`newSession.shell`)}],engine:i?V_:e.engine,setEngine:t=>{r(t===V_),t!==`:shell`&&e.setEngine(t)}}}:{on:i,choice:e}}async function U_(e,t,n){let r=n.trim();if(/[\r\n]/.test(r))throw Error(H(`newSession.shellOneLine`));let i=r?{type:r}:{},a=r?Tu(r):H(`newSession.shell`);if(typeof t==`object`&&t)return(await e(`task.spawn`,{...Ju({repos:t.repos,branch:t.branch,engine:``,prompt:``,model:``}),title:a,shell:!0,...i})).taskIds[0];let{taskId:o}=t===null?await e(`task.openScratch`,{}):await e(`task.openCheckout`,{repo:t,title:a});return await e(`tab.new`,{taskId:o,kind:`shell`,own:!0,...i}),o}function W_(e,t){let n=e.scratch||e.noProject,r=n?[]:t.extraRepos??[];return{...n?{ungrouped:!0}:{repo:t.repo},...t.baseRef?{baseBranch:t.baseRef}:{},...r.length>0?{extras:r}:{},...e.machine?{machine:e.machine.id}:{},prompt:t.prompt,...t.engine?{engine:t.engine}:{},worktree:e.kind===`task`,retryOf:{id:e.id,label:e.label}}}function G_(e,t){return e?[e,...(t.extras??[]).map(e=>e.repo)]:[]}function K_(e,t){return e?{...t.baseBranch?{[e]:t.baseBranch}:{},...Object.fromEntries((t.extras??[]).flatMap(e=>e.baseRef?[[e.repo,e.baseRef]]:[]))}:{}}function q_(e){return[e.machine??``,e.repo??``,e.ungrouped?`u`:``,e.retryOf?.id??``,e.baseBranch??``,e.worktree===void 0?``:String(e.worktree)].join(`\0`)}function J_(e,t){return e.retryOf&&e.engine&&e.engine===t?e.retryOf.id:void 0}async function Y_(e,t){try{let{task:n}=await e.client.request(`task.get`,{taskId:t.id});if(!n.prompt)return void z(H(`menu.retryNoPrompt`),`error`);ie(W_(t,{...n,prompt:n.prompt}))}catch(e){z(K(e),`error`)}}function X_(e,t){let n=async n=>{await e.act(`task.archive`,{taskId:t.id,archived:!0,...n?{force:n}:{}}),z(J(`tasks`,`archive.done`,{title:t.label}))};O.set((0,W.jsx)(q,{title:H(`newSession.retryArchiveTitle`,{title:t.label}),body:H(`newSession.retryArchiveBody`),confirmLabel:J(`tasks`,`menu.archive`),onConfirm:()=>n(!1),escalate:{when:e=>e instanceof Go&&e.code===`TASK_BUSY`,label:J(`tasks`,`archive.busyConfirm`),title:J(`tasks`,`archive.busyTitle`),body:()=>J(`tasks`,`archive.busyBody`,{title:t.label}),run:()=>n(!0)}}))}var Z_=v([]),Q_=()=>y(Z_);async function $_(e){Z_.set((await e.request(`snippets.get`)).snippets)}async function ev(e,t){Z_.set((await e.request(`snippets.save`,{name:t.name,text:t.text})).snippets)}async function tv(e,t){Z_.set((await e.request(`snippets.remove`,{name:t})).snippets)}var nv=/^[A-Za-z0-9][\w-]{0,31}$/;function rv(e,t){let n=t;for(;n>0&&/[\w-]/.test(e[n-1]??``);)n--;if(n===0||e[n-1]!==`@`)return null;let r=e[n-2];if(r!==void 0&&!/\s/.test(r))return null;let i=t;for(;i<e.length&&/[\w-]/.test(e[i]??``);)i++;return{start:n-1,end:i,query:e.slice(n,t)}}function iv(e,t){let n=t.toLowerCase(),r=e.filter(e=>e.name.toLowerCase().startsWith(n));return[...r.filter(e=>e.name.toLowerCase()===n),...r.filter(e=>e.name.toLowerCase()!==n)]}function av(e,t,n){return{text:e.slice(0,t.start)+n.text+e.slice(t.end),caret:t.start+n.text.length}}var ov=e=>e.split(`
|
|
43
|
-
`,1)[0]??``;function sv(e){return(0,W.jsx)(`ul`,{className:`${Or} ${e.className}`,children:e.items.map((t,n)=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(G,{variant:`row`,tabIndex:-1,"aria-pressed":n===e.at,className:kr({cursor:n===e.at,accent:!1}),onMouseDown:t=>{t.preventDefault(),e.onPick(n)},children:[(0,W.jsxs)(`span`,{className:`text-accent`,children:[`@`,t.name]}),(0,W.jsxs)(`span`,{className:`text-muted`,children:[` `,ov(t.text)]})]})},t.name))})}function cv(e){let t=Q_(),[n,r]=(0,m.useState)(0),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(null),c=(0,m.useRef)(null),l=rv(e.value,Math.min(n,e.value.length)),u=l?iv(t,l.query):[],d=l!==null&&u.length>0&&o!==l.start,f=Math.min(i,Math.max(0,u.length-1));(0,m.useLayoutEffect)(()=>{let t=c.current,n=e.area.current;t===null||!n||(c.current=null,n.setSelectionRange(t,t),r(t))});let p=t=>{let n=u[t];if(!l||!n)return;let r=av(e.value,l,n);c.current=r.caret,a(0),e.onChange(r.text)},h=e=>{if(!d||e.nativeEvent.isComposing)return!1;if(e.key===`ArrowDown`||e.key===`ArrowUp`)a(Math.max(0,Math.min(u.length-1,f+(e.key===`ArrowDown`?1:-1))));else if(e.key===`Tab`&&!e.shiftKey||e.key===`Enter`&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey)p(f);else if(e.key===`Escape`)s(l?.start??null),e.stopPropagation();else return!1;return e.preventDefault(),!0};return{list:d?(0,W.jsx)(sv,{items:u,at:f,className:e.listClassName??``,onPick:p}):null,field:{onChange:t=>{r(t.target.selectionStart),a(0),e.onChange(t.target.value)},onSelect:e=>r(e.currentTarget.selectionStart),onKeyDown:t=>{h(t)||!e.onEnter||t.key!==`Enter`||t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e.onEnter())}}}}var lv=`relative hidden [border-top:var(--hairline)_solid_var(--line)] bg-surface px-3 pt-2.5 pb-3.5 touch:flex`,uv=`absolute inset-x-3 bottom-full z-5 mb-1`,dv=`absolute inset-x-3 bottom-full z-6 mb-1`,fv=`flex min-w-0 flex-1 items-center gap-2.5`,pv=`flex h-11 min-w-0 flex-1 items-center rounded-[12px] border-hairline border-line bg-inset focus-within:border-focus has-[textarea:disabled]:opacity-60`,mv=`h-full min-w-0 flex-1 resize-none bg-transparent py-0 pr-3.5 pl-3.5 font-sans text-display leading-[42px] text-ink outline-none [border:0] has-[+button]:pr-0`,hv=`transition-transform duration-100 active:scale-94 motion-reduce:transition-none motion-reduce:active:scale-none`,gv=`transition-[scale,background-color,border-color,color] duration-150 active:scale-[0.98] motion-reduce:transition-none motion-reduce:active:scale-none`,_v=`flex size-11 shrink-0 items-center justify-center rounded-[12px] border-hairline border-accent text-accent touch-manipulation disabled:border-line disabled:text-muted disabled:opacity-60 ${hv}`,vv=`flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-[10px] touch-manipulation active:bg-inset disabled:opacity-60 has-[:disabled]:opacity-60 ${hv}`,yv=`size-4.5 flex-none fill-none stroke-current stroke-[1.5] [stroke-linecap:round] [stroke-linejoin:round]`,bv=(e=!1)=>`${vv} -mr-1.5 -ml-3.25 ${e?`text-accent`:`text-muted`}`,xv=e=>`${vv} ${e?`text-accent`:`text-muted`}`,Sv=(e,t)=>`relative z-6 flex h-11 min-w-0 flex-1 items-center gap-2.5 rounded-[12px] border-hairline px-3.5 font-sans touch-manipulation disabled:text-muted ${gv} ${t?`border-accent bg-accent text-paper`:e?`border-accent bg-accent-soft text-accent`:`border-line bg-inset text-ink`}`;function Cv({d:e}){return(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,className:yv,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:e})})}var wv=`M8 1.5a2.5 2.5 0 0 1 2.5 2.5v4.5a2.5 2.5 0 0 1-5 0V4A2.5 2.5 0 0 1 8 1.5zM3 8a5 5 0 0 0 10 0M8 13v1.5`,Tv=`M8 13V3M3.5 7.5 8 3l4.5 4.5`;function Ev(){return(0,W.jsx)(Cv,{d:`M10.5 4.5 5.8 9.2a1.4 1.4 0 0 0 2 2l5-5a2.8 2.8 0 0 0-4-4l-5.2 5.2a4.2 4.2 0 0 0 6 6L13 9`})}function Dv(e){return(0,W.jsxs)(`button`,{type:`submit`,className:_v,title:e.label,disabled:e.disabled,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:e.label}),(0,W.jsx)(Cv,{d:Tv})]})}function Ov(e,t){let n=(0,m.useRef)(e);e!==null&&(n.current=e);let r=e===null,[i,a]=(0,m.useState)(r);return(0,m.useEffect)(()=>{if(!r)return a(!1);let e=window.setTimeout(()=>a(!0),t);return()=>window.clearTimeout(e)},[r,t]),{shown:e??(i?null:n.current),leaving:r&&!i}}function kv(e){return typeof Intl.Segmenter==`function`?[...new Intl.Segmenter(void 0,{granularity:`word`}).segment(e)].map(e=>e.segment):e.split(/(\s+)/)}function Av({level:e,seconds:t,wide:n}){let r=n?120:80,i=(0,m.useRef)([]),a=(0,m.useRef)(-1);t!==a.current&&(a.current=t,i.current=[...i.current,e].slice(-r));let o=[...Array(r-i.current.length).fill(0),...i.current];return(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center justify-end overflow-hidden ${n?`h-10 gap-[3px]`:`h-5.5 gap-[2.5px]`}`,"aria-hidden":`true`,children:o.map((e,t)=>(0,W.jsx)(`i`,{className:`block h-full flex-none rounded-full bg-current transition-transform duration-100 ease-linear motion-reduce:transition-none ${n?`w-[3px]`:`w-[2.5px]`}`,style:{transform:`scaleY(${Math.max(n?.08:.12,Math.min(1,e*10))})`}},t))})}function jv(){return(0,W.jsx)(`span`,{className:`inline-flex items-center gap-[3px] align-middle`,"aria-hidden":`true`,children:[0,160,320].map(e=>(0,W.jsx)(`i`,{className:`block size-1 rounded-full bg-current motion-safe:animate-dot`,style:{animationDelay:`${e}ms`}},e))})}var Mv=`pointer-events-none absolute inset-x-0 bottom-full z-6 mb-2.5 flex min-h-17 origin-bottom items-center rounded-[16px] border-hairline bg-surface px-4 py-3 text-left shadow-dialog transition-colors duration-150`;function Nv({bubble:e,leaving:t}){return(0,W.jsx)(`span`,{className:`${Mv} ${t?`motion-safe:animate-sink-out`:`motion-safe:animate-bubble-in`} ${e.armed?`border-accent`:`border-line`}`,children:e.text?(0,W.jsx)(`span`,{className:`flex max-h-[5.8em] min-w-0 flex-1 flex-col justify-end overflow-hidden font-sans text-display leading-[1.45] transition-colors duration-150 motion-safe:animate-fade-in ${e.waiting?`text-muted`:`text-ink`}`,children:(0,W.jsx)(`span`,{children:kv(e.text).map((e,t)=>(0,W.jsx)(`span`,{className:`motion-safe:animate-fade-in`,children:e},t))})},`words`):(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 text-accent`,children:(0,W.jsx)(Av,{level:e.level,seconds:e.seconds,wide:!0})},`wave`)})}var Pv=`flex min-w-0 flex-1 items-center gap-2.5 motion-safe:animate-fade-in`;function Fv(e){let{state:t}=e,n=t.phase===`recording`,r=t.phase===`transcribing`,i=e.slide!==void 0,a=n&&t.held,o=(0,m.useRef)(``);n&&(o.current=t.partial);let{shown:s,leaving:c}=Ov(i&&(a||(n||r)&&o.current!==``)?{text:o.current,armed:a&&t.armed,waiting:!a,level:t.level,seconds:t.seconds}:null,140),l=s&&(0,W.jsx)(Nv,{bubble:s,leaving:c}),u=(0,W.jsxs)(`span`,{className:`${Pv} justify-center gap-2 text-body`,children:[e.working.replace(/…$/,``),(0,W.jsx)(jv,{})]},`working`);return r||n&&i&&!a?(0,W.jsxs)(W.Fragment,{children:[l,u]}):n?(0,W.jsxs)(W.Fragment,{children:[l,(0,W.jsxs)(`span`,{className:Pv,children:[(0,W.jsx)(`span`,{className:`size-2 flex-none rounded-full bg-current`,style:{opacity:.3+Math.min(1,t.level*10)*.7}}),(0,W.jsx)(`span`,{className:`flex-none font-mono text-body normal-nums`,children:t.time}),i?(0,W.jsxs)(`span`,{className:`ml-auto flex flex-none items-center gap-1 text-body motion-safe:animate-fade-in ${t.armed?`font-semibold`:`opacity-80`}`,children:[(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,className:`size-4 flex-none fill-none stroke-current stroke-[1.5]`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:Tv})}),t.armed?e.release:e.slide]},String(t.armed)):t.partial?(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 justify-end overflow-hidden whitespace-nowrap text-meta`,children:t.partial}):(0,W.jsx)(Av,{level:t.level,seconds:t.seconds})]},`take`)]}):(0,W.jsxs)(W.Fragment,{children:[l,(0,W.jsxs)(`span`,{className:`${Pv} justify-center gap-2 text-display`,children:[(0,W.jsx)(`span`,{className:`flex text-muted`,children:(0,W.jsx)(Cv,{d:wv})}),e.idle]},`idle`)]})}function Iv({state:e}){return e.phase===`recording`?(0,W.jsx)(`span`,{className:`font-mono text-meta normal-nums`,children:e.time}):e.phase===`transcribing`?(0,W.jsx)(`span`,{className:`font-mono text-meta`,children:`…`}):(0,W.jsx)(Cv,{d:wv})}function Lv(e){return e.hold?(0,W.jsx)(Fv,{state:e.state,idle:e.idle,working:e.working}):(0,W.jsx)(Iv,{state:e.state})}function Rv(e){return(0,W.jsxs)(`form`,{className:lv,"data-composer":e.composerKey,onSubmit:t=>{t.preventDefault(),e.onSend()},children:[e.attached&&(0,W.jsx)(`div`,{className:uv,children:e.attached}),e.suggest&&(0,W.jsx)(`div`,{className:dv,children:e.suggest}),(0,W.jsxs)(`div`,{className:fv,children:[e.attach,e.voice??(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:pv,children:[(0,W.jsx)(`textarea`,{ref:e.fieldRef,className:mv,rows:1,value:e.value,placeholder:e.placeholder,disabled:e.busy,enterKeyHint:`send`,onChange:e.onChange,onSelect:e.onSelect,onKeyDown:e.onKeyDown,onPaste:e.onPaste,onBlur:e.onBlur}),e.dictate]}),(0,W.jsx)(Dv,{label:e.sendLabel,disabled:e.busy||!e.ready})]})]})]})}var zv=`/dictation-worklet.js`,Bv=60,Vv=16e3,Hv=.004,Uv={phase:`idle`,seconds:0,level:0,error:null,partial:``},Wv=1e3,Gv=class{step;emitted=0;consumed=0;constructor(e){this.step=e}push(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;let i=this.consumed+t,a=[];for(let e=Math.floor(this.emitted*this.step);e<i;e=Math.floor(this.emitted*this.step)){let t=Math.max(-1,Math.min(1,n[e-this.consumed]??0));a.push(Math.round(t*32767)),this.emitted++}return this.consumed=i,Int16Array.from(a)}};function Kv(e){let t=new Uint8Array(e.length*2),n=new DataView(t.buffer);for(let t=0;t<e.length;t++)n.setInt16(t*2,e[t],!0);return t}function qv(e,t){let n=new Gv(t/Vv).push(e),r=Math.max(1,n.length),i=new Uint8Array(44+r*2),a=new DataView(i.buffer),o=(e,t)=>{for(let n=0;n<t.length;n++)a.setUint8(e+n,t.charCodeAt(n))};return o(0,`RIFF`),a.setUint32(4,36+r*2,!0),o(8,`WAVEfmt `),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,Vv,!0),a.setUint32(28,Vv*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),o(36,`data`),a.setUint32(40,r*2,!0),i.set(Kv(n),44),i}function Jv(e){for(let t of e.getTracks())t.stop();return null}function Yv(e){let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].toString(16).padStart(2,`0`);return t.join(``)}var Xv=class{client;scope;view=v(Uv);stream=null;context=null;node=null;chunks=[];timer=null;capTimer=null;peak=0;recent=0;session=0;live=null;liveTimer=null;constructor(e,t){this.client=e,this.scope=t}get recording(){return this.view.get().phase===`recording`}async toggle(){return this.recording?this.stop():this.start()}async start(e=!1){if(this.view.get().phase!==`idle`&&this.view.get().phase!==`error`)return null;let t=++this.session;this.live=null,this.view.set({...Uv,phase:`recording`});try{let n=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}});if(t!==this.session)return Jv(n);this.stream=n;let r=new AudioContext;if(this.context=r,await r.audioWorklet.addModule(zv),t!==this.session)return null;let i=r.createMediaStreamSource(n);this.node=new AudioWorkletNode(r,`rove-capture`),this.chunks=[],this.peak=0,this.recent=0,this.node.port.onmessage=e=>{let t=e.data;this.chunks.push(t);let n=0;for(let e=0;e<t.length;e++)n+=t[e]*t[e];let r=Math.sqrt(n/Math.max(1,t.length));this.peak=Math.max(this.peak,r),this.recent=Math.max(this.recent,r)},i.connect(this.node);let a=r.createGain();a.gain.value=0,this.node.connect(a),a.connect(r.destination);let o=Date.now();return this.timer=window.setInterval(()=>{this.view.set({...this.view.get(),seconds:(Date.now()-o)/1e3,level:this.recent}),this.recent=0},100),this.capTimer=window.setTimeout(()=>void this.stop(),Bv*1e3),e&&(this.live={id:`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`,resample:new Gv(r.sampleRate/Vv),sent:0,seq:0,inFlight:null,dead:!1},this.liveTimer=window.setInterval(()=>void this.pump(!1),Wv)),null}catch(e){return t===this.session?(this.release(),this.fail(e),null):null}}async pump(e){let t=this.live;if(!t||t.dead||t.inFlight&&!e||(t.inFlight&&await t.inFlight.catch(()=>{}),t.dead))return null;let n=this.chunks.slice(t.sent);t.sent+=n.length;let r=t.seq++,i=r===0?this.scope():null,a=this.client.request(`voice.stream`,{session:t.id,seq:r,pcm:Yv(Kv(t.resample.push(n))),final:e,...i?{context:i.draft,taskId:i.taskId,tabId:i.tabId}:{}});t.inFlight=a;try{let n=await a;if(e)return n;let r=this.view.get();this.live===t&&r.phase===`recording`&&typeof n.partial==`string`&&this.view.set({...r,partial:n.partial})}catch{t.dead=!0}finally{t.inFlight===a&&(t.inFlight=null)}return null}async stop(){if(this.view.get().phase!==`recording`)return null;let e=this.context?.sampleRate??Vv,t=this.chunks;this.view.set({...this.view.get(),phase:`transcribing`,level:0}),this.release();let n=qv(t,e),r=(n.length-44)/2/Vv;if(r<.3||this.peak<Hv)return this.live=null,this.view.set(Uv),{text:``,seconds:r,ms:0,reason:`silent`};try{let e=this.live?await this.pump(!0):null;this.live=null;let t=e??await this.transcribeWhole(n);return this.view.set(Uv),t}catch(e){return this.live=null,this.fail(e),null}}transcribeWhole(e){let t=this.scope();return this.client.request(`voice.transcribe`,{wav:Yv(e),context:t.draft,taskId:t.taskId,tabId:t.tabId})}fail(e){this.view.set({...Uv,phase:`error`,error:e instanceof Error?e.message:String(e)})}cancel(){this.view.get().phase===`recording`&&(this.release(),this.live=null,this.view.set(Uv))}release(){this.session++,this.timer!==null&&window.clearInterval(this.timer),this.capTimer!==null&&window.clearTimeout(this.capTimer),this.liveTimer!==null&&window.clearInterval(this.liveTimer),this.timer=null,this.capTimer=null,this.liveTimer=null,this.node?.port.close(),this.node=null;for(let e of this.stream?.getTracks()??[])e.stop();this.stream=null,this.context?.close().catch(()=>{}),this.context=null}},Zv=e=>`0:${String(Math.floor(e)).padStart(2,`0`)}`,Qv=300,$v=48,ey=()=>navigator.vibrate?.(8),ty=new WeakMap,ny=new WeakSet;function ry(e){let t=ty.get(e);return t||(t=v(null),ty.set(e,t)),t}function iy(e,t){ry(e).set(t)}var ay=e=>e.available??(e.ready===!0||(e.model??null)!==null);function oy(e){let t=ry(e),n=y(t);return(0,m.useEffect)(()=>{ny.has(e)||(ny.add(e),e.onOpen(()=>{e.request(`voice.status`).then(e=>t.set(ay(e)),()=>t.set(!1))}))},[e,t]),n}var sy=e=>xu()&&ry(e).get()!==!1;function cy(e){U();let t=(0,m.useRef)(e);t.current=e;let n=(0,m.useRef)(null);n.current===null&&(n.current=new Xv(e.client,()=>t.current.context()));let r=y(n.current.view),i=oy(e.client),a=(0,m.useRef)(null),o=(0,m.useRef)(!1),[s,c]=(0,m.useState)(null);(0,m.useEffect)(()=>()=>{a.current&&window.clearTimeout(a.current.timer),n.current?.cancel()},[]);let l=(e,n)=>{if(!e?.text)return;let{onSend:r,onText:i}=t.current;n&&r?r(e.text):i(e.text)},u=()=>void n.current?.toggle().then(e=>l(e,!1)),d=e=>{if(e.button!==0)return;e.currentTarget.setPointerCapture(e.pointerId);let t={y:e.clientY,timer:0,held:!1,armed:!1,started:null};(r.phase===`idle`||r.phase===`error`)&&(t.timer=window.setTimeout(()=>{t.held=!0,t.started=n.current?.start(!0)??null,c({armed:!1}),ey()},Qv)),a.current=t},f=e=>{let n=a.current;if(!n?.held||!t.current.onSend)return;let r=n.y-e.clientY>$v;r!==n.armed&&(n.armed=r,c({armed:r}),ey())},p=async()=>{let e=a.current;if(a.current=null,e){if(window.clearTimeout(e.timer),o.current=e.held,!e.held)return t.current.onTap?void 0:u();c(null),await e.started,l(await n.current?.stop()??null,e.armed)}},h=async()=>{let e=a.current;a.current=null,e&&(window.clearTimeout(e.timer),e.held&&(c(null),await e.started,n.current?.cancel()))},g=r.phase===`recording`?H(s?`voice.release`:`voice.stop`,{time:Zv(r.seconds)}):r.phase===`transcribing`?H(`voice.working`):e.idle??H(`voice.say`),_=r.phase===`recording`,v=s?.armed??!1;return i===!0?(0,W.jsx)(`button`,{type:`button`,className:`${(e.look??sh)(_,v)} ${ch}`,disabled:e.disabled||r.phase===`transcribing`,title:r.error??H(`voice.hint`),"aria-label":e.face?g:void 0,onPointerDown:d,onPointerMove:f,onPointerUp:()=>void p(),onPointerCancel:()=>void h(),onContextMenu:e=>e.preventDefault(),onClick:t=>{let n=o.current;if(o.current=!1,e.onTap)return n?void 0:e.onTap();t.detail===0&&u()},children:e.face?e.face({phase:r.phase,time:Zv(r.seconds),seconds:r.seconds,level:r.level,held:s!==null,armed:v,partial:r.partial}):(0,W.jsxs)(W.Fragment,{children:[g,_&&(0,W.jsx)(`span`,{className:`inline-flex items-center`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`,style:{opacity:.25+Math.min(1,r.level*12)*.75}})})]})}):null}function ly(e,t){re(e,void 0,t)}function uy(){re(void 0,void 0,void 0,void 0,!0)}var dy=`rove.web.newSession.worktree`;function fy({model:e,seed:t}){let n=t.repo;U();let r=y(e.selection).taskId,i=e.tasks.get()?.tasks.find(e=>e.id===r)?.repo,a=cd(e,n??i,t.engine),o=X(e,`repos.list`)?.repos,s=e=>t.ungrouped?void 0:(t.machine?void 0:n)??i??e?.[0],[c,l]=(0,m.useState)(o??[]),[u,d]=(0,m.useState)(()=>X(e,`fs.subdirs`,{path:`~/`})?.home??``),[f,p]=(0,m.useState)(()=>G_(s(o),t)),[h,g]=(0,m.useState)(()=>Object.fromEntries(f.flatMap(t=>{let n=X(e,`repo.probe`,{path:t});return n?[[t,n]]:[]}))),_=(0,m.useRef)(new Set),[v,b]=(0,m.useState)(t.ungrouped===!0),[x,S]=(0,m.useState)(null),C=()=>{b(!0),p([]),S(null)},[w,T]=(0,m.useState)(()=>K_(s(o),t)),[E,D]=(0,m.useState)(``),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(()=>(t.prompt!==void 0&&D_(t.prompt),E_())),M=e=>{D_(e),j(e)},[N,ee]=(0,m.useState)(``),[P,F]=(0,m.useState)(!1),[I,te]=(0,m.useState)(``),[ne,re]=(0,m.useState)(()=>t.worktree??localStorage.getItem(dy)!==`0`),ie=e=>{localStorage.setItem(dy,e?`1`:`0`),re(e)},[ae,R]=(0,m.useState)(null),oe=(0,m.useRef)(()=>{}),{attachments:se,attach:ce,remove:le,ready:B,clear:ue}=vu(e,R,w_),de=(0,m.useRef)(null),fe=oy(e.client),pe=xu()&&fe===!0,me=e=>{let t=de.current,n=t?.selectionStart??A.length,r=t?.selectionEnd??A.length,i=n>0&&!/\s$/.test(A.slice(0,n))?` `:``;M(`${A.slice(0,n)}${i}${e}${A.slice(r)}`);let a=n+i.length+e.length;requestAnimationFrame(()=>{pe||t?.focus(),t?.setSelectionRange(a,a)})},he=u_(e,{machine:t.machine,repo:n},a),{machines:ge,machine:_e,remote:V,machineName:ye,remoteList:be,engineThere:xe,shown:Se}=he,{pick:Ce,setPick:we,base:Te,setBase:Ee}=he,De=H_(Se,!V),Oe=V||De.on?null:uu(e=>void ce(e)),ke=Se.engine;(0,m.useEffect)(()=>e.client.onOpen(()=>{Promise.all([Z(e,`repos.list`),Z(e,`fs.subdirs`,{path:`~/`})]).then(([e,n])=>{l(e.repos),d(n.home);let r=s(e.repos);p(e=>e.length>0||!r?e:G_(r,t)),T(e=>({...e,...K_(r,t)}))}).catch(()=>{})}),[e,n]);let Ae=f.some(e=>h[e]?.git===!1),je=!V&&(!ne||Ae)&&f.length===1,Me=V&&!xe?dg(Ce,be.repos):null,Ne=Me!==null&&!ne,Pe=f[0]??``;(0,m.useEffect)(()=>{for(let t of f)_.current.has(t)||(_.current.add(t),Z(e,`repo.probe`,{path:t}).then(e=>g(n=>({...n,[t]:e}))).catch(()=>{}))},[e,f]),(0,m.useEffect)(()=>{sy(e.client)||de.current?.focus()},[e.client]);let Fe=!V&&!v&&!je&&!De.on,Ie=O_(De.choice,Fe),Le=Ie.comparing?Se:De.choice,Re=a.engines.find(e=>e.id===ke),ze=Se.engines.find(e=>e.id===ke)?.name??ke,Be=Bu(Re,H(`newSession.modelDefault`)),Ve=Be.some(e=>e.id===N)?N:``,He=async t=>{te(H(`newSession.cloning`,{source:t}));let n=await e.client.request(`repo.clone`,{url:t},te);return l(e=>e.includes(n.path)?e:[...e,n.path]),p([n.path]),S(null),n.path},Ue=async()=>{if(!Ce)return R(H(`newSession.needRepo`));if(!A.trim())return R(H(`newSession.needPrompt`));let n=Se.missing?.has(ke)&&ze;if(n)return R(H(`newSession.engineMissingOn`,{engine:n,machine:ye}));F(!0),te(Ce.clone?H(`newSession.cloningOn`,{source:lg(Ce.ref),machine:ye}):H(`newSession.startingOn`,{machine:ye}));try{let n=await __(e,{pick:Ce,machine:_e,engine:ke,prompt:A.trim(),baseRef:Te,...Ne?{checkout:Me}:{},engineThere:xe,model:Ve});D_(``),L.set(null),n&&e.selectWhenListed(n),t.retryOf&&n&&X_(e,t.retryOf)}catch(e){R(y_(e))}finally{F(!1),te(``)}},We=async n=>{if(oe.current=()=>void We(n),R(null),V)return Ue();if(!Pe&&!v&&!x)return R(H(`newSession.needRepo`));if(!A.trim()&&!De.on)return R(H(`newSession.needPrompt`));F(!0);let r=pu(A.trim(),await B());try{let i=x?[await He(x)]:f,a=await Promise.all(i.map(t=>e.client.request(`repo.probe`,{path:t}))),o=a.find(e=>!e.ok);if(o)throw Error(o.reason??o.repo);let s=a.some(e=>e.git===!1);if(s&&a.length>1)throw Error(H(`newSession.plainMulti`));let c,l,u=e.client.request.bind(e.client),d=i.map((e,t)=>({repo:a[t]?.repo??e,baseRef:w[e]??``})),p=i.length===1&&!ne||s?d[0]?.repo??``:null;if(De.on)c=await U_(u,v?null:p??{repos:d,branch:E.trim()},A);else if(v)c=await Yu(u,ke,r,Ve);else if(p!==null)c=await Xu(u,p,ke,A,r,n,Ve);else{let a=J_(t,ke),o=he.auto&&!n&&i.length===1&&Ie.ids.length<=1&&se.length===0&&!a,s=await e.client.request(`task.spawn`,{...Ju({repos:d,branch:E.trim(),engine:ke,commandFrom:a,engines:n?[]:Ie.ids,prompt:r,...n?{at:n}:{},model:Ve}),...o?{machine:n_}:{}});s.machine&&z(H(`newSession.startedOn`,{machine:s.machine})),c=s.taskIds[0],l=s.groupId}n&&z(H(`newSession.laterSet`,{time:F_(n)})),D_(``),ue(),L.set(null),l?ve(l):c&&e.selectWhenListed(c),t.retryOf&&c&&X_(e,t.retryOf)}catch(e){let t=Wu(e);t?(D_(``),ue(),L.set(null),z(e instanceof Error?e.message:String(e),`error`),ve(t)):R(y_(e))}finally{F(!1),te(``)}},Ge=cv({value:A,onChange:M,area:de,onEnter:()=>void We()}),Ke=e=>{he.switchTo(e,Pe),k(``),R(null),b(!1)};return(0,W.jsxs)(`div`,{className:Gm,children:[(0,W.jsxs)(`div`,{className:Km,children:[(0,W.jsx)(Hm,{scene:t.sky??`orbit`}),(0,W.jsx)(`h1`,{className:`m-0 font-sans text-title font-semibold text-accent`,children:H(`newSession.title`)}),(0,W.jsx)(`p`,{className:`m-0 text-muted narrow:hidden`,children:H(`newSession.tagline`)})]}),(0,W.jsxs)(`form`,{className:qm,onSubmit:e=>{e.preventDefault(),We()},children:[(0,W.jsxs)(`div`,{className:Ym,...Oe?.drop,children:[!V&&(0,W.jsx)(yu,{attachments:se,onRemove:le}),(0,W.jsx)(`textarea`,{ref:de,className:Zm,rows:4,spellCheck:!1,placeholder:H(De.on?`newSession.shellPlaceholder`:`newSession.placeholder`),value:A,disabled:P,onPaste:Oe?.onPaste,...Ge.field}),Ge.list,(0,W.jsxs)(`div`,{className:Xm,children:[Oe&&(0,W.jsxs)(du,{className:(pe?bv:th)(se.length>0),title:H(`newSession.attachHint`),disabled:P,onFiles:ce,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:H(`newSession.attach`)}),(0,W.jsx)(Ev,{})]}),(0,W.jsx)(cy,{client:e.client,context:()=>({draft:[A.slice(-300),Pe,E,Ce?.ref??``].filter(Boolean).join(`
|
|
44
|
-
`)}),onText:me,disabled:P,look:pe?Sv:th,idle:pe?H(`voice.hold`):void 0,face:e=>(0,W.jsx)(Lv,{state:e,hold:pe,idle:H(`voice.hold`),working:H(`voice.working`)})}),!pe&&(0,W.jsx)(`span`,{className:`flex-1`}),pe&&(0,W.jsx)(Dv,{label:H(`newSession.start`),disabled:P}),!pe&&(0,W.jsx)(`button`,{type:`submit`,className:xr(),disabled:P,children:H(`newSession.start`)})]})]}),(0,W.jsxs)(`div`,{className:Qm,children:[(0,W.jsxs)(`div`,{className:$m,children:[ge.length>0&&(0,W.jsx)(m_,{machines:ge,value:he.auto?`auto`:_e,onPick:Ke}),(0,W.jsx)(ig,{field:`repo`,yields:!0,title:!V&&f.length>1?H(`newSession.repoCount`,{count:f.length}):H(`newSession.repo`),label:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(wh,{}),(0,W.jsx)(`span`,{className:_h,children:(V?Ce?.clone?lg(Ce.ref):Gu(Ce?[Ce.ref]:[]):x?lg(x):Gu(f))||H(v?`newSession.noFolder`:`newSession.repo`)})]}),children:t=>(0,W.jsx)(B_,{model:e,saved:V?be.repos.map(ug):c,picked:V?Ce?[Ce.ref]:[]:f,primary:V?``:Pe,home:V?``:u,query:O,onQuery:k,onToggle:(e,n)=>{if(R(null),!V)return b(!1),S(null),n?p(t=>Ku(t,e)):(p([e]),t());we({ref:e,clone:!1}),t()},onClone:e=>{if(R(null),V)return we({ref:e,clone:!0});S(e),p([]),b(!1),k(``)},cloning:V?void 0:x??void 0,close:t,remote:V?{name:ye,empty:f_(_e,be),blocked:be.problem!==``}:void 0,ungrouped:V?void 0:{on:v,pick:C}})}),(0,W.jsx)(x_,{remote:V,remotePick:Ce,remoteBase:Te,onRemoteBase:Ee,remoteWorktree:Me===null?`required`:Ne?`off`:`on`,ungrouped:v,inPlace:je,plain:Ae,onToggleWorktree:()=>ie(!ne),repos:f,probes:h,bases:w,onBase:(e,t)=>T(n=>({...n,[e]:t})),branchName:E,onBranchName:D})]}),(0,W.jsxs)(`div`,{className:eh,children:[(0,W.jsx)(k_,{choice:Le,picks:Ie,available:Fe,missing:Se.missing}),!(V&&xe)&&!Ie.comparing&&!De.on&&Be.length>0&&(0,W.jsx)(A_,{models:Be,model:Ve,onModel:ee}),(0,W.jsx)(L_,{busy:P,onLater:!V&&!v&&!Ie.comparing&&!De.on?e=>void We(e):void 0,onInvalid:R,agentPlace:V?{machine:ye,there:xe,onPick:he.setEngineThere}:void 0})]})]}),(0,W.jsx)(v_,{progress:P?I:``,error:ae,busy:P,onRetry:()=>oe.current()})]})]})}var py=[`needs`,`working`,`ready`,`idle`],my=`~state:`;function hy(e){switch(e.rowStatus?.kind){case`attention`:case`needs-input`:case`unseen`:return`needs`;case`busy`:case`running`:return`working`}switch(e.group){case`waiting-on-you`:return`needs`;case`working`:return`working`;case`landing`:case`ready-for-review`:return`ready`}return e.pr?.lifecycle===`open`||e.status===`done`?`ready`:`idle`}var gy=e=>e&&!Ud(e)?Cd(e.repo):void 0;function _y(e,t){let n=Wd(e,t.sort),{children:r,nested:i}=Yd([{repo:``,label:``,tasks:n}]),a=n.filter(e=>!i.has(e.id)),o=Ad(a),s=e=>{let t=[],n=new Set,i=e=>{if(!n.has(e.id)){n.add(e.id),t.push(e);for(let t of r.get(e.id)??[])i(t)}};return i(e),t},c=new Map;for(let e of a){let t=kd(e),n=((t===null?void 0:o.get(t))??[e]).map(s),r=n.flat().map(hy).reduce((e,t)=>py.indexOf(t)<py.indexOf(e)?t:e);for(let e of n)for(let t of e)c.set(t.id,r)}return py.flatMap(e=>{let t=n.filter(t=>c.get(t.id)===e);return t.length===0?[]:[{repo:``,label:H(`rail.state.${e}`),key:`${my}${e}`,tasks:t}]})}function vy(e){let t=new Set(e.machines.map(e=>e.alias));return{rows:yy(Qd(_y([...e.tasks.filter(e=>!e.routine),...e.remote.filter(e=>!e.routine&&e.machine!==void 0&&t.has(e.machine.id))],e),e.query,e.fold).map(e=>{if(e.kind!==`project`)return e;let t=e.id.slice(`project:${my}`.length);return{id:`state:${t}`,kind:`state`,state:t,label:e.label,count:0}})),groups:[]}}function yy(e){let t=new Map,n=``;for(let r of e)r.kind===`state`?n=r.id:r.kind===`task`&&t.set(n,(t.get(n)??0)+1);return e.map(e=>e.kind===`state`?{...e,count:t.get(e.id)??0}:e)}var by=new Set([`refused`,`timeout`,`host-key-changed`,`host-key-unverified`,`auth-denied`,`unresolved`,`ssh-failed`,`no-rove`,`no-daemon`,`bad-status`,`handshake`,`no-forwarding`,`lost`]);function xy(e){return e&&by.has(e)?`machines.reason.${e}`:null}function Sy(e,t){return e.filter(e=>e.machine?.id===t&&!e.routine&&!e.deleting)}function Cy(e){let t=py.map(e=>({state:e,tasks:[]}));for(let n of e)t[py.indexOf(hy(n))]?.tasks.push(n);return t.filter(e=>e.tasks.length>0)}var wy=`flex flex-col font-mono text-meta`,Ty=`flex flex-col gap-1 border-t-hairline border-line py-2.5 first:border-t-0 first:pt-0`,Ey=`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,Dy=`min-w-0 text-ink wrap-anywhere`,Oy=`m-0 text-muted wrap-anywhere`,ky=`flex flex-wrap gap-x-3.5 gap-y-1 pt-0.5 whitespace-nowrap`,Ay=`mt-1.5 mb-0.5 text-subtle`,jy=`flex min-w-0 items-baseline gap-2 pl-2`,My=`min-w-0 flex-1 truncate text-left`,Ny=`min-w-0 max-w-[55%] flex-none truncate text-muted`;function Py(e){O.set((0,W.jsx)(Ry,{model:e}))}function Fy({model:e,tasks:t}){let n=t=>{B(),e.select(t.id),ge()};return Cy(t).map(e=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`${Ay} m-0`,children:H(`rail.state.${e.state}`)}),e.tasks.map(e=>(0,W.jsxs)(G,{variant:`row`,className:`${jy} w-full rounded-sm py-0.5 hover:bg-hover`,onClick:()=>n(e),children:[(0,W.jsx)(`span`,{className:My,children:e.label}),(0,W.jsx)(`span`,{className:Ny,children:e.branch})]},e.id))]},e.state))}function Iy({model:e,alias:t}){let[n,r]=(0,m.useState)(null);return(0,m.useEffect)(()=>{let n=!0;return Z(e,`machines.repos`,{machine:t}).then(e=>n&&r(e),e=>n&&r({failed:e instanceof Error?e.message:String(e)})),()=>{n=!1}},[e,t]),n?`failed`in n?(0,W.jsx)(`p`,{className:Oy,children:H(`machines.reposFailed`,{message:n.failed})}):n.reason?(0,W.jsx)(`p`,{className:Oy,children:H(`machines.reposFailed`,{message:n.message??n.reason})}):n.repos.length===0?(0,W.jsx)(`p`,{className:Oy,children:H(`machines.noRepos`)}):n.repos.map(e=>(0,W.jsxs)(`div`,{className:jy,children:[(0,W.jsx)(`span`,{className:My,children:e.id}),(0,W.jsx)(`span`,{className:Ny,title:e.primary??e.checkouts[0],children:e.primary??e.checkouts[0]??``})]},e.id)):(0,W.jsx)(`p`,{className:Oy,children:H(`machines.loading`)})}function Ly(e){let{model:t,row:n,tasks:r,words:i}=e,[a,o]=(0,m.useState)(null),s=n.state===`online`,c=xy(n.reason),l=Cy(r).map(e=>`${e.tasks.length} ${H(`rail.state.${e.state}`)}`),u=e=>o(a===e?null:e),[d,f]=(0,m.useState)({busy:!1});return(0,W.jsxs)(`section`,{className:Ty,children:[(0,W.jsxs)(`div`,{className:Ey,children:[(0,W.jsx)(`span`,{className:`${Dy} ${s?``:Sp.warning}`,children:Zh(n,i)}),(0,W.jsx)(`span`,{className:`text-muted`,children:l.length>0?l.join(` · `):H(`machines.noTasks`)})]}),c&&(0,W.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:H(c)}),(d.busy||d.note)&&(0,W.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:d.busy?H(`machines.updating`):d.note}),(0,W.jsxs)(`div`,{className:ky,children:[n.behind&&(0,W.jsx)(G,{hit:`tight`,disabled:d.busy,onClick:()=>{f({busy:!0}),t.client.request(`machines.update`,{machine:n.alias}).then(e=>f({busy:!1,note:e.ok?H(e.result.changed?`machines.updated`:`machines.upToDate`,{from:e.result.from??`?`,to:e.result.to??`?`}):H(`machines.updateFailed`,{message:e.message})}),e=>f({busy:!1,note:H(`machines.updateFailed`,{message:e instanceof Error?e.message:String(e)})}))},children:H(`machines.update`)}),s&&(0,W.jsx)(G,{hit:`tight`,onClick:()=>{B(),ly(void 0,n.alias)},children:H(`machines.newHere`)}),r.length>0&&(0,W.jsx)(G,{hit:`tight`,"aria-expanded":a===`tasks`,onClick:()=>u(`tasks`),children:H(a===`tasks`?`machines.hide`:`machines.tasks`)}),s&&(0,W.jsx)(G,{hit:`tight`,"aria-expanded":a===`repos`,onClick:()=>u(`repos`),children:H(a===`repos`?`machines.hide`:`machines.repos`)})]}),a===`tasks`&&(0,W.jsx)(Fy,{model:t,tasks:r}),a===`repos`&&(0,W.jsx)(Iy,{model:t,alias:n.alias})]})}function Ry({model:e}){let t=U(),n=rg(e),r=y(e.remote),i=(t===`zh`?Ji:qi).machine;return(0,W.jsx)(Ci,{title:H(`machines.title`),wide:!0,children:(0,W.jsxs)(`div`,{className:`${Kr} ${wy}`,children:[n.length===0&&(0,W.jsx)(`p`,{className:`m-0 text-muted wrap-anywhere`,children:H(`machines.none`)}),n.map(t=>(0,W.jsx)(Ly,{model:e,row:t,tasks:Sy(r,t.alias),words:i},t.alias))]})})}function zy(e,t,n=300){let r=0,i,a=()=>{r++,i?.(),i=void 0};return{stop:a,run:o=>{a();let s=o.trim();if(s.length<2){t({kind:`idle`});return}let c=r,l=setTimeout(()=>{t({kind:`searching`}),e(s).then(e=>c===r&&t({kind:`done`,query:s,reply:e}),e=>c===r&&t({kind:`failed`,message:e instanceof Error?e.message:String(e)}))},n);i=()=>clearTimeout(l)}}}var By=`mx-1.5 mt-2 mb-0.5 font-mono text-meta font-semibold normal-nums text-subtle first:mt-0`,Vy=`mx-1.5 my-1 text-meta text-muted [overflow-wrap:anywhere]`,Hy=e=>`flex w-full min-w-0 cursor-pointer flex-col gap-0.5 rounded-sm px-1.5 py-1.5 text-left text-ink [font:inherit] touch:py-2.5 ${e?`is-selected bg-hover`:``}`,Uy=`flex min-w-0 items-baseline gap-2`,Wy=`min-w-0 flex-1 truncate text-body`,Gy=`whitespace-nowrap text-meta text-muted`,Ky=`text-meta text-muted [overflow-wrap:anywhere]`,qy=`rounded-xs bg-accent/25 text-ink`;function Jy(e,t){let[n,r]=(0,m.useState)({kind:`idle`});return(0,m.useEffect)(()=>{let n=zy(t=>e.client.request(`sessions.search`,{query:t}),r);return n.run(t),n.stop},[e,t]),n}function Yy(e,t){let n=[],r=e.toLowerCase(),i=t.toLowerCase(),a=0;for(let t=r.indexOf(i);i&&t>=0;t=r.indexOf(i,t+i.length))t>a&&n.push(e.slice(a,t)),n.push({hit:e.slice(t,t+i.length),at:t}),a=t+i.length;return n.push(e.slice(a)),n.map(e=>typeof e==`string`?e:(0,W.jsx)(`mark`,{className:qy,children:e.hit},e.at))}function Xy({children:e}){return(0,W.jsx)(`h3`,{className:By,children:e})}function Zy({children:e,error:t}){return(0,W.jsx)(`p`,{className:`${Vy} ${t?`text-error`:``}`,children:e})}function Qy(e){return(0,W.jsx)(G,{variant:`row`,className:Hy(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:(0,W.jsxs)(`span`,{className:Uy,children:[(0,W.jsx)(`span`,{className:Wy,children:e.title}),(0,W.jsx)(`span`,{className:Gy,children:e.repo})]})})}function $y(e){let{hit:t}=e;return(0,W.jsxs)(G,{variant:`row`,className:Hy(e.selected),onMouseEnter:e.onHover,onClick:e.onOpen,children:[(0,W.jsxs)(`span`,{className:Uy,children:[(0,W.jsx)(`span`,{className:Wy,children:t.title}),(0,W.jsxs)(`span`,{className:Gy,children:[H(t.role===`user`?`search.you`:`search.agent`),` · `,Ul(Date.now()-Date.parse(t.at))]})]}),(0,W.jsx)(`span`,{className:Ky,children:Yy(t.snippet,e.query)})]})}async function eb(e,t){let{taskId:n}=await e.client.request(`task.openScratch`);await gd(e,n,{kind:`engine`,prompt:t}),B()}function tb(e){return eb(e,H(`settings.feedback.reportPrompt`))}var nb=v(`issues`);function rb(e,t,n){return{repo:e.repo,baseBranch:t,prompt:n,worktree:!0}}function ib(e){let t=e.todos;return!t||t.length===0?null:{done:t.filter(e=>e.done).length,total:t.length}}function ab(e){return(e.todos??[]).filter(e=>!e.done)}var ob=/LAND_CONFLICT/,sb=/MAIN_CHECKOUT_DIRTY/,cb=/SYNC_CONFLICT(?:: )?(.*)/,lb=/SYNC_WORKTREE_DIRTY(?:: )?(.*)/;function ub(e){let t=K(e);return ob.test(t)?J(`worktrees`,`land.conflict`,{files:t}):sb.test(t)?J(`worktrees`,`land.dirtyBase`):J(`worktrees`,`land.failed`,{error:t})}async function db(e,t,n){if(t.machine){fb(e,t,t.machine.label,n);return}let r;try{r=await e.client.request(`task.landPreflight`,{taskId:t.id})}catch(e){z(J(`worktrees`,`land.failed`,{error:K(e)}),`error`);return}if(r.refusal){z(r.refusal===`MAIN_CHECKOUT_DIRTY`?J(`worktrees`,`land.dirtyBase`):J(`worktrees`,`land.failed`,{error:r.message??r.refusal}),`error`);return}let i=t.branch||t.title,a=ab(e.tasks.get()?.tasks.find(e=>e.id===t.id)??{}).length;O.set((0,W.jsx)(q,{title:J(`worktrees`,`land.confirmTitle`),body:[J(`worktrees`,r.ahead===1?`land.confirmBodyOne`:`land.confirmBody`,{branch:i,landedOn:r.landedOn,commits:r.ahead??`?`}),...a>0?[H(`files.landTodos`,{count:a})]:[]].join(`
|
|
45
|
-
|
|
46
|
-
`),confirmLabel:J(`worktrees`,`land.button`),onConfirm:async()=>{try{let r=await e.client.request(`task.land`,{taskId:t.id});z(J(`worktrees`,`land.done`,{branch:i,landedOn:r.landedOn,commit:r.commit.slice(0,8)})),n?.()}catch(e){throw Error(ub(e))}}}))}function fb(e,t,n,r){let i=t.branch||t.title;O.set((0,W.jsx)(q,{title:H(`taskops.publishTitle`),body:H(`taskops.publishBody`,{branch:i,host:n}),confirmLabel:H(`taskops.publishButton`),onConfirm:async()=>{let n=await e.client.request(`task.land`,{taskId:t.id}),a=n.published?.prUrl;a?z(H(`taskops.publishedPr`,{branch:i,url:a})):z(H(`taskops.publishedNoPr`,{branch:i,reason:mb(n.published?.prError??``)}),`error`),r?.()}}))}async function pb(e,t){try{let n=await e.client.request(`task.syncBase`,{taskId:t});z(J(`tasks`,n.alreadyCurrent?`sync.alreadyCurrent`:`sync.done`,{base:n.baseRef}))}catch(e){let t=K(e),n=cb.exec(t),r=lb.exec(t);z(n?J(`tasks`,`sync.conflict`,{files:n[1]?.trim()||`?`}):r?J(`tasks`,`sync.dirty`,{files:r[1]?.trim()||`?`}):J(`tasks`,`sync.failed`,{error:t}),`error`)}}function mb(e){return e.split(`
|
|
47
|
-
`).find(e=>e.trim().length>0)?.trim()??e.trim()}async function hb(e,t,n){try{let r=await e.client.request(`task.fixChecks`,e.engineTarget(t));r.outcome===`unavailable`?z(J(`files`,`toast.ciChecksUnavailable`,{detail:mb(r.detail??``)}),`error`):r.outcome===`none`?z(J(`files`,`toast.ciNoFailingChecks`),`error`):z(n)}catch(e){z(K(e),`error`)}}async function gb(e,t){try{let n=await e.client.request(`task.openEditor`,{taskId:t});n.outcome===`noEditor`?z(J(`tasks`,`toast.noEditor`),`error`):n.outcome===`failed`&&z(J(`tasks`,`toast.openWorktreeFailed`,{label:n.label??``}),`error`)}catch(e){z(Dh(e)?J(`tasks`,`toast.noDiskSpace`):J(`tasks`,`toast.worktreeErrorGeneric`,{message:K(e)}),`error`)}}function _b(e,t){let n=e.tasks.get();return[...n?.tasks??[],...n?.archived??[]].filter(e=>e.parentTaskId===t)}function vb(e,t){let n=_b(e,t.id),r=n.length>0,i=n=>e.act(`task.delete`,{taskId:t.id,...n}).then(()=>{}),a=e=>`${J(`worktrees`,`delete.forceBody`,{branch:t.branch||t.title})}\n\n${J(`worktrees`,`delete.forceReason`,{reason:K(e).replace(`task ${t.id} `,``)})}`,o=async e=>{i(e).catch(n=>{if(e.force||!(n instanceof Go)||n.code!==`DIRTY_WORKTREE`){z(K(n),`error`);return}O.set((0,W.jsx)(q,{title:J(`tasks`,`confirm.forceDeleteTitle`,{title:t.label}),body:a(n),confirmLabel:J(`tasks`,`confirm.forceDeleteConfirm`),onConfirm:()=>o({...e,force:!0})}))})};return(0,W.jsx)(q,{title:r?J(`tasks`,`confirm.childrenTitle`,{title:t.label,count:String(n.length)}):J(`tasks`,t.kind===`dir`?`confirm.deleteTitleDir`:`confirm.deleteTitle`,{title:t.label}),body:r?J(`tasks`,`confirm.childrenBody`):J(`tasks`,t.kind===`dir`?`confirm.deleteBodyDir`:`confirm.deleteBodyTask`),confirmLabel:J(`tasks`,r?`confirm.childrenPromote`:`confirm.deleteConfirm`),onConfirm:()=>o({}),...r?{secondary:{label:J(`tasks`,`confirm.childrenCascade`),onConfirm:()=>o({cascade:!0})}}:{}})}async function yb(e,t){let n=t.archived!==!0,r=t.label,i=async i=>{await e.act(`task.archive`,{taskId:t.id,archived:n,...i}),z(J(`tasks`,n?`archive.done`:`archive.restored`,{title:r}))},a=async e=>{try{await i(e)}catch(t){if(n&&t instanceof Go&&t.code===`TASK_BUSY`){O.set((0,W.jsx)(q,{title:J(`tasks`,`archive.busyTitle`),body:J(`tasks`,`archive.busyBody`,{title:r}),confirmLabel:J(`tasks`,`archive.busyConfirm`),onConfirm:()=>i({...e,force:!0})}));return}z(J(`tasks`,n?`archive.failed`:`archive.restoreFailed`,{error:K(t)}),`error`)}},o=n?(e.tasks.get()?.tasks??[]).filter(e=>e.parentTaskId===t.id):[];if(o.length===0)return a({});O.set((0,W.jsx)(q,{title:J(`tasks`,`confirm.childrenTitle`,{title:r,count:String(o.length)}),body:J(`tasks`,`confirm.archiveChildrenBody`),confirmLabel:J(`tasks`,`confirm.childrenPromote`),onConfirm:async()=>void a({promote:!0}),secondary:{label:J(`tasks`,`confirm.archiveChildrenAll`),onConfirm:async()=>void a({})}}))}function bb(e,t,n){return(0,W.jsx)(q,{title:J(`tasks`,`confirm.forgetProjectTitle`,{title:n}),body:J(`tasks`,`confirm.forgetProjectBody`),confirmLabel:J(`tasks`,`confirm.forgetProjectConfirm`),onConfirm:async()=>{try{await e.client.request(`project.forget`,{repo:t})}catch(e){throw Error(J(`tasks`,`toast.forgetProjectFailed`,{error:K(e)}))}}})}var xb=v(null),Sb=0;function Cb(e,t){xb.set({taskId:e,hit:t,nonce:++Sb}),Yc(e,`chat`)}var wb=10;function Tb(e,t){let n=e=>e.surface===t?0:e.surface?1:2,r=Do().filter(n=>Oo(n,t)&&n.live?.(e)!==!1).map((e,t)=>({command:e,index:t})).sort((e,t)=>n(e.command)-n(t.command)||Number(e.command.prefix)-Number(t.command.prefix)||e.index-t.index),i=new Set,a=[];for(let{command:e}of r){let t=e.chords[0];!t||e.id===`palette.open`||i.has(e.id)||(i.add(e.id),a.push({command:e,name:Nl(e.id),raw:e.prefix?`${ho()} + ${t}`:t}))}return a}function Eb(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null;O.set((0,W.jsx)(Ob,{model:e,surface:Ao(),origin:t}))}var Db=8;function Ob({model:e,surface:t,origin:n}){U();let[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(0),s=(0,m.useRef)(null),c=y(lo),l=y(e.tasks),u=y(e.remote),d=(0,m.useMemo)(()=>Tb(e,t),[e,t,c]).filter(e=>Cl(r,e.name,e.raw)),f=(rg(e).length>0?[{name:H(`machines.title`)}]:[]).filter(e=>Cl(r,e.name,``)),p=[{name:H(`settings.feedback.report`)}].filter(e=>Cl(r,e.name,``)),h=r.trim(),g=h===``?[]:[...l?.tasks??[],...u,...l?.archived??[]].filter(e=>!e.routine&&!e.deleting&&[e.label,e.title,e.branch,Cd(e.repo)].some(e=>e!==``&&pl(h,e))).slice(0,Db),_=y(e.installedMods).has(`issues`),v=[{id:`usage`,name:H(`usage.title`)},..._?[{id:`issues`,name:H(`reviewQueue.palette`),source:`reviews`}]:[]].filter(e=>h===``||pl(h,e.name)),b=Jy(e,r),x=b.kind===`done`?b.reply.matches:[],S=[...d.map(e=>({kind:`command`,row:e})),...v.map(e=>({kind:`page`,...e})),...f.map(e=>({kind:`machines`,...e})),...p.map(e=>({kind:`report`,...e})),...g.map(e=>({kind:`task`,task:e})),...x.map(e=>({kind:`hit`,hit:e}))],C=Math.min(a,Math.max(0,S.length-1));(0,m.useEffect)(()=>()=>n?.focus(),[n]),(0,m.useEffect)(()=>{s.current?.querySelector(`.is-selected`)?.scrollIntoView({block:`nearest`})},[C]);let w=t=>{if(t.kind===`machines`){Py(e);return}if(B(),n?.focus(),t.kind===`report`){tb(e).catch(()=>z(H(`settings.feedback.reportFailed`),`error`));return}if(t.kind===`command`){t.row.command.live?.(e)===!1?z(jl(`unavailable`),`error`):t.row.command.run(e);return}if(t.kind===`page`){t.source&&nb.set(t.source),V(t.id);return}t.kind===`task`&&t.task.archived&&yb(e,t.task),t.kind===`task`?e.select(t.task.id):e.select(t.hit.taskId,t.hit.tabId??null),ge(),t.kind===`hit`&&Cb(t.hit.taskId,t.hit)},T=e=>{if(e.key===`ArrowDown`)o(Math.min(S.length-1,C+1));else if(e.key===`ArrowUp`)o(Math.max(0,C-1));else if(e.key===`Enter`){let e=S[C];e&&w(e)}else return;e.preventDefault()},E=h!==``&&(g.length>0||h.length>=2),D=0,O=()=>D++;return(0,W.jsx)(Ci,{title:jl(`palette`),wide:!0,children:(0,W.jsxs)(`div`,{className:`${Kr} palette`,onKeyDown:T,children:[(0,W.jsx)(`input`,{className:hn,autoFocus:!0,spellCheck:!1,value:r,placeholder:jl(`search`),onChange:e=>{i(e.target.value),o(0)}}),(0,W.jsxs)(`div`,{className:fn,ref:s,style:{maxHeight:`${(E?18:wb)*1.9}em`},children:[S.length===0&&b.kind!==`searching`&&(0,W.jsx)(`p`,{className:`text-muted`,children:jl(`noResults`)}),E&&d.length>0&&(0,W.jsx)(Xy,{children:H(`search.commands`)}),d.map(e=>{let t=O();return(0,W.jsx)(`button`,{type:`button`,className:pn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`command`,row:e}),children:(0,W.jsx)(`span`,{className:mn,children:`${t===C?`› `:` `}${e.name}`})},e.command.id)}),v.map(e=>{let t=O();return(0,W.jsx)(G,{variant:`row`,className:pn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`page`,...e}),children:(0,W.jsx)(`span`,{className:mn,children:`${t===C?`› `:` `}${e.name}`})},e.id)}),f.map(e=>{let t=O();return(0,W.jsx)(G,{variant:`row`,className:pn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`machines`,...e}),children:(0,W.jsx)(`span`,{className:mn,children:`${t===C?`› `:` `}${e.name}`})},`machines`)}),p.map(e=>{let t=O();return(0,W.jsx)(G,{variant:`row`,className:pn(t===C),title:e.name,onMouseEnter:()=>o(t),onClick:()=>w({kind:`report`,...e}),children:(0,W.jsx)(`span`,{className:mn,children:`${t===C?`› `:` `}${e.name}`})},`report`)}),g.length>0&&(0,W.jsx)(Xy,{children:H(`search.tasks`)}),g.map(e=>{let t=O();return(0,W.jsx)(Qy,{title:e.label,repo:e.archived?H(`search.archived`,{repo:Cd(e.repo)}):Cd(e.repo),selected:t===C,onHover:()=>o(t),onOpen:()=>w({kind:`task`,task:e})},e.id)}),b.kind!==`idle`&&(0,W.jsx)(Xy,{children:H(`search.inConversations`)}),b.kind===`searching`&&(0,W.jsx)(Zy,{children:H(`search.searching`)}),b.kind===`failed`&&(0,W.jsx)(Zy,{error:!0,children:b.message}),b.kind===`done`&&x.length===0&&(0,W.jsx)(Zy,{children:H(`search.none`,{query:b.query})}),x.map(e=>{let t=O();return(0,W.jsx)($y,{hit:e,query:b.kind===`done`?b.query:``,selected:t===C,onHover:()=>o(t),onOpen:()=>w({kind:`hit`,hit:e})},`${e.taskId}:${e.tabId??``}:${e.at}:${t}`)}),b.kind===`done`&&b.reply.truncated&&(0,W.jsx)(Zy,{children:H(`search.truncated`)}),b.kind===`done`&&b.reply.skipped.length>0&&(0,W.jsx)(Zy,{children:H(`search.skipped`,{count:b.reply.skipped.length})})]}),(0,W.jsx)(`p`,{className:`keys-only text-muted`,children:jl(`run`)})]})})}var kb=v(null);function Ab(e){let t=(document.activeElement?.closest(`.rail`)==null?null:kb.get())??e.selection.get().taskId;return e.tasks.get()?.tasks.find(e=>e.id===t)??null}var jb=[`latest`,`next`,`nightly`],Mb={autoRouting:{title:`Auto routing`,hint:"Routing by depth: a task says how deep the work is — swift, standard, deep — and this table says which engine, model and reasoning effort that depth runs on. Pick a depth in the new-task dialog (or `rove api add --tier`) and Rove fills those three fields from the row; you still see them and can change them before the task starts. enter (or click) a row to point it somewhere else, with the same picker a task uses. A row whose target cannot start says why here, not at launch.",unconfigured:`Auto routing is off: a depth has nowhere to route — its engine is blank. Point it somewhere below, or remove the empty autoRouting.<tier>.engine from state.json.`,engineDefault:`engine default`,ready:`● ready`,unavailable:`! unavailable — {reason}`,classifierTitle:`Classifier`,classifierHint:"The rows above say what each depth RUNS. This says who CHOOSES one: switch it on and `rove api add --tier auto` reads the task's first message and picks the depth for you. It is off by default, it is never required, and it can never fail a create — no key, no network, a timeout, or an answer it is not confident enough about all leave you on the depth you would have had.",classifierDataFlow:"! Turning the classifier on sends the task's first message to a third party that is NOT the engine vendor you picked — TypeSafe System One for `jev`, or whatever address you point `custom` at. It reads the text before your engine does. Nothing leaves this machine while it is off.",classifierLabel:`Choose with`,classifierOff:`off`,classifierCustomLabel:`custom`,classifierOffHint:`— nothing is sent anywhere`,classifierJevHint:`— TypeSafe System One, billed to your own key`,classifierCustomHint:`— your endpoint: POST the text, answer with a depth and a confidence`,endpointLabel:`Endpoint`,endpointUnset:`(none — enter one, then set Choose with to custom)`,endpointTitle:`Custom classifier endpoint`,endpointField:`URL`,endpointInvalidTitle:`Not a URL`,endpointInvalidBody:`The endpoint has to start with https://, or http:// for a loopback address (127.0.0.1, localhost, ::1) — over a network, plain http would carry the task's first 1,200 characters in cleartext. Leave it empty to clear it.`,thresholdLabel:`Confidence floor`,thresholdHint:`— below this, the depth is left alone`,thresholdTitle:`Confidence floor`,thresholdField:`0 to 1`,thresholdInvalidTitle:`Not a confidence`,thresholdInvalidBody:`The floor is a number between 0 and 1. 0.5 is the shipped default.`,keyLabel:`API key`,keyStored:`stored {hint} — enter to replace, empty to clear`,keyFromEnv:"from ${env} — the environment wins over a stored key",keyNone:`not set — enter to paste one`,keyTitle:`{env}`,keyPlaceholder:`paste the key; leave empty to clear the stored one`,keySaved:`● key stored in ~/.rove/secrets.json (owner-only, never in state.json)`,keyCustomUnused:`● no Authorization header is sent to a custom endpoint — set autoRouting.classifierCustomKeyEnv to the variable holding its key if it needs one`,keyNoVariableTitle:`No key variable for this endpoint`,keyNoVariableBody:`A custom classifier endpoint is sent no Authorization header until autoRouting.classifierCustomKeyEnv names the variable its key lives in. Set that first — a key stored under a name nothing reads is a key at rest for no purpose.`,keyWriteFailedTitle:`Key not saved`,keyWriteFailedBody:`~/.rove/secrets.json could not be written: {reason}. Check directory permissions and disk space, then save again.`,keyMissing:`! no key — nothing is chosen and tasks keep their usual depth`,keyPresentEnv:"● key read from ${env} in this process's environment"}},Nb={autoRouting:{title:`自动路由`,hint:"按深度路由:任务说明这活有多深——轻快、标准、深入——这张表说明那一档跑在哪个引擎、哪个模型、哪个推理强度上。在新建任务对话框里选一档(或 `rove api add --tier`),Rove 就照那一行填进这三个字段;任务启动前你仍然看得见、改得了。enter(或点击)某一行,用和任务一样的选择器把它指到别处。目标起不来的行会在这里说明原因,而不是等到启动时才炸。",unconfigured:`自动路由已关闭:有一档无处可去——它的引擎是空的。在下面把它指到某个引擎,或从 state.json 里删掉空的 autoRouting.<tier>.engine。`,engineDefault:`引擎默认`,ready:`● 可用`,unavailable:`! 不可用——{reason}`,classifierTitle:`分类器`,classifierHint:"上面几行说的是每一档**跑什么**,这里决定**由谁来选**:打开之后,`rove api add --tier auto` 会读任务的第一句话替你选档。默认关着,从来不是必需的,也永远不会让建 task 失败——没 key、断网、超时、或者它自己没把握,都只是让你停在本来就会用的那一档上。",classifierDataFlow:"! 打开分类器,任务的第一句话会发给一个**不是你选的那个引擎厂商**的第三方——`jev` 是 TypeSafe System One,`custom` 是你自己填的地址。它比你的引擎更早读到这段文字。关着的时候什么都不发。",classifierLabel:`选档方式`,classifierOff:`关`,classifierCustomLabel:`自定义`,classifierOffHint:`——不向任何地方发送`,classifierJevHint:`——TypeSafe System One,走你自己的 key 计费`,classifierCustomHint:`——你自己的接口:POST 那段文本,返回一个档位加一个置信度`,endpointLabel:`接口地址`,endpointUnset:`(未填——先填一个,再把「选档方式」切到自定义)`,endpointTitle:`自定义分类器接口`,endpointField:`URL`,endpointInvalidTitle:`不是一个 URL`,endpointInvalidBody:`接口地址要以 https:// 开头;http:// 只在回环地址(127.0.0.1、localhost、::1)上接受——发到网络上的话,明文 http 会把任务的前 1200 个字符原样带走。留空则清除。`,thresholdLabel:`置信度下限`,thresholdHint:`——低于这个值就不动档位`,thresholdTitle:`置信度下限`,thresholdField:`0 到 1`,thresholdInvalidTitle:`不是一个置信度`,thresholdInvalidBody:`下限是 0 到 1 之间的数。出厂默认 0.5。`,keyLabel:`API key`,keyStored:`已存 {hint}——enter 可替换,留空清除`,keyFromEnv:"来自环境变量 ${env}——环境变量优先于存起来的那个",keyNone:`未设置——enter 粘贴一个`,keyTitle:`{env}`,keyPlaceholder:`粘贴 key;留空则清除已存的那个`,keySaved:`● key 存在 ~/.rove/secrets.json(仅本人可读,不会进 state.json)`,keyCustomUnused:`● 自定义接口不会收到 Authorization 头——它若需要凭据,把 autoRouting.classifierCustomKeyEnv 指向存它的变量`,keyNoVariableTitle:`这个接口还没有 key 变量`,keyNoVariableBody:`在 autoRouting.classifierCustomKeyEnv 指定存 key 的变量之前,自定义分类器接口不会收到任何 Authorization 头。先设那个——存在一个没人读的名字下面的 key,只是白白落在盘上。`,keyWriteFailedTitle:`key 没存下`,keyWriteFailedBody:`写不了 ~/.rove/secrets.json:{reason}。请检查目录权限和磁盘空间,再次保存。`,keyMissing:`! 没有 key——不会替你选档,任务保持原来的档位`,keyPresentEnv:"● key 来自本进程环境变量 ${env}"}},Pb={dev:{reset:`Reset UI state`,resetHint:`Clears ~/.config/rove/state.json and ~/.rove/tasks.json, then quits Rove — relaunch to start fresh. Working session list, pane sizes, theme, model picks all reset. Worktrees on disk and engine session history are not touched.`,resetButton:`[enter] Reset`,restart:`Restart backend`,restartHint:`Stops the Rove daemon and relaunches this window on the installed build — picks up daemon / orchestrator / engine edits without quitting by hand. Running engine sessions live in the PTY host and survive it; other attached Rove windows reconnect on their own.`,restartButton:`[enter] Restart`,reload:`Reload settings`,reloadHint:"Applies hand edits to ~/.config/rove/state.json (from `rove config`) to this window without a restart.",reloadButton:`[enter] Reload`,reloadDone:`Reloaded: {count} changed.`,reloadUnchanged:`Already matches state.json; nothing changed.`,reloadFailed:`state.json could not be read, nothing changed: {error}`,doctorHint:"Daemon wedged or unresponsive? Restart backend above does it from here; from a shell it is `rove daemon restart`. Hosted engine sessions stay alive across a daemon restart.",experimental:`Experimental`,remoteHint:"Remote projects (SSH): register a project whose git worktrees live on another host, driven from this local Rove. Unfinished — Hosted PTY engine launch over SSH is not implemented, and file/diff panes still degrade. Enables `rove add --remote`.",remote:`Remote projects`,autoStatusHint:`Auto status flow: a backlog task moves to in_progress when its engine starts a turn, and new sessions get a system-prompt note telling the agent to set in_review itself when the work is done. Never touches done/canceled.`,autoStatus:`Auto status flow`,dispatcherHint:"Field-notes dispatcher: task sessions file one-line gotchas (`rove api note`), and every session of that repo that starts later is handed them.",dispatcher:`Field-notes dispatcher`}},Fb={dev:{reset:`重置 UI 状态`,resetHint:`清空 ~/.config/rove/state.json 和 ~/.rove/tasks.json,然后退出 Rove——重新启动即可从头开始。工作会话列表、面板尺寸、主题、模型选择都会重置。磁盘上的 worktree 和引擎会话历史不受影响。`,resetButton:`[enter] 重置`,restart:`重启后端`,restartHint:`停止 Rove daemon,并以已安装的版本重新启动当前窗口——无需手动退出即可应用 daemon / orchestrator / engine 的改动。正在运行的引擎会话由 PTY host 托管,不受影响;其他已连接的 Rove 窗口会自行重连。`,restartButton:`[enter] 重启`,reload:`重新加载设置`,reloadHint:"把对 ~/.config/rove/state.json 的手动修改(来自 `rove config`)应用到当前窗口,无需重启。",reloadButton:`[enter] 重新加载`,reloadDone:`已重新加载:{count} 项有变化。`,reloadUnchanged:`已与 state.json 一致,没有变化。`,reloadFailed:`无法读取 state.json,未做任何改动:{error}`,doctorHint:"daemon 卡住或无响应?上面的「重启后端」就能在这里完成;在 shell 里则是 `rove daemon restart`。Hosted PTY 引擎会话不会因 daemon 重启而退出。",experimental:`实验性`,remoteHint:"远程项目(SSH):注册一个 git worktree + 引擎都通过 SSH 跑在另一台主机上、由本地 Rove 驱动的项目。尚未完成——文件/diff 面板对远程仍会降级。启用 `rove add --remote`。",remote:`远程项目`,autoStatusHint:`自动状态流转:backlog 任务在其引擎开始一轮时移到 in_progress,新会话会拿到一条系统提示,告诉 agent 完成后自行设为 in_review。绝不触碰 done/canceled。`,autoStatus:`自动状态流转`,dispatcherHint:"现场笔记调度器:任务会话提交一行经验(`rove api note`),之后在该仓库启动的每个会话都会拿到这些笔记。",dispatcher:`现场笔记调度器`}},Ib={engines:{title:`Engines`,hint:`Engines Rove can start on this machine. New tasks start with the default engine; switch an engine off to stop offering it.`,keys:`space available · d default · enter launch command · r rename · x reset/remove`,customTag:`custom`,available:`available`,off:`off`,defaultMark:`default`,makeDefault:`Make default`,status:{checking:`Checking…`,unknown:`Status unknown`,ready:`Ready`,notInstalled:`Not installed`,notOnPath:`Not on PATH`,signIn:`Sign in needed`,integrationMissing:`Integration not installed`,integrationOutdated:`Integration outdated`,integrationBlocked:`Integration blocked`},detail:{program:`Program`,command:`Command`,signIn:`Sign-in`,reporting:`Live status`,adapter:`Adapter`,programFound:`{binary} found at {path}.`,programFoundVersion:`{binary} {version} found at {path}.`,programMissing:`{binary} is not on PATH. Install the engine's CLI, or point its launch command at it.`,programUnknown:`Rove could not check for {binary}.`,commandDefault:`{command} (the default)`,commandCustom:`{command} (yours)`,signedIn:`Signed in.`,signedInAs:`Signed in as {who}.`,apiKey:`An API key is configured.`,token:`A token is configured ({source}).`,signedOut:`Not signed in. Sign in with the engine's own CLI.`,signInUnknown:`Rove can't see whether this engine is signed in.`,signInFailed:`Sign-in check failed: {error}`,hooksInstalled:`Rove's hooks are installed, so tabs report their state as it changes.`,hooksOutdated:`Rove's hooks are from an older version; reinstall them under Engine integrations.`,hooksMissing:`Rove's hooks are not installed; install them under Engine integrations.`,hooksAwaitEngine:`Rove's hooks can be installed once the engine is.`,hooksUnsupported:`This engine has no hooks for Rove to install.`,hooksBlocked:`Rove can't write its hooks into {file}: {reason}`,hooksBlockedHere:`Rove can't write its hooks into the engine's config: {reason}`,markersYes:`It leaves turn-complete markers that Rove reads back.`,markersNo:`It leaves no turn-complete markers.`,screenYes:`Screen rules cover what the hooks don't.`,screenNo:`No screen rules.`,screenNotNeeded:`No screen rules; the hooks report everything.`,adapterDeclared:`Borrows the {protocol} adapter.`,adapterGeneric:`Generic adapter: no transcript reader, sign-in check or resume.`,skill:`Rove skill`,skillInstalled:`Installed in {dir}.`,skillInstalledHere:`Installed and current.`,skillOutdated:`From an older Rove; reinstall it under Rove agent skill.`,skillMissing:`Not installed; install it under Rove agent skill.`},skill:{title:`Rove agent skill`,hint:`Teaches the agent in each engine to drive Rove itself (rove api): start tasks, read other sessions, message them.`,install:`Install ({count})`,noEngines:`No engine here takes the skill`,failed:`Install failed: {reason}`,bannerTitle:`ROVE SKILL NOT INSTALLED`,bannerHint:`{engines} can't drive Rove yet (start tasks, read other sessions). Click here to install.`,bannerHintWeb:`{engines} can't drive Rove yet (start tasks, read other sessions).`},integrations:{title:`Engine integrations`,hint:`Hooks Rove writes into each engine's own config, so a tab shows working, waiting or done the moment it happens.`,summary:`{installed} of {total} installed`,install:`Install missing ({count})`,upToDate:`All up to date`,remove:`Remove all ({count})`,noneInstalled:`Nothing to remove`},addEngine:`+ Add engine`,launchCommandTitle:`{name} launch command`,displayNameTitle:`{name} display name (blank = default)`,addTitle:`Add engine`,addStepTitle:`Add engine · {id}`,protocolTitle:`Add engine · {id} — protocol`,protocolNone:`None — generic adapter`,protocolFooter:`↑↓ choose · enter pick · esc cancel`,protocolRow:`protocol {protocol}`,protocolGeneric:`generic`,idPlaceholder:`lowercase slug, e.g. aider`,commandPlaceholder:`e.g. aider --model sonnet`,hookTrustHint:`Open {command} in the engine and approve hooks yourself. Written hooks are not proof of trust.`,readiness:`CLI: {cli} · login: {login} · hooks: {hooks}`,cliReady:`available`,cliMissing:`missing; install the engine CLI`,loginReady:`detected`,loginMissing:`sign in with the engine CLI`,readinessUnknown:`not observable`,hooksWritten:`written`,hooksMissing:`not written; Settings → Engines`,hooksOutdated:`outdated; Settings → Engines`,hookWaiting:`No hook event received yet. After approval, send a short prompt to verify activity.`,hookReceived:`Hook event recorded for this tab. Send a short prompt to check current reporting; current trust is not inferred.`,readinessFailed:`Readiness check unavailable; run rove doctor. No authorization is inferred.`},accounts:{checking:`Checking…`,notLoggedIn:`○ Not logged in`,loggedIn:`● Logged in: {email}`,apiKeyConfigured:`● API key configured`,chatgptLogin:`● ChatGPT login: {email}`,tokenConfigured:`● Token configured ({source})`,detected:`● Login detected`}},Lb={engines:{title:`引擎`,hint:`Rove 能在这台机器上启动的引擎。新任务默认用「默认」引擎;关掉某个引擎,选引擎时就不再列出它。`,keys:`space 可用 · d 设为默认 · enter 启动命令 · r 重命名 · x 重置/移除`,customTag:`自定义`,available:`可用`,off:`已关`,defaultMark:`默认`,makeDefault:`设为默认`,status:{checking:`检查中…`,unknown:`状态未知`,ready:`就绪`,notInstalled:`未安装`,notOnPath:`不在 PATH 上`,signIn:`需要登录`,integrationMissing:`未安装接入`,integrationOutdated:`接入已过期`,integrationBlocked:`接入被拒绝`},detail:{program:`程序`,command:`命令`,signIn:`登录`,reporting:`实时状态`,adapter:`适配器`,programFound:`{binary} 位于 {path}。`,programFoundVersion:`{binary} {version} 位于 {path}。`,programMissing:`{binary} 不在 PATH 上。请安装引擎 CLI,或把启动命令指向它。`,programUnknown:`Rove 无法检查 {binary}。`,commandDefault:`{command}(默认)`,commandCustom:`{command}(自定义)`,signedIn:`已登录。`,signedInAs:`已登录:{who}。`,apiKey:`已配置 API key。`,token:`已配置 Token({source})。`,signedOut:`未登录。请用引擎自己的命令行登录。`,signInUnknown:`Rove 无法得知该引擎是否已登录。`,signInFailed:`登录检查失败:{error}`,hooksInstalled:`Rove 的钩子已安装,标签页的状态会实时上报。`,hooksOutdated:`Rove 的钩子来自旧版本;请在「引擎接入」里重新安装。`,hooksMissing:`Rove 的钩子未安装;请在「引擎接入」里安装。`,hooksAwaitEngine:`引擎安装后才能装 Rove 的钩子。`,hooksUnsupported:`该引擎没有可供 Rove 安装的钩子。`,hooksBlocked:`Rove 无法把钩子写入 {file}:{reason}`,hooksBlockedHere:`Rove 无法把钩子写入引擎配置:{reason}`,markersYes:`它会留下回合完成标记,Rove 可以读回。`,markersNo:`它不留下回合完成标记。`,screenYes:`读屏规则兜底钩子覆盖不到的状态。`,screenNo:`没有读屏规则。`,screenNotNeeded:`没有读屏规则;钩子已报全所有状态。`,adapterDeclared:`借用 {protocol} 适配器。`,adapterGeneric:`通用适配器:没有会话记录读取、登录检查和恢复。`,skill:`Rove 技能`,skillInstalled:`已安装在 {dir}。`,skillInstalledHere:`已安装,是最新版。`,skillOutdated:`来自旧版 Rove;请在「Rove 智能体技能」里重新安装。`,skillMissing:`未安装;请在「Rove 智能体技能」里安装。`},skill:{title:`Rove 智能体技能`,hint:`教会各引擎里的智能体自己操作 Rove(rove api):开任务、读其他会话、给它们发消息。`,install:`安装({count})`,noEngines:`这台机器上没有能装技能的引擎`,failed:`安装失败:{reason}`,bannerTitle:`ROVE 技能未安装`,bannerHint:`{engines} 还不能操作 Rove(开任务、读其他会话)。点这里安装。`,bannerHintWeb:`{engines} 还不能操作 Rove(开任务、读其他会话)。`},integrations:{title:`引擎接入`,hint:`Rove 写进各引擎自身配置的钩子,让标签页在工作、等待、完成的那一刻就显示出来。`,summary:`已安装 {installed}/{total}`,install:`安装缺失的({count})`,upToDate:`全部已是最新`,remove:`全部移除({count})`,noneInstalled:`没有可移除的`},addEngine:`+ 添加引擎`,launchCommandTitle:`{name} 的启动命令`,displayNameTitle:`{name} 的显示名称(留空 = 默认)`,addTitle:`添加引擎`,addStepTitle:`添加引擎 · {id}`,protocolTitle:`添加引擎 · {id} —— 协议`,protocolNone:`无 —— 通用适配器`,protocolFooter:`↑↓ 选择 · enter 确认 · esc 取消`,protocolRow:`协议 {protocol}`,protocolGeneric:`通用`,idPlaceholder:`小写短名,如 aider`,commandPlaceholder:`如 aider --model sonnet`,hookTrustHint:`在引擎中打开 {command},由你自行批准 hooks。写入不代表已授权。`,readiness:`CLI:{cli} · 登录:{login} · hooks:{hooks}`,cliReady:`可用`,cliMissing:`缺失;请安装引擎 CLI`,loginReady:`已检测到`,loginMissing:`请通过引擎 CLI 登录`,readinessUnknown:`无法观测`,hooksWritten:`已写入`,hooksMissing:`未写入;设置 → 引擎`,hooksOutdated:`已过时;设置 → 引擎`,hookWaiting:`尚未收到 hook 事件。授权后发送一条简短提示,验证活动状态。`,hookReceived:`已记录此标签页的 hook 事件。发送简短提示以检查当前上报;不据此推断当前授权。`,readinessFailed:`无法检查就绪状态;请运行 rove doctor。不会据此推断已授权。`},accounts:{checking:`检查中…`,notLoggedIn:`○ 未登录`,loggedIn:`● 已登录: {email}`,apiKeyConfigured:`● 已配置 API key`,chatgptLogin:`● ChatGPT 登录: {email}`,tokenConfigured:`● 已配置 Token ({source})`,detected:`● 检测到登录`}},Rb={plugins:{title:`Plugins`,hint:"Rove's first-party mods first: enter (or click) installs or uninstalls one, and uninstalling keeps its data on disk. Then the plugins registered in ~/.rove/plugins.json: enter toggles one on or off — the daemon watches the file, so the change applies live. Rows indented under a plugin are the settings it declares; enter edits one, and the value reaches the plugin on its next run. Install and remove them from the shell: `rove plugin install <owner/repo>`, `rove plugin link <dir>`.",empty:"Kanban and Issues are first-party mods: enter (or click) installs one. No other plugins registered; add one with `rove plugin install <owner/repo>` — browse the `rove-plugin` topic on GitHub.",sourceLink:`linked {path}`,sourceGithub:`{spec}`,sourceBuiltIn:`first-party mod · not installed`,sourceBuiltInInstalled:`first-party mod · installed`,updateAvailable:`update available — rove plugin update`,declares:`{actions} actions · {events} events · {panes} panes`,declaresWithEngines:`{actions} actions · {events} events · {panes} panes · {engines} engines`,declaresPages:`· {pages} pages`,pageFailed:`page {detail}`,manifestUnreadable:`manifest unreadable; check the rove-plugin.toml path and TOML syntax`,unsupportedPlatform:`· not supported on this platform`,noHooks:`· no hooks declared`,lastRun:`· last run {label} {status} {ago} ago`,neverRun:`· never run`,runOk:`ok`,runRunning:`still running`,runFailed:"failed to start; inspect `rove plugin log <id>`",runExit:`exit {code}`,settingUnset:`(unset — enter to edit)`,settingInvalidTitle:`Not a number`,settingInvalidBody:`{label} only accepts a number. Keeping the previous value.`},marketplace:{title:`Marketplace`,hint:"Plugins published under the `rove-plugin` topic on GitHub, most-starred first. enter (or click) shows what the install would run and asks before running any of it. The listing is re-queried each time you open this section.",loading:`Searching GitHub…`,empty:`No plugins listed.`,offline:`GitHub is unreachable — showing first-party plugins only. Re-open this section to retry.`,installedTag:`installed`,firstParty:`first-party`,preparing:`cloning {ref}…`,installing:`building and registering {name}…`,installed:`installed {id} v{version} — it is enabled, and appears under Plugins.`,cancelled:`install cancelled; nothing was run.`,failed:`install failed: {error}. Check the build output and retry from Marketplace.`,alreadyInstalled:`already installed as {id} — manage it under Plugins.`,confirmTitle:`Install {name}?`,confirmInstall:`install`,previewSource:`source: {source}`,previewCommands:`Commands this plugin declares:`,previewNoCommands:`This plugin declares no commands.`,previewWarning:`warning: {warning}`,previewTrust:`Installing runs the build commands above, and the rest run later on the events they declare. They run as you, with your environment, and nothing is sandboxed.`}},zb={plugins:{title:`插件`,hint:"先列 Rove 官方 mod:enter(或点击)安装或卸载,卸载后数据仍留在磁盘上。再列在 ~/.rove/plugins.json 里注册的插件:enter 切换启用/禁用——daemon 监听该文件,改动实时生效。插件下方缩进的行是它声明的设置项,enter 编辑,新值在插件下次运行时生效。安装与移除在 shell 里做:`rove plugin install <owner/repo>`、`rove plugin link <dir>`。",empty:"Kanban 和 Issues 是官方 mod:enter(或点击)安装。尚未注册其他插件;用 `rove plugin install <owner/repo>` 安装一个——可在 GitHub 的 `rove-plugin` 话题下浏览。",sourceLink:`本地链接 {path}`,sourceGithub:`{spec}`,sourceBuiltIn:`官方 mod · 未安装`,sourceBuiltInInstalled:`官方 mod · 已安装`,updateAvailable:`有新版本 — rove plugin update`,declares:`{actions} 个动作 · {events} 个事件 · {panes} 个面板`,declaresWithEngines:`{actions} 个动作 · {events} 个事件 · {panes} 个面板 · {engines} 个引擎`,declaresPages:`· {pages} 个页面`,pageFailed:`页面 {detail}`,manifestUnreadable:`manifest 无法解析;请检查rove-plugin.toml 的路径和 TOML 语法`,unsupportedPlatform:`· 不支持当前平台`,noHooks:`· 未声明钩子`,lastRun:`· 上次运行 {label} {status} {ago}前`,neverRun:`· 尚未运行过`,runOk:`成功`,runRunning:`仍在运行`,runFailed:"启动失败;请查看 `rove plugin log <id>`",runExit:`退出码 {code}`,settingUnset:`(未设置 — enter 编辑)`,settingInvalidTitle:`不是数字`,settingInvalidBody:`{label} 只接受数字,保留原值。`},marketplace:{title:`插件市场`,hint:"GitHub 上 `rove-plugin` 话题下发布的插件,按 star 数排序。enter(或点击)会先列出安装会执行的命令,确认后才真正执行。每次进入本区块都会重新查询列表。",loading:`正在搜索 GitHub…`,empty:`列表为空。`,offline:`GitHub 不可达——只显示首方插件。重新进入本区块可再试一次。`,installedTag:`已安装`,firstParty:`首方`,preparing:`正在克隆 {ref}…`,installing:`正在构建并注册 {name}…`,installed:`已安装 {id} v{version}——已启用,可在「插件」区块管理。`,cancelled:`已取消安装,没有执行任何命令。`,failed:`安装失败:{error}。请检查构建输出,再从插件市场重试。`,alreadyInstalled:`已安装为 {id}——在「插件」区块管理。`,confirmTitle:`安装 {name}?`,confirmInstall:`安装`,previewSource:`来源:{source}`,previewCommands:`该插件声明的命令:`,previewNoCommands:`该插件未声明任何命令。`,previewWarning:`警告:{warning}`,previewTrust:`安装会执行上面的 build 命令,其余命令会在它们声明的事件发生时执行。它们以你的身份、带你的环境变量运行,没有任何沙箱。`}},Bb={en:{appearance:{enabled:`On`,disabled:`Off`,borderFlow:`Flowing gradient`,borderStill:`Still`,glyphsBraille:`Braille`,glyphsStarburst:`Starburst (needs a font with the Dingbats block)`,glyphsAscii:`ASCII`,titleShimmer:`Shimmer`,titleStill:`Still`,preview:`Workspace preview`,tasks:`Tasks`,terminal:`Terminal`,files:`Files`,testsPassed:`Tests passed`,transparent:`Transparent background`,opaque:`Opaque background`,modeDark:`Dark`,modeLight:`Light`,modeAuto:`Auto (follow the terminal)`,openHint:`Enter to choose an option and preview it.`,chooseHint:`↑/↓ or j/k preview · enter apply · esc cancel`},title:`Settings`,esc:`esc`,nav:{default:`j/k pick · h/l switch level · enter activate · esc close`,keys:`j/k pick · enter record a key · backspace default · x unbind · esc close`,feedback:`tab next field · enter sends on Send · esc close`},groups:{preferences:`Preferences`,agents:`Agents`,more:`More`},sections:{general:`General`,engines:`Engines`,autoRouting:`Auto routing`,plugins:`Plugins`,marketplace:`Marketplace`,keys:`Keybindings`,feedback:`Feedback`,dev:`Dev`},general:{usage:`USAGE`,theme:`Theme`,themeMode:`Mode`,themeHint:`l to enter list · j/k to highlight · enter to apply`,language:`Language`,languageHint:`Display language for Rove's UI. l to enter list · j/k to highlight · enter to apply.`,transparent:`Transparent background`,transparentHint:`Drops the renderer's bg fill so the host terminal shows through. enter toggles.`,on:`[x] on`,off:`[ ] off`,focusAccent:`Focus accent`,focusAccentHint:`Color of focused pane title, ▌ marker, and split borders.`,accentPrimary:`Primary (brand accent)`,accentSuccess:`Success (legacy green)`,accentInfo:`Info (cool blue)`,appearance:`Appearance`,appearanceHint:`How split panes draw.`,splitStyle:`Split panes`,workingBorder:`Working border`,taskColors:`Task colors`,glyphSet:`State glyphs`,colorblind:`Colorblind diff colours`,runningTitle:`Running title`,splitBox:`Box frames`,splitLine:`Divider line`,splitRail:`Accent rail`,splitRule:`Top rule`,notifications:`Notifications`,notificationsHint:`When a background tab finishes or pauses on an approval.`,toast:`Toast`,toastHint:`bottom-right popup`,sound:`Sound`,soundHint:`bell + chime + an OSC 9 desktop notification (rides SSH)`,soundVolume:`Chime volume — {percent}%`,soundVolumeHint:`enter cycles; applies to the next chime`,crossTask:`Cross-task`,crossTaskHint:`also for a task you switched away from`,finishedAlerts:`Finished turns`,finishedAlertsHint:`off: only approvals and errors alert; the unread dot stays`,keyHints:`Keyboard hints`,keyHintsHint:`The status-bar reminder of the command and help keys.`,keyHintsShow:`Show keyboard hints`,updates:`Updates`,updatesHint:`Stable is the default channel; next previews the coming release; nightly is built from main every day.`,updateChannelTitle:`Release channel`,updateChannel:`Channel: {channel}`,updateChannelHint:"enter cycles stable / next / nightly; `rove update` follows it",updateChannelName:{latest:`stable`,next:`next preview`,nightly:`nightly preview`},updateNotify:`Notify on updates`,updateNotifyHint:`new versions on this channel; off hides the update chip, and checking by hand still reports`,updateCheck:`[ Check for updates ]`,updateCheckHint:`asks npm for the newest release on this channel right now`,updateCheckButton:`Check for updates`,updateChecking:`Checking…`,updateOpenPage:`Open Update page`,updateOpenPageRow:`[ Open Update page ]`,railFold:`Folded task rail`,railFoldHint:`What the rail shows once folded away from its corner control.`,railFoldRow:`Folded rail shows: {style}`,railFoldRowHint:`enter cycles`,railFoldGlyphs:`status glyphs`,railFoldInitials:`glyph + initials`,railFoldHairline:`colour band only`,editor:`Editor`,editorHint:`What enter opens a file with in the file tree — diff mode when the editor supports it, the read-only preview when it isn't installed.`,editorRow:`editor: < {kind} >`,editorRowHint:`auto follows $VISUAL / $EDITOR, else nvim / vim / emacs / nano`,editorCustom:`custom: {cmd}`,editorCustomUnset:`(unset — enter to edit)`,worktree:`Worktree location`,worktreeHint:`Where new task worktrees are created. New tasks only.`,worktreeBase:`location: < {kind} >`,worktreeBaseHint:"custom takes `~`, a relative path, or a leading `$project_dir`",worktreeKindDefault:`default ~/.rove/worktrees`,worktreeKindNext:`next to project`,worktreeKindCustom:`custom`,worktreeCustom:`custom: {path}`,worktreeCustomUnset:`(unset — enter to edit)`,worktreeBaseTitle:`Custom worktree location (blank = default; $project_dir = project root)`,worktreeBaseField:`PATH`,editorCustomTitle:`Custom editor command (use {file} for the path)`,worktreeBaseInvalidTitle:`Can't use that worktree location`,worktreeBaseTokenBody:`{token} only expands as the leading path segment (e.g. {token}/../rove-worktrees). Keeping the previous setting.`,worktreeBaseUnusableBody:`{path} isn't usable ({error}). Keeping the previous setting — pick a writable directory.`,terminal:`Terminal`,terminalHint:`Applies to terminals opened after the change.`,scrollbackRow:`scrollback: {rows} rows`,scrollbackRowHint:`100–100000 · larger costs proportionally more CPU per redraw`,scrollbackTitle:`Terminal scrollback rows (100–100000)`,scrollbackField:`ROWS`,scrollbackInvalidTitle:`Not a number`,scrollbackInvalidBody:`Scrollback must be a number of rows (e.g. 1000). Keeping the previous setting.`,tabStripRow:`tab strip: {mode}`,tabStripMode:{never:`off — the sidebar tree lists tabs`,multipleOnly:`only with 2+ tabs`,always:`always`},usageShowTitle:`Usage`,usageShowHint:`How plan quota and context percentages read, in the footer and here.`,usageShowRow:`percentages: {mode}`,usageShowMode:{used:`used`,left:`left`}},field:{command:`COMMAND`,name:`NAME`,id:`ID`},action:{save:`save`,next:`next`,add:`add`},reset:{title:`Reset UI state?`,body:`Wipes ~/.config/rove/state.json and ~/.rove/tasks.json, then quits Rove — relaunch for a fresh start with an empty working session list. Worktrees on disk and engine session history are NOT touched.`,done:`Rove: UI state reset. Relaunch Rove to start fresh.`,failedTitle:`UI state was not reset`,failedBody:`Could not write the settings file. Your settings and tasks have been kept. Try resetting again.`},restart:{title:`Restart backend?`,body:`Stops the daemon and relaunches this Rove on the installed build, so daemon / orchestrator / engine edits take effect. Running engine sessions live in the PTY host and keep going; open tabs come back. Any other attached windows reconnect on their own.`,done:`Rove: restarting the backend...`},stateWrite:{failedTitle:`Settings were not saved`,failedBody:`{file} could not be written ({keys}). Check its directory permissions and free disk space, then save again.`},...Mb,...Ib,...Rb,keybindings:{title:`Keybindings`,hint:`Press enter on a binding, then the key you want. To put it behind the prefix, press the prefix key first. Changes are saved to the file below and apply at once.`,configFile:`Config file`,notCreated:` (not created yet)`,prefixTitle:`Command layer ({prefix})`,prefixHint:`Bare keys act in the focused pane; a small one-press set covers frequent Rove actions; {prefix} opens the command layer ({timeout}ms second-stroke window). Prefix bindings keep their pane scope and modal rules.`,tapPresentation:`Prefix tap`,tapPresentationHint:`Choose whether the complete guide also marks controls already on screen.`,tapPresentationLocal:`On-screen entries + complete guide (default)`,tapPresentationGuide:`Complete guide only`,prefixDisabled:`disabled`,prefixKey:`Prefix key`,recording:`press the new key… (esc cancels)`,recordingPrefix:`{prefix}, then… (esc cancels)`,recordingSlot:`press the key for {slot}… (esc cancels)`,unbound:`(unbound)`,defaultKeys:`default: {keys}`,warnings:`Warnings`},feedback:{title:`Feedback`,hint:"Files a GitHub issue on the Rove repo through `gh`. Requires `gh auth login`; without it you get a prefilled link to open.",titleLabel:`title`,titlePlaceholder:`Short summary`,descriptionLabel:`description`,descriptionPlaceholder:`What happened? (enter for a new line · tab to Send)`,send:`[enter] File a GitHub issue`,submitting:`submitting...`,sent:`filed #{number}: {url}`,notFiled:`not filed: {hint}
|
|
48
|
-
{url}`,error:`error: {message}
|
|
49
|
-
{hint}`},...Pb},zh:{appearance:{enabled:`开启`,disabled:`关闭`,borderFlow:`流动渐变`,borderStill:`静止`,glyphsBraille:`盲文点`,glyphsStarburst:`星芒(需要含 Dingbats 符号区的字体)`,glyphsAscii:`ASCII`,titleShimmer:`流光`,titleStill:`静止`,preview:`工作区预览`,tasks:`任务`,terminal:`终端`,files:`文件`,testsPassed:`测试通过`,transparent:`透明背景`,opaque:`不透明背景`,modeDark:`深色`,modeLight:`浅色`,modeAuto:`自动(跟随终端)`,openHint:`按 Enter 打开选项和预览。`,chooseHint:`↑/↓ 或 j/k 预览 · enter 应用 · esc 取消`},title:`设置`,esc:`esc`,nav:{default:`j/k 选择 · h/l 切换层级 · enter 确认 · esc 关闭`,keys:`j/k 选择 · enter 录入按键 · backspace 恢复默认 · x 解绑 · esc 关闭`,feedback:`tab 下一项 · enter 在发送项发送 · esc 关闭`},groups:{preferences:`偏好`,agents:`智能体`,more:`更多`},sections:{general:`通用`,autoRouting:`自动路由`,engines:`引擎`,plugins:`插件`,marketplace:`插件市场`,keys:`快捷键`,feedback:`反馈`,dev:`开发`},general:{usage:`用量`,theme:`主题`,themeMode:`明暗`,themeHint:`l 进入列表 · j/k 高亮 · enter 应用`,language:`语言`,languageHint:`Rove 界面的显示语言。l 进入列表 · j/k 高亮 · enter 应用。`,transparent:`透明背景`,transparentHint:`去掉渲染器的背景填充,让宿主终端透出来。按 enter 切换。`,on:`[x] 开`,off:`[ ] 关`,focusAccent:`聚焦强调色`,focusAccentHint:`聚焦面板标题、▌ 标记和分隔边框的颜色。`,accentPrimary:`主色(品牌强调色)`,accentSuccess:`成功色(传统绿)`,accentInfo:`信息色(冷蓝)`,appearance:`外观`,appearanceHint:`分屏面板怎么画边。`,splitStyle:`分屏面板`,workingBorder:`运行中边框`,taskColors:`任务配色`,glyphSet:`状态符号`,colorblind:`色盲友好的增删配色`,runningTitle:`运行中标题`,splitBox:`方框边框`,splitLine:`单线分隔`,splitRail:`左侧强调条`,splitRule:`顶部横线`,notifications:`通知`,notificationsHint:`后台标签完成或在审批处暂停时触发。`,toast:`Toast 弹窗`,toastHint:`右下角弹窗`,sound:`声音`,soundHint:`响铃 + 提示音 + OSC 9 桌面通知(经 SSH 直达本地)`,soundVolume:`提示音音量 — {percent}%`,soundVolumeHint:`回车循环切换;下一声提示音生效`,crossTask:`跨任务`,crossTaskHint:`你已切走的任务也通知`,finishedAlerts:`回合完成`,finishedAlertsHint:`关闭后只有审批和错误会提醒;未读标记照常`,keyHints:`键盘提示`,keyHintsHint:`状态栏里的命令键和帮助键提醒。`,keyHintsShow:`显示键盘提示`,updates:`更新`,updatesHint:`稳定版是默认渠道;next 预览即将发布的版本;nightly 每天从 main 自动构建。`,updateChannelTitle:`发布渠道`,updateChannel:`渠道:{channel}`,updateChannelHint:"enter 在稳定版 / next / nightly 间切换;`rove update` 跟随它",updateChannelName:{latest:`稳定版`,next:`next 预览版`,nightly:`nightly 预览版`},updateNotify:`有新版本时通知我`,updateNotifyHint:`只针对所选渠道;关闭后不再显示更新标记,手动检查仍会给出结果`,updateCheck:`[ 检查更新 ]`,updateCheckHint:`立即向 npm 查询所选渠道的最新版本`,updateCheckButton:`检查更新`,updateChecking:`检查中…`,updateOpenPage:`打开更新页`,updateOpenPageRow:`[ 打开更新页 ]`,railFold:`折叠后的任务栏`,railFoldHint:`任务栏从角标折叠之后显示什么。`,railFoldRow:`折叠后显示:{style}`,railFoldRowHint:`enter 切换`,railFoldGlyphs:`状态字形`,railFoldInitials:`字形 + 首字母`,railFoldHairline:`仅色带`,editor:`编辑器`,editorHint:`文件树里按 enter 用什么打开文件——支持时走编辑器 diff 模式,未安装时回退到只读预览。`,editorRow:`编辑器: < {kind} >`,editorRowHint:`auto 跟随 $VISUAL / $EDITOR,否则 nvim / vim / emacs / nano`,editorCustom:`自定义: {cmd}`,editorCustomUnset:`(未设置 — enter 编辑)`,worktree:`工作树位置`,worktreeHint:`新任务工作树的创建位置。仅对新任务生效。`,worktreeBase:`位置: < {kind} >`,worktreeBaseHint:"自定义可填 `~`、相对路径或以 `$project_dir` 开头",worktreeKindDefault:`默认 ~/.rove/worktrees`,worktreeKindNext:`项目旁边`,worktreeKindCustom:`自定义`,worktreeCustom:`自定义: {path}`,worktreeCustomUnset:`(未设置 — enter 编辑)`,worktreeBaseTitle:`自定义工作树位置(留空 = 默认;$project_dir = 项目根目录)`,worktreeBaseField:`路径`,editorCustomTitle:`自定义编辑器命令(用 {file} 代表文件路径)`,worktreeBaseInvalidTitle:`无法使用该工作树位置`,worktreeBaseTokenBody:`{token} 只能作为路径的第一段展开(如 {token}/../rove-worktrees)。保留原设置。`,worktreeBaseUnusableBody:`{path} 不可用({error})。保留原设置 —— 请选择一个可写目录。`,terminal:`终端`,terminalHint:`对修改后新打开的终端生效。`,scrollbackRow:`回滚行数: {rows} 行`,scrollbackRowHint:`100–100000 · 调大会按比例增加每次重绘的 CPU`,scrollbackTitle:`终端回滚行数(100–100000)`,scrollbackField:`行数`,scrollbackInvalidTitle:`不是数字`,scrollbackInvalidBody:`回滚行数必须是数字(如 1000)。保留原设置。`,tabStripRow:`标签栏: {mode}`,tabStripMode:{never:`关闭 — 标签在左侧树里`,multipleOnly:`仅 2 个以上标签时显示`,always:`始终显示`},usageShowTitle:`用量`,usageShowHint:`套餐额度和上下文百分比的显示方式,作用于底栏和此处。`,usageShowRow:`百分比: {mode}`,usageShowMode:{used:`已用`,left:`剩余`}},field:{command:`命令`,name:`名称`,id:`标识`},action:{save:`保存`,next:`下一步`,add:`添加`},reset:{title:`重置界面状态?`,body:`将清除 ~/.config/rove/state.json 和 ~/.rove/tasks.json 并退出 Rove —— 重新启动后会是一个干净的开始,工作会话列表为空。磁盘上的工作树和引擎会话历史不受影响。`,done:`Rove:界面状态已重置。重新启动 Rove 即可从头开始。`,failedTitle:`UI 状态未能重置`,failedBody:`无法写入设置文件。设置和任务均已保留,请稍后重新尝试重置。`},restart:{title:`重启后端?`,body:`会停掉 daemon,并以已安装的版本重新启动当前 Rove 窗口,从而让 daemon / orchestrator / 引擎的改动生效。正在运行的引擎会话由 PTY host 托管,不会中断;已打开的标签页会恢复。其他已连接的窗口会自行重连。`,done:`Rove:正在重启后端……`},stateWrite:{failedTitle:`设置未能保存`,failedBody:`{file} 写入失败({keys})。请检查目录权限和磁盘空间,再次保存。`},...Nb,...Lb,...zb,keybindings:{title:`快捷键`,hint:`在某一行按 enter,再按你想要的键。想放到 prefix 后面,就先按 prefix 键。改动会写进下面的文件,立即生效。`,configFile:`配置文件`,notCreated:` (尚未创建)`,prefixTitle:`命令层({prefix})`,prefixHint:`裸键作用于当前聚焦面板;少量单次快捷键覆盖高频 Rove 操作;{prefix} 打开命令层(第二击窗口 {timeout}ms)。Prefix 绑定保持原有的面板作用域和 modal 规则。`,tapPresentation:`点按 Prefix`,tapPresentationHint:`选择完整指南是否同时标记当前屏幕上的入口。`,tapPresentationLocal:`屏幕入口 + 完整指南(默认)`,tapPresentationGuide:`仅完整指南`,prefixDisabled:`已禁用`,prefixKey:`Prefix 键`,recording:`按下新的键…(esc 取消)`,recordingPrefix:`{prefix},然后…(esc 取消)`,recordingSlot:`按下「{slot}」对应的键…(esc 取消)`,unbound:`(已解绑)`,defaultKeys:`默认: {keys}`,warnings:`警告`},feedback:{title:`反馈`,hint:"通过 `gh` 在 Rove 仓库提一个 GitHub issue。需要 `gh auth login`;没登录时会给你一条预填好的链接。",titleLabel:`标题`,titlePlaceholder:`简短概括`,descriptionLabel:`描述`,descriptionPlaceholder:`发生了什么?(enter 换行 · tab 跳到发送)`,send:`[enter] 提交 GitHub issue`,submitting:`提交中...`,sent:`已提交 #{number}:{url}`,notFiled:`未提交:{hint}
|
|
50
|
-
{url}`,error:`错误:{message}
|
|
51
|
-
{hint}`},...Fb}},Vb={en:qi,zh:Ji};function Q(e,t){return It(Bb,e,t)}function Hb(e,t){return It(Vb,e,t)}function Ub({label:e,value:t,picks:n,onPick:r}){return(0,W.jsx)(`fieldset`,{"aria-label":e,className:`m-0 inline-flex min-w-0 flex-wrap gap-0.5 rounded-sm border-hairline border-line bg-inset p-0.5`,children:n.map(e=>{let n=e.value===t;return(0,W.jsx)(`button`,{type:`button`,"aria-pressed":n,className:Rt(`rounded-xs px-2.5 py-1 font-sans text-meta whitespace-nowrap touch:min-h-9`,`focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,n?`bg-menu text-ink`:`text-muted hover:bg-hover`),onClick:()=>!n&&r(e.value),children:e.label},e.value)})})}function Wb({label:e,value:t,picks:n,onPick:r}){let i=(0,m.useRef)(!1),a=e=>{let i=e.getBoundingClientRect();D.set({x:i.left,y:i.bottom+4,right:i.right,minWidth:i.width,start:Math.max(n.findIndex(e=>e.value===t),0),target:e,items:n.map(n=>({label:n.label,checked:n.value===t,run:()=>{e.focus(),n.value!==t&&r(n.value)}}))})};return(0,W.jsxs)(`button`,{type:`button`,"aria-label":`${e}: ${n.find(e=>e.value===t)?.label??t}`,"aria-haspopup":`menu`,className:`relative inline-flex max-w-full min-w-0 items-center rounded-sm border-hairline border-line bg-inset py-1.5 pr-7 pl-2.5 text-left font-sans text-meta text-ink hover:border-line-active focus-visible:border-line-active focus-visible:outline-none data-menu-open:border-line-active touch:min-h-10`,onMouseDown:e=>{i.current=e.currentTarget.hasAttribute(`data-menu-open`)},onClick:e=>{i.current||a(e.currentTarget),i.current=!1},onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),a(e.currentTarget))},children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:n.find(e=>e.value===t)?.label??t}),(0,W.jsx)(hs,{className:`pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-subtle`})]})}var Gb=`${Vr} w-narrow:pt-0`,Kb=`dialog relative m-0 flex h-[min(640px,80vh)] w-[min(880px,calc(100vw-32px))] overflow-hidden rounded-md border-hairline border-line bg-surface text-inherit shadow-dialog focus:outline-none motion-safe:animate-rise-in [.is-leaving_&]:animate-sink-out w-narrow:h-dvh w-narrow:w-screen w-narrow:flex-col w-narrow:rounded-none w-narrow:border-0 w-narrow:pt-[env(safe-area-inset-top)] w-narrow:translate-x-[var(--back-x,0px)] w-narrow:pb-[env(safe-area-inset-bottom)] short:h-[calc(100dvh-24px)]`,qb=`absolute top-3 right-3 z-1 grid size-7 place-items-center rounded-sm text-display leading-none text-muted hover:bg-inset hover:text-ink focus-visible:bg-inset focus-visible:text-ink touch:size-10`,Jb=e=>`hidden flex-none items-center ${e?`px-5`:`px-4`} py-3 text-left font-mono text-meta font-bold text-accent w-narrow:flex touch:min-h-11`,Yb=e=>`flex min-h-0 min-w-0 flex-1 flex-col ${e?`absolute inset-0 z-1 translate-x-(--back-x) bg-surface [padding:inherit] shadow-dialog`:``}`,Xb=`flex w-56 flex-none flex-col gap-5 overflow-y-auto scrollbar-none [border-right:var(--hairline)_solid_var(--line)] px-2.5 py-4 w-narrow:w-full w-narrow:flex-1 w-narrow:[border-right:none] w-narrow:px-3 w-narrow:py-3`,Zb=`m-0 px-2 pb-0.5 font-sans text-title font-semibold normal-nums text-ink`,Qb=`flex flex-col gap-0.5`,$b=`m-0 px-2 pb-1 font-mono text-meta font-normal text-subtle`,ex=(e,t)=>`flex items-center rounded-sm px-2 py-1.25 text-left font-sans text-body touch:min-h-10 w-narrow:min-h-11 w-narrow:px-3 ${e?`bg-menu text-ink`:`${t?`text-muted`:`text-ink`} [&:hover]:bg-hover`}`,tx=`ml-auto hidden text-subtle w-narrow:block`,nx=`flex flex-col`,rx=`flex min-w-0 flex-wrap gap-x-4 text-meta`,ix=`inline-flex min-h-6.5 min-w-0 items-center gap-2`,ax=`block h-7 w-36 rounded-md border-hairline border-line bg-paper`,ox=`m-0 pb-2 text-meta text-subtle`,sx=`flex flex-col border-t-hairline border-t-line [&>*]:border-b-hairline [&>*]:border-b-line`,cx=`flex items-center justify-between gap-x-6 gap-y-2 py-3 w-narrow:flex-col w-narrow:items-stretch`,lx=`flex items-center justify-between gap-x-6 py-3`,ux=`flex flex-col gap-3 py-3`,dx=`flex min-w-0 flex-1 flex-col gap-0.5`,fx=`text-body text-ink`,px=`text-meta text-muted [&_a]:text-accent`,mx=`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,hx=`m-0 py-3 text-body text-muted`,gx=`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none`,_x=`${gx} w-24 text-right`,vx=`flex flex-col gap-1.5`,yx=`text-meta font-medium text-muted`,bx=`min-h-30 max-h-[50vh] leading-[1.45]`,xx=`flex flex-wrap items-center justify-end gap-2.5`,Sx=`flex items-center gap-2.5 rounded-sm bg-inset px-3 py-2 text-meta`,Cx=`grid grid-cols-[minmax(0,1fr)_104px_72px] items-center gap-3`,wx=`flex flex-col`,Tx=`${Cx} pb-1.5 pl-7.5 font-sans text-meta font-medium normal-nums text-subtle [&>span:not(:first-child)]:text-center`,Ex=`border-b-hairline border-b-line first:border-t-hairline first:border-t-line`,Dx=`${Cx} group/eng rounded-sm py-1.5 pr-1 pl-0`,Ox=`flex min-w-0 items-center gap-2 rounded-sm py-1.5 pr-0 pl-1.5 text-left focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-focus`,kx=e=>`mx-0.5 ${e?`text-muted`:`text-subtle`}`,Ax=`flex min-w-0 flex-col gap-0.5`,jx=e=>`truncate text-body leading-[inherit] font-medium ${e?`text-muted`:`text-ink`}`,Mx=`ml-2 text-meta leading-[inherit] font-normal text-subtle`,Nx={ready:`bg-success`,attention:`bg-warning`,error:`bg-error`,absent:`bg-subtle`},Px=e=>`inline-flex items-center gap-1.5 text-meta leading-[inherit] ${e===`error`?`text-error`:`text-muted`}`,Fx=e=>`size-1.75 flex-none rounded-full ${Nx[e]}`,Ix=`flex justify-center`,Lx=`rounded-full bg-accent-soft px-2.5 py-0.5 font-sans text-meta font-medium normal-nums capitalize text-accent`,Rx=`rounded-full border-hairline border-line px-2.5 py-0.5 text-meta leading-[inherit] whitespace-nowrap text-muted opacity-0 transition-opacity duration-120 ease-[ease] group-hover/eng:opacity-100 group-focus-within/eng:opacity-100 hover:border-line-active hover:text-ink motion-reduce:transition-none touch:opacity-100`,zx=`mt-0 mr-1 mb-3 ml-7 flex flex-col gap-2.5 px-1.5 py-1`,Bx=`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3.5 gap-y-1.5 text-meta leading-[1.5]`,Vx=`text-subtle`,Hx=e=>`m-0 wrap-anywhere ${e?`text-warning`:`text-ink`}`,Ux=`flex items-center gap-2`,Wx=`flex-1 px-2 py-1.25`,Gx=`text-meta leading-[inherit] text-success`,Kx=(e=!1)=>`overflow-hidden text-ellipsis text-meta text-muted ${e?`whitespace-normal`:`whitespace-nowrap`}`,qx=`flex flex-col gap-1 py-3`,Jx=`flex items-baseline gap-3`,Yx=`flex flex-col gap-2.5 pt-2`,Xx=`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-2`,Zx=`m-0 pb-1.5 text-meta font-medium text-subtle`,Qx=e=>e?`border-accent bg-accent-soft`:`border-line hover:bg-hover`,$x=`flex h-9 overflow-hidden rounded-xs border-hairline`,eS=`flex w-2/5 flex-col gap-0.75 p-1`,tS=`flex min-w-0 flex-1 flex-col gap-0.75 p-1`,nS=`h-0.75 rounded-xs`,rS=`mt-auto flex gap-0.75`,iS=`size-1 rounded-xs`,aS=`flex min-w-0 items-baseline gap-1.5 font-sans text-meta`,oS=`grid grid-cols-2 gap-2.5 w-narrow:grid-cols-1`,sS=(e=!1)=>`flex min-w-0 flex-col gap-2.5 rounded-md border-hairline border-line bg-surface p-3.5 ${e?`col-span-2 w-narrow:col-span-1`:``}`,cS=`flex min-w-0 items-center gap-3`,lS=`group relative h-4.5 w-7.5 flex-none justify-self-center rounded-full border-hairline border-line bg-inset transition-[background,border-color] duration-120 ease-[ease] aria-checked:border-accent aria-checked:bg-accent motion-reduce:transition-none`,uS=`absolute top-0.5 left-0.5 size-3 rounded-full bg-muted transition-[transform,background] duration-120 ease-[ease] group-aria-checked:[transform:translateX(12px)] group-aria-checked:bg-paper motion-reduce:transition-none`;function dS({on:e,...t}){return(0,W.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,className:lS,...t,children:(0,W.jsx)(`span`,{className:uS})})}function fS(e){return(0,W.jsxs)(`section`,{className:nx,children:[e.title&&(0,W.jsx)(`h2`,{className:`m-0 pb-1.5 font-sans text-meta font-medium normal-nums text-muted`,children:e.title}),e.hint&&(0,W.jsx)(`p`,{className:`m-0 pb-2 text-meta text-subtle`,children:e.hint}),(0,W.jsx)(`div`,{className:sx,children:e.children})]})}function pS(e){let t=(0,W.jsxs)(`div`,{className:dx,children:[(0,W.jsx)(`span`,{id:e.labelId,className:fx,children:e.label}),e.hint&&(0,W.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:e.hint}),e.sample&&(0,W.jsx)(`span`,{className:`mt-1.5 flex min-w-0`,children:e.sample})]});return e.stack?(0,W.jsxs)(`div`,{className:ux,children:[t,e.children]}):(0,W.jsxs)(`div`,{className:e.inline?lx:cx,children:[t,e.children&&(0,W.jsx)(`div`,{className:`flex min-w-0 flex-none items-center justify-end gap-2 w-narrow:justify-start`,children:e.children})]})}function mS(e){let t=(0,m.useId)();return(0,W.jsx)(pS,{label:e.label,hint:e.hint,labelId:t,inline:!0,children:(0,W.jsx)(dS,{on:e.checked,"aria-labelledby":t,disabled:e.disabled,onClick:()=>e.onChange(!e.checked)})})}var hS=36;function gS(e){let t=e.picks.length<=4&&e.picks.reduce((e,t)=>e+t.label.length,0)<=hS?Ub:Wb;return(0,W.jsx)(pS,{label:e.label,hint:e.hint,sample:e.sample,children:(0,W.jsx)(t,{label:e.label,value:e.value,picks:e.picks,onPick:e.onPick})})}function _S(e){return(0,W.jsx)(pS,{label:e.label,hint:e.note,children:(0,W.jsx)(`span`,{className:mx,children:e.value})})}var vS=`page min-h-0 flex-1 rounded-md border-hairline border-line bg-paper px-4.5 py-3.5 focus:outline-none`,yS=`${vS} overflow-y-auto`,bS=`page-title mx-0 mt-0 mb-1.5 font-sans text-title font-bold normal-nums`,xS=`flex items-baseline justify-between gap-4 [&_.page-title]:m-0`,SS=e=>`min-w-0 truncate text-meta ${e?``:`leading-[inherit]`}`,CS=`flex flex-wrap items-center gap-2`,wS={row:`touch:after:-inset-x-0.75 touch:after:-inset-y-0.5`,kanban:`touch:after:-inset-x-0.75 touch:after:-top-1.5 touch:after:-bottom-1`,header:`touch:after:-inset-x-0.75 touch:after:-top-2.5 touch:after:-bottom-1.25`},TS=`mt-2.5 flex flex-col gap-1.5`,ES=e=>`flex cursor-pointer flex-col gap-0.5 rounded-sm px-2.5 py-1.5 ${e?`bg-menu`:``}`,DS=`flex min-w-0 items-baseline gap-2.5`,OS=`whitespace-nowrap text-muted`,kS=`flex gap-2.5 pl-[4ch] text-meta leading-[inherit] text-muted`,AS=`min-w-0 flex-1 truncate`,jS=`flex flex-col px-1.5 pb-2`,MS=`flex flex-col border-t-hairline border-t-line px-1.5 py-1.5`,NS=`relative flex flex-col`,PS=e=>`flex items-center rounded-sm px-2 py-0.75 text-left touch:min-h-10 ${e?`bg-menu text-ink`:`text-muted [&:hover]:bg-hover`}`,FS=`ml-auto -mr-[4.5px] w-5 text-center font-sans text-display leading-none font-normal text-accent normal-nums`,IS=`mr-[7px] size-3.5 flex-none fill-none stroke-current stroke-[1.75] [stroke-linecap:round] [stroke-linejoin:round]`,LS=`[&_b]:mr-2.5`,RS=`${vS} flex flex-col overflow-hidden`,zS=`min-h-0 flex-1 overflow-y-auto`,BS=`[&_h2]:mx-0 [&_h2]:mt-3.5 [&_h2]:mb-1 [&_h2]:text-[length:var(--fs-body)]`,VS=`max-h-[55vh] overflow-x-hidden overflow-y-auto`,HS=`mr-auto text-[length:var(--fs-meta)]`,US=`text-[length:var(--fs-body)] leading-[1.55] wrap-anywhere [&_h3]:mx-0 [&_h3]:mt-3 [&_h3]:mb-1.5 [&_h3]:font-sans [&_h3]:text-meta [&_h3]:font-medium [&_h3]:normal-nums [&_h3]:text-muted [&_h3:first-child]:mt-0 [&_ul]:m-0 [&_ul]:pl-4.5 [&_li+li]:mt-2 [&_p]:mx-0 [&_p]:mt-0 [&_p]:mb-2 [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2 [&_code]:rounded-sm [&_code]:bg-inset [&_code]:px-1 [&_code]:py-0 [&_code]:font-mono [&_code]:text-meta [&_code]:font-normal [&_code]:normal-nums`,WS=`mt-3`,GS=e=>`rounded-sm px-2 py-1.25 ${e?`bg-menu`:``}`,KS=`flex items-baseline gap-2 text-[length:var(--fs-body)]`,qS=`flex items-baseline justify-between gap-2`,JS=`font-mono`,YS=`truncate`,XS=`mt-4 text-[length:var(--fs-meta)]`;function ZS(e){return e.replace(/\[`[0-9a-f]{7,40}`\]\([^)]*\)\s*/g,``).replace(/\s+[—-]\s+\[@[^\]]+\]\([^)]*\)\s*$/,``).trim()}function QS(e){let t=[],n=(e,n)=>t.push({kind:e,text:n,id:t.length});for(let r of e.split(/\r?\n/)){let e=r.trimEnd();if(e.trim()===``)continue;let i=/^#{1,6}\s+(.*)$/.exec(e);if(i){n(`heading`,i[1]??``);continue}let a=/^\s*[-*]\s+(.*)$/.exec(e);if(a){n(`item`,a[1]??``);continue}let o=t.at(-1);o&&o.kind!==`heading`?o.text=`${o.text} ${e.trim()}`:n(`para`,e.trim())}return t.map(e=>e.kind===`item`?{...e,text:ZS(e.text)}:e)}var $S=/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)|`([^`]+)`|\*\*([^*]+)\*\*/g;function eC(e){let t=[],n=0;for(let r of e.matchAll($S)){let i=r.index??0;i>n&&t.push(e.slice(n,i));let[a,o,s,c,l]=r;o!==void 0&&s!==void 0?t.push((0,W.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,children:eC(o)},i)):c===void 0?l!==void 0&&t.push((0,W.jsx)(`b`,{children:l},i)):t.push((0,W.jsx)(`code`,{children:c},i)),n=i+a.length}return n<e.length&&t.push(e.slice(n)),t}function tC({body:e}){let t=QS(e),n=[],r=[],i=()=>{r.length>0&&n.push((0,W.jsx)(`ul`,{children:r},`ul-${n.length}`)),r=[]};for(let e of t){if(e.kind===`item`){r.push((0,W.jsx)(`li`,{children:eC(e.text)},e.id));continue}i(),n.push(e.kind===`heading`?(0,W.jsx)(`h3`,{children:e.text},e.id):(0,W.jsx)(`p`,{children:eC(e.text)},e.id))}return i(),(0,W.jsx)(`div`,{className:US,children:n})}var nC=v(null),rC=v(!1),iC=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>t[n]??e),aC=e=>`https://github.com/Sma1lboy/rove/releases/tag/v${e}`;function oC(){return U()===`zh`?Qi:Zi}function sC(e,t){return e.request(`update.check`,{force:!0,locale:Mt.get(),channel:t}).then(e=>(nC.set(e),!0),()=>!1)}function cC(){let e=oC(),t=y(nC),{prefs:n}=Lp();if(!n.updateNotify||!t?.info?.hasUpdate)return null;let r=iC(e.available,{version:t.info.latest});return(0,W.jsxs)(G,{variant:`row`,className:`${qt} whitespace-nowrap font-mono text-meta text-warning`,"aria-label":`${H(`rail.update`)} · ${r}`,title:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},onClick:()=>V(`update`),children:[`↑`,(0,W.jsxs)(`span`,{className:`rail-tight:hidden`,children:[` `,t.info.latest]})]})}function lC({notes:e}){return e.map(e=>(0,W.jsxs)(`section`,{className:BS,children:[(0,W.jsxs)(`h2`,{className:`mono`,children:[`v`,e.version]}),(0,W.jsx)(tC,{body:e.body})]},e.version))}var uC=1e3;function dC(e){let[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)(!0);return(0,m.useEffect)(()=>{if(!r)return;let t=!0,a,o=()=>e.request(`update.status`,{}).then(e=>{t&&(n(e.status),e.status?.running?a=setTimeout(o,uC):i(!1))},()=>t&&i(!1));return o(),()=>{t=!1,clearTimeout(a)}},[e,r]),{run:t,setRun:n,poll:()=>i(!0)}}function fC({client:e}){let t=oC(),n=y(nC),[r,i]=(0,m.useState)(!1),a=y(rC),[o,s]=(0,m.useState)(null),{run:c,setRun:l,poll:u}=dC(e),d=(0,m.useRef)(null);(0,m.useEffect)(()=>{d.current?.focus(),sC(e).finally(()=>i(!0))},[e]);let f=n?.info??null,p=n?.current??``,h=f?.latest??p,g=f?.hasUpdate===!0,_=r&&f===null,v=r&&f!==null&&!g,b=n?.notes??[],x=b[0]?.url??(h?aC(h):null),S=c?.code===0,[C,w]=(0,m.useState)(!1),T=g&&!c?.running&&!S,E=n=>{if(n===`close`)return N.set(null);if(n===`restart`){if(!S||C)return;w(!0),e.request(`update.restart`,{}).catch(e=>e instanceof Go&&w(!1));return}if(n===`update`){if(!T)return;s(null),e.request(`update.run`,{}).then(e=>{l(e.status),u()},e=>{if(e instanceof Go&&e.code===`BUSY`)return u();s(iC(t.webStartFailed,{error:e instanceof Error?e.message:String(e)}))});return}s(x&&window.open(x,`_blank`,`noopener`)!==null?t.statusReleaseOpened:t.statusReleaseError)};return(0,m.useEffect)(()=>{!r||!a||(rC.set(!1),g&&E(`update`))},[r,g,a]),(0,W.jsxs)(`div`,{className:RS,tabIndex:0,ref:d,onKeyDown:e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`c`&&!window.getSelection()?.toString())return e.preventDefault(),E(`close`);if(!(e.metaKey||e.ctrlKey||e.altKey)){if(e.key===`Enter`&&e.target===d.current)E(S?`restart`:T?`update`:`release`);else if(e.key===`Enter`)return;else if(e.key===`u`)E(`update`);else if(e.key===`r`)E(`release`);else if(e.key===`q`||e.key===`Escape`)E(`close`);else return;e.preventDefault()}},children:[(0,W.jsx)(`h1`,{className:bS,children:H(`rail.update`)}),(0,W.jsxs)(`div`,{className:zS,children:[(0,W.jsxs)(`p`,{className:`mono ${LS}`,children:[(0,W.jsx)(`span`,{className:`text-muted`,children:t.current}),` `,(0,W.jsxs)(`b`,{children:[`v`,p]}),` `,(0,W.jsx)(`span`,{className:`text-muted`,children:t.latest}),` `,_?(0,W.jsx)(`b`,{className:`text-muted`,children:t.latestUnknown}):r?(0,W.jsxs)(`b`,{className:g?`text-warning`:`text-success`,children:[`v`,h]}):(0,W.jsx)(`span`,{className:`text-muted`,children:`…`})]}),_&&(0,W.jsx)(`p`,{className:`text-muted`,children:t.registryRetry}),v&&(0,W.jsx)(`p`,{className:`text-success`,children:t.upToDate}),o&&(0,W.jsx)(`p`,{className:`mono text-accent`,children:o}),c&&(0,W.jsxs)(W.Fragment,{children:[c.output&&(0,W.jsx)(`pre`,{className:`my-2 max-h-[40vh] overflow-auto whitespace-pre-wrap wrap-anywhere rounded-sm bg-inset p-2 font-mono text-[length:var(--fs-meta)]`,children:c.output}),(0,W.jsx)(`p`,{className:`mono ${c.running?`text-muted`:c.code===0?`text-success`:`text-error`}`,children:c.running?iC(t.webRunning,{command:c.command}):c.code===0?C?t.webRestarting:iC(t.webInstalled,{latest:h}):iC(t.updateFailed,{code:String(c.code)})})]}),g&&(0,W.jsx)(`p`,{className:`mono text-muted`,children:iC(t.changesSectionHeader,{from:p,to:h})}),!r&&(0,W.jsx)(`p`,{className:`text-muted`,children:t.loadingNotes}),r&&g&&b.length===0&&(0,W.jsx)(`p`,{className:`text-muted`,children:t.notesUnavailable}),(0,W.jsx)(lC,{notes:b})]}),(0,W.jsxs)(`div`,{className:`${Pr} pt-2.5`,children:[x?(0,W.jsx)(`a`,{className:jr,href:x,target:`_blank`,rel:`noopener noreferrer`,"aria-keyshortcuts":`r`,children:t.actions.openRelease}):(0,W.jsx)(`span`,{className:`text-muted`,children:t.releaseUrlUnavailable}),S&&(0,W.jsx)(G,{variant:`filled`,disabled:C,onClick:()=>E(`restart`),children:t.webRestart}),T&&(0,W.jsx)(G,{variant:`filled`,"aria-keyshortcuts":`u`,onClick:()=>E(`update`),children:t.actions.updateNow})]})]})}var pC=`rove.whatsNewSeenVersion`,mC=e=>e.split(/[.-]/).slice(0,3).map(Number),hC=(e,t)=>{let[n,r]=[mC(e),mC(t)];for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)>(r[e]??0);return!1};function gC(e,t){let n=localStorage.getItem(pC);localStorage.setItem(pC,t),!(!n||!hC(t,n))&&e.request(`release.notes`,{version:t.replace(/-.*$/,``),locale:Mt.get()}).then(e=>O.set((0,W.jsx)(_C,{from:n,to:t,notes:e.notes})),()=>O.set((0,W.jsx)(_C,{from:n,to:t,notes:null})))}function _C(e){let t=oC(),n=(0,m.useRef)(null);return(0,m.useEffect)(()=>n.current?.focus(),[]),(0,m.useEffect)(()=>{let e=e=>{e.key===`q`&&O.set(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.jsxs)(Ci,{title:t.whatsNew.title,wide:!0,children:[(0,W.jsx)(`p`,{className:`text-muted`,children:iC(t.whatsNew.upgraded,{from:e.from,to:e.to})}),(0,W.jsx)(`div`,{className:VS,children:e.notes?(0,W.jsx)(tC,{body:e.notes.body}):(0,W.jsx)(`p`,{className:`text-muted`,children:t.whatsNew.notesUnavailable})}),(0,W.jsxs)(`div`,{className:Pr,children:[(0,W.jsx)(`span`,{className:`mono text-muted ${HS} touch:hidden!`,children:H(`whatsNew.keys`)}),(0,W.jsx)(`a`,{className:jr,href:e.notes?.url??aC(e.to),target:`_blank`,rel:`noopener noreferrer`,children:H(`whatsNew.openRelease`)}),(0,W.jsx)(`button`,{ref:n,type:`button`,className:xr(),onClick:()=>O.set(null),children:H(`whatsNew.continue`)})]})]})}var vC=(e,t)=>e.replace(`{version}`,t);function yC({client:e}){let t=oC(),n=y(nC),{prefs:r}=Lp(),[i,a]=(0,m.useState)(`idle`),o=()=>{a(`checking`),sC(e,r.updateChannel).then(e=>a(e?`done`:`failed`))},s=t=>{a(`idle`),Fp(e,`updateChannel`,t)},c=n?.info??null,l=i===`failed`||i===`done`&&c===null,u=i===`done`&&n&&c?c.hasUpdate?vC(t.available,c.latest):t.upToDate:l?t.latestUnknown:void 0,d=l?`text-muted`:c?.hasUpdate?`text-warning`:`text-success`;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(gS,{label:Q(`general.updateChannelTitle`),hint:Q(`general.updatesHint`),value:r.updateChannel,picks:jb.map(e=>({value:e,label:Q(`general.updateChannelName.${e}`)})),onPick:s}),(0,W.jsx)(mS,{label:Q(`general.updateNotify`),hint:Q(`general.updateNotifyHint`),checked:r.updateNotify,onChange:t=>void Fp(e,`updateNotify`,t)}),(0,W.jsxs)(pS,{label:Q(`general.updates`),hint:Q(`general.updateCheckHint`),children:[i===`done`&&c?.hasUpdate&&(0,W.jsx)(G,{variant:`action`,onClick:()=>{B(),V(`update`)},children:Q(`general.updateOpenPage`)}),(0,W.jsx)(G,{variant:`action`,disabled:i===`checking`,onClick:o,children:Q(i===`checking`?`general.updateChecking`:`general.updateCheckButton`)})]}),u&&(0,W.jsx)(pS,{label:(0,W.jsx)(`span`,{className:d,children:u}),hint:c?.hasUpdate?(0,W.jsx)(`code`,{className:`font-mono`,children:`rove update`}):void 0,children:i===`done`&&n&&c&&(0,W.jsx)(`span`,{className:`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,title:`${t.latest} v${c.latest}`,children:`${t.current} v${n.current} · ${t.latest} v${c.latest}`})})]})}function bC({client:e}){let[t,n]=(0,m.useState)(null),[r,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(null),u=()=>e.request(`auth.status`).then(n,()=>n(null));if((0,m.useEffect)(()=>void u(),[e]),!t)return null;let d=async(t,n)=>{l(null);try{let r=n===void 0?{mode:t}:{mode:t,password:n},{token:o}=await e.request(`auth.setMode`,r);if(o){i(o),window.location.reload();return}a(!1),s(``),await u()}catch(e){l(e instanceof Error?e.message:String(e))}},f=r?`password`:t.mode,p=o.length<t.minPassword;return(0,W.jsxs)(fS,{title:H(`settings.about.access`),children:[(0,W.jsx)(gS,{label:H(`settings.about.signIn`),hint:H(`settings.about.signInHint.${f}`),value:f,picks:t.modes.map(e=>({value:e,label:H(`settings.about.signInMode.${e}`)})),onPick:e=>{e===`password`&&!t.hasPassword?a(!0):d(e)}}),f===`password`&&(0,W.jsxs)(pS,{label:H(t.hasPassword?`settings.about.passwordChange`:`settings.about.passwordSet`),hint:c??H(`settings.about.passwordHint`,{min:t.minPassword}),children:[(0,W.jsx)(`input`,{className:`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none w-48`,type:`password`,autoComplete:`new-password`,"aria-label":H(`settings.about.passwordField`),placeholder:H(`settings.about.passwordField`),value:o,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&!p&&void d(`password`,o)}),(0,W.jsx)(G,{variant:`action`,disabled:p,onClick:()=>void d(`password`,o),children:H(`settings.about.passwordSave`)})]})]})}function xC({client:e}){let[t,n]=(0,m.useState)(()=>X(e,`daemon.info`)??null);return(0,m.useEffect)(()=>{Z(e,`daemon.info`).then(n,()=>n(null))},[e]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fS,{title:H(`settings.about.groupRove`),children:[t?.daemonVersion&&(0,W.jsx)(pS,{label:H(`settings.about.daemon`),hint:H(t.stale?`settings.about.daemonStale`:`settings.about.daemonCurrent`,{version:t.daemonVersion})}),(0,W.jsx)(yC,{client:e})]}),(0,W.jsx)(bC,{client:e}),(0,W.jsx)(fS,{title:H(`settings.about.browser`),children:(0,W.jsx)(pS,{label:H(`settings.about.signOut`),hint:H(`settings.about.browserHint`),children:(0,W.jsx)(G,{variant:`action`,onClick:()=>void fs().then(()=>window.location.reload()),children:H(`settings.about.signOut`)})})})]})}var SC=e=>new Map((e?.engines??[]).flatMap(e=>e.icon?[[e.id,e.icon]]:[]));function CC(e){let[t,n]=(0,m.useState)(()=>SC(X(e,`engines.list`))),r=y(e.tasks)!==null;return(0,m.useEffect)(()=>{r&&Z(e,`engines.list`).then(e=>n(SC(e))).catch(()=>{})},[e,r]),t}var wC=[`both`,`engine`,`dots`];function TC(){return Lp().prefs.statusMark??`both`}function EC(e,t){Fp(e,`statusMark`,t)}var DC=`block size-4 flex-none translate-y-px`,OC=`animate-mark-pulse motion-reduce:[animation-duration:4.8s]`;function kC(e){let t=e.status?.look;if(t===`waiting`||t===`error`)return(0,W.jsx)(`span`,{className:`${DC} text-center font-mono text-meta leading-4 font-semibold ${Cp[e.status?.tone??`muted`]}`,"aria-hidden":`true`,children:t===`waiting`?`?`:`!`});let n=e.status&&(t===`idle`?`text-muted`:Cp[e.status.tone]);return(0,W.jsx)(`svg`,{className:`${DC} ${n??(e.icon?`text-ink`:`text-muted`)} ${t===`working`?OC:``}`,viewBox:e.icon?.viewBox??`0 0 14 14`,role:e.name?`img`:void 0,"aria-label":e.name,"aria-hidden":!e.name||void 0,children:e.icon?e.icon.paths.map(e=>(0,W.jsx)(`path`,{d:e.d,fill:n?`currentColor`:e.fill??`currentColor`,fillRule:e.evenodd?`evenodd`:void 0},e.d)):(0,W.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`})})}var AC=[{label:`settings.appearance.previewWorking`,status:{kind:`running`,since:0}},{label:`settings.appearance.previewDone`,status:{kind:`unseen`,since:0}},{label:`settings.appearance.previewIdle`,status:{kind:`idle`,since:0}},{label:`settings.appearance.previewWaiting`,status:{kind:`needs-input`,since:0}},{label:`settings.appearance.previewBroken`,status:{kind:`attention`,reason:`error`,since:0}}];function jC({model:e}){let t=TC(),[n]=[...CC(e).values()];return(0,W.jsx)(`span`,{className:rx,"aria-hidden":`true`,children:AC.map(({label:e,status:r})=>(0,W.jsxs)(`span`,{className:ix,children:[t!==`dots`&&(0,W.jsx)(kC,{icon:n,status:t===`engine`?Fg(r):void 0}),(0,W.jsx)(`span`,{className:`text-ink`,children:H(e)}),t!==`engine`&&(0,W.jsx)(Xg,{status:r})]},e))})}function MC(){return(0,W.jsx)(`span`,{className:`${ix} ${vi} ${yi}`,"aria-hidden":`true`,children:H(`settings.appearance.previewTitle`)})}function NC(){return(0,W.jsx)(`span`,{className:`${ax} ${kn}`,"aria-hidden":`true`})}function PC(e,t){return e===`auto`?t?`dark`:`light`:e}function FC(e,t,n){let r=e.find(e=>e.name===t)??e.find(e=>e.name===`claude`);return r?r[n]:null}var IC=e=>[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16));function LC(e){let[t=0,n=0,r=0]=IC(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function RC(e,t){let[n=0,r=0]=[LC(e),LC(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)}var zC=4.5,BC=1.1;function VC(e,t,n){let r=e=>t.every(t=>RC(e,t)>=n(t));if(r(e))return e;let i=IC(e),a=LC(t[0])<.18?255:0;for(let e=.02;e<1;e+=.02){let t=i.map(t=>Math.round(t+(a-t)*e).toString(16).padStart(2,`0`)).join(``);if(r(`#${t}`))return`#${t}`}return a?`#ffffff`:`#000000`}function HC(e){let t=[e.background,e.backgroundPanel,e.backgroundElement,e.backgroundMenu],n=VC(e.diffLineNumber,t,()=>zC);return{muted:VC(e.textMuted,t,e=>Math.max(zC,RC(n,e)*BC)),subtle:n}}function UC(e,t){let n=t.colorblind===`on`,r=HC(e);return{"--paper":e.background,"--surface":e.backgroundPanel,"--inset":e.backgroundElement,"--menu":e.backgroundMenu,"--line":e.border,"--line-active":e.borderActive,"--line-subtle":e.borderSubtle,"--ink":e.text,"--muted":r.muted,"--subtle":r.subtle,"--accent":e.primary,"--error":e.error,"--success":e.success,"--warning":e.warning,"--info":e.info,"--merged":e.syntaxType,"--focus":e[t.focusAccent]??e.primary,"--diff-added":(n?e.diffAddedColorblind:e.diffAdded)??e.diffAdded,"--diff-removed":e.diffRemoved,"--diff-added-bg":(n?e.diffAddedBgColorblind:e.diffAddedBg)??e.diffAddedBg,"--diff-removed-bg":e.diffRemovedBg}}function WC(e){return{background:e.background,foreground:e.text,cursor:e.primary,cursorAccent:e.background,selectionBackground:e.backgroundMenu,black:e.background,red:e.error,green:e.success,yellow:e.warning,blue:e.info,magenta:e.syntaxType,cyan:e.secondary,white:e.textMuted,brightBlack:e.diffLineNumber,brightRed:e.error,brightGreen:e.success,brightYellow:e.warning,brightBlue:e.info,brightMagenta:e.syntaxType,brightCyan:e.secondary,brightWhite:e.text}}var GC=v(null),KC=v(null),qC=v(null);function JC({theme:e,mode:t}){let n=e[t],r=(e,t)=>({background:e,width:t});return(0,W.jsxs)(`span`,{className:$x,style:{background:n.background,borderColor:n.border},"aria-hidden":!0,children:[(0,W.jsxs)(`span`,{className:eS,style:{background:n.backgroundPanel},children:[(0,W.jsx)(`span`,{className:nS,style:r(n.primary,`70%`)}),(0,W.jsx)(`span`,{className:nS,style:r(n.textMuted,`85%`)}),(0,W.jsx)(`span`,{className:nS,style:r(n.textMuted,`55%`)})]}),(0,W.jsxs)(`span`,{className:tS,children:[(0,W.jsx)(`span`,{className:nS,style:r(n.text,`90%`)}),(0,W.jsx)(`span`,{className:nS,style:r(n.textMuted,`65%`)}),(0,W.jsx)(`span`,{className:nS,style:r(n.accent??n.primary,`40%`)}),(0,W.jsx)(`span`,{className:rS,children:[n.success,n.warning,n.error,n.info].map((e,t)=>(0,W.jsx)(`span`,{className:iS,style:{background:e}},t))})]})]})}function YC(e){return(0,W.jsxs)(G,{variant:`card`,"aria-pressed":e.active,className:Qx(e.active),onMouseEnter:()=>KC.set(e.theme),onFocus:()=>KC.set(e.theme),onClick:e.onClick,children:[(0,W.jsx)(JC,{theme:e.theme,mode:e.mode}),(0,W.jsxs)(`span`,{className:aS,children:[(0,W.jsx)(`span`,{className:`truncate text-ink`,children:e.theme.name}),e.tag&&(0,W.jsx)(`span`,{className:`text-subtle`,children:e.tag})]})]})}function XC({children:e}){return(0,W.jsx)(`div`,{className:Xx,onMouseLeave:()=>KC.set(null),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||KC.set(null)},children:e})}function ZC(e){let{model:t}=e,{client:n}=t,r=y(qC),[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1);(0,m.useEffect)(()=>()=>KC.set(null),[]),(0,m.useEffect)(()=>void Pp(n).catch(()=>void 0),[n]),(0,m.useEffect)(()=>{qC.get()===null&&n.request(`theme.hosted`).then(e=>qC.set(e),()=>qC.set({themes:[],dir:null}))},[n]);let f=e=>{l(!1),eb(t,H(`prefs.themeAgentPrompt`,{dir:e})).catch(()=>l(!0))},p=r?.dir??null,h=async e=>{a(e),s(null);try{await n.request(`theme.install`,{name:e}),await Pp(n),await Fp(n,`theme`,e)}catch{s(e)}finally{a(null)}},g=new Set(e.themes.map(e=>e.name)),_=(r?.themes??[]).filter(e=>!g.has(e.name));return(0,W.jsxs)(pS,{label:e.label,hint:H(`prefs.themePreviewHint`),stack:!0,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:Zx,children:H(`prefs.themeInstalled`)}),(0,W.jsx)(XC,{children:e.themes.map(t=>(0,W.jsx)(YC,{theme:t,mode:e.mode,active:t.name===e.value,tag:t.bundled?void 0:H(`prefs.themeUser`),onClick:()=>t.name!==e.value&&void Fp(n,`theme`,t.name)},t.name))})]}),_.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(G,{className:`inline-flex items-center gap-1.5`,"aria-expanded":u,onClick:()=>d(!u),children:[(0,W.jsx)(hs,{right:!u}),u?H(`prefs.themeHide`):H(`prefs.themeBrowse`,{count:_.length})]}),u&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`m-0 pb-1.5 text-meta font-medium text-subtle mt-2.5`,children:H(`prefs.themeMoreHint`)}),(0,W.jsx)(XC,{children:_.map(t=>(0,W.jsx)(YC,{theme:t,mode:e.mode,active:!1,tag:i===t.name?H(`prefs.themeInstalling`):o===t.name?H(`prefs.themeInstallFailed`):H(`prefs.themeGet`),onClick:()=>i===null&&void h(t.name)},t.name))})]})]}),p&&(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(G,{variant:`action`,onClick:()=>f(p),children:H(`prefs.themeAgent`)}),(0,W.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:H(c?`prefs.themeAgentFailed`:`prefs.themeAgentHint`)})]})]})}var QC=v({}),$C=``,ew=`(prefers-color-scheme: dark)`;function tw(e){let t=window.matchMedia(ew);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function nw(){return(0,m.useSyncExternalStore)(tw,()=>window.matchMedia(ew).matches)}function rw(){let e=nw();return PC(Lp().prefs.themeMode,e)}function iw(e){let t=rw(),n=Lp();(0,m.useEffect)(()=>{if(!n.loaded||n.prefs.taskColors!==`on`)return;let r=`${n.prefs.theme}/${t}`;r!==$C&&($C=r,QC.set({}));let i=()=>{let i=QC.get(),a=e.tasks.get(),o=[...a?.tasks??[],...a?.archived??[]].map(e=>e.id).filter(e=>!(e in i));o.length!==0&&e.client.request(`theme.taskColors`,{theme:n.prefs.theme,mode:t,taskIds:o}).then(e=>{$C===r&&QC.set({...QC.get(),...e.colors})}).catch(()=>void 0)};return i(),e.tasks.subscribe(i)},[e,t,n.loaded,n.prefs.taskColors,n.prefs.theme])}function aw(e){let t=Lp(),n=y(QC);return e&&t.prefs.taskColors===`on`?n[e]:void 0}var ow={themeMode:{dark:`appearance.modeDark`,light:`appearance.modeLight`,auto:`appearance.modeAuto`},focusAccent:{primary:`general.accentPrimary`,success:`general.accentSuccess`,info:`general.accentInfo`},splitStyle:{box:`general.splitBox`,line:`general.splitLine`,rail:`general.splitRail`,rule:`general.splitRule`},railFold:{glyphs:`general.railFoldGlyphs`,initials:`general.railFoldInitials`,hairline:`general.railFoldHairline`},workingBorder:{flow:`appearance.borderFlow`,still:`appearance.borderStill`},runningTitle:{shimmer:`appearance.titleShimmer`,still:`appearance.titleStill`}},sw={engine:`settings.appearance.statusMarkEngine`,both:`settings.appearance.statusMarkBoth`,dots:`settings.appearance.statusMarkDots`};function cw({model:e}){let{client:t}=e,n=Lp(),r=rw(),i=y(Vp),a=TC(),o=(e,n)=>void Fp(t,e,n),s=(e,t,r,i)=>(0,W.jsx)(gS,{label:Q(t),hint:r,sample:i,value:n.prefs[e],picks:Rp(n,e).map(t=>({value:t,label:e===`themeMode`&&t===`auto`?H(`prefs.modeAuto`):Q(ow[e]?.[String(t)]??String(t))})),onPick:t=>o(e,t)}),c=(e,t,r)=>(0,W.jsx)(mS,{label:Q(t),hint:r,checked:n.prefs[e]===`on`,onChange:t=>o(e,t?`on`:`off`)});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fS,{children:[(0,W.jsx)(ZC,{model:e,label:Q(`general.theme`),themes:n.themes,value:n.prefs.theme,mode:r}),s(`themeMode`,`general.themeMode`)]}),(0,W.jsxs)(fS,{title:H(`settings.appearance.groupColours`),children:[s(`focusAccent`,`general.focusAccent`,Q(`general.focusAccentHint`)),c(`taskColors`,`general.taskColors`,H(`settings.appearance.taskColorsNote`)),c(`colorblind`,`general.colorblind`,H(`settings.appearance.colorblindNote`))]}),(0,W.jsxs)(fS,{title:H(`settings.appearance.groupTasks`),children:[s(`workingBorder`,`general.workingBorder`,H(`settings.appearance.workingBorderNote`),(0,W.jsx)(NC,{})),s(`runningTitle`,`general.runningTitle`,void 0,(0,W.jsx)(MC,{})),s(`splitStyle`,`general.splitStyle`),s(`railFold`,`general.railFold`,Q(`general.railFoldHint`)),(0,W.jsx)(gS,{label:H(`settings.appearance.railGroup`),value:i,picks:zp.map(e=>({value:e,label:H(e===`state`?`settings.appearance.railGroupState`:`settings.appearance.railGroupProject`)})),onPick:Up}),(0,W.jsx)(gS,{label:H(`settings.appearance.statusMark`),sample:(0,W.jsx)(jC,{model:e}),value:a,picks:wC.map(e=>({value:e,label:H(sw[e])})),onPick:e=>EC(t,e)})]})]})}function lw(e,t,n){if(t===`offline`)return`offline`;if(t===`unsupported`||t===`mismatch`)return`outdated`;if(!e)return`loading`;let r=e.status;return r?r.gh?r.account?r.account===n?`same`:`different`:`signedOut`:`noGh`:e.reason===`failed`||!e.reason?`failed`:e.reason}var uw=e=>e===``?{}:{machine:e},dw=2e3,fw=e=>e?.login?.state===`pending`||e?.login?.state===`syncing`;function pw(e){let{client:t}=e,n=rg(e),[r,i]=(0,m.useState)({}),[a,o]=(0,m.useState)(!1),s=(0,m.useMemo)(()=>{let e={};for(let i of[``,...n.map(e=>e.alias)]){let n=r[i]??X(t,`github.status`,uw(i));n&&(e[i]=n)}return e},[r,n,t]),c=n.flatMap(e=>e.state===`online`?[e.alias]:[]).join(`
|
|
52
|
-
`),l=(0,m.useMemo)(()=>c?c.split(`
|
|
53
|
-
`):[],[c]),u=(0,m.useRef)(new Set),d=(0,m.useCallback)(async e=>{let n=await Z(t,`github.status`,uw(e)).catch(e=>({status:null,reason:`failed`,message:K(e)}));i(t=>({...t,[e]:n}))},[t]),f=(0,m.useCallback)(async()=>{o(!0);try{await Promise.all([``,...l].map(d))}finally{o(!1)}},[d,l]);return(0,m.useEffect)(()=>{f()},[f]),(0,m.useEffect)(()=>{let e=new Set(Object.entries(s).flatMap(([e,t])=>fw(t.status)?[e]:[])),t=[...u.current].some(t=>!e.has(t));if(u.current=e,t&&f(),e.size===0)return;let n=window.setTimeout(()=>{for(let t of e)d(t)},dw);return()=>window.clearTimeout(n)},[s,d,f]),{machines:n,probes:s,refreshing:a,refresh:f,probe:d,act:(0,m.useCallback)(async(e,n)=>{try{let r=await t.request(e,n);return r.ok||z(r.message,`error`),r}catch(e){return z(K(e),`error`),null}},[t])}}var mw={same:`markSame`,different:`markDifferent`,signedOut:`markSignedOut`,noGh:`markNoGh`,outdated:`markOutdated`,offline:`markOffline`,denied:`markDenied`,failed:`markFailed`},hw=(e,t)=>H(`settings.connectors.${e}`,t),gw={same:`text-diff-added`,signedOut:`text-diff-removed`,failed:`text-diff-removed`,denied:`text-diff-removed`,different:`text-warning`,outdated:`text-warning`,offline:`text-muted`,noGh:`text-muted`,loading:`text-muted`};function _w(e,t){return e===`loading`?hw(`loading`):hw(mw[e],{login:t?.account??``})}function vw(e){if(!e?.gh)return``;let t=e.ssh.ok?`✓ ${e.ssh.user??``}`.trim():`✗`;return hw(`detail`,{protocol:e.protocol??`—`,ssh:t})}function yw(){return(0,W.jsx)(`svg`,{className:`size-7 flex-none`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z`})})}function bw(e){navigator.clipboard.writeText(e).then(()=>z(hw(`codeCopied`)),()=>{})}function xw({login:e,onCancel:t}){return e.state===`failed`?(0,W.jsxs)(`div`,{className:Sx,children:[(0,W.jsx)(`span`,{className:`text-muted`,children:hw(`loginFailed`,{error:e.error??``})}),(0,W.jsx)(G,{className:`ml-auto`,onClick:t,children:hw(`dismiss`)})]}):e.state===`syncing`?(0,W.jsx)(`div`,{className:Sx,children:(0,W.jsx)(`span`,{className:`text-muted`,children:hw(`syncing`)})}):(0,W.jsxs)(`div`,{className:Sx,children:[e.code?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,className:`font-mono font-normal normal-nums rounded-sm border-hairline border-dashed border-line px-2 py-0.5 text-display tracking-code`,title:hw(`codeHint`),onClick:()=>bw(e.code??``),children:e.code}),(0,W.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:hw(`openGithub`)})]}):(0,W.jsx)(`span`,{className:`text-muted`,children:hw(`loading`)}),(0,W.jsx)(G,{className:`ml-auto`,onClick:t,children:H(`dialog.cancel`)})]})}function Sw(e){let t=lw(e.probe,e.machine,e.rove),n=e.probe?.status??null,r=fw(n),i=t===`different`||t===`signedOut`,a=n?.login,o=vw(n),s=i&&!r;return(0,W.jsxs)(`div`,{className:sS(),children:[(0,W.jsxs)(`div`,{className:cS,children:[(0,W.jsx)(`span`,{className:`${fx} min-w-0 flex-1 truncate`,children:e.name}),(0,W.jsx)(`span`,{className:`whitespace-nowrap text-meta ${gw[t]}`,title:e.probe?.message,children:_w(t,n)})]}),o&&(0,W.jsx)(`span`,{className:Kx(),title:[n?.authDetail,n?.ssh.detail].filter(Boolean).join(`, `)||void 0,children:o}),s&&(e.onSync||e.onLogin)&&(0,W.jsxs)(`div`,{className:`mt-auto flex flex-wrap gap-2`,children:[e.onSync&&e.rove&&(0,W.jsx)(G,{variant:`action`,disabled:e.busy,onClick:e.onSync,children:hw(`useRove`)}),e.onLogin&&(0,W.jsx)(G,{variant:`action`,disabled:e.busy,onClick:e.onLogin,children:hw(`loginThere`)})]}),a&&(0,W.jsx)(xw,{login:a,onCancel:e.onCancel})]})}function Cw({model:e}){let{machines:t,probes:n,refreshing:r,refresh:i,probe:a,act:o}=pw(e),[s,c]=(0,m.useState)(null),[l,u]=(0,m.useState)(!1),d=n[``],f=d?.status?.account??null,p=fw(d?.status),h=async(e,t)=>{c(e);try{await t()}finally{c(null)}},g=e=>h(e,async()=>{await o(`github.login`,e===``?{}:{machine:e}),await a(e)}),_=e=>h(e,async()=>{await o(`github.login`,e===``?{cancel:!0}:{machine:e,cancel:!0}),await a(e)}),v=e=>h(e,async()=>{(await o(`github.sync`,{machine:e}))?.ok&&z(hw(`synced`,{machine:e,login:f??``})),await a(e)}),y=()=>h(``,async()=>{(await o(`github.logout`,{}))?.ok&&u(!1),await i()});return(0,W.jsxs)(`div`,{className:oS,children:[(0,W.jsxs)(`div`,{className:sS(!0),children:[(0,W.jsxs)(`div`,{className:`${cS} w-narrow:flex-wrap`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3 w-narrow:basis-full`,children:[(0,W.jsx)(yw,{}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,W.jsx)(`span`,{className:fx,children:`GitHub`}),(0,W.jsx)(`span`,{className:px,children:hw(`githubDescription`)})]})]}),f?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:mx,children:[`@`,f]}),(0,W.jsx)(G,{variant:`action`,disabled:s!==null,onClick:()=>u(!0),children:hw(`disconnect`)})]}):d?!p&&(0,W.jsx)(G,{variant:`filled`,disabled:s!==null,onClick:()=>void g(``),children:hw(`connect`)}):(0,W.jsx)(`span`,{className:`text-meta text-muted`,children:hw(`loading`)})]}),l&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border-hairline border-line bg-inset px-3 py-2.5 [&_p]:m-0 [&_p]:text-meta [&_p]:text-muted`,children:[(0,W.jsx)(`p`,{children:hw(`disconnectBody`)}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2.5`,children:[(0,W.jsx)(G,{onClick:()=>u(!1),children:H(`dialog.cancel`)}),(0,W.jsx)(G,{variant:`danger`,disabled:s!==null,onClick:()=>void y(),children:hw(`disconnect`)})]})]}),!f&&d?.status?.login&&(0,W.jsx)(xw,{login:d.status.login,onCancel:()=>void _(``)})]}),(f||!d)&&(0,W.jsxs)(`section`,{className:`col-span-2 flex flex-col pt-4 w-narrow:col-span-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pb-1.5 [&>h2]:pb-0`,children:[(0,W.jsx)(`h2`,{className:`m-0 pb-1.5 font-sans text-meta font-medium normal-nums text-muted`,children:hw(`machines`)}),r?(0,W.jsx)(`span`,{className:`text-meta text-muted`,children:hw(`refreshing`)}):(0,W.jsx)(G,{onClick:()=>void i(),children:hw(`refresh`)})]}),(0,W.jsx)(`p`,{className:`m-0 pb-2 text-meta text-subtle`,children:hw(`machinesHint`)}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-2.5 w-narrow:grid-cols-1`,children:[(0,W.jsx)(Sw,{name:hw(`thisMachine`),probe:d,machine:null,rove:f,busy:s!==null,onCancel:()=>void _(``)}),t.map(e=>(0,W.jsx)(Sw,{name:e.alias,probe:n[e.alias],machine:e.state,rove:f,busy:s!==null,onSync:()=>void v(e.alias),onLogin:()=>void g(e.alias),onCancel:()=>void _(e.alias)},e.alias))]})]})]})}function ww({model:e}){return(0,W.jsx)(Cw,{model:e})}var Tw=[{key:`remoteProjects`,label:`dev.remote`,hint:`dev.remoteHint`},{key:`autoStatus`,label:`dev.autoStatus`,hint:`dev.autoStatusHint`},{key:`dispatcher`,label:`dev.dispatcher`,hint:`dev.dispatcherHint`}];function Ew({client:e}){let{prefs:t}=Lp(),[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(!1),o=async()=>{if(n){a(!0);try{if(n===`reset`){await e.request(`dev.reset`),localStorage.removeItem(`rove.prefs`),window.location.reload();return}await e.request(`daemon.restart`),z(Q(`restart.done`)),r(null)}catch(e){z(K(e),`error`)}finally{a(!1)}}},s=(e,t,a,s,c)=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(pS,{label:t,hint:a,children:(0,W.jsx)(G,{variant:`action`,onClick:()=>r(e),children:s})}),n===e&&(0,W.jsx)(`div`,{className:`pb-3`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border-hairline border-line bg-inset px-3 py-2.5 [&_p]:m-0 [&_p]:text-meta [&_p]:text-muted`,children:[(0,W.jsx)(`strong`,{children:Q(`${e}.title`)}),(0,W.jsx)(`p`,{children:H(e===`reset`?`prefs.resetBody`:`prefs.restartBody`)}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2.5`,children:[(0,W.jsx)(G,{onClick:()=>r(null),children:H(`dialog.cancel`)}),(0,W.jsx)(G,{variant:c?`danger`:`filled`,disabled:i,onClick:()=>void o(),children:s})]})]})})]});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(fS,{title:Q(`dev.experimental`),children:Tw.map(n=>(0,W.jsx)(mS,{label:Q(n.label),hint:Q(n.hint),checked:t[n.key],onChange:t=>void Fp(e,n.key,t)},n.key))}),(0,W.jsxs)(fS,{hint:Q(`dev.doctorHint`),children:[s(`restart`,Q(`dev.restart`),H(`prefs.restartHint`),H(`prefs.restartButton`),!1),s(`reset`,Q(`dev.reset`),H(`prefs.resetHint`),H(`prefs.resetButton`),!0)]})]})}function Dw(e){return e.binaryFound===void 0?{key:`settings.engines.status.checking`,tone:`unknown`}:e.binaryFound===null?{key:`settings.engines.status.unknown`,tone:`unknown`}:e.binaryFound?e.configIssue?{key:`settings.engines.status.integrationBlocked`,tone:`error`}:e.login===`no`?{key:`settings.engines.status.signIn`,tone:`attention`}:e.hooks===`outdated`?{key:`settings.engines.status.integrationOutdated`,tone:`attention`}:e.hooks===`not-installed`?{key:`settings.engines.status.integrationMissing`,tone:`attention`}:{key:`settings.engines.status.ready`,tone:`ready`}:e.commandChosen?{key:`settings.engines.status.notOnPath`,tone:`attention`}:{key:`settings.engines.status.notInstalled`,tone:`absent`}}var Ow=v([]),kw=3e4;function Aw(e){return e.request(`skill.missing`).then(e=>Ow.set(e.engines),()=>{})}function jw(e){(0,m.useEffect)(()=>{let t=e.onOpen(()=>void Aw(e)),n=Oi(kw,()=>void Aw(e));return()=>{t(),n()}},[e])}function Mw(e){return e.request(`skill.install`).then(e=>{e.error&&z(Q(`engines.skill.failed`,{reason:e.error}),`error`)}).catch(e=>z(K(e),`error`)).then(()=>Aw(e))}function Nw(e){return Dw({binaryFound:e.binaryFound,login:e.login,hooks:e.hooks,configIssue:e.configIssue,commandChosen:e.custom||e.customized})}var Pw={ready:`ready`,attention:`attention`,error:`error`,absent:`absent`,unknown:`absent`};function Fw({client:e}){let[t,n]=(0,m.useState)(()=>X(e,`engines.settings`)?.engines??null),[r,i]=(0,m.useState)(null),a=(0,m.useCallback)(()=>Z(e,`engines.settings`).then(e=>n(e.engines),e=>z(K(e),`error`)),[e]);(0,m.useEffect)(()=>{a()},[a]);let o=(t,n={})=>void e.request(t,n).then(a).catch(e=>z(K(e),`error`));return t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`p`,{className:ox,children:Q(`engines.hint`)}),(0,W.jsxs)(`div`,{className:wx,children:[(0,W.jsxs)(`div`,{className:Tx,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{children:Q(`engines.defaultMark`)}),(0,W.jsx)(`span`,{children:Q(`engines.available`)})]}),t.map(e=>(0,W.jsx)(Iw,{engine:e,open:r===e.id,onToggleOpen:()=>i(r===e.id?null:e.id),run:o},e.id))]})]}),(0,W.jsx)(zw,{engines:t,run:o}),(0,W.jsx)(Bw,{engines:t,client:e,reload:a})]}):(0,W.jsx)(`p`,{className:hx,children:H(`preview.loading`)})}function Iw(e){let{engine:t,run:n}=e,r=(0,m.useId)(),i=Nw(t),a=t.binaryFound===!1;return(0,W.jsxs)(`div`,{className:Ex,children:[(0,W.jsxs)(`div`,{className:Dx,children:[(0,W.jsxs)(`button`,{type:`button`,className:Ox,"aria-expanded":e.open,"aria-controls":r,onClick:e.onToggleOpen,children:[(0,W.jsx)(hs,{right:!e.open,className:kx(e.open)}),(0,W.jsxs)(`span`,{className:Ax,children:[(0,W.jsxs)(`span`,{className:jx(!t.enabled),children:[t.name,t.renamedFrom?(0,W.jsx)(`span`,{className:Mx,children:t.renamedFrom}):null,t.custom&&!t.renamedFrom?(0,W.jsx)(`span`,{className:Mx,children:Q(`engines.customTag`)}):null]}),(0,W.jsxs)(`span`,{className:Px(Pw[i.tone]),children:[(0,W.jsx)(`span`,{className:Fx(Pw[i.tone]),"aria-hidden":`true`}),Q(i.key.slice(9))]})]})]}),(0,W.jsx)(`div`,{className:Ix,children:t.isDefault?(0,W.jsx)(`span`,{className:Lx,children:Q(`engines.defaultMark`)}):t.canBeDefault&&!a?(0,W.jsx)(`button`,{type:`button`,className:Rx,"aria-label":H(`settings.engines.default`,{name:t.name}),onClick:()=>n(`engine.setDefault`,{id:t.id}),children:Q(`engines.makeDefault`)}):null}),a?(0,W.jsx)(`span`,{}):(0,W.jsx)(dS,{on:t.enabled,"aria-label":H(`settings.engines.enabled`,{name:t.name}),onClick:()=>n(`engine.setEnabled`,{id:t.id,enabled:!t.enabled})})]}),e.open?(0,W.jsx)(Rw,{id:r,engine:t,run:n}):null]})}function Lw(e){if(e.configIssue)return Q(`engines.detail.hooksBlockedHere`,{reason:e.configIssue});switch(e.hooks){case`installed`:return Q(`engines.detail.hooksInstalled`);case`outdated`:return Q(`engines.detail.hooksOutdated`);case`not-installed`:return e.binaryFound===!1?Q(`engines.detail.hooksAwaitEngine`):Q(`engines.detail.hooksMissing`);default:return Q(`engines.detail.hooksUnsupported`)}}function Rw(e){let{engine:t,run:n}=e,[r,i]=(0,m.useState)(null),a=t.binaryFound===!0?Q(`engines.detail.programFound`,{binary:t.binary,path:t.binaryPath??t.binary}):t.binaryFound===!1?Q(`engines.detail.programMissing`,{binary:t.binary}):Q(`engines.detail.programUnknown`,{binary:t.binary}),o=t.login===`yes`?Q(`engines.detail.signedIn`):t.login===`no`?Q(`engines.detail.signedOut`):Q(`engines.detail.signInUnknown`),s=[Lw(t),Q(t.markers?`engines.detail.markersYes`:`engines.detail.markersNo`),Q(t.screen?`engines.detail.screenYes`:t.hooks===`installed`?`engines.detail.screenNotNeeded`:`engines.detail.screenNo`)];return(0,W.jsxs)(`div`,{id:e.id,className:zx,children:[(0,W.jsxs)(`dl`,{className:Bx,children:[(0,W.jsx)(`dt`,{className:Vx,children:Q(`engines.detail.program`)}),(0,W.jsx)(`dd`,{className:Hx(t.binaryFound===!1),children:a}),(0,W.jsx)(`dt`,{className:Vx,children:Q(`engines.detail.signIn`)}),(0,W.jsx)(`dd`,{className:Hx(t.login===`no`),children:o}),(0,W.jsx)(`dt`,{className:Vx,children:Q(`engines.detail.reporting`)}),(0,W.jsx)(`dd`,{className:Hx(!1),children:s.map(e=>(0,W.jsx)(`span`,{className:`block`,children:e},e))}),t.skill===`unsupported`?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:Vx,children:Q(`engines.detail.skill`)}),(0,W.jsx)(`dd`,{className:Hx(t.skill!==`installed`),children:Q(t.skill===`installed`?`engines.detail.skillInstalledHere`:t.skill===`outdated`?`engines.detail.skillOutdated`:`engines.detail.skillMissing`)})]}),t.custom?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:Vx,children:Q(`engines.detail.adapter`)}),(0,W.jsx)(`dd`,{className:Hx(!1),children:t.protocol?Q(`engines.detail.adapterDeclared`,{protocol:t.protocol}):Q(`engines.detail.adapterGeneric`)})]}):null]}),r===null?(0,W.jsxs)(`div`,{className:Ux,children:[(0,W.jsx)(G,{variant:`action`,onClick:()=>i(t.name),children:H(`settings.engines.rename`)}),t.custom||t.customized?(0,W.jsx)(G,{variant:`action`,onClick:()=>n(`engine.reset`,{id:t.id}),children:t.custom?H(`settings.engines.remove`):H(`settings.engines.reset`)}):null]}):(0,W.jsxs)(`form`,{className:Ux,onSubmit:e=>{e.preventDefault(),n(`engine.rename`,{id:t.id,name:r}),i(null)},children:[(0,W.jsx)(`input`,{className:`${Mr} w-full ${Wx}`,autoFocus:!0,value:r,"aria-label":H(`settings.engines.rename`),placeholder:H(`settings.engines.namePlaceholder`),onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i(null))}}),(0,W.jsx)(G,{variant:`filled`,type:`submit`,children:H(`settings.engines.save`)}),(0,W.jsx)(G,{variant:`action`,onClick:()=>i(null),children:H(`settings.engines.cancel`)})]})]})}function zw({engines:e,run:t}){let n=e.filter(e=>e.hooks!==`unsupported`),r=n.filter(e=>e.binaryFound!==!1),i=r.filter(e=>e.hooks===`installed`).length,a=r.length-i,o=n.filter(e=>e.hooks!==`not-installed`).length;return n.length===0?null:(0,W.jsx)(fS,{title:Q(`engines.integrations.title`),hint:Q(`engines.integrations.hint`),children:(0,W.jsx)(pS,{label:Q(`engines.integrations.summary`,{installed:i,total:r.length}),children:(0,W.jsxs)(`div`,{className:xx,children:[a>0?(0,W.jsx)(G,{variant:`filled`,onClick:()=>t(`engines.hooks.install`),children:Q(`engines.integrations.install`,{count:a})}):(0,W.jsx)(`span`,{className:Gx,children:Q(`engines.integrations.upToDate`)}),o>0?(0,W.jsx)(G,{variant:`action`,onClick:()=>t(`engines.hooks.uninstall`),children:Q(`engines.integrations.remove`,{count:o})}):null]})})})}function Bw(e){let t=e.engines.filter(e=>e.skill!==`unsupported`),n=t.filter(e=>e.skill===`installed`).length,r=t.length-n;return(0,W.jsx)(fS,{title:Q(`engines.skill.title`),hint:Q(`engines.skill.hint`),children:(0,W.jsx)(pS,{label:t.length>0?Q(`engines.integrations.summary`,{installed:n,total:t.length}):Q(`engines.skill.noEngines`),children:r>0?(0,W.jsx)(G,{variant:`filled`,onClick:()=>void Mw(e.client).then(e.reload),children:Q(`engines.skill.install`,{count:r})}):t.length>0?(0,W.jsx)(`span`,{className:Gx,children:Q(`engines.integrations.upToDate`)}):null})})}var Vw={bug:`settings.feedback.kindBug`,idea:`settings.feedback.kindIdea`,question:`settings.feedback.kindQuestion`};function Hw({model:e}){let[t,n]=(0,m.useState)(`bug`),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1);return(0,W.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:n=>{n.preventDefault(),!(!r.trim()||!a.trim())&&(c(!0),u(null),e.client.request(`feedback.send`,{title:r.trim(),body:a,kind:t}).then(e=>{u(e),e.filed&&(i(``),o(``))}).catch(e=>z(K(e),`error`)).finally(()=>c(!1)))},children:[(0,W.jsx)(`p`,{className:`m-0 ${px}`,children:H(`settings.feedback.hint`)}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`div`,{className:xx,children:(0,W.jsx)(G,{variant:`action`,type:`button`,onClick:()=>{f(!1),tb(e).catch(()=>f(!0))},children:H(`settings.feedback.report`)})}),(0,W.jsx)(`p`,{className:`m-0 ${px}`,children:H(d?`settings.feedback.reportFailed`:`settings.feedback.reportNote`)})]}),(0,W.jsxs)(`label`,{className:vx,children:[(0,W.jsx)(`span`,{className:yx,children:H(`settings.feedback.kindLabel`)}),(0,W.jsx)(`select`,{className:`${gx} w-full`,value:t,onChange:e=>n(e.target.value),children:Object.keys(Vw).map(e=>(0,W.jsx)(`option`,{value:e,children:H(Vw[e])},e))})]}),(0,W.jsxs)(`label`,{className:vx,children:[(0,W.jsx)(`span`,{className:yx,children:H(`settings.feedback.titleLabel`)}),(0,W.jsx)(`input`,{className:`${gx} w-full`,value:r,onChange:e=>i(e.target.value)})]}),(0,W.jsxs)(`label`,{className:vx,children:[(0,W.jsx)(`span`,{className:yx,children:H(`settings.feedback.body`)}),(0,W.jsx)(`textarea`,{className:`${gx} ${bx} w-full`,rows:6,value:a,onChange:e=>o(e.target.value)})]}),l&&(0,W.jsxs)(`p`,{className:`m-0 text-meta text-muted [&_a]:text-accent break-words`,children:[l.filed?H(`settings.feedback.sent`,{number:l.number??0}):H(`settings.feedback.notFiled`,{hint:l.hint??``}),` `,(0,W.jsx)(`a`,{className:`underline`,href:l.url,target:`_blank`,rel:`noreferrer`,children:l.filed?l.url:H(`settings.feedback.openLink`)})]}),(0,W.jsx)(`div`,{className:xx,children:(0,W.jsx)(G,{variant:`filled`,type:`submit`,disabled:s||!r.trim()||!a.trim(),children:H(`settings.feedback.send`)})})]})}var Uw=[{value:`en`,label:`English`},{value:`zh`,label:`中文`}],Ww={default:`general.worktreeKindDefault`,nextToProject:`general.worktreeKindNext`,custom:`general.worktreeKindCustom`};function Gw({model:e}){let{client:t}=e,n=Lp(),{prefs:r,info:i}=n,a=(e,n)=>void Fp(t,e,n),o=[`default`,`nextToProject`];(i.worktreeCustomPath||r.worktreeBase===`custom`)&&o.push(`custom`);let s=o.map(e=>({value:e,label:Q(Ww[e])}));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fS,{title:H(`settings.general.groupInterface`),children:[(0,W.jsx)(gS,{label:Q(`general.language`),hint:H(`prefs.languageHint`),value:r.locale,picks:Uw,onPick:e=>a(`locale`,e)}),(0,W.jsx)(mS,{label:Q(`general.keyHintsShow`),hint:H(`settings.general.tuiKeyHints`),checked:r.keyHints,onChange:e=>a(`keyHints`,e)}),(0,W.jsx)(gS,{label:H(`settings.general.tabStrip`),value:r.tabStrip,picks:Rp(n,`tabStrip`).map(e=>({value:e,label:Q(`general.tabStripMode.${e}`)})),onPick:e=>a(`tabStrip`,e)})]}),(0,W.jsx)(fS,{title:H(`settings.general.groupFiles`),children:(0,W.jsx)(gS,{label:Q(`general.worktree`),hint:Q(`general.worktreeHint`),value:r.worktreeBase,picks:s,onPick:e=>a(`worktreeBase`,e)})}),(0,W.jsx)(fS,{title:H(`settings.general.groupTerminal`),hint:Q(`general.terminalHint`),children:(0,W.jsx)(Kw,{client:t})})]})}function Kw({client:e}){let t=Lp(),n=t.options.scrollbackRows,r=n&&`min`in n?n:{min:100,max:1e5},[i,a]=(0,m.useState)(String(t.prefs.scrollbackRows));return(0,m.useEffect)(()=>a(String(t.prefs.scrollbackRows)),[t.prefs.scrollbackRows]),(0,W.jsx)(pS,{label:H(`settings.general.scrollback`),hint:Q(`general.scrollbackRowHint`),children:(0,W.jsx)(`input`,{className:_x,inputMode:`numeric`,value:i,"aria-label":Q(`general.scrollbackTitle`),onChange:e=>a(e.target.value),onBlur:()=>{let n=Number(i);if(i.trim()===``||!Number.isInteger(n)){a(String(t.prefs.scrollbackRows));return}let o=Math.min(r.max,Math.max(r.min,n));o===t.prefs.scrollbackRows?a(String(o)):Fp(e,`scrollbackRows`,o)},onKeyDown:e=>e.key===`Enter`&&e.currentTarget.blur()})})}var qw=`prefix.key`;function Jw(e,t,n){let r=t.find(e=>e===`enter`||e.endsWith(`+enter`))??t[0];if(r===void 0)return{kind:`more`,recording:e};if(t.includes(`escape`))return{kind:`cancel`};if(e.prefixArmed)return{kind:`done`,mode:`prefix`,keys:[r]};if(e.got.length===0&&n.some(e=>t.includes(e)))return{kind:`more`,recording:{...e,prefixArmed:!0}};let i=[...e.got,r];return i.length<e.slots?{kind:`more`,recording:{...e,got:i}}:{kind:`done`,mode:`direct`,keys:i}}function Yw(){return ml(ul().filter(e=>e.keys.length>0||e.prefixKeys!==void 0)).flatMap(e=>[...e.rows])}[...Array.from({length:12},(e,t)=>`f${t+1}`)];function Xw(e,t){let n=`alternating [${e}, ${t}] pairs`;return{layout:n,slots:[e,t],validateCount:e=>e>=2&&e%2==0?null:`needs ${n} (an even number of chords — got ${e})`}}var Zw={"sidebar.goto":Xw(`top (double-tap)`,`bottom`),"sidebar.nav":Xw(`down`,`up`),"files.nav":Xw(`down`,`up`),"diff.review.cursor":Xw(`down`,`up`),"sidebar.search.nav":Xw(`down`,`up`),"files.hierarchy":Xw(`collapse`,`expand`),"files.tab":Xw(`previous tab`,`next tab`),"app.quit":{layout:`[quit confirm, hard exit] (second chord optional)`,validateCount:e=>e<=2?null:`needs [quit confirm, hard exit] (1 or 2 chords — got ${e})`}};function Qw(e){return Zw[e]?.slots??[]}var $w=`group/cap relative inline-flex flex-none items-stretch rounded-sm border-hairline bg-surface font-mono text-meta has-[:focus-visible]:outline-1 has-[:focus-visible]:outline-offset-1 has-[:focus-visible]:outline-focus`,eT={idle:`border-line text-ink hover:border-line-active`,changed:`border-line text-accent hover:border-line-active`,empty:`border-dashed border-line text-subtle hover:border-line-active`,active:`border-accent text-accent`},tT=`absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full border-hairline border-line bg-paper p-0 leading-none text-subtle hover:border-line-active hover:text-error focus-visible:opacity-100 group-hover/cap:opacity-100 touch:size-5 touch:opacity-100 touch:after:absolute touch:after:-inset-2.5 touch:after:content-['']`;function nT(e){return(0,W.jsxs)(`span`,{className:Rt($w,eT[e.tone??`idle`]),children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":e.label,className:`px-2 py-1 touch:min-h-10`,onClick:e.onPress,children:e.children}),e.onRemove&&(0,W.jsx)(`button`,{type:`button`,"aria-label":e.removeLabel,className:Rt(tT,!e.removeShown&&`opacity-0`),onClick:e.onRemove,children:`×`})]})}var rT=new Set([`app.quit`,`view.redraw`]),iT=ml(Yw().filter(e=>!rT.has(e.id)));function aT(e){let[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)(null),a=(0,m.useRef)(t);a.current=t;let o=async(t,n)=>{try{let r=await e.request(`keybindings.set`,{id:t,...n});i({id:t,lines:r.lines}),await po(e)}catch(e){z(K(e),`error`)}},s=(0,m.useRef)(o);s.current=o;let c=t!==null;return(0,m.useEffect)(()=>{if(!c)return;let e=e=>{e.preventDefault(),e.stopImmediatePropagation();let t=a.current;if(!t||[`Control`,`Shift`,`Alt`,`Meta`].includes(e.key))return;let r=t.id===`prefix.key`?[]:lo.get().prefix.firstStrokes,i=Jw(t,sl(e),r);if(i.kind===`more`)return n(i.recording);n(null),i.kind===`done`&&s.current(t.id,{[i.mode]:i.keys})};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[c]),{recording:t,notice:r,record:e=>{i(null),n({id:e,slots:Math.max(1,Qw(e).length),got:[],prefixArmed:!1})},save:(e,t)=>void o(e,t)}}function oT(e,t){if(e.prefixArmed)return Q(`keybindings.recordingPrefix`,{prefix:t});let n=Qw(e.id)[e.got.length];return n?Q(`keybindings.recordingSlot`,{slot:n}):Q(`keybindings.recording`)}function sT(e){let{editor:t,id:n}=e,r=()=>t.record(n),i=H(`keys.recordFor`,{name:e.name});if(t.recording?.id===n)return(0,W.jsx)(nT,{tone:`active`,label:i,onPress:r,children:oT(t.recording,e.prefixName)});let a=e.changed?`changed`:`idle`,o=t.notice?.id===n,s=e.prefix??[];return e.direct.length===0&&s.length===0?(0,W.jsx)(nT,{tone:`empty`,label:i,onPress:r,children:Q(`keybindings.unbound`)}):(0,W.jsxs)(W.Fragment,{children:[e.direct.length>0&&(0,W.jsx)(nT,{tone:a,label:i,onPress:r,onRemove:()=>t.save(n,{direct:[]}),removeLabel:H(`keys.removeFor`,{name:e.name}),removeShown:o,children:e.direct.join(` / `)}),s.length>0&&(0,W.jsx)(nT,{tone:a,label:i,onPress:r,onRemove:()=>t.save(n,{prefix:[]}),removeLabel:H(`keys.removeFor`,{name:e.name}),removeShown:o,children:s.map(t=>`${e.prefixName} ${t}`).join(` / `)})]})}function cT(e,t,n,r){let i=e.notice?.id===t?e.notice.lines:[];return i.length>0?(0,W.jsx)(`span`,{className:`text-warning`,children:i.join(` `)}):n===null?r:(0,W.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2`,children:[Q(`keybindings.defaultKeys`,{keys:n}),(0,W.jsx)(G,{hit:`tight`,onClick:()=>e.save(t,{direct:`default`,prefix:`default`}),children:H(`keys.reset`)})]})}function lT({editor:e,keys:t}){let n=t.prefix.key??Q(`keybindings.prefixDisabled`),r=(e,t=[])=>[...e,...t.map(e=>`${n} ${e}`)].join(` / `);return(0,W.jsx)(W.Fragment,{children:iT.map(i=>(0,W.jsx)(fS,{title:Fl(i.category),children:i.rows.map(i=>{let a=t.rows.find(e=>e.id===i.id),o=Nl(i.id);return(0,W.jsx)(pS,{label:o,hint:cT(e,i.id,a?r(i.keys,i.prefixKeys):null),children:(0,W.jsx)(sT,{editor:e,id:i.id,name:o,direct:a?.keys??i.keys,prefix:a?a.prefixKeys:i.prefixKeys,prefixName:n,changed:a!==void 0})},i.id)})},i.category))})}function uT({model:e}){let{client:t}=e,{prefs:n}=Lp(),r=y(lo),[i,a]=(0,m.useState)(!1);(0,m.useEffect)(()=>void po(t),[t]);let o=r.prefix.key??Q(`keybindings.prefixDisabled`),s=aT(t),c=co.prefix.firstStrokes,l=r.prefix.firstStrokes.join()!==c.join();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fS,{hint:H(`keys.editHint`),children:[(0,W.jsx)(gS,{label:Q(`keybindings.tapPresentation`),hint:Q(`keybindings.tapPresentationHint`),value:n.prefixTap,picks:[{value:`local`,label:Q(`keybindings.tapPresentationLocal`)},{value:`guide`,label:Q(`keybindings.tapPresentationGuide`)}],onPick:e=>void Fp(t,`prefixTap`,e)}),(0,W.jsx)(pS,{label:Q(`keybindings.prefixTitle`,{prefix:o}),hint:cT(s,qw,l?c.join(` / `):null,Q(`keybindings.prefixHint`,{prefix:o,timeout:r.prefix.timeoutMs})),children:(0,W.jsx)(sT,{editor:s,id:qw,name:Q(`keybindings.prefixKey`),direct:r.prefix.firstStrokes,prefixName:o,changed:l})})]}),r.warnings.length>0&&(0,W.jsx)(fS,{title:Q(`keybindings.warnings`),children:r.warnings.map(e=>(0,W.jsx)(pS,{label:(0,W.jsx)(`span`,{className:`text-warning`,children:e})},e))}),(0,W.jsx)(lT,{editor:s,keys:r}),r.plugins.length>0&&(0,W.jsx)(fS,{title:H(`keys.pluginChords`),children:r.plugins.map(e=>(0,W.jsx)(pS,{label:(0,W.jsx)(`span`,{className:`font-mono`,children:e.chord}),hint:(0,W.jsx)(`span`,{className:`font-mono`,children:`${e.kind}:${e.target}`})},e.chord))}),(0,W.jsx)(fS,{title:Q(`keybindings.configFile`),hint:H(`prefs.keysYaml`),children:(0,W.jsx)(pS,{label:(0,W.jsx)(`span`,{className:`font-mono break-all`,children:r.path+(r.exists?``:Q(`keybindings.notCreated`))}),hint:H(i?`keys.agentFailed`:`keys.agentHint`),children:(0,W.jsx)(G,{variant:`action`,onClick:()=>{a(!1),eb(e,H(`keys.agentPrompt`,{path:r.path})).catch(()=>a(!0))},children:H(`keys.agent`)})})})]})}var dT=`/assets/pulse-3XJkP4CJ.wav`;function fT(e,t){return e===`error`||t}function pT(e,t,n=!1){return n?e.kind===`error`:t||e.kind!==`done`||e.turnEnd!==!0}function mT(e,t,n=!1){return t&&e.silent!==!0&&!n}function hT(e){return e===`permission_needed`?`needs_input`:e===`error`||e===`rate_limited`||e===`dead`?`error`:e===`turn_complete`?`done`:null}function gT(e,t,n,r){if(e===null)return[];let i=[];for(let[a,o]of t){if(a===n||e.get(a)===o)continue;let t=r(o);t&&i.push({key:a,kind:t})}return i}function _T(){return window.isSecureContext&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window}var vT=()=>navigator.serviceWorker.register(`sw.js`);async function yT(e){if(!_T())return`unsupported`;if(Notification.permission===`denied`)return`blocked`;let t=await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription();if(!t)return`off`;let{subscribed:n}=await e.request(`push.status`,{endpoint:t.endpoint});return n?`on`:`off`}async function bT(e){if(!_T())return`unsupported`;if(await Notification.requestPermission()!==`granted`)return`blocked`;let t=await vT();await navigator.serviceWorker.ready;let{publicKey:n}=await e.request(`push.key`),r=await t.pushManager.getSubscription();return r?.options.applicationServerKey&&ET(r.options.applicationServerKey)!==n&&(await r.unsubscribe(),r=null),r??=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:TT(n)}),await e.request(`push.subscribe`,{subscription:r.toJSON()}),`on`}async function xT(e){let t=await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription();return t&&(await e.request(`push.unsubscribe`,{endpoint:t.endpoint}),await t.unsubscribe()),`off`}async function ST(e,t,n,r){let i={body:r,tag:`task:${e}:${t}`,icon:`icon-192.png`,data:{taskId:e}},a=`serviceWorker`in navigator?await navigator.serviceWorker.getRegistration():void 0;if(a)return a.showNotification(`Rove — ${n}`,i);let o=new Notification(`Rove — ${n}`,i);o.onclick=()=>{window.focus(),CT?.(e),o.close()}}var CT=null;function wT(e){CT=t=>e.selectWhenListed(t);let t=new URLSearchParams(window.location.search),n=t.get(`task`);if(n){t.delete(`task`);let r=t.toString();history.replaceState(null,``,`${window.location.pathname}${r?`?${r}`:``}${window.location.hash}`),e.selectWhenListed(n)}let r=()=>{CT=null};if(!(`serviceWorker`in navigator))return r;let i=t=>{let n=t.data;n?.type===`rove.openTask`&&typeof n.taskId==`string`&&n.taskId&&e.selectWhenListed(n.taskId)};return navigator.serviceWorker.addEventListener(`message`,i),()=>{r(),navigator.serviceWorker.removeEventListener(`message`,i)}}function TT(e){let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(t,e=>e.charCodeAt(0))}function ET(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var DT={done:`✓`,needs_input:`?`,error:`✕`};function OT(e){let t=new Audio(dT);t.volume=Math.min(1,Math.max(0,e)),t.play().catch(()=>void 0)}function kT(e,t,n){!document.hidden||typeof Notification>`u`||Notification.permission!==`granted`||ST(e,t,n,DT[t]).catch(()=>void 0)}function AT(){typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()}function jT(e){let t=new Map;for(let n of e.tasks)n.activity&&t.set(n.id,n.activity.state);return t}function MT(e){let t=(0,m.useRef)(null);(0,m.useEffect)(()=>{let n=()=>{let n=e.tasks.get();if(!n)return;let r=jT(n),i=gT(t.current,r,null,hT);t.current=r;let{prefs:a}=Ap.get();if(!a.crossTask)return;let o=e.selection.get().taskId,s=new Map(n.tasks.map(e=>[e.id,e.label]));for(let{key:t,kind:n}of i){if(t===o||!pT({kind:n,turnEnd:!0},a.finishedAlerts))continue;let r=s.get(t)??t;fT(n,a.toast)&&z(`${DT[n]} ${r}`,n===`error`?`error`:`info`,{label:H(`workspace.openTask`),run:()=>e.select(t)}),mT({},a.sound)&&(OT(a.soundVolume),kT(t,n,r))}};return n(),e.tasks.subscribe(n)},[e])}function NT({client:e}){let[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)(null);(0,m.useEffect)(()=>{yT(e).then(n,()=>n(`off`))},[e]);let a=t=>{i(null),(t?bT(e):xT(e)).then(n,e=>i(e instanceof Error?e.message:String(e)))},o=r?H(`prefs.pushFailed`,{error:r}):H(t===`unsupported`?`prefs.pushUnsupported`:t===`blocked`?`prefs.pushBlocked`:`prefs.pushHint`);return(0,W.jsx)(mS,{label:H(`prefs.push`),hint:o,checked:t===`on`,disabled:t===null||t===`unsupported`||t===`blocked`,onChange:a})}function PT({model:e}){let{client:t}=e,n=Lp(),{prefs:r}=n,i=(e,n)=>void Fp(t,e,n);return(0,W.jsxs)(fS,{children:[(0,W.jsx)(mS,{label:Q(`general.toast`),hint:H(`settings.notifications.toastNote`),checked:r.toast,onChange:e=>i(`toast`,e)}),(0,W.jsx)(mS,{label:Q(`general.sound`),hint:H(`prefs.soundHint`),checked:r.sound,onChange:e=>{e&&AT(),i(`sound`,e)}}),(0,W.jsx)(gS,{label:H(`settings.notifications.volume`),hint:H(`prefs.soundVolumeHint`),value:r.soundVolume,picks:Rp(n,`soundVolume`).map(e=>({value:e,label:`${Math.round(e*100)}%`})),onPick:e=>{Ap.get().prefs.sound&&OT(e),i(`soundVolume`,e)}}),(0,W.jsx)(mS,{label:Q(`general.crossTask`),hint:Q(`general.crossTaskHint`),checked:r.crossTask,onChange:e=>i(`crossTask`,e)}),(0,W.jsx)(mS,{label:Q(`general.finishedAlerts`),hint:Q(`general.finishedAlertsHint`),checked:r.finishedAlerts,onChange:e=>i(`finishedAlerts`,e)}),(0,W.jsx)(NT,{client:t})]})}var FT={kanban:`kanban`,issues:`issues`};function IT({model:e}){let t=y(e.installedMods),[n,r]=(0,m.useState)(()=>X(e,`builtinMods.list`)?.mods??null);if((0,m.useEffect)(()=>{Z(e,`builtinMods.list`).then(e=>r(e.mods),()=>r([])),e.refreshMods()},[e]),!n||n.length===0)return null;let i=n=>{let r=!t.has(n.id);e.client.request(`builtinMod.setInstalled`,{id:n.id,installed:r}).then(()=>(!r&&N.get()===FT[n.id]&&N.set(null),e.refreshMods())).catch(e=>z(K(e),`error`))};return(0,W.jsx)(fS,{title:H(`settings.plugins.builtIn`),hint:H(`settings.plugins.builtInHint`),children:n.map(e=>(0,W.jsx)(pS,{label:e.name,hint:e.description,inline:!0,children:(0,W.jsx)(dS,{on:t.has(e.id),"aria-label":H(`settings.plugins.turnOn`,{name:e.name}),onClick:()=>i(e)})},e.id))})}function LT({model:e}){let{client:t}=e,[n,r]=(0,m.useState)(()=>X(t,`plugins.list`)?.plugins??null),i=(0,m.useCallback)(()=>Z(t,`plugins.list`).then(e=>r(e.plugins),e=>z(K(e),`error`)),[t]);return(0,m.useEffect)(()=>{i()},[i]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(IT,{model:e}),(0,W.jsx)(fS,{title:H(`settings.plugins.registered`),children:n?n.length===0?(0,W.jsx)(`p`,{className:hx,children:H(`settings.plugins.empty`)}):n.map(e=>(0,W.jsx)(pS,{label:e.id,hint:[e.version,e.linked?H(`settings.plugins.linked`):null,e.platformOk===!1?H(`settings.plugins.unsupportedPlatform`):null].filter(Boolean).join(`, `),inline:!0,children:(0,W.jsx)(dS,{on:e.enabled,"aria-label":e.id,onClick:()=>void t.request(`plugin.setEnabled`,{id:e.id,enabled:!e.enabled}).then(i).catch(e=>z(K(e),`error`))})},e.id)):(0,W.jsx)(`p`,{className:hx,children:H(`preview.loading`)})})]})}function RT(e){let[t,n]=(0,m.useState)(e.tier.engine),[r,i]=(0,m.useState)(e.tier.model??``),[a,o]=(0,m.useState)(e.tier.effort??``),s=e.engines.find(e=>e.id===t);return(0,W.jsxs)(`form`,{className:Yx,onSubmit:n=>{n.preventDefault(),e.onSave(t,s?.takesModel?r.trim():``,a)},onKeyDown:t=>{t.key===`Escape`&&(t.stopPropagation(),e.onCancel())},children:[(0,W.jsx)(Ub,{label:Q(`sections.engines`),value:t,picks:e.engines.map(e=>({value:e.id,label:e.name})),onPick:t=>{let r=e.engines.find(e=>e.id===t);n(t),r&&!r.effortLevels.includes(a)&&o(``),r&&!r.takesModel&&i(``)}}),s&&s.effortLevels.length>0&&(0,W.jsx)(Ub,{label:H(`prefs.tierEffort`),value:a,picks:[``,...s.effortLevels].map(e=>({value:e,label:e||Q(`autoRouting.engineDefault`)})),onPick:o}),s?.takesModel&&(0,W.jsx)(`input`,{className:`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none`,value:r,spellCheck:!1,placeholder:Q(`autoRouting.engineDefault`),"aria-label":H(`prefs.tierModel`),onChange:e=>i(e.target.value)}),(0,W.jsxs)(`div`,{className:xx,children:[(0,W.jsx)(G,{onClick:e.onCancel,children:H(`dialog.cancel`)}),(0,W.jsx)(G,{variant:`filled`,type:`submit`,children:Q(`action.save`)})]})]})}function zT({client:e}){let[t,n]=(0,m.useState)(()=>X(e,`autoRouting.get`)??null),[r,i]=(0,m.useState)(null),a=(0,m.useCallback)(()=>Z(e,`autoRouting.get`).then(n,e=>z(K(e),`error`)),[e]);(0,m.useEffect)(()=>{a()},[a]);let o=(t,n)=>e.request(t,n).then(a).catch(e=>z(K(e),`error`));if(!t)return(0,W.jsx)(`p`,{className:hx,children:H(`preview.loading`)});let s=t.classifier,c=[{value:`off`,label:Q(`autoRouting.classifierOff`)},{value:`jev`,label:`jev`},...s.canCustom||s.mode===`custom`?[{value:`custom`,label:Q(`autoRouting.classifierCustomLabel`)}]:[]],l=s.mode===`off`?Q(`autoRouting.classifierOffHint`):s.mode===`jev`?Q(`autoRouting.classifierJevHint`):Q(`autoRouting.classifierCustomHint`),u=s.keySource===`env`?Q(`autoRouting.keyPresentEnv`,{env:s.keyEnv??``}):s.keySource===`file`?Q(`autoRouting.keySaved`):s.keyConfigured?Q(`autoRouting.keyMissing`):Q(`autoRouting.keyCustomUnused`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(fS,{hint:Q(`autoRouting.hint`),children:[!t.configured&&(0,W.jsx)(pS,{label:(0,W.jsx)(`span`,{className:`text-warning`,children:Q(`autoRouting.unconfigured`)})}),t.tiers.map(e=>(0,W.jsxs)(`div`,{className:qx,children:[(0,W.jsxs)(`div`,{className:Jx,children:[(0,W.jsx)(`span`,{className:fx,children:Hb(`tier.${e.tier}`)}),(0,W.jsx)(`span`,{className:`${px} min-w-0 truncate`,children:[e.engineName,e.model??Q(`autoRouting.engineDefault`),e.effort??Q(`autoRouting.engineDefault`)].join(` · `)}),(0,W.jsx)(G,{className:`ml-auto`,onClick:()=>i(r===e.tier?null:e.tier),children:H(`prefs.tierEdit`)})]}),(0,W.jsx)(`span`,{className:px,children:Hb(`tierDesc.${e.tier}`)}),(0,W.jsx)(`span`,{className:`text-meta ${e.block?`text-warning`:`text-success`}`,children:e.block?Q(`autoRouting.unavailable`,{reason:e.block}):Q(`autoRouting.ready`)}),r===e.tier&&(0,W.jsx)(RT,{tier:e,engines:t.engines,onCancel:()=>i(null),onSave:(t,n,r)=>{i(null),o(`autoRouting.setTier`,{tier:e.tier,engine:t,model:n,effort:r})}})]},e.tier))]}),(0,W.jsxs)(fS,{title:Q(`autoRouting.classifierTitle`),hint:Q(`autoRouting.classifierHint`),children:[(0,W.jsx)(pS,{label:(0,W.jsx)(`span`,{className:s.mode===`off`?`text-muted`:`text-warning`,children:Q(`autoRouting.classifierDataFlow`)})}),(0,W.jsx)(gS,{label:Q(`autoRouting.classifierLabel`),hint:l.replace(/^[—\s]+/,``),value:s.mode,picks:c,onPick:e=>void o(`autoRouting.setClassifier`,{mode:e})})]}),(0,W.jsxs)(fS,{title:H(`prefs.classifierConnection`),hint:H(`prefs.editInTui`),children:[(0,W.jsx)(_S,{label:Q(`autoRouting.endpointLabel`),value:s.endpointHost||H(`prefs.unset`)}),(0,W.jsx)(_S,{label:Q(`autoRouting.thresholdLabel`),value:s.threshold.toFixed(2)}),(0,W.jsx)(pS,{label:Q(`autoRouting.keyLabel`),hint:u})]})]})}var BT=[{id:`preferences`,sections:[`general`,`appearance`,`notifications`,`snippets`,`keys`]},{id:`agents`,sections:[`engines`,`autoRouting`,`voice`,`connectors`,`plugins`]},{id:`more`,sections:[`about`,`feedback`,`dev`]}],VT=e=>({section:e??`general`,drilled:e!==void 0});function HT(e,t){return t&&e.drilled?`list`:`close`}var UT=e=>e.split(`
|
|
54
|
-
`,1)[0]??``;function WT(e){let[t,n]=(0,m.useState)(e.editing?.name??``),[r,i]=(0,m.useState)(e.editing?.text??``),[a,o]=(0,m.useState)(!1),s=nv.test(t)&&r.trim()!==``;return(0,W.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:n=>{n.preventDefault(),s&&(o(!0),ev(e.client,{name:t,text:r}).then(e.onDone).catch(e=>{z(K(e),`error`),o(!1)}))},children:[(0,W.jsxs)(`label`,{className:vx,children:[(0,W.jsx)(`span`,{className:yx,children:H(`snippets.name`)}),(0,W.jsx)(`input`,{className:`${gx} w-full font-mono`,value:t,maxLength:32,spellCheck:!1,autoComplete:`off`,autoFocus:!e.editing,readOnly:e.editing!==void 0,placeholder:H(`snippets.namePlaceholder`),onChange:e=>n(e.target.value)}),t!==``&&!nv.test(t)&&(0,W.jsx)(`span`,{className:`text-meta text-muted [&_a]:text-accent`,children:H(`snippets.badName`)})]}),(0,W.jsxs)(`label`,{className:vx,children:[(0,W.jsx)(`span`,{className:yx,children:H(`snippets.text`)}),(0,W.jsx)(`textarea`,{className:`${gx} ${bx} w-full`,rows:5,value:r,maxLength:8e3,placeholder:H(`snippets.textPlaceholder`),onChange:e=>i(e.target.value)})]}),(0,W.jsxs)(`div`,{className:xx,children:[(0,W.jsx)(G,{onClick:e.onDone,children:H(`snippets.cancel`)}),(0,W.jsx)(G,{type:`submit`,disabled:a||!s,children:H(`snippets.save`)})]})]})}function GT({model:e}){let{client:t}=e,n=Q_(),[r,i]=(0,m.useState)(null);return(0,m.useEffect)(()=>void $_(t).catch(()=>void 0),[t]),(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(fS,{children:[n.length===0&&r===null&&(0,W.jsx)(pS,{label:H(`snippets.empty`)}),n.map(e=>(0,W.jsxs)(pS,{label:(0,W.jsxs)(`span`,{className:`font-mono`,children:[`@`,e.name]}),hint:UT(e.text),children:[(0,W.jsx)(G,{onClick:()=>i(e),children:H(`snippets.edit`)}),(0,W.jsx)(G,{onClick:()=>void tv(t,e.name).then(()=>{i(null),z(H(`snippets.removed`,{name:e.name}))}).catch(e=>z(K(e),`error`)),children:H(`snippets.remove`)})]},e.name))]}),r===null?(0,W.jsx)(`div`,{className:xx,children:(0,W.jsx)(G,{onClick:()=>i(`new`),children:H(`snippets.add`)})}):(0,W.jsx)(WT,{client:t,editing:r===`new`?void 0:r,onDone:()=>i(null)},r===`new`?`new`:r.name)]})}function KT(e,t){return t===`left`?100-Math.min(100,Math.max(0,e)):e}var qT=e=>e>=95?`crit`:e>=75?`warn`:`ok`,JT=e=>String(e).padStart(2,`0`);function YT(e,t){if(e==null||e<=t)return``;let n=new Date(e),r=`${JT(n.getHours())}:${JT(n.getMinutes())}`;return e-t<864e5?`→ ${r}`:`→ ${n.getMonth()+1}/${n.getDate()} ${r}`}function XT(e,t,n=`used`){let r=e.windows.find(e=>e.kind===`session`)??e.windows[0];return r?{label:r.label,percentText:`${KT(r.percent,n)}%`,resetText:YT(r.resetsAt,t),tone:qT(r.percent)}:null}var ZT=1e4;function QT({client:e,inset:t=!0}){let n=y(e.conn),[r,i]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(n.state!==`open`)return;let t=!0,r=()=>e.request(`usage.get`,{}).then(e=>{t&&i(e.usage)}).catch(()=>{});r();let a=Oi(ZT,r);return()=>{t=!1,a()}},[e,n.state]);let a=Date.now(),o=(r??[]).flatMap(e=>{let t=XT({capturedAt:e.capturedAt,windows:e.windows},a);return t?[{vendor:e.vendor,name:e.name,chip:t}]:[]});return o.length===0?null:(0,W.jsx)(`div`,{className:`${zn} ${t?`px-2`:``}`,children:o.map(({vendor:e,name:t,chip:n})=>{let r=Math.min(100,Math.max(0,Number.parseInt(n.percentText,10)||0));return(0,W.jsxs)(G,{variant:`row`,className:Bn,title:`${t} · ${n.label} ${n.percentText} ${n.resetText}`.trim(),"aria-label":`${H(`usage.open`)}: ${t}`,onClick:()=>{B(),V(`usage`)},children:[(0,W.jsx)(`span`,{className:`truncate`,children:t}),(0,W.jsx)(`span`,{className:Un(n.tone),style:{"--fill":`${r}%`}}),(0,W.jsxs)(`span`,{children:[n.label,` `,(0,W.jsx)(`span`,{className:Vn[n.tone],children:n.percentText})]})]},e)})})}var $T=2e3;function eE(e){let[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)(null),a=(0,m.useCallback)(t=>{n(t),iy(e,t.available)},[e]),o=(0,m.useCallback)(()=>e.request(`voice.status`).then(a,e=>i(K(e))),[e,a]);(0,m.useEffect)(()=>void o(),[o]);let s=t?.setup?.install.phase===`running`||t?.available===!0&&!t.ready;return(0,m.useEffect)(()=>{if(!s)return;let e=window.setInterval(()=>void o(),$T);return()=>window.clearInterval(e)},[s,o]),{status:t,error:r,setError:i,accept:a}}function tE(e){let[t,n]=(0,m.useState)(!1);return t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:mx,children:e.ask}),(0,W.jsx)(G,{variant:`action`,disabled:e.disabled,onClick:()=>{n(!1),e.onConfirm()},children:e.label}),(0,W.jsx)(G,{variant:`action`,onClick:()=>n(!1),children:H(`voice.setup.cancel`)})]}):(0,W.jsx)(G,{variant:`action`,disabled:e.disabled,onClick:()=>n(!0),children:e.label})}function nE({client:e}){let{status:t,error:n,setError:r,accept:i}=eE(e),[a,o]=(0,m.useState)(!1),s=t?.setup,[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(``),[f,p]=(0,m.useState)(``),[h,g]=(0,m.useState)(``);(0,m.useEffect)(()=>{s?.cloud&&(d(e=>e||s.cloud?.baseURL||``),p(e=>e||s.cloud?.model||``))},[s?.cloud]);let _=(t,n)=>(o(!0),r(null),e.request(t,n).then(i,e=>r(K(e))).finally(()=>o(!1)));if(!t)return(0,W.jsx)(`p`,{className:hx,children:n??`…`});if(!s)return(0,W.jsx)(`p`,{className:hx,children:t.model??H(`voice.setup.unavailable`)});let v=s.install,y=v.phase===`running`,b=c?`cloud`:s.backend,x=e=>{if(e===`cloud`&&!s.cloud?.hasKey)return l(!0);l(!1),_(`voice.configure`,{backend:e})},S=b===`off`?H(`voice.setup.offHint`):c?H(`voice.setup.cloudNeeded`):b===`local`&&!s.localInstalled?H(y?`voice.setup.localInstalling`:`voice.setup.localNeeded`):t.ready?H(`voice.setup.ready`,{model:t.model??``}):t.error??H(`voice.setup.starting`),C=y?v.line??H(`voice.setup.installing`):v.phase===`failed`&&!s.localInstalled?H(`voice.setup.failed`,{line:v.line??``}):s.localInstalled?H(`voice.setup.installed`):s.blocked??H(`voice.setup.localHint`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(fS,{children:(0,W.jsx)(gS,{label:H(`voice.setup.dictation`),hint:S,value:b,picks:[`off`,`local`,`cloud`].map(e=>({value:e,label:H(`voice.setup.backend.${e}`)})),onPick:x})}),(b===`local`||s.localInstalled||y)&&(0,W.jsx)(fS,{title:H(`voice.setup.backend.local`),children:(0,W.jsx)(pS,{label:H(`voice.setup.localTitle`),hint:C,children:y?(0,W.jsx)(`span`,{className:`max-w-90 min-w-0 truncate font-mono text-meta text-muted [overflow-wrap:anywhere]`,children:H(`voice.setup.installing`)}):s.localInstalled?(0,W.jsx)(tE,{label:H(`voice.setup.uninstall`),ask:H(`voice.setup.uninstallAsk`),disabled:a,onConfirm:()=>void _(`voice.uninstall`)}):!s.blocked&&(0,W.jsx)(G,{variant:`action`,disabled:a,onClick:()=>void _(`voice.install`),children:H(`voice.setup.install`)})})}),(b===`cloud`||s.cloud)&&(0,W.jsx)(fS,{title:H(`voice.setup.cloudTitle`),hint:H(`voice.setup.cloudHint`),children:(0,W.jsxs)(`form`,{className:`flex flex-col gap-3 py-3`,onSubmit:e=>{e.preventDefault(),_(`voice.configure`,{backend:`cloud`,baseURL:u,model:f,apiKey:h}).then(()=>l(!1)),g(``)},children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-meta font-medium text-muted`,children:H(`voice.setup.baseURL`)}),(0,W.jsx)(`input`,{className:`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none font-mono`,value:u,placeholder:`https://api.openai.com/v1`,spellCheck:!1,autoComplete:`off`,onChange:e=>d(e.target.value)})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-meta font-medium text-muted`,children:H(`voice.setup.model`)}),(0,W.jsx)(`input`,{className:`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none font-mono`,value:f,placeholder:`gpt-4o-mini-transcribe`,spellCheck:!1,autoComplete:`off`,onChange:e=>p(e.target.value)})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-meta font-medium text-muted`,children:H(`voice.setup.apiKey`)}),(0,W.jsx)(`input`,{className:`rounded-sm border-hairline border-line bg-paper px-2.5 py-1.5 font-sans text-body text-ink focus-visible:border-line-active focus-visible:outline-none font-mono`,type:`password`,value:h,placeholder:s.cloud?.hasKey?H(`voice.setup.keySaved`):``,autoComplete:`off`,onChange:e=>g(e.target.value)})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2.5`,children:[s.cloud&&(0,W.jsx)(tE,{label:H(`voice.setup.forget`),ask:H(`voice.setup.forgetAsk`),disabled:a,onConfirm:()=>{d(``),p(``),_(`voice.forgetCloud`)}}),(0,W.jsx)(G,{variant:`action`,type:`submit`,disabled:a||!u.trim()||!f.trim()||!(h||s.cloud?.hasKey),children:H(s.backend===`cloud`?`voice.setup.save`:`voice.setup.saveAndUse`)})]})]})}),n&&(0,W.jsx)(`p`,{className:`m-0 py-3 text-body text-muted text-error`,children:n})]})}var rE={general:e=>(0,W.jsx)(Gw,{model:e}),appearance:e=>(0,W.jsx)(cw,{model:e}),notifications:e=>(0,W.jsx)(PT,{model:e}),snippets:e=>(0,W.jsx)(GT,{model:e}),keys:e=>(0,W.jsx)(uT,{model:e}),engines:e=>(0,W.jsx)(Fw,{client:e.client}),autoRouting:e=>(0,W.jsx)(zT,{client:e.client}),voice:e=>(0,W.jsx)(nE,{client:e.client}),connectors:e=>(0,W.jsx)(ww,{model:e}),plugins:e=>(0,W.jsx)(LT,{model:e}),about:e=>(0,W.jsx)(xC,{client:e.client}),feedback:e=>(0,W.jsx)(Hw,{model:e}),dev:e=>(0,W.jsx)(Ew,{client:e.client})},iE={general:`sections.general`,engines:`sections.engines`,autoRouting:`sections.autoRouting`,plugins:`sections.plugins`,keys:`sections.keys`,feedback:`sections.feedback`,dev:`sections.dev`},aE=e=>{let t=iE[e];return t?Q(t):H(`settings.sections.${e}`)};function oE(e){return(0,W.jsxs)(`nav`,{className:Xb,"aria-label":H(`settings.title`),children:[(0,W.jsx)(`h1`,{className:Zb,children:H(`settings.title`)}),BT.map(t=>(0,W.jsxs)(`div`,{className:Qb,children:[(0,W.jsx)(`p`,{className:$b,children:H(`settings.groups.${t.id}`)}),t.sections.map(n=>(0,W.jsxs)(G,{variant:`row`,className:ex(!e.narrow&&e.current===n,t.id===`more`),"aria-current":!e.narrow&&e.current===n?`page`:void 0,onClick:()=>e.onPick(n),children:[aE(n),(0,W.jsx)(hs,{right:!0,className:tx})]},n))]},t.id))]})}function sE({model:e,section:t}){U();let[n,r]=(0,m.useState)(()=>VT(t)),i=we(),a=()=>HT(n,i)===`list`?r({...n,drilled:!1}):B();(0,m.useEffect)(()=>{let e=document.querySelector(`.dialog`);e&&!e.contains(document.activeElement)&&e.focus()},[]),(0,m.useEffect)(()=>{let e=e=>{e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),a())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let o=y(Ae)===`panel`&&i&&n.drilled,s=!i||!n.drilled||o,c=!i||n.drilled;return(0,W.jsx)(`div`,{className:Gb,onMouseDown:e=>e.target===e.currentTarget&&B(),children:(0,W.jsxs)(`dialog`,{ref:i&&!n.drilled?je(B):void 0,tabIndex:-1,open:!0,className:Kb,"aria-label":H(`settings.title`),onKeyDown:e=>{let t=e.target;e.key===`Escape`&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.blur(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())},children:[i?s&&(0,W.jsx)(G,{variant:`row`,className:Jb(!0),onClick:B,children:`‹ ${he.get()===`sidebar`?Il(`narrowBack`):H(`dialog.close`)}`}):(0,W.jsx)(G,{variant:`row`,className:qb,"aria-label":H(`dialog.close`),title:H(`dialog.close`),onClick:B,children:`×`}),s&&(0,W.jsx)(oE,{current:n.section,narrow:i,onPick:e=>r({section:e,drilled:!0})}),i&&s&&(0,W.jsx)(QT,{client:e.client,inset:!1}),c&&(0,W.jsxs)(`div`,{ref:i?je(a):void 0,className:Yb(o),children:[i&&(0,W.jsx)(G,{variant:`row`,className:Jb(!1),onClick:a,children:`‹ ${H(`settings.title`)}`}),(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto scrollbar-none`,children:(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-7 px-8 pt-7 pb-10 w-narrow:gap-6 w-narrow:px-4 w-narrow:pt-1 w-narrow:pb-10`,children:[(0,W.jsxs)(`header`,{className:`flex flex-col gap-1 pr-8 w-narrow:pr-0`,children:[(0,W.jsx)(`h1`,{className:`m-0 font-sans text-display font-semibold normal-nums text-ink`,children:aE(n.section)}),(0,W.jsx)(`p`,{className:`m-0 text-body text-muted`,children:H(`settings.pages.${n.section}`)})]}),(0,W.jsx)(`div`,{className:`flex flex-col gap-7 w-narrow:gap-6`,children:rE[n.section](e)})]})},n.section)]})]})})}var cE=e=>{let{taskId:t}=e.selection.get();return e.tasks.get()?.tasks.find(e=>e.id===t)??null},lE=e=>{let{taskId:t,tabId:n}=e.selection.get(),r=t?e.tabs.get()[t]?.find(e=>e.id===n):void 0;return!!r&&!af(r.split)},uE=[{id:`app.refresh`,live:()=>aa.get().stale,run:e=>la(e.client)},{id:`palette.open`,live:()=>!0,run:Eb},{id:`task.new.global`,live:()=>!0,run:e=>ly(cE(e)?.repo)},{id:`chat.tab.fork`,live:e=>!!cE(e),run:e=>{let t=cE(e);t&&O.set((0,W.jsx)(xd,{model:e,taskId:t.id,context:`continue`}))}},{id:`chat.fork.new`,live:e=>!!cE(e),run:e=>{let t=cE(e);t&&O.set((0,W.jsx)(xd,{model:e,taskId:t.id,destination:`fork`}))}},{id:`settings.open`,live:()=>!0,run:e=>O.set((0,W.jsx)(sE,{model:e}))},{id:`inbox.show`,live:()=>!0,run:e=>O.set((0,W.jsx)(Ep,{model:e}))},{id:`focus.previous`,live:()=>!0,run:()=>eo(-1)},{id:`focus.next`,live:()=>!0,run:()=>eo(1)},{id:`workspace.filesToggle`,live:e=>!!cE(e),run:e=>{let t=cE(e);t&&Xc(t.id,`files`)}},{id:`files.createPR`,live:e=>!!cE(e),run:e=>{let t=cE(e);t&&e.client.request(`tab.requestPR`,e.engineTarget(t.id)).then(()=>z(H(`files.prRequested`))).catch(e=>z(e instanceof Error?e.message:String(e),`error`))}},{id:`chat.tab.close`,live:e=>!!e.selection.get().tabId&&lE(e),run:e=>{let{taskId:t,tabId:n}=e.selection.get();!t||!n||e.closeTab(t,n).catch(e=>z(e instanceof Error?e.message:String(e),`error`))}},{id:`kanban.open`,live:e=>e.installedMods.get().has(`kanban`),run:()=>V(`kanban`)},{id:`automations.open`,live:()=>!0,run:()=>V(`routines`)},{id:`workItems.open`,live:e=>e.installedMods.get().has(`issues`),run:()=>V(`issues`)},{id:`task.moveMode`,live:e=>!!Ab(e),run:()=>{Zp(!Xp.get()),document.querySelector(`.rail`)?.focus()}},{id:`files.syncBase`,live:e=>Ab(e)?.kind===`task`,run:e=>{let t=Ab(e);t&&pb(e,t.id)}},{id:`files.fixChecks`,live:e=>!!Ab(e),run:e=>{let t=Ab(e);t&&hb(e,t.id,H(`taskops.fixSent`))}},{id:`task.openEditor`,live:e=>!!Ab(e),run:e=>{let t=Ab(e);t&&gb(e,t.id)}}];To(()=>uE.map(e=>({id:e.id,chords:bo(e.id),prefix:!0,live:e.live,run:e.run})));function dE(e){return cl(e[0]??``)}function fE(e,t){let n=Ao(),r=Do().filter(t=>t.prefix&&Oo(t,n)&&t.live?.(e)!==!1);for(let e of t){let t=r.filter(t=>t.chords.includes(e)).sort((e,t)=>ko(e,n)-ko(t,n))[0];if(t)return t}}var pE=null,mE=null;function hE(){pE=null,mE!==null&&window.clearTimeout(mE),mE=null;let e=Nf.get();e.guide?.kind===`prefix`&&Nf.set({...e,guide:null})}function gE(){if(pE!==null){hE();return}O.get()||ho()===null||(pE=Date.now(),Nf.set({...Nf.get(),guide:{kind:`prefix`,armedAt:pE}}),mE!==null&&window.clearTimeout(mE),mE=window.setTimeout(hE,lo.get().prefix.timeoutMs))}function _E(e,t){hE();let n=typeof t==`string`?[t]:t,r=fE(e,n);Ff(dE(n),r?.id??null),r?.run(e)}var vE=null;function yE(){vE!==null&&window.clearTimeout(vE),vE=null;let e=Nf.get();e.guide?.kind===`direct`&&Nf.set({...e,guide:null})}function bE(){vE!==null||O.get()||(vE=window.setTimeout(()=>{hE(),Nf.set({...Nf.get(),guide:{kind:`direct`}})},400))}function xE(e){(0,m.useEffect)(()=>{let t=t=>{if(t.key===`Control`){t.repeat||bE();return}if(yE(),[`Shift`,`Alt`,`Meta`].includes(t.key))return;let n=sl(t),{firstStrokes:r,timeoutMs:i}=lo.get().prefix;if(pE!==null&&Date.now()-pE<=i){if(t.preventDefault(),t.stopImmediatePropagation(),t.key===`Escape`)return hE();_E(e,n);return}hE();let a=document.activeElement,o=zo(a instanceof HTMLElement?a:null)===`field`;!O.get()&&!o&&n.some(e=>r.includes(e))&&(t.preventDefault(),t.stopImmediatePropagation(),gE())},n=e=>e.key===`Control`&&yE(),r=e=>{pE!==null&&(e.target instanceof Element&&e.target.closest(`.prefix-guide, .shortcut-badge, [data-prefix-arm]`)||hE())};return window.addEventListener(`keydown`,t,{capture:!0}),window.addEventListener(`keyup`,n,{capture:!0}),window.addEventListener(`pointerdown`,r,{capture:!0}),window.addEventListener(`blur`,yE),()=>{window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`keyup`,n,{capture:!0}),window.removeEventListener(`pointerdown`,r,{capture:!0}),window.removeEventListener(`blur`,yE),yE(),hE()}},[e])}function SE(e){let t=Ao(),n=new Map;for(let r of Do()){if(!r.prefix||!Oo(r,t)||r.live?.(e)===!1)continue;let i=ko(r,t);for(let e of r.chords){let t=n.get(e);(!t||i<t.rank)&&n.set(e,{action:r.id,rank:i})}}return[...n].map(([e,{action:t}])=>({stroke:e,action:t}))}function CE(e){let t=new Map(Y.map((e,t)=>[e.id,t])),n=new Map;for(let{stroke:t,action:r}of e)n.set(r,[...n.get(r)??[],t]);let r=new Map,i=[...n].sort(([e],[n])=>(t.get(e)??2**53-1)-(t.get(n)??2**53-1));for(let[e,t]of i){let n=Sl(e);r.set(n,[...r.get(n)??[],{action:e,strokes:t}])}return[...r].map(([e,t])=>({category:e,actions:t}))}var wE=e=>e===`prefix.moreCommands`?jl(`moreCommandsPrefix`):Pl(e);function TE(e){let[,t]=(0,m.useState)(0);(0,m.useEffect)(()=>{if(e===null)return;let n=window.setTimeout(()=>t(e=>e+1),Math.max(30,e-Date.now()));return()=>window.clearTimeout(n)},[e])}function EE({model:e}){U();let t=y(Nf);y(lo),y(e.selection);let n=Date.now(),r=t.entries.filter(e=>n-e.at<Mf),i=t.guide?.kind===`prefix`?t.guide.armedAt:null,a=i!==null&&n-i<jf?i+jf:null;TE(a??(r[0]?r[0].at+Mf:null));let o=t.guide?.kind===`direct`||i!==null&&a===null;if(!o&&!t.guide&&r.length===0)return null;if(o&&t.guide){let n=t.guide.kind===`direct`,r=n?kf(jo(e,Ao()),ho()):SE(e);return(0,W.jsxs)(`output`,{className:`mono ${on}`,onMouseDown:e=>e.preventDefault(),children:[(0,W.jsxs)(`div`,{className:cn,children:[(0,W.jsx)(`span`,{className:`text-accent`,children:n?jl(`directLayer`):jl(`commandLayer`,{prefix:ho()??``})}),(0,W.jsx)(`span`,{className:`keys-only text-muted`,children:jl(n?`releaseCtrl`:`escCancel`)})]}),(0,W.jsx)(`div`,{className:ln,children:CE(r).map(t=>(0,W.jsxs)(`div`,{className:un,children:[(0,W.jsx)(`div`,{className:`text-accent`,children:Fl(t.category)}),t.actions.map(({action:t,strokes:r})=>(0,W.jsxs)(`button`,{type:`button`,className:dn,disabled:n,onClick:()=>r[0]&&_E(e,r[0]),children:[(0,W.jsx)(`span`,{className:sn,children:r.map(cl).join(`/`)}),(0,W.jsx)(`span`,{children:wE(t)})]},t))]},t.category))})]})}return(0,W.jsxs)(`output`,{className:Cn,children:[r.map(e=>(0,W.jsxs)(DE,{at:e.at,children:[(0,W.jsx)(`span`,{className:`text-accent`,children:ho()}),` + `,e.stroke,` →`,` `,e.action?wE(e.action):(0,W.jsx)(`span`,{className:`text-muted`,children:`∅`})]},e.id)),i!==null&&(0,W.jsxs)(`div`,{className:wn(!1),children:[(0,W.jsx)(`span`,{className:`text-accent`,children:ho()}),` ⋯`]})]})}function DE({at:e,children:t}){let[n]=(0,m.useState)(Date.now),r=n-e>140,i={"--hud-out":`${e+Mf-140-n}ms`};return(0,W.jsx)(`div`,{className:wn(r),style:i,children:t})}function OE({model:e,bindingId:t,head:n=!1}){let r=y(Nf);y(lo);let i=Lp().prefs.prefixTap;if(r.guide?.kind!==`prefix`||i!==`local`)return null;let a=Of({bindingId:t,reachability:jo(e,Ao()),prefixKey:ho()});if(!a)return null;let o=Do().find(e=>e.id===t&&e.prefix)?.chords[0];return(0,W.jsx)(`button`,{type:`button`,className:`mono ${Zt(n)}`,onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),o&&_E(e,o)},children:a})}var kE=[`workingBorder`,`runningTitle`,`taskColors`,`colorblind`];function AE(e){let{client:t}=e,n=Lp(),r=rw(),i=y(KC);iw(e),MT(e),(0,m.useEffect)(()=>{let e=()=>{Pp(t).catch(()=>void 0),$_(t).catch(()=>void 0)},n=()=>document.visibilityState===`visible`&&e(),r=t.onOpen(e);return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,n),()=>{r(),window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,n)}},[t]),(0,m.useEffect)(()=>{let e=document.documentElement,t=i?i[r]:FC(n.themes,n.prefs.theme,r),a=t?UC(t,n.prefs):{};for(let[t,n]of Object.entries(a))e.style.setProperty(t,n);e.style.colorScheme=r;for(let t of kE)e.dataset[t]=String(n.prefs[t]);GC.set(t?WC(t):null);let o=document.querySelector(`meta[name="theme-color"]`);o||(o=document.createElement(`meta`),o.name=`theme-color`,document.head.append(o)),o.content=getComputedStyle(document.body).backgroundColor},[n,r,i])}var jE=globalThis.webkit?.messageHandlers?.roveMac;function ME(e){let t=t=>e(t.detail);return window.addEventListener(`rove-mac`,t),()=>window.removeEventListener(`rove-mac`,t)}function NE(e,t,n,r,i,a){(0,m.useEffect)(()=>{if(jE)return jE.postMessage({op:`toolbar`,folded:e,waiting:t,back:n,forward:r,dark:getComputedStyle(document.documentElement).colorScheme!==`light`}),ME(({action:e})=>{e===`fold`&&a(),e===`back`&&n&&i(-1),e===`forward`&&r&&i(1)})},[e,t,n,r,i,a])}function PE(e,t){return e.kind===`task`&&t.kind===`task`?e.taskId===t.taskId:e.kind===`page`&&t.kind===`page`?e.id===t.id:e.kind===`new`&&t.kind===`new`}var FE={entries:[],at:-1};function IE(e,t){let n=e.entries[e.at];if(n&&PE(n,t)){let n=[...e.entries];return n[e.at]=t,{entries:n,at:e.at}}let r=[...e.entries.slice(0,e.at+1),t].slice(-50);return{entries:r,at:r.length-1}}function LE(e,t,n){for(let r=e.at+t;r>=0&&r<e.entries.length;r+=t){let t=e.entries[r];if(t&&n(t))return r}return-1}var RE=v(FE);function zE(e){let t=N.get();if(t)return{kind:`page`,id:t};let n=L.get();if(n)return{kind:`new`,start:n};let{taskId:r,tabId:i}=e.selection.get();return r?{kind:`task`,taskId:r,tabId:i}:null}function BE(e,t){if(t.kind!==`task`)return!0;let n=e.tasks.get()?.tasks.find(e=>e.id===t.taskId);return n!==void 0&&!n.deleting}var VE=!1;function HE(e){let t=!1,n=()=>{t||(t=!0,queueMicrotask(()=>{if(t=!1,VE)return;let n=zE(e);n&&RE.set(IE(RE.get(),n))}))};n();let r=[e.selection.subscribe(n),N.subscribe(n),L.subscribe(n)];return()=>{for(let e of r)e()}}function UE(e,t){let n=RE.get(),r=LE(n,t,t=>BE(e,t)),i=n.entries[r];i&&(VE=!0,i.kind===`task`?(N.set(null),L.set(null),e.select(i.taskId,i.tabId)):i.kind===`page`?(L.set(null),V(i.id)):(N.set(null),L.set(i.start)),RE.set({entries:n.entries,at:r}),queueMicrotask(()=>{VE=!1}))}function WE(e,t){return e.filter(e=>e.groupId===t).sort((e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``)||e.title.localeCompare(t.title))}var GE=400;function KE(e){let t=null;for(let n of e.history?.messages??[]){if(n.role!==`assistant`)continue;let e=(n.blocks??[]).flatMap(e=>e.type===`text`&&e.text?[e.text]:[]).join(`
|
|
55
|
-
`).trim(),r=n.timestamp??``;e&&(!t||r>t.at)&&(t={at:r,text:e})}let n=(e.terminal?.tail??[]).map(e=>e.trimEnd()).filter(e=>e.trim()!==``),r=t?.text??n.slice(-6).join(`
|
|
56
|
-
`);return r?r.length>GE?`${r.slice(0,GE).trimEnd()}…`:r:null}function qE(e){let t=e.files.filter(e=>e.scope===`working`),n=t.length>0?`working`:`branch`,r=n===`working`?t:e.files.filter(e=>e.scope===`branch`);return{scope:n,files:r,added:r.reduce((e,t)=>e+(t.added??0),0),deleted:r.reduce((e,t)=>e+(t.deleted??0),0)}}var JE=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function YE(e,t=null,n=!1){let r=[],i=0,a=0,o=t,s=!1;for(let t of e.replace(/\n$/,``).split(`
|
|
57
|
-
`)){if(t.startsWith(`diff --git `)){let e=/ b\/(.+)$/.exec(t);o=e?e[1]:o,s=!1,r.push({kind:`file`,text:o??t,oldNo:null,newNo:null,path:o});continue}let e=JE.exec(t);if(e){i=Number(e[1]),a=Number(e[2]),s=!0,r.push({kind:`hunk`,text:t,oldNo:null,newNo:null,path:o});continue}if(!s){r.push({kind:`meta`,text:t,oldNo:null,newNo:null,path:o});continue}t.startsWith(`+`)?r.push({kind:`add`,text:t.slice(1),oldNo:null,newNo:a++,path:o}):t.startsWith(`-`)?r.push({kind:`del`,text:t.slice(1),oldNo:i++,newNo:null,path:o,...n?{foreignOld:!0}:{}}):t.startsWith(`\\`)?r.push({kind:`meta`,text:t,oldNo:null,newNo:null,path:o}):r.push({kind:`ctx`,text:t.slice(1),oldNo:i++,newNo:a++,path:o})}return r}function XE(e,t){return e.replace(/\n$/,``).split(`
|
|
58
|
-
`).map((e,n)=>({kind:`ctx`,text:e,oldNo:null,newNo:n+1,path:t}))}function ZE(e){return e.kind===`del`?e.foreignOld?null:e.oldNo:e.kind===`add`||e.kind===`ctx`?e.newNo:null}function QE(e){let t=e.startLine?`lines ${e.startLine}-${e.line}`:`line ${e.line}`;return`@${e.path} (${t}) `}function $E(e,t,n){let r=e[t],i=r?ZE(r):null;if(!r?.path||i===null)return null;if(n===null||n===t)return{path:r.path,line:i};let a=e[Math.min(n,t)],o=e[Math.max(n,t)],s=a?ZE(a):null,c=o?ZE(o):null;return s===null||c===null||a?.path!==o?.path?{path:r.path,line:i}:s===c?{path:r.path,line:c}:{path:r.path,startLine:Math.min(s,c),line:Math.max(s,c)}}function eD(e,t,n){let r=$E(e,t,n);if(!r)return null;let i=r.startLine!==void 0&&n!==null;return{...r,first:i?Math.min(n,t):t,last:i?Math.max(n,t):t}}function tD(e,t){let n=[],r=!1;return e.forEach((e,i)=>{e.kind===`file`&&(r=e.path!==null&&t.has(e.path)),(!r||e.kind===`file`)&&n.push(i)}),n}function nD(e){let t=new Map,n=-1;return e.forEach((e,r)=>{if(e.kind===`file`){n=r,t.set(r,{added:0,removed:0});return}let i=t.get(n);i&&(e.kind===`add`?i.added++:e.kind===`del`&&i.removed++)}),t}var rD=[`source`,`tests`,`config`,`docs`,`generated`],iD=/(^|\/)(bun\.lockb?|package-lock\.json|yarn\.lock|pnpm-lock\.yaml|Cargo\.lock|poetry\.lock|uv\.lock|Gemfile\.lock|go\.sum|composer\.lock)$/,aD=/(^|\/)(dist|build|generated|__generated__|\.next)\/|\.min\.(js|css)$|\.snap$|\.generated\.|\.pb\.go$|\.map$/,oD=/(^|\/)(tests?|__tests__|spec|e2e)\/|\.(test|spec)\.[cm]?[jt]sx?$|_test\.(go|py)$|(^|\/)test_[^/]+\.py$/,sD=/\.(md|mdx|rst|txt)$|(^|\/)docs\//i,cD=/(^|\/)(\.[\w.-]+rc(\.\w+)?|[\w.-]*\.config\.[cm]?[jt]s|tsconfig[\w.-]*\.json|package\.json|biome\.json|Dockerfile|Makefile)$|\.(ya?ml|toml|ini|env)$|(^|\/)\.(github|changeset|vscode)\//,lD=e=>iD.test(e);function uD(e){return iD.test(e)||aD.test(e)?`generated`:oD.test(e)?`tests`:sD.test(e)?`docs`:cD.test(e)?`config`:`source`}var dD=e=>uD(e)===`generated`;function fD(e){let t=e.filter(e=>uD(e.path)!==`generated`),n=t.reduce((e,t)=>e+t.lines,0);return t.length===0?1:((e,t)=>e<=2&&t<=30?1:e<=5&&t<=150?2:e<=10&&t<=400?3:e<=20&&t<=1e3?4:5)(t.length,n)}function pD(e){let t=[],n=(e,n)=>n>0&&t.push({group:e,count:n});for(let t of rD)t===`generated`?(n(`lockfile`,e.filter(lD).length),n(`generated`,e.filter(e=>uD(e)===`generated`&&!lD(e)).length)):n(t,e.filter(e=>uD(e)===t).length);return t}function mD(e){let t=[];for(let n of e)(n.kind===`file`||t.length===0)&&t.push([]),t[t.length-1]?.push(n);let n=e=>rD.indexOf(uD(e[0]?.path??``));return t.map((e,t)=>({file:e,i:t})).sort((e,t)=>n(e.file)-n(t.file)||e.i-t.i).flatMap(({file:e})=>e)}function hD(e){return pD(e.map(e=>e.path)).map(({group:e,count:t})=>({key:e===`lockfile`?t===1?`lockfile`:`lockfiles`:e,count:t}))}function gD(e,t){let n=[...e.entries()].flatMap(([e,n])=>{let r=t[e]?.path;return r?[{path:r,lines:n.added+n.removed}]:[]});return n.length<2?``:[H(`review.shape.effort`,{n:fD(n)}),...hD(n).map(e=>H(`review.shape.${e.key}`,{count:e.count}))].join(` · `)}function _D(e,t,n){if(!e||typeof e!=`object`||!(`kind`in e))return{kind:`text`,text:H(`preview.unknown`)};let r=`text`in e&&typeof e.text==`string`?e.text:``;switch(e.kind){case`diff`:{let e=YE(r,t===`.`?null:t,n);return{kind:`rows`,rows:t===`.`?mD(e):e,diff:!0}}case`code`:return{kind:`rows`,rows:XE(r,t),diff:!1};case`binary`:return{kind:`text`,text:H(`preview.binary`)};case`empty`:return{kind:`text`,text:H(`preview.empty`)};case`error`:return{kind:`text`,text:`message`in e?String(e.message):H(`preview.unknown`),error:!0};default:return{kind:`text`,text:H(`preview.noHunks`,{kind:String(e.kind)})}}}function vD(e){return e instanceof Go&&e.code===`UNKNOWN_OP`?Error(H(`review.notSupported`)):e instanceof Error?e:Error(String(e))}function yD(e,t){let n=e.tasks.get()?.tasks.find(e=>e.id===t);return n?.workspace?`${n.machine?.id??``}:${n.workspace}`:t}function bD({tone:e,children:t}){return(0,W.jsx)(`span`,{className:Rt(`flex-none font-mono text-meta`,e&&Sp[e]),children:t})}var xD=`mt-4 grid grid-cols-[repeat(auto-fit,minmax(min(100%,24rem),1fr))] items-stretch gap-3`,SD=e=>`flex min-w-0 flex-col gap-2 rounded-md border-hairline bg-inset px-3 pt-2.5 pb-3 ${e?`border-accent`:`border-transparent`}`,CD=`flex min-w-0 items-center gap-2`,wD=`min-w-0 truncate font-bold`,TD=`truncate font-mono text-meta text-muted`,ED=`m-0 line-clamp-4 whitespace-pre-wrap wrap-anywhere`,DD=`m-0 flex gap-2 font-mono text-meta text-muted`,OD=`group/preview @container/preview -mx-3 max-h-[min(60vh,40rem)] min-h-0 overflow-x-hidden overflow-y-auto bg-paper py-1.5 font-mono text-meta/normal [&>:first-child]:mt-0 [&>:first-child]:border-t-0`,kD=`group w-full text-left`,AD=`min-w-0 truncate group-hover:underline`,jD=`mt-auto flex min-h-7.5 flex-wrap items-center gap-x-3.5 gap-y-1 pt-1 font-mono text-meta`,MD=`flex min-w-0 flex-wrap items-center gap-x-3.5 gap-y-0.5 px-2.5 py-1 font-mono text-meta`,ND={add:`bg-diff-added-bg`,del:`bg-diff-removed-bg`},PD={add:`text-diff-added`,del:`text-diff-removed`};function FD(e,t){let n=t.cursor?`bg-inset group-focus/preview:bg-accent-soft`:t.noted?`bg-inset`:ND[e]??``;return`relative grid ${e===`file`||e===`note`?`cursor-pointer`:`cursor-default`} grid-cols-[4ch_4ch_2ch_minmax(0,1fr)] gap-x-2 gap-y-0 whitespace-pre px-3 group-data-file/preview:grid-cols-[4ch_1ch_minmax(0,1fr)] @max-md/preview:grid-cols-[3ch_3ch_1ch_minmax(0,1fr)] @max-md/preview:gap-x-1 @max-md/preview:px-1.5 @max-md/preview:group-data-file/preview:grid-cols-[3ch_1ch_minmax(0,1fr)] ${n} ${e===`file`?`mt-2 border-t-hairline border-line pt-1 font-bold text-ink`:e===`hunk`||e===`meta`?`text-subtle`:``}`}var ID=`text-right text-subtle`,LD=`${ID} group-data-file/preview:hidden`,RD=(e,t,n=!1)=>t?`text-accent`:n?`text-diff-added`:PD[e]??``,zD=e=>`min-w-0 whitespace-pre-wrap wrap-anywhere ${PD[e]??``}`,BD=`min-w-0 whitespace-pre-wrap wrap-anywhere text-accent`,VD=`col-span-3 flex min-w-0 items-baseline gap-2 overflow-hidden`,HD=400;function UD(e){let{model:t,taskId:n,scope:r}=e,i={taskId:n,path:`.`,scope:r},[a,o]=(0,m.useState)(()=>{let e=X(t,`diff.file`,i);return e===void 0?null:_D(e,`.`,!1)});(0,m.useEffect)(()=>{let e=!0;return Z(t,`diff.file`,{taskId:n,path:`.`,scope:r}).then(t=>e&&o(_D(t,`.`,!1)),t=>e&&o({kind:`text`,text:t instanceof Error?t.message:String(t),error:!0})),()=>{e=!1}},[t,n,r,e.refresh]);let s=(0,m.useMemo)(()=>a?.kind===`rows`?a.rows.filter(e=>e.kind!==`meta`):[],[a]),c=(0,m.useMemo)(()=>nD(s),[s]),l=s.length-HD;return(0,W.jsxs)(`div`,{className:OD,children:[!a&&(0,W.jsx)(`p`,{className:`mx-2.5 my-3 font-mono text-meta text-subtle`,children:H(`preview.loading`)}),a?.kind===`text`&&(0,W.jsx)(`p`,{className:`mx-2.5 my-3 font-mono text-meta text-subtle ${a.error?`text-error`:``}`,children:a.text}),s.slice(0,HD).map((t,n)=>t.kind===`file`?(0,W.jsx)(WD,{row:t,stat:c.get(n),onOpen:e.onOpen},n):(0,W.jsxs)(`div`,{className:FD(t.kind,{cursor:!1,noted:!1}),children:[(0,W.jsx)(`span`,{className:LD,children:t.oldNo??``}),(0,W.jsx)(`span`,{className:ID,children:t.newNo??``}),(0,W.jsx)(`span`,{className:RD(t.kind,!1),children:t.kind===`add`?`+`:t.kind===`del`?`−`:` `}),(0,W.jsx)(`span`,{className:zD(t.kind),children:t.text})]},n)),l>0&&(0,W.jsx)(G,{hit:`tight`,className:`mx-3 my-2 font-mono text-meta`,onClick:()=>e.onOpen(`.`),children:H(`compare.moreLines`,{count:l})})]})}function WD(e){let{row:t,stat:n}=e;return(0,W.jsxs)(G,{variant:`row`,title:t.text,className:`${FD(`file`,{cursor:!1,noted:!1})} ${kD}`,onClick:()=>e.onOpen(t.path??`.`),children:[(0,W.jsx)(`span`,{}),(0,W.jsxs)(`span`,{className:VD,children:[(0,W.jsx)(`span`,{className:AD,children:t.text}),n?.added?(0,W.jsxs)(bD,{tone:`added`,children:[`+`,n.added]}):null,n?.removed?(0,W.jsxs)(bD,{tone:`removed`,children:[`−`,n.removed]}):null]})]})}async function GD(e,t,n){let r=new Set(e.tasks.get()?.tasks.map(e=>e.id)),i=0;try{for(let a of t.filter(e=>r.has(e)))await e.act(`task.archive`,{taskId:a,archived:!0,...n?{force:!0}:{}}),i++}catch(e){if(i>0&&z(H(`compare.archived`,{count:i})),e instanceof Go&&e.code===`TASK_BUSY`)throw e;z(H(`compare.archiveFailed`,{error:K(e)}),`error`);return}z(H(`compare.archived`,{count:i}))}async function KD(e,t,n){try{for(let r of n)r.id!==t.id&&r.kept&&await e.act(`task.keep`,{taskId:r.id,kept:!1});await e.act(`task.keep`,{taskId:t.id,kept:!0})}catch(e){z(H(`compare.keepFailed`,{error:K(e)}),`error`);return}z(H(`compare.keptToast`,{title:t.label}));let r=n.filter(e=>e.id!==t.id).map(e=>e.id);r.length!==0&&O.set((0,W.jsx)(q,{title:H(`compare.archiveTitle`),body:H(`compare.archiveBody`,{count:r.length}),confirmLabel:H(`compare.archiveConfirm`),onConfirm:()=>GD(e,r,!1),escalate:{when:e=>e instanceof Go&&e.code===`TASK_BUSY`,label:H(`compare.archiveBusyConfirm`),title:H(`compare.archiveBusyTitle`),body:()=>H(`compare.archiveBusyBody`),run:()=>GD(e,r,!0)}}))}async function qD(e,t){try{await e.act(`task.keep`,{taskId:t.id,kept:!1}),z(H(`compare.unkeptToast`,{title:t.label}))}catch(e){z(H(`compare.keepFailed`,{error:K(e)}),`error`)}}var JD={title:`ROUTINES`,holdingDaemon:`keeping the daemon awake`,notHolding:`none active`,needAttention:`{count} of {total} need you ·`,paused:`paused`,newTitle:`New routine`,composerLegend:`enter create · tab fields · ←→ ↑↓ edit the focused field · esc cancel`,fieldName:`NAME`,fieldRepo:`REPO`,fieldTarget:`DELIVER TO`,fieldTargetTab:`EXISTING ENGINE TAB`,targetFresh:`New task on each run`,targetStanding:`Routine-owned standing task`,targetStandingNew:`Routine-owned standing task, new conversation each run`,targetExisting:`Existing conversation: {task} / {tab}. Never creates or revives a session.`,fieldPrompt:`PROMPT`,fieldSchedule:`SCHEDULE (FIVE-FIELD CRON)`,namePlaceholder:`weekday dependency audit`,promptPlaceholder:`Audit dependencies and summarize risky changes.`,noProject:`Ungrouped`,cronInvalid:`not a five-field cron`,cronField:{minute:`min`,hour:`hour`,dayOfMonth:`day`,month:`month`,dayOfWeek:`weekday`},schedule:{everyDay:`every day {at}`,weekdays:`weekdays {at}`,weekends:`weekends {at}`,onWeekday:`{weekday} {at}`,everyMinute:`every minute`,everyMinutes:`every {n}m`,everyHours:`every {n}h`,hourlyAt:`hourly at :{minute}`,atClock:`at {time}`,dow:{MON:`Mondays`,TUE:`Tuesdays`,WED:`Wednesdays`,THU:`Thursdays`,FRI:`Fridays`,SAT:`Saturdays`,SUN:`Sundays`}},when:{inMinutes:`in {n}m`,inHours:`in {n}h`,inDays:`in {n}d`,minutesAgo:`{n}m ago`,hoursAgo:`{n}h ago`,now:`now`,justNow:`just now`,dateTime:`{date}, {time}`},runStatus:{dispatched:`dispatched`,revived:`revived`,skipped_cancelled:`cancelled before delivery`,skipped_precheck:`skipped (precheck)`,skipped_blocked:`skipped (task can't use it)`,skipped_missed:`skipped (missed)`,skipped_unavailable:`skipped (unavailable)`,dispatch_failed:`dispatch failed`,ran:`ran`,script_failed:`script failed`},cronNever:`valid, but never fires`,missing:{target:`Choose an existing task.`,targetTab:`Enter an existing tab id, e.g. tab-2.`,name:`Give it a name.`,repo:`Pick a project.`,prompt:`Say what it should do.`,schedule:`That schedule will not run.`},empty:`No routines scheduled.`,loadFailed:`Could not read the routines: {message}`,emptyHint:`Press n to create one.`,precheck:`precheck: {command}`,engineDefault:`default engine`,engineChanged:`{name} now runs on {engine}.`,engineChangedNewSession:`{name} now runs on {engine}. Its next run starts a new session; the earlier one stays as a task.`,lastFailed:`last failed {when}: {reason}`,recentRuns:`RECENT RUNS`,precheckDetail:`WHY IT SKIPPED — precheck {exit} in {duration}ms`,precheckExited:`exited {code}`,precheckTimedOut:`timed out`,precheckStdout:`stdout`,precheckStderr:`stderr`,precheckNoOutput:`(no output)`,noRuns:`Not run yet.`,responses:`RESPONSES`,noResponses:"No run has reported back yet. Agents answer with `routine-respond`.",responseAwaiting:`awaiting response`,responseMissing:`no response`,noSelection:`A routine runs its prompt in a project on a schedule.`,running:`Running {name}…`,ranWith:`{name}: {status}`,latestRunNoTask:`The latest run created no task.`,runNow:`[ run now ]`,deleteTitle:`Delete routine?`,deleteBody:`{name} and its run history will be removed. Tasks it already created are untouched.`,deleteButton:`Delete`,createFailed:`Couldn't create the routine: {error}`,deleteFailed:`Couldn't delete "{name}": {error}`,enableFailed:`"{name}" stays paused: {error}`,disableFailed:`"{name}" stays enabled: {error}`,runFailed:`Couldn't run "{name}" now: {error}`},YD={title:`例行任务`,holdingDaemon:`正在保持守护进程常驻`,notHolding:`无启用项`,needAttention:`{total} 个中有 {count} 个需要处理 ·`,paused:`已暂停`,newTitle:`新建例行任务`,composerLegend:`enter 创建 · tab 切字段 · ←→ ↑↓ 编辑当前字段 · esc 取消`,fieldName:`名称`,fieldTarget:`投递目标`,fieldTargetTab:`既有引擎标签页`,targetFresh:`每次新建任务`,targetStanding:`例行任务自有的常驻任务`,targetStandingNew:`例行任务自有的常驻任务,每次运行新开对话`,targetExisting:`既有会话:{task} / {tab}。不会创建或重启会话。`,fieldRepo:`仓库`,fieldPrompt:`提示词`,fieldSchedule:`调度(五段 cron)`,namePlaceholder:`工作日依赖审计`,promptPlaceholder:`审计依赖并总结有风险的变更。`,noProject:`未分组`,cronInvalid:`不是合法的五段 cron`,cronField:{minute:`分`,hour:`时`,dayOfMonth:`日`,month:`月`,dayOfWeek:`星期`},schedule:{everyDay:`每天{at}`,weekdays:`工作日{at}`,weekends:`周末{at}`,onWeekday:`{weekday}{at}`,everyMinute:`每分钟`,everyMinutes:`每 {n} 分钟`,everyHours:`每 {n} 小时`,hourlyAt:`每小时的 :{minute}`,atClock:`{time}`,dow:{MON:`每周一`,TUE:`每周二`,WED:`每周三`,THU:`每周四`,FRI:`每周五`,SAT:`每周六`,SUN:`每周日`}},when:{inMinutes:`{n} 分钟后`,inHours:`{n} 小时后`,inDays:`{n} 天后`,minutesAgo:`{n} 分钟前`,hoursAgo:`{n} 小时前`,now:`即将`,justNow:`刚刚`,dateTime:`{date} {time}`},runStatus:{dispatched:`已派发`,revived:`已重启会话`,skipped_cancelled:`交付前已取消`,skipped_precheck:`已跳过(预检)`,skipped_blocked:`已跳过(任务暂不能接收)`,skipped_missed:`已跳过(错过时间)`,skipped_unavailable:`已跳过(不可用)`,dispatch_failed:`派发失败`,ran:`已运行`,script_failed:`脚本失败`},cronNever:`语法合法,但永远不会触发`,missing:{target:`请选择既有任务。`,targetTab:`请输入既有标签页 ID,例如 tab-2。`,name:`起个名字。`,repo:`选一个项目。`,prompt:`说明它要做什么。`,schedule:`这个调度不会触发。`},empty:`还没有例行任务。`,loadFailed:`读不到例行任务:{message}`,emptyHint:`按 n 新建一条。`,precheck:`预检:{command}`,engineDefault:`默认引擎`,engineChanged:`{name} 已改用 {engine}。`,engineChangedNewSession:`{name} 已改用 {engine}。下次运行会新开会话,原来的会话保留为任务。`,lastFailed:`上次失败({when}):{reason}`,recentRuns:`最近执行`,precheckDetail:`为什么跳过 —— 预检{exit},耗时 {duration}ms`,precheckExited:`退出码 {code}`,precheckTimedOut:`超时`,precheckStdout:`标准输出`,precheckStderr:`标准错误`,precheckNoOutput:`(无输出)`,noRuns:`尚未执行。`,responses:`回报`,noResponses:"还没有执行回报。agent 用 `routine-respond` 回报。",responseAwaiting:`等待回报`,responseMissing:`未回报`,noSelection:`例行任务会按调度在某个项目里跑它的提示词。`,running:`正在运行 {name}…`,ranWith:`{name}:{status}`,latestRunNoTask:`最近一次执行没有创建任务。`,runNow:`[ 立即运行 ]`,deleteTitle:`删除这条例行任务?`,deleteBody:`将删除 {name} 及其执行记录。它已经创建的任务不受影响。`,deleteButton:`删除`,createFailed:`创建例行任务失败:{error}`,deleteFailed:`删除“{name}”失败:{error}`,enableFailed:`“{name}”仍处于暂停状态:{error}`,disableFailed:`“{name}”仍处于启用状态:{error}`,runFailed:`无法立即运行“{name}”:{error}`},XD={title:`Kanban`,hint:`tab project · ←↓↑→ card · enter detail · n new · d delete · r refresh · esc close`,loading:`Loading issues…`,noRepos:"No projects yet — add one with `rove add <path>`, or file a story with `rove api issue-create`.",empty:"No issues — agents file them via `rove api issue-create`.",readFailed:"Couldn't read this project's stories: {error}. Run `rove doctor`, then reopen Kanban.",readFailedToast:`Couldn't read stories for {repo}: {error}`,columnEmpty:`No cards`,column:{backlog:`Backlog`,inProgress:`In progress`,parked:`Parked`,done:`Done`},more:`+{count} more`,attention:`{count} need you`,turnComplete:`turn done`,menu:{setStatus:`status → {status}`},detail:{status:{open:`open`,doing:`doing`,hold:`hold`,done:`done`},statusLabel:`STATUS`,created:`created {date}`,linked:`linked to a session`,titleLabel:`TITLE`,description:`DESCRIPTION`,noDescription:`No description.`,attachHint:`paste a path / ctrl+v screenshot → inserts an image placeholder`,engine:`ENGINE`,workspace:`WORKSPACE`,placement:{worktree:`New worktree task — its own workspace`,project:`Project checkout — a new chattab, no worktree`},jumpLabel:`AFTER START`,jump:{stay:`Stay on the board`,follow:`Jump to the session`},startLegend:`enter/ctrl+enter start · tab fields · ←→ status/engine · ↑↓ workspace · esc save & close`,sessionLabel:`SESSION`,openAction:`Open the linked session ↵`,unlinkAction:`Unlink`,openLegend:`enter open the focused action · tab fields · ←→ status · unlink returns the card to Backlog · esc save & close`,eventsLabel:`EVENTS`,eventsLoading:`Loading events…`,eventsNone:`No engine events recorded yet.`,doneNote:`Done stories have nothing left to start — set the status back to reopen one · esc save & close`,startedBackground:`Started in background: {title}`,newStory:`NEW STORY`,createLegend:`ctrl+s save · enter/ctrl+enter save & start · tab fields · esc cancel`},confirmDelete:{title:`Delete story #{id}?`,body:`“{title}” will be removed from the tracker. A linked task, branch, or worktree is left untouched.`},deleteFailed:`Couldn't delete story #{id}: {error}`,createFailed:`Couldn't create the story: {error}`,updateFailed:`Couldn't save story #{id}: {error}`,statusFailed:`Story #{id} stays in its old column: {error}`,linkFailed:`Story #{id} isn't linked to its task: {error}`,unlinkFailed:`Story #{id} is still linked: {error}`},ZD={title:`看板`,hint:`tab 切项目 · ←↓↑→ 选卡片 · enter 详情 · n 新建 · d 删除 · r 刷新 · esc 关闭`,loading:`正在加载 issues…`,noRepos:"还没有项目——用 `rove add <路径>` 添加一个,或用 `rove api issue-create` 创建一个 story。",empty:"暂无 issue——agent 可通过 `rove api issue-create` 创建。",readFailed:"读取该项目的 story 失败:{error}。请运行 `rove doctor`,再重新打开看板。",readFailedToast:`读取 {repo} 的 story 失败:{error}`,columnEmpty:`暂无卡片`,column:{backlog:`待办`,inProgress:`进行中`,parked:`搁置`,done:`已完成`},more:`还有 {count} 条`,attention:`{count} 张等你处理`,turnComplete:`回合完成`,menu:{setStatus:`状态 → {status}`},detail:{status:{open:`待办`,doing:`进行中`,hold:`搁置`,done:`已完成`},statusLabel:`状态`,created:`创建于 {date}`,linked:`已关联会话`,titleLabel:`标题`,description:`描述`,noDescription:`暂无描述。`,attachHint:`粘贴路径 / ctrl+v 贴截图 → 插入图片占位行`,engine:`引擎`,workspace:`工作区`,placement:{worktree:`新建 worktree 任务——独立工作区`,project:`项目主目录——新开 chattab,不建 worktree`},jumpLabel:`启动后`,jump:{stay:`留在看板`,follow:`跳转到会话`},startLegend:`enter/ctrl+enter 启动 · tab 切字段 · ←→ 状态/引擎 · ↑↓ 工作区 · esc 保存关闭`,sessionLabel:`会话`,openAction:`打开关联会话 ↵`,unlinkAction:`解除关联`,openLegend:`enter 执行选中操作 · tab 切字段 · ←→ 状态 · 解除关联把卡片退回 Backlog · esc 保存关闭`,eventsLabel:`事件`,eventsLoading:`正在加载事件…`,eventsNone:`暂无引擎事件记录。`,doneNote:`已完成的 story 无需启动——改回状态即可重新打开 · esc 保存关闭`,startedBackground:`已在后台启动:{title}`,newStory:`新建 STORY`,createLegend:`ctrl+s 仅保存 · enter/ctrl+enter 保存并启动 · tab 切字段 · esc 取消`},confirmDelete:{title:`删除 story #{id}?`,body:`「{title}」将从 tracker 中移除。已关联的任务、分支、worktree 不受影响。`},deleteFailed:`删除 story #{id} 失败:{error}`,createFailed:`创建 story 失败:{error}`,updateFailed:`保存 story #{id} 失败:{error}`,statusFailed:`Story #{id} 仍留在原来的列:{error}`,linkFailed:`Story #{id} 未能关联到它的任务:{error}`,unlinkFailed:`Story #{id} 仍处于关联状态:{error}`},QD={title:`ISSUES`,noRepo:`no project`,empty:`No open issues.`,assignedFilter:`assigned to me`,starting:`Starting work on #{number}…`,startedNoEngine:`Created {title}, but its engine did not start.`,linkedChip:`→ {title}`,openingLinked:`Opening {title}…`,startFailed:`Couldn't start work on #{number}: {error}`,errorHint:{noRemote:"Add a GitHub remote (`git remote add origin <url>`) and try again, or press q / esc to close.",ghMissing:"Install the `gh` CLI and authenticate, or press q / esc to close.",auth:"Run `gh auth login`, or press q / esc to close.",fallback:`{message} · press q / esc to close`}},$D={title:`议题`,noRepo:`无项目`,empty:`没有开放的议题。`,assignedFilter:`分配给我的`,starting:`正在开始处理 #{number}…`,startedNoEngine:`已创建 {title},但引擎没有启动。`,linkedChip:`→ {title}`,openingLinked:`正在打开 {title}…`,startFailed:`开始处理 #{number} 失败:{error}`,errorHint:{noRemote:"添加 GitHub remote(`git remote add origin <url>`)后重试,或按 q / esc 关闭。",ghMissing:"安装 `gh` CLI 并登录,或按 q / esc 关闭。",auth:"执行 `gh auth login`,或按 q / esc 关闭。",fallback:`{message} · 按 q / esc 关闭`}};function eO(){let e=U()===`zh`;return{kanban:e?ZD:XD,auto:e?YD:JD,items:e?$D:QD,nav:(e?Ji:qi).nav,group:(e?Ji:qi).group,common:e?Ai:ki}}function $(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e))}function tO(){let{auto:e}=eO();return(t,n)=>{let r=e;for(let e of t.replace(/^automations\./,``).split(`.`))r=r&&typeof r==`object`?Reflect.get(r,e):void 0;return typeof r==`string`?n?$(r,n):r:t}}function nO(e){return e instanceof Error?e.message:String(e)}function rO(e){return e.replace(/^\/private\//,`/`).replace(/\/+$/,``)}function iO(e,t){let n=Sd(e),r=n[n.length-1]??e;return t.some(t=>t!==e&&Sd(t).pop()===r)&&n.length>1?`${n[n.length-2]}/${r}`:r}function aO(...e){let t=new Set,n=[];for(let r of e.flat()){if(!r||r.startsWith(`ssh://`))continue;let e=rO(r);t.has(e)||(t.add(e),n.push(r))}return n}function oO(e){return aO((y(e.tasks)?.tasks??[]).filter(e=>!Ud(e)).map(e=>e.repo))}function sO(e){let t=y(e.tasks),{taskId:n}=y(e.selection);return t?.tasks.find(e=>e.id===n)?.repo}function cO(e){let[t,n]=(0,m.useState)(0);return(0,m.useEffect)(()=>Oi(e,()=>n(e=>e+1)),[e]),[t,(0,m.useCallback)(()=>n(e=>e+1),[])]}function lO(e){return e instanceof HTMLElement?e.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName):!1}function uO(e){let t=(0,m.useRef)(e);t.current=e,(0,m.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||O.get()||D.get())return;let n=e.target instanceof HTMLElement?e.target:null;lO(n)||n?.closest(`.rail, .side-panel, .xterm`)||e.metaKey||e.altKey||e.ctrlKey&&e.key.toLowerCase()===`c`&&window.getSelection()?.toString()||t.current(e)&&(e.preventDefault(),e.stopPropagation())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function dO(){let e=(0,m.useRef)(null);return(0,m.useEffect)(()=>e.current?.focus(),[]),e}function fO(e,t){let[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(()=>X(e,`diff.files`,{taskId:t.id})??null),o=`${t.rowStatus?.kind??``}:${t.rowStatus?.since??0}`,s=JSON.stringify(t.changes??null);return(0,m.useEffect)(()=>{let n=!0;return Z(e,`output.read`,{taskId:t.id,limit:8}).then(e=>n&&r(KE(e)),()=>n&&r(null)),()=>{n=!1}},[e,t.id,o]),(0,m.useEffect)(()=>{let n=!0;return Z(e,`diff.files`,{taskId:t.id}).then(e=>n&&a(e),()=>{}),()=>{n=!1}},[e,t.id,s,o]),{reply:n,changes:i?qE(i):null,refresh:`${s}|${o}`}}function pO(e){let{changes:t}=e;return t?t.files.length===0?(0,W.jsx)(`p`,{className:`m-0 font-mono text-meta text-subtle`,children:H(`compare.noChanges`)}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:DD,children:[(0,W.jsx)(`span`,{children:H(`compare.files`,{count:t.files.length})}),t.added>0&&(0,W.jsxs)(bD,{tone:`added`,children:[`+`,t.added]}),t.deleted>0&&(0,W.jsxs)(bD,{tone:`removed`,children:[`−`,t.deleted]})]}),(0,W.jsx)(UD,{model:e.model,taskId:e.row.id,scope:t.scope,refresh:e.refresh,onOpen:e.onOpen})]}):(0,W.jsx)(`p`,{className:wr,children:`…`})}function mO({row:e,icon:t}){let n=TC();return n===`dots`?(0,W.jsx)(Xg,{status:e.rowStatus}):(0,W.jsx)(kC,{icon:t,name:e.engine?.name,status:n===`engine`?Fg(e.rowStatus):void 0})}function hO(e){let{model:t,row:n,round:r}=e,{reply:i,changes:a,refresh:o}=fO(t,n),{look:s}=Fg(n.rowStatus),c=n.kept===!0,l=e=>{t.select(n.id),Zc({taskId:n.id,path:e,scope:a?.scope??`working`})};return(0,W.jsxs)(`section`,{className:SD(c),"data-attempt":n.id,"aria-current":c||void 0,children:[(0,W.jsxs)(`div`,{className:CD,children:[(0,W.jsx)(mO,{row:n,icon:e.icon}),(0,W.jsx)(`span`,{className:wD,children:n.engine?.name??n.label}),(0,W.jsx)(`span`,{className:`flex-none text-meta text-muted`,children:H(`compare.status.${s}`)}),c&&(0,W.jsx)(`span`,{className:`ml-auto flex-none font-mono text-meta text-accent`,children:H(`compare.kept`)})]}),(0,W.jsx)(`span`,{className:TD,title:n.branch,children:n.branch}),i?(0,W.jsx)(`p`,{className:ED,children:i}):(0,W.jsx)(`p`,{className:`m-0 text-muted`,children:H(`compare.noReply`)}),(0,W.jsx)(pO,{model:t,row:n,changes:a,refresh:o,onOpen:l}),(0,W.jsxs)(`div`,{className:jD,children:[c?(0,W.jsx)(G,{hit:`tight`,onClick:()=>void qD(t,n),children:H(`compare.unkeep`)}):(0,W.jsx)(G,{variant:`filled`,onClick:()=>void KD(t,n,r),children:H(`compare.keep`)}),(0,W.jsx)(G,{hit:`tight`,onClick:()=>t.select(n.id),children:H(`compare.terminal`)}),(0,W.jsx)(G,{hit:`tight`,onClick:()=>l(`.`),children:H(`compare.diff`)})]})]})}function gO(e,t){let[n,r]=(0,m.useState)(()=>t?X(e,`task.get`,{taskId:t})?.task?.prompt??null:null);return(0,m.useEffect)(()=>{if(!t)return;let n=!0;return Z(e,`task.get`,{taskId:t}).then(e=>n&&r(e.task?.prompt?.trim()||null),()=>{}),()=>{n=!1}},[e,t]),n}function _O({model:e}){U();let t=y(P),n=y(e.tasks),r=dO(),i=CC(e),a=t&&n?WE(n.tasks,t):[],o=gO(e,a[0]?.id);return(0,W.jsxs)(`div`,{className:yS,tabIndex:0,ref:r,onKeyDown:e=>{e.metaKey||e.ctrlKey||e.altKey||e.key!==`q`&&e.key!==`Escape`||(e.preventDefault(),N.set(null))},children:[(0,W.jsxs)(`div`,{className:xS,children:[(0,W.jsx)(`h1`,{className:bS,children:H(`compare.title`)}),a.length>0&&(0,W.jsx)(`span`,{className:`flex-none font-mono text-meta text-muted`,children:H(`compare.attempts`,{count:a.length})})]}),o&&(0,W.jsx)(`p`,{className:`m-0 mt-1.5 line-clamp-4 max-w-[90ch] whitespace-pre-wrap wrap-anywhere rounded-sm bg-inset px-3 py-2 text-ink`,title:o,children:o}),a.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:H(`compare.empty`)}):(0,W.jsx)(`div`,{className:xD,children:a.map(t=>(0,W.jsx)(hO,{model:e,row:t,round:a,icon:i.get(t.engine?.id??``)},t.id))})]})}function vO(e){let t=Math.floor(e/6e4),n=Math.floor(t/60);return{minutes:t,hours:n,days:Math.floor(n/24)}}function yO(e,t=Date.now()){let n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return`${r}s`;let{minutes:i,hours:a,days:o}=vO(n);return i<60?`${i}m`:a<24?`${a}h`:`${o}d`}var bO=[{id:`issues`,label:`reviewQueue.sourceIssues`},{id:`reviews`,label:`reviewQueue.sourceReviews`}];function xO(){U();let e=y(nb);return(0,W.jsx)(`span`,{className:`flex items-baseline gap-3 font-mono text-meta`,children:bO.map(t=>t.id===e?(0,W.jsx)(`span`,{className:`text-ink`,children:H(t.label)},t.id):(0,W.jsx)(G,{onClick:()=>nb.set(t.id),children:H(t.label)},t.id))})}var SO={passing:`reviewQueue.checksPassing`,failing:`reviewQueue.checksFailing`,pending:`reviewQueue.checksPending`},CO={missing:`reviewQueue.gh.missing`,unauthenticated:`reviewQueue.gh.unauthenticated`,failed:`reviewQueue.gh.failed`};function wO(e){let{pr:t}=e,n=Date.parse(t.createdAt),r=[t.isDraft?H(`reviewQueue.draft`):``,t.fork?H(`reviewQueue.fork`):``,t.checks?H(SO[t.checks]):``];return(0,W.jsxs)(`div`,{"data-row":e.index,className:ES(e.at),onClick:e.onPick,children:[(0,W.jsxs)(`div`,{className:DS,children:[(0,W.jsxs)(`span`,{className:`mono ${OS}`,children:[t.nameWithOwner.split(`/`)[1],`#`,t.number]}),(0,W.jsx)(`span`,{className:AS,children:t.title}),(0,W.jsx)(G,{disabled:e.busy,onClick:e.onReview,children:H(`reviewQueue.start`)})]}),(0,W.jsxs)(`div`,{className:kS,children:[(0,W.jsx)(`span`,{className:AS,children:[t.author,...r].filter(Boolean).join(`, `)}),(0,W.jsxs)(`span`,{className:`mono`,children:[`+`,t.additions,` −`,t.deletions]}),(0,W.jsx)(`span`,{className:`mono`,children:Number.isFinite(n)?yO(n,e.now):``})]})]})}function TO({model:e}){U();let t=e.client,[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(null),[o,s]=(0,m.useState)(0),[c,l]=(0,m.useState)(null),[u,d]=(0,m.useState)(null),[f,p]=(0,m.useState)(0),h=(0,m.useRef)(!1),g=dO(),_=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=!0,n=h.current;return h.current=!1,a(null),t.request(`review.queue`,n?{refresh:!0}:{}).then(t=>e&&r(t)).catch(t=>{e&&(a(nO(t)),r({prs:[],other:0}))}),()=>{e=!1}},[t,f]);let v=n?.prs??[],y=Math.min(o,Math.max(0,v.length-1));(0,m.useEffect)(()=>{_.current?.querySelector(`[data-row="${y}"]`)?.scrollIntoView({block:`nearest`})},[y]);let b=async e=>{if(c===null){l(e.number),d(H(`reviewQueue.preparing`,{number:e.number}));try{let{ref:n}=await t.request(`review.prepare`,{repo:e.repo,number:e.number});ie(rb(e,n,H(`reviewQueue.prompt`,{number:e.number,repo:e.nameWithOwner,title:e.title,url:e.url,head:e.headRef,base:e.baseRef})))}catch(t){z(H(`reviewQueue.failed`,{number:e.number,error:nO(t)}),`error`)}finally{l(null),d(null)}}};uO(e=>{if(e.ctrlKey)return e.key===`c`&&(N.set(null),!0);switch(e.key){case`Escape`:case`q`:return N.set(null),!0;case`j`:case`ArrowDown`:return s(Math.min(v.length-1,y+1)),!0;case`k`:case`ArrowUp`:return s(Math.max(0,y-1)),!0;case`r`:return h.current=!0,p(e=>e+1),!0;case`Enter`:{let e=v[y];return e&&b(e),!0}default:return!1}});let x=Date.now();return(0,W.jsxs)(`div`,{className:yS,tabIndex:0,ref:g,children:[(0,W.jsxs)(`div`,{className:xS,children:[(0,W.jsx)(`h1`,{className:bS,children:H(`reviewQueue.title`)}),(0,W.jsx)(xO,{})]}),i?(0,W.jsx)(`p`,{className:`text-error`,children:i}):n===null?(0,W.jsx)(`p`,{className:`text-muted`,children:`…`}):n.reason?(0,W.jsx)(`p`,{className:`text-muted`,children:H(CO[n.reason])}):v.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:H(`reviewQueue.empty`)}):(0,W.jsx)(`div`,{className:TS,ref:_,children:v.map((e,t)=>(0,W.jsx)(wO,{pr:e,index:t,at:t===y,now:x,busy:c!==null,onPick:()=>s(t),onReview:()=>void b(e)},`${e.nameWithOwner}#${e.number}`))}),n&&n.other>0&&(0,W.jsx)(`p`,{className:`text-muted mx-0 mt-2 mb-0 text-meta leading-[inherit]`,children:H(`reviewQueue.other`,{count:n.other})}),u&&(0,W.jsx)(`p`,{className:`text-muted mx-0 mt-2 mb-0 text-meta leading-[inherit]`,children:u})]})}var EO=30;function DO(){let{items:e}=eO();return t=>{let n=t.indexOf(`: `);switch(n>=0?t.slice(0,n):`failed`){case`no-remote`:return e.errorHint.noRemote;case`gh-missing`:return e.errorHint.ghMissing;case`auth`:return e.errorHint.auth;default:return $(e.errorHint.fallback,{message:t})}}}function OO({model:e}){let{items:t,common:n}=eO(),r=DO(),i=e.client,a=y(e.tasks),o=oO(e),s=sO(e),[c,l]=(0,m.useState)(()=>{let e=s?o.findIndex(e=>rO(e)===rO(s)):-1;return Math.max(0,e)}),u=o[c],d=(e,t)=>({repo:e,limit:EO,...t?{assignee:`@me`}:{}}),f=e=>Object.fromEntries(e.links.map(e=>[e.number,e.taskId])),[p,h]=(0,m.useState)(()=>u?X(i,`workitem.list`,d(u,!1))?.items??null:null),[g,_]=(0,m.useState)(()=>{let e=u?X(i,`workitem.links`,{repo:u}):void 0;return e?f(e):{}}),[v,b]=(0,m.useState)(null),[x,S]=(0,m.useState)(!1),[C,w]=(0,m.useState)(0),[T,E]=(0,m.useState)(0),[D,O]=(0,m.useState)(!1),[k,A]=(0,m.useState)(null),j=dO(),M=(0,m.useRef)(!1);(0,m.useEffect)(()=>{let e=!0;if(!u){h([]);return}b(null);let t=M.current;M.current=!1;let n=d(u,x),r=X(i,`workitem.list`,n);return r&&h(r.items),i.request(`workitem.list`,{...n,...t?{refresh:!0}:{}}).then(t=>e&&h(rd(i,`workitem.list`,n,t).items)).catch(t=>{e&&(b(nO(t)),h([]))}),Z(i,`workitem.links`,{repo:u}).then(t=>e&&_(f(t))).catch(()=>e&&_({})),()=>{e=!1}},[i,u,x,C,a?.tasks.length]);let ee=p??[],P=Math.min(T,Math.max(0,ee.length-1));(0,m.useEffect)(()=>A(null),[u,x]);let F=(0,m.useRef)(null);(0,m.useEffect)(()=>{F.current?.querySelector(`[data-row="${P}"]`)?.scrollIntoView({block:`nearest`})},[P]);let I=e=>a?.tasks.find(t=>t.id===e)?.label??e,te=t=>{N.set(null),e.select(t)},ne=async()=>{let e=ee[P];if(!e||!u||D)return;let n=g[e.number];if(n){A($(t.openingLinked,{title:I(n)})),te(n);return}O(!0),A($(t.starting,{number:e.number}));try{let n=await i.request(`workitem.start`,{repo:u,number:e.number});n.started?te(n.taskId):A($(t.startedNoEngine,{title:n.title}))}catch(n){z($(t.startFailed,{number:e.number,error:nO(n)}),`error`)}finally{O(!1)}};uO(e=>{if(e.ctrlKey)return e.key===`c`&&(N.set(null),!0);switch(e.key){case`Escape`:case`q`:return N.set(null),!0;case`j`:case`ArrowDown`:return E(Math.min(ee.length-1,P+1)),!0;case`k`:case`ArrowUp`:return E(Math.max(0,P-1)),!0;case`Tab`:return l(t=>o.length?(t+(e.shiftKey?o.length-1:1))%o.length:0),!0;case`a`:return S(e=>!e),!0;case`r`:return M.current=!0,w(e=>e+1),!0;case`Enter`:return ne(),!0;default:return!1}});let L=Date.now();return(0,W.jsxs)(`div`,{className:yS,tabIndex:0,ref:j,children:[(0,W.jsxs)(`div`,{className:xS,children:[(0,W.jsx)(`h1`,{className:bS,children:t.title}),(0,W.jsx)(xO,{}),(0,W.jsxs)(`span`,{className:`mono touch:empty:hidden! text-muted ${SS(!0)}`,children:[u?iO(u,o):t.noRepo,x?` ${t.assignedFilter}`:``]})]}),v?(0,W.jsxs)(`div`,{className:TS,children:[(0,W.jsx)(`p`,{className:`text-error`,children:v}),(0,W.jsx)(`p`,{className:`text-muted`,children:r(v)})]}):p===null?(0,W.jsx)(`p`,{className:`text-muted`,children:n.loading}):ee.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:t.empty}):(0,W.jsx)(`div`,{className:TS,ref:F,children:ee.map((e,n)=>{let r=g[e.number],i=Date.parse(e.updatedAt);return(0,W.jsxs)(`div`,{"data-row":n,className:ES(n===P),onClick:()=>n===P?void ne():E(n),children:[(0,W.jsxs)(`div`,{className:DS,children:[(0,W.jsxs)(`span`,{className:`mono ${OS}`,children:[`#`,e.number]}),(0,W.jsx)(`span`,{children:e.title})]}),(0,W.jsxs)(`div`,{className:kS,children:[(0,W.jsx)(`span`,{className:AS,children:[e.author,...e.labels.slice(0,2)].filter(Boolean).join(`, `)}),r&&(0,W.jsx)(`span`,{children:$(t.linkedChip,{title:I(r)})}),(0,W.jsx)(`span`,{className:`mono`,children:Number.isFinite(i)?yO(i,L):``})]})]},e.number)})}),k&&(0,W.jsx)(`p`,{className:`text-muted mx-0 mt-2 mb-0 text-meta leading-[inherit]`,children:k})]})}function kO({model:e}){return y(nb)===`reviews`?(0,W.jsx)(TO,{model:e}):(0,W.jsx)(OO,{model:e})}var AO={backlog:`active`,in_progress:`active`,in_review:`parked`,error:`parked`,done:`terminal`,canceled:`terminal`,open:`active`,doing:`active`,hold:`parked`};function jO(e){return AO[e]??`parked`}var MO=[`backlog`,`in_progress`,`parked`,`done`];function NO(e,t,n){let r=e.find(e=>e.issues.length>0)?.issues[0]?.id??null;if(t==null)return r;let i=-1,a=-1;for(let[n,r]of e.entries()){let e=r.issues.findIndex(e=>e.id===t);if(e!==-1){i=n,a=e;break}}if(i===-1)return r;if(n===`up`||n===`down`){let r=e[i]?.issues??[],o=n===`up`?a-1:a+1;return r[Math.max(0,Math.min(o,r.length-1))]?.id??t}let o=n===`left`?-1:1;for(let n=i+o;n>=0&&n<e.length;n+=o){let r=e[n]?.issues??[];if(r.length!==0)return r[Math.min(a,r.length-1)]?.id??t}return t}function PO(e,t){let n=jO(e.status);return n===`terminal`?`done`:n===`parked`?`parked`:e.taskId!==void 0&&e.taskId!==``&&(t?.(e.taskId)??!0)||e.status===`doing`?`in_progress`:`backlog`}function FO(e,t){let n=0;return{columns:e.map(e=>{if(e.key!==`in_progress`)return e;let r=[],i=[];for(let n of e.issues)n.taskId!==void 0&&n.taskId!==``&&t(n.taskId)?r.push(n):i.push(n);return n=r.length,r.length===0?e:{...e,issues:[...r,...i]}}),attentionCount:n}}function IO(e,t){return e.created===t.created?t.id-e.id:e.created<t.created?1:-1}function LO(e,t){let n={backlog:[],in_progress:[],parked:[],done:[]};for(let r of e)n[PO(r,t)].push(r);return MO.map(e=>{let t=e===`done`||e===`parked`,r=n[e].sort(IO);return!t||r.length<=20?{key:e,issues:r,hiddenCount:0}:{key:e,issues:r.slice(0,20),hiddenCount:r.length-20}})}var RO=[`worktree`,`project`];async function zO(e,t){let n=t.placement===`project`?`project`:`worktree`,{title:r,prompt:i}=await e.request(`issue.prompt`,{repo:t.repo,id:t.issue.id,where:n}),a=[];if(t.placement!==`project`){let{taskId:n}=await e.request(`task.create`,{repo:t.repo,engine:t.engine,title:r,prompt:i});return await e.request(`issue.update`,{repo:t.repo,id:t.issue.id,task:n}).catch(e=>a.push({kind:`link`,error:nO(e)})),{taskId:n,warnings:a}}let o=await Xu((t,n)=>e.request(t,n),t.repo,t.engine,r,i);if(!o)throw Error(`the session did not start`);return await e.request(`issue.setStatus`,{repo:t.repo,id:t.issue.id,status:`doing`}).catch(e=>a.push({kind:`status`,error:nO(e)})),{taskId:o,warnings:a}}var BO=`text-meta leading-[inherit]`,VO=`text-meta`,HO=`flex flex-col gap-2 overflow-hidden`,UO=`flex min-w-0 items-baseline gap-3`,WO=`font-bold whitespace-nowrap text-accent touch:relative touch:after:absolute touch:after:-inset-x-2 touch:after:-inset-y-1 touch:after:content-['']`,GO=`min-w-0 truncate ${VO}`,KO=`ml-auto ${BO}`,qO=`grid min-h-0 flex-1 grid-cols-4 gap-2`,JO=`flex min-h-0 flex-1 flex-col gap-2`,YO=`flex gap-4 ${VO}`,XO=e=>`flex items-baseline gap-1.5 whitespace-nowrap touch:relative touch:after:absolute touch:after:-inset-x-1.5 touch:after:-top-1 touch:after:-bottom-3 touch:after:content-[''] ${e?`font-bold text-accent`:`text-muted`}`,ZO={in_progress:`text-accent`,parked:`text-warning`,done:`text-success`},QO=e=>`flex min-h-0 flex-col rounded-md border-hairline border-line p-2 ${e?`flex-1`:``}`,$O=e=>`m-0 mb-2 flex justify-between gap-2 font-mono text-meta font-bold normal-nums ${ZO[e]??`text-muted`}`,ek=`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto`,tk=`m-0 ${VO}`,nk=e=>`flex flex-none cursor-pointer flex-col gap-1 rounded-sm border-hairline bg-surface px-2.5 py-2 ${e.selected?`border-accent`:e.attention?`border-warning`:`border-line hover:border-line-active`}`,rk=`flex justify-between gap-2`,ik=e=>`min-w-0 font-bold wrap-anywhere ${e?`text-muted`:``}`,ak=`h-[2.8em] overflow-hidden whitespace-pre-wrap wrap-anywhere ${BO}`,ok=`flex justify-between gap-2 ${VO}`,sk=`w-[min(680px,calc(100vw-32px))]!`,ck=`flex items-baseline gap-3.5`,lk=`flex items-baseline gap-2.5`,uk=`tracking-[0] normal-case`,dk=`min-h-40 font-mono`,fk=`flex flex-col items-start gap-0.5`,pk=e=>`text-left font-mono text-meta whitespace-pre-wrap normal-nums ${e?`font-bold text-accent`:`font-normal text-muted`}`,mk=BO,hk=`flex flex-col gap-1 [&_p]:m-0`,gk=`flex gap-2 ${VO}`,_k=`min-w-[4ch] text-right`,vk=`rounded-sm border-hairline border-transparent p-1 focus:border-accent focus:outline-none`,yk={choice:`radiogroup`,list:`listbox`,cells:`group`};function bk(e){return(0,W.jsx)(`div`,{ref:e.fieldRef,role:yk[e.kind??`choice`],tabIndex:0,"aria-label":e.label,className:`${vk} ${e.className??``}`,onKeyDown:e.onKeyDown,onClick:e.onClick,children:e.children})}var xk=[`open`,`doing`,`hold`,`done`];function Sk({model:e,taskId:t}){let{kanban:n}=eO(),[r,i]=(0,m.useState)(null);return(0,m.useEffect)(()=>{let n=!0;return e.client.request(`task.events`,{taskId:t}).then(e=>n&&i(e.events)).catch(()=>n&&i([])),()=>{n=!1}},[e,t]),(0,W.jsxs)(`div`,{className:hk,children:[(0,W.jsx)(`h2`,{className:`${Ar} text-muted`,children:n.detail.eventsLabel}),r===null?(0,W.jsx)(`p`,{className:`text-muted`,children:n.detail.eventsLoading}):r.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:n.detail.eventsNone}):r.map(e=>(0,W.jsxs)(`div`,{className:`mono ${gk}`,children:[(0,W.jsx)(`span`,{className:`text-muted ${_k}`,children:yO(e.at)}),(0,W.jsx)(`span`,{children:e.kind}),e.tail&&(0,W.jsx)(`span`,{className:`text-muted`,children:e.tail})]},`${e.at}:${e.kind}:${e.tail}`))]})}function Ck(e){let{kanban:t}=eO(),{issue:n,mode:r}=e,i=r===`create`,a=!i&&n.taskId?n.taskId:null,o=i||!a&&n.status!==`done`,[s,c]=(0,m.useState)(n.title),[l,u]=(0,m.useState)(n.body),[d,f]=(0,m.useState)(n.status),[p,h]=(0,m.useState)(e.defaultEngine),[g,_]=(0,m.useState)(RO[0]),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(!1),S=(0,m.useRef)({}),C=e=>t=>{S.current[e]=t},w=i?`title`:o?`workspace`:a?`open`:`title`;(0,m.useEffect)(()=>S.current[w]?.focus(),[w]);let T=()=>({title:s.trim()||n.title,body:l,status:d}),E=()=>({engine:p,placement:g,jump:v}),D=t=>{B(),t&&e.onOutcome(t)},O=()=>s.trim()?!0:(S.current.title?.focus(),!1),k=()=>{i?O()&&D({kind:`create`,title:s.trim(),body:l,start:E()}):o?D({kind:`start`,...E(),...T()}):a&&D({kind:`open`,taskId:a,...T()})},A=()=>{i&&O()&&D({kind:`create`,title:s.trim(),body:l,start:null})},j=()=>D(i?null:{kind:`close`,...T()}),M=(0,m.useRef)({commit:k,saveOnly:A,close:j});M.current={commit:k,saveOnly:A,close:j},(0,m.useEffect)(()=>{let e=e=>{let t=e.key===`Escape`?M.current.close:e.key===`Enter`&&(e.ctrlKey||e.metaKey)?M.current.commit:e.key.toLowerCase()===`s`&&e.ctrlKey&&!e.metaKey?M.current.saveOnly:null;t&&(e.preventDefault(),e.stopImmediatePropagation(),t())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[]);let N=async t=>{let n=t.find(e=>e.size>Zl);if(n){z(H(`pages.attachTooLarge`,{name:n.name||n.type}),`error`);return}x(!0);try{let n=await Promise.all(t.map(t=>iu(e.model.client,t)));u(e=>tu(e,n))}catch(e){z(K(e),`error`)}finally{x(!1)}},ee=e=>{let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),N(t))},P=e=>{let t=Array.from(e.dataTransfer.files);e.preventDefault(),t.length>0&&N(t)},F=(e,t,n)=>e[(Math.max(0,e.indexOf(t))+n+e.length)%e.length],I=(e,t,n)=>r=>{if(r.ctrlKey||r.metaKey||r.altKey)return;let i=(e===`x`?{ArrowRight:1,l:1,ArrowLeft:-1,h:-1}:{ArrowDown:1,ArrowUp:-1})[r.key];if(i)t(i);else if(r.key===`Enter`&&n)n();else return;r.preventDefault()},te=d===`done`?`text-success`:d===`hold`?`text-warning`:d===`doing`?`text-accent`:`text-muted`,ne=e=>t.detail.status[e];return(0,W.jsx)(`div`,{className:Vr,onMouseDown:e=>e.target===e.currentTarget&&M.current.close(),children:(0,W.jsxs)(`dialog`,{open:!0,className:`${Hr(!0)} ${sk}`,"aria-label":i?t.detail.newStory:`#${n.id}`,onPaste:ee,onDrop:P,onDragOver:e=>e.preventDefault(),children:[(0,W.jsxs)(`div`,{className:Ur,children:[i?(0,W.jsx)(`h1`,{className:`${Ar} text-muted`,children:t.detail.newStory}):(0,W.jsxs)(`h1`,{className:`${Ar} text-muted ${ck}`,children:[(0,W.jsxs)(`span`,{children:[`#`,n.id]}),(0,W.jsx)(`span`,{className:te,children:ne(d)}),(0,W.jsx)(`span`,{className:`text-muted`,children:$(t.detail.created,{date:n.created})}),a&&(0,W.jsx)(`span`,{className:`text-accent`,children:t.detail.linked})]}),(0,W.jsx)(`button`,{type:`button`,className:Gr,"aria-label":H(`dialog.close`),title:H(`dialog.close`),onClick:()=>M.current.close(),children:`×`})]}),(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsxs)(`label`,{className:Ir,children:[(0,W.jsx)(`span`,{className:`${Ar} text-muted`,children:t.detail.titleLabel}),(0,W.jsx)(`input`,{ref:C(`title`),className:Nr,spellCheck:!1,value:s,onChange:e=>c(e.target.value.replace(/[\r\n]+/g,` `)),onKeyDown:e=>{e.key===`Enter`&&!e.ctrlKey&&!e.metaKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),S.current.description?.focus())}})]}),(0,W.jsxs)(`label`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.detail.description,(0,W.jsx)(`span`,{className:`text-muted ${uk}`,children:xu()?H(`pages.attachHintTouch`):t.detail.attachHint}),b&&(0,W.jsx)(`span`,{className:`text-accent`,children:`…`})]}),(0,W.jsx)(`textarea`,{ref:C(`description`),className:`${Nr} ${Lr} ${dk}`,rows:8,spellCheck:!1,placeholder:t.detail.noDescription,value:l,onChange:e=>u(e.target.value)})]}),!i&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsxs)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted flex items-baseline gap-2.5`,children:[t.detail.statusLabel,(0,W.jsx)(`span`,{className:`keys-only text-muted tracking-[0] normal-case`,children:`←/→`})]}),(0,W.jsx)(bk,{fieldRef:C(`status`),label:t.detail.statusLabel,className:`flex flex-wrap gap-1.5`,onKeyDown:I(`x`,e=>f(F(xk,d,e))),children:xk.map(e=>(0,W.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-pressed":e===d,className:zr(e===d),onClick:()=>{f(e),S.current.status?.focus()},children:ne(e)},e))})]}),o?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.detail.engine,(0,W.jsx)(`span`,{className:`keys-only text-muted ${uk}`,children:`←/→`})]}),(0,W.jsx)(bk,{fieldRef:C(`engine`),label:t.detail.engine,className:Rr,onKeyDown:I(`x`,t=>h(F(e.engines.map(e=>e.id),p,t)),k),children:e.engines.map(e=>(0,W.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-pressed":e.id===p,className:zr(e.id===p),onClick:()=>{h(e.id),S.current.engine?.focus()},children:e.name},e.id))})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.detail.workspace,(0,W.jsx)(`span`,{className:`keys-only text-muted ${uk}`,children:`↑/↓`})]}),(0,W.jsx)(bk,{fieldRef:C(`workspace`),label:t.detail.workspace,className:fk,onKeyDown:I(`y`,e=>_(F(RO,g,e)),k),children:RO.map(e=>(0,W.jsxs)(`button`,{type:`button`,tabIndex:-1,"aria-pressed":e===g,className:`touch:py-1.5 ${pk(e===g)}`,onClick:()=>{_(e),S.current.workspace?.focus()},children:[e===g?`▸ `:` `,t.detail.placement[e]]},e))})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.detail.jumpLabel,(0,W.jsx)(`span`,{className:`keys-only text-muted ${uk}`,children:`←/→`})]}),(0,W.jsx)(bk,{fieldRef:C(`jump`),label:t.detail.jumpLabel,className:Rr,onKeyDown:I(`x`,()=>y(!v),k),children:[!1,!0].map(e=>(0,W.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-pressed":e===v,className:zr(e===v),onClick:()=>{y(e),S.current.jump?.focus()},children:e?t.detail.jump.follow:t.detail.jump.stay},String(e)))})]}),(0,W.jsx)(`p`,{className:`touch:empty:hidden! text-muted ${mk}`,children:(0,W.jsx)(xp,{text:wu(i?t.detail.createLegend:t.detail.startLegend)})}),(0,W.jsxs)(`div`,{className:Pr,children:[i&&(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:A,children:H(`pages.storySave`)}),(0,W.jsx)(`button`,{type:`button`,className:xr(),onClick:k,children:H(i?`pages.storySaveStart`:`pages.storyStart`)})]})]}):a?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsx)(`span`,{className:`${Ar} text-muted`,children:t.detail.sessionLabel}),(0,W.jsxs)(`div`,{className:`${Rr} ${vk}`,children:[(0,W.jsx)(`button`,{ref:C(`open`),type:`button`,className:zr(!0),onClick:()=>D({kind:`open`,taskId:a,...T()}),children:t.detail.openAction}),(0,W.jsx)(`button`,{ref:C(`unlink`),type:`button`,className:zr(),onClick:()=>D({kind:`unlink`,...T()}),children:t.detail.unlinkAction})]})]}),(0,W.jsx)(Sk,{model:e.model,taskId:a}),(0,W.jsx)(`p`,{className:`touch:empty:hidden! text-muted ${mk}`,children:(0,W.jsx)(xp,{text:wu(t.detail.openLegend)})})]}):(0,W.jsx)(`p`,{className:`touch:empty:hidden! text-muted ${mk}`,children:(0,W.jsx)(xp,{text:wu(t.detail.doneNote)})})]})]})})}var wk={"waiting-on-you":`text-error`,landing:`text-success`,"ready-for-review":`text-ink`,working:`text-accent`};function Tk(e){let[t,n]=(0,m.useState)(()=>{let t=X(e,`engines.list`);return t?Ru(t.engines):[]});return(0,m.useEffect)(()=>e.client.onOpen(()=>{Z(e,`engines.list`).then(e=>n(Ru(e.engines))).catch(()=>{})}),[e]),{engines:t,defaultEngine:zu(t)}}function Ek(e,t){let n=oO(e),r=n.join(`
|
|
59
|
-
`),[i,a]=(0,m.useState)(()=>X(e,`kanban.boards`)??null);return(0,m.useEffect)(()=>{let t=!0,r=e.client,i=e=>r.request(e).then(e=>e.repos).catch(()=>[]);return Promise.all([i(`repos.list`),i(`issue.repos`)]).then(([e,t])=>aO(e,n,t)).then(e=>Promise.all(e.map(e=>r.request(`issue.list`,{repo:e}).catch(t=>({repoRoot:e,nextId:1,issues:[],readError:nO(t)}))))).then(n=>{let r=rd(e,`kanban.boards`,void 0,[...n].sort((e,t)=>e.repoRoot.localeCompare(t.repoRoot)));t&&a(r)}),()=>{t=!1}},[e,t,r]),i}function Dk(e){let{issue:t}=e,n=t.body.trim();return(0,W.jsxs)(`div`,{"data-issue":t.id,className:nk({selected:e.selected,attention:e.badge?.tone===`text-error`}),onClick:()=>e.selected?e.onOpen():e.onSelect(),onContextMenu:t=>{t.preventDefault(),e.onMenu(t.clientX,t.clientY)},children:[(0,W.jsxs)(`div`,{className:rk,children:[(0,W.jsx)(`span`,{className:ik(e.column===`done`),children:t.title}),(0,W.jsxs)(`span`,{className:`mono text-muted`,children:[`#`,t.id]})]}),(0,W.jsx)(`div`,{className:`text-muted ${ak}`,children:n}),(0,W.jsxs)(`div`,{className:`mono text-muted ${ok}`,children:[(0,W.jsx)(`span`,{children:t.created}),e.badge&&(0,W.jsx)(`span`,{className:e.badge.tone,children:e.badge.label})]})]})}var Ok=5e3,kk=760;function Ak({model:e}){let{kanban:t,group:n,common:r}=eO(),[i,a]=cO(Ok),o=Ek(e,i),{engines:s,defaultEngine:c}=Tk(e),l=y(e.tasks),u=sO(e),[d,f]=(0,m.useState)(null),[p,h]=(0,m.useState)(null),g=dO(),[_,v]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let e=g.current;if(!e)return;let t=new ResizeObserver(()=>v(e.clientWidth<kk));return t.observe(e),()=>t.disconnect()},[g]);let b=o??[],x=u?b.find(e=>e.repoRoot.replace(/^\/private\//,`/`)===u.replace(/^\/private\//,`/`)):void 0,S=Math.max(0,b.findIndex(e=>e.repoRoot===(d??x?.repoRoot))),C=b[S],w=b.map(e=>e.repoRoot),T=b.filter(e=>e.readError).map(e=>`${e.repoRoot}\0${e.readError}`).join(`
|
|
60
|
-
`);(0,m.useEffect)(()=>{for(let e of b)e.readError&&z($(t.readFailedToast,{repo:iO(e.repoRoot,w),error:e.readError}),`error`)},[T]);let E=l?.tasks??[],k=new Set(E.map(e=>e.id)),A=e=>E.find(t=>t.id===e)?.group,{columns:j,attentionCount:M}=FO(C?LO(C.issues,k.size===0?void 0:e=>k.has(e)):[],e=>A(e)===`waiting-on-you`),ee={backlog:t.column.backlog,in_progress:t.column.inProgress,parked:t.column.parked,done:t.column.done},P=(e,t)=>{let r=e.taskId&&(t===`in_progress`||t===`parked`)?A(e.taskId):void 0,i=r===`waiting-on-you`?n.waitingOnYou:r===`landing`?n.landing:r===`ready-for-review`?n.readyForReview:r===`working`?n.working:null;return r&&i?{label:i,tone:wk[r]??`text-muted`}:null},F=async(t,n,r,i)=>{try{return await e.client.request(t,{repo:C?.repoRoot,...n})}catch(e){return z($(r,{id:String(i),error:nO(e)}),`error`),null}finally{a()}},I=(e,n)=>F(`issue.setStatus`,{id:e.id,status:n},t.statusFailed,e.id),te=t=>{N.set(null),e.select(t)},ne=async(n,r,i)=>{try{let a=await zO(e.client,{repo:n,issue:r,engine:i.engine,placement:i.placement});for(let e of a.warnings)z($(e.kind===`link`?t.linkFailed:t.statusFailed,{id:String(r.id),error:e.error}),`error`);i.jump?(N.set(null),e.selectWhenListed(a.taskId)):z($(t.detail.startedBackground,{title:`#${r.id} ${r.title}`}))}catch(e){z(K(e),`error`)}finally{a()}},L=async(e,n)=>{if(!C||n.kind===`create`)return;let r={};n.title!==e.title&&(r.title=n.title),n.body!==e.body&&(r.body=n.body),(r.title!==void 0||r.body!==void 0)&&await F(`issue.update`,{id:e.id,...r},t.updateFailed,e.id),n.status!==e.status&&await I(e,n.status),n.kind===`open`?te(n.taskId):n.kind===`unlink`?await F(`issue.update`,{id:e.id,task:`none`},t.unlinkFailed,e.id):n.kind===`start`&&await ne(C.repoRoot,{...e,...r},n)},re=t=>{C&&(h(t.id),O.set((0,W.jsx)(Ck,{model:e,issue:t,mode:`detail`,engines:s,defaultEngine:c,onOutcome:e=>void L(t,e)})))},ie=()=>{if(!C)return;let n=C.repoRoot,r={id:C.nextId,title:``,status:`open`,created:new Date().toISOString().slice(0,10),body:``};O.set((0,W.jsx)(Ck,{model:e,issue:r,mode:`create`,engines:s,defaultEngine:c,onOutcome:i=>{i.kind===`create`&&(async()=>{try{let t=await e.client.request(`issue.create`,{repo:n,title:i.title,body:i.body});if(a(),!i.start)return;let o=t.issues.find(e=>e.id===r.id)??t.issues.reduce((e,t)=>e&&e.id>t.id?e:t,null);o&&await ne(n,o,i.start)}catch(e){z($(t.createFailed,{error:nO(e)}),`error`)}})()}}))},ae=()=>{let n=C?.issues.find(e=>e.id===p);if(!C||!n)return;let i=C.repoRoot;O.set((0,W.jsx)(q,{title:$(t.confirmDelete.title,{id:String(n.id)}),body:$(t.confirmDelete.body,{title:n.title}),confirmLabel:r.confirm,onConfirm:async()=>{try{await e.client.request(`issue.delete`,{repo:i,id:n.id}),h(null)}catch(e){z($(t.deleteFailed,{id:String(n.id),error:nO(e)}),`error`)}finally{a()}}}))},R=e=>{b.length!==0&&(f(b[(S+e+b.length)%b.length]?.repoRoot??null),h(null))},oe=e=>{let t=NO(j,p,e);t!=null&&h(t)},se=e=>j.some(e=>e.issues.length>0)?oe(e):R(e===`left`?-1:1);uO(e=>{if(e.ctrlKey)return e.key===`c`&&(N.set(null),!0);switch(e.key){case`Escape`:case`q`:return N.set(null),!0;case`r`:return a(),!0;case`Tab`:return R(e.shiftKey?-1:1),!0;case`ArrowUp`:return oe(`up`),!0;case`ArrowDown`:return oe(`down`),!0;case`ArrowRight`:case`l`:return se(`right`),!0;case`ArrowLeft`:case`h`:return se(`left`),!0;case`Enter`:{let e=C?.issues.find(e=>e.id===p);return e&&re(e),!0}case`n`:return ie(),!0;case`d`:return ae(),!0;default:return!1}});let ce=(0,m.useRef)(null);(0,m.useEffect)(()=>{ce.current?.querySelector(`[data-issue="${p}"]`)?.scrollIntoView({block:`nearest`})},[p]);let le=(e,n,r)=>{h(e.id),D.set({x:n,y:r,items:xk.filter(t=>t!==e.status).map(n=>({label:$(t.menu.setStatus,{status:t.detail.status[n]}),run:()=>void I(e,n)}))})},B=j.find(e=>e.issues.some(e=>e.id===p))??j.find(e=>e.issues.length>0)??j[0],ue=(e,n=!1)=>{let r=$(t.attention,{count:String(M)});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{children:[ee[e.key],` (`,e.issues.length+e.hiddenCount,`)`]}),e.key===`in_progress`&&M>0&&(0,W.jsx)(`span`,{className:`text-warning`,title:n?r:void 0,children:n?`!${M}`:r})]})},de=(e,n)=>(0,W.jsxs)(`section`,{className:QO(!n),children:[n&&(0,W.jsx)(`h2`,{className:$O(e.key),children:ue(e)}),(0,W.jsxs)(`div`,{className:ek,children:[e.issues.map(t=>(0,W.jsx)(Dk,{issue:t,column:e.key,selected:t.id===p,badge:P(t,e.key),onSelect:()=>h(t.id),onOpen:()=>re(t),onMenu:(e,n)=>le(t,e,n)},t.id)),e.issues.length===0&&e.hiddenCount===0&&(0,W.jsx)(`p`,{className:`mono text-muted ${tk}`,children:t.columnEmpty}),e.hiddenCount>0&&(0,W.jsx)(`p`,{className:`mono text-muted ${tk}`,children:$(t.more,{count:String(e.hiddenCount)})})]})]},e.key);return(0,W.jsxs)(`div`,{className:`${vS} ${HO}`,tabIndex:0,ref:g,children:[(0,W.jsxs)(`div`,{className:`kb-top`,children:[(0,W.jsx)(`h1`,{className:bS,children:t.title}),(0,W.jsx)(`span`,{className:`mono keys-only text-muted`,children:t.hint}),(0,W.jsxs)(`span`,{className:`mono ${CS}`,children:[(0,W.jsx)(`button`,{type:`button`,className:`${jr} ${wS.kanban}`,disabled:!C,onClick:ie,children:H(`pages.new`)}),(0,W.jsx)(`button`,{type:`button`,className:`${jr} ${wS.kanban}`,disabled:!C?.issues.some(e=>e.id===p),onClick:ae,children:H(`pages.delete`)})]})]}),o===null?(0,W.jsx)(`p`,{className:`text-muted`,children:t.loading}):C?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:UO,children:[(0,W.jsxs)(`button`,{type:`button`,className:WO,onClick:()=>R(1),children:[iO(C.repoRoot,w),b.length>1&&(0,W.jsx)(`span`,{className:`text-muted`,children:` ${S+1}/${b.length}`})]}),!_&&(0,W.jsx)(`span`,{className:`mono text-muted ${GO}`,children:C.repoRoot}),C.issues.length===0&&!C.readError&&(0,W.jsx)(`span`,{className:`text-muted ${KO}`,children:t.empty})]}),C.readError?(0,W.jsx)(`p`,{className:`text-error`,children:$(t.readFailed,{error:C.readError})}):_&&B?(0,W.jsxs)(`div`,{className:JO,ref:ce,children:[(0,W.jsx)(`div`,{className:`mono ${YO}`,children:j.map(e=>(0,W.jsx)(`button`,{type:`button`,className:XO(e.key===B.key),onClick:()=>{let t=e.issues[0];t&&h(t.id)},children:ue(e,!0)},e.key))}),de(B,!1)]}):(0,W.jsx)(`div`,{className:qO,ref:ce,children:j.map(e=>de(e,!0))})]}):(0,W.jsx)(`p`,{className:`text-muted`,children:t.noRepos})]})}var jk={title:`Mods`,empty:`No mod is drawing anything.`,emptyHint:`A plugin with a [mod] entry draws its panes here, in the TUI and the web alike.`,keys:`↑↓/tab move · enter press · esc back`,pressFailed:`{plugin}: the press did not reach the mod ({reason})`},Mk={title:`Mods`,empty:`当前没有 mod 在绘制内容。`,emptyHint:`声明了 [mod] 的插件会在这里绘制面板,TUI 和 web 显示的是同一份。`,keys:`↑↓/tab 移动 · enter 按下 · esc 返回`,pressFailed:`{plugin}:按键没有送达 mod({reason})`},Nk={info:`text-info`,success:`text-success`,warning:`text-warning`,error:`text-error`,muted:`text-muted`},Pk=`flex flex-col gap-3`,Fk=`[&_p]:mx-0 [&_p]:my-1`,Ik=`rounded-md border-hairline border-line px-3 pt-2 pb-3 font-mono`,Lk=`mb-2 text-meta leading-[inherit] text-ink`,Rk=(e,t)=>`flex min-w-0 items-start ${e?`[&>form]:flex-[1_1_12em] [&>form]:self-center`:``} ${t?`rounded-sm border-hairline border-line`:``}`,zk=(e,t)=>`whitespace-pre-wrap wrap-anywhere ${e?Nk[e]:`text-ink`} ${t?`font-bold`:``}`,Bk=(e,t)=>`cursor-pointer rounded-sm border-hairline border-current px-2.5 py-0.5 [font:inherit] font-bold! ${Nk[e]} ${t?`bg-[color-mix(in_srgb,currentcolor_18%,transparent)]`:`bg-transparent [&:hover]:bg-[color-mix(in_srgb,currentcolor_18%,transparent)]`}`,Vk=`flex min-w-0 max-w-[40em] self-stretch`,Hk=`w-full font-mono`,Uk=[0,6,12,20];function Wk(e){return`mod-${e.kind}:${e.plugin}/${e.pane}/${e.key}`}function Gk(e){let[t,n]=(0,m.useState)(e.value??``);return(0,W.jsx)(`form`,{className:Vk,onSubmit:r=>{r.preventDefault(),e.onSubmit(t),n(e.value??``)},children:(0,W.jsx)(`input`,{id:e.id,className:`${Nr} ${Hk}`,spellCheck:!1,value:t,placeholder:e.placeholder,onFocus:e.onFocus,onChange:e=>n(e.target.value)})})}function Kk(e){let{node:t}=e;if(t.type===`text`)return(0,W.jsx)(`span`,{className:zk(t.tone,t.bold===!0),children:t.text});if(t.type===`input`){let n={kind:`input`,plugin:e.pane.plugin,pane:e.pane.id,key:t.key};return(0,W.jsx)(Gk,{id:Wk(n),placeholder:t.placeholder,value:t.value,onFocus:()=>e.onFocus(n),onSubmit:t=>e.onSubmit(n,t)},t.value??``)}if(t.type===`button`){let n={kind:`button`,plugin:e.pane.plugin,pane:e.pane.id,key:t.key};return(0,W.jsx)(`button`,{type:`button`,id:Wk(n),className:Bk(t.tone??`info`,xa(n,e.cursor)),onFocus:()=>e.onFocus(n),onClick:()=>e.onPress(n),children:t.label})}return(0,W.jsx)(`div`,{className:Rk(t.direction===`row`,t.border===!0),style:{flexDirection:t.direction??`column`,gap:Uk[t.gap??0],padding:Uk[t.padding??0]},children:t.children.map((t,n)=>(0,W.jsx)(Kk,{...e,node:t},n))})}function qk({model:e}){let t=U()===`zh`?Mk:jk,n=y(e.mods),r=ba(n),[i,a]=(0,m.useState)(null),o=Sa(r,i),s=dO(),c=(0,m.useRef)(!1),l=(t,n,r={})=>{a(t),!c.current&&(c.current=!0,e.client.request(n,{plugin:t.plugin,pane:t.pane,key:t.key,...r}).catch(e=>z(e instanceof Error?e.message:String(e),`error`)).finally(()=>{c.current=!1}))},u=e=>l(e,`mod.press`),d=(e,t)=>l(e,`mod.submit`,{value:t}),f=e=>{let t=Ca(r,o,e);a(t),t&&document.getElementById(Wk(t))?.focus()};return uO(e=>{if(e.ctrlKey)return e.key===`c`&&(N.set(null),!0);switch(e.key){case`Escape`:case`q`:return N.set(null),!0;case`ArrowDown`:return f(1),!0;case`ArrowUp`:return f(-1),!0;case`Enter`:return e.target instanceof HTMLButtonElement?!1:(o?.kind===`button`&&u(o),!0);default:return!1}}),(0,W.jsxs)(`div`,{className:`${yS} ${Pk}`,tabIndex:0,ref:s,children:[(0,W.jsxs)(`div`,{className:xS,children:[(0,W.jsx)(`h1`,{className:bS,children:t.title}),(0,W.jsx)(`span`,{className:`keys-only touch:empty:hidden! text-muted ${SS(!1)}`,children:t.keys})]}),n.length===0?(0,W.jsxs)(`div`,{className:Fk,children:[(0,W.jsx)(`p`,{children:t.empty}),(0,W.jsx)(`p`,{className:`text-muted`,children:t.emptyHint})]}):n.map(e=>(0,W.jsxs)(`section`,{className:Ik,children:[(0,W.jsxs)(`header`,{className:Lk,children:[e.title,` `,(0,W.jsx)(`span`,{className:`text-muted`,children:e.plugin})]}),(0,W.jsx)(Kk,{node:e.tree,pane:e,cursor:o,onPress:u,onSubmit:d,onFocus:a})]},`${e.plugin}/${e.id}`))]})}function Jk(e,t,n){if(e.script||e.target)return null;let r=e.vendor?t(e.vendor):n;return{full:[r,e.model,e.modelEffort].filter(Boolean).join(` · `),short:e.model??r}}function Yk(e){return e===`dispatch_failed`||e===`skipped_unavailable`||e===`script_failed`}function Xk(e,t){return e.response?`responded`:e.status!==`dispatched`&&e.status!==`revived`||e.deliveryStatus===`quiet`?null:e.deliveryStatus===`missing`?`missing`:e.deliveryStatus===`awaiting`?`awaiting`:t-Date.parse(e.at)>72e5?`missing`:`awaiting`}var Zk=6e4,Qk=3294,$k=new Map([[`JAN`,1],[`FEB`,2],[`MAR`,3],[`APR`,4],[`MAY`,5],[`JUN`,6],[`JUL`,7],[`AUG`,8],[`SEP`,9],[`OCT`,10],[`NOV`,11],[`DEC`,12]]),eA=new Map([[`SUN`,0],[`MON`,1],[`TUE`,2],[`WED`,3],[`THU`,4],[`FRI`,5],[`SAT`,6]]),tA=256;function nA(e,t,n){let r=e.toUpperCase(),i=t?.get(r);if(i!==void 0)return i;if(!/^\d+$/.test(r))throw Error(`invalid cron ${n}: ${e}`);return Number(r)}function rA(e){let t=new Set;for(let n of e.value.split(`,`)){if(n.length===0)throw Error(`invalid cron ${e.field}: ${e.value}`);let[r,i,...a]=n.split(`/`);if(a.length>0||r===void 0)throw Error(`invalid cron ${e.field}: ${n}`);let o=1;if(i!==void 0&&(!/^\d+$/.test(i)||(o=Number(i),o<1)))throw Error(`invalid cron ${e.field} step: ${n}`);let s,c;if(r===`*`)s=e.min,c=e.max;else if(r.includes(`-`)){let[t,i,...a]=r.split(`-`);if(a.length>0||t===void 0||i===void 0)throw Error(`invalid cron ${e.field} range: ${n}`);s=nA(t,e.names,e.field),c=nA(i,e.names,e.field)}else s=nA(r,e.names,e.field),c=i===void 0?s:e.max;if(s<e.min||c>e.max||s>c)throw Error(`cron ${e.field} out of range: ${n}`);for(let n=s;n<=c;n+=o)t.add(e.normalize?e.normalize(n):n)}return t}function iA(e){if(e.length>tA)throw Error(`cron expression is too long`);let t=e.trim().split(/\s+/).filter(Boolean);if(t.length!==5)throw Error(`cron expression needs 5 fields (minute hour day month weekday), got ${t.length}`);let[n,r,i,a,o]=t;return{minutes:rA({value:n,min:0,max:59,field:`minute`}),hours:rA({value:r,min:0,max:23,field:`hour`}),daysOfMonth:rA({value:i,min:1,max:31,field:`day-of-month`}),months:rA({value:a,min:1,max:12,field:`month`,names:$k}),daysOfWeek:rA({value:o,min:0,max:7,field:`weekday`,names:eA,normalize:e=>e%7}),dayOfMonthRestricted:!i.startsWith(`*`),dayOfWeekRestricted:!o.startsWith(`*`)}}function aA(e){try{return iA(e),!0}catch{return!1}}function oA(e,t,n){return new Date(e.year,e.month-1,e.day,t,n,0,0).getTime()}function sA(e){let t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}}function cA(e,t){return sA(new Date(e.year,e.month-1,e.day+t,12,0,0,0).getTime())}function lA(e,t){if(!e.months.has(t.month))return!1;let n=e.daysOfMonth.has(t.day),r=e.daysOfWeek.has(new Date(t.year,t.month-1,t.day).getDay());return e.dayOfMonthRestricted&&e.dayOfWeekRestricted?n||r:n&&r}function uA(e){return e-e%Zk}function dA(e,t){return[...e].sort((e,n)=>(e-n)*t)}function fA(e,t){let n=iA(e),r=dA(n.hours,1),i=dA(n.minutes,1),a=new Date(uA(t)+Zk),o=sA(a.getTime()),s=a.getHours(),c=a.getMinutes();for(let e=0;e<Qk;e++){if(lA(n,o)){for(let e of r)if(!(e<s))for(let n of i){if(e===s&&n<c)continue;let r=oA(o,e,n);if(r>t)return r}}o=cA(o,1),s=0,c=0}throw Error(`cron expression never matches: ${e}`)}var pA=[`minute`,`hour`,`dayOfMonth`,`month`,`dayOfWeek`];function mA(e){let t=e.trim().split(/\s+/).filter(Boolean);return pA.map((e,n)=>t[n]??`*`)}function hA(e){return pA.map((t,n)=>e[n]??`*`).join(` `)}var gA=[`*`,`*/5`,`*/10`,`*/15`,`*/30`,...SA(0,59)],_A=[`*`,`*/2`,`*/3`,`*/4`,`*/6`,`*/12`,...SA(0,23)],vA=[`*`,...SA(1,31)],yA=[`*`,`JAN`,`FEB`,`MAR`,`APR`,`MAY`,`JUN`,`JUL`,`AUG`,`SEP`,`OCT`,`NOV`,`DEC`],bA=[`*`,`MON-FRI`,`SAT,SUN`,`MON`,`TUE`,`WED`,`THU`,`FRI`,`SAT`,`SUN`],xA=[`MON`,`TUE`,`WED`,`THU`,`FRI`,`SAT`,`SUN`];function SA(e,t){let n=[];for(let r=e;r<=t;r++)n.push(String(r));return n}var CA={minute:gA,hour:_A,dayOfMonth:vA,month:yA,dayOfWeek:bA};function wA(e,t,n){let r=CA[e],i=r.indexOf(t.trim().toUpperCase());return i<0?(n>0?r[0]:r[r.length-1])??t:r[(i+n+r.length)%r.length]??t}function TA(e,t){return Math.min(Math.max(e+t,0),pA.length-1)}function EA(e,t,n){let r=mA(e);return t<0||t>=pA.length||(r[t]=n),hA(r)}function DA(e,t){let[n,r,i,a,o]=mA(e);if(a!==`*`||i!==`*`||n===void 0||r===void 0||o===void 0)return null;let s=OA(n,r,t);if(!s)return null;let{at:c,bare:l}=s;if(o===`*`)return l?c:t(`automations.schedule.everyDay`,{at:c});if(o===`MON-FRI`)return t(`automations.schedule.weekdays`,{at:c});if(o===`SAT,SUN`)return t(`automations.schedule.weekends`,{at:c});let u=xA.find(e=>e===o.toUpperCase());return u?t(`automations.schedule.onWeekday`,{weekday:t(`automations.schedule.dow.${u}`),at:c}):null}function OA(e,t,n){return t===`*`?e===`*`?{at:n(`automations.schedule.everyMinute`),bare:!0}:e.startsWith(`*/`)?{at:n(`automations.schedule.everyMinutes`,{n:e.slice(2)}),bare:!0}:/^\d+$/.test(e)?{at:n(`automations.schedule.hourlyAt`,{minute:e.padStart(2,`0`)}),bare:!1}:null:t.startsWith(`*/`)&&e===`0`?{at:n(`automations.schedule.everyHours`,{n:t.slice(2)}),bare:!0}:/^\d+$/.test(t)&&/^\d+$/.test(e)?{at:n(`automations.schedule.atClock`,{time:`${t.padStart(2,`0`)}:${e.padStart(2,`0`)}`}),bare:!1}:null}function kA(e,t,n,r){let i=e.trim();if(!aA(i))return{kind:`invalid`};let a;try{a=fA(i,t)}catch{return{kind:`never`}}return{kind:`ok`,nextRunMs:a,relative:AA(a-t,n),absolute:jA(a,t,n,r)}}function AA(e,t){let{minutes:n,hours:r,days:i}=vO(e);return n<60?t(`automations.when.inMinutes`,{n:Math.max(1,n)}):r<24?t(`automations.when.inHours`,{n:r}):t(`automations.when.inDays`,{n:i})}function jA(e,t,n,r){let i=new Date(e),a=`${String(i.getHours()).padStart(2,`0`)}:${String(i.getMinutes()).padStart(2,`0`)}`,o=new Date(t);if(i.getFullYear()===o.getFullYear()&&i.getMonth()===o.getMonth()&&i.getDate()===o.getDate())return a;let s=e-t<5184e5,c=i.toLocaleDateString(r,s?{weekday:`short`}:{weekday:`short`,month:`short`,day:`numeric`});return s?`${c} ${a}`:n(`automations.when.dateTime`,{date:c,time:a})}function MA(e,t){let n=t?.trim()??``;return n&&e?.effortLevels?.includes(n)?n:``}function NA(e){let{model:t}=e,[n,r]=(0,m.useState)([]),[i,a]=(0,m.useState)({}),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(``),[f,p]=(0,m.useState)(!1),{busy:h,error:g,submit:_}=wi();(0,m.useEffect)(()=>{Promise.all([t.client.request(`engines.list`),e.current()]).then(([e,t])=>{let n=Ru(e.engines,t.engine).filter(e=>e.ready!==!1||e.id===t.engine),i=n.find(e=>e.id===t.engine)??n[0];r(n),a(t),s(i?.id??``),l(MA(i,t.effort)),d(i?.id===t.engine?t.model??``:``),p(!0)})},[t]);let v=n.find(e=>e.id===o),y=v?.effortLevels??[],b=y.length>0?[``,...y]:[],x=(v?.models??[]).map(e=>e.id).filter(e=>e.toLowerCase().includes(u.trim().toLowerCase())&&e!==u.trim()).slice(0,6),S=e=>{s(e);let t=n.find(t=>t.id===e);l(MA(t,e===i.engine?i.effort:void 0)),d(e===i.engine?i.model??``:``)},C=e=>{let t=n.findIndex(e=>e.id===o),r=n[Math.max(0,Math.min(n.length-1,t+e))];r&&S(r.id)},w=e=>{if(b.length===0)return;let t=Math.max(0,b.indexOf(c));l(b[Math.max(0,Math.min(b.length-1,t+e))]??``)},T=e=>{let t=e.target instanceof HTMLInputElement;if(e.key===`ArrowUp`&&!t)C(-1);else if(e.key===`ArrowDown`&&!t)C(1);else if((e.key===`ArrowLeft`||e.key===`h`)&&!t)w(-1);else if((e.key===`ArrowRight`||e.key===`l`)&&!t)w(1);else return;e.preventDefault()},E=()=>_(async()=>{if(!v)return;let t=y.length>0?c:void 0,n=v.acceptsModel?u.trim():void 0;(v.id!==i.engine||t!==void 0&&t!==(i.effort??``)||n!==void 0&&n!==(i.model??``))&&await e.onSet({engine:v,...t===void 0?{}:{effort:t},...n===void 0?{}:{model:n}})});return(0,W.jsx)(Ci,{title:J(`tasks`,`changeEngine.title`),wide:!0,children:(0,W.jsxs)(`form`,{className:Kr,onKeyDown:T,onSubmit:e=>{e.preventDefault(),E()},children:[(0,W.jsx)(`ul`,{className:Br,"aria-label":J(`tasks`,`changeEngine.title`),children:n.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"aria-pressed":e.id===o,className:gi({selected:e.id===o}),onClick:()=>S(e.id),children:[(0,W.jsx)(`span`,{className:`${bi} text-accent`,children:e.id===o?`●`:` `}),(0,W.jsx)(`span`,{className:_i,children:e.name}),e.id===i.engine&&(0,W.jsx)(`span`,{className:`text-muted`,children:J(`tasks`,`changeEngine.current`)})]})},e.id))}),f&&v&&v.acceptsModel&&(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:J(`tasks`,`engineModel.label`)}),(0,W.jsx)(`input`,{className:Nr,spellCheck:!1,placeholder:J(`tasks`,`engineModel.placeholder`),value:u,onChange:e=>d(e.target.value)}),x.length>0&&(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:x.map(e=>(0,W.jsx)(`button`,{type:`button`,className:zr(),onClick:()=>d(e),children:e},e))})]}),b.length>0&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:J(`tasks`,`changeEngine.effortLabel`)}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:b.map(e=>(0,W.jsx)(`button`,{type:`button`,"aria-pressed":e===c,className:zr(e===c),onClick:()=>l(e),children:e===``?J(`tasks`,`changeEngine.noEffort`):e},e||`default`))})]}),(0,W.jsx)(`p`,{className:`keys-only ${Tr}`,children:(0,W.jsx)(xp,{text:[J(`tasks`,`changeEngine.footer.engine`),...v?.acceptsModel?[J(`tasks`,`changeEngine.footer.model`)]:[],...b.length>0?[J(`tasks`,`changeEngine.footer.effort`)]:[],J(`tasks`,`changeEngine.footer.set`),J(`tasks`,`changeEngine.footer.cancel`)].join(` · `)})}),g&&(0,W.jsx)(`p`,{className:`text-error`,children:g}),(0,W.jsx)(Di,{busy:h||!f,submitLabel:H(`taskops.set`)})]})})}var PA=`flex flex-col overflow-hidden @container`,FA=`mt-2.5 grid min-h-0 flex-1 grid-cols-[minmax(260px,2fr)_minmax(0,3fr)] gap-4 rt-narrow:flex rt-narrow:flex-col rt-narrow:overflow-y-auto`,IA=`flex min-h-0 flex-col gap-3 overflow-y-auto scrollbar-none rt-narrow:shrink-0 rt-narrow:overflow-visible`,LA=`flex gap-1.5 px-2 pt-0 pb-1`,RA=e=>`flex min-w-0 cursor-pointer flex-col gap-0.5 rounded-sm px-2 py-1.5 ${e?`bg-menu`:`[&:hover]:bg-hover`}`,zA=`flex min-w-0 items-baseline gap-2.5`,BA=e=>`min-w-0 flex-1 truncate font-bold ${e?`text-muted`:``}`,VA=`whitespace-nowrap text-meta`,HA=`truncate text-meta`,UA=`flex min-h-0 flex-col gap-1.5 overflow-y-auto py-0 pr-0 pl-4 [border-left:var(--hairline)_solid_var(--line)] [&_h2]:m-0 [&_p]:m-0 [&>*]:shrink-0 [&>h2]:mt-2.5 rt-narrow:shrink-0 rt-narrow:overflow-visible rt-narrow:pt-3 rt-narrow:pl-0 rt-narrow:[border-left:none] rt-narrow:[border-top:var(--hairline)_solid_var(--line)]`,WA=`flex flex-wrap items-baseline justify-between gap-3`,GA=`font-sans text-display font-bold normal-nums wrap-anywhere`,KA=`mx-0 mt-1 mb-0 grid grid-cols-[max-content_minmax(0,1fr)] items-baseline gap-x-3.5 gap-y-1 [&_dd]:m-0 [&_dd]:wrap-anywhere [&_dd_.mono]:whitespace-pre`,qA=`max-h-[12lh] overflow-y-auto rounded-sm bg-inset px-2.5 py-2 whitespace-pre-wrap wrap-anywhere`,JA=`min-w-0 text-meta leading-[inherit]`,YA=`flex w-full min-w-0 gap-2 text-inherit`,XA=YA,ZA=`${YA} cursor-pointer border-none bg-transparent p-0 text-left font-[inherit] [&:hover]:underline`,QA=`min-w-0 flex-1 truncate`,$A=`[&+&]:mt-1.5`,ej=e=>`whitespace-pre-wrap wrap-anywhere text-meta ${e?``:`leading-[inherit]`}`,tj=`text-meta`,nj=`flex gap-4.5`,rj=e=>`flex min-w-[5ch] flex-col gap-0.5 rounded-sm border-hairline px-1.5 py-1 text-left font-mono text-body normal-nums [&>span]:text-meta [&>span]:text-subtle ${e?`border-accent font-bold text-accent`:`border-transparent font-normal`}`,ij=`hidden gap-2 px-1 pt-0.5 pb-1.5 touch:flex`,aj=`h-8 w-11 touch-manipulation rounded-sm border-hairline border-line bg-inset font-mono text-display font-normal normal-nums text-ink`;function oj(e){let t=e.client,[n,r]=(0,m.useState)(()=>X(t,`pendingStart.list`)?.starts??[]);if((0,m.useEffect)(()=>{let e=!0;return Z(t,`pendingStart.list`).then(t=>e&&r(t.starts)).catch(()=>void 0),()=>{e=!1}},[t,e.tick]),n.length===0)return null;let i=n.map(e=>e.repo),a=async n=>{try{await t.request(`pendingStart.cancel`,{id:n.id}),r(e=>e.filter(e=>e.id!==n.id)),e.reload()}catch(e){z($(H(`pages.laterCancelFailed`),{error:nO(e)}),`error`)}};return(0,W.jsxs)(`section`,{"data-field":`later`,className:`mt-2.5`,children:[(0,W.jsxs)(`h2`,{className:`${Ar} ${LA} text-muted`,children:[H(`pages.laterStarts`),` `,(0,W.jsx)(`span`,{className:`mono`,children:n.length})]}),n.map(e=>(0,W.jsxs)(`div`,{className:RA(!1),children:[(0,W.jsxs)(`span`,{className:zA,children:[(0,W.jsx)(`span`,{className:BA(!1),children:e.title}),(0,W.jsx)(`span`,{className:`mono text-muted ${VA}`,title:new Date(e.at).toLocaleString(),children:F_(new Date(e.at))}),(0,W.jsx)(G,{className:`font-mono`,hit:`tight`,onClick:()=>void a(e),children:H(`pages.laterCancel`)})]}),(0,W.jsx)(`span`,{className:`mono text-muted ${HA}`,children:iO(e.repo,i)}),e.error&&(0,W.jsx)(`span`,{className:`mono text-warning truncate text-meta`,title:e.error,children:$(H(`pages.laterFailed`),{error:e.error})})]},e.id))]})}var sj={name:``,repo:``,prompt:``,schedule:`0 9 * * MON-FRI`};function cj(e){return e.name.trim().length>0&&(e.repo===null||e.repo.trim().length>0)&&e.prompt.trim().length>0&&(!e.target||e.target.taskId.trim().length>0&&/^tab-[\w-]+$/.test(e.target.tabId))&&aA(e.schedule.trim())}function lj(e){return e.name.trim().length===0?`name`:e.repo!==null&&e.repo.trim().length===0?`repo`:e.target&&!e.target.taskId.trim()?`target`:e.target&&!/^tab-[\w-]+$/.test(e.target.tabId)?`targetTab`:e.prompt.trim().length===0?`prompt`:aA(e.schedule.trim())?null:`schedule`}function uj(e){let{auto:t,common:n}=eO(),r=tO(),i=U()===`zh`?`zh-CN`:`en-US`,[a,o]=(0,m.useState)(()=>({...sj,repo:e.repos.find(t=>e.defaultRepo&&rO(t)===rO(e.defaultRepo))??e.repos[0]??null})),[s,c]=(0,m.useState)(0),[l,u]=(0,m.useState)(null),d=(0,m.useRef)({}),f=e=>t=>{d.current[e]=t};(0,m.useEffect)(()=>d.current.name?.focus(),[]);let p=e=>{o(t=>({...t,...e})),u(null)};(0,m.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),B())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[]);let h=()=>{if(cj(a)){B(),e.onSubmit({name:a.name.trim(),repo:a.repo===null?null:a.repo.trim(),prompt:a.prompt.trim(),schedule:a.schedule.trim(),...a.target?{target:a.target}:{}});return}let n=lj(a);n&&(d.current[n]?.focus(),u(Reflect.get(t.missing,n)))},g=a.repo===null?[]:e.tasks.filter(e=>rO(e.repo)===rO(a.repo??``)),_=a.target?g.findIndex(e=>e.id===a.target?.taskId)+1:0,v=e=>{let t=(_+e+g.length+1)%(g.length+1),n=g[t-1];p({target:n?{kind:`existing-tab`,taskId:n.id,tabId:`tab-1`}:void 0})},y=[null,...e.repos],b=e=>{let t=Math.min(Math.max(y.indexOf(a.repo)+e,0),y.length-1),n=y[t];n!==void 0&&p({repo:n,target:void 0})},x=e=>t=>{(t.key===`ArrowUp`||t.key===`ArrowDown`)&&(t.preventDefault(),e(t.key===`ArrowDown`?1:-1))},S=e=>t=>{t.key===`Enter`&&(t.preventDefault(),d.current[e]?.focus())},C=mA(a.schedule),w=e=>{let t=pA[s];t&&p({schedule:EA(a.schedule,s,wA(t,C[s]??`*`,e))})},T=e=>{if(!(e.ctrlKey||e.metaKey||e.altKey)){if(e.key===`ArrowLeft`||e.key===`h`)c(TA(s,-1));else if(e.key===`ArrowRight`||e.key===`l`)c(TA(s,1));else if(e.key===`ArrowUp`||e.key===`ArrowDown`)w(e.key===`ArrowUp`?1:-1);else return;e.preventDefault()}},E=kA(a.schedule,Date.now(),r,i),D=DA(a.schedule,r);return(0,W.jsx)(`div`,{className:Vr,onMouseDown:e=>e.target===e.currentTarget&&B(),children:(0,W.jsxs)(`dialog`,{open:!0,className:`${Hr(!0)} ${sk}`,"aria-label":t.newTitle,children:[(0,W.jsx)(`h1`,{className:`${Ar} text-muted`,children:t.newTitle}),(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsxs)(`label`,{className:Ir,children:[(0,W.jsx)(`span`,{className:`${Ar} text-muted`,children:t.fieldName}),(0,W.jsx)(`input`,{ref:f(`name`),className:Nr,spellCheck:!1,placeholder:t.namePlaceholder,value:a.name,onChange:e=>p({name:e.target.value}),onKeyDown:S(`repo`)})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.fieldRepo,(0,W.jsx)(`span`,{className:`keys-only text-muted ${uk}`,children:`↑/↓`})]}),(0,W.jsx)(bk,{fieldRef:f(`repo`),kind:`list`,label:t.fieldRepo,className:fk,onKeyDown:x(b),children:y.map(t=>(0,W.jsxs)(`button`,{type:`button`,tabIndex:-1,"aria-selected":t===a.repo,className:`touch:py-1.5 ${pk(t===a.repo)}`,onClick:()=>{p({repo:t,target:void 0}),d.current.repo?.focus()},children:[t===a.repo?`▸ `:` `,t===null?H(`rail.noProject`):iO(t,e.repos)]},t??``))})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.fieldTarget,(0,W.jsx)(`span`,{className:`keys-only text-muted ${uk}`,children:`↑/↓`})]}),(0,W.jsx)(bk,{fieldRef:f(`target`),kind:`list`,label:t.fieldTarget,onKeyDown:x(v),onClick:()=>v(1),children:a.target?g[_-1]?.title??a.target.taskId:t.targetFresh})]}),a.target&&(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`m-0 font-sans text-meta font-medium normal-nums text-muted`,children:t.fieldTargetTab}),(0,W.jsx)(`input`,{ref:f(`targetTab`),className:Nr,spellCheck:!1,value:a.target.tabId,onChange:e=>a.target&&p({target:{...a.target,tabId:e.target.value}}),onKeyDown:S(`prompt`)})]}),(0,W.jsxs)(`label`,{className:Ir,children:[(0,W.jsx)(`span`,{className:`${Ar} text-muted`,children:t.fieldPrompt}),(0,W.jsx)(`input`,{ref:f(`prompt`),className:Nr,spellCheck:!1,placeholder:t.promptPlaceholder,value:a.prompt,onChange:e=>p({prompt:e.target.value}),onKeyDown:S(`schedule`)})]}),(0,W.jsxs)(`div`,{className:Ir,children:[(0,W.jsxs)(`span`,{className:`${Ar} text-muted ${lk}`,children:[t.fieldSchedule,(0,W.jsx)(`span`,{className:`keys-only text-muted ${uk}`,children:`←/→ ↑/↓`})]}),(0,W.jsx)(bk,{fieldRef:f(`schedule`),kind:`cells`,label:t.fieldSchedule,className:nj,onKeyDown:T,children:pA.map((e,n)=>(0,W.jsxs)(`button`,{type:`button`,tabIndex:-1,className:rj(n===s),onClick:()=>{c(n),d.current.schedule?.focus()},children:[C[n]??`*`,(0,W.jsx)(`span`,{children:t.cronField[e]})]},e))}),(0,W.jsx)(`div`,{className:ij,children:[-1,1].map(e=>{let n=t.cronField[pA[s]??`minute`]??``;return(0,W.jsx)(`button`,{type:`button`,tabIndex:-1,className:aj,"aria-label":H(e<0?`pages.cronDown`:`pages.cronUp`,{field:n}),onClick:()=>{w(e),d.current.schedule?.focus()},children:e<0?`−`:`+`},e)})}),E.kind===`ok`?(0,W.jsxs)(`p`,{className:`mono text-success`,children:[D?`${D}, `:``,E.relative,`, `,E.absolute]}):(0,W.jsx)(`p`,{className:`mono text-error`,children:E.kind===`never`?t.cronNever:t.cronInvalid})]}),l&&(0,W.jsxs)(`p`,{className:`text-error`,children:[`※ `,l]}),(0,W.jsx)(`p`,{className:`touch:empty:hidden! text-muted ${mk}`,children:(0,W.jsx)(xp,{text:wu(t.composerLegend)})}),(0,W.jsxs)(`div`,{className:Pr,children:[(0,W.jsx)(`button`,{type:`button`,className:jr,onClick:B,children:n.cancel}),(0,W.jsx)(`button`,{ref:f(`confirm`),type:`button`,className:xr(),onClick:h,children:n.create})]})]})]})})}var dj=[`ok`,`blocked`,`failed`,`skipped`];function fj(e){switch(e.status){case`dispatched`:case`revived`:case`ran`:return`ok`;case`skipped_blocked`:return`blocked`;case`dispatch_failed`:case`skipped_unavailable`:case`script_failed`:return`failed`;default:return`skipped`}}var pj={scheduled:`schedule`,manual:`manual`,webhook:`webhook`};function mj(e){if(e.status===`skipped_precheck`)return e.precheckResult?.durationMs??null;if(e.status===`ran`||e.status===`script_failed`)return null;let t=Date.parse(e.at),n=Date.parse(e.response?.at??``);return Number.isFinite(t)&&Number.isFinite(n)&&n>=t?n-t:null}function hj(e){if(e<1e3)return`${Math.max(0,Math.round(e))}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return n%60==0?`${r}h`:`${r}h ${n%60}m`}function gj(e,t){return e.filter(e=>t===null||fj(e)===t).sort((e,t)=>Date.parse(t.at)-Date.parse(e.at)||t.runNumber-e.runNumber)}function _j(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);if(t<0||n<=t)return null;try{return{prefix:e.slice(0,t).trim(),value:JSON.parse(e.slice(t,n+1))}}catch{return null}}var vj=(e,t)=>e&&typeof e==`object`?Reflect.get(e,t):void 0;function yj(e){let t=_j(e);if(!t)return{summary:e,full:e};let n=vj(t.value,`error`)??t.value,r=vj(n,`message`),i=vj(n,`code`),a=typeof r==`string`?typeof i==`string`?`${i}: ${r}`:r:null,o=t.prefix.replace(/:$/,``);return{summary:a?`${o} — ${a}`:e,full:`${t.prefix}\n${JSON.stringify(t.value,null,2)}`}}function bj(e){let t=e.trim();if(!/^[[{]/.test(t))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}var xj={dispatched:`success`,revived:`success`,skipped_precheck:`muted`,skipped_blocked:`warning`,skipped_cancelled:`muted`,skipped_missed:`warning`,skipped_unavailable:`warning`,dispatch_failed:`error`,ran:`success`,script_failed:`error`},Sj={success:`text-success`,muted:`text-muted`,warning:`text-warning`,error:`text-error`},Cj={success:`✓`,error:`†`,warning:`!`,muted:`·`},wj=e=>xj[e]??`muted`;function Tj(e){let{auto:t}=eO(),{runs:n,when:r}=e,i=e=>t.runStatus[e]??e,a=n.filter(e=>e.response);return(0,W.jsxs)(W.Fragment,{children:[n[0]?.precheckResult&&(0,W.jsx)(Ej,{run:n[0]}),(0,W.jsx)(`h2`,{className:`${Ar} text-muted`,children:t.responses}),a.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:t.noResponses}):a.map(e=>(0,W.jsxs)(`div`,{className:$A,children:[(0,W.jsx)(`p`,{className:`mono ${tj} ${Sj[wj(e.status)]}`,children:`#${e.runNumber} ${i(e.status)}, ${r(e.response?.at)}`}),(0,W.jsx)(`p`,{className:ej(!1),children:bj(e.response?.text??``)})]},e.id))]})}function Ej({run:e}){let{auto:t}=eO(),n=e.precheckResult;if(!n)return null;let r=n.timedOut?t.precheckTimedOut:$(t.precheckExited,{code:String(n.exitCode??`?`)}),i=[{label:t.precheckStdout,text:n.stdout},{label:t.precheckStderr,text:n.stderr}].filter(e=>e.text.trim().length>0);return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:`${Ar} text-muted`,children:$(t.precheckDetail,{exit:r,duration:String(n.durationMs)})}),i.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:t.precheckNoOutput}):i.map(e=>(0,W.jsx)(`p`,{className:`mono ${ej(!0)}`,children:`${e.label}: ${e.text.replace(/\s+$/,``).split(`
|
|
61
|
-
`).slice(-10).join(`
|
|
62
|
-
`)}`},e.label))]})}var Dj=30;function Oj(e,t,n){let r=t.join(`\0`),[i,a]=(0,m.useState)(()=>Object.fromEntries(t.map(t=>[t,X(e,`routine.runs`,{id:t})?.runs??[]])));return(0,m.useEffect)(()=>{let n=!0;for(let r of t)Z(e,`routine.runs`,{id:r}).then(e=>n&&a(t=>({...t,[r]:e.runs}))).catch(()=>void 0);return()=>{n=!1}},[e,r,n]),i}function kj(e){U();let{auto:t}=eO(),[n,r]=(0,m.useState)(null),i=gj(e.runs,n),a=e=>{if(e.status===`skipped_blocked`){let t=e.blocked?.reason;return t?$(H(`runLog.blockedRun`),{reason:H(`runLog.blocked.${t}`)}):H(`runLog.outcome.blocked`)}return t.runStatus[e.status]??e.status},o=(e,t,n,r)=>(0,W.jsx)(G,{variant:`pill`,hit:`tight`,"aria-current":t,className:`max-w-40 truncate`,onClick:n,children:`[ ${e} ]`},r);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:`${Ar} text-muted`,children:H(`runLog.title`)}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[o(H(`runLog.all`),n===null,()=>r(null),`all`),dj.map(e=>o(H(`runLog.outcome.${e}`),n===e,()=>r(e),e))]}),i.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:e.runs.length===0?t.noRuns:H(`runLog.empty`)}):i.slice(0,Dj).map(n=>{let r=wj(n.status),i=Xk(n,e.now),o=i===`awaiting`?`, ${t.responseAwaiting}`:i===`missing`?`, ${t.responseMissing}`:``,s=mj(n),c=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{children:Cj[r]}),(0,W.jsx)(`span`,{children:`#${n.runNumber}`}),(0,W.jsx)(`span`,{className:QA,children:`${a(n)}${n.tabId?`, ${n.tabId}`:``}${o}`}),(0,W.jsx)(`span`,{className:`text-subtle`,children:H(`runLog.source.${pj[n.trigger]}`)}),s!==null&&(0,W.jsx)(`span`,{className:`text-muted`,children:hj(s)}),(0,W.jsx)(`span`,{className:`text-muted`,children:e.when(n.at)})]}),l=n.error?yj(n.error):null,u=n.taskId,d=i===`missing`?`text-warning`:Sj[r];return(0,W.jsxs)(`div`,{className:`${JA} ${d}`,children:[u?(0,W.jsx)(`button`,{type:`button`,className:`mono ${ZA}`,onClick:()=>e.openRun(u),children:c}):(0,W.jsx)(`span`,{className:`mono ${XA}`,children:c}),l&&(0,W.jsxs)(`details`,{className:`mono pl-[calc(2ch+16px)] [&_summary]:cursor-pointer [&_summary]:list-none [&_summary]:truncate [&_summary::-webkit-details-marker]:hidden [&[open]_summary]:whitespace-normal [&_pre]:mx-0 [&_pre]:mt-1 [&_pre]:mb-1.5 [&_pre]:max-h-[16lh] [&_pre]:overflow-auto [&_pre]:rounded-sm [&_pre]:bg-inset [&_pre]:px-2 [&_pre]:py-1.5 [&_pre]:whitespace-pre-wrap [&_pre]:wrap-anywhere [&_pre]:text-muted`,children:[(0,W.jsx)(`summary`,{children:l.summary}),(0,W.jsx)(`pre`,{children:l.full})]})]},n.id)}),i.length>Dj&&(0,W.jsx)(`p`,{className:`text-muted`,children:H(`runLog.more`,{count:i.length-Dj})})]})}function Aj(e){let{auto:t}=eO(),n=tO(),r=U()===`zh`?`zh-CN`:`en-US`,{routine:i,busy:a,when:o}=e,s=DA(i.schedule,n),c=i.nextRunAt?Date.parse(i.nextRunAt):NaN;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:WA,children:[(0,W.jsx)(`h2`,{className:GA,children:i.name}),(0,W.jsxs)(`span`,{className:`mono ${CS}`,children:[(0,W.jsx)(`button`,{type:`button`,className:`${jr} ${wS.row}`,disabled:a,onClick:e.onRunNow,children:t.runNow}),(0,W.jsx)(`button`,{type:`button`,className:`${jr} ${wS.row}`,disabled:a,onClick:e.onToggle,children:H(i.enabled?`pages.routinePause`:`pages.routineEnable`)}),(0,W.jsx)(`button`,{type:`button`,className:`${jr} ${wS.row}`,disabled:a,onClick:e.onDelete,children:H(`pages.delete`)})]})]}),(0,W.jsxs)(`dl`,{className:KA,children:[(0,W.jsx)(`dt`,{className:`text-muted`,children:H(`pages.routineSchedule`)}),(0,W.jsxs)(`dd`,{children:[s??(0,W.jsx)(`span`,{className:`mono`,children:i.schedule}),s&&(0,W.jsx)(`span`,{className:`mono text-muted`,children:` ${i.schedule}`})]}),(0,W.jsx)(`dt`,{className:`text-muted`,children:H(`pages.routineNext`)}),(0,W.jsx)(`dd`,{className:i.enabled?``:`text-warning`,children:i.enabled?Number.isFinite(c)?`${o(i.nextRunAt)} · ${new Date(c).toLocaleString(r,{weekday:`short`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}`:`—`:t.paused}),(0,W.jsx)(`dt`,{className:`text-muted`,children:H(`pages.routineProject`)}),(0,W.jsx)(`dd`,{children:e.project}),!i.script&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted`,children:H(`pages.routineDelivers`)}),(0,W.jsx)(`dd`,{children:i.target?$(t.targetExisting,{task:e.targetTitle??i.target.taskId,tab:i.target.tabId}):i.persistentSession?i.newConversation?t.targetStandingNew:t.targetStanding:t.targetFresh})]}),e.engine&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted`,children:H(`pages.routineEngine`)}),(0,W.jsxs)(`dd`,{className:`flex flex-wrap items-baseline gap-x-3.5`,children:[(0,W.jsx)(`span`,{children:e.engine}),(0,W.jsx)(G,{className:`font-mono`,hit:`tight`,disabled:a,onClick:e.onChangeEngine,children:H(`pages.routineChangeEngine`)})]})]})]}),i.precheck&&(0,W.jsx)(`p`,{className:`mono text-muted`,children:$(t.precheck,{command:i.precheck.command})}),i.script?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:`${Ar} text-muted`,children:H(`pages.routineScript`)}),(0,W.jsx)(`p`,{className:`mono ${qA}`,children:i.script.command})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:`${Ar} text-muted`,children:H(`pages.routinePrompt`)}),(0,W.jsx)(`p`,{className:qA,children:i.prompt})]}),(0,W.jsx)(kj,{runs:e.runs,now:e.now,when:o,openRun:e.openRun}),(0,W.jsx)(Tj,{runs:e.runs,when:o})]})}var jj=5e3;function Mj({model:e}){let{auto:t,common:n}=eO(),r=e.client,[i,a]=cO(jj),o=y(e.tasks),s=oO(e),c=sO(e),[l,u]=(0,m.useState)(()=>X(r,`routine.list`)??null),[d,f]=(0,m.useState)(null),[p,h]=(0,m.useState)(null),[g,_]=(0,m.useState)(null),v=dO(),b=tO(),x=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=!0;return Z(r,`routine.list`).then(t=>e&&u(t)).catch(()=>e&&u(e=>e??{automations:[],keepsDaemonAlive:!1})),()=>{e=!1}},[r,i]);let[S,C]=(0,m.useState)(()=>X(r,`engines.list`)?.engines??[]);(0,m.useEffect)(()=>r.onOpen(()=>{Z(r,`engines.list`).then(e=>C(e.engines)).catch(()=>{})}),[r]);let w=l?.automations??[],T=l?.lastRunStatus??{},E=l?.lastFailure??{},D=e=>{let t=T[e.id];return t!==void 0&&Yk(t)},k=[{key:`pages.routinesNeedYou`,rows:w.filter(D)},{key:`pages.routinesActive`,rows:w.filter(e=>e.enabled&&!D(e))},{key:`pages.routinesPaused`,rows:w.filter(e=>!e.enabled&&!D(e))}],A=k.flatMap(e=>e.rows),j=Math.max(0,A.findIndex(e=>e.id===d)),M=A[j],P=e=>f(A[e]?.id??null),F=k[0]?.rows.length??0,I=y(ee);(0,m.useEffect)(()=>{I===null||!l||(l.automations.some(e=>e.id===I)&&f(I),ee.set(null))},[I,l]);let te=Oj(r,M?[M.id]:[],i),ne=M?te[M.id]??[]:[];(0,m.useEffect)(()=>_(null),[M?.id]);let L=(0,m.useRef)(null),[re,ie]=(0,m.useState)(0),ae=(0,m.useRef)(0);(0,m.useEffect)(()=>{let e=x.current,t=re!==ae.current;if(ae.current=re,t&&e&&L.current&&e.offsetTop>L.current.offsetTop){e.scrollIntoView({block:`start`,behavior:`smooth`});return}L.current?.querySelector(`[data-row="${j}"]`)?.scrollIntoView({block:`nearest`})},[j,re]);let R=Date.now(),oe=e=>{let n=e?Date.parse(e):NaN;if(!Number.isFinite(n))return`—`;let r=n-R,i=r>=0,a=Math.floor(Math.abs(r)/6e4),o=Math.floor(a/60);return a<1?i?t.when.now:t.when.justNow:a<60?$(i?t.when.inMinutes:t.when.minutesAgo,{n:a}):o<24?$(i?t.when.inHours:t.when.hoursAgo,{n:o}):new Date(n).toLocaleDateString()},se=e=>o?.tasks.find(t=>t.id===e)?.label??e,ce=t=>{N.set(null),e.select(t)},le=(e,t,n)=>z($(e,{name:t,error:nO(n)}),`error`),B=async()=>{if(!(!M||p)){h(M.id);try{await r.request(`routine.setEnabled`,{id:M.id,enabled:!M.enabled}),a()}catch(e){le(M.enabled?t.disableFailed:t.enableFailed,M.name,e)}finally{h(null)}}},ue=async()=>{if(!(!M||p)){h(M.id),_($(t.running,{name:M.name}));try{let e=await r.request(`routine.runNow`,{id:M.id});_($(t.ranWith,{name:M.name,status:e.status})),a()}catch(e){le(t.runFailed,M.name,e)}finally{h(null)}}},de=async()=>{if(p)return;let e=aO(await r.request(`repos.list`).then(e=>e.repos).catch(()=>[]),s);O.set((0,W.jsx)(uj,{repos:e,tasks:(o?.tasks??[]).filter(e=>!e.deleting).map(e=>({id:e.id,title:e.label,repo:e.repo})),defaultRepo:c,onSubmit:e=>{(async()=>{h(`new`);try{await r.request(`routine.create`,{...e.repo===null?{}:{repo:e.repo},name:e.name,prompt:e.prompt,schedule:e.schedule,...e.target?{targetTask:e.target.taskId,targetTab:e.target.tabId}:{}}),a()}catch(e){z($(t.createFailed,{error:nO(e)}),`error`)}finally{h(null)}})()}}))},fe=()=>{if(!M||p)return;let e=M;O.set((0,W.jsx)(q,{title:t.deleteTitle,body:$(t.deleteBody,{name:e.name}),confirmLabel:t.deleteButton,onConfirm:async()=>{h(e.id);try{await r.request(`routine.delete`,{id:e.id}),a()}catch(n){le(t.deleteFailed,e.name,n)}finally{h(null)}}}))};uO(e=>{if(e.ctrlKey)return e.key===`c`&&(N.set(null),!0);switch(e.key){case`Escape`:case`q`:return N.set(null),!0;case`j`:case`ArrowDown`:return P(Math.min(A.length-1,j+1)),!0;case`k`:case`ArrowUp`:return P(Math.max(0,j-1)),!0;case`n`:return de(),!0;case`r`:return a(),!0;case`e`:return B(),!0;case`s`:return ue(),!0;case`d`:return fe(),!0;case`Enter`:{let e=ne[0]?.taskId;return e?ce(e):ne.length>0&&_(t.latestRunNoTask),!0}default:return!1}});let pe=e=>Jk(e,e=>S.find(t=>t.id===e)?.name??e,t.engineDefault),me=()=>{if(!M)return;let n=M;O.set((0,W.jsx)(NA,{model:e,current:async()=>({engine:n.vendor,effort:n.modelEffort,model:n.model}),onSet:async e=>{let i=await r.request(`routine.setEngine`,{id:n.id,engine:e.engine.id,model:e.model??``,effort:e.effort??``});_($(i.releasedSessionTaskId?t.engineChangedNewSession:t.engineChanged,{name:n.name,engine:[e.engine.name,e.model,e.effort].filter(Boolean).join(` · `)})),a()}}))},he=e=>e===void 0?H(`rail.noProject`):iO(e,w.flatMap(e=>e.repo??[]));return(0,W.jsxs)(`div`,{className:`${vS} ${PA}`,tabIndex:0,ref:v,children:[(0,W.jsxs)(`div`,{className:xS,children:[(0,W.jsx)(`h1`,{className:bS,children:t.title}),(0,W.jsxs)(`span`,{className:`mono ${CS}`,children:[F>0&&(0,W.jsx)(`span`,{className:`text-error`,children:$(t.needAttention,{count:String(F),total:String(A.length)})}),(0,W.jsx)(`span`,{className:`text-muted`,children:l?.keepsDaemonAlive?t.holdingDaemon:t.notHolding}),(0,W.jsx)(`button`,{type:`button`,className:`${jr} ${wS.header}`,onClick:()=>void de(),children:H(`pages.new`)})]})]}),(0,W.jsx)(oj,{client:r,tick:i,reload:a}),l===null?(0,W.jsx)(`p`,{className:`text-muted`,children:n.loading}):A.length===0?(0,W.jsxs)(`div`,{className:TS,children:[(0,W.jsx)(`p`,{className:`text-muted`,children:t.empty}),(0,W.jsx)(`p`,{className:`keys-only`,children:t.emptyHint})]}):(0,W.jsxs)(`div`,{className:FA,children:[(0,W.jsx)(`div`,{className:IA,ref:L,children:k.map(e=>e.rows.length===0?null:(0,W.jsxs)(`section`,{children:[(0,W.jsxs)(`h2`,{className:`${Ar} ${LA} ${e===k[0]?`text-error`:`text-muted`}`,children:[H(e.key),` `,(0,W.jsx)(`span`,{className:`mono`,children:e.rows.length})]}),e.rows.map(e=>{let n=A.indexOf(e),r=T[e.id],i=r?wj(r):null;return(0,W.jsxs)(`div`,{"data-row":n,className:RA(n===j),onClick:()=>{P(n),ie(e=>e+1)},children:[(0,W.jsxs)(`span`,{className:zA,children:[(0,W.jsx)(`span`,{className:BA(!e.enabled),children:e.name}),(0,W.jsx)(`span`,{className:`mono text-muted ${VA}`,children:e.enabled?oe(e.nextRunAt):t.paused}),(0,W.jsx)(`span`,{className:`mono ${i?Sj[i]:`text-muted`}`,style:{width:`1ch`},children:i?Cj[i]:` `})]}),(0,W.jsx)(`span`,{className:`mono text-muted ${HA}`,title:e.schedule,children:[he(e.repo),DA(e.schedule,b)??e.schedule,pe(e)?.short].filter(Boolean).join(` · `)}),E[e.id]?(0,W.jsx)(`span`,{className:`mono text-warning ${HA}`,title:E[e.id]?.reason,children:$(t.lastFailed,{when:oe(E[e.id]?.at),reason:E[e.id]?.reason??``})}):null]},e.id)})]},e.key))}),(0,W.jsx)(`div`,{className:UA,ref:x,children:M?(0,W.jsx)(Aj,{routine:M,runs:ne,busy:p===M.id,project:he(M.repo),engine:pe(M)?.full??null,targetTitle:M.target?se(M.target.taskId):void 0,now:R,when:oe,openRun:ce,onRunNow:()=>void ue(),onToggle:()=>void B(),onDelete:fe,onChangeEngine:me}):(0,W.jsx)(`p`,{className:`text-muted`,children:t.noSelection})})]}),g&&(0,W.jsx)(`p`,{className:`text-muted mx-0 mt-2 mb-0 text-meta leading-[inherit]`,children:g})]})}var Nj=v({});function Pj(e,t,n){let r=Nj.get()[`${e}::${t.id}`];return r&&r.sig===df(n)&&rf(n.root).some(e=>e.id===r.leaf)?r.leaf:n.activeLeafId}function Fj(e,t,n,r){Nj.set({...Nj.get(),[`${e}::${t}`]:{sig:df(n),leaf:r}})}function Ij(e,t,n,r){Fj(e,t.id,n,r),Io(id(e,t.id,r))?.focus()}function Lj(e){let{taskId:t,tabId:n}=e.selection.get(),r=t?e.tabs.get()[t]?.find(e=>e.id===n):void 0;return t&&r?{taskId:t,tab:r}:null}async function Rj(e,t,n){try{let r=await e.client.request(`tab.split`,t);typeof t.taskId==`string`&&await e.refreshTabsNow(t.taskId),n?.(r)}catch(e){z(e instanceof Error?e.message:String(e),`error`)}}function zj(e,t,n,r,i){let a=i??(n.split?Pj(t,n,n.split):`leaf-1`),o=e.selection.get();(o.taskId!==t||o.tabId!==n.id)&&e.select(t,n.id);let s=Io(id(t,n.id,a))?.size();Rj(e,{taskId:t,tabId:n.id,action:`open`,direction:r,leafId:a,...s},e=>{e.changed?e.split&&Fj(t,n.id,e.split,e.leaf):z(H(`layout.splitTooSmall`),`error`)})}function Bj(e,t,n,r){let i=n.split,a=i?Pj(t,n,i):r,o=()=>Rj(e,{taskId:t,tabId:n.id,action:`close`,leafId:r},e=>{let i=e.split;if(!i)return;let o=a!==r&&rf(i.root).some(e=>e.id===a);Fj(t,n.id,i,o?a:i.activeLeafId)});if(!i||!lf(n,i,r)){o();return}O.set((0,W.jsx)(q,{title:H(`confirm.closePaneTitle`,{pane:cf(i,tf(n)).get(r)??r}),body:H(`confirm.closePaneBody`),confirmLabel:H(`menu.closePane`),onConfirm:o}))}function Vj(e,t,n,r){let i=n.split;i&&O.set((0,W.jsx)(Ti,{title:Ml(`split.renameTitle`),initial:cf(i,tf(n)).get(r)??``,allowEmpty:!0,submitLabel:H(`dialog.save`),onSubmit:i=>Rj(e,{taskId:t,tabId:n.id,action:`rename`,leafId:r,title:i})}))}function Hj(e,t,n,r){return[{label:H(`menu.renamePane`),section:`split`,key:gl(`workspace.split.rename`)??void 0,run:()=>Vj(e,t,n,r)},{label:H(`menu.closePane`),section:`split`,key:yo(`workspace.split.close`)||void 0,run:()=>Bj(e,t,n,r)}]}function Uj(e,t,n,r){return[{label:H(`menu.splitRight`),section:`split`,key:gl(`workspace.split.right`)??void 0,run:()=>zj(e,t,n,`right`,r)},{label:H(`menu.splitDown`),section:`split`,key:gl(`workspace.split.down`)??void 0,run:()=>zj(e,t,n,`down`,r)}]}function Wj(e,t,n,r){let i=n.split,a=r??(i?Pj(t,n,i):`leaf-1`);return[...Uj(e,t,n,a),...af(i)?Hj(e,t,n,a):[]]}function Gj(e,t){let n=e.tabs.get()[t]??[],r=e.selection.get(),i=(r.taskId===t?n.find(e=>e.id===r.tabId):void 0)??Ka(n);return!i||!uf(i)?[]:Uj(e,t,i,i.split?Pj(t,i,i.split):`leaf-1`)}function Kj({model:e,task:t}){let[n,r]=(0,m.useState)(()=>X(e,`task.get`,{taskId:t.id})?.task??null),[i,a]=(0,m.useState)(null),{busy:o,error:s,submit:c}=wi();(0,m.useEffect)(()=>{Z(e,`task.get`,{taskId:t.id}).then(e=>r(e.task)).catch(e=>a(K(e)))},[e,t.id]);let l=()=>c(async()=>{if(!n?.prompt)return;let t=(await e.client.request(`task.spawn`,{repo:n.repo,prompt:n.prompt,...n.engine?{engine:n.engine}:{},...n.baseRef?{baseBranch:n.baseRef}:{}})).taskIds[0];t&&e.selectWhenListed(t)});return(0,W.jsx)(Ci,{title:J(`tasks`,`runAgain.title`),wide:!0,children:(0,W.jsxs)(`form`,{className:Kr,onSubmit:e=>{e.preventDefault(),l()},children:[(0,W.jsx)(`p`,{className:`text-muted`,children:J(`tasks`,`runAgain.source`,{title:t.label})}),(0,W.jsx)(`pre`,{className:Er,children:n?.prompt??i??J(`tasks`,`fieldNotes.loading`)}),(0,W.jsx)(`p`,{className:Tr,children:J(`tasks`,`runAgain.hint`)}),s&&(0,W.jsx)(`p`,{className:`text-error`,children:s}),(0,W.jsx)(Di,{busy:o||!n?.prompt,submitLabel:J(`tasks`,`runAgain.confirm`)})]})})}function qj(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Jj({model:e,repo:t}){let[n,r]=(0,m.useState)({kind:`loading`}),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)(null),u=(0,m.useRef)(null),d=()=>e.client.request(`notes.list`,{repo:t}).then(e=>r({kind:`ready`,notes:e.notes})).catch(e=>r({kind:`error`,message:K(e)}));(0,m.useEffect)(()=>void d(),[]);let f=n.kind===`ready`?n.notes:[];(0,m.useEffect)(()=>a(e=>Math.max(0,Math.min(e,f.length-1))),[f.length]),(0,m.useEffect)(()=>{u.current?.querySelector(`.is-selected`)?.scrollIntoView({block:`nearest`})},[i]);let p=async n=>{if(n.id!==void 0){l(null);try{await e.client.request(`notes.delete`,{repo:t,id:n.id}),s(null),await d()}catch(e){l(K(e))}}};return(0,W.jsx)(Ci,{title:J(`tasks`,`fieldNotes.title`),wide:!0,children:(0,W.jsxs)(`div`,{className:Kr,onKeyDown:e=>{if(!o){if(e.key===`ArrowDown`||e.key===`j`)a(e=>Math.min(f.length-1,e+1));else if(e.key===`ArrowUp`||e.key===`k`)a(e=>Math.max(0,e-1));else if(e.key===`d`&&f[i]?.id!==void 0)s(f[i]??null);else return;e.preventDefault()}},children:[(0,W.jsx)(`p`,{className:`font-mono text-meta break-all text-muted`,children:t}),n.kind===`loading`&&(0,W.jsx)(`p`,{className:`text-muted`,children:J(`tasks`,`fieldNotes.loading`)}),n.kind===`error`&&(0,W.jsx)(`p`,{className:`text-error`,children:n.message}),n.kind===`ready`&&f.length===0&&(0,W.jsx)(`p`,{className:`text-muted`,children:J(`tasks`,`fieldNotes.empty`)}),f.length>0&&(0,W.jsx)(`ul`,{className:`m-0 list-none p-0 flex max-h-[44vh] flex-col gap-2 overflow-y-auto`,ref:u,children:f.map((e,t)=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:Dr(t===i),onClick:()=>a(t),autoFocus:t===0,children:[(0,W.jsxs)(`span`,{className:`font-mono text-meta whitespace-pre text-accent`,children:[t===i?`▸ `:` `,qj(e.at),`, `,e.author]}),(0,W.jsx)(`span`,{className:`text-ink whitespace-pre-wrap wrap-anywhere`,children:e.text})]})},`${e.at}:${t}`))}),o&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-sm border-hairline border-line bg-paper px-3 py-2.5`,children:[(0,W.jsx)(`p`,{children:(0,W.jsx)(`strong`,{children:J(`tasks`,`fieldNotes.confirmDelete.title`)})}),(0,W.jsx)(`p`,{className:`text-muted`,children:J(`tasks`,`fieldNotes.confirmDelete.body`,{text:o.text})}),c&&(0,W.jsx)(`p`,{className:`text-error`,children:c}),(0,W.jsxs)(`div`,{className:`actions flex items-center justify-end gap-3.5`,children:[(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>s(null),children:H(`dialog.cancel`)}),(0,W.jsx)(`button`,{type:`button`,className:xr({danger:!0}),onClick:()=>void p(o),children:H(`taskops.retire`)})]})]}),!o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`keys-only font-sans text-meta text-subtle`,children:J(`tasks`,`fieldNotes.footerDeletable`)}),(0,W.jsxs)(`div`,{className:`actions flex items-center justify-end gap-3.5`,children:[(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,disabled:f[i]?.id===void 0,onClick:()=>s(f[i]??null),children:H(`taskops.retire`)}),(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:B,children:H(`taskops.close`)})]})]})]})})}var Yj=[`backlog`,`in_progress`,`in_review`,`done`,`canceled`,`error`],Xj={backlog:`status.backlog`,in_progress:`status.inProgress`,in_review:`status.inReview`,done:`status.done`,canceled:`status.canceled`,error:`status.error`},Zj=e=>({binding:e,key:gl(e)??void 0});async function Qj(e,t){if(!e){z(H(`menu.nothingToCopy`,{what:t}),`error`);return}try{await navigator.clipboard.writeText(e),z(H(`menu.copied`,{text:e}))}catch{z(H(`menu.copyFailed`),`error`)}}function $j(e,t,n){let r=[{label:H(`menu.newTask`),section:`open`,run:()=>ly(t)}],i=(n,i,a)=>{i!==null&&r.push({label:n,section:`edit`,run:()=>void e.client.request(`project.move`,{repo:t,target:i,side:a}).catch(e=>z(J(`tasks`,`toast.moveFailed`,{error:String(e)}),`error`))})};return i(J(`tasks`,`menu.moveToTop`),n.top,`before`),i(J(`tasks`,`menu.moveProjectUp`),n.above,`before`),i(J(`tasks`,`menu.moveProjectDown`),n.below,`after`),r.push({label:H(`menu.viewSessions`),section:`open`,run:()=>ye(t)}),r.push({label:J(`tasks`,`menu.fieldNotes`),section:`notes`,run:()=>O.set((0,W.jsx)(Jj,{model:e,repo:t}))}),n.local&&r.push({label:J(`tasks`,`menu.forgetProject`),section:`danger`,danger:!0,run:()=>O.set(bb(e,t,n.label))}),r}function eM(e){return[{label:H(`menu.newChatNoFolder`),section:`open`,run:()=>uy()},{label:H(`menu.newShell`),section:`open`,run:()=>void _d(e).catch(e=>z(String(e),`error`))}]}function tM(){Zp(!Xp.get()),document.querySelector(`.rail`)?.focus()}function nM(e,t,n){let r=n.filter(e=>!e.startsWith(`ssh://`)&&e!==t.repo),i=r.map(e=>{let t=e.slice(e.lastIndexOf(`/`)+1);return{value:e,label:r.filter(e=>e.endsWith(`/${t}`)).length>1?e:t}});return i.length===0?(z(J(`tasks`,`moveToProject.empty`),`error`),null):(0,W.jsx)(Ei,{title:J(`tasks`,`moveToProject.title`),choices:i,onPick:async n=>{await e.client.request(`task.moveToProject`,{taskId:t.id,repo:n}),z(J(`tasks`,`toast.movedToProject`,{project:i.find(e=>e.value===n)?.label??n}))}})}function rM(e,t,n){let r=e.client,i=[];n&&(i.push({label:H(`menu.closeTab`),section:`tab`,run:()=>O.set((0,W.jsx)(q,{title:H(`confirm.closeTabTitle`,{tab:n.title??n.engineName??n.id}),body:H(`confirm.closeTabBody`),confirmLabel:H(`menu.closeTab`),onConfirm:async()=>{await e.closeTab(t.id,n.id)}}))}),i.push(...Wj(e,t.id,n))),i.push({label:H(`menu.newChat`),section:`open`,run:()=>void hd(e,t.id)}),i.push({label:H(`menu.newChatPick`),section:`open`,rare:!0,run:()=>O.set((0,W.jsx)(xd,{model:e,taskId:t.id}))}),i.push({label:H(`menu.continueEngine`),section:`open`,rare:!0,...Zj(`chat.tab.fork`),run:()=>O.set((0,W.jsx)(xd,{model:e,taskId:t.id,context:`continue`,sourceTabId:n?.id}))}),i.push({label:H(`menu.newShell`),section:`open`,run:()=>void gd(e,t.id,{kind:`shell`}).catch(e=>z(String(e),`error`))}),t.kind===`task`&&t.ownsBranch===!0&&t.branch&&!t.sharesWorkspaceOf&&!t.machine&&!t.extraRepoCount&&i.push({label:J(`tasks`,`menu.newTaskFromBranch`),section:`open`,rare:!0,run:()=>ie({repo:t.repo,baseBranch:t.branch,worktree:!0})}),t.startsAt&&(i.push({label:H(`menu.startNow`),section:`open`,run:()=>void e.client.request(`task.startScheduledNow`,{taskId:t.id}).catch(e=>z(String(e),`error`))}),i.push({label:H(`menu.cancelStart`),section:`open`,run:()=>void e.client.request(`task.cancelScheduledStart`,{taskId:t.id}).catch(e=>z(String(e),`error`))})),t.hasPrompt&&(i.push({label:J(`tasks`,`menu.runAgain`),section:`open`,run:()=>O.set((0,W.jsx)(Kj,{model:e,task:t}))}),i.push({label:H(`menu.retryEdit`),section:`open`,rare:!0,run:()=>void Y_(e,t)}));let a=!t.machine;if(a&&i.push({label:J(`tasks`,`menu.openEditor`),section:`open`,...Zj(`tasks.openWorktree`),run:()=>void gb(e,t.id)}),t.groupId){let e=t.groupId;i.push({label:H(`compare.menu`),section:`open`,run:()=>ve(e)})}i.push({label:H(`menu.rename`),section:`edit`,...Zj(`sidebar.rename`),run:()=>O.set((0,W.jsx)(Ti,{title:H(`menu.rename`),initial:t.title,submitLabel:H(`dialog.save`),onSubmit:n=>e.act(`task.rename`,{taskId:t.id,title:n}).then(()=>{})}))}),i.push({label:t.pinned?H(`menu.unpin`):H(`menu.pin`),section:`edit`,...Zj(`sidebar.pin`),run:()=>void e.act(`task.pin`,{taskId:t.id,pinned:!t.pinned}).catch(e=>z(String(e),`error`))}),a&&i.push({label:J(`tasks`,`menu.reorder`),section:`edit`,rare:!0,...Zj(`sidebar.localMerge`),run:()=>tM()}),i.push({label:H(`menu.setStatus`),section:`edit`,children:Yj.map(n=>({label:H(Xj[n]),checked:n===t.status,run:()=>void e.act(`task.setStatus`,{taskId:t.id,status:n}).catch(e=>z(String(e),`error`))}))}),a&&!t.routine&&!t.parentTaskId&&!t.extraRepoCount&&i.push({label:J(`tasks`,`menu.moveToProject`),section:`edit`,rare:!0,run:()=>void e.client.request(`repos.list`).then(n=>{let r=nM(e,t,n.repos);r&&O.set(r)}).catch(e=>z(String(e),`error`))}),a&&i.push({label:H(`menu.changeEngine`),section:`edit`,rare:!0,...Zj(`tasks.cycleEngine`),run:()=>O.set((0,W.jsx)(NA,{model:e,current:async()=>(await e.client.request(`task.get`,{taskId:t.id})).task,onSet:async n=>{await e.client.request(`task.setEngine`,{taskId:t.id,engine:n.engine.id,...n.effort===void 0?{}:{effort:n.effort},...n.model===void 0?{}:{model:n.model}}),z(J(`tasks`,`toast.engineSwitched`,{engine:n.engine.name}))}}))}),t.pr?.checkState===`failing`&&i.push({label:J(`tasks`,`menu.fixChecks`),section:`git`,key:yo(`files.fixChecks`),run:()=>void hb(e,t.id,H(`taskops.fixSent`))}),t.kind===`task`&&t.branch&&a&&i.push({label:J(`tasks`,`menu.syncBase`),section:`git`,rare:!0,key:yo(`files.syncBase`),run:()=>void pb(e,t.id)}),t.branch&&i.push({label:H(`menu.renameBranch`),section:`git`,rare:!0,...Zj(`tasks.renameBranch`),run:()=>O.set((0,W.jsx)(Ti,{title:H(`menu.renameBranch`),initial:t.branch,submitLabel:H(`dialog.save`),onSubmit:e=>r.request(`task.setBranch`,{taskId:t.id,branch:e}).then(()=>{})}))}),t.kind===`task`&&t.branch&&i.push({label:H(`menu.land`),section:`git`,run:()=>void db(e,t)});let o=[{label:H(`menu.copyWhat.id`),run:()=>void Qj(t.id,H(`menu.what.id`))}];return t.branch&&o.push({label:H(`menu.copyWhat.branch`),run:()=>void Qj(t.branch,H(`menu.what.branch`))}),o.push({label:H(`menu.copyWhat.path`),run:()=>void r.request(`task.get`,{taskId:t.id}).then(e=>Qj(e.task.worktreePath,H(`menu.what.path`))).catch(e=>z(String(e),`error`))}),i.push({label:H(`menu.copy`),section:`copy`,children:o}),i.push({label:J(`tasks`,t.archived?`menu.unarchive`:`menu.archive`),section:`danger`,run:()=>void yb(e,t)}),i.push({label:H(`menu.removeSession`),section:`danger`,...Zj(`sidebar.delete`),danger:!0,run:()=>O.set(vb(e,t))}),i}var iM=e=>Date.parse(e.updatedAt??e.createdAt??``)||0;function aM(e,t,n){return(n===`archived`?e?.archived??[]:e?.tasks??[]).filter(e=>!e.routine).filter(e=>t===null||!Ud(e)&&rO(e.repo)===rO(t)).sort((e,t)=>iM(t)-iM(e))}function oM(e){let t=new Set,n=[];for(let r of[...e?.tasks??[],...e?.archived??[]]){if(r.routine||Ud(r)||r.repo.startsWith(`ssh://`))continue;let e=rO(r.repo);t.has(e)||(t.add(e),n.push(r.repo))}return n}function sM({tabs:e,value:t,onChange:n,className:r}){return(0,W.jsx)(`div`,{className:Rt(`flex gap-1`,r),role:`tablist`,children:e.map(e=>{let r=e.id===t;return(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:Rt(`relative rounded-sm px-2.5 py-0.75 font-mono text-meta font-semibold`,`touch:after:absolute touch:after:content-[''] touch:after:-inset-x-0.5 touch:after:-top-2 touch:after:-bottom-1.5`,r?`bg-inset text-ink group-focus-within/pane:text-accent`:`text-muted`),onClick:()=>n(e.id),children:e.label},e.id)})})}function cM({model:e}){let{common:t}=eO(),n=y(e.tasks),r=y(F)??``,[i,a]=(0,m.useState)(`active`),[o,s]=(0,m.useState)(0),c=oM(n),l=r===``?null:r,u=aM(n,l,i),d=Math.min(o,Math.max(0,u.length-1)),f=(0,m.useRef)(null);(0,m.useEffect)(()=>f.current?.focus(),[]);let p=(0,m.useRef)(null);(0,m.useEffect)(()=>{p.current?.querySelector(`[data-row="${d}"]`)?.scrollIntoView({block:`nearest`})},[d]);let h=t=>{N.set(null),e.select(t)},g=e=>{a(e),s(0)},_=e=>{let t=[``,...c],n=t.findIndex(e=>e===``?r===``:rO(e)===rO(r));F.set(t[(Math.max(0,n)+(e?t.length-1:1))%t.length]??``),s(0)};uO(e=>{if(e.ctrlKey)return e.key===`c`&&(N.set(null),!0);let t=u[d];switch(e.key){case`Escape`:case`q`:return N.set(null),!0;case`j`:case`ArrowDown`:return s(Math.min(u.length-1,d+1)),!0;case`k`:case`ArrowUp`:return s(Math.max(0,d-1)),!0;case`Tab`:return _(e.shiftKey),!0;case`a`:return g(i===`active`?`archived`:`active`),!0;case`Enter`:return t&&h(t.id),!0;default:return!1}});let v=Date.now();return(0,W.jsxs)(`div`,{className:`group/pane ${yS}`,tabIndex:0,ref:f,children:[(0,W.jsxs)(`div`,{className:xS,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,W.jsx)(`h1`,{className:bS,children:H(`sessions.title`)}),(0,W.jsx)(sM,{tabs:[{id:`active`,label:H(`sessions.active`)},{id:`archived`,label:H(`sessions.archived`)}],value:i,onChange:g})]}),(0,W.jsx)(`span`,{className:`mono touch:empty:hidden! text-muted ${SS(!0)}`,children:l?iO(l,c):H(`sessions.allProjects`)})]}),n?u.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:H(i===`archived`?`sessions.emptyArchived`:`sessions.emptyActive`)}):(0,W.jsx)(`div`,{className:TS,ref:p,children:u.map((t,n)=>{let r=Date.parse(t.updatedAt??t.createdAt??``);return(0,W.jsx)(`div`,{"data-row":n,className:ES(n===d),onClick:()=>h(t.id),onContextMenu:r=>{s(n),xI(r,rM(e,t,null))},children:(0,W.jsxs)(`div`,{className:DS,children:[(0,W.jsx)(`span`,{className:AS,title:t.label,children:t.label}),l===null&&!Ud(t)?(0,W.jsx)(`span`,{className:`mono text-meta ${OS}`,children:iO(t.repo,c)}):null,(0,W.jsx)(`span`,{className:`mono text-meta ${OS}`,children:Number.isFinite(r)?yO(r,v):``})]})},t.id)})}):(0,W.jsx)(`p`,{className:`text-muted`,children:t.loading}),(0,W.jsx)(`p`,{className:`mt-2.5 mb-0 text-meta text-subtle touch:hidden`,children:H(`sessions.keys`)})]})}function lM({active:e=!1,onSelect:t,plus:n=!1,children:r}){return(0,W.jsxs)(`button`,{type:`button`,className:`rail-nav-row ${PS(e)}`,"aria-current":e?`page`:void 0,onClick:t,children:[r,n?(0,W.jsx)(`span`,{className:FS,"aria-hidden":`true`,children:`+`}):null]})}var uM=`mx-auto flex max-w-[76rem] flex-col font-mono text-meta leading-[1.5]`,dM=`flex items-end justify-between gap-[4ch]`,fM=`m-0 text-title font-bold tracking-[0.02em]`,pM=`font-bold tracking-code uppercase`,mM=`text-muted`,hM=`text-subtle`,gM=`my-4 border-t-hairline border-dashed! border-line-active`,_M=`m-0 mb-1.5 text-meta text-muted ${pM}`,vM=`${_M} flex flex-wrap items-baseline justify-between gap-x-[4ch]`,yM=`flex flex-wrap items-start gap-x-[8ch] gap-y-4`,bM=`min-w-[min(100%,36ch)] flex-1`,xM=`text-[3.5rem] leading-none font-bold tracking-[-0.03em]`,SM=`grid grid-cols-[repeat(auto-fit,minmax(min(100%,34ch),1fr))] items-start gap-x-[6ch] gap-y-5`,CM=`flex min-w-0 items-baseline gap-[1ch] whitespace-nowrap`,wM=`min-w-0 truncate`,TM=`min-w-[2ch] flex-1 -translate-y-0.75 border-b-hairline border-dotted! border-line-active`,EM=`pl-[2ch] text-subtle`,DM=`-mx-[1ch] block rounded-sm px-[1ch] py-0.5 text-left`,OM=`${DM} w-[calc(100%+2ch)] cursor-pointer hover:bg-hover focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-focus`,kM=`grid grid-cols-[6ch_minmax(0,1fr)_5ch_5ch_8ch] items-center gap-x-[2ch] py-0.5 whitespace-nowrap`,AM=[`bg-accent`,`bg-info`,`bg-merged`,`bg-subtle`],jM=`grid grid-cols-[minmax(0,1fr)_minmax(8ch,14ch)_5ch] items-center gap-x-[1ch] whitespace-nowrap`,MM=`relative h-2.5 border-hairline border-current after:absolute after:inset-y-0 after:left-0 after:w-(--fill) after:bg-current after:content-['']`,NM={ok:`${MM} text-success`,warn:`${MM} text-warning`,crit:`${MM} text-error`},PM=`flex h-9 flex-none items-stretch text-ink`,FM=`flex-none bg-current`,IM=`flex flex-wrap items-baseline justify-between gap-x-[4ch] gap-y-1 text-subtle`,LM={turns:0,tokens:0,ms:0},RM=e=>(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0),zM=e=>Math.max(0,e.endedAt-e.startedAt),BM=(e,t)=>({turns:e.turns+1,tokens:e.tokens+RM(t),ms:e.ms+zM(t)});function VM(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function HM(e,t,n,r){let i=[];for(let e=n-1;e>=0;e--){let n=new Date(t);n.setDate(n.getDate()-e),i.push(VM(n.getTime()))}let a=new Map(i.map(e=>[e,{sum:LM,byEngine:{}}]));for(let t of e){let e=a.get(VM(t.startedAt));if(!e)continue;let n=t.vendor??`unknown`;e.sum=BM(e.sum,t),e.byEngine[n]=(e.byEngine[n]??0)+RM(t)}let o=e.reduce((e,t)=>Math.min(e,t.startedAt),1/0),s=e.length>=r&&Number.isFinite(o)?{count:e.length,day:VM(o)}:null;return{cutoff:s,days:i.map(e=>{let t=a.get(e);return{day:e,...t?.sum??LM,byEngine:t?.byEngine??{},partial:s!==null&&e<=s.day}})}}function UM(e){let t=new Map;for(let n of e){let e=n.vendor??`unknown`,r=n.model??`unknown`,i=`${e}\0${r}`;t.set(i,{engine:e,model:r,...BM(t.get(i)??LM,n)})}return[...t.values()].sort((e,t)=>t.tokens-e.tokens||t.turns-e.turns)}function WM(e,t){let n=new Map;for(let t of e)n.set(t.taskId,{taskId:t.taskId,...BM(n.get(t.taskId)??LM,t)});return[...n.values()].sort((e,t)=>t.tokens-e.tokens||t.turns-e.turns).slice(0,t)}function GM(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4)).replace(/\.0$/,``)}k`:`${(e/1e6).toFixed(+(e<1e7)).replace(/\.0$/,``)}M`}var KM=.1,qM=/^(\d+)\s*(h|d)$/;function JM(e,t){let n=qM.exec(e.label.trim());if(!n||e.resetsAt===null||e.percent<=0)return null;let r=Number(n[1])*(n[2]===`d`?24:1)*36e5,i=r-(e.resetsAt-t);if(!(i>=r*KM)||i>r)return null;if(e.percent>=100)return{kind:`full`,at:t};let a=t+(100-e.percent)/e.percent*i;return a<e.resetsAt?{kind:`full`,at:a}:{kind:`lasts`}}var YM=14,XM=500,ZM=3e4,QM=8;function $M(e,t,n,r){let i=X(e,t,n),[a,o]=(0,m.useState)(i?{kind:`ready`,value:i}:{kind:`loading`}),s=y(e.client.conn).state===`open`,c=JSON.stringify(n);return(0,m.useEffect)(()=>{if(!s)return;let r=!0;return Z(e,t,n).then(e=>r&&o({kind:`ready`,value:e})).catch(e=>r&&o(t=>t.kind===`ready`?t:{kind:`failed`,error:nO(e)})),()=>{r=!1}},[e,t,c,r,s]),a}var eN=()=>(0,W.jsx)(`div`,{className:gM});function tN({name:e,title:t,sum:n,sub:r,open:i}){let a=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:CM,children:[(0,W.jsx)(`span`,{className:wM,title:t,children:e}),(0,W.jsx)(`span`,{className:TM}),(0,W.jsx)(`span`,{children:GM(n.tokens)})]}),(0,W.jsx)(`span`,{className:`block truncate ${EM}`,children:[r,`${n.turns}t`,hj(n.ms)].filter(Boolean).join(` · `)})]});return i?(0,W.jsx)(G,{variant:`row`,className:OM,onClick:i,children:a}):(0,W.jsx)(`div`,{className:DM,children:a})}function nN({sum:e}){let t=`${e.tokens}${e.turns}${e.ms}`.repeat(4).slice(0,36);return(0,W.jsx)(`div`,{className:PM,"aria-hidden":`true`,children:[...t].map((e,t)=>(0,W.jsx)(`span`,{className:FM,style:{width:1+Number(e)%3,marginRight:1+Number(e)%2}},t))})}function rN({usage:e,nameOf:t}){let n=Date.now(),r=e.flatMap(e=>e.windows.map(r=>{let i=JM(r,n),a=i?.kind===`full`&&i.at-n<72e6,o=i?.kind===`full`?$(H(`usage.full`),{time:new Date(i.at).toLocaleString([],{...a?{}:{weekday:`short`},hour:`2-digit`,minute:`2-digit`})}):i?H(`usage.lasts`):``;return{key:`${e.vendor}:${r.kind}`,name:`${e.name||t(e.vendor)} ${r.label}`,percent:Math.round(r.percent),tone:XT({capturedAt:e.capturedAt,windows:[r]},n)?.tone??`ok`,note:o}}));return r.length===0?null:(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h2`,{className:_M,children:H(`usage.quota`)}),r.map(e=>(0,W.jsxs)(`div`,{className:`py-0.5`,children:[(0,W.jsxs)(`div`,{className:jM,children:[(0,W.jsx)(`span`,{className:wM,children:e.name}),(0,W.jsx)(`span`,{className:NM[e.tone]??NM.ok,style:{"--fill":`${Math.min(100,Math.max(0,e.percent))}%`}}),(0,W.jsx)(`span`,{className:`text-right ${Vn[e.tone]}`,children:`${e.percent}%`})]}),e.note&&(0,W.jsx)(`div`,{className:`pl-[2ch] text-subtle`,children:e.note})]},e.key))]})}function iN({model:e}){U();let t=dO(),[n]=cO(ZM),r=$M(e,`turns.list`,{sinceDays:YM,limit:XM},n),i=$M(e,`engines.list`,{},n),a=$M(e,`usage.get`,{},n),o=y(e.tasks),s=i.kind===`ready`?i.value.engines:[],c=e=>s.find(t=>t.id===e)?.name??e,l=e=>o?.tasks.find(t=>t.id===e)?.label??H(`usage.removedTask`),u=a.kind===`ready`&&a.value.usage&&(0,W.jsx)(rN,{usage:a.value.usage,nameOf:c});return(0,W.jsx)(`div`,{className:yS,tabIndex:0,ref:t,onKeyDown:e=>{e.metaKey||e.ctrlKey||e.altKey||e.key!==`q`&&e.key!==`Escape`||(e.preventDefault(),N.set(null))},children:(0,W.jsx)(`div`,{className:uM,children:(()=>{if(r.kind===`loading`)return(0,W.jsx)(`p`,{className:`m-0 ${mM}`,children:H(`usage.loading`)});if(r.kind===`failed`)return(0,W.jsx)(`p`,{className:`m-0 text-error`,children:$(H(`usage.failed`),{error:r.error})});let t=r.value.turns,n=new Set(r.value.readers??[]),i=HM(t,Date.now(),YM,XM),a=new Map;for(let e of i.days)for(let[t,n]of Object.entries(e.byEngine))a.set(t,(a.get(t)??0)+n);let s=[...a].sort((e,t)=>t[1]-e[1]).map(([e])=>e),d=e=>AM[Math.max(0,s.indexOf(e))%AM.length]??AM[0],f=Math.max(0,...i.days.map(e=>e.tokens)),p=i.days.slice(Math.max(0,i.days.findIndex(e=>e.turns>0))),m=i.days.reduce((e,t)=>({turns:e.turns+t.turns,tokens:e.tokens+t.tokens,ms:e.ms+t.ms}),{turns:0,tokens:0,ms:0}),h=[...new Set((o?.tasks??[]).flatMap(e=>e.engine?.id&&!n.has(e.engine.id)?[e.engine.id]:[]))];return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:dM,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h1`,{className:fM,children:[(0,W.jsx)(`span`,{className:Gn,children:`[`}),` rove `,(0,W.jsx)(`span`,{className:Gn,children:`]`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:pM,children:H(`usage.receipt`)}),(0,W.jsx)(`span`,{className:mM,children:` ${i.days[0]?.day.slice(5)} → ${i.days.at(-1)?.day.slice(5)}`})]})]}),t.length>0&&(0,W.jsx)(nN,{sum:m})]}),(0,W.jsx)(eN,{}),t.length===0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`m-0 ${mM}`,children:H(`usage.empty`)}),u&&(0,W.jsx)(eN,{}),u]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:yM,children:[(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h2`,{className:_M,children:H(`usage.total`)}),(0,W.jsx)(`div`,{className:xM,children:GM(m.tokens)}),(0,W.jsx)(`div`,{className:`mt-1.5 ${mM}`,children:`${$(H(`usage.turns`),{count:m.turns})} · ${hj(m.ms)}`})]}),(0,W.jsxs)(`section`,{className:bM,children:[(0,W.jsxs)(`h2`,{className:vM,children:[H(`usage.perDay`),s.length>1&&(0,W.jsx)(`span`,{className:`flex flex-wrap gap-x-[2ch] font-normal tracking-normal normal-case`,children:s.map(e=>(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`mr-[1ch] inline-block size-2 align-baseline ${d(e)}`}),c(e)]},e))})]}),p.map(e=>(0,W.jsxs)(`div`,{className:kM,children:[(0,W.jsx)(`span`,{className:mM,children:`${e.day.slice(5)}${e.partial?`~`:``}`}),(0,W.jsx)(`span`,{className:`flex min-w-0`,children:e.tokens>0&&f>0&&(0,W.jsx)(`span`,{className:`flex h-2.5 w-(--fill) min-w-0.5 gap-px`,style:{"--fill":`${e.tokens/f*100}%`},children:s.map(t=>(e.byEngine[t]??0)>0&&(0,W.jsx)(`span`,{className:`min-w-0.5 basis-0 ${d(t)}`,style:{flexGrow:e.byEngine[t]}},t))})}),e.turns>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-right`,children:GM(e.tokens)}),(0,W.jsx)(`span`,{className:`text-right text-subtle`,children:`${e.turns}t`}),(0,W.jsx)(`span`,{className:`text-right text-subtle`,children:hj(e.ms)})]})]},e.day))]})]}),(0,W.jsx)(eN,{}),(0,W.jsxs)(`div`,{className:SM,children:[(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h2`,{className:_M,children:H(`usage.byModel`)}),UM(t).map(e=>(0,W.jsx)(tN,{name:e.model,title:`${c(e.engine)} · ${e.model}`,sum:e,sub:c(e.engine)},`${e.engine}\0${e.model}`))]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h2`,{className:_M,children:H(`usage.topTasks`)}),WM(t,QM).map(t=>{let n=o?.tasks.some(e=>e.id===t.taskId),r=l(t.taskId);return(0,W.jsx)(tN,{name:n?r:(0,W.jsx)(`span`,{className:hM,children:r}),title:r,sum:t,open:n?()=>{N.set(null),e.select(t.taskId)}:null},t.taskId)})]}),u]})]}),(0,W.jsx)(eN,{}),(0,W.jsxs)(`div`,{className:IM,children:[(0,W.jsx)(`span`,{children:$(H(`usage.range`),{days:YM})}),i.cutoff&&(0,W.jsx)(`span`,{children:$(H(`usage.cutoff`),{count:i.cutoff.count,day:i.cutoff.day.slice(5)})}),h.length>0&&(0,W.jsx)(`span`,{children:$(H(`usage.noReader`),{engines:h.map(c).join(`, `)})}),(0,W.jsx)(`span`,{className:`${pM} ml-auto`,children:H(`usage.thanks`)})]})]})})()})})}var aN={id:`mods`,label:`mods`},oN=[{id:`kanban`,label:`kanban`,mod:`kanban`},{id:`routines`,label:`automations`},{id:`issues`,label:`issues`,mod:`issues`}];function sN({model:e}){let{nav:t}=eO(),n=y(N),r=y(e.mods).length>0,i=y(e.installedMods),a=[...oN.filter(e=>!e.mod||i.has(e.mod)),...r?[aN]:[]];return(0,W.jsxs)(`div`,{className:jS,children:[(0,W.jsx)(lM,{plus:!0,onSelect:()=>ly(),children:H(`rail.newTask`)}),a.map(e=>(0,W.jsx)(lM,{active:n===e.id,onSelect:()=>V(e.id),children:t[e.label]},e.id))]})}function cN({model:e,page:t}){let n=y(e.installedMods);return t===`kanban`&&n.has(`kanban`)?(0,W.jsx)(Ak,{model:e}):t===`routines`?(0,W.jsx)(Mj,{model:e}):t===`issues`&&n.has(`issues`)?(0,W.jsx)(kO,{model:e}):t===`mods`?(0,W.jsx)(qk,{model:e}):t===`compare`?(0,W.jsx)(_O,{model:e}):t===`usage`?(0,W.jsx)(iN,{model:e}):t===`sessions`?(0,W.jsx)(cM,{model:e}):t===`update`?(0,W.jsx)(fC,{client:e.client}):null}var lN=d();function uN(e){return e?.match(/^https?:\/\/[^/]+\/([^/]+\/[^/]+)\/(?:pull|merge_requests|-\/merge_requests)\//)?.[1]}var dN=e=>e.charAt(0).toUpperCase()+e.slice(1);function fN(e){return[H(`rail.pr.state.${e.state}`),...e.checks?[H(`rail.pr.checks.${e.checks}`)]:[]].join(`, `)}function pN(e){let t=new Map;for(let n of e){let e=Bg(n),r=[...e&&n.pr?[{pr:n.pr,mark:e}]:[],...(n.sessionPrs??[]).flatMap(e=>{let t=Vg(e);return t?[{pr:e,mark:t}]:[]})];for(let{pr:e,mark:i}of r){let r=e.url??(e.number===void 0?n.id:`${n.repo}#${e.number}`),a=t.get(r),o=e.lifecycle===`unknown`,s=a?.pr.lifecycle===`unknown`;(!a||s&&!o||o===s&&Hg([a.mark,i])!==a.mark)&&t.set(r,{task:n,pr:e,mark:i})}}return[...t.values()]}function mN({tasks:e,onOpen:t}){let[n,r]=(0,m.useState)(null),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(null),s=(0,m.useRef)(null),c=(0,m.useRef)(null),l=xu();(0,m.useLayoutEffect)(()=>{let e=c.current;if(!e||!n)return;let t=e.getBoundingClientRect();t.right>window.innerWidth-8&&(e.style.left=`${Math.max(8,window.innerWidth-t.width-8)}px`,e.style.top=`${n.bottom+6}px`);let r=e.getBoundingClientRect().bottom-(window.innerHeight-8);r>0&&(e.style.top=`${Math.max(8,e.getBoundingClientRect().top-r)}px`)},[n]);let u=()=>{t?.(),s.current!==null&&window.clearTimeout(s.current),s.current=null,a(!1),o.current&&!n&&r(o.current.getBoundingClientRect())},d=()=>{a(!0),s.current=window.setTimeout(()=>r(null),140)};(0,m.useEffect)(()=>{if(!l||!n)return;let e=e=>{let t=e.target;o.current?.contains(t)||c.current?.contains(t)||(a(!0),s.current=window.setTimeout(()=>r(null),140))};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[l,n]),(0,m.useEffect)(()=>()=>{s.current!==null&&window.clearTimeout(s.current)},[]);let f=pN(e),p=Hg(f.map(e=>e.mark));if(!p)return null;let h=f.length===1?`PR #${f[0]?.pr.number??``}, ${fN(p)}`:H(`rail.pr.many`,{count:f.length});return(0,W.jsxs)(`span`,{ref:o,className:`chip ${Ph} ${p.tone}`,"aria-label":h,onMouseEnter:l?void 0:u,onMouseLeave:l?void 0:d,onClick:e=>{l&&(e.stopPropagation(),n&&!i?d():u())},children:[p.glyph,f.length>1&&(0,W.jsx)(`span`,{className:`font-sans`,children:f.length}),n&&(0,lN.createPortal)((0,W.jsx)(`div`,{ref:c,className:Fh(i),style:{top:n.top-6,left:n.right+8},onMouseEnter:l?void 0:u,onMouseLeave:l?void 0:d,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onContextMenu:e=>e.stopPropagation(),children:f.map(({task:e,pr:t,mark:n})=>{let r=uN(t?.url),i=t?.additions!==void 0&&t.deletions!==void 0;return(0,W.jsxs)(`button`,{type:`button`,className:`flex flex-col gap-1 rounded-[calc(var(--radius)-6px)] px-3 py-2 text-left font-sans enabled:hover:bg-hover`,disabled:!t?.url,onClick:()=>t?.url&&window.open(t.url,`_blank`,`noopener`),children:[(0,W.jsx)(`span`,{className:`truncate font-semibold text-ink`,children:t.title||e.label}),(0,W.jsxs)(`span`,{className:`flex items-baseline gap-0 text-meta leading-[inherit] whitespace-nowrap`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-baseline gap-1.25 ${n.tone}`,children:[(0,W.jsx)(`span`,{className:`font-mono`,children:n.glyph}),dN(H(`rail.pr.state.${n.state}`))]}),(0,W.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-pre text-muted`,children:[...n.checks?[H(`rail.pr.checks.${n.checks}`)]:[],[r,t?.number===void 0?``:`#${t.number}`].filter(Boolean).join(` `)].filter(Boolean).map(e=>`, ${e}`).join(``)}),i&&(0,W.jsxs)(`span`,{className:`ml-auto flex gap-1.5 pl-3 tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,t.additions]}),(0,W.jsxs)(`span`,{className:`text-error`,children:[`−`,t.deletions]})]})]})]},t.url??`${e.id}#${t.number??``}`)})}),document.body)]})}function hN(e,t,n){let r=t(n),i=[];for(let a=2;a<=r;a++){let o=n+1;for(;o<e&&t(o)>a;)o++;let s=o<e&&t(o)===a;i.push(a===r?s?`tee`:`elbow`:s?`pipe`:`blank`)}return i}function gN(e,t,n){let r=e=>e.repo===t.repo&&!e.pinned==!t.pinned;if(t.id===n.id||!r(n))return null;let i=e.filter(r).sort((e,t)=>(e.order??e.rank)-(t.order??t.rank)).map(e=>e.id);return i.indexOf(n.id)-i.indexOf(t.id)}function _N(e,t,n,r){let i=gN(e,t,n);return i===null?null:r===`above`&&i>0?i-1:r===`below`&&i<0?i+1:i}function vN(e,t){return e.id!==t.id&&t.repo===e.repo&&!t.pinned==!e.pinned}var yN=e=>e===void 0||e.kind===`project`||e.kind===`state`?0:e.kind===`task`||e.kind===`pane`||e.kind===`round`?e.depth:1;function bN(e,t){let n=yN(e[t]),r=t+1;for(;r<e.length&&yN(e[r])>n;)r++;return r}function xN(e,t){return hN(e.length,t=>yN(e[t]),t)}function SN(e,t,n,r){let i=e.findIndex(e=>e.id===t);if(i<0||t===n)return e;let a=bN(e,i),o=e.slice(i,a),s=[...e.slice(0,i),...e.slice(a)],c=s.findIndex(e=>e.id===n);if(c<0)return e;let l=r===`above`?c:bN(s,c);return[...s.slice(0,l),...o,...s.slice(l)]}var CN={duration:180,easing:`cubic-bezier(0.16, 1, 0.3, 1)`};function wN(e,t){let n=(0,m.useRef)(null);(0,m.useLayoutEffect)(()=>{let r=[...document.querySelectorAll(`[data-rail-body] > [data-row]`)],i=new Map(r.map(e=>[e.dataset.row??``,e.offsetTop])),a=n.current;if(n.current={list:e,tops:i},!(!a||a.list===e||a.tops.size===0||t)&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)for(let e of r){let t=a.tops.get(e.dataset.row??``);t===void 0?e.animate([{opacity:0},{opacity:1}],CN):t!==e.offsetTop&&e.animate([{transform:`translateY(${t-e.offsetTop}px)`},{transform:`none`}],CN)}})}var TN=null,EN=()=>(TN||(TN=new Image,TN.src=`data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`),TN);function DN(e,t,n,r){let[i,a]=(0,m.useState)(null),o=(0,m.useRef)(t);o.current=t;let[s,c]=(0,m.useState)(null),l=(0,m.useRef)(()=>a(null));(0,m.useEffect)(()=>{if(!s)return;let e=()=>{c(null),l.current()};if(t!==s)return e();let n=window.setTimeout(e,3e3);return()=>window.clearTimeout(n)},[t,s]);let u=(0,m.useRef)(null),d=(0,m.useRef)(null);wN(t,i!==null||s!==null);let f=()=>[...u.current?.querySelectorAll(`[data-row]`)??[]];(0,m.useLayoutEffect)(()=>{let e=d.current;if(!e||(d.current=null,window.matchMedia(`(prefers-reduced-motion: reduce)`).matches))return;let t=f().flatMap(t=>{let n=e.get(t.dataset.row??``),r=n===void 0?0:n-t.getBoundingClientRect().top;return r?[{el:t,dy:r}]:[]});for(let{el:e,dy:n}of t)e.style.transition=`none`,e.style.transform=`translateY(${n}px)`;u.current?.getBoundingClientRect();for(let{el:e}of t)e.style.transition=`transform 150ms ease-out`,e.style.transform=``,e.addEventListener(`transitionend`,()=>e.style.removeProperty(`transition`),{once:!0})});let p=(0,m.useRef)(null),h=(0,m.useRef)([]),g=(0,m.useRef)(new Map),_=(0,m.useRef)(0),v=(0,m.useRef)(0),y=e=>{p.current=e,a(e)},b=e=>!n||e.machine!==void 0?null:e.kind===`project`?e.noProject?null:t.find(t=>t.repo===e.repo&&!Ud(t))??null:e.kind===`task`&&e.depth===1?e.task:null,x=e=>{let t=b(e);if(t)return{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setDragImage(EN(),0,0),n.dataTransfer.setData(`text/plain`,t.id),u.current=n.currentTarget.closest(`[data-rail-body]`),w(u.current);let r=h.current,i=r.findIndex(t=>t.id===e.id);_.current=r.slice(i,bN(r,i)).reduce((e,t,n)=>e+(g.current.get(t.id)?.height??0)+(n>0?g.current.get(t.id)?.gap??0:0),0),v.current=n.clientY,y({fromRow:e.id,from:t,toRow:e.id,to:t,side:`above`,project:e.kind===`project`})},onDragEnd:()=>p.current&&y(null)}},S=(e,t,n)=>{let r=t;if(n.project)for(;r>0&&e[r]?.kind!==`project`;)r--;let i=e[r];if(!i||i.kind===`project`!==n.project)return null;let a=b(i);return!a||!n.project&&!vN(n.from,a)?null:{row:i.id,task:a}},C={onDragOver:e=>{let t=p.current;if(!t)return;e.preventDefault();let n=e.clientY-v.current;v.current=e.clientY;let r=e.target.closest(`[data-row]`)?.dataset.row,i=h.current,a=S(i,i.findIndex(e=>e.id===r),t);if(!a||a.row===t.fromRow)return;let o=e.currentTarget.querySelector(`[data-row="${CSS.escape(t.fromRow)}"]`)?.getBoundingClientRect().top;if(o===void 0||e.clientY>=o&&e.clientY<o+_.current)return;let s=e.clientY<o?`above`:`below`;(s===`above`?n>=0:n<=0)||(t.toRow!==a.row||t.side!==s)&&y({...t,toRow:a.row,to:a.task,side:s})},onDrop:n=>{let i=p.current;if(!i)return;n.preventDefault(),p.current=null,r?l.current=()=>a(null):l.current=()=>{d.current=new Map(f().map(e=>[e.dataset.row??``,e.getBoundingClientRect().top])),a(null),Jp(`default`),z(J(`tasks`,`sort.label`,{mode:J(`tasks`,`sort.modes.default`)}))};let s=o.current,u=()=>o.current===s?c(s):l.current();if(i.project){if(i.toRow===i.fromRow)return l.current();let t={repo:i.from.repo,target:i.to.repo,side:i.side===`above`?`before`:`after`};e.client.request(`project.move`,t).catch(e=>z(J(`tasks`,`toast.moveFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)).finally(u);return}let m=_N(t,i.from,i.to,i.side);m?$p(e,i.from.id,m).finally(u):l.current()}},w=e=>{let t=[...e?.querySelectorAll(`[data-row]`)??[]];g.current=new Map(t.map((e,n)=>{let r=t[n-1],i=r?e.offsetTop-r.offsetTop-r.offsetHeight:0;return[e.dataset.row??``,{top:e.offsetTop,gap:i,height:e.offsetHeight}]}))},T=(e,t)=>{h.current=t?SN(e,t.fromRow,t.toRow,t.side):e;let n=new Map;if(!t)return n;let r=Math.min(...[...g.current.values()].map(e=>e.top)),i=e=>e.kind===`project`||e.kind===`state`,a=Math.max(0,...e.filter(i).map(e=>g.current.get(e.id)?.gap??0));for(let[e,t]of h.current.entries()){let o=g.current.get(t.id);if(!o)return new Map;e>0&&(r+=i(t)?a:o.gap),r!==o.top&&n.set(t.id,r-o.top),r+=o.height}return n};return{props:x,body:C,places:e=>{let t=[...g.current.keys()],n=i&&e.length===t.length&&e.every((e,n)=>e.id===t[n])?i:null,r=T(e,n),a=n?e.findIndex(e=>e.id===n.fromRow):-1,o=new Set(a<0?[]:e.slice(a,bN(e,a)).map(e=>e.id));return{dragging:n?.fromRow??null,place:e=>{let t=r.get(e.id);return{"data-row":e.id,...o.has(e.id)?{"data-lifted":``}:{},...t?{style:{transform:`translateY(${t}px)`}}:{}}}}}}}function ON({model:e,narrow:t,onSettings:n}){U();let r=y(Ow),i=Q(`engines.skill.bannerHintWeb`,{engines:r.join(`, `)});return(0,W.jsxs)(`div`,{className:MS,children:[!t&&(0,W.jsx)(QT,{client:e.client}),(0,W.jsxs)(`div`,{className:NS,children:[(0,W.jsxs)(`button`,{type:`button`,className:`rail-nav-row ${PS(!1)}`,onClick:n,children:[(0,W.jsxs)(`svg`,{className:IS,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),(0,W.jsx)(`span`,{children:H(`rail.settings`)}),r.length>0&&(0,W.jsx)(`span`,{className:`ml-2 min-w-0 truncate text-meta text-subtle`,title:i,children:H(`rail.skillCue`)})]}),(0,W.jsx)(OE,{model:e,bindingId:`settings.open`})]})]})}function kN(e,{task:t,tab:n,leaf:r}){n.split&&Ij(t.id,n,n.split,r),e.select(t.id,n.id)}function AN(e){let{row:t}=e;y(Nj);let n=e.selectedTabId===t.tab.id&&!!t.tab.split&&Pj(t.task.id,t.tab,t.tab.split)===t.leaf;return(0,W.jsxs)(`button`,{type:`button`,className:`${gi({size:`pane`})} ${e.cursor?Hh:``}`,"aria-current":n||void 0,onClick:e.onClick,onContextMenu:e.onMenu,...e.place,children:[(0,W.jsx)(`span`,{className:kh,"aria-hidden":`true`,children:e.guides?.map((e,t)=>(0,W.jsx)(`span`,{className:Mh(e)},t))}),(0,W.jsx)(`span`,{className:`${_i} text-(length:--fs-meta) ${n?`text-ink`:`text-muted`}`,children:t.label})]})}var jN=`rove.collapsedProjects`,MN=`rove.foldedTasks`,NN=`rove.openedTasks`,PN=600;function FN(e){try{let t=JSON.parse(localStorage.getItem(e)??`[]`);return new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}catch{return new Set}}function IN(e,t){try{localStorage.setItem(e,JSON.stringify([...t]))}catch{}}var LN=(e,t)=>{let n=new Set(e);return n.delete(t)||n.add(t),n};function RN(){let e=y(Kp),[t,n]=(0,m.useState)({active:!1,query:``}),[r,i]=(0,m.useState)(()=>FN(jN)),a=e=>i(t=>{let n=LN(t,e);return IN(jN,n),n}),[o,s]=(0,m.useState)(()=>({folded:FN(MN),opened:FN(NN)}));return{sort:e,cycleSort:Yp,search:t,setSearch:n,collapsed:r,toggleProject:a,hand:o,toggleTaskFold:(e,t)=>s(n=>{let r=new Set(n.folded),i=new Set(n.opened);return t?(r.delete(e),i.add(e)):(i.delete(e),r.add(e)),IN(MN,r),IN(NN,i),{folded:r,opened:i}})}}var zN=[`sidebar.nav`,`sidebar.goto`,`sidebar.select`,`sidebar.tree.open`,`sidebar.rename`,`sidebar.pin`,`sidebar.localMerge`,`sidebar.delete`,`sidebar.sort`,`sidebar.search.enter`,`tasks.renameBranch`,`tasks.cycleEngine`,`tasks.openWorktree`,`tasks.update`,`tasks.focusEngine`,`task.new`,`settings.open.sidebar`,`worktrees.open.sidebar`];function BN(e){for(let t of e)for(let e of zN){let n=vo(e).indexOf(t);if(n>=0)return{id:e,slot:n}}return null}function VN(e,t){let n=e.selection.get().taskId===t;e.select(t),ge(),n&&!sy(e.client)&&$a()}function HN(e,t,n,r){let{search:i,setSearch:a}=n,[o,s]=(0,m.useState)(null),c=(0,m.useRef)(0),l=t.filter(e=>e.kind!==`project`&&e.kind!==`state`),u=l.findIndex(e=>e.id===o);(0,m.useEffect)(()=>{u<0&&s(r.selectedId&&l.some(e=>e.id===r.selectedId)?r.selectedId:l[0]?.id??null)},[u,l,r.selectedId]);let d=l[u],f=d?.kind===`task`||d?.kind===`pane`?d.task.id:null;(0,m.useEffect)(()=>kb.set(f),[f]);let p=l[0]?.id??null;(0,m.useEffect)(()=>{i.query,i.active&&s(p)},[i.active,i.query,p]);let h=e=>{let t=l[Math.max(0,Math.min(l.length-1,e))];t&&s(t.id)},g=t=>{t?.kind===`task`&&e.select(t.task.id),t?.kind===`round`&&ve(t.groupId),t?.kind===`pane`&&kN(e,t),t&&ge()},_=(t,n)=>{t?.kind===`task`&&E(rM(e,t.task,null),n)?.run?.()},v=async t=>{if(t?.kind===`task`&&t.machine===void 0)try{let{engines:n}=await e.client.request(`engines.list`),r=Ru(n).filter(e=>e.ready!==!1),i=r[(r.findIndex(e=>e.id===t.task.engine?.id)+1)%r.length];if(!i||i.id===t.task.engine?.id)return;await e.client.request(`task.setCommand`,{taskId:t.task.id,engine:i.id}),z(H(`rail.engineSwitched`,{engine:i.name}))}catch(e){z(H(`rail.engineSwitchFailed`,{error:e instanceof Error?e.message:String(e)}),`error`)}};return{cursor:o,setCursor:s,onKeyDown:t=>{let o=l[u],s=t.target instanceof HTMLInputElement;if(i.active){if(t.metaKey||t.ctrlKey||t.altKey)return;if(t.key===`Escape`)a({active:!1,query:``});else if(t.key===`Enter`)g(o),a({active:!1,query:``});else if(t.key===`ArrowDown`)h(u+1);else if(t.key===`ArrowUp`)h(u-1);else if(t.key===`Backspace`&&!s)a(e=>({...e,query:e.query.slice(0,-1)}));else if(t.key.length===1&&!s)a(e=>({...e,query:e.query+t.key}));else return;t.preventDefault();return}let d=BN(sl(t));if(Xp.get()){let n=o?.kind===`task`&&o.machine===void 0;if(d?.id===`sidebar.nav`)n&&Qp(e,o,d.slot%2==0?1:-1);else if(d?.id===`sidebar.localMerge`||t.key===`Enter`||t.key===`Escape`)Zp(!1);else return;t.preventDefault();return}switch(d?.id){case`sidebar.nav`:h(d.slot%2==0?u+1:u-1);break;case`sidebar.goto`:d.slot%2==1?h(l.length-1):Date.now()-c.current<PN?(h(0),c.current=0):c.current=Date.now();break;case`sidebar.select`:case`sidebar.tree.open`:g(o);break;case`tasks.focusEngine`:$a();break;case`sidebar.rename`:case`sidebar.pin`:case`sidebar.delete`:case`tasks.renameBranch`:case`tasks.openWorktree`:_(o,d.id);break;case`tasks.cycleEngine`:v(o);break;case`sidebar.localMerge`:o?.machine===void 0&&Zp(!0);break;case`sidebar.sort`:n.cycleSort(),z(J(`tasks`,`sort.label`,{mode:J(`tasks`,`sort.modes.${Kp.get()}`)}));break;case`sidebar.search.enter`:a({active:!0,query:``});break;case`task.new`:r.onNewTask(o?.kind===`task`||o?.kind===`pane`?o.task.repo:void 0,o?.machine);break;case`settings.open.sidebar`:r.onSettings();break;case`worktrees.open.sidebar`:V(`worktrees`);break;case`tasks.update`:V(`update`);break;default:return}t.preventDefault()},onPress:e=>{let t=e.target.closest(`[data-row]`)?.dataset.row;t&&s(t)}}}var UN=192,WN=`rove.web.railWidth`,GN=`rove.web.railFolded`;function KN(){let e=Number(localStorage.getItem(WN));return Number.isFinite(e)&&e>0?e:null}var qN=v(KN());qN.subscribe(()=>{let e=qN.get();e===null?localStorage.removeItem(WN):localStorage.setItem(WN,String(Math.round(e)))}),qN.subscribe(fe);var JN=v(localStorage.getItem(GN)===`1`);JN.subscribe(()=>localStorage.setItem(GN,JN.get()?`1`:`0`));var YN=v(!1),XN=null,ZN=!1;function QN(e){XN!==null&&window.clearTimeout(XN),XN=null,ZN=e,e?YN.set(!0):XN=window.setTimeout(()=>D.get()===null&&YN.set(!1),250)}D.subscribe(()=>{D.get()===null&&YN.get()&&!ZN&&QN(!1)}),JN.subscribe(()=>YN.set(!1)),JN.subscribe(fe);function $N(e,t=window.innerWidth){let n=Math.max(UN,t-320);return Math.max(UN,Math.min(n,Math.round(e)))}var eP=(e,t,n)=>`~pane:${e}:${t}:${n}`;function tP(e,t){return e.flatMap(e=>e.kind===`task`?[e,...(t[e.task.id]??[]).flatMap(t=>{let n=t.split;if(!n||!af(n))return[];let r=cf(n,tf(t));return rf(n.root).map(n=>({id:eP(e.task.id,t.id,n.id),kind:`pane`,task:e.task,tab:t,leaf:n.id,label:r.get(n.id)??n.id,depth:e.depth+1,...e.machine===void 0?{}:{machine:e.machine}}))})]:[e])}function nP(e){let{row:t}=e;return(0,W.jsxs)(`button`,{type:`button`,className:`${gi({size:`pane`})} ${e.cursor?Hh:``}`,title:H(`compare.menu`),onClick:()=>{e.onClick(),ve(t.groupId)},...e.place,children:[e.guides&&(0,W.jsx)(`span`,{className:`-my-0.75 -mr-0.5 ml-0 flex flex-none self-stretch`,"aria-hidden":`true`,children:e.guides.map((e,t)=>(0,W.jsx)(`span`,{className:Mh(e)},t))}),(0,W.jsx)(`span`,{className:`${_i} text-(length:--fs-meta) text-muted`,children:t.title}),(0,W.jsxs)(`span`,{className:`${Si} ml-auto items-center`,children:[e.repo&&(0,W.jsx)(`span`,{className:`max-w-24 truncate text-subtle`,children:e.repo}),(0,W.jsx)(`span`,{className:`text-subtle`,children:t.tasks.length}),(0,W.jsx)(Xg,{status:Rg(t.tasks)})]})]})}function rP(e){let t=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let e=t.current;return()=>{e&&document.activeElement===e&&e.closest(`nav`)?.focus()}},[]),(0,W.jsxs)(`div`,{className:`${zh} mono items-center`,children:[(0,W.jsx)(`span`,{className:`text-accent`,children:`/`}),(0,W.jsx)(`input`,{ref:t,className:Bh,type:`text`,autoFocus:!0,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,enterKeyHint:`go`,value:e.query,placeholder:H(`rail.searchPlaceholder`),"aria-label":H(`rail.searchPlaceholder`),onChange:t=>e.onChange(t.target.value)}),e.query&&(0,W.jsx)(`span`,{className:`ml-1.5 text-muted`,children:e.count})]})}var iP=Math.min,aP=Math.max,oP=Math.round,sP=Math.floor,cP=e=>({x:e,y:e}),lP={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function uP(e,t,n){return aP(e,iP(t,n))}function dP(e,t){return typeof e==`function`?e(t):e}function fP(e){return e.split(`-`)[0]}function pP(e){return e.split(`-`)[1]}function mP(e){return e===`x`?`y`:`x`}function hP(e){return e===`y`?`height`:`width`}function gP(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function _P(e){return mP(gP(e))}function vP(e,t,n){n===void 0&&(n=!1);let r=pP(e),i=_P(e),a=hP(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=DP(o)),[o,DP(o)]}function yP(e){let t=DP(e);return[bP(e),t,bP(t)]}function bP(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var xP=[`left`,`right`],SP=[`right`,`left`],CP=[`top`,`bottom`],wP=[`bottom`,`top`];function TP(e,t,n){switch(e){case`top`:case`bottom`:return n?t?SP:xP:t?xP:SP;case`left`:case`right`:return t?CP:wP;default:return[]}}function EP(e,t,n,r){let i=pP(e),a=TP(fP(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(bP)))),a}function DP(e){let t=fP(e);return lP[t]+e.slice(t.length)}function OP(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function kP(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:OP(e)}function AP(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 jP(e,t,n){let{reference:r,floating:i}=e,a=gP(t),o=_P(t),s=hP(o),c=fP(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=pP(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function MP(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}=dP(t,e),p=kP(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=AP(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=AP(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 NP=50,PP=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:MP},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=jP(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<NP&&(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}=jP(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},FP=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}=dP(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=fP(r),_=gP(o),v=fP(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[DP(o)]:yP(o)),x=p!==`none`;!d&&x&&b.push(...EP(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=vP(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`||_===gP(t)||T.every(e=>gP(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=gP(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{}}}},IP=new Set([`left`,`top`]);async function LP(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=fP(n),s=pP(n),c=gP(n)===`y`,l=IP.has(o)?-1:1,u=a&&c?-1:1,d=dP(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 RP=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 LP(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}}}}},zP=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}=dP(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=gP(i),p=mP(f),m=u[p],h=u[f],g=(e,t)=>uP(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}}}}}};function BP(){return typeof window<`u`}function VP(e){return WP(e)?(e.nodeName||``).toLowerCase():`#document`}function HP(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function UP(e){return((WP(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function WP(e){return BP()?e instanceof Node||e instanceof HP(e).Node:!1}function GP(e){return BP()?e instanceof Element||e instanceof HP(e).Element:!1}function KP(e){return BP()?e instanceof HTMLElement||e instanceof HP(e).HTMLElement:!1}function qP(e){return!BP()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof HP(e).ShadowRoot}function JP(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=aF(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function YP(e){return/^(table|td|th)$/.test(VP(e))}function XP(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ZP=/transform|translate|scale|rotate|perspective|filter/,QP=/paint|layout|strict|content/,$P=e=>!!e&&e!==`none`,eF;function tF(e){let t=GP(e)?aF(e):e;return $P(t.transform)||$P(t.translate)||$P(t.scale)||$P(t.rotate)||$P(t.perspective)||!rF()&&($P(t.backdropFilter)||$P(t.filter))||ZP.test(t.willChange||``)||QP.test(t.contain||``)}function nF(e){let t=sF(e);for(;KP(t)&&!iF(t);){if(tF(t))return t;if(XP(t))return null;t=sF(t)}return null}function rF(){return eF??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),eF}function iF(e){return/^(html|body|#document)$/.test(VP(e))}function aF(e){return HP(e).getComputedStyle(e)}function oF(e){return GP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sF(e){if(VP(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||qP(e)&&e.host||UP(e);return qP(t)?t.host:t}function cF(e){let t=sF(e);return iF(t)?(e.ownerDocument||e).body:KP(t)&&JP(t)?t:cF(t)}function lF(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cF(e),i=r===e.ownerDocument?.body,a=HP(r);if(i){let e=uF(a);return t.concat(a,a.visualViewport||[],JP(r)?r:[],e&&n?lF(e):[])}return t.concat(r,lF(r,[],n))}function uF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dF(e){let t=aF(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=KP(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=oP(n)!==a||oP(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fF(e){return GP(e)?e:e.contextElement}function pF(e){let t=fF(e);if(!KP(t))return cP(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=dF(t),o=(a?oP(n.width):n.width)/r,s=(a?oP(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var mF=cP(0);function hF(e){let t=HP(e);return!rF()||!t.visualViewport?mF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gF(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===HP(e)}function _F(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=fF(e),o=cP(1);t&&(r?GP(r)&&(o=pF(r)):o=pF(e));let s=gF(a,n,r)?hF(a):cP(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=HP(a),t=GP(r)?HP(r):r,n=e,i=uF(n);for(;i&&t!==n;){let e=pF(i),t=i.getBoundingClientRect(),r=aF(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=HP(i),i=uF(n)}}return AP({width:u,height:d,x:c,y:l})}function vF(e,t){let n=oF(e).scrollLeft;return t?t.left+n:_F(UP(e)).left+n}function yF(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vF(e,n),y:n.top+t.scrollTop}}function bF(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=UP(r),s=t?XP(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=cP(1),u=cP(0),d=KP(r);if((d||!a)&&((VP(r)!==`body`||JP(o))&&(c=oF(r)),d)){let e=_F(r);l=pF(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?yF(o,c):cP(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 xF(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function SF(e){let t=oF(e),n=e.ownerDocument.body,r=aP(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=aP(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+vF(e),o=-t.scrollTop;return aF(n).direction===`rtl`&&(a+=aP(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var CF=25;function wF(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=HP(e),a=UP(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!rF()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(vF(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<=CF&&(s-=o)}return{width:s,height:c,x:l,y:u}}function TF(e,t){let n=_F(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=pF(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function EF(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=wF(e,n,t);else if(t===`document`)r=SF(UP(e));else if(GP(t))r=TF(t,n);else{let n=hF(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return AP(r)}function DF(e,t){let n=t.get(e);if(n)return n;let r=lF(e,[],!1).filter(e=>GP(e)&&VP(e)!==`body`),i=null,a=aF(e).position===`fixed`,o=a?sF(e):e;for(;GP(o)&&!iF(o);){let e=aF(o),t=tF(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=sF(o)}return t.set(e,r),r}function OF(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?XP(t)?[]:DF(t,this._c):[].concat(n),r],o=EF(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=EF(t,a[e],i);s=aP(n.top,s),c=iP(n.right,c),l=iP(n.bottom,l),u=aP(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function kF(e){let{width:t,height:n}=dF(e);return{width:t,height:n}}function AF(e,t,n){let r=KP(t),i=UP(t),a=n===`fixed`,o=_F(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=cP(0);if((r||!a)&&((VP(t)!==`body`||JP(i))&&(s=oF(t)),r)){let e=_F(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=vF(i));let l=i&&!r&&!a?yF(i,s):cP(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 jF(e){return aF(e).position===`static`}function MF(e,t){if(!KP(e)||aF(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return UP(e)===n&&(n=n.ownerDocument.body),n}function NF(e,t){let n=HP(e);if(XP(e))return n;if(!KP(e)){let t=sF(e);for(;t&&!iF(t);){if(GP(t)&&!jF(t))return t;t=sF(t)}return n}let r=MF(e,t);for(;r&&YP(r)&&jF(r);)r=MF(r,t);return r&&iF(r)&&jF(r)&&!tF(r)?n:r||nF(e)||n}var PF=async function(e){let t=this.getOffsetParent||NF,n=this.getDimensions,r=await n(e.floating);return{reference:AF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FF(e){return aF(e).direction===`rtl`}var IF={convertOffsetParentRelativeRectToViewportRelativeRect:bF,getDocumentElement:UP,getClippingRect:OF,getOffsetParent:NF,getElementRects:PF,getClientRects:xF,getDimensions:kF,getScale:pF,isElement:GP,isRTL:FF};function LF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function RF(e,t,n){let r=null,i,a=UP(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=sP(d),h=sP(a.clientWidth-(u+f)),g=sP(a.clientHeight-(d+p)),_=sP(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:aP(0,iP(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!LF(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=HP(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function zF(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=fF(e),u=i||a?[...l?lF(l):[],...t?lF(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?RF(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?_F(e):null;c&&g();function g(){let t=_F(e);h&&!LF(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 BF=RP,VF=zP,HF=FP,UF=(e,t,n)=>{let r=new Map,i=n??{},a={...IF,...i.platform,_c:r};return PP(e,t,{...i,platform:a})},WF=`pointer-events-none fixed top-0 left-0 z-35 max-w-80 animate-tip-in rounded-sm border-hairline border-line bg-inset px-2.5 py-1.5 font-sans text-meta leading-[1.4] whitespace-normal wrap-anywhere text-ink shadow-popover motion-reduce:animate-none`,GF=500,KF=400,qF=`rove-tip`,JF=null,YF=null,XF=null,ZF=null,QF=0,$F=!1,eI=()=>$F;function tI(){return JF?.isConnected?JF:(JF=document.createElement(`div`),JF.id=qF,JF.setAttribute(`role`,`tooltip`),JF.className=WF,JF.hidden=!0,document.body.append(JF),JF)}function nI(){ZF!==null&&window.clearTimeout(ZF),ZF=null}function rI(e,t,n=`top`){nI(),iI();let r=tI();r.textContent=t,r.hidden=!1,YF=e,e.setAttribute(`aria-describedby`,qF),XF=zF(e,r,()=>{if(!e.isConnected)return iI();UF(e,r,{strategy:`fixed`,placement:n,middleware:[BF(6),HF(),VF({padding:8})]}).then(({x:e,y:t})=>{r.style.left=`${e}px`,r.style.top=`${t}px`})})}function iI(){nI(),YF&&(XF?.(),XF=null,YF.getAttribute(`aria-describedby`)===qF&&YF.removeAttribute(`aria-describedby`),YF=null,JF&&(JF.hidden=!0),QF=performance.now())}function aI(e){if(!(e instanceof Element))return null;let t=e.closest(`[title], [data-tip]`);if(!t||t instanceof HTMLIFrameElement)return null;let n=t.getAttribute(`title`);if(n!==null){if(t.removeAttribute(`title`),n===``)return null;t.dataset.tip=n,!t.hasAttribute(`aria-label`)&&!t.textContent?.trim()&&t.setAttribute(`aria-label`,n)}return t.dataset.tip?t:null}function oI(e){if(e===YF)return;nI();let t=YF!==null||performance.now()-QF<KF,n=()=>e.isConnected&&e.dataset.tip&&rI(e,e.dataset.tip);t?n():ZF=window.setTimeout(n,GF)}var sI=!1;function cI(){sI||(sI=!0,document.addEventListener(`pointerover`,e=>{if(e.pointerType===`touch`)return;let t=aI(e.target);t?oI(t):YF&&e.target instanceof Node&&YF.contains(e.target)||iI()}),document.addEventListener(`pointerout`,e=>{let t=aI(e.target);t&&!(e.relatedTarget instanceof Node&&t.contains(e.relatedTarget))&&iI()}),document.addEventListener(`keydown`,e=>{$F=!0,e.key===`Escape`&&iI()},!0),document.addEventListener(`pointerdown`,()=>{$F=!1,iI()},!0),document.addEventListener(`focusin`,e=>{let t=$F?aI(e.target):null;t&&oI(t)}),document.addEventListener(`focusout`,e=>{e.target===YF&&iI()}),window.addEventListener(`blur`,iI))}var lI=450,uI=e=>{let t=e.querySelector(`.row-title`);return!!t&&t.scrollWidth>t.clientWidth};function dI(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(e);i.current=e;let a=()=>{n.current!==null&&window.clearTimeout(n.current),n.current=null},o=e=>{a(),n.current=window.setTimeout(()=>rI(e,i.current,`right`),lI)},s=()=>{a(),iI()};return(0,m.useEffect)(()=>{let e=r.current,n=e?.closest(`.rail`);if(!t||!e||!n||!eI()||!n.contains(document.activeElement)||!uI(e))return;let i=e=>{e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||s()};return o(e),n.addEventListener(`focusout`,i),()=>{n.removeEventListener(`focusout`,i),s()}},[t]),(0,m.useEffect)(()=>()=>{n.current!==null&&window.clearTimeout(n.current)},[]),{ref:e=>{r.current=e},onPointerEnter:e=>{e.pointerType===`touch`||!uI(e.currentTarget)||o(e.currentTarget)},onPointerLeave:s,hide:s}}var fI={info:`text-info`,success:`text-success`,warning:`text-warning`,error:`text-error`};function pI(e){return e.tokens?.map(e=>(0,W.jsx)(`span`,{className:`max-w-32 truncate ${fI[e.tone??``]??`text-subtle`}`,title:e.source,children:e.text},`${e.source}:${e.text}`))}function mI({at:e}){let t=new Date(e);if(Number.isNaN(t.getTime()))return null;let n=F_(t);return(0,W.jsxs)(`span`,{className:`text-subtle`,title:H(`rail.startsAt`,{time:t.toLocaleString()}),children:[`◷ `,n]})}var hI=2e4;function gI(e,t){let n=Lp().prefs.statusMarkNoticeSeen===!1,r=TC();(0,m.useEffect)(()=>{!n||t===void 0||(Fp(e.client,`statusMarkNoticeSeen`,!0),t!==0&&r!==`dots`&&z(H(`rail.markNotice`),`info`,{label:H(`rail.markNoticeUndo`),run:()=>EC(e.client,`dots`)},hI))},[e,n,t,r])}function _I(e){let{repo:t,label:n,collapsed:r}=e,i=H(r?`rail.expandGroup`:`rail.collapseGroup`,{name:n});return(0,W.jsxs)(W.Fragment,{children:[t&&(0,W.jsx)(`button`,{type:`button`,className:Kh,title:t,onClick:()=>ye(t),children:(0,W.jsx)(`span`,{className:`truncate`,children:n})}),(0,W.jsxs)(`button`,{type:`button`,className:`${qh} ${t?`min-w-6 shrink-0 justify-center`:`-ml-1`}`,"aria-label":t?i:void 0,"aria-expanded":!r,title:i,onClick:e.onToggle,children:[!t&&(0,W.jsx)(`span`,{className:`truncate`,children:n}),e.count!==void 0&&(0,W.jsx)(`span`,{className:`font-normal text-subtle`,children:e.count}),(0,W.jsx)(hs,{right:r,className:Jh(r)})]}),e.onNewTask&&(0,W.jsx)(`button`,{type:`button`,className:Yh,title:H(`rail.newTask`),onClick:e.onNewTask,children:`+`})]})}function vI({client:e,railBar:t}){U(),y(lo);let{stale:n,bridgeVersion:r,daemonVersion:i}=y(aa);if(!n)return null;let a=H(`layout.refreshRove`),o=[H(`layout.refreshVersions`,{bridge:r?`v${r}`:H(`layout.unknownVersion`),daemon:i?`v${i}`:H(`layout.unknownVersion`)}),yo(`app.refresh`)].filter(Boolean).join(` · `),s=(0,W.jsxs)(G,{variant:`pill`,className:`ml-auto min-h-6 min-w-6 justify-center touch:min-h-8 rounded-sm focus-visible:outline-1 focus-visible:outline-focus`,"aria-label":a,title:o,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},onClick:()=>la(e),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 shrink-0 rounded-full bg-warning`}),(0,W.jsx)(`span`,{className:t?`@max-[6.25rem]/refresh:sr-only`:void 0,children:a})]});return t?(0,W.jsx)(`div`,{className:`@container/refresh absolute top-2 right-2.5 left-[calc(5.75rem+var(--shell-inset-left,0px))] flex h-6.5 items-center justify-end @max-[13rem]:right-1`,children:s}):s}function yI(e){let t=J(`doctor`,`fix.humanOnlyWhy`),n=[];if(e.git||n.push({id:`git`,label:J(`doctor`,`fix.git`),action:J(`doctor`,`fix.gitAction`),why:t}),e.engines.length===0){let r=e.signedOut.length>0;n.push({id:`engine`,label:J(`doctor`,r?`fix.noEngineLogin`:`fix.noEngine`),action:J(`doctor`,r?`fix.noEngineLoginAction`:`fix.noEngineAction`,{list:e.signedOut.map(e=>e.id).join(`, `)}),why:t})}return n}function bI({model:e}){U(),y(lo);let[t,n]=(0,m.useState)(()=>X(e,`welcome.env`)??null);(0,m.useEffect)(()=>{let t=!0;return Z(e,`welcome.env`).then(e=>t&&n(e)).catch(()=>{}),()=>{t=!1}},[e]);let r=t===null?null:t.engines.length>0?{key:`enginesFound`,warn:!1,list:t.engines.map(e=>e.name).join(`, `)}:t.signedOut.length>0?{key:`enginesSignedOut`,warn:!0,list:t.signedOut.map(e=>e.name).join(`, `)}:{key:`enginesMissing`,warn:!0,list:``},i=t!==null&&(t.engines.length===0||!t.git)?yI(t):[];return(0,W.jsx)(`div`,{className:ym,"data-field":`welcome`,children:(0,W.jsxs)(`div`,{className:bm,children:[(0,W.jsx)(Hm,{scene:`rings`}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h1`,{className:`m-0 font-sans text-title font-semibold text-ink`,children:H(`firstRun.title`)}),(0,W.jsx)(`p`,{className:`m-0 font-sans text-body text-muted`,children:H(`firstRun.body`)})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`button`,{type:`button`,className:xr(),"data-field":`start-first-task`,onClick:()=>ly(t?.start?.repo),children:H(`firstRun.start`)}),(0,W.jsx)(`span`,{className:`keys-only mono text-meta text-subtle`,children:yo(`task.new.global`)})]}),t!==null&&r!==null&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5 font-sans text-meta`,children:[(0,W.jsx)(`p`,{className:`m-0 ${r.warn?`text-warning`:`text-subtle`}`,children:J(`workspace`,`welcome.${r.key}`,{list:r.list})}),!t.git&&(0,W.jsx)(`p`,{className:`m-0 text-warning`,children:J(`workspace`,`welcome.gitMissing`)}),i.map(e=>(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,W.jsx)(`p`,{className:`m-0 text-warning`,children:e.label}),(0,W.jsx)(`p`,{className:`mono m-0 text-accent`,children:e.action}),(0,W.jsx)(`p`,{className:`m-0 text-muted`,children:e.why})]},e.id)),i.length>0&&(0,W.jsx)(`p`,{className:`m-0 text-muted`,children:J(`common`,`failureHint`,{command:`rove doctor`})})]})]})})}function xI(e,t){e.preventDefault(),D.set({x:e.clientX,y:e.clientY,items:t,target:e.currentTarget,fromKeyboard:e.button!==2})}function SI({model:e,narrow:t}){let n=U(),r=y(e.tasks),i=y(e.remote),a=rg(e),o=y(e.tabs),s=CC(e);gI(e,r?.tasks.length);let c=y(e.selection),l=r?.tasks??[],u=r?.attention.filter(e=>e.unread).length??0,d=c.taskId,f=y(N)===null?d:null,p=new Map([...l,...i].map(e=>[e.id,e])),h=RN(),g=y(Xp),_=y(Vp)===`state`,v=e=>(_?vy:ef)({tasks:l,remote:i,machines:a,sort:h.sort,query:e,fold:{...h.hand,selectedId:d??void 0}}),b=v(h.search.active?h.search.query:``),{groups:x}=b,S=h.search.active?b.rows:nf(tP(yy(b.rows),o),h.collapsed),C=e=>e.filter(e=>e.kind!==`project`&&e.kind!==`state`&&e.kind!==`round`),w=(n===`zh`?Ji:qi).machine,E=new Set(a.filter(e=>e.state!==`online`).map(e=>e.alias)),D=x.filter(e=>!e.noProject&&e.machine===void 0).map(e=>e.repo),k=e=>{let t=D.indexOf(e);return{label:Cd(e),local:t>=0,top:t>0?D[0]??null:null,above:t>0?D[t-1]??null:null,below:t>=0?D[t+1]??null:null}},A=DN(e,l,!h.search.active&&!_,h.sort==="default"),{place:j,dragging:M}=A.places(S),ee=()=>O.set((0,W.jsx)(sE,{model:e})),P=HN(e,S,h,{selectedId:d,onNewTask:ly,onSettings:ee}),F=C(v(``).rows).length,I=(0,m.useRef)(null),te=y(JN)&&!t,ne=y(YN)&&te,L=t?l.find(e=>e.id===c.taskId&&!e.deleting)??null:null;return(0,W.jsxs)(`nav`,{className:`${Lh} ${te?`is-folded`:``}`,ref:I,inert:te&&!ne,"aria-hidden":te&&!ne,onMouseEnter:te?()=>QN(!0):void 0,onMouseLeave:te?()=>QN(!1):void 0,tabIndex:0,onKeyDown:P.onKeyDown,children:[(0,W.jsxs)(`header`,{className:Rh,children:[(0,W.jsxs)(`span`,{className:`${Wn} mr-auto`,children:[(0,W.jsx)(`span`,{className:Gn,children:`[`}),` rove `,(0,W.jsx)(`span`,{className:Gn,children:`]`})]}),(0,W.jsxs)(`span`,{className:`relative`,children:[(0,W.jsx)(`button`,{type:`button`,className:`m-0 text-meta font-medium normal-nums inbox-chip relative ${pi} ${qt} ${u>0?`text-accent`:`text-muted`}`,onClick:()=>O.set((0,W.jsx)(Ep,{model:e})),children:H(`rail.inbox`,{count:u})}),(0,W.jsx)(OE,{model:e,bindingId:`inbox.show`,head:!0})]}),(0,W.jsx)(cC,{}),(0,W.jsx)(vI,{client:e.client,railBar:!t})]}),g&&(0,W.jsxs)(`div`,{className:`flex gap-1 px-3.5 pb-2 text-meta mono`,children:[(0,W.jsx)(`span`,{className:`text-accent`,children:J(`tasks`,`moveChip`).trim()}),(0,W.jsx)(`span`,{className:`keys-only ml-1.5 text-muted`,children:(0,W.jsx)(xp,{text:H(`taskops.moveHint`)})})]}),h.search.active&&(0,W.jsx)(rP,{query:h.search.query,count:`${C(S).length}/${F}`,onChange:e=>h.setSearch(t=>({...t,query:e}))}),(0,W.jsx)(sN,{model:e}),(0,W.jsxs)(`div`,{"data-rail-body":!0,className:Vh(M!==null),...A.body,onPointerDownCapture:P.onPress,children:[r&&l.length===0&&i.length===0&&t&&(0,W.jsx)(bI,{model:e}),r&&l.length===0&&i.length===0&&!t&&(0,W.jsx)(`p`,{className:`m-0 px-2 py-3 font-mono text-meta text-subtle`,children:H(`rail.empty`)}),L&&(0,W.jsx)(GI,{title:L.title}),S.map((t,n)=>t.kind===`round`?(0,W.jsx)(nP,{row:t,guides:t.depth>1?xN(S,n):void 0,repo:_&&t.depth===1?gy(t.tasks[0]):void 0,cursor:t.id===P.cursor,place:j(t),onClick:()=>P.setCursor(t.id)},t.id):t.kind===`pane`?(0,W.jsx)(AN,{selectedTabId:t.task.id===f?c.tabId:null,row:t,guides:xN(S,n),cursor:t.id===P.cursor,place:j(t),onClick:()=>{P.setCursor(t.id),kN(e,t),ge()},onMenu:n=>{P.setCursor(t.id),xI(n,Hj(e,t.task.id,t.tab,t.leaf))}},t.id):(0,W.jsx)(CI,{row:t,guides:t.kind===`task`&&t.depth>1?xN(S,n):void 0,cloud:$h(t,a,w),repo:_&&t.kind===`task`&&t.depth===1?gy(t.task):void 0,tabs:t.kind===`task`?o[t.task.id]:void 0,engineIcon:t.kind===`task`?s.get(t.task.engine?.id??``):void 0,selected:t.id===f,cursor:t.id===P.cursor&&M===null,stale:t.machine!==void 0&&E.has(t.machine),collapsed:(t.kind===`project`||t.kind===`state`)&&h.collapsed.has(t.id),drag:A.props(t),dragging:M===t.id,place:j(t),onNewTask:t.kind===`project`?t.noProject?uy:()=>ly(t.repo,t.machine):void 0,moving:g&&t.machine===void 0&&t.kind!==`project`&&t.id===P.cursor,prTasks:t.kind===`task`?[t.task,...(t.fold?.descendantIds??[]).flatMap(e=>p.get(e)??[])]:void 0,rollup:t.kind===`task`&&t.fold?.collapsed?Rg([t.task,...t.fold.descendantIds.flatMap(e=>p.get(e)??[])]):void 0,onToggleFold:()=>{t.kind===`task`&&h.toggleTaskFold(t.id,t.fold?.collapsed===!0)},onClick:()=>{P.setCursor(t.id),(t.kind===`project`||t.kind===`state`)&&h.toggleProject(t.id),t.kind===`task`&&VN(e,t.task.id)},onMenu:n=>{if(t.kind!==`project`||t.machine===void 0){if(t.kind===`project`&&t.noProject){xI(n,eM(e));return}if(t.kind===`project`){xI(n,$j(e,t.repo,k(t.repo)));return}t.kind===`task`&&(P.setCursor(t.id),xI(n,T(EI(TI(rM(e,t.task,null),t.fold,()=>h.toggleTaskFold(t.id,t.fold?.collapsed===!0)),Gj(e,t.task.id)),H(`menu.more`))))}}},t.id))]}),(0,W.jsx)(ON,{model:e,narrow:t,onSettings:ee}),!t&&!te&&(0,W.jsx)(BI,{rail:I})]})}function CI(e){let{row:t}=e,n=dI(t.kind===`task`?t.task.label:``,e.cursor&&t.kind===`task`),r=e.cursor?Hh:``;if(t.kind===`project`||t.kind===`state`)return(0,W.jsx)(`h2`,{className:Uh({moving:e.moving,dragging:e.dragging,grab:e.drag!==void 0}),onContextMenu:e.onMenu,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},...e.place,...e.drag,children:(0,W.jsx)(_I,{label:t.label,repo:t.kind===`project`&&!t.noProject?t.repo:void 0,count:t.kind===`state`?t.count:void 0,collapsed:!!e.collapsed,onToggle:e.onClick,onNewTask:e.onNewTask})});let i=t.task,a=i.rowStatus?.kind===`running`,o=ib(i),s=TC(),c=s===`engine`,l=t.fold?.collapsed?e.rollup:i.rowStatus;return(0,W.jsxs)(`button`,{type:`button`,ref:n.ref,className:`${gi({selected:e.selected,moving:e.moving,lifted:e.dragging,grab:e.drag!==void 0})} ${r}`,onClick:e.onClick,onContextMenu:e.onMenu,onPointerEnter:n.onPointerEnter,onPointerLeave:n.onPointerLeave,...e.place,...e.drag,children:[e.guides&&(0,W.jsx)(`span`,{className:`-my-0.75 -mr-0.5 ml-0 flex flex-none self-stretch`,"aria-hidden":`true`,children:e.guides.map((e,t)=>(0,W.jsx)(`span`,{className:Mh(e)},t))}),s!==`dots`&&(0,W.jsx)(kC,{icon:e.engineIcon,name:i.engine?.name,status:c?Fg(l):void 0}),(0,W.jsx)(`span`,{className:`${vi} ${e.stale?`text-subtle`:``} ${a?yi:``}`,children:t.attempt??i.label}),(0,W.jsxs)(`span`,{className:`${Si} ml-auto items-center`,children:[(0,W.jsx)(pI,{tokens:i.rowTokens}),e.repo&&(0,W.jsx)(`span`,{className:`max-w-24 truncate text-subtle`,children:e.repo}),t.level!==void 0&&(0,W.jsx)(`span`,{className:`text-subtle`,children:t.level}),(i.extraRepoCount??0)>0&&(0,W.jsxs)(`span`,{className:`text-subtle`,title:H(`rail.extraRepos`,{count:i.extraRepoCount??0}),children:[`+`,i.extraRepoCount]}),o&&(0,W.jsxs)(`span`,{className:`text-subtle tabular-nums`,title:H(`rail.todos`,o),children:[o.done,`/`,o.total]}),t.fold?.collapsed&&(0,W.jsx)(wI,{count:t.fold.count,onUnfold:e.onToggleFold}),i.kept&&(0,W.jsx)(`span`,{className:`text-accent`,title:H(`compare.kept`),children:`✓`}),i.pinned&&(0,W.jsx)(`span`,{className:`text-subtle`,children:`▴`}),i.startsAt&&(0,W.jsx)(mI,{at:i.startsAt}),(0,W.jsx)(mN,{tasks:e.prTasks??[i],onOpen:n.hide}),e.cloud&&(0,W.jsx)(tg,{label:e.cloud}),!c&&(0,W.jsx)(Xg,{status:l})]})]})}function wI(e){let t=J(`tasks`,`menu.expandChildren`);return(0,W.jsxs)(`span`,{role:`button`,tabIndex:-1,"aria-label":t,"aria-expanded":!1,className:`chip text-muted ${Nh}`,title:t,onClick:t=>{t.stopPropagation(),e.onUnfold()},children:[e.count,(0,W.jsx)(hs,{right:!0})]})}function TI(e,t,n){if(!t)return e;let r={label:J(`tasks`,t.collapsed?`menu.expandChildren`:`menu.collapseChildren`),section:`open`,rare:!0,run:n},i=e.map(e=>e.section).lastIndexOf(`open`);return[...e.slice(0,i+1),r,...e.slice(i+1)]}function EI(e,t){let n=e.map(e=>e.section).lastIndexOf(`open`);return[...e.slice(0,n+1),...t.map(e=>({...e,rare:!0})),...e.slice(n+1)]}function DI({children:e}){return(0,W.jsx)(`svg`,{className:`size-3.5 ${Yn}`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:e})}var OI={chat:(0,W.jsx)(`path`,{d:`M3 3.5h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H8l-3 2.5v-2.5H3a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1zM5 6.5h6M5 8.5h4`}),files:(0,W.jsx)(`path`,{d:`M2 4.5a1 1 0 0 1 1-1h3l1.5 1.5H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z`}),diff:(0,W.jsx)(`path`,{d:`M3.5 2.5h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM8 5v4M6 7h4M6 11h4`}),browser:(0,W.jsx)(`path`,{d:`M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2zM2 8h12M8 2c2.2 2 2.2 10 0 12M8 2c-2.2 2-2.2 10 0 12`}),quota:(0,W.jsx)(`path`,{d:`M2 10a6 6 0 1 1 12 0M8 10l2.5-3.5M4 13h8`})};function kI(e){let t=Ms(e);return t?Ns(t):H(`panel.browser`)}var AI=7.3,jI=22,MI=160,NI=2,PI=24;function FI(e,t){let n=0;for(let t of e){let e=0;for(let n of t)e+=(n.codePointAt(0)??0)>11903?2:1;n+=Math.min(MI,jI+e*AI)+NI}return n<=t}function II(e,t,n){let r=[{label:H(`panel.close`),section:`close`,run:()=>rl(e,n.id)}];return t.tabs.length>1&&r.push({label:H(`panel.closeOthers`),section:`close`,run:()=>nl(e,e=>Ks(e,n.id))}),r}function LI({taskId:e,column:t}){U();let n=(0,m.useRef)(null),r=(0,m.useRef)(null),[i,a]=(0,m.useState)(0);(0,m.useEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(([e])=>a(e?.contentRect.width??0));return t.observe(e),()=>t.disconnect()},[]);let o=i>0&&!FI(t.tabs.map(kI),i-PI);return(0,m.useEffect)(()=>{r.current?.querySelector(`.is-active`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[t.active,t.tabs.length,o]),(0,W.jsxs)(`div`,{className:ir,ref:n,children:[(0,W.jsx)(`div`,{className:ar,role:`tablist`,"aria-label":H(`panel.tabs`),ref:r,children:t.tabs.map(n=>{let r=n.id===t.active;return(0,W.jsxs)(`div`,{role:`presentation`,className:or({active:r,compact:o}),onMouseDown:e=>{e.button===1&&e.preventDefault()},onAuxClick:t=>{t.button===1&&(t.preventDefault(),rl(e,n.id))},onContextMenu:r=>xI(r,II(e,t,n)),children:[(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,className:sr(r),title:Ms(n)||kI(n),onClick:()=>nl(e,e=>Fs(e,n.id)),children:(0,W.jsx)(`span`,{className:cr,children:kI(n)})}),(0,W.jsx)(`button`,{type:`button`,className:lr(r),"aria-label":H(`panel.close`),tabIndex:-1,onClick:()=>rl(e,n.id),children:`×`})]},n.id)})}),(0,W.jsx)(`button`,{type:`button`,className:Xn({tool:!0}),title:H(`panel.new`),"aria-label":H(`panel.new`),onClick:()=>nl(e,Rs),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M8 3.5v9M3.5 8h9`})})})]})}function RI({edge:e,className:t,...n}){return(0,W.jsx)(`div`,{"data-grip":``,className:Rt(`absolute inset-y-0 z-5 w-1.5 cursor-col-resize touch-none`,`after:absolute after:inset-y-0 after:w-0.5 after:bg-line-active after:opacity-0 after:transition-opacity after:duration-120`,`hover:after:opacity-100 hover:after:delay-250 active:after:bg-accent active:after:opacity-100 active:after:delay-0`,e===`right`?`right-0 after:right-0`:`left-0 after:left-0`,t),...n})}var zI=400;function BI({rail:e}){U();let t=(0,m.useRef)(null),n=(0,m.useRef)(0),r=(0,m.useRef)(null);return(0,W.jsx)(RI,{edge:`right`,title:H(`layout.railResize`),onPointerDown:n=>{t.current={x:n.clientX,width:e.current?.getBoundingClientRect().width??0,moved:!1},n.currentTarget.setPointerCapture(n.pointerId),pe(!0)},onPointerMove:e=>{let n=t.current;!n||e.clientX===n.x||(n.moved=!0,qN.set($N(n.width+e.clientX-n.x)))},onPointerUp:()=>{let e=t.current;if(t.current=null,!e)return;if(e.moved){n.current=0;return}let i=Date.now();r.current!==null&&window.clearTimeout(r.current),r.current=null,i-n.current<zI?(n.current=0,qN.set(null)):(n.current=i,r.current=window.setTimeout(()=>JN.set(!0),zI))},onLostPointerCapture:()=>pe(!1)})}function VI({side:e}){return(0,W.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2.5`}),(0,W.jsx)(`path`,{d:e===`left`?`M6 2.5v11`:`M10 2.5v11`})]})}function HI({model:e}){U();let t=y(RE),n=y(JN),r=y(e.tasks),i=t=>BE(e,t),a=H(n?`layout.railUnfold`:`layout.railFold`),o=n&&(r?.tasks??[]).some(Ig);return NE(n,o,LE(t,-1,i)>=0,LE(t,1,i)>=0,t=>UE(e,t<0?-1:1),()=>JN.set(!n)),jE?null:(0,W.jsxs)(`div`,{className:Zn,onMouseEnter:()=>n&&YN.get()&&QN(!0),onMouseLeave:()=>n&&YN.get()&&QN(!1),children:[(0,W.jsxs)(`button`,{type:`button`,className:Xn(),title:a,"aria-label":a,onClick:()=>JN.set(!n),children:[(0,W.jsx)(VI,{side:`left`}),o&&(0,W.jsx)(`span`,{className:`absolute top-0.75 right-0.75 size-1.5 rounded-full bg-accent`})]}),(0,W.jsx)(`button`,{type:`button`,className:Xn(),title:H(`layout.navBack`),"aria-label":H(`layout.navBack`),disabled:LE(t,-1,i)<0,onClick:()=>UE(e,-1),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M10 3.5 5.5 8l4.5 4.5`})})}),(0,W.jsx)(`button`,{type:`button`,className:Xn(),title:H(`layout.navForward`),"aria-label":H(`layout.navForward`),disabled:LE(t,1,i)<0,onClick:()=>UE(e,1),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`})})})]})}var UI=(0,W.jsx)(`path`,{d:`M3 3.5h10a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1zM4.5 6.5 6.5 8l-2 1.5M8 10h3`});function WI({client:e,taskId:t,title:n}){U();let r=y(hc);return(0,W.jsxs)(`div`,{className:Jt,children:[(0,W.jsxs)(`button`,{type:`button`,className:`mono ${Yt}`,"aria-label":Il(`narrowBack`),onClick:_e,children:[(0,W.jsx)(`span`,{className:`flex-none text-accent`,children:n?`‹`:`‹ ${Il(`narrowBack`)}`}),n&&(0,W.jsx)(`span`,{className:`truncate font-sans text-body font-normal text-ink`,children:n})]}),t&&(0,W.jsx)(`span`,{className:`mono ml-auto flex flex-none gap-0.5`,role:`tablist`,children:[`terminal`,...mc].map(e=>{let n=H(e===`terminal`?`layout.narrowTerminal`:`panel.${e}`);return(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r===e,"aria-label":n,title:n,className:Xt,onClick:()=>e===`terminal`?hc.set(e):Yc(t,e),children:(0,W.jsx)(DI,{children:e===`terminal`?UI:OI[e]})},e)})}),(0,W.jsx)(vI,{client:e})]})}function GI({title:e}){return U(),(0,W.jsxs)(`button`,{type:`button`,className:gi({}),onClick:ge,children:[(0,W.jsx)(`span`,{className:`${bi} font-bold text-accent`,children:`↩`}),(0,W.jsx)(`span`,{className:_i,children:Ll(`recentJump`,{title:e})})]})}function KI(e,t,n){let r=n.width/t.width,i=n.height/t.height,a=Math.min(n.width,Math.max(0,Math.round(e.left*r))),o=Math.min(n.height,Math.max(0,Math.round(e.top*i)));return{x:a,y:o,width:Math.min(n.width-a,Math.round(e.width*r)),height:Math.min(n.height-o,Math.round(e.height*i))}}function qI(e,t,n){let r={left:0,top:0,width:n.innerWidth,height:n.innerHeight},i={left:(n.outerWidth-n.innerWidth)/2,top:n.outerHeight-n.innerHeight},a={...i,width:n.outerWidth,height:n.outerHeight},o={left:n.screenX+i.left,top:n.screenY+i.top,...n.screen},s={browser:r,window:a,monitor:o}[e??``];if(s)return s;let c=e=>Math.abs(e.width/e.height-t.width/t.height);return[r,a,o].reduce((e,t)=>c(t)<c(e)?t:e)}function JI(){return typeof navigator.mediaDevices?.getDisplayMedia==`function`}async function YI(e,t){let n=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:`browser`},preferCurrentTab:!0,selfBrowserSurface:`include`});try{let r=document.createElement(`video`);r.muted=!0,r.srcObject=n,await r.play();let i={width:r.videoWidth,height:r.videoHeight},a=e.getBoundingClientRect(),o=qI(n.getVideoTracks()[0]?.getSettings().displaySurface,i,window),s=KI({left:a.left+o.left,top:a.top+o.top,width:a.width,height:a.height},o,i),c=document.createElement(`canvas`);c.width=s.width,c.height=s.height,c.getContext(`2d`)?.drawImage(r,s.x,s.y,s.width,s.height,0,0,s.width,s.height);let l=await new Promise(e=>c.toBlob(e,`image/png`));if(!l)throw Error(`empty capture`);return new File([l],t,{type:`image/png`})}finally{for(let e of n.getTracks())e.stop()}}var XI=new Set,ZI=2e3;function QI(e){XI.add(e)}function $I(e,t=ZI){setTimeout(()=>XI.delete(e),t)}var eL=e=>XI.has(e),tL={background:`#141413`,foreground:`#eae7df`,cursor:`#cc785c`,cursorAccent:`#141413`,selectionBackground:`#33312e`,black:`#141413`,red:`#ec6f74`,green:`#9aca86`,yellow:`#e8c96b`,blue:`#61aaf2`,magenta:`#9b87f5`,cyan:`#d4967e`,white:`#a9a39a`,brightBlack:`#6b665f`,brightRed:`#ec6f74`,brightGreen:`#9aca86`,brightYellow:`#e8c96b`,brightBlue:`#61aaf2`,brightMagenta:`#9b87f5`,brightCyan:`#e0ab96`,brightWhite:`#eae7df`},nL=`Rove Nerd Symbols`,rL=[`"JetBrains Mono"`,`"${nL}"`,`"SF Mono"`,`ui-monospace`,`Menlo`,`monospace`].join(`, `);function iL(e){switch(e.kind){case`restored`:return H(`workspace.restored`);case`notLive`:return H(`workspace.tabNotLive`);case`exited`:return H(`workspace.exited`,{code:e.code??`?`});case`failed`:return H(`workspace.attachFailed`,{message:e.message});case`none`:return``}}function aL(e){U();let{notice:t,engineExit:n,model:r,taskId:i,tabId:a,revive:o}=e,s=t.kind===`none`?n:null,c=t.kind===`none`&&!s&&e.usageLimit===!0&&!o.error,[l,u]=(0,m.useState)(!1);if(t.kind===`none`&&!s&&!c)return null;let d=c?r.tasks.get()?.attention.find(e=>e.taskId===i&&e.state===`rate_limited`)?.resumeAt:void 0,f=t.kind===`notLive`||t.kind===`restored`||t.kind===`exited`,p=t.kind===`exited`||s!==null,h=o.error?H(`workspace.reopenFailed`,{message:o.error}):s?H(`workspace.engineExited`,{code:s.code??`?`}):c?d?H(`workspace.usageLimitUntil`,{time:new Date(d).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}):H(`workspace.usageLimit`):iL(t);return(0,W.jsxs)(`div`,{className:In(t.kind===`failed`||!!o.error),children:[(0,W.jsx)(`span`,{children:h}),e.onReopen&&(f||s)&&(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,disabled:o.busy,onClick:()=>e.onReopen?.(s!==null),children:o.busy?H(`workspace.reopening`):H(s?`workspace.retry`:`workspace.reopen`)}),t.kind===`failed`&&e.onRetryAttach&&(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:e.onRetryAttach,children:H(`workspace.retry`)}),c&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(G,{variant:`link`,hit:`tight`,onClick:()=>O.set((0,W.jsx)(xd,{model:r,taskId:i,context:`continue`,sourceTabId:a})),children:H(`menu.continueEngine`)}),(0,W.jsx)(G,{variant:`link`,hit:`tight`,disabled:l,onClick:()=>{u(!0),r.client.request(`task.resumeQuota`,{taskId:i}).catch(e=>z(e instanceof Error?e.message:String(e),`error`)).finally(()=>u(!1))},children:H(l?`workspace.resumingQuota`:`workspace.resumeQuota`)}),(0,W.jsx)(G,{variant:`link`,hit:`tight`,onClick:e.onDismissLimit,children:H(`workspace.dismiss`)})]}),p&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>O.set((0,W.jsx)(sE,{model:r,section:`engines`})),children:H(`workspace.engineSettings`)}),(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>O.set((0,W.jsx)(xd,{model:r,taskId:i})),children:H(`menu.newChatPick`)}),(0,W.jsx)(G,{variant:`link`,hit:`tight`,onClick:()=>O.set((0,W.jsx)(xd,{model:r,taskId:i,context:`continue`,sourceTabId:a})),children:H(`menu.continueEngine`)})]})]})}var oL=/\x1b\[\?[0-9;]*c|\x1b\[\??[0-9;]*\$y|\x1b\](?:10|11);[^\x07\x1b]*(?:\x07|\x1b\\)/g,sL=/\x1b\[[?>=]?[0-9;]*(?:[cnRt]|\$y)|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1bP[^\x1b]*\x1b\\/g;function cL(e){let t=0;return{forward(n){let r=(t>0?n.replace(sL,``):n).replace(oL,``);r&&e(r)},replay(e){t++,e(()=>{t--})}}}function lL(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function uL(e){return!e||typeof e!=`object`||!(`stream`in e)||typeof e.stream!=`string`?null:{stream:e.stream,...`data`in e&&typeof e.data==`string`?{data:e.data}:{},...`code`in e&&(typeof e.code==`number`||e.code===null)?{code:e.code}:{}}}var dL=65536,fL=20;function pL(e){let t=0,n=null,r=()=>{n!==null&&window.clearTimeout(n),n=null,t>0&&e(t),t=0};return{parsed(e){t+=e,t>=dL?r():n??=window.setTimeout(r,fL)},dispose(){n!==null&&window.clearTimeout(n),n=null,t=0}}}function mL(e){return!e||typeof e!=`object`||!(`stream`in e)||!(`replay`in e)?null:typeof e.stream==`string`&&typeof e.replay==`string`?{stream:e.stream,replay:e.replay}:null}function hL(e,t,n,r,i,a){let o=id(t,n,r);O.set((0,W.jsx)(q,{title:Ml(`reset.title`),body:Ml(`reset.body`),confirmLabel:H(`workspace.reset`),onConfirm:async()=>{QI(o);try{await e.request(`tab.split`,{taskId:t,tabId:n,action:`reset`,leafId:r??`leaf-1`,...i}),await a()}finally{$I(o)}}}))}function gL(e,t){let n=``,r=0,i=()=>{r=0;let i=e.getBoundingClientRect(),a=i.width>1&&i.height>1&&[[.02,.03],[.5,.5],[.98,.97],[.02,.97],[.98,.03]].every(([t,n])=>e.contains(document.elementFromPoint(i.x+i.width*t,i.y+i.height*n)))&&!document.querySelector(`[role="menu"], [aria-modal="true"], .overlay`),o=[i.x,i.y,i.width,i.height,a].join(`,`);o!==n&&(n=o,t(i,a))},a=()=>{document.hidden?i():r||=requestAnimationFrame(i)},o=new ResizeObserver(a);o.observe(e);let s=new MutationObserver(a);return s.observe(document.body,{childList:!0,attributes:!0,subtree:!0}),window.addEventListener(`resize`,a),window.addEventListener(`scroll`,a,!0),document.addEventListener(`transitionend`,a),document.addEventListener(`visibilitychange`,a),i(),()=>{o.disconnect(),s.disconnect(),cancelAnimationFrame(r),window.removeEventListener(`resize`,a),window.removeEventListener(`scroll`,a,!0),document.removeEventListener(`transitionend`,a),document.removeEventListener(`visibilitychange`,a)}}function _L(e){let{client:t,taskId:n,tabId:r,leafId:i}=e,a=(0,m.useRef)(null),o=(0,m.useRef)(e);o.current=e;let[s,c]=(0,m.useState)({kind:`none`}),[l,u]=(0,m.useState)(0),[d,f]=(0,m.useState)(!1),p=id(n,r,i);return(0,m.useEffect)(()=>{if(!a.current||!jE)return;let e=a.current,s=String(l)+crypto.randomUUID(),u=(e,t={})=>jE?.postMessage({id:s,op:e,...t}),d=(e,n)=>void t.request(e,n).catch(()=>{}),f=!1,m=0,h=!1,g=0,_=0,v=null,y=pL(e=>{h&&d(`term.ack`,{stream:p,chars:e})}),b=async()=>{if(!f||!g||!_)return;let e={cols:g,rows:_},a=++m;h=!1,v=[];try{let o=await t.request(`term.attach`,{taskId:n,tabId:r,...i&&i!==`leaf-1`?{leafId:i}:{},...e,acks:!0});if(m!==a)return;h=o.alive,h&&(g!==e.cols||_!==e.rows)&&d(`term.resize`,{stream:p,cols:g,rows:_}),u(`replay`,{data:o.replay});for(let e of v??[])u(`data`,{data:e});v=null,c(o.alive?{kind:`none`}:{kind:o.restored?`restored`:`notLive`})}catch(e){m===a&&(v=null,c({kind:`failed`,message:String(e)}))}},x=!1,S=e=>{h&&d(`term.input`,{stream:p,data:e})},C=cL(S),w={stream:p,input:S,focus:()=>u(`focus`),size:()=>({cols:g,rows:_}),reattach:b,scrollPages:e=>u(`scroll`,{direction:e}),hasSelection:()=>x,copySelection:()=>(x&&u(`copy`),x),reset:()=>hL(t,n,r,i,{cols:g,rows:_},async()=>{await b(),u(`focus`)})},T=Fo(w),E=ME(e=>{if(e.id===s&&((e.action===`input`||e.action===`reply`)&&e.data&&C.forward(e.data),e.action===`selection`&&(x=e.selected===!0),e.action===`blur`&&Po.get()===w&&Po.set(null),e.action===`parsed`&&e.chars&&y.parsed(e.chars),e.action===`focus`&&(Po.set(w),o.current.onActivate?.()),e.action===`size`&&e.cols&&e.rows)){let t=!g;g=e.cols,_=e.rows,t?b():h&&d(`term.resize`,{stream:p,cols:g,rows:_})}}),D=[t.on(`term.data`,e=>{let t=uL(e);t?.stream!==p||!t.data||(v?v.push(t.data):h&&u(`data`,{data:t.data}))}),t.on(`term.reset`,e=>{let t=mL(e);h&&t?.stream===p&&u(`reset`,{data:t.replay})}),t.on(`term.exit`,e=>{let t=uL(e);t?.stream===p&&(h=!1,++m,v=null,c({kind:`exited`,code:t.code??null}),eL(p)||o.current.onExit?.())}),t.conn.subscribe(()=>{t.conn.get().state!==`open`&&(f=!1,h=!1,v=null,++m)}),t.onOpen(()=>{f=!0,b()})],O=()=>{let e=GC.get()??tL,t=getComputedStyle(document.documentElement);return{dark:t.colorScheme!==`light`,subtle:t.getPropertyValue(`--subtle`).trim(),muted:t.getPropertyValue(`--muted`).trim(),foreground:e.foreground,background:e.background,scrollback:Ap.get().prefs.scrollbackRows}},k=()=>u(`appearance`,O());D.push(GC.subscribe(k),Ap.subscribe(k));let A=gL(e,(e,t)=>u(`frame`,{x:e.x,y:e.y,width:e.width,height:e.height,visible:t,focus:o.current.focused!==!1,...O()}));return()=>{++m,h=!1;for(let e of D)e();T(),E(),y.dispose(),A(),u(`remove`),f&&g&&d(`term.detach`,{stream:p}),f=!1}},[t,n,r,i,p,l]),(0,W.jsx)(`div`,{className:An,"data-stream":p,children:(0,W.jsxs)(`div`,{className:jn,children:[(0,W.jsx)(`div`,{className:Mn,ref:a,"data-native-terminal":``}),(0,W.jsx)(aL,{model:e.model,taskId:n,tabId:r,notice:s,engineExit:e.engineExit??null,revive:{busy:d,error:null},onRetryAttach:()=>u(e=>e+1),onReopen:async e=>{f(!0);try{await t.request(`term.revive`,{taskId:n,tabId:r,...e?{restartExited:e}:{}}),u(e=>e+1)}catch(e){c({kind:`failed`,message:String(e)})}finally{f(!1)}}})]})})}var vL=new Map,yL=new Set,bL=(e,t)=>`${e}/${t}`,xL=e=>vL.get(e)??``;function SL(e,t){t===``?vL.delete(e):vL.set(e,t);for(let e of yL)e()}function CL(e){return yL.add(e),()=>yL.delete(e)}function wL(e,t){let n=xL(e).trimEnd();SL(e,n===``?t:`${n}\n\n${t}`)}function TL(e,t,n,r,i,a){let o=n.length-t.length;return{base:n,spans:[...e?.base===t?e.spans.filter(([e,t])=>t<=r||e>=i).map(([e,t])=>e>=i?[e+o,t+o]:[e,t]):[],a]}}async function EL(e,t,n){if(n===t.base)return;let r;try{r=(await e.request(`voice.learn`,{base:t.base,spans:t.spans,sent:n})).learned??[]}catch{return}r.length!==0&&z(H(`voice.learned`,{pairs:r.map(e=>H(`voice.learnedPair`,{spoken:e.spoken,term:e.term})).join(`, `)}),`info`,{label:H(`voice.undo`),run:()=>void e.request(`voice.unlearn`,{learned:r}).then(()=>z(H(`voice.unlearned`)),()=>z(H(`voice.unlearnFailed`),`error`))})}function DL({model:e,taskId:t,tabId:n}){let r=y(e.tasks)?.tasks.find(e=>e.id===t)!==void 0,i=bL(t,n),a=(0,m.useSyncExternalStore)(CL,()=>xL(i)),[o,s]=(0,m.useState)(!1),{attachments:c,attach:l,remove:u,ready:d,clear:f}=vu(e,e=>z(e,`error`),void 0,t),p=(0,m.useRef)(null),h=oy(e.client),[g,_]=(0,m.useState)(!1),v=cv({value:a,onChange:e=>SL(i,e),area:p,listClassName:`m-0`}),b=(0,m.useRef)(null),x=e=>{let t=p.current,n=t?.selectionStart??a.length,r=t?.selectionEnd??a.length,o=n>0&&!/\s$/.test(a.slice(0,n))?` `:``,s=`${a.slice(0,n)}${o}${e}${a.slice(r)}`;SL(i,s);let c=n+o.length+e.length;b.current=TL(b.current,a,s,n,r,[n+o.length,c]),requestAnimationFrame(()=>t?.setSelectionRange(c,c))},S=async e=>{let t=a.trim()?`${a.trimEnd()} ${e}`:e;await w(t)||SL(i,t)},C=e=>void S(e),w=async(r=a)=>{s(!0);try{let a=pu(r.trim(),await d()).trim();if(!a)return!1;let o=await e.client.request(`tab.send`,{taskId:t,tabId:n,prompt:a});return o.delivered?(SL(i,``),f(),_(!1),b.current&&EL(e.client,b.current,r),b.current=null,!0):(z(H(`layout.composerNotSent`,{reason:o.reason??``}),`error`),!1)}catch(e){let t=e instanceof Go?e.code:void 0;return z(t===`UNKNOWN_OP`?H(`layout.composerOldBridge`):t===`AWAITING_PERMISSION`?H(`layout.composerAtMenu`):e instanceof Error?e.message:String(e),`error`),!1}finally{s(!1)}};if(!r)return null;let T=l,E={client:e.client,context:()=>({draft:a,taskId:t,tabId:n}),onText:e=>void x(e),disabled:o},D=h===!0&&!g&&a===``,O=()=>{(0,lN.flushSync)(()=>_(!0)),p.current?.focus()};return(0,W.jsx)(Rv,{value:a,placeholder:H(`layout.composerPlaceholder`),sendLabel:H(`layout.composerSend`),busy:o,ready:a.trim()!==``||c.length>0,attached:(0,W.jsx)(yu,{attachments:c,onRemove:u}),attach:(0,W.jsxs)(du,{className:bv(),title:H(`layout.composerAttach`),disabled:o,onFiles:T,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:H(`layout.composerAttach`)}),(0,W.jsx)(Ev,{})]}),dictate:(0,W.jsx)(cy,{...E,look:xv,face:e=>(0,W.jsx)(Iv,{state:e})}),voice:D?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(cy,{...E,onSend:C,look:Sv,onTap:O,idle:H(`voice.holdOrType`),face:e=>(0,W.jsx)(Fv,{state:e,idle:H(`voice.holdOrType`),working:H(`voice.working`),slide:H(`voice.slideToSend`),release:H(`voice.tipSend`)})}),(0,W.jsx)(Dv,{label:H(`layout.composerSend`),disabled:o||c.length===0})]}):void 0,composerKey:i,fieldRef:p,suggest:v.list,...v.field,onPaste:uu(T).onPaste,onBlur:()=>a===``&&_(!1),onSend:()=>void w()})}var OL={up:`layout.termKeyUp`,down:`layout.termKeyDown`,left:`layout.termKeyLeft`,right:`layout.termKeyRight`,interrupt:`layout.termKeyInterrupt`,enter:`layout.termKeyEnter`};function kL({handle:e,atMenu:t}){U();let[n,r]=(0,m.useState)(!1);(0,m.useEffect)(()=>{e.armCtrl(n?()=>r(!1):null)},[e,n]),(0,m.useEffect)(()=>()=>e.armCtrl(null),[e]);let{term:i}=e,a=e=>(0,W.jsx)(`button`,{type:`button`,className:an(!1),"aria-label":OL[e.id]?H(OL[e.id]):void 0,onClick:()=>{r(!1),i.input(e.bytes(i.modes.applicationCursorKeysMode),!0)},children:e.cap},e.id);return(0,W.jsxs)(`div`,{className:`mono ${rn}`,role:`toolbar`,"aria-label":H(`layout.termKeys`),onPointerDown:e=>e.preventDefault(),children:[t&&fp.map(a),(0,W.jsx)(`button`,{type:`button`,className:an(n),"aria-pressed":n,onClick:()=>r(!n),children:`ctrl`}),up.filter(e=>!(t&&fp.includes(e))).map(a)]})}function AL(e){let t=e.split(`
|
|
63
|
-
`).map(e=>e.trimEnd());for(;t[0]===``;)t.shift();for(;t.at(-1)===``;)t.pop();if(t.length===0)return null;let n=Math.max(0,...Array.from(t.join(`
|
|
64
|
-
`).matchAll(/`+/g),e=>e[0].length)),r="`".repeat(Math.max(3,n+1));return`${r}\n${t.join(`
|
|
65
|
-
`)}\n${r}\n`}function jL(e){let t=document.querySelector(`[data-composer="${CSS.escape(e)}"]`);return t&&t.offsetParent!==null?t:null}function ML(e,t,n,r){let i=AL(e.term.getSelection());if(i===null)return!1;let a=bL(t,n),o=jL(a);if(o){wL(a,i),e.term.clearSelection();let t=o.querySelector(`textarea`);return t?.focus(),t?.setSelectionRange(t.value.length,t.value.length),!0}return r?(z(H(`quote.atMenu`),`error`),!1):e.term.modes.bracketedPasteMode?(e.term.paste(i),e.term.clearSelection(),e.term.focus(),!0):(z(H(`quote.notReady`),`error`),!1)}async function NL(e,t,n){for(let r of n){r.size>1048576&&z(H(`layout.dropUploading`,{name:r.name}));try{t.term.paste(`${await iu(e,r,t.stream.split(`::`)[0])} `)}catch(e){z(e instanceof Error?e.message:String(e),`error`)}}t.term.focus()}async function PL(){if(!navigator.clipboard?.read)throw Error(H(`layout.pasteNeedsHttps`));let e=[];for(let t of await navigator.clipboard.read())for(let n of t.types)(n.startsWith(`image/`)||n===`application/pdf`)&&e.push(new File([await t.getType(n)],`clipboard`,{type:n}));return e}async function FL(e,t){let n;try{n=await PL()}catch(e){z(H(`layout.pasteNoAccess`,{error:e instanceof Error?e.message:String(e)}),`error`);return}n.length===0?z(H(`layout.pasteNoImage`),`error`):await NL(e,t,n)}async function IL(e){try{return await navigator.clipboard.writeText(e),!0}catch{return z(H(`menu.copyFailed`),`error`),!1}}function LL(e){return jE?(0,W.jsx)(_L,{...e}):(0,W.jsx)(RL,{...e})}function RL(e){let{client:t,taskId:n,tabId:r,leafId:i}=e,a=y(e.model.tasks)?.tasks.find(e=>e.id===n)?.tabStatus?.[r]?.kind===`needs-input`;U();let o=(0,m.useRef)(null),[s,c]=(0,m.useState)({kind:`none`}),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(0),[p,h]=(0,m.useState)({busy:!1,error:null}),g=(0,m.useRef)(e);g.current=e,oy(t);let _=e.composer===!0&&sy(t),v=(0,m.useRef)(_);v.current=_,(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let a=null,s=!1,l=[document.fonts.load(`13px "JetBrains Mono"`),document.fonts.load(`bold 13px "JetBrains Mono"`)];document.fonts.load(`13px "${nL}"`,String.fromCodePoint(57504)).catch(()=>{});let d=()=>{s||$f({client:t,host:e,taskId:n,tabId:r,leafId:i,focusOnMount:g.current.focused!==!1&&!v.current},{setNotice:c,onScrolled:f,onFocusChange:e=>{if(!a)return;let{stream:t}=a.handle;e?(g.current.onActivate?.(),Po.set(Io(t)??null)):Po.get()?.stream===t&&Po.set(null)},onExit:()=>{eL(id(n,r,i))||g.current.onExit?.()},copyText:IL,pasteImage:async()=>{a&&await FL(t,a.handle)}}).then(e=>{s?e.release():(a=e,u(e.handle))})};return Qf(t,n,r,i)?d():Promise.allSettled(l).then(d),()=>{s=!0,u(null),a?.release()}},[t,n,r,i]);let[b,x]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(!l)return;x(l.term.hasSelection());let e=l.term.onSelectionChange(()=>x(l.term.hasSelection()));return()=>{e.dispose(),x(!1)}},[l]),(0,m.useEffect)(()=>{if(!l)return;let{term:e,stream:a}=l,o={stream:a,focus:()=>e.focus(),input:t=>e.input(t,!0),reattach:()=>l.reattach(),scrollPages:e=>l.scrollLines(e*10),hasSelection:()=>e.hasSelection(),copySelection:()=>{let t=e.getSelection();return t.trim().length!==0&&(IL(t),e.clearSelection(),!0)},reset:()=>hL(t,n,r,i,{cols:e.cols,rows:e.rows},async()=>{await l.reattach(),e.focus()}),size:()=>({cols:e.cols,rows:e.rows})},s=Fo(o);return document.activeElement===e.textarea&&Po.set(o),()=>{s()}},[l,t,n,r,i]),(0,m.useEffect)(()=>{e.focused&&!_&&l&&document.activeElement!==l.term.textarea&&l.term.focus()},[e.focused,_,l]);let S=!i||i===`leaf-1`,[C,w]=(0,m.useState)(null),T=e.engineExit?.since===C,[E,D]=(0,m.useState)(null),O=e.usageLimit&&e.usageLimit.since!==E?e.usageLimit:null,k=(0,m.useRef)(!1),A=async(i,a)=>{if(!k.current){k.current=!0,h({busy:!0,error:null});try{await t.request(`term.revive`,{taskId:n,tabId:r,...a?{restartExited:a}:{}}),await i.reattach(),i.term.focus(),w(e.engineExit?.since??null),h({busy:!1,error:null})}catch(e){h({busy:!1,error:e instanceof Error?e.message:String(e)})}finally{k.current=!1}}};return(0,W.jsxs)(`div`,{className:An,"data-stream":id(n,r,i),onDragOver:e=>e.dataTransfer.types.includes(`Files`)&&e.preventDefault(),onDrop:e=>{!e.dataTransfer.files.length||!l||(e.preventDefault(),NL(t,l,Array.from(e.dataTransfer.files)))},onPasteCapture:e=>{if(!l)return;let n=Array.from(e.clipboardData.files);(n.length!==0||e.clipboardData.getData(`text/plain`)===``)&&(e.preventDefault(),e.stopPropagation(),n.length>0?NL(t,l,n):FL(t,l))},children:[(0,W.jsxs)(`div`,{className:jn,children:[(0,W.jsx)(`div`,{className:Mn,ref:o}),(0,W.jsx)(aL,{notice:s,engineExit:T?null:e.engineExit??null,model:e.model,taskId:n,tabId:r,revive:p,onReopen:S&&l?e=>void A(l,e):void 0,onRetryAttach:l?()=>void l.reattach():void 0,usageLimit:O!==null,onDismissLimit:O?()=>D(O.since):void 0}),b&&e.composer&&l&&(0,W.jsx)(G,{variant:`floating`,className:`absolute top-2.5 right-2.5 z-4`,title:H(`quote.title`),onClick:()=>ML(l,n,r,a),children:H(`quote.action`)}),d>0&&l&&(0,W.jsxs)(`div`,{className:`mono absolute right-2.5 bottom-2.5 z-4 flex gap-3 rounded-sm border-hairline border-line bg-inset px-2.5 py-1 text-meta`,children:[(0,W.jsx)(`span`,{className:`text-warning`,children:Ml(`scrolledBack`,{lines:d})}),(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>l.scrollToTop(),children:Ml(`scrollFirst`)}),(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>l.scrollToBottom(),children:Ml(`scrollLatest`)})]})]}),e.composer&&(0,W.jsx)(DL,{model:e.model,taskId:n,tabId:r}),l&&(0,W.jsx)(kL,{handle:l,atMenu:a})]})}var zL=[{tool:`pen`,d:`M3 13l.6-2.6L10.9 3.1l2 2L5.6 12.4zM9.6 4.4l2 2`},{tool:`box`,d:`M3 4h10v8H3z`},{tool:`text`,d:`M4 4h8M8 4v8.5`}];function BL({mark:e}){return e.kind===`pen`?(0,W.jsx)(`path`,{d:e.d}):e.kind===`box`?(0,W.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:2}):(0,W.jsx)(`text`,{x:e.x,y:e.y,className:`fill-accent stroke-none font-mono text-body font-semibold`,children:e.text})}function VL({model:e,taskId:t,url:n,target:r,onClose:i}){let[a,o]=(0,m.useState)(`pen`),[s,c]=(0,m.useState)([]),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(null),[p,h]=(0,m.useState)(!1),g=e=>{let t=e.currentTarget.getBoundingClientRect();return{x:Math.round(e.clientX-t.left),y:Math.round(e.clientY-t.top)}},_=e=>{let{x:t,y:n}=g(e);a!==`text`&&(e.currentTarget.setPointerCapture(e.pointerId),u(a===`pen`?{kind:`pen`,d:`M${t} ${n}`}:{kind:`box`,x:t,y:n,w:0,h:0}))},v=e=>{if(!l)return;let{x:t,y:n}=g(e);l.kind===`pen`?u({kind:`pen`,d:`${l.d} L${t} ${n}`}):l.kind===`box`&&u({...l,w:Math.max(0,t-l.x),h:Math.max(0,n-l.y)})},y=()=>{l&&(l.kind!==`box`||l.w>2&&l.h>2)&&c([...s,l]),u(null)},b=e=>{d&&e.trim()&&c([...s,{kind:`text`,...d,text:e.trim()}]),f(null)},x=async()=>{let a=I.get(),o=a?.startsWith(`${t}::`)?Zf(e.client,a):null,s=r.current;if(!o||!s){z(H(`browser.noEngine`),`error`);return}h(!0);try{await NL(e.client,o,[await YI(s,`browser-${Ns(n)}.png`)]),i()}catch(e){e instanceof DOMException&&e.name===`NotAllowedError`||z(H(`browser.captureFailed`,{error:e instanceof Error?e.message:String(e)}),`error`),h(!1)}};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`svg`,{className:yr,"aria-label":H(`browser.annotate`),onPointerDown:_,onPointerMove:v,onPointerUp:y,onPointerCancel:y,onClick:e=>a===`text`&&f(g(e)),children:[(0,W.jsx)(`title`,{children:H(`browser.annotate`)}),[...s,...l?[l]:[]].map((e,t)=>(0,W.jsx)(BL,{mark:e},t))]}),d&&(0,W.jsx)(`input`,{autoFocus:!0,className:`absolute min-w-24 rounded-xs border-hairline border-accent bg-paper px-1 font-mono text-body text-accent focus:outline-none`,style:{left:d.x,top:d.y-14},"aria-label":H(`browser.text`),onBlur:e=>b(e.target.value),onKeyDown:e=>e.key===`Enter`&&e.currentTarget.blur()},`${d.x},${d.y}`),!p&&(0,W.jsxs)(`div`,{className:`absolute bottom-3 left-1/2 flex w-max -translate-x-1/2 items-center whitespace-nowrap gap-0.5 rounded-md border-hairline border-line bg-surface p-1 shadow-popover [&_svg]:flex-none`,children:[zL.map(e=>(0,W.jsx)(G,{variant:a===e.tool?`iconOn`:`icon`,title:H(`browser.${e.tool}`),"aria-label":H(`browser.${e.tool}`),"aria-pressed":a===e.tool,onClick:()=>o(e.tool),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:e.d})})},e.tool)),(0,W.jsx)(G,{variant:`icon`,disabled:s.length===0,title:H(`browser.undo`),"aria-label":H(`browser.undo`),onClick:()=>c(s.slice(0,-1)),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M5.5 3.5 3 6l2.5 2.5M3 6h6.5a3 3 0 0 1 0 6H7`})})}),(0,W.jsx)(G,{variant:`filled`,onClick:()=>void x(),children:H(`browser.addToChat`)}),(0,W.jsx)(G,{variant:`icon`,title:H(`browser.annotateDone`),"aria-label":H(`browser.annotateDone`),onClick:i,children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]})]})}var HL=5e3;function UL(e,t){let[n,r]=(0,m.useState)([]);return(0,m.useEffect)(()=>{r([]);let n=!0,i=()=>e.client.request(`browser.ports`,{taskId:t}).then(e=>n&&r(e.ports),()=>{});i();let a=window.setInterval(()=>void i(),HL);return()=>{n=!1,window.clearInterval(a)}},[e,t]),n}function WL({model:e,task:t}){U();let n=t.id,r=UL(e,n);return r.length===0?null:(0,W.jsx)(`div`,{className:`flex flex-wrap justify-end gap-x-3.5 gap-y-1 px-2 pb-2 font-mono text-meta whitespace-nowrap`,children:r.map(e=>(0,W.jsx)(G,{onClick:()=>$c(n,e.url),children:H(`files.openPort`,{port:e.port})},e.port))})}var GL={md:`md`,markdown:`md`,html:`html`,htm:`html`,svg:`svg`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,webp:`image`,pdf:`pdf`};function KL(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<0?null:GL[t.slice(n+1).toLowerCase()]??null}function qL(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var JL=e=>new TextDecoder().decode(qL(e));function YL(e,t){if(e===`svg`)return`image/svg+xml`;if(e===`pdf`)return`application/pdf`;let n=t.slice(t.lastIndexOf(`.`)+1).toLowerCase();return n===`jpg`||n===`jpeg`?`image/jpeg`:n===`gif`?`image/gif`:n===`webp`?`image/webp`:`image/png`}var XL=`default-src 'none'; img-src data:; style-src 'unsafe-inline'`;function ZL(e){let t=`<meta http-equiv="Content-Security-Policy" content="${XL}">`,n=/^\s*<!doctype[^>]*>/i.exec(e);return n?`${n[0]}${t}${e.slice(n[0].length)}`:`${t}${e}`}var QL=/^\[([^\]\n]+)\]\((https?:\/\/[^\s)]+)\)/,$L=/^https?:\/\/[^\s<>)\]]+/,eR=/[\p{L}\p{N}]/u;function tR(e){let t=[],n=``,r=()=>{n&&t.push({t:`text`,v:n}),n=``},i=0;for(;i<e.length;){let a=e.slice(i),o=e[i]??``;if(o==="`"){let n=e.indexOf("`",i+1);if(n>i+1){r(),t.push({t:`code`,v:e.slice(i+1,n)}),i=n+1;continue}}else if(a.startsWith(`**`)){let n=e.indexOf(`**`,i+2);if(n>i+2){r(),t.push({t:`bold`,c:tR(e.slice(i+2,n))}),i=n+2;continue}}else if(o===`*`||o===`_`&&!eR.test(e[i-1]??``)){let n=e.indexOf(o,i+1);if(n>i+1&&!/\s/.test(e[i+1]??` `)&&(o===`*`||!eR.test(e[n+1]??``))){r(),t.push({t:`em`,c:tR(e.slice(i+1,n))}),i=n+1;continue}}else if(o===`[`){let e=QL.exec(a);if(e){r(),t.push({t:`link`,href:e[2],c:tR(e[1])}),i+=e[0].length;continue}}else if(o===`h`&&!eR.test(e[i-1]??``)){let e=$L.exec(a);if(e){let n=e[0].replace(/[.,;:!?]+$/,``);r(),t.push({t:`link`,href:n,c:[{t:`text`,v:n}]}),i+=n.length;continue}}n+=o,i++}return r(),t}var nR=/^\s*(```+|~~~+)\s*([\w+#.-]*)\s*$/,rR=/^(#{1,6})\s+(.*?)\s*#*\s*$/,iR=/^(\s*)([-*+])\s+(.*)$/,aR=/^(\s*)\d+[.)]\s+(.*)$/,oR=/^\s*([-*_])(\s*\1){2,}\s*$/,sR=/^\s*\|.*\|\s*$/,cR=/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/,lR=e=>e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());function uR(e){let t=e.replace(/\r\n?/g,`
|
|
66
|
-
`).split(`
|
|
67
|
-
`),n=[],r=[],i=()=>{r.length>0&&n.push({t:`para`,c:tR(r.join(`
|
|
68
|
-
`))}),r=[]};for(let e=0;e<t.length;e++){let a=t[e],o=nR.exec(a);if(o){i();let r=o[1][0],a=[];for(e++;e<t.length&&!RegExp(`^\\s*${r}{3,}\\s*$`).test(t[e]);e++)a.push(t[e]);n.push({t:`code`,lang:o[2]??``,v:a.join(`
|
|
69
|
-
`)});continue}if(a.trim()===``){i();continue}let s=rR.exec(a);if(s){i(),n.push({t:`heading`,level:s[1].length,c:tR(s[2])});continue}if(oR.test(a)){i(),n.push({t:`hr`});continue}if(sR.test(a)){i();let r=[];for(;e<t.length&&sR.test(t[e]);e++){let n=t[e];cR.test(n)||r.push(lR(n))}e--,n.push({t:`table`,rows:r.map(e=>e.map(e=>tR(e)))});continue}if(a.startsWith(`>`)){i();let r=[];for(;e<t.length&&t[e].startsWith(`>`);e++)r.push(t[e].replace(/^>\s?/,``));e--,n.push({t:`quote`,c:tR(r.join(`
|
|
70
|
-
`))});continue}let c=iR.exec(a),l=c?null:aR.exec(a);if(c||l){i();let r=!c,a=[];for(;e<t.length;e++){let n=r?aR.exec(t[e]):iR.exec(t[e]);if(!n)break;let i=n[1].length;a.push({depth:Math.min(3,Math.floor(i/2)),c:tR(r?n[2]:n[3])})}e--,n.push({t:`list`,ordered:r,items:a});continue}r.push(a)}return i(),n}var dR=`flex min-h-0 min-w-0 flex-1 flex-col font-sans text-body`,fR=`flex flex-none flex-wrap items-center gap-x-3 gap-y-1 px-3 pb-1.5 font-mono text-meta`,pR=`min-w-0 flex-1 basis-32 py-1 text-meta`,mR=`min-h-0 flex-1 overflow-y-auto px-3 pb-3`,hR=`m-0 px-3 py-2 font-mono text-meta text-subtle`,gR=`m-0 whitespace-pre-wrap px-3 pb-3 font-mono text-meta leading-[1.45] text-muted wrap-anywhere`,_R=e=>`group/entry mt-3 rounded-sm border-l-2 py-0.5 pl-2.5 ${e.flash?`border-accent bg-accent-soft`:e.current?`border-line-active`:`border-transparent`}`,vR=`mb-0.5 flex items-center gap-2 font-mono text-meta`,yR=e=>e===`user`?`text-accent`:`text-muted`,bR=`text-subtle`,xR=`ml-auto opacity-0 group-hover/entry:opacity-100 focus-visible:opacity-100 touch:opacity-100`,SR=`m-0 mt-0.5 flex min-w-0 items-baseline gap-1.5 font-mono text-meta text-subtle`,CR=`flex-none text-muted`,wR=`min-w-0 flex-1 truncate`,TR=`leading-[1.5] wrap-anywhere`,ER=`m-0 mb-2 whitespace-pre-wrap last:mb-0`,DR=`m-0 mt-3 mb-1.5 font-semibold first:mt-0`,OR=`m-0 mb-2 flex flex-col gap-0.5 pl-5 last:mb-0`,kR=`m-0 mb-2 border-l-2 border-line pl-2.5 whitespace-pre-wrap text-muted last:mb-0`,AR=`m-0 mb-2 overflow-x-auto rounded-sm border-hairline border-line bg-inset px-2.5 py-2 font-mono text-meta leading-[1.45] last:mb-0`,jR=`rounded-xs bg-inset px-1 font-mono text-meta`,MR=`text-accent underline`,NR=`mb-2 block max-w-full overflow-x-auto border-collapse font-mono text-meta last:mb-0`,PR=`border-hairline border-line px-2 py-0.5 text-left align-top`,FR=`my-2 border-0 border-t border-line`;function IR(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=e.toLowerCase(),i=[],a=0;for(let t=r.indexOf(n);t>=0;t=r.indexOf(n,a))t>a&&i.push(e.slice(a,t)),i.push((0,W.jsx)(`mark`,{className:qy,"data-hit":``,children:e.slice(t,t+n.length)},t)),a=t+n.length;return i.push(e.slice(a)),m.Children.toArray(i)}var LR=[`h3`,`h3`,`h4`,`h5`,`h6`,`h6`];function RR({level:e,children:t}){let n=LR[Math.min(5,Math.max(0,e-1))]??`h6`;return(0,W.jsx)(n,{className:DR,children:t})}function zR(e,t){return e.map((e,n)=>(0,W.jsx)(m.Fragment,{children:t(e)},n))}function BR({nodes:e,needle:t}){return zR(e,e=>e.t===`text`?IR(e.v,t):e.t===`code`?(0,W.jsx)(`code`,{className:jR,children:IR(e.v,t)}):e.t===`bold`?(0,W.jsx)(`strong`,{children:(0,W.jsx)(BR,{nodes:e.c,needle:t})}):e.t===`em`?(0,W.jsx)(`em`,{children:(0,W.jsx)(BR,{nodes:e.c,needle:t})}):(0,W.jsx)(`a`,{className:MR,href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:(0,W.jsx)(BR,{nodes:e.c,needle:t})}))}function VR({block:e,needle:t}){switch(e.t){case`heading`:return(0,W.jsx)(RR,{level:e.level,children:(0,W.jsx)(BR,{nodes:e.c,needle:t})});case`para`:return(0,W.jsx)(`p`,{className:ER,children:(0,W.jsx)(BR,{nodes:e.c,needle:t})});case`code`:return(0,W.jsx)(`pre`,{className:AR,children:(0,W.jsx)(`code`,{children:IR(e.v,t)})});case`quote`:return(0,W.jsx)(`blockquote`,{className:kR,children:(0,W.jsx)(BR,{nodes:e.c,needle:t})});case`hr`:return(0,W.jsx)(`hr`,{className:FR});case`list`:{let n=e.ordered?`ol`:`ul`;return(0,W.jsx)(n,{className:`${OR} ${e.ordered?`list-decimal`:`list-disc`}`,children:zR(e.items,e=>(0,W.jsx)(`li`,{style:{marginLeft:`${e.depth*1.25}rem`},children:(0,W.jsx)(BR,{nodes:e.c,needle:t})}))})}case`table`:return(0,W.jsx)(`table`,{className:NR,children:(0,W.jsx)(`tbody`,{children:zR(e.rows,e=>(0,W.jsx)(`tr`,{children:zR(e,e=>(0,W.jsx)(`td`,{className:PR,children:(0,W.jsx)(BR,{nodes:e,needle:t})}))}))})})}}function HR({source:e,needle:t=``}){let n=(0,m.useMemo)(()=>uR(e),[e]);return(0,W.jsx)(`div`,{className:TR,children:zR(n,e=>(0,W.jsx)(VR,{block:e,needle:t}))})}function UR(e){if(e instanceof Go){if(e.code===`TOO_LARGE`){let t=e.detail?.size;return $(H(`artifact.tooLarge`),{size:typeof t==`number`?`${(t/1048576).toFixed(1)} MB`:`5 MB+`})}if(e.code===`NOT_PREVIEWABLE`)return H(`artifact.notPreviewable`);if(e.code===`NOT_FOUND`)return H(`artifact.gone`)}return $(H(`artifact.failed`),{error:e instanceof Error?e.message:String(e)})}function WR(e,t,n,r){let[i,a]=(0,m.useState)({kind:`loading`});return(0,m.useEffect)(()=>{let r=!0;return e.client.request(`file.read`,{taskId:t,path:n}).then(e=>r&&a({kind:`ready`,file:e}),e=>r&&a({kind:`failed`,text:UR(e)})),()=>{r=!1}},[e,t,n,r]),i}function GR(e,t){let n=(0,m.useMemo)(()=>e===null?null:URL.createObjectURL(new Blob([qL(e)],{type:t})),[e,t]);return(0,m.useEffect)(()=>()=>void(n&&URL.revokeObjectURL(n)),[n]),n}function KR({model:e,taskId:t,path:n,kind:r,changeKey:i}){U();let a=WR(e,t,n,i),o=GR(a.kind===`ready`&&(r===`svg`||r===`image`||r===`pdf`)?a.file.base64:null,r===`md`||r===`html`?``:YL(r,n));return a.kind===`loading`?(0,W.jsx)(`p`,{className:wr,children:H(`artifact.loading`)}):a.kind===`failed`?(0,W.jsx)(`p`,{className:`${wr} text-error`,children:a.text}):r===`md`?(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-3 py-2`,children:(0,W.jsx)(HR,{source:JL(a.file.base64)})}):r===`html`?(0,W.jsx)(`iframe`,{title:n,sandbox:``,srcDoc:ZL(JL(a.file.base64)),style:{colorScheme:`light`,background:`#fff`},className:`min-h-0 w-full flex-1 border-none`}):o?r===`pdf`?(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(`a`,{className:`${jr} px-3 py-1 font-mono text-meta`,href:o,target:`_blank`,rel:`noreferrer noopener`,children:H(`artifact.open`)}),(0,W.jsx)(`iframe`,{title:n,src:o,className:`min-h-0 w-full flex-1 border-none`})]}):(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,W.jsx)(`img`,{src:o,alt:n,className:`max-w-full`})}):null}function qR(e){let[t,n]=(0,m.useState)(0),r=e.open&&e.items.length>0,i=Math.min(t,Math.max(0,e.items.length-1)),a=(0,m.useRef)(null),{onCursor:o}=e;return(0,m.useEffect)(()=>o?.(i),[i,o]),(0,m.useEffect)(()=>{a.current?.scrollIntoView({block:`nearest`})},[i,e.items]),(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`input`,{className:Nr,"data-field":e.field,spellCheck:!1,autoComplete:`off`,autoFocus:e.autoFocus,placeholder:e.placeholder,value:e.value,onChange:t=>{n(0),e.onChange(t.target.value.replace(/[\r\n]+/g,``))},onKeyDown:t=>{if(!t.nativeEvent.isComposing){if(t.key===`ArrowDown`||t.key===`ArrowUp`){if(!r)return;t.preventDefault(),n(Math.max(0,Math.min(e.items.length-1,i+(t.key===`ArrowDown`?1:-1))))}else t.key===`Tab`&&!t.shiftKey&&r&&e.onComplete?.(i)?(t.preventDefault(),n(0)):t.key===`Enter`&&!t.ctrlKey&&!t.metaKey&&(t.preventDefault(),r?((e.onEnterRow??e.onPick)(i),n(0)):e.onEnter?.())}}}),r&&(0,W.jsx)(`ul`,{className:`mx-0 mt-1 mb-0 max-h-47 list-none overflow-y-auto rounded-sm border-hairline border-line bg-inset p-0.5 font-mono text-meta`,children:e.items.map((t,n)=>(0,W.jsx)(`li`,{ref:n===i?a:void 0,children:(0,W.jsxs)(`button`,{type:`button`,tabIndex:-1,"aria-pressed":n===i,className:kr({cursor:n===i,accent:!!t.accent}),onMouseDown:t=>{t.preventDefault(),e.onPick(n)},children:[(0,W.jsx)(`span`,{children:t.text}),t.dim&&(0,W.jsxs)(`span`,{className:`text-muted`,children:[` `,t.dim]})]})},t.key))})]})}function JR(e,t,n){let r=[{ref:null,suggestion:{key:`default`,text:t,dim:H(`review.baseDefault`),accent:!0}}],i=(e,n)=>{for(let i of e)i!==t&&r.push({ref:i,suggestion:{key:`${n}:${i}`,text:i,dim:n}})};i(e?.branches??[],H(`review.baseBranch`)),i(e?.remotes??[],H(`review.baseRemote`)),i(e?.tags??[],H(`review.baseTag`));for(let t of e?.commits??[])r.push({ref:t.sha,suggestion:{key:`commit:${t.sha}`,text:t.sha,dim:t.subject}});let a=n.trim().toLowerCase();if(a===``)return r.slice(0,40);let o=e=>{if(e.suggestion.text.toLowerCase()===a)return 0;let t=Um(e.suggestion.text,a);return t===`substring`||(e.suggestion.dim??``).toLowerCase().includes(a)?1:t===`segments`?2:null};return r.flatMap(e=>{let t=o(e);return t===null?[]:[{c:e,r:t}]}).sort((e,t)=>e.r-t.r).map(e=>e.c).slice(0,40)}function YR(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(null),s=e.model.client;(0,m.useEffect)(()=>{if(!t)return;let n=!0;return Z(s,`diff.refs`,{taskId:e.taskId}).then(e=>n&&o(e),()=>{}),()=>{n=!1}},[t,s,e.taskId]);let c=JR(a,e.base,r),l=t=>{e.onPick(t),n(!1),i(``)},u=e.custom??e.base,d=[{id:`task`,label:H(`review.scopeTask`)},{id:`working`,label:H(`review.scopeWorking`)},{id:`branch`,label:H(`review.scopeBranch`)}],f=d.find(t=>t.id===e.scope)?.label??``;return(0,W.jsxs)(`span`,{className:`relative`,onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&t&&n(!1)},children:[(0,W.jsx)(G,{hit:`tight`,"aria-expanded":t,"aria-haspopup":`menu`,onClick:t=>{let r=t.currentTarget.getBoundingClientRect();D.set({x:r.left,y:r.bottom+2,target:t.currentTarget,items:[...d.map(t=>({label:t.label,section:`scope`,checked:t.id===e.scope,run:()=>e.onScope(t.id)})),{label:H(`review.compareAgainst`,{base:u}),section:`base`,run:()=>n(!0)}]})},children:H(`review.scopeMenu`,{base:u,scope:f})}),t&&(0,W.jsx)(`div`,{className:`absolute top-full left-0 z-3 mt-1 w-64 max-w-full rounded-sm border-hairline border-line-active bg-surface p-1 shadow-popover`,children:(0,W.jsx)(qR,{field:`diff-base`,autoFocus:!0,value:r,onChange:i,items:c.map(e=>e.suggestion),open:!0,placeholder:H(`review.basePlaceholder`),onPick:e=>l(c[e]?.ref??null),onEnter:()=>l(r.trim()===``?null:r.trim())})})]})}var XR=`rove.diffBase`;function ZR(){try{let e=JSON.parse(localStorage.getItem(XR)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function QR(e){return ZR()[e]??null}function $R(e,t){let n=ZR();t===null?delete n[e]:n[e]=t;try{localStorage.setItem(XR,JSON.stringify(n))}catch{}}function ez(e){let[t,n]=(0,m.useState)(()=>QR(e.taskId));return[t,t=>{$R(e.taskId,t),n(t),t!==null&&e.scope!==`task`&&Zc({taskId:e.taskId,path:e.path,scope:`task`})}]}var tz=(0,m.memo)(function(e){return(0,W.jsxs)(`div`,{className:`flex items-center ${e.viewed?`opacity-60`:``}`,children:[(0,W.jsxs)(G,{variant:`row`,"data-row":e.index,"aria-expanded":!e.closed,"aria-label":H(e.closed?`review.unfold`:`review.fold`,{path:e.name}),className:`${FD(`file`,{cursor:e.cursor,noted:!1})} min-w-0 flex-1 text-left`,onClick:()=>e.onToggleFold(e.index,e.path),children:[(0,W.jsx)(`span`,{className:`grid place-items-center text-subtle`,children:(0,W.jsx)(hs,{right:e.closed})}),(0,W.jsxs)(`span`,{className:VD,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.added?(0,W.jsxs)(bD,{tone:`added`,children:[`+`,e.added]}):null,e.removed?(0,W.jsxs)(bD,{tone:`removed`,children:[`−`,e.removed]}):null]})]}),e.path!==null&&(0,W.jsx)(G,{hit:`tight`,className:`flex-none px-2`,"aria-pressed":e.viewed,"aria-label":H(e.viewed?`review.unmarkViewed`:`review.markViewed`,{path:e.name}),onClick:()=>e.path!==null&&e.onToggleViewed(e.path),children:e.viewed?H(`review.viewedOn`):H(`review.viewed`)})]})});function nz(e){return(0,W.jsxs)(`div`,{className:`absolute top-full right-3 z-1 flex gap-1.5`,children:[(0,W.jsx)(G,{variant:`floating`,onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),e.onComment()},children:H(`review.comment`)}),e.showRange&&(0,W.jsx)(G,{variant:`floating`,onClick:t=>{t.stopPropagation(),e.onRange()},children:H(`review.range`)}),e.ranged&&(0,W.jsx)(G,{variant:`floating`,title:H(`preview.askInChatHint`),onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),e.onAsk()},children:H(`preview.askInChat`)})]})}function rz({note:e,onEdit:t}){return(0,W.jsxs)(G,{variant:`row`,className:`${FD(`note`,{cursor:!1,noted:!1})} w-full text-left`,onClick:t,children:[(0,W.jsx)(`span`,{className:LD}),(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{className:`text-accent`,children:`●`}),(0,W.jsx)(`span`,{className:BD,children:e.body})]})}function iz(e){let t=(0,m.useRef)(e);return t.current=e,(0,m.useMemo)(()=>({rowClick:(e,n)=>t.current.rowClick(e,n),fileClick:(e,n)=>t.current.fileClick(e,n),viewedClick:e=>t.current.viewedClick(e),editNote:e=>t.current.editNote(e)}),[])}var az=2e3,oz=(0,m.memo)(function(e){let{index:t,row:n,noted:r}=e;return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{"data-row":t,className:FD(n.kind,{cursor:e.cursor,noted:r}),onClick:n=>e.onClick(t,n),children:[(0,W.jsx)(`span`,{className:LD,children:n.oldNo??``}),(0,W.jsx)(`span`,{className:ID,children:n.newNo??``}),(0,W.jsx)(`span`,{className:RD(n.kind,r,e.changed),children:n.kind===`add`?`+`:n.kind===`del`?`−`:r?`●`:e.changed?`▎`:` `}),(0,W.jsxs)(`span`,{className:zD(n.kind),children:[n.text.length>az?n.text.slice(0,az):n.text,n.text.length>az&&(0,W.jsxs)(`span`,{className:`text-subtle`,children:[` `,H(`review.lineClipped`,{count:(n.text.length-az).toLocaleString()})]})]}),e.actions]}),e.notes?.map(t=>t.id===e.editId?(0,W.jsx)(m.Fragment,{children:e.composer},t.id):(0,W.jsx)(rz,{note:t,onEdit:()=>e.onEditNote(t)},t.id)),e.editId===void 0&&e.composer]})});function sz(e){return(0,W.jsxs)(`div`,{className:`flex flex-none flex-wrap items-center gap-x-3 gap-y-1 px-2 pt-1.5 font-mono text-meta`,children:[e.picker,(0,W.jsx)(G,{hit:`tight`,"aria-pressed":e.ignoreWs,title:H(`review.ignoreWsHint`),className:`opacity-60 aria-pressed:underline aria-pressed:opacity-100`,onClick:e.onToggleWs,children:H(`review.ignoreWs`)}),(0,W.jsxs)(`span`,{className:`flex min-w-0 basis-full flex-wrap items-center gap-x-1.5 text-muted`,children:[H(`review.totals`,{files:e.files,added:e.added,removed:e.removed}),e.shape&&(0,W.jsxs)(`span`,{children:[`· `,e.shape]}),e.files>0&&(0,W.jsxs)(`span`,{className:`whitespace-nowrap`,children:[`· `,H(`review.viewedCount`,{done:e.viewed,files:e.files})]})]}),(0,W.jsxs)(`span`,{className:`ml-auto flex items-center gap-x-3`,children:[e.files>1&&(0,W.jsx)(G,{hit:`tight`,onClick:e.onNextFile,children:H(`review.nextFile`)}),e.onNextComment&&(0,W.jsx)(G,{hit:`tight`,onClick:e.onNextComment,children:H(`review.nextComment`)}),e.files>1&&(0,W.jsx)(G,{hit:`tight`,onClick:e.onFoldAll,children:e.allFolded?H(`review.unfoldAll`):H(`review.foldAll`)})]})]})}var cz=`rove.diffViewed`,lz=(e,t)=>`${e}\0${t}`,uz=4096;function dz(e){let t=2166136261;for(let n of e){let e=n.text.length>uz?`${n.text.slice(0,uz/2)}${n.text.length}${n.text.slice(-2048)}`:n.text,r=`${n.kind}${e}\n`;for(let e=0;e<r.length;e++)t=Math.imul(t^r.charCodeAt(e),16777619)}return(t>>>0).toString(16)}function fz(e){let t=new Map,n=-1,r=r=>{let i=n>=0?e[n]?.path:null;i&&t.set(i,dz(e.slice(n+1,r)))};return e.forEach((e,t)=>{e.kind===`file`&&(r(t),n=t)}),r(e.length),t}function pz(){try{let e=JSON.parse(localStorage.getItem(cz)??`{}`);return!e||typeof e!=`object`||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return{}}}function mz(e){try{localStorage.setItem(cz,JSON.stringify(e))}catch{}}function hz(e,t,n){let r=new Set;for(let[i,a]of n)e[lz(t,i)]===a&&r.add(i);return r}function gz(e,t,n,r){let i={...e};return r===void 0?delete i[lz(t,n)]:i[lz(t,n)]=r,i}function _z(e,t){return e.find(e=>e>t)??e[0]??null}var vz=`rove.diffIgnoreWs`;function yz(){try{return localStorage.getItem(vz)===`1`}catch{return!1}}function bz(e){try{localStorage.setItem(vz,e?`1`:`0`)}catch{}}function xz(e){return(0,W.jsx)(`div`,{className:`flex flex-none items-center gap-3 px-2 pt-1.5 font-mono text-meta`,children:(0,W.jsx)(G,{hit:`tight`,onClick:()=>e.file?Zc({taskId:e.taskId,path:e.path,scope:`working`}):Qc(e.taskId,e.path),children:H(e.file?`preview.modeDiff`:`preview.modeFile`)})})}function Sz(e,t,n,r,i){let[a,o]=(0,m.useState)(null);return(0,m.useEffect)(()=>{if(!r)return;let i=!0;return Z(e,`diff.file`,{taskId:t,path:n,scope:`working`}).then(e=>{if(!i)return;let t=e.kind===`diff`&&typeof e.text==`string`?YE(e.text,n):[];o(new Set(t.flatMap(e=>e.kind===`add`&&e.newNo!==null?[e.newNo]:[])))},()=>i&&o(null)),()=>{i=!1}},[e,t,n,r,i]),r?a:null}var Cz=[`renamed`,`added`,`untracked`,`modified`,`deleted`,`conflict`],wz={U:`conflict`,D:`deleted`,M:`modified`,T:`modified`,"?":`untracked`,A:`added`,R:`renamed`,C:`renamed`},Tz={conflict:`attention`,deleted:`attention`,modified:`warning`,untracked:`success`,added:`success`,renamed:`accent`},Ez={conflict:`!`,deleted:`D`,modified:`M`,untracked:`U`,added:`A`,renamed:`R`};function Dz(e){let t=new Map;for(let n of[`branch`,`working`])for(let r of e){let e=r.scope===n?wz[r.status]:void 0;e&&t.set(r.path,e)}let n=new Map(t);for(let[e,r]of t)for(let t=e.indexOf(`/`);t>=0;t=e.indexOf(`/`,t+1)){let i=e.slice(0,t+1),a=n.get(i);(a===void 0||Cz.indexOf(r)>Cz.indexOf(a))&&n.set(i,r)}return n}function Oz(e,t){return e.some(e=>e.scope===`working`&&e.path===t&&e.status!==`?`)}var kz={add:`+`,del:`-`},Az=40,jz=160,Mz=e=>`${kz[e.kind]??` `}${e.text.slice(0,jz)}`,Nz=e=>e.startLine!==void 0&&e.startLine!==e.line?`${e.filePath}:${e.startLine}-${e.line}`:`${e.filePath}:${e.line}`;function Pz(e,t,n){let r=[];for(let i=t;i<=n&&r.length<Az;i++){let t=e[i];t&&ZE(t)!==null&&r.push(Mz(t))}return r.join(`
|
|
71
|
-
`)}function Fz(e,t){let n=e.startLine??e.line,r=t.flatMap((t,n)=>t.path===e.filePath&&ZE(t)!==null?[n]:[]);if(!e.code){let i=r.filter(r=>{let i=ZE(t[r]);return i>=n&&i<=e.line}),a=i[0],o=i[i.length-1];return a===void 0||o===void 0?null:{first:a,last:o}}let i=e.code.split(`
|
|
72
|
-
`);for(let e=0;e+i.length<=r.length;e++){let a=r.slice(e,e+i.length),o=a[0],s=a[a.length-1];if(o!==void 0&&s!==void 0&&ZE(t[o])===n&&a.every((e,n)=>Mz(t[e])===i[n]))return{first:o,last:s}}return null}function Iz(e,t,n){return Fz(e,t)?`ok`:t.some(t=>t.path===e.filePath)||n?`moved`:`unknown`}function Lz(e){let[t,n]=(0,m.useState)(null),r=()=>{n(null),e.focusView()},i=async n=>{if(t){if(t.kind===`add`){let{target:r}=t;await e.client.request(`review.add`,{taskId:e.taskId,filePath:r.path,line:r.line,...r.startLine?{startLine:r.startLine}:{},code:Pz(e.rows,r.first,r.last),body:n})}else await e.client.request(`review.edit`,{taskId:e.taskId,id:t.note.id,body:n}).catch(e=>{throw vD(e)});e.onSaved(t.kind===`add`),r()}};return{node:t&&(0,W.jsx)(Rz,{location:t.kind===`add`?Nz({filePath:t.target.path,startLine:t.target.startLine,line:t.target.line}):Nz(t.note),...t.kind===`edit`?{initial:t.note.body}:{},onSubmit:i,onCancel:r}),row:t?t.kind===`add`?t.target.last:Fz(t.note,e.rows)?.last??-1:null,editId:t?.kind===`edit`?t.note.id:void 0,add:()=>e.target&&n({kind:`add`,target:e.target}),edit:e=>n({kind:`edit`,note:e})}}function Rz(e){let[t,n]=(0,m.useState)(e.initial??``),[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(null),s=e.initial!==void 0,c=t.trim(),l=async()=>{if(!(!c||r)){i(!0),o(null);try{await e.onSubmit(c)}catch(e){o(e instanceof Error?e.message:String(e)),i(!1)}}};return(0,W.jsxs)(`div`,{className:FD(`note`,{cursor:!1,noted:!1}),onKeyDown:e=>e.stopPropagation(),onMouseUp:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`span`,{className:LD}),(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{className:`text-accent`,children:`●`}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 whitespace-normal`,children:[(0,W.jsx)(`textarea`,{className:`${Nr} ${Lr} font-mono`,"aria-label":H(s?`review.noteEditOn`:`review.noteOn`,{location:e.location}),autoFocus:!0,rows:3,value:t,disabled:r,onChange:e=>n(e.target.value),onFocus:e=>e.currentTarget.setSelectionRange(t.length,t.length),onKeyDown:t=>{t.key===`Enter`&&(t.ctrlKey||t.metaKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),e.onCancel())}}),a&&(0,W.jsx)(`p`,{className:`m-0 text-error`,children:a}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(G,{hit:`tight`,disabled:r||!c,onClick:()=>void l(),children:H(s?`review.noteSave`:`review.noteAdd`)}),(0,W.jsx)(G,{hit:`tight`,className:`text-muted`,disabled:r,onClick:e.onCancel,children:H(`review.noteCancel`)})]})]})]})}function zz({notes:e,states:t,sending:n,onShow:r,onEdit:i,onDrop:a,onSend:o}){U();let[s,c]=(0,m.useState)(!1);if(e.length===0)return null;let l=e.length;return(0,W.jsxs)(`div`,{className:`flex max-h-2/5 min-h-0 flex-none flex-col border-t-hairline border-line font-mono text-meta`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 narrow:px-2`,children:[(0,W.jsxs)(G,{variant:`row`,className:`flex min-w-0 flex-1 items-center gap-2 text-left text-ink`,"aria-expanded":s,onClick:()=>c(!s),children:[(0,W.jsx)(hs,{right:!s}),(0,W.jsx)(`span`,{children:l===1?H(`review.countOne`):H(`review.count`,{count:l})})]}),(0,W.jsx)(G,{disabled:n,onClick:o,children:n?H(`review.sending`):H(`review.send`,{count:l})})]}),s&&(0,W.jsx)(`ul`,{className:`m-0 min-h-0 list-none overflow-y-auto p-0 pb-1`,children:e.map(e=>(0,W.jsxs)(`li`,{className:`flex flex-col gap-0.5 px-3 py-1 narrow:px-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,W.jsx)(G,{variant:`row`,className:`min-w-0 flex-1 truncate text-left text-ink hover:underline`,title:H(`review.show`),onClick:()=>r(e),children:Nz(e)}),t.get(e.id)===`moved`&&(0,W.jsx)(`span`,{title:H(`review.movedHint`),children:(0,W.jsx)(bD,{tone:`warning`,children:H(`review.moved`)})}),(0,W.jsx)(G,{hit:`tight`,onClick:()=>i(e),children:H(`review.edit`)}),(0,W.jsx)(G,{hit:`tight`,onClick:()=>a(e),children:H(`review.drop`)})]}),(0,W.jsx)(`p`,{className:`m-0 line-clamp-2 whitespace-pre-wrap wrap-anywhere text-muted`,children:e.body})]},e.id))})]})}var Bz=[];function Vz({model:e,view:t,active:n,restored:r,onClose:i}){U();let a=xu(),[o,s]=(0,m.useState)(yz),[c,l]=(0,m.useState)(pz),[u,d]=ez(t),f=t.scope===`task`?u:null,p=f!==null,h=t.file===!0,g={taskId:t.taskId,path:t.path,scope:t.scope,...h?{content:!0}:{},...o?{ignoreWhitespace:!0}:{},...f?{base:f}:{}},_=yD(e,t.taskId),v={...g,taskId:_},[b,x]=(0,m.useState)(()=>{let n=X(e,`diff.file`,v);return n===void 0?null:_D(n,t.path,p)}),[S,C]=(0,m.useState)(()=>X(e,`review.list`,{taskId:t.taskId})?.notes??[]),[w,T]=(0,m.useState)(()=>X(e,`diff.files`,{taskId:_})),[E,D]=(0,m.useState)(0),[O,k]=(0,m.useState)(null),[A,j]=(0,m.useState)(!1),[M,N]=(0,m.useState)(new Map),[ee,P]=(0,m.useState)(!1),[F,te]=(0,m.useState)(0),ne=(0,m.useRef)(null),L=e.client,re=y(L.conn).state;(0,m.useEffect)(()=>{let e=!0;return L.request(`diff.file`,g).then(n=>e&&x(_D(rd(L,`diff.file`,v,n),t.path,p)),t=>{if(e){if(f&&t instanceof Go&&t.code===`BAD_REF`){d(null),z(t.message,`error`);return}x({kind:`text`,text:Zo(t),error:!0})}}),()=>{e=!1}},[L,t.taskId,t.path,t.scope,o,f,F,re]),(0,m.useEffect)(()=>{let e=!0;return L.request(`diff.files`,{taskId:t.taskId}).then(t=>e&&T(rd(L,`diff.files`,{taskId:_},t)),()=>{}),()=>{e=!1}},[L,t.taskId,F]);let ie=()=>void Z(L,`review.list`,{taskId:t.taskId}).then(e=>C(e.notes));(0,m.useEffect)(ie,[L,t.taskId,F]);let ae=(0,m.useRef)(!1);(0,m.useEffect)(()=>{n&&(ae.current||!r)&&ne.current?.focus(),ae.current=!0},[n,r]);let R=b?.kind===`rows`?b.rows:Bz,oe=b?.kind===`rows`&&b.diff,se=w?.base??null,ce=t.path!==`.`&&t.scope===`working`&&Oz(w?.files??[],t.path),le=Sz(L,t.taskId,t.path,h&&ce&&!oe,F),B=(0,m.useMemo)(()=>R.map((e,t)=>`row-${t}`),[R]),ue=(0,m.useMemo)(()=>nD(R),[R]),de=(0,m.useMemo)(()=>fz(R),[R]),fe=(0,m.useMemo)(()=>hz(c,t.taskId,de),[c,t.taskId,de]),pe=(0,m.useMemo)(()=>{let e=new Set;for(let t of de.keys())(M.get(t)??(dD(t)||fe.has(t)))&&e.add(t);return e},[de,fe,M]),me=(e,t)=>N(n=>{let r=new Map(n);for(let n of e)r.set(n,t);return r}),he=(0,m.useMemo)(()=>tD(R,pe),[R,pe]),ge=(0,m.useMemo)(()=>S.filter(e=>e.sentAt===void 0),[S]),_e=(0,m.useMemo)(()=>ge.map(e=>({note:e,at:Fz(e,R)})),[ge,R]),V=(0,m.useMemo)(()=>{let e=new Set;for(let{at:t}of _e)if(t)for(let n=t.first;n<=t.last;n++)e.add(n);return e},[_e]),ve=(0,m.useMemo)(()=>{let e=new Map;for(let{note:t,at:n}of _e)n&&e.set(n.last,[...e.get(n.last)??[],t]);return e},[_e]),ye=t.path===`.`&&b!==null&&!(b.kind===`text`&&b.error),be=(0,m.useMemo)(()=>{let e=new Map;for(let{note:t}of _e)e.set(t.id,Iz(t,R,ye));return e},[_e,R,ye]);(0,m.useEffect)(()=>{if(he.includes(E))return;let e=E;for(;e>0&&R[e]?.kind!==`file`;)e--;D(e),k(null)},[he,E,R]);let xe=(0,m.useRef)(!1);(0,m.useEffect)(()=>{if(!xe.current){xe.current=!0;return}ne.current?.querySelector(`[data-row="${E}"]`)?.scrollIntoView({block:`nearest`})},[E]);let Se=eD(R,E,O),Ce=e=>me([e],!pe.has(e)),we=[...ue.keys()].flatMap(e=>R[e]?.path?[R[e]?.path]:[]),Te=(0,m.useMemo)(()=>gD(ue,R),[ue,R]),Ee=we.length>0&&we.every(e=>pe.has(e)),De=[...ue.values()].reduce((e,t)=>({added:e.added+t.added,removed:e.removed+t.removed}),{added:0,removed:0}),Oe=e=>{let n=gz(c,t.taskId,e,fe.has(e)?void 0:de.get(e));l(n),mz(n),N(t=>{let n=new Map(t);return n.delete(e),n})},ke=()=>{bz(!o),s(!o)},Ae=Lz({client:L,taskId:t.taskId,rows:R,target:Se,onSaved:e=>{e&&(k(null),j(!1)),ie()},focusView:()=>ne.current?.focus()}),je=e=>{Fe(e),(t.path===`.`||t.path===e.filePath)&&Ae.edit(e)},Me=e=>void L.request(`review.remove`,{taskId:t.taskId,id:e.id}).then(ie).catch(e=>z(vD(e).message,`error`)),Ne=y(I),Pe=()=>{let e=$E(R,E,O);if(e){if(!Ne?.startsWith(`${t.taskId}::`)){z(H(`files.mentionNoEngine`),`error`);return}L.request(`term.input`,{stream:Ne,data:QE(e)}).then(()=>{k(null),Io(Ne)?.focus()}).catch(e=>z(e instanceof Error?e.message:String(e),`error`))}},Fe=e=>{let n=Fz(e,R),r=R.findIndex(t=>t.kind===`file`&&t.path===e.filePath);n?(me([e.filePath],!1),D(n.first)):t.path===`.`&&r>=0?D(r):t.path!==e.filePath&&t.path!==`.`&&Zc({taskId:t.taskId,path:e.filePath,scope:t.scope}),k(null),j(!1)},Ie=()=>{P(!0),L.request(`review.send`,e.engineTarget(t.taskId)).then(e=>{z(e.delivered?H(`preview.sent`,{count:e.sent}):H(`preview.notSent`,{reason:e.reason??``}),e.delivered?`info`:`error`),ie()}).catch(e=>z(e instanceof Error?e.message:String(e),`error`)).finally(()=>P(!1))},Le=()=>{let e=_z([...ue.keys()],E);e!==null&&(D(e),k(null),j(!1))},Re=()=>{let e=_z(_e.flatMap(({at:e})=>e?[e.first]:[]).sort((e,t)=>e-t),E);if(e===null)return;let t=R[e]?.path;t&&me([t],!1),D(e),k(null),j(!1)},ze=e=>D(t=>{let n=Math.max(0,he.indexOf(t));return he[Math.min(he.length-1,Math.max(0,n+e))]??t}),Be=e=>{let t=e.key;if(t===`j`||t===`ArrowDown`)ze(1);else if(t===`k`||t===`ArrowUp`)ze(-1);else if(t===`v`)k(e=>e===null?E:null),j(!0);else if(t===`c`&&!e.ctrlKey)Ae.add();else if(t===`x`){let e=_e.find(({at:e})=>e&&E>=e.first&&E<=e.last);e&&Me(e.note)}else if(t===`s`)Ie();else if(t===`z`){let e=R[E]?.path;e&&oe&&Ce(e)}else if(t===`r`)te(e=>e+1);else if(t===`q`||t===`Escape`)i();else if(e.ctrlKey&&!e.metaKey&&t.toLowerCase()===`c`&&!window.getSelection()?.toString())i();else return;e.preventDefault()},Ve=()=>{let e=window.getSelection();if(!e||e.isCollapsed)return;let t=e=>(e instanceof Element?e:e?.parentElement)?.closest(`[data-row]`),n=t(e.anchorNode),r=t(e.focusNode);!n||!r||(k(Number(n.dataset.row)),D(Number(r.dataset.row)),j(!0))},He=iz({rowClick:(e,t)=>{window.getSelection()?.isCollapsed!==!1&&(t.shiftKey?k(e=>e??E):(!a||O===null)&&k(null),D(e),j(!0))},fileClick:(e,t)=>{D(e),k(null),j(!1),t&&Ce(t)},viewedClick:Oe,editNote:je}),Ue=O===null?E:Math.min(O,E),We=O===null?E:Math.max(O,E);return(0,W.jsxs)(`div`,{className:`group/preview @container/preview flex min-h-0 min-w-0 flex-1 flex-col outline-none`,"data-file":h&&!oe?``:void 0,tabIndex:0,ref:ne,onKeyDown:Be,children:[ce&&(0,W.jsx)(xz,{taskId:t.taskId,path:t.path,file:h}),oe&&(0,W.jsx)(sz,{picker:se!==null&&(0,W.jsx)(YR,{taskId:t.taskId,model:e,scope:t.scope,onScope:e=>Zc({taskId:t.taskId,path:t.path,scope:e}),base:se,custom:u,onPick:d}),ignoreWs:o,onToggleWs:ke,files:we.length,shape:Te,added:De.added,removed:De.removed,viewed:fe.size,allFolded:Ee,onFoldAll:()=>me(we,!Ee),onNextFile:Le,onNextComment:_e.some(({at:e})=>e)?Re:null}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto py-1.5 font-mono text-meta/normal`,onMouseUp:Ve,children:[!b&&(0,W.jsx)(`p`,{className:`mx-2.5 my-3 font-mono text-meta text-subtle`,children:H(`preview.loading`)}),b?.kind===`text`&&(0,W.jsx)(`p`,{className:`mx-2.5 my-3 font-mono text-meta text-subtle ${b.error?`text-error`:``}`,children:b.text}),he.map(e=>{let t=R[e],n=e>=Ue&&e<=We;if(t.kind===`file`){let r=ue.get(e),i=t.path;return(0,W.jsx)(tz,{index:e,name:t.text,path:i,closed:i!==null&&pe.has(i),viewed:i!==null&&fe.has(i),cursor:n,added:r?.added??0,removed:r?.removed??0,onToggleFold:He.fileClick,onToggleViewed:He.viewedClick},B[e])}return(0,W.jsx)(oz,{index:e,row:t,cursor:n,noted:V.has(e),actions:A&&Se&&!Ae.node&&e===We&&(0,W.jsx)(nz,{showRange:a&&O===null,ranged:O!==null,onComment:Ae.add,onRange:()=>k(E),onAsk:Pe}),notes:ve.get(e),changed:t.newNo!==null&&le?.has(t.newNo)===!0,composer:e===Ae.row?Ae.node:void 0,editId:e===Ae.row?Ae.editId:void 0,onClick:He.rowClick,onEditNote:He.editNote},B[e])}),Ae.row===-1&&Ae.node]}),(0,W.jsx)(zz,{notes:ge,states:be,sending:ee,onShow:Fe,onEdit:je,onDrop:Me,onSend:Ie})]})}function Hz(e){U();let{model:t,view:n}=e,r=n.path===`.`?null:KL(n.path),[i,a]=(0,m.useState)(null),o=y(t.tasks);if(!r)return(0,W.jsx)(Vz,{...e});let s=i===n.path,c=JSON.stringify(o?.tasks.find(e=>e.id===n.taskId)?.changes??null);return(0,W.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex gap-x-3 px-2.5 py-1`,children:[(0,W.jsx)(G,{variant:`pill`,hit:`tight`,"aria-current":!s,onClick:()=>a(null),children:`[ ${H(`artifact.preview`)} ]`}),(0,W.jsx)(G,{variant:`pill`,hit:`tight`,"aria-current":s,onClick:()=>a(n.path),children:`[ ${H(`artifact.source`)} ]`})]}),s?(0,W.jsx)(Vz,{...e}):(0,W.jsx)(KR,{model:t,taskId:n.taskId,path:n.path,kind:r,changeKey:c})]})}var Uz=6e4,Wz=new class{known=new Map;get(e){return this.known.get(e)}due(e,t){let n=this.known.get(e);return!n||t-n.at>=Uz}set(e,t,n){t===null&&this.known.get(e)?.probe||this.known.set(e,{probe:t,at:n})}};function Gz(e,t,n){let[,r]=(0,m.useState)(0);(0,m.useEffect)(()=>{if(!n||!Wz.due(t,Date.now()))return;let i=!0;return e.request(`browser.probe`,{url:t,origin:window.location.origin}).then(e=>Wz.set(t,e,Date.now()),()=>Wz.set(t,null,Date.now())).then(()=>i&&r(e=>e+1)),()=>{i=!1}},[e,t,n]);let i=n?Wz.get(t):void 0;return{pending:n&&!i,probe:i?.probe??null}}function Kz({d:e}){return(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:e})})}function qz(e){let t=UL(e.model,e.taskId);return(0,W.jsxs)(`div`,{className:pr,children:[t.length>0&&(0,W.jsx)(`div`,{className:`flex w-[36ch] max-w-full flex-col text-left text-ink`,children:t.map(t=>(0,W.jsxs)(`button`,{type:`button`,className:gi({size:`file`}),title:t.url,onClick:()=>e.onOpen(t.url),children:[(0,W.jsx)(`span`,{className:`row-title min-w-0 flex-1 truncate`,children:t.command}),(0,W.jsx)(`span`,{className:`flex-none text-subtle`,children:`:${t.port}`})]},t.port))}),(0,W.jsx)(`p`,{children:H(t.length>0?`browser.empty`:`browser.emptyPorts`)})]})}var Jz=`M6.5 3.5h-3v9h9v-3M9.5 3.5h3v3M12.5 3.5l-5 5`;function Yz({model:e,taskId:t,tab:n,root:r,shown:i,restored:a,onClose:o,onNavigate:s,onStep:c}){U();let l=Ms(n),u=Cs(l),d=u===null?l:ws(u,r),[f,p]=(0,m.useState)(d),[h,g]=(0,m.useState)(null),[_,v]=(0,m.useState)(0),[b,x]=(0,m.useState)(!1),S=(0,m.useRef)(null),C=(0,m.useRef)(null),w=y(e.client.conn).hello?.peer?.local,T=l&&u===null?As(l,window.location,w):null;(0,m.useEffect)(()=>{p(d),g(null)},[d]),(0,m.useEffect)(()=>{let e=C.current;e&&u!==null&&document.activeElement!==e&&(e.scrollLeft=e.scrollWidth)},[f,u,i]);let E=e=>{let t=Ts(e,r),n=t===`outside`?null:t??ks(e);g(t===`outside`?`outside`:n===null&&e.trim()!==``?`invalid`:null),n!==null&&(n===l?(p(d),v(_+1)):s(n))},D=T?new URL(l).hostname:``,O=T===`yes`&&l.startsWith(`https:`)&&!Es(D),{pending:k,probe:A}=Gz(e.client,l,O),j=l&&T?js(l,T,A):null,M=T===`yes`&&!j&&!k,N=j?H(`browser.${j.key}`,{host:j.host}):T===null&&u===null?H(`browser.${h??`empty`}`):null;return(0,W.jsxs)(`div`,{className:mr,children:[(0,W.jsxs)(`form`,{className:hr,onSubmit:e=>{e.preventDefault(),E(f)},children:[(0,W.jsx)(`button`,{type:`button`,className:Xn({small:!0}),disabled:n.at<=0,title:H(`browser.back`),"aria-label":H(`browser.back`),onClick:()=>c(n.at-1),children:(0,W.jsx)(Kz,{d:`M10 3.5 5.5 8l4.5 4.5`})}),(0,W.jsx)(`button`,{type:`button`,className:Xn({small:!0}),disabled:n.at>=n.urls.length-1,title:H(`browser.forward`),"aria-label":H(`browser.forward`),onClick:()=>c(n.at+1),children:(0,W.jsx)(Kz,{d:`M6 3.5 10.5 8 6 12.5`})}),(0,W.jsx)(`button`,{type:`button`,className:Xn({small:!0}),disabled:!M&&u===null,title:H(`browser.reload`),"aria-label":H(`browser.reload`),onClick:()=>v(_+1),children:(0,W.jsx)(Kz,{d:`M12.5 8a4.5 4.5 0 1 1-1.4-3.3M12.5 2.5v2.7H9.8`})}),(0,W.jsx)(`input`,{ref:C,className:`browser-url mono ${gr}`,value:f,placeholder:H(`browser.placeholder`),"aria-label":H(`browser.address`),"aria-invalid":h!==null,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,inputMode:`url`,onChange:e=>p(e.target.value)}),JI()&&(0,W.jsx)(G,{variant:b&&M?`iconOn`:`icon`,disabled:!M,title:H(`browser.annotate`),"aria-label":H(`browser.annotate`),"aria-pressed":b&&M,onClick:()=>x(!b),children:(0,W.jsx)(Kz,{d:`M3 13l.6-2.6L10.9 3.1l2 2L5.6 12.4zM9.6 4.4l2 2`})}),l&&u===null?(0,W.jsx)(`a`,{className:Xn({small:!0}),href:l,target:`_blank`,rel:`noopener noreferrer`,title:H(`browser.openTab`),"aria-label":H(`browser.openTab`),children:(0,W.jsx)(Kz,{d:Jz})}):(0,W.jsx)(`button`,{type:`button`,className:Xn({small:!0}),disabled:!0,"aria-label":H(`browser.openTab`),children:(0,W.jsx)(Kz,{d:Jz})})]}),u===null?M?(0,W.jsxs)(`div`,{ref:S,className:vr,children:[(0,W.jsx)(`iframe`,{className:_r,src:l,title:l,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`,referrerPolicy:`no-referrer`},`${l}#${_}`),b&&(0,W.jsx)(VL,{model:e,taskId:t,url:l,target:S,onClose:()=>x(!1)},`${l}#${_}`)]}):T===null&&h===null?(0,W.jsx)(qz,{model:e,taskId:t,onOpen:s}):N?(0,W.jsx)(`p`,{className:pr,children:N}):null:(0,W.jsx)(Hz,{model:e,view:{taskId:t,path:u,scope:`working`,file:!0},active:i,restored:a,onClose:o},`${u}#${_}#${n.read??``}`)]})}var Xz=`scrollbar-none flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto p-3`,Zz=`m-0 p-3 font-mono text-meta text-muted`,Qz=`flex items-baseline justify-between gap-3 font-mono text-meta normal-nums`,$z=`flex h-1.5 w-full gap-px overflow-hidden rounded-full bg-inset`,eB=`h-full min-w-[2px] flex-none`,tB=`m-0 flex list-none flex-col p-0`,nB=`-mx-1 flex h-5.5 min-w-0 items-center gap-2 rounded-xs px-1 font-mono text-meta normal-nums`,rB=`mt-2`,iB=`size-2 flex-none rounded-full bg-line`,aB=`flex min-w-0 flex-1 items-center gap-1.5`,oB=`min-w-0 truncate text-muted`,sB=`w-[7ch] flex-none text-right text-ink`,cB=`w-[6ch] flex-none text-right text-muted`,lB=`group/fold`,uB=`${nB} cursor-pointer list-none hover:bg-hover focus-visible:outline focus-visible:outline-1 focus-visible:outline-focus [&::-webkit-details-marker]:hidden`,dB=`m-0 flex list-none flex-col p-0`,fB=`${nB} pl-5`,pB=`flex min-w-0 flex-1 overflow-hidden`,mB=`min-w-0 truncate text-subtle`,hB=`flex-none text-muted`,gB=`w-[7ch] flex-none text-right text-muted`,_B=`w-[6ch] flex-none`,vB=1e4,yB={system:`var(--info)`,system_prompt:`var(--info)`,system_tools:`var(--success)`,mcp_tools:`var(--warning)`,mcp_instructions:`var(--warning)`,custom_agents:`var(--ink)`,memory_files:`var(--merged)`,skills:`var(--muted)`,messages:`var(--accent)`,used:`var(--accent)`},bB=[`var(--info)`,`var(--success)`,`var(--warning)`,`var(--merged)`];function xB({model:e,task:t,active:n}){U();let r=y(e.client.conn),i=y(e.selection),a=y(e.tabs)[t.id]??[],o=i.taskId===t.id?a.find(e=>e.id===i.tabId):void 0,s=(o?.kind===`engine`?o:a.find(e=>e.kind===`engine`))?.id??null,[c,l]=(0,m.useState)({kind:`loading`}),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(``);if((0,m.useEffect)(()=>{if(!n||r.state!==`open`)return;let i=`${t.id}::${s}`;if(f.current!==i&&l({kind:`loading`}),f.current=i,!s){l({kind:`ready`,meter:null});return}let a=!0,o=n=>e.client.request(`context.usage`,{taskId:t.id,tabId:s,probe:n}).then(e=>a&&l({kind:`ready`,meter:e.meter})).catch(e=>a&&l(t=>t.kind===`ready`?t:{kind:`failed`,error:nO(e)})),c=()=>{d(!0),o(!0).finally(()=>a&&d(!1))};o(!1).then(c);let u=Oi(vB,c);return()=>{a=!1,d(!1),u()}},[e,n,r.state,t.id,s]),c.kind===`loading`)return(0,W.jsx)(`p`,{className:Zz,children:H(`context.loading`)});if(c.kind===`failed`)return(0,W.jsx)(`p`,{className:Zz,children:H(`context.failed`,{error:c.error})});if(!c.meter)return(0,W.jsx)(`p`,{className:Zz,children:H(`context.none`)});let p=c.meter,h=p.rows.filter(e=>e.share!==void 0),g=e=>e.share===void 0?void 0:yB[e.key]??bB[h.indexOf(e)%bB.length],_=`${p.approximate?`~`:``}${CB(p.used)}`;return(0,W.jsxs)(`div`,{className:Xz,children:[(0,W.jsxs)(`div`,{className:Qz,children:[(0,W.jsx)(`span`,{className:`text-ink`,children:p.percent===null?H(`context.usedTokens`,{tokens:_}):H(`context.used`,{percent:wB(p.percent)})}),p.window!==null&&(0,W.jsxs)(`span`,{className:`text-muted`,children:[_,` / `,CB(p.window)]})]}),(0,W.jsx)(`div`,{className:$z,role:`meter`,"aria-valuenow":Math.round(p.percent??100),"aria-valuemin":0,"aria-valuemax":100,children:h.map(e=>(0,W.jsx)(`span`,{className:eB,style:{width:`${e.share}%`,background:g(e)}},e.key))}),(0,W.jsx)(`ul`,{className:tB,children:p.rows.map((e,t)=>{let n=`context.part.${e.key}`,r=H(n)===n?e.label??e.key:H(n),i=g(e),a=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:iB,style:i?{background:i}:void 0}),(0,W.jsxs)(`span`,{className:aB,children:[(0,W.jsx)(`span`,{className:oB,title:r,children:r}),e.items&&(0,W.jsx)(`span`,{className:`inline-block flex-none text-subtle group-open/fold:rotate-90`,children:`›`})]}),(0,W.jsx)(`span`,{className:sB,children:CB(e.tokens)}),(0,W.jsx)(`span`,{className:cB,children:e.deferred?`—`:wB(e.tokens/(p.window??p.used)*100)})]}),o=(e.deferred?!p.rows[t-1]?.deferred:e.share===void 0)?rB:void 0;if(!e.items)return(0,W.jsx)(`li`,{className:o,children:(0,W.jsx)(`div`,{className:nB,children:a})},e.key);let s=e.items.reduce((e,t)=>e+t.tokens,0),c=(e.itemCount??e.items.length)-e.items.length;return(0,W.jsx)(`li`,{className:o,children:(0,W.jsxs)(`details`,{className:lB,children:[(0,W.jsx)(`summary`,{className:uB,children:a}),(0,W.jsxs)(`ul`,{className:dB,children:[e.items.map(e=>(0,W.jsx)(SB,{name:e.name,tokens:e.tokens},e.name)),c>0&&(0,W.jsx)(SB,{name:H(`context.more`,{count:c}),tokens:e.tokens-s})]})]})},e.key)})}),u&&h.length<2&&(0,W.jsx)(`p`,{className:`m-0 font-mono text-meta text-subtle`,children:H(`context.probing`)})]})}function SB({name:e,tokens:t}){let n=e.lastIndexOf(`/`)+1;return(0,W.jsxs)(`li`,{className:fB,title:e,children:[(0,W.jsxs)(`span`,{className:pB,children:[n>0&&(0,W.jsx)(`span`,{className:`min-w-0 truncate text-subtle`,children:e.slice(0,n)}),(0,W.jsx)(`span`,{className:n>0?hB:mB,children:e.slice(n)})]}),(0,W.jsx)(`span`,{className:gB,children:CB(Math.max(0,t))}),(0,W.jsx)(`span`,{className:_B})]})}function CB(e){return e>=1e6?`${+(e/1e6).toFixed(1)}M`:e>=1e3?`${+(e/1e3).toFixed(1)}k`:String(e)}function wB(e){return e>0&&e<.1?`<0.1%`:`${e<10?+e.toFixed(1):Math.round(e)}%`}var TB=3;function EB({model:e,task:t}){U();let n=t.autoFixCi,r=n=>void e.client.request(`task.autoFixCi`,{taskId:t.id,enabled:n}).catch(e=>z(e instanceof Error?e.message:String(e),`error`));return(0,W.jsx)(`div`,{className:`flex items-center gap-3 px-2 pt-1 font-mono text-meta`,children:n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:n.stopped?Sp.attention:`text-muted`,title:H(`files.autoFix.hint`),children:H(n.stopped?`files.autoFix.stopped`:`files.autoFix.count`,{n:n.attempts,max:TB})}),(0,W.jsx)(G,{hit:`tight`,onClick:()=>r(!1),children:H(`files.autoFix.off`)})]}):(0,W.jsx)(G,{hit:`tight`,title:H(`files.autoFix.hint`),onClick:()=>r(!0),children:H(`files.autoFix.on`)})})}function DB(e){let t=e.pr;return!!t&&t.number!==void 0&&!e.machine&&(t.lifecycle===`open`||t.lifecycle===`ready_to_merge`)}function OB(e){let t={fail:0,pending:0,pass:0,skipped:0};for(let n of e)t[n.state]++;return t}function kB(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function AB(e,t){let{startedAt:n,completedAt:r,durationMs:i}=e;return e.state===`pending`?n?{key:`files.checks.runningFor`,vars:{elapsed:kB(t-n)}}:null:i===null?r?{key:`files.checks.finishedAgo`,vars:{age:Ul(t-r)}}:null:r?{key:`files.checks.tookAgo`,vars:{duration:kB(i),age:Ul(t-r)}}:{key:`files.checks.took`,vars:{duration:kB(i)}}}function jB(e){let t=[],n=e.mergeState.toUpperCase();e.draft&&t.push({key:`files.merge.draft`,tone:`warning`}),e.mergeable.toUpperCase()===`CONFLICTING`||n===`DIRTY`?t.push({key:`files.merge.conflicts`,tone:`attention`}):n===`BEHIND`?t.push({key:`files.merge.behind`,tone:`warning`}):n===`UNSTABLE`?t.push({key:`files.merge.unstable`,tone:`warning`}):n===`BLOCKED`?t.push({key:`files.merge.blocked`,tone:`warning`}):n===`CLEAN`&&!e.draft&&t.push({key:`files.merge.clean`,tone:`success`});let r=e.review.toUpperCase();return r===`APPROVED`?t.push({key:`files.merge.approved`,tone:`success`}):r===`CHANGES_REQUESTED`?t.push({key:`files.merge.changes`,tone:`attention`}):r===`REVIEW_REQUIRED`&&t.push({key:`files.merge.reviewRequired`,tone:`warning`}),t}var MB=`flex flex-col gap-0.5 px-2 pb-2 font-mono text-meta`,NB=`flex items-start gap-2`,PB=`flex min-w-0 flex-1 flex-wrap items-center gap-x-2 text-left text-ink`,FB={pass:{glyph:`✓`,tone:`success`},fail:{glyph:`✗`,tone:`attention`},pending:{glyph:`●`,tone:`warning`},skipped:{glyph:`–`,tone:`muted`}};function IB({model:e,task:t}){U();let n=t.pr,r=t.id,[i,a]=(0,m.useState)(()=>X(e,`pr.checks`,{taskId:r})??null),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)({}),[u,d]=(0,m.useState)(0),f=`${n?.number}:${n?.checkState}:${n?.mergeable}:${n?.reviewDecision}`;(0,m.useEffect)(()=>{let t=!0,n={taskId:r};return e.client.request(`pr.checks`,u>0?{...n,fresh:!0}:n).then(r=>{t&&(rd(e,`pr.checks`,n,r),a(r))},e=>t&&a({outcome:`unavailable`,detail:e instanceof Error?e.message:String(e)})),()=>{t=!1}},[e,r,f,u]);let p=t=>{let n=`${t.runId}:${t.name}`;if(c[n]){l(({[n]:e,...t})=>t);return}l(e=>({...e,[n]:{state:`loading`}})),e.client.request(`pr.checkLog`,{taskId:r,runId:t.runId,job:t.name}).then(e=>e.outcome===`ok`?{state:`text`,text:e.tail}:e.outcome===`none`?{state:`note`,text:H(`files.checks.noLog`)}:{state:`note`,text:H(`files.checks.logUnavailable`,{detail:e.detail})}).catch(e=>({state:`note`,text:H(`files.checks.logUnavailable`,{detail:e instanceof Error?e.message:String(e)})})).then(e=>l(t=>n in t?{...t,[n]:e}:t))},h=(0,W.jsx)(G,{hit:`tight`,className:`flex-none whitespace-nowrap`,onClick:()=>d(e=>e+1),children:H(`files.checks.refresh`)});if(!i)return(0,W.jsx)(`div`,{className:MB,children:(0,W.jsx)(`div`,{className:NB,children:(0,W.jsxs)(`span`,{className:`flex-1 text-muted`,children:[H(`files.checks.title`),` `,H(`files.checks.loading`)]})})});if(i.outcome!==`ok`)return(0,W.jsx)(`div`,{className:MB,children:(0,W.jsxs)(`div`,{className:NB,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 text-muted wrap-anywhere`,children:i.outcome===`none`?H(`files.checks.none`):H(`files.checks.unavailable`,{detail:i.detail})}),h]})});let g=OB(i.checks),_=Date.now(),v=o??(g.fail>0||g.pending>0),y=jB(i);return(0,W.jsxs)(`div`,{className:MB,children:[(0,W.jsxs)(`div`,{className:NB,children:[(0,W.jsxs)(G,{variant:`row`,className:PB,"aria-expanded":v,disabled:i.total===0,onClick:()=>s(!v),children:[i.total>0&&(0,W.jsx)(hs,{right:!v}),(0,W.jsx)(`span`,{children:i.total===0?H(`files.checks.none`):H(`files.checks.summary`,{pass:g.pass+g.skipped,total:i.total})}),g.fail>0&&(0,W.jsx)(`span`,{className:Sp.attention,children:H(`files.checks.failed`,{count:g.fail})}),g.pending>0&&(0,W.jsx)(`span`,{className:Sp.warning,children:H(`files.checks.running`,{count:g.pending})}),y.map(e=>(0,W.jsx)(`span`,{className:Sp[e.tone],children:H(e.key)},e.key))]}),h]}),v&&i.checks.map(e=>{let{glyph:t,tone:n}=FB[e.state],r=AB(e,_),i=`${e.runId}:${e.name}`,a=c[i];return(0,W.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline gap-2 pl-4`,children:[(0,W.jsx)(`span`,{className:`w-[1ch] flex-none text-center ${Sp[n]}`,children:t}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:e.name}),r&&(0,W.jsx)(`span`,{className:`flex-none text-subtle`,children:H(r.key,r.vars)}),e.state===`fail`&&e.runId&&(0,W.jsx)(G,{hit:`tight`,className:`flex-none whitespace-nowrap`,onClick:()=>p(e),children:H(a?`files.checks.hideLog`:`files.checks.log`)})]}),a&&(0,W.jsx)(`pre`,{className:`m-0 ml-4 mb-1 max-h-40 overflow-y-auto rounded-sm border-hairline border-line bg-inset px-2 py-1.5 whitespace-pre-wrap wrap-anywhere text-muted`,children:a.state===`loading`?H(`files.checks.loading`):a.text})]},`${e.name}:${e.url}`)}),v&&i.total>i.checks.length&&(0,W.jsx)(`span`,{className:`pl-4 text-subtle`,children:H(`files.checks.more`,{count:i.total-i.checks.length})})]})}function LB({model:e,task:t}){return DB(t)?(0,W.jsxs)(`div`,{onKeyDown:e=>e.stopPropagation(),children:[(0,W.jsx)(IB,{model:e,task:t}),(0,W.jsx)(EB,{model:e,task:t})]}):null}function RB(e,t){let n={children:new Map,file:!1};for(let t of e){let e=n;for(let n of t.split(`/`)){let t=e.children.get(n);t||(t={children:new Map,file:!1},e.children.set(n,t)),e=t}e.file=!0}let r=[],i=(e,n,a)=>{let o=[...e.children].sort(([e,t],[n,r])=>{let i=t.children.size>0&&!t.file;return i===(r.children.size>0&&!r.file)?e.localeCompare(n):i?-1:1});for(let[e,s]of o){let o=s.children.size>0&&!s.file,c=o?`${n}${e}/`:`${n}${e}`,l=o&&t.has(c);r.push({path:c,name:e,depth:a,dir:o,open:l}),l&&i(s,c,a+1)}};return i(n,``,0),r}var zB={start:`\x1B[200~`,end:`\x1B[201~`};function BB(e,t){return e.engineTarget(t).tabId??e.tabs.get()[t]?.find(e=>e.kind===`engine`)?.id}async function VB(e,t,n){let r=BB(e,t);if(!r)return z(H(`files.stripNoEngine`),`error`),!1;try{return e.selection.get().tabId!==r&&e.select(t,r),await e.client.request(`term.input`,{stream:id(t,r),data:`${zB.start}${n}${zB.end}`}),z(H(`files.stripFilled`)),!0}catch(e){return z(e instanceof Error?e.message:String(e),`error`),!1}}function HB(e){let t=e.kind===`task`&&!e.noWorktree&&!e.machine&&!e.archived,n=e.changes;return t&&!!n&&`added`in n&&n.added+n.deleted>0}function UB(e){return[...HB(e)?[`commit`]:[],...WB(e)]}function WB(e){let t=e.pr;if(!t)return e.kind===`task`&&!e.noWorktree&&!e.machine&&!e.archived&&!e.sessionPrs?.length?[`createPR`]:[];if(t.lifecycle===`merged`)return e.archived?[]:[`archive`];if(t.lifecycle!==`open`&&t.lifecycle!==`ready_to_merge`)return[];let n=[];return((t.mergeable??``).toUpperCase()===`CONFLICTING`||e.prChip===`conflict`)&&n.push(`conflicts`),t.checkState===`failing`&&n.push(`fixCI`),(t.reviewDecision??``).toUpperCase()===`CHANGES_REQUESTED`&&n.push(`comments`),n}async function GB(e,t,n){try{let r=await e.client.request(`task.prompt`,{taskId:t.id,kind:n});r.outcome===`unavailable`?z(H(`files.stripUnavailable`,{detail:r.detail??``}),`error`):r.outcome===`none`||!r.prompt?z(H(`files.stripNothing`),`error`):await VB(e,t.id,r.prompt)}catch(e){z(e instanceof Error?e.message:String(e),`error`)}}var KB={commit:`files.stripCommit`,createPR:`files.stripCreate`,conflicts:`files.stripConflicts`,fixCI:`files.stripFixCi`,comments:`files.stripComments`,archive:`files.stripArchive`};function qB({model:e,task:t}){let n=UB(t);return n.length===0?null:(0,W.jsx)(`div`,{className:`flex flex-wrap justify-end gap-x-3.5 gap-y-1 px-2 pb-2 font-mono text-meta whitespace-nowrap`,children:n.map(n=>(0,W.jsx)(G,{onClick:()=>n===`archive`?void yb(e,t):void GB(e,t,n),children:H(KB[n])},n))})}function JB({model:e,task:t,narrow:n=!1}){U();let[r,i]=(0,m.useState)(()=>X(e,`files.list`,{taskId:t.id})?.files??null),[a,o]=(0,m.useState)(()=>Dz(X(e,`diff.files`,{taskId:t.id})?.files??[])),[s,c]=(0,m.useState)(null),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(new Set),[p,h]=(0,m.useState)(0),[g,_]=(0,m.useState)(0),v=(0,m.useRef)(null),b=y(I),x=y(e.client.conn),S=JSON.stringify(t.changes??null);(0,m.useEffect)(()=>{let n=!0;return Z(e,`files.list`,{taskId:t.id}).then(e=>{n&&(i(e.files),c(e.root??null),u(null))},e=>n&&u(Zo(e))),()=>{n=!1}},[e,t.id,S,g,x.state]),(0,m.useEffect)(()=>{let n=!0;return Z(e,`diff.files`,{taskId:t.id}).then(e=>n&&o(Dz(e.files)),()=>{}),()=>{n=!1}},[e,t.id,S,g,x.state]);let C=r!==null,w=RB(r??[],d).map(e=>({path:e.path,label:e.name,depth:e.depth,dir:e.dir,open:e.open,state:a.get(e.path)})),T=Math.min(p,Math.max(0,w.length-1)),E=w[T],D=(e,t)=>f(n=>{let r=new Set(n);return t??!r.has(e)?r.add(e):r.delete(e),r}),O=e=>Qc(t.id,e),k=e=>Zc({taskId:t.id,path:e,scope:`working`}),A=n=>{if(!b?.startsWith(`${t.id}::`)){z(H(`files.mentionNoEngine`),`error`);return}e.client.request(`term.input`,{stream:b,data:`@${n} `}).catch(e=>z(String(e),`error`))},j=(n,r,i)=>t.machine?z(H(`files.remoteNoExternal`,{host:t.machine.label}),`error`):void e.client.request(n,{taskId:t.id,path:r}).then(()=>i&&z(i)).catch(e=>z(e instanceof Error?e.message:String(e),`error`)),M=e=>j(`file.openExternal`,e,H(`taskops.openedExternal`)),N=n=>void e.client.request(`file.openTerminal`,{taskId:t.id,path:n}).catch(e=>z(e instanceof Error?e.message:String(e),`error`)),ee=e=>{let t=e.dir?e.path.slice(0,-1):e.path;return[{label:H(`files.menu.attach`),key:`a`,run:()=>A(e.path)},{label:H(`files.menu.copy`),children:[{label:H(`files.menu.copyRelative`),run:()=>void Qj(t,t)},...s?[{label:H(`files.menu.copyAbsolute`),run:()=>void Qj(`${s}/${t}`,t)}]:[],{label:H(`files.menu.copyName`),run:()=>void Qj(e.label,t)}]},{label:H(`files.menu.diff`),key:`d`,section:`open`,run:()=>k(e.path)},...e.dir?[]:[{label:H(`files.menu.openExternal`),key:`o`,section:`open`,run:()=>M(e.path)}],{label:H(`files.menu.reveal`),section:`open`,run:()=>j(`file.reveal`,t)},{label:H(`files.menu.terminal`),section:`terminal`,run:()=>N(t)}]};return(0,W.jsxs)(`div`,{className:`group/pane flex min-h-0 min-w-0 flex-1 flex-col outline-none ${n?`px-1.5 pt-2.5 pb-2`:`pt-0.5 pr-1.5 pb-1.5 pl-0`}`,tabIndex:0,ref:v,onKeyDown:e=>{let t=e.key;if(t===`j`||t===`ArrowDown`)h(Math.min(w.length-1,T+1));else if(t===`k`||t===`ArrowUp`)h(Math.max(0,T-1));else if((t===`l`||t===`ArrowRight`)&&E?.dir)D(E.path,!0);else if((t===`h`||t===`ArrowLeft`)&&E?.dir)D(E.path,!1);else if(t===`r`)_(e=>e+1);else if(t===`D`&&e.shiftKey)k(`.`);else if(t===`d`&&E)k(E.path);else if(t===`Enter`&&E)E.dir?D(E.path):O(E.path);else if(t===`a`&&E)A(E.path);else if(t===`o`&&E&&!E.dir)M(E.path);else return;e.preventDefault()},children:[(0,W.jsx)(qB,{model:e,task:t}),(0,W.jsx)(LB,{model:e,task:t}),(0,W.jsx)(WL,{model:e,task:t}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[l&&(0,W.jsx)(`p`,{className:`mono text-error`,children:l}),!l&&C&&w.length===0&&(0,W.jsx)(`p`,{className:`mx-2.5 my-3 font-mono text-meta text-subtle`,children:H(`files.emptyAll`)}),w.map((e,t)=>(0,W.jsxs)(`button`,{type:`button`,className:gi({selected:t===T,size:n?`file-narrow`:`file`}),style:{paddingLeft:8+e.depth*14},title:e.path,onContextMenu:n=>{h(t),xI(n,ee(e))},onClick:()=>{h(t),v.current?.focus(),e.dir?D(e.path):O(e.path)},children:[(0,W.jsx)(`span`,{className:xi,children:e.dir?(0,W.jsx)(hs,{right:!e.open}):null}),(0,W.jsx)(`span`,{className:`${_i} ${e.state?Sp[Tz[e.state]]:``}`,children:e.label}),e.state&&(0,W.jsx)(`span`,{className:`w-[1ch] flex-none text-center font-mono ${Sp[Tz[e.state]]}`,title:H(`files.state.${e.state}`),children:e.dir?`•`:Ez[e.state]})]},e.path))]})]})}var YB={entries:[],failed:new Set},XB=[`command`,`cmd`,`file_path`,`path`,`pattern`,`query`,`url`,`description`,`prompt`],ZB=100;function QB(e){let t=(e.split(`
|
|
73
|
-
`).find(e=>e.trim()!==``)??``).trim();return t.length>ZB?`${t.slice(0,99)}…`:t}function $B(e){if(typeof e==`string`)return QB(e);if(!e||typeof e!=`object`)return``;let t=e,n=e=>typeof e==`string`?e:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e.join(` `):``;for(let e of XB){let r=n(t[e]);if(r.trim())return QB(r)}for(let e of Object.values(t)){let t=n(e);if(t.trim())return QB(t)}return``}function eV(e){return e===`user`||e===`assistant`||e===`system`?e:null}function tV(e,t){let n=[],r=[];return e.forEach((e,i)=>{let a=eV(e.role);if(!a)return;let o=[],s=[];for(let t of e.blocks??[])t.type===`text`&&t.text?.trim()?o.push(t.text.trim()):t.type===`tool_call`?s.push({callId:t.callId??``,name:t.name??`tool`,summary:$B(t.input)}):t.type===`tool_result`&&t.isError&&t.callId&&r.push(t.callId);(o.length!==0||s.length!==0)&&n.push({index:t+i,role:a,at:e.timestamp??``,text:o.join(`
|
|
74
|
-
|
|
75
|
-
`),tools:s})}),{entries:n,failed:r}}function nV(e,t,n){let r=tV(t,n),i=new Map(e.entries.map(e=>[e.index,e]));for(let e of r.entries)i.set(e.index,e);let a=r.failed.length>0?new Set([...e.failed,...r.failed]):e.failed;return{entries:[...i.values()].sort((e,t)=>e.index-t.index),failed:a}}function rV(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.text.toLowerCase().includes(n)||e.tools.some(e=>`${e.name} ${e.summary}`.toLowerCase().includes(n))).map(e=>e.index):[]}var iV=e=>e.replace(/[*_`]+/g,``).replace(/[…\s]+/g,` `).trim().toLowerCase();function aV(e,t){let n=e.find(e=>e.at===t.at&&e.role===t.role);if(n)return n.index;let r=iV(t.snippet);return r?e.find(e=>e.role===t.role&&iV(e.text).includes(r))?.index??null:null}function oV(e,t){let n=e[0];if(!n)return!0;let[r,i]=[Date.parse(n.at),Date.parse(t.at)];return Number.isNaN(r)||Number.isNaN(i)?!0:r>i}function sV(e,t){let n=e.tools.map(e=>`- \`${e.name}\`${e.summary?` ${e.summary}`:``}${t.has(e.callId)?` (failed)`:``}`);return[e.text,n.join(`
|
|
76
|
-
`)].filter(e=>e!==``).join(`
|
|
77
|
-
|
|
78
|
-
`)}function cV(e,t){return e.text===``?sV(e,t):e.text}function lV(e,t,n,r){return`# ${e}\n\n${t.map(e=>`${`## ${r[e.role]}${e.at?` · ${e.at}`:``}`}\n\n${sV(e,n)}`).join(`
|
|
79
|
-
|
|
80
|
-
`)}\n`}var uV=50;function dV(e,t){let[n,r]=(0,m.useState)({kind:`loading`}),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(n);o.current=n;let s=(0,m.useRef)(!1),c=(0,m.useRef)(0),l=(0,m.useCallback)(n=>e.client.request(`output.read`,{taskId:t,limit:uV,...n}),[e,t]),u=(0,m.useCallback)(async()=>{let e=++c.current;s.current=!0;try{let t=await l({});if(e!==c.current)return;if(t.source===`terminal`||!t.history){r({kind:`terminal`,tail:t.terminal?.tail??[]});return}let n=nV(YB,t.history.messages??[],t.history.firstIndex??0);r({kind:`ready`,transcript:n,cursor:t.cursor??null,older:t.olderCursor??null})}catch(t){e===c.current&&r({kind:`error`,message:K(t)})}finally{e===c.current&&(s.current=!1)}},[l]);(0,m.useEffect)(()=>(r({kind:`loading`}),u(),()=>{c.current++,s.current=!1}),[u]);let d=(0,m.useCallback)(async()=>{let e=o.current;if(s.current)return;if(e.kind===`terminal`)return u();if(e.kind!==`ready`||!e.cursor)return;let t=c.current;s.current=!0;try{let n=await l({cursor:e.cursor,source:`history`});if(t!==c.current)return;r(e=>e.kind===`ready`?{...e,transcript:nV(e.transcript,n.history?.messages??[],n.history?.firstIndex??0),cursor:n.cursor??e.cursor}:e)}catch{t===c.current&&(s.current=!1,await u())}finally{t===c.current&&(s.current=!1)}},[l,u]);return{state:n,paging:i,loadOlder:(0,m.useCallback)(async()=>{let e=o.current;if(s.current||e.kind!==`ready`||!e.older)return;let t=c.current;s.current=!0,a(!0);try{let n=await l({cursor:e.older,source:`history`});if(t!==c.current)return;r(e=>e.kind===`ready`?{...e,transcript:nV(e.transcript,n.history?.messages??[],n.history?.firstIndex??0),older:n.olderCursor??null}:e)}catch(e){t===c.current&&r({kind:`error`,message:K(e)})}finally{t===c.current&&(s.current=!1,a(!1))}},[l]),loadAll:(0,m.useCallback)(async()=>{let e=o.current;if(e.kind!==`ready`)return null;if(s.current||!e.older)return e.transcript;let t=c.current;s.current=!0,a(!0);let n=[],i=e.transcript;try{for(let r=e.older;r&&t===c.current;){let e=await l({cursor:r,source:`history`}),t={messages:e.history?.messages??[],firstIndex:e.history?.firstIndex??0};n.push(t),i=nV(i,t.messages,t.firstIndex),r=e.olderCursor??null}return t===c.current?(r(e=>e.kind===`ready`?{...e,transcript:n.reduce((e,t)=>nV(e,t.messages,t.firstIndex),e.transcript),older:null}:e),i):null}catch(e){return t===c.current&&r({kind:`error`,message:K(e)}),null}finally{t===c.current&&(s.current=!1,a(!1))}},[l]),refresh:d,reload:(0,m.useCallback)(()=>{r({kind:`loading`}),u()},[u])}}var fV=3e3,pV=80,mV=2500;function hV(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/markdown;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),URL.revokeObjectURL(n)}var gV=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})};function _V(e){let{entry:t}=e,n=H(t.role===`user`?`transcript.you`:t.role===`assistant`?`transcript.agent`:`transcript.system`);return(0,W.jsxs)(`article`,{className:_R(e),"data-index":t.index,children:[(0,W.jsxs)(`header`,{className:vR,children:[(0,W.jsx)(`span`,{className:yR(t.role),children:n}),(0,W.jsx)(`span`,{className:bR,children:gV(t.at)}),(0,W.jsx)(G,{className:xR,onClick:e.onCopy,children:H(`transcript.copy`)})]}),t.text!==``&&(0,W.jsx)(HR,{source:t.text,needle:e.needle}),t.tools.map((t,n)=>(0,W.jsxs)(`p`,{className:SR,title:`${t.name} ${t.summary}`,children:[(0,W.jsx)(`span`,{className:CR,children:IR(t.name,e.needle)}),(0,W.jsx)(`span`,{className:wR,children:IR(t.summary,e.needle)}),e.failed.has(t.callId)&&(0,W.jsx)(`span`,{className:`flex-none text-error`,children:H(`transcript.failed`)})]},n))]})}function vV({model:e,task:t,active:n}){U();let r=dV(e,t.id),{state:i}=r,[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(0),[l,u]=(0,m.useState)(null),d=(0,m.useRef)(null),f=(0,m.useRef)(!0),p=(0,m.useRef)(null),h=y(xb),g=i.kind===`ready`?i:null,_=(0,m.useMemo)(()=>g?.transcript.entries??[],[g?.transcript]),v=g?.transcript.failed??new Set,b=(0,m.useMemo)(()=>rV(_,a),[_,a]),x=b.length===0?0:Math.min(s,b.length-1),S=b[x]??null,C=e=>{f.current=!1,d.current?.querySelector(`[data-index="${e}"]`)?.scrollIntoView({block:`center`})},w=t.rowStatus?.kind,T=w===`running`||w===`needs-input`,{refresh:E}=r;(0,m.useEffect)(()=>{n&&E()},[n,w,E]),(0,m.useEffect)(()=>{if(!n||!T)return;let e=setInterval(()=>void E(),fV);return()=>clearInterval(e)},[n,T,E]),(0,m.useLayoutEffect)(()=>{let e=d.current;e&&(p.current?(e.scrollTop=p.current.top+(e.scrollHeight-p.current.height),p.current=null):f.current&&(e.scrollTop=e.scrollHeight))},[_]);let D=async()=>{let e=d.current;e&&(p.current={height:e.scrollHeight,top:e.scrollTop}),await r.loadOlder()};(0,m.useEffect)(()=>{if(!h||h.taskId!==t.id||!g||!n)return;let e=aV(_,h.hit);e===null?g.older&&oV(_,h.hit)?D():xb.set(null):(u(e),C(e),xb.set(null))},[h,g,_,n,t.id]),(0,m.useEffect)(()=>{if(l===null)return;let e=setTimeout(()=>u(null),mV);return()=>clearTimeout(e)},[l]),(0,m.useEffect)(()=>{c(0);let e=rV(_,a)[0];e!==void 0&&C(e)},[a]);let O=e=>{if(b.length===0)return;let t=(x+e+b.length)%b.length;c(t),C(b[t])},k=e=>{e.key===`Enter`&&!e.nativeEvent.isComposing?(e.preventDefault(),O(e.shiftKey?-1:1)):e.key===`Escape`&&a!==``&&(e.stopPropagation(),o(``))},A=e=>void navigator.clipboard.writeText(cV(e,v)).then(()=>z(H(`transcript.copied`)),()=>z(H(`menu.copyFailed`),`error`)),j=async()=>{let e=await r.loadAll();if(!e)return;let n={user:H(`transcript.you`),assistant:H(`transcript.agent`),system:H(`transcript.system`)};hV(`${t.label.replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-|-$/g,``)||`conversation`}.md`,lV(t.label,e.entries,e.failed,n))};return i.kind===`loading`?(0,W.jsx)(`div`,{className:dR,children:(0,W.jsx)(`p`,{className:hR,children:H(`transcript.loading`)})}):i.kind===`error`?(0,W.jsxs)(`div`,{className:dR,children:[(0,W.jsx)(`p`,{className:`${hR} text-error`,children:H(`transcript.error`,{error:i.message})}),(0,W.jsx)(`p`,{className:hR,children:(0,W.jsx)(G,{onClick:r.reload,children:H(`transcript.retry`)})})]}):i.kind===`terminal`?(0,W.jsxs)(`div`,{className:dR,children:[(0,W.jsx)(`p`,{className:hR,children:H(`transcript.noHistory`)}),(0,W.jsx)(`pre`,{className:`${gR} min-h-0 flex-1 overflow-y-auto`,children:i.tail.join(`
|
|
81
|
-
`)})]}):(0,W.jsxs)(`div`,{className:dR,children:[(0,W.jsxs)(`div`,{className:fR,children:[(0,W.jsx)(`input`,{className:`${Nr} ${pR}`,value:a,placeholder:H(`transcript.findPlaceholder`),"aria-label":H(`transcript.findPlaceholder`),spellCheck:!1,autoComplete:`off`,onChange:e=>o(e.target.value),onKeyDown:k}),a.trim()!==``&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`whitespace-nowrap text-muted`,children:b.length===0?H(`transcript.findNone`):H(`transcript.findCount`,{at:x+1,total:b.length})}),(0,W.jsx)(G,{onClick:()=>O(-1),disabled:b.length===0,children:H(`transcript.prev`)}),(0,W.jsx)(G,{onClick:()=>O(1),disabled:b.length===0,children:H(`transcript.next`)})]}),(0,W.jsx)(G,{onClick:()=>void j(),disabled:_.length===0,children:H(`transcript.export`)})]}),(0,W.jsxs)(`div`,{ref:d,className:mR,onScroll:e=>{let t=e.currentTarget;f.current=t.scrollHeight-t.scrollTop-t.clientHeight<pV,t.scrollTop<pV&&g?.older&&!r.paging&&D()},children:[g?.older&&(0,W.jsx)(`p`,{className:`m-0 px-3 py-2 font-mono text-meta text-subtle`,children:(0,W.jsx)(G,{onClick:()=>void D(),disabled:r.paging,children:H(`transcript.older`)})}),_.length===0&&(0,W.jsx)(`p`,{className:`m-0 px-3 py-2 font-mono text-meta text-subtle`,children:H(`transcript.empty`)}),_.map(e=>(0,W.jsx)(_V,{entry:e,failed:v,needle:a,flash:l===e.index,current:S===e.index,onCopy:()=>A(e)},e.index))]})]})}var yV={working:`review.scopeWorking`,branch:`review.scopeBranch`,task:`review.scopeTask`};function bV(e){return e.kind===`diff`?e.path===`.`?{text:H(yV[e.scope]),hint:H(`preview.whole`)}:{text:$s(e.path),hint:e.path}:{text:H(`panel.${e.kind}`),hint:H(`panel.${e.kind}`)}}function xV({taskId:e,kind:t,expand:n}){U();let r=y(bc),i=H(r?`panel.restore`:`panel.expand`);return(0,W.jsxs)(W.Fragment,{children:[n&&(0,W.jsx)(`button`,{type:`button`,className:Xn({tool:!0}),title:i,"aria-label":i,"aria-pressed":r,onClick:()=>bc.set(!r),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:r?`M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5l4-4M6.5 9.5l-4 4`:`M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5l-4.5 4.5M2.5 13.5 7 9`})})}),(0,W.jsx)(`button`,{type:`button`,className:Xn({tool:!0}),title:H(`panel.close`),"aria-label":H(`panel.close`),onClick:()=>tl(e,t),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]})}function SV({taskId:e,column:t,narrow:n}){if(U(),t.kind===`browser`)return(0,W.jsxs)(`div`,{className:nr(n),children:[(0,W.jsx)(LI,{taskId:e,column:t}),!n&&(0,W.jsx)(xV,{taskId:e,kind:`browser`,expand:!0})]});if(n&&t.kind!==`diff`)return null;let{text:r,hint:i}=bV(t);return(0,W.jsxs)(`div`,{className:nr(n),children:[(0,W.jsx)(`span`,{className:rr,title:i,children:r}),(0,W.jsx)(xV,{taskId:e,kind:t.kind,expand:!n})]})}var CV=e=>`${e.id}:${Ms(e)}`;function wV({model:e,task:t,column:n,restored:r}){let i=(0,m.useRef)([]);i.current=qs(i.current,n.active,n.tabs);let a=(0,m.useRef)(n.tabs.map(CV));return n.tabs.filter(e=>i.current.includes(e.id)).map(i=>(0,W.jsx)(`div`,{className:fr,hidden:i.id!==n.active,children:(0,W.jsx)(Yz,{model:e,taskId:t.id,tab:i,root:t.workspace,shown:i.id===n.active,restored:r&&a.current.includes(CV(i)),onClose:()=>rl(t.id,i.id),onNavigate:e=>nl(t.id,t=>Bs(t,i.id,e)),onStep:e=>nl(t.id,t=>Vs(t,i.id,e))})},i.id))}function TV({model:e,task:t,column:n,narrow:r,restored:i}){return n.kind===`browser`?(0,W.jsx)(wV,{model:e,task:t,column:n,restored:i}):(0,W.jsxs)(`div`,{className:fr,children:[n.kind===`files`&&(0,W.jsx)(JB,{model:e,task:t,narrow:r}),n.kind===`chat`&&(0,W.jsx)(vV,{model:e,task:t,active:!0}),n.kind===`quota`&&(0,W.jsx)(xB,{model:e,task:t,active:!0}),n.kind===`diff`&&(0,W.jsx)(Hz,{model:e,view:{taskId:t.id,path:n.path,scope:n.scope},active:!0,restored:i,onClose:()=>tl(t.id,`diff`)},`${t.id}:${n.path}:${n.scope}:${n.at??``}`)]})}function EV({taskId:e,kinds:t,index:n,body:r,slot:i}){U();let a=(0,m.useRef)(null);return(0,W.jsx)(`div`,{className:dr,style:{gridColumn:i},title:H(`panel.resizeSplit`),onPointerDown:e=>{let n=t.map(e=>r.current?.querySelector(`[data-kind="${e}"]`)?.getBoundingClientRect().width??0);a.current={x:e.clientX,widths:n},r.current?.classList.add(`is-resizing`),e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:t=>{let r=a.current;if(!r)return;let i=pc(r.widths,n,t.clientX-r.x,220);Jc(e,e=>dc(e,i))},onLostPointerCapture:()=>{a.current=null,r.current?.classList.remove(`is-resizing`)},onDoubleClick:()=>Jc(e,fc)})}function DV({panel:e}){U();let t=(0,m.useRef)(null);return(0,W.jsx)(RI,{edge:`left`,title:H(`panel.resize`),onPointerDown:n=>{t.current={x:n.clientX,width:e.current?.getBoundingClientRect().width??0},e.current?.classList.add(`is-resizing`),n.currentTarget.setPointerCapture(n.pointerId),pe(!0)},onPointerMove:e=>{let n=t.current;if(!n||e.clientX===n.x)return;let r=JN.get()?0:$N(qN.get()??280);vc.set(xc(n.width-(e.clientX-n.x),r))},onLostPointerCapture:()=>{t.current=null,e.current?.classList.remove(`is-resizing`),pe(!1)},onDoubleClick:()=>vc.set(null)})}var OV=e=>e.kind===`diff`?`diff:${e.path}:${e.scope}`:e.kind;function kV({model:e,task:t,narrow:n}){U();let r=Wc(t.id),i=y(hc),a=y(bc),o=(0,m.useRef)(null),s=(0,m.useRef)(null),c=i===`terminal`?`files`:i,l=n?Qs(r,c):void 0;(0,m.useEffect)(()=>{n&&!l&&Jc(t.id,e=>rc(e,c))},[n,l,c,t.id]);let u=n?l?[l]:[]:r.columns,d=u.map(e=>e.kind),f=(n?[1]:uc(r)).map((e,t)=>`${t>0?`var(--divider) `:``}minmax(0, ${e}fr)`).join(` `),p=(0,m.useRef)(u.map(OV));return(0,W.jsxs)(`aside`,{className:$n(n),ref:o,children:[!n&&!a&&(0,W.jsx)(DV,{panel:o}),(0,W.jsxs)(`div`,{className:er,ref:s,style:{gridTemplateColumns:f},children:[u.map(r=>(0,W.jsxs)(`section`,{className:tr,"data-kind":r.kind,style:{gridColumn:2*d.indexOf(r.kind)+1},children:[(0,W.jsx)(SV,{taskId:t.id,column:r,narrow:n}),(0,W.jsx)(TV,{model:e,task:t,column:r,narrow:n,restored:p.current.includes(OV(r))})]},r.kind)),!n&&u.slice(1).map((e,n)=>(0,W.jsx)(EV,{taskId:t.id,kinds:d,index:n,body:s,slot:2*n+2},`divider:${e.kind}`))]})]})}function AV({model:e,task:t,remoteHost:n,narrow:r=!1}){let i=Gc(t?.id??null);return!r&&!i?null:t?(0,W.jsx)(kV,{model:e,task:t,narrow:r},t.id):n?(0,W.jsx)(`aside`,{className:$n(!1),children:(0,W.jsx)(ng,{host:n,onMachines:()=>Py(e)})}):null}var jV=1500;function MV({model:e}){let t=e.client,n=y(t.conn),[r,i]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(n.state!==`connecting`)return i(!1);let e=window.setTimeout(()=>i(!0),jV);return()=>window.clearTimeout(e)},[n.state]),n.state===`open`||n.state===`connecting`&&!r?null:(0,W.jsxs)(`footer`,{className:Ln,children:[(0,W.jsx)(`span`,{className:Rn(n.state===`retrying`)}),(0,W.jsx)(`span`,{children:n.state===`retrying`?H(`status.retrying`,{count:n.failures}):H(`status.connecting`)}),n.state===`retrying`&&(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>t.retryNow(),children:H(`status.retry`)})]})}var NV=`rove.web.update.skipped`,PV=`rove.web.update.askedAt`;function FV(e){return!e.latest||!e.notify||e.latest===e.skipped||e.askedAt!==null&&e.now-e.askedAt<18e6?null:e.latest}function IV(){let e=nC.get(),t=FV({latest:e?.info?.hasUpdate?e.info.latest:null,notify:Ap.get().prefs.updateNotify,skipped:localStorage.getItem(NV),askedAt:Number(localStorage.getItem(PV))||null,now:Date.now()});!t||O.get()!==null||(localStorage.setItem(PV,String(Date.now())),O.set((0,W.jsx)(LV,{current:e?.current??``,latest:t,notes:e?.notes??[]})))}function LV(e){let[t]=e.notes;return(0,W.jsx)(Ci,{title:H(`updatePrompt.title`,{version:e.latest}),wide:e.notes.length>0,children:(0,W.jsxs)(`div`,{className:Kr,children:[(0,W.jsx)(`p`,{className:`text-muted`,children:H(`updatePrompt.body`,{current:e.current})}),e.notes.length===1&&t?(0,W.jsx)(tC,{body:t.body}):(0,W.jsx)(lC,{notes:e.notes}),(0,W.jsxs)(`div`,{className:Pr,children:[(0,W.jsx)(G,{onClick:()=>{localStorage.setItem(NV,e.latest),B()},children:H(`updatePrompt.skip`)}),(0,W.jsx)(G,{onClick:B,children:H(`updatePrompt.later`)}),(0,W.jsx)(G,{variant:`filled`,autoFocus:!0,onClick:()=>{B(),rC.set(!0),V(`update`)},children:H(`updatePrompt.yes`)})]})]})})}function RV({model:e,taskId:t,groupId:n}){U();let r=y(e.tasks),i=r?WE(r.tasks,n):[];return i.length<2||!i.some(e=>e.id===t)?null:(0,W.jsxs)(`nav`,{className:MD,"aria-label":H(`compare.menu`),children:[i.map((n,r)=>(0,W.jsxs)(G,{variant:`pill`,hit:`tight`,"aria-current":n.id===t,onClick:()=>e.select(n.id),children:[`[ `,(0,W.jsx)(Xg,{status:n.rowStatus}),r+1,` `,n.engine?.name??n.label,n.kept&&(0,W.jsx)(`span`,{className:`text-accent`,children:`✓`}),` ]`]},n.id)),(0,W.jsx)(G,{hit:`tight`,className:`ml-auto flex-none whitespace-nowrap`,onClick:()=>ve(n),children:H(`compare.strip`)})]})}var zV=e=>Lj(e)!==null,BV=e=>af(Lj(e)?.tab.split);function VV(e){let t=Lj(e),n=t?.tab.split;return t&&n?{...t,split:n,leaf:Pj(t.taskId,t.tab,n)}:null}To(()=>[{id:`workspace.split.right`,chords:[`ctrl+\\`],prefix:!1,surface:`workspace`,live:zV,run:e=>{let t=Lj(e);t&&zj(e,t.taskId,t.tab,`right`)}},{id:`workspace.split.down`,chords:[`ctrl+=`],prefix:!1,surface:`workspace`,live:zV,run:e=>{let t=Lj(e);t&&zj(e,t.taskId,t.tab,`down`)}},{id:`workspace.split.focus-next`,chords:[`f3`],prefix:!1,surface:`workspace`,live:BV,run:e=>{let t=VV(e);t&&Ij(t.taskId,t.tab,t.split,sf(t.split,t.leaf))}},{id:`workspace.split.close`,chords:[`w`],prefix:!0,surface:`workspace`,live:BV,run:e=>{let t=VV(e);t&&Bj(e,t.taskId,t.tab,t.leaf)}},{id:`workspace.split.rename`,chords:[`f2`],prefix:!1,surface:`workspace`,live:BV,run:e=>{let t=VV(e);t&&Vj(e,t.taskId,t.tab,t.leaf)}}]);var HV=4e3,UV=[{id:`leaf-1`,x:0,y:0,w:1,h:1,left:!1,top:!1}];function WV({model:e,taskId:t,tab:n}){let r=n.split;y(Nj);let i=r?Pj(t,n,r):`leaf-1`,a=r?cf(r,tf(n)):new Map,o=af(r),{prefs:s}=Lp(),c=y(e.tasks)?.tasks.find(e=>e.id===t)?.tabStatus?.[n.id]??n.status,l=n.kind===`engine`&&c?.reason===`dead`?c.since:null;(0,m.useEffect)(()=>{l!==null&&e.refreshTabsNow(t)},[l,e,t]),(0,m.useEffect)(()=>{if(!o)return;let n=window.setInterval(()=>{document.hidden||e.refreshTabsNow(t)},HV);return()=>window.clearInterval(n)},[o,e,t]);let u=l!==null&&n.alive!==!1?{code:n.exit?.code??null,since:l}:null,d=n.kind===`engine`&&c?.reason===`rate_limited`?{since:c.since}:null;return(0,W.jsx)(`div`,{className:Qt,children:(r?of(r.root):UV).map(c=>(0,W.jsxs)(`div`,{className:tn(o?s.splitStyle:null,{left:c.left,top:c.top,active:c.id===i}),style:{left:`calc(${c.x*100}% + var(--ml, 0px))`,top:`calc(${c.y*100}% + var(--mt, 0px))`,width:`calc(${c.w*100}% - var(--ml, 0px))`,height:`calc(${c.h*100}% - var(--mt, 0px))`},children:[(0,W.jsx)(LL,{client:e.client,model:e,engineExit:c.id===`leaf-1`?u:null,usageLimit:c.id===`leaf-1`?d:null,composer:n.kind===`engine`&&c.id===`leaf-1`,taskId:t,tabId:n.id,leafId:c.id,focused:c.id===i,onActivate:()=>r&&Fj(t,n.id,r,c.id),onExit:()=>{o?Rj(e,{taskId:t,tabId:n.id,action:`close`,leafId:c.id}):n.kind!==`engine`&&e.closeTab(t,n.id).catch(()=>{})}}),o&&(0,W.jsx)(`span`,{className:nn(s.splitStyle===`rule`,c.id===i),onContextMenu:r=>xI(r,Wj(e,t,n,c.id)),children:a.get(c.id)})]},c.id))})}var GV=/^[0-9a-f]{7,40}$/i;function KV(e,t){return t.sharesWorkspaceOf||!t.baseRef?null:e.find(e=>e.id!==t.id&&e.branch!==``&&e.branch===t.baseRef)||(GV.test(t.baseRef)&&t.parentTaskId?e.find(e=>e.id===t.parentTaskId)??null:null)}function qV(e,t){let n=[];for(let r=KV(e,t);r&&n.length<20&&!n.includes(r);r=KV(e,r))n.unshift(r);let r=e.filter(n=>!n.deleting&&KV(e,n)?.id===t.id).sort((e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``));if(n.length===0&&r.length===0)return null;let i=n[0]??t,a=i.baseRef&&!GV.test(i.baseRef)?i.baseRef:null;return{nodes:[...n,t,...r],at:n.length,base:a}}var JV=e=>e.pr?.lifecycle===`merged`;function YV(e){return e.nodes.find(e=>!JV(e))??null}function XV({model:e,taskId:t}){U();let n=y(e.tasks)?.tasks??[],r=n.find(e=>e.id===t),i=r?qV(n,r):null;if(!i)return null;let a=YV(i);return(0,W.jsxs)(`nav`,{className:MD,"aria-label":H(`compare.stackLabel`),children:[i.base&&(0,W.jsxs)(`span`,{className:`text-subtle`,children:[i.base,` ←`]}),i.nodes.map((n,r)=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-x-3.5`,children:[r>0&&(0,W.jsx)(`span`,{className:`text-subtle`,children:`←`}),(0,W.jsxs)(G,{variant:`pill`,hit:`tight`,"aria-current":n.id===t,onClick:()=>e.select(n.id),children:[`[ `,(0,W.jsx)(Xg,{status:n.rowStatus}),n.label||n.title,JV(n)?(0,W.jsx)(`span`,{className:`text-accent`,children:`✓`}):n.pr?.number?(0,W.jsx)(`span`,{children:`PR`}):null,` ]`]})]},n.id)),a&&!a.machine&&(0,W.jsx)(G,{hit:`tight`,className:`ml-auto flex-none whitespace-nowrap`,onClick:()=>void db(e,a),children:H(`compare.landBottom`)})]})}function ZV(e,t){return e===`never`?!1:e!==`multipleOnly`||t>=2}function QV({taskId:e}){U();let t=Wc(e),n=Gc(e);return(0,W.jsx)(`div`,{className:ur,children:mc.map(r=>{let i=n&&!!Qs(t,r);return(0,W.jsx)(`button`,{type:`button`,className:Xn({on:i}),title:H(`panel.${r}`),"aria-label":H(`panel.${r}`),"aria-pressed":i,onClick:()=>Xc(e,r),children:(0,W.jsx)(DI,{children:OI[r]})},r)})})}function $V({model:e,task:t,tabs:n,narrow:r}){let i=y(e.selection),{prefs:a}=Lp(),o=!ZV(a.tabStrip,n.length);return(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-0.5 font-mono text-meta/body transition-padding-left duration-220 ease-snap motion-reduce:transition-none rail-folded:min-h-6.5 rail-folded:pl-23`,role:`tablist`,children:[n.map((n,r)=>(0,W.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n.id===i.tabId,className:`group/tab flex items-center gap-1.5 whitespace-nowrap rounded-sm px-2.5 py-1 active:scale-97 motion-reduce:active:scale-none touch:select-none touch:touch-callout-none ${o?`hidden`:``} ${n.id===i.tabId?`bg-inset text-ink`:`text-muted hover:bg-hover data-menu-open:bg-hover`}`,onClick:()=>e.select(t.id,n.id),onContextMenu:r=>xI(r,T(rM(e,t,n),H(`menu.more`))),children:[(0,W.jsx)(`span`,{className:`text-subtle group-aria-selected/tab:text-accent`,children:r+1}),tf(n)]},n.id)),!r&&(0,W.jsx)(QV,{taskId:t.id})]})}function eH(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e))}function tH({model:e}){let t=U()===`zh`?na:ta,n=e.client,[r,i]=(0,m.useState)(()=>(X(n,`worktrees.list`,{network:!0})??X(n,`worktrees.list`,{network:!1}))?.projects??null),[a,o]=(0,m.useState)([]),[s,c]=(0,m.useState)(0),[l,u]=(0,m.useState)(0),d=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=!0,t=!1,r=r=>Z(n,`worktrees.list`,{network:r}).then(n=>{if(!(!e||!r&&t)&&(r&&(t=!0),i(n.projects),r)){let e=new Set(n.projects.flatMap(e=>e.worktrees.map(e=>e.path)));o(t=>t.filter(t=>e.has(t)))}}).catch(()=>{});return r(!1),r(!0),()=>{e=!1}},[n,l]),(0,m.useEffect)(()=>d.current?.focus(),[]);let f=(r??[]).map(e=>({...e,worktrees:e.worktrees.filter(e=>!a.includes(e.path))})),p=f.flatMap(e=>e.worktrees),h=Math.min(s,Math.max(0,p.length-1));(0,m.useEffect)(()=>{d.current?.querySelector(`[data-row="${h}"]`)?.scrollIntoView({block:`nearest`})},[h]);let g=(0,m.useCallback)(()=>u(e=>e+1),[]),_=async(e,r)=>{o(t=>[...t,e.path]);try{let i=await n.request(`worktrees.remove`,{path:e.path,force:r});i.residue&&z(eH(t.delete.residue,i.residue)),g()}catch(n){o(t=>t.filter(t=>t!==e.path));let i=n&&typeof n==`object`&&`code`in n?n.code:null;if(!r&&i===`DIRTY_WORKTREE`){O.set((0,W.jsx)(q,{title:t.delete.forceTitle,body:`${eH(t.delete.forceBody,{branch:e.branch||e.path})}\n\n${eH(t.delete.forceReason,{reason:K(n)})}`,confirmLabel:t.delete.button,onConfirm:()=>_(e,!0)}));return}z(eH(t.delete.failed,{error:K(n)}),`error`)}},v=e=>O.set((0,W.jsx)(q,{title:t.delete.confirmTitle,body:eH(t.delete.confirmBody,{branch:e.branch||e.path}),confirmLabel:t.delete.button,onConfirm:async()=>{_(e,!1)}})),y=n=>{if(!n.taskId){z(t.land.noTask,`error`);return}db(e,{id:n.taskId,title:n.branch,branch:n.branch},g)},b=e=>{if(e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.toLowerCase()===`c`&&!window.getSelection()?.toString())return e.preventDefault(),N.set(null);if(e.metaKey||e.ctrlKey||e.altKey)return;let t=p[h];if(e.key===`j`||e.key===`ArrowDown`)c(Math.min(p.length-1,h+1));else if(e.key===`k`||e.key===`ArrowUp`)c(Math.max(0,h-1));else if(e.key===`d`&&t)v(t);else if(e.key===`l`&&t)y(t);else if(e.key===`q`||e.key===`Escape`)N.set(null);else return;e.preventDefault()},x=0;return(0,W.jsxs)(`div`,{className:yS,tabIndex:0,ref:d,onKeyDown:b,children:[(0,W.jsx)(`h1`,{className:bS,children:t.title}),r===null?(0,W.jsx)(`p`,{className:`text-muted`,children:t.loading}):f.length===0?(0,W.jsx)(`p`,{className:`text-muted`,children:t.noProjects}):f.map(e=>{let n=x;return x+=e.worktrees.length,(0,W.jsxs)(`section`,{className:WS,children:[(0,W.jsxs)(`h2`,{className:`mt-1.5 mr-2 mb-1 ml-0 flex items-center gap-1 font-mono text-meta font-semibold normal-nums text-subtle`,children:[(0,W.jsx)(`span`,{children:e.repo}),(0,W.jsx)(`span`,{className:`rule`})]}),e.worktrees.length===0&&(0,W.jsx)(`p`,{className:`mono text-muted`,children:t.noWorktrees}),e.worktrees.map((e,r)=>{let i=n+r;return(0,W.jsxs)(`div`,{"data-row":i,className:GS(i===h),onClick:()=>c(i),children:[(0,W.jsxs)(`div`,{className:KS,children:[(0,W.jsx)(`span`,{className:JS,children:e.branch||t.row.detached}),e.roveManaged&&(0,W.jsx)(`span`,{className:`chip text-muted`,children:t.badge.roveManaged}),e.dirty===!0&&(0,W.jsx)(`span`,{className:`chip text-warning`,children:t.badge.dirty}),e.dirty===null&&(0,W.jsx)(`span`,{className:`chip text-muted`,children:t.badge.dirtyUnknown}),(0,W.jsx)(`span`,{className:`chip ${e.branchOnRemote===!0?`text-success`:e.branchOnRemote===!1?`text-warning`:`text-muted`}`,children:e.branchOnRemote===!0?t.badge.remoteOn:e.branchOnRemote===!1?t.badge.remoteOff:t.badge.remoteUnknown}),e.verdictReason!==`dirty`&&e.verdictReason!==`fresh`&&(0,W.jsx)(`span`,{className:`chip ${e.verdict===`merged`?`text-success`:e.verdict===`stale`?`text-warning`:`text-accent`}`,children:t.verdict[e.verdictReason]??e.verdictReason})]}),(0,W.jsxs)(`div`,{className:`${qS} mono text-muted`,children:[(0,W.jsx)(`span`,{className:YS,children:e.path}),e.createdAtMs>0&&(0,W.jsx)(`span`,{children:eH(t.row.created,{age:Ul(Date.now()-e.createdAtMs)})})]}),i===h&&(0,W.jsxs)(`div`,{className:`flex items-baseline gap-2 text-[length:var(--fs-body)]`,children:[(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>v(e),children:t.delete.button}),e.taskId&&(0,W.jsx)(`button`,{type:`button`,className:`link text-accent [&:hover]:underline touch-hit`,onClick:()=>y(e),children:t.land.button})]})]},e.path)})]},e.repo)}),(0,W.jsx)(`p`,{className:`${XS} mono keys-only text-muted`,children:(0,W.jsx)(xp,{text:`j/k · d ${t.delete.button} · l ${t.land.button} · q/esc`})})]})}function nH({model:e,narrow:t}){let n=y(e.selection),r=y(e.tabs),i=y(e.tasks),a=y(e.remote),o=a.find(e=>e.id===n.taskId&&!e.machine?.stale),s=Ua(i,n.taskId)??o??null,c=o?void 0:a.find(e=>e.id===n.taskId),l=s?r[s.id]??[]:[],u=s?s.id in r:!1,d=y(N),f=aw(s?.id),p=s?.rowStatus?.kind===`running`,h=y(L),g=y(hc)!==`terminal`&&t&&!!s;return(0,m.useEffect)(()=>{let t=e.selection.get();return e.selection.subscribe(()=>{N.set(null),L.set(null);let n=e.selection.get();(n.taskId!==t.taskId||n.tabId!==t.tabId)&&hc.set(`terminal`),t=n})},[e]),(0,m.useEffect)(()=>HE(e),[e]),d===`worktrees`?(0,W.jsxs)(`main`,{className:`${Dn} ${Gt}`,children:[t&&(0,W.jsx)(WI,{client:e.client}),(0,W.jsx)(tH,{model:e})]}):d?(0,W.jsxs)(`main`,{className:`${Dn} ${Gt}`,children:[t&&(0,W.jsx)(WI,{client:e.client}),(0,W.jsx)(cN,{model:e,page:d})]}):h?(0,W.jsxs)(`main`,{className:`${Dn} ${Gt}`,children:[t&&(0,W.jsx)(WI,{client:e.client}),(0,W.jsx)(`div`,{className:On,children:(0,W.jsx)(fy,{model:e,seed:h},q_(h))})]}):(0,W.jsxs)(`main`,{className:`${Dn} ${Gt}`,children:[t&&(0,W.jsx)(WI,{client:e.client,taskId:s?.id,title:s?.title}),s&&(0,W.jsx)($V,{model:e,task:s,tabs:l,narrow:t}),s&&!s.groupId&&(0,W.jsx)(XV,{model:e,taskId:s.id}),s?.groupId&&(0,W.jsx)(RV,{model:e,taskId:s.id,groupId:s.groupId}),(0,W.jsxs)(`div`,{className:`${On} ${p?kn:``}`,style:f?{"--task-ink":f}:void 0,children:[!t&&!s&&!c&&i&&i.tasks.length+a.length===0&&(0,W.jsx)(bI,{model:e}),!s&&!c&&i&&i.tasks.length+a.length>0&&(0,W.jsx)(`p`,{className:Tn,children:H(`workspace.pickTask`)}),c?.machine&&(0,W.jsx)(`div`,{className:En,children:(0,W.jsx)(ng,{host:c.machine.label,onMachines:()=>Py(e)})}),s&&u&&l.length===0&&!g&&(0,W.jsxs)(`div`,{className:En,children:[(0,W.jsx)(`p`,{children:H(`workspace.noTabs`)}),(0,W.jsx)(G,{variant:`filled`,onClick:()=>void gd(e,s.id,{kind:`engine`}).catch(e=>z(String(e),`error`)),children:s.engine?H(`workspace.startEngine`,{engine:s.engine.name}):H(`workspace.startSession`)}),` `,(0,W.jsx)(G,{variant:`filled`,onClick:()=>void hd(e,s.id),children:H(`menu.newChat`)}),` `,(0,W.jsx)(G,{variant:`filled`,onClick:()=>O.set((0,W.jsx)(xd,{model:e,taskId:s.id})),children:H(`menu.newChatPick`)})]}),s&&g&&(0,W.jsx)(AV,{model:e,task:s,narrow:!0}),s&&n.tabId&&l.some(e=>e.id===n.tabId)&&(0,W.jsx)(`div`,{className:`min-w-0 flex-1 ${g?`hidden`:`flex`}`,children:(0,W.jsx)(WV,{model:e,taskId:s.id,tab:l.find(e=>e.id===n.tabId)??l[0]},`${s.id}::${n.tabId}`)})]})]})}function rH({model:e}){U();let t=y(e.client.conn);return t.hello===null&&t.failures>=2?(0,W.jsx)(iH,{}):(0,W.jsx)(aH,{model:e})}function iH(){let[e,t]=(0,m.useState)(null);return(0,m.useEffect)(()=>{ls().then(t)},[]),e===null?null:e?(0,W.jsx)(ms,{}):(0,W.jsx)(Fr,{failing:!0})}function aH({model:e}){xE(e);let t=y(e.client.conn).hello;(0,m.useEffect)(()=>{if(!t)return;gC(e.client,t.roveVersion);let n=()=>void sC(e.client).then(IV);n();let r=window.setInterval(n,36e5);return()=>window.clearInterval(r)},[t,e.client]),(0,m.useEffect)(()=>{t&&os(e)},[t,e]),wf(e),xf(e),Vo(),mo(e.client),AE(e),ca(e.client),jw(e.client),(0,m.useEffect)(()=>{e.onSelect=ge;let t=L.subscribe(()=>{L.get()!==null&&ge()});return ae(),t},[e]),(0,m.useEffect)(()=>wT(e),[e]);let n=y(e.selection),r=y(e.tasks),i=y(e.remote),a=we(),o=y(JN),s=y(YN),c=y(qN),l=y(he),u=y(Ae)===`app`,d=y(vc),f=y(bc),p=y(N),h=y(ue)===`drag`,g=y(L)!==null,_=i.find(e=>e.id===n.taskId&&!e.machine?.stale),v=Ua(r,n.taskId)??_??null,b=_?void 0:i.find(e=>e.id===n.taskId),x=Gc(v?.id??null),S=Wc(v?.id??``).columns.length,C=a?Te(l,!!v||!!b,p!==null||g):null;(0,m.useEffect)(()=>e.setTaskShown(C===null||C===`content`&&p===null&&!g),[e,C,p,g]);let w=$N(c??280),T=d===null?null:xc(d,o?0:w),E=Math.max(1,S),D=`max(280px, min(calc((100% - var(--rail-w)) * ${E} / ${E+2}), calc(100% - var(--rail-w) - 320px)))`,O={"--rail-w":`${o?0:w}px`,"--rail-open-w":`${o?$N(280):w}px`,"--panel-w":T===null?D:`${T}px`};return(0,W.jsx)(`div`,{className:Ht,children:(0,W.jsxs)(`div`,{className:Ut({panel:x&&(!!v||!!b)&&!a,expanded:f&&x&&!a,surface:C&&u?`back`:C,folded:o&&!a,peek:o&&s&&!a,dragging:h}),style:a?void 0:O,children:[!a&&(0,W.jsx)(HI,{model:e}),o&&!a&&(0,W.jsx)(`div`,{className:`absolute inset-y-0 left-0 z-5 col-1 row-1 w-2.5`,title:H(`layout.railUnfold`),onMouseEnter:()=>QN(!0),onMouseLeave:()=>QN(!1),onMouseUp:()=>JN.set(!1)}),(0,W.jsx)(SI,{model:e,narrow:a}),(0,W.jsx)(nH,{model:e,narrow:a}),!a&&(0,W.jsx)(AV,{model:e,task:v,remoteHost:b?.machine?.label}),(0,W.jsx)(MV,{model:e}),(0,W.jsx)(bs,{}),(0,W.jsx)(EE,{model:e}),(0,W.jsx)(qa,{model:e})]})})}var oH=`rove.crashLog`,sH=4e3;function cH(){try{let e=JSON.parse(localStorage.getItem(oH)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function lH(e){if(e instanceof Error)return`${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function uH(e,...t){let n=`${new Date().toISOString()} [${e}] ${t.map(lH).join(` `)}`.slice(0,sH);try{localStorage.setItem(oH,JSON.stringify([...cH(),n].slice(-100)))}catch{}}function dH(){return cH().join(`
|
|
82
|
-
`)}function fH(){let e=console.error.bind(console);console.error=(...t)=>{uH(`error`,...t),e(...t)},window.addEventListener(`error`,e=>uH(`uncaught`,e.error??e.message)),window.addEventListener(`unhandledrejection`,e=>uH(`rejection`,e.reason)),document.addEventListener(`webglcontextlost`,()=>uH(`webgl`,`context lost`),!0)}var pH=class extends m.Component{state={error:null,componentStack:``};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.setState({componentStack:t.componentStack??``})}render(){let{error:e,componentStack:t}=this.state;if(!e)return this.props.children;let n=[`${e.message}\n${e.stack??``}`,t,dH()].filter(Boolean).join(`
|
|
83
|
-
|
|
84
|
-
`);return(0,W.jsx)(mH,{report:n})}};function mH({report:e}){let[t,n]=(0,m.useState)(!1);return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3 bg-surface p-4 text-ink`,children:[(0,W.jsx)(`p`,{className:`font-sans text-title`,children:H(`crash.title`)}),(0,W.jsxs)(`div`,{className:`flex gap-4`,children:[(0,W.jsx)(G,{variant:`filled`,onClick:()=>void navigator.clipboard.writeText(e).then(()=>n(!0),()=>n(!1)),children:H(t?`crash.copied`:`crash.copy`)}),(0,W.jsx)(G,{variant:`action`,onClick:()=>location.reload(),children:H(`crash.reload`)})]}),(0,W.jsx)(`pre`,{className:`min-h-0 flex-1 select-text overflow-auto whitespace-pre-wrap break-all font-mono text-meta text-muted`,children:e})]})}var hH=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function gH(e){return[...e.querySelectorAll(hH)].filter(e=>e.tabIndex>=0&&e.offsetParent!==null)}function _H(){window.addEventListener(`keydown`,e=>{if(e.key!==`Tab`||e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey)return;let t=[...document.querySelectorAll(`.overlay:not(.is-leaving)`)].at(-1);if(!t)return;let n=gH(t);if(n.length===0)return;let r=document.activeElement,i=r instanceof HTMLElement&&t.contains(r),a=e.shiftKey?n.filter(e=>i&&!!(r.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)).at(-1)??n.at(-1):n.find(e=>i&&!!(r.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING))??n[0];e.preventDefault(),a?.focus()})}function vH(e){if(!ce())for(let t of document.querySelectorAll(`${e}:not(.is-leaving)`)){let e=t.cloneNode(!0);e.classList.add(`is-leaving`),e.inert=!0,e.setAttribute(`aria-hidden`,`true`),document.body.append(e);let n=t.querySelectorAll(`*`),r=e.querySelectorAll(`*`);n.forEach((e,t)=>{let n=r[t];e.scrollTop&&(n.scrollTop=e.scrollTop),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(n.value=e.value)}),window.setTimeout(()=>e.remove(),200)}}function yH(e){for(let t of document.querySelectorAll(`${e}.is-leaving`))t.remove()}function bH(){for(let e of document.querySelectorAll(`.overlay:not(.is-leaving)`))for(let t of e.getAnimations())t instanceof CSSAnimation&&t.animationName===`fade-in`&&t.finish()}function xH(){let e=O.get(),t=-1/0;O.subscribe(()=>{let n=O.get();if(n===null&&e!==null)t=performance.now(),vH(`.overlay`);else if(n!==null){let n=e!==null||performance.now()-t<140;yH(`.overlay`),n&&requestAnimationFrame(bH)}e=n});let n=D.get();D.subscribe(()=>{let e=D.get();e===null&&n!==null?vH(`.menu`):e!==null&&yH(`.menu`),n=e});let r=Nf.get().guide;Nf.subscribe(()=>{let e=Nf.get().guide;e===null&&r!==null?vH(`.prefix-guide`):e!==null&&yH(`.prefix-guide`),r=e})}var SH=500,CH=10,wH=`input, textarea, select, [contenteditable], .xterm`,TH=[`mousedown`,`mouseup`,`click`,`contextmenu`];function EH(){let e=null,t=()=>{e&&window.clearTimeout(e.timer),e=null},n=()=>{let e=e=>{e.preventDefault(),e.stopPropagation()},t=()=>{for(let t of TH)document.removeEventListener(t,e,!0);document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`keydown`,t,!0)};for(let t of TH)document.addEventListener(t,e,!0);document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`keydown`,t,!0)};document.addEventListener(`pointerdown`,r=>{if(t(),r.pointerType!==`touch`||!(r.target instanceof Element)||r.target.closest(wH))return;let i=r.target,a={x:r.clientX,y:r.clientY,native:!1,timer:window.setTimeout(()=>{e=null,!(a.native||!i.isConnected)&&(i.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:a.x,clientY:a.y,button:2})),n())},SH)};e=a},!0),document.addEventListener(`pointermove`,n=>{e&&Math.hypot(n.clientX-e.x,n.clientY-e.y)>CH&&t()},!0),document.addEventListener(`pointerup`,t,!0),document.addEventListener(`pointercancel`,t,!0),document.addEventListener(`contextmenu`,t=>{e&&t.isTrusted&&(e.native=!0)},!0)}function DH(e,t){e.viewingExtras=()=>wc({narrow:Se(),panelOpen:Kc(e.selection.get().taskId)});let n=()=>e.reportViewing();yc.subscribe(n),qc(n),L.subscribe(n),N.subscribe(n),Ce(n),t.on(`panel`,t=>{Cc(t)&&il(t,e.selection.get().taskId)})}function OH(e){let t=e;return!!t&&typeof t.promptId==`string`&&typeof t.title==`string`}function kH({client:e,prompt:t}){let n=(U()===`zh`?Ai:ki).prompt,[r,i]=(0,m.useState)(t.initial??``),a=(0,m.useRef)(!1),{busy:o,error:s,submit:c}=wi();return(0,m.useEffect)(()=>()=>{a.current||e.request(`ui.promptReply`,{promptId:t.promptId}).catch(()=>{})},[e,t.promptId]),(0,W.jsx)(Ci,{title:t.title,children:(0,W.jsxs)(`form`,{className:Kr,onSubmit:n=>{n.preventDefault(),c(async()=>{await e.request(`ui.promptReply`,{promptId:t.promptId,value:r}),a.current=!0})},children:[(0,W.jsx)(`input`,{className:Nr,"aria-label":n.fieldLabel,autoFocus:!0,spellCheck:!1,value:r,placeholder:t.placeholder,onChange:e=>i(e.target.value)}),s&&(0,W.jsx)(`p`,{className:`text-error`,children:s}),(0,W.jsx)(Di,{busy:o,submitLabel:n.submitLabel})]})})}function AH(e,t){O.get()||O.set((0,W.jsx)(kH,{client:e,prompt:t},t.promptId))}var jH=900,MH=new WeakMap;function NH(e){e.setAttribute(`data-scrolling`,``),window.clearTimeout(MH.get(e)),MH.set(e,window.setTimeout(()=>e.removeAttribute(`data-scrolling`),jH))}function PH(){document.addEventListener(`scroll`,e=>{let t=e.target instanceof Element?e.target:document.scrollingElement;t&&NH(t)},{capture:!0,passive:!0})}var FH=`rove-web.reloadedFor`;function IH(e,t,n){return e===null?`adopt`:t===e||t===n?`stay`:`reload`}function LH(){let e=null;try{e=window.sessionStorage}catch{}return{storage:e,reload:()=>window.location.reload()}}function RH(e,t=LH()){let n=null,r=null,i=()=>{try{return t.storage?.getItem(FH)??r}catch{return r}};return e.conn.subscribe(()=>{let{state:a,hello:o}=e.conn.get();if(a!==`open`||!o)return;let s=IH(n,o.roveVersion,i());if(s===`adopt`&&(n=o.roveVersion),s===`reload`){r=o.roveVersion;try{t.storage?.setItem(FH,o.roveVersion)}catch{}t.reload()}})}function zH(){let e=window.visualViewport;if(!e)return;let t=document.documentElement,n=()=>{t.style.setProperty(`--vvh`,`${e.height*e.scale}px`),t.toggleAttribute(`data-keyboard`,window.innerHeight-e.height*e.scale>120),e.scale===1&&window.scrollY!==0&&window.scrollTo(0,0)};e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),window.addEventListener(`scroll`,n,{passive:!0}),n()}fH();var BH=(0,h.createRoot)(document.getElementById(`root`));zH(),EH(),Ie(),PH(),xH(),_H(),cI();var VH=e=>BH.render((0,W.jsx)(m.StrictMode,{children:(0,W.jsx)(pH,{children:e})}));function HH(e){let t=new Yo(Xo(),e),n=new Ga(t);t.on(`prompt`,e=>{OH(e)&&AH(t,e)}),DH(n,t),RH(t),t.start(),VH((0,W.jsx)(rH,{model:n}))}var UH=r();UH?HH(UH):Promise.all([us(),ls()]).then(([e,t])=>{e?HH(``):VH(t?(0,W.jsx)(ms,{}):(0,W.jsx)(Fr,{}))});export{Go as _,uL as a,I as b,tL as c,mp as d,pp as f,id as g,zf as h,mL as i,GC as l,hp as m,pL as n,cL as o,gp as p,lL as r,rL as s,NH as t,Ap as u,Nn as v,ue as x,Fn as y};
|