@robota-sdk/agent-cli 3.4.4 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +5 -4
  3. package/dist/node/bin.js +1 -1
  4. package/dist/node/desktop-host.d.ts +2 -2
  5. package/dist/node/desktop-host.d.ts.map +1 -1
  6. package/dist/node/desktop-host.js +1 -1
  7. package/dist/node/headless.js +1 -1
  8. package/dist/node/host.js +1 -1
  9. package/dist/node/index.d.ts +1 -1
  10. package/dist/node/index.d.ts.map +1 -1
  11. package/dist/node/index.js +1 -1
  12. package/dist/node/{process-hardening-JO3sChVi.js → process-hardening-CutnbmOo.js} +273 -273
  13. package/dist/node/{product-host-Cc_shUFy.js → product-host-CA55PWNj.js} +423 -423
  14. package/dist/node/{product-host-Cc_shUFy.js.map → product-host-CA55PWNj.js.map} +1 -1
  15. package/dist/node/{src-CIATEueG-jYQhIX0i.js → src-CIATEueG-CYDfXiWm.js} +1 -1
  16. package/dist/node/{src-CIATEueG-CpjiQphV.js → src-CIATEueG-CefNhLe4.js} +2 -2
  17. package/dist/node/{src-CIATEueG-CpjiQphV.js.map → src-CIATEueG-CefNhLe4.js.map} +1 -1
  18. package/dist/node/{src-Da9AIPoA-b68F04E9.js → src-Da9AIPoA-CANKHTs9.js} +1 -1
  19. package/dist/node/{src-Da9AIPoA-nTFcDv_q.js → src-Da9AIPoA-Uiwejk2Q.js} +2 -2
  20. package/dist/node/{src-Da9AIPoA-nTFcDv_q.js.map → src-Da9AIPoA-Uiwejk2Q.js.map} +1 -1
  21. package/dist/node/{src-DwAfU-9z-CUm6BTZZ.js → src-DwAfU-9z-DvL3POR0.js} +2 -2
  22. package/dist/node/{src-DwAfU-9z-CUm6BTZZ.js.map → src-DwAfU-9z-DvL3POR0.js.map} +1 -1
  23. package/dist/node/{src-DwAfU-9z-CKweDta0.js → src-DwAfU-9z-eI1GNag_.js} +1 -1
  24. package/dist/node/{src-eB41xezu-Cd-baTiH.js → src-eB41xezu-Baynp2G6.js} +1 -1
  25. package/dist/node/{src-eB41xezu-hSDRo6P2.js → src-eB41xezu-DVQe6uDO.js} +2 -2
  26. package/dist/node/{src-eB41xezu-hSDRo6P2.js.map → src-eB41xezu-DVQe6uDO.js.map} +1 -1
  27. package/dist/web/assets/{index-C9AI2mJa.js → index-BI7Qo-t8.js} +2 -272
  28. package/dist/web/assets/index-Cq83FfwC.css +1 -0
  29. package/dist/web/index.html +2 -2
  30. package/package.json +13 -13
  31. package/scripts/native-build.mjs +1 -1
  32. package/dist/web/assets/index-BSxTg2Py.css +0 -1
@@ -1,44 +1,4 @@
1
- (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function r(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(u){if(u.ep)return;u.ep=!0;const o=r(u);fetch(u.href,o)}})();function tu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vc={exports:{}},ea={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Xm;function B0(){if(Xm)return ea;Xm=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(s,u,o){var f=null;if(o!==void 0&&(f=""+o),u.key!==void 0&&(f=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:t,type:s,key:f,ref:u!==void 0?u:null,props:o}}return ea.Fragment=i,ea.jsx=r,ea.jsxs=r,ea}var Qm;function H0(){return Qm||(Qm=1,vc.exports=B0()),vc.exports}var d=H0(),Sc={exports:{}},Ce={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Zm;function I0(){if(Zm)return Ce;Zm=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function v(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,M={};function E(A,B,j){this.props=A,this.context=B,this.refs=M,this.updater=j||N}E.prototype.isReactComponent={},E.prototype.setState=function(A,B){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,B,"setState")},E.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function V(){}V.prototype=E.prototype;function L(A,B,j){this.props=A,this.context=B,this.refs=M,this.updater=j||N}var ne=L.prototype=new V;ne.constructor=L,C(ne,E.prototype),ne.isPureReactComponent=!0;var W=Array.isArray;function R(){}var P={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function G(A,B,j){var re=j.ref;return{$$typeof:t,type:A,key:B,ref:re!==void 0?re:null,props:j}}function O(A,B){return G(A.type,B,A.props)}function ue(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function te(A){var B={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(j){return B[j]})}var Se=/\/+/g;function ie(A,B){return typeof A=="object"&&A!==null&&A.key!=null?te(""+A.key):B.toString(36)}function le(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(R,R):(A.status="pending",A.then(function(B){A.status==="pending"&&(A.status="fulfilled",A.value=B)},function(B){A.status==="pending"&&(A.status="rejected",A.reason=B)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function D(A,B,j,re,fe){var pe=typeof A;(pe==="undefined"||pe==="boolean")&&(A=null);var ke=!1;if(A===null)ke=!0;else switch(pe){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(A.$$typeof){case t:case i:ke=!0;break;case y:return ke=A._init,D(ke(A._payload),B,j,re,fe)}}if(ke)return fe=fe(A),ke=re===""?"."+ie(A,0):re,W(fe)?(j="",ke!=null&&(j=ke.replace(Se,"$&/")+"/"),D(fe,B,j,"",function(be){return be})):fe!=null&&(ue(fe)&&(fe=O(fe,j+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Se,"$&/")+"/")+ke)),B.push(fe)),1;ke=0;var _e=re===""?".":re+":";if(W(A))for(var oe=0;oe<A.length;oe++)re=A[oe],pe=_e+ie(re,oe),ke+=D(re,B,j,pe,fe);else if(oe=v(A),typeof oe=="function")for(A=oe.call(A),oe=0;!(re=A.next()).done;)re=re.value,pe=_e+ie(re,oe++),ke+=D(re,B,j,pe,fe);else if(pe==="object"){if(typeof A.then=="function")return D(le(A),B,j,re,fe);throw B=String(A),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ke}function X(A,B,j){if(A==null)return A;var re=[],fe=0;return D(A,re,"","",function(pe){return B.call(j,pe,fe++)}),re}function ce(A){if(A._status===-1){var B=A._result;B=B(),B.then(function(j){(A._status===0||A._status===-1)&&(A._status=1,A._result=j)},function(j){(A._status===0||A._status===-1)&&(A._status=2,A._result=j)}),A._status===-1&&(A._status=0,A._result=B)}if(A._status===1)return A._result.default;throw A._result}var he=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},_={map:X,forEach:function(A,B,j){X(A,function(){B.apply(this,arguments)},j)},count:function(A){var B=0;return X(A,function(){B++}),B},toArray:function(A){return X(A,function(B){return B})||[]},only:function(A){if(!ue(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Ce.Activity=x,Ce.Children=_,Ce.Component=E,Ce.Fragment=r,Ce.Profiler=u,Ce.PureComponent=L,Ce.StrictMode=s,Ce.Suspense=g,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(A){return P.H.useMemoCache(A)}},Ce.cache=function(A){return function(){return A.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(A,B,j){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var re=C({},A.props),fe=A.key;if(B!=null)for(pe in B.key!==void 0&&(fe=""+B.key),B)!K.call(B,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&B.ref===void 0||(re[pe]=B[pe]);var pe=arguments.length-2;if(pe===1)re.children=j;else if(1<pe){for(var ke=Array(pe),_e=0;_e<pe;_e++)ke[_e]=arguments[_e+2];re.children=ke}return G(A.type,fe,re)},Ce.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:o,_context:A},A},Ce.createElement=function(A,B,j){var re,fe={},pe=null;if(B!=null)for(re in B.key!==void 0&&(pe=""+B.key),B)K.call(B,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(fe[re]=B[re]);var ke=arguments.length-2;if(ke===1)fe.children=j;else if(1<ke){for(var _e=Array(ke),oe=0;oe<ke;oe++)_e[oe]=arguments[oe+2];fe.children=_e}if(A&&A.defaultProps)for(re in ke=A.defaultProps,ke)fe[re]===void 0&&(fe[re]=ke[re]);return G(A,pe,fe)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(A){return{$$typeof:h,render:A}},Ce.isValidElement=ue,Ce.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:ce}},Ce.memo=function(A,B){return{$$typeof:m,type:A,compare:B===void 0?null:B}},Ce.startTransition=function(A){var B=P.T,j={};P.T=j;try{var re=A(),fe=P.S;fe!==null&&fe(j,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(R,he)}catch(pe){he(pe)}finally{B!==null&&j.types!==null&&(B.types=j.types),P.T=B}},Ce.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ce.use=function(A){return P.H.use(A)},Ce.useActionState=function(A,B,j){return P.H.useActionState(A,B,j)},Ce.useCallback=function(A,B){return P.H.useCallback(A,B)},Ce.useContext=function(A){return P.H.useContext(A)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(A,B){return P.H.useDeferredValue(A,B)},Ce.useEffect=function(A,B){return P.H.useEffect(A,B)},Ce.useEffectEvent=function(A){return P.H.useEffectEvent(A)},Ce.useId=function(){return P.H.useId()},Ce.useImperativeHandle=function(A,B,j){return P.H.useImperativeHandle(A,B,j)},Ce.useInsertionEffect=function(A,B){return P.H.useInsertionEffect(A,B)},Ce.useLayoutEffect=function(A,B){return P.H.useLayoutEffect(A,B)},Ce.useMemo=function(A,B){return P.H.useMemo(A,B)},Ce.useOptimistic=function(A,B){return P.H.useOptimistic(A,B)},Ce.useReducer=function(A,B,j){return P.H.useReducer(A,B,j)},Ce.useRef=function(A){return P.H.useRef(A)},Ce.useState=function(A){return P.H.useState(A)},Ce.useSyncExternalStore=function(A,B,j){return P.H.useSyncExternalStore(A,B,j)},Ce.useTransition=function(){return P.H.useTransition()},Ce.version="19.2.8",Ce}var Km;function Cf(){return Km||(Km=1,Sc.exports=I0()),Sc.exports}var w=Cf();const bn=tu(w);var kc={exports:{}},ta={},wc={exports:{}},jc={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Pm;function Y0(){return Pm||(Pm=1,(function(t){function i(D,X){var ce=D.length;D.push(X);e:for(;0<ce;){var he=ce-1>>>1,_=D[he];if(0<u(_,X))D[he]=X,D[ce]=_,ce=he;else break e}}function r(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var X=D[0],ce=D.pop();if(ce!==X){D[0]=ce;e:for(var he=0,_=D.length,A=_>>>1;he<A;){var B=2*(he+1)-1,j=D[B],re=B+1,fe=D[re];if(0>u(j,ce))re<_&&0>u(fe,j)?(D[he]=fe,D[re]=ce,he=re):(D[he]=j,D[B]=ce,he=B);else if(re<_&&0>u(fe,ce))D[he]=fe,D[re]=ce,he=re;else break e}}return X}function u(D,X){var ce=D.sortIndex-X.sortIndex;return ce!==0?ce:D.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var g=[],m=[],y=1,x=null,S=3,v=!1,N=!1,C=!1,M=!1,E=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function ne(D){for(var X=r(m);X!==null;){if(X.callback===null)s(m);else if(X.startTime<=D)s(m),X.sortIndex=X.expirationTime,i(g,X);else break;X=r(m)}}function W(D){if(C=!1,ne(D),!N)if(r(g)!==null)N=!0,R||(R=!0,te());else{var X=r(m);X!==null&&le(W,X.startTime-D)}}var R=!1,P=-1,K=5,G=-1;function O(){return M?!0:!(t.unstable_now()-G<K)}function ue(){if(M=!1,R){var D=t.unstable_now();G=D;var X=!0;try{e:{N=!1,C&&(C=!1,V(P),P=-1),v=!0;var ce=S;try{t:{for(ne(D),x=r(g);x!==null&&!(x.expirationTime>D&&O());){var he=x.callback;if(typeof he=="function"){x.callback=null,S=x.priorityLevel;var _=he(x.expirationTime<=D);if(D=t.unstable_now(),typeof _=="function"){x.callback=_,ne(D),X=!0;break t}x===r(g)&&s(g),ne(D)}else s(g);x=r(g)}if(x!==null)X=!0;else{var A=r(m);A!==null&&le(W,A.startTime-D),X=!1}}break e}finally{x=null,S=ce,v=!1}X=void 0}}finally{X?te():R=!1}}}var te;if(typeof L=="function")te=function(){L(ue)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,ie=Se.port2;Se.port1.onmessage=ue,te=function(){ie.postMessage(null)}}else te=function(){E(ue,0)};function le(D,X){P=E(function(){D(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(D){switch(S){case 1:case 2:case 3:var X=3;break;default:X=S}var ce=S;S=X;try{return D()}finally{S=ce}},t.unstable_requestPaint=function(){M=!0},t.unstable_runWithPriority=function(D,X){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ce=S;S=D;try{return X()}finally{S=ce}},t.unstable_scheduleCallback=function(D,X,ce){var he=t.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?he+ce:he):ce=he,D){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ce+_,D={id:y++,callback:X,priorityLevel:D,startTime:ce,expirationTime:_,sortIndex:-1},ce>he?(D.sortIndex=ce,i(m,D),r(g)===null&&D===r(m)&&(C?(V(P),P=-1):C=!0,le(W,ce-he))):(D.sortIndex=_,i(g,D),N||v||(N=!0,R||(R=!0,te()))),D},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(D){var X=S;return function(){var ce=S;S=X;try{return D.apply(this,arguments)}finally{S=ce}}}})(jc)),jc}var Jm;function V0(){return Jm||(Jm=1,wc.exports=Y0()),wc.exports}var Nc={exports:{}},Rt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Wm;function G0(){if(Wm)return Rt;Wm=1;var t=Cf();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(g,m,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rt.createPortal=function(g,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return o(g,m,null,y)},Rt.flushSync=function(g){var m=f.T,y=s.p;try{if(f.T=null,s.p=2,g)return g()}finally{f.T=m,s.p=y,s.d.f()}},Rt.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,s.d.C(g,m))},Rt.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},Rt.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var y=m.as,x=h(y,m.crossOrigin),S=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?s.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:v}):y==="script"&&s.d.X(g,{crossOrigin:x,integrity:S,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Rt.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=h(m.as,m.crossOrigin);s.d.M(g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&s.d.M(g)},Rt.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,x=h(y,m.crossOrigin);s.d.L(g,y,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Rt.preloadModule=function(g,m){if(typeof g=="string")if(m){var y=h(m.as,m.crossOrigin);s.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else s.d.m(g)},Rt.requestFormReset=function(g){s.d.r(g)},Rt.unstable_batchedUpdates=function(g,m){return g(m)},Rt.useFormState=function(g,m,y){return f.H.useFormState(g,m,y)},Rt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Rt.version="19.2.8",Rt}var eg;function $0(){if(eg)return Nc.exports;eg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Nc.exports=G0(),Nc.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var tg;function F0(){if(tg)return ta;tg=1;var t=V0(),i=Cf(),r=$0();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(o(e)!==e)throw Error(s(188))}function m(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(s(188));return n!==e?null:e}for(var l=e,a=n;;){var c=l.return;if(c===null)break;var p=c.alternate;if(p===null){if(a=c.return,a!==null){l=a;continue}break}if(c.child===p.child){for(p=c.child;p;){if(p===l)return g(c),e;if(p===a)return g(c),n;p=p.sibling}throw Error(s(188))}if(l.return!==a.return)l=c,a=p;else{for(var b=!1,k=c.child;k;){if(k===l){b=!0,l=c,a=p;break}if(k===a){b=!0,a=c,l=p;break}k=k.sibling}if(!b){for(k=p.child;k;){if(k===l){b=!0,l=p,a=c;break}if(k===a){b=!0,a=p,l=c;break}k=k.sibling}if(!b)throw Error(s(189))}}if(l.alternate!==a)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),L=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Symbol.for("react.client.reference");function ie(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case E:return"Profiler";case M:return"StrictMode";case W:return"Suspense";case R:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case L:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case ne:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return n=e.displayName||null,n!==null?n:ie(e.type)||"Memo";case K:n=e._payload,e=e._init;try{return ie(e(n))}catch{}}return null}var le=Array.isArray,D=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},he=[],_=-1;function A(e){return{current:e}}function B(e){0>_||(e.current=he[_],he[_]=null,_--)}function j(e,n){_++,he[_]=e.current,e.current=n}var re=A(null),fe=A(null),pe=A(null),ke=A(null);function _e(e,n){switch(j(pe,n),j(fe,e),j(re,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?gm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=gm(n),e=xm(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(re),j(re,e)}function oe(){B(re),B(fe),B(pe)}function be(e){e.memoizedState!==null&&j(ke,e);var n=re.current,l=xm(n,e.type);n!==l&&(j(fe,e),j(re,l))}function We(e){fe.current===e&&(B(re),B(fe)),ke.current===e&&(B(ke),Kr._currentValue=ce)}var wt,Ft;function Xt(e){if(wt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);wt=n&&n[1]||"",Ft=-1<l.stack.indexOf(`
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function r(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(u){if(u.ep)return;u.ep=!0;const o=r(u);fetch(u.href,o)}})();function tu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vc={exports:{}},ea={};var Xm;function B0(){if(Xm)return ea;Xm=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(s,u,o){var f=null;if(o!==void 0&&(f=""+o),u.key!==void 0&&(f=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:t,type:s,key:f,ref:u!==void 0?u:null,props:o}}return ea.Fragment=i,ea.jsx=r,ea.jsxs=r,ea}var Qm;function H0(){return Qm||(Qm=1,vc.exports=B0()),vc.exports}var d=H0(),Sc={exports:{}},Ce={};var Zm;function I0(){if(Zm)return Ce;Zm=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function v(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,M={};function E(A,B,j){this.props=A,this.context=B,this.refs=M,this.updater=j||N}E.prototype.isReactComponent={},E.prototype.setState=function(A,B){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,B,"setState")},E.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function V(){}V.prototype=E.prototype;function L(A,B,j){this.props=A,this.context=B,this.refs=M,this.updater=j||N}var ne=L.prototype=new V;ne.constructor=L,C(ne,E.prototype),ne.isPureReactComponent=!0;var W=Array.isArray;function R(){}var P={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function G(A,B,j){var re=j.ref;return{$$typeof:t,type:A,key:B,ref:re!==void 0?re:null,props:j}}function O(A,B){return G(A.type,B,A.props)}function ue(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function te(A){var B={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(j){return B[j]})}var Se=/\/+/g;function ie(A,B){return typeof A=="object"&&A!==null&&A.key!=null?te(""+A.key):B.toString(36)}function le(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(R,R):(A.status="pending",A.then(function(B){A.status==="pending"&&(A.status="fulfilled",A.value=B)},function(B){A.status==="pending"&&(A.status="rejected",A.reason=B)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function D(A,B,j,re,fe){var pe=typeof A;(pe==="undefined"||pe==="boolean")&&(A=null);var ke=!1;if(A===null)ke=!0;else switch(pe){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(A.$$typeof){case t:case i:ke=!0;break;case y:return ke=A._init,D(ke(A._payload),B,j,re,fe)}}if(ke)return fe=fe(A),ke=re===""?"."+ie(A,0):re,W(fe)?(j="",ke!=null&&(j=ke.replace(Se,"$&/")+"/"),D(fe,B,j,"",function(be){return be})):fe!=null&&(ue(fe)&&(fe=O(fe,j+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Se,"$&/")+"/")+ke)),B.push(fe)),1;ke=0;var _e=re===""?".":re+":";if(W(A))for(var oe=0;oe<A.length;oe++)re=A[oe],pe=_e+ie(re,oe),ke+=D(re,B,j,pe,fe);else if(oe=v(A),typeof oe=="function")for(A=oe.call(A),oe=0;!(re=A.next()).done;)re=re.value,pe=_e+ie(re,oe++),ke+=D(re,B,j,pe,fe);else if(pe==="object"){if(typeof A.then=="function")return D(le(A),B,j,re,fe);throw B=String(A),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ke}function X(A,B,j){if(A==null)return A;var re=[],fe=0;return D(A,re,"","",function(pe){return B.call(j,pe,fe++)}),re}function ce(A){if(A._status===-1){var B=A._result;B=B(),B.then(function(j){(A._status===0||A._status===-1)&&(A._status=1,A._result=j)},function(j){(A._status===0||A._status===-1)&&(A._status=2,A._result=j)}),A._status===-1&&(A._status=0,A._result=B)}if(A._status===1)return A._result.default;throw A._result}var he=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},_={map:X,forEach:function(A,B,j){X(A,function(){B.apply(this,arguments)},j)},count:function(A){var B=0;return X(A,function(){B++}),B},toArray:function(A){return X(A,function(B){return B})||[]},only:function(A){if(!ue(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Ce.Activity=x,Ce.Children=_,Ce.Component=E,Ce.Fragment=r,Ce.Profiler=u,Ce.PureComponent=L,Ce.StrictMode=s,Ce.Suspense=g,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(A){return P.H.useMemoCache(A)}},Ce.cache=function(A){return function(){return A.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(A,B,j){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var re=C({},A.props),fe=A.key;if(B!=null)for(pe in B.key!==void 0&&(fe=""+B.key),B)!K.call(B,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&B.ref===void 0||(re[pe]=B[pe]);var pe=arguments.length-2;if(pe===1)re.children=j;else if(1<pe){for(var ke=Array(pe),_e=0;_e<pe;_e++)ke[_e]=arguments[_e+2];re.children=ke}return G(A.type,fe,re)},Ce.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:o,_context:A},A},Ce.createElement=function(A,B,j){var re,fe={},pe=null;if(B!=null)for(re in B.key!==void 0&&(pe=""+B.key),B)K.call(B,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(fe[re]=B[re]);var ke=arguments.length-2;if(ke===1)fe.children=j;else if(1<ke){for(var _e=Array(ke),oe=0;oe<ke;oe++)_e[oe]=arguments[oe+2];fe.children=_e}if(A&&A.defaultProps)for(re in ke=A.defaultProps,ke)fe[re]===void 0&&(fe[re]=ke[re]);return G(A,pe,fe)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(A){return{$$typeof:h,render:A}},Ce.isValidElement=ue,Ce.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:ce}},Ce.memo=function(A,B){return{$$typeof:m,type:A,compare:B===void 0?null:B}},Ce.startTransition=function(A){var B=P.T,j={};P.T=j;try{var re=A(),fe=P.S;fe!==null&&fe(j,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(R,he)}catch(pe){he(pe)}finally{B!==null&&j.types!==null&&(B.types=j.types),P.T=B}},Ce.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ce.use=function(A){return P.H.use(A)},Ce.useActionState=function(A,B,j){return P.H.useActionState(A,B,j)},Ce.useCallback=function(A,B){return P.H.useCallback(A,B)},Ce.useContext=function(A){return P.H.useContext(A)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(A,B){return P.H.useDeferredValue(A,B)},Ce.useEffect=function(A,B){return P.H.useEffect(A,B)},Ce.useEffectEvent=function(A){return P.H.useEffectEvent(A)},Ce.useId=function(){return P.H.useId()},Ce.useImperativeHandle=function(A,B,j){return P.H.useImperativeHandle(A,B,j)},Ce.useInsertionEffect=function(A,B){return P.H.useInsertionEffect(A,B)},Ce.useLayoutEffect=function(A,B){return P.H.useLayoutEffect(A,B)},Ce.useMemo=function(A,B){return P.H.useMemo(A,B)},Ce.useOptimistic=function(A,B){return P.H.useOptimistic(A,B)},Ce.useReducer=function(A,B,j){return P.H.useReducer(A,B,j)},Ce.useRef=function(A){return P.H.useRef(A)},Ce.useState=function(A){return P.H.useState(A)},Ce.useSyncExternalStore=function(A,B,j){return P.H.useSyncExternalStore(A,B,j)},Ce.useTransition=function(){return P.H.useTransition()},Ce.version="19.2.8",Ce}var Km;function Cf(){return Km||(Km=1,Sc.exports=I0()),Sc.exports}var w=Cf();const bn=tu(w);var kc={exports:{}},ta={},wc={exports:{}},jc={};var Pm;function Y0(){return Pm||(Pm=1,(function(t){function i(D,X){var ce=D.length;D.push(X);e:for(;0<ce;){var he=ce-1>>>1,_=D[he];if(0<u(_,X))D[he]=X,D[ce]=_,ce=he;else break e}}function r(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var X=D[0],ce=D.pop();if(ce!==X){D[0]=ce;e:for(var he=0,_=D.length,A=_>>>1;he<A;){var B=2*(he+1)-1,j=D[B],re=B+1,fe=D[re];if(0>u(j,ce))re<_&&0>u(fe,j)?(D[he]=fe,D[re]=ce,he=re):(D[he]=j,D[B]=ce,he=B);else if(re<_&&0>u(fe,ce))D[he]=fe,D[re]=ce,he=re;else break e}}return X}function u(D,X){var ce=D.sortIndex-X.sortIndex;return ce!==0?ce:D.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var g=[],m=[],y=1,x=null,S=3,v=!1,N=!1,C=!1,M=!1,E=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function ne(D){for(var X=r(m);X!==null;){if(X.callback===null)s(m);else if(X.startTime<=D)s(m),X.sortIndex=X.expirationTime,i(g,X);else break;X=r(m)}}function W(D){if(C=!1,ne(D),!N)if(r(g)!==null)N=!0,R||(R=!0,te());else{var X=r(m);X!==null&&le(W,X.startTime-D)}}var R=!1,P=-1,K=5,G=-1;function O(){return M?!0:!(t.unstable_now()-G<K)}function ue(){if(M=!1,R){var D=t.unstable_now();G=D;var X=!0;try{e:{N=!1,C&&(C=!1,V(P),P=-1),v=!0;var ce=S;try{t:{for(ne(D),x=r(g);x!==null&&!(x.expirationTime>D&&O());){var he=x.callback;if(typeof he=="function"){x.callback=null,S=x.priorityLevel;var _=he(x.expirationTime<=D);if(D=t.unstable_now(),typeof _=="function"){x.callback=_,ne(D),X=!0;break t}x===r(g)&&s(g),ne(D)}else s(g);x=r(g)}if(x!==null)X=!0;else{var A=r(m);A!==null&&le(W,A.startTime-D),X=!1}}break e}finally{x=null,S=ce,v=!1}X=void 0}}finally{X?te():R=!1}}}var te;if(typeof L=="function")te=function(){L(ue)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,ie=Se.port2;Se.port1.onmessage=ue,te=function(){ie.postMessage(null)}}else te=function(){E(ue,0)};function le(D,X){P=E(function(){D(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(D){switch(S){case 1:case 2:case 3:var X=3;break;default:X=S}var ce=S;S=X;try{return D()}finally{S=ce}},t.unstable_requestPaint=function(){M=!0},t.unstable_runWithPriority=function(D,X){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ce=S;S=D;try{return X()}finally{S=ce}},t.unstable_scheduleCallback=function(D,X,ce){var he=t.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?he+ce:he):ce=he,D){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ce+_,D={id:y++,callback:X,priorityLevel:D,startTime:ce,expirationTime:_,sortIndex:-1},ce>he?(D.sortIndex=ce,i(m,D),r(g)===null&&D===r(m)&&(C?(V(P),P=-1):C=!0,le(W,ce-he))):(D.sortIndex=_,i(g,D),N||v||(N=!0,R||(R=!0,te()))),D},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(D){var X=S;return function(){var ce=S;S=X;try{return D.apply(this,arguments)}finally{S=ce}}}})(jc)),jc}var Jm;function V0(){return Jm||(Jm=1,wc.exports=Y0()),wc.exports}var Nc={exports:{}},Rt={};var Wm;function G0(){if(Wm)return Rt;Wm=1;var t=Cf();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(g,m,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Rt.createPortal=function(g,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return o(g,m,null,y)},Rt.flushSync=function(g){var m=f.T,y=s.p;try{if(f.T=null,s.p=2,g)return g()}finally{f.T=m,s.p=y,s.d.f()}},Rt.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,s.d.C(g,m))},Rt.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},Rt.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var y=m.as,x=h(y,m.crossOrigin),S=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?s.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:v}):y==="script"&&s.d.X(g,{crossOrigin:x,integrity:S,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Rt.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=h(m.as,m.crossOrigin);s.d.M(g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&s.d.M(g)},Rt.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,x=h(y,m.crossOrigin);s.d.L(g,y,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Rt.preloadModule=function(g,m){if(typeof g=="string")if(m){var y=h(m.as,m.crossOrigin);s.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else s.d.m(g)},Rt.requestFormReset=function(g){s.d.r(g)},Rt.unstable_batchedUpdates=function(g,m){return g(m)},Rt.useFormState=function(g,m,y){return f.H.useFormState(g,m,y)},Rt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Rt.version="19.2.8",Rt}var eg;function $0(){if(eg)return Nc.exports;eg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Nc.exports=G0(),Nc.exports}var tg;function F0(){if(tg)return ta;tg=1;var t=V0(),i=Cf(),r=$0();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(o(e)!==e)throw Error(s(188))}function m(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(s(188));return n!==e?null:e}for(var l=e,a=n;;){var c=l.return;if(c===null)break;var p=c.alternate;if(p===null){if(a=c.return,a!==null){l=a;continue}break}if(c.child===p.child){for(p=c.child;p;){if(p===l)return g(c),e;if(p===a)return g(c),n;p=p.sibling}throw Error(s(188))}if(l.return!==a.return)l=c,a=p;else{for(var b=!1,k=c.child;k;){if(k===l){b=!0,l=c,a=p;break}if(k===a){b=!0,a=c,l=p;break}k=k.sibling}if(!b){for(k=p.child;k;){if(k===l){b=!0,l=p,a=c;break}if(k===a){b=!0,a=p,l=c;break}k=k.sibling}if(!b)throw Error(s(189))}}if(l.alternate!==a)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),L=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Symbol.for("react.client.reference");function ie(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case E:return"Profiler";case M:return"StrictMode";case W:return"Suspense";case R:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case L:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case ne:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return n=e.displayName||null,n!==null?n:ie(e.type)||"Memo";case K:n=e._payload,e=e._init;try{return ie(e(n))}catch{}}return null}var le=Array.isArray,D=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},he=[],_=-1;function A(e){return{current:e}}function B(e){0>_||(e.current=he[_],he[_]=null,_--)}function j(e,n){_++,he[_]=e.current,e.current=n}var re=A(null),fe=A(null),pe=A(null),ke=A(null);function _e(e,n){switch(j(pe,n),j(fe,e),j(re,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?gm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=gm(n),e=xm(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(re),j(re,e)}function oe(){B(re),B(fe),B(pe)}function be(e){e.memoizedState!==null&&j(ke,e);var n=re.current,l=xm(n,e.type);n!==l&&(j(fe,e),j(re,l))}function We(e){fe.current===e&&(B(re),B(fe)),ke.current===e&&(B(ke),Kr._currentValue=ce)}var wt,Ft;function Xt(e){if(wt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);wt=n&&n[1]||"",Ft=-1<l.stack.indexOf(`
42
2
  at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
3
  `+wt+e+Ft}var Qt=!1;function ot(e,n){if(!e||Qt)return"";Qt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(n){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch($){var Y=$}Reflect.construct(e,[],ee)}else{try{ee.call()}catch($){Y=$}e.call(ee.prototype)}}else{try{throw Error()}catch($){Y=$}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch($){if($&&Y&&typeof $.stack=="string")return[$.stack,Y.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=a.DetermineComponentFrameRoot(),b=p[0],k=p[1];if(b&&k){var T=b.split(`
44
4
  `),I=k.split(`
@@ -74,237 +34,7 @@ Error generating stack: `+a.message+`
74
34
  `))+1))}const f="#".repeat(u),h=r.enter("headingAtx"),g=r.enter("phrasing");o.move(f+" ");let m=r.containerPhrasing(t,{before:"# ",after:`
75
35
  `,...o.current()});return/^[\t ]/.test(m)&&(m=ha(m.charCodeAt(0))+m.slice(1)),m=m?f+" "+m:f,r.options.closeAtx&&(m+=" "+f),g(),h(),m}Ny.peek=Lj;function Ny(t){return t.value||""}function Lj(){return"<"}Ey.peek=Uj;function Ey(t,i,r,s){const u=$f(r),o=u==='"'?"Quote":"Apostrophe",f=r.enter("image");let h=r.enter("label");const g=r.createTracker(s);let m=g.move("![");return m+=g.move(r.safe(t.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),h(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(h=r.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(r.safe(t.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(h=r.enter("destinationRaw"),m+=g.move(r.safe(t.url,{before:m,after:t.title?" ":")",...g.current()}))),h(),t.title&&(h=r.enter(`title${o}`),m+=g.move(" "+u),m+=g.move(r.safe(t.title,{before:m,after:u,...g.current()})),m+=g.move(u),h()),m+=g.move(")"),f(),m}function Uj(){return"!"}Cy.peek=qj;function Cy(t,i,r,s){const u=t.referenceType,o=r.enter("imageReference");let f=r.enter("label");const h=r.createTracker(s);let g=h.move("![");const m=r.safe(t.alt,{before:g,after:"]",...h.current()});g+=h.move(m+"]["),f();const y=r.stack;r.stack=[],f=r.enter("reference");const x=r.safe(r.associationId(t),{before:g,after:"]",...h.current()});return f(),r.stack=y,o(),u==="full"||!m||m!==x?g+=h.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function qj(){return"!"}_y.peek=Bj;function _y(t,i,r){let s=t.value||"",u="`",o=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(s);)u+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++o<r.unsafe.length;){const f=r.unsafe[o],h=r.compilePattern(f);let g;if(f.atBreak)for(;g=h.exec(s);){let m=g.index;s.charCodeAt(m)===10&&s.charCodeAt(m-1)===13&&m--,s=s.slice(0,m)+" "+s.slice(g.index+1)}}return u+s+u}function Bj(){return"`"}function Ty(t,i){const r=Lf(t);return!!(!i.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Ay.peek=Hj;function Ay(t,i,r,s){const u=$f(r),o=u==='"'?"Quote":"Apostrophe",f=r.createTracker(s);let h,g;if(Ty(t,r)){const y=r.stack;r.stack=[],h=r.enter("autolink");let x=f.move("<");return x+=f.move(r.containerPhrasing(t,{before:x,after:">",...f.current()})),x+=f.move(">"),h(),r.stack=y,x}h=r.enter("link"),g=r.enter("label");let m=f.move("[");return m+=f.move(r.containerPhrasing(t,{before:m,after:"](",...f.current()})),m+=f.move("]("),g(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(g=r.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(r.safe(t.url,{before:m,after:">",...f.current()})),m+=f.move(">")):(g=r.enter("destinationRaw"),m+=f.move(r.safe(t.url,{before:m,after:t.title?" ":")",...f.current()}))),g(),t.title&&(g=r.enter(`title${o}`),m+=f.move(" "+u),m+=f.move(r.safe(t.title,{before:m,after:u,...f.current()})),m+=f.move(u),g()),m+=f.move(")"),h(),m}function Hj(t,i,r){return Ty(t,r)?"<":"["}Dy.peek=Ij;function Dy(t,i,r,s){const u=t.referenceType,o=r.enter("linkReference");let f=r.enter("label");const h=r.createTracker(s);let g=h.move("[");const m=r.containerPhrasing(t,{before:g,after:"]",...h.current()});g+=h.move(m+"]["),f();const y=r.stack;r.stack=[],f=r.enter("reference");const x=r.safe(r.associationId(t),{before:g,after:"]",...h.current()});return f(),r.stack=y,o(),u==="full"||!m||m!==x?g+=h.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function Ij(){return"["}function Ff(t){const i=t.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function Yj(t){const i=Ff(t),r=t.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Vj(t){const i=t.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function Ry(t){const i=t.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function Gj(t,i,r,s){const u=r.enter("list"),o=r.bulletCurrent;let f=t.ordered?Vj(r):Ff(r);const h=t.ordered?f==="."?")":".":Yj(r);let g=i&&r.bulletLastUsed?f===r.bulletLastUsed:!1;if(!t.ordered){const y=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(g=!0),Ry(r)===f&&y){let x=-1;for(;++x<t.children.length;){const S=t.children[x];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(f=h),r.bulletCurrent=f;const m=r.containerFlow(t,s);return r.bulletLastUsed=f,r.bulletCurrent=o,u(),m}function $j(t){const i=t.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function Fj(t,i,r,s){const u=$j(r);let o=r.bulletCurrent||Ff(r);i&&i.type==="list"&&i.ordered&&(o=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(t))+o);let f=o.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||t.spread))&&(f=Math.ceil(f/4)*4);const h=r.createTracker(s);h.move(o+" ".repeat(f-o.length)),h.shift(f);const g=r.enter("listItem"),m=r.indentLines(r.containerFlow(t,h.current()),y);return g(),m;function y(x,S,v){return S?(v?"":" ".repeat(f))+x:(v?o:o+" ".repeat(f-o.length))+x}}function Xj(t,i,r,s){const u=r.enter("paragraph"),o=r.enter("phrasing"),f=r.containerPhrasing(t,s);return o(),u(),f}const Qj=ru(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Zj(t,i,r,s){return(t.children.some(function(f){return Qj(f)})?r.containerPhrasing:r.containerFlow).call(r,t,s)}function Kj(t){const i=t.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}zy.peek=Pj;function zy(t,i,r,s){const u=Kj(r),o=r.enter("strong"),f=r.createTracker(s),h=f.move(u+u);let g=f.move(r.containerPhrasing(t,{after:u,before:h,...f.current()}));const m=g.charCodeAt(0),y=Js(s.before.charCodeAt(s.before.length-1),m,u);y.inside&&(g=ha(m)+g.slice(1));const x=g.charCodeAt(g.length-1),S=Js(s.after.charCodeAt(0),x,u);S.inside&&(g=g.slice(0,-1)+ha(x));const v=f.move(u+u);return o(),r.attentionEncodeSurroundingInfo={after:S.outside,before:y.outside},h+g+v}function Pj(t,i,r){return r.options.strong||"*"}function Jj(t,i,r,s){return r.safe(t.value,s)}function Wj(t){const i=t.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function eN(t,i,r){const s=(Ry(r)+(r.options.ruleSpaces?" ":"")).repeat(Wj(r));return r.options.ruleSpaces?s.slice(0,-1):s}const My={blockquote:wj,break:Fg,code:Tj,definition:Dj,emphasis:jy,hardBreak:Fg,heading:Oj,html:Ny,image:Ey,imageReference:Cy,inlineCode:_y,link:Ay,linkReference:Dy,list:Gj,listItem:Fj,paragraph:Xj,root:Zj,strong:zy,text:Jj,thematicBreak:eN};function tN(){return{enter:{table:nN,tableData:Xg,tableHeader:Xg,tableRow:iN},exit:{codeText:rN,table:lN,tableData:Gc,tableHeader:Gc,tableRow:Gc}}}function nN(t){const i=t._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function lN(t){this.exit(t),this.data.inTable=void 0}function iN(t){this.enter({type:"tableRow",children:[]},t)}function Gc(t){this.exit(t)}function Xg(t){this.enter({type:"tableCell",children:[]},t)}function rN(t){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,aN));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(t)}function aN(t,i){return i==="|"?i:t}function sN(t){const i=t||{},r=i.tableCellPadding,s=i.tablePipeAlign,u=i.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
76
36
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:g,tableRow:h}};function f(v,N,C,M){return m(y(v,C,M),v.align)}function h(v,N,C,M){const E=x(v,C,M),V=m([E]);return V.slice(0,V.indexOf(`
77
- `))}function g(v,N,C,M){const E=C.enter("tableCell"),V=C.enter("phrasing"),L=C.containerPhrasing(v,{...M,before:o,after:o});return V(),E(),L}function m(v,N){return Sj(v,{align:N,alignDelimiters:s,padding:r,stringLength:u})}function y(v,N,C){const M=v.children;let E=-1;const V=[],L=N.enter("table");for(;++E<M.length;)V[E]=x(M[E],N,C);return L(),V}function x(v,N,C){const M=v.children;let E=-1;const V=[],L=N.enter("tableRow");for(;++E<M.length;)V[E]=g(M[E],v,N,C);return L(),V}function S(v,N,C){let M=My.inlineCode(v,N,C);return C.stack.includes("tableCell")&&(M=M.replace(/\|/g,"\\$&")),M}}function uN(){return{exit:{taskListCheckValueChecked:Qg,taskListCheckValueUnchecked:Qg,paragraph:cN}}}function oN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:fN}}}function Qg(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function cN(t){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const u=i.children;let o=-1,f;for(;++o<u.length;){const h=u[o];if(h.type==="paragraph"){f=h;break}}f===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(t)}function fN(t,i,r,s){const u=t.children[0],o=typeof t.checked=="boolean"&&u&&u.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",h=r.createTracker(s);o&&h.move(f);let g=My.listItem(t,i,r,{...s,...h.current()});return o&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(y){return y+f}}function dN(){return[Gw(),fj(),mj(),tN(),uN()]}function pN(t){return{extensions:[$w(),dj(t),gj(),sN(t),oN()]}}const hN={tokenize:vN,partial:!0},Oy={tokenize:SN,partial:!0},Ly={tokenize:kN,partial:!0},Uy={tokenize:wN,partial:!0},mN={tokenize:jN,partial:!0},qy={name:"wwwAutolink",tokenize:yN,previous:Hy},By={name:"protocolAutolink",tokenize:bN,previous:Iy},al={name:"emailAutolink",tokenize:xN,previous:Yy},Ln={};function gN(){return{text:Ln}}let oi=48;for(;oi<123;)Ln[oi]=al,oi++,oi===58?oi=65:oi===91&&(oi=97);Ln[43]=al;Ln[45]=al;Ln[46]=al;Ln[95]=al;Ln[72]=[al,By];Ln[104]=[al,By];Ln[87]=[al,qy];Ln[119]=[al,qy];function xN(t,i,r){const s=this;let u,o;return f;function f(x){return!bf(x)||!Yy.call(s,s.previous)||Xf(s.events)?r(x):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(x))}function h(x){return bf(x)?(t.consume(x),h):x===64?(t.consume(x),g):r(x)}function g(x){return x===46?t.check(mN,y,m)(x):x===45||x===95||zt(x)?(o=!0,t.consume(x),g):y(x)}function m(x){return t.consume(x),u=!0,g}function y(x){return o&&u&&Lt(s.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(x)):r(x)}}function yN(t,i,r){const s=this;return u;function u(f){return f!==87&&f!==119||!Hy.call(s,s.previous)||Xf(s.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(hN,t.attempt(Oy,t.attempt(Ly,o),r),r)(f))}function o(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(f)}}function bN(t,i,r){const s=this;let u="",o=!1;return f;function f(x){return(x===72||x===104)&&Iy.call(s,s.previous)&&!Xf(s.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),t.consume(x),h):r(x)}function h(x){if(Lt(x)&&u.length<5)return u+=String.fromCodePoint(x),t.consume(x),h;if(x===58){const S=u.toLowerCase();if(S==="http"||S==="https")return t.consume(x),g}return r(x)}function g(x){return x===47?(t.consume(x),o?m:(o=!0,g)):r(x)}function m(x){return x===null||Zs(x)||nt(x)||pi(x)||nu(x)?r(x):t.attempt(Oy,t.attempt(Ly,y),r)(x)}function y(x){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),i(x)}}function vN(t,i,r){let s=0;return u;function u(f){return(f===87||f===119)&&s<3?(s++,t.consume(f),u):f===46&&s===3?(t.consume(f),o):r(f)}function o(f){return f===null?r(f):i(f)}}function SN(t,i,r){let s,u,o;return f;function f(m){return m===46||m===95?t.check(Uy,g,h)(m):m===null||nt(m)||pi(m)||m!==45&&nu(m)?g(m):(o=!0,t.consume(m),f)}function h(m){return m===95?s=!0:(u=s,s=void 0),t.consume(m),f}function g(m){return u||s||!o?r(m):i(m)}}function kN(t,i){let r=0,s=0;return u;function u(f){return f===40?(r++,t.consume(f),u):f===41&&s<r?o(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(Uy,i,o)(f):f===null||nt(f)||pi(f)?i(f):(t.consume(f),u)}function o(f){return f===41&&s++,t.consume(f),u}}function wN(t,i,r){return s;function s(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(t.consume(h),s):h===38?(t.consume(h),o):h===93?(t.consume(h),u):h===60||h===null||nt(h)||pi(h)?i(h):r(h)}function u(h){return h===null||h===40||h===91||nt(h)||pi(h)?i(h):s(h)}function o(h){return Lt(h)?f(h):r(h)}function f(h){return h===59?(t.consume(h),s):Lt(h)?(t.consume(h),f):r(h)}}function jN(t,i,r){return s;function s(o){return t.consume(o),u}function u(o){return zt(o)?r(o):i(o)}}function Hy(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||nt(t)}function Iy(t){return!Lt(t)}function Yy(t){return!(t===47||bf(t))}function bf(t){return t===43||t===45||t===46||t===95||zt(t)}function Xf(t){let i=t.length,r=!1;for(;i--;){const s=t[i][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const NN={tokenize:zN,partial:!0};function EN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:AN,continuation:{tokenize:DN},exit:RN}},text:{91:{name:"gfmFootnoteCall",tokenize:TN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CN,resolveTo:_N}}}}function CN(t,i,r){const s=this;let u=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let f;for(;u--;){const g=s.events[u][1];if(g.type==="labelImage"){f=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return h;function h(g){if(!f||!f._balanced)return r(g);const m=Cn(s.sliceSerialize({start:f.end,end:s.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?r(g):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),i(g))}}function _N(t,i){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},h=[t[r+1],t[r+2],["enter",s,i],t[r+3],t[r+4],["enter",u,i],["exit",u,i],["enter",o,i],["enter",f,i],["exit",f,i],["exit",o,i],t[t.length-2],t[t.length-1],["exit",s,i]];return t.splice(r,t.length-r+1,...h),t}function TN(t,i,r){const s=this,u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,f;return h;function h(x){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?r(x):(t.enter("gfmFootnoteCallMarker"),t.consume(x),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",m)}function m(x){if(o>999||x===93&&!f||x===null||x===91||nt(x))return r(x);if(x===93){t.exit("chunkString");const S=t.exit("gfmFootnoteCallString");return u.includes(Cn(s.sliceSerialize(S)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),i):r(x)}return nt(x)||(f=!0),o++,t.consume(x),x===92?y:m}function y(x){return x===91||x===92||x===93?(t.consume(x),o++,m):m(x)}}function AN(t,i,r){const s=this,u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,f=0,h;return g;function g(N){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(N){return N===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",y):r(N)}function y(N){if(f>999||N===93&&!h||N===null||N===91||nt(N))return r(N);if(N===93){t.exit("chunkString");const C=t.exit("gfmFootnoteDefinitionLabelString");return o=Cn(s.sliceSerialize(C)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),S}return nt(N)||(h=!0),f++,t.consume(N),N===92?x:y}function x(N){return N===91||N===92||N===93?(t.consume(N),f++,y):y(N)}function S(N){return N===58?(t.enter("definitionMarker"),t.consume(N),t.exit("definitionMarker"),u.includes(o)||u.push(o),Ie(t,v,"gfmFootnoteDefinitionWhitespace")):r(N)}function v(N){return i(N)}}function DN(t,i,r){return t.check(ga,i,t.attempt(NN,i,r))}function RN(t){t.exit("gfmFootnoteDefinition")}function zN(t,i,r){const s=this;return Ie(t,u,"gfmFootnoteDefinitionIndent",5);function u(o){const f=s.events[s.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?i(o):r(o)}}function MN(t){let r=(t||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:u};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function u(f,h){let g=-1;for(;++g<f.length;)if(f[g][0]==="enter"&&f[g][1].type==="strikethroughSequenceTemporary"&&f[g][1]._close){let m=g;for(;m--;)if(f[m][0]==="exit"&&f[m][1].type==="strikethroughSequenceTemporary"&&f[m][1]._open&&f[g][1].end.offset-f[g][1].start.offset===f[m][1].end.offset-f[m][1].start.offset){f[g][1].type="strikethroughSequence",f[m][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[m][1].start),end:Object.assign({},f[g][1].end)},x={type:"strikethroughText",start:Object.assign({},f[m][1].end),end:Object.assign({},f[g][1].start)},S=[["enter",y,h],["enter",f[m][1],h],["exit",f[m][1],h],["enter",x,h]],v=h.parser.constructs.insideSpan.null;v&&an(S,S.length,0,lu(v,f.slice(m+1,g),h)),an(S,S.length,0,[["exit",x,h],["enter",f[g][1],h],["exit",f[g][1],h],["exit",y,h]]),an(f,m-1,g-m+3,S),g=m+S.length-2;break}}for(g=-1;++g<f.length;)f[g][1].type==="strikethroughSequenceTemporary"&&(f[g][1].type="data");return f}function o(f,h,g){const m=this.previous,y=this.events;let x=0;return S;function S(N){return m===126&&y[y.length-1][1].type!=="characterEscape"?g(N):(f.enter("strikethroughSequenceTemporary"),v(N))}function v(N){const C=rr(m);if(N===126)return x>1?g(N):(f.consume(N),x++,v);if(x<2&&!r)return g(N);const M=f.exit("strikethroughSequenceTemporary"),E=rr(N);return M._open=!E||E===2&&!!C,M._close=!C||C===2&&!!E,h(N)}}}class ON{constructor(){this.map=[]}add(i,r,s){LN(this,i,r,s)}consume(i){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let u=s.pop();for(;u;){for(const o of u)i.push(o);u=s.pop()}this.map.length=0}}function LN(t,i,r,s){let u=0;if(!(r===0&&s.length===0)){for(;u<t.map.length;){if(t.map[u][0]===i){t.map[u][1]+=r,t.map[u][2].push(...s);return}u+=1}t.map.push([i,r,s])}}function UN(t,i){let r=!1;const s=[];for(;i<t.length;){const u=t[i];if(r){if(u[0]==="enter")u[1].type==="tableContent"&&s.push(t[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(t[i-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return s}function qN(){return{flow:{null:{name:"table",tokenize:BN,resolveAll:HN}}}}function BN(t,i,r){const s=this;let u=0,o=0,f;return h;function h(O){let ue=s.events.length-1;for(;ue>-1;){const ie=s.events[ue][1].type;if(ie==="lineEnding"||ie==="linePrefix")ue--;else break}const te=ue>-1?s.events[ue][1].type:null,Se=te==="tableHead"||te==="tableRow"?R:g;return Se===R&&s.parser.lazy[s.now().line]?r(O):Se(O)}function g(O){return t.enter("tableHead"),t.enter("tableRow"),m(O)}function m(O){return O===124||(f=!0,o+=1),y(O)}function y(O){return O===null?r(O):we(O)?o>1?(o=0,s.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),v):r(O):Le(O)?Ie(t,y,"whitespace")(O):(o+=1,f&&(f=!1,u+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),f=!0,y):(t.enter("data"),x(O)))}function x(O){return O===null||O===124||nt(O)?(t.exit("data"),y(O)):(t.consume(O),O===92?S:x)}function S(O){return O===92||O===124?(t.consume(O),x):x(O)}function v(O){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(O):(t.enter("tableDelimiterRow"),f=!1,Le(O)?Ie(t,N,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):N(O))}function N(O){return O===45||O===58?M(O):O===124?(f=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),C):W(O)}function C(O){return Le(O)?Ie(t,M,"whitespace")(O):M(O)}function M(O){return O===58?(o+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),E):O===45?(o+=1,E(O)):O===null||we(O)?ne(O):W(O)}function E(O){return O===45?(t.enter("tableDelimiterFiller"),V(O)):W(O)}function V(O){return O===45?(t.consume(O),V):O===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),L):(t.exit("tableDelimiterFiller"),L(O))}function L(O){return Le(O)?Ie(t,ne,"whitespace")(O):ne(O)}function ne(O){return O===124?N(O):O===null||we(O)?!f||u!==o?W(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(O)):W(O)}function W(O){return r(O)}function R(O){return t.enter("tableRow"),P(O)}function P(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),P):O===null||we(O)?(t.exit("tableRow"),i(O)):Le(O)?Ie(t,P,"whitespace")(O):(t.enter("data"),K(O))}function K(O){return O===null||O===124||nt(O)?(t.exit("data"),P(O)):(t.consume(O),O===92?G:K)}function G(O){return O===92||O===124?(t.consume(O),K):K(O)}}function HN(t,i){let r=-1,s=!0,u=0,o=[0,0,0,0],f=[0,0,0,0],h=!1,g=0,m,y,x;const S=new ON;for(;++r<t.length;){const v=t[r],N=v[1];v[0]==="enter"?N.type==="tableHead"?(h=!1,g!==0&&(Zg(S,i,g,m,y),y=void 0,g=0),m={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},S.add(r,0,[["enter",m,i]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(s=!0,x=void 0,o=[0,0,0,0],f=[0,r+1,0,0],h&&(h=!1,y={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},S.add(r,0,[["enter",y,i]])),u=N.type==="tableDelimiterRow"?2:y?3:1):u&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(s=!1,f[2]===0&&(o[1]!==0&&(f[0]=f[1],x=Is(S,i,o,u,void 0,x),o=[0,0,0,0]),f[2]=r)):N.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(f[0]=f[1],x=Is(S,i,o,u,void 0,x)),o=f,f=[o[1],r,0,0])):N.type==="tableHead"?(h=!0,g=r):N.type==="tableRow"||N.type==="tableDelimiterRow"?(g=r,o[1]!==0?(f[0]=f[1],x=Is(S,i,o,u,r,x)):f[1]!==0&&(x=Is(S,i,f,u,r,x)),u=0):u&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(f[3]=r)}for(g!==0&&Zg(S,i,g,m,y),S.consume(i.events),r=-1;++r<i.events.length;){const v=i.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=UN(i.events,r))}return t}function Is(t,i,r,s,u,o){const f=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(o.end=Object.assign({},lr(i.events,r[0])),t.add(r[0],0,[["exit",o,i]]));const g=lr(i.events,r[1]);if(o={type:f,start:Object.assign({},g),end:Object.assign({},g)},t.add(r[1],0,[["enter",o,i]]),r[2]!==0){const m=lr(i.events,r[2]),y=lr(i.events,r[3]),x={type:h,start:Object.assign({},m),end:Object.assign({},y)};if(t.add(r[2],0,[["enter",x,i]]),s!==2){const S=i.events[r[2]],v=i.events[r[3]];if(S[1].end=Object.assign({},v[1].end),S[1].type="chunkText",S[1].contentType="text",r[3]>r[2]+1){const N=r[2]+1,C=r[3]-r[2]-1;t.add(N,C,[])}}t.add(r[3]+1,0,[["exit",x,i]])}return u!==void 0&&(o.end=Object.assign({},lr(i.events,u)),t.add(u,0,[["exit",o,i]]),o=void 0),o}function Zg(t,i,r,s,u){const o=[],f=lr(i.events,r);u&&(u.end=Object.assign({},f),o.push(["exit",u,i])),s.end=Object.assign({},f),o.push(["exit",s,i]),t.add(r+1,0,o)}function lr(t,i){const r=t[i],s=r[0]==="enter"?"start":"end";return r[1][s]}const IN={name:"tasklistCheck",tokenize:VN};function YN(){return{text:{91:IN}}}function VN(t,i,r){const s=this;return u;function u(g){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(g):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),o)}function o(g){return nt(g)?(t.enter("taskListCheckValueUnchecked"),t.consume(g),t.exit("taskListCheckValueUnchecked"),f):g===88||g===120?(t.enter("taskListCheckValueChecked"),t.consume(g),t.exit("taskListCheckValueChecked"),f):r(g)}function f(g){return g===93?(t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),h):r(g)}function h(g){return we(g)?i(g):Le(g)?t.check({tokenize:GN},i,r)(g):r(g)}}function GN(t,i,r){return Ie(t,s,"whitespace");function s(u){return u===null?r(u):i(u)}}function $N(t){return Wx([gN(),EN(),MN(t),qN(),YN()])}const FN={};function XN(t){const i=this,r=t||FN,s=i.data(),u=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),f=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);u.push($N(r)),o.push(dN()),f.push(pN(r))}/**
78
- * @license lucide-react v1.26.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const Vy=(...t)=>t.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();/**
83
- * @license lucide-react v1.26.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const QN=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
88
- * @license lucide-react v1.26.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const ZN=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,s)=>s?s.toUpperCase():r.toLowerCase());/**
93
- * @license lucide-react v1.26.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const Kg=t=>{const i=ZN(t);return i.charAt(0).toUpperCase()+i.slice(1)};/**
98
- * @license lucide-react v1.26.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */var $c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
103
- * @license lucide-react v1.26.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const KN=t=>{for(const i in t)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},PN=w.createContext({}),JN=()=>w.useContext(PN),WN=w.forwardRef(({color:t,size:i,strokeWidth:r,absoluteStrokeWidth:s,className:u="",children:o,iconNode:f,...h},g)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:x=!1,color:S="currentColor",className:v=""}=JN()??{},N=s??x?Number(r??y)*24/Number(i??m):r??y;return w.createElement("svg",{ref:g,...$c,width:i??m??$c.width,height:i??m??$c.height,stroke:t??S,strokeWidth:N,className:Vy("lucide",v,u),...!o&&!KN(h)&&{"aria-hidden":"true"},...h},[...f.map(([C,M])=>w.createElement(C,M)),...Array.isArray(o)?o:[o]])});/**
108
- * @license lucide-react v1.26.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const Re=(t,i)=>{const r=w.forwardRef(({className:s,...u},o)=>w.createElement(WN,{ref:o,iconNode:i,className:Vy(`lucide-${QN(Kg(t))}`,`lucide-${t}`,s),...u}));return r.displayName=Kg(t),r};/**
113
- * @license lucide-react v1.26.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const eE=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],tE=Re("arrow-down",eE);/**
118
- * @license lucide-react v1.26.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const nE=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],lE=Re("arrow-up",nE);/**
123
- * @license lucide-react v1.26.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const iE=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],rE=Re("bot",iE);/**
128
- * @license lucide-react v1.26.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const aE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ya=Re("check",aE);/**
133
- * @license lucide-react v1.26.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const sE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gy=Re("chevron-down",sE);/**
138
- * @license lucide-react v1.26.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const uE=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oE=Re("chevron-left",uE);/**
143
- * @license lucide-react v1.26.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const cE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],su=Re("chevron-right",cE);/**
148
- * @license lucide-react v1.26.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const fE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],dE=Re("circle-check",fE);/**
153
- * @license lucide-react v1.26.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const pE=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],hE=Re("circle-dashed",pE);/**
158
- * @license lucide-react v1.26.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const mE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pg=Re("circle-x",mE);/**
163
- * @license lucide-react v1.26.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const gE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],xE=Re("copy",gE);/**
168
- * @license lucide-react v1.26.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const yE=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],bE=Re("ellipsis",yE);/**
173
- * @license lucide-react v1.26.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const vE=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],SE=Re("external-link",vE);/**
178
- * @license lucide-react v1.26.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const kE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],wE=Re("file-text",kE);/**
183
- * @license lucide-react v1.26.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const jE=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],NE=Re("gauge",jE);/**
188
- * @license lucide-react v1.26.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const EE=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],CE=Re("git-branch",EE);/**
193
- * @license lucide-react v1.26.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const _E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],TE=Re("globe",_E);/**
198
- * @license lucide-react v1.26.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const AE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qf=Re("loader-circle",AE);/**
203
- * @license lucide-react v1.26.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const DE=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],RE=Re("message-circle-question-mark",DE);/**
208
- * @license lucide-react v1.26.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const zE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],ME=Re("panel-left-close",zE);/**
213
- * @license lucide-react v1.26.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const OE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],LE=Re("panel-left-open",OE);/**
218
- * @license lucide-react v1.26.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const UE=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Jg=Re("paperclip",UE);/**
223
- * @license lucide-react v1.26.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const qE=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],BE=Re("pause",qE);/**
228
- * @license lucide-react v1.26.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const HE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$y=Re("pencil",HE);/**
233
- * @license lucide-react v1.26.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const IE=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],YE=Re("play",IE);/**
238
- * @license lucide-react v1.26.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const VE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Zf=Re("refresh-cw",VE);/**
243
- * @license lucide-react v1.26.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const GE=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$E=Re("search",GE);/**
248
- * @license lucide-react v1.26.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const FE=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Fy=Re("settings",FE);/**
253
- * @license lucide-react v1.26.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const XE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],vf=Re("shield-alert",XE);/**
258
- * @license lucide-react v1.26.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const QE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ZE=Re("shield",QE);/**
263
- * @license lucide-react v1.26.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const KE=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],PE=Re("sparkles",KE);/**
268
- * @license lucide-react v1.26.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const JE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],WE=Re("square-check",JE);/**
273
- * @license lucide-react v1.26.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const eC=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Xy=Re("square-pen",eC);/**
278
- * @license lucide-react v1.26.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const tC=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],nC=Re("square-terminal",tC);/**
283
- * @license lucide-react v1.26.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const lC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],uu=Re("square",lC);/**
288
- * @license lucide-react v1.26.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const iC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Qy=Re("target",iC);/**
293
- * @license lucide-react v1.26.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const rC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Kf=Re("trash-2",rC);/**
298
- * @license lucide-react v1.26.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const aC=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Zy=Re("wrench",aC);/**
303
- * @license lucide-react v1.26.0 - ISC
304
- *
305
- * This source code is licensed under the ISC license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const sC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=Re("x",sC),Ky=new Map([["theme","This app follows your system appearance."],["keybindings","This app uses standard keyboard shortcuts here."],["editor","Type your message directly in the composer."],["statusline","The GUI shows session status in its own status row, not a terminal status line."],["shell","Use the Terminal app for shell commands."],["exit","Close the window or tab to end this session; delete it from the sidebar to remove it for good."],["devices","Device pairing is managed from the terminal for now."]]),uC="This command runs in the host terminal.";function Py(t){return Ky.has(t.name)?!0:t.runner==="client"&&!(t.surfaces??[]).includes("gui")}function Jy(t){return Ky.get(t)??uC}function oC(t,i){switch(i.type){case"permission_request":{const{id:r,toolName:s,toolArgs:u,requesterDriverId:o,requester:f,diffLines:h,diffFile:g,cwd:m}=i.event;return t.some(y=>y.id===r)?t:[...t,{kind:"permission",id:r,toolName:s,toolArgs:u,...o?{requesterDriverId:o}:{},...f?{requester:f}:{},...h?{diffLines:h,diffFile:g}:{},...m?{cwd:m}:{}}]}case"ask_request":{const{id:r,request:s,requesterDriverId:u}=i.event;return t.some(o=>o.id===r)?t:[...t,{kind:"ask",id:r,request:s,...u?{requesterDriverId:u}:{}}]}case"prompt_resolved":{const{id:r}=i.event,s=t.filter(u=>u.id!==r);return s.length===t.length?t:s}default:return t}}function cC(t,i){return{type:"permission-response",id:t,result:i}}function fC(t,i){return{type:"ask-response",id:t,response:i}}function aa(t){switch(t.type){case"show-plugin-manager":return"plugin";case"show-settings":return"settings";case"show-session-picker":return"resume";case"show-agent-switcher":return"agent";case"show-theme-picker":return"theme";default:return t.type}}function Ys(t){return t.type==="show-session-picker"?"session-sidebar":t.type==="show-settings"?"settings":t.type==="show-plugin-manager"?"settings-plugins":t.type==="show-agent-switcher"?"agent-switcher":null}function dC(t){switch(t.type){case"show-session-picker":return"This host cannot list sessions, so there is nothing to resume.";case"show-theme-picker":return Jy("theme");default:return`This client does not have a screen for '${t.type}' yet.`}}const pC=2e3,hC=10;function mC(t,i){let r=null,s="disconnected",u=null,o=0,f=!1;function h(v){s=v,i.onStatusChange(v)}function g(){if(!f){if(o>=hC){i.onGiveUp?.();return}u=setTimeout(()=>{o++,m()},pC)}}function m(){h("connecting"),r=new WebSocket(t),r.onopen=()=>{o=0,h("connected"),S({type:"get-messages"})},r.onmessage=v=>{const N=v.data;if(typeof N!="string")return;const C=qx(N,Ux);if(!C.ok){i.onMessage({type:"protocol_error",message:`Malformed message from server (${C.reason})`});return}i.onMessage(C.message)},r.onclose=()=>{r=null,f?h("disconnected"):(h("disconnected"),g())},r.onerror=()=>{h("error")}}function y(){f=!1,u!==null&&(clearTimeout(u),u=null),m()}function x(){f=!0,u!==null&&(clearTimeout(u),u=null),r?.close(),r=null,h("disconnected")}function S(v){r?.readyState===WebSocket.OPEN&&r.send(JSON.stringify(v))}return{connect:y,disconnect:x,send:S,status:()=>s}}const gC={text_delta:"reducer-state",user_message:"reducer-state",tool_start:"reducer-state",tool_end:"reducer-state",thinking:"reducer-state",complete:"reducer-state",interrupted:"reducer-state",error:"visible-notice",command_result:"reducer-state",messages:"reducer-state",history:"intentionally-not-rendered",history_changed:"visible-notice",context:"reducer-state",turn_source:"intentionally-not-rendered",commands:"reducer-state",session_status:"reducer-state",model_list:"reducer-state",agent_definitions:"reducer-state",sessions:"reducer-state",sessions_error:"reducer-state",session_switched:"reducer-state",session_change_failed:"visible-notice",session_renamed_in_list:"reducer-state",session_rename_failed:"visible-notice",session_deleted:"reducer-state",session_delete_failed:"visible-notice",usage_report:"reducer-state",personal_usage_report:"reducer-state",personal_usage_report_error:"visible-notice",stored_session_usage_report:"reducer-state",stored_session_usage_report_error:"visible-notice",executing:"intentionally-not-rendered",pending:"reducer-state",execution_workspace_event:"reducer-state",execution_detail:"reducer-state",execution_detail_error:"reducer-state",waiting_loop_stop:"intentionally-not-rendered",project_status:"reducer-state",project_diff:"reducer-state",project_memory:"reducer-state",app_view:"reducer-state",app_tool_result:"reducer-state",background_task_event:"intentionally-not-rendered",background_job_group_event:"intentionally-not-rendered",plan_event:"intentionally-not-rendered",context_file_refreshed:"intentionally-not-rendered",branch_event:"intentionally-not-rendered",background_tasks:"reducer-state",background_task:"intentionally-not-rendered",background_job_groups:"intentionally-not-rendered",background_job_group:"intentionally-not-rendered",background_task_log:"intentionally-not-rendered",permission_request:"reducer-state",ask_request:"reducer-state",prompt_resolved:"reducer-state",ui_intent:"reducer-state",session_renamed:"reducer-state",history_cleared:"reducer-state",background_task_control_result:"visible-notice",protocol_error:"visible-notice",resume_gap:"transport-control",surface_role:"reducer-state",settings:"reducer-state",settings_error:"reducer-state"};let Wg=0;function ex(t){return Wg+=1,`${t}_${Wg}_${Date.now()}`}function xC(t){const[i,r]=w.useState(!1),[s,u]=w.useState("idle"),[o,f]=w.useState([]),[h,g]=w.useState(null),[m,y]=w.useState(null),x=w.useRef(null),S=w.useRef(null),v=w.useCallback(C=>C.type!=="agent_definitions"?!1:(x.current!==C.requestId||(f(C.agents),g(C.current),u("ready")),!0),[]),N=w.useCallback(()=>{const C=ex("get_agent_definitions");x.current=C,t({type:"get-agent-definitions",requestId:C})},[t]);return{agentSwitcherOpen:i,agentSwitcherStatus:s,agentDefinitions:o,currentAgentType:h,agentSwitchMessage:m,openAgentSwitcher:w.useCallback(()=>{r(!0),u(C=>C==="ready"?"ready":"loading"),y(null),N()},[N]),closeAgentSwitcher:w.useCallback(()=>{r(!1)},[]),selectAgent:w.useCallback(C=>{const M=ex("agent_switch");S.current=M,y(null),t({type:"command",name:"agent",args:C,requestId:M})},[t]),handleAgentDefinitionsMessage:v,resolveSwitchResult:w.useCallback((C,M)=>C===void 0||S.current!==C?!1:(S.current=null,y(M.message),M.success&&N(),!0),[N])}}let tx=0;function nx(t){return tx+=1,`${t}_${tx}_${Date.now()}`}const lx="The connection to the session closed.",yC="This session is read-only.";function bC(t){return t.appView?.viewId}function vC(t,i){return{type:"read-app-view",requestId:t,viewId:i}}function SC(t,i,r,s){return{type:"call-app-tool",requestId:t,viewId:i,name:r,arguments:s}}function kC(t,i,r){const s=w.useRef(new Map),[u]=w.useState(()=>nx("app_request")),o=w.useCallback((h=lx)=>{const g=[...s.current.values()];s.current.clear();for(const m of g)m.dispose(),m.reject(new Error(h))},[]),f=w.useCallback((h,g,m,y)=>new Promise((x,S)=>{if(!i()||y?.aborted){S(new Error(y?.aborted?"The app view closed.":lx));return}if(r()){S(new Error(yC));return}const v=nx(`${u}_${h}`),N=()=>y?.removeEventListener("abort",C),C=()=>{s.current.delete(v),N(),S(new Error("The app view closed."))};s.current.set(v,m(x,S,N)),y?.addEventListener("abort",C,{once:!0});try{t(g(v))}catch(M){s.current.delete(v),N(),S(M instanceof Error?M:new Error(String(M)))}}),[i,r,u,t]);return{readAppView:w.useCallback((h,g)=>f("app_view",m=>vC(m,h),(m,y,x)=>({answer:"app_view",resolve:m,reject:y,dispose:x}),g),[f]),callAppTool:w.useCallback((h,g,m,y)=>f("app_tool",x=>SC(x,h,g,m),(x,S,v)=>({answer:"app_tool_result",resolve:x,reject:S,dispose:v}),y),[f]),handleAppViewMessage:w.useCallback(h=>{if(h.type==="app_view"||h.type==="app_tool_result"){const g=s.current.get(h.requestId);if(g===void 0||g.answer!==h.type)return!0;if(s.current.delete(h.requestId),g.dispose(),h.type==="app_view"&&g.answer==="app_view")g.resolve(h.view);else if(h.type==="app_tool_result"&&g.answer==="app_tool_result"){const{success:m,data:y,parts:x,error:S}=h;g.resolve({success:m,...y!==void 0?{data:y}:{},...x!==void 0?{parts:x}:{},...S!==void 0?{error:S}:{}})}return!0}if(h.type==="protocol_error"&&h.requestId!==void 0){const g=s.current.get(h.requestId);return g===void 0?h.requestId.startsWith(`${u}_`):(s.current.delete(h.requestId),g.dispose(),g.reject(new Error(h.message)),!0)}return!1},[u]),rejectPendingAppRequests:o}}let ix=0;function wC(){return ix+=1,`execdetail_${ix}_${Date.now()}`}function jC(t){const[i,r]=w.useState(null),[s,u]=w.useState("idle"),[o,f]=w.useState([]),[h,g]=w.useState(null),[m,y]=w.useState(!1),[x,S]=w.useState("live"),[v,N]=w.useState(),C=w.useRef(null),M=w.useRef(null),E=w.useRef("live"),V=w.useRef(void 0),L=w.useRef(null),ne=w.useRef(null),W=w.useRef(0),R=w.useCallback((D,X,ce=!1)=>{if(C.current!==null){(!ce||L.current===null||L.current.refresh)&&(L.current={cursor:X,refresh:ce});return}const he=wC();C.current=he,W.current=Date.now(),ce||u("loading"),g(null),t({type:"read-execution-detail",requestId:he,entryId:D,cursor:X})},[t]),P=w.useCallback(()=>{ne.current!==null&&clearTimeout(ne.current),ne.current=null,L.current=null},[]);w.useEffect(()=>P,[P]);const K=w.useCallback(D=>{P(),C.current=null,M.current=D,E.current="live",S("live"),r(D),f([]),N(void 0),y(!1),V.current=void 0,R(D)},[P,R]),G=w.useCallback(()=>{!i||s==="loading"||m||R(i,V.current)},[i,s,m,R]),O=w.useCallback(D=>{const X=M.current;X&&(P(),E.current=D,S(D),f([]),N(void 0),y(!1),u("loading"),V.current=void 0,R(X,D==="transcript"?{offset:0}:void 0))},[P,R]),ue=w.useCallback(()=>O("transcript"),[O]),te=w.useCallback(()=>O("live"),[O]),Se=w.useCallback(()=>{P(),r(null),C.current=null,M.current=null,f([]),N(void 0),u("idle"),g(null),y(!1)},[P]),ie=w.useCallback(D=>{if(ne.current!==null)return;const X=Math.max(0,250-(Date.now()-W.current));ne.current=setTimeout(()=>{ne.current=null,M.current===D&&E.current==="live"&&R(D,void 0,!0)},X)},[R]),le=w.useCallback(D=>{const X=M.current;if(!X||E.current!=="live")return;const ce=D.entries.find(he=>he.id===X);ce?.resumeSessionId&&ce.controls.includes("attach")&&ie(X)},[ie]);return{openEntryId:i,executionDetailStatus:s,executionDetailRecords:o,executionDetailError:h,executionDetailComplete:m,executionDetailMode:x,executionDetailUnreadable:v,openExecutionDetail:K,loadMoreExecutionDetail:G,showEarlierExecutionDetail:ue,showLiveExecutionDetail:te,closeExecutionDetail:Se,handleExecutionDetailMessage:w.useCallback(D=>{if(D.type!=="execution_detail"&&D.type!=="execution_detail_error")return!1;if(C.current!==D.requestId)return!0;C.current=null;const X=L.current;return L.current=null,(!X||X.refresh)&&(D.type==="execution_detail_error"?(u("error"),g(D.message)):(f(ce=>D.page.cursor===void 0||D.page.cursor.offset===0?D.page.records:[...ce,...D.page.records]),N(ce=>{const he=D.page.unreadable;return D.page.cursor===void 0||D.page.cursor.offset===0||!ce?he:he?{locked:ce.locked+he.locked,noKeys:ce.noKeys+he.noKeys,doesNotOpen:ce.doesNotOpen+he.doesNotOpen}:ce}),V.current=D.page.nextCursor,y(D.page.nextCursor===void 0),u("ready"))),X&&M.current&&(X.refresh?ie(M.current):R(M.current,X.cursor)),!0},[R,ie]),handleExecutionWorkspace:le}}let rx=0;function NC(){return rx+=1,`model_list_${rx}_${Date.now()}`}function EC(t){const[i,r]=w.useState(null),s=w.useRef(null),u=w.useCallback(o=>o.type!=="model_list"?!1:(s.current!==o.requestId||r({groups:o.groups,currentModel:o.currentModel,...o.currentProfile!==void 0?{currentProfile:o.currentProfile}:{}}),!0),[]);return{modelList:i,requestModelList:w.useCallback(()=>{const o=NC();s.current=o,t({type:"list-models",requestId:o})},[t]),handleModelListMessage:u}}let ax=0;function sx(t){return ax+=1,`${t}_${ax}_${Date.now()}`}function CC(t){const[i,r]=w.useState("idle"),[s,u]=w.useState(null),[o,f]=w.useState(null),[h,g]=w.useState("idle"),[m,y]=w.useState(null),[x,S]=w.useState(null),[v,N]=w.useState(null),[C,M]=w.useState("idle"),[E,V]=w.useState(null),L=w.useRef(null),ne=w.useRef(null),W=w.useCallback(R=>R.type==="personal_usage_report"||R.type==="personal_usage_report_error"?(L.current!==R.requestId||(u(R.type==="personal_usage_report"?R.report:null),f(R.type==="personal_usage_report_error"?R.message:null),r(R.type==="personal_usage_report"?"ready":"error")),!0):R.type==="usage_report"?(V(R.report),M("ready"),!0):R.type==="stored_session_usage_report"||R.type==="stored_session_usage_report_error"?(ne.current!==R.requestId||(y(R.type==="stored_session_usage_report"?R.report:null),S(R.sessionId),N(R.type==="stored_session_usage_report_error"?R.message:null),g(R.type==="stored_session_usage_report"?"ready":"error")),!0):(R.type==="protocol_error"&&M(P=>P==="loading"?"error":P),!1),[]);return{personalUsageStatus:i,personalUsageReport:s,personalUsageError:o,requestPersonalUsage:w.useCallback(R=>{const P=sx("personal_usage");L.current=P,r("loading"),f(null),t({type:"get-personal-usage-report",requestId:P,period:R,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"})},[t]),storedSessionUsageStatus:h,storedSessionUsageReport:m,storedSessionUsageSessionId:x,storedSessionUsageError:v,requestStoredSessionUsage:w.useCallback(R=>{const P=sx("stored_session_usage");ne.current=P,g("loading"),y(null),S(R),N(null),t({type:"get-stored-session-usage-report",requestId:P,sessionId:R})},[t]),currentSessionUsageStatus:C,currentSessionUsageReport:E,requestCurrentSessionUsage:w.useCallback(()=>{M("loading"),t({type:"get-usage-report"})},[t]),handleUsageMessage:W}}let ux=0;function Fc(t){return ux+=1,`${t}_${ux}_${Date.now()}`}function _C(t){const[i,r]=w.useState("idle"),[s,u]=w.useState(null),[o,f]=w.useState("idle"),[h,g]=w.useState(null),[m,y]=w.useState(null),[x,S]=w.useState("idle"),[v,N]=w.useState(null),C=w.useRef(null),M=w.useRef(null),E=w.useRef(null),V=w.useCallback(L=>L.type==="project_status"?(C.current!==L.requestId||(u(L.result),r("ready")),!0):L.type==="project_diff"?(M.current!==L.requestId||(y(L.result),f("ready")),!0):L.type==="project_memory"?(E.current!==L.requestId||(N(L.result),S("ready")),!0):(L.type==="protocol_error"&&L.requestId!==void 0&&(C.current===L.requestId&&r("error"),M.current===L.requestId&&f("error"),E.current===L.requestId&&S("error")),!1),[]);return{projectStatusState:i,projectStatus:s,requestProjectStatus:w.useCallback(()=>{const L=Fc("project_status");C.current=L,r("loading"),t({type:"project-status",requestId:L})},[t]),projectDiffState:o,projectDiffPath:h,projectDiff:m,requestProjectDiff:w.useCallback(L=>{const ne=Fc("project_diff");M.current=ne,g(L),f("loading"),y(null),t({type:"project-diff",requestId:ne,path:L})},[t]),projectMemoryState:x,projectMemory:v,requestProjectMemory:w.useCallback(()=>{const L=Fc("project_memory");E.current=L,S("loading"),t({type:"project-memory",requestId:L})},[t]),handleProjectMessage:V}}function TC(t){const[i,r]=w.useState([]),s=w.useCallback(()=>{t({type:"get-background-tasks",filter:{kind:"scheduled"}})},[t]),u=w.useCallback(o=>o.type==="background_tasks"?(r(o.tasks.filter(f=>f.kind==="scheduled")),!0):o.type==="background_task_control_result"&&o.action==="cancel"?(o.success&&s(),!1):(o.type==="command_result"&&o.name==="schedule"&&o.success&&s(),!1),[s]);return{scheduledTasks:i,pauseSchedule:w.useCallback(o=>{t({type:"command",name:"schedule",args:`pause ${o}`})},[t]),resumeSchedule:w.useCallback(o=>{t({type:"command",name:"schedule",args:`resume ${o}`})},[t]),deleteSchedule:w.useCallback(o=>{t({type:"cancel-background-task",taskId:o})},[t]),handleSchedulesMessage:u,requestSchedules:s}}const Wy=w.createContext(null);function AC({value:t,children:i}){if(!t.identity.displayName||!t.identity.cliName||!t.storage.browserNamespace)throw new Error("A public product identity is required");return d.jsx(Wy.Provider,{value:t,children:i},t.storage.browserNamespace)}function ql(){const t=w.useContext(Wy);if(t===null)throw new Error("ProductIdentityProvider is required");return t}let ox=0;function tr(t){return ox+=1,`${t}_${ox}_${Date.now()}`}function DC(t){return t.sessions.some(i=>typeof i.live=="boolean")}function Pf(t){return`${t}.restoreSessionId`}function e1(t,i){try{window.sessionStorage.setItem(Pf(t),i)}catch{}}function RC(t){try{return window.sessionStorage.getItem(Pf(t))}catch{return null}}function zC(t){try{window.sessionStorage.removeItem(Pf(t))}catch{}}function MC(){return typeof window>"u"||typeof window.matchMedia!="function"?!0:window.matchMedia("(min-width: 768px)").matches}function OC(t,i){const{storage:{browserNamespace:r}}=ql(),[s,u]=w.useState(null),[o,f]=w.useState(null),[h,g]=w.useState(MC),m=w.useRef(null),y=w.useRef(!1),x=w.useCallback(()=>{const W=tr("sessions");m.current=W,t({type:"list-sessions",requestId:W})},[t]),S=w.useRef(null);S.current=s?.currentSessionId??null;const v=w.useCallback(W=>{W!==S.current&&t({type:"switch-session",sessionId:W,requestId:tr("session_change")})},[t,r]),N=w.useCallback(()=>t({type:"new-session",requestId:tr("session_change")}),[t,r]),C=w.useCallback((W,R)=>t({type:"rename-session",sessionId:W,name:R,requestId:tr("session_rename")}),[t,r]),M=w.useCallback(W=>t({type:"delete-session",sessionId:W,requestId:tr("session_delete")}),[t,r]),E=w.useRef(null),V=w.useRef(null),L=w.useCallback(()=>{V.current=RC(r)??E.current},[r]),ne=w.useCallback(W=>{const R=V.current;V.current=null,R!==null&&(zC(r),R!==W.currentSessionId&&(i()||DC(W)&&W.sessions.some(P=>P.id===R)&&t({type:"switch-session",sessionId:R,requestId:tr("session_change")})))},[t,r,i]);return{sessionListing:s,sessionsError:o,requestSessions:x,switchSession:v,newSession:N,renameSessionInList:C,deleteSession:M,sessionSidebarOpen:h,setSessionSidebarOpen:g,handleSessionsMessage:w.useCallback(W=>W.type!=="sessions"&&W.type!=="sessions_error"?!1:W.requestId!==m.current?!0:W.type==="sessions"?(y.current=!1,u(W.listing),f(null),ne(W.listing),!0):(V.current=null,y.current=W.code==="not_available",W.code==="not_available"&&u(null),f({code:W.code,message:W.message}),!0),[ne]),canListSessions:w.useCallback(()=>!y.current,[]),markCurrent:w.useCallback(W=>{E.current=W,e1(r,W),u(R=>R===null?R:{...R,currentSessionId:W})},[r]),armRestore:L}}let cx=0;function fx(t){return cx+=1,`${t}_${cx}_${Date.now()}`}function LC(t){const[i,r]=w.useState(!1),[s,u]=w.useState("idle"),[o,f]=w.useState(null),[h,g]=w.useState(null),[m,y]=w.useState(null),x=w.useRef(null),S=w.useCallback(N=>N.type!=="settings"&&N.type!=="settings_error"?!1:x.current!==N.requestId?!0:N.type==="settings"?(f(N.settings),u("ready"),g(null),!0):(g(N.message),u(C=>C==="ready"?"ready":"error"),!0),[]),v=w.useCallback(()=>{u(C=>C==="ready"?"ready":"loading"),g(null);const N=fx("get_settings");x.current=N,t({type:"get-settings",requestId:N})},[t]);return{settingsOpen:i,settingsStatus:s,settingsSnapshot:o,settingsError:h,settingsInitialSectionId:m,openSettings:w.useCallback(N=>{r(!0),y(N??null),v()},[v]),closeSettings:w.useCallback(()=>{r(!1)},[]),updateSettings:w.useCallback(N=>{const C=fx("update_settings");x.current=C,g(null),t({type:"update-settings",requestId:C,patch:N})},[t]),handleSettingsMessage:S,refreshSettings:v}}let UC=0;function pt(){return`msg_${++UC}_${Date.now()}`}let dx=0;function qC(){return dx+=1,`silent_command_${dx}_${Date.now()}`}function t1(t,i){const r=t[t.length-1];return r&&r.type==="text"?[...t.slice(0,-1),{...r,text:r.text+i}]:[...t,{type:"text",id:pt(),text:i}]}function n1(t,i){const r=t[t.length-1];return r&&r.type==="tools"?[...t.slice(0,-1),{...r,tools:[...r.tools,i]}]:[...t,{type:"tools",id:pt(),tools:[i]}]}function l1(t,i){return i.executionId!==void 0?t.findIndex(r=>r.executionId===i.executionId&&r.status==="running"):t.findIndex(r=>r.name===i.toolName&&r.status==="running")}function i1(t){return{id:pt(),name:t.toolName,input:t.firstArg,...t.executionId?{executionId:t.executionId}:{},...t.displayPath?{displayPath:t.displayPath}:{},...t.commandName?{commandName:t.commandName}:{},...t.internal?{internal:!0}:{}}}function Jf(t){return{status:t.isRunning?"running":t.result==="error"||t.result==="denied"?"error":"done",result:t.result,...t.diffLines?{diffLines:t.diffLines}:{},...t.diffFile?{diffFile:t.diffFile}:{},...t.toolResultData!==void 0?{toolResultData:t.toolResultData}:{},...t.toolResultParts?{toolResultParts:t.toolResultParts}:{},...t.appView?{appView:t.appView}:{}}}function BC(t,i){let r=!1;return t.map(s=>{if(r||s.type!=="tools")return s;const u=l1(s.tools,i);if(u===-1)return s;r=!0;const o=[...s.tools];return o[u]={...o[u],...Jf(i)},{...s,tools:o}})}function r1(t){const i=new Map;for(const r of t)if(r.type==="tools")for(const s of r.tools){if(!s.diffFile||!s.diffLines||s.diffLines.length===0)continue;const u=s.diffLines.filter(h=>h.type==="add").length,o=s.diffLines.filter(h=>h.type==="remove").length,f=i.get(s.diffFile);i.set(s.diffFile,{path:s.diffFile,added:(f?.added??0)+u,removed:(f?.removed??0)+o,diffLines:s.diffLines})}return[...i.values()]}function HC(t){return{...i1(t),...Jf(t)}}function IC(t){const i=[];let r=[];const s=()=>{for(const o of r)i.push(o.type==="tools"?{id:o.id,role:"tools",tools:o.tools}:{id:o.id,role:"assistant",content:o.text});const u=r1(r);u.length>0&&i.push({id:pt(),role:"changed-files",files:u}),r=[]};for(const u of t)u.type==="text"&&u.role==="user"?(s(),i.push({id:pt(),role:"user",content:u.content})):u.type==="text"?r=t1(r,u.content):r=n1(r,HC(u.tool));return s(),i}function a1(t){const[i,r]=w.useState("disconnected"),s=w.useRef("disconnected"),[u,o]=w.useState(null),f=w.useRef(null),h=w.useCallback(()=>f.current==="observe",[]),[g,m]=w.useState([]),[y,x]=w.useState([]),[S,v]=w.useState(""),[N,C]=w.useState(!1),[M,E]=w.useState(null),[V,L]=w.useState([]),[ne,W]=w.useState(null),[R,P]=w.useState(null),[K,G]=w.useState([]),[O,ue]=w.useState(null),te=w.useRef(null),[Se,ie]=w.useState(null),[le,D]=w.useState(null),[X,ce]=w.useState(!1),he=w.useCallback(()=>ce(!0),[]),_=w.useCallback(()=>ce(!1),[]),A=w.useRef(null),B=w.useRef(""),j=w.useRef([]),re=w.useRef([]),fe=w.useRef(null),pe=w.useRef(null),ke=w.useCallback(F=>{j.current=F(j.current),x(j.current)},[]),_e=w.useCallback(F=>{m(se=>[...se,F])},[]),oe=w.useCallback(F=>{const se=re.current;re.current=[],B.current="",v(""),C(!1),ke(()=>[]);for(const ze of se)ze.type==="tools"?_e({id:ze.id,role:"tools",tools:ze.tools.map(Tn=>({...Tn,status:F(Tn)}))}):_e({id:ze.id,role:"assistant",content:ze.text});const ge=r1(se);ge.length>0&&_e({id:pt(),role:"changed-files",files:ge})},[_e,ke]),be=w.useRef(0),We=w.useRef(new Set),wt=w.useRef(0),Ft=w.useRef(new Set),[Xt,Qt]=w.useState(),ot=w.useRef(null),$e=w.useCallback(F=>{const se=h()&&!rg(F.type);if(F.type==="send-background-task"){if(se||ot.current!==null)return;ot.current=F.taskId,Qt({taskId:F.taskId,status:"pending"})}if(F.type==="command"){if(F.name==="help"){ce(!0);return}const ge=te.current?.commands.find(ze=>ze.name===F.name);if(Py(ge??{name:F.name})){_e({id:pt(),role:"command",name:F.name,content:Jy(F.name),tone:"info"});return}if(se)return;be.current+=1}se||((F.type==="switch-session"||F.type==="new-session")&&(wt.current+=1,F.requestId!==void 0&&Ft.current.add(F.requestId)),A.current?.send(F))},[_e,h]),Zt=w.useCallback(F=>{wt.current=Math.max(0,wt.current-1),F!==void 0&&Ft.current.delete(F)},[]),sn=w.useCallback((F,se)=>{const ge=qC();We.current.add(ge),$e({type:"command",name:F,requestId:ge,...se?{args:se}:{}})},[$e]),{handleUsageMessage:Sn,...Un}=CC($e),{handleExecutionDetailMessage:sl,handleExecutionWorkspace:ul,closeExecutionDetail:at,...Bl}=jC($e),{handleModelListMessage:Z,...U}=EC($e),{handleProjectMessage:de,...ye}=_C($e),{handleAppViewMessage:De,rejectPendingAppRequests:lt,readAppView:Et,callAppTool:st}=kC($e,w.useCallback(()=>s.current==="connected",[]),h),{handleSessionsMessage:ct,canListSessions:Ct,markCurrent:Fe,armRestore:kn,...Ut}=OC($e,h),{requestSessions:wn,setSessionSidebarOpen:Hl}=Ut,{handleSettingsMessage:Il,openSettings:qn,refreshSettings:_n,...Yl}=LC($e),ol=w.useRef(!1);ol.current=Yl.settingsOpen;const{handleAgentDefinitionsMessage:va,resolveSwitchResult:or,openAgentSwitcher:Vl,...Gl}=xC($e),{handleSchedulesMessage:Sa,requestSchedules:$l,...ka}=TC($e),cl=w.useCallback(()=>{G(F=>F.filter(se=>se.kind!=="context-compacted"))},[]),mi=w.useCallback(F=>{if(gC[F.type],!Sn(F)&&!sl(F)&&!Z(F)&&!de(F)&&!De(F)&&!ct(F)&&!Il(F)&&!va(F)&&!Sa(F))switch(F.type){case"surface_role":f.current=F.role,o(F.role);break;case"messages":{const se=F.display?IC(F.display):F.messages.flatMap(ge=>{if(ge.role!=="user"&&ge.role!=="assistant")return[];const ze=ge.content??"";return[{id:pt(),role:ge.role,content:ze}]});m(se),F.driverId&&D(F.driverId);break}case"user_message":m(se=>[...se,{id:pt(),role:"user",content:F.content??"",...F.driverId?{author:F.driverId}:{}}]);break;case"text_delta":{const se=B.current+F.delta;B.current=se,v(se),re.current=t1(re.current,F.delta);break}case"thinking":C(F.isThinking);break;case"tool_start":{const{state:se}=F,ge={...i1(se),status:"running"};ke(ze=>[...ze,ge]),re.current=n1(re.current,ge);break}case"tool_end":{const{state:se}=F;ke(ge=>{const ze=l1(ge,se);if(ze===-1)return ge;const Tn=[...ge];return Tn[ze]={...Tn[ze],...Jf(se)},Tn}),re.current=BC(re.current,se);break}case"execution_workspace_event":ul(F.snapshot),E(F.snapshot);break;case"background_task_control_result":F.action==="send"&&ot.current===F.taskId&&(ot.current=null,Qt({taskId:F.taskId,status:F.success?"sent":"failed"})),F.success||G(se=>[...se,{id:pt(),kind:"background-task-control-failed",message:F.message??`Could not ${F.action==="send"?"send to":"stop"} ${F.taskId}.`}]);break;case"pending":W(F.pending===null?null:{text:F.pending,count:F.pendingCount??1});break;case"permission_request":case"ask_request":case"prompt_resolved":L(se=>oC(se,F));break;case"ui_intent":{if(Ys(F.event.intent)==="session-sidebar"&&Ct()){Hl(!0),wn(),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}if(Ys(F.event.intent)==="settings"){qn(),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}if(Ys(F.event.intent)==="settings-plugins"){qn("plugins"),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}if(Ys(F.event.intent)==="agent-switcher"){Vl(),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}const se={name:aa(F.event.intent),text:dC(F.event.intent)};be.current>0?fe.current=se:_e({id:pt(),role:"command",name:se.name,content:se.text,tone:"info"});break}case"session_renamed":P(F.event.name),wn();break;case"session_switched":lt("The active session changed."),Zt(),pe.current=null,ie(null),cl(),B.current="",re.current=[],v(""),C(!1),ke(()=>[]),m([]),L([]),W(null),P(null),E(null),at(),Fe(F.event.sessionId),$e({type:"get-messages"}),$e({type:"get-status"}),$e({type:"get-commands"}),$e({type:"get-execution-workspace"}),$e({type:"get-pending"}),wn(),$l();break;case"history_cleared":cl(),lt("The session history was cleared."),B.current="",re.current=[],v(""),m([]);break;case"error":{const se=F.model??pe.current?.model;$e({type:"get-status"}),oe(ge=>ge.status==="running"?"error":ge.status),G(ge=>[...ge,{id:pt(),kind:"session-error",message:F.message,...F.code!==void 0&&{code:F.code},...F.provider!==void 0&&{provider:F.provider},...se!==void 0&&{model:se},...F.retryAfterSeconds!==void 0&&{retryAfterSeconds:F.retryAfterSeconds}}]);break}case"session_change_failed":if(F.requestId!==void 0&&!Ft.current.has(F.requestId))break;Zt(F.requestId),G(se=>[...se,{id:pt(),kind:"session-change-refused",message:F.message}]);break;case"session_renamed_in_list":wn();break;case"session_rename_failed":G(se=>[...se,{id:pt(),kind:"session-change-refused",message:F.message}]);break;case"session_deleted":wn();break;case"session_delete_failed":G(se=>[...se,{id:pt(),kind:"session-change-refused",message:F.message}]);break;case"protocol_error":{if(ot.current!==null&&F.message==="Not permitted for an observer: send-background-task"&&(Qt({taskId:ot.current,status:"failed"}),ot.current=null),wt.current>0){Zt(),G(ge=>[...ge,{id:pt(),kind:"protocol-error",message:F.message}]);break}be.current=Math.max(0,be.current-1);const se=fe.current;fe.current=null,se!==null&&se.text!==null&&_e({id:pt(),role:"command",name:se.name,content:se.text,tone:"info"}),G(ge=>[...ge,{id:pt(),kind:"protocol-error",message:F.message}]);break}case"commands":{const se={commands:F.commands,skills:F.skills};te.current=se,ue(se);break}case"context":if(pe.current!==null){const se={...pe.current,context:F.state};pe.current=se,ie(se)}break;case"history_changed":{const se=F.compact;se?.trigger==="auto"&&G(ge=>[...ge,{id:pt(),kind:"context-compacted",message:`Auto compacted context: ${Math.round(se.beforeUsedPercentage)}% → ${Math.round(se.afterUsedPercentage)}%`}]);break}case"session_status":pe.current=F.status,ie(F.status);break;case"command_result":{$e({type:"get-status"}),$e({type:"get-commands"}),be.current=Math.max(0,be.current-1),F.name==="provider"&&F.success&&ol.current&&_n();const se=F.requestId!==void 0&&We.current.delete(F.requestId);if(or(F.requestId,F))break;const ge=fe.current;if(fe.current=null,ge!==null&&F.success){ge.text!==null&&_e({id:pt(),role:"command",name:F.name,content:ge.text,tone:"info"});break}if(F.message.trim().length===0)break;if(se){F.success||G(ze=>[...ze,{id:pt(),kind:"command-failed",message:F.message}]);break}_e({id:pt(),role:"command",name:F.name,content:F.message,tone:F.success?"success":"error"});break}case"complete":case"interrupted":$e({type:"get-status"}),$e({type:"get-pending"}),wn(),oe(se=>se.status==="running"?"done":se.status);break}},[_e,Ct,at,cl,oe,va,De,sl,ul,Z,de,Sa,ct,Il,Sn,Fe,Vl,qn,_n,$l,wn,or,lt,$e,Hl,Zt,ke]),cr=w.useCallback((F,se)=>{A.current?.send(cC(F,se)),L(ge=>ge.filter(ze=>ze.id!==F))},[]),wa=w.useCallback((F,se)=>{A.current?.send(fC(F,se)),L(ge=>ge.filter(ze=>ze.id!==F))},[]),ja=w.useCallback(F=>{G(se=>se.filter(ge=>ge.id!==F))},[]);return w.useEffect(()=>{const se=t({onMessage:mi,onStatusChange:ze=>{s.current=ze,r(ze),ze!=="connected"&&(f.current=null,o(null)),ze!=="connected"&&(lt(),cl(),at(),ot.current!==null&&(Qt({taskId:ot.current,status:"failed"}),ot.current=null)),ze==="connected"&&(be.current=0,We.current.clear(),wt.current=0,Ft.current.clear(),fe.current=null,ge.send({type:"get-surface-role"}),ge.send({type:"get-commands"}),ge.send({type:"get-status"}),ge.send({type:"get-pending"}),kn(),wn(),$l())}}),ge={connect:()=>se.connect(),disconnect:()=>se.disconnect(),send:ze=>{f.current==="observe"&&!rg(ze.type)||se.send(ze)}};return A.current=ge,ge.connect(),()=>{ge.disconnect(),A.current=null,lt()}},[t,mi,cl,at,wn,$l,kn,lt]),{status:i,messages:g,activeTools:y,streamingText:S,isThinking:N,executionWorkspace:M,sessionName:R,commandCatalog:O,sessionStatus:Se,ownDriverId:le,role:u,send:$e,sendCommandSilently:sn,pendingPrompts:V,queuedPrompt:ne,answerPermission:cr,answerAsk:wa,...Un,...Bl,executionDetailInput:Xt,closeExecutionDetail:at,...U,...ye,...Ut,sessionNotices:K,dismissSessionNotice:ja,openSettings:qn,...Yl,openAgentSwitcher:Vl,...Gl,...ka,readAppView:Et,callAppTool:st,helpOpen:X,openHelp:he,closeHelp:_}}function YC(t){const[i,r]=w.useState(!1),s=a1(w.useCallback(u=>mC(t,{...u,onGiveUp:()=>r(!0)}),[t]));return w.useEffect(()=>{s.status==="connected"&&r(!1)},[s.status]),{...s,connectionLost:i}}function VC(t,i){let r=!1,s=!1,u,o=!1,f=!1;const h=()=>{f=!0,r=!1,!o&&s&&i.onStatusChange("disconnected")};return{connect(){if(!(f||o)&&!s){s=!0,i.onStatusChange("connecting");try{u=t.subscribe(g=>{if(!s||o||f)return;const m=qx(g,Ux);if(!m.ok){o=!0,r=!1,t.close(),i.onStatusChange("error");return}i.onMessage(m.message)},h,()=>{!s||o||f||(r=!0,i.onStatusChange("connected"),t.send(JSON.stringify({type:"get-messages"})))})}catch{h()}}},disconnect(){s=!1,r=!1,u?.(),u=void 0,i.onStatusChange("disconnected")},send(g){!r||o||t.send(JSON.stringify(g))||(t.close(),h())}}}async function GC(t){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}if(!$C(t))throw new Error("copy failed")}function $C(t){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.opacity="0",r.style.pointerEvents="none",document.body.appendChild(r),r.focus(),r.select();let s=!1;try{s=document.execCommand("copy")}catch{s=!1}return document.body.removeChild(r),i?.focus(),s}const FC=2e3;function XC(){const[t,i]=w.useState("idle");return w.useEffect(()=>{if(t==="idle")return;const s=setTimeout(()=>i("idle"),FC);return()=>clearTimeout(s)},[t]),{status:t,copy:s=>{GC(s).then(()=>i("copied"),()=>i("error"))}}}function Sf(t){return t.startsWith("attach:")?"terminal":t==="app"?"desktop-app":t==="browser"?"browser":t==="remote:ws"?"remote":t.startsWith("peer:")?"peer":null}function s1(t,i){if(t===W0)return!0;if(t===Lx||i===null)return!1;if(t===i)return!0;const r=Sf(t);return r!==null&&r===Sf(i)}function QC(t){switch(Sf(t)){case"terminal":return"the terminal";case"desktop-app":return"the desktop app";case"browser":return"the browser";case"remote":case"peer":return"a remote device";default:return"another surface"}}function u1(t){return t===Lx?"Automatic — loop":`from ${QC(t)}`}function o1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function c1(t){const i=[];for(const r of t??[])r.type==="text"?i.push({type:"text",text:r.text}):r.type==="image_inline"?i.push({type:"image",data:r.data,mimeType:r.mimeType}):r.type==="audio_inline"&&i.push({type:"audio",data:r.data,mimeType:r.mimeType});return i}function ZC(t){let i=c1(t.parts);return i.length===0&&typeof t.data=="string"&&(i=[{type:"text",text:t.data}]),!t.success&&t.error!==void 0&&(i=[...i,{type:"text",text:t.error}]),{content:i,...o1(t.data)?{structuredContent:t.data}:{},isError:!t.success}}function KC(t,i){let r=c1(t.toolResultParts);return r.length===0&&t.toolResultData!==void 0&&(r=[{type:"text",text:t.toolResultData}]),{content:r,...o1(i.structuredContent)?{structuredContent:i.structuredContent}:{},isError:t.status==="error"}}const PC="2026-01-26",px=-32602,JC=-32601,Xc=-32e3,WC="ui/notifications/sandbox-proxy-ready",e_="ui/notifications/sandbox-resource-ready";function sa(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;const i=Object.getPrototypeOf(t);return i===null||Object.getPrototypeOf(i)===null}function t_(t){return t instanceof Error?t.message:String(t)}function n_(t){const{view:i}=t;let r=!1,s=!1,u="uninitialized",o=!1;const f=(x,S)=>{t.post({jsonrpc:"2.0",id:x,result:S})},h=(x,S,v)=>{t.post({jsonrpc:"2.0",id:x,error:{code:S,message:v}})},g=(x,S)=>{if(u!=="ready"){h(x,Xc,"This app view has not initialized.");return}const v=sa(S)?S.name:void 0,N=typeof v=="string"&&Object.hasOwn(i.callableTools,v)?i.callableTools[v]:void 0;if(!sa(S)||N===void 0){h(x,px,"This tool is not available to this view.");return}const C=S.arguments===void 0?{}:S.arguments;if(!sa(C)){h(x,px,"Tool arguments must be an object.");return}if(o){h(x,Xc,"Another tool call from this view is still running.");return}o=!0;let M;try{M=t.callAppTool(N,C)}catch(E){M=Promise.reject(E)}M.then(E=>{o=!1,r||f(x,ZC(E))},E=>{o=!1,r||h(x,Xc,t_(E))})},m=(x,S,v)=>{switch(S){case"ui/initialize":u==="uninitialized"&&(u="initializing"),f(x,{protocolVersion:PC,hostCapabilities:{serverTools:{}},hostInfo:t.hostInfo,hostContext:t.hostContext});return;case"tools/call":g(x,v);return;case"ping":f(x,{});return;case"ui/request-display-mode":f(x,{mode:"inline"});return;default:h(x,JC,`This host does not support ${S}.`)}},y=(x,S)=>{switch(x){case WC:if(s)return;s=!0,t.post({jsonrpc:"2.0",method:e_,params:{html:i.html}});return;case"ui/notifications/initialized":if(u!=="initializing")return;u="ready",t.post({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:i.toolInput??{}}}),t.post({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:t.toolResult});return;case"ui/notifications/size-changed":{const v=sa(S)?S.height:void 0;if(typeof v!="number"||!Number.isFinite(v))return;t.onHeight(Math.min(640,Math.max(48,Math.round(v))));return}default:return}};return{handleMessage(x){if(r)return;const S=t.source();if(S===null||x.source!==S)return;const v=x.data;if(!sa(v)||v.jsonrpc!=="2.0")return;const{method:N,id:C}=v;typeof N=="string"&&(C===void 0?y(N,v.params):(typeof C=="string"||typeof C=="number")&&m(C,N,v.params))},dispose(){r||(r=!0,u==="ready"&&t.post({jsonrpc:"2.0",id:"teardown",method:"ui/resource-teardown",params:{reason:"closed"}}))}}}const f1=w.createContext(null);function l_(t){return{theme:typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",displayMode:"inline",availableDisplayModes:["inline"],containerDimensions:{maxHeight:640},platform:t,locale:typeof navigator>"u"?"en-US":navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}}const i_=160,r_="This tool returned an app view, which this window cannot show.";function d1({tool:t}){const i=w.useContext(f1);if(t.appView===void 0)return null;const r=bC(t);return i===null||i.sandboxUrl===void 0||r===void 0?d.jsx("p",{className:"text-[13px] text-subtle",children:r_}):d.jsx(a_,{tool:t,host:i,sandboxUrl:i.sandboxUrl,viewKey:r,sourceId:t.appView.sourceId},r)}function a_({tool:t,host:i,sandboxUrl:r,viewKey:s,sourceId:u}){const[o,f]=w.useState({status:"loading"}),[h,g]=w.useState(i_),m=w.useRef(null),y=w.useRef(t);y.current=t,w.useEffect(()=>{const S=new AbortController;return f({status:"loading"}),i.readAppView(s,S.signal).then(v=>{S.signal.aborted||f({status:"ready",view:v,host:i,sandboxUrl:r,signal:S.signal})},v=>{S.signal.aborted||f({status:"failed",reason:v instanceof Error?v.message:String(v)})}),()=>{S.abort()}},[s,i.readAppView,i.callAppTool,r]);const x=o.status==="ready"&&o.host.readAppView===i.readAppView&&o.host.callAppTool===i.callAppTool&&o.sandboxUrl===r?o:null;return w.useLayoutEffect(()=>{const S=m.current;if(x===null||S===null)return;const v=x.host,N=x.view,C=n_({view:N,toolResult:KC(y.current,N),hostInfo:v.hostInfo,hostContext:l_(v.platform),post:E=>S.contentWindow?.postMessage(E,"*"),source:()=>S.contentWindow,callAppTool:(E,V)=>v.callAppTool(s,E,V,x.signal),onHeight:g}),M=E=>C.handleMessage(E);return window.addEventListener("message",M),()=>{window.removeEventListener("message",M),C.dispose()}},[x,s]),o.status==="failed"?d.jsxs("p",{className:"text-[13px] text-subtle",children:["The app from ",u," could not be shown: ",o.reason]}):x===null?d.jsxs("p",{className:"text-[13px] text-subtle",children:["Loading the app from ",u,"…"]}):d.jsxs("div",{className:"my-1 flex flex-col gap-1",children:[d.jsxs("p",{className:"text-[12px] text-subtle",children:["App from ",u]}),d.jsx("iframe",{ref:m,sandbox:"allow-scripts",src:r,title:`App from ${u}`,referrerPolicy:"no-referrer","data-testid":"app-view-frame",style:{width:"100%",height:h},className:"block rounded-lg border border-border bg-card"})]})}const s_={add:"bg-accent/10 text-foreground",remove:"bg-destructive/10 text-foreground",context:"text-muted-foreground",hunk:"text-subtle"},u_={add:"+ ",remove:"- ",context:" ",hunk:""},Qc=40,Vs=500;function hx({line:t}){return d.jsx("div",{className:`whitespace-pre ${s_[t.type]}`,children:`${u_[t.type]}${t.text}`})}function ou({diffLines:t}){const[i,r]=w.useState(!1);if(t.length<=Qc)return d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-sidebar px-3 py-2 font-mono text-[12.5px] leading-relaxed",children:t.map((f,h)=>d.jsx(hx,{line:f},h))});const s=t.slice(0,Vs),u=i?s:t.slice(0,Qc),o=Math.min(t.length,Vs)-Qc;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-sidebar px-3 py-2 font-mono text-[12.5px] leading-relaxed",children:u.map((f,h)=>d.jsx(hx,{line:f},h))}),i&&t.length>Vs&&d.jsxs("p",{className:"text-[12px] text-subtle",children:[t.length-Vs," more lines not shown"]}),d.jsx("button",{type:"button",onClick:()=>r(f=>!f),className:"self-start text-[12.5px] text-accent hover:underline",children:i?"Show less":`Show more (${o} more lines)`})]})}function kf(t){return t==null||typeof t=="boolean"?"":typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(kf).join(""):bn.isValidElement(t)?kf(t.props.children):""}function p1({label:t,getText:i,className:r=""}){const{status:s,copy:u}=XC(),o=s==="copied"?"Copied":s==="error"?"Couldn't copy":"";return d.jsxs("span",{className:`inline-flex items-center ${r}`,children:[d.jsxs("button",{type:"button",onClick:()=>u(i()),className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground shadow-sm shadow-black/5 transition-colors hover:bg-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s==="copied"?d.jsx(ya,{size:13,strokeWidth:2}):d.jsx(xE,{size:13,strokeWidth:1.9}),d.jsx("span",{children:t})]}),d.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:o})]})}function o_({children:t}){const i=kf(t).replace(/\n$/,"");return d.jsxs("div",{className:"group/code relative my-1",children:[d.jsx("pre",{tabIndex:0,"aria-label":"Code block, horizontally scrollable",className:"gui-code-scroll overflow-x-auto rounded-xl bg-sidebar px-4 py-3.5 font-mono text-[13px] leading-[1.65] focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t}),d.jsx(p1,{label:"Copy code",getText:()=>i,className:"absolute right-2 top-2 opacity-0 transition-opacity group-hover/code:opacity-100 group-focus-within/code:opacity-100 [@media(hover:none)]:opacity-100"})]})}function c_({children:t}){return d.jsx(Mw,{remarkPlugins:[XN],components:{h1:({children:i})=>d.jsx("h1",{className:"mt-6 text-[20px] font-semibold leading-snug tracking-[-0.015em] first:mt-0",children:i}),h2:({children:i})=>d.jsx("h2",{className:"mt-6 text-[17px] font-semibold leading-snug tracking-[-0.01em] first:mt-0",children:i}),h3:({children:i})=>d.jsx("h3",{className:"mt-5 text-[15px] font-semibold leading-snug first:mt-0",children:i}),p:({children:i})=>d.jsx("p",{children:i}),pre:o_,code:({className:i,children:r})=>i?d.jsx("code",{className:`font-mono ${i??""}`,children:r}):d.jsx("code",{className:"rounded-md bg-raised px-1.5 py-0.5 font-mono text-[0.85em]",children:r}),ul:({children:i})=>d.jsx("ul",{className:"ml-5 list-outside list-disc space-y-1.5 marker:text-subtle",children:i}),ol:({children:i})=>d.jsx("ol",{className:"ml-5 list-outside list-decimal space-y-1.5 marker:text-subtle",children:i}),li:({children:i})=>d.jsx("li",{className:"pl-1",children:i}),strong:({children:i})=>d.jsx("strong",{className:"font-semibold",children:i}),em:({children:i})=>d.jsx("em",{className:"italic",children:i}),a:({href:i,children:r})=>d.jsx("a",{href:i,className:"text-accent underline decoration-accent/40 underline-offset-[3px] hover:decoration-accent",target:"_blank",rel:"noopener noreferrer",children:r}),table:({children:i})=>d.jsx("div",{className:"overflow-x-auto",children:d.jsx("table",{className:"w-full border-collapse text-[14px]",children:i})}),thead:({children:i})=>d.jsx("thead",{children:i}),th:({children:i})=>d.jsx("th",{className:"border-b border-border px-3 py-2 text-left text-[13px] font-medium text-muted-foreground",children:i}),td:({children:i})=>d.jsx("td",{className:"px-3 py-2 align-top",children:i}),blockquote:({children:i})=>d.jsx("blockquote",{className:"border-l-2 border-subtle/50 pl-4 text-muted-foreground",children:i}),hr:()=>d.jsx("hr",{className:"mx-auto my-7 w-12 border-subtle/40"})},children:t})}function f_({content:t,author:i,ownDriverId:r}){const s=i&&!s1(i,r)?u1(i):void 0;return d.jsxs("div",{className:"flex flex-col items-end gap-1.5 pl-12",children:[s&&d.jsx("span",{className:"px-1 text-[12.5px] text-subtle",children:s}),d.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words rounded-[20px] bg-raised px-4 py-2.5 text-[15px] leading-relaxed text-foreground",children:t})]})}function mx({content:t,isStreaming:i=!1}){return d.jsxs("div",{className:"group/message gui-prose",children:[d.jsx(c_,{children:t}),i&&d.jsx("span",{className:"ml-1 inline-block h-2.5 w-2.5 animate-pulse rounded-full bg-foreground/70 align-middle"}),!i&&d.jsx("div",{className:"flex opacity-0 transition-opacity focus-within:opacity-100 group-hover/message:opacity-100 group-focus-within/message:opacity-100 [@media(hover:none)]:opacity-100",children:d.jsx(p1,{label:"Copy message",getText:()=>t})})]})}function d_({name:t,className:i}){const r=t.toLowerCase(),s={size:15,strokeWidth:1.75,className:i};return/(read|view|cat|open)/u.test(r)?d.jsx(wE,{...s}):/(grep|glob|search|find|list|ls)/u.test(r)?d.jsx($E,{...s}):/(edit|write|patch|replace|create)/u.test(r)?d.jsx($y,{...s}):/(bash|shell|exec|run|command|terminal)/u.test(r)?d.jsx(nC,{...s}):/(web|fetch|http|url|browse)/u.test(r)?d.jsx(TE,{...s}):/(agent|task|delegate)/u.test(r)?d.jsx(rE,{...s}):d.jsx(Zy,{...s})}const p_=52;function h1(t,i=p_){if(t.length<=i)return t;const r=t.lastIndexOf("/");if(r===-1)return t;const s=t.slice(r+1),u=t.slice(0,r),o=i-s.length-2;return o<=0?`…/${s}`:`…${u.slice(u.length-o)}/${s}`}function h_(t){if(t)try{const i=JSON.parse(t);if(typeof i!="object"||i===null)return{output:t};const r=i;return{structured:t,...typeof r.output=="string"&&r.output?{output:r.output}:{},...typeof r.error=="string"&&r.error?{error:r.error}:{},...typeof r.exitCode=="number"?{exitCode:r.exitCode}:{}}}catch{return{output:t}}}const Zc=20,Kc=500;function Ws({text:t}){const[i,r]=w.useState(!1),s=t.split(`
37
+ `))}function g(v,N,C,M){const E=C.enter("tableCell"),V=C.enter("phrasing"),L=C.containerPhrasing(v,{...M,before:o,after:o});return V(),E(),L}function m(v,N){return Sj(v,{align:N,alignDelimiters:s,padding:r,stringLength:u})}function y(v,N,C){const M=v.children;let E=-1;const V=[],L=N.enter("table");for(;++E<M.length;)V[E]=x(M[E],N,C);return L(),V}function x(v,N,C){const M=v.children;let E=-1;const V=[],L=N.enter("tableRow");for(;++E<M.length;)V[E]=g(M[E],v,N,C);return L(),V}function S(v,N,C){let M=My.inlineCode(v,N,C);return C.stack.includes("tableCell")&&(M=M.replace(/\|/g,"\\$&")),M}}function uN(){return{exit:{taskListCheckValueChecked:Qg,taskListCheckValueUnchecked:Qg,paragraph:cN}}}function oN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:fN}}}function Qg(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function cN(t){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const u=i.children;let o=-1,f;for(;++o<u.length;){const h=u[o];if(h.type==="paragraph"){f=h;break}}f===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(t)}function fN(t,i,r,s){const u=t.children[0],o=typeof t.checked=="boolean"&&u&&u.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",h=r.createTracker(s);o&&h.move(f);let g=My.listItem(t,i,r,{...s,...h.current()});return o&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(y){return y+f}}function dN(){return[Gw(),fj(),mj(),tN(),uN()]}function pN(t){return{extensions:[$w(),dj(t),gj(),sN(t),oN()]}}const hN={tokenize:vN,partial:!0},Oy={tokenize:SN,partial:!0},Ly={tokenize:kN,partial:!0},Uy={tokenize:wN,partial:!0},mN={tokenize:jN,partial:!0},qy={name:"wwwAutolink",tokenize:yN,previous:Hy},By={name:"protocolAutolink",tokenize:bN,previous:Iy},al={name:"emailAutolink",tokenize:xN,previous:Yy},Ln={};function gN(){return{text:Ln}}let oi=48;for(;oi<123;)Ln[oi]=al,oi++,oi===58?oi=65:oi===91&&(oi=97);Ln[43]=al;Ln[45]=al;Ln[46]=al;Ln[95]=al;Ln[72]=[al,By];Ln[104]=[al,By];Ln[87]=[al,qy];Ln[119]=[al,qy];function xN(t,i,r){const s=this;let u,o;return f;function f(x){return!bf(x)||!Yy.call(s,s.previous)||Xf(s.events)?r(x):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(x))}function h(x){return bf(x)?(t.consume(x),h):x===64?(t.consume(x),g):r(x)}function g(x){return x===46?t.check(mN,y,m)(x):x===45||x===95||zt(x)?(o=!0,t.consume(x),g):y(x)}function m(x){return t.consume(x),u=!0,g}function y(x){return o&&u&&Lt(s.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(x)):r(x)}}function yN(t,i,r){const s=this;return u;function u(f){return f!==87&&f!==119||!Hy.call(s,s.previous)||Xf(s.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(hN,t.attempt(Oy,t.attempt(Ly,o),r),r)(f))}function o(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(f)}}function bN(t,i,r){const s=this;let u="",o=!1;return f;function f(x){return(x===72||x===104)&&Iy.call(s,s.previous)&&!Xf(s.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),t.consume(x),h):r(x)}function h(x){if(Lt(x)&&u.length<5)return u+=String.fromCodePoint(x),t.consume(x),h;if(x===58){const S=u.toLowerCase();if(S==="http"||S==="https")return t.consume(x),g}return r(x)}function g(x){return x===47?(t.consume(x),o?m:(o=!0,g)):r(x)}function m(x){return x===null||Zs(x)||nt(x)||pi(x)||nu(x)?r(x):t.attempt(Oy,t.attempt(Ly,y),r)(x)}function y(x){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),i(x)}}function vN(t,i,r){let s=0;return u;function u(f){return(f===87||f===119)&&s<3?(s++,t.consume(f),u):f===46&&s===3?(t.consume(f),o):r(f)}function o(f){return f===null?r(f):i(f)}}function SN(t,i,r){let s,u,o;return f;function f(m){return m===46||m===95?t.check(Uy,g,h)(m):m===null||nt(m)||pi(m)||m!==45&&nu(m)?g(m):(o=!0,t.consume(m),f)}function h(m){return m===95?s=!0:(u=s,s=void 0),t.consume(m),f}function g(m){return u||s||!o?r(m):i(m)}}function kN(t,i){let r=0,s=0;return u;function u(f){return f===40?(r++,t.consume(f),u):f===41&&s<r?o(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(Uy,i,o)(f):f===null||nt(f)||pi(f)?i(f):(t.consume(f),u)}function o(f){return f===41&&s++,t.consume(f),u}}function wN(t,i,r){return s;function s(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(t.consume(h),s):h===38?(t.consume(h),o):h===93?(t.consume(h),u):h===60||h===null||nt(h)||pi(h)?i(h):r(h)}function u(h){return h===null||h===40||h===91||nt(h)||pi(h)?i(h):s(h)}function o(h){return Lt(h)?f(h):r(h)}function f(h){return h===59?(t.consume(h),s):Lt(h)?(t.consume(h),f):r(h)}}function jN(t,i,r){return s;function s(o){return t.consume(o),u}function u(o){return zt(o)?r(o):i(o)}}function Hy(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||nt(t)}function Iy(t){return!Lt(t)}function Yy(t){return!(t===47||bf(t))}function bf(t){return t===43||t===45||t===46||t===95||zt(t)}function Xf(t){let i=t.length,r=!1;for(;i--;){const s=t[i][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const NN={tokenize:zN,partial:!0};function EN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:AN,continuation:{tokenize:DN},exit:RN}},text:{91:{name:"gfmFootnoteCall",tokenize:TN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CN,resolveTo:_N}}}}function CN(t,i,r){const s=this;let u=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let f;for(;u--;){const g=s.events[u][1];if(g.type==="labelImage"){f=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return h;function h(g){if(!f||!f._balanced)return r(g);const m=Cn(s.sliceSerialize({start:f.end,end:s.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?r(g):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),i(g))}}function _N(t,i){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},h=[t[r+1],t[r+2],["enter",s,i],t[r+3],t[r+4],["enter",u,i],["exit",u,i],["enter",o,i],["enter",f,i],["exit",f,i],["exit",o,i],t[t.length-2],t[t.length-1],["exit",s,i]];return t.splice(r,t.length-r+1,...h),t}function TN(t,i,r){const s=this,u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,f;return h;function h(x){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?r(x):(t.enter("gfmFootnoteCallMarker"),t.consume(x),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",m)}function m(x){if(o>999||x===93&&!f||x===null||x===91||nt(x))return r(x);if(x===93){t.exit("chunkString");const S=t.exit("gfmFootnoteCallString");return u.includes(Cn(s.sliceSerialize(S)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),i):r(x)}return nt(x)||(f=!0),o++,t.consume(x),x===92?y:m}function y(x){return x===91||x===92||x===93?(t.consume(x),o++,m):m(x)}}function AN(t,i,r){const s=this,u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,f=0,h;return g;function g(N){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(N){return N===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",y):r(N)}function y(N){if(f>999||N===93&&!h||N===null||N===91||nt(N))return r(N);if(N===93){t.exit("chunkString");const C=t.exit("gfmFootnoteDefinitionLabelString");return o=Cn(s.sliceSerialize(C)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(N),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),S}return nt(N)||(h=!0),f++,t.consume(N),N===92?x:y}function x(N){return N===91||N===92||N===93?(t.consume(N),f++,y):y(N)}function S(N){return N===58?(t.enter("definitionMarker"),t.consume(N),t.exit("definitionMarker"),u.includes(o)||u.push(o),Ie(t,v,"gfmFootnoteDefinitionWhitespace")):r(N)}function v(N){return i(N)}}function DN(t,i,r){return t.check(ga,i,t.attempt(NN,i,r))}function RN(t){t.exit("gfmFootnoteDefinition")}function zN(t,i,r){const s=this;return Ie(t,u,"gfmFootnoteDefinitionIndent",5);function u(o){const f=s.events[s.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?i(o):r(o)}}function MN(t){let r=(t||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:u};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function u(f,h){let g=-1;for(;++g<f.length;)if(f[g][0]==="enter"&&f[g][1].type==="strikethroughSequenceTemporary"&&f[g][1]._close){let m=g;for(;m--;)if(f[m][0]==="exit"&&f[m][1].type==="strikethroughSequenceTemporary"&&f[m][1]._open&&f[g][1].end.offset-f[g][1].start.offset===f[m][1].end.offset-f[m][1].start.offset){f[g][1].type="strikethroughSequence",f[m][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[m][1].start),end:Object.assign({},f[g][1].end)},x={type:"strikethroughText",start:Object.assign({},f[m][1].end),end:Object.assign({},f[g][1].start)},S=[["enter",y,h],["enter",f[m][1],h],["exit",f[m][1],h],["enter",x,h]],v=h.parser.constructs.insideSpan.null;v&&an(S,S.length,0,lu(v,f.slice(m+1,g),h)),an(S,S.length,0,[["exit",x,h],["enter",f[g][1],h],["exit",f[g][1],h],["exit",y,h]]),an(f,m-1,g-m+3,S),g=m+S.length-2;break}}for(g=-1;++g<f.length;)f[g][1].type==="strikethroughSequenceTemporary"&&(f[g][1].type="data");return f}function o(f,h,g){const m=this.previous,y=this.events;let x=0;return S;function S(N){return m===126&&y[y.length-1][1].type!=="characterEscape"?g(N):(f.enter("strikethroughSequenceTemporary"),v(N))}function v(N){const C=rr(m);if(N===126)return x>1?g(N):(f.consume(N),x++,v);if(x<2&&!r)return g(N);const M=f.exit("strikethroughSequenceTemporary"),E=rr(N);return M._open=!E||E===2&&!!C,M._close=!C||C===2&&!!E,h(N)}}}class ON{constructor(){this.map=[]}add(i,r,s){LN(this,i,r,s)}consume(i){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];s.push(i.slice()),i.length=0;let u=s.pop();for(;u;){for(const o of u)i.push(o);u=s.pop()}this.map.length=0}}function LN(t,i,r,s){let u=0;if(!(r===0&&s.length===0)){for(;u<t.map.length;){if(t.map[u][0]===i){t.map[u][1]+=r,t.map[u][2].push(...s);return}u+=1}t.map.push([i,r,s])}}function UN(t,i){let r=!1;const s=[];for(;i<t.length;){const u=t[i];if(r){if(u[0]==="enter")u[1].type==="tableContent"&&s.push(t[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(t[i-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return s}function qN(){return{flow:{null:{name:"table",tokenize:BN,resolveAll:HN}}}}function BN(t,i,r){const s=this;let u=0,o=0,f;return h;function h(O){let ue=s.events.length-1;for(;ue>-1;){const ie=s.events[ue][1].type;if(ie==="lineEnding"||ie==="linePrefix")ue--;else break}const te=ue>-1?s.events[ue][1].type:null,Se=te==="tableHead"||te==="tableRow"?R:g;return Se===R&&s.parser.lazy[s.now().line]?r(O):Se(O)}function g(O){return t.enter("tableHead"),t.enter("tableRow"),m(O)}function m(O){return O===124||(f=!0,o+=1),y(O)}function y(O){return O===null?r(O):we(O)?o>1?(o=0,s.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),v):r(O):Le(O)?Ie(t,y,"whitespace")(O):(o+=1,f&&(f=!1,u+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),f=!0,y):(t.enter("data"),x(O)))}function x(O){return O===null||O===124||nt(O)?(t.exit("data"),y(O)):(t.consume(O),O===92?S:x)}function S(O){return O===92||O===124?(t.consume(O),x):x(O)}function v(O){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(O):(t.enter("tableDelimiterRow"),f=!1,Le(O)?Ie(t,N,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):N(O))}function N(O){return O===45||O===58?M(O):O===124?(f=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),C):W(O)}function C(O){return Le(O)?Ie(t,M,"whitespace")(O):M(O)}function M(O){return O===58?(o+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),E):O===45?(o+=1,E(O)):O===null||we(O)?ne(O):W(O)}function E(O){return O===45?(t.enter("tableDelimiterFiller"),V(O)):W(O)}function V(O){return O===45?(t.consume(O),V):O===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),L):(t.exit("tableDelimiterFiller"),L(O))}function L(O){return Le(O)?Ie(t,ne,"whitespace")(O):ne(O)}function ne(O){return O===124?N(O):O===null||we(O)?!f||u!==o?W(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(O)):W(O)}function W(O){return r(O)}function R(O){return t.enter("tableRow"),P(O)}function P(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),P):O===null||we(O)?(t.exit("tableRow"),i(O)):Le(O)?Ie(t,P,"whitespace")(O):(t.enter("data"),K(O))}function K(O){return O===null||O===124||nt(O)?(t.exit("data"),P(O)):(t.consume(O),O===92?G:K)}function G(O){return O===92||O===124?(t.consume(O),K):K(O)}}function HN(t,i){let r=-1,s=!0,u=0,o=[0,0,0,0],f=[0,0,0,0],h=!1,g=0,m,y,x;const S=new ON;for(;++r<t.length;){const v=t[r],N=v[1];v[0]==="enter"?N.type==="tableHead"?(h=!1,g!==0&&(Zg(S,i,g,m,y),y=void 0,g=0),m={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},S.add(r,0,[["enter",m,i]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(s=!0,x=void 0,o=[0,0,0,0],f=[0,r+1,0,0],h&&(h=!1,y={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},S.add(r,0,[["enter",y,i]])),u=N.type==="tableDelimiterRow"?2:y?3:1):u&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(s=!1,f[2]===0&&(o[1]!==0&&(f[0]=f[1],x=Is(S,i,o,u,void 0,x),o=[0,0,0,0]),f[2]=r)):N.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(f[0]=f[1],x=Is(S,i,o,u,void 0,x)),o=f,f=[o[1],r,0,0])):N.type==="tableHead"?(h=!0,g=r):N.type==="tableRow"||N.type==="tableDelimiterRow"?(g=r,o[1]!==0?(f[0]=f[1],x=Is(S,i,o,u,r,x)):f[1]!==0&&(x=Is(S,i,f,u,r,x)),u=0):u&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(f[3]=r)}for(g!==0&&Zg(S,i,g,m,y),S.consume(i.events),r=-1;++r<i.events.length;){const v=i.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=UN(i.events,r))}return t}function Is(t,i,r,s,u,o){const f=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(o.end=Object.assign({},lr(i.events,r[0])),t.add(r[0],0,[["exit",o,i]]));const g=lr(i.events,r[1]);if(o={type:f,start:Object.assign({},g),end:Object.assign({},g)},t.add(r[1],0,[["enter",o,i]]),r[2]!==0){const m=lr(i.events,r[2]),y=lr(i.events,r[3]),x={type:h,start:Object.assign({},m),end:Object.assign({},y)};if(t.add(r[2],0,[["enter",x,i]]),s!==2){const S=i.events[r[2]],v=i.events[r[3]];if(S[1].end=Object.assign({},v[1].end),S[1].type="chunkText",S[1].contentType="text",r[3]>r[2]+1){const N=r[2]+1,C=r[3]-r[2]-1;t.add(N,C,[])}}t.add(r[3]+1,0,[["exit",x,i]])}return u!==void 0&&(o.end=Object.assign({},lr(i.events,u)),t.add(u,0,[["exit",o,i]]),o=void 0),o}function Zg(t,i,r,s,u){const o=[],f=lr(i.events,r);u&&(u.end=Object.assign({},f),o.push(["exit",u,i])),s.end=Object.assign({},f),o.push(["exit",s,i]),t.add(r+1,0,o)}function lr(t,i){const r=t[i],s=r[0]==="enter"?"start":"end";return r[1][s]}const IN={name:"tasklistCheck",tokenize:VN};function YN(){return{text:{91:IN}}}function VN(t,i,r){const s=this;return u;function u(g){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(g):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),o)}function o(g){return nt(g)?(t.enter("taskListCheckValueUnchecked"),t.consume(g),t.exit("taskListCheckValueUnchecked"),f):g===88||g===120?(t.enter("taskListCheckValueChecked"),t.consume(g),t.exit("taskListCheckValueChecked"),f):r(g)}function f(g){return g===93?(t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),h):r(g)}function h(g){return we(g)?i(g):Le(g)?t.check({tokenize:GN},i,r)(g):r(g)}}function GN(t,i,r){return Ie(t,s,"whitespace");function s(u){return u===null?r(u):i(u)}}function $N(t){return Wx([gN(),EN(),MN(t),qN(),YN()])}const FN={};function XN(t){const i=this,r=t||FN,s=i.data(),u=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),f=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);u.push($N(r)),o.push(dN()),f.push(pN(r))}const Vy=(...t)=>t.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();const QN=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ZN=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,s)=>s?s.toUpperCase():r.toLowerCase());const Kg=t=>{const i=ZN(t);return i.charAt(0).toUpperCase()+i.slice(1)};var $c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const KN=t=>{for(const i in t)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},PN=w.createContext({}),JN=()=>w.useContext(PN),WN=w.forwardRef(({color:t,size:i,strokeWidth:r,absoluteStrokeWidth:s,className:u="",children:o,iconNode:f,...h},g)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:x=!1,color:S="currentColor",className:v=""}=JN()??{},N=s??x?Number(r??y)*24/Number(i??m):r??y;return w.createElement("svg",{ref:g,...$c,width:i??m??$c.width,height:i??m??$c.height,stroke:t??S,strokeWidth:N,className:Vy("lucide",v,u),...!o&&!KN(h)&&{"aria-hidden":"true"},...h},[...f.map(([C,M])=>w.createElement(C,M)),...Array.isArray(o)?o:[o]])});const Re=(t,i)=>{const r=w.forwardRef(({className:s,...u},o)=>w.createElement(WN,{ref:o,iconNode:i,className:Vy(`lucide-${QN(Kg(t))}`,`lucide-${t}`,s),...u}));return r.displayName=Kg(t),r};const eE=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],tE=Re("arrow-down",eE);const nE=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],lE=Re("arrow-up",nE);const iE=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],rE=Re("bot",iE);const aE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ya=Re("check",aE);const sE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gy=Re("chevron-down",sE);const uE=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oE=Re("chevron-left",uE);const cE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],su=Re("chevron-right",cE);const fE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],dE=Re("circle-check",fE);const pE=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],hE=Re("circle-dashed",pE);const mE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pg=Re("circle-x",mE);const gE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],xE=Re("copy",gE);const yE=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],bE=Re("ellipsis",yE);const vE=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],SE=Re("external-link",vE);const kE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],wE=Re("file-text",kE);const jE=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],NE=Re("gauge",jE);const EE=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],CE=Re("git-branch",EE);const _E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],TE=Re("globe",_E);const AE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qf=Re("loader-circle",AE);const DE=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],RE=Re("message-circle-question-mark",DE);const zE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],ME=Re("panel-left-close",zE);const OE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],LE=Re("panel-left-open",OE);const UE=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Jg=Re("paperclip",UE);const qE=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],BE=Re("pause",qE);const HE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$y=Re("pencil",HE);const IE=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],YE=Re("play",IE);const VE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Zf=Re("refresh-cw",VE);const GE=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$E=Re("search",GE);const FE=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Fy=Re("settings",FE);const XE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],vf=Re("shield-alert",XE);const QE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ZE=Re("shield",QE);const KE=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],PE=Re("sparkles",KE);const JE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],WE=Re("square-check",JE);const eC=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Xy=Re("square-pen",eC);const tC=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],nC=Re("square-terminal",tC);const lC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],uu=Re("square",lC);const iC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Qy=Re("target",iC);const rC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Kf=Re("trash-2",rC);const aC=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Zy=Re("wrench",aC);const sC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=Re("x",sC),Ky=new Map([["theme","This app follows your system appearance."],["keybindings","This app uses standard keyboard shortcuts here."],["editor","Type your message directly in the composer."],["statusline","The GUI shows session status in its own status row, not a terminal status line."],["shell","Use the Terminal app for shell commands."],["exit","Close the window or tab to end this session; delete it from the sidebar to remove it for good."],["devices","Device pairing is managed from the terminal for now."]]),uC="This command runs in the host terminal.";function Py(t){return Ky.has(t.name)?!0:t.runner==="client"&&!(t.surfaces??[]).includes("gui")}function Jy(t){return Ky.get(t)??uC}function oC(t,i){switch(i.type){case"permission_request":{const{id:r,toolName:s,toolArgs:u,requesterDriverId:o,requester:f,diffLines:h,diffFile:g,cwd:m}=i.event;return t.some(y=>y.id===r)?t:[...t,{kind:"permission",id:r,toolName:s,toolArgs:u,...o?{requesterDriverId:o}:{},...f?{requester:f}:{},...h?{diffLines:h,diffFile:g}:{},...m?{cwd:m}:{}}]}case"ask_request":{const{id:r,request:s,requesterDriverId:u}=i.event;return t.some(o=>o.id===r)?t:[...t,{kind:"ask",id:r,request:s,...u?{requesterDriverId:u}:{}}]}case"prompt_resolved":{const{id:r}=i.event,s=t.filter(u=>u.id!==r);return s.length===t.length?t:s}default:return t}}function cC(t,i){return{type:"permission-response",id:t,result:i}}function fC(t,i){return{type:"ask-response",id:t,response:i}}function aa(t){switch(t.type){case"show-plugin-manager":return"plugin";case"show-settings":return"settings";case"show-session-picker":return"resume";case"show-agent-switcher":return"agent";case"show-theme-picker":return"theme";default:return t.type}}function Ys(t){return t.type==="show-session-picker"?"session-sidebar":t.type==="show-settings"?"settings":t.type==="show-plugin-manager"?"settings-plugins":t.type==="show-agent-switcher"?"agent-switcher":null}function dC(t){switch(t.type){case"show-session-picker":return"This host cannot list sessions, so there is nothing to resume.";case"show-theme-picker":return Jy("theme");default:return`This client does not have a screen for '${t.type}' yet.`}}const pC=2e3,hC=10;function mC(t,i){let r=null,s="disconnected",u=null,o=0,f=!1;function h(v){s=v,i.onStatusChange(v)}function g(){if(!f){if(o>=hC){i.onGiveUp?.();return}u=setTimeout(()=>{o++,m()},pC)}}function m(){h("connecting"),r=new WebSocket(t),r.onopen=()=>{o=0,h("connected"),S({type:"get-messages"})},r.onmessage=v=>{const N=v.data;if(typeof N!="string")return;const C=qx(N,Ux);if(!C.ok){i.onMessage({type:"protocol_error",message:`Malformed message from server (${C.reason})`});return}i.onMessage(C.message)},r.onclose=()=>{r=null,f?h("disconnected"):(h("disconnected"),g())},r.onerror=()=>{h("error")}}function y(){f=!1,u!==null&&(clearTimeout(u),u=null),m()}function x(){f=!0,u!==null&&(clearTimeout(u),u=null),r?.close(),r=null,h("disconnected")}function S(v){r?.readyState===WebSocket.OPEN&&r.send(JSON.stringify(v))}return{connect:y,disconnect:x,send:S,status:()=>s}}const gC={text_delta:"reducer-state",user_message:"reducer-state",tool_start:"reducer-state",tool_end:"reducer-state",thinking:"reducer-state",complete:"reducer-state",interrupted:"reducer-state",error:"visible-notice",command_result:"reducer-state",messages:"reducer-state",history:"intentionally-not-rendered",history_changed:"visible-notice",context:"reducer-state",turn_source:"intentionally-not-rendered",commands:"reducer-state",session_status:"reducer-state",model_list:"reducer-state",agent_definitions:"reducer-state",sessions:"reducer-state",sessions_error:"reducer-state",session_switched:"reducer-state",session_change_failed:"visible-notice",session_renamed_in_list:"reducer-state",session_rename_failed:"visible-notice",session_deleted:"reducer-state",session_delete_failed:"visible-notice",usage_report:"reducer-state",personal_usage_report:"reducer-state",personal_usage_report_error:"visible-notice",stored_session_usage_report:"reducer-state",stored_session_usage_report_error:"visible-notice",executing:"intentionally-not-rendered",pending:"reducer-state",execution_workspace_event:"reducer-state",execution_detail:"reducer-state",execution_detail_error:"reducer-state",waiting_loop_stop:"intentionally-not-rendered",project_status:"reducer-state",project_diff:"reducer-state",project_memory:"reducer-state",app_view:"reducer-state",app_tool_result:"reducer-state",background_task_event:"intentionally-not-rendered",background_job_group_event:"intentionally-not-rendered",plan_event:"intentionally-not-rendered",context_file_refreshed:"intentionally-not-rendered",branch_event:"intentionally-not-rendered",background_tasks:"reducer-state",background_task:"intentionally-not-rendered",background_job_groups:"intentionally-not-rendered",background_job_group:"intentionally-not-rendered",background_task_log:"intentionally-not-rendered",permission_request:"reducer-state",ask_request:"reducer-state",prompt_resolved:"reducer-state",ui_intent:"reducer-state",session_renamed:"reducer-state",history_cleared:"reducer-state",background_task_control_result:"visible-notice",protocol_error:"visible-notice",resume_gap:"transport-control",surface_role:"reducer-state",settings:"reducer-state",settings_error:"reducer-state"};let Wg=0;function ex(t){return Wg+=1,`${t}_${Wg}_${Date.now()}`}function xC(t){const[i,r]=w.useState(!1),[s,u]=w.useState("idle"),[o,f]=w.useState([]),[h,g]=w.useState(null),[m,y]=w.useState(null),x=w.useRef(null),S=w.useRef(null),v=w.useCallback(C=>C.type!=="agent_definitions"?!1:(x.current!==C.requestId||(f(C.agents),g(C.current),u("ready")),!0),[]),N=w.useCallback(()=>{const C=ex("get_agent_definitions");x.current=C,t({type:"get-agent-definitions",requestId:C})},[t]);return{agentSwitcherOpen:i,agentSwitcherStatus:s,agentDefinitions:o,currentAgentType:h,agentSwitchMessage:m,openAgentSwitcher:w.useCallback(()=>{r(!0),u(C=>C==="ready"?"ready":"loading"),y(null),N()},[N]),closeAgentSwitcher:w.useCallback(()=>{r(!1)},[]),selectAgent:w.useCallback(C=>{const M=ex("agent_switch");S.current=M,y(null),t({type:"command",name:"agent",args:C,requestId:M})},[t]),handleAgentDefinitionsMessage:v,resolveSwitchResult:w.useCallback((C,M)=>C===void 0||S.current!==C?!1:(S.current=null,y(M.message),M.success&&N(),!0),[N])}}let tx=0;function nx(t){return tx+=1,`${t}_${tx}_${Date.now()}`}const lx="The connection to the session closed.",yC="This session is read-only.";function bC(t){return t.appView?.viewId}function vC(t,i){return{type:"read-app-view",requestId:t,viewId:i}}function SC(t,i,r,s){return{type:"call-app-tool",requestId:t,viewId:i,name:r,arguments:s}}function kC(t,i,r){const s=w.useRef(new Map),[u]=w.useState(()=>nx("app_request")),o=w.useCallback((h=lx)=>{const g=[...s.current.values()];s.current.clear();for(const m of g)m.dispose(),m.reject(new Error(h))},[]),f=w.useCallback((h,g,m,y)=>new Promise((x,S)=>{if(!i()||y?.aborted){S(new Error(y?.aborted?"The app view closed.":lx));return}if(r()){S(new Error(yC));return}const v=nx(`${u}_${h}`),N=()=>y?.removeEventListener("abort",C),C=()=>{s.current.delete(v),N(),S(new Error("The app view closed."))};s.current.set(v,m(x,S,N)),y?.addEventListener("abort",C,{once:!0});try{t(g(v))}catch(M){s.current.delete(v),N(),S(M instanceof Error?M:new Error(String(M)))}}),[i,r,u,t]);return{readAppView:w.useCallback((h,g)=>f("app_view",m=>vC(m,h),(m,y,x)=>({answer:"app_view",resolve:m,reject:y,dispose:x}),g),[f]),callAppTool:w.useCallback((h,g,m,y)=>f("app_tool",x=>SC(x,h,g,m),(x,S,v)=>({answer:"app_tool_result",resolve:x,reject:S,dispose:v}),y),[f]),handleAppViewMessage:w.useCallback(h=>{if(h.type==="app_view"||h.type==="app_tool_result"){const g=s.current.get(h.requestId);if(g===void 0||g.answer!==h.type)return!0;if(s.current.delete(h.requestId),g.dispose(),h.type==="app_view"&&g.answer==="app_view")g.resolve(h.view);else if(h.type==="app_tool_result"&&g.answer==="app_tool_result"){const{success:m,data:y,parts:x,error:S}=h;g.resolve({success:m,...y!==void 0?{data:y}:{},...x!==void 0?{parts:x}:{},...S!==void 0?{error:S}:{}})}return!0}if(h.type==="protocol_error"&&h.requestId!==void 0){const g=s.current.get(h.requestId);return g===void 0?h.requestId.startsWith(`${u}_`):(s.current.delete(h.requestId),g.dispose(),g.reject(new Error(h.message)),!0)}return!1},[u]),rejectPendingAppRequests:o}}let ix=0;function wC(){return ix+=1,`execdetail_${ix}_${Date.now()}`}function jC(t){const[i,r]=w.useState(null),[s,u]=w.useState("idle"),[o,f]=w.useState([]),[h,g]=w.useState(null),[m,y]=w.useState(!1),[x,S]=w.useState("live"),[v,N]=w.useState(),C=w.useRef(null),M=w.useRef(null),E=w.useRef("live"),V=w.useRef(void 0),L=w.useRef(null),ne=w.useRef(null),W=w.useRef(0),R=w.useCallback((D,X,ce=!1)=>{if(C.current!==null){(!ce||L.current===null||L.current.refresh)&&(L.current={cursor:X,refresh:ce});return}const he=wC();C.current=he,W.current=Date.now(),ce||u("loading"),g(null),t({type:"read-execution-detail",requestId:he,entryId:D,cursor:X})},[t]),P=w.useCallback(()=>{ne.current!==null&&clearTimeout(ne.current),ne.current=null,L.current=null},[]);w.useEffect(()=>P,[P]);const K=w.useCallback(D=>{P(),C.current=null,M.current=D,E.current="live",S("live"),r(D),f([]),N(void 0),y(!1),V.current=void 0,R(D)},[P,R]),G=w.useCallback(()=>{!i||s==="loading"||m||R(i,V.current)},[i,s,m,R]),O=w.useCallback(D=>{const X=M.current;X&&(P(),E.current=D,S(D),f([]),N(void 0),y(!1),u("loading"),V.current=void 0,R(X,D==="transcript"?{offset:0}:void 0))},[P,R]),ue=w.useCallback(()=>O("transcript"),[O]),te=w.useCallback(()=>O("live"),[O]),Se=w.useCallback(()=>{P(),r(null),C.current=null,M.current=null,f([]),N(void 0),u("idle"),g(null),y(!1)},[P]),ie=w.useCallback(D=>{if(ne.current!==null)return;const X=Math.max(0,250-(Date.now()-W.current));ne.current=setTimeout(()=>{ne.current=null,M.current===D&&E.current==="live"&&R(D,void 0,!0)},X)},[R]),le=w.useCallback(D=>{const X=M.current;if(!X||E.current!=="live")return;const ce=D.entries.find(he=>he.id===X);ce?.resumeSessionId&&ce.controls.includes("attach")&&ie(X)},[ie]);return{openEntryId:i,executionDetailStatus:s,executionDetailRecords:o,executionDetailError:h,executionDetailComplete:m,executionDetailMode:x,executionDetailUnreadable:v,openExecutionDetail:K,loadMoreExecutionDetail:G,showEarlierExecutionDetail:ue,showLiveExecutionDetail:te,closeExecutionDetail:Se,handleExecutionDetailMessage:w.useCallback(D=>{if(D.type!=="execution_detail"&&D.type!=="execution_detail_error")return!1;if(C.current!==D.requestId)return!0;C.current=null;const X=L.current;return L.current=null,(!X||X.refresh)&&(D.type==="execution_detail_error"?(u("error"),g(D.message)):(f(ce=>D.page.cursor===void 0||D.page.cursor.offset===0?D.page.records:[...ce,...D.page.records]),N(ce=>{const he=D.page.unreadable;return D.page.cursor===void 0||D.page.cursor.offset===0||!ce?he:he?{locked:ce.locked+he.locked,noKeys:ce.noKeys+he.noKeys,doesNotOpen:ce.doesNotOpen+he.doesNotOpen}:ce}),V.current=D.page.nextCursor,y(D.page.nextCursor===void 0),u("ready"))),X&&M.current&&(X.refresh?ie(M.current):R(M.current,X.cursor)),!0},[R,ie]),handleExecutionWorkspace:le}}let rx=0;function NC(){return rx+=1,`model_list_${rx}_${Date.now()}`}function EC(t){const[i,r]=w.useState(null),s=w.useRef(null),u=w.useCallback(o=>o.type!=="model_list"?!1:(s.current!==o.requestId||r({groups:o.groups,currentModel:o.currentModel,...o.currentProfile!==void 0?{currentProfile:o.currentProfile}:{}}),!0),[]);return{modelList:i,requestModelList:w.useCallback(()=>{const o=NC();s.current=o,t({type:"list-models",requestId:o})},[t]),handleModelListMessage:u}}let ax=0;function sx(t){return ax+=1,`${t}_${ax}_${Date.now()}`}function CC(t){const[i,r]=w.useState("idle"),[s,u]=w.useState(null),[o,f]=w.useState(null),[h,g]=w.useState("idle"),[m,y]=w.useState(null),[x,S]=w.useState(null),[v,N]=w.useState(null),[C,M]=w.useState("idle"),[E,V]=w.useState(null),L=w.useRef(null),ne=w.useRef(null),W=w.useCallback(R=>R.type==="personal_usage_report"||R.type==="personal_usage_report_error"?(L.current!==R.requestId||(u(R.type==="personal_usage_report"?R.report:null),f(R.type==="personal_usage_report_error"?R.message:null),r(R.type==="personal_usage_report"?"ready":"error")),!0):R.type==="usage_report"?(V(R.report),M("ready"),!0):R.type==="stored_session_usage_report"||R.type==="stored_session_usage_report_error"?(ne.current!==R.requestId||(y(R.type==="stored_session_usage_report"?R.report:null),S(R.sessionId),N(R.type==="stored_session_usage_report_error"?R.message:null),g(R.type==="stored_session_usage_report"?"ready":"error")),!0):(R.type==="protocol_error"&&M(P=>P==="loading"?"error":P),!1),[]);return{personalUsageStatus:i,personalUsageReport:s,personalUsageError:o,requestPersonalUsage:w.useCallback(R=>{const P=sx("personal_usage");L.current=P,r("loading"),f(null),t({type:"get-personal-usage-report",requestId:P,period:R,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"})},[t]),storedSessionUsageStatus:h,storedSessionUsageReport:m,storedSessionUsageSessionId:x,storedSessionUsageError:v,requestStoredSessionUsage:w.useCallback(R=>{const P=sx("stored_session_usage");ne.current=P,g("loading"),y(null),S(R),N(null),t({type:"get-stored-session-usage-report",requestId:P,sessionId:R})},[t]),currentSessionUsageStatus:C,currentSessionUsageReport:E,requestCurrentSessionUsage:w.useCallback(()=>{M("loading"),t({type:"get-usage-report"})},[t]),handleUsageMessage:W}}let ux=0;function Fc(t){return ux+=1,`${t}_${ux}_${Date.now()}`}function _C(t){const[i,r]=w.useState("idle"),[s,u]=w.useState(null),[o,f]=w.useState("idle"),[h,g]=w.useState(null),[m,y]=w.useState(null),[x,S]=w.useState("idle"),[v,N]=w.useState(null),C=w.useRef(null),M=w.useRef(null),E=w.useRef(null),V=w.useCallback(L=>L.type==="project_status"?(C.current!==L.requestId||(u(L.result),r("ready")),!0):L.type==="project_diff"?(M.current!==L.requestId||(y(L.result),f("ready")),!0):L.type==="project_memory"?(E.current!==L.requestId||(N(L.result),S("ready")),!0):(L.type==="protocol_error"&&L.requestId!==void 0&&(C.current===L.requestId&&r("error"),M.current===L.requestId&&f("error"),E.current===L.requestId&&S("error")),!1),[]);return{projectStatusState:i,projectStatus:s,requestProjectStatus:w.useCallback(()=>{const L=Fc("project_status");C.current=L,r("loading"),t({type:"project-status",requestId:L})},[t]),projectDiffState:o,projectDiffPath:h,projectDiff:m,requestProjectDiff:w.useCallback(L=>{const ne=Fc("project_diff");M.current=ne,g(L),f("loading"),y(null),t({type:"project-diff",requestId:ne,path:L})},[t]),projectMemoryState:x,projectMemory:v,requestProjectMemory:w.useCallback(()=>{const L=Fc("project_memory");E.current=L,S("loading"),t({type:"project-memory",requestId:L})},[t]),handleProjectMessage:V}}function TC(t){const[i,r]=w.useState([]),s=w.useCallback(()=>{t({type:"get-background-tasks",filter:{kind:"scheduled"}})},[t]),u=w.useCallback(o=>o.type==="background_tasks"?(r(o.tasks.filter(f=>f.kind==="scheduled")),!0):o.type==="background_task_control_result"&&o.action==="cancel"?(o.success&&s(),!1):(o.type==="command_result"&&o.name==="schedule"&&o.success&&s(),!1),[s]);return{scheduledTasks:i,pauseSchedule:w.useCallback(o=>{t({type:"command",name:"schedule",args:`pause ${o}`})},[t]),resumeSchedule:w.useCallback(o=>{t({type:"command",name:"schedule",args:`resume ${o}`})},[t]),deleteSchedule:w.useCallback(o=>{t({type:"cancel-background-task",taskId:o})},[t]),handleSchedulesMessage:u,requestSchedules:s}}const Wy=w.createContext(null);function AC({value:t,children:i}){if(!t.identity.displayName||!t.identity.cliName||!t.storage.browserNamespace)throw new Error("A public product identity is required");return d.jsx(Wy.Provider,{value:t,children:i},t.storage.browserNamespace)}function ql(){const t=w.useContext(Wy);if(t===null)throw new Error("ProductIdentityProvider is required");return t}let ox=0;function tr(t){return ox+=1,`${t}_${ox}_${Date.now()}`}function DC(t){return t.sessions.some(i=>typeof i.live=="boolean")}function Pf(t){return`${t}.restoreSessionId`}function e1(t,i){try{window.sessionStorage.setItem(Pf(t),i)}catch{}}function RC(t){try{return window.sessionStorage.getItem(Pf(t))}catch{return null}}function zC(t){try{window.sessionStorage.removeItem(Pf(t))}catch{}}function MC(){return typeof window>"u"||typeof window.matchMedia!="function"?!0:window.matchMedia("(min-width: 768px)").matches}function OC(t,i){const{storage:{browserNamespace:r}}=ql(),[s,u]=w.useState(null),[o,f]=w.useState(null),[h,g]=w.useState(MC),m=w.useRef(null),y=w.useRef(!1),x=w.useCallback(()=>{const W=tr("sessions");m.current=W,t({type:"list-sessions",requestId:W})},[t]),S=w.useRef(null);S.current=s?.currentSessionId??null;const v=w.useCallback(W=>{W!==S.current&&t({type:"switch-session",sessionId:W,requestId:tr("session_change")})},[t,r]),N=w.useCallback(()=>t({type:"new-session",requestId:tr("session_change")}),[t,r]),C=w.useCallback((W,R)=>t({type:"rename-session",sessionId:W,name:R,requestId:tr("session_rename")}),[t,r]),M=w.useCallback(W=>t({type:"delete-session",sessionId:W,requestId:tr("session_delete")}),[t,r]),E=w.useRef(null),V=w.useRef(null),L=w.useCallback(()=>{V.current=RC(r)??E.current},[r]),ne=w.useCallback(W=>{const R=V.current;V.current=null,R!==null&&(zC(r),R!==W.currentSessionId&&(i()||DC(W)&&W.sessions.some(P=>P.id===R)&&t({type:"switch-session",sessionId:R,requestId:tr("session_change")})))},[t,r,i]);return{sessionListing:s,sessionsError:o,requestSessions:x,switchSession:v,newSession:N,renameSessionInList:C,deleteSession:M,sessionSidebarOpen:h,setSessionSidebarOpen:g,handleSessionsMessage:w.useCallback(W=>W.type!=="sessions"&&W.type!=="sessions_error"?!1:W.requestId!==m.current?!0:W.type==="sessions"?(y.current=!1,u(W.listing),f(null),ne(W.listing),!0):(V.current=null,y.current=W.code==="not_available",W.code==="not_available"&&u(null),f({code:W.code,message:W.message}),!0),[ne]),canListSessions:w.useCallback(()=>!y.current,[]),markCurrent:w.useCallback(W=>{E.current=W,e1(r,W),u(R=>R===null?R:{...R,currentSessionId:W})},[r]),armRestore:L}}let cx=0;function fx(t){return cx+=1,`${t}_${cx}_${Date.now()}`}function LC(t){const[i,r]=w.useState(!1),[s,u]=w.useState("idle"),[o,f]=w.useState(null),[h,g]=w.useState(null),[m,y]=w.useState(null),x=w.useRef(null),S=w.useCallback(N=>N.type!=="settings"&&N.type!=="settings_error"?!1:x.current!==N.requestId?!0:N.type==="settings"?(f(N.settings),u("ready"),g(null),!0):(g(N.message),u(C=>C==="ready"?"ready":"error"),!0),[]),v=w.useCallback(()=>{u(C=>C==="ready"?"ready":"loading"),g(null);const N=fx("get_settings");x.current=N,t({type:"get-settings",requestId:N})},[t]);return{settingsOpen:i,settingsStatus:s,settingsSnapshot:o,settingsError:h,settingsInitialSectionId:m,openSettings:w.useCallback(N=>{r(!0),y(N??null),v()},[v]),closeSettings:w.useCallback(()=>{r(!1)},[]),updateSettings:w.useCallback(N=>{const C=fx("update_settings");x.current=C,g(null),t({type:"update-settings",requestId:C,patch:N})},[t]),handleSettingsMessage:S,refreshSettings:v}}let UC=0;function pt(){return`msg_${++UC}_${Date.now()}`}let dx=0;function qC(){return dx+=1,`silent_command_${dx}_${Date.now()}`}function t1(t,i){const r=t[t.length-1];return r&&r.type==="text"?[...t.slice(0,-1),{...r,text:r.text+i}]:[...t,{type:"text",id:pt(),text:i}]}function n1(t,i){const r=t[t.length-1];return r&&r.type==="tools"?[...t.slice(0,-1),{...r,tools:[...r.tools,i]}]:[...t,{type:"tools",id:pt(),tools:[i]}]}function l1(t,i){return i.executionId!==void 0?t.findIndex(r=>r.executionId===i.executionId&&r.status==="running"):t.findIndex(r=>r.name===i.toolName&&r.status==="running")}function i1(t){return{id:pt(),name:t.toolName,input:t.firstArg,...t.executionId?{executionId:t.executionId}:{},...t.displayPath?{displayPath:t.displayPath}:{},...t.commandName?{commandName:t.commandName}:{},...t.internal?{internal:!0}:{}}}function Jf(t){return{status:t.isRunning?"running":t.result==="error"||t.result==="denied"?"error":"done",result:t.result,...t.diffLines?{diffLines:t.diffLines}:{},...t.diffFile?{diffFile:t.diffFile}:{},...t.toolResultData!==void 0?{toolResultData:t.toolResultData}:{},...t.toolResultParts?{toolResultParts:t.toolResultParts}:{},...t.appView?{appView:t.appView}:{}}}function BC(t,i){let r=!1;return t.map(s=>{if(r||s.type!=="tools")return s;const u=l1(s.tools,i);if(u===-1)return s;r=!0;const o=[...s.tools];return o[u]={...o[u],...Jf(i)},{...s,tools:o}})}function r1(t){const i=new Map;for(const r of t)if(r.type==="tools")for(const s of r.tools){if(!s.diffFile||!s.diffLines||s.diffLines.length===0)continue;const u=s.diffLines.filter(h=>h.type==="add").length,o=s.diffLines.filter(h=>h.type==="remove").length,f=i.get(s.diffFile);i.set(s.diffFile,{path:s.diffFile,added:(f?.added??0)+u,removed:(f?.removed??0)+o,diffLines:s.diffLines})}return[...i.values()]}function HC(t){return{...i1(t),...Jf(t)}}function IC(t){const i=[];let r=[];const s=()=>{for(const o of r)i.push(o.type==="tools"?{id:o.id,role:"tools",tools:o.tools}:{id:o.id,role:"assistant",content:o.text});const u=r1(r);u.length>0&&i.push({id:pt(),role:"changed-files",files:u}),r=[]};for(const u of t)u.type==="text"&&u.role==="user"?(s(),i.push({id:pt(),role:"user",content:u.content})):u.type==="text"?r=t1(r,u.content):r=n1(r,HC(u.tool));return s(),i}function a1(t){const[i,r]=w.useState("disconnected"),s=w.useRef("disconnected"),[u,o]=w.useState(null),f=w.useRef(null),h=w.useCallback(()=>f.current==="observe",[]),[g,m]=w.useState([]),[y,x]=w.useState([]),[S,v]=w.useState(""),[N,C]=w.useState(!1),[M,E]=w.useState(null),[V,L]=w.useState([]),[ne,W]=w.useState(null),[R,P]=w.useState(null),[K,G]=w.useState([]),[O,ue]=w.useState(null),te=w.useRef(null),[Se,ie]=w.useState(null),[le,D]=w.useState(null),[X,ce]=w.useState(!1),he=w.useCallback(()=>ce(!0),[]),_=w.useCallback(()=>ce(!1),[]),A=w.useRef(null),B=w.useRef(""),j=w.useRef([]),re=w.useRef([]),fe=w.useRef(null),pe=w.useRef(null),ke=w.useCallback(F=>{j.current=F(j.current),x(j.current)},[]),_e=w.useCallback(F=>{m(se=>[...se,F])},[]),oe=w.useCallback(F=>{const se=re.current;re.current=[],B.current="",v(""),C(!1),ke(()=>[]);for(const ze of se)ze.type==="tools"?_e({id:ze.id,role:"tools",tools:ze.tools.map(Tn=>({...Tn,status:F(Tn)}))}):_e({id:ze.id,role:"assistant",content:ze.text});const ge=r1(se);ge.length>0&&_e({id:pt(),role:"changed-files",files:ge})},[_e,ke]),be=w.useRef(0),We=w.useRef(new Set),wt=w.useRef(0),Ft=w.useRef(new Set),[Xt,Qt]=w.useState(),ot=w.useRef(null),$e=w.useCallback(F=>{const se=h()&&!rg(F.type);if(F.type==="send-background-task"){if(se||ot.current!==null)return;ot.current=F.taskId,Qt({taskId:F.taskId,status:"pending"})}if(F.type==="command"){if(F.name==="help"){ce(!0);return}const ge=te.current?.commands.find(ze=>ze.name===F.name);if(Py(ge??{name:F.name})){_e({id:pt(),role:"command",name:F.name,content:Jy(F.name),tone:"info"});return}if(se)return;be.current+=1}se||((F.type==="switch-session"||F.type==="new-session")&&(wt.current+=1,F.requestId!==void 0&&Ft.current.add(F.requestId)),A.current?.send(F))},[_e,h]),Zt=w.useCallback(F=>{wt.current=Math.max(0,wt.current-1),F!==void 0&&Ft.current.delete(F)},[]),sn=w.useCallback((F,se)=>{const ge=qC();We.current.add(ge),$e({type:"command",name:F,requestId:ge,...se?{args:se}:{}})},[$e]),{handleUsageMessage:Sn,...Un}=CC($e),{handleExecutionDetailMessage:sl,handleExecutionWorkspace:ul,closeExecutionDetail:at,...Bl}=jC($e),{handleModelListMessage:Z,...U}=EC($e),{handleProjectMessage:de,...ye}=_C($e),{handleAppViewMessage:De,rejectPendingAppRequests:lt,readAppView:Et,callAppTool:st}=kC($e,w.useCallback(()=>s.current==="connected",[]),h),{handleSessionsMessage:ct,canListSessions:Ct,markCurrent:Fe,armRestore:kn,...Ut}=OC($e,h),{requestSessions:wn,setSessionSidebarOpen:Hl}=Ut,{handleSettingsMessage:Il,openSettings:qn,refreshSettings:_n,...Yl}=LC($e),ol=w.useRef(!1);ol.current=Yl.settingsOpen;const{handleAgentDefinitionsMessage:va,resolveSwitchResult:or,openAgentSwitcher:Vl,...Gl}=xC($e),{handleSchedulesMessage:Sa,requestSchedules:$l,...ka}=TC($e),cl=w.useCallback(()=>{G(F=>F.filter(se=>se.kind!=="context-compacted"))},[]),mi=w.useCallback(F=>{if(gC[F.type],!Sn(F)&&!sl(F)&&!Z(F)&&!de(F)&&!De(F)&&!ct(F)&&!Il(F)&&!va(F)&&!Sa(F))switch(F.type){case"surface_role":f.current=F.role,o(F.role);break;case"messages":{const se=F.display?IC(F.display):F.messages.flatMap(ge=>{if(ge.role!=="user"&&ge.role!=="assistant")return[];const ze=ge.content??"";return[{id:pt(),role:ge.role,content:ze}]});m(se),F.driverId&&D(F.driverId);break}case"user_message":m(se=>[...se,{id:pt(),role:"user",content:F.content??"",...F.driverId?{author:F.driverId}:{}}]);break;case"text_delta":{const se=B.current+F.delta;B.current=se,v(se),re.current=t1(re.current,F.delta);break}case"thinking":C(F.isThinking);break;case"tool_start":{const{state:se}=F,ge={...i1(se),status:"running"};ke(ze=>[...ze,ge]),re.current=n1(re.current,ge);break}case"tool_end":{const{state:se}=F;ke(ge=>{const ze=l1(ge,se);if(ze===-1)return ge;const Tn=[...ge];return Tn[ze]={...Tn[ze],...Jf(se)},Tn}),re.current=BC(re.current,se);break}case"execution_workspace_event":ul(F.snapshot),E(F.snapshot);break;case"background_task_control_result":F.action==="send"&&ot.current===F.taskId&&(ot.current=null,Qt({taskId:F.taskId,status:F.success?"sent":"failed"})),F.success||G(se=>[...se,{id:pt(),kind:"background-task-control-failed",message:F.message??`Could not ${F.action==="send"?"send to":"stop"} ${F.taskId}.`}]);break;case"pending":W(F.pending===null?null:{text:F.pending,count:F.pendingCount??1});break;case"permission_request":case"ask_request":case"prompt_resolved":L(se=>oC(se,F));break;case"ui_intent":{if(Ys(F.event.intent)==="session-sidebar"&&Ct()){Hl(!0),wn(),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}if(Ys(F.event.intent)==="settings"){qn(),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}if(Ys(F.event.intent)==="settings-plugins"){qn("plugins"),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}if(Ys(F.event.intent)==="agent-switcher"){Vl(),be.current>0&&(fe.current={name:aa(F.event.intent),text:null});break}const se={name:aa(F.event.intent),text:dC(F.event.intent)};be.current>0?fe.current=se:_e({id:pt(),role:"command",name:se.name,content:se.text,tone:"info"});break}case"session_renamed":P(F.event.name),wn();break;case"session_switched":lt("The active session changed."),Zt(),pe.current=null,ie(null),cl(),B.current="",re.current=[],v(""),C(!1),ke(()=>[]),m([]),L([]),W(null),P(null),E(null),at(),Fe(F.event.sessionId),$e({type:"get-messages"}),$e({type:"get-status"}),$e({type:"get-commands"}),$e({type:"get-execution-workspace"}),$e({type:"get-pending"}),wn(),$l();break;case"history_cleared":cl(),lt("The session history was cleared."),B.current="",re.current=[],v(""),m([]);break;case"error":{const se=F.model??pe.current?.model;$e({type:"get-status"}),oe(ge=>ge.status==="running"?"error":ge.status),G(ge=>[...ge,{id:pt(),kind:"session-error",message:F.message,...F.code!==void 0&&{code:F.code},...F.provider!==void 0&&{provider:F.provider},...se!==void 0&&{model:se},...F.retryAfterSeconds!==void 0&&{retryAfterSeconds:F.retryAfterSeconds}}]);break}case"session_change_failed":if(F.requestId!==void 0&&!Ft.current.has(F.requestId))break;Zt(F.requestId),G(se=>[...se,{id:pt(),kind:"session-change-refused",message:F.message}]);break;case"session_renamed_in_list":wn();break;case"session_rename_failed":G(se=>[...se,{id:pt(),kind:"session-change-refused",message:F.message}]);break;case"session_deleted":wn();break;case"session_delete_failed":G(se=>[...se,{id:pt(),kind:"session-change-refused",message:F.message}]);break;case"protocol_error":{if(ot.current!==null&&F.message==="Not permitted for an observer: send-background-task"&&(Qt({taskId:ot.current,status:"failed"}),ot.current=null),wt.current>0){Zt(),G(ge=>[...ge,{id:pt(),kind:"protocol-error",message:F.message}]);break}be.current=Math.max(0,be.current-1);const se=fe.current;fe.current=null,se!==null&&se.text!==null&&_e({id:pt(),role:"command",name:se.name,content:se.text,tone:"info"}),G(ge=>[...ge,{id:pt(),kind:"protocol-error",message:F.message}]);break}case"commands":{const se={commands:F.commands,skills:F.skills};te.current=se,ue(se);break}case"context":if(pe.current!==null){const se={...pe.current,context:F.state};pe.current=se,ie(se)}break;case"history_changed":{const se=F.compact;se?.trigger==="auto"&&G(ge=>[...ge,{id:pt(),kind:"context-compacted",message:`Auto compacted context: ${Math.round(se.beforeUsedPercentage)}% → ${Math.round(se.afterUsedPercentage)}%`}]);break}case"session_status":pe.current=F.status,ie(F.status);break;case"command_result":{$e({type:"get-status"}),$e({type:"get-commands"}),be.current=Math.max(0,be.current-1),F.name==="provider"&&F.success&&ol.current&&_n();const se=F.requestId!==void 0&&We.current.delete(F.requestId);if(or(F.requestId,F))break;const ge=fe.current;if(fe.current=null,ge!==null&&F.success){ge.text!==null&&_e({id:pt(),role:"command",name:F.name,content:ge.text,tone:"info"});break}if(F.message.trim().length===0)break;if(se){F.success||G(ze=>[...ze,{id:pt(),kind:"command-failed",message:F.message}]);break}_e({id:pt(),role:"command",name:F.name,content:F.message,tone:F.success?"success":"error"});break}case"complete":case"interrupted":$e({type:"get-status"}),$e({type:"get-pending"}),wn(),oe(se=>se.status==="running"?"done":se.status);break}},[_e,Ct,at,cl,oe,va,De,sl,ul,Z,de,Sa,ct,Il,Sn,Fe,Vl,qn,_n,$l,wn,or,lt,$e,Hl,Zt,ke]),cr=w.useCallback((F,se)=>{A.current?.send(cC(F,se)),L(ge=>ge.filter(ze=>ze.id!==F))},[]),wa=w.useCallback((F,se)=>{A.current?.send(fC(F,se)),L(ge=>ge.filter(ze=>ze.id!==F))},[]),ja=w.useCallback(F=>{G(se=>se.filter(ge=>ge.id!==F))},[]);return w.useEffect(()=>{const se=t({onMessage:mi,onStatusChange:ze=>{s.current=ze,r(ze),ze!=="connected"&&(f.current=null,o(null)),ze!=="connected"&&(lt(),cl(),at(),ot.current!==null&&(Qt({taskId:ot.current,status:"failed"}),ot.current=null)),ze==="connected"&&(be.current=0,We.current.clear(),wt.current=0,Ft.current.clear(),fe.current=null,ge.send({type:"get-surface-role"}),ge.send({type:"get-commands"}),ge.send({type:"get-status"}),ge.send({type:"get-pending"}),kn(),wn(),$l())}}),ge={connect:()=>se.connect(),disconnect:()=>se.disconnect(),send:ze=>{f.current==="observe"&&!rg(ze.type)||se.send(ze)}};return A.current=ge,ge.connect(),()=>{ge.disconnect(),A.current=null,lt()}},[t,mi,cl,at,wn,$l,kn,lt]),{status:i,messages:g,activeTools:y,streamingText:S,isThinking:N,executionWorkspace:M,sessionName:R,commandCatalog:O,sessionStatus:Se,ownDriverId:le,role:u,send:$e,sendCommandSilently:sn,pendingPrompts:V,queuedPrompt:ne,answerPermission:cr,answerAsk:wa,...Un,...Bl,executionDetailInput:Xt,closeExecutionDetail:at,...U,...ye,...Ut,sessionNotices:K,dismissSessionNotice:ja,openSettings:qn,...Yl,openAgentSwitcher:Vl,...Gl,...ka,readAppView:Et,callAppTool:st,helpOpen:X,openHelp:he,closeHelp:_}}function YC(t){const[i,r]=w.useState(!1),s=a1(w.useCallback(u=>mC(t,{...u,onGiveUp:()=>r(!0)}),[t]));return w.useEffect(()=>{s.status==="connected"&&r(!1)},[s.status]),{...s,connectionLost:i}}function VC(t,i){let r=!1,s=!1,u,o=!1,f=!1;const h=()=>{f=!0,r=!1,!o&&s&&i.onStatusChange("disconnected")};return{connect(){if(!(f||o)&&!s){s=!0,i.onStatusChange("connecting");try{u=t.subscribe(g=>{if(!s||o||f)return;const m=qx(g,Ux);if(!m.ok){o=!0,r=!1,t.close(),i.onStatusChange("error");return}i.onMessage(m.message)},h,()=>{!s||o||f||(r=!0,i.onStatusChange("connected"),t.send(JSON.stringify({type:"get-messages"})))})}catch{h()}}},disconnect(){s=!1,r=!1,u?.(),u=void 0,i.onStatusChange("disconnected")},send(g){!r||o||t.send(JSON.stringify(g))||(t.close(),h())}}}async function GC(t){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}if(!$C(t))throw new Error("copy failed")}function $C(t){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.opacity="0",r.style.pointerEvents="none",document.body.appendChild(r),r.focus(),r.select();let s=!1;try{s=document.execCommand("copy")}catch{s=!1}return document.body.removeChild(r),i?.focus(),s}const FC=2e3;function XC(){const[t,i]=w.useState("idle");return w.useEffect(()=>{if(t==="idle")return;const s=setTimeout(()=>i("idle"),FC);return()=>clearTimeout(s)},[t]),{status:t,copy:s=>{GC(s).then(()=>i("copied"),()=>i("error"))}}}function Sf(t){return t.startsWith("attach:")?"terminal":t==="app"?"desktop-app":t==="browser"?"browser":t==="remote:ws"?"remote":t.startsWith("peer:")?"peer":null}function s1(t,i){if(t===W0)return!0;if(t===Lx||i===null)return!1;if(t===i)return!0;const r=Sf(t);return r!==null&&r===Sf(i)}function QC(t){switch(Sf(t)){case"terminal":return"the terminal";case"desktop-app":return"the desktop app";case"browser":return"the browser";case"remote":case"peer":return"a remote device";default:return"another surface"}}function u1(t){return t===Lx?"Automatic — loop":`from ${QC(t)}`}function o1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function c1(t){const i=[];for(const r of t??[])r.type==="text"?i.push({type:"text",text:r.text}):r.type==="image_inline"?i.push({type:"image",data:r.data,mimeType:r.mimeType}):r.type==="audio_inline"&&i.push({type:"audio",data:r.data,mimeType:r.mimeType});return i}function ZC(t){let i=c1(t.parts);return i.length===0&&typeof t.data=="string"&&(i=[{type:"text",text:t.data}]),!t.success&&t.error!==void 0&&(i=[...i,{type:"text",text:t.error}]),{content:i,...o1(t.data)?{structuredContent:t.data}:{},isError:!t.success}}function KC(t,i){let r=c1(t.toolResultParts);return r.length===0&&t.toolResultData!==void 0&&(r=[{type:"text",text:t.toolResultData}]),{content:r,...o1(i.structuredContent)?{structuredContent:i.structuredContent}:{},isError:t.status==="error"}}const PC="2026-01-26",px=-32602,JC=-32601,Xc=-32e3,WC="ui/notifications/sandbox-proxy-ready",e_="ui/notifications/sandbox-resource-ready";function sa(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;const i=Object.getPrototypeOf(t);return i===null||Object.getPrototypeOf(i)===null}function t_(t){return t instanceof Error?t.message:String(t)}function n_(t){const{view:i}=t;let r=!1,s=!1,u="uninitialized",o=!1;const f=(x,S)=>{t.post({jsonrpc:"2.0",id:x,result:S})},h=(x,S,v)=>{t.post({jsonrpc:"2.0",id:x,error:{code:S,message:v}})},g=(x,S)=>{if(u!=="ready"){h(x,Xc,"This app view has not initialized.");return}const v=sa(S)?S.name:void 0,N=typeof v=="string"&&Object.hasOwn(i.callableTools,v)?i.callableTools[v]:void 0;if(!sa(S)||N===void 0){h(x,px,"This tool is not available to this view.");return}const C=S.arguments===void 0?{}:S.arguments;if(!sa(C)){h(x,px,"Tool arguments must be an object.");return}if(o){h(x,Xc,"Another tool call from this view is still running.");return}o=!0;let M;try{M=t.callAppTool(N,C)}catch(E){M=Promise.reject(E)}M.then(E=>{o=!1,r||f(x,ZC(E))},E=>{o=!1,r||h(x,Xc,t_(E))})},m=(x,S,v)=>{switch(S){case"ui/initialize":u==="uninitialized"&&(u="initializing"),f(x,{protocolVersion:PC,hostCapabilities:{serverTools:{}},hostInfo:t.hostInfo,hostContext:t.hostContext});return;case"tools/call":g(x,v);return;case"ping":f(x,{});return;case"ui/request-display-mode":f(x,{mode:"inline"});return;default:h(x,JC,`This host does not support ${S}.`)}},y=(x,S)=>{switch(x){case WC:if(s)return;s=!0,t.post({jsonrpc:"2.0",method:e_,params:{html:i.html}});return;case"ui/notifications/initialized":if(u!=="initializing")return;u="ready",t.post({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:i.toolInput??{}}}),t.post({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:t.toolResult});return;case"ui/notifications/size-changed":{const v=sa(S)?S.height:void 0;if(typeof v!="number"||!Number.isFinite(v))return;t.onHeight(Math.min(640,Math.max(48,Math.round(v))));return}default:return}};return{handleMessage(x){if(r)return;const S=t.source();if(S===null||x.source!==S)return;const v=x.data;if(!sa(v)||v.jsonrpc!=="2.0")return;const{method:N,id:C}=v;typeof N=="string"&&(C===void 0?y(N,v.params):(typeof C=="string"||typeof C=="number")&&m(C,N,v.params))},dispose(){r||(r=!0,u==="ready"&&t.post({jsonrpc:"2.0",id:"teardown",method:"ui/resource-teardown",params:{reason:"closed"}}))}}}const f1=w.createContext(null);function l_(t){return{theme:typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",displayMode:"inline",availableDisplayModes:["inline"],containerDimensions:{maxHeight:640},platform:t,locale:typeof navigator>"u"?"en-US":navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}}const i_=160,r_="This tool returned an app view, which this window cannot show.";function d1({tool:t}){const i=w.useContext(f1);if(t.appView===void 0)return null;const r=bC(t);return i===null||i.sandboxUrl===void 0||r===void 0?d.jsx("p",{className:"text-[13px] text-subtle",children:r_}):d.jsx(a_,{tool:t,host:i,sandboxUrl:i.sandboxUrl,viewKey:r,sourceId:t.appView.sourceId},r)}function a_({tool:t,host:i,sandboxUrl:r,viewKey:s,sourceId:u}){const[o,f]=w.useState({status:"loading"}),[h,g]=w.useState(i_),m=w.useRef(null),y=w.useRef(t);y.current=t,w.useEffect(()=>{const S=new AbortController;return f({status:"loading"}),i.readAppView(s,S.signal).then(v=>{S.signal.aborted||f({status:"ready",view:v,host:i,sandboxUrl:r,signal:S.signal})},v=>{S.signal.aborted||f({status:"failed",reason:v instanceof Error?v.message:String(v)})}),()=>{S.abort()}},[s,i.readAppView,i.callAppTool,r]);const x=o.status==="ready"&&o.host.readAppView===i.readAppView&&o.host.callAppTool===i.callAppTool&&o.sandboxUrl===r?o:null;return w.useLayoutEffect(()=>{const S=m.current;if(x===null||S===null)return;const v=x.host,N=x.view,C=n_({view:N,toolResult:KC(y.current,N),hostInfo:v.hostInfo,hostContext:l_(v.platform),post:E=>S.contentWindow?.postMessage(E,"*"),source:()=>S.contentWindow,callAppTool:(E,V)=>v.callAppTool(s,E,V,x.signal),onHeight:g}),M=E=>C.handleMessage(E);return window.addEventListener("message",M),()=>{window.removeEventListener("message",M),C.dispose()}},[x,s]),o.status==="failed"?d.jsxs("p",{className:"text-[13px] text-subtle",children:["The app from ",u," could not be shown: ",o.reason]}):x===null?d.jsxs("p",{className:"text-[13px] text-subtle",children:["Loading the app from ",u,"…"]}):d.jsxs("div",{className:"my-1 flex flex-col gap-1",children:[d.jsxs("p",{className:"text-[12px] text-subtle",children:["App from ",u]}),d.jsx("iframe",{ref:m,sandbox:"allow-scripts",src:r,title:`App from ${u}`,referrerPolicy:"no-referrer","data-testid":"app-view-frame",style:{width:"100%",height:h},className:"block rounded-lg border border-border bg-card"})]})}const s_={add:"bg-accent/10 text-foreground",remove:"bg-destructive/10 text-foreground",context:"text-muted-foreground",hunk:"text-subtle"},u_={add:"+ ",remove:"- ",context:" ",hunk:""},Qc=40,Vs=500;function hx({line:t}){return d.jsx("div",{className:`whitespace-pre ${s_[t.type]}`,children:`${u_[t.type]}${t.text}`})}function ou({diffLines:t}){const[i,r]=w.useState(!1);if(t.length<=Qc)return d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-sidebar px-3 py-2 font-mono text-[12.5px] leading-relaxed",children:t.map((f,h)=>d.jsx(hx,{line:f},h))});const s=t.slice(0,Vs),u=i?s:t.slice(0,Qc),o=Math.min(t.length,Vs)-Qc;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("pre",{className:"overflow-x-auto rounded-lg bg-sidebar px-3 py-2 font-mono text-[12.5px] leading-relaxed",children:u.map((f,h)=>d.jsx(hx,{line:f},h))}),i&&t.length>Vs&&d.jsxs("p",{className:"text-[12px] text-subtle",children:[t.length-Vs," more lines not shown"]}),d.jsx("button",{type:"button",onClick:()=>r(f=>!f),className:"self-start text-[12.5px] text-accent hover:underline",children:i?"Show less":`Show more (${o} more lines)`})]})}function kf(t){return t==null||typeof t=="boolean"?"":typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(kf).join(""):bn.isValidElement(t)?kf(t.props.children):""}function p1({label:t,getText:i,className:r=""}){const{status:s,copy:u}=XC(),o=s==="copied"?"Copied":s==="error"?"Couldn't copy":"";return d.jsxs("span",{className:`inline-flex items-center ${r}`,children:[d.jsxs("button",{type:"button",onClick:()=>u(i()),className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground shadow-sm shadow-black/5 transition-colors hover:bg-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s==="copied"?d.jsx(ya,{size:13,strokeWidth:2}):d.jsx(xE,{size:13,strokeWidth:1.9}),d.jsx("span",{children:t})]}),d.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:o})]})}function o_({children:t}){const i=kf(t).replace(/\n$/,"");return d.jsxs("div",{className:"group/code relative my-1",children:[d.jsx("pre",{tabIndex:0,"aria-label":"Code block, horizontally scrollable",className:"gui-code-scroll overflow-x-auto rounded-xl bg-sidebar px-4 py-3.5 font-mono text-[13px] leading-[1.65] focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t}),d.jsx(p1,{label:"Copy code",getText:()=>i,className:"absolute right-2 top-2 opacity-0 transition-opacity group-hover/code:opacity-100 group-focus-within/code:opacity-100 [@media(hover:none)]:opacity-100"})]})}function c_({children:t}){return d.jsx(Mw,{remarkPlugins:[XN],components:{h1:({children:i})=>d.jsx("h1",{className:"mt-6 text-[20px] font-semibold leading-snug tracking-[-0.015em] first:mt-0",children:i}),h2:({children:i})=>d.jsx("h2",{className:"mt-6 text-[17px] font-semibold leading-snug tracking-[-0.01em] first:mt-0",children:i}),h3:({children:i})=>d.jsx("h3",{className:"mt-5 text-[15px] font-semibold leading-snug first:mt-0",children:i}),p:({children:i})=>d.jsx("p",{children:i}),pre:o_,code:({className:i,children:r})=>i?d.jsx("code",{className:`font-mono ${i??""}`,children:r}):d.jsx("code",{className:"rounded-md bg-raised px-1.5 py-0.5 font-mono text-[0.85em]",children:r}),ul:({children:i})=>d.jsx("ul",{className:"ml-5 list-outside list-disc space-y-1.5 marker:text-subtle",children:i}),ol:({children:i})=>d.jsx("ol",{className:"ml-5 list-outside list-decimal space-y-1.5 marker:text-subtle",children:i}),li:({children:i})=>d.jsx("li",{className:"pl-1",children:i}),strong:({children:i})=>d.jsx("strong",{className:"font-semibold",children:i}),em:({children:i})=>d.jsx("em",{className:"italic",children:i}),a:({href:i,children:r})=>d.jsx("a",{href:i,className:"text-accent underline decoration-accent/40 underline-offset-[3px] hover:decoration-accent",target:"_blank",rel:"noopener noreferrer",children:r}),table:({children:i})=>d.jsx("div",{className:"overflow-x-auto",children:d.jsx("table",{className:"w-full border-collapse text-[14px]",children:i})}),thead:({children:i})=>d.jsx("thead",{children:i}),th:({children:i})=>d.jsx("th",{className:"border-b border-border px-3 py-2 text-left text-[13px] font-medium text-muted-foreground",children:i}),td:({children:i})=>d.jsx("td",{className:"px-3 py-2 align-top",children:i}),blockquote:({children:i})=>d.jsx("blockquote",{className:"border-l-2 border-subtle/50 pl-4 text-muted-foreground",children:i}),hr:()=>d.jsx("hr",{className:"mx-auto my-7 w-12 border-subtle/40"})},children:t})}function f_({content:t,author:i,ownDriverId:r}){const s=i&&!s1(i,r)?u1(i):void 0;return d.jsxs("div",{className:"flex flex-col items-end gap-1.5 pl-12",children:[s&&d.jsx("span",{className:"px-1 text-[12.5px] text-subtle",children:s}),d.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words rounded-[20px] bg-raised px-4 py-2.5 text-[15px] leading-relaxed text-foreground",children:t})]})}function mx({content:t,isStreaming:i=!1}){return d.jsxs("div",{className:"group/message gui-prose",children:[d.jsx(c_,{children:t}),i&&d.jsx("span",{className:"ml-1 inline-block h-2.5 w-2.5 animate-pulse rounded-full bg-foreground/70 align-middle"}),!i&&d.jsx("div",{className:"flex opacity-0 transition-opacity focus-within:opacity-100 group-hover/message:opacity-100 group-focus-within/message:opacity-100 [@media(hover:none)]:opacity-100",children:d.jsx(p1,{label:"Copy message",getText:()=>t})})]})}function d_({name:t,className:i}){const r=t.toLowerCase(),s={size:15,strokeWidth:1.75,className:i};return/(read|view|cat|open)/u.test(r)?d.jsx(wE,{...s}):/(grep|glob|search|find|list|ls)/u.test(r)?d.jsx($E,{...s}):/(edit|write|patch|replace|create)/u.test(r)?d.jsx($y,{...s}):/(bash|shell|exec|run|command|terminal)/u.test(r)?d.jsx(nC,{...s}):/(web|fetch|http|url|browse)/u.test(r)?d.jsx(TE,{...s}):/(agent|task|delegate)/u.test(r)?d.jsx(rE,{...s}):d.jsx(Zy,{...s})}const p_=52;function h1(t,i=p_){if(t.length<=i)return t;const r=t.lastIndexOf("/");if(r===-1)return t;const s=t.slice(r+1),u=t.slice(0,r),o=i-s.length-2;return o<=0?`…/${s}`:`…${u.slice(u.length-o)}/${s}`}function h_(t){if(t)try{const i=JSON.parse(t);if(typeof i!="object"||i===null)return{output:t};const r=i;return{structured:t,...typeof r.output=="string"&&r.output?{output:r.output}:{},...typeof r.error=="string"&&r.error?{error:r.error}:{},...typeof r.exitCode=="number"?{exitCode:r.exitCode}:{}}}catch{return{output:t}}}const Zc=20,Kc=500;function Ws({text:t}){const[i,r]=w.useState(!1),s=t.split(`
308
38
  `);if(s.length<=Zc)return d.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[12.5px] leading-relaxed text-muted-foreground",children:t});const u=s.slice(0,Kc);return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[12.5px] leading-relaxed text-muted-foreground",children:(i?u:s.slice(0,Zc)).join(`
309
39
  `)}),i&&s.length>Kc&&d.jsxs("p",{className:"text-[12px] text-subtle",children:[s.length-Kc," more lines"]}),d.jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"self-start text-[12.5px] text-accent hover:underline",children:i?"Show less":`Show more (${s.length-Zc} more lines)`})]})}function m_({tool:t}){return d.jsxs("div",{className:"flex flex-col gap-2",children:[t.executionId&&d.jsx("code",{className:"text-[12px] text-subtle",children:t.executionId}),t.toolResultParts?.map((i,r)=>{switch(i.type){case"text":return d.jsx(Ws,{text:i.text},r);case"image_inline":return/^image\/(png|jpeg|gif|webp)$/.test(i.mimeType)?d.jsx("img",{src:`data:${i.mimeType};base64,${i.data}`,alt:`Observation from ${t.name}`,className:"max-h-96 max-w-full object-contain"},r):d.jsxs("p",{children:["Image preview unavailable (",i.mimeType,")."]},r);case"image_uri":return d.jsxs("div",{children:[d.jsx("p",{children:"Image reference; an admitted read is required."}),d.jsx("code",{children:i.uri})]},r);case"resource_link":return d.jsxs("div",{children:[d.jsx("p",{children:i.title??i.name}),d.jsx("code",{children:i.uri}),d.jsx("p",{children:"An admitted read is required."})]},r);case"resource_embedded":return d.jsxs("div",{children:[d.jsx("code",{children:i.uri}),i.text!==void 0?d.jsx(Ws,{text:i.text}):d.jsxs("p",{children:["Embedded binary resource (",i.mimeType??"unknown type","); preview unavailable."]})]},r);case"audio_inline":return d.jsxs("p",{children:["Audio preview unavailable (",i.mimeType,")."]},r)}})]})}function m1({tool:t}){const i=t.status==="running",r=t.status==="error",[s,u]=w.useState(!1),o=h_(t.toolResultData),f=t.diffLines!==void 0&&t.diffLines.length>0,h=!!o?.output||!!o?.error||!!o?.structured,g=!!t.toolResultParts?.length,m=f||h||g,y=t.commandName?`Ran /${t.commandName}`:t.name;return d.jsxs("div",{className:"flex flex-col text-[14px]",children:[d.jsxs("button",{type:"button",disabled:!m,"aria-expanded":m?s:void 0,onClick:()=>m&&u(x=>!x),className:`group -mx-2 flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-1 text-left ${m?"hover:bg-hover":"cursor-default"}`,children:[d.jsx(d_,{name:t.name,className:`flex-shrink-0 ${r?"text-destructive":"text-subtle"}`}),d.jsx("span",{className:`flex-shrink-0 font-medium ${i?"gui-shimmer":r?"text-destructive":"text-muted-foreground"}`,children:y}),t.displayPath?d.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-[12.5px] text-subtle",title:t.displayPath,children:h1(t.displayPath)}):typeof t.input=="string"&&t.input&&d.jsx("span",{className:"min-w-0 truncate font-mono text-[12.5px] text-subtle",children:t.input}),d.jsxs("span",{className:"ml-auto flex flex-shrink-0 items-center gap-1.5 text-[12.5px] text-subtle",children:[i?d.jsx(Qf,{size:14,className:"animate-spin","aria-label":"running"}):r?d.jsx("span",{className:"text-destructive",children:"failed"}):d.jsx(ya,{size:14,"aria-label":"done"}),m&&d.jsx(su,{size:13,className:`transition-transform ${s?"rotate-90":""}`})]})]}),s&&m&&d.jsxs("div",{className:"flex flex-col gap-1 pb-1 pl-[25px] pt-0.5",children:[f&&d.jsx(ou,{diffLines:t.diffLines}),!f&&o?.output&&d.jsx(Ws,{text:o.output}),o?.error&&d.jsx("p",{className:"font-mono text-[12.5px] text-destructive",children:o.error}),typeof o?.exitCode=="number"&&d.jsxs("p",{className:"text-[12px] text-subtle",children:["exit ",o.exitCode]}),o?.structured&&d.jsx(Ws,{text:o.structured}),g&&d.jsx(m_,{tool:t})]})]})}const gx=12,xx=280,g_={success:{dot:"bg-accent",text:"text-foreground/90"},error:{dot:"bg-destructive",text:"text-destructive"},info:{dot:"bg-subtle",text:"text-muted-foreground"}};function x_({entry:t}){const i=t.content.split(`
310
40
  `),r=w.useRef(null),[s,u]=w.useState(!1),[o,f]=w.useState(!1);w.useLayoutEffect(()=>{const S=r.current;S&&u(S.scrollHeight>xx)},[t.content]);const h=i.length>gx,g=h||s,m=g&&!o,y=m&&h?i.slice(0,gx).join(`