acp-devtools 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1768 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function Qd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var py={exports:{}},fl={},fy={exports:{}},ge={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 Ss=Symbol.for("react.element"),qx=Symbol.for("react.portal"),Ux=Symbol.for("react.fragment"),Lx=Symbol.for("react.strict_mode"),Dx=Symbol.for("react.profiler"),zx=Symbol.for("react.provider"),Fx=Symbol.for("react.context"),Bx=Symbol.for("react.forward_ref"),Hx=Symbol.for("react.suspense"),Vx=Symbol.for("react.memo"),Wx=Symbol.for("react.lazy"),$f=Symbol.iterator;function Kx(e){return e===null||typeof e!="object"?null:(e=$f&&e[$f]||e["@@iterator"],typeof e=="function"?e:null)}var my={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hy=Object.assign,yy={};function Gr(e,t,n){this.props=e,this.context=t,this.refs=yy,this.updater=n||my}Gr.prototype.isReactComponent={};Gr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Gr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gy(){}gy.prototype=Gr.prototype;function Yd(e,t,n){this.props=e,this.context=t,this.refs=yy,this.updater=n||my}var Xd=Yd.prototype=new gy;Xd.constructor=Yd;hy(Xd,Gr.prototype);Xd.isPureReactComponent=!0;var kf=Array.isArray,vy=Object.prototype.hasOwnProperty,Zd={current:null},by={key:!0,ref:!0,__self:!0,__source:!0};function xy(e,t,n){var o,r={},i=null,s=null;if(t!=null)for(o in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)vy.call(t,o)&&!by.hasOwnProperty(o)&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return{$$typeof:Ss,type:e,key:i,ref:s,props:r,_owner:Zd.current}}function Gx(e,t){return{$$typeof:Ss,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function eu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ss}function Jx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Tf=/\/+/g;function Wl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Jx(""+e.key):t.toString(36)}function sa(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Ss:case qx:s=!0}}if(s)return s=e,r=r(s),e=o===""?"."+Wl(s,0):o,kf(r)?(n="",e!=null&&(n=e.replace(Tf,"$&/")+"/"),sa(r,t,n,"",function(c){return c})):r!=null&&(eu(r)&&(r=Gx(r,n+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(Tf,"$&/")+"/")+e)),t.push(r)),1;if(s=0,o=o===""?".":o+":",kf(e))for(var a=0;a<e.length;a++){i=e[a];var l=o+Wl(i,a);s+=sa(i,t,n,l,r)}else if(l=Kx(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=o+Wl(i,a++),s+=sa(i,t,n,l,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Is(e,t,n){if(e==null)return e;var o=[],r=0;return sa(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Qx(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var St={current:null},aa={transition:null},Yx={ReactCurrentDispatcher:St,ReactCurrentBatchConfig:aa,ReactCurrentOwner:Zd};function wy(){throw Error("act(...) is not supported in production builds of React.")}ge.Children={map:Is,forEach:function(e,t,n){Is(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Is(e,function(){t++}),t},toArray:function(e){return Is(e,function(t){return t})||[]},only:function(e){if(!eu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Component=Gr;ge.Fragment=Ux;ge.Profiler=Dx;ge.PureComponent=Yd;ge.StrictMode=Lx;ge.Suspense=Hx;ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;ge.act=wy;ge.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=hy({},e.props),r=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Zd.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)vy.call(t,l)&&!by.hasOwnProperty(l)&&(o[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];o.children=a}return{$$typeof:Ss,type:e.type,key:r,ref:i,props:o,_owner:s}};ge.createContext=function(e){return e={$$typeof:Fx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zx,_context:e},e.Consumer=e};ge.createElement=xy;ge.createFactory=function(e){var t=xy.bind(null,e);return t.type=e,t};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:Bx,render:e}};ge.isValidElement=eu;ge.lazy=function(e){return{$$typeof:Wx,_payload:{_status:-1,_result:e},_init:Qx}};ge.memo=function(e,t){return{$$typeof:Vx,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=aa.transition;aa.transition={};try{e()}finally{aa.transition=t}};ge.unstable_act=wy;ge.useCallback=function(e,t){return St.current.useCallback(e,t)};ge.useContext=function(e){return St.current.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e){return St.current.useDeferredValue(e)};ge.useEffect=function(e,t){return St.current.useEffect(e,t)};ge.useId=function(){return St.current.useId()};ge.useImperativeHandle=function(e,t,n){return St.current.useImperativeHandle(e,t,n)};ge.useInsertionEffect=function(e,t){return St.current.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return St.current.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return St.current.useMemo(e,t)};ge.useReducer=function(e,t,n){return St.current.useReducer(e,t,n)};ge.useRef=function(e){return St.current.useRef(e)};ge.useState=function(e){return St.current.useState(e)};ge.useSyncExternalStore=function(e,t,n){return St.current.useSyncExternalStore(e,t,n)};ge.useTransition=function(){return St.current.useTransition()};ge.version="18.3.1";fy.exports=ge;var P=fy.exports;const te=Qd(P);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 Xx=P,Zx=Symbol.for("react.element"),e0=Symbol.for("react.fragment"),t0=Object.prototype.hasOwnProperty,n0=Xx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o0={key:!0,ref:!0,__self:!0,__source:!0};function Sy(e,t,n){var o,r={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(o in t)t0.call(t,o)&&!o0.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)r[o]===void 0&&(r[o]=t[o]);return{$$typeof:Zx,type:e,key:i,ref:s,props:r,_owner:n0.current}}fl.Fragment=e0;fl.jsx=Sy;fl.jsxs=Sy;py.exports=fl;var d=py.exports,Oc={},$y={exports:{}},Ut={},ky={exports:{}},Ty={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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
- */(function(e){function t(q,G){var I=q.length;q.push(G);e:for(;0<I;){var _=I-1>>>1,A=q[_];if(0<r(A,G))q[_]=G,q[I]=A,I=_;else break e}}function n(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var G=q[0],I=q.pop();if(I!==G){q[0]=I;e:for(var _=0,A=q.length,E=A>>>1;_<E;){var w=2*(_+1)-1,k=q[w],N=w+1,B=q[N];if(0>r(k,I))N<A&&0>r(B,k)?(q[_]=B,q[N]=I,_=N):(q[_]=k,q[w]=I,_=w);else if(N<A&&0>r(B,I))q[_]=B,q[N]=I,_=N;else break e}}return G}function r(q,G){var I=q.sortIndex-G.sortIndex;return I!==0?I:q.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],f=1,m=null,h=3,y=!1,g=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(q){for(var G=n(c);G!==null;){if(G.callback===null)o(c);else if(G.startTime<=q)o(c),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(c)}}function S(q){if(b=!1,x(q),!g)if(n(l)!==null)g=!0,Q(T);else{var G=n(c);G!==null&&ee(S,G.startTime-q)}}function T(q,G){g=!1,b&&(b=!1,u(j),j=-1),y=!0;var I=h;try{for(x(G),m=n(l);m!==null&&(!(m.expirationTime>G)||q&&!F());){var _=m.callback;if(typeof _=="function"){m.callback=null,h=m.priorityLevel;var A=_(m.expirationTime<=G);G=e.unstable_now(),typeof A=="function"?m.callback=A:m===n(l)&&o(l),x(G)}else o(l);m=n(l)}if(m!==null)var E=!0;else{var w=n(c);w!==null&&ee(S,w.startTime-G),E=!1}return E}finally{m=null,h=I,y=!1}}var C=!1,$=null,j=-1,R=5,M=-1;function F(){return!(e.unstable_now()-M<R)}function V(){if($!==null){var q=e.unstable_now();M=q;var G=!0;try{G=$(!0,q)}finally{G?L():(C=!1,$=null)}}else C=!1}var L;if(typeof p=="function")L=function(){p(V)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=V,L=function(){D.postMessage(null)}}else L=function(){v(V,0)};function Q(q){$=q,C||(C=!0,L())}function ee(q,G){j=v(function(){q(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_continueExecution=function(){g||y||(g=!0,Q(T))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(q){switch(h){case 1:case 2:case 3:var G=3;break;default:G=h}var I=h;h=G;try{return q()}finally{h=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,G){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var I=h;h=q;try{return G()}finally{h=I}},e.unstable_scheduleCallback=function(q,G,I){var _=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?_+I:_):I=_,q){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=I+A,q={id:f++,callback:G,priorityLevel:q,startTime:I,expirationTime:A,sortIndex:-1},I>_?(q.sortIndex=I,t(c,q),n(l)===null&&q===n(c)&&(b?(u(j),j=-1):b=!0,ee(S,I-_))):(q.sortIndex=A,t(l,q),g||y||(g=!0,Q(T))),q},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(q){var G=h;return function(){var I=h;h=G;try{return q.apply(this,arguments)}finally{h=I}}}})(Ty);ky.exports=Ty;var r0=ky.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 i0=P,qt=r0;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var _y=new Set,Hi={};function Yo(e,t){Ur(e,t),Ur(e+"Capture",t)}function Ur(e,t){for(Hi[e]=t,e=0;e<t.length;e++)_y.add(t[e])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=Object.prototype.hasOwnProperty,s0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_f={},jf={};function a0(e){return Rc.call(jf,e)?!0:Rc.call(_f,e)?!1:s0.test(e)?jf[e]=!0:(_f[e]=!0,!1)}function l0(e,t,n,o){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function c0(e,t,n,o){if(t===null||typeof t>"u"||l0(e,t,n,o))return!0;if(o)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $t(e,t,n,o,r,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ct[e]=new $t(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ct[t]=new $t(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ct[e]=new $t(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ct[e]=new $t(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ct[e]=new $t(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ct[e]=new $t(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ct[e]=new $t(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ct[e]=new $t(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ct[e]=new $t(e,5,!1,e.toLowerCase(),null,!1,!1)});var tu=/[\-:]([a-z])/g;function nu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(tu,nu);ct[t]=new $t(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(tu,nu);ct[t]=new $t(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(tu,nu);ct[t]=new $t(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ct[e]=new $t(e,1,!1,e.toLowerCase(),null,!1,!1)});ct.xlinkHref=new $t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ct[e]=new $t(e,1,!1,e.toLowerCase(),null,!0,!0)});function ou(e,t,n,o){var r=ct.hasOwnProperty(t)?ct[t]:null;(r!==null?r.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(c0(t,n,r,o)&&(n=null),o||r===null?a0(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,o=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,o?e.setAttributeNS(o,t,n):e.setAttribute(t,n))))}var Fn=i0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Os=Symbol.for("react.element"),pr=Symbol.for("react.portal"),fr=Symbol.for("react.fragment"),ru=Symbol.for("react.strict_mode"),Ac=Symbol.for("react.profiler"),jy=Symbol.for("react.provider"),Ny=Symbol.for("react.context"),iu=Symbol.for("react.forward_ref"),Mc=Symbol.for("react.suspense"),qc=Symbol.for("react.suspense_list"),su=Symbol.for("react.memo"),Zn=Symbol.for("react.lazy"),Cy=Symbol.for("react.offscreen"),Nf=Symbol.iterator;function si(e){return e===null||typeof e!="object"?null:(e=Nf&&e[Nf]||e["@@iterator"],typeof e=="function"?e:null)}var He=Object.assign,Kl;function wi(e){if(Kl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kl=t&&t[1]||""}return`
34
- `+Kl+e}var Gl=!1;function Jl(e,t){if(!e||Gl)return"";Gl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var o=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){o=c}e.call(t.prototype)}else{try{throw Error()}catch(c){o=c}e()}}catch(c){if(c&&o&&typeof c.stack=="string"){for(var r=c.stack.split(`
35
- `),i=o.stack.split(`
36
- `),s=r.length-1,a=i.length-1;1<=s&&0<=a&&r[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||r[s]!==i[a]){var l=`
37
- `+r[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Gl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wi(e):""}function d0(e){switch(e.tag){case 5:return wi(e.type);case 16:return wi("Lazy");case 13:return wi("Suspense");case 19:return wi("SuspenseList");case 0:case 2:case 15:return e=Jl(e.type,!1),e;case 11:return e=Jl(e.type.render,!1),e;case 1:return e=Jl(e.type,!0),e;default:return""}}function Uc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case fr:return"Fragment";case pr:return"Portal";case Ac:return"Profiler";case ru:return"StrictMode";case Mc:return"Suspense";case qc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ny:return(e.displayName||"Context")+".Consumer";case jy:return(e._context.displayName||"Context")+".Provider";case iu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case su:return t=e.displayName||null,t!==null?t:Uc(e.type)||"Memo";case Zn:t=e._payload,e=e._init;try{return Uc(e(t))}catch{}}return null}function u0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Uc(t);case 8:return t===ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function go(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ey(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p0(e){var t=Ey(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(s){o=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(s){o=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){e._valueTracker||(e._valueTracker=p0(e))}function Py(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=Ey(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function Ea(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Lc(e,t){var n=t.checked;return He({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cf(e,t){var n=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;n=go(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Iy(e,t){t=t.checked,t!=null&&ou(e,"checked",t,!1)}function Dc(e,t){Iy(e,t);var n=go(t.value),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zc(e,t.type,n):t.hasOwnProperty("defaultValue")&&zc(e,t.type,go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ef(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zc(e,t,n){(t!=="number"||Ea(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Si=Array.isArray;function Tr(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+go(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Fc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return He({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Si(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:go(n)}}function Oy(e,t){var n=go(t.value),o=go(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),o!=null&&(e.defaultValue=""+o)}function If(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ry(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Bc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ry(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var As,Ay=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,o,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,o,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(As=As||document.createElement("div"),As.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=As.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ji={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},f0=["Webkit","ms","Moz","O"];Object.keys(ji).forEach(function(e){f0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ji[t]=ji[e]})});function My(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ji.hasOwnProperty(e)&&ji[e]?(""+t).trim():t+"px"}function qy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=My(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var m0=He({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hc(e,t){if(t){if(m0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Vc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wc=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kc=null,_r=null,jr=null;function Of(e){if(e=Ts(e)){if(typeof Kc!="function")throw Error(H(280));var t=e.stateNode;t&&(t=vl(t),Kc(e.stateNode,e.type,t))}}function Uy(e){_r?jr?jr.push(e):jr=[e]:_r=e}function Ly(){if(_r){var e=_r,t=jr;if(jr=_r=null,Of(e),t)for(e=0;e<t.length;e++)Of(t[e])}}function Dy(e,t){return e(t)}function zy(){}var Ql=!1;function Fy(e,t,n){if(Ql)return e(t,n);Ql=!0;try{return Dy(e,t,n)}finally{Ql=!1,(_r!==null||jr!==null)&&(zy(),Ly())}}function Wi(e,t){var n=e.stateNode;if(n===null)return null;var o=vl(n);if(o===null)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var Gc=!1;if(qn)try{var ai={};Object.defineProperty(ai,"passive",{get:function(){Gc=!0}}),window.addEventListener("test",ai,ai),window.removeEventListener("test",ai,ai)}catch{Gc=!1}function h0(e,t,n,o,r,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var Ni=!1,Pa=null,Ia=!1,Jc=null,y0={onError:function(e){Ni=!0,Pa=e}};function g0(e,t,n,o,r,i,s,a,l){Ni=!1,Pa=null,h0.apply(y0,arguments)}function v0(e,t,n,o,r,i,s,a,l){if(g0.apply(this,arguments),Ni){if(Ni){var c=Pa;Ni=!1,Pa=null}else throw Error(H(198));Ia||(Ia=!0,Jc=c)}}function Xo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function By(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Rf(e){if(Xo(e)!==e)throw Error(H(188))}function b0(e){var t=e.alternate;if(!t){if(t=Xo(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return Rf(r),e;if(i===o)return Rf(r),t;i=i.sibling}throw Error(H(188))}if(n.return!==o.return)n=r,o=i;else{for(var s=!1,a=r.child;a;){if(a===n){s=!0,n=r,o=i;break}if(a===o){s=!0,o=r,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,o=r;break}if(a===o){s=!0,o=i,n=r;break}a=a.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==o)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Hy(e){return e=b0(e),e!==null?Vy(e):null}function Vy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Vy(e);if(t!==null)return t;e=e.sibling}return null}var Wy=qt.unstable_scheduleCallback,Af=qt.unstable_cancelCallback,x0=qt.unstable_shouldYield,w0=qt.unstable_requestPaint,Ge=qt.unstable_now,S0=qt.unstable_getCurrentPriorityLevel,lu=qt.unstable_ImmediatePriority,Ky=qt.unstable_UserBlockingPriority,Oa=qt.unstable_NormalPriority,$0=qt.unstable_LowPriority,Gy=qt.unstable_IdlePriority,ml=null,$n=null;function k0(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(ml,e,void 0,(e.current.flags&128)===128)}catch{}}var sn=Math.clz32?Math.clz32:j0,T0=Math.log,_0=Math.LN2;function j0(e){return e>>>=0,e===0?32:31-(T0(e)/_0|0)|0}var Ms=64,qs=4194304;function $i(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ra(e,t){var n=e.pendingLanes;if(n===0)return 0;var o=0,r=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~r;a!==0?o=$i(a):(i&=s,i!==0&&(o=$i(i)))}else s=n&~r,s!==0?o=$i(s):i!==0&&(o=$i(i));if(o===0)return 0;if(t!==0&&t!==o&&!(t&r)&&(r=o&-o,i=t&-t,r>=i||r===16&&(i&4194240)!==0))return t;if(o&4&&(o|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)n=31-sn(t),r=1<<n,o|=e[n],t&=~r;return o}function N0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function C0(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-sn(i),a=1<<s,l=r[s];l===-1?(!(a&n)||a&o)&&(r[s]=N0(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Qc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jy(){var e=Ms;return Ms<<=1,!(Ms&4194240)&&(Ms=64),e}function Yl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $s(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-sn(t),e[t]=n}function E0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-sn(n),i=1<<r;t[r]=0,o[r]=-1,e[r]=-1,n&=~i}}function cu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-sn(n),r=1<<o;r&t|e[o]&t&&(e[o]|=t),n&=~r}}var ke=0;function Qy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yy,du,Xy,Zy,eg,Yc=!1,Us=[],ao=null,lo=null,co=null,Ki=new Map,Gi=new Map,to=[],P0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Mf(e,t){switch(e){case"focusin":case"focusout":ao=null;break;case"dragenter":case"dragleave":lo=null;break;case"mouseover":case"mouseout":co=null;break;case"pointerover":case"pointerout":Ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gi.delete(t.pointerId)}}function li(e,t,n,o,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Ts(t),t!==null&&du(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function I0(e,t,n,o,r){switch(t){case"focusin":return ao=li(ao,e,t,n,o,r),!0;case"dragenter":return lo=li(lo,e,t,n,o,r),!0;case"mouseover":return co=li(co,e,t,n,o,r),!0;case"pointerover":var i=r.pointerId;return Ki.set(i,li(Ki.get(i)||null,e,t,n,o,r)),!0;case"gotpointercapture":return i=r.pointerId,Gi.set(i,li(Gi.get(i)||null,e,t,n,o,r)),!0}return!1}function tg(e){var t=Mo(e.target);if(t!==null){var n=Xo(t);if(n!==null){if(t=n.tag,t===13){if(t=By(n),t!==null){e.blockedOn=t,eg(e.priority,function(){Xy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function la(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);Wc=o,n.target.dispatchEvent(o),Wc=null}else return t=Ts(n),t!==null&&du(t),e.blockedOn=n,!1;t.shift()}return!0}function qf(e,t,n){la(e)&&n.delete(t)}function O0(){Yc=!1,ao!==null&&la(ao)&&(ao=null),lo!==null&&la(lo)&&(lo=null),co!==null&&la(co)&&(co=null),Ki.forEach(qf),Gi.forEach(qf)}function ci(e,t){e.blockedOn===t&&(e.blockedOn=null,Yc||(Yc=!0,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,O0)))}function Ji(e){function t(r){return ci(r,e)}if(0<Us.length){ci(Us[0],e);for(var n=1;n<Us.length;n++){var o=Us[n];o.blockedOn===e&&(o.blockedOn=null)}}for(ao!==null&&ci(ao,e),lo!==null&&ci(lo,e),co!==null&&ci(co,e),Ki.forEach(t),Gi.forEach(t),n=0;n<to.length;n++)o=to[n],o.blockedOn===e&&(o.blockedOn=null);for(;0<to.length&&(n=to[0],n.blockedOn===null);)tg(n),n.blockedOn===null&&to.shift()}var Nr=Fn.ReactCurrentBatchConfig,Aa=!0;function R0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=1,uu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function A0(e,t,n,o){var r=ke,i=Nr.transition;Nr.transition=null;try{ke=4,uu(e,t,n,o)}finally{ke=r,Nr.transition=i}}function uu(e,t,n,o){if(Aa){var r=Xc(e,t,n,o);if(r===null)ac(e,t,o,Ma,n),Mf(e,o);else if(I0(r,e,t,n,o))o.stopPropagation();else if(Mf(e,o),t&4&&-1<P0.indexOf(e)){for(;r!==null;){var i=Ts(r);if(i!==null&&Yy(i),i=Xc(e,t,n,o),i===null&&ac(e,t,o,Ma,n),i===r)break;r=i}r!==null&&o.stopPropagation()}else ac(e,t,o,null,n)}}var Ma=null;function Xc(e,t,n,o){if(Ma=null,e=au(o),e=Mo(e),e!==null)if(t=Xo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=By(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ma=e,null}function ng(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(S0()){case lu:return 1;case Ky:return 4;case Oa:case $0:return 16;case Gy:return 536870912;default:return 16}default:return 16}}var ro=null,pu=null,ca=null;function og(){if(ca)return ca;var e,t=pu,n=t.length,o,r="value"in ro?ro.value:ro.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var s=n-e;for(o=1;o<=s&&t[n-o]===r[i-o];o++);return ca=r.slice(e,1<o?1-o:void 0)}function da(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ls(){return!0}function Uf(){return!1}function Lt(e){function t(n,o,r,i,s){this._reactName=n,this._targetInst=r,this.type=o,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ls:Uf,this.isPropagationStopped=Uf,this}return He(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ls)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ls)},persist:function(){},isPersistent:Ls}),t}var Jr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fu=Lt(Jr),ks=He({},Jr,{view:0,detail:0}),M0=Lt(ks),Xl,Zl,di,hl=He({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==di&&(di&&e.type==="mousemove"?(Xl=e.screenX-di.screenX,Zl=e.screenY-di.screenY):Zl=Xl=0,di=e),Xl)},movementY:function(e){return"movementY"in e?e.movementY:Zl}}),Lf=Lt(hl),q0=He({},hl,{dataTransfer:0}),U0=Lt(q0),L0=He({},ks,{relatedTarget:0}),ec=Lt(L0),D0=He({},Jr,{animationName:0,elapsedTime:0,pseudoElement:0}),z0=Lt(D0),F0=He({},Jr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),B0=Lt(F0),H0=He({},Jr,{data:0}),Df=Lt(H0),V0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},K0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=K0[e])?!!t[e]:!1}function mu(){return G0}var J0=He({},ks,{key:function(e){if(e.key){var t=V0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=da(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?W0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mu,charCode:function(e){return e.type==="keypress"?da(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?da(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Q0=Lt(J0),Y0=He({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zf=Lt(Y0),X0=He({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mu}),Z0=Lt(X0),ew=He({},Jr,{propertyName:0,elapsedTime:0,pseudoElement:0}),tw=Lt(ew),nw=He({},hl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ow=Lt(nw),rw=[9,13,27,32],hu=qn&&"CompositionEvent"in window,Ci=null;qn&&"documentMode"in document&&(Ci=document.documentMode);var iw=qn&&"TextEvent"in window&&!Ci,rg=qn&&(!hu||Ci&&8<Ci&&11>=Ci),Ff=" ",Bf=!1;function ig(e,t){switch(e){case"keyup":return rw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function sw(e,t){switch(e){case"compositionend":return sg(t);case"keypress":return t.which!==32?null:(Bf=!0,Ff);case"textInput":return e=t.data,e===Ff&&Bf?null:e;default:return null}}function aw(e,t){if(mr)return e==="compositionend"||!hu&&ig(e,t)?(e=og(),ca=pu=ro=null,mr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return rg&&t.locale!=="ko"?null:t.data;default:return null}}var lw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lw[e.type]:t==="textarea"}function ag(e,t,n,o){Uy(o),t=qa(t,"onChange"),0<t.length&&(n=new fu("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Ei=null,Qi=null;function cw(e){vg(e,0)}function yl(e){var t=gr(e);if(Py(t))return e}function dw(e,t){if(e==="change")return t}var lg=!1;if(qn){var tc;if(qn){var nc="oninput"in document;if(!nc){var Vf=document.createElement("div");Vf.setAttribute("oninput","return;"),nc=typeof Vf.oninput=="function"}tc=nc}else tc=!1;lg=tc&&(!document.documentMode||9<document.documentMode)}function Wf(){Ei&&(Ei.detachEvent("onpropertychange",cg),Qi=Ei=null)}function cg(e){if(e.propertyName==="value"&&yl(Qi)){var t=[];ag(t,Qi,e,au(e)),Fy(cw,t)}}function uw(e,t,n){e==="focusin"?(Wf(),Ei=t,Qi=n,Ei.attachEvent("onpropertychange",cg)):e==="focusout"&&Wf()}function pw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yl(Qi)}function fw(e,t){if(e==="click")return yl(t)}function mw(e,t){if(e==="input"||e==="change")return yl(t)}function hw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:hw;function Yi(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var r=n[o];if(!Rc.call(t,r)||!dn(e[r],t[r]))return!1}return!0}function Kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gf(e,t){var n=Kf(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kf(n)}}function dg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ug(){for(var e=window,t=Ea();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ea(e.document)}return t}function yu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yw(e){var t=ug(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dg(n.ownerDocument.documentElement,n)){if(o!==null&&yu(n)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!e.extend&&i>o&&(r=o,o=i,i=r),r=Gf(n,i);var s=Gf(n,o);r&&s&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var gw=qn&&"documentMode"in document&&11>=document.documentMode,hr=null,Zc=null,Pi=null,ed=!1;function Jf(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ed||hr==null||hr!==Ea(o)||(o=hr,"selectionStart"in o&&yu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Pi&&Yi(Pi,o)||(Pi=o,o=qa(Zc,"onSelect"),0<o.length&&(t=new fu("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=hr)))}function Ds(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yr={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionend:Ds("Transition","TransitionEnd")},oc={},pg={};qn&&(pg=document.createElement("div").style,"AnimationEvent"in window||(delete yr.animationend.animation,delete yr.animationiteration.animation,delete yr.animationstart.animation),"TransitionEvent"in window||delete yr.transitionend.transition);function gl(e){if(oc[e])return oc[e];if(!yr[e])return e;var t=yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pg)return oc[e]=t[n];return e}var fg=gl("animationend"),mg=gl("animationiteration"),hg=gl("animationstart"),yg=gl("transitionend"),gg=new Map,Qf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xo(e,t){gg.set(e,t),Yo(t,[e])}for(var rc=0;rc<Qf.length;rc++){var ic=Qf[rc],vw=ic.toLowerCase(),bw=ic[0].toUpperCase()+ic.slice(1);xo(vw,"on"+bw)}xo(fg,"onAnimationEnd");xo(mg,"onAnimationIteration");xo(hg,"onAnimationStart");xo("dblclick","onDoubleClick");xo("focusin","onFocus");xo("focusout","onBlur");xo(yg,"onTransitionEnd");Ur("onMouseEnter",["mouseout","mouseover"]);Ur("onMouseLeave",["mouseout","mouseover"]);Ur("onPointerEnter",["pointerout","pointerover"]);Ur("onPointerLeave",["pointerout","pointerover"]);Yo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Yo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Yo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Yo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Yo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Yo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ki="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xw=new Set("cancel close invalid load scroll toggle".split(" ").concat(ki));function Yf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,v0(o,t,void 0,e),e.currentTarget=null}function vg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],r=o.event;o=o.listeners;e:{var i=void 0;if(t)for(var s=o.length-1;0<=s;s--){var a=o[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&r.isPropagationStopped())break e;Yf(r,a,c),i=l}else for(s=0;s<o.length;s++){if(a=o[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&r.isPropagationStopped())break e;Yf(r,a,c),i=l}}}if(Ia)throw e=Jc,Ia=!1,Jc=null,e}function Oe(e,t){var n=t[id];n===void 0&&(n=t[id]=new Set);var o=e+"__bubble";n.has(o)||(bg(t,e,2,!1),n.add(o))}function sc(e,t,n){var o=0;t&&(o|=4),bg(n,e,o,t)}var zs="_reactListening"+Math.random().toString(36).slice(2);function Xi(e){if(!e[zs]){e[zs]=!0,_y.forEach(function(n){n!=="selectionchange"&&(xw.has(n)||sc(n,!1,e),sc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zs]||(t[zs]=!0,sc("selectionchange",!1,t))}}function bg(e,t,n,o){switch(ng(t)){case 1:var r=R0;break;case 4:r=A0;break;default:r=uu}n=r.bind(null,t,n,e),r=void 0,!Gc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),o?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function ac(e,t,n,o,r){var i=o;if(!(t&1)&&!(t&2)&&o!==null)e:for(;;){if(o===null)return;var s=o.tag;if(s===3||s===4){var a=o.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=o.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=Mo(a),s===null)return;if(l=s.tag,l===5||l===6){o=i=s;continue e}a=a.parentNode}}o=o.return}Fy(function(){var c=i,f=au(n),m=[];e:{var h=gg.get(e);if(h!==void 0){var y=fu,g=e;switch(e){case"keypress":if(da(n)===0)break e;case"keydown":case"keyup":y=Q0;break;case"focusin":g="focus",y=ec;break;case"focusout":g="blur",y=ec;break;case"beforeblur":case"afterblur":y=ec;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=U0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Z0;break;case fg:case mg:case hg:y=z0;break;case yg:y=tw;break;case"scroll":y=M0;break;case"wheel":y=ow;break;case"copy":case"cut":case"paste":y=B0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=zf}var b=(t&4)!==0,v=!b&&e==="scroll",u=b?h!==null?h+"Capture":null:h;b=[];for(var p=c,x;p!==null;){x=p;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,u!==null&&(S=Wi(p,u),S!=null&&b.push(Zi(p,S,x)))),v)break;p=p.return}0<b.length&&(h=new y(h,g,null,n,f),m.push({event:h,listeners:b}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",h&&n!==Wc&&(g=n.relatedTarget||n.fromElement)&&(Mo(g)||g[Un]))break e;if((y||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,y?(g=n.relatedTarget||n.toElement,y=c,g=g?Mo(g):null,g!==null&&(v=Xo(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(y=null,g=c),y!==g)){if(b=Lf,S="onMouseLeave",u="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(b=zf,S="onPointerLeave",u="onPointerEnter",p="pointer"),v=y==null?h:gr(y),x=g==null?h:gr(g),h=new b(S,p+"leave",y,n,f),h.target=v,h.relatedTarget=x,S=null,Mo(f)===c&&(b=new b(u,p+"enter",g,n,f),b.target=x,b.relatedTarget=v,S=b),v=S,y&&g)t:{for(b=y,u=g,p=0,x=b;x;x=or(x))p++;for(x=0,S=u;S;S=or(S))x++;for(;0<p-x;)b=or(b),p--;for(;0<x-p;)u=or(u),x--;for(;p--;){if(b===u||u!==null&&b===u.alternate)break t;b=or(b),u=or(u)}b=null}else b=null;y!==null&&Xf(m,h,y,b,!1),g!==null&&v!==null&&Xf(m,v,g,b,!0)}}e:{if(h=c?gr(c):window,y=h.nodeName&&h.nodeName.toLowerCase(),y==="select"||y==="input"&&h.type==="file")var T=dw;else if(Hf(h))if(lg)T=mw;else{T=pw;var C=uw}else(y=h.nodeName)&&y.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(T=fw);if(T&&(T=T(e,c))){ag(m,T,n,f);break e}C&&C(e,h,c),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&zc(h,"number",h.value)}switch(C=c?gr(c):window,e){case"focusin":(Hf(C)||C.contentEditable==="true")&&(hr=C,Zc=c,Pi=null);break;case"focusout":Pi=Zc=hr=null;break;case"mousedown":ed=!0;break;case"contextmenu":case"mouseup":case"dragend":ed=!1,Jf(m,n,f);break;case"selectionchange":if(gw)break;case"keydown":case"keyup":Jf(m,n,f)}var $;if(hu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else mr?ig(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(rg&&n.locale!=="ko"&&(mr||j!=="onCompositionStart"?j==="onCompositionEnd"&&mr&&($=og()):(ro=f,pu="value"in ro?ro.value:ro.textContent,mr=!0)),C=qa(c,j),0<C.length&&(j=new Df(j,e,null,n,f),m.push({event:j,listeners:C}),$?j.data=$:($=sg(n),$!==null&&(j.data=$)))),($=iw?sw(e,n):aw(e,n))&&(c=qa(c,"onBeforeInput"),0<c.length&&(f=new Df("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:c}),f.data=$))}vg(m,t)})}function Zi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qa(e,t){for(var n=t+"Capture",o=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Wi(e,n),i!=null&&o.unshift(Zi(e,i,r)),i=Wi(e,t),i!=null&&o.push(Zi(e,i,r))),e=e.return}return o}function or(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xf(e,t,n,o,r){for(var i=t._reactName,s=[];n!==null&&n!==o;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===o)break;a.tag===5&&c!==null&&(a=c,r?(l=Wi(n,i),l!=null&&s.unshift(Zi(n,l,a))):r||(l=Wi(n,i),l!=null&&s.push(Zi(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ww=/\r\n?/g,Sw=/\u0000|\uFFFD/g;function Zf(e){return(typeof e=="string"?e:""+e).replace(ww,`
38
- `).replace(Sw,"")}function Fs(e,t,n){if(t=Zf(t),Zf(e)!==t&&n)throw Error(H(425))}function Ua(){}var td=null,nd=null;function od(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var rd=typeof setTimeout=="function"?setTimeout:void 0,$w=typeof clearTimeout=="function"?clearTimeout:void 0,em=typeof Promise=="function"?Promise:void 0,kw=typeof queueMicrotask=="function"?queueMicrotask:typeof em<"u"?function(e){return em.resolve(null).then(e).catch(Tw)}:rd;function Tw(e){setTimeout(function(){throw e})}function lc(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(o===0){e.removeChild(r),Ji(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);Ji(t)}function uo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Qr=Math.random().toString(36).slice(2),gn="__reactFiber$"+Qr,es="__reactProps$"+Qr,Un="__reactContainer$"+Qr,id="__reactEvents$"+Qr,_w="__reactListeners$"+Qr,jw="__reactHandles$"+Qr;function Mo(e){var t=e[gn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Un]||n[gn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tm(e);e!==null;){if(n=e[gn])return n;e=tm(e)}return t}e=n,n=e.parentNode}return null}function Ts(e){return e=e[gn]||e[Un],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function gr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function vl(e){return e[es]||null}var sd=[],vr=-1;function wo(e){return{current:e}}function qe(e){0>vr||(e.current=sd[vr],sd[vr]=null,vr--)}function Ce(e,t){vr++,sd[vr]=e.current,e.current=t}var vo={},gt=wo(vo),Nt=wo(!1),Bo=vo;function Lr(e,t){var n=e.type.contextTypes;if(!n)return vo;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Ct(e){return e=e.childContextTypes,e!=null}function La(){qe(Nt),qe(gt)}function nm(e,t,n){if(gt.current!==vo)throw Error(H(168));Ce(gt,t),Ce(Nt,n)}function xg(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in t))throw Error(H(108,u0(e)||"Unknown",r));return He({},n,o)}function Da(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vo,Bo=gt.current,Ce(gt,e),Ce(Nt,Nt.current),!0}function om(e,t,n){var o=e.stateNode;if(!o)throw Error(H(169));n?(e=xg(e,t,Bo),o.__reactInternalMemoizedMergedChildContext=e,qe(Nt),qe(gt),Ce(gt,e)):qe(Nt),Ce(Nt,n)}var Cn=null,bl=!1,cc=!1;function wg(e){Cn===null?Cn=[e]:Cn.push(e)}function Nw(e){bl=!0,wg(e)}function So(){if(!cc&&Cn!==null){cc=!0;var e=0,t=ke;try{var n=Cn;for(ke=1;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}Cn=null,bl=!1}catch(r){throw Cn!==null&&(Cn=Cn.slice(e+1)),Wy(lu,So),r}finally{ke=t,cc=!1}}return null}var br=[],xr=0,za=null,Fa=0,Ft=[],Bt=0,Ho=null,Pn=1,In="";function Co(e,t){br[xr++]=Fa,br[xr++]=za,za=e,Fa=t}function Sg(e,t,n){Ft[Bt++]=Pn,Ft[Bt++]=In,Ft[Bt++]=Ho,Ho=e;var o=Pn;e=In;var r=32-sn(o)-1;o&=~(1<<r),n+=1;var i=32-sn(t)+r;if(30<i){var s=r-r%5;i=(o&(1<<s)-1).toString(32),o>>=s,r-=s,Pn=1<<32-sn(t)+r|n<<r|o,In=i+e}else Pn=1<<i|n<<r|o,In=e}function gu(e){e.return!==null&&(Co(e,1),Sg(e,1,0))}function vu(e){for(;e===za;)za=br[--xr],br[xr]=null,Fa=br[--xr],br[xr]=null;for(;e===Ho;)Ho=Ft[--Bt],Ft[Bt]=null,In=Ft[--Bt],Ft[Bt]=null,Pn=Ft[--Bt],Ft[Bt]=null}var At=null,Ot=null,De=!1,on=null;function $g(e,t){var n=Ht(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function rm(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,At=e,Ot=uo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,At=e,Ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ho!==null?{id:Pn,overflow:In}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ht(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,At=e,Ot=null,!0):!1;default:return!1}}function ad(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ld(e){if(De){var t=Ot;if(t){var n=t;if(!rm(e,t)){if(ad(e))throw Error(H(418));t=uo(n.nextSibling);var o=At;t&&rm(e,t)?$g(o,n):(e.flags=e.flags&-4097|2,De=!1,At=e)}}else{if(ad(e))throw Error(H(418));e.flags=e.flags&-4097|2,De=!1,At=e}}}function im(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;At=e}function Bs(e){if(e!==At)return!1;if(!De)return im(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!od(e.type,e.memoizedProps)),t&&(t=Ot)){if(ad(e))throw kg(),Error(H(418));for(;t;)$g(e,t),t=uo(t.nextSibling)}if(im(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ot=uo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ot=null}}else Ot=At?uo(e.stateNode.nextSibling):null;return!0}function kg(){for(var e=Ot;e;)e=uo(e.nextSibling)}function Dr(){Ot=At=null,De=!1}function bu(e){on===null?on=[e]:on.push(e)}var Cw=Fn.ReactCurrentBatchConfig;function ui(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var o=n.stateNode}if(!o)throw Error(H(147,e));var r=o,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=r.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function Hs(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function sm(e){var t=e._init;return t(e._payload)}function Tg(e){function t(u,p){if(e){var x=u.deletions;x===null?(u.deletions=[p],u.flags|=16):x.push(p)}}function n(u,p){if(!e)return null;for(;p!==null;)t(u,p),p=p.sibling;return null}function o(u,p){for(u=new Map;p!==null;)p.key!==null?u.set(p.key,p):u.set(p.index,p),p=p.sibling;return u}function r(u,p){return u=ho(u,p),u.index=0,u.sibling=null,u}function i(u,p,x){return u.index=x,e?(x=u.alternate,x!==null?(x=x.index,x<p?(u.flags|=2,p):x):(u.flags|=2,p)):(u.flags|=1048576,p)}function s(u){return e&&u.alternate===null&&(u.flags|=2),u}function a(u,p,x,S){return p===null||p.tag!==6?(p=yc(x,u.mode,S),p.return=u,p):(p=r(p,x),p.return=u,p)}function l(u,p,x,S){var T=x.type;return T===fr?f(u,p,x.props.children,S,x.key):p!==null&&(p.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&sm(T)===p.type)?(S=r(p,x.props),S.ref=ui(u,p,x),S.return=u,S):(S=ga(x.type,x.key,x.props,null,u.mode,S),S.ref=ui(u,p,x),S.return=u,S)}function c(u,p,x,S){return p===null||p.tag!==4||p.stateNode.containerInfo!==x.containerInfo||p.stateNode.implementation!==x.implementation?(p=gc(x,u.mode,S),p.return=u,p):(p=r(p,x.children||[]),p.return=u,p)}function f(u,p,x,S,T){return p===null||p.tag!==7?(p=Fo(x,u.mode,S,T),p.return=u,p):(p=r(p,x),p.return=u,p)}function m(u,p,x){if(typeof p=="string"&&p!==""||typeof p=="number")return p=yc(""+p,u.mode,x),p.return=u,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Os:return x=ga(p.type,p.key,p.props,null,u.mode,x),x.ref=ui(u,null,p),x.return=u,x;case pr:return p=gc(p,u.mode,x),p.return=u,p;case Zn:var S=p._init;return m(u,S(p._payload),x)}if(Si(p)||si(p))return p=Fo(p,u.mode,x,null),p.return=u,p;Hs(u,p)}return null}function h(u,p,x,S){var T=p!==null?p.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return T!==null?null:a(u,p,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Os:return x.key===T?l(u,p,x,S):null;case pr:return x.key===T?c(u,p,x,S):null;case Zn:return T=x._init,h(u,p,T(x._payload),S)}if(Si(x)||si(x))return T!==null?null:f(u,p,x,S,null);Hs(u,x)}return null}function y(u,p,x,S,T){if(typeof S=="string"&&S!==""||typeof S=="number")return u=u.get(x)||null,a(p,u,""+S,T);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Os:return u=u.get(S.key===null?x:S.key)||null,l(p,u,S,T);case pr:return u=u.get(S.key===null?x:S.key)||null,c(p,u,S,T);case Zn:var C=S._init;return y(u,p,x,C(S._payload),T)}if(Si(S)||si(S))return u=u.get(x)||null,f(p,u,S,T,null);Hs(p,S)}return null}function g(u,p,x,S){for(var T=null,C=null,$=p,j=p=0,R=null;$!==null&&j<x.length;j++){$.index>j?(R=$,$=null):R=$.sibling;var M=h(u,$,x[j],S);if(M===null){$===null&&($=R);break}e&&$&&M.alternate===null&&t(u,$),p=i(M,p,j),C===null?T=M:C.sibling=M,C=M,$=R}if(j===x.length)return n(u,$),De&&Co(u,j),T;if($===null){for(;j<x.length;j++)$=m(u,x[j],S),$!==null&&(p=i($,p,j),C===null?T=$:C.sibling=$,C=$);return De&&Co(u,j),T}for($=o(u,$);j<x.length;j++)R=y($,u,j,x[j],S),R!==null&&(e&&R.alternate!==null&&$.delete(R.key===null?j:R.key),p=i(R,p,j),C===null?T=R:C.sibling=R,C=R);return e&&$.forEach(function(F){return t(u,F)}),De&&Co(u,j),T}function b(u,p,x,S){var T=si(x);if(typeof T!="function")throw Error(H(150));if(x=T.call(x),x==null)throw Error(H(151));for(var C=T=null,$=p,j=p=0,R=null,M=x.next();$!==null&&!M.done;j++,M=x.next()){$.index>j?(R=$,$=null):R=$.sibling;var F=h(u,$,M.value,S);if(F===null){$===null&&($=R);break}e&&$&&F.alternate===null&&t(u,$),p=i(F,p,j),C===null?T=F:C.sibling=F,C=F,$=R}if(M.done)return n(u,$),De&&Co(u,j),T;if($===null){for(;!M.done;j++,M=x.next())M=m(u,M.value,S),M!==null&&(p=i(M,p,j),C===null?T=M:C.sibling=M,C=M);return De&&Co(u,j),T}for($=o(u,$);!M.done;j++,M=x.next())M=y($,u,j,M.value,S),M!==null&&(e&&M.alternate!==null&&$.delete(M.key===null?j:M.key),p=i(M,p,j),C===null?T=M:C.sibling=M,C=M);return e&&$.forEach(function(V){return t(u,V)}),De&&Co(u,j),T}function v(u,p,x,S){if(typeof x=="object"&&x!==null&&x.type===fr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Os:e:{for(var T=x.key,C=p;C!==null;){if(C.key===T){if(T=x.type,T===fr){if(C.tag===7){n(u,C.sibling),p=r(C,x.props.children),p.return=u,u=p;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Zn&&sm(T)===C.type){n(u,C.sibling),p=r(C,x.props),p.ref=ui(u,C,x),p.return=u,u=p;break e}n(u,C);break}else t(u,C);C=C.sibling}x.type===fr?(p=Fo(x.props.children,u.mode,S,x.key),p.return=u,u=p):(S=ga(x.type,x.key,x.props,null,u.mode,S),S.ref=ui(u,p,x),S.return=u,u=S)}return s(u);case pr:e:{for(C=x.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===x.containerInfo&&p.stateNode.implementation===x.implementation){n(u,p.sibling),p=r(p,x.children||[]),p.return=u,u=p;break e}else{n(u,p);break}else t(u,p);p=p.sibling}p=gc(x,u.mode,S),p.return=u,u=p}return s(u);case Zn:return C=x._init,v(u,p,C(x._payload),S)}if(Si(x))return g(u,p,x,S);if(si(x))return b(u,p,x,S);Hs(u,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,p!==null&&p.tag===6?(n(u,p.sibling),p=r(p,x),p.return=u,u=p):(n(u,p),p=yc(x,u.mode,S),p.return=u,u=p),s(u)):n(u,p)}return v}var zr=Tg(!0),_g=Tg(!1),Ba=wo(null),Ha=null,wr=null,xu=null;function wu(){xu=wr=Ha=null}function Su(e){var t=Ba.current;qe(Ba),e._currentValue=t}function cd(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function Cr(e,t){Ha=e,xu=wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(jt=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(xu!==e)if(e={context:e,memoizedValue:t,next:null},wr===null){if(Ha===null)throw Error(H(308));wr=e,Ha.dependencies={lanes:0,firstContext:e}}else wr=wr.next=e;return t}var qo=null;function $u(e){qo===null?qo=[e]:qo.push(e)}function jg(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,$u(t)):(n.next=r.next,r.next=n),t.interleaved=n,Ln(e,o)}function Ln(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var eo=!1;function ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ng(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,be&2){var r=o.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),o.pending=t,Ln(e,n)}return r=o.interleaved,r===null?(t.next=t,$u(o)):(t.next=r.next,r.next=t),o.interleaved=t,Ln(e,n)}function ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,cu(e,n)}}function am(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:o.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Va(e,t,n,o){var r=e.updateQueue;eo=!1;var i=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(i!==null){var m=r.baseState;s=0,f=c=l=null,a=i;do{var h=a.lane,y=a.eventTime;if((o&h)===h){f!==null&&(f=f.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,b=a;switch(h=t,y=n,b.tag){case 1:if(g=b.payload,typeof g=="function"){m=g.call(y,m,h);break e}m=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(y,m,h):g,h==null)break e;m=He({},m,h);break e;case 2:eo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else y={eventTime:y,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=y,l=m):f=f.next=y,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(f===null&&(l=m),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=f,t=r.shared.interleaved,t!==null){r=t;do s|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);Wo|=s,e.lanes=s,e.memoizedState=m}}function lm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],r=o.callback;if(r!==null){if(o.callback=null,o=n,typeof r!="function")throw Error(H(191,r));r.call(o)}}}var _s={},kn=wo(_s),ts=wo(_s),ns=wo(_s);function Uo(e){if(e===_s)throw Error(H(174));return e}function Tu(e,t){switch(Ce(ns,t),Ce(ts,e),Ce(kn,_s),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bc(t,e)}qe(kn),Ce(kn,t)}function Fr(){qe(kn),qe(ts),qe(ns)}function Cg(e){Uo(ns.current);var t=Uo(kn.current),n=Bc(t,e.type);t!==n&&(Ce(ts,e),Ce(kn,n))}function _u(e){ts.current===e&&(qe(kn),qe(ts))}var Fe=wo(0);function Wa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var dc=[];function ju(){for(var e=0;e<dc.length;e++)dc[e]._workInProgressVersionPrimary=null;dc.length=0}var pa=Fn.ReactCurrentDispatcher,uc=Fn.ReactCurrentBatchConfig,Vo=0,Be=null,Xe=null,ot=null,Ka=!1,Ii=!1,os=0,Ew=0;function dt(){throw Error(H(321))}function Nu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dn(e[n],t[n]))return!1;return!0}function Cu(e,t,n,o,r,i){if(Vo=i,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,pa.current=e===null||e.memoizedState===null?Rw:Aw,e=n(o,r),Ii){i=0;do{if(Ii=!1,os=0,25<=i)throw Error(H(301));i+=1,ot=Xe=null,t.updateQueue=null,pa.current=Mw,e=n(o,r)}while(Ii)}if(pa.current=Ga,t=Xe!==null&&Xe.next!==null,Vo=0,ot=Xe=Be=null,Ka=!1,t)throw Error(H(300));return e}function Eu(){var e=os!==0;return os=0,e}function hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Be.memoizedState=ot=e:ot=ot.next=e,ot}function Qt(){if(Xe===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=ot===null?Be.memoizedState:ot.next;if(t!==null)ot=t,Xe=e;else{if(e===null)throw Error(H(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},ot===null?Be.memoizedState=ot=e:ot=ot.next=e}return ot}function rs(e,t){return typeof t=="function"?t(e):t}function pc(e){var t=Qt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var o=Xe,r=o.baseQueue,i=n.pending;if(i!==null){if(r!==null){var s=r.next;r.next=i.next,i.next=s}o.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,o=o.baseState;var a=s=null,l=null,c=i;do{var f=c.lane;if((Vo&f)===f)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var m={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=m,s=o):l=l.next=m,Be.lanes|=f,Wo|=f}c=c.next}while(c!==null&&c!==i);l===null?s=o:l.next=a,dn(o,t.memoizedState)||(jt=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=l,n.lastRenderedState=o}if(e=n.interleaved,e!==null){r=e;do i=r.lane,Be.lanes|=i,Wo|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fc(e){var t=Qt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var o=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do i=e(i,s.action),s=s.next;while(s!==r);dn(i,t.memoizedState)||(jt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,o]}function Eg(){}function Pg(e,t){var n=Be,o=Qt(),r=t(),i=!dn(o.memoizedState,r);if(i&&(o.memoizedState=r,jt=!0),o=o.queue,Pu(Rg.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||ot!==null&&ot.memoizedState.tag&1){if(n.flags|=2048,is(9,Og.bind(null,n,o,r,t),void 0,null),rt===null)throw Error(H(349));Vo&30||Ig(n,t,r)}return r}function Ig(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Og(e,t,n,o){t.value=n,t.getSnapshot=o,Ag(t)&&Mg(e)}function Rg(e,t,n){return n(function(){Ag(t)&&Mg(e)})}function Ag(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function Mg(e){var t=Ln(e,1);t!==null&&an(t,e,1,-1)}function cm(e){var t=hn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:e},t.queue=e,e=e.dispatch=Ow.bind(null,Be,e),[t.memoizedState,e]}function is(e,t,n,o){return e={tag:e,create:t,destroy:n,deps:o,next:null},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e)),e}function qg(){return Qt().memoizedState}function fa(e,t,n,o){var r=hn();Be.flags|=e,r.memoizedState=is(1|t,n,void 0,o===void 0?null:o)}function xl(e,t,n,o){var r=Qt();o=o===void 0?null:o;var i=void 0;if(Xe!==null){var s=Xe.memoizedState;if(i=s.destroy,o!==null&&Nu(o,s.deps)){r.memoizedState=is(t,n,i,o);return}}Be.flags|=e,r.memoizedState=is(1|t,n,i,o)}function dm(e,t){return fa(8390656,8,e,t)}function Pu(e,t){return xl(2048,8,e,t)}function Ug(e,t){return xl(4,2,e,t)}function Lg(e,t){return xl(4,4,e,t)}function Dg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zg(e,t,n){return n=n!=null?n.concat([e]):null,xl(4,4,Dg.bind(null,t,e),n)}function Iu(){}function Fg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Nu(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function Bg(e,t){var n=Qt();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Nu(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function Hg(e,t,n){return Vo&21?(dn(n,t)||(n=Jy(),Be.lanes|=n,Wo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=n)}function Pw(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var o=uc.transition;uc.transition={};try{e(!1),t()}finally{ke=n,uc.transition=o}}function Vg(){return Qt().memoizedState}function Iw(e,t,n){var o=mo(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},Wg(e))Kg(t,n);else if(n=jg(e,t,n,o),n!==null){var r=wt();an(n,e,o,r),Gg(n,t,o)}}function Ow(e,t,n){var o=mo(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wg(e))Kg(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(r.hasEagerState=!0,r.eagerState=a,dn(a,s)){var l=t.interleaved;l===null?(r.next=r,$u(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=jg(e,t,r,o),n!==null&&(r=wt(),an(n,e,o,r),Gg(n,t,o))}}function Wg(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Kg(e,t){Ii=Ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gg(e,t,n){if(n&4194240){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,cu(e,n)}}var Ga={readContext:Jt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},Rw={readContext:Jt,useCallback:function(e,t){return hn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:dm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fa(4194308,4,Dg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fa(4194308,4,e,t)},useInsertionEffect:function(e,t){return fa(4,2,e,t)},useMemo:function(e,t){var n=hn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var o=hn();return t=n!==void 0?n(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=Iw.bind(null,Be,e),[o.memoizedState,e]},useRef:function(e){var t=hn();return e={current:e},t.memoizedState=e},useState:cm,useDebugValue:Iu,useDeferredValue:function(e){return hn().memoizedState=e},useTransition:function(){var e=cm(!1),t=e[0];return e=Pw.bind(null,e[1]),hn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=Be,r=hn();if(De){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),rt===null)throw Error(H(349));Vo&30||Ig(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,dm(Rg.bind(null,o,i,e),[e]),o.flags|=2048,is(9,Og.bind(null,o,i,n,t),void 0,null),n},useId:function(){var e=hn(),t=rt.identifierPrefix;if(De){var n=In,o=Pn;n=(o&~(1<<32-sn(o)-1)).toString(32)+n,t=":"+t+"R"+n,n=os++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Ew++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Aw={readContext:Jt,useCallback:Fg,useContext:Jt,useEffect:Pu,useImperativeHandle:zg,useInsertionEffect:Ug,useLayoutEffect:Lg,useMemo:Bg,useReducer:pc,useRef:qg,useState:function(){return pc(rs)},useDebugValue:Iu,useDeferredValue:function(e){var t=Qt();return Hg(t,Xe.memoizedState,e)},useTransition:function(){var e=pc(rs)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Eg,useSyncExternalStore:Pg,useId:Vg,unstable_isNewReconciler:!1},Mw={readContext:Jt,useCallback:Fg,useContext:Jt,useEffect:Pu,useImperativeHandle:zg,useInsertionEffect:Ug,useLayoutEffect:Lg,useMemo:Bg,useReducer:fc,useRef:qg,useState:function(){return fc(rs)},useDebugValue:Iu,useDeferredValue:function(e){var t=Qt();return Xe===null?t.memoizedState=e:Hg(t,Xe.memoizedState,e)},useTransition:function(){var e=fc(rs)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Eg,useSyncExternalStore:Pg,useId:Vg,unstable_isNewReconciler:!1};function tn(e,t){if(e&&e.defaultProps){t=He({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function dd(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:He({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wl={isMounted:function(e){return(e=e._reactInternals)?Xo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var o=wt(),r=mo(e),i=Rn(o,r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(an(t,e,r,o),ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=wt(),r=mo(e),i=Rn(o,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(an(t,e,r,o),ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),o=mo(e),r=Rn(n,o);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,o),t!==null&&(an(t,e,o,n),ua(t,e,o))}};function um(e,t,n,o,r,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,i,s):t.prototype&&t.prototype.isPureReactComponent?!Yi(n,o)||!Yi(r,i):!0}function Jg(e,t,n){var o=!1,r=vo,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(r=Ct(t)?Bo:gt.current,o=t.contextTypes,i=(o=o!=null)?Lr(e,r):vo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wl,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function pm(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&wl.enqueueReplaceState(t,t.state,null)}function ud(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},ku(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Jt(i):(i=Ct(t)?Bo:gt.current,r.context=Lr(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(dd(e,t,i,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&wl.enqueueReplaceState(r,r.state,null),Va(e,n,r,o),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function Br(e,t){try{var n="",o=t;do n+=d0(o),o=o.return;while(o);var r=n}catch(i){r=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:r,digest:null}}function mc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function pd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var qw=typeof WeakMap=="function"?WeakMap:Map;function Qg(e,t,n){n=Rn(-1,n),n.tag=3,n.payload={element:null};var o=t.value;return n.callback=function(){Qa||(Qa=!0,Sd=o),pd(e,t)},n}function Yg(e,t,n){n=Rn(-1,n),n.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var r=t.value;n.payload=function(){return o(r)},n.callback=function(){pd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){pd(e,t),typeof o!="function"&&(fo===null?fo=new Set([this]):fo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function fm(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new qw;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(r.add(n),e=Yw.bind(null,e,t,n),t.then(e,e))}function mm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hm(e,t,n,o,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Rn(-1,1),t.tag=2,po(n,t,1))),n.lanes|=1),e)}var Uw=Fn.ReactCurrentOwner,jt=!1;function vt(e,t,n,o){t.child=e===null?_g(t,null,n,o):zr(t,e.child,n,o)}function ym(e,t,n,o,r){n=n.render;var i=t.ref;return Cr(t,r),o=Cu(e,t,n,o,i,r),n=Eu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&n&&gu(t),t.flags|=1,vt(e,t,o,r),t.child)}function gm(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!Du(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Xg(e,t,i,o,r)):(e=ga(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&r)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Yi,n(s,o)&&e.ref===t.ref)return Dn(e,t,r)}return t.flags|=1,e=ho(i,o),e.ref=t.ref,e.return=t,t.child=e}function Xg(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(Yi(i,o)&&e.ref===t.ref)if(jt=!1,t.pendingProps=o=i,(e.lanes&r)!==0)e.flags&131072&&(jt=!0);else return t.lanes=e.lanes,Dn(e,t,r)}return fd(e,t,n,o,r)}function Zg(e,t,n){var o=t.pendingProps,r=o.children,i=e!==null?e.memoizedState:null;if(o.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce($r,Pt),Pt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ce($r,Pt),Pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Ce($r,Pt),Pt|=o}else i!==null?(o=i.baseLanes|n,t.memoizedState=null):o=n,Ce($r,Pt),Pt|=o;return vt(e,t,r,n),t.child}function ev(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fd(e,t,n,o,r){var i=Ct(n)?Bo:gt.current;return i=Lr(t,i),Cr(t,r),n=Cu(e,t,n,o,i,r),o=Eu(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Dn(e,t,r)):(De&&o&&gu(t),t.flags|=1,vt(e,t,n,r),t.child)}function vm(e,t,n,o,r){if(Ct(n)){var i=!0;Da(t)}else i=!1;if(Cr(t,r),t.stateNode===null)ma(e,t),Jg(t,n,o),ud(t,n,o,r),o=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Jt(c):(c=Ct(n)?Bo:gt.current,c=Lr(t,c));var f=n.getDerivedStateFromProps,m=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==o||l!==c)&&pm(t,s,o,c),eo=!1;var h=t.memoizedState;s.state=h,Va(t,o,s,r),l=t.memoizedState,a!==o||h!==l||Nt.current||eo?(typeof f=="function"&&(dd(t,n,f,o),l=t.memoizedState),(a=eo||um(t,n,a,o,h,l,c))?(m||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=l),s.props=o,s.state=l,s.context=c,o=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{s=t.stateNode,Ng(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:tn(t.type,a),s.props=c,m=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ct(n)?Bo:gt.current,l=Lr(t,l));var y=n.getDerivedStateFromProps;(f=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==m||h!==l)&&pm(t,s,o,l),eo=!1,h=t.memoizedState,s.state=h,Va(t,o,s,r);var g=t.memoizedState;a!==m||h!==g||Nt.current||eo?(typeof y=="function"&&(dd(t,n,y,o),g=t.memoizedState),(c=eo||um(t,n,c,o,h,g,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(o,g,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(o,g,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=g),s.props=o,s.state=g,s.context=l,o=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),o=!1)}return md(e,t,n,o,i,r)}function md(e,t,n,o,r,i){ev(e,t);var s=(t.flags&128)!==0;if(!o&&!s)return r&&om(t,n,!1),Dn(e,t,i);o=t.stateNode,Uw.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&s?(t.child=zr(t,e.child,null,i),t.child=zr(t,null,a,i)):vt(e,t,a,i),t.memoizedState=o.state,r&&om(t,n,!0),t.child}function tv(e){var t=e.stateNode;t.pendingContext?nm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nm(e,t.context,!1),Tu(e,t.containerInfo)}function bm(e,t,n,o,r){return Dr(),bu(r),t.flags|=256,vt(e,t,n,o),t.child}var hd={dehydrated:null,treeContext:null,retryLane:0};function yd(e){return{baseLanes:e,cachePool:null,transitions:null}}function nv(e,t,n){var o=t.pendingProps,r=Fe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Ce(Fe,r&1),e===null)return ld(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=o.children,e=o.fallback,i?(o=t.mode,i=t.child,s={mode:"hidden",children:s},!(o&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=kl(s,o,0,null),e=Fo(e,o,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=yd(n),t.memoizedState=hd,e):Ou(t,s));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Lw(e,t,s,o,a,r,n);if(i){i=o.fallback,s=t.mode,r=e.child,a=r.sibling;var l={mode:"hidden",children:o.children};return!(s&1)&&t.child!==r?(o=t.child,o.childLanes=0,o.pendingProps=l,t.deletions=null):(o=ho(r,l),o.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=ho(a,i):(i=Fo(i,s,n,null),i.flags|=2),i.return=t,o.return=t,o.sibling=i,t.child=o,o=i,i=t.child,s=e.child.memoizedState,s=s===null?yd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=hd,o}return i=e.child,e=i.sibling,o=ho(i,{mode:"visible",children:o.children}),!(t.mode&1)&&(o.lanes=n),o.return=t,o.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Ou(e,t){return t=kl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vs(e,t,n,o){return o!==null&&bu(o),zr(t,e.child,null,n),e=Ou(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lw(e,t,n,o,r,i,s){if(n)return t.flags&256?(t.flags&=-257,o=mc(Error(H(422))),Vs(e,t,s,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=o.fallback,r=t.mode,o=kl({mode:"visible",children:o.children},r,0,null),i=Fo(i,r,s,null),i.flags|=2,o.return=t,i.return=t,o.sibling=i,t.child=o,t.mode&1&&zr(t,e.child,null,s),t.child.memoizedState=yd(s),t.memoizedState=hd,i);if(!(t.mode&1))return Vs(e,t,s,null);if(r.data==="$!"){if(o=r.nextSibling&&r.nextSibling.dataset,o)var a=o.dgst;return o=a,i=Error(H(419)),o=mc(i,o,void 0),Vs(e,t,s,o)}if(a=(s&e.childLanes)!==0,jt||a){if(o=rt,o!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(o.suspendedLanes|s)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Ln(e,r),an(o,e,r,-1))}return Lu(),o=mc(Error(H(421))),Vs(e,t,s,o)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Xw.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,Ot=uo(r.nextSibling),At=t,De=!0,on=null,e!==null&&(Ft[Bt++]=Pn,Ft[Bt++]=In,Ft[Bt++]=Ho,Pn=e.id,In=e.overflow,Ho=t),t=Ou(t,o.children),t.flags|=4096,t)}function xm(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),cd(e.return,t,n)}function hc(e,t,n,o,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r)}function ov(e,t,n){var o=t.pendingProps,r=o.revealOrder,i=o.tail;if(vt(e,t,o.children,n),o=Fe.current,o&2)o=o&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xm(e,n,t);else if(e.tag===19)xm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(Ce(Fe,o),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Wa(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),hc(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Wa(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}hc(t,!0,n,null,i);break;case"together":hc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ma(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=ho(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ho(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dw(e,t,n){switch(t.tag){case 3:tv(t),Dr();break;case 5:Cg(t);break;case 1:Ct(t.type)&&Da(t);break;case 4:Tu(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,r=t.memoizedProps.value;Ce(Ba,o._currentValue),o._currentValue=r;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Ce(Fe,Fe.current&1),t.flags|=128,null):n&t.child.childLanes?nv(e,t,n):(Ce(Fe,Fe.current&1),e=Dn(e,t,n),e!==null?e.sibling:null);Ce(Fe,Fe.current&1);break;case 19:if(o=(n&t.childLanes)!==0,e.flags&128){if(o)return ov(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ce(Fe,Fe.current),o)break;return null;case 22:case 23:return t.lanes=0,Zg(e,t,n)}return Dn(e,t,n)}var rv,gd,iv,sv;rv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gd=function(){};iv=function(e,t,n,o){var r=e.memoizedProps;if(r!==o){e=t.stateNode,Uo(kn.current);var i=null;switch(n){case"input":r=Lc(e,r),o=Lc(e,o),i=[];break;case"select":r=He({},r,{value:void 0}),o=He({},o,{value:void 0}),i=[];break;case"textarea":r=Fc(e,r),o=Fc(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=Ua)}Hc(n,o);var s;n=null;for(c in r)if(!o.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Hi.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in o){var l=o[c];if(a=r!=null?r[c]:void 0,o.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Hi.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Oe("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};sv=function(e,t,n,o){n!==o&&(t.flags|=4)};function pi(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&14680064,o|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function zw(e,t,n){var o=t.pendingProps;switch(vu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return Ct(t.type)&&La(),ut(t),null;case 3:return o=t.stateNode,Fr(),qe(Nt),qe(gt),ju(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Bs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,on!==null&&(Td(on),on=null))),gd(e,t),ut(t),null;case 5:_u(t);var r=Uo(ns.current);if(n=t.type,e!==null&&t.stateNode!=null)iv(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(H(166));return ut(t),null}if(e=Uo(kn.current),Bs(t)){o=t.stateNode,n=t.type;var i=t.memoizedProps;switch(o[gn]=t,o[es]=i,e=(t.mode&1)!==0,n){case"dialog":Oe("cancel",o),Oe("close",o);break;case"iframe":case"object":case"embed":Oe("load",o);break;case"video":case"audio":for(r=0;r<ki.length;r++)Oe(ki[r],o);break;case"source":Oe("error",o);break;case"img":case"image":case"link":Oe("error",o),Oe("load",o);break;case"details":Oe("toggle",o);break;case"input":Cf(o,i),Oe("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",o);break;case"textarea":Pf(o,i),Oe("invalid",o)}Hc(n,i),r=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?o.textContent!==a&&(i.suppressHydrationWarning!==!0&&Fs(o.textContent,a,e),r=["children",a]):typeof a=="number"&&o.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Fs(o.textContent,a,e),r=["children",""+a]):Hi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Oe("scroll",o)}switch(n){case"input":Rs(o),Ef(o,i,!0);break;case"textarea":Rs(o),If(o);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(o.onclick=Ua)}o=r,t.updateQueue=o,o!==null&&(t.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ry(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=s.createElement(n,{is:o.is}):(e=s.createElement(n),n==="select"&&(s=e,o.multiple?s.multiple=!0:o.size&&(s.size=o.size))):e=s.createElementNS(e,n),e[gn]=t,e[es]=o,rv(e,t,!1,!1),t.stateNode=e;e:{switch(s=Vc(n,o),n){case"dialog":Oe("cancel",e),Oe("close",e),r=o;break;case"iframe":case"object":case"embed":Oe("load",e),r=o;break;case"video":case"audio":for(r=0;r<ki.length;r++)Oe(ki[r],e);r=o;break;case"source":Oe("error",e),r=o;break;case"img":case"image":case"link":Oe("error",e),Oe("load",e),r=o;break;case"details":Oe("toggle",e),r=o;break;case"input":Cf(e,o),r=Lc(e,o),Oe("invalid",e);break;case"option":r=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},r=He({},o,{value:void 0}),Oe("invalid",e);break;case"textarea":Pf(e,o),r=Fc(e,o),Oe("invalid",e);break;default:r=o}Hc(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?qy(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ay(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Vi(e,l):typeof l=="number"&&Vi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Hi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Oe("scroll",e):l!=null&&ou(e,i,l,s))}switch(n){case"input":Rs(e),Ef(e,o,!1);break;case"textarea":Rs(e),If(e);break;case"option":o.value!=null&&e.setAttribute("value",""+go(o.value));break;case"select":e.multiple=!!o.multiple,i=o.value,i!=null?Tr(e,!!o.multiple,i,!1):o.defaultValue!=null&&Tr(e,!!o.multiple,o.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Ua)}switch(n){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ut(t),null;case 6:if(e&&t.stateNode!=null)sv(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(H(166));if(n=Uo(ns.current),Uo(kn.current),Bs(t)){if(o=t.stateNode,n=t.memoizedProps,o[gn]=t,(i=o.nodeValue!==n)&&(e=At,e!==null))switch(e.tag){case 3:Fs(o.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fs(o.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else o=(n.nodeType===9?n:n.ownerDocument).createTextNode(o),o[gn]=t,t.stateNode=o}return ut(t),null;case 13:if(qe(Fe),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&Ot!==null&&t.mode&1&&!(t.flags&128))kg(),Dr(),t.flags|=98560,i=!1;else if(i=Bs(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[gn]=t}else Dr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),i=!1}else on!==null&&(Td(on),on=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,t.mode&1&&(e===null||Fe.current&1?tt===0&&(tt=3):Lu())),t.updateQueue!==null&&(t.flags|=4),ut(t),null);case 4:return Fr(),gd(e,t),e===null&&Xi(t.stateNode.containerInfo),ut(t),null;case 10:return Su(t.type._context),ut(t),null;case 17:return Ct(t.type)&&La(),ut(t),null;case 19:if(qe(Fe),i=t.memoizedState,i===null)return ut(t),null;if(o=(t.flags&128)!==0,s=i.rendering,s===null)if(o)pi(i,!1);else{if(tt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Wa(e),s!==null){for(t.flags|=128,pi(i,!1),o=s.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=n,n=t.child;n!==null;)i=n,e=o,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ce(Fe,Fe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ge()>Hr&&(t.flags|=128,o=!0,pi(i,!1),t.lanes=4194304)}else{if(!o)if(e=Wa(s),e!==null){if(t.flags|=128,o=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!De)return ut(t),null}else 2*Ge()-i.renderingStartTime>Hr&&n!==1073741824&&(t.flags|=128,o=!0,pi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ge(),t.sibling=null,n=Fe.current,Ce(Fe,o?n&1|2:n&1),t):(ut(t),null);case 22:case 23:return Uu(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?Pt&1073741824&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function Fw(e,t){switch(vu(t),t.tag){case 1:return Ct(t.type)&&La(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fr(),qe(Nt),qe(gt),ju(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _u(t),null;case 13:if(qe(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));Dr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Fe),null;case 4:return Fr(),null;case 10:return Su(t.type._context),null;case 22:case 23:return Uu(),null;case 24:return null;default:return null}}var Ws=!1,mt=!1,Bw=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Sr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Ve(e,t,o)}else n.current=null}function vd(e,t,n){try{n()}catch(o){Ve(e,t,o)}}var wm=!1;function Hw(e,t){if(td=Aa,e=ug(),yu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,f=0,m=e,h=null;t:for(;;){for(var y;m!==n||r!==0&&m.nodeType!==3||(a=s+r),m!==i||o!==0&&m.nodeType!==3||(l=s+o),m.nodeType===3&&(s+=m.nodeValue.length),(y=m.firstChild)!==null;)h=m,m=y;for(;;){if(m===e)break t;if(h===n&&++c===r&&(a=s),h===i&&++f===o&&(l=s),(y=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(nd={focusedElem:e,selectionRange:n},Aa=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,v=g.memoizedState,u=t.stateNode,p=u.getSnapshotBeforeUpdate(t.elementType===t.type?b:tn(t.type,b),v);u.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Ve(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return g=wm,wm=!1,g}function Oi(e,t,n){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&e)===e){var i=r.destroy;r.destroy=void 0,i!==void 0&&vd(t,n,i)}r=r.next}while(r!==o)}}function Sl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var o=n.create;n.destroy=o()}n=n.next}while(n!==t)}}function bd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function av(e){var t=e.alternate;t!==null&&(e.alternate=null,av(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gn],delete t[es],delete t[id],delete t[_w],delete t[jw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function lv(e){return e.tag===5||e.tag===3||e.tag===4}function Sm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ua));else if(o!==4&&(e=e.child,e!==null))for(xd(e,t,n),e=e.sibling;e!==null;)xd(e,t,n),e=e.sibling}function wd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(wd(e,t,n),e=e.sibling;e!==null;)wd(e,t,n),e=e.sibling}var st=null,nn=!1;function Wn(e,t,n){for(n=n.child;n!==null;)cv(e,t,n),n=n.sibling}function cv(e,t,n){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(ml,n)}catch{}switch(n.tag){case 5:mt||Sr(n,t);case 6:var o=st,r=nn;st=null,Wn(e,t,n),st=o,nn=r,st!==null&&(nn?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(nn?(e=st,n=n.stateNode,e.nodeType===8?lc(e.parentNode,n):e.nodeType===1&&lc(e,n),Ji(e)):lc(st,n.stateNode));break;case 4:o=st,r=nn,st=n.stateNode.containerInfo,nn=!0,Wn(e,t,n),st=o,nn=r;break;case 0:case 11:case 14:case 15:if(!mt&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&vd(n,t,s),r=r.next}while(r!==o)}Wn(e,t,n);break;case 1:if(!mt&&(Sr(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(a){Ve(n,t,a)}Wn(e,t,n);break;case 21:Wn(e,t,n);break;case 22:n.mode&1?(mt=(o=mt)||n.memoizedState!==null,Wn(e,t,n),mt=o):Wn(e,t,n);break;default:Wn(e,t,n)}}function $m(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Bw),t.forEach(function(o){var r=Zw.bind(null,e,o);n.has(o)||(n.add(o),o.then(r,r))})}}function Xt(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var r=n[o];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:st=a.stateNode,nn=!1;break e;case 3:st=a.stateNode.containerInfo,nn=!0;break e;case 4:st=a.stateNode.containerInfo,nn=!0;break e}a=a.return}if(st===null)throw Error(H(160));cv(i,s,r),st=null,nn=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){Ve(r,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dv(t,e),t=t.sibling}function dv(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Xt(t,e),fn(e),o&4){try{Oi(3,e,e.return),Sl(3,e)}catch(b){Ve(e,e.return,b)}try{Oi(5,e,e.return)}catch(b){Ve(e,e.return,b)}}break;case 1:Xt(t,e),fn(e),o&512&&n!==null&&Sr(n,n.return);break;case 5:if(Xt(t,e),fn(e),o&512&&n!==null&&Sr(n,n.return),e.flags&32){var r=e.stateNode;try{Vi(r,"")}catch(b){Ve(e,e.return,b)}}if(o&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Iy(r,i),Vc(a,s);var c=Vc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],m=l[s+1];f==="style"?qy(r,m):f==="dangerouslySetInnerHTML"?Ay(r,m):f==="children"?Vi(r,m):ou(r,f,m,c)}switch(a){case"input":Dc(r,i);break;case"textarea":Oy(r,i);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Tr(r,!!i.multiple,y,!1):h!==!!i.multiple&&(i.defaultValue!=null?Tr(r,!!i.multiple,i.defaultValue,!0):Tr(r,!!i.multiple,i.multiple?[]:"",!1))}r[es]=i}catch(b){Ve(e,e.return,b)}}break;case 6:if(Xt(t,e),fn(e),o&4){if(e.stateNode===null)throw Error(H(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(b){Ve(e,e.return,b)}}break;case 3:if(Xt(t,e),fn(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{Ji(t.containerInfo)}catch(b){Ve(e,e.return,b)}break;case 4:Xt(t,e),fn(e);break;case 13:Xt(t,e),fn(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Mu=Ge())),o&4&&$m(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(mt=(c=mt)||f,Xt(t,e),mt=c):Xt(t,e),fn(e),o&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(Z=e,f=e.child;f!==null;){for(m=Z=f;Z!==null;){switch(h=Z,y=h.child,h.tag){case 0:case 11:case 14:case 15:Oi(4,h,h.return);break;case 1:Sr(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){o=h,n=h.return;try{t=o,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(b){Ve(o,n,b)}}break;case 5:Sr(h,h.return);break;case 22:if(h.memoizedState!==null){Tm(m);continue}}y!==null?(y.return=h,Z=y):Tm(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{r=m.stateNode,c?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=m.stateNode,l=m.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=My("display",s))}catch(b){Ve(e,e.return,b)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=c?"":m.memoizedProps}catch(b){Ve(e,e.return,b)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Xt(t,e),fn(e),o&4&&$m(e);break;case 21:break;default:Xt(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(lv(n)){var o=n;break e}n=n.return}throw Error(H(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(Vi(r,""),o.flags&=-33);var i=Sm(e);wd(e,i,r);break;case 3:case 4:var s=o.stateNode.containerInfo,a=Sm(e);xd(e,a,s);break;default:throw Error(H(161))}}catch(l){Ve(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vw(e,t,n){Z=e,uv(e)}function uv(e,t,n){for(var o=(e.mode&1)!==0;Z!==null;){var r=Z,i=r.child;if(r.tag===22&&o){var s=r.memoizedState!==null||Ws;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||mt;a=Ws;var c=mt;if(Ws=s,(mt=l)&&!c)for(Z=r;Z!==null;)s=Z,l=s.child,s.tag===22&&s.memoizedState!==null?_m(r):l!==null?(l.return=s,Z=l):_m(r);for(;i!==null;)Z=i,uv(i),i=i.sibling;Z=r,Ws=a,mt=c}km(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,Z=i):km(e)}}function km(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mt||Sl(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!mt)if(n===null)o.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:tn(t.type,n.memoizedProps);o.componentDidUpdate(r,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&lm(t,i,o);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lm(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Ji(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}mt||t.flags&512&&bd(t)}catch(h){Ve(t,t.return,h)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Tm(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function _m(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sl(4,t)}catch(l){Ve(t,n,l)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var r=t.return;try{o.componentDidMount()}catch(l){Ve(t,r,l)}}var i=t.return;try{bd(t)}catch(l){Ve(t,i,l)}break;case 5:var s=t.return;try{bd(t)}catch(l){Ve(t,s,l)}}}catch(l){Ve(t,t.return,l)}if(t===e){Z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Z=a;break}Z=t.return}}var Ww=Math.ceil,Ja=Fn.ReactCurrentDispatcher,Ru=Fn.ReactCurrentOwner,Gt=Fn.ReactCurrentBatchConfig,be=0,rt=null,Je=null,lt=0,Pt=0,$r=wo(0),tt=0,ss=null,Wo=0,$l=0,Au=0,Ri=null,_t=null,Mu=0,Hr=1/0,Nn=null,Qa=!1,Sd=null,fo=null,Ks=!1,io=null,Ya=0,Ai=0,$d=null,ha=-1,ya=0;function wt(){return be&6?Ge():ha!==-1?ha:ha=Ge()}function mo(e){return e.mode&1?be&2&&lt!==0?lt&-lt:Cw.transition!==null?(ya===0&&(ya=Jy()),ya):(e=ke,e!==0||(e=window.event,e=e===void 0?16:ng(e.type)),e):1}function an(e,t,n,o){if(50<Ai)throw Ai=0,$d=null,Error(H(185));$s(e,n,o),(!(be&2)||e!==rt)&&(e===rt&&(!(be&2)&&($l|=n),tt===4&&no(e,lt)),Et(e,o),n===1&&be===0&&!(t.mode&1)&&(Hr=Ge()+500,bl&&So()))}function Et(e,t){var n=e.callbackNode;C0(e,t);var o=Ra(e,e===rt?lt:0);if(o===0)n!==null&&Af(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&Af(n),t===1)e.tag===0?Nw(jm.bind(null,e)):wg(jm.bind(null,e)),kw(function(){!(be&6)&&So()}),n=null;else{switch(Qy(o)){case 1:n=lu;break;case 4:n=Ky;break;case 16:n=Oa;break;case 536870912:n=Gy;break;default:n=Oa}n=bv(n,pv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function pv(e,t){if(ha=-1,ya=0,be&6)throw Error(H(327));var n=e.callbackNode;if(Er()&&e.callbackNode!==n)return null;var o=Ra(e,e===rt?lt:0);if(o===0)return null;if(o&30||o&e.expiredLanes||t)t=Xa(e,o);else{t=o;var r=be;be|=2;var i=mv();(rt!==e||lt!==t)&&(Nn=null,Hr=Ge()+500,zo(e,t));do try{Jw();break}catch(a){fv(e,a)}while(!0);wu(),Ja.current=i,be=r,Je!==null?t=0:(rt=null,lt=0,t=tt)}if(t!==0){if(t===2&&(r=Qc(e),r!==0&&(o=r,t=kd(e,r))),t===1)throw n=ss,zo(e,0),no(e,o),Et(e,Ge()),n;if(t===6)no(e,o);else{if(r=e.current.alternate,!(o&30)&&!Kw(r)&&(t=Xa(e,o),t===2&&(i=Qc(e),i!==0&&(o=i,t=kd(e,i))),t===1))throw n=ss,zo(e,0),no(e,o),Et(e,Ge()),n;switch(e.finishedWork=r,e.finishedLanes=o,t){case 0:case 1:throw Error(H(345));case 2:Eo(e,_t,Nn);break;case 3:if(no(e,o),(o&130023424)===o&&(t=Mu+500-Ge(),10<t)){if(Ra(e,0)!==0)break;if(r=e.suspendedLanes,(r&o)!==o){wt(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=rd(Eo.bind(null,e,_t,Nn),t);break}Eo(e,_t,Nn);break;case 4:if(no(e,o),(o&4194240)===o)break;for(t=e.eventTimes,r=-1;0<o;){var s=31-sn(o);i=1<<s,s=t[s],s>r&&(r=s),o&=~i}if(o=r,o=Ge()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Ww(o/1960))-o,10<o){e.timeoutHandle=rd(Eo.bind(null,e,_t,Nn),o);break}Eo(e,_t,Nn);break;case 5:Eo(e,_t,Nn);break;default:throw Error(H(329))}}}return Et(e,Ge()),e.callbackNode===n?pv.bind(null,e):null}function kd(e,t){var n=Ri;return e.current.memoizedState.isDehydrated&&(zo(e,t).flags|=256),e=Xa(e,t),e!==2&&(t=_t,_t=n,t!==null&&Td(t)),e}function Td(e){_t===null?_t=e:_t.push.apply(_t,e)}function Kw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var o=0;o<n.length;o++){var r=n[o],i=r.getSnapshot;r=r.value;try{if(!dn(i(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function no(e,t){for(t&=~Au,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-sn(t),o=1<<n;e[n]=-1,t&=~o}}function jm(e){if(be&6)throw Error(H(327));Er();var t=Ra(e,0);if(!(t&1))return Et(e,Ge()),null;var n=Xa(e,t);if(e.tag!==0&&n===2){var o=Qc(e);o!==0&&(t=o,n=kd(e,o))}if(n===1)throw n=ss,zo(e,0),no(e,t),Et(e,Ge()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eo(e,_t,Nn),Et(e,Ge()),null}function qu(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Hr=Ge()+500,bl&&So())}}function Ko(e){io!==null&&io.tag===0&&!(be&6)&&Er();var t=be;be|=1;var n=Gt.transition,o=ke;try{if(Gt.transition=null,ke=1,e)return e()}finally{ke=o,Gt.transition=n,be=t,!(be&6)&&So()}}function Uu(){Pt=$r.current,qe($r)}function zo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$w(n)),Je!==null)for(n=Je.return;n!==null;){var o=n;switch(vu(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&La();break;case 3:Fr(),qe(Nt),qe(gt),ju();break;case 5:_u(o);break;case 4:Fr();break;case 13:qe(Fe);break;case 19:qe(Fe);break;case 10:Su(o.type._context);break;case 22:case 23:Uu()}n=n.return}if(rt=e,Je=e=ho(e.current,null),lt=Pt=t,tt=0,ss=null,Au=$l=Wo=0,_t=Ri=null,qo!==null){for(t=0;t<qo.length;t++)if(n=qo[t],o=n.interleaved,o!==null){n.interleaved=null;var r=o.next,i=n.pending;if(i!==null){var s=i.next;i.next=r,o.next=s}n.pending=o}qo=null}return e}function fv(e,t){do{var n=Je;try{if(wu(),pa.current=Ga,Ka){for(var o=Be.memoizedState;o!==null;){var r=o.queue;r!==null&&(r.pending=null),o=o.next}Ka=!1}if(Vo=0,ot=Xe=Be=null,Ii=!1,os=0,Ru.current=null,n===null||n.return===null){tt=1,ss=t,Je=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=lt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,f=a,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var y=mm(s);if(y!==null){y.flags&=-257,hm(y,s,a,i,t),y.mode&1&&fm(i,c,t),t=y,l=c;var g=t.updateQueue;if(g===null){var b=new Set;b.add(l),t.updateQueue=b}else g.add(l);break e}else{if(!(t&1)){fm(i,c,t),Lu();break e}l=Error(H(426))}}else if(De&&a.mode&1){var v=mm(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),hm(v,s,a,i,t),bu(Br(l,a));break e}}i=l=Br(l,a),tt!==4&&(tt=2),Ri===null?Ri=[i]:Ri.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var u=Qg(i,l,t);am(i,u);break e;case 1:a=l;var p=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(fo===null||!fo.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=Yg(i,a,t);am(i,S);break e}}i=i.return}while(i!==null)}yv(n)}catch(T){t=T,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function mv(){var e=Ja.current;return Ja.current=Ga,e===null?Ga:e}function Lu(){(tt===0||tt===3||tt===2)&&(tt=4),rt===null||!(Wo&268435455)&&!($l&268435455)||no(rt,lt)}function Xa(e,t){var n=be;be|=2;var o=mv();(rt!==e||lt!==t)&&(Nn=null,zo(e,t));do try{Gw();break}catch(r){fv(e,r)}while(!0);if(wu(),be=n,Ja.current=o,Je!==null)throw Error(H(261));return rt=null,lt=0,tt}function Gw(){for(;Je!==null;)hv(Je)}function Jw(){for(;Je!==null&&!x0();)hv(Je)}function hv(e){var t=vv(e.alternate,e,Pt);e.memoizedProps=e.pendingProps,t===null?yv(e):Je=t,Ru.current=null}function yv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Fw(n,t),n!==null){n.flags&=32767,Je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tt=6,Je=null;return}}else if(n=zw(n,t,Pt),n!==null){Je=n;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);tt===0&&(tt=5)}function Eo(e,t,n){var o=ke,r=Gt.transition;try{Gt.transition=null,ke=1,Qw(e,t,n,o)}finally{Gt.transition=r,ke=o}return null}function Qw(e,t,n,o){do Er();while(io!==null);if(be&6)throw Error(H(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(E0(e,i),e===rt&&(Je=rt=null,lt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ks||(Ks=!0,bv(Oa,function(){return Er(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Gt.transition,Gt.transition=null;var s=ke;ke=1;var a=be;be|=4,Ru.current=null,Hw(e,n),dv(n,e),yw(nd),Aa=!!td,nd=td=null,e.current=n,Vw(n),w0(),be=a,ke=s,Gt.transition=i}else e.current=n;if(Ks&&(Ks=!1,io=e,Ya=r),i=e.pendingLanes,i===0&&(fo=null),k0(n.stateNode),Et(e,Ge()),t!==null)for(o=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],o(r.value,{componentStack:r.stack,digest:r.digest});if(Qa)throw Qa=!1,e=Sd,Sd=null,e;return Ya&1&&e.tag!==0&&Er(),i=e.pendingLanes,i&1?e===$d?Ai++:(Ai=0,$d=e):Ai=0,So(),null}function Er(){if(io!==null){var e=Qy(Ya),t=Gt.transition,n=ke;try{if(Gt.transition=null,ke=16>e?16:e,io===null)var o=!1;else{if(e=io,io=null,Ya=0,be&6)throw Error(H(331));var r=be;for(be|=4,Z=e.current;Z!==null;){var i=Z,s=i.child;if(Z.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Z=c;Z!==null;){var f=Z;switch(f.tag){case 0:case 11:case 15:Oi(8,f,i)}var m=f.child;if(m!==null)m.return=f,Z=m;else for(;Z!==null;){f=Z;var h=f.sibling,y=f.return;if(av(f),f===c){Z=null;break}if(h!==null){h.return=y,Z=h;break}Z=y}}}var g=i.alternate;if(g!==null){var b=g.child;if(b!==null){g.child=null;do{var v=b.sibling;b.sibling=null,b=v}while(b!==null)}}Z=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Z=s;else e:for(;Z!==null;){if(i=Z,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Oi(9,i,i.return)}var u=i.sibling;if(u!==null){u.return=i.return,Z=u;break e}Z=i.return}}var p=e.current;for(Z=p;Z!==null;){s=Z;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,Z=x;else e:for(s=p;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Sl(9,a)}}catch(T){Ve(a,a.return,T)}if(a===s){Z=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Z=S;break e}Z=a.return}}if(be=r,So(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(ml,e)}catch{}o=!0}return o}finally{ke=n,Gt.transition=t}}return!1}function Nm(e,t,n){t=Br(n,t),t=Qg(e,t,1),e=po(e,t,1),t=wt(),e!==null&&($s(e,1,t),Et(e,t))}function Ve(e,t,n){if(e.tag===3)Nm(e,e,n);else for(;t!==null;){if(t.tag===3){Nm(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fo===null||!fo.has(o))){e=Br(n,e),e=Yg(t,e,1),t=po(t,e,1),e=wt(),t!==null&&($s(t,1,e),Et(t,e));break}}t=t.return}}function Yw(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(lt&n)===n&&(tt===4||tt===3&&(lt&130023424)===lt&&500>Ge()-Mu?zo(e,0):Au|=n),Et(e,t)}function gv(e,t){t===0&&(e.mode&1?(t=qs,qs<<=1,!(qs&130023424)&&(qs=4194304)):t=1);var n=wt();e=Ln(e,t),e!==null&&($s(e,t,n),Et(e,n))}function Xw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gv(e,n)}function Zw(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(H(314))}o!==null&&o.delete(t),gv(e,n)}var vv;vv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)jt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return jt=!1,Dw(e,t,n);jt=!!(e.flags&131072)}else jt=!1,De&&t.flags&1048576&&Sg(t,Fa,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;ma(e,t),e=t.pendingProps;var r=Lr(t,gt.current);Cr(t,n),r=Cu(null,t,o,e,r,n);var i=Eu();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ct(o)?(i=!0,Da(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,ku(t),r.updater=wl,t.stateNode=r,r._reactInternals=t,ud(t,o,e,n),t=md(null,t,o,!0,i,n)):(t.tag=0,De&&i&&gu(t),vt(null,t,r,n),t=t.child),t;case 16:o=t.elementType;e:{switch(ma(e,t),e=t.pendingProps,r=o._init,o=r(o._payload),t.type=o,r=t.tag=tS(o),e=tn(o,e),r){case 0:t=fd(null,t,o,e,n);break e;case 1:t=vm(null,t,o,e,n);break e;case 11:t=ym(null,t,o,e,n);break e;case 14:t=gm(null,t,o,tn(o.type,e),n);break e}throw Error(H(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),fd(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),vm(e,t,o,r,n);case 3:e:{if(tv(t),e===null)throw Error(H(387));o=t.pendingProps,i=t.memoizedState,r=i.element,Ng(e,t),Va(t,o,null,n);var s=t.memoizedState;if(o=s.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=Br(Error(H(423)),t),t=bm(e,t,o,n,r);break e}else if(o!==r){r=Br(Error(H(424)),t),t=bm(e,t,o,n,r);break e}else for(Ot=uo(t.stateNode.containerInfo.firstChild),At=t,De=!0,on=null,n=_g(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dr(),o===r){t=Dn(e,t,n);break e}vt(e,t,o,n)}t=t.child}return t;case 5:return Cg(t),e===null&&ld(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,s=r.children,od(o,r)?s=null:i!==null&&od(o,i)&&(t.flags|=32),ev(e,t),vt(e,t,s,n),t.child;case 6:return e===null&&ld(t),null;case 13:return nv(e,t,n);case 4:return Tu(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=zr(t,null,o,n):vt(e,t,o,n),t.child;case 11:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),ym(e,t,o,r,n);case 7:return vt(e,t,t.pendingProps,n),t.child;case 8:return vt(e,t,t.pendingProps.children,n),t.child;case 12:return vt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,r=t.pendingProps,i=t.memoizedProps,s=r.value,Ce(Ba,o._currentValue),o._currentValue=s,i!==null)if(dn(i.value,s)){if(i.children===r.children&&!Nt.current){t=Dn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===o){if(i.tag===1){l=Rn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),cd(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),cd(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}vt(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,o=t.pendingProps.children,Cr(t,n),r=Jt(r),o=o(r),t.flags|=1,vt(e,t,o,n),t.child;case 14:return o=t.type,r=tn(o,t.pendingProps),r=tn(o.type,r),gm(e,t,o,r,n);case 15:return Xg(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:tn(o,r),ma(e,t),t.tag=1,Ct(o)?(e=!0,Da(t)):e=!1,Cr(t,n),Jg(t,o,r),ud(t,o,r,n),md(null,t,o,!0,e,n);case 19:return ov(e,t,n);case 22:return Zg(e,t,n)}throw Error(H(156,t.tag))};function bv(e,t){return Wy(e,t)}function eS(e,t,n,o){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,n,o){return new eS(e,t,n,o)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tS(e){if(typeof e=="function")return Du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===iu)return 11;if(e===su)return 14}return 2}function ho(e,t){var n=e.alternate;return n===null?(n=Ht(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ga(e,t,n,o,r,i){var s=2;if(o=e,typeof e=="function")Du(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case fr:return Fo(n.children,r,i,t);case ru:s=8,r|=8;break;case Ac:return e=Ht(12,n,t,r|2),e.elementType=Ac,e.lanes=i,e;case Mc:return e=Ht(13,n,t,r),e.elementType=Mc,e.lanes=i,e;case qc:return e=Ht(19,n,t,r),e.elementType=qc,e.lanes=i,e;case Cy:return kl(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jy:s=10;break e;case Ny:s=9;break e;case iu:s=11;break e;case su:s=14;break e;case Zn:s=16,o=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Ht(s,n,t,r),t.elementType=e,t.type=o,t.lanes=i,t}function Fo(e,t,n,o){return e=Ht(7,e,o,t),e.lanes=n,e}function kl(e,t,n,o){return e=Ht(22,e,o,t),e.elementType=Cy,e.lanes=n,e.stateNode={isHidden:!1},e}function yc(e,t,n){return e=Ht(6,e,null,t),e.lanes=n,e}function gc(e,t,n){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nS(e,t,n,o,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yl(0),this.expirationTimes=Yl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yl(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function zu(e,t,n,o,r,i,s,a,l){return e=new nS(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ht(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ku(i),e}function oS(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pr,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}function xv(e){if(!e)return vo;e=e._reactInternals;e:{if(Xo(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(Ct(n))return xg(e,n,t)}return t}function wv(e,t,n,o,r,i,s,a,l){return e=zu(n,o,!0,e,r,i,s,a,l),e.context=xv(null),n=e.current,o=wt(),r=mo(n),i=Rn(o,r),i.callback=t??null,po(n,i,r),e.current.lanes=r,$s(e,r,o),Et(e,o),e}function Tl(e,t,n,o){var r=t.current,i=wt(),s=mo(r);return n=xv(n),t.context===null?t.context=n:t.pendingContext=n,t=Rn(i,s),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=po(r,t,s),e!==null&&(an(e,r,s,i),ua(e,r,s)),s}function Za(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Cm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fu(e,t){Cm(e,t),(e=e.alternate)&&Cm(e,t)}function rS(){return null}var Sv=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bu(e){this._internalRoot=e}_l.prototype.render=Bu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Tl(e,t,null,null)};_l.prototype.unmount=Bu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ko(function(){Tl(null,e,null,null)}),t[Un]=null}};function _l(e){this._internalRoot=e}_l.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<to.length&&t!==0&&t<to[n].priority;n++);to.splice(n,0,e),n===0&&tg(e)}};function Hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Em(){}function iS(e,t,n,o,r){if(r){if(typeof o=="function"){var i=o;o=function(){var c=Za(s);i.call(c)}}var s=wv(t,o,e,0,null,!1,!1,"",Em);return e._reactRootContainer=s,e[Un]=s.current,Xi(e.nodeType===8?e.parentNode:e),Ko(),s}for(;r=e.lastChild;)e.removeChild(r);if(typeof o=="function"){var a=o;o=function(){var c=Za(l);a.call(c)}}var l=zu(e,0,!1,null,null,!1,!1,"",Em);return e._reactRootContainer=l,e[Un]=l.current,Xi(e.nodeType===8?e.parentNode:e),Ko(function(){Tl(t,l,n,o)}),l}function Nl(e,t,n,o,r){var i=n._reactRootContainer;if(i){var s=i;if(typeof r=="function"){var a=r;r=function(){var l=Za(s);a.call(l)}}Tl(t,s,e,r)}else s=iS(n,t,e,r,o);return Za(s)}Yy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$i(t.pendingLanes);n!==0&&(cu(t,n|1),Et(t,Ge()),!(be&6)&&(Hr=Ge()+500,So()))}break;case 13:Ko(function(){var o=Ln(e,1);if(o!==null){var r=wt();an(o,e,1,r)}}),Fu(e,1)}};du=function(e){if(e.tag===13){var t=Ln(e,134217728);if(t!==null){var n=wt();an(t,e,134217728,n)}Fu(e,134217728)}};Xy=function(e){if(e.tag===13){var t=mo(e),n=Ln(e,t);if(n!==null){var o=wt();an(n,e,t,o)}Fu(e,t)}};Zy=function(){return ke};eg=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};Kc=function(e,t,n){switch(t){case"input":if(Dc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var r=vl(o);if(!r)throw Error(H(90));Py(o),Dc(o,r)}}}break;case"textarea":Oy(e,n);break;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}};Dy=qu;zy=Ko;var sS={usingClientEntryPoint:!1,Events:[Ts,gr,vl,Uy,Ly,qu]},fi={findFiberByHostInstance:Mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},aS={bundleType:fi.bundleType,version:fi.version,rendererPackageName:fi.rendererPackageName,rendererConfig:fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hy(e),e===null?null:e.stateNode},findFiberByHostInstance:fi.findFiberByHostInstance||rS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{ml=Gs.inject(aS),$n=Gs}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sS;Ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hu(t))throw Error(H(200));return oS(e,t,null,n)};Ut.createRoot=function(e,t){if(!Hu(e))throw Error(H(299));var n=!1,o="",r=Sv;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=zu(e,1,!1,null,null,n,!1,o,r),e[Un]=t.current,Xi(e.nodeType===8?e.parentNode:e),new Bu(t)};Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Hy(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e){return Ko(e)};Ut.hydrate=function(e,t,n){if(!jl(t))throw Error(H(200));return Nl(null,e,t,!0,n)};Ut.hydrateRoot=function(e,t,n){if(!Hu(e))throw Error(H(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",s=Sv;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=wv(t,null,e,1,n??null,r,!1,i,s),e[Un]=t.current,Xi(e),o)for(e=0;e<o.length;e++)n=o[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new _l(t)};Ut.render=function(e,t,n){if(!jl(t))throw Error(H(200));return Nl(null,e,t,!1,n)};Ut.unmountComponentAtNode=function(e){if(!jl(e))throw Error(H(40));return e._reactRootContainer?(Ko(function(){Nl(null,null,e,!1,function(){e._reactRootContainer=null,e[Un]=null})}),!0):!1};Ut.unstable_batchedUpdates=qu;Ut.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!jl(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Nl(e,t,n,!1,o)};Ut.version="18.3.1-next-f1338f8080-20240426";function $v(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($v)}catch(e){console.error(e)}}$v(),$y.exports=Ut;var Vu=$y.exports;const lS=Qd(Vu);var Pm=Vu;Oc.createRoot=Pm.createRoot,Oc.hydrateRoot=Pm.hydrateRoot;const Im=e=>{let t;const n=new Set,o=(c,f)=>{const m=typeof c=="function"?c(t):c;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,h))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(o,r,a);return a},cS=e=>e?Im(e):Im,dS=e=>e;function uS(e,t=dS){const n=te.useSyncExternalStore(e.subscribe,te.useCallback(()=>t(e.getState()),[e,t]),te.useCallback(()=>t(e.getInitialState()),[e,t]));return te.useDebugValue(n),n}const Om=e=>{const t=cS(e),n=o=>uS(t,o);return Object.assign(n,t),n},Wu=e=>e?Om(e):Om;function pS(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const s=l=>l===null?null:JSON.parse(l,void 0),a=(i=n.getItem(r))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const _d=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return _d(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return _d(o)(n)}}}},fS=(e,t)=>(n,o,r)=>{let i={storage:pS(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,u)=>({...u,...v}),...t},s=!1,a=0;const l=new Set,c=new Set;let f=i.storage;if(!f)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},o,r);const m=()=>{const v=i.partialize({...o()});return f.setItem(i.name,{state:v,version:i.version})},h=r.setState;r.setState=(v,u)=>(h(v,u),m());const y=e((...v)=>(n(...v),m()),o,r);r.getInitialState=()=>y;let g;const b=()=>{var v,u;if(!f)return;const p=++a;s=!1,l.forEach(S=>{var T;return S((T=o())!=null?T:y)});const x=((u=i.onRehydrateStorage)==null?void 0:u.call(i,(v=o())!=null?v:y))||void 0;return _d(f.getItem.bind(f))(i.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==i.version){if(i.migrate){const T=i.migrate(S.state,S.version);return T instanceof Promise?T.then(C=>[!0,C]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var T;if(p!==a)return;const[C,$]=S;if(g=i.merge($,(T=o())!=null?T:y),n(g,!0),C)return m()}).then(()=>{p===a&&(x==null||x(o(),void 0),g=o(),s=!0,c.forEach(S=>S(g)))}).catch(S=>{p===a&&(x==null||x(void 0,S))})};return r.persist={setOptions:v=>{i={...i,...v},v.storage&&(f=v.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:v=>(l.add(v),()=>{l.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},i.skipHydration||b(),g||y},mS=fS,as=["editor-to-agent","agent-to-editor"],ls=["request","response","notification","error","unknown"],hS={directions:new Set(as),kinds:new Set(ls),search:"",showStreams:!0};function yS(e){var n,o;if(e.kind!=="notification"||e.method!=="session/update")return!1;const t=(n=e.payload)==null?void 0:n.params;return((o=t==null?void 0:t.update)==null?void 0:o.sessionUpdate)==="agent_message_chunk"}const ne=Wu()(mS(e=>({session:null,messages:[],connection:"idle",lastError:null,selectedSeq:null,replayDone:!1,filters:hS,playback:{cap:null,playing:!1,speed:1},detailTab:"tree",clearedUpToSeq:null,handleEvent:t=>{switch(t.type){case"session.start":e(n=>{const o=n.session!==null&&n.session.id===t.session.id,r=n.session===null,i=o||r;return{session:t.session,messages:[],selectedSeq:i?n.selectedSeq:null,replayDone:!1,clearedUpToSeq:i?n.clearedUpToSeq:null,playback:i?n.playback:{...n.playback,cap:null,playing:!1}}});return;case"message":e(n=>n.clearedUpToSeq!==null&&t.message.seq<=n.clearedUpToSeq?{}:{messages:[...n.messages,t.message]});return;case"replay.done":e({replayDone:!0});return;case"session.end":e({session:t.session});return}},setConnection:(t,n=null)=>e({connection:t,lastError:n}),select:t=>e({selectedSeq:t}),setSearch:t=>e(n=>({filters:{...n.filters,search:t}})),toggleDirection:t=>e(n=>{const o=new Set(n.filters.directions);return o.has(t)?o.delete(t):o.add(t),{filters:{...n.filters,directions:o}}}),toggleKind:t=>e(n=>{const o=new Set(n.filters.kinds);return o.has(t)?o.delete(t):o.add(t),{filters:{...n.filters,kinds:o}}}),toggleStreams:()=>e(t=>({filters:{...t.filters,showStreams:!t.filters.showStreams}})),setPlaybackCap:t=>e(n=>({playback:{...n.playback,cap:t}})),setPlaying:t=>e(n=>({playback:{...n.playback,playing:t}})),setPlaybackSpeed:t=>e(n=>({playback:{...n.playback,speed:t}})),setDetailTab:t=>e({detailTab:t}),appendMessages:t=>{t.length!==0&&e(n=>{const o=n.clearedUpToSeq!==null?t.filter(r=>r.seq>n.clearedUpToSeq):t;return o.length===0?n:{messages:[...n.messages,...o]}})},loadFromExport:t=>{e({session:{id:t.session.id,name:t.session.name,agentCommand:t.session.agentCommand,startedAt:t.session.startedAt,endedAt:t.session.endedAt,clientName:t.session.clientName,importedAt:t.exportedAt,clientVersion:null,clientPlatform:null,agentName:null,agentVersion:null,protocolVersion:null,currentMode:null,currentModel:null,agentCapabilitiesJson:null},messages:t.messages,selectedSeq:null,replayDone:!0,clearedUpToSeq:null,playback:{cap:null,playing:!1,speed:1},connection:"idle",lastError:null})},clear:()=>e(t=>{const n=t.messages.length>0?t.messages[t.messages.length-1].seq:t.clearedUpToSeq;return{messages:[],selectedSeq:null,clearedUpToSeq:n}})}),{name:"acp.messages.v1",partialize:e=>({filters:{directions:[...e.filters.directions],kinds:[...e.filters.kinds],showStreams:e.filters.showStreams}}),merge:(e,t)=>{const n=e;return n!=null&&n.filters?{...t,filters:{...t.filters,directions:new Set(n.filters.directions),kinds:new Set(n.filters.kinds),showStreams:n.filters.showStreams}}:t}}));function gS(e,t,n=null){const o=t.search.trim().toLowerCase();return e.filter(r=>{if(n!==null&&r.seq>n||!t.directions.has(r.direction))return!1;if(yS(r)){if(!t.showStreams)return!1}else if(!t.kinds.has(r.kind))return!1;return!(o&&!r.raw.toLowerCase().includes(o))})}function vS(e,t){return t===null?null:e.find(n=>n.seq===t)??null}function Cl(e){const t=new Map,n=new Map;for(const o of e){if(o.rpcId===void 0||o.rpcId===null)continue;const r=String(o.rpcId);if(o.kind==="request")t.set(r,o.seq);else if(o.kind==="response"||o.kind==="error"){const i=t.get(r);i!==void 0&&n.set(o.seq,i)}}return n}const kv="ws://127.0.0.1:3737",bS=1500,xS=12e3;let En=null,Mi=null,el=0,cs=!1,Ku=kv,Rm=!1,Pr=[],jd=!1;function Nd(){if(jd=!1,Pr.length===0)return;const e=Pr;Pr=[],ne.getState().appendMessages(e)}function wS(){jd||(jd=!0,typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Nd):Promise.resolve().then(Nd))}function Am(){if(cs)return;const e=Math.min(xS,bS*Math.pow(1.6,el));el+=1,Mi=setTimeout(()=>{Mi=null,Gu(Ku)},e)}function Gu(e=kv){if(En){try{En.close()}catch{}En=null}Pr=[],cs=!1,Ku=e;const t=ne.getState();t.connection!=="connecting"&&t.setConnection("connecting");let n;try{n=new WebSocket(e)}catch(o){const r=o instanceof Error?o.message:String(o);t.setConnection("connecting",r),Am();return}En=n,n.addEventListener("open",()=>{el=0,Rm=!0,ne.getState().setConnection("open")}),n.addEventListener("message",o=>{try{const r=JSON.parse(o.data);if(r.type==="message"){Pr.push(r.message),wS();return}Pr.length>0&&Nd(),ne.getState().handleEvent(r)}catch(r){console.warn("acp-devtools: invalid WS frame",r)}}),n.addEventListener("error",()=>{}),n.addEventListener("close",()=>{if(En===n&&(En=null),cs){ne.getState().setConnection("closed");return}const o=ne.getState();if(Rm&&o.replayDone){o.setConnection("idle");return}o.setConnection("connecting"),Am()})}function Cd(){if(cs=!0,Mi&&(clearTimeout(Mi),Mi=null),En){try{En.close()}catch{}En=null}ne.getState().setConnection("idle")}function SS(){Cd(),cs=!1,el=0,Gu(Ku)}async function $S(e){const t=await fetch(`/api/sessions/${e}/messages`,{headers:{accept:"application/json"}});if(!t.ok){const n=await Ju(t);throw new Error(n)}return await t.json()}async function Tv(){const e=await fetch("/api/sessions",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`sessions: HTTP ${e.status}`);return(await e.json()).sessions??[]}async function _v(e){const t=await e.text(),n=await fetch("/api/import",{method:"POST",headers:{"content-type":"application/json","x-acp-source-filename":jS(e.name)},body:t});if(!n.ok){const o=await Ju(n);throw new Error(o)}return await n.json()}async function kS(e){const t=await fetch(`/api/sessions/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404){const n=await Ju(t);throw new Error(n)}}function tl(e){return`ws://${window.location.host}/replay/${e}`}function TS(e){return e!==null&&/\/replay\/\d+$/.test(e)}function _S(e){const t=e.match(/\/replay\/(\d+)$/);return t?Number(t[1]):null}async function Ju(e){try{const t=await e.json();if(t.error)return t.error}catch{}return`HTTP ${e.status} ${e.statusText}`}function jS(e){return e.replace(/[^\x20-\x7E]/g,"?").slice(0,200)}const Ed="acp.discovery.selectedUrl";function NS(){try{return localStorage.getItem(Ed)}catch{return null}}function CS(e){try{e?localStorage.setItem(Ed,e):localStorage.removeItem(Ed)}catch{}}const ft=Wu(e=>({captures:[],savedSessions:[],selectedUrl:NS(),lastFetchAt:null,lastError:null,setCaptures:t=>e({captures:t,lastFetchAt:Date.now(),lastError:null}),setSavedSessions:t=>e({savedSessions:t}),setSelected:t=>{CS(t),e({selectedUrl:t})},setError:t=>e({lastError:t})})),ES=2500;let rr=null;async function PS(){const e=await fetch("/api/active",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`discovery: HTTP ${e.status}`);return(await e.json()).captures??[]}async function Mm(){const e=ft.getState();try{const[t,n]=await Promise.all([PS(),Tv().catch(()=>e.savedSessions)]);e.setCaptures(t),e.setSavedSessions(n)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}function IS(){return Mm(),rr&&clearInterval(rr),rr=setInterval(()=>{Mm()},ES),()=>{rr&&(clearInterval(rr),rr=null)}}async function Qu(){const e=ft.getState();try{const t=await Tv();e.setSavedSessions(t)}catch(t){e.setError(t instanceof Error?t.message:String(t))}}const jv="acp.theme.v1";function OS(){try{const e=localStorage.getItem(jv);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function RS(){return typeof window>"u"||!window.matchMedia?!0:window.matchMedia("(prefers-color-scheme: dark)").matches}function Nv(e){return e==="system"?RS()?"dark":"light":e}function Cv(e){if(typeof document>"u")return;const t=document.documentElement;t.classList.toggle("light",e==="light"),t.classList.toggle("dark",e==="dark")}const Ev=typeof window<"u"?OS():"system",Pv=Nv(Ev);typeof window<"u"&&Cv(Pv);const Pd=Wu(e=>({mode:Ev,resolved:Pv,setMode:t=>{try{localStorage.setItem(jv,t)}catch{}const n=Nv(t);Cv(n),e({mode:t,resolved:n})}}));function AS(){if(typeof window>"u"||!window.matchMedia)return()=>{};const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{const{mode:n,setMode:o}=Pd.getState();n==="system"&&o("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}const MS={AcceptNesNotification:{description:"Notification sent when a suggestion is accepted.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
41
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
42
- these keys.
43
-
44
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},id:{description:"The ID of the accepted suggestion.",type:"string"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."}},required:["sessionId","id"],type:"object","x-method":"nes/accept","x-side":"agent"},AgentAuthCapabilities:{description:`**UNSTABLE**
45
-
46
- This capability is not part of the spec yet, and may be removed or changed at any point.
47
-
48
- Authentication-related capabilities supported by the agent.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
49
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
50
- these keys.
51
-
52
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},logout:{anyOf:[{$ref:"#/$defs/LogoutCapabilities"},{type:"null"}],description:"Whether the agent supports the logout method.\n\nBy supplying `{}` it means that the agent supports the logout method."}},type:"object"},AgentCapabilities:{description:`Capabilities supported by the agent.
53
-
54
- Advertised during initialization to inform the client about
55
- available features and content types.
56
-
57
- See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
58
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
59
- these keys.
60
-
61
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},auth:{allOf:[{$ref:"#/$defs/AgentAuthCapabilities"}],default:{},description:`**UNSTABLE**
62
-
63
- This capability is not part of the spec yet, and may be removed or changed at any point.
64
-
65
- Authentication-related capabilities supported by the agent.`},loadSession:{default:!1,description:"Whether the agent supports `session/load`.",type:"boolean"},mcpCapabilities:{allOf:[{$ref:"#/$defs/McpCapabilities"}],default:{acp:!1,http:!1,sse:!1},description:"MCP capabilities supported by the agent."},nes:{anyOf:[{$ref:"#/$defs/NesCapabilities"},{type:"null"}],description:`**UNSTABLE**
66
-
67
- This capability is not part of the spec yet, and may be removed or changed at any point.
68
-
69
- NES (Next Edit Suggestions) capabilities supported by the agent.`},positionEncoding:{anyOf:[{$ref:"#/$defs/PositionEncodingKind"},{type:"null"}],description:`**UNSTABLE**
70
-
71
- This capability is not part of the spec yet, and may be removed or changed at any point.
72
-
73
- The position encoding selected by the agent from the client's supported encodings.`},promptCapabilities:{allOf:[{$ref:"#/$defs/PromptCapabilities"}],default:{audio:!1,embeddedContext:!1,image:!1},description:"Prompt capabilities supported by the agent."},providers:{anyOf:[{$ref:"#/$defs/ProvidersCapabilities"},{type:"null"}],description:`**UNSTABLE**
74
-
75
- This capability is not part of the spec yet, and may be removed or changed at any point.
76
-
77
- Provider configuration capabilities supported by the agent.
78
-
79
- By supplying \`{}\` it means that the agent supports provider configuration methods.`},sessionCapabilities:{allOf:[{$ref:"#/$defs/SessionCapabilities"}],default:{}}},type:"object"},AgentNotification:{properties:{method:{type:"string"},params:{anyOf:[{anyOf:[{allOf:[{$ref:"#/$defs/SessionNotification"}],description:`Handles session update notifications from the agent.
80
-
81
- This is a notification endpoint (no response expected) that receives
82
- real-time updates about session progress, including message chunks,
83
- tool calls, and execution plans.
84
-
85
- Note: Clients SHOULD continue accepting tool call updates even after
86
- sending a \`session/cancel\` notification, as the agent may send final
87
- updates before responding with the cancelled stop reason.
88
-
89
- See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)`,title:"SessionNotification"},{allOf:[{$ref:"#/$defs/CompleteElicitationNotification"}],description:`**UNSTABLE**
90
-
91
- This capability is not part of the spec yet, and may be removed or changed at any point.
92
-
93
- Notification that a URL-based elicitation has completed.`,title:"CompleteElicitationNotification"},{allOf:[{$ref:"#/$defs/MessageMcpNotification"}],description:`**UNSTABLE**
94
-
95
- This capability is not part of the spec yet, and may be removed or changed at any point.
96
-
97
- Receives an MCP-over-ACP notification.`,title:"MessageMcpNotification"},{allOf:[{$ref:"#/$defs/ExtNotification"}],description:`Handles extension notifications from the agent.
98
-
99
- Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
100
- Extension notifications provide a way to send one-way messages for custom functionality
101
- while maintaining protocol compatibility.
102
-
103
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,title:"ExtNotification"}],description:`All possible notifications that an agent can send to a client.
104
-
105
- This enum is used internally for routing RPC notifications. You typically won't need
106
- to use this directly.
107
-
108
- Notifications do not expect a response.`},{type:"null"}]}},required:["method"],type:"object","x-docs-ignore":!0},AgentRequest:{properties:{id:{$ref:"#/$defs/RequestId"},method:{type:"string"},params:{anyOf:[{anyOf:[{allOf:[{$ref:"#/$defs/WriteTextFileRequest"}],description:`Writes content to a text file in the client's file system.
109
-
110
- Only available if the client advertises the \`fs.writeTextFile\` capability.
111
- Allows the agent to create or modify files within the client's environment.
112
-
113
- See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)`,title:"WriteTextFileRequest"},{allOf:[{$ref:"#/$defs/ReadTextFileRequest"}],description:`Reads content from a text file in the client's file system.
114
-
115
- Only available if the client advertises the \`fs.readTextFile\` capability.
116
- Allows the agent to access file contents within the client's environment.
117
-
118
- See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)`,title:"ReadTextFileRequest"},{allOf:[{$ref:"#/$defs/RequestPermissionRequest"}],description:`Requests permission from the user for a tool call operation.
119
-
120
- Called by the agent when it needs user authorization before executing
121
- a potentially sensitive operation. The client should present the options
122
- to the user and return their decision.
123
-
124
- If the client cancels the prompt turn via \`session/cancel\`, it MUST
125
- respond to this request with \`RequestPermissionOutcome::Cancelled\`.
126
-
127
- See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)`,title:"RequestPermissionRequest"},{allOf:[{$ref:"#/$defs/CreateTerminalRequest"}],description:`Executes a command in a new terminal
128
-
129
- Only available if the \`terminal\` Client capability is set to \`true\`.
130
-
131
- Returns a \`TerminalId\` that can be used with other terminal methods
132
- to get the current output, wait for exit, and kill the command.
133
-
134
- The \`TerminalId\` can also be used to embed the terminal in a tool call
135
- by using the \`ToolCallContent::Terminal\` variant.
136
-
137
- The Agent is responsible for releasing the terminal by using the \`terminal/release\`
138
- method.
139
-
140
- See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)`,title:"CreateTerminalRequest"},{allOf:[{$ref:"#/$defs/TerminalOutputRequest"}],description:`Gets the terminal output and exit status
141
-
142
- Returns the current content in the terminal without waiting for the command to exit.
143
- If the command has already exited, the exit status is included.
144
-
145
- See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)`,title:"TerminalOutputRequest"},{allOf:[{$ref:"#/$defs/ReleaseTerminalRequest"}],description:`Releases a terminal
146
-
147
- The command is killed if it hasn't exited yet. Use \`terminal/wait_for_exit\`
148
- to wait for the command to exit before releasing the terminal.
149
-
150
- After release, the \`TerminalId\` can no longer be used with other \`terminal/*\` methods,
151
- but tool calls that already contain it, continue to display its output.
152
-
153
- The \`terminal/kill\` method can be used to terminate the command without releasing
154
- the terminal, allowing the Agent to call \`terminal/output\` and other methods.
155
-
156
- See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)`,title:"ReleaseTerminalRequest"},{allOf:[{$ref:"#/$defs/WaitForTerminalExitRequest"}],description:`Waits for the terminal command to exit and return its exit status
157
-
158
- See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)`,title:"WaitForTerminalExitRequest"},{allOf:[{$ref:"#/$defs/KillTerminalRequest"}],description:`Kills the terminal command without releasing the terminal
159
-
160
- While \`terminal/release\` will also kill the command, this method will keep
161
- the \`TerminalId\` valid so it can be used with other methods.
162
-
163
- This method can be helpful when implementing command timeouts which terminate
164
- the command as soon as elapsed, and then get the final output so it can be sent
165
- to the model.
166
-
167
- Note: Call \`terminal/release\` when \`TerminalId\` is no longer needed.
168
-
169
- See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)`,title:"KillTerminalRequest"},{allOf:[{$ref:"#/$defs/CreateElicitationRequest"}],description:`**UNSTABLE**
170
-
171
- This capability is not part of the spec yet, and may be removed or changed at any point.
172
-
173
- Requests structured user input via a form or URL.`,title:"CreateElicitationRequest"},{allOf:[{$ref:"#/$defs/ConnectMcpRequest"}],description:`**UNSTABLE**
174
-
175
- This capability is not part of the spec yet, and may be removed or changed at any point.
176
-
177
- Opens an MCP-over-ACP connection.`,title:"ConnectMcpRequest"},{allOf:[{$ref:"#/$defs/MessageMcpRequest"}],description:`**UNSTABLE**
178
-
179
- This capability is not part of the spec yet, and may be removed or changed at any point.
180
-
181
- Exchanges an MCP-over-ACP message.`,title:"MessageMcpRequest"},{allOf:[{$ref:"#/$defs/DisconnectMcpRequest"}],description:`**UNSTABLE**
182
-
183
- This capability is not part of the spec yet, and may be removed or changed at any point.
184
-
185
- Closes an MCP-over-ACP connection.`,title:"DisconnectMcpRequest"},{allOf:[{$ref:"#/$defs/ExtRequest"}],description:`Handles extension method requests from the agent.
186
-
187
- Allows the Agent to send an arbitrary request that is not part of the ACP spec.
188
- Extension methods provide a way to add custom functionality while maintaining
189
- protocol compatibility.
190
-
191
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,title:"ExtMethodRequest"}],description:`All possible requests that an agent can send to a client.
192
-
193
- This enum is used internally for routing RPC requests. You typically won't need
194
- to use this directly.
195
-
196
- This enum encompasses all method calls from agent to client.`},{type:"null"}]}},required:["id","method"],type:"object","x-docs-ignore":!0},AgentResponse:{anyOf:[{properties:{id:{$ref:"#/$defs/RequestId"},result:{anyOf:[{allOf:[{$ref:"#/$defs/InitializeResponse"}],title:"InitializeResponse"},{allOf:[{$ref:"#/$defs/AuthenticateResponse"}],title:"AuthenticateResponse"},{allOf:[{$ref:"#/$defs/ListProvidersResponse"}],title:"ListProvidersResponse"},{allOf:[{$ref:"#/$defs/SetProvidersResponse"}],title:"SetProvidersResponse"},{allOf:[{$ref:"#/$defs/DisableProvidersResponse"}],title:"DisableProvidersResponse"},{allOf:[{$ref:"#/$defs/LogoutResponse"}],title:"LogoutResponse"},{allOf:[{$ref:"#/$defs/NewSessionResponse"}],title:"NewSessionResponse"},{allOf:[{$ref:"#/$defs/LoadSessionResponse"}],title:"LoadSessionResponse"},{allOf:[{$ref:"#/$defs/ListSessionsResponse"}],title:"ListSessionsResponse"},{allOf:[{$ref:"#/$defs/DeleteSessionResponse"}],title:"DeleteSessionResponse"},{allOf:[{$ref:"#/$defs/ForkSessionResponse"}],title:"ForkSessionResponse"},{allOf:[{$ref:"#/$defs/ResumeSessionResponse"}],title:"ResumeSessionResponse"},{allOf:[{$ref:"#/$defs/CloseSessionResponse"}],title:"CloseSessionResponse"},{allOf:[{$ref:"#/$defs/SetSessionModeResponse"}],title:"SetSessionModeResponse"},{allOf:[{$ref:"#/$defs/SetSessionConfigOptionResponse"}],title:"SetSessionConfigOptionResponse"},{allOf:[{$ref:"#/$defs/PromptResponse"}],title:"PromptResponse"},{allOf:[{$ref:"#/$defs/SetSessionModelResponse"}],title:"SetSessionModelResponse"},{allOf:[{$ref:"#/$defs/StartNesResponse"}],title:"StartNesResponse"},{allOf:[{$ref:"#/$defs/SuggestNesResponse"}],title:"SuggestNesResponse"},{allOf:[{$ref:"#/$defs/CloseNesResponse"}],title:"CloseNesResponse"},{allOf:[{$ref:"#/$defs/ExtResponse"}],title:"ExtMethodResponse"},{allOf:[{$ref:"#/$defs/MessageMcpResponse"}],title:"MessageMcpResponse"}],description:`All possible responses that an agent can send to a client.
197
-
198
- This enum is used internally for routing RPC responses. You typically won't need
199
- to use this directly - the responses are handled automatically by the connection.
200
-
201
- These are responses to the corresponding \`ClientRequest\` variants.`}},required:["id","result"],title:"Result",type:"object"},{properties:{error:{$ref:"#/$defs/Error"},id:{$ref:"#/$defs/RequestId"}},required:["id","error"],title:"Error",type:"object"}],"x-docs-ignore":!0},Annotations:{description:"Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
202
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
203
- these keys.
204
-
205
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},audience:{items:{$ref:"#/$defs/Role"},type:["array","null"]},lastModified:{type:["string","null"]},priority:{format:"double",type:["number","null"]}},type:"object"},AudioContent:{description:"Audio provided to or from an LLM.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
206
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
207
- these keys.
208
-
209
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},annotations:{anyOf:[{$ref:"#/$defs/Annotations"},{type:"null"}]},data:{type:"string"},mimeType:{type:"string"}},required:["data","mimeType"],type:"object"},AuthCapabilities:{description:`**UNSTABLE**
210
-
211
- This capability is not part of the spec yet, and may be removed or changed at any point.
212
-
213
- Authentication capabilities supported by the client.
214
-
215
- Advertised during initialization to inform the agent which authentication
216
- method types the client can handle. This governs opt-in types that require
217
- additional client-side support.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
218
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
219
- these keys.
220
-
221
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},terminal:{default:!1,description:"Whether the client supports `terminal` authentication methods.\n\nWhen `true`, the agent may include `terminal` entries in its authentication methods.",type:"boolean"}},type:"object"},AuthEnvVar:{description:`**UNSTABLE**
222
-
223
- This capability is not part of the spec yet, and may be removed or changed at any point.
224
-
225
- Describes a single environment variable for an [\`AuthMethodEnvVar\`] authentication method.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
226
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
227
- these keys.
228
-
229
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},label:{description:"Human-readable label for this variable, displayed in client UI.",type:["string","null"]},name:{description:'The environment variable name (e.g. `"OPENAI_API_KEY"`).',type:"string"},optional:{default:!1,description:"Whether this variable is optional.\n\nDefaults to `false`.",type:"boolean"},secret:{default:!0,description:`Whether this value is a secret (e.g. API key, token).
230
- Clients should use a password-style input for secret vars.
231
-
232
- Defaults to \`true\`.`,type:"boolean"}},required:["name"],type:"object"},AuthMethod:{anyOf:[{allOf:[{$ref:"#/$defs/AuthMethodEnvVar"}],description:`**UNSTABLE**
233
-
234
- This capability is not part of the spec yet, and may be removed or changed at any point.
235
-
236
- User provides a key that the client passes to the agent as an environment variable.`,properties:{type:{const:"env_var",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/AuthMethodTerminal"}],description:`**UNSTABLE**
237
-
238
- This capability is not part of the spec yet, and may be removed or changed at any point.
239
-
240
- Client runs an interactive terminal for the user to authenticate via a TUI.`,properties:{type:{const:"terminal",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/AuthMethodAgent"}],description:"Agent handles authentication itself.\n\nThis is the default when no `type` is specified.",title:"agent"}],description:"Describes an available authentication method.\n\nThe `type` field acts as the discriminator in the serialized JSON form.\nWhen no `type` is present, the method is treated as `agent`."},AuthMethodAgent:{description:`Agent handles authentication itself.
241
-
242
- This is the default authentication method type.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
243
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
244
- these keys.
245
-
246
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},description:{description:"Optional description providing more details about this authentication method.",type:["string","null"]},id:{description:"Unique identifier for this authentication method.",type:"string"},name:{description:"Human-readable name of the authentication method.",type:"string"}},required:["id","name"],type:"object"},AuthMethodEnvVar:{description:`**UNSTABLE**
247
-
248
- This capability is not part of the spec yet, and may be removed or changed at any point.
249
-
250
- Environment variable authentication method.
251
-
252
- The user provides credentials that the client passes to the agent as environment variables.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
253
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
254
- these keys.
255
-
256
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},description:{description:"Optional description providing more details about this authentication method.",type:["string","null"]},id:{description:"Unique identifier for this authentication method.",type:"string"},link:{description:"Optional link to a page where the user can obtain their credentials.",type:["string","null"]},name:{description:"Human-readable name of the authentication method.",type:"string"},vars:{description:"The environment variables the client should set.",items:{$ref:"#/$defs/AuthEnvVar"},type:"array"}},required:["id","name","vars"],type:"object"},AuthMethodTerminal:{description:`**UNSTABLE**
257
-
258
- This capability is not part of the spec yet, and may be removed or changed at any point.
259
-
260
- Terminal-based authentication method.
261
-
262
- The client runs an interactive terminal for the user to authenticate via a TUI.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
263
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
264
- these keys.
265
-
266
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},args:{description:"Additional arguments to pass when running the agent binary for terminal auth.",items:{type:"string"},type:"array"},description:{description:"Optional description providing more details about this authentication method.",type:["string","null"]},env:{additionalProperties:{type:"string"},description:"Additional environment variables to set when running the agent binary for terminal auth.",type:"object"},id:{description:"Unique identifier for this authentication method.",type:"string"},name:{description:"Human-readable name of the authentication method.",type:"string"}},required:["id","name"],type:"object"},AuthenticateRequest:{description:`Request parameters for the authenticate method.
267
-
268
- Specifies which authentication method to use.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
269
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
270
- these keys.
271
-
272
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},methodId:{description:`The ID of the authentication method to use.
273
- Must be one of the methods advertised in the initialize response.`,type:"string"}},required:["methodId"],type:"object","x-method":"authenticate","x-side":"agent"},AuthenticateResponse:{description:"Response to the `authenticate` method.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
274
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
275
- these keys.
276
-
277
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"authenticate","x-side":"agent"},AvailableCommand:{description:"Information about a command.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
278
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
279
- these keys.
280
-
281
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},description:{description:"Human-readable description of what the command does.",type:"string"},input:{anyOf:[{$ref:"#/$defs/AvailableCommandInput"},{type:"null"}],description:"Input for the command if required"},name:{description:"Command name (e.g., `create_plan`, `research_codebase`).",type:"string"}},required:["name","description"],type:"object"},AvailableCommandInput:{anyOf:[{allOf:[{$ref:"#/$defs/UnstructuredCommandInput"}],description:"All text that was typed after the command name is provided as input.",title:"unstructured"}],description:"The input specification for a command."},AvailableCommandsUpdate:{description:"Available commands are ready or have changed",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
282
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
283
- these keys.
284
-
285
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},availableCommands:{description:"Commands the agent can execute",items:{$ref:"#/$defs/AvailableCommand"},type:"array"}},required:["availableCommands"],type:"object"},BlobResourceContents:{description:"Binary resource contents.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
286
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
287
- these keys.
288
-
289
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},blob:{type:"string"},mimeType:{type:["string","null"]},uri:{type:"string"}},required:["blob","uri"],type:"object"},BooleanPropertySchema:{description:"Schema for boolean properties in an elicitation form.",properties:{default:{description:"Default value.",type:["boolean","null"]},description:{description:"Human-readable description.",type:["string","null"]},title:{description:"Optional title for the property.",type:["string","null"]}},type:"object"},CancelNotification:{description:`Notification to cancel ongoing operations for a session.
290
-
291
- See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
292
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
293
- these keys.
294
-
295
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to cancel operations for."}},required:["sessionId"],type:"object","x-method":"session/cancel","x-side":"agent"},CancelRequestNotification:{description:`**UNSTABLE**
296
-
297
- This capability is not part of the spec yet, and may be removed or changed at any point.
298
-
299
- Notification to cancel an ongoing request.
300
-
301
- See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
302
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
303
- these keys.
304
-
305
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},requestId:{allOf:[{$ref:"#/$defs/RequestId"}],description:"The ID of the request to cancel."}},required:["requestId"],type:"object","x-method":"$/cancel_request","x-side":"protocol"},ClientCapabilities:{description:`Capabilities supported by the client.
306
-
307
- Advertised during initialization to inform the agent about
308
- available features and methods.
309
-
310
- See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
311
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
312
- these keys.
313
-
314
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},auth:{allOf:[{$ref:"#/$defs/AuthCapabilities"}],default:{terminal:!1},description:`**UNSTABLE**
315
-
316
- This capability is not part of the spec yet, and may be removed or changed at any point.
317
-
318
- Authentication capabilities supported by the client.
319
- Determines which authentication method types the agent may include
320
- in its \`InitializeResponse\`.`},elicitation:{anyOf:[{$ref:"#/$defs/ElicitationCapabilities"},{type:"null"}],description:`**UNSTABLE**
321
-
322
- This capability is not part of the spec yet, and may be removed or changed at any point.
323
-
324
- Elicitation capabilities supported by the client.
325
- Determines which elicitation modes the agent may use.`},fs:{allOf:[{$ref:"#/$defs/FileSystemCapabilities"}],default:{readTextFile:!1,writeTextFile:!1},description:`File system capabilities supported by the client.
326
- Determines which file operations the agent can request.`},nes:{anyOf:[{$ref:"#/$defs/ClientNesCapabilities"},{type:"null"}],description:`**UNSTABLE**
327
-
328
- This capability is not part of the spec yet, and may be removed or changed at any point.
329
-
330
- NES (Next Edit Suggestions) capabilities supported by the client.`},positionEncodings:{description:`**UNSTABLE**
331
-
332
- This capability is not part of the spec yet, and may be removed or changed at any point.
333
-
334
- The position encodings supported by the client, in order of preference.`,items:{$ref:"#/$defs/PositionEncodingKind"},type:"array"},terminal:{default:!1,description:"Whether the Client support all `terminal/*` methods.",type:"boolean"}},type:"object"},ClientNesCapabilities:{description:"NES capabilities advertised by the client during initialization.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
335
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
336
- these keys.
337
-
338
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},jump:{anyOf:[{$ref:"#/$defs/NesJumpCapabilities"},{type:"null"}],description:"Whether the client supports the `jump` suggestion kind."},rename:{anyOf:[{$ref:"#/$defs/NesRenameCapabilities"},{type:"null"}],description:"Whether the client supports the `rename` suggestion kind."},searchAndReplace:{anyOf:[{$ref:"#/$defs/NesSearchAndReplaceCapabilities"},{type:"null"}],description:"Whether the client supports the `searchAndReplace` suggestion kind."}},type:"object"},ClientNotification:{properties:{method:{type:"string"},params:{anyOf:[{anyOf:[{allOf:[{$ref:"#/$defs/CancelNotification"}],description:`Cancels ongoing operations for a session.
339
-
340
- This is a notification sent by the client to cancel an ongoing prompt turn.
341
-
342
- Upon receiving this notification, the Agent SHOULD:
343
- - Stop all language model requests as soon as possible
344
- - Abort all tool call invocations in progress
345
- - Send any pending \`session/update\` notifications
346
- - Respond to the original \`session/prompt\` request with \`StopReason::Cancelled\`
347
-
348
- See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)`,title:"CancelNotification"},{allOf:[{$ref:"#/$defs/DidOpenDocumentNotification"}],description:`**UNSTABLE**
349
-
350
- Notification sent when a file is opened in the editor.`,title:"DidOpenDocumentNotification"},{allOf:[{$ref:"#/$defs/DidChangeDocumentNotification"}],description:`**UNSTABLE**
351
-
352
- Notification sent when a file is edited.`,title:"DidChangeDocumentNotification"},{allOf:[{$ref:"#/$defs/DidCloseDocumentNotification"}],description:`**UNSTABLE**
353
-
354
- Notification sent when a file is closed.`,title:"DidCloseDocumentNotification"},{allOf:[{$ref:"#/$defs/DidSaveDocumentNotification"}],description:`**UNSTABLE**
355
-
356
- Notification sent when a file is saved.`,title:"DidSaveDocumentNotification"},{allOf:[{$ref:"#/$defs/DidFocusDocumentNotification"}],description:`**UNSTABLE**
357
-
358
- Notification sent when a file becomes the active editor tab.`,title:"DidFocusDocumentNotification"},{allOf:[{$ref:"#/$defs/AcceptNesNotification"}],description:`**UNSTABLE**
359
-
360
- Notification sent when a suggestion is accepted.`,title:"AcceptNesNotification"},{allOf:[{$ref:"#/$defs/RejectNesNotification"}],description:`**UNSTABLE**
361
-
362
- Notification sent when a suggestion is rejected.`,title:"RejectNesNotification"},{allOf:[{$ref:"#/$defs/MessageMcpNotification"}],description:`**UNSTABLE**
363
-
364
- This capability is not part of the spec yet, and may be removed or changed at any point.
365
-
366
- Sends an MCP-over-ACP notification.`,title:"MessageMcpNotification"},{allOf:[{$ref:"#/$defs/ExtNotification"}],description:`Handles extension notifications from the client.
367
-
368
- Extension notifications provide a way to send one-way messages for custom functionality
369
- while maintaining protocol compatibility.
370
-
371
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,title:"ExtNotification"}],description:`All possible notifications that a client can send to an agent.
372
-
373
- This enum is used internally for routing RPC notifications. You typically won't need
374
- to use this directly.
375
-
376
- Notifications do not expect a response.`},{type:"null"}]}},required:["method"],type:"object","x-docs-ignore":!0},ClientRequest:{properties:{id:{$ref:"#/$defs/RequestId"},method:{type:"string"},params:{anyOf:[{anyOf:[{allOf:[{$ref:"#/$defs/InitializeRequest"}],description:`Establishes the connection with a client and negotiates protocol capabilities.
377
-
378
- This method is called once at the beginning of the connection to:
379
- - Negotiate the protocol version to use
380
- - Exchange capability information between client and agent
381
- - Determine available authentication methods
382
-
383
- The agent should respond with its supported protocol version and capabilities.
384
-
385
- See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)`,title:"InitializeRequest"},{allOf:[{$ref:"#/$defs/AuthenticateRequest"}],description:`Authenticates the client using the specified authentication method.
386
-
387
- Called when the agent requires authentication before allowing session creation.
388
- The client provides the authentication method ID that was advertised during initialization.
389
-
390
- After successful authentication, the client can proceed to create sessions with
391
- \`new_session\` without receiving an \`auth_required\` error.
392
-
393
- See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)`,title:"AuthenticateRequest"},{allOf:[{$ref:"#/$defs/ListProvidersRequest"}],description:`**UNSTABLE**
394
-
395
- This capability is not part of the spec yet, and may be removed or changed at any point.
396
-
397
- Lists providers that can be configured by the client.`,title:"ListProvidersRequest"},{allOf:[{$ref:"#/$defs/SetProvidersRequest"}],description:`**UNSTABLE**
398
-
399
- This capability is not part of the spec yet, and may be removed or changed at any point.
400
-
401
- Replaces the configuration for a provider.`,title:"SetProvidersRequest"},{allOf:[{$ref:"#/$defs/DisableProvidersRequest"}],description:`**UNSTABLE**
402
-
403
- This capability is not part of the spec yet, and may be removed or changed at any point.
404
-
405
- Disables a provider.`,title:"DisableProvidersRequest"},{allOf:[{$ref:"#/$defs/LogoutRequest"}],description:`**UNSTABLE**
406
-
407
- This capability is not part of the spec yet, and may be removed or changed at any point.
408
-
409
- Logs out of the current authenticated state.
410
-
411
- After a successful logout, all new sessions will require authentication.
412
- There is no guarantee about the behavior of already running sessions.`,title:"LogoutRequest"},{allOf:[{$ref:"#/$defs/NewSessionRequest"}],description:`Creates a new conversation session with the agent.
413
-
414
- Sessions represent independent conversation contexts with their own history and state.
415
-
416
- The agent should:
417
- - Create a new session context
418
- - Connect to any specified MCP servers
419
- - Return a unique session ID for future requests
420
-
421
- May return an \`auth_required\` error if the agent requires authentication.
422
-
423
- See protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)`,title:"NewSessionRequest"},{allOf:[{$ref:"#/$defs/LoadSessionRequest"}],description:`Loads an existing session to resume a previous conversation.
424
-
425
- This method is only available if the agent advertises the \`loadSession\` capability.
426
-
427
- The agent should:
428
- - Restore the session context and conversation history
429
- - Connect to the specified MCP servers
430
- - Stream the entire conversation history back to the client via notifications
431
-
432
- See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)`,title:"LoadSessionRequest"},{allOf:[{$ref:"#/$defs/ListSessionsRequest"}],description:`Lists existing sessions known to the agent.
433
-
434
- This method is only available if the agent advertises the \`sessionCapabilities.list\` capability.
435
-
436
- The agent should return metadata about sessions with optional filtering and pagination support.`,title:"ListSessionsRequest"},{allOf:[{$ref:"#/$defs/DeleteSessionRequest"}],description:`**UNSTABLE**
437
-
438
- This capability is not part of the spec yet, and may be removed or changed at any point.
439
-
440
- Deletes an existing session from \`session/list\`.
441
-
442
- This method is only available if the agent advertises the \`sessionCapabilities.delete\` capability.`,title:"DeleteSessionRequest"},{allOf:[{$ref:"#/$defs/ForkSessionRequest"}],description:`**UNSTABLE**
443
-
444
- This capability is not part of the spec yet, and may be removed or changed at any point.
445
-
446
- Forks an existing session to create a new independent session.
447
-
448
- This method is only available if the agent advertises the \`session.fork\` capability.
449
-
450
- The agent should create a new session with the same conversation context as the
451
- original, allowing operations like generating summaries without affecting the
452
- original session's history.`,title:"ForkSessionRequest"},{allOf:[{$ref:"#/$defs/ResumeSessionRequest"}],description:`Resumes an existing session without returning previous messages.
453
-
454
- This method is only available if the agent advertises the \`sessionCapabilities.resume\` capability.
455
-
456
- The agent should resume the session context, allowing the conversation to continue
457
- without replaying the message history (unlike \`session/load\`).`,title:"ResumeSessionRequest"},{allOf:[{$ref:"#/$defs/CloseSessionRequest"}],description:`Closes an active session and frees up any resources associated with it.
458
-
459
- This method is only available if the agent advertises the \`sessionCapabilities.close\` capability.
460
-
461
- The agent must cancel any ongoing work (as if \`session/cancel\` was called)
462
- and then free up any resources associated with the session.`,title:"CloseSessionRequest"},{allOf:[{$ref:"#/$defs/SetSessionModeRequest"}],description:`Sets the current mode for a session.
463
-
464
- Allows switching between different agent modes (e.g., "ask", "architect", "code")
465
- that affect system prompts, tool availability, and permission behaviors.
466
-
467
- The mode must be one of the modes advertised in \`availableModes\` during session
468
- creation or loading. Agents may also change modes autonomously and notify the
469
- client via \`current_mode_update\` notifications.
470
-
471
- This method can be called at any time during a session, whether the Agent is
472
- idle or actively generating a response.
473
-
474
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`,title:"SetSessionModeRequest"},{allOf:[{$ref:"#/$defs/SetSessionConfigOptionRequest"}],description:"Sets the current value for a session configuration option.",title:"SetSessionConfigOptionRequest"},{allOf:[{$ref:"#/$defs/PromptRequest"}],description:`Processes a user prompt within a session.
475
-
476
- This method handles the whole lifecycle of a prompt:
477
- - Receives user messages with optional context (files, images, etc.)
478
- - Processes the prompt using language models
479
- - Reports language model content and tool calls to the Clients
480
- - Requests permission to run tools
481
- - Executes any requested tool calls
482
- - Returns when the turn is complete with a stop reason
483
-
484
- See protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)`,title:"PromptRequest"},{allOf:[{$ref:"#/$defs/SetSessionModelRequest"}],description:`**UNSTABLE**
485
-
486
- This capability is not part of the spec yet, and may be removed or changed at any point.
487
-
488
- Select a model for a given session.`,title:"SetSessionModelRequest"},{allOf:[{$ref:"#/$defs/StartNesRequest"}],description:`**UNSTABLE**
489
-
490
- This capability is not part of the spec yet, and may be removed or changed at any point.
491
-
492
- Starts an NES session.`,title:"StartNesRequest"},{allOf:[{$ref:"#/$defs/SuggestNesRequest"}],description:`**UNSTABLE**
493
-
494
- This capability is not part of the spec yet, and may be removed or changed at any point.
495
-
496
- Requests a code suggestion.`,title:"SuggestNesRequest"},{allOf:[{$ref:"#/$defs/CloseNesRequest"}],description:`**UNSTABLE**
497
-
498
- This capability is not part of the spec yet, and may be removed or changed at any point.
499
-
500
- Closes an active NES session and frees up any resources associated with it.
501
-
502
- The agent must cancel any ongoing work and then free up any resources
503
- associated with the NES session.`,title:"CloseNesRequest"},{allOf:[{$ref:"#/$defs/MessageMcpRequest"}],description:`**UNSTABLE**
504
-
505
- This capability is not part of the spec yet, and may be removed or changed at any point.
506
-
507
- Exchanges an MCP-over-ACP message.`,title:"MessageMcpRequest"},{allOf:[{$ref:"#/$defs/ExtRequest"}],description:`Handles extension method requests from the client.
508
-
509
- Extension methods provide a way to add custom functionality while maintaining
510
- protocol compatibility.
511
-
512
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,title:"ExtMethodRequest"}],description:`All possible requests that a client can send to an agent.
513
-
514
- This enum is used internally for routing RPC requests. You typically won't need
515
- to use this directly.
516
-
517
- This enum encompasses all method calls from client to agent.`},{type:"null"}]}},required:["id","method"],type:"object","x-docs-ignore":!0},ClientResponse:{anyOf:[{properties:{id:{$ref:"#/$defs/RequestId"},result:{anyOf:[{allOf:[{$ref:"#/$defs/WriteTextFileResponse"}],title:"WriteTextFileResponse"},{allOf:[{$ref:"#/$defs/ReadTextFileResponse"}],title:"ReadTextFileResponse"},{allOf:[{$ref:"#/$defs/RequestPermissionResponse"}],title:"RequestPermissionResponse"},{allOf:[{$ref:"#/$defs/CreateTerminalResponse"}],title:"CreateTerminalResponse"},{allOf:[{$ref:"#/$defs/TerminalOutputResponse"}],title:"TerminalOutputResponse"},{allOf:[{$ref:"#/$defs/ReleaseTerminalResponse"}],title:"ReleaseTerminalResponse"},{allOf:[{$ref:"#/$defs/WaitForTerminalExitResponse"}],title:"WaitForTerminalExitResponse"},{allOf:[{$ref:"#/$defs/KillTerminalResponse"}],title:"KillTerminalResponse"},{allOf:[{$ref:"#/$defs/CreateElicitationResponse"}],title:"CreateElicitationResponse"},{allOf:[{$ref:"#/$defs/ConnectMcpResponse"}],title:"ConnectMcpResponse"},{allOf:[{$ref:"#/$defs/DisconnectMcpResponse"}],title:"DisconnectMcpResponse"},{allOf:[{$ref:"#/$defs/ExtResponse"}],title:"ExtMethodResponse"},{allOf:[{$ref:"#/$defs/MessageMcpResponse"}],title:"MessageMcpResponse"}],description:`All possible responses that a client can send to an agent.
518
-
519
- This enum is used internally for routing RPC responses. You typically won't need
520
- to use this directly - the responses are handled automatically by the connection.
521
-
522
- These are responses to the corresponding \`AgentRequest\` variants.`}},required:["id","result"],title:"Result",type:"object"},{properties:{error:{$ref:"#/$defs/Error"},id:{$ref:"#/$defs/RequestId"}},required:["id","error"],title:"Error",type:"object"}],"x-docs-ignore":!0},CloseNesRequest:{description:`Request to close an NES session.
523
-
524
- The agent **must** cancel any ongoing work related to the NES session
525
- and then free up any resources associated with the session.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
526
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
527
- these keys.
528
-
529
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the NES session to close."}},required:["sessionId"],type:"object","x-method":"nes/close","x-side":"agent"},CloseNesResponse:{description:"Response from closing an NES session.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
530
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
531
- these keys.
532
-
533
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"nes/close","x-side":"agent"},CloseSessionRequest:{description:`Request parameters for closing an active session.
534
-
535
- If supported, the agent **must** cancel any ongoing work related to the session
536
- (treat it as if \`session/cancel\` was called) and then free up any resources
537
- associated with the session.
538
-
539
- Only available if the Agent supports the \`sessionCapabilities.close\` capability.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
540
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
541
- these keys.
542
-
543
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to close."}},required:["sessionId"],type:"object","x-method":"session/close","x-side":"agent"},CloseSessionResponse:{description:"Response from closing a session.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
544
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
545
- these keys.
546
-
547
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"session/close","x-side":"agent"},CompleteElicitationNotification:{description:`**UNSTABLE**
548
-
549
- This capability is not part of the spec yet, and may be removed or changed at any point.
550
-
551
- Notification sent by the agent when a URL-based elicitation is complete.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
552
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
553
- these keys.
554
-
555
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},elicitationId:{allOf:[{$ref:"#/$defs/ElicitationId"}],description:"The ID of the elicitation that completed."}},required:["elicitationId"],type:"object","x-method":"elicitation/complete","x-side":"client"},ConfigOptionUpdate:{description:"Session configuration options have been updated.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
556
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
557
- these keys.
558
-
559
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configOptions:{description:"The full set of configuration options and their current values.",items:{$ref:"#/$defs/SessionConfigOption"},type:"array"}},required:["configOptions"],type:"object"},ConnectMcpRequest:{description:`**UNSTABLE**
560
-
561
- This capability is not part of the spec yet, and may be removed or changed at any point.
562
-
563
- Request parameters for \`mcp/connect\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
564
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
565
- these keys.
566
-
567
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},acpId:{allOf:[{$ref:"#/$defs/McpServerAcpId"}],description:"The ACP MCP server ID that was provided by the component declaring the MCP server."}},required:["acpId"],type:"object","x-method":"mcp/connect","x-side":"client"},ConnectMcpResponse:{description:`**UNSTABLE**
568
-
569
- This capability is not part of the spec yet, and may be removed or changed at any point.
570
-
571
- Response to \`mcp/connect\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
572
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
573
- these keys.
574
-
575
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},connectionId:{allOf:[{$ref:"#/$defs/McpConnectionId"}],description:"The unique identifier for this MCP-over-ACP connection."}},required:["connectionId"],type:"object","x-method":"mcp/connect","x-side":"client"},Content:{description:"Standard content block (text, images, resources).",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
576
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
577
- these keys.
578
-
579
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{allOf:[{$ref:"#/$defs/ContentBlock"}],description:"The actual content block."}},required:["content"],type:"object"},ContentBlock:{description:`Content blocks represent displayable information in the Agent Client Protocol.
580
-
581
- They provide a structured way to handle various types of user-facing content—whether
582
- it's text from language models, images for analysis, or embedded resources for context.
583
-
584
- Content blocks appear in:
585
- - User prompts sent via \`session/prompt\`
586
- - Language model output streamed through \`session/update\` notifications
587
- - Progress updates and results from tool calls
588
-
589
- This structure is compatible with the Model Context Protocol (MCP), enabling
590
- agents to seamlessly forward content from MCP tool outputs without transformation.
591
-
592
- See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)`,discriminator:{propertyName:"type"},oneOf:[{allOf:[{$ref:"#/$defs/TextContent"}],description:`Text content. May be plain text or formatted with Markdown.
593
-
594
- All agents MUST support text content blocks in prompts.
595
- Clients SHOULD render this text as Markdown.`,properties:{type:{const:"text",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/ImageContent"}],description:"Images for visual context or analysis.\n\nRequires the `image` prompt capability when included in prompts.",properties:{type:{const:"image",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/AudioContent"}],description:"Audio data for transcription or analysis.\n\nRequires the `audio` prompt capability when included in prompts.",properties:{type:{const:"audio",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/ResourceLink"}],description:`References to resources that the agent can access.
596
-
597
- All agents MUST support resource links in prompts.`,properties:{type:{const:"resource_link",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/EmbeddedResource"}],description:`Complete resource contents embedded directly in the message.
598
-
599
- Preferred for including context as it avoids extra round-trips.
600
-
601
- Requires the \`embeddedContext\` prompt capability when included in prompts.`,properties:{type:{const:"resource",type:"string"}},required:["type"],type:"object"}]},ContentChunk:{description:"A streamed item of content",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
602
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
603
- these keys.
604
-
605
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{allOf:[{$ref:"#/$defs/ContentBlock"}],description:"A single item of content"},messageId:{description:`**UNSTABLE**
606
-
607
- This capability is not part of the spec yet, and may be removed or changed at any point.
608
-
609
- A unique identifier for the message this chunk belongs to.
610
-
611
- All chunks belonging to the same message share the same \`messageId\`.
612
- A change in \`messageId\` indicates a new message has started.
613
- Both clients and agents MUST use UUID format for message IDs.`,type:["string","null"]}},required:["content"],type:"object"},Cost:{description:`**UNSTABLE**
614
-
615
- This capability is not part of the spec yet, and may be removed or changed at any point.
616
-
617
- Cost information for a session.`,properties:{amount:{description:"Total cumulative cost for session.",format:"double",type:"number"},currency:{description:'ISO 4217 currency code (e.g., "USD", "EUR").',type:"string"}},required:["amount","currency"],type:"object"},CreateElicitationRequest:{description:`**UNSTABLE**
618
-
619
- This capability is not part of the spec yet, and may be removed or changed at any point.
620
-
621
- Request from the agent to elicit structured user input.
622
-
623
- The agent sends this to the client to request information from the user,
624
- either via a form or by directing them to a URL.
625
- Elicitations are tied to a session (optionally a tool call) or a request.`,discriminator:{propertyName:"mode"},oneOf:[{allOf:[{$ref:"#/$defs/ElicitationFormMode"}],description:"Form-based elicitation where the client renders a form from the provided schema.",properties:{mode:{const:"form",type:"string"}},required:["mode"],type:"object"},{allOf:[{$ref:"#/$defs/ElicitationUrlMode"}],description:"URL-based elicitation where the client directs the user to a URL.",properties:{mode:{const:"url",type:"string"}},required:["mode"],type:"object"}],properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
626
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
627
- these keys.
628
-
629
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},message:{description:"A human-readable message describing what input is needed.",type:"string"}},required:["message"],type:"object","x-method":"elicitation/create","x-side":"client"},CreateElicitationResponse:{description:`**UNSTABLE**
630
-
631
- This capability is not part of the spec yet, and may be removed or changed at any point.
632
-
633
- Response from the client to an elicitation request.`,discriminator:{propertyName:"action"},oneOf:[{allOf:[{$ref:"#/$defs/ElicitationAcceptAction"}],description:"The user accepted and provided content.",properties:{action:{const:"accept",type:"string"}},required:["action"],type:"object"},{description:"The user declined the elicitation.",properties:{action:{const:"decline",type:"string"}},required:["action"],type:"object"},{description:"The elicitation was cancelled.",properties:{action:{const:"cancel",type:"string"}},required:["action"],type:"object"}],properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
634
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
635
- these keys.
636
-
637
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"elicitation/create","x-side":"client"},CreateTerminalRequest:{description:"Request to create a new terminal and execute a command.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
638
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
639
- these keys.
640
-
641
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},args:{description:"Array of command arguments.",items:{type:"string"},type:"array"},command:{description:"The command to execute.",type:"string"},cwd:{description:"Working directory for the command (absolute path).",type:["string","null"]},env:{description:"Environment variables for the command.",items:{$ref:"#/$defs/EnvVariable"},type:"array"},outputByteLimit:{description:`Maximum number of output bytes to retain.
642
-
643
- When the limit is exceeded, the Client truncates from the beginning of the output
644
- to stay within the limit.
645
-
646
- The Client MUST ensure truncation happens at a character boundary to maintain valid
647
- string output, even if this means the retained output is slightly less than the
648
- specified limit.`,format:"uint64",minimum:0,type:["integer","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."}},required:["sessionId","command"],type:"object","x-method":"terminal/create","x-side":"client"},CreateTerminalResponse:{description:"Response containing the ID of the created terminal.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
649
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
650
- these keys.
651
-
652
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},terminalId:{description:"The unique identifier for the created terminal.",type:"string"}},required:["terminalId"],type:"object","x-method":"terminal/create","x-side":"client"},CurrentModeUpdate:{description:`The current mode of the session has changed
653
-
654
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
655
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
656
- these keys.
657
-
658
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},currentModeId:{allOf:[{$ref:"#/$defs/SessionModeId"}],description:"The ID of the current mode"}},required:["currentModeId"],type:"object"},DeleteSessionRequest:{description:`**UNSTABLE**
659
-
660
- This capability is not part of the spec yet, and may be removed or changed at any point.
661
-
662
- Request parameters for deleting an existing session from \`session/list\`.
663
-
664
- Only available if the Agent supports the \`sessionCapabilities.delete\` capability.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
665
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
666
- these keys.
667
-
668
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to delete."}},required:["sessionId"],type:"object","x-method":"session/delete","x-side":"agent"},DeleteSessionResponse:{description:`**UNSTABLE**
669
-
670
- This capability is not part of the spec yet, and may be removed or changed at any point.
671
-
672
- Response from deleting a session.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
673
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
674
- these keys.
675
-
676
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"session/delete","x-side":"agent"},DidChangeDocumentNotification:{description:"Notification sent when a file is edited.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
677
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
678
- these keys.
679
-
680
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},contentChanges:{description:"The content changes.",items:{$ref:"#/$defs/TextDocumentContentChangeEvent"},type:"array"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."},uri:{description:"The URI of the changed document.",type:"string"},version:{description:"The new version number of the document.",format:"int64",type:"integer"}},required:["sessionId","uri","version","contentChanges"],type:"object","x-method":"document/didChange","x-side":"agent"},DidCloseDocumentNotification:{description:"Notification sent when a file is closed.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
681
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
682
- these keys.
683
-
684
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."},uri:{description:"The URI of the closed document.",type:"string"}},required:["sessionId","uri"],type:"object","x-method":"document/didClose","x-side":"agent"},DidFocusDocumentNotification:{description:"Notification sent when a file becomes the active editor tab.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
685
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
686
- these keys.
687
-
688
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},position:{allOf:[{$ref:"#/$defs/Position"}],description:"The current cursor position."},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."},uri:{description:"The URI of the focused document.",type:"string"},version:{description:"The version number of the document.",format:"int64",type:"integer"},visibleRange:{allOf:[{$ref:"#/$defs/Range"}],description:"The portion of the file currently visible in the editor viewport."}},required:["sessionId","uri","version","position","visibleRange"],type:"object","x-method":"document/didFocus","x-side":"agent"},DidOpenDocumentNotification:{description:"Notification sent when a file is opened in the editor.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
689
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
690
- these keys.
691
-
692
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},languageId:{description:'The language identifier of the document (e.g., "rust", "python").',type:"string"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."},text:{description:"The full text content of the document.",type:"string"},uri:{description:"The URI of the opened document.",type:"string"},version:{description:"The version number of the document.",format:"int64",type:"integer"}},required:["sessionId","uri","languageId","version","text"],type:"object","x-method":"document/didOpen","x-side":"agent"},DidSaveDocumentNotification:{description:"Notification sent when a file is saved.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
693
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
694
- these keys.
695
-
696
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."},uri:{description:"The URI of the saved document.",type:"string"}},required:["sessionId","uri"],type:"object","x-method":"document/didSave","x-side":"agent"},Diff:{description:`A diff representing file modifications.
697
-
698
- Shows changes to files in a format suitable for display in the client UI.
699
-
700
- See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
701
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
702
- these keys.
703
-
704
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},newText:{description:"The new content after modification.",type:"string"},oldText:{description:"The original content (None for new files).",type:["string","null"]},path:{description:"The file path being modified.",type:"string"}},required:["path","newText"],type:"object"},DisableProvidersRequest:{description:`**UNSTABLE**
705
-
706
- This capability is not part of the spec yet, and may be removed or changed at any point.
707
-
708
- Request parameters for \`providers/disable\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
709
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
710
- these keys.
711
-
712
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},id:{description:"Provider id to disable.",type:"string"}},required:["id"],type:"object","x-method":"providers/disable","x-side":"agent"},DisableProvidersResponse:{description:`**UNSTABLE**
713
-
714
- This capability is not part of the spec yet, and may be removed or changed at any point.
715
-
716
- Response to \`providers/disable\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
717
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
718
- these keys.
719
-
720
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"providers/disable","x-side":"agent"},DisconnectMcpRequest:{description:`**UNSTABLE**
721
-
722
- This capability is not part of the spec yet, and may be removed or changed at any point.
723
-
724
- Request parameters for \`mcp/disconnect\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
725
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
726
- these keys.
727
-
728
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},connectionId:{allOf:[{$ref:"#/$defs/McpConnectionId"}],description:"The MCP-over-ACP connection to close."}},required:["connectionId"],type:"object","x-method":"mcp/disconnect","x-side":"client"},DisconnectMcpResponse:{description:`**UNSTABLE**
729
-
730
- This capability is not part of the spec yet, and may be removed or changed at any point.
731
-
732
- Response to \`mcp/disconnect\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
733
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
734
- these keys.
735
-
736
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"mcp/disconnect","x-side":"client"},ElicitationAcceptAction:{description:`**UNSTABLE**
737
-
738
- This capability is not part of the spec yet, and may be removed or changed at any point.
739
-
740
- The user accepted the elicitation and provided content.`,properties:{content:{additionalProperties:{$ref:"#/$defs/ElicitationContentValue"},description:"The user-provided content, if any, as an object matching the requested schema.",type:["object","null"]}},type:"object"},ElicitationCapabilities:{description:`**UNSTABLE**
741
-
742
- This capability is not part of the spec yet, and may be removed or changed at any point.
743
-
744
- Elicitation capabilities supported by the client.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
745
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
746
- these keys.
747
-
748
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},form:{anyOf:[{$ref:"#/$defs/ElicitationFormCapabilities"},{type:"null"}],description:"Whether the client supports form-based elicitation."},url:{anyOf:[{$ref:"#/$defs/ElicitationUrlCapabilities"},{type:"null"}],description:"Whether the client supports URL-based elicitation."}},type:"object"},ElicitationContentValue:{anyOf:[{title:"String",type:"string"},{format:"int64",title:"Integer",type:"integer"},{format:"double",title:"Number",type:"number"},{title:"Boolean",type:"boolean"},{items:{type:"string"},title:"StringArray",type:"array"}]},ElicitationFormCapabilities:{description:`**UNSTABLE**
749
-
750
- This capability is not part of the spec yet, and may be removed or changed at any point.
751
-
752
- Form-based elicitation capabilities.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
753
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
754
- these keys.
755
-
756
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},ElicitationFormMode:{anyOf:[{allOf:[{$ref:"#/$defs/ElicitationSessionScope"}],description:"Tied to a session, optionally to a specific tool call within that session.",title:"Session"},{allOf:[{$ref:"#/$defs/ElicitationRequestScope"}],description:`Tied to a specific JSON-RPC request outside of a session
757
- (e.g., during auth/configuration phases before any session is started).`,title:"Request"}],description:`**UNSTABLE**
758
-
759
- This capability is not part of the spec yet, and may be removed or changed at any point.
760
-
761
- Form-based elicitation mode where the client renders a form from the provided schema.`,properties:{requestedSchema:{allOf:[{$ref:"#/$defs/ElicitationSchema"}],description:"A JSON Schema describing the form fields to present to the user."}},required:["requestedSchema"],type:"object"},ElicitationId:{description:`**UNSTABLE**
762
-
763
- This capability is not part of the spec yet, and may be removed or changed at any point.
764
-
765
- Unique identifier for an elicitation.`,type:"string"},ElicitationPropertySchema:{description:'Property schema for elicitation form fields.\n\nEach variant corresponds to a JSON Schema `"type"` value.\nSingle-select enums use the `String` variant with `enum` or `oneOf` set.\nMulti-select enums use the `Array` variant.',discriminator:{propertyName:"type"},oneOf:[{allOf:[{$ref:"#/$defs/StringPropertySchema"}],description:"String property (or single-select enum when `enum`/`oneOf` is set).",properties:{type:{const:"string",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/NumberPropertySchema"}],description:"Number (floating-point) property.",properties:{type:{const:"number",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/IntegerPropertySchema"}],description:"Integer property.",properties:{type:{const:"integer",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/BooleanPropertySchema"}],description:"Boolean property.",properties:{type:{const:"boolean",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/MultiSelectPropertySchema"}],description:"Multi-select array property.",properties:{type:{const:"array",type:"string"}},required:["type"],type:"object"}]},ElicitationRequestScope:{description:`**UNSTABLE**
766
-
767
- This capability is not part of the spec yet, and may be removed or changed at any point.
768
-
769
- Request-scoped elicitation, tied to a specific JSON-RPC request outside of a session
770
- (e.g., during auth/configuration phases before any session is started).`,properties:{requestId:{allOf:[{$ref:"#/$defs/RequestId"}],description:"The request this elicitation is tied to."}},required:["requestId"],type:"object"},ElicitationSchema:{description:`Type-safe elicitation schema for requesting structured user input.
771
-
772
- This represents a JSON Schema object with primitive-typed properties,
773
- as required by the elicitation specification.`,properties:{description:{description:"Optional description of what this schema represents.",type:["string","null"]},properties:{additionalProperties:{$ref:"#/$defs/ElicitationPropertySchema"},default:{},description:"Property definitions (must be primitive types).",type:"object"},required:{description:"List of required property names.",items:{type:"string"},type:["array","null"]},title:{description:"Optional title for the schema.",type:["string","null"]},type:{allOf:[{$ref:"#/$defs/ElicitationSchemaType"}],default:"object",description:'Type discriminator. Always `"object"`.'}},type:"object"},ElicitationSchemaType:{description:"Type discriminator for elicitation schemas.",oneOf:[{const:"object",description:"Object schema type.",type:"string"}]},ElicitationSessionScope:{description:`**UNSTABLE**
774
-
775
- This capability is not part of the spec yet, and may be removed or changed at any point.
776
-
777
- Session-scoped elicitation, optionally tied to a specific tool call.
778
-
779
- When \`tool_call_id\` is set, the elicitation is tied to a specific tool call.
780
- This is useful when an agent receives an elicitation from an MCP server
781
- during a tool call and needs to redirect it to the user.`,properties:{sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session this elicitation is tied to."},toolCallId:{anyOf:[{$ref:"#/$defs/ToolCallId"},{type:"null"}],description:"Optional tool call within the session."}},required:["sessionId"],type:"object"},ElicitationStringType:{description:"Items definition for untitled multi-select enum properties.",oneOf:[{const:"string",description:"String schema type.",type:"string"}]},ElicitationUrlCapabilities:{description:`**UNSTABLE**
782
-
783
- This capability is not part of the spec yet, and may be removed or changed at any point.
784
-
785
- URL-based elicitation capabilities.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
786
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
787
- these keys.
788
-
789
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},ElicitationUrlMode:{anyOf:[{allOf:[{$ref:"#/$defs/ElicitationSessionScope"}],description:"Tied to a session, optionally to a specific tool call within that session.",title:"Session"},{allOf:[{$ref:"#/$defs/ElicitationRequestScope"}],description:`Tied to a specific JSON-RPC request outside of a session
790
- (e.g., during auth/configuration phases before any session is started).`,title:"Request"}],description:`**UNSTABLE**
791
-
792
- This capability is not part of the spec yet, and may be removed or changed at any point.
793
-
794
- URL-based elicitation mode where the client directs the user to a URL.`,properties:{elicitationId:{allOf:[{$ref:"#/$defs/ElicitationId"}],description:"The unique identifier for this elicitation."},url:{description:"The URL to direct the user to.",format:"uri",type:"string"}},required:["elicitationId","url"],type:"object"},EmbeddedResource:{description:"The contents of a resource, embedded into a prompt or tool call result.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
795
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
796
- these keys.
797
-
798
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},annotations:{anyOf:[{$ref:"#/$defs/Annotations"},{type:"null"}]},resource:{$ref:"#/$defs/EmbeddedResourceResource"}},required:["resource"],type:"object"},EmbeddedResourceResource:{anyOf:[{allOf:[{$ref:"#/$defs/TextResourceContents"}],title:"TextResourceContents"},{allOf:[{$ref:"#/$defs/BlobResourceContents"}],title:"BlobResourceContents"}],description:"Resource content that can be embedded in a message."},EnumOption:{description:"A titled enum option with a const value and human-readable title.",properties:{const:{description:"The constant value for this option.",type:"string"},title:{description:"Human-readable title for this option.",type:"string"}},required:["const","title"],type:"object"},EnvVariable:{description:"An environment variable to set when launching an MCP server.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
799
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
800
- these keys.
801
-
802
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},name:{description:"The name of the environment variable.",type:"string"},value:{description:"The value to set for the environment variable.",type:"string"}},required:["name","value"],type:"object"},Error:{description:`JSON-RPC error object.
803
-
804
- Represents an error that occurred during method execution, following the
805
- JSON-RPC 2.0 error object specification with optional additional data.
806
-
807
- See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)`,properties:{code:{allOf:[{$ref:"#/$defs/ErrorCode"}],description:`A number indicating the error type that occurred.
808
- This must be an integer as defined in the JSON-RPC specification.`},data:{description:`Optional primitive or structured value that contains additional information about the error.
809
- This may include debugging information or context-specific details.`},message:{description:`A string providing a short description of the error.
810
- The message should be limited to a concise single sentence.`,type:"string"}},required:["code","message"],type:"object"},ErrorCode:{anyOf:[{const:-32700,description:`**Parse error**: Invalid JSON was received by the server.
811
- An error occurred on the server while parsing the JSON text.`,format:"int32",title:"Parse error",type:"integer"},{const:-32600,description:"**Invalid request**: The JSON sent is not a valid Request object.",format:"int32",title:"Invalid request",type:"integer"},{const:-32601,description:"**Method not found**: The method does not exist or is not available.",format:"int32",title:"Method not found",type:"integer"},{const:-32602,description:"**Invalid params**: Invalid method parameter(s).",format:"int32",title:"Invalid params",type:"integer"},{const:-32603,description:`**Internal error**: Internal JSON-RPC error.
812
- Reserved for implementation-defined server errors.`,format:"int32",title:"Internal error",type:"integer"},{const:-32800,description:`**Request cancelled**: **UNSTABLE**
813
-
814
- This capability is not part of the spec yet, and may be removed or changed at any point.
815
-
816
- Execution of the method was aborted either due to a cancellation request from the caller or
817
- because of resource constraints or shutdown.`,format:"int32",title:"Request cancelled",type:"integer"},{const:-32e3,description:"**Authentication required**: Authentication is required before this operation can be performed.",format:"int32",title:"Authentication required",type:"integer"},{const:-32002,description:"**Resource not found**: A given resource, such as a file, was not found.",format:"int32",title:"Resource not found",type:"integer"},{const:-32042,description:`**URL elicitation required**: **UNSTABLE**
818
-
819
- This capability is not part of the spec yet, and may be removed or changed at any point.
820
-
821
- The agent requires user input via a URL-based elicitation before it can proceed.`,format:"int32",title:"URL elicitation required",type:"integer"},{description:"Other undefined error code.",format:"int32",title:"Other",type:"integer"}],description:`Predefined error codes for common JSON-RPC and ACP-specific errors.
822
-
823
- These codes follow the JSON-RPC 2.0 specification for standard errors
824
- and use the reserved range (-32000 to -32099) for protocol-specific errors.`},ExtNotification:{description:`Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
825
- Extension notifications provide a way to send one-way messages for custom functionality
826
- while maintaining protocol compatibility.
827
-
828
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`},ExtRequest:{description:`Allows for sending an arbitrary request that is not part of the ACP spec.
829
- Extension methods provide a way to add custom functionality while maintaining
830
- protocol compatibility.
831
-
832
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`},ExtResponse:{description:`Allows for sending an arbitrary response to an [\`ExtRequest\`] that is not part of the ACP spec.
833
- Extension methods provide a way to add custom functionality while maintaining
834
- protocol compatibility.
835
-
836
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`},FileSystemCapabilities:{description:`File system capabilities that a client may support.
837
-
838
- See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
839
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
840
- these keys.
841
-
842
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},readTextFile:{default:!1,description:"Whether the Client supports `fs/read_text_file` requests.",type:"boolean"},writeTextFile:{default:!1,description:"Whether the Client supports `fs/write_text_file` requests.",type:"boolean"}},type:"object"},ForkSessionRequest:{description:`**UNSTABLE**
843
-
844
- This capability is not part of the spec yet, and may be removed or changed at any point.
845
-
846
- Request parameters for forking an existing session.
847
-
848
- Creates a new session based on the context of an existing one, allowing
849
- operations like generating summaries without affecting the original session's history.
850
-
851
- Only available if the Agent supports the \`session.fork\` capability.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
852
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
853
- these keys.
854
-
855
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},additionalDirectories:{description:`**UNSTABLE**
856
-
857
- This capability is not part of the spec yet, and may be removed or changed at any point.
858
-
859
- Additional workspace roots to activate for this session. Each path must be absolute.
860
-
861
- When omitted or empty, no additional roots are activated. When non-empty,
862
- this is the complete resulting additional-root list for the forked
863
- session.`,items:{type:"string"},type:"array"},cwd:{description:"The working directory for this session.",type:"string"},mcpServers:{description:"List of MCP servers to connect to for this session.",items:{$ref:"#/$defs/McpServer"},type:"array"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to fork."}},required:["sessionId","cwd"],type:"object","x-method":"session/fork","x-side":"agent"},ForkSessionResponse:{description:`**UNSTABLE**
864
-
865
- This capability is not part of the spec yet, and may be removed or changed at any point.
866
-
867
- Response from forking an existing session.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
868
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
869
- these keys.
870
-
871
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configOptions:{description:"Initial session configuration options if supported by the Agent.",items:{$ref:"#/$defs/SessionConfigOption"},type:["array","null"]},models:{anyOf:[{$ref:"#/$defs/SessionModelState"},{type:"null"}],description:`**UNSTABLE**
872
-
873
- This capability is not part of the spec yet, and may be removed or changed at any point.
874
-
875
- Initial model state if supported by the Agent`},modes:{anyOf:[{$ref:"#/$defs/SessionModeState"},{type:"null"}],description:`Initial mode state if supported by the Agent
876
-
877
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"Unique identifier for the newly created forked session."}},required:["sessionId"],type:"object","x-method":"session/fork","x-side":"agent"},HttpHeader:{description:"An HTTP header to set when making requests to the MCP server.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
878
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
879
- these keys.
880
-
881
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},name:{description:"The name of the HTTP header.",type:"string"},value:{description:"The value to set for the HTTP header.",type:"string"}},required:["name","value"],type:"object"},ImageContent:{description:"An image provided to or from an LLM.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
882
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
883
- these keys.
884
-
885
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},annotations:{anyOf:[{$ref:"#/$defs/Annotations"},{type:"null"}]},data:{type:"string"},mimeType:{type:"string"},uri:{type:["string","null"]}},required:["data","mimeType"],type:"object"},Implementation:{description:`Metadata about the implementation of the client or agent.
886
- Describes the name and version of an MCP implementation, with an optional
887
- title for UI representation.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
888
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
889
- these keys.
890
-
891
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},name:{description:`Intended for programmatic or logical use, but can be used as a display
892
- name fallback if title isn’t present.`,type:"string"},title:{description:`Intended for UI and end-user contexts — optimized to be human-readable
893
- and easily understood.
894
-
895
- If not provided, the name should be used for display.`,type:["string","null"]},version:{description:`Version of the implementation. Can be displayed to the user or used
896
- for debugging or metrics purposes. (e.g. "1.0.0").`,type:"string"}},required:["name","version"],type:"object"},InitializeRequest:{description:`Request parameters for the initialize method.
897
-
898
- Sent by the client to establish connection and negotiate capabilities.
899
-
900
- See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
901
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
902
- these keys.
903
-
904
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},clientCapabilities:{allOf:[{$ref:"#/$defs/ClientCapabilities"}],default:{auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1},description:"Capabilities supported by the client."},clientInfo:{anyOf:[{$ref:"#/$defs/Implementation"},{type:"null"}],description:`Information about the Client name and version sent to the Agent.
905
-
906
- Note: in future versions of the protocol, this will be required.`},protocolVersion:{allOf:[{$ref:"#/$defs/ProtocolVersion"}],description:"The latest protocol version supported by the client."}},required:["protocolVersion"],type:"object","x-method":"initialize","x-side":"agent"},InitializeResponse:{description:`Response to the \`initialize\` method.
907
-
908
- Contains the negotiated protocol version and agent capabilities.
909
-
910
- See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
911
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
912
- these keys.
913
-
914
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},agentCapabilities:{allOf:[{$ref:"#/$defs/AgentCapabilities"}],default:{auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}},description:"Capabilities supported by the agent."},agentInfo:{anyOf:[{$ref:"#/$defs/Implementation"},{type:"null"}],description:`Information about the Agent name and version sent to the Client.
915
-
916
- Note: in future versions of the protocol, this will be required.`},authMethods:{default:[],description:"Authentication methods supported by the agent.",items:{$ref:"#/$defs/AuthMethod"},type:"array"},protocolVersion:{allOf:[{$ref:"#/$defs/ProtocolVersion"}],description:`The protocol version the client specified if supported by the agent,
917
- or the latest protocol version supported by the agent.
918
-
919
- The client should disconnect, if it doesn't support this version.`}},required:["protocolVersion"],type:"object","x-method":"initialize","x-side":"agent"},IntegerPropertySchema:{description:"Schema for integer properties in an elicitation form.",properties:{default:{description:"Default value.",format:"int64",type:["integer","null"]},description:{description:"Human-readable description.",type:["string","null"]},maximum:{description:"Maximum value (inclusive).",format:"int64",type:["integer","null"]},minimum:{description:"Minimum value (inclusive).",format:"int64",type:["integer","null"]},title:{description:"Optional title for the property.",type:["string","null"]}},type:"object"},KillTerminalRequest:{description:"Request to kill a terminal without releasing it.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
920
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
921
- these keys.
922
-
923
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."},terminalId:{description:"The ID of the terminal to kill.",type:"string"}},required:["sessionId","terminalId"],type:"object","x-method":"terminal/kill","x-side":"client"},KillTerminalResponse:{description:"Response to `terminal/kill` method",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
924
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
925
- these keys.
926
-
927
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"terminal/kill","x-side":"client"},ListProvidersRequest:{description:`**UNSTABLE**
928
-
929
- This capability is not part of the spec yet, and may be removed or changed at any point.
930
-
931
- Request parameters for \`providers/list\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
932
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
933
- these keys.
934
-
935
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"providers/list","x-side":"agent"},ListProvidersResponse:{description:`**UNSTABLE**
936
-
937
- This capability is not part of the spec yet, and may be removed or changed at any point.
938
-
939
- Response to \`providers/list\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
940
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
941
- these keys.
942
-
943
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},providers:{description:"Configurable providers with current routing info suitable for UI display.",items:{$ref:"#/$defs/ProviderInfo"},type:"array"}},required:["providers"],type:"object","x-method":"providers/list","x-side":"agent"},ListSessionsRequest:{description:"Request parameters for listing existing sessions.\n\nOnly available if the Agent supports the `sessionCapabilities.list` capability.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
944
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
945
- these keys.
946
-
947
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},cursor:{description:"Opaque cursor token from a previous response's nextCursor field for cursor-based pagination",type:["string","null"]},cwd:{description:"Filter sessions by working directory. Must be an absolute path.",type:["string","null"]}},type:"object","x-method":"session/list","x-side":"agent"},ListSessionsResponse:{description:"Response from listing sessions.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
948
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
949
- these keys.
950
-
951
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},nextCursor:{description:`Opaque cursor token. If present, pass this in the next request's cursor parameter
952
- to fetch the next page. If absent, there are no more results.`,type:["string","null"]},sessions:{description:"Array of session information objects",items:{$ref:"#/$defs/SessionInfo"},type:"array"}},required:["sessions"],type:"object","x-method":"session/list","x-side":"agent"},LlmProtocol:{anyOf:[{const:"anthropic",description:"Anthropic API protocol.",type:"string"},{const:"openai",description:"OpenAI API protocol.",type:"string"},{const:"azure",description:"Azure OpenAI API protocol.",type:"string"},{const:"vertex",description:"Google Vertex AI API protocol.",type:"string"},{const:"bedrock",description:"AWS Bedrock API protocol.",type:"string"},{description:"Unknown or custom protocol.",title:"other",type:"string"}],description:`**UNSTABLE**
953
-
954
- This capability is not part of the spec yet, and may be removed or changed at any point.
955
-
956
- Well-known API protocol identifiers for LLM providers.
957
-
958
- Agents and clients MUST handle unknown protocol identifiers gracefully.
959
-
960
- Protocol names beginning with \`_\` are free for custom use, like other ACP extension methods.
961
- Protocol names that do not begin with \`_\` are reserved for the ACP spec.`},LoadSessionRequest:{description:`Request parameters for loading an existing session.
962
-
963
- Only available if the Agent supports the \`loadSession\` capability.
964
-
965
- See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
966
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
967
- these keys.
968
-
969
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},additionalDirectories:{description:`**UNSTABLE**
970
-
971
- This capability is not part of the spec yet, and may be removed or changed at any point.
972
-
973
- Additional workspace roots to activate for this session. Each path must be absolute.
974
-
975
- When omitted or empty, no additional roots are activated. When non-empty,
976
- this is the complete resulting additional-root list for the loaded
977
- session. It may differ from any previously used or reported list as long as
978
- the request \`cwd\` matches the session's \`cwd\`.`,items:{type:"string"},type:"array"},cwd:{description:"The working directory for this session.",type:"string"},mcpServers:{description:"List of MCP servers to connect to for this session.",items:{$ref:"#/$defs/McpServer"},type:"array"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to load."}},required:["mcpServers","cwd","sessionId"],type:"object","x-method":"session/load","x-side":"agent"},LoadSessionResponse:{description:"Response from loading an existing session.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
979
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
980
- these keys.
981
-
982
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configOptions:{description:"Initial session configuration options if supported by the Agent.",items:{$ref:"#/$defs/SessionConfigOption"},type:["array","null"]},models:{anyOf:[{$ref:"#/$defs/SessionModelState"},{type:"null"}],description:`**UNSTABLE**
983
-
984
- This capability is not part of the spec yet, and may be removed or changed at any point.
985
-
986
- Initial model state if supported by the Agent`},modes:{anyOf:[{$ref:"#/$defs/SessionModeState"},{type:"null"}],description:`Initial mode state if supported by the Agent
987
-
988
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`}},type:"object","x-method":"session/load","x-side":"agent"},LogoutCapabilities:{description:`**UNSTABLE**
989
-
990
- This capability is not part of the spec yet, and may be removed or changed at any point.
991
-
992
- Logout capabilities supported by the agent.
993
-
994
- By supplying \`{}\` it means that the agent supports the logout method.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
995
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
996
- these keys.
997
-
998
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},LogoutRequest:{description:`**UNSTABLE**
999
-
1000
- This capability is not part of the spec yet, and may be removed or changed at any point.
1001
-
1002
- Request parameters for the logout method.
1003
-
1004
- Terminates the current authenticated session.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1005
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1006
- these keys.
1007
-
1008
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"logout","x-side":"agent"},LogoutResponse:{description:`**UNSTABLE**
1009
-
1010
- This capability is not part of the spec yet, and may be removed or changed at any point.
1011
-
1012
- Response to the \`logout\` method.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1013
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1014
- these keys.
1015
-
1016
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"logout","x-side":"agent"},McpCapabilities:{description:"MCP capabilities supported by the agent",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1017
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1018
- these keys.
1019
-
1020
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},acp:{default:!1,description:`**UNSTABLE**
1021
-
1022
- This capability is not part of the spec yet, and may be removed or changed at any point.
1023
-
1024
- Agent supports [\`McpServer::Acp\`].`,type:"boolean"},http:{default:!1,description:"Agent supports [`McpServer::Http`].",type:"boolean"},sse:{default:!1,description:"Agent supports [`McpServer::Sse`].",type:"boolean"}},type:"object"},McpConnectionId:{description:`**UNSTABLE**
1025
-
1026
- This capability is not part of the spec yet, and may be removed or changed at any point.
1027
-
1028
- A unique identifier for an active MCP-over-ACP connection.`,type:"string"},McpServer:{anyOf:[{allOf:[{$ref:"#/$defs/McpServerHttp"}],description:"HTTP transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.",properties:{type:{const:"http",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/McpServerSse"}],description:"SSE transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.",properties:{type:{const:"sse",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/McpServerAcp"}],description:`**UNSTABLE**
1029
-
1030
- This capability is not part of the spec yet, and may be removed or changed at any point.
1031
-
1032
- ACP transport configuration
1033
-
1034
- Only available when the Agent capabilities indicate \`mcp_capabilities.acp\` is \`true\`.
1035
- The MCP server is provided by an ACP component and communicates over the ACP channel.`,properties:{type:{const:"acp",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/McpServerStdio"}],description:`Stdio transport configuration
1036
-
1037
- All Agents MUST support this transport.`,title:"stdio"}],description:`Configuration for connecting to an MCP (Model Context Protocol) server.
1038
-
1039
- MCP servers provide tools and context that the agent can use when
1040
- processing prompts.
1041
-
1042
- See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)`},McpServerAcp:{description:`**UNSTABLE**
1043
-
1044
- This capability is not part of the spec yet, and may be removed or changed at any point.
1045
-
1046
- ACP transport configuration for MCP.
1047
-
1048
- The MCP server is provided by an ACP component and communicates over the ACP channel
1049
- using \`mcp/connect\`, \`mcp/message\`, and \`mcp/disconnect\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1050
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1051
- these keys.
1052
-
1053
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},id:{allOf:[{$ref:"#/$defs/McpServerAcpId"}],description:`Unique identifier for this MCP server, generated by the component providing it.
1054
-
1055
- Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible
1056
- on the same ACP connection.`},name:{description:"Human-readable name identifying this MCP server.",type:"string"}},required:["name","id"],type:"object"},McpServerAcpId:{description:`**UNSTABLE**
1057
-
1058
- This capability is not part of the spec yet, and may be removed or changed at any point.
1059
-
1060
- Unique identifier for an MCP server using the ACP transport.
1061
-
1062
- The value is opaque and generated by the ACP component providing the MCP server. It is
1063
- used by \`mcp/connect\` to route connection requests back to the component that declared the
1064
- server.`,type:"string"},McpServerHttp:{description:"HTTP transport configuration for MCP.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1065
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1066
- these keys.
1067
-
1068
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},headers:{description:"HTTP headers to set when making requests to the MCP server.",items:{$ref:"#/$defs/HttpHeader"},type:"array"},name:{description:"Human-readable name identifying this MCP server.",type:"string"},url:{description:"URL to the MCP server.",type:"string"}},required:["name","url","headers"],type:"object"},McpServerSse:{description:"SSE transport configuration for MCP.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1069
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1070
- these keys.
1071
-
1072
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},headers:{description:"HTTP headers to set when making requests to the MCP server.",items:{$ref:"#/$defs/HttpHeader"},type:"array"},name:{description:"Human-readable name identifying this MCP server.",type:"string"},url:{description:"URL to the MCP server.",type:"string"}},required:["name","url","headers"],type:"object"},McpServerStdio:{description:"Stdio transport configuration for MCP.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1073
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1074
- these keys.
1075
-
1076
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},args:{description:"Command-line arguments to pass to the MCP server.",items:{type:"string"},type:"array"},command:{description:"Path to the MCP server executable.",type:"string"},env:{description:"Environment variables to set when launching the MCP server.",items:{$ref:"#/$defs/EnvVariable"},type:"array"},name:{description:"Human-readable name identifying this MCP server.",type:"string"}},required:["name","command","args","env"],type:"object"},MessageMcpNotification:{description:`**UNSTABLE**
1077
-
1078
- This capability is not part of the spec yet, and may be removed or changed at any point.
1079
-
1080
- Notification parameters for \`mcp/message\`.
1081
-
1082
- This is used when the wrapped MCP message is a notification and the outer JSON-RPC
1083
- envelope has no \`id\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1084
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1085
- these keys.
1086
-
1087
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},connectionId:{allOf:[{$ref:"#/$defs/McpConnectionId"}],description:"The MCP-over-ACP connection this message is sent on."},method:{description:"The inner MCP method name.",type:"string"},params:{additionalProperties:!0,description:"Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params.",type:["object","null"]}},required:["connectionId","method"],type:"object","x-method":"mcp/message","x-side":"both"},MessageMcpRequest:{description:`**UNSTABLE**
1088
-
1089
- This capability is not part of the spec yet, and may be removed or changed at any point.
1090
-
1091
- Request parameters for \`mcp/message\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1092
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1093
- these keys.
1094
-
1095
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},connectionId:{allOf:[{$ref:"#/$defs/McpConnectionId"}],description:"The MCP-over-ACP connection this message is sent on."},method:{description:"The inner MCP method name.",type:"string"},params:{additionalProperties:!0,description:"Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params.",type:["object","null"]}},required:["connectionId","method"],type:"object","x-method":"mcp/message","x-side":"both"},MessageMcpResponse:{description:`**UNSTABLE**
1096
-
1097
- This capability is not part of the spec yet, and may be removed or changed at any point.
1098
-
1099
- Response to \`mcp/message\`.
1100
-
1101
- This is the inner MCP response result payload. Any JSON value is valid.`,"x-method":"mcp/message","x-side":"both"},ModelId:{description:`**UNSTABLE**
1102
-
1103
- This capability is not part of the spec yet, and may be removed or changed at any point.
1104
-
1105
- A unique identifier for a model.`,type:"string"},ModelInfo:{description:`**UNSTABLE**
1106
-
1107
- This capability is not part of the spec yet, and may be removed or changed at any point.
1108
-
1109
- Information about a selectable model.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1110
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1111
- these keys.
1112
-
1113
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},description:{description:"Optional description of the model.",type:["string","null"]},modelId:{allOf:[{$ref:"#/$defs/ModelId"}],description:"Unique identifier for the model."},name:{description:"Human-readable name of the model.",type:"string"}},required:["modelId","name"],type:"object"},MultiSelectItems:{anyOf:[{allOf:[{$ref:"#/$defs/UntitledMultiSelectItems"}],description:"Untitled multi-select items with plain string values.",title:"Untitled"},{allOf:[{$ref:"#/$defs/TitledMultiSelectItems"}],description:"Titled multi-select items with human-readable labels.",title:"Titled"}],description:"Items for a multi-select (array) property schema."},MultiSelectPropertySchema:{description:"Schema for multi-select (array) properties in an elicitation form.",properties:{default:{description:"Default selected values.",items:{type:"string"},type:["array","null"]},description:{description:"Human-readable description.",type:["string","null"]},items:{allOf:[{$ref:"#/$defs/MultiSelectItems"}],description:"The items definition describing allowed values."},maxItems:{description:"Maximum number of items to select.",format:"uint64",minimum:0,type:["integer","null"]},minItems:{description:"Minimum number of items to select.",format:"uint64",minimum:0,type:["integer","null"]},title:{description:"Optional title for the property.",type:["string","null"]}},required:["items"],type:"object"},NesCapabilities:{description:"NES capabilities advertised by the agent during initialization.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1114
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1115
- these keys.
1116
-
1117
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},context:{anyOf:[{$ref:"#/$defs/NesContextCapabilities"},{type:"null"}],description:"Context the agent wants attached to each suggestion request."},events:{anyOf:[{$ref:"#/$defs/NesEventCapabilities"},{type:"null"}],description:"Events the agent wants to receive."}},type:"object"},NesContextCapabilities:{description:"Context capabilities the agent wants attached to each suggestion request.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1118
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1119
- these keys.
1120
-
1121
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},diagnostics:{anyOf:[{$ref:"#/$defs/NesDiagnosticsCapabilities"},{type:"null"}],description:"Whether the agent wants diagnostics context."},editHistory:{anyOf:[{$ref:"#/$defs/NesEditHistoryCapabilities"},{type:"null"}],description:"Whether the agent wants edit history context."},openFiles:{anyOf:[{$ref:"#/$defs/NesOpenFilesCapabilities"},{type:"null"}],description:"Whether the agent wants open files context."},recentFiles:{anyOf:[{$ref:"#/$defs/NesRecentFilesCapabilities"},{type:"null"}],description:"Whether the agent wants recent files context."},relatedSnippets:{anyOf:[{$ref:"#/$defs/NesRelatedSnippetsCapabilities"},{type:"null"}],description:"Whether the agent wants related snippets context."},userActions:{anyOf:[{$ref:"#/$defs/NesUserActionsCapabilities"},{type:"null"}],description:"Whether the agent wants user actions context."}},type:"object"},NesDiagnostic:{description:"A diagnostic (error, warning, etc.).",properties:{message:{description:"The diagnostic message.",type:"string"},range:{allOf:[{$ref:"#/$defs/Range"}],description:"The range of the diagnostic."},severity:{allOf:[{$ref:"#/$defs/NesDiagnosticSeverity"}],description:"The severity of the diagnostic."},uri:{description:"The URI of the file containing the diagnostic.",type:"string"}},required:["uri","range","severity","message"],type:"object"},NesDiagnosticSeverity:{description:"Severity of a diagnostic.",oneOf:[{const:"error",description:"An error.",type:"string"},{const:"warning",description:"A warning.",type:"string"},{const:"information",description:"An informational message.",type:"string"},{const:"hint",description:"A hint.",type:"string"}]},NesDiagnosticsCapabilities:{description:"Capabilities for diagnostics context.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1122
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1123
- these keys.
1124
-
1125
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesDocumentDidChangeCapabilities:{description:"Capabilities for `document/didChange` events.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1126
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1127
- these keys.
1128
-
1129
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},syncKind:{allOf:[{$ref:"#/$defs/TextDocumentSyncKind"}],description:'The sync kind the agent wants: `"full"` or `"incremental"`.'}},required:["syncKind"],type:"object"},NesDocumentDidCloseCapabilities:{description:"Marker for `document/didClose` capability support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1130
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1131
- these keys.
1132
-
1133
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesDocumentDidFocusCapabilities:{description:"Marker for `document/didFocus` capability support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1134
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1135
- these keys.
1136
-
1137
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesDocumentDidOpenCapabilities:{description:"Marker for `document/didOpen` capability support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1138
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1139
- these keys.
1140
-
1141
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesDocumentDidSaveCapabilities:{description:"Marker for `document/didSave` capability support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1142
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1143
- these keys.
1144
-
1145
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesDocumentEventCapabilities:{description:"Document event capabilities the agent wants to receive.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1146
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1147
- these keys.
1148
-
1149
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},didChange:{anyOf:[{$ref:"#/$defs/NesDocumentDidChangeCapabilities"},{type:"null"}],description:"Whether the agent wants `document/didChange` events, and the sync kind."},didClose:{anyOf:[{$ref:"#/$defs/NesDocumentDidCloseCapabilities"},{type:"null"}],description:"Whether the agent wants `document/didClose` events."},didFocus:{anyOf:[{$ref:"#/$defs/NesDocumentDidFocusCapabilities"},{type:"null"}],description:"Whether the agent wants `document/didFocus` events."},didOpen:{anyOf:[{$ref:"#/$defs/NesDocumentDidOpenCapabilities"},{type:"null"}],description:"Whether the agent wants `document/didOpen` events."},didSave:{anyOf:[{$ref:"#/$defs/NesDocumentDidSaveCapabilities"},{type:"null"}],description:"Whether the agent wants `document/didSave` events."}},type:"object"},NesEditHistoryCapabilities:{description:"Capabilities for edit history context.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1150
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1151
- these keys.
1152
-
1153
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},maxCount:{description:"Maximum number of edit history entries the agent can use.",format:"uint32",minimum:0,type:["integer","null"]}},type:"object"},NesEditHistoryEntry:{description:"An entry in the edit history.",properties:{diff:{description:"A diff representing the edit.",type:"string"},uri:{description:"The URI of the edited file.",type:"string"}},required:["uri","diff"],type:"object"},NesEditSuggestion:{description:"A text edit suggestion.",properties:{cursorPosition:{anyOf:[{$ref:"#/$defs/Position"},{type:"null"}],description:"Optional suggested cursor position after applying edits."},edits:{description:"The text edits to apply.",items:{$ref:"#/$defs/NesTextEdit"},type:"array"},id:{description:"Unique identifier for accept/reject tracking.",type:"string"},uri:{description:"The URI of the file to edit.",type:"string"}},required:["id","uri","edits"],type:"object"},NesEventCapabilities:{description:"Event capabilities the agent can consume.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1154
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1155
- these keys.
1156
-
1157
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},document:{anyOf:[{$ref:"#/$defs/NesDocumentEventCapabilities"},{type:"null"}],description:"Document event capabilities."}},type:"object"},NesExcerpt:{description:"A code excerpt from a file.",properties:{endLine:{description:"The end line of the excerpt (zero-based).",format:"uint32",minimum:0,type:"integer"},startLine:{description:"The start line of the excerpt (zero-based).",format:"uint32",minimum:0,type:"integer"},text:{description:"The text content of the excerpt.",type:"string"}},required:["startLine","endLine","text"],type:"object"},NesJumpCapabilities:{description:"Marker for jump suggestion support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1158
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1159
- these keys.
1160
-
1161
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesJumpSuggestion:{description:"A jump-to-location suggestion.",properties:{id:{description:"Unique identifier for accept/reject tracking.",type:"string"},position:{allOf:[{$ref:"#/$defs/Position"}],description:"The target position within the file."},uri:{description:"The file to navigate to.",type:"string"}},required:["id","uri","position"],type:"object"},NesOpenFile:{description:"An open file in the editor.",properties:{languageId:{description:"The language identifier.",type:"string"},lastFocusedMs:{description:"Timestamp in milliseconds since epoch of when the file was last focused.",format:"uint64",minimum:0,type:["integer","null"]},uri:{description:"The URI of the file.",type:"string"},visibleRange:{anyOf:[{$ref:"#/$defs/Range"},{type:"null"}],description:"The visible range in the editor, if any."}},required:["uri","languageId"],type:"object"},NesOpenFilesCapabilities:{description:"Capabilities for open files context.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1162
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1163
- these keys.
1164
-
1165
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesRecentFile:{description:"A recently accessed file.",properties:{languageId:{description:"The language identifier.",type:"string"},text:{description:"The full text content of the file.",type:"string"},uri:{description:"The URI of the file.",type:"string"}},required:["uri","languageId","text"],type:"object"},NesRecentFilesCapabilities:{description:"Capabilities for recent files context.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1166
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1167
- these keys.
1168
-
1169
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},maxCount:{description:"Maximum number of recent files the agent can use.",format:"uint32",minimum:0,type:["integer","null"]}},type:"object"},NesRejectReason:{description:"The reason a suggestion was rejected.",oneOf:[{const:"rejected",description:"The user explicitly dismissed the suggestion.",type:"string"},{const:"ignored",description:"The suggestion was shown but the user continued editing without interacting.",type:"string"},{const:"replaced",description:"The suggestion was superseded by a newer suggestion.",type:"string"},{const:"cancelled",description:"The request was cancelled before the agent returned a response.",type:"string"}]},NesRelatedSnippet:{description:"A related code snippet from a file.",properties:{excerpts:{description:"The code excerpts.",items:{$ref:"#/$defs/NesExcerpt"},type:"array"},uri:{description:"The URI of the file containing the snippets.",type:"string"}},required:["uri","excerpts"],type:"object"},NesRelatedSnippetsCapabilities:{description:"Capabilities for related snippets context.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1170
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1171
- these keys.
1172
-
1173
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesRenameCapabilities:{description:"Marker for rename suggestion support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1174
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1175
- these keys.
1176
-
1177
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesRenameSuggestion:{description:"A rename symbol suggestion.",properties:{id:{description:"Unique identifier for accept/reject tracking.",type:"string"},newName:{description:"The new name for the symbol.",type:"string"},position:{allOf:[{$ref:"#/$defs/Position"}],description:"The position of the symbol to rename."},uri:{description:"The file URI containing the symbol.",type:"string"}},required:["id","uri","position","newName"],type:"object"},NesRepository:{description:"Repository metadata for an NES session.",properties:{name:{description:"The repository name.",type:"string"},owner:{description:"The repository owner.",type:"string"},remoteUrl:{description:"The remote URL of the repository.",type:"string"}},required:["name","owner","remoteUrl"],type:"object"},NesSearchAndReplaceCapabilities:{description:"Marker for search and replace suggestion support.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1178
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1179
- these keys.
1180
-
1181
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},NesSearchAndReplaceSuggestion:{description:"A search-and-replace suggestion.",properties:{id:{description:"Unique identifier for accept/reject tracking.",type:"string"},isRegex:{description:"Whether `search` is a regular expression. Defaults to `false`.",type:["boolean","null"]},replace:{description:"The replacement text.",type:"string"},search:{description:"The text or pattern to find.",type:"string"},uri:{description:"The file URI to search within.",type:"string"}},required:["id","uri","search","replace"],type:"object"},NesSuggestContext:{description:"Context attached to a suggestion request.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1182
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1183
- these keys.
1184
-
1185
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},diagnostics:{description:"Current diagnostics (errors, warnings).",items:{$ref:"#/$defs/NesDiagnostic"},type:["array","null"]},editHistory:{description:"Recent edit history.",items:{$ref:"#/$defs/NesEditHistoryEntry"},type:["array","null"]},openFiles:{description:"Currently open files in the editor.",items:{$ref:"#/$defs/NesOpenFile"},type:["array","null"]},recentFiles:{description:"Recently accessed files.",items:{$ref:"#/$defs/NesRecentFile"},type:["array","null"]},relatedSnippets:{description:"Related code snippets.",items:{$ref:"#/$defs/NesRelatedSnippet"},type:["array","null"]},userActions:{description:"Recent user actions (typing, navigation, etc.).",items:{$ref:"#/$defs/NesUserAction"},type:["array","null"]}},type:"object"},NesSuggestion:{description:"A suggestion returned by the agent.",discriminator:{propertyName:"kind"},oneOf:[{allOf:[{$ref:"#/$defs/NesEditSuggestion"}],description:"A text edit suggestion.",properties:{kind:{const:"edit",type:"string"}},required:["kind"],type:"object"},{allOf:[{$ref:"#/$defs/NesJumpSuggestion"}],description:"A jump-to-location suggestion.",properties:{kind:{const:"jump",type:"string"}},required:["kind"],type:"object"},{allOf:[{$ref:"#/$defs/NesRenameSuggestion"}],description:"A rename symbol suggestion.",properties:{kind:{const:"rename",type:"string"}},required:["kind"],type:"object"},{allOf:[{$ref:"#/$defs/NesSearchAndReplaceSuggestion"}],description:"A search-and-replace suggestion.",properties:{kind:{const:"searchAndReplace",type:"string"}},required:["kind"],type:"object"}]},NesTextEdit:{description:"A text edit within a suggestion.",properties:{newText:{description:"The replacement text.",type:"string"},range:{allOf:[{$ref:"#/$defs/Range"}],description:"The range to replace."}},required:["range","newText"],type:"object"},NesTriggerKind:{description:"What triggered the suggestion request.",oneOf:[{const:"automatic",description:"Triggered by user typing or cursor movement.",type:"string"},{const:"diagnostic",description:"Triggered by a diagnostic appearing at or near the cursor.",type:"string"},{const:"manual",description:"Triggered by an explicit user action (keyboard shortcut).",type:"string"}]},NesUserAction:{description:"A user action (typing, cursor movement, etc.).",properties:{action:{description:'The kind of action (e.g., "insertChar", "cursorMovement").',type:"string"},position:{allOf:[{$ref:"#/$defs/Position"}],description:"The position where the action occurred."},timestampMs:{description:"Timestamp in milliseconds since epoch.",format:"uint64",minimum:0,type:"integer"},uri:{description:"The URI of the file where the action occurred.",type:"string"}},required:["action","uri","position","timestampMs"],type:"object"},NesUserActionsCapabilities:{description:"Capabilities for user actions context.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1186
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1187
- these keys.
1188
-
1189
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},maxCount:{description:"Maximum number of user actions the agent can use.",format:"uint32",minimum:0,type:["integer","null"]}},type:"object"},NewSessionRequest:{description:`Request parameters for creating a new session.
1190
-
1191
- See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1192
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1193
- these keys.
1194
-
1195
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},additionalDirectories:{description:`**UNSTABLE**
1196
-
1197
- This capability is not part of the spec yet, and may be removed or changed at any point.
1198
-
1199
- Additional workspace roots for this session. Each path must be absolute.
1200
-
1201
- These expand the session's filesystem scope without changing \`cwd\`, which
1202
- remains the base for relative paths. When omitted or empty, no
1203
- additional roots are activated for the new session.`,items:{type:"string"},type:"array"},cwd:{description:"The working directory for this session. Must be an absolute path.",type:"string"},mcpServers:{description:"List of MCP (Model Context Protocol) servers the agent should connect to.",items:{$ref:"#/$defs/McpServer"},type:"array"}},required:["cwd","mcpServers"],type:"object","x-method":"session/new","x-side":"agent"},NewSessionResponse:{description:`Response from creating a new session.
1204
-
1205
- See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1206
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1207
- these keys.
1208
-
1209
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configOptions:{description:"Initial session configuration options if supported by the Agent.",items:{$ref:"#/$defs/SessionConfigOption"},type:["array","null"]},models:{anyOf:[{$ref:"#/$defs/SessionModelState"},{type:"null"}],description:`**UNSTABLE**
1210
-
1211
- This capability is not part of the spec yet, and may be removed or changed at any point.
1212
-
1213
- Initial model state if supported by the Agent`},modes:{anyOf:[{$ref:"#/$defs/SessionModeState"},{type:"null"}],description:`Initial mode state if supported by the Agent
1214
-
1215
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:`Unique identifier for the created session.
1216
-
1217
- Used in all subsequent requests for this conversation.`}},required:["sessionId"],type:"object","x-method":"session/new","x-side":"agent"},NumberPropertySchema:{description:"Schema for number (floating-point) properties in an elicitation form.",properties:{default:{description:"Default value.",format:"double",type:["number","null"]},description:{description:"Human-readable description.",type:["string","null"]},maximum:{description:"Maximum value (inclusive).",format:"double",type:["number","null"]},minimum:{description:"Minimum value (inclusive).",format:"double",type:["number","null"]},title:{description:"Optional title for the property.",type:["string","null"]}},type:"object"},PermissionOption:{description:"An option presented to the user when requesting permission.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1218
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1219
- these keys.
1220
-
1221
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},kind:{allOf:[{$ref:"#/$defs/PermissionOptionKind"}],description:"Hint about the nature of this permission option."},name:{description:"Human-readable label to display to the user.",type:"string"},optionId:{allOf:[{$ref:"#/$defs/PermissionOptionId"}],description:"Unique identifier for this permission option."}},required:["optionId","name","kind"],type:"object"},PermissionOptionId:{description:"Unique identifier for a permission option.",type:"string"},PermissionOptionKind:{description:`The type of permission option being presented to the user.
1222
-
1223
- Helps clients choose appropriate icons and UI treatment.`,oneOf:[{const:"allow_once",description:"Allow this operation only this time.",type:"string"},{const:"allow_always",description:"Allow this operation and remember the choice.",type:"string"},{const:"reject_once",description:"Reject this operation only this time.",type:"string"},{const:"reject_always",description:"Reject this operation and remember the choice.",type:"string"}]},Plan:{description:`An execution plan for accomplishing complex tasks.
1224
-
1225
- Plans consist of multiple entries representing individual tasks or goals.
1226
- Agents report plans to clients to provide visibility into their execution strategy.
1227
- Plans can evolve during execution as the agent discovers new requirements or completes tasks.
1228
-
1229
- See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1230
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1231
- these keys.
1232
-
1233
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},entries:{description:`The list of tasks to be accomplished.
1234
-
1235
- When updating a plan, the agent must send a complete list of all entries
1236
- with their current status. The client replaces the entire plan with each update.`,items:{$ref:"#/$defs/PlanEntry"},type:"array"}},required:["entries"],type:"object"},PlanEntry:{description:`A single entry in the execution plan.
1237
-
1238
- Represents a task or goal that the assistant intends to accomplish
1239
- as part of fulfilling the user's request.
1240
- See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1241
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1242
- these keys.
1243
-
1244
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{description:"Human-readable description of what this task aims to accomplish.",type:"string"},priority:{allOf:[{$ref:"#/$defs/PlanEntryPriority"}],description:`The relative importance of this task.
1245
- Used to indicate which tasks are most critical to the overall goal.`},status:{allOf:[{$ref:"#/$defs/PlanEntryStatus"}],description:"Current execution status of this task."}},required:["content","priority","status"],type:"object"},PlanEntryPriority:{description:`Priority levels for plan entries.
1246
-
1247
- Used to indicate the relative importance or urgency of different
1248
- tasks in the execution plan.
1249
- See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)`,oneOf:[{const:"high",description:"High priority task - critical to the overall goal.",type:"string"},{const:"medium",description:"Medium priority task - important but not critical.",type:"string"},{const:"low",description:"Low priority task - nice to have but not essential.",type:"string"}]},PlanEntryStatus:{description:`Status of a plan entry in the execution flow.
1250
-
1251
- Tracks the lifecycle of each task from planning through completion.
1252
- See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)`,oneOf:[{const:"pending",description:"The task has not started yet.",type:"string"},{const:"in_progress",description:"The task is currently being worked on.",type:"string"},{const:"completed",description:"The task has been successfully completed.",type:"string"}]},Position:{description:"A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.",properties:{character:{description:"Zero-based character offset (encoding-dependent).",format:"uint32",minimum:0,type:"integer"},line:{description:"Zero-based line number.",format:"uint32",minimum:0,type:"integer"}},required:["line","character"],type:"object"},PositionEncodingKind:{description:`The encoding used for character offsets in positions.
1253
-
1254
- Follows the same conventions as LSP 3.17. The default is UTF-16.`,oneOf:[{const:"utf-16",description:"Character offsets count UTF-16 code units. This is the default.",type:"string"},{const:"utf-32",description:"Character offsets count Unicode code points.",type:"string"},{const:"utf-8",description:"Character offsets count UTF-8 code units (bytes).",type:"string"}]},PromptCapabilities:{description:`Prompt capabilities supported by the agent in \`session/prompt\` requests.
1255
-
1256
- Baseline agent functionality requires support for [\`ContentBlock::Text\`]
1257
- and [\`ContentBlock::ResourceLink\`] in prompt requests.
1258
-
1259
- Other variants must be explicitly opted in to.
1260
- Capabilities for different types of content in prompt requests.
1261
-
1262
- Indicates which content types beyond the baseline (text and resource links)
1263
- the agent can process.
1264
-
1265
- See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1266
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1267
- these keys.
1268
-
1269
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},audio:{default:!1,description:"Agent supports [`ContentBlock::Audio`].",type:"boolean"},embeddedContext:{default:!1,description:"Agent supports embedded context in `session/prompt` requests.\n\nWhen enabled, the Client is allowed to include [`ContentBlock::Resource`]\nin prompt requests for pieces of context that are referenced in the message.",type:"boolean"},image:{default:!1,description:"Agent supports [`ContentBlock::Image`].",type:"boolean"}},type:"object"},PromptRequest:{description:`Request parameters for sending a user prompt to the agent.
1270
-
1271
- Contains the user's message and any additional context.
1272
-
1273
- See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1274
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1275
- these keys.
1276
-
1277
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},messageId:{description:`**UNSTABLE**
1278
-
1279
- This capability is not part of the spec yet, and may be removed or changed at any point.
1280
-
1281
- A client-generated unique identifier for this user message.
1282
-
1283
- If provided, the Agent SHOULD echo this value as \`userMessageId\` in the
1284
- [\`PromptResponse\`] to confirm it was recorded.
1285
- Both clients and agents MUST use UUID format for message IDs.`,type:["string","null"]},prompt:{description:"The blocks of content that compose the user's message.\n\nAs a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`],\nwhile other variants are optionally enabled via [`PromptCapabilities`].\n\nThe Client MUST adapt its interface according to [`PromptCapabilities`].\n\nThe client MAY include referenced pieces of context as either\n[`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`].\n\nWhen available, [`ContentBlock::Resource`] is preferred\nas it avoids extra round-trips and allows the message to include\npieces of context from sources the agent may not have access to.",items:{$ref:"#/$defs/ContentBlock"},type:"array"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to send this user message to"}},required:["sessionId","prompt"],type:"object","x-method":"session/prompt","x-side":"agent"},PromptResponse:{description:`Response from processing a user prompt.
1286
-
1287
- See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1288
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1289
- these keys.
1290
-
1291
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},stopReason:{allOf:[{$ref:"#/$defs/StopReason"}],description:"Indicates why the agent stopped processing the turn."},usage:{anyOf:[{$ref:"#/$defs/Usage"},{type:"null"}],description:`**UNSTABLE**
1292
-
1293
- This capability is not part of the spec yet, and may be removed or changed at any point.
1294
-
1295
- Token usage for this turn (optional).`},userMessageId:{description:`**UNSTABLE**
1296
-
1297
- This capability is not part of the spec yet, and may be removed or changed at any point.
1298
-
1299
- The acknowledged user message ID.
1300
-
1301
- If the client provided a \`messageId\` in the [\`PromptRequest\`], the agent echoes it here
1302
- to confirm it was recorded. If the client did not provide one, the agent MAY assign one
1303
- and return it here. Absence of this field indicates the agent did not record a message ID.`,type:["string","null"]}},required:["stopReason"],type:"object","x-method":"session/prompt","x-side":"agent"},ProtocolVersion:{description:`Protocol version identifier.
1304
-
1305
- This version is only bumped for breaking changes.
1306
- Non-breaking changes should be introduced via capabilities.`,format:"uint16",maximum:65535,minimum:0,type:"integer"},ProviderCurrentConfig:{description:`**UNSTABLE**
1307
-
1308
- This capability is not part of the spec yet, and may be removed or changed at any point.
1309
-
1310
- Current effective non-secret routing configuration for a provider.`,properties:{apiType:{allOf:[{$ref:"#/$defs/LlmProtocol"}],description:"Protocol currently used by this provider."},baseUrl:{description:"Base URL currently used by this provider.",type:"string"}},required:["apiType","baseUrl"],type:"object"},ProviderInfo:{description:`**UNSTABLE**
1311
-
1312
- This capability is not part of the spec yet, and may be removed or changed at any point.
1313
-
1314
- Information about a configurable LLM provider.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1315
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1316
- these keys.
1317
-
1318
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},current:{anyOf:[{$ref:"#/$defs/ProviderCurrentConfig"},{type:"null"}],description:`Current effective non-secret routing config.
1319
- Null or omitted means provider is disabled.`},id:{description:'Provider identifier, for example "main" or "openai".',type:"string"},required:{description:"Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, clients must not call `providers/disable` for this id.",type:"boolean"},supported:{description:"Supported protocol types for this provider.",items:{$ref:"#/$defs/LlmProtocol"},type:"array"}},required:["id","supported","required"],type:"object"},ProvidersCapabilities:{description:`**UNSTABLE**
1320
-
1321
- This capability is not part of the spec yet, and may be removed or changed at any point.
1322
-
1323
- Provider configuration capabilities supported by the agent.
1324
-
1325
- By supplying \`{}\` it means that the agent supports provider configuration methods.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1326
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1327
- these keys.
1328
-
1329
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},Range:{description:"A range in a text document, expressed as start and end positions.",properties:{end:{allOf:[{$ref:"#/$defs/Position"}],description:"The end position (exclusive)."},start:{allOf:[{$ref:"#/$defs/Position"}],description:"The start position (inclusive)."}},required:["start","end"],type:"object"},ReadTextFileRequest:{description:"Request to read content from a text file.\n\nOnly available if the client supports the `fs.readTextFile` capability.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1330
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1331
- these keys.
1332
-
1333
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},limit:{description:"Maximum number of lines to read.",format:"uint32",minimum:0,type:["integer","null"]},line:{description:"Line number to start reading from (1-based).",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"Absolute path to the file to read.",type:"string"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."}},required:["sessionId","path"],type:"object","x-method":"fs/read_text_file","x-side":"client"},ReadTextFileResponse:{description:"Response containing the contents of a text file.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1334
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1335
- these keys.
1336
-
1337
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{type:"string"}},required:["content"],type:"object","x-method":"fs/read_text_file","x-side":"client"},RejectNesNotification:{description:"Notification sent when a suggestion is rejected.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1338
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1339
- these keys.
1340
-
1341
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},id:{description:"The ID of the rejected suggestion.",type:"string"},reason:{anyOf:[{$ref:"#/$defs/NesRejectReason"},{type:"null"}],description:"The reason for rejection."},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this notification."}},required:["sessionId","id"],type:"object","x-method":"nes/reject","x-side":"agent"},ReleaseTerminalRequest:{description:"Request to release a terminal and free its resources.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1342
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1343
- these keys.
1344
-
1345
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."},terminalId:{description:"The ID of the terminal to release.",type:"string"}},required:["sessionId","terminalId"],type:"object","x-method":"terminal/release","x-side":"client"},ReleaseTerminalResponse:{description:"Response to terminal/release method",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1346
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1347
- these keys.
1348
-
1349
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"terminal/release","x-side":"client"},RequestId:{anyOf:[{title:"Null",type:"null"},{format:"int64",title:"Number",type:"integer"},{title:"Str",type:"string"}],description:`JSON RPC Request Id
1350
-
1351
- An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null \\[1\\] and Numbers SHOULD NOT contain fractional parts \\[2\\]
1352
-
1353
- The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
1354
-
1355
- \\[1\\] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
1356
-
1357
- \\[2\\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.`},RequestPermissionOutcome:{description:"The outcome of a permission request.",discriminator:{propertyName:"outcome"},oneOf:[{description:"The prompt turn was cancelled before the user responded.\n\nWhen a client sends a `session/cancel` notification to cancel an ongoing\nprompt turn, it MUST respond to all pending `session/request_permission`\nrequests with this `Cancelled` outcome.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)",properties:{outcome:{const:"cancelled",type:"string"}},required:["outcome"],type:"object"},{allOf:[{$ref:"#/$defs/SelectedPermissionOutcome"}],description:"The user selected one of the provided options.",properties:{outcome:{const:"selected",type:"string"}},required:["outcome"],type:"object"}]},RequestPermissionRequest:{description:`Request for user permission to execute a tool call.
1358
-
1359
- Sent when the agent needs authorization before performing a sensitive operation.
1360
-
1361
- See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1362
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1363
- these keys.
1364
-
1365
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},options:{description:"Available permission options for the user to choose from.",items:{$ref:"#/$defs/PermissionOption"},type:"array"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."},toolCall:{allOf:[{$ref:"#/$defs/ToolCallUpdate"}],description:"Details about the tool call requiring permission."}},required:["sessionId","toolCall","options"],type:"object","x-method":"session/request_permission","x-side":"client"},RequestPermissionResponse:{description:"Response to a permission request.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1366
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1367
- these keys.
1368
-
1369
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},outcome:{allOf:[{$ref:"#/$defs/RequestPermissionOutcome"}],description:"The user's decision on the permission request."}},required:["outcome"],type:"object","x-method":"session/request_permission","x-side":"client"},ResourceLink:{description:"A resource that the server is capable of reading, included in a prompt or tool call result.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1370
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1371
- these keys.
1372
-
1373
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},annotations:{anyOf:[{$ref:"#/$defs/Annotations"},{type:"null"}]},description:{type:["string","null"]},mimeType:{type:["string","null"]},name:{type:"string"},size:{format:"int64",type:["integer","null"]},title:{type:["string","null"]},uri:{type:"string"}},required:["name","uri"],type:"object"},ResumeSessionRequest:{description:`Request parameters for resuming an existing session.
1374
-
1375
- Resumes an existing session without returning previous messages (unlike \`session/load\`).
1376
- This is useful for agents that can resume sessions but don't implement full session loading.
1377
-
1378
- Only available if the Agent supports the \`sessionCapabilities.resume\` capability.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1379
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1380
- these keys.
1381
-
1382
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},additionalDirectories:{description:`**UNSTABLE**
1383
-
1384
- This capability is not part of the spec yet, and may be removed or changed at any point.
1385
-
1386
- Additional workspace roots to activate for this session. Each path must be absolute.
1387
-
1388
- When omitted or empty, no additional roots are activated. When non-empty,
1389
- this is the complete resulting additional-root list for the resumed
1390
- session. It may differ from any previously used or reported list as long as
1391
- the request \`cwd\` matches the session's \`cwd\`.`,items:{type:"string"},type:"array"},cwd:{description:"The working directory for this session.",type:"string"},mcpServers:{description:"List of MCP servers to connect to for this session.",items:{$ref:"#/$defs/McpServer"},type:"array"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to resume."}},required:["sessionId","cwd"],type:"object","x-method":"session/resume","x-side":"agent"},ResumeSessionResponse:{description:"Response from resuming an existing session.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1392
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1393
- these keys.
1394
-
1395
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configOptions:{description:"Initial session configuration options if supported by the Agent.",items:{$ref:"#/$defs/SessionConfigOption"},type:["array","null"]},models:{anyOf:[{$ref:"#/$defs/SessionModelState"},{type:"null"}],description:`**UNSTABLE**
1396
-
1397
- This capability is not part of the spec yet, and may be removed or changed at any point.
1398
-
1399
- Initial model state if supported by the Agent`},modes:{anyOf:[{$ref:"#/$defs/SessionModeState"},{type:"null"}],description:`Initial mode state if supported by the Agent
1400
-
1401
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`}},type:"object","x-method":"session/resume","x-side":"agent"},Role:{description:"The sender or recipient of messages and data in a conversation.",enum:["assistant","user"],type:"string"},SelectedPermissionOutcome:{description:"The user selected one of the provided options.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1402
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1403
- these keys.
1404
-
1405
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},optionId:{allOf:[{$ref:"#/$defs/PermissionOptionId"}],description:"The ID of the option the user selected."}},required:["optionId"],type:"object"},SessionAdditionalDirectoriesCapabilities:{description:`**UNSTABLE**
1406
-
1407
- This capability is not part of the spec yet, and may be removed or changed at any point.
1408
-
1409
- Capabilities for additional session directories support.
1410
-
1411
- By supplying \`{}\` it means that the agent supports the \`additionalDirectories\`
1412
- field on supported session lifecycle requests. Agents that also support
1413
- \`session/list\` may return \`SessionInfo.additionalDirectories\` when they track
1414
- that state.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1415
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1416
- these keys.
1417
-
1418
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},SessionCapabilities:{description:"Session capabilities supported by the agent.\n\nAs a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.\n\nOptionally, they **MAY** support other session methods and notifications by specifying additional capabilities.\n\nNote: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.\n\nSee protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1419
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1420
- these keys.
1421
-
1422
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},additionalDirectories:{anyOf:[{$ref:"#/$defs/SessionAdditionalDirectoriesCapabilities"},{type:"null"}],description:`**UNSTABLE**
1423
-
1424
- This capability is not part of the spec yet, and may be removed or changed at any point.
1425
-
1426
- Whether the agent supports \`additionalDirectories\` on supported session lifecycle requests.
1427
-
1428
- Agents that also support \`session/list\` may return
1429
- \`SessionInfo.additionalDirectories\` when they track that state.`},close:{anyOf:[{$ref:"#/$defs/SessionCloseCapabilities"},{type:"null"}],description:"Whether the agent supports `session/close`."},delete:{anyOf:[{$ref:"#/$defs/SessionDeleteCapabilities"},{type:"null"}],description:"**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`."},fork:{anyOf:[{$ref:"#/$defs/SessionForkCapabilities"},{type:"null"}],description:`**UNSTABLE**
1430
-
1431
- This capability is not part of the spec yet, and may be removed or changed at any point.
1432
-
1433
- Whether the agent supports \`session/fork\`.`},list:{anyOf:[{$ref:"#/$defs/SessionListCapabilities"},{type:"null"}],description:"Whether the agent supports `session/list`."},resume:{anyOf:[{$ref:"#/$defs/SessionResumeCapabilities"},{type:"null"}],description:"Whether the agent supports `session/resume`."}},type:"object"},SessionCloseCapabilities:{description:"Capabilities for the `session/close` method.\n\nBy supplying `{}` it means that the agent supports closing of sessions.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1434
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1435
- these keys.
1436
-
1437
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},SessionConfigBoolean:{description:`**UNSTABLE**
1438
-
1439
- This capability is not part of the spec yet, and may be removed or changed at any point.
1440
-
1441
- A boolean on/off toggle session configuration option payload.`,properties:{currentValue:{description:"The current value of the boolean option.",type:"boolean"}},required:["currentValue"],type:"object"},SessionConfigGroupId:{description:"Unique identifier for a session configuration option value group.",type:"string"},SessionConfigId:{description:"Unique identifier for a session configuration option.",type:"string"},SessionConfigOption:{description:"A session configuration option selector and its current state.",discriminator:{propertyName:"type"},oneOf:[{allOf:[{$ref:"#/$defs/SessionConfigSelect"}],description:"Single-value selector (dropdown).",properties:{type:{const:"select",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/SessionConfigBoolean"}],description:`**UNSTABLE**
1442
-
1443
- This capability is not part of the spec yet, and may be removed or changed at any point.
1444
-
1445
- Boolean on/off toggle.`,properties:{type:{const:"boolean",type:"string"}},required:["type"],type:"object"}],properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1446
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1447
- these keys.
1448
-
1449
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},category:{anyOf:[{$ref:"#/$defs/SessionConfigOptionCategory"},{type:"null"}],description:"Optional semantic category for this option (UX only)."},description:{description:"Optional description for the Client to display to the user.",type:["string","null"]},id:{allOf:[{$ref:"#/$defs/SessionConfigId"}],description:"Unique identifier for the configuration option."},name:{description:"Human-readable label for the option.",type:"string"}},required:["id","name"],type:"object"},SessionConfigOptionCategory:{anyOf:[{const:"mode",description:"Session mode selector.",type:"string"},{const:"model",description:"Model selector.",type:"string"},{const:"thought_level",description:"Thought/reasoning level selector.",type:"string"},{description:"Unknown / uncategorized selector.",title:"other",type:"string"}],description:`Semantic category for a session configuration option.
1450
-
1451
- This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs
1452
- session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,
1453
- placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown
1454
- categories gracefully.
1455
-
1456
- Category names beginning with \`_\` are free for custom use, like other ACP extension methods.
1457
- Category names that do not begin with \`_\` are reserved for the ACP spec.`},SessionConfigSelect:{description:"A single-value selector (dropdown) session configuration option payload.",properties:{currentValue:{allOf:[{$ref:"#/$defs/SessionConfigValueId"}],description:"The currently selected value."},options:{allOf:[{$ref:"#/$defs/SessionConfigSelectOptions"}],description:"The set of selectable options."}},required:["currentValue","options"],type:"object"},SessionConfigSelectGroup:{description:"A group of possible values for a session configuration option.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1458
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1459
- these keys.
1460
-
1461
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},group:{allOf:[{$ref:"#/$defs/SessionConfigGroupId"}],description:"Unique identifier for this group."},name:{description:"Human-readable label for this group.",type:"string"},options:{description:"The set of option values in this group.",items:{$ref:"#/$defs/SessionConfigSelectOption"},type:"array"}},required:["group","name","options"],type:"object"},SessionConfigSelectOption:{description:"A possible value for a session configuration option.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1462
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1463
- these keys.
1464
-
1465
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},description:{description:"Optional description for this option value.",type:["string","null"]},name:{description:"Human-readable label for this option value.",type:"string"},value:{allOf:[{$ref:"#/$defs/SessionConfigValueId"}],description:"Unique identifier for this option value."}},required:["value","name"],type:"object"},SessionConfigSelectOptions:{anyOf:[{description:"A flat list of options with no grouping.",items:{$ref:"#/$defs/SessionConfigSelectOption"},title:"Ungrouped",type:"array"},{description:"A list of options grouped under headers.",items:{$ref:"#/$defs/SessionConfigSelectGroup"},title:"Grouped",type:"array"}],description:"Possible values for a session configuration option."},SessionConfigValueId:{description:"Unique identifier for a session configuration option value.",type:"string"},SessionDeleteCapabilities:{description:"**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1466
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1467
- these keys.
1468
-
1469
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},SessionForkCapabilities:{description:`**UNSTABLE**
1470
-
1471
- This capability is not part of the spec yet, and may be removed or changed at any point.
1472
-
1473
- Capabilities for the \`session/fork\` method.
1474
-
1475
- By supplying \`{}\` it means that the agent supports forking of sessions.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1476
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1477
- these keys.
1478
-
1479
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},SessionId:{description:`A unique identifier for a conversation session between a client and agent.
1480
-
1481
- Sessions maintain their own context, conversation history, and state,
1482
- allowing multiple independent interactions with the same agent.
1483
-
1484
- See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)`,type:"string"},SessionInfo:{description:"Information about a session returned by session/list",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1485
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1486
- these keys.
1487
-
1488
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},additionalDirectories:{description:`**UNSTABLE**
1489
-
1490
- This capability is not part of the spec yet, and may be removed or changed at any point.
1491
-
1492
- Additional workspace roots for this session, if the Agent reports them. Each path must be absolute.
1493
-
1494
- Agents may omit this field when they do not track or surface additional-root
1495
- state. When present, this is the complete additional-root list known to
1496
- the Agent for the session.`,items:{type:"string"},type:"array"},cwd:{description:"The working directory for this session. Must be an absolute path.",type:"string"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"Unique identifier for the session"},title:{description:"Human-readable title for the session",type:["string","null"]},updatedAt:{description:"ISO 8601 timestamp of last activity",type:["string","null"]}},required:["sessionId","cwd"],type:"object"},SessionInfoUpdate:{description:`Update to session metadata. All fields are optional to support partial updates.
1497
-
1498
- Agents send this notification to update session information like title or custom metadata.
1499
- This allows clients to display dynamic session names and track session state changes.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1500
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1501
- these keys.
1502
-
1503
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},title:{description:"Human-readable title for the session. Set to null to clear.",type:["string","null"]},updatedAt:{description:"ISO 8601 timestamp of last activity. Set to null to clear.",type:["string","null"]}},type:"object"},SessionListCapabilities:{description:"Capabilities for the `session/list` method.\n\nBy supplying `{}` it means that the agent supports listing of sessions.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1504
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1505
- these keys.
1506
-
1507
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},SessionMode:{description:`A mode the agent can operate in.
1508
-
1509
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1510
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1511
- these keys.
1512
-
1513
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},description:{type:["string","null"]},id:{$ref:"#/$defs/SessionModeId"},name:{type:"string"}},required:["id","name"],type:"object"},SessionModeId:{description:"Unique identifier for a Session Mode.",type:"string"},SessionModeState:{description:"The set of modes and the one currently active.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1514
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1515
- these keys.
1516
-
1517
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},availableModes:{description:"The set of modes that the Agent can operate in",items:{$ref:"#/$defs/SessionMode"},type:"array"},currentModeId:{allOf:[{$ref:"#/$defs/SessionModeId"}],description:"The current mode the Agent is in."}},required:["currentModeId","availableModes"],type:"object"},SessionModelState:{description:`**UNSTABLE**
1518
-
1519
- This capability is not part of the spec yet, and may be removed or changed at any point.
1520
-
1521
- The set of models and the one currently active.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1522
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1523
- these keys.
1524
-
1525
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},availableModels:{description:"The set of models that the Agent can use",items:{$ref:"#/$defs/ModelInfo"},type:"array"},currentModelId:{allOf:[{$ref:"#/$defs/ModelId"}],description:"The current model the Agent is in."}},required:["currentModelId","availableModels"],type:"object"},SessionNotification:{description:`Notification containing a session update from the agent.
1526
-
1527
- Used to stream real-time progress and results during prompt processing.
1528
-
1529
- See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1530
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1531
- these keys.
1532
-
1533
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session this update pertains to."},update:{allOf:[{$ref:"#/$defs/SessionUpdate"}],description:"The actual update content."}},required:["sessionId","update"],type:"object","x-method":"session/update","x-side":"client"},SessionResumeCapabilities:{description:"Capabilities for the `session/resume` method.\n\nBy supplying `{}` it means that the agent supports resuming of sessions.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1534
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1535
- these keys.
1536
-
1537
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object"},SessionUpdate:{description:`Different types of updates that can be sent during session processing.
1538
-
1539
- These updates provide real-time feedback about the agent's progress.
1540
-
1541
- See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)`,discriminator:{propertyName:"sessionUpdate"},oneOf:[{allOf:[{$ref:"#/$defs/ContentChunk"}],description:"A chunk of the user's message being streamed.",properties:{sessionUpdate:{const:"user_message_chunk",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/ContentChunk"}],description:"A chunk of the agent's response being streamed.",properties:{sessionUpdate:{const:"agent_message_chunk",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/ContentChunk"}],description:"A chunk of the agent's internal reasoning being streamed.",properties:{sessionUpdate:{const:"agent_thought_chunk",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/ToolCall"}],description:"Notification that a new tool call has been initiated.",properties:{sessionUpdate:{const:"tool_call",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/ToolCallUpdate"}],description:"Update on the status or results of a tool call.",properties:{sessionUpdate:{const:"tool_call_update",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/Plan"}],description:`The agent's execution plan for complex tasks.
1542
- See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)`,properties:{sessionUpdate:{const:"plan",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/AvailableCommandsUpdate"}],description:"Available commands are ready or have changed",properties:{sessionUpdate:{const:"available_commands_update",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/CurrentModeUpdate"}],description:`The current mode of the session has changed
1543
-
1544
- See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)`,properties:{sessionUpdate:{const:"current_mode_update",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/ConfigOptionUpdate"}],description:"Session configuration options have been updated.",properties:{sessionUpdate:{const:"config_option_update",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/SessionInfoUpdate"}],description:"Session metadata has been updated (title, timestamps, custom metadata)",properties:{sessionUpdate:{const:"session_info_update",type:"string"}},required:["sessionUpdate"],type:"object"},{allOf:[{$ref:"#/$defs/UsageUpdate"}],description:`**UNSTABLE**
1545
-
1546
- This capability is not part of the spec yet, and may be removed or changed at any point.
1547
-
1548
- Context window and cost update for the session.`,properties:{sessionUpdate:{const:"usage_update",type:"string"}},required:["sessionUpdate"],type:"object"}]},SetProvidersRequest:{description:`**UNSTABLE**
1549
-
1550
- This capability is not part of the spec yet, and may be removed or changed at any point.
1551
-
1552
- Request parameters for \`providers/set\`.
1553
-
1554
- Replaces the full configuration for one provider id.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1555
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1556
- these keys.
1557
-
1558
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},apiType:{allOf:[{$ref:"#/$defs/LlmProtocol"}],description:"Protocol type for this provider."},baseUrl:{description:"Base URL for requests sent through this provider.",type:"string"},headers:{additionalProperties:{type:"string"},description:`Full headers map for this provider.
1559
- May include authorization, routing, or other integration-specific headers.`,type:"object"},id:{description:"Provider id to configure.",type:"string"}},required:["id","apiType","baseUrl"],type:"object","x-method":"providers/set","x-side":"agent"},SetProvidersResponse:{description:`**UNSTABLE**
1560
-
1561
- This capability is not part of the spec yet, and may be removed or changed at any point.
1562
-
1563
- Response to \`providers/set\`.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1564
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1565
- these keys.
1566
-
1567
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"providers/set","x-side":"agent"},SetSessionConfigOptionRequest:{anyOf:[{description:'A boolean value (`type: "boolean"`).',properties:{type:{const:"boolean",type:"string"},value:{description:"The boolean value.",type:"boolean"}},required:["type","value"],type:"object"},{description:"A [`SessionConfigValueId`] string value.\n\nThis is the default when `type` is absent on the wire. Unknown `type`\nvalues with string payloads also gracefully deserialize into this\nvariant.",properties:{value:{allOf:[{$ref:"#/$defs/SessionConfigValueId"}],description:"The value ID."}},required:["value"],title:"value_id",type:"object"}],description:"Request parameters for setting a session configuration option.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1568
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1569
- these keys.
1570
-
1571
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configId:{allOf:[{$ref:"#/$defs/SessionConfigId"}],description:"The ID of the configuration option to set."},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to set the configuration option for."}},required:["sessionId","configId"],type:"object","x-method":"session/set_config_option","x-side":"agent"},SetSessionConfigOptionResponse:{description:"Response to `session/set_config_option` method.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1572
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1573
- these keys.
1574
-
1575
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},configOptions:{description:"The full set of configuration options and their current values.",items:{$ref:"#/$defs/SessionConfigOption"},type:"array"}},required:["configOptions"],type:"object","x-method":"session/set_config_option","x-side":"agent"},SetSessionModeRequest:{description:"Request parameters for setting a session mode.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1576
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1577
- these keys.
1578
-
1579
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},modeId:{allOf:[{$ref:"#/$defs/SessionModeId"}],description:"The ID of the mode to set."},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to set the mode for."}},required:["sessionId","modeId"],type:"object","x-method":"session/set_mode","x-side":"agent"},SetSessionModeResponse:{description:"Response to `session/set_mode` method.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1580
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1581
- these keys.
1582
-
1583
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"session/set_mode","x-side":"agent"},SetSessionModelRequest:{description:`**UNSTABLE**
1584
-
1585
- This capability is not part of the spec yet, and may be removed or changed at any point.
1586
-
1587
- Request parameters for setting a session model.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1588
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1589
- these keys.
1590
-
1591
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},modelId:{allOf:[{$ref:"#/$defs/ModelId"}],description:"The ID of the model to set."},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The ID of the session to set the model for."}},required:["sessionId","modelId"],type:"object","x-method":"session/set_model","x-side":"agent"},SetSessionModelResponse:{description:`**UNSTABLE**
1592
-
1593
- This capability is not part of the spec yet, and may be removed or changed at any point.
1594
-
1595
- Response to \`session/set_model\` method.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1596
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1597
- these keys.
1598
-
1599
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"session/set_model","x-side":"agent"},StartNesRequest:{description:"Request to start an NES session.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1600
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1601
- these keys.
1602
-
1603
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},repository:{anyOf:[{$ref:"#/$defs/NesRepository"},{type:"null"}],description:"Repository metadata, if the workspace is a git repository."},workspaceFolders:{description:"The workspace folders.",items:{$ref:"#/$defs/WorkspaceFolder"},type:["array","null"]},workspaceUri:{description:"The root URI of the workspace.",type:["string","null"]}},type:"object","x-method":"nes/start","x-side":"agent"},StartNesResponse:{description:"Response to `nes/start`.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1604
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1605
- these keys.
1606
-
1607
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for the newly started NES session."}},required:["sessionId"],type:"object","x-method":"nes/start","x-side":"agent"},StopReason:{description:`Reasons why an agent stops processing a prompt turn.
1608
-
1609
- See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)`,oneOf:[{const:"end_turn",description:"The turn ended successfully.",type:"string"},{const:"max_tokens",description:"The turn ended because the agent reached the maximum number of tokens.",type:"string"},{const:"max_turn_requests",description:`The turn ended because the agent reached the maximum number of allowed
1610
- agent requests between user turns.`,type:"string"},{const:"refusal",description:`The turn ended because the agent refused to continue. The user prompt
1611
- and everything that comes after it won't be included in the next
1612
- prompt, so this should be reflected in the UI.`,type:"string"},{const:"cancelled",description:`The turn was cancelled by the client via \`session/cancel\`.
1613
-
1614
- This stop reason MUST be returned when the client sends a \`session/cancel\`
1615
- notification, even if the cancellation causes exceptions in underlying operations.
1616
- Agents should catch these exceptions and return this semantically meaningful
1617
- response to confirm successful cancellation.`,type:"string"}]},StringFormat:{description:"String format types for string properties in elicitation schemas.",oneOf:[{const:"email",description:"Email address format.",type:"string"},{const:"uri",description:"URI format.",type:"string"},{const:"date",description:"Date format (YYYY-MM-DD).",type:"string"},{const:"date-time",description:"Date-time format (ISO 8601).",type:"string"}]},StringPropertySchema:{description:'Schema for string properties in an elicitation form.\n\nWhen `enum` or `oneOf` is set, this represents a single-select enum\nwith `"type": "string"`.',properties:{default:{description:"Default value.",type:["string","null"]},description:{description:"Human-readable description.",type:["string","null"]},enum:{description:"Enum values for untitled single-select enums.",items:{type:"string"},type:["array","null"]},format:{anyOf:[{$ref:"#/$defs/StringFormat"},{type:"null"}],description:"String format."},maxLength:{description:"Maximum string length.",format:"uint32",minimum:0,type:["integer","null"]},minLength:{description:"Minimum string length.",format:"uint32",minimum:0,type:["integer","null"]},oneOf:{description:"Titled enum options for titled single-select enums.",items:{$ref:"#/$defs/EnumOption"},type:["array","null"]},pattern:{description:"Pattern the string must match.",type:["string","null"]},title:{description:"Optional title for the property.",type:["string","null"]}},type:"object"},SuggestNesRequest:{description:"Request for a code suggestion.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1618
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1619
- these keys.
1620
-
1621
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},context:{anyOf:[{$ref:"#/$defs/NesSuggestContext"},{type:"null"}],description:"Context for the suggestion, included based on agent capabilities."},position:{allOf:[{$ref:"#/$defs/Position"}],description:"The current cursor position."},selection:{anyOf:[{$ref:"#/$defs/Range"},{type:"null"}],description:"The current text selection range, if any."},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."},triggerKind:{allOf:[{$ref:"#/$defs/NesTriggerKind"}],description:"What triggered this suggestion request."},uri:{description:"The URI of the document to suggest for.",type:"string"},version:{description:"The version number of the document.",format:"int64",type:"integer"}},required:["sessionId","uri","version","position","triggerKind"],type:"object","x-method":"nes/suggest","x-side":"agent"},SuggestNesResponse:{description:"Response to `nes/suggest`.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1622
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1623
- these keys.
1624
-
1625
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},suggestions:{description:"The list of suggestions.",items:{$ref:"#/$defs/NesSuggestion"},type:"array"}},required:["suggestions"],type:"object","x-method":"nes/suggest","x-side":"agent"},Terminal:{description:"Embed a terminal created with `terminal/create` by its id.\n\nThe terminal must be added before calling `terminal/release`.\n\nSee protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1626
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1627
- these keys.
1628
-
1629
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},terminalId:{type:"string"}},required:["terminalId"],type:"object"},TerminalExitStatus:{description:"Exit status of a terminal command.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1630
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1631
- these keys.
1632
-
1633
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},exitCode:{description:"The process exit code (may be null if terminated by signal).",format:"uint32",minimum:0,type:["integer","null"]},signal:{description:"The signal that terminated the process (may be null if exited normally).",type:["string","null"]}},type:"object"},TerminalOutputRequest:{description:"Request to get the current output and status of a terminal.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1634
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1635
- these keys.
1636
-
1637
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."},terminalId:{description:"The ID of the terminal to get output from.",type:"string"}},required:["sessionId","terminalId"],type:"object","x-method":"terminal/output","x-side":"client"},TerminalOutputResponse:{description:"Response containing the terminal output and exit status.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1638
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1639
- these keys.
1640
-
1641
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},exitStatus:{anyOf:[{$ref:"#/$defs/TerminalExitStatus"},{type:"null"}],description:"Exit status if the command has completed."},output:{description:"The terminal output captured so far.",type:"string"},truncated:{description:"Whether the output was truncated due to byte limits.",type:"boolean"}},required:["output","truncated"],type:"object","x-method":"terminal/output","x-side":"client"},TextContent:{description:"Text provided to or from an LLM.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1642
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1643
- these keys.
1644
-
1645
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},annotations:{anyOf:[{$ref:"#/$defs/Annotations"},{type:"null"}]},text:{type:"string"}},required:["text"],type:"object"},TextDocumentContentChangeEvent:{description:"A content change event for a document.\n\nWhen `range` is `None`, `text` is the full content of the document.\nWhen `range` is `Some`, `text` replaces the given range.",properties:{range:{anyOf:[{$ref:"#/$defs/Range"},{type:"null"}],description:"The range of the document that changed. If `None`, the entire content is replaced."},text:{description:"The new text for the range, or the full document content if `range` is `None`.",type:"string"}},required:["text"],type:"object"},TextDocumentSyncKind:{description:"How the agent wants document changes delivered.",oneOf:[{const:"full",description:"Client sends the entire file content on each change.",type:"string"},{const:"incremental",description:"Client sends only the changed ranges.",type:"string"}]},TextResourceContents:{description:"Text-based resource contents.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1646
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1647
- these keys.
1648
-
1649
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},mimeType:{type:["string","null"]},text:{type:"string"},uri:{type:"string"}},required:["text","uri"],type:"object"},TitledMultiSelectItems:{description:"Items definition for titled multi-select enum properties.",properties:{anyOf:{description:"Titled enum options.",items:{$ref:"#/$defs/EnumOption"},type:"array"}},required:["anyOf"],type:"object"},ToolCall:{description:`Represents a tool call that the language model has requested.
1650
-
1651
- Tool calls are actions that the agent executes on behalf of the language model,
1652
- such as reading files, executing code, or fetching data from external sources.
1653
-
1654
- See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1655
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1656
- these keys.
1657
-
1658
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{description:"Content produced by the tool call.",items:{$ref:"#/$defs/ToolCallContent"},type:"array"},kind:{allOf:[{$ref:"#/$defs/ToolKind"}],description:`The category of tool being invoked.
1659
- Helps clients choose appropriate icons and UI treatment.`},locations:{description:`File locations affected by this tool call.
1660
- Enables "follow-along" features in clients.`,items:{$ref:"#/$defs/ToolCallLocation"},type:"array"},rawInput:{description:"Raw input parameters sent to the tool."},rawOutput:{description:"Raw output returned by the tool."},status:{allOf:[{$ref:"#/$defs/ToolCallStatus"}],description:"Current execution status of the tool call."},title:{description:"Human-readable title describing what the tool is doing.",type:"string"},toolCallId:{allOf:[{$ref:"#/$defs/ToolCallId"}],description:"Unique identifier for this tool call within the session."}},required:["toolCallId","title"],type:"object"},ToolCallContent:{description:`Content produced by a tool call.
1661
-
1662
- Tool calls can produce different types of content including
1663
- standard content blocks (text, images) or file diffs.
1664
-
1665
- See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)`,discriminator:{propertyName:"type"},oneOf:[{allOf:[{$ref:"#/$defs/Content"}],description:"Standard content block (text, images, resources).",properties:{type:{const:"content",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/Diff"}],description:"File modification shown as a diff.",properties:{type:{const:"diff",type:"string"}},required:["type"],type:"object"},{allOf:[{$ref:"#/$defs/Terminal"}],description:"Embed a terminal created with `terminal/create` by its id.\n\nThe terminal must be added before calling `terminal/release`.\n\nSee protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)",properties:{type:{const:"terminal",type:"string"}},required:["type"],type:"object"}]},ToolCallId:{description:"Unique identifier for a tool call within a session.",type:"string"},ToolCallLocation:{description:`A file location being accessed or modified by a tool.
1666
-
1667
- Enables clients to implement "follow-along" features that track
1668
- which files the agent is working with in real-time.
1669
-
1670
- See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1671
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1672
- these keys.
1673
-
1674
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},line:{description:"Optional line number within the file.",format:"uint32",minimum:0,type:["integer","null"]},path:{description:"The file path being accessed or modified.",type:"string"}},required:["path"],type:"object"},ToolCallStatus:{description:`Execution status of a tool call.
1675
-
1676
- Tool calls progress through different statuses during their lifecycle.
1677
-
1678
- See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)`,oneOf:[{const:"pending",description:`The tool call hasn't started running yet because the input is either
1679
- streaming or we're awaiting approval.`,type:"string"},{const:"in_progress",description:"The tool call is currently running.",type:"string"},{const:"completed",description:"The tool call completed successfully.",type:"string"},{const:"failed",description:"The tool call failed with an error.",type:"string"}]},ToolCallUpdate:{description:`An update to an existing tool call.
1680
-
1681
- Used to report progress and results as tools execute. All fields except
1682
- the tool call ID are optional - only changed fields need to be included.
1683
-
1684
- See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1685
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1686
- these keys.
1687
-
1688
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{description:"Replace the content collection.",items:{$ref:"#/$defs/ToolCallContent"},type:["array","null"]},kind:{anyOf:[{$ref:"#/$defs/ToolKind"},{type:"null"}],description:"Update the tool kind."},locations:{description:"Replace the locations collection.",items:{$ref:"#/$defs/ToolCallLocation"},type:["array","null"]},rawInput:{description:"Update the raw input."},rawOutput:{description:"Update the raw output."},status:{anyOf:[{$ref:"#/$defs/ToolCallStatus"},{type:"null"}],description:"Update the execution status."},title:{description:"Update the human-readable title.",type:["string","null"]},toolCallId:{allOf:[{$ref:"#/$defs/ToolCallId"}],description:"The ID of the tool call being updated."}},required:["toolCallId"],type:"object"},ToolKind:{description:`Categories of tools that can be invoked.
1689
-
1690
- Tool kinds help clients choose appropriate icons and optimize how they
1691
- display tool execution progress.
1692
-
1693
- See protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)`,oneOf:[{const:"read",description:"Reading files or data.",type:"string"},{const:"edit",description:"Modifying files or content.",type:"string"},{const:"delete",description:"Removing files or data.",type:"string"},{const:"move",description:"Moving or renaming files.",type:"string"},{const:"search",description:"Searching for information.",type:"string"},{const:"execute",description:"Running commands or code.",type:"string"},{const:"think",description:"Internal reasoning or planning.",type:"string"},{const:"fetch",description:"Retrieving external data.",type:"string"},{const:"switch_mode",description:"Switching the current session mode.",type:"string"},{const:"other",description:"Other tool types (default).",type:"string"}]},UnstructuredCommandInput:{description:"All text that was typed after the command name is provided as input.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1694
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1695
- these keys.
1696
-
1697
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},hint:{description:"A hint to display when the input hasn't been provided yet",type:"string"}},required:["hint"],type:"object"},UntitledMultiSelectItems:{description:"Items definition for untitled multi-select enum properties.",properties:{enum:{description:"Allowed enum values.",items:{type:"string"},type:"array"},type:{allOf:[{$ref:"#/$defs/ElicitationStringType"}],description:'Item type discriminator. Must be `"string"`.'}},required:["type","enum"],type:"object"},Usage:{description:`**UNSTABLE**
1698
-
1699
- This capability is not part of the spec yet, and may be removed or changed at any point.
1700
-
1701
- Token usage information for a prompt turn.`,properties:{cachedReadTokens:{description:"Total cache read tokens.",format:"uint64",minimum:0,type:["integer","null"]},cachedWriteTokens:{description:"Total cache write tokens.",format:"uint64",minimum:0,type:["integer","null"]},inputTokens:{description:"Total input tokens across all turns.",format:"uint64",minimum:0,type:"integer"},outputTokens:{description:"Total output tokens across all turns.",format:"uint64",minimum:0,type:"integer"},thoughtTokens:{description:"Total thought/reasoning tokens",format:"uint64",minimum:0,type:["integer","null"]},totalTokens:{description:"Sum of all token types across session.",format:"uint64",minimum:0,type:"integer"}},required:["totalTokens","inputTokens","outputTokens"],type:"object"},UsageUpdate:{description:`**UNSTABLE**
1702
-
1703
- This capability is not part of the spec yet, and may be removed or changed at any point.
1704
-
1705
- Context window and cost update for a session.`,properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1706
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1707
- these keys.
1708
-
1709
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},cost:{anyOf:[{$ref:"#/$defs/Cost"},{type:"null"}],description:"Cumulative session cost (optional)."},size:{description:"Total context window size in tokens.",format:"uint64",minimum:0,type:"integer"},used:{description:"Tokens currently in context.",format:"uint64",minimum:0,type:"integer"}},required:["used","size"],type:"object"},WaitForTerminalExitRequest:{description:"Request to wait for a terminal command to exit.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1710
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1711
- these keys.
1712
-
1713
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."},terminalId:{description:"The ID of the terminal to wait for.",type:"string"}},required:["sessionId","terminalId"],type:"object","x-method":"terminal/wait_for_exit","x-side":"client"},WaitForTerminalExitResponse:{description:"Response containing the exit status of a terminal command.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1714
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1715
- these keys.
1716
-
1717
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},exitCode:{description:"The process exit code (may be null if terminated by signal).",format:"uint32",minimum:0,type:["integer","null"]},signal:{description:"The signal that terminated the process (may be null if exited normally).",type:["string","null"]}},type:"object","x-method":"terminal/wait_for_exit","x-side":"client"},WorkspaceFolder:{description:"A workspace folder.",properties:{name:{description:"The display name of the folder.",type:"string"},uri:{description:"The URI of the folder.",type:"string"}},required:["uri","name"],type:"object"},WriteTextFileRequest:{description:"Request to write content to a text file.\n\nOnly available if the client supports the `fs.writeTextFile` capability.",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1718
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1719
- these keys.
1720
-
1721
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]},content:{description:"The text content to write to the file.",type:"string"},path:{description:"Absolute path to the file to write.",type:"string"},sessionId:{allOf:[{$ref:"#/$defs/SessionId"}],description:"The session ID for this request."}},required:["sessionId","path","content"],type:"object","x-method":"fs/write_text_file","x-side":"client"},WriteTextFileResponse:{description:"Response to `fs/write_text_file`",properties:{_meta:{additionalProperties:!0,description:`The _meta property is reserved by ACP to allow clients and agents to attach additional
1722
- metadata to their interactions. Implementations MUST NOT make assumptions about values at
1723
- these keys.
1724
-
1725
- See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)`,type:["object","null"]}},type:"object","x-method":"fs/write_text_file","x-side":"client"}},qS="https://json-schema.org/draft/2020-12/schema",US=[{anyOf:[{allOf:[{$ref:"#/$defs/AgentRequest"}],title:"Request"},{allOf:[{$ref:"#/$defs/AgentResponse"}],title:"Response"},{allOf:[{$ref:"#/$defs/AgentNotification"}],title:"Notification"}],description:`A message (request, response, or notification) with \`"jsonrpc": "2.0"\` specified as
1726
- [required by JSON-RPC 2.0 Specification][1].
1727
-
1728
- [1]: https://www.jsonrpc.org/specification#compatibility`,properties:{jsonrpc:{enum:["2.0"],type:"string"}},required:["jsonrpc"],title:"Agent",type:"object"},{anyOf:[{allOf:[{$ref:"#/$defs/ClientRequest"}],title:"Request"},{allOf:[{$ref:"#/$defs/ClientResponse"}],title:"Response"},{allOf:[{$ref:"#/$defs/ClientNotification"}],title:"Notification"}],description:`A message (request, response, or notification) with \`"jsonrpc": "2.0"\` specified as
1729
- [required by JSON-RPC 2.0 Specification][1].
1730
-
1731
- [1]: https://www.jsonrpc.org/specification#compatibility`,properties:{jsonrpc:{enum:["2.0"],type:"string"}},required:["jsonrpc"],title:"Client",type:"object"},{anyOf:[{allOf:[{$ref:"#/$defs/CancelRequestNotification"}],description:`**UNSTABLE**
1732
-
1733
- This capability is not part of the spec yet, and may be removed or
1734
- changed at any point.
1735
-
1736
- Cancels an ongoing request.
1737
-
1738
- This is a notification sent by the side that sent a request to cancel that request.
1739
-
1740
- Upon receiving this notification, the receiver:
1741
-
1742
- 1. MUST cancel the corresponding request activity and all nested activities
1743
- 2. MAY send any pending notifications.
1744
- 3. MUST send one of these responses for the original request:
1745
- - Valid response with appropriate data (partial results or cancellation marker)
1746
- - Error response with code \`-32800\` (Cancelled)
1747
-
1748
- See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)`,title:"CancelRequestNotification"}],description:`General protocol-level notifications that all sides are expected to
1749
- implement.
1750
-
1751
- Notifications whose methods start with '$/' are messages which
1752
- are protocol implementation dependent and might not be implementable in all
1753
- clients or agents. For example if the implementation uses a single threaded
1754
- synchronous programming language then there is little it can do to react to
1755
- a \`$/cancel_request\` notification. If an agent or client receives
1756
- notifications starting with '$/' it is free to ignore the notification.
1757
-
1758
- Notifications do not expect a response.`,title:"ProtocolLevel"}],LS="Agent Client Protocol",Iv={$defs:MS,$schema:qS,anyOf:US,title:LS};var Id={exports:{}},Ov={},ln={},Vr={},js={},ue={},ds={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(p){if(super(),!e.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class o extends t{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((x,S)=>`${x}${S}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((x,S)=>(S instanceof n&&(x[S.str]=(x[S.str]||0)+1),x),{})}}e._Code=o,e.nil=new o("");function r(u,...p){const x=[u[0]];let S=0;for(;S<p.length;)a(x,p[S]),x.push(u[++S]);return new o(x)}e._=r;const i=new o("+");function s(u,...p){const x=[y(u[0])];let S=0;for(;S<p.length;)x.push(i),a(x,p[S]),x.push(i,y(u[++S]));return l(x),new o(x)}e.str=s;function a(u,p){p instanceof o?u.push(...p._items):p instanceof n?u.push(p):u.push(m(p))}e.addCodeArg=a;function l(u){let p=1;for(;p<u.length-1;){if(u[p]===i){const x=c(u[p-1],u[p+1]);if(x!==void 0){u.splice(p-1,3,x);continue}u[p++]="+"}p++}}function c(u,p){if(p==='""')return u;if(u==='""')return p;if(typeof u=="string")return p instanceof n||u[u.length-1]!=='"'?void 0:typeof p!="string"?`${u.slice(0,-1)}${p}"`:p[0]==='"'?u.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(u instanceof n))return`"${u}${p.slice(1)}`}function f(u,p){return p.emptyStr()?u:u.emptyStr()?p:s`${u}${p}`}e.strConcat=f;function m(u){return typeof u=="number"||typeof u=="boolean"||u===null?u:y(Array.isArray(u)?u.join(","):u)}function h(u){return new o(y(u))}e.stringify=h;function y(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function g(u){return typeof u=="string"&&e.IDENTIFIER.test(u)?new o(`.${u}`):r`[${u}]`}e.getProperty=g;function b(u){if(typeof u=="string"&&e.IDENTIFIER.test(u))return new o(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)}e.getEsmExportName=b;function v(u){return new o(u.toString())}e.regexpCode=v})(ds);var Od={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ds;class n extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var o;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class r{constructor({prefixes:c,parent:f}={}){this._names={},this._prefixes=c,this._parent=f}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const f=this._names[c]||this._nameGroup(c);return`${c}${f.index++}`}_nameGroup(c){var f,m;if(!((m=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||m===void 0)&&m.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=r;class i extends t.Name{constructor(c,f){super(f),this.prefix=c}setValue(c,{property:f,itemIndex:m}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(f)}[${m}]`}}e.ValueScopeName=i;const s=(0,t._)`\n`;class a extends r{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?s:t.nil}}get(){return this._scope}name(c){return new i(c,this._newName(c))}value(c,f){var m;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(c),{prefix:y}=h,g=(m=f.key)!==null&&m!==void 0?m:f.ref;let b=this._values[y];if(b){const p=b.get(g);if(p)return p}else b=this._values[y]=new Map;b.set(g,h);const v=this._scope[y]||(this._scope[y]=[]),u=v.length;return v[u]=f.ref,h.setValue(f,{property:y,itemIndex:u}),h}getValue(c,f){const m=this._values[c];if(m)return m.get(f)}scopeRefs(c,f=this._values){return this._reduceValues(f,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${c}${m.scopePath}`})}scopeCode(c=this._values,f,m){return this._reduceValues(c,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},f,m)}_reduceValues(c,f,m={},h){let y=t.nil;for(const g in c){const b=c[g];if(!b)continue;const v=m[g]=m[g]||new Map;b.forEach(u=>{if(v.has(u))return;v.set(u,o.Started);let p=f(u);if(p){const x=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${x} ${u} = ${p};${this.opts._n}`}else if(p=h==null?void 0:h(u))y=(0,t._)`${y}${p}${this.opts._n}`;else throw new n(u);v.set(u,o.Completed)})}return y}}e.ValueScope=a})(Od);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=ds,n=Od;var o=ds;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var r=Od;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(w,k){return this}}class s extends i{constructor(w,k,N){super(),this.varKind=w,this.name=k,this.rhs=N}render({es5:w,_n:k}){const N=w?n.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${B};`+k}optimizeNames(w,k){if(w[this.name.str])return this.rhs&&(this.rhs=U(this.rhs,w,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(w,k,N){super(),this.lhs=w,this.rhs=k,this.sideEffects=N}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,k){if(!(this.lhs instanceof t.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=U(this.rhs,w,k),this}get names(){const w=this.lhs instanceof t.Name?{}:{...this.lhs.names};return L(w,this.rhs)}}class l extends a{constructor(w,k,N,B){super(w,N,B),this.op=k}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}}class c extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class f extends i{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}}class m extends i{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}}class h extends i{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code};`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,k){return this.code=U(this.code,w,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends i{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((k,N)=>k+N.render(w),"")}optimizeNodes(){const{nodes:w}=this;let k=w.length;for(;k--;){const N=w[k].optimizeNodes();Array.isArray(N)?w.splice(k,1,...N):N?w[k]=N:w.splice(k,1)}return w.length>0?this:void 0}optimizeNames(w,k){const{nodes:N}=this;let B=N.length;for(;B--;){const O=N[B];O.optimizeNames(w,k)||(D(w,O.names),N.splice(B,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((w,k)=>V(w,k.names),{})}}class g extends y{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class b extends y{}class v extends g{}v.kind="else";class u extends g{constructor(w,k){super(k),this.condition=w}render(w){let k=`if(${this.condition})`+super.render(w);return this.else&&(k+="else "+this.else.render(w)),k}optimizeNodes(){super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let k=this.else;if(k){const N=k.optimizeNodes();k=this.else=Array.isArray(N)?new v(N):N}if(k)return w===!1?k instanceof u?k:k.nodes:this.nodes.length?this:new u(Q(w),k instanceof u?[k]:k.nodes);if(!(w===!1||!this.nodes.length))return this}optimizeNames(w,k){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(w,k),!!(super.optimizeNames(w,k)||this.else))return this.condition=U(this.condition,w,k),this}get names(){const w=super.names;return L(w,this.condition),this.else&&V(w,this.else.names),w}}u.kind="if";class p extends g{}p.kind="for";class x extends p{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iteration=U(this.iteration,w,k),this}get names(){return V(super.names,this.iteration.names)}}class S extends p{constructor(w,k,N,B){super(),this.varKind=w,this.name=k,this.from=N,this.to=B}render(w){const k=w.es5?n.varKinds.var:this.varKind,{name:N,from:B,to:O}=this;return`for(${k} ${N}=${B}; ${N}<${O}; ${N}++)`+super.render(w)}get names(){const w=L(super.names,this.from);return L(w,this.to)}}class T extends p{constructor(w,k,N,B){super(),this.loop=w,this.varKind=k,this.name=N,this.iterable=B}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,k){if(super.optimizeNames(w,k))return this.iterable=U(this.iterable,w,k),this}get names(){return V(super.names,this.iterable.names)}}class C extends g{constructor(w,k,N){super(),this.name=w,this.args=k,this.async=N}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}}C.kind="func";class $ extends y{render(w){return"return "+super.render(w)}}$.kind="return";class j extends g{render(w){let k="try"+super.render(w);return this.catch&&(k+=this.catch.render(w)),this.finally&&(k+=this.finally.render(w)),k}optimizeNodes(){var w,k;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(w,k){var N,B;return super.optimizeNames(w,k),(N=this.catch)===null||N===void 0||N.optimizeNames(w,k),(B=this.finally)===null||B===void 0||B.optimizeNames(w,k),this}get names(){const w=super.names;return this.catch&&V(w,this.catch.names),this.finally&&V(w,this.finally.names),w}}class R extends g{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}}R.kind="catch";class M extends g{render(w){return"finally"+super.render(w)}}M.kind="finally";class F{constructor(w,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
1759
- `:""},this._extScope=w,this._scope=new n.Scope({parent:w}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,k){const N=this._extScope.value(w,k);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(w,k){return this._extScope.getValue(w,k)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,k,N,B){const O=this._scope.toName(k);return N!==void 0&&B&&(this._constants[O.str]=N),this._leafNode(new s(w,O,N)),O}const(w,k,N){return this._def(n.varKinds.const,w,k,N)}let(w,k,N){return this._def(n.varKinds.let,w,k,N)}var(w,k,N){return this._def(n.varKinds.var,w,k,N)}assign(w,k,N){return this._leafNode(new a(w,k,N))}add(w,k){return this._leafNode(new l(w,e.operators.ADD,k))}code(w){return typeof w=="function"?w():w!==t.nil&&this._leafNode(new h(w)),this}object(...w){const k=["{"];for(const[N,B]of w)k.length>1&&k.push(","),k.push(N),(N!==B||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,B));return k.push("}"),new t._Code(k)}if(w,k,N){if(this._blockNode(new u(w)),k&&N)this.code(k).else().code(N).endIf();else if(k)this.code(k).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new u(w))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(u,v)}_for(w,k){return this._blockNode(w),k&&this.code(k).endFor(),this}for(w,k){return this._for(new x(w),k)}forRange(w,k,N,B,O=this.opts.es5?n.varKinds.var:n.varKinds.let){const Y=this._scope.toName(w);return this._for(new S(O,Y,k,N),()=>B(Y))}forOf(w,k,N,B=n.varKinds.const){const O=this._scope.toName(w);if(this.opts.es5){const Y=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${Y}.length`,ie=>{this.var(O,(0,t._)`${Y}[${ie}]`),N(O)})}return this._for(new T("of",B,O,k),()=>N(O))}forIn(w,k,N,B=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${k})`,N);const O=this._scope.toName(w);return this._for(new T("in",B,O,k),()=>N(O))}endFor(){return this._endBlockNode(p)}label(w){return this._leafNode(new c(w))}break(w){return this._leafNode(new f(w))}return(w){const k=new $;if(this._blockNode(k),this.code(w),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(w,k,N){if(!k&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new j;if(this._blockNode(B),this.code(w),k){const O=this.name("e");this._currNode=B.catch=new R(O),k(O)}return N&&(this._currNode=B.finally=new M,this.code(N)),this._endBlockNode(R,M)}throw(w){return this._leafNode(new m(w))}block(w,k){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(k),this}endBlock(w){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-k;if(N<0||w!==void 0&&N!==w)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${w} expected`);return this._nodes.length=k,this}func(w,k=t.nil,N,B){return this._blockNode(new C(w,k,N)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,k){const N=this._currNode;if(N instanceof w||k&&N instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${w.kind}/${k.kind}`:w.kind}"`)}_elseNode(w){const k=this._currNode;if(!(k instanceof u))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=w,this}get _root(){return this._nodes[0]}get _currNode(){const w=this._nodes;return w[w.length-1]}set _currNode(w){const k=this._nodes;k[k.length-1]=w}}e.CodeGen=F;function V(E,w){for(const k in w)E[k]=(E[k]||0)+(w[k]||0);return E}function L(E,w){return w instanceof t._CodeOrName?V(E,w.names):E}function U(E,w,k){if(E instanceof t.Name)return N(E);if(!B(E))return E;return new t._Code(E._items.reduce((O,Y)=>(Y instanceof t.Name&&(Y=N(Y)),Y instanceof t._Code?O.push(...Y._items):O.push(Y),O),[]));function N(O){const Y=k[O.str];return Y===void 0||w[O.str]!==1?O:(delete w[O.str],Y)}function B(O){return O instanceof t._Code&&O._items.some(Y=>Y instanceof t.Name&&w[Y.str]===1&&k[Y.str]!==void 0)}}function D(E,w){for(const k in w)E[k]=(E[k]||0)-(w[k]||0)}function Q(E){return typeof E=="boolean"||typeof E=="number"||E===null?!E:(0,t._)`!${A(E)}`}e.not=Q;const ee=_(e.operators.AND);function q(...E){return E.reduce(ee)}e.and=q;const G=_(e.operators.OR);function I(...E){return E.reduce(G)}e.or=I;function _(E){return(w,k)=>w===t.nil?k:k===t.nil?w:(0,t._)`${A(w)} ${E} ${A(k)}`}function A(E){return E instanceof t.Name?E:(0,t._)`(${E})`}})(ue);var J={};Object.defineProperty(J,"__esModule",{value:!0});J.checkStrictMode=J.getErrorPath=J.Type=J.useFunc=J.setEvaluated=J.evaluatedPropsToName=J.mergeEvaluated=J.eachItem=J.unescapeJsonPointer=J.escapeJsonPointer=J.escapeFragment=J.unescapeFragment=J.schemaRefOrVal=J.schemaHasRulesButRef=J.schemaHasRules=J.checkUnknownRules=J.alwaysValidSchema=J.toHash=void 0;const je=ue,DS=ds;function zS(e){const t={};for(const n of e)t[n]=!0;return t}J.toHash=zS;function FS(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Rv(e,t),!Av(t,e.self.RULES.all))}J.alwaysValidSchema=FS;function Rv(e,t=e.schema){const{opts:n,self:o}=e;if(!n.strictSchema||typeof t=="boolean")return;const r=o.RULES.keywords;for(const i in t)r[i]||Uv(e,`unknown keyword: "${i}"`)}J.checkUnknownRules=Rv;function Av(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}J.schemaHasRules=Av;function BS(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}J.schemaHasRulesButRef=BS;function HS({topSchemaRef:e,schemaPath:t},n,o,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,je._)`${n}`}return(0,je._)`${e}${t}${(0,je.getProperty)(o)}`}J.schemaRefOrVal=HS;function VS(e){return Mv(decodeURIComponent(e))}J.unescapeFragment=VS;function WS(e){return encodeURIComponent(Yu(e))}J.escapeFragment=WS;function Yu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}J.escapeJsonPointer=Yu;function Mv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}J.unescapeJsonPointer=Mv;function KS(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}J.eachItem=KS;function qm({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(r,i,s,a)=>{const l=s===void 0?i:s instanceof je.Name?(i instanceof je.Name?e(r,i,s):t(r,i,s),s):i instanceof je.Name?(t(r,s,i),i):n(i,s);return a===je.Name&&!(l instanceof je.Name)?o(r,l):l}}J.mergeEvaluated={props:qm({mergeNames:(e,t,n)=>e.if((0,je._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,je._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,je._)`${n} || {}`).code((0,je._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,je._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,je._)`${n} || {}`),Xu(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:qv}),items:qm({mergeNames:(e,t,n)=>e.if((0,je._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,je._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,je._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,je._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function qv(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,je._)`{}`);return t!==void 0&&Xu(e,n,t),n}J.evaluatedPropsToName=qv;function Xu(e,t,n){Object.keys(n).forEach(o=>e.assign((0,je._)`${t}${(0,je.getProperty)(o)}`,!0))}J.setEvaluated=Xu;const Um={};function GS(e,t){return e.scopeValue("func",{ref:t,code:Um[t.code]||(Um[t.code]=new DS._Code(t.code))})}J.useFunc=GS;var Rd;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Rd||(J.Type=Rd={}));function JS(e,t,n){if(e instanceof je.Name){const o=t===Rd.Num;return n?o?(0,je._)`"[" + ${e} + "]"`:(0,je._)`"['" + ${e} + "']"`:o?(0,je._)`"/" + ${e}`:(0,je._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,je.getProperty)(e).toString():"/"+Yu(e)}J.getErrorPath=JS;function Uv(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}J.checkStrictMode=Uv;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});const pt=ue,QS={data:new pt.Name("data"),valCxt:new pt.Name("valCxt"),instancePath:new pt.Name("instancePath"),parentData:new pt.Name("parentData"),parentDataProperty:new pt.Name("parentDataProperty"),rootData:new pt.Name("rootData"),dynamicAnchors:new pt.Name("dynamicAnchors"),vErrors:new pt.Name("vErrors"),errors:new pt.Name("errors"),this:new pt.Name("this"),self:new pt.Name("self"),scope:new pt.Name("scope"),json:new pt.Name("json"),jsonPos:new pt.Name("jsonPos"),jsonLen:new pt.Name("jsonLen"),jsonPart:new pt.Name("jsonPart")};Dt.default=QS;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ue,n=J,o=Dt;e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:u})=>u?(0,t.str)`"${v}" keyword must be ${u} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function r(v,u=e.keywordError,p,x){const{it:S}=v,{gen:T,compositeRule:C,allErrors:$}=S,j=m(v,u,p);x??(C||$)?l(T,j):c(S,(0,t._)`[${j}]`)}e.reportError=r;function i(v,u=e.keywordError,p){const{it:x}=v,{gen:S,compositeRule:T,allErrors:C}=x,$=m(v,u,p);l(S,$),T||C||c(x,o.default.vErrors)}e.reportExtraError=i;function s(v,u){v.assign(o.default.errors,u),v.if((0,t._)`${o.default.vErrors} !== null`,()=>v.if(u,()=>v.assign((0,t._)`${o.default.vErrors}.length`,u),()=>v.assign(o.default.vErrors,null)))}e.resetErrorsCount=s;function a({gen:v,keyword:u,schemaValue:p,data:x,errsCount:S,it:T}){if(S===void 0)throw new Error("ajv implementation error");const C=v.name("err");v.forRange("i",S,o.default.errors,$=>{v.const(C,(0,t._)`${o.default.vErrors}[${$}]`),v.if((0,t._)`${C}.instancePath === undefined`,()=>v.assign((0,t._)`${C}.instancePath`,(0,t.strConcat)(o.default.instancePath,T.errorPath))),v.assign((0,t._)`${C}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${u}`),T.opts.verbose&&(v.assign((0,t._)`${C}.schema`,p),v.assign((0,t._)`${C}.data`,x))})}e.extendErrors=a;function l(v,u){const p=v.const("err",u);v.if((0,t._)`${o.default.vErrors} === null`,()=>v.assign(o.default.vErrors,(0,t._)`[${p}]`),(0,t._)`${o.default.vErrors}.push(${p})`),v.code((0,t._)`${o.default.errors}++`)}function c(v,u){const{gen:p,validateName:x,schemaEnv:S}=v;S.$async?p.throw((0,t._)`new ${v.ValidationError}(${u})`):(p.assign((0,t._)`${x}.errors`,u),p.return(!1))}const f={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(v,u,p){const{createErrors:x}=v.it;return x===!1?(0,t._)`{}`:h(v,u,p)}function h(v,u,p={}){const{gen:x,it:S}=v,T=[y(S,p),g(v,p)];return b(v,u,T),x.object(...T)}function y({errorPath:v},{instancePath:u}){const p=u?(0,t.str)`${v}${(0,n.getErrorPath)(u,n.Type.Str)}`:v;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,p)]}function g({keyword:v,it:{errSchemaPath:u}},{schemaPath:p,parentSchema:x}){let S=x?u:(0,t.str)`${u}/${v}`;return p&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(p,n.Type.Str)}`),[f.schemaPath,S]}function b(v,{params:u,message:p},x){const{keyword:S,data:T,schemaValue:C,it:$}=v,{opts:j,propertyName:R,topSchemaRef:M,schemaPath:F}=$;x.push([f.keyword,S],[f.params,typeof u=="function"?u(v):u||(0,t._)`{}`]),j.messages&&x.push([f.message,typeof p=="function"?p(v):p]),j.verbose&&x.push([f.schema,C],[f.parentSchema,(0,t._)`${M}${F}`],[o.default.data,T]),R&&x.push([f.propertyName,R])}})(js);Object.defineProperty(Vr,"__esModule",{value:!0});Vr.boolOrEmptySchema=Vr.topBoolOrEmptySchema=void 0;const YS=js,XS=ue,ZS=Dt,e$={message:"boolean schema is false"};function t$(e){const{gen:t,schema:n,validateName:o}=e;n===!1?Lv(e,!1):typeof n=="object"&&n.$async===!0?t.return(ZS.default.data):(t.assign((0,XS._)`${o}.errors`,null),t.return(!0))}Vr.topBoolOrEmptySchema=t$;function n$(e,t){const{gen:n,schema:o}=e;o===!1?(n.var(t,!1),Lv(e)):n.var(t,!0)}Vr.boolOrEmptySchema=n$;function Lv(e,t){const{gen:n,data:o}=e,r={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,YS.reportError)(r,e$,void 0,t)}var et={},Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.getRules=Go.isJSONType=void 0;const o$=["string","number","integer","boolean","null","object","array"],r$=new Set(o$);function i$(e){return typeof e=="string"&&r$.has(e)}Go.isJSONType=i$;function s$(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Go.getRules=s$;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.shouldUseRule=An.shouldUseGroup=An.schemaHasRulesForType=void 0;function a$({schema:e,self:t},n){const o=t.RULES.types[n];return o&&o!==!0&&Dv(e,o)}An.schemaHasRulesForType=a$;function Dv(e,t){return t.rules.some(n=>zv(e,n))}An.shouldUseGroup=Dv;function zv(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(o=>e[o]!==void 0))}An.shouldUseRule=zv;Object.defineProperty(et,"__esModule",{value:!0});et.reportTypeError=et.checkDataTypes=et.checkDataType=et.coerceAndCheckDataType=et.getJSONTypes=et.getSchemaTypes=et.DataType=void 0;const l$=Go,c$=An,d$=js,fe=ue,Fv=J;var Ir;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ir||(et.DataType=Ir={}));function u$(e){const t=Bv(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}et.getSchemaTypes=u$;function Bv(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(l$.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}et.getJSONTypes=Bv;function p$(e,t){const{gen:n,data:o,opts:r}=e,i=f$(t,r.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,c$.schemaHasRulesForType)(e,t[0]));if(s){const a=Zu(t,o,r.strictNumbers,Ir.Wrong);n.if(a,()=>{i.length?m$(e,t,i):ep(e)})}return s}et.coerceAndCheckDataType=p$;const Hv=new Set(["string","number","integer","boolean","null"]);function f$(e,t){return t?e.filter(n=>Hv.has(n)||t==="array"&&n==="array"):[]}function m$(e,t,n){const{gen:o,data:r,opts:i}=e,s=o.let("dataType",(0,fe._)`typeof ${r}`),a=o.let("coerced",(0,fe._)`undefined`);i.coerceTypes==="array"&&o.if((0,fe._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>o.assign(r,(0,fe._)`${r}[0]`).assign(s,(0,fe._)`typeof ${r}`).if(Zu(t,r,i.strictNumbers),()=>o.assign(a,r))),o.if((0,fe._)`${a} !== undefined`);for(const c of n)(Hv.has(c)||c==="array"&&i.coerceTypes==="array")&&l(c);o.else(),ep(e),o.endIf(),o.if((0,fe._)`${a} !== undefined`,()=>{o.assign(r,a),h$(e,a)});function l(c){switch(c){case"string":o.elseIf((0,fe._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,fe._)`"" + ${r}`).elseIf((0,fe._)`${r} === null`).assign(a,(0,fe._)`""`);return;case"number":o.elseIf((0,fe._)`${s} == "boolean" || ${r} === null
1760
- || (${s} == "string" && ${r} && ${r} == +${r})`).assign(a,(0,fe._)`+${r}`);return;case"integer":o.elseIf((0,fe._)`${s} === "boolean" || ${r} === null
1761
- || (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(a,(0,fe._)`+${r}`);return;case"boolean":o.elseIf((0,fe._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(a,!1).elseIf((0,fe._)`${r} === "true" || ${r} === 1`).assign(a,!0);return;case"null":o.elseIf((0,fe._)`${r} === "" || ${r} === 0 || ${r} === false`),o.assign(a,null);return;case"array":o.elseIf((0,fe._)`${s} === "string" || ${s} === "number"
1762
- || ${s} === "boolean" || ${r} === null`).assign(a,(0,fe._)`[${r}]`)}}}function h$({gen:e,parentData:t,parentDataProperty:n},o){e.if((0,fe._)`${t} !== undefined`,()=>e.assign((0,fe._)`${t}[${n}]`,o))}function Ad(e,t,n,o=Ir.Correct){const r=o===Ir.Correct?fe.operators.EQ:fe.operators.NEQ;let i;switch(e){case"null":return(0,fe._)`${t} ${r} null`;case"array":i=(0,fe._)`Array.isArray(${t})`;break;case"object":i=(0,fe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,fe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,fe._)`typeof ${t} ${r} ${e}`}return o===Ir.Correct?i:(0,fe.not)(i);function s(a=fe.nil){return(0,fe.and)((0,fe._)`typeof ${t} == "number"`,a,n?(0,fe._)`isFinite(${t})`:fe.nil)}}et.checkDataType=Ad;function Zu(e,t,n,o){if(e.length===1)return Ad(e[0],t,n,o);let r;const i=(0,Fv.toHash)(e);if(i.array&&i.object){const s=(0,fe._)`typeof ${t} != "object"`;r=i.null?s:(0,fe._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else r=fe.nil;i.number&&delete i.integer;for(const s in i)r=(0,fe.and)(r,Ad(s,t,n,o));return r}et.checkDataTypes=Zu;const y$={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,fe._)`{type: ${e}}`:(0,fe._)`{type: ${t}}`};function ep(e){const t=g$(e);(0,d$.reportError)(t,y$)}et.reportTypeError=ep;function g$(e){const{gen:t,data:n,schema:o}=e,r=(0,Fv.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:n,schema:o.type,schemaCode:r,schemaValue:r,parentSchema:o,params:{},it:e}}var El={};Object.defineProperty(El,"__esModule",{value:!0});El.assignDefaults=void 0;const ir=ue,v$=J;function b$(e,t){const{properties:n,items:o}=e.schema;if(t==="object"&&n)for(const r in n)Lm(e,r,n[r].default);else t==="array"&&Array.isArray(o)&&o.forEach((r,i)=>Lm(e,i,r.default))}El.assignDefaults=b$;function Lm(e,t,n){const{gen:o,compositeRule:r,data:i,opts:s}=e;if(n===void 0)return;const a=(0,ir._)`${i}${(0,ir.getProperty)(t)}`;if(r){(0,v$.checkStrictMode)(e,`default is ignored for: ${a}`);return}let l=(0,ir._)`${a} === undefined`;s.useDefaults==="empty"&&(l=(0,ir._)`${l} || ${a} === null || ${a} === ""`),o.if(l,(0,ir._)`${a} = ${(0,ir.stringify)(n)}`)}var bn={},ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;const Ae=ue,tp=J,Kn=Dt,x$=J;function w$(e,t){const{gen:n,data:o,it:r}=e;n.if(op(n,o,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ae._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=w$;function S$({gen:e,data:t,it:{opts:n}},o,r){return(0,Ae.or)(...o.map(i=>(0,Ae.and)(op(e,t,i,n.ownProperties),(0,Ae._)`${r} = ${i}`)))}ye.checkMissingProp=S$;function $$(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=$$;function Vv(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ae._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=Vv;function np(e,t,n){return(0,Ae._)`${Vv(e)}.call(${t}, ${n})`}ye.isOwnProperty=np;function k$(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} !== undefined`;return o?(0,Ae._)`${r} && ${np(e,t,n)}`:r}ye.propertyInData=k$;function op(e,t,n,o){const r=(0,Ae._)`${t}${(0,Ae.getProperty)(n)} === undefined`;return o?(0,Ae.or)(r,(0,Ae.not)(np(e,t,n))):r}ye.noPropertyInData=op;function Wv(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=Wv;function T$(e,t){return Wv(t).filter(n=>!(0,tp.alwaysValidSchema)(e,t[n]))}ye.schemaProperties=T$;function _$({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:r,errorPath:i},it:s},a,l,c){const f=c?(0,Ae._)`${e}, ${t}, ${o}${r}`:t,m=[[Kn.default.instancePath,(0,Ae.strConcat)(Kn.default.instancePath,i)],[Kn.default.parentData,s.parentData],[Kn.default.parentDataProperty,s.parentDataProperty],[Kn.default.rootData,Kn.default.rootData]];s.opts.dynamicRef&&m.push([Kn.default.dynamicAnchors,Kn.default.dynamicAnchors]);const h=(0,Ae._)`${f}, ${n.object(...m)}`;return l!==Ae.nil?(0,Ae._)`${a}.call(${l}, ${h})`:(0,Ae._)`${a}(${h})`}ye.callValidateCode=_$;const j$=(0,Ae._)`new RegExp`;function N$({gen:e,it:{opts:t}},n){const o=t.unicodeRegExp?"u":"",{regExp:r}=t.code,i=r(n,o);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Ae._)`${r.code==="new RegExp"?j$:(0,x$.useFunc)(e,r)}(${n}, ${o})`})}ye.usePattern=N$;function C$(e){const{gen:t,data:n,keyword:o,it:r}=e,i=t.name("valid");if(r.allErrors){const a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){const l=t.const("len",(0,Ae._)`${n}.length`);t.forRange("i",0,l,c=>{e.subschema({keyword:o,dataProp:c,dataPropType:tp.Type.Num},i),t.if((0,Ae.not)(i),a)})}}ye.validateArray=C$;function E$(e){const{gen:t,schema:n,keyword:o,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,tp.alwaysValidSchema)(r,l))&&!r.opts.unevaluated)return;const s=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,c)=>{const f=e.subschema({keyword:o,schemaProp:c,compositeRule:!0},a);t.assign(s,(0,Ae._)`${s} || ${a}`),e.mergeValidEvaluated(f,a)||t.if((0,Ae.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ye.validateUnion=E$;Object.defineProperty(bn,"__esModule",{value:!0});bn.validateKeywordUsage=bn.validSchemaType=bn.funcKeywordCode=bn.macroKeywordCode=void 0;const bt=ue,Po=Dt,P$=ye,I$=js;function O$(e,t){const{gen:n,keyword:o,schema:r,parentSchema:i,it:s}=e,a=t.macro.call(s.self,r,i,s),l=Kv(n,o,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const c=n.name("valid");e.subschema({schema:a,schemaPath:bt.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:l,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}bn.macroKeywordCode=O$;function R$(e,t){var n;const{gen:o,keyword:r,schema:i,parentSchema:s,$data:a,it:l}=e;M$(l,t);const c=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,f=Kv(o,r,c),m=o.let("valid");e.block$data(m,h),e.ok((n=t.valid)!==null&&n!==void 0?n:m);function h(){if(t.errors===!1)b(),t.modifying&&Dm(e),v(()=>e.error());else{const u=t.async?y():g();t.modifying&&Dm(e),v(()=>A$(e,u))}}function y(){const u=o.let("ruleErrs",null);return o.try(()=>b((0,bt._)`await `),p=>o.assign(m,!1).if((0,bt._)`${p} instanceof ${l.ValidationError}`,()=>o.assign(u,(0,bt._)`${p}.errors`),()=>o.throw(p))),u}function g(){const u=(0,bt._)`${f}.errors`;return o.assign(u,null),b(bt.nil),u}function b(u=t.async?(0,bt._)`await `:bt.nil){const p=l.opts.passContext?Po.default.this:Po.default.self,x=!("compile"in t&&!a||t.schema===!1);o.assign(m,(0,bt._)`${u}${(0,P$.callValidateCode)(e,f,p,x)}`,t.modifying)}function v(u){var p;o.if((0,bt.not)((p=t.valid)!==null&&p!==void 0?p:m),u)}}bn.funcKeywordCode=R$;function Dm(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,()=>t.assign(n,(0,bt._)`${o.parentData}[${o.parentDataProperty}]`))}function A$(e,t){const{gen:n}=e;n.if((0,bt._)`Array.isArray(${t})`,()=>{n.assign(Po.default.vErrors,(0,bt._)`${Po.default.vErrors} === null ? ${t} : ${Po.default.vErrors}.concat(${t})`).assign(Po.default.errors,(0,bt._)`${Po.default.vErrors}.length`),(0,I$.extendErrors)(e)},()=>e.error())}function M$({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Kv(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,bt.stringify)(n)})}function q$(e,t,n=!1){return!t.length||t.some(o=>o==="array"?Array.isArray(e):o==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==o||n&&typeof e>"u")}bn.validSchemaType=q$;function U$({schema:e,opts:t,self:n,errSchemaPath:o},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");const s=r.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[i])){const l=`keyword "${i}" value is invalid at path "${o}": `+n.errorsText(r.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(l);else throw new Error(l)}}bn.validateKeywordUsage=U$;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.extendSubschemaMode=yo.extendSubschemaData=yo.getSubschema=void 0;const vn=ue,Gv=J;function L$(e,{keyword:t,schemaProp:n,schema:o,schemaPath:r,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return n===void 0?{schema:a,schemaPath:(0,vn._)`${e.schemaPath}${(0,vn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:(0,vn._)`${e.schemaPath}${(0,vn.getProperty)(t)}${(0,vn.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Gv.escapeFragment)(n)}`}}if(o!==void 0){if(r===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:r,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}yo.getSubschema=L$;function D$(e,t,{dataProp:n,dataPropType:o,data:r,dataTypes:i,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(n!==void 0){const{errorPath:c,dataPathArr:f,opts:m}=t,h=a.let("data",(0,vn._)`${t.data}${(0,vn.getProperty)(n)}`,!0);l(h),e.errorPath=(0,vn.str)`${c}${(0,Gv.getErrorPath)(n,o,m.jsPropertySyntax)}`,e.parentDataProperty=(0,vn._)`${n}`,e.dataPathArr=[...f,e.parentDataProperty]}if(r!==void 0){const c=r instanceof vn.Name?r:a.let("data",r,!0);l(c),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}yo.extendSubschemaData=D$;function z$(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:o,createErrors:r,allErrors:i}){o!==void 0&&(e.compositeRule=o),r!==void 0&&(e.createErrors=r),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}yo.extendSubschemaMode=z$;var at={},Jv=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var s=i[r];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},Qv={exports:{}},so=Qv.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var o=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};va(t,o,r,e,"",e)};so.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};so.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};so.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};so.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function va(e,t,n,o,r,i,s,a,l,c){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,r,i,s,a,l,c);for(var f in o){var m=o[f];if(Array.isArray(m)){if(f in so.arrayKeywords)for(var h=0;h<m.length;h++)va(e,t,n,m[h],r+"/"+f+"/"+h,i,r,f,o,h)}else if(f in so.propsKeywords){if(m&&typeof m=="object")for(var y in m)va(e,t,n,m[y],r+"/"+f+"/"+F$(y),i,r,f,o,y)}else(f in so.keywords||e.allKeys&&!(f in so.skipKeywords))&&va(e,t,n,m,r+"/"+f,i,r,f,o)}n(o,r,i,s,a,l,c)}}function F$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var B$=Qv.exports;Object.defineProperty(at,"__esModule",{value:!0});at.getSchemaRefs=at.resolveUrl=at.normalizeId=at._getFullPath=at.getFullPath=at.inlineRef=void 0;const H$=J,V$=Jv,W$=B$,K$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function G$(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Md(e):t?Yv(e)<=t:!1}at.inlineRef=G$;const J$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Md(e){for(const t in e){if(J$.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(Md)||typeof n=="object"&&Md(n))return!0}return!1}function Yv(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!K$.has(n)&&(typeof e[n]=="object"&&(0,H$.eachItem)(e[n],o=>t+=Yv(o)),t===1/0))return 1/0}return t}function Xv(e,t="",n){n!==!1&&(t=Or(t));const o=e.parse(t);return Zv(e,o)}at.getFullPath=Xv;function Zv(e,t){return e.serialize(t).split("#")[0]+"#"}at._getFullPath=Zv;const Q$=/#\/?$/;function Or(e){return e?e.replace(Q$,""):""}at.normalizeId=Or;function Y$(e,t,n){return n=Or(n),e.resolve(t,n)}at.resolveUrl=Y$;const X$=/^[a-z_][-a-z0-9._]*$/i;function Z$(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:o}=this.opts,r=Or(e[n]||t),i={"":r},s=Xv(o,r,!1),a={},l=new Set;return W$(e,{allKeys:!0},(m,h,y,g)=>{if(g===void 0)return;const b=s+h;let v=i[g];typeof m[n]=="string"&&(v=u.call(this,m[n])),p.call(this,m.$anchor),p.call(this,m.$dynamicAnchor),i[h]=v;function u(x){const S=this.opts.uriResolver.resolve;if(x=Or(v?S(v,x):x),l.has(x))throw f(x);l.add(x);let T=this.refs[x];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?c(m,T.schema,x):x!==Or(b)&&(x[0]==="#"?(c(m,a[x],x),a[x]=m):this.refs[x]=b),x}function p(x){if(typeof x=="string"){if(!X$.test(x))throw new Error(`invalid anchor "${x}"`);u.call(this,`#${x}`)}}}),a;function c(m,h,y){if(h!==void 0&&!V$(m,h))throw f(y)}function f(m){return new Error(`reference "${m}" resolves to more than one schema`)}}at.getSchemaRefs=Z$;Object.defineProperty(ln,"__esModule",{value:!0});ln.getData=ln.KeywordCxt=ln.validateFunctionCode=void 0;const eb=Vr,zm=et,rp=An,nl=et,ek=El,qi=bn,vc=yo,re=ue,le=Dt,tk=at,Mn=J,mi=js;function nk(e){if(ob(e)&&(rb(e),nb(e))){ik(e);return}tb(e,()=>(0,eb.topBoolOrEmptySchema)(e))}ln.validateFunctionCode=nk;function tb({gen:e,validateName:t,schema:n,schemaEnv:o,opts:r},i){r.code.es5?e.func(t,(0,re._)`${le.default.data}, ${le.default.valCxt}`,o.$async,()=>{e.code((0,re._)`"use strict"; ${Fm(n,r)}`),rk(e,r),e.code(i)}):e.func(t,(0,re._)`${le.default.data}, ${ok(r)}`,o.$async,()=>e.code(Fm(n,r)).code(i))}function ok(e){return(0,re._)`{${le.default.instancePath}="", ${le.default.parentData}, ${le.default.parentDataProperty}, ${le.default.rootData}=${le.default.data}${e.dynamicRef?(0,re._)`, ${le.default.dynamicAnchors}={}`:re.nil}}={}`}function rk(e,t){e.if(le.default.valCxt,()=>{e.var(le.default.instancePath,(0,re._)`${le.default.valCxt}.${le.default.instancePath}`),e.var(le.default.parentData,(0,re._)`${le.default.valCxt}.${le.default.parentData}`),e.var(le.default.parentDataProperty,(0,re._)`${le.default.valCxt}.${le.default.parentDataProperty}`),e.var(le.default.rootData,(0,re._)`${le.default.valCxt}.${le.default.rootData}`),t.dynamicRef&&e.var(le.default.dynamicAnchors,(0,re._)`${le.default.valCxt}.${le.default.dynamicAnchors}`)},()=>{e.var(le.default.instancePath,(0,re._)`""`),e.var(le.default.parentData,(0,re._)`undefined`),e.var(le.default.parentDataProperty,(0,re._)`undefined`),e.var(le.default.rootData,le.default.data),t.dynamicRef&&e.var(le.default.dynamicAnchors,(0,re._)`{}`)})}function ik(e){const{schema:t,opts:n,gen:o}=e;tb(e,()=>{n.$comment&&t.$comment&&sb(e),dk(e),o.let(le.default.vErrors,null),o.let(le.default.errors,0),n.unevaluated&&sk(e),ib(e),fk(e)})}function sk(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,re._)`${n}.evaluated`),t.if((0,re._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,re._)`${e.evaluated}.props`,(0,re._)`undefined`)),t.if((0,re._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,re._)`${e.evaluated}.items`,(0,re._)`undefined`))}function Fm(e,t){const n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,re._)`/*# sourceURL=${n} */`:re.nil}function ak(e,t){if(ob(e)&&(rb(e),nb(e))){lk(e,t);return}(0,eb.boolOrEmptySchema)(e,t)}function nb({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function ob(e){return typeof e.schema!="boolean"}function lk(e,t){const{schema:n,gen:o,opts:r}=e;r.$comment&&n.$comment&&sb(e),uk(e),pk(e);const i=o.const("_errs",le.default.errors);ib(e,i),o.var(t,(0,re._)`${i} === ${le.default.errors}`)}function rb(e){(0,Mn.checkUnknownRules)(e),ck(e)}function ib(e,t){if(e.opts.jtd)return Bm(e,[],!1,t);const n=(0,zm.getSchemaTypes)(e.schema),o=(0,zm.coerceAndCheckDataType)(e,n);Bm(e,n,!o,t)}function ck(e){const{schema:t,errSchemaPath:n,opts:o,self:r}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,Mn.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function dk(e){const{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,Mn.checkStrictMode)(e,"default is ignored in the schema root")}function uk(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,tk.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function pk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function sb({gen:e,schemaEnv:t,schema:n,errSchemaPath:o,opts:r}){const i=n.$comment;if(r.$comment===!0)e.code((0,re._)`${le.default.self}.logger.log(${i})`);else if(typeof r.$comment=="function"){const s=(0,re.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,re._)`${le.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function fk(e){const{gen:t,schemaEnv:n,validateName:o,ValidationError:r,opts:i}=e;n.$async?t.if((0,re._)`${le.default.errors} === 0`,()=>t.return(le.default.data),()=>t.throw((0,re._)`new ${r}(${le.default.vErrors})`)):(t.assign((0,re._)`${o}.errors`,le.default.vErrors),i.unevaluated&&mk(e),t.return((0,re._)`${le.default.errors} === 0`))}function mk({gen:e,evaluated:t,props:n,items:o}){n instanceof re.Name&&e.assign((0,re._)`${t}.props`,n),o instanceof re.Name&&e.assign((0,re._)`${t}.items`,o)}function Bm(e,t,n,o){const{gen:r,schema:i,data:s,allErrors:a,opts:l,self:c}=e,{RULES:f}=c;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,Mn.schemaHasRulesButRef)(i,f))){r.block(()=>cb(e,"$ref",f.all.$ref.definition));return}l.jtd||hk(e,t),r.block(()=>{for(const h of f.rules)m(h);m(f.post)});function m(h){(0,rp.shouldUseGroup)(i,h)&&(h.type?(r.if((0,nl.checkDataType)(h.type,s,l.strictNumbers)),Hm(e,h),t.length===1&&t[0]===h.type&&n&&(r.else(),(0,nl.reportTypeError)(e)),r.endIf()):Hm(e,h),a||r.if((0,re._)`${le.default.errors} === ${o||0}`))}}function Hm(e,t){const{gen:n,schema:o,opts:{useDefaults:r}}=e;r&&(0,ek.assignDefaults)(e,t.type),n.block(()=>{for(const i of t.rules)(0,rp.shouldUseRule)(o,i)&&cb(e,i.keyword,i.definition,t.type)})}function hk(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(yk(e,t),e.opts.allowUnionTypes||gk(e,t),vk(e,e.dataTypes))}function yk(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{ab(e.dataTypes,n)||ip(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),xk(e,t)}}function gk(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&ip(e,"use allowUnionTypes to allow union type keyword")}function vk(e,t){const n=e.self.RULES.all;for(const o in n){const r=n[o];if(typeof r=="object"&&(0,rp.shouldUseRule)(e.schema,r)){const{type:i}=r.definition;i.length&&!i.some(s=>bk(t,s))&&ip(e,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function bk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function ab(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function xk(e,t){const n=[];for(const o of e.dataTypes)ab(t,o)?n.push(o):t.includes("integer")&&o==="number"&&n.push("integer");e.dataTypes=n}function ip(e,t){const n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Mn.checkStrictMode)(e,t,e.opts.strictTypes)}class lb{constructor(t,n,o){if((0,qi.validateKeywordUsage)(t,n,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Mn.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",db(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,qi.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=t.gen.const("_errs",le.default.errors))}result(t,n,o){this.failResult((0,re.not)(t),n,o)}failResult(t,n,o){this.gen.if(t),o?o():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,re.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:n}=this;this.fail((0,re._)`${n} !== undefined && (${(0,re.or)(this.invalid$data(),t)})`)}error(t,n,o){if(n){this.setParams(n),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,n){(t?mi.reportExtraError:mi.reportError)(this,this.def.error,n)}$dataError(){(0,mi.reportError)(this,this.def.$dataError||mi.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,mi.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,o=re.nil){this.gen.block(()=>{this.check$data(t,o),n()})}check$data(t=re.nil,n=re.nil){if(!this.$data)return;const{gen:o,schemaCode:r,schemaType:i,def:s}=this;o.if((0,re.or)((0,re._)`${r} === undefined`,n)),t!==re.nil&&o.assign(t,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),t!==re.nil&&o.assign(t,!1)),o.else()}invalid$data(){const{gen:t,schemaCode:n,schemaType:o,def:r,it:i}=this;return(0,re.or)(s(),a());function s(){if(o.length){if(!(n instanceof re.Name))throw new Error("ajv implementation error");const l=Array.isArray(o)?o:[o];return(0,re._)`${(0,nl.checkDataTypes)(l,n,i.opts.strictNumbers,nl.DataType.Wrong)}`}return re.nil}function a(){if(r.validateSchema){const l=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,re._)`!${l}(${n})`}return re.nil}}subschema(t,n){const o=(0,vc.getSubschema)(this.it,t);(0,vc.extendSubschemaData)(o,this.it,t),(0,vc.extendSubschemaMode)(o,t);const r={...this.it,...o,items:void 0,props:void 0};return ak(r,n),r}mergeEvaluated(t,n){const{it:o,gen:r}=this;o.opts.unevaluated&&(o.props!==!0&&t.props!==void 0&&(o.props=Mn.mergeEvaluated.props(r,t.props,o.props,n)),o.items!==!0&&t.items!==void 0&&(o.items=Mn.mergeEvaluated.items(r,t.items,o.items,n)))}mergeValidEvaluated(t,n){const{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(n,()=>this.mergeEvaluated(t,re.Name)),!0}}ln.KeywordCxt=lb;function cb(e,t,n,o){const r=new lb(e,n,t);"code"in n?n.code(r,o):r.$data&&n.validate?(0,qi.funcKeywordCode)(r,n):"macro"in n?(0,qi.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,qi.funcKeywordCode)(r,n)}const wk=/^\/(?:[^~]|~0|~1)*$/,Sk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function db(e,{dataLevel:t,dataNames:n,dataPathArr:o}){let r,i;if(e==="")return le.default.rootData;if(e[0]==="/"){if(!wk.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,i=le.default.rootData}else{const c=Sk.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);const f=+c[1];if(r=c[2],r==="#"){if(f>=t)throw new Error(l("property/index",f));return o[t-f]}if(f>t)throw new Error(l("data",f));if(i=n[t-f],!r)return i}let s=i;const a=r.split("/");for(const c of a)c&&(i=(0,re._)`${i}${(0,re.getProperty)((0,Mn.unescapeJsonPointer)(c))}`,s=(0,re._)`${s} && ${i}`);return s;function l(c,f){return`Cannot access ${c} ${f} levels up, current level is ${t}`}}ln.getData=db;var Js={},Vm;function sp(){if(Vm)return Js;Vm=1,Object.defineProperty(Js,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Js.default=e,Js}var Qs={},Wm;function Pl(){if(Wm)return Qs;Wm=1,Object.defineProperty(Qs,"__esModule",{value:!0});const e=at;class t extends Error{constructor(o,r,i,s){super(s||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,e.resolveUrl)(o,r,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}return Qs.default=t,Qs}var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.resolveSchema=xt.getCompilingSchema=xt.resolveRef=xt.compileSchema=xt.SchemaEnv=void 0;const Zt=ue,$k=sp(),jo=Dt,rn=at,Km=J,kk=ln;class Il{constructor(t){var n;this.refs={},this.dynamicAnchors={};let o;typeof t.schema=="object"&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,rn.normalizeId)(o==null?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o==null?void 0:o.$async,this.refs={}}}xt.SchemaEnv=Il;function ap(e){const t=ub.call(this,e);if(t)return t;const n=(0,rn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:o,lines:r}=this.opts.code,{ownProperties:i}=this.opts,s=new Zt.CodeGen(this.scope,{es5:o,lines:r,ownProperties:i});let a;e.$async&&(a=s.scopeValue("Error",{ref:$k.default,code:(0,Zt._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");e.validateName=l;const c={gen:s,allErrors:this.opts.allErrors,data:jo.default.data,parentData:jo.default.parentData,parentDataProperty:jo.default.parentDataProperty,dataNames:[jo.default.data],dataPathArr:[Zt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Zt.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Zt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Zt._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,kk.validateFunctionCode)(c),s.optimize(this.opts.code.optimize);const m=s.toString();f=`${s.scopeRefs(jo.default.scope)}return ${m}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const y=new Function(`${jo.default.self}`,`${jo.default.scope}`,f)(this,this.scope.get());if(this.scope.value(l,{ref:y}),y.errors=null,y.schema=e.schema,y.schemaEnv=e,e.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:l,validateCode:m,scopeValues:s._values}),this.opts.unevaluated){const{props:g,items:b}=c;y.evaluated={props:g instanceof Zt.Name?void 0:g,items:b instanceof Zt.Name?void 0:b,dynamicProps:g instanceof Zt.Name,dynamicItems:b instanceof Zt.Name},y.source&&(y.source.evaluated=(0,Zt.stringify)(y.evaluated))}return e.validate=y,e}catch(m){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),m}finally{this._compilations.delete(e)}}xt.compileSchema=ap;function Tk(e,t,n){var o;n=(0,rn.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let i=Nk.call(this,e,n);if(i===void 0){const s=(o=e.localRefs)===null||o===void 0?void 0:o[n],{schemaId:a}=this.opts;s&&(i=new Il({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[n]=_k.call(this,i)}xt.resolveRef=Tk;function _k(e){return(0,rn.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:ap.call(this,e)}function ub(e){for(const t of this._compilations)if(jk(t,e))return t}xt.getCompilingSchema=ub;function jk(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Nk(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Ol.call(this,e,t)}function Ol(e,t){const n=this.opts.uriResolver.parse(t),o=(0,rn._getFullPath)(this.opts.uriResolver,n);let r=(0,rn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===r)return bc.call(this,n,e);const i=(0,rn.normalizeId)(o),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){const a=Ol.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:bc.call(this,n,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||ap.call(this,s),i===(0,rn.normalizeId)(t)){const{schema:a}=s,{schemaId:l}=this.opts,c=a[l];return c&&(r=(0,rn.resolveUrl)(this.opts.uriResolver,r,c)),new Il({schema:a,schemaId:l,root:e,baseId:r})}return bc.call(this,n,s)}}xt.resolveSchema=Ol;const Ck=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bc(e,{baseId:t,schema:n,root:o}){var r;if(((r=e.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,Km.unescapeFragment)(a)];if(l===void 0)return;n=l;const c=typeof n=="object"&&n[this.opts.schemaId];!Ck.has(a)&&c&&(t=(0,rn.resolveUrl)(this.opts.uriResolver,t,c))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,Km.schemaHasRulesButRef)(n,this.RULES)){const a=(0,rn.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Ol.call(this,o,a)}const{schemaId:s}=this.opts;if(i=i||new Il({schema:n,schemaId:s,root:o,baseId:t}),i.schema!==i.root.schema)return i}const Ek="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Pk="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ik="object",Ok=["$data"],Rk={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ak=!1,Mk={$id:Ek,description:Pk,type:Ik,required:Ok,properties:Rk,additionalProperties:Ak};var lp={},Rl={exports:{}};const qk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pb=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),cp=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),fb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Uk=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function mb(e){let t="",n=0,o=0;for(o=0;o<e.length;o++)if(n=e[o].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(n=e[o].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[o]}return t}const Lk=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Gm(e){return e.length=0,!0}function Dk(e,t,n){if(e.length){const o=mb(e);if(o!=="")t.push(o);else return n.error=!0,!1;e.length=0}return!0}function zk(e){let t=0;const n={error:!1,address:"",zone:""},o=[],r=[];let i=!1,s=!1,a=Dk;for(let l=0;l<e.length;l++){const c=e[l];if(!(c==="["||c==="]"))if(c===":"){if(i===!0&&(s=!0),!a(r,o,n))break;if(++t>7){n.error=!0;break}l>0&&e[l-1]===":"&&(i=!0),o.push(":");continue}else if(c==="%"){if(!a(r,o,n))break;a=Gm}else{r.push(c);continue}}return r.length&&(a===Gm?n.zone=r.join(""):s?o.push(r.join("")):o.push(mb(r))),n.address=o.join(""),n}function hb(e){if(Fk(e,":")<2)return{host:e,isIPV6:!1};const t=zk(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,o=t.address;return t.zone&&(n+="%"+t.zone,o+="%25"+t.zone),{host:n,isIPV6:!0,escapedHost:o}}}function Fk(e,t){let n=0;for(let o=0;o<e.length;o++)e[o]===t&&n++;return n}function Bk(e){let t=e;const n=[];let o=-1,r=0;for(;r=t.length;){if(r===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(r===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(r===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((o=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,o)),t=t.slice(o)}return n.join("")}const Hk={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Vk=/[@/?#:]/g,Wk=/[@/?#]/g;function yb(e,t){const n=t?Wk:Vk;return n.lastIndex=0,e.replace(n,o=>Hk[o])}function Kk(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let o=0;o<e.length;o++){if(e[o]==="%"&&o+2<e.length){const r=e.slice(o+1,o+3);if(cp(r)){const i=r.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&fb(s)?n+=s:n+="%"+i,o+=2;continue}}n+=e[o]}return n}function Gk(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(cp(o)){const r=o.toUpperCase(),i=String.fromCharCode(parseInt(r,16));i!=="."&&fb(i)?t+=i:t+="%"+r,n+=2;continue}}Uk(e[n])?t+=e[n]:t+=escape(e[n])}return t}function Jk(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const o=e.slice(n+1,n+3);if(cp(o)){t+="%"+o.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function Qk(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);if(!pb(n)){const o=hb(n);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=yb(n,!1)}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var gb={nonSimpleDomain:Lk,recomposeAuthority:Qk,reescapeHostDelimiters:yb,normalizePercentEncoding:Kk,normalizePathEncoding:Gk,escapePreservingEscapes:Jk,removeDotSegments:Bk,isIPv4:pb,isUUID:qk,normalizeIPv6:hb};const{isUUID:Yk}=gb,Xk=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function vb(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function bb(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function xb(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Zk(e){return e.secure=vb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function eT(e){if((e.port===(vb(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function tT(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(Xk);if(n){const o=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const r=`${o}:${t.nid||e.nid}`,i=dp(r);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function nT(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const n=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),r=`${n}:${t.nid||o}`,i=dp(r);i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${o||t.nid}:${a}`,t.skipEscape=!0,s}function oT(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Yk(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function rT(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const wb={scheme:"http",domainHost:!0,parse:bb,serialize:xb},iT={scheme:"https",domainHost:wb.domainHost,parse:bb,serialize:xb},ba={scheme:"ws",domainHost:!0,parse:Zk,serialize:eT},sT={scheme:"wss",domainHost:ba.domainHost,parse:ba.parse,serialize:ba.serialize},aT={scheme:"urn",parse:tT,serialize:nT,skipNormalize:!0},lT={scheme:"urn:uuid",parse:oT,serialize:rT,skipNormalize:!0},ol={http:wb,https:iT,ws:ba,wss:sT,urn:aT,"urn:uuid":lT};Object.setPrototypeOf(ol,null);function dp(e){return e&&(ol[e]||ol[e.toLowerCase()])||void 0}var cT={SCHEMES:ol,getSchemeHandler:dp};const{normalizeIPv6:dT,removeDotSegments:Ti,recomposeAuthority:uT,normalizePercentEncoding:pT,normalizePathEncoding:fT,escapePreservingEscapes:mT,reescapeHostDelimiters:hT,isIPv4:yT,nonSimpleDomain:gT}=gb,{SCHEMES:vT,getSchemeHandler:Sb}=cT;function bT(e,t){return typeof e=="string"?e=kT(e,t):typeof e=="object"&&(e=Wr(Jo(e,t),t)),e}function xT(e,t,n){const o=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=$b(Wr(e,o),Wr(t,o),o,!0);return o.skipEscape=!0,Jo(r,o)}function $b(e,t,n,o){const r={};return o||(e=Wr(Jo(e,n),n),t=Wr(Jo(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=Ti(t.path||""),r.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=Ti(t.path||""),r.query=t.query):(t.path?(t.path[0]==="/"?r.path=Ti(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?r.path="/"+t.path:e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path,r.path=Ti(r.path)),r.query=t.query):(r.path=e.path,t.query!==void 0?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function wT(e,t,n){const o=Jm(e,n),r=Jm(t,n);return o!==void 0&&r!==void 0&&o.toLowerCase()===r.toLowerCase()}function Jo(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},o=Object.assign({},t),r=[],i=Sb(o.scheme||n.scheme);i&&i.serialize&&i.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=pT(n.path):(n.path=mT(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),o.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");const s=uT(n);if(s!==void 0&&(o.reference!=="suffix"&&r.push("//"),r.push(s),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let a=n.path;!o.absolutePath&&(!i||!i.absolutePath)&&(a=Ti(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),r.push(a)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}const ST=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function $T(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function kb(e,t){const n=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let r=!1,i=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);const s=e.match(ST);if(s){o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]);const a=$T(o,s);if(a!==void 0&&(o.error=o.error||a,r=!0),o.host)if(yT(o.host)===!1){const f=dT(o.host);o.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==o.reference&&(o.error=o.error||"URI is not a "+n.reference+" reference.");const l=Sb(n.scheme||o.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&o.host&&(n.domainHost||l&&l.domainHost)&&i===!1&&gT(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(c){o.error=o.error||"Host's domain name can not be converted to ASCII: "+c}if((!l||l&&!l.skipNormalize)&&(e.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=hT(unescape(o.host),i))),o.path&&(o.path=fT(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}l&&l.parse&&l.parse(o,n)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:r}}function Wr(e,t){return kb(e,t).parsed}function kT(e,t){return Tb(e,t).normalized}function Tb(e,t){const{parsed:n,malformedAuthorityOrPort:o}=kb(e,t);return{normalized:o?e:Jo(n,t),malformedAuthorityOrPort:o}}function Jm(e,t){if(typeof e=="string"){const{normalized:n,malformedAuthorityOrPort:o}=Tb(e,t);return o?void 0:n}if(typeof e=="object")return Jo(e,t)}const up={SCHEMES:vT,normalize:bT,resolve:xT,resolveComponent:$b,equal:wT,serialize:Jo,parse:Wr};Rl.exports=up;Rl.exports.default=up;Rl.exports.fastUri=up;var TT=Rl.exports;Object.defineProperty(lp,"__esModule",{value:!0});const _b=TT;_b.code='require("ajv/dist/runtime/uri").default';lp.default=_b;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ln;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=ue;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const o=sp(),r=Pl(),i=Go,s=xt,a=ue,l=at,c=et,f=J,m=Mk,h=lp,y=(I,_)=>new RegExp(I,_);y.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},u={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function x(I){var _,A,E,w,k,N,B,O,Y,ie,de,we,ze,Ee,Se,_e,Ye,Pe,_n,Bn,_o,tr,Hn,pn,Yt;const Vn=I.strict,nr=(_=I.code)===null||_===void 0?void 0:_.optimize,ri=nr===!0||nr===void 0?1:nr||0,ii=(E=(A=I.code)===null||A===void 0?void 0:A.regExp)!==null&&E!==void 0?E:y,Vl=(w=I.uriResolver)!==null&&w!==void 0?w:h.default;return{strictSchema:(N=(k=I.strictSchema)!==null&&k!==void 0?k:Vn)!==null&&N!==void 0?N:!0,strictNumbers:(O=(B=I.strictNumbers)!==null&&B!==void 0?B:Vn)!==null&&O!==void 0?O:!0,strictTypes:(ie=(Y=I.strictTypes)!==null&&Y!==void 0?Y:Vn)!==null&&ie!==void 0?ie:"log",strictTuples:(we=(de=I.strictTuples)!==null&&de!==void 0?de:Vn)!==null&&we!==void 0?we:"log",strictRequired:(Ee=(ze=I.strictRequired)!==null&&ze!==void 0?ze:Vn)!==null&&Ee!==void 0?Ee:!1,code:I.code?{...I.code,optimize:ri,regExp:ii}:{optimize:ri,regExp:ii},loopRequired:(Se=I.loopRequired)!==null&&Se!==void 0?Se:p,loopEnum:(_e=I.loopEnum)!==null&&_e!==void 0?_e:p,meta:(Ye=I.meta)!==null&&Ye!==void 0?Ye:!0,messages:(Pe=I.messages)!==null&&Pe!==void 0?Pe:!0,inlineRefs:(_n=I.inlineRefs)!==null&&_n!==void 0?_n:!0,schemaId:(Bn=I.schemaId)!==null&&Bn!==void 0?Bn:"$id",addUsedSchema:(_o=I.addUsedSchema)!==null&&_o!==void 0?_o:!0,validateSchema:(tr=I.validateSchema)!==null&&tr!==void 0?tr:!0,validateFormats:(Hn=I.validateFormats)!==null&&Hn!==void 0?Hn:!0,unicodeRegExp:(pn=I.unicodeRegExp)!==null&&pn!==void 0?pn:!0,int32range:(Yt=I.int32range)!==null&&Yt!==void 0?Yt:!0,uriResolver:Vl}}class S{constructor(_={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,_=this.opts={..._,...x(_)};const{es5:A,lines:E}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:b,es5:A,lines:E}),this.logger=V(_.logger);const w=_.validateFormats;_.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,v,_,"NOT SUPPORTED"),T.call(this,u,_,"DEPRECATED","warn"),this._metaOpts=M.call(this),_.formats&&j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),_.keywords&&R.call(this,_.keywords),typeof _.meta=="object"&&this.addMetaSchema(_.meta),$.call(this),_.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:_,meta:A,schemaId:E}=this.opts;let w=m;E==="id"&&(w={...m},w.id=w.$id,delete w.$id),A&&_&&this.addMetaSchema(w,w[E],!1)}defaultMeta(){const{meta:_,schemaId:A}=this.opts;return this.opts.defaultMeta=typeof _=="object"?_[A]||_:void 0}validate(_,A){let E;if(typeof _=="string"){if(E=this.getSchema(_),!E)throw new Error(`no schema with key or ref "${_}"`)}else E=this.compile(_);const w=E(A);return"$async"in E||(this.errors=E.errors),w}compile(_,A){const E=this._addSchema(_,A);return E.validate||this._compileSchemaEnv(E)}compileAsync(_,A){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:E}=this.opts;return w.call(this,_,A);async function w(ie,de){await k.call(this,ie.$schema);const we=this._addSchema(ie,de);return we.validate||N.call(this,we)}async function k(ie){ie&&!this.getSchema(ie)&&await w.call(this,{$ref:ie},!0)}async function N(ie){try{return this._compileSchemaEnv(ie)}catch(de){if(!(de instanceof r.default))throw de;return B.call(this,de),await O.call(this,de.missingSchema),N.call(this,ie)}}function B({missingSchema:ie,missingRef:de}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${de} cannot be resolved`)}async function O(ie){const de=await Y.call(this,ie);this.refs[ie]||await k.call(this,de.$schema),this.refs[ie]||this.addSchema(de,ie,A)}async function Y(ie){const de=this._loading[ie];if(de)return de;try{return await(this._loading[ie]=E(ie))}finally{delete this._loading[ie]}}}addSchema(_,A,E,w=this.opts.validateSchema){if(Array.isArray(_)){for(const N of _)this.addSchema(N,void 0,E,w);return this}let k;if(typeof _=="object"){const{schemaId:N}=this.opts;if(k=_[N],k!==void 0&&typeof k!="string")throw new Error(`schema ${N} must be string`)}return A=(0,l.normalizeId)(A||k),this._checkUnique(A),this.schemas[A]=this._addSchema(_,E,A,w,!0),this}addMetaSchema(_,A,E=this.opts.validateSchema){return this.addSchema(_,A,!0,E),this}validateSchema(_,A){if(typeof _=="boolean")return!0;let E;if(E=_.$schema,E!==void 0&&typeof E!="string")throw new Error("$schema must be a string");if(E=E||this.opts.defaultMeta||this.defaultMeta(),!E)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(E,_);if(!w&&A){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return w}getSchema(_){let A;for(;typeof(A=C.call(this,_))=="string";)_=A;if(A===void 0){const{schemaId:E}=this.opts,w=new s.SchemaEnv({schema:{},schemaId:E});if(A=s.resolveSchema.call(this,w,_),!A)return;this.refs[_]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(_){if(_ instanceof RegExp)return this._removeAllSchemas(this.schemas,_),this._removeAllSchemas(this.refs,_),this;switch(typeof _){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const A=C.call(this,_);return typeof A=="object"&&this._cache.delete(A.schema),delete this.schemas[_],delete this.refs[_],this}case"object":{const A=_;this._cache.delete(A);let E=_[this.opts.schemaId];return E&&(E=(0,l.normalizeId)(E),delete this.schemas[E],delete this.refs[E]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(_){for(const A of _)this.addKeyword(A);return this}addKeyword(_,A){let E;if(typeof _=="string")E=_,typeof A=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=E);else if(typeof _=="object"&&A===void 0){if(A=_,E=A.keyword,Array.isArray(E)&&!E.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(U.call(this,E,A),!A)return(0,f.eachItem)(E,k=>D.call(this,k)),this;ee.call(this,A);const w={...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)};return(0,f.eachItem)(E,w.type.length===0?k=>D.call(this,k,w):k=>w.type.forEach(N=>D.call(this,k,w,N))),this}getKeyword(_){const A=this.RULES.all[_];return typeof A=="object"?A.definition:!!A}removeKeyword(_){const{RULES:A}=this;delete A.keywords[_],delete A.all[_];for(const E of A.rules){const w=E.rules.findIndex(k=>k.keyword===_);w>=0&&E.rules.splice(w,1)}return this}addFormat(_,A){return typeof A=="string"&&(A=new RegExp(A)),this.formats[_]=A,this}errorsText(_=this.errors,{separator:A=", ",dataVar:E="data"}={}){return!_||_.length===0?"No errors":_.map(w=>`${E}${w.instancePath} ${w.message}`).reduce((w,k)=>w+A+k)}$dataMetaSchema(_,A){const E=this.RULES.all;_=JSON.parse(JSON.stringify(_));for(const w of A){const k=w.split("/").slice(1);let N=_;for(const B of k)N=N[B];for(const B in E){const O=E[B];if(typeof O!="object")continue;const{$data:Y}=O.definition,ie=N[B];Y&&ie&&(N[B]=G(ie))}}return _}_removeAllSchemas(_,A){for(const E in _){const w=_[E];(!A||A.test(E))&&(typeof w=="string"?delete _[E]:w&&!w.meta&&(this._cache.delete(w.schema),delete _[E]))}}_addSchema(_,A,E,w=this.opts.validateSchema,k=this.opts.addUsedSchema){let N;const{schemaId:B}=this.opts;if(typeof _=="object")N=_[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof _!="boolean")throw new Error("schema must be object or boolean")}let O=this._cache.get(_);if(O!==void 0)return O;E=(0,l.normalizeId)(N||E);const Y=l.getSchemaRefs.call(this,_,E);return O=new s.SchemaEnv({schema:_,schemaId:B,meta:A,baseId:E,localRefs:Y}),this._cache.set(O.schema,O),k&&!E.startsWith("#")&&(E&&this._checkUnique(E),this.refs[E]=O),w&&this.validateSchema(_,!0),O}_checkUnique(_){if(this.schemas[_]||this.refs[_])throw new Error(`schema with key or id "${_}" already exists`)}_compileSchemaEnv(_){if(_.meta?this._compileMetaSchema(_):s.compileSchema.call(this,_),!_.validate)throw new Error("ajv implementation error");return _.validate}_compileMetaSchema(_){const A=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,_)}finally{this.opts=A}}}S.ValidationError=o.default,S.MissingRefError=r.default,e.default=S;function T(I,_,A,E="error"){for(const w in I){const k=w;k in _&&this.logger[E](`${A}: option ${w}. ${I[k]}`)}}function C(I){return I=(0,l.normalizeId)(I),this.schemas[I]||this.refs[I]}function $(){const I=this.opts.schemas;if(I)if(Array.isArray(I))this.addSchema(I);else for(const _ in I)this.addSchema(I[_],_)}function j(){for(const I in this.opts.formats){const _=this.opts.formats[I];_&&this.addFormat(I,_)}}function R(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const _ in I){const A=I[_];A.keyword||(A.keyword=_),this.addKeyword(A)}}function M(){const I={...this.opts};for(const _ of g)delete I[_];return I}const F={log(){},warn(){},error(){}};function V(I){if(I===!1)return F;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function U(I,_){const{RULES:A}=this;if((0,f.eachItem)(I,E=>{if(A.keywords[E])throw new Error(`Keyword ${E} is already defined`);if(!L.test(E))throw new Error(`Keyword ${E} has invalid name`)}),!!_&&_.$data&&!("code"in _||"validate"in _))throw new Error('$data keyword must have "code" or "validate" function')}function D(I,_,A){var E;const w=_==null?void 0:_.post;if(A&&w)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let N=w?k.post:k.rules.find(({type:O})=>O===A);if(N||(N={type:A,rules:[]},k.rules.push(N)),k.keywords[I]=!0,!_)return;const B={keyword:I,definition:{..._,type:(0,c.getJSONTypes)(_.type),schemaType:(0,c.getJSONTypes)(_.schemaType)}};_.before?Q.call(this,N,B,_.before):N.rules.push(B),k.all[I]=B,(E=_.implements)===null||E===void 0||E.forEach(O=>this.addKeyword(O))}function Q(I,_,A){const E=I.rules.findIndex(w=>w.keyword===A);E>=0?I.rules.splice(E,0,_):(I.rules.push(_),this.logger.warn(`rule ${A} is not defined`))}function ee(I){let{metaSchema:_}=I;_!==void 0&&(I.$data&&this.opts.$data&&(_=G(_)),I.validateSchema=this.compile(_,!0))}const q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function G(I){return{anyOf:[I,q]}}})(Ov);var pp={},fp={},mp={};Object.defineProperty(mp,"__esModule",{value:!0});const _T={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};mp.default=_T;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.callRef=zn.getValidate=void 0;const jT=Pl(),Qm=ye,Tt=ue,sr=Dt,Ym=xt,Ys=J,NT={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:r,schemaEnv:i,validateName:s,opts:a,self:l}=o,{root:c}=i;if((n==="#"||n==="#/")&&r===c.baseId)return m();const f=Ym.resolveRef.call(l,c,r,n);if(f===void 0)throw new jT.default(o.opts.uriResolver,r,n);if(f instanceof Ym.SchemaEnv)return h(f);return y(f);function m(){if(i===c)return xa(e,s,i,i.$async);const g=t.scopeValue("root",{ref:c});return xa(e,(0,Tt._)`${g}.validate`,c,c.$async)}function h(g){const b=jb(e,g);xa(e,b,g,g.$async)}function y(g){const b=t.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,Tt.stringify)(g)}:{ref:g}),v=t.name("valid"),u=e.subschema({schema:g,dataTypes:[],schemaPath:Tt.nil,topSchemaRef:b,errSchemaPath:n},v);e.mergeEvaluated(u),e.ok(v)}}};function jb(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,Tt._)`${n.scopeValue("wrapper",{ref:t})}.validate`}zn.getValidate=jb;function xa(e,t,n,o){const{gen:r,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,c=l.passContext?sr.default.this:Tt.nil;o?f():m();function f(){if(!a.$async)throw new Error("async schema referenced by sync schema");const g=r.let("valid");r.try(()=>{r.code((0,Tt._)`await ${(0,Qm.callValidateCode)(e,t,c)}`),y(t),s||r.assign(g,!0)},b=>{r.if((0,Tt._)`!(${b} instanceof ${i.ValidationError})`,()=>r.throw(b)),h(b),s||r.assign(g,!1)}),e.ok(g)}function m(){e.result((0,Qm.callValidateCode)(e,t,c),()=>y(t),()=>h(t))}function h(g){const b=(0,Tt._)`${g}.errors`;r.assign(sr.default.vErrors,(0,Tt._)`${sr.default.vErrors} === null ? ${b} : ${sr.default.vErrors}.concat(${b})`),r.assign(sr.default.errors,(0,Tt._)`${sr.default.vErrors}.length`)}function y(g){var b;if(!i.opts.unevaluated)return;const v=(b=n==null?void 0:n.validate)===null||b===void 0?void 0:b.evaluated;if(i.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(i.props=Ys.mergeEvaluated.props(r,v.props,i.props));else{const u=r.var("props",(0,Tt._)`${g}.evaluated.props`);i.props=Ys.mergeEvaluated.props(r,u,i.props,Tt.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=Ys.mergeEvaluated.items(r,v.items,i.items));else{const u=r.var("items",(0,Tt._)`${g}.evaluated.items`);i.items=Ys.mergeEvaluated.items(r,u,i.items,Tt.Name)}}}zn.callRef=xa;zn.default=NT;Object.defineProperty(fp,"__esModule",{value:!0});const CT=mp,ET=zn,PT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",CT.default,ET.default];fp.default=PT;var hp={},yp={};Object.defineProperty(yp,"__esModule",{value:!0});const rl=ue,Gn=rl.operators,il={maximum:{okStr:"<=",ok:Gn.LTE,fail:Gn.GT},minimum:{okStr:">=",ok:Gn.GTE,fail:Gn.LT},exclusiveMaximum:{okStr:"<",ok:Gn.LT,fail:Gn.GTE},exclusiveMinimum:{okStr:">",ok:Gn.GT,fail:Gn.LTE}},IT={message:({keyword:e,schemaCode:t})=>(0,rl.str)`must be ${il[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,rl._)`{comparison: ${il[e].okStr}, limit: ${t}}`},OT={keyword:Object.keys(il),type:"number",schemaType:"number",$data:!0,error:IT,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data((0,rl._)`${n} ${il[t].fail} ${o} || isNaN(${n})`)}};yp.default=OT;var gp={};Object.defineProperty(gp,"__esModule",{value:!0});const Ui=ue,RT={message:({schemaCode:e})=>(0,Ui.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ui._)`{multipleOf: ${e}}`},AT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:RT,code(e){const{gen:t,data:n,schemaCode:o,it:r}=e,i=r.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Ui._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Ui._)`${s} !== parseInt(${s})`;e.fail$data((0,Ui._)`(${o} === 0 || (${s} = ${n}/${o}, ${a}))`)}};gp.default=AT;var vp={},bp={};Object.defineProperty(bp,"__esModule",{value:!0});function Nb(e){const t=e.length;let n=0,o=0,r;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),(r&64512)===56320&&o++);return n}bp.default=Nb;Nb.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(vp,"__esModule",{value:!0});const Io=ue,MT=J,qT=bp,UT={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,Io.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,Io._)`{limit: ${e}}`},LT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:UT,code(e){const{keyword:t,data:n,schemaCode:o,it:r}=e,i=t==="maxLength"?Io.operators.GT:Io.operators.LT,s=r.opts.unicode===!1?(0,Io._)`${n}.length`:(0,Io._)`${(0,MT.useFunc)(e.gen,qT.default)}(${n})`;e.fail$data((0,Io._)`${s} ${i} ${o}`)}};vp.default=LT;var xp={};Object.defineProperty(xp,"__esModule",{value:!0});const DT=ye,zT=J,kr=ue,FT={message:({schemaCode:e})=>(0,kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,kr._)`{pattern: ${e}}`},BT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:FT,code(e){const{gen:t,data:n,$data:o,schema:r,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(o){const{regExp:l}=s.opts.code,c=l.code==="new RegExp"?(0,kr._)`new RegExp`:(0,zT.useFunc)(t,l),f=t.let("valid");t.try(()=>t.assign(f,(0,kr._)`${c}(${i}, ${a}).test(${n})`),()=>t.assign(f,!1)),e.fail$data((0,kr._)`!${f}`)}else{const l=(0,DT.usePattern)(e,r);e.fail$data((0,kr._)`!${l}.test(${n})`)}}};xp.default=BT;var wp={};Object.defineProperty(wp,"__esModule",{value:!0});const Li=ue,HT={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,Li.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,Li._)`{limit: ${e}}`},VT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:HT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxProperties"?Li.operators.GT:Li.operators.LT;e.fail$data((0,Li._)`Object.keys(${n}).length ${r} ${o}`)}};wp.default=VT;var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});const hi=ye,Di=ue,WT=J,KT={message:({params:{missingProperty:e}})=>(0,Di.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Di._)`{missingProperty: ${e}}`},GT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:KT,code(e){const{gen:t,schema:n,schemaCode:o,data:r,$data:i,it:s}=e,{opts:a}=s;if(!i&&n.length===0)return;const l=n.length>=a.loopRequired;if(s.allErrors?c():f(),a.strictRequired){const y=e.parentSchema.properties,{definedProperties:g}=e.it;for(const b of n)if((y==null?void 0:y[b])===void 0&&!g.has(b)){const v=s.schemaEnv.baseId+s.errSchemaPath,u=`required property "${b}" is not defined at "${v}" (strictRequired)`;(0,WT.checkStrictMode)(s,u,s.opts.strictRequired)}}function c(){if(l||i)e.block$data(Di.nil,m);else for(const y of n)(0,hi.checkReportMissingProp)(e,y)}function f(){const y=t.let("missing");if(l||i){const g=t.let("valid",!0);e.block$data(g,()=>h(y,g)),e.ok(g)}else t.if((0,hi.checkMissingProp)(e,n,y)),(0,hi.reportMissingProp)(e,y),t.else()}function m(){t.forOf("prop",o,y=>{e.setParams({missingProperty:y}),t.if((0,hi.noPropertyInData)(t,r,y,a.ownProperties),()=>e.error())})}function h(y,g){e.setParams({missingProperty:y}),t.forOf(y,o,()=>{t.assign(g,(0,hi.propertyInData)(t,r,y,a.ownProperties)),t.if((0,Di.not)(g),()=>{e.error(),t.break()})},Di.nil)}}};Sp.default=GT;var $p={};Object.defineProperty($p,"__esModule",{value:!0});const zi=ue,JT={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,zi.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,zi._)`{limit: ${e}}`},QT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:JT,code(e){const{keyword:t,data:n,schemaCode:o}=e,r=t==="maxItems"?zi.operators.GT:zi.operators.LT;e.fail$data((0,zi._)`${n}.length ${r} ${o}`)}};$p.default=QT;var kp={},Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});const Cb=Jv;Cb.code='require("ajv/dist/runtime/equal").default';Ns.default=Cb;Object.defineProperty(kp,"__esModule",{value:!0});const xc=et,it=ue,YT=J,XT=Ns,ZT={message:({params:{i:e,j:t}})=>(0,it.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,it._)`{i: ${e}, j: ${t}}`},e1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ZT,code(e){const{gen:t,data:n,$data:o,schema:r,parentSchema:i,schemaCode:s,it:a}=e;if(!o&&!r)return;const l=t.let("valid"),c=i.items?(0,xc.getSchemaTypes)(i.items):[];e.block$data(l,f,(0,it._)`${s} === false`),e.ok(l);function f(){const g=t.let("i",(0,it._)`${n}.length`),b=t.let("j");e.setParams({i:g,j:b}),t.assign(l,!0),t.if((0,it._)`${g} > 1`,()=>(m()?h:y)(g,b))}function m(){return c.length>0&&!c.some(g=>g==="object"||g==="array")}function h(g,b){const v=t.name("item"),u=(0,xc.checkDataTypes)(c,v,a.opts.strictNumbers,xc.DataType.Wrong),p=t.const("indices",(0,it._)`{}`);t.for((0,it._)`;${g}--;`,()=>{t.let(v,(0,it._)`${n}[${g}]`),t.if(u,(0,it._)`continue`),c.length>1&&t.if((0,it._)`typeof ${v} == "string"`,(0,it._)`${v} += "_"`),t.if((0,it._)`typeof ${p}[${v}] == "number"`,()=>{t.assign(b,(0,it._)`${p}[${v}]`),e.error(),t.assign(l,!1).break()}).code((0,it._)`${p}[${v}] = ${g}`)})}function y(g,b){const v=(0,YT.useFunc)(t,XT.default),u=t.name("outer");t.label(u).for((0,it._)`;${g}--;`,()=>t.for((0,it._)`${b} = ${g}; ${b}--;`,()=>t.if((0,it._)`${v}(${n}[${g}], ${n}[${b}])`,()=>{e.error(),t.assign(l,!1).break(u)})))}}};kp.default=e1;var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});const qd=ue,t1=J,n1=Ns,o1={message:"must be equal to constant",params:({schemaCode:e})=>(0,qd._)`{allowedValue: ${e}}`},r1={keyword:"const",$data:!0,error:o1,code(e){const{gen:t,data:n,$data:o,schemaCode:r,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,qd._)`!${(0,t1.useFunc)(t,n1.default)}(${n}, ${r})`):e.fail((0,qd._)`${i} !== ${n}`)}};Tp.default=r1;var _p={};Object.defineProperty(_p,"__esModule",{value:!0});const _i=ue,i1=J,s1=Ns,a1={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,_i._)`{allowedValues: ${e}}`},l1={keyword:"enum",schemaType:"array",$data:!0,error:a1,code(e){const{gen:t,data:n,$data:o,schema:r,schemaCode:i,it:s}=e;if(!o&&r.length===0)throw new Error("enum must have non-empty array");const a=r.length>=s.opts.loopEnum;let l;const c=()=>l??(l=(0,i1.useFunc)(t,s1.default));let f;if(a||o)f=t.let("valid"),e.block$data(f,m);else{if(!Array.isArray(r))throw new Error("ajv implementation error");const y=t.const("vSchema",i);f=(0,_i.or)(...r.map((g,b)=>h(y,b)))}e.pass(f);function m(){t.assign(f,!1),t.forOf("v",i,y=>t.if((0,_i._)`${c()}(${n}, ${y})`,()=>t.assign(f,!0).break()))}function h(y,g){const b=r[g];return typeof b=="object"&&b!==null?(0,_i._)`${c()}(${n}, ${y}[${g}])`:(0,_i._)`${n} === ${b}`}}};_p.default=l1;Object.defineProperty(hp,"__esModule",{value:!0});const c1=yp,d1=gp,u1=vp,p1=xp,f1=wp,m1=Sp,h1=$p,y1=kp,g1=Tp,v1=_p,b1=[c1.default,d1.default,u1.default,p1.default,f1.default,m1.default,h1.default,y1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},g1.default,v1.default];hp.default=b1;var jp={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.validateAdditionalItems=void 0;const Oo=ue,Ud=J,x1={message:({params:{len:e}})=>(0,Oo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Oo._)`{limit: ${e}}`},w1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:x1,code(e){const{parentSchema:t,it:n}=e,{items:o}=t;if(!Array.isArray(o)){(0,Ud.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}Eb(e,o)}};function Eb(e,t){const{gen:n,schema:o,data:r,keyword:i,it:s}=e;s.items=!0;const a=n.const("len",(0,Oo._)`${r}.length`);if(o===!1)e.setParams({len:t.length}),e.pass((0,Oo._)`${a} <= ${t.length}`);else if(typeof o=="object"&&!(0,Ud.alwaysValidSchema)(s,o)){const c=n.var("valid",(0,Oo._)`${a} <= ${t.length}`);n.if((0,Oo.not)(c),()=>l(c)),e.ok(c)}function l(c){n.forRange("i",t.length,a,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:Ud.Type.Num},c),s.allErrors||n.if((0,Oo.not)(c),()=>n.break())})}}Yr.validateAdditionalItems=Eb;Yr.default=w1;var Np={},Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.validateTuple=void 0;const Xm=ue,wa=J,S1=ye,$1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return Pb(e,"additionalItems",t);n.items=!0,!(0,wa.alwaysValidSchema)(n,t)&&e.ok((0,S1.validateArray)(e))}};function Pb(e,t,n=e.schema){const{gen:o,parentSchema:r,data:i,keyword:s,it:a}=e;f(r),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=wa.mergeEvaluated.items(o,n.length,a.items));const l=o.name("valid"),c=o.const("len",(0,Xm._)`${i}.length`);n.forEach((m,h)=>{(0,wa.alwaysValidSchema)(a,m)||(o.if((0,Xm._)`${c} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function f(m){const{opts:h,errSchemaPath:y}=a,g=n.length,b=g===m.minItems&&(g===m.maxItems||m[t]===!1);if(h.strictTuples&&!b){const v=`"${s}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${y}"`;(0,wa.checkStrictMode)(a,v,h.strictTuples)}}}Xr.validateTuple=Pb;Xr.default=$1;Object.defineProperty(Np,"__esModule",{value:!0});const k1=Xr,T1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,k1.validateTuple)(e,"items")};Np.default=T1;var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});const Zm=ue,_1=J,j1=ye,N1=Yr,C1={message:({params:{len:e}})=>(0,Zm.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Zm._)`{limit: ${e}}`},E1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:C1,code(e){const{schema:t,parentSchema:n,it:o}=e,{prefixItems:r}=n;o.items=!0,!(0,_1.alwaysValidSchema)(o,t)&&(r?(0,N1.validateAdditionalItems)(e,r):e.ok((0,j1.validateArray)(e)))}};Cp.default=E1;var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});const zt=ue,Xs=J,P1={message:({params:{min:e,max:t}})=>t===void 0?(0,zt.str)`must contain at least ${e} valid item(s)`:(0,zt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,zt._)`{minContains: ${e}}`:(0,zt._)`{minContains: ${e}, maxContains: ${t}}`},I1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:P1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;let s,a;const{minContains:l,maxContains:c}=o;i.opts.next?(s=l===void 0?1:l,a=c):s=1;const f=t.const("len",(0,zt._)`${r}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Xs.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Xs.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Xs.alwaysValidSchema)(i,n)){let b=(0,zt._)`${f} >= ${s}`;a!==void 0&&(b=(0,zt._)`${b} && ${f} <= ${a}`),e.pass(b);return}i.items=!0;const m=t.name("valid");a===void 0&&s===1?y(m,()=>t.if(m,()=>t.break())):s===0?(t.let(m,!0),a!==void 0&&t.if((0,zt._)`${r}.length > 0`,h)):(t.let(m,!1),h()),e.result(m,()=>e.reset());function h(){const b=t.name("_valid"),v=t.let("count",0);y(b,()=>t.if(b,()=>g(v)))}function y(b,v){t.forRange("i",0,f,u=>{e.subschema({keyword:"contains",dataProp:u,dataPropType:Xs.Type.Num,compositeRule:!0},b),v()})}function g(b){t.code((0,zt._)`${b}++`),a===void 0?t.if((0,zt._)`${b} >= ${s}`,()=>t.assign(m,!0).break()):(t.if((0,zt._)`${b} > ${a}`,()=>t.assign(m,!1).break()),s===1?t.assign(m,!0):t.if((0,zt._)`${b} >= ${s}`,()=>t.assign(m,!0)))}}};Ep.default=I1;var Al={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ue,n=J,o=ye;e.error={message:({params:{property:l,depsCount:c,deps:f}})=>{const m=c===1?"property":"properties";return(0,t.str)`must have ${m} ${f} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:f,missingProperty:m}})=>(0,t._)`{property: ${l},
1763
- missingProperty: ${m},
1764
- depsCount: ${c},
1765
- deps: ${f}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[c,f]=i(l);s(l,c),a(l,f)}};function i({schema:l}){const c={},f={};for(const m in l){if(m==="__proto__")continue;const h=Array.isArray(l[m])?c:f;h[m]=l[m]}return[c,f]}function s(l,c=l.schema){const{gen:f,data:m,it:h}=l;if(Object.keys(c).length===0)return;const y=f.let("missing");for(const g in c){const b=c[g];if(b.length===0)continue;const v=(0,o.propertyInData)(f,m,g,h.opts.ownProperties);l.setParams({property:g,depsCount:b.length,deps:b.join(", ")}),h.allErrors?f.if(v,()=>{for(const u of b)(0,o.checkReportMissingProp)(l,u)}):(f.if((0,t._)`${v} && (${(0,o.checkMissingProp)(l,b,y)})`),(0,o.reportMissingProp)(l,y),f.else())}}e.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:f,data:m,keyword:h,it:y}=l,g=f.name("valid");for(const b in c)(0,n.alwaysValidSchema)(y,c[b])||(f.if((0,o.propertyInData)(f,m,b,y.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:b},g);l.mergeValidEvaluated(v,g)},()=>f.var(g,!0)),l.ok(g))}e.validateSchemaDeps=a,e.default=r})(Al);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});const Ib=ue,O1=J,R1={message:"property name must be valid",params:({params:e})=>(0,Ib._)`{propertyName: ${e.propertyName}}`},A1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:R1,code(e){const{gen:t,schema:n,data:o,it:r}=e;if((0,O1.alwaysValidSchema)(r,n))return;const i=t.name("valid");t.forIn("key",o,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Ib.not)(i),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(i)}};Pp.default=A1;var Ml={};Object.defineProperty(Ml,"__esModule",{value:!0});const Zs=ye,en=ue,M1=Dt,ea=J,q1={message:"must NOT have additional properties",params:({params:e})=>(0,en._)`{additionalProperty: ${e.additionalProperty}}`},U1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:q1,code(e){const{gen:t,schema:n,parentSchema:o,data:r,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,ea.alwaysValidSchema)(s,n))return;const c=(0,Zs.allSchemaProperties)(o.properties),f=(0,Zs.allSchemaProperties)(o.patternProperties);m(),e.ok((0,en._)`${i} === ${M1.default.errors}`);function m(){t.forIn("key",r,v=>{!c.length&&!f.length?g(v):t.if(h(v),()=>g(v))})}function h(v){let u;if(c.length>8){const p=(0,ea.schemaRefOrVal)(s,o.properties,"properties");u=(0,Zs.isOwnProperty)(t,p,v)}else c.length?u=(0,en.or)(...c.map(p=>(0,en._)`${v} === ${p}`)):u=en.nil;return f.length&&(u=(0,en.or)(u,...f.map(p=>(0,en._)`${(0,Zs.usePattern)(e,p)}.test(${v})`))),(0,en.not)(u)}function y(v){t.code((0,en._)`delete ${r}[${v}]`)}function g(v){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){y(v);return}if(n===!1){e.setParams({additionalProperty:v}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,ea.alwaysValidSchema)(s,n)){const u=t.name("valid");l.removeAdditional==="failing"?(b(v,u,!1),t.if((0,en.not)(u),()=>{e.reset(),y(v)})):(b(v,u),a||t.if((0,en.not)(u),()=>t.break()))}}function b(v,u,p){const x={keyword:"additionalProperties",dataProp:v,dataPropType:ea.Type.Str};p===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,u)}}};Ml.default=U1;var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});const L1=ln,eh=ye,wc=J,th=Ml,D1={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:o,data:r,it:i}=e;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&th.default.code(new L1.KeywordCxt(i,th.default,"additionalProperties"));const s=(0,eh.allSchemaProperties)(n);for(const m of s)i.definedProperties.add(m);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=wc.mergeEvaluated.props(t,(0,wc.toHash)(s),i.props));const a=s.filter(m=>!(0,wc.alwaysValidSchema)(i,n[m]));if(a.length===0)return;const l=t.name("valid");for(const m of a)c(m)?f(m):(t.if((0,eh.propertyInData)(t,r,m,i.opts.ownProperties)),f(m),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(l);function c(m){return i.opts.useDefaults&&!i.compositeRule&&n[m].default!==void 0}function f(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},l)}}};Ip.default=D1;var Op={};Object.defineProperty(Op,"__esModule",{value:!0});const nh=ye,ta=ue,oh=J,rh=J,z1={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:o,parentSchema:r,it:i}=e,{opts:s}=i,a=(0,nh.allSchemaProperties)(n),l=a.filter(b=>(0,oh.alwaysValidSchema)(i,n[b]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const c=s.strictSchema&&!s.allowMatchingProperties&&r.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof ta.Name)&&(i.props=(0,rh.evaluatedPropsToName)(t,i.props));const{props:m}=i;h();function h(){for(const b of a)c&&y(b),i.allErrors?g(b):(t.var(f,!0),g(b),t.if(f))}function y(b){for(const v in c)new RegExp(b).test(v)&&(0,oh.checkStrictMode)(i,`property ${v} matches pattern ${b} (use allowMatchingProperties)`)}function g(b){t.forIn("key",o,v=>{t.if((0,ta._)`${(0,nh.usePattern)(e,b)}.test(${v})`,()=>{const u=l.includes(b);u||e.subschema({keyword:"patternProperties",schemaProp:b,dataProp:v,dataPropType:rh.Type.Str},f),i.opts.unevaluated&&m!==!0?t.assign((0,ta._)`${m}[${v}]`,!0):!u&&!i.allErrors&&t.if((0,ta.not)(f),()=>t.break())})})}}};Op.default=z1;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});const F1=J,B1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,F1.alwaysValidSchema)(o,n)){e.fail();return}const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Rp.default=B1;var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});const H1=ye,V1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:H1.validateUnion,error:{message:"must match a schema in anyOf"}};Ap.default=V1;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});const Sa=ue,W1=J,K1={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Sa._)`{passingSchemas: ${e.passing}}`},G1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:K1,code(e){const{gen:t,schema:n,parentSchema:o,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&o.discriminator)return;const i=n,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(s,()=>e.reset(),()=>e.error(!0));function c(){i.forEach((f,m)=>{let h;(0,W1.alwaysValidSchema)(r,f)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},l),m>0&&t.if((0,Sa._)`${l} && ${s}`).assign(s,!1).assign(a,(0,Sa._)`[${a}, ${m}]`).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,m),h&&e.mergeEvaluated(h,Sa.Name)})})}}};Mp.default=G1;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});const J1=J,Q1={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach((i,s)=>{if((0,J1.alwaysValidSchema)(o,i))return;const a=e.subschema({keyword:"allOf",schemaProp:s},r);e.ok(r),e.mergeEvaluated(a)})}};qp.default=Q1;var Up={};Object.defineProperty(Up,"__esModule",{value:!0});const sl=ue,Ob=J,Y1={message:({params:e})=>(0,sl.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,sl._)`{failingKeyword: ${e.ifClause}}`},X1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Y1,code(e){const{gen:t,parentSchema:n,it:o}=e;n.then===void 0&&n.else===void 0&&(0,Ob.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const r=ih(o,"then"),i=ih(o,"else");if(!r&&!i)return;const s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),r&&i){const f=t.let("ifClause");e.setParams({ifClause:f}),t.if(a,c("then",f),c("else",f))}else r?t.if(a,c("then")):t.if((0,sl.not)(a),c("else"));e.pass(s,()=>e.error(!0));function l(){const f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(f)}function c(f,m){return()=>{const h=e.subschema({keyword:f},a);t.assign(s,a),e.mergeValidEvaluated(h,s),m?t.assign(m,(0,sl._)`${f}`):e.setParams({ifClause:f})}}}};function ih(e,t){const n=e.schema[t];return n!==void 0&&!(0,Ob.alwaysValidSchema)(e,n)}Up.default=X1;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});const Z1=J,e_={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,Z1.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};Lp.default=e_;Object.defineProperty(jp,"__esModule",{value:!0});const t_=Yr,n_=Np,o_=Xr,r_=Cp,i_=Ep,s_=Al,a_=Pp,l_=Ml,c_=Ip,d_=Op,u_=Rp,p_=Ap,f_=Mp,m_=qp,h_=Up,y_=Lp;function g_(e=!1){const t=[u_.default,p_.default,f_.default,m_.default,h_.default,y_.default,a_.default,l_.default,s_.default,c_.default,d_.default];return e?t.push(n_.default,r_.default):t.push(t_.default,o_.default),t.push(i_.default),t}jp.default=g_;var Dp={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.dynamicAnchor=void 0;const Sc=ue,v_=Dt,sh=xt,b_=zn,x_={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Rb(e,e.schema)};function Rb(e,t){const{gen:n,it:o}=e;o.schemaEnv.root.dynamicAnchors[t]=!0;const r=(0,Sc._)`${v_.default.dynamicAnchors}${(0,Sc.getProperty)(t)}`,i=o.errSchemaPath==="#"?o.validateName:w_(e);n.if((0,Sc._)`!${r}`,()=>n.assign(r,i))}Zr.dynamicAnchor=Rb;function w_(e){const{schemaEnv:t,schema:n,self:o}=e.it,{root:r,baseId:i,localRefs:s,meta:a}=t.root,{schemaId:l}=o.opts,c=new sh.SchemaEnv({schema:n,schemaId:l,root:r,baseId:i,localRefs:s,meta:a});return sh.compileSchema.call(o,c),(0,b_.getValidate)(e,c)}Zr.default=x_;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.dynamicRef=void 0;const ah=ue,S_=Dt,lh=zn,$_={keyword:"$dynamicRef",schemaType:"string",code:e=>Ab(e,e.schema)};function Ab(e,t){const{gen:n,keyword:o,it:r}=e;if(t[0]!=="#")throw new Error(`"${o}" only supports hash fragment reference`);const i=t.slice(1);if(r.allErrors)s();else{const l=n.let("valid",!1);s(l),e.ok(l)}function s(l){if(r.schemaEnv.root.dynamicAnchors[i]){const c=n.let("_v",(0,ah._)`${S_.default.dynamicAnchors}${(0,ah.getProperty)(i)}`);n.if(c,a(c,l),a(r.validateName,l))}else a(r.validateName,l)()}function a(l,c){return c?()=>n.block(()=>{(0,lh.callRef)(e,l),n.let(c,!0)}):()=>(0,lh.callRef)(e,l)}}ei.dynamicRef=Ab;ei.default=$_;var zp={};Object.defineProperty(zp,"__esModule",{value:!0});const k_=Zr,T_=J,__={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,k_.dynamicAnchor)(e,""):(0,T_.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};zp.default=__;var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});const j_=ei,N_={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,j_.dynamicRef)(e,e.schema)};Fp.default=N_;Object.defineProperty(Dp,"__esModule",{value:!0});const C_=Zr,E_=ei,P_=zp,I_=Fp,O_=[C_.default,E_.default,P_.default,I_.default];Dp.default=O_;var Bp={},Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});const ch=Al,R_={keyword:"dependentRequired",type:"object",schemaType:"object",error:ch.error,code:e=>(0,ch.validatePropertyDeps)(e)};Hp.default=R_;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});const A_=Al,M_={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,A_.validateSchemaDeps)(e)};Vp.default=M_;var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});const q_=J,U_={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){t.contains===void 0&&(0,q_.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};Wp.default=U_;Object.defineProperty(Bp,"__esModule",{value:!0});const L_=Hp,D_=Vp,z_=Wp,F_=[L_.default,D_.default,z_.default];Bp.default=F_;var Kp={},Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});const Xn=ue,dh=J,B_=Dt,H_={message:"must NOT have unevaluated properties",params:({params:e})=>(0,Xn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},V_={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:H_,code(e){const{gen:t,schema:n,data:o,errsCount:r,it:i}=e;if(!r)throw new Error("ajv implementation error");const{allErrors:s,props:a}=i;a instanceof Xn.Name?t.if((0,Xn._)`${a} !== true`,()=>t.forIn("key",o,m=>t.if(c(a,m),()=>l(m)))):a!==!0&&t.forIn("key",o,m=>a===void 0?l(m):t.if(f(a,m),()=>l(m))),i.props=!0,e.ok((0,Xn._)`${r} === ${B_.default.errors}`);function l(m){if(n===!1){e.setParams({unevaluatedProperty:m}),e.error(),s||t.break();return}if(!(0,dh.alwaysValidSchema)(i,n)){const h=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:dh.Type.Str},h),s||t.if((0,Xn.not)(h),()=>t.break())}}function c(m,h){return(0,Xn._)`!${m} || !${m}[${h}]`}function f(m,h){const y=[];for(const g in m)m[g]===!0&&y.push((0,Xn._)`${h} !== ${g}`);return(0,Xn.and)(...y)}}};Gp.default=V_;var Jp={};Object.defineProperty(Jp,"__esModule",{value:!0});const Ro=ue,uh=J,W_={message:({params:{len:e}})=>(0,Ro.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ro._)`{limit: ${e}}`},K_={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:W_,code(e){const{gen:t,schema:n,data:o,it:r}=e,i=r.items||0;if(i===!0)return;const s=t.const("len",(0,Ro._)`${o}.length`);if(n===!1)e.setParams({len:i}),e.fail((0,Ro._)`${s} > ${i}`);else if(typeof n=="object"&&!(0,uh.alwaysValidSchema)(r,n)){const l=t.var("valid",(0,Ro._)`${s} <= ${i}`);t.if((0,Ro.not)(l),()=>a(l,i)),e.ok(l)}r.items=!0;function a(l,c){t.forRange("i",c,s,f=>{e.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:uh.Type.Num},l),r.allErrors||t.if((0,Ro.not)(l),()=>t.break())})}}};Jp.default=K_;Object.defineProperty(Kp,"__esModule",{value:!0});const G_=Gp,J_=Jp,Q_=[G_.default,J_.default];Kp.default=Q_;var Qp={},Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});const We=ue,Y_={message:({schemaCode:e})=>(0,We.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,We._)`{format: ${e}}`},X_={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Y_,code(e,t){const{gen:n,data:o,$data:r,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:c,schemaEnv:f,self:m}=a;if(!l.validateFormats)return;r?h():y();function h(){const g=n.scopeValue("formats",{ref:m.formats,code:l.code.formats}),b=n.const("fDef",(0,We._)`${g}[${s}]`),v=n.let("fType"),u=n.let("format");n.if((0,We._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>n.assign(v,(0,We._)`${b}.type || "string"`).assign(u,(0,We._)`${b}.validate`),()=>n.assign(v,(0,We._)`"string"`).assign(u,b)),e.fail$data((0,We.or)(p(),x()));function p(){return l.strictSchema===!1?We.nil:(0,We._)`${s} && !${u}`}function x(){const S=f.$async?(0,We._)`(${b}.async ? await ${u}(${o}) : ${u}(${o}))`:(0,We._)`${u}(${o})`,T=(0,We._)`(typeof ${u} == "function" ? ${S} : ${u}.test(${o}))`;return(0,We._)`${u} && ${u} !== true && ${v} === ${t} && !${T}`}}function y(){const g=m.formats[i];if(!g){p();return}if(g===!0)return;const[b,v,u]=x(g);b===t&&e.pass(S());function p(){if(l.strictSchema===!1){m.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${i}" ignored in schema at path "${c}"`}}function x(T){const C=T instanceof RegExp?(0,We.regexpCode)(T):l.code.formats?(0,We._)`${l.code.formats}${(0,We.getProperty)(i)}`:void 0,$=n.scopeValue("formats",{key:i,ref:T,code:C});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,We._)`${$}.validate`]:["string",T,$]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!f.$async)throw new Error("async format in sync schema");return(0,We._)`await ${u}(${o})`}return typeof v=="function"?(0,We._)`${u}(${o})`:(0,We._)`${u}.test(${o})`}}}};Yp.default=X_;Object.defineProperty(Qp,"__esModule",{value:!0});const Z_=Yp,ej=[Z_.default];Qp.default=ej;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.contentVocabulary=Kr.metadataVocabulary=void 0;Kr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Kr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(pp,"__esModule",{value:!0});const tj=fp,nj=hp,oj=jp,rj=Dp,ij=Bp,sj=Kp,aj=Qp,ph=Kr,lj=[rj.default,tj.default,nj.default,(0,oj.default)(!0),aj.default,ph.metadataVocabulary,ph.contentVocabulary,ij.default,sj.default];pp.default=lj;var Xp={},ql={};Object.defineProperty(ql,"__esModule",{value:!0});ql.DiscrError=void 0;var fh;(function(e){e.Tag="tag",e.Mapping="mapping"})(fh||(ql.DiscrError=fh={}));Object.defineProperty(Xp,"__esModule",{value:!0});const dr=ue,Ld=ql,mh=xt,cj=Pl(),dj=J,uj={message:({params:{discrError:e,tagName:t}})=>e===Ld.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,dr._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},pj={keyword:"discriminator",type:"object",schemaType:"object",error:uj,code(e){const{gen:t,data:n,schema:o,parentSchema:r,it:i}=e,{oneOf:s}=r;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),c=t.const("tag",(0,dr._)`${n}${(0,dr.getProperty)(a)}`);t.if((0,dr._)`typeof ${c} == "string"`,()=>f(),()=>e.error(!1,{discrError:Ld.DiscrError.Tag,tag:c,tagName:a})),e.ok(l);function f(){const y=h();t.if(!1);for(const g in y)t.elseIf((0,dr._)`${c} === ${g}`),t.assign(l,m(y[g]));t.else(),e.error(!1,{discrError:Ld.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function m(y){const g=t.name("valid"),b=e.subschema({keyword:"oneOf",schemaProp:y},g);return e.mergeEvaluated(b,dr.Name),g}function h(){var y;const g={},b=u(r);let v=!0;for(let S=0;S<s.length;S++){let T=s[S];if(T!=null&&T.$ref&&!(0,dj.schemaHasRulesButRef)(T,i.self.RULES)){const $=T.$ref;if(T=mh.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,$),T instanceof mh.SchemaEnv&&(T=T.schema),T===void 0)throw new cj.default(i.opts.uriResolver,i.baseId,$)}const C=(y=T==null?void 0:T.properties)===null||y===void 0?void 0:y[a];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(b||u(T)),p(C,S)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return g;function u({required:S}){return Array.isArray(S)&&S.includes(a)}function p(S,T){if(S.const)x(S.const,T);else if(S.enum)for(const C of S.enum)x(C,T);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(S,T){if(typeof S!="string"||S in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[S]=T}}}};Xp.default=pj;var Zp={};const fj="https://json-schema.org/draft/2020-12/schema",mj="https://json-schema.org/draft/2020-12/schema",hj={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},yj="meta",gj="Core and Validation specifications meta-schema",vj=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],bj=["object","boolean"],xj="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",wj={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},Sj={$schema:fj,$id:mj,$vocabulary:hj,$dynamicAnchor:yj,title:gj,allOf:vj,type:bj,$comment:xj,properties:wj},$j="https://json-schema.org/draft/2020-12/schema",kj="https://json-schema.org/draft/2020-12/meta/applicator",Tj={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},_j="meta",jj="Applicator vocabulary meta-schema",Nj=["object","boolean"],Cj={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},Ej={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Pj={$schema:$j,$id:kj,$vocabulary:Tj,$dynamicAnchor:_j,title:jj,type:Nj,properties:Cj,$defs:Ej},Ij="https://json-schema.org/draft/2020-12/schema",Oj="https://json-schema.org/draft/2020-12/meta/unevaluated",Rj={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},Aj="meta",Mj="Unevaluated applicator vocabulary meta-schema",qj=["object","boolean"],Uj={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},Lj={$schema:Ij,$id:Oj,$vocabulary:Rj,$dynamicAnchor:Aj,title:Mj,type:qj,properties:Uj},Dj="https://json-schema.org/draft/2020-12/schema",zj="https://json-schema.org/draft/2020-12/meta/content",Fj={"https://json-schema.org/draft/2020-12/vocab/content":!0},Bj="meta",Hj="Content vocabulary meta-schema",Vj=["object","boolean"],Wj={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Kj={$schema:Dj,$id:zj,$vocabulary:Fj,$dynamicAnchor:Bj,title:Hj,type:Vj,properties:Wj},Gj="https://json-schema.org/draft/2020-12/schema",Jj="https://json-schema.org/draft/2020-12/meta/core",Qj={"https://json-schema.org/draft/2020-12/vocab/core":!0},Yj="meta",Xj="Core vocabulary meta-schema",Zj=["object","boolean"],eN={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},tN={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},nN={$schema:Gj,$id:Jj,$vocabulary:Qj,$dynamicAnchor:Yj,title:Xj,type:Zj,properties:eN,$defs:tN},oN="https://json-schema.org/draft/2020-12/schema",rN="https://json-schema.org/draft/2020-12/meta/format-annotation",iN={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},sN="meta",aN="Format vocabulary meta-schema for annotation results",lN=["object","boolean"],cN={format:{type:"string"}},dN={$schema:oN,$id:rN,$vocabulary:iN,$dynamicAnchor:sN,title:aN,type:lN,properties:cN},uN="https://json-schema.org/draft/2020-12/schema",pN="https://json-schema.org/draft/2020-12/meta/meta-data",fN={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},mN="meta",hN="Meta-data vocabulary meta-schema",yN=["object","boolean"],gN={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},vN={$schema:uN,$id:pN,$vocabulary:fN,$dynamicAnchor:mN,title:hN,type:yN,properties:gN},bN="https://json-schema.org/draft/2020-12/schema",xN="https://json-schema.org/draft/2020-12/meta/validation",wN={"https://json-schema.org/draft/2020-12/vocab/validation":!0},SN="meta",$N="Validation vocabulary meta-schema",kN=["object","boolean"],TN={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},_N={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},jN={$schema:bN,$id:xN,$vocabulary:wN,$dynamicAnchor:SN,title:$N,type:kN,properties:TN,$defs:_N};Object.defineProperty(Zp,"__esModule",{value:!0});const NN=Sj,CN=Pj,EN=Lj,PN=Kj,IN=nN,ON=dN,RN=vN,AN=jN,MN=["/properties"];function qN(e){return[NN,CN,EN,PN,IN,t(this,ON),RN,t(this,AN)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function t(n,o){return e?n.$dataMetaSchema(o,MN):o}}Zp.default=qN;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const n=Ov,o=pp,r=Xp,i=Zp,s="https://json-schema.org/draft/2020-12/schema";class a extends n.default{constructor(y={}){super({...y,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:y,meta:g}=this.opts;g&&(i.default.call(this,y),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var l=ln;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=sp();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=Pl();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(Id,Id.exports);var UN=Id.exports;const LN=Qd(UN),hh=LN,DN=hh.default??hh,yh="acp";function zN(e){const t={path:e.instancePath||"/",message:e.message??"validation failed"};return e.keyword&&(t.keyword=e.keyword),t}function FN(e){const t=new DN({strict:!1,allErrors:!0,validateFormats:!1});t.addSchema(e,yh);const n=new Map,o=e.$defs??{};for(const[l,c]of Object.entries(o)){const f=c["x-method"];if(typeof f!="string")continue;let m=n.get(f);m||(m={},n.set(f,m)),l.endsWith("Request")?m.requestDef=l:l.endsWith("Response")?m.responseDef=l:l.endsWith("Notification")&&(m.notificationDef=l)}const r=new Map,i=l=>{const c=r.get(l);if(c)return c;const f=t.compile({$ref:`${yh}#/$defs/${l}`});return r.set(l,f),f};function s(l,c={}){if(!l.payload)return{valid:!0,errors:[],skipped:"parse-error"};if(l.kind==="unknown")return{valid:!0,errors:[],skipped:"wrong-kind"};const f=l.method??c.pairedMethod;if(!f)return{valid:!0,errors:[],skipped:"no-method"};const m=n.get(f);if(!m)return{valid:!0,errors:[],skipped:"unknown-method"};let h,y;const g=l.payload;if(l.kind==="request")h=m.requestDef,y=g.params;else if(l.kind==="notification")h=m.notificationDef,y=g.params;else if(l.kind==="response")h=m.responseDef,y=g.result;else return{valid:!0,errors:[],skipped:"wrong-kind"};if(!h)return{valid:!0,errors:[],skipped:"no-schema-for-kind"};const b=i(h);return b(y)?{valid:!0,errors:[],schemaName:h}:{valid:!1,errors:(b.errors??[]).map(zN),schemaName:h}}function a(){return[...n.keys()].sort()}return{validateAcpMessage:s,knownAcpMethods:a}}const BN=FN(Iv),HN=BN.validateAcpMessage;function ef(e){const t=Cl(e),n=new Map;for(const r of e)r.method&&n.set(r.seq,r.method);const o=new Map;for(const r of e){const i=t.get(r.seq),s=i!==void 0?n.get(i):void 0,a={};s!==void 0&&(a.pairedMethod=s),o.set(r.seq,HN(r,a))}return o}function VN(e){let t=0,n=0,o=0;const r=new Set;for(const[,i]of e)if(!i.skipped&&(t+=1,!i.valid&&(n+=1,o+=i.errors.length,i.schemaName))){const s=i.schemaName.replace(/(Request|Response|Notification)$/,"");r.add(s)}return{checked:t,invalidFrames:n,totalErrors:o,affectedMethods:[...r].sort()}}const WN={"claude-code":{shortName:"claude-code",displayName:"Claude Code",description:"Anthropic Claude Code via @agentclientprotocol/claude-agent-acp",command:"npx",args:["-y","@agentclientprotocol/claude-agent-acp"],aliases:[["npx","-y","@zed-industries/claude-code-acp"]]},codex:{shortName:"codex",displayName:"Codex",description:"OpenAI Codex via @zed-industries/codex-acp",command:"npx",args:["-y","@zed-industries/codex-acp"]},goose:{shortName:"goose",displayName:"Goose",description:"Block Goose — install separately, then this runs `goose acp`",command:"goose",args:["acp"],requiresExternalInstall:!0},opencode:{shortName:"opencode",displayName:"OpenCode",description:"SST OpenCode — install via opencode.ai/install, then `opencode acp`",command:"opencode",args:["acp"],requiresExternalInstall:!0}};function KN(e){const t=e.trim();if(t.length===0)return null;for(const n of Object.values(WN)){const o=[[n.command,...n.args],...n.aliases??[]];for(const r of o){const i=r.join(" ");if(t===i||t.startsWith(i+" "))return n}}return null}function Rt(e){const t=KN(e);if(t)return t.displayName;const n=e.trim().split(/\s+/).filter(Boolean);if(n.length===0)return e;if(n[0]==="npx")for(let o=1;o<n.length;o++){const r=n[o];if(!r.startsWith("-"))return r}return n[0]==="node"&&n[1]?n[1].split("/").pop()??n[1]:n[0]}function tf(e){const t=e.sessionDbId!==null?`#${e.sessionDbId}`:`pid ${e.pid}`;if(e.sessionName)return`${t} · ${e.sessionName}`;const n=Rt(e.agentCommand);return e.clientName?`${t} · ${e.clientName} · ${n}`:`${t} · ${n}`}function Ul(e){const t=e.id>0?`#${e.id}`:"ephemeral";if(e.name)return{primary:t,secondary:e.name};const n=Rt(e.agentCommand??""),o=e.clientName?`${e.clientName} · ${n}`:n;return{primary:t,secondary:o}}const GN={};function JN(){const e=GN;return(e==null?void 0:e.VITE_PLAYGROUND)==="1"}const QN={"editor-to-agent":"out","agent-to-editor":"in"},YN={out:"editor-to-agent",in:"agent-to-editor"},XN={request:"req",response:"rsp",notification:"ntf",error:"err",unknown:"unk"},ZN={req:"request",rsp:"response",ntf:"notification",err:"error",unk:"unknown"},eC=["tree","raw","meta"];function gh(e){const t=new URLSearchParams(e),n={},o=t.get("dir");if(o!==null){const g=o.split(",").map(b=>b.trim()).filter(Boolean).map(b=>YN[b]).filter(b=>b!==void 0);g.length>0&&(n.directions=new Set(g))}const r=t.get("kind");if(r!==null){const g=r.split(",").map(b=>b.trim()).filter(Boolean).map(b=>ZN[b]).filter(b=>b!==void 0);g.length>0&&(n.kinds=new Set(g))}t.get("streams")==="0"&&(n.showStreams=!1);const i=t.get("q");i!==null&&(n.search=i);const s=t.get("seq"),a=s!==null&&/^\d+$/.test(s)?Number(s):null,l=t.get("tab"),c=l!==null&&eC.includes(l)?l:null,f=t.get("play"),m=f!==null&&/^\d+$/.test(f)?Number(f):null,h=t.get("ws");return{filters:n,selectedSeq:a,detailTab:c,playbackCap:m,captureUrl:h}}const tC=["ws","dir","kind","streams","q","seq","tab","play"];function nC(e){const t=new URLSearchParams(window.location.search);for(const r of tC)t.delete(r);e.captureUrl&&t.set("ws",e.captureUrl),e.filters.directions.size<as.length&&t.set("dir",[...e.filters.directions].map(r=>QN[r]).filter(Boolean).join(",")),e.filters.kinds.size<ls.length&&t.set("kind",[...e.filters.kinds].map(r=>XN[r]).filter(Boolean).join(",")),e.filters.showStreams||t.set("streams","0"),e.filters.search&&t.set("q",e.filters.search),e.selectedSeq!==null&&t.set("seq",String(e.selectedSeq)),e.detailTab!=="tree"&&t.set("tab",e.detailTab),e.playbackCap!==null&&t.set("play",String(e.playbackCap));const n=t.toString(),o=`${window.location.pathname}${n?`?${n}`:""}${window.location.hash}`;o!==window.location.pathname+window.location.search+window.location.hash&&window.history.replaceState(window.history.state,"",o)}function Mb(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Mb(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function oC(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Mb(e))&&(o&&(o+=" "),o+=t);return o}const nf="-",rC=e=>{const t=sC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(nf);return a[0]===""&&a.length!==1&&a.shift(),qb(a,t)||iC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&o[s]?[...l,...o[s]]:l}}},qb=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?qb(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(nf);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},vh=/^\[(.+)\]$/,iC=e=>{if(vh.test(e)){const t=vh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},sC=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return lC(Object.entries(e.classGroups),n).forEach(([i,s])=>{Dd(s,o,i,t)}),o},Dd=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:bh(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(aC(r)){Dd(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{Dd(s,bh(t,i),n,o)})})},bh=(e,t)=>{let n=e;return t.split(nf).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},aC=e=>e.isThemeGetter,lC=(e,t)=>t?e.map(([n,o])=>{const r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,r]}):e,cC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},Ub="!",dC=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,s=a=>{const l=[];let c=0,f=0,m;for(let v=0;v<a.length;v++){let u=a[v];if(c===0){if(u===r&&(o||a.slice(v,v+i)===t)){l.push(a.slice(f,v)),f=v+i;continue}if(u==="/"){m=v;continue}}u==="["?c++:u==="]"&&c--}const h=l.length===0?a:a.substring(f),y=h.startsWith(Ub),g=y?h.substring(1):h,b=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},uC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},pC=e=>({cache:cC(e.cacheSize),parseClassName:dC(e),...rC(e)}),fC=/\s+/,mC=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(fC);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:f,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:y}=n(c);let g=!!y,b=o(g?h.substring(0,y):h);if(!b){if(!g){a=c+(a.length>0?" "+a:a);continue}if(b=o(h),!b){a=c+(a.length>0?" "+a:a);continue}g=!1}const v=uC(f).join(":"),u=m?v+Ub:v,p=u+b;if(i.includes(p))continue;i.push(p);const x=r(b,g);for(let S=0;S<x.length;++S){const T=x[S];i.push(u+T)}a=c+(a.length>0?" "+a:a)}return a};function hC(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Lb(t))&&(o&&(o+=" "),o+=n);return o}const Lb=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Lb(e[o]))&&(n&&(n+=" "),n+=t);return n};function yC(e,...t){let n,o,r,i=s;function s(l){const c=t.reduce((f,m)=>m(f),e());return n=pC(c),o=n.cache.get,r=n.cache.set,i=a,a(l)}function a(l){const c=o(l);if(c)return c;const f=mC(l,n);return r(l,f),f}return function(){return i(hC.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Db=/^\[(?:([a-z-]+):)?(.+)\]$/i,gC=/^\d+\/\d+$/,vC=new Set(["px","full","screen"]),bC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$C=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jn=e=>Rr(e)||vC.has(e)||gC.test(e),Jn=e=>ti(e,"length",PC),Rr=e=>!!e&&!Number.isNaN(Number(e)),$c=e=>ti(e,"number",Rr),yi=e=>!!e&&Number.isInteger(Number(e)),kC=e=>e.endsWith("%")&&Rr(e.slice(0,-1)),pe=e=>Db.test(e),Qn=e=>bC.test(e),TC=new Set(["length","size","percentage"]),_C=e=>ti(e,TC,zb),jC=e=>ti(e,"position",zb),NC=new Set(["image","url"]),CC=e=>ti(e,NC,OC),EC=e=>ti(e,"",IC),gi=()=>!0,ti=(e,t,n)=>{const o=Db.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},PC=e=>xC.test(e)&&!wC.test(e),zb=()=>!1,IC=e=>SC.test(e),OC=e=>$C.test(e),RC=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),o=Ie("brightness"),r=Ie("borderColor"),i=Ie("borderRadius"),s=Ie("borderSpacing"),a=Ie("borderWidth"),l=Ie("contrast"),c=Ie("grayscale"),f=Ie("hueRotate"),m=Ie("invert"),h=Ie("gap"),y=Ie("gradientColorStops"),g=Ie("gradientColorStopPositions"),b=Ie("inset"),v=Ie("margin"),u=Ie("opacity"),p=Ie("padding"),x=Ie("saturate"),S=Ie("scale"),T=Ie("sepia"),C=Ie("skew"),$=Ie("space"),j=Ie("translate"),R=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",pe,t],V=()=>[pe,t],L=()=>["",jn,Jn],U=()=>["auto",Rr,pe],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",pe],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[Rr,pe];return{cacheSize:500,separator:":",theme:{colors:[gi],spacing:[jn,Jn],blur:["none","",Qn,pe],brightness:_(),borderColor:[e],borderRadius:["none","","full",Qn,pe],borderSpacing:V(),borderWidth:L(),contrast:_(),grayscale:G(),hueRotate:_(),invert:G(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[kC,Jn],inset:F(),margin:F(),opacity:_(),padding:V(),saturate:_(),scale:_(),sepia:G(),skew:_(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[Qn]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...D(),pe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yi,pe]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",yi,pe]}],"grid-cols":[{"grid-cols":[gi]}],"col-start-end":[{col:["auto",{span:["full",yi,pe]},pe]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[gi]}],"row-start-end":[{row:["auto",{span:[yi,pe]},pe]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[Qn]},Qn]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qn,Jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$c]}],"font-family":[{font:[gi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pe]}],"line-clamp":[{"line-clamp":["none",Rr,$c]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jn,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[u]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[u]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jn,Jn]}],"underline-offset":[{"underline-offset":["auto",jn,pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[u]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),jC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_C]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[u]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[u]}],"divide-style":[{divide:Q()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[jn,pe]}],"outline-w":[{outline:[jn,Jn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[u]}],"ring-offset-w":[{"ring-offset":[jn,Jn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qn,EC]}],"shadow-color":[{shadow:[gi]}],opacity:[{opacity:[u]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Qn,pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[m]}],saturate:[{saturate:[x]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[u]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pe]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[yi,pe]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[jn,Jn,$c]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},AC=yC(RC);function K(...e){return AC(oC(e))}const $a=1;function MC(e,t,n){return{version:$a,exportedAt:n.exportedAt??Date.now(),tool:{name:n.tool.name,version:n.tool.version},session:{id:e.id,name:e.name,agentCommand:e.agentCommand,clientName:e.clientName,startedAt:e.startedAt,endedAt:e.endedAt},messages:[...t]}}function qC(e,t=4){return JSON.stringify(e,null,t)+`
1766
- `}class Ke extends Error{constructor(t){super(t),this.name="ExportParseError"}}function UC(e){let t;try{t=JSON.parse(e)}catch(l){throw new Ke(`invalid JSON: ${l instanceof Error?l.message:String(l)}`)}if(!ka(t))throw new Ke("expected an object at the top level");const n=t.version;if(n!==$a)throw new Ke(`unsupported export version ${String(n)} (expected ${$a})`);const o=t.exportedAt;if(typeof o!="number")throw new Ke("exportedAt must be a number");if(!ka(t.tool))throw new Ke("tool must be an object");const r=t.tool.name,i=t.tool.version;if(typeof r!="string")throw new Ke("tool.name must be a string");if(typeof i!="string")throw new Ke("tool.version must be a string");const s=t.session;if(!ka(s))throw new Ke("session must be an object");if(typeof s.id!="number")throw new Ke("session.id must be a number");if(typeof s.startedAt!="number")throw new Ke("session.startedAt must be a number");if(s.endedAt!==null&&typeof s.endedAt!="number")throw new Ke("session.endedAt must be a number or null");if(s.name!==null&&typeof s.name!="string")throw new Ke("session.name must be a string or null");if(s.agentCommand!==null&&typeof s.agentCommand!="string")throw new Ke("session.agentCommand must be a string or null");if(s.clientName!==null&&typeof s.clientName!="string")throw new Ke("session.clientName must be a string or null");if(!Array.isArray(t.messages))throw new Ke("messages must be an array");const a=t.messages.map((l,c)=>LC(l,c));return{version:$a,exportedAt:o,tool:{name:r,version:i},session:{id:s.id,name:s.name,agentCommand:s.agentCommand,clientName:s.clientName,startedAt:s.startedAt,endedAt:s.endedAt},messages:a}}function LC(e,t){if(!ka(e))throw new Ke(`messages[${t}] must be an object`);if(typeof e.seq!="number")throw new Ke(`messages[${t}].seq must be a number`);if(typeof e.timestamp!="number")throw new Ke(`messages[${t}].timestamp must be a number`);if(e.direction!=="editor-to-agent"&&e.direction!=="agent-to-editor")throw new Ke(`messages[${t}].direction must be 'editor-to-agent' or 'agent-to-editor'`);const n=e.kind;if(n!=="request"&&n!=="response"&&n!=="error"&&n!=="notification"&&n!=="unknown")throw new Ke(`messages[${t}].kind has unexpected value '${String(n)}'`);if(typeof e.raw!="string")throw new Ke(`messages[${t}].raw must be a string`);const o={seq:e.seq,timestamp:e.timestamp,direction:e.direction,kind:n,raw:e.raw,payload:e.payload===null?null:e.payload};return typeof e.method=="string"&&(o.method=e.method),(typeof e.rpcId=="string"||typeof e.rpcId=="number"||e.rpcId===null)&&(o.rpcId=e.rpcId),typeof e.parseError=="string"&&(o.parseError=e.parseError),o}function ka(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Fb="<REDACTED>",DC=new Set(["authorization","proxy-authorization","proxy-authentication","x-api-key","x-api-token","x-auth-token","api-key","api_key","proxy_key","cookie","set-cookie"]);function zC(e){if(e.payload==null)return{redacted:e,count:0};const{value:t,count:n}=zd(e.payload,{inProxyConfig:!1});if(n===0)return{redacted:e,count:0};const o=t;return{redacted:{...e,payload:o,raw:JSON.stringify(o)},count:n}}function zd(e,t){if(Array.isArray(e)){let n=0;const o=new Array(e.length);for(let r=0;r<e.length;r++){const i=zd(e[r],t);o[r]=i.value,n+=i.count}return{value:o,count:n}}if(e!==null&&typeof e=="object"){let n=0;const o={};for(const[r,i]of Object.entries(e)){if(typeof i=="string"&&DC.has(r.toLowerCase())){o[r]=Fb,n+=1;continue}if(t.inProxyConfig&&r==="headers"&&i!==null&&typeof i=="object"&&!Array.isArray(i)){const l=FC(i);o[r]=l.value,n+=l.count;continue}const s=t.inProxyConfig||r.toLowerCase()==="proxyconfig"?{inProxyConfig:!0}:t,a=zd(i,s);o[r]=a.value,n+=a.count}return{value:o,count:n}}return{value:e,count:0}}function FC(e){let t=0;const n={};for(const[o,r]of Object.entries(e))typeof r=="string"?(n[o]=Fb,t+=1):n[o]=r;return{value:n,count:t}}function BC(e){let t=0,n=0;const o=e.messages.map(r=>{const i=zC(r);return i.count>0&&(t+=1,n+=i.count),i.redacted});return n===0?{export:e,messagesAffected:0,fieldsRedacted:0}:{export:{...e,messages:o},messagesAffected:t,fieldsRedacted:n}}const HC={name:"acp-devtools-ui",version:"0.3.0"};function VC(e,t=Date.now()){const n=e.id>0?String(e.id):"live",o=new Date(t).toISOString().slice(0,19).replace(/[:T]/g,"-");return`acp-session-${n}-${o}.json`}function WC(e,t,n=Date.now()){const o=MC(e,t,{tool:HC,exportedAt:n}),{export:r}=BC(o);return qC(r)}function Bb(e,t,n=Date.now()){const o=WC(e,t,n),r=new Blob([o],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=VC(e,n),s.rel="noopener",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function KC({open:e,onClose:t}){const[n,o]=P.useState(""),[r,i]=P.useState(0),s=P.useRef(null);P.useEffect(()=>{if(!e)return;o(""),i(0);const c=setTimeout(()=>{var f;return(f=s.current)==null?void 0:f.focus()},0);return()=>clearTimeout(c)},[e]);const a=P.useMemo(()=>GC(),[t,e]),l=P.useMemo(()=>JC(a,n),[a,n]);return P.useEffect(()=>{r>=l.length&&i(0)},[l.length,r]),P.useEffect(()=>{if(!e)return;const c=f=>{if(f.key==="Escape"){f.preventDefault(),t();return}if(f.key==="ArrowDown"){f.preventDefault(),i(m=>l.length===0?0:(m+1)%l.length);return}if(f.key==="ArrowUp"){f.preventDefault(),i(m=>l.length===0?0:(m-1+l.length)%l.length);return}if(f.key==="Enter"){f.preventDefault();const m=l[r];m&&(m.run(),t())}};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[e,l,r,t]),e?d.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] flex items-start justify-center bg-black/60 pt-[8vh] backdrop-blur-sm",onMouseDown:c=>{c.target===c.currentTarget&&t()},children:d.jsxs("div",{className:"w-[min(620px,92vw)] overflow-hidden rounded-md border border-line-strong bg-surface-elev shadow-2xl",children:[d.jsx("div",{className:"border-b border-line bg-surface-base/60",children:d.jsx("input",{ref:s,value:n,onChange:c=>{o(c.target.value),i(0)},placeholder:"type a command… esc closes ↑↓ navigate ↵ run",className:"w-full bg-transparent px-4 py-3 font-mono text-[13px] text-ink-primary placeholder-ink-muted outline-none"})}),d.jsxs("ul",{className:"max-h-[60vh] overflow-y-auto py-1",children:[l.length===0&&d.jsx("li",{className:"px-4 py-3 text-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no match"}),l.map((c,f)=>{const m=f===r,h=l[f-1],y=!h||h.section!==c.section;return d.jsxs("li",{children:[y&&d.jsx("div",{className:"px-4 pt-2 pb-1 font-mono text-[9px] uppercase tracking-widest text-ink-muted",children:c.section}),d.jsxs("button",{type:"button",onClick:()=>{c.run(),t()},onMouseEnter:()=>i(f),className:K("flex w-full items-center justify-between px-4 py-1.5 text-left font-mono text-[12px] transition-colors",m?"bg-accent-out/10 text-ink-primary":"text-ink-secondary hover:bg-surface-rowHover hover:text-ink-primary"),children:[d.jsx("span",{className:"truncate",children:c.label}),c.hint&&d.jsx("span",{className:"ml-3 shrink-0 rounded-sm border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-widest text-ink-muted",children:c.hint})]})]},c.id)})]})]})}):null}function GC(e){const t=ne.getState(),n=ft.getState(),o=[];o.push({id:"session.import",label:"Import session JSON from disk…",section:"session",run:()=>{const r=document.createElement("input");r.type="file",r.accept="application/json,.json",r.addEventListener("change",()=>{var s;const i=(s=r.files)==null?void 0:s[0];i&&(async()=>{try{const a=await _v(i);await Qu(),n.setSelected(tl(a.id))}catch(a){const l=a instanceof Error?a.message:String(a);window.alert(`Import failed: ${l}`)}})()}),r.click()}}),t.session!==null&&t.messages.length>0&&o.push({id:"session.export",label:"Export current session as JSON (redacted — auth tokens hidden)",section:"session",run:()=>Bb(t.session,t.messages)}),o.push({id:"view.deselect",label:"Deselect message",hint:"esc",section:"view",run:()=>t.select(null)}),o.push({id:"view.toggle-streams",label:t.filters.showStreams?"Hide streaming chunks":"Show streaming chunks",section:"filter",run:()=>t.toggleStreams()}),o.push({id:"filter.reset",label:"Reset all filters",section:"filter",run:()=>{const r={directions:new Set(as),kinds:new Set(ls),showStreams:!0,search:""};ne.setState({filters:r})}});for(const r of as){const i=t.filters.directions.has(r);o.push({id:`filter.dir.${r}`,label:`${i?"Hide":"Show"} ${r==="editor-to-agent"?"editor → agent":"agent → editor"} messages`,section:"filter",run:()=>t.toggleDirection(r)})}for(const r of ls){const i=t.filters.kinds.has(r);o.push({id:`filter.kind.${r}`,label:`${i?"Hide":"Show"} ${r} kind`,section:"filter",run:()=>t.toggleKind(r)})}if(t.selectedSeq!==null){const r=t.messages.find(i=>i.seq===t.selectedSeq);r&&(o.push({id:"copy.raw",label:`Copy selected message raw line (seq ${r.seq})`,section:"copy",run:()=>{navigator.clipboard.writeText(r.raw)}}),r.payload&&o.push({id:"copy.payload",label:`Copy selected payload as JSON (seq ${r.seq})`,section:"copy",run:()=>{navigator.clipboard.writeText(JSON.stringify(r.payload,null,2))}}))}for(const r of n.captures)o.push({id:`switch.live.${r.url}`,label:`Switch to live: ${tf(r)}`,section:"switch",run:()=>n.setSelected(r.url)});for(const r of n.savedSessions.slice(0,25)){const i=Rt(r.agent_command??""),s=r.name??(r.client_name?`${r.client_name} · ${i}`:i);o.push({id:`switch.saved.${r.id}`,label:`Open saved #${r.id} · ${s} (${r.message_count} msg)`,section:"switch",run:()=>n.setSelected(tl(r.id))})}return o}function JC(e,t){const n=t.trim().toLowerCase();if(n==="")return e;const o=n.split(/\s+/);return e.filter(r=>{const i=r.label.toLowerCase();return o.every(s=>i.includes(s))})}const QC={idle:"idle",connecting:"connecting",open:"restoring view",closed:"disconnected",error:"connection error"};function YC({status:e,url:t,lastError:n}){const o=QC[e],r=e==="connecting"||e==="open";return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-surface-base",children:d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:[d.jsx("span",{"aria-hidden":!0,className:K("inline-block h-2 w-2 rounded-full",r?"animate-pulse-soft bg-accent-out":"bg-ink-dim",e==="error"&&"bg-accent-error")}),d.jsx("span",{children:o}),d.jsx("span",{className:"text-ink-dim",children:"·"}),d.jsx("span",{className:"lowercase tracking-normal text-ink-secondary",children:t}),n&&e==="error"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-dim",children:"·"}),d.jsx("span",{className:"lowercase tracking-normal text-accent-error",children:n})]})]})})}function XC(e){const t=e.$defs??{},n=new Map;for(const[g,b]of Object.entries(t)){const v=b["x-method"];if(typeof v!="string")continue;let u=n.get(v);u||(u={},n.set(v,u)),g.endsWith("Request")?u.requestDef=g:g.endsWith("Response")?u.responseDef=g:g.endsWith("Notification")&&(u.notificationDef=g)}function o(g,b){var v,u,p;switch(g.kind){case"request":{const x=g.method;return x?((v=n.get(x))==null?void 0:v.requestDef)??null:null}case"notification":{const x=g.method;return x?((u=n.get(x))==null?void 0:u.notificationDef)??null:null}case"response":case"error":return b?((p=n.get(b))==null?void 0:p.responseDef)??null:null;default:return null}}function r(g){return g==="request"||g==="notification"?"params":g==="response"?"result":g==="error"?"error":null}function i(g){return typeof g=="object"&&g!==null&&!Array.isArray(g)}function s(g,b){const v=g.properties;if(!v)return!0;for(const[u,p]of Object.entries(v))if(!(!p||typeof p!="object")){if("const"in p){if(b[u]!==p.const)return!1}else if(Array.isArray(p.enum)&&!p.enum.includes(b[u]))return!1}return!0}function a(g,b){const v=g.type;if(typeof v=="string"){if(v==="null")return b===null;if(v==="string")return typeof b=="string";if(v==="boolean")return typeof b=="boolean";if(v==="number"||v==="integer")return typeof b=="number";if(v==="array")return Array.isArray(b);if(v==="object")return i(b)&&s(g,b)}return g.$ref||g.properties||g.allOf?i(b)&&s(g,b):!1}function l(g,b=void 0){if(!g)return null;if(g.$ref){const v=g.$ref.replace(/^#\/\$defs\//,""),u=t[v];return u?l(u,b):null}if(g.allOf&&g.allOf.length>0){const v={properties:{}};for(const u of g.allOf){const p=l(u,b);p!=null&&p.properties&&(v.properties={...v.properties,...p.properties}),p!=null&&p.type&&!v.type&&(v.type=p.type),p!=null&&p.items&&!v.items&&(v.items=p.items)}return g.description&&!v.description&&(v.description=g.description),v}if(g.anyOf||g.oneOf){const v=g.anyOf??g.oneOf;if(b!==void 0){for(const u of v)if(u.type!=="null"&&a(u,b))return l(u,b)}for(const u of v){if(u.type==="null")continue;const p=l(u,b);if(p)return p}return null}return g}function c(g,b){let v=g;for(const u of b){if(v==null)return;if(Array.isArray(v)&&/^\d+$/.test(u))v=v[Number(u)];else if(typeof v=="object")v=v[u];else return}return v}function f(g){if(!g)return;if(g.$ref)return g.$ref.replace(/^#\/\$defs\//,"");const b=g.type;if(typeof b=="string")return b;if(Array.isArray(b))return b.find(u=>u!=="null")}function m(g,b){const v=t[g];return{typeName:g,typeDescription:(v==null?void 0:v.description)??null,resolve(u){var R;if(u.length===0)return{inSpec:!0,isExtension:!1,description:v==null?void 0:v.description,type:g};const p=u.slice(1);if(p.length===0)return null;let x=!1,S=v??null;for(let M=0;M<p.length;M++){const F=p[M];F==="_meta"&&(x=!0);const V=/^\d+$/.test(F),L=c(b,u.slice(0,M+1));if(S=l(S,L),!S)return null;if(V){const D=c(b,u.slice(0,M+2));S=l(S.items,D);continue}if(x&&F!=="_meta")return{inSpec:!1,isExtension:!0};const U=(R=S.properties)==null?void 0:R[F];if(!U)return{inSpec:!1,isExtension:x};S=U}const T=c(b,u),C=l(S,T),$={inSpec:!0,isExtension:x};S!=null&&S.description?$.description=S.description:C!=null&&C.description&&($.description=C.description);const j=f(S??null)??f(C);return j&&($.type=j),C!=null&&C.enum&&($.enumValues=C.enum),$}}}function h(g,b={}){const v=o(g,b.pairedMethod);return!v||!r(g.kind)?null:m(v,g.payload)}function y(){return[...n.keys()].sort()}return{resolveForMessage:h,knownMethods:y}}const ZC=XC(Iv),eE=ZC.resolveForMessage,tE={info:"border-line bg-surface-base text-ink-primary",warn:"border-accent-warn/40 bg-accent-warn/10 text-ink-primary",error:"border-accent-error/40 bg-accent-error/10 text-ink-primary"};function us({label:e,children:t,delay:n=60,tone:o="info",className:r,focusable:i=!1}){const s=P.useRef(null),a=P.useRef(null),[l,c]=P.useState(null),f=l!==null,m=()=>{const g=s.current;if(!g)return null;const b=g.getBoundingClientRect(),u=window.innerHeight-b.bottom<120;return{top:u?b.top-8:b.bottom+8,left:Math.min(b.left,window.innerWidth-380),flipUp:u}},h=()=>{a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>{const g=m();g&&c(g)},n)},y=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),c(null)};return P.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),P.useEffect(()=>{if(!f)return;const g=()=>y();return window.addEventListener("scroll",g,!0),()=>window.removeEventListener("scroll",g,!0)},[f]),d.jsxs(d.Fragment,{children:[d.jsx("span",{ref:s,className:K("cursor-help",r),onMouseEnter:h,onMouseLeave:y,...i?{onFocus:h,onBlur:y,tabIndex:0}:{},children:t}),l&&Vu.createPortal(d.jsx("div",{role:"tooltip",className:K("pointer-events-none fixed z-[200] max-w-[360px] rounded-sm border px-3 py-2 font-mono text-[11px] leading-snug shadow-lg backdrop-blur-sm",tE[o]),style:{top:l.flipUp?void 0:l.top,bottom:l.flipUp?window.innerHeight-l.top:void 0,left:l.left},children:e}),document.body)]})}const nE=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function Ta(e){return nE.format(e)}function ps(e){const t=e%1e3;return`${Ta(e)}.${String(t).padStart(3,"0")}`}const oE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function rE(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function _a(e,t=Date.now()){const n=new Date(e),o=new Date(t);if(rE(n,o))return Ta(e);if(n.getFullYear()===o.getFullYear())return`${oE[n.getMonth()]} ${n.getDate()} ${Ta(e)}`;const r=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getDate()).padStart(2,"0");return`${n.getFullYear()}-${r}-${i} ${Ta(e)}`}function Ll(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Vt(e){return e<1?"<1ms":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`}function iE(e){return e<250?"ok":e<1500?"warn":"error"}function Hb(e){return e==="editor-to-agent"?"OUT":"IN"}function Vb(e){return e==="editor-to-agent"?"→":"←"}const sE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function aE(e){const t=String(e);return sE.test(t)?t.slice(0,8)+"…":t.length>12?t.slice(0,10)+"…":t}function Ar(e,t=Date.now()){const n=Math.max(0,Math.round((t-e)/1e3));if(n<60)return`${n}s`;const o=Math.floor(n/60);if(o<60)return`${o}m`;const r=Math.floor(o/60);if(r<24){const a=o%60;return`${r}h${String(a).padStart(2,"0")}m`}const i=Math.floor(r/24),s=r%24;return`${i}d${String(s).padStart(2,"0")}h`}function xh(e,t){if(e.length===0)return 0;const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n),i=e[o],s=e[r];return i===void 0||s===void 0?i??0:o===r?i:i+(s-i)*(n-o)}const lE=6;function wh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function cE(e){if(e===null)return"text-accent-error";switch(typeof e){case"string":return"text-accent-out";case"number":return"text-accent-in";case"boolean":return"text-accent-note";default:return"text-ink-secondary"}}function dE(e){return e===null?"null":typeof e=="string"?JSON.stringify(e):String(e)}function al({value:e,name:t,depth:n=0,defaultExpanded:o,path:r=[],getSpec:i}){const s=wh(e)||Array.isArray(e),a=wh(e)?Object.keys(e).length:Array.isArray(e)?e.length:0,l=o??(n<2&&a<=lE),[c,f]=P.useState(l),m=t!==void 0&&i?i(r):null,h=t!==void 0?d.jsx(uE,{name:t,spec:m}):null;if(!s)return d.jsxs("div",{className:"flex items-baseline gap-2 font-mono text-xs leading-relaxed",children:[h,d.jsx("span",{className:K("whitespace-pre-wrap break-all",cE(e)),children:dE(e)})]});const y=Array.isArray(e),g=y?"[":"{",b=y?"]":"}";return d.jsxs("div",{className:"font-mono text-xs leading-relaxed",children:[d.jsxs("button",{type:"button",onClick:()=>f(v=>!v),className:"group/expand flex items-baseline gap-2 text-left hover:text-ink-primary",children:[d.jsx("span",{"aria-hidden":!0,className:K("inline-block w-3 text-ink-muted transition-transform",c?"rotate-90":""),children:"▸"}),h,d.jsx("span",{className:"text-ink-secondary",children:g}),!c&&d.jsxs("span",{className:"text-ink-muted",children:[a," ",y?"items":"keys"]}),!c&&d.jsx("span",{className:"text-ink-secondary",children:b})]}),c&&d.jsxs("div",{className:"ml-3 border-l border-line-grid pl-3",children:[y?e.map((v,u)=>d.jsx(al,{value:v,name:String(u),depth:n+1,path:[...r,String(u)],...i?{getSpec:i}:{}},u)):Object.entries(e).map(([v,u])=>d.jsx(al,{value:u,name:v,depth:n+1,path:[...r,v],...i?{getSpec:i}:{}},v)),d.jsx("div",{className:"text-ink-secondary",children:b})]})]})}function uE({name:e,spec:t}){const n=/^\d+$/.test(e),o=(t==null?void 0:t.description)??null;return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:K(n?"text-ink-muted":"text-ink-secondary"),children:n?`${e}:`:`"${e}":`}),t&&!t.inSpec&&d.jsx(Sh,{tone:t.isExtension?"extension":"unknown",explanation:t.isExtension?"Extension — not declared in the ACP spec; contents are implementation-defined.":"Unknown — this field is not declared in the ACP schema for this message."}),(t==null?void 0:t.inSpec)&&t.isExtension&&d.jsx(Sh,{tone:"extension",explanation:"Extension — _meta payload is implementation-defined per ACP spec."}),o&&d.jsx(us,{label:d.jsx(pE,{text:o,type:t==null?void 0:t.type,enumValues:t==null?void 0:t.enumValues}),tone:"info",className:"text-ink-muted hover:text-ink-primary",focusable:!0,children:d.jsx("span",{"aria-label":`spec: ${o.split(`
1767
- `)[0]}`,children:"ⓘ"})})]})}function pE({text:e,type:t,enumValues:n}){return d.jsxs("div",{className:"space-y-1.5",children:[t&&d.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:d.jsx("span",{className:"text-accent-info",children:t})}),d.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:e}),n&&n.length>0&&d.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["enum: ",n.map(o=>JSON.stringify(o)).join(" · ")]})]})}function Sh({tone:e,explanation:t}){const n=e==="extension"?"border-accent-warn/40 bg-accent-warn/10 text-accent-warn":"border-accent-error/40 bg-accent-error/10 text-accent-error";return d.jsx(us,{label:d.jsx("span",{className:"font-sans",children:t}),tone:e==="extension"?"warn":"error",focusable:!0,children:d.jsx("span",{className:K("inline-flex items-center rounded-sm border px-1 font-mono text-[9px] uppercase tracking-widest",n),children:e==="extension"?"⚠ ext":"⚠ unknown"})})}function fE({message:e,latencyMs:t,pairedRequest:n,onJumpToPaired:o,validation:r}){const i=ne(c=>c.detailTab),s=ne(c=>c.setDetailTab),a=P.useMemo(()=>{if(!e)return null;const c=(n==null?void 0:n.method)??void 0;return eE(e,c?{pairedMethod:c}:void 0)},[e,n]);if(!e)return d.jsx("div",{className:"flex h-full items-center justify-center bg-surface-elev/40",children:d.jsx("div",{className:"text-center font-mono text-xs uppercase tracking-widest text-ink-muted",children:"select a message to inspect"})});const l=e.direction==="editor-to-agent";return d.jsxs("div",{className:"flex h-full flex-col bg-surface-elev/30",children:[d.jsxs("header",{className:"border-b border-line bg-surface-elev px-5 py-3",children:[d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsxs("span",{className:K("font-mono text-[11px] font-semibold tracking-widest",l?"text-accent-out":"text-accent-in"),children:[Vb(e.direction)," ",Hb(e.direction)]}),d.jsxs("span",{className:"font-mono text-xs text-ink-muted",children:["seq ",e.seq]}),d.jsx("span",{className:"font-mono text-xs text-ink-muted",children:ps(e.timestamp)})]}),d.jsx("h2",{className:"mt-1 truncate font-display text-lg uppercase tracking-tight text-ink-primary",children:e.method??e.kind}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[11px] text-ink-secondary",children:[d.jsx(vE,{message:e,resolver:a}),e.rpcId!==void 0&&e.rpcId!==null&&d.jsx(ja,{label:"id",value:String(e.rpcId)}),d.jsx(ja,{label:"bytes",value:Ll(e.raw.length)}),t!==void 0&&d.jsx(ja,{label:"latency",value:`+${Vt(t)}`,accent:!0}),n&&d.jsxs("button",{type:"button",onClick:o?()=>o(n.seq):void 0,className:"inline-flex items-baseline gap-1 transition-colors hover:text-ink-primary",title:"jump to paired message",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:"paired"}),d.jsxs("span",{className:"text-ink-primary underline decoration-line-strong decoration-dotted underline-offset-4",children:["seq ",n.seq," ",n.method??""]})]})]})]}),d.jsxs("nav",{className:"flex gap-1 border-b border-line bg-surface-elev/70 px-4",children:[d.jsx(na,{active:i==="tree",onClick:()=>s("tree"),children:"Tree"}),d.jsx(na,{active:i==="raw",onClick:()=>s("raw"),children:"Raw"}),d.jsx(na,{active:i==="meta",onClick:()=>s("meta"),children:"Meta"}),d.jsx(na,{active:i==="spec",onClick:()=>s("spec"),badge:r&&!r.skipped&&!r.valid?r.errors.length:void 0,children:"Spec"})]}),d.jsxs("div",{className:"flex-1 overflow-auto px-5 py-4",children:[i==="tree"&&d.jsx(hE,{message:e,resolver:a}),i==="raw"&&d.jsx(yE,{raw:e.raw}),i==="meta"&&d.jsx(gE,{message:e}),i==="spec"&&d.jsx(mE,{validation:r})]})]})}function mE({validation:e}){if(!e)return d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"no validation result yet"});if(e.skipped){const t={"parse-error":"this frame failed to parse as JSON-RPC — already surfaced in the Tree tab as a parse error","no-method":"no method available for validation (e.g. response without a paired request)","unknown-method":"the ACP spec has no schema for this method — likely an extension or a future addition","no-schema-for-kind":"the spec has no schema for this kind of frame for this method (e.g. notification-only method)","wrong-kind":"no per-method ACP schema applies (e.g. JSON-RPC error envelope, parse failure)"};return d.jsxs("div",{className:"space-y-2 font-mono text-[11px]",children:[d.jsx("div",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:"not validated"}),d.jsx("div",{className:"text-ink-secondary",children:t[e.skipped]})]})}return e.valid?d.jsx("div",{className:"space-y-2 font-mono text-[11px]",children:d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsx("span",{className:"rounded-sm border border-accent-ok/40 bg-accent-ok/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-ok",children:"✓ conforms"}),d.jsxs("span",{className:"text-ink-muted",children:["matched ",d.jsx("span",{className:"text-ink-secondary",children:e.schemaName})," ","from the ACP schema"]})]})}):d.jsxs("div",{className:"space-y-3 font-mono text-[11px]",children:[d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsxs("span",{className:"rounded-sm border border-accent-error/40 bg-accent-error/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-widest text-accent-error",children:["⚠ ",e.errors.length," violation",e.errors.length===1?"":"s"]}),d.jsxs("span",{className:"text-ink-muted",children:["against ",d.jsx("span",{className:"text-ink-secondary",children:e.schemaName})]})]}),d.jsx("ul",{className:"space-y-1.5",children:e.errors.map((t,n)=>d.jsxs("li",{className:"rounded-sm border border-accent-error/25 bg-accent-error/[0.04] px-2 py-1.5",children:[d.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:[t.keyword??"error"," · ",t.path==="/"?"(root)":t.path]}),d.jsx("div",{className:"mt-0.5 text-ink-primary",children:t.message})]},`${t.path}-${t.keyword}-${n}`))})]})}function hE({message:e,resolver:t}){const n=P.useMemo(()=>{if(t)return o=>t.resolve(o)},[t]);return e.payload===null?d.jsxs("div",{className:"space-y-2 font-mono text-xs",children:[d.jsxs("div",{className:"text-accent-error",children:["parse error: ",e.parseError??"unknown"]}),d.jsx("pre",{className:"whitespace-pre-wrap break-all text-ink-secondary",children:e.raw})]}):d.jsx(al,{value:e.payload,defaultExpanded:!0,...n?{getSpec:n}:{}})}function yE({raw:e}){const[t,n]=P.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return d.jsxs("div",{className:"group relative",children:[d.jsx("button",{type:"button",onClick:o,"aria-label":"Copy raw frame to clipboard",title:"Copy raw frame to clipboard",className:K("absolute right-0 top-0 inline-flex h-6 items-center rounded-sm border bg-surface-elev/70 px-2 font-mono text-[10px] uppercase tracking-widest opacity-0 transition-[opacity,background-color,border-color,color] duration-150","group-hover:opacity-100 focus-visible:opacity-100",t?"border-accent-ok/60 bg-surface-elev text-accent-ok opacity-100":"border-line text-ink-secondary hover:border-accent-info/70 hover:bg-surface-rowHover hover:text-accent-info"),children:t?"✓ copied":"copy"}),d.jsx("pre",{className:"whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-ink-primary",children:e})]})}function gE({message:e}){const t=[["seq",String(e.seq)],["direction",e.direction],["kind",e.kind],["method",e.method??"(none)"],["rpcId",String(e.rpcId??"(none)")],["timestamp",`${ps(e.timestamp)} (${e.timestamp})`],["raw size",Ll(e.raw.length)],["parse error",e.parseError??"(none)"]];return d.jsx("dl",{className:"grid grid-cols-[110px_1fr] gap-x-4 gap-y-1 font-mono text-[12px]",children:t.map(([n,o])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"text-ink-muted uppercase tracking-widest text-[10px]",children:n}),d.jsx("dd",{className:"text-ink-primary",children:o})]},n))})}function vE({message:e,resolver:t}){const n=d.jsx(ja,{label:"kind",value:e.kind});return t!=null&&t.typeDescription?d.jsx(us,{label:d.jsx("div",{className:"whitespace-pre-wrap font-sans text-[12px] leading-snug text-ink-secondary",children:t.typeDescription}),tone:"info",children:n}):n}function ja({label:e,value:t,accent:n}){return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:K(n?"text-accent-warn":"text-ink-primary"),children:t})]})}function na({children:e,active:t,onClick:n,badge:o,tab:r}){return d.jsxs("button",{type:"button",onClick:n,className:K("relative flex items-baseline gap-1.5 px-4 py-2 font-mono text-[11px] uppercase tracking-widest transition-colors",t?"text-ink-primary":"text-ink-muted hover:text-ink-secondary"),children:[d.jsx("span",{children:e}),o!==void 0&&d.jsx("span",{className:"rounded-sm border border-accent-error/40 bg-accent-error/10 px-1 text-[9px] font-semibold text-accent-error",children:o}),t&&d.jsx("span",{className:"absolute inset-x-2 -bottom-px h-px bg-accent-out","aria-hidden":!0})]})}function of(e){const t=new Map,n=new Map;for(const o of e){if(o.rpcId===void 0||o.rpcId===null)continue;const r=String(o.rpcId);if(o.kind==="request")t.set(r,o);else if(o.kind==="response"||o.kind==="error"){const i=t.get(r);if(!i)continue;const s=Math.max(0,o.timestamp-i.timestamp);n.set(i.seq,{pairSeq:o.seq,latencyMs:s}),n.set(o.seq,{pairSeq:i.seq,latencyMs:s})}}return n}function Fd(e){const t=of(e),n=new Map,o=new Map;for(const i of e)if(i.method){if(i.kind==="request"){let s=n.get(i.method);s||(s={count:0,latencies:[]},n.set(i.method,s)),s.count+=1;const a=t.get(i.seq);a&&s.latencies.push(a.latencyMs)}else if(i.kind==="notification"){let s=o.get(i.method);s||(s={count:0,latencies:[]},o.set(i.method,s)),s.count+=1}}const r=[];for(const[i,s]of n)s.latencies.sort((a,l)=>a-l),r.push({method:i,kind:"request",count:s.count,sampleSize:s.latencies.length,p50:s.latencies.length?$h(s.latencies,50):null,p99:s.latencies.length?$h(s.latencies,99):null,max:s.latencies.length?s.latencies[s.latencies.length-1]:null,totalLatencyMs:s.latencies.length?s.latencies.reduce((a,l)=>a+l,0):null,latencies:s.latencies});for(const[i,s]of o)r.push({method:i,kind:"notification",count:s.count,sampleSize:0,p50:null,p99:null,max:null,totalLatencyMs:null,latencies:[]});return r.sort((i,s)=>s.count-i.count||(i.kind==="request"?-1:1)),r}function $h(e,t){if(e.length===0)return 0;const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n),i=e[o],s=e[r];return i===void 0||s===void 0?i??0:o===r?i:i+(s-i)*(n-o)}const Wb=100;function bE(e,t,n={}){const o=n.maxChangesPerRow??Wb,r=kh(e),i=kh(t),s=xE(r,i),a=[],l={equal:0,changed:0,added:0,removed:0,total:0};for(const c of s)if(c.kind==="match"){const f=e[c.i],m=t[c.j],h=wE(f,m,o),y=h.length===0?"equal":"changed";a.push({op:y,a:f,b:m,signature:r[c.i],changes:h}),y==="equal"?l.equal+=1:l.changed+=1}else if(c.kind==="removed"){const f=e[c.i];a.push({op:"removed",a:f,b:null,signature:r[c.i],changes:[]}),l.removed+=1}else{const f=t[c.j];a.push({op:"added",a:null,b:f,signature:i[c.j],changes:[]}),l.added+=1}return l.total=a.length,{rows:a,summary:l}}function kh(e){const t=of(e),n=new Map;for(const o of e)o.method&&n.set(o.seq,o.method);return e.map(o=>{let r=o.method??"";if(!r&&(o.kind==="response"||o.kind==="error")){const i=t.get(o.seq);i&&(r=n.get(i.pairSeq)??"")}return`${o.direction}|${o.kind}|${r}`})}function xE(e,t){const n=e.length,o=t.length,r=o+1,i=new Uint32Array((n+1)*r);for(let c=n-1;c>=0;c--)for(let f=o-1;f>=0;f--){const m=c*r+f;if(e[c]===t[f])i[m]=i[(c+1)*r+(f+1)]+1;else{const h=i[(c+1)*r+f],y=i[c*r+(f+1)];i[m]=h>=y?h:y}}const s=[];let a=0,l=0;for(;a<n&&l<o;)e[a]===t[l]?(s.push({kind:"match",i:a,j:l}),a++,l++):i[(a+1)*r+l]>=i[a*r+(l+1)]?(s.push({kind:"removed",i:a}),a++):(s.push({kind:"added",j:l}),l++);for(;a<n;)s.push({kind:"removed",i:a}),a++;for(;l<o;)s.push({kind:"added",j:l}),l++;return s}function Th(e){const t=e.payload;if(t===null||typeof t!="object")return{raw:e.raw,parseError:e.parseError??null};const n=t,o={};return"method"in n&&(o.method=n.method),"params"in n&&(o.params=n.params),"result"in n&&(o.result=n.result),"error"in n&&(o.error=n.error),o}function wE(e,t,n){const o=[];return ll(Th(e),Th(t),"",o,n),o}function SE(e,t,n=Wb){const o=[];return ll(e,t,"",o,n),o}function _h(e){return Array.isArray(e)?"array":e!==null&&typeof e=="object"?"object":"leaf"}function ll(e,t,n,o,r){if(o.length>=r||Object.is(e,t))return;const i=_h(e),s=_h(t);if(i!==s||i==="leaf"){if($E(e,t))return;o.push({path:n||"$",kind:"change",a:e,b:t});return}if(i==="array"){const f=e,m=t,h=Math.max(f.length,m.length);for(let y=0;y<h;y++){if(o.length>=r)return;const g=`${n}[${y}]`,b=y<f.length,v=y<m.length;b&&v?ll(f[y],m[y],g,o,r):v?o.push({path:g,kind:"add",b:m[y]}):o.push({path:g,kind:"remove",a:f[y]})}return}const a=e,l=t,c=[...new Set([...Object.keys(a),...Object.keys(l)])].sort();for(const f of c){if(o.length>=r)return;const m=n?`${n}.${f}`:f,h=f in a,y=f in l;h&&y?ll(a[f],l[f],m,o,r):y?o.push({path:m,kind:"add",b:l[f]}):o.push({path:m,kind:"remove",a:a[f]})}}function $E(e,t){return Object.is(e,t)}function Ne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function xn(e){return typeof e=="string"&&e.length>0?e:null}function Ao(e){return e===!0}function kE(e){for(const t of e)if(t.kind==="request"&&t.method==="initialize"&&t.direction==="editor-to-agent")return t;return null}function TE(e,t){if(t==null)return null;for(const n of e)if(n.kind==="response"&&n.direction==="agent-to-editor"&&n.rpcId===t)return n;return null}function _E(e){var r,i;const t={name:null,title:null,version:null,platform:null};if(!e)return t;const n=Ne((r=Ne(e.payload))==null?void 0:r.params),o=Ne(n==null?void 0:n.clientInfo);return o?{name:xn(o.name),title:xn(o.title),version:xn(o.version),platform:xn((i=Ne(o._meta))==null?void 0:i.platform)}:t}function jE(e){var s,a;const t={fsReadTextFile:!1,fsWriteTextFile:!1,terminal:!1,authTerminal:!1,authGateway:!1};if(!e)return t;const n=Ne((s=Ne(e.payload))==null?void 0:s.params),o=Ne(n==null?void 0:n.clientCapabilities);if(!o)return t;const r=Ne(o.fs),i=Ne(o.auth);return{fsReadTextFile:Ao(r==null?void 0:r.readTextFile),fsWriteTextFile:Ao(r==null?void 0:r.writeTextFile),terminal:Ao(o.terminal),authTerminal:Ao(i==null?void 0:i.terminal),authGateway:Ao((a=Ne(i==null?void 0:i._meta))==null?void 0:a.gateway)}}function NE(e){var i;const t={name:null,version:null,authMethods:0};if(!e)return t;const n=Ne((i=Ne(e.payload))==null?void 0:i.result);if(!n)return t;const o=Ne(n.agentInfo),r=n.authMethods;return{name:xn(o==null?void 0:o.name),version:xn(o==null?void 0:o.version),authMethods:Array.isArray(r)?r.length:0}}function CE(e){var r;const t={prompt:!1,loadSession:!1};if(!e)return t;const n=Ne((r=Ne(e.payload))==null?void 0:r.result),o=Ne(n==null?void 0:n.agentCapabilities);return o?{prompt:Ao(o.promptCapabilities)||o.promptCapabilities!==void 0,loadSession:Ao(o.loadSession)}:t}function EE(e,t){const n=t??e;if(!n)return null;const o=Ne(n.payload),r=Ne(o==null?void 0:o.result)??Ne(o==null?void 0:o.params),i=r==null?void 0:r.protocolVersion;return typeof i=="number"?i:null}function PE(e){var s,a;let t=null,n=0,o=null,r=0,i=[];for(const l of e){l.direction!=="editor-to-agent"&&l.kind;const c=Ne((s=Ne(l.payload))==null?void 0:s.params);if(c){if(l.method==="session/set_mode"){const f=xn(c.modeId);f!==null&&(t!==null&&t!==f&&(n+=1),t=f)}else if(l.method==="session/set_model"){const f=xn(c.modelId);f!==null&&(o!==null&&o!==f&&(r+=1),o=f)}else if(l.method==="session/update"){const f=Ne(c.update);if((f==null?void 0:f.sessionUpdate)==="available_commands_update"){const m=f.availableCommands;if(Array.isArray(m)){const h=[];for(const y of m){const g=xn((a=Ne(y))==null?void 0:a.name);g!==null&&h.push(g)}h.length>0&&(i=h)}}else if((f==null?void 0:f.sessionUpdate)==="current_mode_update"){const m=xn(f.currentModeId);m!==null&&(t!==null&&t!==m&&(n+=1),t=m)}}}}return{currentMode:t,modeChanges:n,currentModel:o,modelChanges:r,availableCommands:i}}function IE(e){if(!e)return{jetbrainsProxyConfig:null};const t=Ne(e.payload),n=Ne(t==null?void 0:t.params),o=Ne(n==null?void 0:n._meta);return{jetbrainsProxyConfig:(o==null?void 0:o.proxyConfig)??null}}function cl(e){const t=kE(e),n=TE(e,t==null?void 0:t.rpcId);return{protocolVersion:EE(t,n),client:_E(t),agent:NE(n),clientCapabilities:jE(t),agentCapabilities:CE(n),runtime:PE(e),extensions:IE(t)}}function jh(e){return{protocolVersion:e.protocolVersion,client:e.client,agent:e.agent,clientCapabilities:e.clientCapabilities,agentCapabilities:e.agentCapabilities,runtime:e.runtime}}function OE(e,t){const n=cl(e),o=cl(t);return{a:n,b:o,changes:SE(jh(n),jh(o))}}function RE(e,t){const n=Fd(e),o=Fd(t),r=l=>`${l.kind}:${l.method}`,i=new Map(n.map(l=>[r(l),l])),s=new Map(o.map(l=>[r(l),l])),a=[];for(const l of new Set([...i.keys(),...s.keys()])){const c=i.get(l)??null,f=s.get(l)??null,m=c??f;a.push({method:m.method,kind:m.kind,a:c,b:f,countDelta:((f==null?void 0:f.count)??0)-((c==null?void 0:c.count)??0),p50Delta:kc(c==null?void 0:c.p50,f==null?void 0:f.p50),p99Delta:kc(c==null?void 0:c.p99,f==null?void 0:f.p99),maxDelta:kc(c==null?void 0:c.max,f==null?void 0:f.max)})}return a.sort((l,c)=>Math.abs(c.p99Delta??0)-Math.abs(l.p99Delta??0)||Math.abs(c.countDelta)-Math.abs(l.countDelta)||l.method.localeCompare(c.method)),a}function kc(e,t){return e==null||t===null||t===void 0?null:t-e}function rf(e,t=200){const[n,o]=P.useState(e),[r,i]=P.useState(!1);return P.useEffect(()=>{if(e){o(!0);let a=null;const l=requestAnimationFrame(()=>{a=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(l),a!==null&&cancelAnimationFrame(a)}}i(!1);const s=setTimeout(()=>o(!1),t);return()=>clearTimeout(s)},[e,t]),{rendered:n,visible:r}}const sf="flex h-9 items-center gap-4 border-b border-line bg-surface-base px-5",AE={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"UNK"};function ME(e){return e.direction==="editor-to-agent"?"→A":"A←"}function Kb(e){if(e.name)return`#${e.id} · ${e.name}`;const t=e.agent_command?Rt(e.agent_command):"agent";return e.client_name?`#${e.id} · ${e.client_name} · ${t}`:`#${e.id} · ${t}`}const Nh={messages:null,loading:!1,error:null};function Ch(e){const[t,n]=P.useState(Nh);return P.useEffect(()=>{if(e===null){n(Nh);return}let o=!1;return n({messages:null,loading:!0,error:null}),$S(e).then(r=>{o||n({messages:r.messages,loading:!1,error:null})}).catch(r=>{o||n({messages:null,loading:!1,error:r instanceof Error?r.message:String(r)})}),()=>{o=!0}},[e]),t}function qE({open:e,onClose:t}){const n=ne(D=>D.messages),o=ne(D=>D.session),r=ft(D=>D.savedSessions),i=(o==null?void 0:o.id)??null,[s,a]=P.useState(null),[l,c]=P.useState(null),[f,m]=P.useState("frames"),[h,y]=P.useState(!0),[g,b]=P.useState(null),{rendered:v,visible:u}=rf(e);P.useEffect(()=>{if(!e)return;const D=Q=>{Q.key==="Escape"&&(Q.preventDefault(),t())};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[e,t]),P.useEffect(()=>{e&&(a(i),c(null),b(null))},[e,i]),P.useEffect(()=>b(null),[s,l]);const p=Ch(s!==null&&s!==i?s:null),x=Ch(l!==null&&l!==i?l:null),S=s===null?null:s===i?n:p.messages,T=l===null?null:l===i?n:x.messages,C=p.loading||x.loading,$=p.error??x.error,j=P.useMemo(()=>S===null||T===null?null:bE(S,T),[S,T]),R=P.useMemo(()=>{if(!j)return[];const D=[];return j.rows.forEach((Q,ee)=>{h&&Q.op==="equal"||D.push({row:Q,index:ee})}),D},[j,h]),M=P.useMemo(()=>{const D=r.find(Q=>Q.id===l);return D?Kb(D):null},[r,l]),F=P.useMemo(()=>S&&T?OE(S,T):null,[S,T]),V=P.useMemo(()=>S&&T?RE(S,T):null,[S,T]);if(!v)return null;const L=r.filter(D=>D.id!==l),U=r.filter(D=>D.id!==s);return d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Session diff",className:K("fixed inset-0 z-[100] flex flex-col bg-surface-base/95 backdrop-blur-sm transition-opacity duration-200 ease-out",u?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:K("flex h-full w-full flex-col transition-transform duration-200 ease-out",u?"translate-y-0":"-translate-y-2"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Diff — compare two sessions"}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close diff panel",children:"close"})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line bg-surface-elev px-5 py-2.5",children:[d.jsx("span",{className:"font-mono text-[11px] text-accent-out",title:"baseline (left)",children:"A"}),d.jsx(Oh,{ariaLabel:"Baseline session",sessions:L,selectedId:s,onSelect:a}),d.jsx("span",{className:"text-ink-muted",children:"→"}),d.jsx("span",{className:"font-mono text-[11px] text-ink-secondary",title:"comparison (right)",children:"B"}),d.jsx(Oh,{ariaLabel:"Comparison session",sessions:U,selectedId:l,onSelect:c})]}),s===null?d.jsx(vi,{children:"Pick a baseline session (A) to compare from."}):l===null?d.jsx(vi,{children:"Pick a session in the B selector above to compare against A."}):C?d.jsx(vi,{children:"Loading sessions…"}):$?d.jsxs(vi,{tone:"error",children:["Could not load a session: ",$]}):!j||!F||!V?d.jsx(vi,{children:"No data."}):d.jsxs(d.Fragment,{children:[d.jsx(UE,{tab:f,onTab:m,summary:j.summary,infoCount:F.changes.length}),d.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[f==="frames"&&d.jsx(LE,{diff:j,bLabel:M,hideEqual:h,onHideEqual:y,visibleRows:R,expanded:g,onToggleExpand:D=>b(Q=>Q===D?null:D)}),f==="info"&&d.jsx(DE,{meta:F}),f==="perf"&&d.jsx(FE,{perf:V})]})]})]})})}function UE({tab:e,onTab:t,summary:n,infoCount:o}){const i=[{id:"frames",label:"frames",badge:n.changed+n.added+n.removed},{id:"info",label:"info",badge:o},{id:"perf",label:"perf",badge:0}];return d.jsx("div",{className:"flex items-center gap-1 border-b border-line bg-surface-elev px-5 py-1.5",children:i.map(s=>d.jsxs("button",{type:"button",onClick:()=>t(s.id),className:K("inline-flex items-center gap-1.5 rounded-sm px-3 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors",e===s.id?"bg-surface-rowHover text-ink-primary":"text-ink-muted hover:text-ink-secondary"),children:[s.label,s.badge>0&&d.jsx("span",{className:"rounded-sm border border-line px-1 text-[9px] text-ink-secondary",children:s.badge})]},s.id))})}function LE({diff:e,bLabel:t,hideEqual:n,onHideEqual:o,visibleRows:r,expanded:i,onToggleExpand:s}){const a=e.summary.changed===0&&e.summary.added===0&&e.summary.removed===0;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K(sf,"font-mono text-[11px]"),children:[d.jsxs("span",{className:"text-ink-muted",children:[e.summary.equal," same"]}),d.jsxs("span",{className:"text-accent-warn",children:[e.summary.changed," differs"]}),d.jsxs("span",{className:"text-accent-error",children:[e.summary.removed," only in A"]}),d.jsxs("span",{className:"text-accent-ok",children:[e.summary.added," only in B"]}),d.jsxs("label",{className:"ml-auto flex cursor-pointer select-none items-center gap-2 text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx("input",{type:"checkbox",checked:n,onChange:l=>o(l.target.checked),className:"accent-accent-info"}),"hide unchanged"]})]}),a?d.jsxs(fs,{tone:"ok",children:["Sessions are identical",t?` — every frame in B (${t}) matches A`:"","."]}):r.length===0?d.jsx(fs,{children:"Only unchanged frames — toggle “hide unchanged” to see them."}):d.jsxs("table",{className:"w-full table-fixed border-collapse font-mono text-[11px]",children:[d.jsxs("colgroup",{children:[d.jsx("col",{className:"w-[24px]"}),d.jsx("col",{className:"w-1/2"}),d.jsx("col",{className:"w-1/2"})]}),d.jsx("tbody",{children:r.map(({row:l,index:c})=>d.jsx(VE,{row:l,expanded:i===c,onToggle:()=>s(c)},c))})]})]})}function Gb(){return d.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-warn",children:"~"})," changed"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-ok",children:"+"})," only in B"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-error",children:"−"})," only in A"]})]})}function DE({meta:e}){return e.changes.length===0?d.jsx(fs,{tone:"ok",children:"Metadata identical — same client, agent, capabilities, protocol and runtime."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:sf,children:d.jsx(Gb,{})}),d.jsx("ul",{className:"space-y-1 px-5 py-3 font-mono text-[11px]",children:e.changes.map((t,n)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Jb,{change:t})},n))})]})}function Eh(e){return e==null?"—":Vt(e)}function zE(e){return e===null?{text:"—",tone:"text-ink-dim"}:e===0?{text:"0",tone:"text-ink-muted"}:{text:(e>0?"+":"−")+Vt(Math.abs(e)),tone:e>0?"text-accent-error":"text-accent-ok"}}function FE({perf:e}){return e.length===0?d.jsx(fs,{children:"No methods to compare."}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:K(sf,"font-mono text-[10px] uppercase tracking-widest text-ink-muted"),children:[d.jsx("span",{children:"Δ = B − A · sorted by |Δ p99|"}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-error",children:"+"})," slower in B"]}),d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{className:"text-accent-ok",children:"−"})," faster in B"]})]}),d.jsxs("table",{className:"w-full text-[11px]",children:[d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:d.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx("th",{className:"py-2 pl-5 pr-3",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"A p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"B p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"Δ p99"}),d.jsx("th",{className:"px-3 py-2 text-right",children:"count"})]})}),d.jsx("tbody",{className:"font-mono",children:e.map(t=>{var o,r,i,s;const n=zE(t.p99Delta);return d.jsxs("tr",{className:"border-b border-line/40 hover:bg-surface-rowHover/50",children:[d.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:t.method,children:t.method}),d.jsx("td",{className:"px-3 py-1.5 text-[10px] uppercase tracking-widest text-ink-muted",children:t.kind==="request"?"req":"ntf"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:Eh(((o=t.a)==null?void 0:o.p99)??null)}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:Eh(((r=t.b)==null?void 0:r.p99)??null)}),d.jsx("td",{className:K("px-3 py-1.5 text-right",n.tone),children:n.text}),d.jsxs("td",{className:"px-3 py-1.5 text-right text-ink-muted",children:[((i=t.a)==null?void 0:i.count)??0,"→",((s=t.b)==null?void 0:s.count)??0]})]},`${t.kind}:${t.method}`)})})]})]})}function vi({children:e,tone:t}){return d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d.jsx(fs,{...t?{tone:t}:{},children:e})})}const BE={equal:"",changed:"bg-accent-warn/5",added:"bg-accent-ok/5",removed:"bg-accent-error/5"},HE={equal:{glyph:"=",tone:"text-ink-dim"},changed:{glyph:"≠",tone:"text-accent-warn"},added:{glyph:"▸",tone:"text-accent-ok"},removed:{glyph:"◂",tone:"text-accent-error"}};function VE({row:e,expanded:t,onToggle:n}){const o=HE[e.op],r=e.op==="changed"&&e.changes.length>0;return d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:K("border-b border-line/40 align-top",BE[e.op],r&&"cursor-pointer hover:bg-accent-warn/10"),onClick:r?n:void 0,children:[d.jsx("td",{className:K("py-1.5 pl-5 text-center",o.tone),children:o.glyph}),d.jsx("td",{className:"px-3 py-1.5",children:d.jsx(Ph,{frame:e.a,muted:e.op==="added"})}),d.jsxs("td",{className:"px-3 py-1.5",children:[d.jsx(Ph,{frame:e.b,muted:e.op==="removed"}),r&&d.jsxs("span",{className:"ml-2 text-[10px] text-accent-warn",children:[t?"▾":"▸"," ",e.changes.length," field",e.changes.length===1?"":"s"]})]})]}),r&&t&&d.jsxs("tr",{className:"border-b border-line/40 bg-surface-elev",children:[d.jsx("td",{}),d.jsxs("td",{colSpan:2,className:"px-5 py-2",children:[d.jsx("div",{className:"mb-1.5",children:d.jsx(Gb,{})}),d.jsx("ul",{className:"space-y-1",children:e.changes.map((i,s)=>d.jsx("li",{className:"leading-snug",children:d.jsx(Jb,{change:i})},s))})]})]})]})}function Ph({frame:e,muted:t}){if(e===null)return d.jsx("span",{className:"text-ink-dim",children:"—"});const n=e.method??(e.parseError?`! ${e.parseError}`:"—");return d.jsxs("span",{className:K("inline-flex items-baseline gap-2",t&&"opacity-60"),children:[d.jsx("span",{className:"text-ink-dim",children:ME(e)}),d.jsx("span",{className:"text-[10px] uppercase tracking-widest text-ink-muted",children:AE[e.kind]}),d.jsx("span",{className:"truncate text-ink-primary",title:n,children:n}),d.jsxs("span",{className:"text-ink-dim",children:["#",e.seq]})]})}const Ih=80;function oa(e){let t;try{t=JSON.stringify(e)}catch{t=String(e)}return t===void 0&&(t="undefined"),t.length>Ih&&(t=t.slice(0,Ih-1)+"…"),t}function Jb({change:e}){return e.kind==="add"?d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-ok",children:"+ "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-ok",children:oa(e.b)})]}):e.kind==="remove"?d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-error",children:"− "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-error line-through",children:oa(e.a)})]}):d.jsxs("span",{children:[d.jsx("span",{className:"text-accent-warn",children:"~ "}),d.jsx("span",{className:"text-ink-secondary",children:e.path}),d.jsx("span",{className:"text-ink-muted",children:": "}),d.jsx("span",{className:"text-accent-error line-through",children:oa(e.a)}),d.jsx("span",{className:"text-ink-muted",children:" → "}),d.jsx("span",{className:"text-accent-ok",children:oa(e.b)})]})}function fs({children:e,tone:t="muted"}){const n=t==="error"?"text-accent-error":t==="ok"?"text-accent-ok":"text-ink-muted";return d.jsx("div",{className:K("px-5 py-8 text-center font-mono text-[12px]",n),children:e})}function Oh({ariaLabel:e,sessions:t,selectedId:n,onSelect:o}){const[r,i]=P.useState(!1),s=P.useRef(null);P.useEffect(()=>{if(!r)return;const m=h=>{s.current&&!s.current.contains(h.target)&&i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const a=t.filter(m=>m.imported_at===null),l=t.filter(m=>m.imported_at!==null),c=n!==null?t.find(m=>m.id===n)??null:null,f=c?Kb(c):n!==null?`#${n}`:"select a session…";return d.jsxs("div",{ref:s,className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>i(m=>!m),"aria-label":e,"aria-haspopup":"listbox","aria-expanded":r,className:K("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] uppercase tracking-widest transition-colors","border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",r?"border-line-strong text-ink-primary":""),title:`${e} — pick which session to compare`,children:[d.jsx("span",{className:"inline-block w-[240px] truncate text-left",children:f}),d.jsx("span",{"aria-hidden":!0,className:K("transition-transform",r?"rotate-180":""),children:"▾"})]}),r&&d.jsxs("div",{className:"absolute left-0 top-[calc(100%+6px)] z-50 w-[460px] rounded-md border border-line bg-surface-elev shadow-xl",children:[d.jsxs(Rh,{children:["saved · ",a.length," session",a.length===1?"":"s"]}),a.length===0&&d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no other saved sessions to compare"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:a.map(m=>d.jsx(Ah,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))}),l.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs(Rh,{children:["imported · ",l.length," file",l.length===1?"":"s"]}),d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:l.map(m=>d.jsx(Ah,{s:m,active:m.id===n,onPick:()=>{o(m.id),i(!1)}},m.id))})]})]})]})}function Rh({children:e}){return d.jsx("div",{className:"border-b border-line bg-surface-base/50 px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e})}function Ah({s:e,active:t,onPick:n}){return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:n,title:`session #${e.id} · ${e.agent_command??""} · ${e.message_count} messages`,className:K("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",t?"bg-accent-note animate-pulse-soft":"bg-ink-dim")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),d.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Rt(e.agent_command??"")}`:Rt(e.agent_command??""))]}),d.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[e.message_count,"msg · ",Ar(e.started_at)]})]})})}let Tc=null,bi=null;async function WE(){if(Tc)return Tc;if(bi)return bi;bi=(async()=>{const e=await fetch("/api/info",{headers:{accept:"application/json"}});if(!e.ok)throw new Error(`info: HTTP ${e.status}`);const t=await e.json();return Tc=t,t})();try{return await bi}finally{bi=null}}const KE=[{id:"zed",label:"Zed"},{id:"jetbrains",label:"JetBrains"}],GE="/absolute/path/to/acp-devtools";function JE(e){return JSON.stringify({agent_servers:{"Claude Code (via ACP Devtools)":{type:"custom",command:e}}},null,4)}function Qb({text:e,label:t="Copy"}){const[n,o]=P.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1400)}catch{o(!1)}};return d.jsx("button",{type:"button",onClick:r,className:K("rounded border border-line px-2 py-0.5 font-mono text-[10px] uppercase tracking-widest transition-colors",n?"border-accent-out text-accent-out":"text-ink-secondary hover:border-ink-secondary hover:text-ink-primary"),children:n?"Copied":t})}function QE(){const[e,t]=P.useState("zed"),[n,o]=P.useState(null);P.useEffect(()=>{let a=!0;return WE().then(l=>{a&&o(l.binaryPath)}).catch(()=>{}),()=>{a=!1}},[]);const r=n??GE,i=n===null,s=P.useMemo(()=>({zed:JE(r),jetbrainsName:"Claude Code (via ACP Devtools)"}),[r]);return d.jsxs("div",{className:"rounded border border-line bg-surface-base",children:[d.jsx("div",{className:"flex items-center gap-1 border-b border-line px-3 py-2",children:KE.map(a=>d.jsx("button",{type:"button",onClick:()=>t(a.id),className:K("rounded px-2 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors",e===a.id?"bg-surface-elev text-ink-primary":"text-ink-secondary hover:text-ink-primary"),children:a.label},a.id))}),e==="zed"&&d.jsxs("div",{className:"px-3 py-3",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"~/.config/zed/settings.json"}),d.jsx(Qb,{text:s.zed})]}),d.jsx("pre",{className:"overflow-x-auto rounded border border-line bg-surface-elev/60 px-3 py-2 font-mono text-[11px] leading-relaxed text-ink-primary",children:s.zed}),d.jsxs("p",{className:"mt-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Open Zed, paste into ",d.jsx("span",{className:"font-mono",children:"settings.json"})," ","(Cmd+,), pick the new agent in the right-side panel, send a prompt. The CLI auto-proxies ",d.jsx("span",{className:"font-mono",children:"@zed-industries/claude-code-acp"})," ","when launched with no args."]}),d.jsx(Mh,{isPlaceholder:i})]}),e==="jetbrains"&&d.jsxs("div",{className:"px-3 py-3",children:[d.jsxs("p",{className:"mb-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["Settings (Cmd+,) → search ",d.jsx("span",{className:"font-mono",children:"agent"})," → open the AI Assistant / Junie agent-servers page → add a new entry with these fields (no arguments needed):"]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(qh,{label:"Name",value:s.jetbrainsName}),d.jsx(qh,{label:"Command",value:r})]}),d.jsxs("p",{className:"mt-3 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["JetBrains IDEs require an absolute ",d.jsx("span",{className:"font-mono",children:"command"}),". See ",d.jsx("span",{className:"font-mono",children:"examples/jetbrains-config.md"})," if the agent-servers page is not where the search suggests."]}),d.jsx(Mh,{isPlaceholder:i})]})]})}function Mh({isPlaceholder:e}){return e?d.jsxs("div",{className:"mt-3 rounded border border-line border-dashed bg-surface-elev/40 px-3 py-2 font-sans text-[11px] leading-relaxed text-ink-secondary",children:["You're viewing the UI through a development server, so the absolute binary path couldn't be auto-detected. After running"," ",d.jsx("span",{className:"font-mono",children:"npm run build:full"})," in the repo and"," ",d.jsx("span",{className:"font-mono",children:"npm link"})," inside"," ",d.jsx("span",{className:"font-mono",children:"packages/cli/"}),", find the path with"," ",d.jsx("span",{className:"font-mono",children:"which acp-devtools"})," and replace the placeholder above."]}):d.jsxs("p",{className:"mt-3 font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:["path auto-resolved · verify with ",d.jsx("span",{className:"text-ink-secondary",children:"which acp-devtools"})]})}function qh({label:e,value:t}){return d.jsxs("div",{className:"flex items-center gap-2 rounded border border-line bg-surface-elev/60 px-3 py-1.5",children:[d.jsx("span",{className:"w-20 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:"flex-1 truncate font-mono text-[11px] text-ink-primary",children:t}),d.jsx(Qb,{text:t})]})}function YE({status:e,lastError:t,url:n,captureCount:o}){const r=e==="open"?"Awaiting messages":e==="connecting"?"Connecting":e==="closed"?"Disconnected":e==="error"?"Connection error":"No live capture",i=e==="open"?"text-accent-out":e==="error"?"text-accent-error":"text-ink-secondary";return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:d.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[d.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.3.0 / pre-alpha"})]}),d.jsx("h2",{className:K("font-display text-2xl uppercase tracking-tight",i),children:r}),d.jsx("p",{className:"mt-2 font-sans text-sm leading-relaxed text-ink-secondary",children:"Connect an IDE to start streaming ACP frames. Pick yours below — the snippet plugs acp-devtools between editor and agent so every message is captured live."}),o>0&&d.jsxs("p",{className:"mt-2 font-mono text-[11px] uppercase tracking-widest text-accent-out",children:[o," live capture",o===1?"":"s"," discovered — pick one in the picker above"]}),d.jsx("div",{className:"mt-4",children:d.jsx(QE,{})}),d.jsxs("div",{className:"mt-4 flex items-center gap-3 font-mono text-[11px]",children:[d.jsx(XE,{status:e}),d.jsx("span",{className:"text-ink-secondary",children:n}),t&&d.jsx("span",{className:"text-accent-error",children:t})]})]})})}function XE({status:e}){const t=e==="open"?"bg-accent-out":e==="connecting"?"bg-accent-warn animate-pulse-soft":e==="error"?"bg-accent-error":"bg-ink-dim";return d.jsx("span",{className:K("h-2 w-2 rounded-full",t),"aria-hidden":!0})}function ZE(){const e=ne(i=>i.filters),t=ne(i=>i.toggleDirection),n=ne(i=>i.toggleKind),o=ne(i=>i.toggleStreams),r=ne(i=>i.setSearch);return d.jsxs("div",{className:"flex items-center gap-3 border-b border-line bg-surface-elev/70 px-4 py-2",children:[d.jsx("div",{className:"flex items-center gap-1",children:as.map(i=>d.jsx(nP,{dir:i,active:e.directions.has(i),onClick:()=>t(i)},i))}),d.jsx(iP,{}),d.jsxs("div",{className:"flex items-center gap-1",children:[ls.map(i=>d.jsx(oP,{kind:i,active:e.kinds.has(i),onClick:()=>n(i)},i)),d.jsx(rP,{active:e.showStreams,onClick:o})]}),d.jsx("div",{className:"ml-auto",children:d.jsx("input",{type:"search",placeholder:"search payload…",value:e.search,onChange:i=>r(i.target.value),className:K("h-7 w-64 rounded border border-line bg-surface-base px-2 font-mono text-[11px] text-ink-primary placeholder-ink-muted","focus:border-accent-out focus:outline-none")})})]})}const eP={"editor-to-agent":"editor → agent (toggle to filter messages flowing from your IDE to the AI)","agent-to-editor":"agent → editor (toggle to filter messages coming back from the AI)"},tP={request:"request — expects a response",response:"response — answer to a previous request",notification:"notification — one-way event, no response",error:"error — response carrying an error object",unknown:"unknown — frames that could not be classified as JSON-RPC"};function nP({dir:e,active:t,onClick:n}){const o=e==="editor-to-agent",r=o?"→ OUT":"← IN",i=o?"text-accent-out":"text-accent-in";return d.jsx("button",{type:"button",onClick:n,title:eP[e],className:K("inline-flex items-center gap-1 rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold tracking-widest transition-colors",t?K(i,o?"border-accent-out/50 bg-accent-out/10":"border-accent-in/50 bg-accent-in/10"):"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:r})}function oP({kind:e,active:t,onClick:n}){const r={request:{color:"text-accent-out",border:"border-accent-out/50",bg:"bg-accent-out/10"},response:{color:"text-accent-in",border:"border-accent-in/50",bg:"bg-accent-in/10"},notification:{color:"text-accent-note",border:"border-accent-note/50",bg:"bg-accent-note/10"},error:{color:"text-accent-error",border:"border-accent-error/50",bg:"bg-accent-error/10"},unknown:{color:"text-ink-muted",border:"border-line",bg:"bg-surface-row"}}[e];return d.jsx("button",{type:"button",onClick:n,title:tP[e],className:K("rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",t?K(r.color,r.border,r.bg):"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:e})}function rP({active:e,onClick:t}){return d.jsx("button",{type:"button",onClick:t,title:"stream — collapse runs of agent_message_chunk notifications into a single row",className:K("rounded-sm border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",e?"border-accent-note/50 bg-accent-note/10 text-accent-note":"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),children:"stream"})}function iP(){return d.jsx("span",{"aria-hidden":!0,className:"h-5 w-px bg-line"})}const sP={minSamplesForTail:3,longTailRatio:5,minBusiestCount:50,minBusiestRatio:2.5,minHotspotShare:.4,minSamplesForOutlier:5,outlierRatio:3};function aP(e,t,n={}){const o={...sP,...n},r=[],i=t.reduce((y,g)=>y+(g.totalLatencyMs??0),0);if(i>0){const g=t.filter(b=>b.totalLatencyMs!==null&&b.totalLatencyMs>0).sort((b,v)=>(v.totalLatencyMs??0)-(b.totalLatencyMs??0))[0];if(g&&g.totalLatencyMs!==null){const b=g.totalLatencyMs/i;b>=o.minHotspotShare&&r.push({kind:"hotspot",summary:`${g.method} consumed ${ar(g.totalLatencyMs)} of total wall time`,detail:`${Math.round(b*100)}% of ${ar(i)} sampled latency`,methods:[g.method]})}}const a=t.filter(y=>y.sampleSize>=o.minSamplesForTail&&y.p50!==null&&y.p99!==null&&y.p50>0&&y.p99/y.p50>=o.longTailRatio).sort((y,g)=>(g.p99??0)/(g.p50??1)-(y.p99??0)/(y.p50??1))[0];if(a&&a.p99!==null&&a.p50!==null){const y=Math.round(a.p99/a.p50);r.push({kind:"long-tail",summary:`${a.method} has a long tail — p99 is ${y}× the p50`,detail:`p50 ${ar(a.p50)} · p99 ${ar(a.p99)} · ${a.sampleSize} samples`,methods:[a.method]})}const l=[...t].filter(y=>y.sampleSize>=o.minSamplesForOutlier&&y.p99!==null&&y.max!==null&&y.p99>0&&y.max/y.p99>=o.outlierRatio).sort((y,g)=>(g.max??0)-(y.max??0))[0];if(l&&l.max!==null&&l.p99!==null){const y=Math.round(l.max/l.p99);r.push({kind:"outlier",summary:`${l.method} had one ${ar(l.max)} call — ${y}× its p99`,detail:`p99 ${ar(l.p99)} · ${l.sampleSize} samples`,methods:[l.method]})}const c=[...t].sort((y,g)=>g.count-y.count),f=c[0],m=c[1];if(f&&f.count>=o.minBusiestCount){const y=m&&m.count>0?f.count/m.count:1/0;if(y>=o.minBusiestRatio){const g=f.kind==="notification"?"notifications":"calls";r.push({kind:"busiest",summary:`${f.method} sent ${f.count} ${g}`,detail:m?`${y.toFixed(1)}× the next-busiest method (${m.method} · ${m.count})`:"no other methods to compare against",methods:[f.method]})}}const h=lP(e);if(h.length>0){const y=h.slice(0,3),g=h.length>3?` (+${h.length-3} more)`:"";r.push({kind:"errors",summary:`${h.length} method${h.length===1?"":"s"} returned an error`,detail:y.join(", ")+g,methods:h})}return r}function lP(e){const t=new Map,n=new Set;for(const o of e){const r=o.rpcId===void 0||o.rpcId===null?null:String(o.rpcId);if(o.kind==="request"&&o.method&&r!==null)t.set(r,o.method);else if(o.kind==="error"&&r!==null){const i=t.get(r);i&&n.add(i)}}return[...n].sort()}function ar(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<1e4)return`${(e/1e3).toFixed(2)}s`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return`${t}m${n}s`}function cP(e,t){if(e.length<=t)return e;const n=[];for(let o=0;o<t;o++){const r=Math.round(o*(e.length-1)/(t-1));n.push(e[r])}return n}function dP({values:e,width:t=64,height:n=14,className:o,title:r}){if(e.length===0)return null;const i=e[e.length-1]??0;if(i===0)return null;const s=Math.max(1,Math.floor(t/4)),a=cP(e,s),l=1,c=(t-l*(a.length-1))/a.length;return d.jsx("svg",{viewBox:`0 0 ${t} ${n}`,width:t,height:n,className:K("inline-block align-middle",o),role:"img","aria-label":r??`latency distribution, ${e.length} samples`,children:a.map((f,m)=>{const h=Math.max(1,f/i*n);return d.jsx("rect",{x:m*(c+l),y:n-h,width:c,height:h,fill:"currentColor",opacity:.4+f/i*.6},m)})})}function uP(e){const t={events:[],startTs:0,endTs:0,durationMs:0,laneCounts:{"editor-req":0,"agent-req":0,notification:0}};if(e.length===0)return t;const n=of(e),o=new Map;for(const l of e)o.set(l.seq,l);let r=1/0,i=-1/0;const s=[],a={"editor-req":0,"agent-req":0,notification:0};for(const l of e)if(l.timestamp<r&&(r=l.timestamp),l.timestamp>i&&(i=l.timestamp),l.kind==="request"){const c=l.direction==="editor-to-agent"?"editor-req":"agent-req",f=n.get(l.seq),m=f?o.get(f.pairSeq):void 0,h=(m==null?void 0:m.kind)==="error",y=m?m.timestamp:l.timestamp;y>i&&(i=y),s.push({seq:l.seq,startTs:l.timestamp,endTs:y,lane:c,method:l.method??null,kind:l.kind,erroredOut:h,pairedSeq:m?m.seq:null}),a[c]+=1}else l.kind==="notification"&&(s.push({seq:l.seq,startTs:l.timestamp,endTs:l.timestamp,lane:"notification",method:l.method??null,kind:l.kind,erroredOut:!1,pairedSeq:null}),a.notification+=1);return!Number.isFinite(r)||!Number.isFinite(i)?t:{events:s,startTs:r,endTs:i,durationMs:Math.max(0,i-r),laneCounts:a}}const dl=["editor-req","agent-req","notification"],pP={"editor-req":"editor → agent","agent-req":"agent → editor",notification:"notifications"},oo=48,af=6,Dl=24,wn=132,ms=20,zl=8,fP=20,Uh=3e4,Lh=50;function mP(e,t,n,o,r,i){if(e.length===0||n<=t)return{segments:[{kind:"active",tStart:t,tEnd:n,pxStart:0,pxEnd:o*r}],tsToX:()=>wn-i,totalActiveMs:0};const s=[...e].sort((p,x)=>p.startTs-x.startTs),a=[];let l=t,c=t;for(const p of s)p.startTs-c>Uh&&(c>l&&a.push({kind:"active",tStart:l,tEnd:c}),a.push({kind:"gap",tStart:c,tEnd:p.startTs}),l=p.startTs),c=Math.max(c,p.endTs);c>l&&a.push({kind:"active",tStart:l,tEnd:c}),n>c+Uh?a.push({kind:"gap",tStart:c,tEnd:n}):n>c&&a.length>0&&(a[a.length-1].tEnd=n);const f=a.filter(p=>p.kind==="gap").length,m=a.filter(p=>p.kind==="active").reduce((p,x)=>p+(x.tEnd-x.tStart),0),h=o*r,y=Math.max(50,h-f*Lh),g=m>0?y/m:0;let b=0;const v=[];for(const p of a){const x=p.kind==="gap"?Lh:(p.tEnd-p.tStart)*g;v.push({...p,pxStart:b,pxEnd:b+x}),b+=x}return{segments:v,tsToX:p=>{if(p<=v[0].tStart)return wn+v[0].pxStart-i;for(const S of v)if(p>=S.tStart&&p<=S.tEnd){const T=S.tEnd>S.tStart?(p-S.tStart)/(S.tEnd-S.tStart):0,C=S.pxStart+T*(S.pxEnd-S.pxStart);return wn+C-i}const x=v[v.length-1];return wn+x.pxEnd-i},totalActiveMs:m}}function hP({messages:e,onSelectSeq:t,height:n=220,controlsRef:o,onZoomChange:r}){const i=P.useMemo(()=>uP(e),[e]),s=P.useRef(null),a=P.useRef(null),[l,c]=P.useState({width:800,height:n}),[f,m]=P.useState(1),[h,y]=P.useState(0),[g,b]=P.useState(null),[v,u]=P.useState({x:0,y:0}),p=P.useRef(null);P.useEffect(()=>{const L=s.current;if(!L||typeof ResizeObserver>"u")return;const U=new ResizeObserver(D=>{const Q=D[0];if(!Q)return;const ee=Q.contentRect;c({width:Math.max(320,ee.width),height:Math.max(120,ee.height)})});return U.observe(L),()=>U.disconnect()},[]),P.useEffect(()=>{m(1),y(0),b(null)},[i.startTs,i.endTs]);const x=P.useMemo(()=>{const L=Math.max(50,l.width-wn-ms);return mP(i.events,i.startTs,i.endTs,L,f,h)},[i,l.width,f,h]),S=P.useMemo(()=>{if(i.events.length===0)return[];const L=[];for(const U of i.events){const D=x.tsToX(U.startTs),Q=x.tsToX(U.endTs),ee=Math.max(2,Q-D),q=dl.indexOf(U.lane),G=zl+Dl+q*(oo+af)+oo/2-9;L.push({...U,x:D,y:G,width:ee,height:18})}return L},[i,x]);P.useEffect(()=>{const L=a.current;if(!L)return;const U=window.devicePixelRatio||1;L.width=l.width*U,L.height=l.height*U,L.style.width=`${l.width}px`,L.style.height=`${l.height}px`;const D=L.getContext("2d");if(!D)return;D.setTransform(U,0,0,U,0,0);const Q=getComputedStyle(document.documentElement),ee=G=>`rgb(${Q.getPropertyValue(`--${G}`).trim()})`,q=(G,I)=>`rgba(${Q.getPropertyValue(`--${G}`).trim()} / ${I})`;D.clearRect(0,0,l.width,l.height),yP(D,l,ee),vP(D,x,l,ee,q),gP(D,l,x,ee),wP(D,S,g,ee,q)},[S,x,l,g]);const T=(L,U)=>{for(const D of S){const Q=Math.max(D.width,6);if(L>=D.x&&L<=D.x+Q&&U>=D.y&&U<=D.y+D.height)return D}return null},C=L=>{const U=L.currentTarget.getBoundingClientRect(),D=L.clientX-U.left,Q=L.clientY-U.top;if(p.current){const q=D-p.current.startX;y(Math.max(0,p.current.startPan-q));return}const ee=T(D,Q);b(ee),u({x:L.clientX,y:L.clientY})},$=L=>{const U=L.currentTarget.getBoundingClientRect(),D=L.clientX-U.left,Q=L.clientY-U.top,ee=T(D,Q);if(ee&&t){t(ee.seq);return}p.current={startX:D,startPan:h}},j=()=>{p.current=null},R=L=>{if(!L.metaKey&&!L.ctrlKey)return;L.preventDefault();const U=L.deltaY<0?1.15:1/1.15;m(D=>Math.min(50,Math.max(.3,D*U)))},M=()=>m(L=>Math.min(50,L*1.5)),F=()=>m(L=>Math.max(.3,L/1.5)),V=()=>{m(1),y(0)};return P.useEffect(()=>{if(o)return o.current={zoomIn:M,zoomOut:F,reset:V,getZoom:()=>f},()=>{o.current&&(o.current=null)}}),P.useEffect(()=>{r==null||r(f)},[f,r]),i.events.length===0?d.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] uppercase tracking-widest text-ink-muted",children:"no messages — capture or load a session first"}):d.jsxs("div",{ref:s,className:"relative h-full w-full",style:{minHeight:0},children:[d.jsx("canvas",{ref:a,className:K("block h-full w-full",p.current?"cursor-grabbing":g?"cursor-pointer":"cursor-grab"),onMouseMove:C,onMouseDown:$,onMouseUp:j,onMouseLeave:()=>{b(null),p.current=null},onWheel:R}),g&&d.jsxs("div",{role:"tooltip",className:"pointer-events-none fixed z-[150] rounded-sm border border-line bg-surface-base px-3 py-2 font-mono text-[11px] shadow-lg",style:{left:Math.min(window.innerWidth-280,v.x+12),top:v.y+12,maxWidth:280},children:[d.jsxs("div",{className:"text-ink-primary",children:[d.jsxs("span",{className:"text-ink-muted",children:["seq ",g.seq]})," · ",g.method??g.kind]}),d.jsx("div",{className:"text-ink-muted",children:g.endTs>g.startTs?`${Vt(g.endTs-g.startTs)}${g.erroredOut?" · error":""}`:g.lane==="notification"?"notification":"pending"}),t&&d.jsx("div",{className:"mt-1 text-[10px] text-ink-dim",children:"click to inspect"})]})]})}function yP(e,t,n){e.font="10px monospace",e.textBaseline="middle",e.textAlign="start";for(let o=0;o<dl.length;o++){const r=dl[o],i=zl+Dl+o*(oo+af);e.fillStyle=n("surface-elev"),e.fillRect(wn,i,t.width-wn-ms,oo),e.fillStyle=n("ink-muted"),e.fillText(pP[r],fP,i+oo/2),e.strokeStyle=n("line"),e.lineWidth=1,e.beginPath(),e.moveTo(wn,i+oo),e.lineTo(t.width-ms,i+oo),e.stroke()}}function gP(e,t,n,o){var g;const r=zl+Dl-4;e.strokeStyle=o("line"),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="bottom",e.textAlign="center",e.lineWidth=1;const i=n.segments.filter(b=>b.kind==="active").reduce((b,v)=>Math.max(b,v.tEnd-v.tStart),0),s=n.segments.reduce((b,v)=>b+(v.kind==="active"?v.pxEnd-v.pxStart:0),0),l=(i>0?s/n.totalActiveMs:0)*1e3,c=[.1,.25,.5,1,2,5,10,30,60,120,300],f=80;let m=c[c.length-1];for(const b of c)if(b*l>=f){m=b;break}const h=m*1e3,y=((g=n.segments[0])==null?void 0:g.tStart)??0;for(const b of n.segments){if(b.kind!=="active")continue;const v=Math.ceil((b.tStart-y)/h)*h+y;for(let u=v;u<=b.tEnd;u+=h){const p=n.tsToX(u);p<wn||p>t.width-ms||(e.beginPath(),e.moveTo(p,r),e.lineTo(p,r+4),e.stroke(),e.fillText(xP(u-y),p,r-2))}}}function vP(e,t,n,o,r){const i=zl+Dl,s=i+dl.length*(oo+af);for(const a of t.segments){if(a.kind!=="gap")continue;const l=t.tsToX(a.tStart),f=t.tsToX(a.tEnd)-l;if(l>n.width-ms||l+f<wn)continue;e.fillStyle=r("ink-muted",.06),e.fillRect(l,i,f,s-i),e.strokeStyle=o("line"),e.setLineDash([3,3]),e.lineWidth=1,e.beginPath(),e.moveTo(l+.5,i),e.lineTo(l+.5,s),e.moveTo(l+f-.5,i),e.lineTo(l+f-.5,s),e.stroke(),e.setLineDash([]),e.fillStyle=o("ink-muted"),e.font="10px monospace",e.textBaseline="middle",e.textAlign="center";const m=l+f/2,h=i+(s-i)/2;e.fillText(bP(a.tEnd-a.tStart),m,h)}}function bP(e){if(e<6e4)return`${Math.round(e/1e3)}s idle`;if(e<36e5)return`${Math.round(e/6e4)}m idle`;const t=Math.floor(e/36e5),n=Math.round(e%36e5/6e4);return n>0?`${t}h${n}m idle`:`${t}h idle`}function xP(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(e<1e4?1:0)}s`;const t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return`${t}m${n}s`}function wP(e,t,n,o,r){for(const i of t){const s=(n==null?void 0:n.seq)===i.seq,a=i.erroredOut?r("accent-error",.6):i.kind==="notification"?r("accent-note",.7):i.lane==="editor-req"?r("accent-out",.7):r("accent-in",.7);e.fillStyle=s?a.replace(/0\.\d+/,"0.95"):a,e.fillRect(i.x,i.y,Math.max(i.width,2),i.height),s&&(e.strokeStyle=o("ink-primary"),e.lineWidth=1,e.strokeRect(i.x-.5,i.y-.5,Math.max(i.width,2)+1,i.height+1))}}function SP({open:e,onClose:t,onNavigateToSeq:n}){const o=ne(S=>S.messages),r=ne(S=>S.session),i=ne(S=>S.select),s=P.useRef(null),[a,l]=P.useState(1),c=P.useMemo(()=>Fd(o),[o]),f=P.useMemo(()=>aP(o,c),[o,c]),m=P.useMemo(()=>c.reduce((S,T)=>Math.max(S,T.count),0),[c]),[h,y]=P.useState("count"),[g,b]=P.useState("desc"),{rendered:v,visible:u}=rf(e);P.useEffect(()=>{if(!e)return;const S=T=>{T.key==="Escape"&&(T.preventDefault(),t())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[e,t]);const p=P.useMemo(()=>EP(c,h,g),[c,h,g]),x=P.useMemo(()=>CP(c),[c]);return v?d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Performance dashboard",className:K("fixed inset-0 z-[100] flex flex-col bg-surface-base/95 backdrop-blur-sm transition-opacity duration-200 ease-out",u?"opacity-100":"opacity-0"),children:d.jsxs("div",{className:K("flex h-full w-full flex-col transition-transform duration-200 ease-out",u?"translate-y-0":"-translate-y-2"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsxs("div",{className:"flex min-w-0 items-baseline gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Performance — per-method latency"}),r&&d.jsx("span",{className:"truncate font-mono text-[11px] text-ink-secondary",children:(()=>{const S=Ul(r);let T=S.secondary;if(!r.clientName){const C=cl(o),$=C.client.title??C.client.name??null;if($){const j=S.secondary;T=j?`${$} · ${j}`:$}}return T?`${S.primary} · ${T}`:S.primary})()})]}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close performance panel",children:"close"})]}),f.length>0&&d.jsx(_P,{insights:f}),d.jsx("div",{className:"border-b border-line bg-surface-elev px-5 py-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:c.length===0?d.jsx("span",{children:"no messages — capture or load a session first"}):d.jsxs("span",{children:[x.methods," methods · ",x.requests," requests ·"," ",x.notifications," notifications · ",x.samples," latency samples"]})}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[d.jsx("div",{className:"flex-1 overflow-y-auto",children:p.length===0?null:d.jsxs("table",{className:"w-full table-fixed text-[11px]",children:[d.jsxs("colgroup",{children:[d.jsx("col",{}),d.jsx("col",{className:"w-[64px]"}),d.jsx("col",{className:"w-[88px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[80px]"}),d.jsx("col",{className:"w-[120px]"})]}),d.jsx("thead",{className:"sticky top-0 z-10 bg-surface-base",children:d.jsxs("tr",{className:"border-b border-line text-left font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsx(cr,{sk:"method",current:h,dir:g,onSort:lr(y,b,g),className:"!pl-5",children:"method"}),d.jsx("th",{className:"px-3 py-2",children:"kind"}),d.jsx(cr,{sk:"count",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"count"}),d.jsx(cr,{sk:"p50",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"p50"}),d.jsx(cr,{sk:"p99",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"p99"}),d.jsx(cr,{sk:"max",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"max"}),d.jsx(cr,{sk:"total",current:h,dir:g,onSort:lr(y,b,g),align:"right",children:"total"}),d.jsx("th",{className:"py-2 pl-3 pr-5 text-right",children:"dist"})]})}),d.jsx("tbody",{className:"font-mono",children:p.map(S=>d.jsxs("tr",{className:"border-b border-line/40 transition-colors hover:bg-surface-rowHover/50",children:[d.jsx("td",{className:"truncate py-1.5 pl-5 pr-3 text-ink-primary",title:S.method,children:S.method}),d.jsx("td",{className:"px-3 py-1.5 text-ink-muted",children:d.jsx(NP,{kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-primary",children:d.jsx(jP,{count:S.count,max:m,kind:S.kind})}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p50!==null?Vt(S.p50):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.p99!==null?Vt(S.p99):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.max!==null?Vt(S.max):"—"}),d.jsx("td",{className:"px-3 py-1.5 text-right text-ink-secondary",children:S.totalLatencyMs!==null?Vt(S.totalLatencyMs):"—"}),d.jsx("td",{className:"py-1.5 pl-3 pr-5 text-right",children:S.latencies.length>0?d.jsx(dP,{values:S.latencies,width:88,height:14,className:"text-accent-info",title:`${S.method} latency distribution`}):d.jsx("span",{className:"text-ink-dim",children:"—"})})]},`${S.kind}:${S.method}`))})]})}),o.length>0&&d.jsxs("div",{className:"flex h-[260px] shrink-0 flex-col border-t border-line bg-surface-elev",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line bg-surface-base px-5 py-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("div",{className:"flex min-w-0 items-baseline gap-2 truncate",children:[d.jsx("span",{children:"timeline — wall-clock waterfall"}),d.jsx("span",{className:"text-ink-dim",children:"· drag to pan · Cmd/Ctrl + wheel zoom · click to inspect"})]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[d.jsxs("span",{className:"text-ink-secondary",children:[a.toFixed(a<1?2:1),"×"]}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.zoomOut()},className:"inline-flex h-5 w-5 items-center justify-center rounded-sm border border-line hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Zoom out",title:"Zoom out",children:"−"}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.zoomIn()},className:"inline-flex h-5 w-5 items-center justify-center rounded-sm border border-line hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Zoom in",title:"Zoom in",children:"+"}),d.jsx("button",{type:"button",onClick:()=>{var S;return(S=s.current)==null?void 0:S.reset()},className:"inline-flex h-5 items-center justify-center rounded-sm border border-line px-2 hover:bg-surface-rowHover hover:text-ink-primary","aria-label":"Reset zoom and pan",title:"Reset zoom and pan to defaults",children:"reset"})]})]}),d.jsx("div",{className:"flex-1",children:d.jsx(hP,{messages:o,controlsRef:s,onZoomChange:l,onSelectSeq:S=>{n?n(S):(i(S),t())}})})]})]})]})}):null}const $P={hotspot:"●","long-tail":"▲",outlier:"◆",busiest:"■",errors:"✗"},kP={hotspot:"text-accent-warn","long-tail":"text-accent-warn",outlier:"text-accent-warn",busiest:"text-accent-info",errors:"text-accent-error"},TP={hotspot:"hotspot","long-tail":"long tail",outlier:"outlier",busiest:"busiest",errors:"errors"};function _P({insights:e}){return d.jsxs("div",{className:"border-b border-line bg-surface-base px-5 py-2.5",children:[d.jsx("div",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"insights"}),d.jsx("ul",{className:"space-y-1.5",children:e.map(t=>d.jsxs("li",{className:"flex items-start gap-2",children:[d.jsx("span",{"aria-hidden":!0,className:K("mt-[3px] inline-block text-[9px] leading-none",kP[t.kind]),children:$P[t.kind]}),d.jsx("div",{className:"min-w-[68px] font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:TP[t.kind]}),d.jsxs("div",{className:"flex-1 text-[11px] leading-snug",children:[d.jsx("div",{className:"text-ink-primary",children:t.summary}),t.detail&&d.jsx("div",{className:"text-[10px] text-ink-muted",children:t.detail})]})]},t.kind))})]})}function jP({count:e,max:t,kind:n}){const o=t>0?e/t*100:0,r=n==="request"?"bg-accent-out/15":"bg-accent-note/15";return d.jsxs("div",{className:"relative inline-block w-[44px] text-right",children:[d.jsx("div",{"aria-hidden":!0,className:K("absolute inset-y-[1px] right-0 rounded-sm",r),style:{width:`${o}%`}}),d.jsx("span",{className:"relative",children:e})]})}function lr(e,t,n){return(o,r)=>{r?t(n==="asc"?"desc":"asc"):(e(o),t(o==="method"?"asc":"desc"))}}function cr({sk:e,current:t,dir:n,onSort:o,align:r="left",className:i,children:s}){const a=t===e;return d.jsxs("th",{className:K("cursor-pointer select-none px-3 py-2 transition-colors hover:text-ink-primary",r==="right"?"text-right":"",a?"text-ink-primary":"",i),onClick:()=>o(e,a),"aria-sort":a?n==="asc"?"ascending":"descending":"none",children:[d.jsx("span",{children:s}),a&&d.jsx("span",{className:"ml-1 text-accent-warn",children:n==="asc"?"↑":"↓"})]})}function NP({kind:e}){const t=e==="request"?"text-accent-out":"text-accent-note",n=e==="request"?"req":"ntf";return d.jsx("span",{className:K("text-[10px] uppercase tracking-widest",t),title:e,children:n})}function CP(e){let t=0,n=0,o=0;for(const r of e)r.kind==="request"?t+=r.count:n+=r.count,o+=r.sampleSize;return{methods:e.length,requests:t,notifications:n,samples:o}}function EP(e,t,n){const o=n==="asc"?1:-1,r=[...e];return r.sort((i,s)=>{const a=Dh(i,t),l=Dh(s,t);return a===null&&l!==null?1:a!==null&&l===null?-1:t==="method"?o*i.method.localeCompare(s.method):a===null||l===null?0:o*(a-l)}),r}function Dh(e,t){switch(t){case"method":return 0;case"count":return e.count;case"p50":return e.p50;case"p99":return e.p99;case"max":return e.max;case"total":return e.totalLatencyMs}}const lf=["raw.githubusercontent.com","gist.githubusercontent.com"];function Yb(e){try{return{ok:!0,export:UC(e)}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}}function PP(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:lf.includes(t.host)}async function IP(e){if(!PP(e))return{ok:!1,error:`host not in playground allowlist (${lf.join(", ")})`};let t;try{t=await fetch(e,{redirect:"follow"})}catch(o){return{ok:!1,error:`fetch failed: ${o instanceof Error?o.message:String(o)}`}}if(!t.ok)return{ok:!1,error:`HTTP ${t.status} ${t.statusText}`};const n=await t.text();return Yb(n)}function OP({initialUrl:e=null}){const[t,n]=P.useState(null),[o,r]=P.useState(e!==null),[i,s]=P.useState(!1),[a,l]=P.useState(""),c=P.useRef(null),f=(b,v)=>{b.ok?(ne.getState().loadFromExport(b.export),n(null)):n(`${v}: ${b.error}`),r(!1)},m=async b=>{r(!0),n(null);try{const v=await b.text();f(Yb(v),b.name)}catch(v){n(`${b.name}: ${v instanceof Error?v.message:String(v)}`),r(!1)}},h=async b=>{r(!0),n(null),f(await IP(b),b)},y=P.useRef(e);if(y.current!==null){const b=y.current;y.current=null,h(b)}const g=b=>{var u;b.preventDefault(),s(!1);const v=(u=b.dataTransfer.files)==null?void 0:u[0];v&&m(v)};return d.jsx("div",{className:"flex h-full w-full items-center justify-center bg-grid",children:d.jsxs("div",{className:"relative w-[min(720px,92%)] rounded-md border border-line bg-surface-elev/80 p-6 backdrop-blur-sm",children:[d.jsxs("div",{className:"mb-1 flex items-baseline gap-3",children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:"acp.devtools"}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"playground"})]}),d.jsx("h2",{className:"font-display text-2xl uppercase tracking-tight text-ink-primary",children:"Drop an exported session"}),d.jsxs("p",{className:"mt-2 font-sans text-sm leading-relaxed text-ink-secondary",children:["The playground renders ACP session exports client-side. Nothing leaves your browser. Generate exports with ",d.jsx("code",{className:"font-mono",children:"acp-devtools export <id>"})," ","— auth headers and proxy tokens are redacted by default."]}),d.jsxs("div",{role:"button",tabIndex:0,"aria-label":"Drop session export here or click to pick a file",onClick:()=>{var b;return(b=c.current)==null?void 0:b.click()},onKeyDown:b=>{var v;(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),(v=c.current)==null||v.click())},onDragOver:b=>{b.preventDefault(),s(!0)},onDragLeave:()=>s(!1),onDrop:g,className:K("mt-5 flex h-40 cursor-pointer flex-col items-center justify-center rounded-md border-2 border-dashed text-center transition-colors",i?"border-accent-out bg-accent-out/10":"border-line bg-surface-base/40 hover:border-ink-muted"),children:[d.jsx("span",{className:"font-display text-sm uppercase tracking-[0.18em] text-ink-muted",children:o?"Loading…":"Drop .json here"}),d.jsx("span",{className:"mt-1 font-mono text-[11px] text-ink-dim",children:"or click to pick a file"}),d.jsx("input",{ref:c,type:"file",accept:".json,application/json",className:"hidden",onChange:b=>{var u;const v=(u=b.target.files)==null?void 0:u[0];v&&m(v),b.target.value=""}})]}),d.jsxs("form",{className:"mt-4 flex items-center gap-2",onSubmit:b=>{b.preventDefault();const v=a.trim();v&&h(v)},children:[d.jsx("input",{type:"url",value:a,onChange:b=>l(b.target.value),placeholder:"https://raw.githubusercontent.com/…/session.json",className:"flex-1 rounded-sm border border-line bg-surface-base px-3 py-2 font-mono text-[12px] text-ink-primary outline-none focus:border-ink-muted","aria-label":"Load session from URL"}),d.jsx("button",{type:"submit",disabled:o||a.trim().length===0,className:"rounded-sm border border-line bg-surface-base px-3 py-2 font-display text-[11px] uppercase tracking-widest text-ink-secondary transition-colors hover:border-ink-muted disabled:cursor-not-allowed disabled:opacity-50",children:"Load"})]}),d.jsxs("p",{className:"mt-2 font-mono text-[10px] leading-relaxed text-ink-dim",children:["URL allowlist: ",lf.join(", "),". Gists are public — don't use this for anything you wouldn't post on Twitter."]}),t&&d.jsx("p",{className:"mt-3 font-mono text-[11px] text-accent-error",children:t})]})})}const RP=[.5,1,2,4,8];function AP(){const e=ne(h=>h.messages),t=ne(h=>h.playback),n=ne(h=>h.setPlaybackCap),o=ne(h=>h.setPlaying),r=ne(h=>h.setPlaybackSpeed),i=e.length>0?e[0].seq:0,s=e.length>0?e[e.length-1].seq:0,a=t.cap??s,l=a>=s,c=P.useRef(null);if(P.useEffect(()=>{if(!t.playing)return;if(l){o(!1);return}const h=e.findIndex(u=>u.seq===a),y=e[h+1];if(!y){o(!1);return}const g=e[h],b=g?y.timestamp-g.timestamp:0,v=Math.max(15,Math.min(1500,b/t.speed));return c.current=setTimeout(()=>{n(y.seq)},v),()=>{c.current&&(clearTimeout(c.current),c.current=null)}},[t.playing,t.speed,a,e,l,n,o]),e.length===0)return null;const f=h=>{h>=s?n(null):n(h),t.playing&&o(!1)},m=()=>{l?(n(i),o(!0)):o(!t.playing)};return d.jsxs("div",{className:"flex items-center gap-3 border-t border-line bg-surface-elev/70 px-4 py-2 font-mono text-[11px]",children:[d.jsx("button",{type:"button",onClick:m,className:K("inline-flex h-6 w-12 items-center justify-center rounded-sm border font-semibold uppercase tracking-widest transition-colors",t.playing?"border-accent-warn/50 bg-accent-warn/10 text-accent-warn":"border-accent-out/50 bg-accent-out/10 text-accent-out"),title:t.playing?"pause":l?"restart playback":"play",children:t.playing?"❚❚":l?"↺":"▶"}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-secondary",children:[String(a).padStart(3,"0")," / ",String(s).padStart(3,"0")]}),d.jsx("input",{type:"range",min:i,max:s,value:a,onChange:h=>f(Number(h.target.value)),className:"h-1 flex-1 cursor-pointer accent-accent-out"}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:RP.map(h=>d.jsxs("button",{type:"button",onClick:()=>r(h),className:K("rounded-sm border px-1.5 py-0.5 text-[10px] uppercase tracking-widest transition-colors",t.speed===h?"border-accent-out/50 bg-accent-out/10 text-accent-out":"border-line text-ink-muted hover:border-line-strong hover:text-ink-secondary"),title:`${h}× speed`,children:[h,"×"]},h))}),d.jsx("button",{type:"button",onClick:()=>{n(null),o(!1)},className:"rounded-sm border border-line px-2 py-0.5 text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:border-line-strong hover:text-ink-secondary",title:"show all messages, exit playback",children:"show all"})]})}function Xb(e=5e3){const[t,n]=P.useState(()=>Date.now());return P.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function MP({open:e,onClose:t}){const n=ne(a=>a.session),o=ne(a=>a.messages),r=P.useMemo(()=>cl(o),[o]),{rendered:i,visible:s}=rf(e);return P.useEffect(()=>{if(!e)return;const a=l=>{l.key==="Escape"&&(l.preventDefault(),t())};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[e,t]),i?d.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Session info",className:K("fixed inset-0 z-[100] flex items-start justify-end bg-black/60 backdrop-blur-sm transition-opacity duration-200 ease-out",s?"opacity-100":"opacity-0"),onMouseDown:a=>{a.target===a.currentTarget&&t()},children:d.jsxs("div",{className:K("flex h-full w-full max-w-[440px] flex-col border-l border-line bg-surface-base shadow-2xl transition-transform duration-200 ease-out",s?"translate-x-0":"translate-x-full"),children:[d.jsxs("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[d.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:"Session info"}),d.jsx("button",{type:"button",onClick:t,className:"font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors hover:text-ink-primary","aria-label":"Close session info panel",children:"close"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:n?d.jsx(qP,{session:n,meta:r,messages:o}):d.jsx("div",{className:"font-mono text-[11px] text-ink-muted",children:"No session attached."})})]})}):null}function qP({session:e,meta:t,messages:n}){const o=Xb(5e3),{primary:r}=Ul(e),i=P.useMemo(()=>LP(n),[n]);return d.jsxs("div",{className:"space-y-5 text-[12px]",children:[d.jsxs(xi,{title:"Summary",children:[d.jsx(mn,{label:"Session",value:r}),d.jsx(mn,{label:"Client",value:t.client.title||t.client.name||e.clientName||"—",secondary:t.client.version?`v${t.client.version}${t.client.platform?` · ${t.client.platform}`:""}`:null}),d.jsx(mn,{label:"Agent",value:t.agent.name||UP(e.agentCommand)||"—",secondary:t.agent.version?`v${t.agent.version}`:null}),d.jsx(mn,{label:"Protocol",value:t.protocolVersion!==null?`ACP v${t.protocolVersion}`:"—"}),d.jsx(mn,{label:"Started",value:_a(e.startedAt,o)}),d.jsx(mn,{label:"Messages",value:`${n.length} (req ${i.req} · rsp ${i.rsp} · ntf ${i.note} · err ${i.err})`})]}),d.jsxs(xi,{title:"Client capabilities",children:[d.jsx(No,{label:"fs.readTextFile",enabled:t.clientCapabilities.fsReadTextFile}),d.jsx(No,{label:"fs.writeTextFile",enabled:t.clientCapabilities.fsWriteTextFile}),d.jsx(No,{label:"terminal",enabled:t.clientCapabilities.terminal}),d.jsx(No,{label:"auth.terminal",enabled:t.clientCapabilities.authTerminal}),d.jsx(No,{label:"auth.gateway",enabled:t.clientCapabilities.authGateway})]}),d.jsxs(xi,{title:"Agent capabilities",children:[d.jsx(No,{label:"prompt",enabled:t.agentCapabilities.prompt}),d.jsx(No,{label:"loadSession",enabled:t.agentCapabilities.loadSession}),d.jsx(mn,{label:"Auth methods",value:String(t.agent.authMethods)})]}),d.jsxs(xi,{title:"Runtime state",children:[d.jsx(mn,{label:"Mode",value:t.runtime.currentMode??"—",secondary:t.runtime.modeChanges>0?`changed ${t.runtime.modeChanges}× this session`:null}),d.jsx(mn,{label:"Model",value:t.runtime.currentModel??"—",secondary:t.runtime.modelChanges>0?`changed ${t.runtime.modelChanges}× this session`:null}),d.jsx(mn,{label:"Commands",value:t.runtime.availableCommands.length>0?t.runtime.availableCommands.join(", "):"—",wrap:!0})]}),t.extensions.jetbrainsProxyConfig!==null&&d.jsx(xi,{title:"JetBrains extensions",children:d.jsx("div",{className:"rounded-sm border border-line bg-surface-elev p-3 font-mono text-[11px] text-ink-secondary",children:d.jsx(al,{value:t.extensions.jetbrainsProxyConfig})})})]})}function UP(e){if(!e)return null;const t=e.trim().split(/\s+/);if(t[0]==="npx")for(let n=1;n<t.length;n++){const o=t[n];if(!o.startsWith("-"))return o}return t[0]??null}function LP(e){let t=0,n=0,o=0,r=0;for(const i of e)i.kind==="request"?t++:i.kind==="response"?n++:i.kind==="notification"?o++:i.kind==="error"&&r++;return{req:t,rsp:n,note:o,err:r}}function xi({title:e,children:t}){return d.jsxs("div",{children:[d.jsx("h3",{className:"mb-2 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("div",{className:"space-y-1.5",children:t})]})}function mn({label:e,value:t,secondary:n,wrap:o=!1}){return d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsxs("span",{className:K("flex-1 text-ink-primary",o?"whitespace-normal break-words":"truncate"),title:o?void 0:t,children:[t,n&&d.jsx("span",{className:"ml-2 text-[10px] text-ink-muted",children:n})]})]})}function No({label:e,enabled:t}){return d.jsxs("div",{className:"flex items-baseline gap-3",children:[d.jsx("span",{className:"w-[120px] shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e}),d.jsx("span",{className:K("flex-1 font-mono text-[11px]",t?"text-accent-ok":"text-ink-dim"),children:t?"✓ enabled":"— not advertised"})]})}function DP({left:e,right:t,storageKey:n,initialLeftFraction:o=.6,minLeft:r=320,minRight:i=320}){const s=P.useRef(null),[a,l]=P.useState(null),c=P.useRef(!1);P.useEffect(()=>{if(!s.current)return;const y=s.current.clientWidth,g=n?Number(localStorage.getItem(n)):NaN;n&&Number.isFinite(g)&&g>0&&g<y?l(g):l(Math.round(y*o))},[o,n]);const f=P.useCallback(y=>{y.preventDefault(),c.current=!0,y.currentTarget.setPointerCapture(y.pointerId)},[]),m=P.useCallback(y=>{if(!c.current||!s.current)return;const g=s.current.getBoundingClientRect(),b=y.clientX-g.left,v=g.width,u=Math.min(Math.max(b,r),v-i);l(u),n&&localStorage.setItem(n,String(Math.round(u)))},[r,i,n]),h=P.useCallback(y=>{c.current=!1;try{y.currentTarget.releasePointerCapture(y.pointerId)}catch{}},[]);return d.jsxs("div",{ref:s,className:"flex h-full w-full overflow-hidden",children:[d.jsx("div",{style:{width:a??"60%"},className:"flex h-full min-w-0 flex-col",children:e}),d.jsx("div",{role:"separator","aria-orientation":"vertical",className:K("group relative w-px shrink-0 cursor-col-resize bg-line",'before:absolute before:inset-y-0 before:-left-1 before:-right-1 before:content-[""]'),onPointerDown:f,onPointerMove:m,onPointerUp:h,onPointerCancel:h,children:d.jsx("div",{className:"absolute inset-y-0 left-0 w-px bg-line transition-colors group-hover:bg-accent-out/40"})}),d.jsx("div",{className:"flex h-full min-w-0 flex-1 flex-col",children:t})]})}function zP(){const e=ne(n=>n.messages),t=P.useMemo(()=>{let n=0,o=0,r=0,i=0,s=0;const a=new Map;for(const y of e)switch(a.set(y.seq,y.timestamp),s+=y.raw.length,y.kind){case"request":n+=1;break;case"response":o+=1;break;case"notification":r+=1;break;case"error":i+=1;break}const l=Cl(e),c=[];for(const y of e){if(y.kind!=="response"&&y.kind!=="error")continue;const g=l.get(y.seq);if(g===void 0)continue;const b=a.get(g);b!==void 0&&c.push(y.timestamp-b)}c.sort((y,g)=>y-g);const f=c.length?xh(c,50):null,m=c.length?xh(c,99):null,h=VN(ef(e));return{total:e.length,req:n,res:o,note:r,err:i,bytes:s,p50:f,p99:m,spec:h}},[e]);return d.jsxs("footer",{className:"flex items-center justify-between gap-6 border-t border-line bg-surface-elev/80 px-5 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:[d.jsxs("div",{className:"flex items-center gap-5",children:[d.jsx(Yn,{label:"msgs",value:t.total,tone:"primary"}),d.jsx(Yn,{label:"req",value:t.req,tone:"out"}),d.jsx(Yn,{label:"rsp",value:t.res,tone:"in"}),d.jsx(Yn,{label:"ntf",value:t.note,tone:"note"}),d.jsx(Yn,{label:"err",value:t.err,tone:t.err>0?"error":"muted"})]}),d.jsxs("div",{className:"flex items-center gap-5",children:[d.jsx(Yn,{label:"p50",value:t.p50!==null?Vt(t.p50):"—",tone:"primary"}),d.jsx(Yn,{label:"p99",value:t.p99!==null?Vt(t.p99):"—",tone:"primary"}),d.jsx(Yn,{label:"bytes",value:t.total>0?Ll(t.bytes):"—",tone:"primary"}),t.spec.checked>0&&d.jsx(BP,{invalidFrames:t.spec.invalidFrames,totalErrors:t.spec.totalErrors,affectedMethods:t.spec.affectedMethods}),d.jsx(FP,{})]})]})}function FP(){return d.jsxs("a",{href:"https://github.com/maksugr/acp-devtools",target:"_blank",rel:"noreferrer noopener",title:"Enjoying acp-devtools? Star it on GitHub — thank you!","aria-label":"Star acp-devtools on GitHub",className:"inline-flex items-baseline gap-1 text-ink-muted transition-colors hover:text-accent-warn focus-visible:text-accent-warn focus-visible:outline-none",children:[d.jsx("span",{"aria-hidden":"true",className:"text-[10px]",children:"★"}),d.jsx("span",{className:"text-[9px] tracking-normal",children:"Star on GitHub"})]})}function BP({invalidFrames:e,totalErrors:t,affectedMethods:n}){if(e===0)return d.jsx(us,{label:d.jsx("span",{className:"font-sans",children:"every frame validates against the ACP schema"}),tone:"info",children:d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:"spec"}),d.jsx("span",{className:"text-accent-ok",children:"✓"})]})});const o=`${t} schema error${t===1?"":"s"} in ${e} frame${e===1?"":"s"}`;return d.jsx(us,{tone:"warn",label:d.jsxs("div",{className:"space-y-1.5 font-sans",children:[d.jsx("div",{children:o}),n.length>0&&d.jsxs("div",{className:"font-mono text-[10px] text-ink-muted",children:["methods: ",n.join(", ")]})]}),children:d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:"spec"}),d.jsxs("span",{className:"text-accent-error",children:["⚠ ",e]})]})})}function Yn({label:e,value:t,tone:n}){const o=n==="primary"?"text-ink-primary":n==="out"?"text-accent-out":n==="in"?"text-accent-in":n==="note"?"text-accent-note":n==="error"?"text-accent-error":"text-ink-muted";return d.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[d.jsx("span",{children:e}),d.jsx("span",{className:o,children:t})]})}const Fl=0,$o=1,ni=2,Zb=4;function zh(e){return()=>e}function HP(e){e()}function ex(e,t){return n=>e(t(n))}function Fh(e,t){return()=>e(t)}function VP(e,t){return n=>e(t,n)}function cf(e){return e!==void 0}function WP(...e){return()=>{e.map(HP)}}function oi(){}function Bl(e,t){return t(e),e}function KP(e,t){return t(e)}function Ue(...e){return e}function $e(e,t){return e($o,t)}function me(e,t){e(Fl,t)}function df(e){e(ni)}function Le(e){return e(Zb)}function oe(e,t){return $e(e,VP(t,Fl))}function cn(e,t){const n=e($o,o=>{n(),t(o)});return n}function Bh(e){let t,n;return o=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{o(t)},e)}}function tx(e,t){return e===t}function Me(e=tx){let t;return n=>o=>{e(t,o)||(t=o,n(o))}}function ae(e){return t=>n=>{e(n)&&t(n)}}function X(e){return t=>ex(t,e)}function yn(e){return t=>()=>{t(e)}}function z(e,...t){const n=GP(...t);return(o,r)=>{switch(o){case ni:df(e);return;case $o:return $e(e,n(r))}}}function Sn(e,t){return n=>o=>{n(t=e(t,o))}}function Qo(e){return t=>n=>{e>0?e--:t(n)}}function On(e){let t=null,n;return o=>r=>{t=r,!n&&(n=setTimeout(()=>{n=void 0,o(t)},e))}}function he(...e){const t=new Array(e.length);let n=0,o=null;const r=2**e.length-1;return e.forEach((i,s)=>{const a=2**s;$e(i,l=>{const c=n;n|=a,t[s]=l,c!==r&&n===r&&o&&(o(),o=null)})}),i=>s=>{const a=()=>{i([s].concat(t))};n===r?a():o=a}}function GP(...e){return t=>e.reduceRight(KP,t)}function JP(e){let t,n;const o=()=>t==null?void 0:t();return function(r,i){switch(r){case $o:return i?n===i?void 0:(o(),n=i,t=$e(e,i),t):(o(),oi);case ni:o(),n=null;return}}}function W(e){let t=e;const n=ve();return(o,r)=>{switch(o){case Fl:t=r;break;case $o:{r(t);break}case Zb:return t}return n(o,r)}}function yt(e,t){return Bl(W(t),n=>oe(e,n))}function ve(){const e=[];return(t,n)=>{switch(t){case Fl:e.slice().forEach(o=>{o(n)});return;case ni:e.splice(0,e.length);return;case $o:return e.push(n),()=>{const o=e.indexOf(n);o>-1&&e.splice(o,1)}}}}function Mt(e){return Bl(ve(),t=>oe(e,t))}function xe(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:QP(),singleton:n}}const QP=()=>Symbol();function YP(e){const t=new Map,n=({constructor:o,dependencies:r,id:i,singleton:s})=>{if(s&&t.has(i))return t.get(i);const a=o(r.map(l=>n(l)));return s&&t.set(i,a),a};return n(e)}function Qe(...e){const t=ve(),n=new Array(e.length);let o=0;const r=2**e.length-1;return e.forEach((i,s)=>{const a=2**s;$e(i,l=>{n[s]=l,o|=a,o===r&&me(t,n)})}),function(i,s){switch(i){case ni:{df(t);return}case $o:return o===r&&s(n),$e(t,s)}}}function se(e,t=tx){return z(e,Me(t))}function Bd(...e){return function(t,n){switch(t){case ni:return;case $o:return WP(...e.map(o=>$e(o,n)))}}}const nt={DEBUG:0,INFO:1,WARN:2,ERROR:3},XP={[nt.DEBUG]:"debug",[nt.ERROR]:"error",[nt.INFO]:"log",[nt.WARN]:"warn"},ZP=()=>typeof globalThis>"u"?window:globalThis,ko=xe(()=>{const e=W(nt.ERROR);return{log:W((t,n,o=nt.INFO)=>{const r=ZP().VIRTUOSO_LOG_LEVEL??Le(e);o>=r&&console[XP[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),Hd=new WeakMap;function nx(e){return"self"in e?e.document.documentElement:e}function eI(e){const t=nx(e),n=Hd.get(t);if(n!==void 0)return n;const o=t.ownerDocument.defaultView.getComputedStyle(t).direction==="rtl";return Hd.set(t,o),o}function Hh(e){Hd.delete(nx(e))}function ox(e,t){return eI(e)?-t:t}const Lo=ox;function Vh(e,t){return ox(e,t)}function Zo(e,t,n){return uf(e,t,n).callbackRef}function uf(e,t,n){const o=te.useRef(null);let r=s=>{};const i=te.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(s=>{const a=()=>{const l=s[0].target;l.offsetParent!==null&&e(l)};n?a():requestAnimationFrame(a)}):null,[e,n]);return r=s=>{s&&t?(i==null||i.observe(s),o.current=s):(o.current&&(i==null||i.unobserve(o.current)),o.current=null)},{callbackRef:r,ref:o}}function tI(e,t,n,o,r,i,s,a,l){const c=te.useCallback(f=>{const m=nI(f.children,t,a?"offsetWidth":"offsetHeight",r);let h=f.parentElement;for(;h.dataset.virtuosoScroller===void 0;)h=h.parentElement;const y=h.lastElementChild.dataset.viewportType==="window";let g;y&&(g=h.ownerDocument.defaultView);const b=s?a?s.scrollWidth:s.scrollHeight:y?a?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight:a?h.scrollWidth:h.scrollHeight,v=s?a?s.offsetWidth:s.offsetHeight:y?a?g.innerWidth:g.innerHeight:a?h.offsetWidth:h.offsetHeight,u=s?a?Lo(s,s.scrollLeft):s.scrollTop:y?a?Lo(g,g.scrollX||g.document.documentElement.scrollLeft):g.scrollY||g.document.documentElement.scrollTop:a?Lo(h,h.scrollLeft):h.scrollTop;o({scrollHeight:b,scrollTop:Math.max(u,0),viewportHeight:v}),i==null||i(a?Wh("column-gap",getComputedStyle(f).columnGap,r):Wh("row-gap",getComputedStyle(f).rowGap,r)),m!==null&&e(m)},[e,t,r,i,s,o,a]);return uf(c,n,l)}function nI(e,t,n,o){const r=e.length;if(r===0)return null;const i=[];for(let s=0;s<r;s++){const a=e.item(s);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),f=t(a,n);if(f===0&&o("Zero-sized element, this should not happen",{child:a},nt.ERROR),f===c)continue;const m=i[i.length-1];i.length===0||m.size!==f||m.endIndex!==l-1?i.push({endIndex:l,size:f,startIndex:l}):i[i.length-1].endIndex++}return i}function Wh(e,t,n){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&n(`${e} was not resolved to pixel value correctly`,t,nt.WARN),t==="normal"?0:parseInt(t??"0",10)}function rx(e,t,n){const o=te.useRef(null),r=te.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),f=c.width;let m,h;if(t){const y=t.getBoundingClientRect(),g=c.top-y.top;h=y.height-Math.max(0,g),m=g+t.scrollTop}else{const y=s.current.ownerDocument.defaultView;h=y.innerHeight-Math.max(0,c.top),m=c.top+y.scrollY}o.current={listHeight:c.height,offsetTop:m,visibleHeight:h,visibleWidth:f},e(o.current)},[e,t]),{callbackRef:i,ref:s}=uf(r,!0,n),a=te.useCallback(()=>{r(s.current)},[r,s]);return te.useEffect(()=>{var c;if(t){t.addEventListener("scroll",a);const f=new ResizeObserver(()=>{requestAnimationFrame(a)});return f.observe(t),()=>{t.removeEventListener("scroll",a),f.unobserve(t)}}const l=(c=s.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,t,s]),i}const kt=xe(()=>{const e=ve(),t=ve(),n=W(0),o=ve(),r=W(0),i=ve(),s=ve(),a=W(0),l=W(0),c=W(0),f=W(0),m=ve(),h=ve(),y=W(!1),g=W(!1),b=W(!1);return oe(z(e,X(({scrollTop:v})=>v)),t),oe(z(e,X(({scrollHeight:v})=>v)),s),oe(t,r),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:f,headerHeight:a,horizontalDirection:g,scrollBy:h,scrollContainerState:e,scrollHeight:s,scrollingInProgress:y,scrollTo:m,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:i}},[],{singleton:!0}),hs={lvl:0};function ix(e,t){const n=e.length;if(n===0)return[];let{index:o,value:r}=t(e[0]);const i=[];for(let s=1;s<n;s++){const{index:a,value:l}=t(e[s]);i.push({end:a-1,start:o,value:r}),o=a,r=l}return i.push({end:1/0,start:o,value:r}),i}function Te(e){return e===hs}function ys(e,t){if(!Te(e))return t===e.k?e.v:t<e.k?ys(e.l,t):ys(e.r,t)}function un(e,t,n="k"){if(Te(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const o=un(e.r,t,n);return o[0]===-1/0?[e.k,e.v]:o}return un(e.l,t,n)}function It(e,t,n){return Te(e)?lx(t,n,1):t===e.k?Ze(e,{k:t,v:n}):t<e.k?Kh(Ze(e,{l:It(e.l,t,n)})):Kh(Ze(e,{r:It(e.r,t,n)}))}function Mr(){return hs}function qr(e,t,n){if(Te(e))return[];const o=un(e,t)[0];return oI(Wd(e,o,n))}function Vd(e,t){if(Te(e))return hs;const{k:n,l:o,r}=e;if(t===n){if(Te(o))return r;if(Te(r))return o;const[i,s]=ax(o);return Na(Ze(e,{k:i,l:sx(o),v:s}))}return t<n?Na(Ze(e,{l:Vd(o,t)})):Na(Ze(e,{r:Vd(r,t)}))}function Do(e){return Te(e)?[]:[...Do(e.l),{k:e.k,v:e.v},...Do(e.r)]}function Wd(e,t,n){if(Te(e))return[];const{k:o,l:r,r:i,v:s}=e;let a=[];return o>t&&(a=a.concat(Wd(r,t,n))),o>=t&&o<=n&&a.push({k:o,v:s}),o<=n&&(a=a.concat(Wd(i,t,n))),a}function Na(e){const{l:t,lvl:n,r:o}=e;if(o.lvl>=n-1&&t.lvl>=n-1)return e;if(n>o.lvl+1){if(_c(t))return cx(Ze(e,{lvl:n-1}));if(!Te(t)&&!Te(t.r))return Ze(t.r,{l:Ze(t,{r:t.r.l}),lvl:n,r:Ze(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(_c(e))return Kd(Ze(e,{lvl:n-1}));if(!Te(o)&&!Te(o.l)){const r=o.l,i=_c(r)?o.lvl-1:o.lvl;return Ze(r,{l:Ze(e,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Kd(Ze(o,{l:r.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Ze(e,t){return lx(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function sx(e){return Te(e.r)?e.l:Na(Ze(e,{r:sx(e.r)}))}function _c(e){return Te(e)||e.lvl>e.r.lvl}function ax(e){return Te(e.r)?[e.k,e.v]:ax(e.r)}function lx(e,t,n,o=hs,r=hs){return{k:e,l:o,lvl:n,r,v:t}}function Kh(e){return Kd(cx(e))}function cx(e){const{l:t}=e;return!Te(t)&&t.lvl===e.lvl?Ze(t,{r:Ze(e,{l:t.r})}):e}function Kd(e){const{lvl:t,r:n}=e;return!Te(n)&&!Te(n.r)&&n.lvl===t&&n.r.lvl===t?Ze(n,{l:Ze(e,{r:n.l}),lvl:t+1}):e}function oI(e){return ix(e,({k:t,v:n})=>({index:t,value:n}))}function dx(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function gs(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const pf=xe(()=>({recalcInProgress:W(!1)}),[],{singleton:!0});function ux(e,t,n){return e[ul(e,t,n)]}function ul(e,t,n,o=0){let r=e.length-1;for(;o<=r;){const i=Math.floor((o+r)/2),s=e[i],a=n(s,t);if(a===0)return i;if(a===-1){if(r-o<2)return i-1;r=i-1}else{if(r===o)return i;o=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function rI(e,t,n,o){const r=ul(e,t,o),i=ul(e,n,o,r);return e.slice(r,i+1)}function bo(e,t){return Math.round(e.getBoundingClientRect()[t])}function Hl(e){return!Te(e.groupOffsetTree)}function ff({index:e},t){return t===e?0:t<e?-1:1}function iI(){return{groupIndices:[],groupOffsetTree:Mr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Mr()}}function sI(e,t){let n=Te(e)?0:1/0;for(const o of t){const{endIndex:r,size:i,startIndex:s}=o;if(n=Math.min(n,s),Te(e)){e=It(e,0,i);continue}const a=qr(e,s-1,r+1);if(a.some(fI(o)))continue;let l=!1,c=!1;for(const{end:f,start:m,value:h}of a)l?(r>=m||i===h)&&(e=Vd(e,m)):(c=h!==i,l=!0),f>r&&r>=m&&h!==i&&(e=It(e,r+1,h));c&&(e=It(e,s,i))}return[e,n]}function aI(e){return typeof e.groupIndex<"u"}function lI({offset:e},t){return t===e?0:t<e?-1:1}function vs(e,t,n){if(t.length===0)return 0;const{index:o,offset:r,size:i}=ux(t,e,ff),s=e-o,a=i*s+(s-1)*n+r;return a>0?a+n:a}function px(e,t){if(!Hl(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function fx(e,t,n){if(aI(e))return t.groupIndices[e.groupIndex]+1;const o=e.index==="LAST"?n:e.index;let r=px(o,t);return r=Math.max(0,r,Math.min(n,r)),r}function cI(e,t,n,o=0){return o>0&&(t=Math.max(t,ux(e,o,ff).offset)),ix(rI(e,t,n,lI),pI)}function dI(e,[t,n,o,r]){t.length>0&&o("received item sizes",t,nt.DEBUG);const i=e.sizeTree;let s=i,a=0;if(n.length>0&&Te(i)&&t.length===2){const h=t[0].size,y=t[1].size;s=n.reduce((g,b)=>It(It(g,b,h),b+1,y),s)}else[s,a]=sI(s,t);if(s===i)return e;const{lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m}=Gd(e.offsetTree,a,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,y)=>It(h,y,vs(y,m,r)),Mr()),lastIndex:l,lastOffset:c,lastSize:f,offsetTree:m,sizeTree:s}}function uI(e){return Do(e).map(({k:t,v:n},o,r)=>{const i=r[o+1];return{endIndex:i!==void 0?i.k-1:1/0,size:n,startIndex:t}})}function Gh(e,t){let n=0,o=0;for(;n<e;)n+=t[o+1]-t[o]-1,o++;return o-(n===e?0:1)}function Gd(e,t,n,o){let r=e,i=0,s=0,a=0,l=0;if(t!==0){l=ul(r,t-1,ff),a=r[l].offset;const c=un(n,t-1);i=c[0],s=c[1],r.length&&r[l].size===un(n,t)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:c,value:f}of qr(n,t,1/0)){const m=c-i,h=m*s+a+m*o;r.push({index:c,offset:h,size:f}),i=c,a=h,s=f}return{lastIndex:i,lastOffset:a,lastSize:s,offsetTree:r}}function pI(e){return{index:e.index,value:e}}function fI(e){const{endIndex:t,size:n,startIndex:o}=e;return r=>r.start===o&&(r.end===t||r.end===1/0)&&r.value===n}const mI={offsetHeight:"height",offsetWidth:"width"},Tn=xe(([{log:e},{recalcInProgress:t}])=>{const n=ve(),o=ve(),r=yt(o,0),i=ve(),s=ve(),a=W(0),l=W([]),c=W(void 0),f=W(void 0),m=W(void 0),h=W(void 0),y=W(($,j)=>bo($,mI[j])),g=W(void 0),b=W(0),v=iI(),u=yt(z(n,he(l,e,b),Sn(dI,v),Me()),v),p=yt(z(l,Me(),Sn(($,j)=>({current:j,prev:$.current}),{current:[],prev:[]}),X(({prev:$})=>$)),[]);oe(z(l,ae($=>$.length>0),he(u,b),X(([$,j,R])=>{const M=$.reduce((F,V,L)=>It(F,V,vs(V,j.offsetTree,R)||L),Mr());return{...j,groupIndices:$,groupOffsetTree:M}})),u),oe(z(o,he(u),ae(([$,{lastIndex:j}])=>$<j),X(([$,{lastIndex:j,lastSize:R}])=>[{endIndex:j,size:R,startIndex:$}])),n),oe(c,f);const x=yt(z(c,X($=>$===void 0)),!0);oe(z(f,ae($=>$!==void 0&&Te(Le(u).sizeTree)),X($=>{const j=Le(m),R=Le(l).length>0;return j!==void 0&&j!==0?R?[{endIndex:0,size:j,startIndex:0},{endIndex:1,size:$,startIndex:1}]:[]:[{endIndex:0,size:$,startIndex:0}]})),n),oe(z(h,ae($=>$!==void 0&&$.length>0&&Te(Le(u).sizeTree)),X($=>{const j=[];let R=$[0],M=0;for(let F=1;F<$.length;F++){const V=$[F];V!==R&&(j.push({endIndex:F-1,size:R,startIndex:M}),R=V,M=F)}return j.push({endIndex:$.length-1,size:R,startIndex:M}),j})),n),oe(z(l,he(m,f),ae(([,$,j])=>$!==void 0&&j!==void 0),X(([$,j,R])=>{const M=[];for(let F=0;F<$.length;F++){const V=$[F],L=$[F+1];M.push({startIndex:V,endIndex:V,size:j}),L!==void 0&&M.push({startIndex:V+1,endIndex:L-1,size:R})}return M})),n);const S=Mt(z(n,he(u),Sn(({sizes:$},[j,R])=>({changed:R!==$,sizes:R}),{changed:!1,sizes:v}),X($=>$.changed)));$e(z(a,Sn(($,j)=>({diff:$.prev-j,prev:j}),{diff:0,prev:0}),X($=>$.diff)),$=>{const{groupIndices:j}=Le(u);if($>0)me(t,!0),me(i,$+Gh($,j));else if($<0){const R=Le(p);R.length>0&&($-=Gh(-$,R)),me(s,$)}}),$e(z(a,he(e)),([$,j])=>{$<0&&j("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},nt.ERROR)});const T=Mt(i);oe(z(i,he(u),X(([$,j])=>{const R=j.groupIndices.length>0,M=[],F=j.lastSize;if(R){const V=ys(j.sizeTree,0);let L=0,U=0;for(;L<$;){const Q=j.groupIndices[U],ee=j.groupIndices.length===U+1?1/0:j.groupIndices[U+1]-Q-1;M.push({endIndex:Q,size:V,startIndex:Q}),M.push({endIndex:Q+1+ee-1,size:F,startIndex:Q+1}),U++,L+=ee+1}const D=Do(j.sizeTree);return L!==$&&D.shift(),D.reduce((Q,{k:ee,v:q})=>{let G=Q.ranges;return Q.prevSize!==0&&(G=[...Q.ranges,{endIndex:ee+$-1,size:Q.prevSize,startIndex:Q.prevIndex}]),{prevIndex:ee+$,prevSize:q,ranges:G}},{prevIndex:$,prevSize:0,ranges:M}).ranges}return Do(j.sizeTree).reduce((V,{k:L,v:U})=>({prevIndex:L+$,prevSize:U,ranges:[...V.ranges,{endIndex:L+$-1,size:V.prevSize,startIndex:V.prevIndex}]}),{prevIndex:0,prevSize:F,ranges:[]}).ranges})),n);const C=Mt(z(s,he(u,b),X(([$,{offsetTree:j},R])=>{const M=-$;return vs(M,j,R)})));return oe(z(s,he(u,b),X(([$,j,R])=>{if(j.groupIndices.length>0){if(Te(j.sizeTree))return j;let F=Mr();const V=Le(p);let L=0,U=0,D=0;for(;L<-$;){D=V[U];const Q=V[U+1]-D-1;U++,L+=Q+1}if(F=Do(j.sizeTree).reduce((Q,{k:ee,v:q})=>It(Q,Math.max(0,ee+$),q),F),L!==-$){const Q=ys(j.sizeTree,D);F=It(F,0,Q);const ee=un(j.sizeTree,-$+1)[1];F=It(F,1,ee)}return{...j,sizeTree:F,...Gd(j.offsetTree,0,F,R)}}const M=Do(j.sizeTree).reduce((F,{k:V,v:L})=>It(F,Math.max(0,V+$),L),Mr());return{...j,sizeTree:M,...Gd(j.offsetTree,0,M,R)}})),u),{beforeUnshiftWith:T,data:g,defaultItemSize:f,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:m,gap:b,groupIndices:l,heightEstimates:h,itemSize:y,listRefresh:S,shiftWith:s,shiftWithOffset:C,sizeRanges:n,sizes:u,statefulTotalCount:r,totalCount:o,trackItemSizes:x,unshiftWith:i}},Ue(ko,pf),{singleton:!0});function hI(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const mx=xe(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const i=ve(),s=ve(),a=Mt(z(i,X(hI)));return oe(z(a,X(l=>l.totalCount)),n),oe(z(a,X(l=>l.groupIndices)),e),oe(z(Qe(r,t,o),ae(([l,c])=>Hl(c)),X(([l,c,f])=>un(c.groupOffsetTree,Math.max(l-f,0),"v")[0]),Me(),X(l=>[l])),s),{groupCounts:i,topItemsIndexes:s}},Ue(Tn,kt)),To=xe(([{log:e}])=>{const t=W(!1),n=Mt(z(t,ae(o=>o),Me()));return $e(t,o=>{o&&Le(e)("props updated",{},nt.DEBUG)}),{didMount:n,propsReady:t}},Ue(ko),{singleton:!0}),yI=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function hx(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!yI)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const Cs=xe(([{gap:e,listRefresh:t,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:i,footerHeight:s,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:f,viewportHeight:m},{log:h}])=>{const y=ve(),g=ve(),b=W(0);let v=null,u=null,p=null;function x(){v!==null&&(v(),v=null),p!==null&&(p(),p=null),u&&(clearTimeout(u),u=null),me(l,!1)}return oe(z(y,he(n,m,o,b,a,s,h),he(e,i,r),X(([[S,T,C,$,j,R,M,F],V,L,U])=>{const D=hx(S),{align:Q,behavior:ee,offset:q}=D,G=$-1,I=fx(D,T,G);let _=vs(I,T.offsetTree,V)+R;Q==="end"?(_+=L+un(T.sizeTree,I)[1]-C+U,I===G&&(_+=M)):Q==="center"?_+=(L+un(T.sizeTree,I)[1]-C+U)/2:_-=j,q!==void 0&&q!==0&&(_+=q);const A=E=>{x(),E?(F("retrying to scroll to",{location:S},nt.DEBUG),me(y,S)):(me(g,!0),F("list did not change, scroll successful",{},nt.DEBUG))};if(x(),ee==="smooth"){let E=!1;p=$e(t,w=>{E=E||w}),v=cn(f,()=>{A(E)})}else v=cn(z(t,gI(150)),A);return u=setTimeout(()=>{x()},1200),me(l,!0),F("scrolling from index to",{behavior:ee,index:I,top:_},nt.DEBUG),{behavior:ee,top:_}})),c),{scrollTargetReached:g,scrollToIndex:y,topListHeight:b}},Ue(Tn,kt,ko),{singleton:!0});function gI(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return o=>{o&&(t(!0),clearTimeout(n))}}}function mf(e,t){e===0?t():requestAnimationFrame(()=>{mf(e-1,t)})}function hf(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Es=xe(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:i},{didMount:s}])=>{const a=W(!0),l=W(0),c=W(!0);return oe(z(s,he(l),ae(([f,m])=>m!==0),yn(!1)),a),oe(z(s,he(l),ae(([f,m])=>m!==0),yn(!1)),c),$e(z(Qe(t,s),he(a,n,e,c),ae(([[,f],m,{sizeTree:h},y,g])=>f&&(!Te(h)||cf(y))&&!m&&!g),he(l)),([,f])=>{cn(r,()=>{me(c,!0)}),mf(4,()=>{cn(o,()=>{me(a,!0)}),me(i,f)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},Ue(Tn,kt,Cs,To),{singleton:!0});function yx(e,t){return Math.abs(e-t)<1.01}const bs="up",Fi="down",vI="none",bI={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},xI=0,Ps=xe(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:i}])=>{const s=W(!1),a=W(!0),l=ve(),c=ve(),f=W(4),m=W(xI),h=yt(z(Bd(z(se(r),Qo(1),yn(!0)),z(se(r),Qo(1),yn(!1),Bh(100))),Me()),!1),y=yt(z(Bd(z(n,yn(!0)),z(n,yn(!1),Bh(200))),Me()),!1);oe(z(Qe(se(r),se(m)),X(([p,x])=>p<=x),Me()),a),oe(z(a,On(50)),c);const g=Mt(z(Qe(o,se(i),se(t),se(e),se(f)),Sn((p,[{scrollHeight:x,scrollTop:S},T,C,$,j])=>{const R=S+T-x>-j,M={scrollHeight:x,scrollTop:S,viewportHeight:T};if(R){let V,L;return S>p.state.scrollTop?(V="SCROLLED_DOWN",L=p.state.scrollTop-S):(V="SIZE_DECREASED",L=p.state.scrollTop-S||p.scrollTopDelta),{atBottom:!0,atBottomBecause:V,scrollTopDelta:L,state:M}}let F;return M.scrollHeight>p.state.scrollHeight?F="SIZE_INCREASED":T<p.state.viewportHeight?F="VIEWPORT_HEIGHT_DECREASING":S<p.state.scrollTop?F="SCROLLING_UPWARDS":F="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:F,state:M}},bI),Me((p,x)=>p!==void 0&&p.atBottom===x.atBottom))),b=yt(z(o,Sn((p,{scrollHeight:x,scrollTop:S,viewportHeight:T})=>{if(!yx(p.scrollHeight,x)){const C=x-(S+T)<1;return p.scrollTop!==S&&C?{changed:!0,jump:p.scrollTop-S,scrollHeight:x,scrollTop:S}:{changed:!0,jump:0,scrollHeight:x,scrollTop:S}}return{changed:!1,jump:0,scrollHeight:x,scrollTop:S}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ae(p=>p.changed),X(p=>p.jump)),0);oe(z(g,X(p=>p.atBottom)),s),oe(z(s,On(50)),l);const v=W(Fi);oe(z(o,X(({scrollTop:p})=>p),Me(),Sn((p,x)=>Le(y)?{direction:p.direction,prevScrollTop:x}:{direction:x<p.prevScrollTop?bs:Fi,prevScrollTop:x},{direction:Fi,prevScrollTop:0}),X(p=>p.direction)),v),oe(z(o,On(50),yn(vI)),v);const u=W(0);return oe(z(h,ae(p=>!p),yn(0)),u),oe(z(r,On(100),he(h),ae(([p,x])=>x),Sn(([p,x],[S])=>[x,S],[0,0]),X(([p,x])=>x-p)),u),{atBottomState:g,atBottomStateChange:l,atBottomThreshold:f,atTopStateChange:c,atTopThreshold:m,isAtBottom:s,isAtTop:a,isScrolling:h,lastJumpDueToItemResize:b,scrollDirection:v,scrollVelocity:u}},Ue(kt)),xs="top",ws="bottom",Jh="none";function Qh(e,t,n){return typeof e=="number"?n===bs&&t===xs||n===Fi&&t===ws?e:0:n===bs?t===xs?e.main:e.reverse:t===ws?e.main:e.reverse}function Yh(e,t){return typeof e=="number"?e:e[t]??0}const yf=xe(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const i=ve(),s=W(0),a=W(0),l=W(0),c=yt(z(Qe(se(o),se(r),se(n),se(i,gs),se(l),se(s),se(t),se(e),se(a)),X(([f,m,h,[y,g],b,v,u,p,x])=>{const S=f-p,T=v+u,C=Math.max(h-S,0);let $=Jh;const j=Yh(x,xs),R=Yh(x,ws);return y-=p,y+=h+u,g+=h+u,g-=p,y>f+T-j&&($=bs),g<f-C+m+R&&($=Fi),$!==Jh?[Math.max(S-h-Qh(b,xs,$)-j,0),S-C-u+m+Qh(b,ws,$)+R]:null}),ae(f=>f!==null),Me(gs)),[0,0]);return{increaseViewportBy:a,listBoundary:i,overscan:l,topListHeight:s,visibleRange:c}},Ue(kt),{singleton:!0});function wI(e,t,n){if(Hl(t)){const o=px(e,t);return[{index:un(t.groupOffsetTree,o)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:o,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const jc={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ca(e,t,n,o,r,i){const{lastIndex:s,lastOffset:a,lastSize:l}=r;let c=0,f=0;if(e.length>0){c=e[0].offset;const b=e[e.length-1];f=b.offset+b.size}const m=n-s,h=a+m*l+(m-1)*o,y=c,g=h-f;return{bottom:f,firstItemIndex:i,items:Xh(e,r,i),offsetBottom:g,offsetTop:c,top:y,topItems:Xh(t,r,i),topListHeight:t.reduce((b,v)=>v.size+b,0),totalCount:n}}function gx(e,t,n,o,r,i){let s=0;if(n.groupIndices.length>0)for(const f of n.groupIndices){if(f-s>=e)break;s++}const a=e+s,l=hf(t,a),c=Array.from({length:a}).map((f,m)=>({data:i[m+l],index:m+l,offset:0,size:0}));return Ca(c,[],a,r,n,o)}function Xh(e,t,n){if(e.length===0)return[];if(!Hl(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const o=e[0].index,r=e[e.length-1].index,i=[],s=qr(t.groupOffsetTree,o,r);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=s.shift(),l=t.groupIndices.indexOf(a.start));let f;c.index===a.start?f={index:l,type:"group"}:f={groupIndex:l,index:c.index-(l+1)+n},i.push({...f,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}function Zh(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const er=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o,totalCount:r},i,{listBoundary:s,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:f},{topListHeight:m},h,{didMount:y},{recalcInProgress:g}])=>{const b=W([]),v=W(0),u=ve(),p=W(0);oe(i.topItemsIndexes,b);const x=yt(z(Qe(y,g,se(l,gs),se(r),se(o),se(c),f,se(b),se(t),se(n),se(p),e),ae(([$,j,,R,,,,,,,,M])=>{const F=M!==void 0&&M.length!==R;return $&&!j&&!F}),X(([,,[$,j],R,M,F,V,L,U,D,Q,ee])=>{var Y,ie;const q=M,{offsetTree:G,sizeTree:I}=q,_=Le(v);if(R===0)return{...jc,totalCount:R};if($===0&&j===0)return _===0?{...jc,totalCount:R}:gx(_,F,M,U,D,ee||[]);if(Te(I))return _>0?null:Ca(wI(hf(F,R),q,ee),[],R,D,q,U);const A=[];if(L.length>0){const de=L[0],we=L[L.length-1];let ze=0;for(const Ee of qr(I,de,we)){const Se=Ee.value,_e=Math.max(Ee.start,de),Ye=Math.min(Ee.end,we);for(let Pe=_e;Pe<=Ye;Pe++)A.push({data:ee==null?void 0:ee[Pe],index:Pe,offset:ze,size:Se}),ze+=Se}}if(!V)return Ca([],A,R,D,q,U);const E=L.length>0?L[L.length-1]+1:0,w=cI(G,$,j,E);if(w.length===0)return null;const k=R-1,N=Bl([],de=>{for(const we of w){const ze=we.value;let Ee=ze.offset,Se=we.start;const _e=ze.size;if(ze.offset<$){Se+=Math.floor(($-ze.offset+D)/(_e+D));const Pe=Se-we.start;Ee+=Pe*_e+Pe*D}Se<E&&(Ee+=(E-Se)*_e,Se=E);const Ye=Math.min(we.end,k);for(let Pe=Se;Pe<=Ye&&!(Ee>=j);Pe++)de.push({data:ee==null?void 0:ee[Pe],index:Pe,offset:Ee,size:_e}),Ee+=_e+D}}),B=Zh(Q,xs),O=Zh(Q,ws);if(N.length>0&&(B>0||O>0)){const de=N[0],we=N[N.length-1];if(B>0&&de.index>E){const ze=Math.min(B,de.index-E),Ee=[];let Se=de.offset;for(let _e=de.index-1;_e>=de.index-ze;_e--){const Ye=((Y=qr(I,_e,_e)[0])==null?void 0:Y.value)??de.size;Se-=Ye+D,Ee.unshift({data:ee==null?void 0:ee[_e],index:_e,offset:Se,size:Ye})}N.unshift(...Ee)}if(O>0&&we.index<k){const ze=Math.min(O,k-we.index);let Ee=we.offset+we.size+D;for(let Se=we.index+1;Se<=we.index+ze;Se++){const _e=((ie=qr(I,Se,Se)[0])==null?void 0:ie.value)??we.size;N.push({data:ee==null?void 0:ee[Se],index:Se,offset:Ee,size:_e}),Ee+=_e+D}}}return Ca(N,A,R,D,q,U)}),ae($=>$!==null),Me()),jc);oe(z(e,ae(cf),X($=>$==null?void 0:$.length)),r),oe(z(x,X($=>$.topListHeight)),m),oe(m,a),oe(z(x,X($=>[$.top,$.bottom])),s),oe(z(x,X($=>$.items)),u);const S=Mt(z(x,ae(({items:$})=>$.length>0),he(r,e),ae(([{items:$},j])=>$[$.length-1].originalIndex===j-1),X(([,$,j])=>[$-1,j]),Me(gs),X(([$])=>$))),T=Mt(z(x,On(200),ae(({items:$,topItems:j})=>$.length>0&&$[0].originalIndex===j.length),X(({items:$})=>$[0].index),Me())),C=Mt(z(x,ae(({items:$})=>$.length>0),X(({items:$})=>{let j=0,R=$.length-1;for(;$[j].type==="group"&&j<R;)j++;for(;$[R].type==="group"&&R>j;)R--;return{endIndex:$[R].index,startIndex:$[j].index}}),Me(dx)));return{endReached:S,initialItemCount:v,itemsRendered:u,listState:x,minOverscanItemCount:p,rangeChanged:C,startReached:T,topItemsIndexes:b,...h}},Ue(Tn,mx,yf,Es,Cs,Ps,To,pf),{singleton:!0}),vx=xe(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:o},{listState:r}])=>{const i=ve(),s=yt(z(Qe(n,e,o,t,r),X(([a,l,c,f,m])=>a+l+c+f+m.offsetBottom+m.bottom)),0);return oe(se(s),i),{totalListHeight:s,totalListHeightChanged:i}},Ue(kt,er),{singleton:!0}),SI=xe(([{viewportHeight:e},{totalListHeight:t}])=>{const n=W(!1),o=yt(z(Qe(n,e,t),ae(([r])=>r),X(([,r,i])=>Math.max(0,r-i)),On(0),Me()),0);return{alignToBottom:n,paddingTopAddition:o}},Ue(kt,vx),{singleton:!0}),bx=xe(()=>({context:W(null)})),$I=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:o,...r},viewportBottom:i,viewportTop:s})=>t<s?{...r,align:n??"start",...o!==void 0?{behavior:o}:{}}:e>i?{...r,align:n??"end",...o!==void 0?{behavior:o}:{}}:null,xx=xe(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:i,scrollingInProgress:s,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const f=ve();return oe(z(f,he(t,l,n,i,r,o,a),he(e),X(([[m,h,y,g,b,v,u,p],x])=>{const{calculateViewLocation:S=$I,done:T,...C}=m,$=fx(m,h,g-1),j=vs($,h.offsetTree,x)+b+v,R=j+un(h.sizeTree,$)[1],M=p+v,F=p+y-u,V=S({itemBottom:R,itemTop:j,locationParams:C,viewportBottom:F,viewportTop:M});return V!==null?T&&cn(z(s,ae(L=>!L),Qo(Le(s)?1:2)),T):T==null||T(),V}),ae(m=>m!==null)),c),{scrollIntoView:f}},Ue(Tn,kt,Cs,er,ko),{singleton:!0});function ey(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const kI=(e,t)=>typeof e=="function"?ey(e(t)):t&&ey(e),TI=xe(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:i},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:f},{scrollingInProgress:m},{context:h},{scrollIntoView:y}])=>{const g=W(!1),b=ve();let v=null;function u(T){me(s,{align:"end",behavior:T,index:"LAST"})}$e(z(Qe(z(se(t),Qo(1)),l),he(se(g),i,a,m),X(([[T,C],$,j,R,M])=>{let F=C&&R,V="auto";return F&&(V=kI($,j||M),F=F&&V!==!1),{followOutputBehavior:V,shouldFollow:F,totalCount:T}}),ae(({shouldFollow:T})=>T)),({followOutputBehavior:T,totalCount:C})=>{v!==null&&(v(),v=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("following output to ",{totalCount:C},nt.DEBUG),u(T)}):v=cn(e,()=>{Le(f)("following output to ",{totalCount:C},nt.DEBUG),u(T),v=null})});function p(T){const C=cn(r,$=>{T&&!$.atBottom&&$.notAtBottomBecause==="SIZE_INCREASED"&&v===null&&(Le(f)("scrolling to bottom due to increased size",{},nt.DEBUG),u("auto"))});setTimeout(C,100)}$e(z(Qe(se(g),t,c),ae(([T,,C])=>T!==!1&&C),Sn(({value:T},[,C])=>({refreshed:T===C,value:C}),{refreshed:!1,value:0}),ae(({refreshed:T})=>T),he(g,t)),([,T])=>{Le(a)&&p(T!==!1)}),$e(b,()=>{p(Le(g)!==!1)}),$e(Qe(se(g),r),([T,C])=>{T!==!1&&!C.atBottom&&C.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&u("auto")});const x=W(null),S=ve();return oe(Bd(z(se(o),X(T=>(T==null?void 0:T.length)??0)),z(se(t))),S),$e(z(Qe(z(S,Qo(1)),l),he(se(x),a,m,h),X(([[T,C],$,j,R,M])=>C&&j&&($==null?void 0:$({context:M,totalCount:T,scrollingInProgress:R}))),ae(T=>!!T),On(0)),T=>{v!==null&&(v(),v=null),Le(n)!==void 0?requestAnimationFrame(()=>{Le(f)("scrolling into view",{}),me(y,T)}):v=cn(e,()=>{Le(f)("scrolling into view",{}),me(y,T),v=null})}),{autoscrollToBottom:b,followOutput:g,scrollIntoViewOnChange:x}},Ue(Tn,Ps,Cs,Es,To,ko,kt,bx,xx)),_I=xe(([{data:e,firstItemIndex:t,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:i,listState:s},{didMount:a}])=>(oe(z(a,he(i),ae(([,l])=>l!==0),he(r,o,t,n,e),X(([[,l],c,f,m,h,y=[]])=>gx(l,c,f,m,h,y))),s),{}),Ue(Tn,Es,er,To),{singleton:!0}),jI=xe(([{didMount:e},{scrollTo:t},{listState:n}])=>{const o=W(0);return $e(z(e,he(o),ae(([,r])=>r!==0),X(([,r])=>({top:r}))),r=>{cn(z(n,Qo(1),ae(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{me(t,r)})})}),{initialScrollTop:o}},Ue(To,kt,er),{singleton:!0}),wx=xe(([{scrollVelocity:e}])=>{const t=W(!1),n=ve(),o=W(!1);return oe(z(e,he(o,t,n),ae(([r,i])=>i!==!1&&i!==void 0),X(([r,i,s,a])=>{const{enter:l,exit:c}=i;if(s){if(c(r,a))return!1}else if(l(r,a))return!0;return s}),Me()),t),$e(z(Qe(t,e,n),he(o)),([[r,i,s],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(i,s)}),{isSeeking:t,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:e}},Ue(Ps),{singleton:!0}),gf=xe(([{scrollContainerState:e,scrollTo:t}])=>{const n=ve(),o=ve(),r=ve(),i=W(!1),s=W(void 0);return oe(z(Qe(n,o),X(([{scrollTop:a,viewportHeight:l},{offsetTop:c,listHeight:f}])=>({scrollHeight:f,scrollTop:Math.max(0,a-c),viewportHeight:l}))),e),oe(z(t,he(o),X(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:s,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},Ue(kt)),NI=xe(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=ve(),f=W(void 0),m=W(null),h=W(null);return oe(a,m),oe(l,h),$e(z(c,he(t,o,s,m,h,n)),([y,g,b,v,u,p,x])=>{const S=uI(g.sizeTree);v&&u!==null&&p!==null&&(b=u.scrollTop-p.offsetTop),b-=x,y({ranges:S,scrollTop:b})}),oe(z(f,ae(cf),X(CI)),r),oe(z(i,he(f),ae(([,y])=>y!==void 0),Me(),X(([,y])=>y.ranges)),e),{getState:c,restoreStateFrom:f}},Ue(Tn,kt,Es,To,gf));function CI(e){return{align:"start",index:0,offset:e.scrollTop}}const EI=xe(([{topItemsIndexes:e}])=>{const t=W(0);return oe(z(t,ae(n=>n>=0),X(n=>Array.from({length:n}).map((o,r)=>r))),e),{topItemCount:t}},Ue(er));function Sx(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const PI=Sx(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),II=xe(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:i,lastJumpDueToItemResize:s,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:f,shiftWithOffset:m,sizes:h},{log:y},{recalcInProgress:g}])=>{const b=Mt(z(l,he(s),Sn(([,u,p,x],[{bottom:S,items:T,offsetBottom:C,totalCount:$},j])=>{const R=S+C;let M=0;return p===$&&u.length>0&&T.length>0&&(T[0].originalIndex===0&&u[0].originalIndex===0||(M=R-x,M!==0&&(M+=j))),[M,T,$,R]},[0,[],0,0]),ae(([u])=>u!==0),he(o,a,n,r,y,g),ae(([,u,p,x,,,S])=>!S&&!x&&u!==0&&p===bs),X(([[u],,,,,p])=>(p("Upward scrolling compensation",{amount:u},nt.DEBUG),u))));function v(u){u>0?(me(t,{behavior:"auto",top:-u}),me(e,0)):(me(e,0),me(t,{behavior:"auto",top:-u}))}return $e(z(b,he(e,i)),([u,p,x])=>{x&&PI()?me(e,p-u):v(-u)}),$e(z(Qe(yt(i,!1),e,g),ae(([u,p,x])=>!u&&!x&&p!==0),X(([u,p])=>p),On(1)),v),oe(z(m,X(u=>({top:-u}))),t),$e(z(c,he(h,f),X(([u,{groupIndices:p,lastSize:x,sizeTree:S},T])=>{function C(F){return F*(x+T)}if(p.length===0)return C(u);let $=0;const j=ys(S,0);let R=0,M=0;for(;R<u;){R++,$+=j;let F=p.length===M+1?1/0:p[M+1]-p[M]-1;R+F>u&&($-=j,F=u-R+1),R+=F,$+=C(F),M++}return $})),u=>{me(e,u),requestAnimationFrame(()=>{me(t,{top:u}),requestAnimationFrame(()=>{me(e,0),me(g,!1)})})}),{deviation:e}},Ue(kt,Ps,er,Tn,ko,pf)),OI=xe(([e,t,n,o,r,i,s,a,l,c,f])=>({...e,...t,...n,...o,...r,...i,...s,...a,...l,...c,...f}),Ue(yf,_I,To,wx,vx,jI,SI,gf,xx,ko,bx)),$x=xe(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:i,groupIndices:s,heightEstimates:a,itemSize:l,sizeRanges:c,sizes:f,statefulTotalCount:m,totalCount:h,trackItemSizes:y},{initialItemFinalLocationReached:g,initialTopMostItemIndex:b,scrolledToInitialItem:v},u,p,x,S,{scrollToIndex:T},C,{topItemCount:$},{groupCounts:j},R])=>{const{listState:M,minOverscanItemCount:F,topItemsIndexes:V,rangeChanged:L,...U}=S;return oe(L,R.scrollSeekRangeChanged),oe(z(R.windowViewportRect,X(D=>D.visibleHeight)),u.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:i,groupCounts:j,heightEstimates:a,initialItemFinalLocationReached:g,initialTopMostItemIndex:b,scrolledToInitialItem:v,sizeRanges:c,topItemCount:$,topItemsIndexes:V,totalCount:h,...x,groupIndices:s,itemSize:l,listState:M,minOverscanItemCount:F,scrollToIndex:T,statefulTotalCount:m,trackItemSizes:y,rangeChanged:L,...U,...R,...u,sizes:f,...p}},Ue(Tn,Es,kt,NI,TI,er,Cs,II,EI,mx,OI));function RI(e,t){const n={},o={};let r=0;const i=e.length;for(;r<i;)o[e[r]]=1,r+=1;for(const s in t)Object.hasOwn(o,s)||(n[s]=t[s]);return n}const ra=typeof document<"u"?te.useLayoutEffect:te.useEffect;function kx(e,t,n){const o=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),i=Object.keys(t.methods||{}),s=Object.keys(t.events||{}),a=te.createContext({});function l(v,u){v.propsReady!==void 0&&me(v.propsReady,!1);for(const p of o){const x=v[t.required[p]];me(x,u[p])}for(const p of r)if(p in u){const x=v[t.optional[p]];me(x,u[p])}v.propsReady!==void 0&&me(v.propsReady,!0)}function c(v){return i.reduce((u,p)=>(u[p]=x=>{const S=v[t.methods[p]];me(S,x)},u),{})}function f(v){return s.reduce((u,p)=>(u[p]=JP(v[t.events[p]]),u),{})}const m=te.forwardRef(function(v,u){const{children:p,...x}=v,[S]=te.useState(()=>Bl(YP(e),$=>{l($,x)})),[T]=te.useState(Fh(f,S));ra(()=>{for(const $ of s)$ in x&&$e(T[$],x[$]);return()=>{Object.values(T).map(df)}},[x,T,S]),ra(()=>{l(S,x)}),te.useImperativeHandle(u,zh(c(S)));const C=n;return d.jsx(a.Provider,{value:S,children:n!==void 0?d.jsx(C,{...RI([...o,...r,...s],x),children:p}):p})}),h=v=>{const u=te.useContext(a);return te.useCallback(p=>{me(u[v],p)},[u,v])},y=v=>{const u=te.useContext(a)[v],p=te.useCallback(x=>$e(u,x),[u]);return te.useSyncExternalStore(p,()=>Le(u),()=>Le(u))},g=v=>{const u=te.useContext(a)[v],[p,x]=te.useState(Fh(Le,u));return ra(()=>$e(u,S=>{S!==p&&x(zh(S))}),[u,p]),p},b=parseInt(te.version)>=18?y:g;return{Component:m,useEmitter:(v,u)=>{const p=te.useContext(a)[v];ra(()=>$e(p,u),[u,p])},useEmitterValue:b,usePublisher:h}}const Tx=te.createContext(void 0),_x=te.createContext(void 0),Nc="-webkit-sticky",ty="sticky",vf=Sx(()=>{if(typeof document>"u")return ty;const e=document.createElement("div");return e.style.position=Nc,e.style.position===Nc?Nc:ty}),jx=typeof document<"u"?te.useLayoutEffect:te.useEffect;function Cc(e){return"self"in e}function AI(e){return"body"in e}function Nx(e,t,n,o=oi,r,i){const s=te.useRef(null),a=te.useRef(null),l=te.useRef(null),c=te.useCallback(h=>{let y,g,b;const v=h.target;if(AI(v)||Cc(v)){const p=Cc(v)?v:v.defaultView;b=i===!0?Lo(p,p.scrollX):p.scrollY,y=i===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight,g=i===!0?p.innerWidth:p.innerHeight}else b=i===!0?Lo(v,v.scrollLeft):v.scrollTop,y=i===!0?v.scrollWidth:v.scrollHeight,g=i===!0?v.offsetWidth:v.offsetHeight;const u=()=>{e({scrollHeight:y,scrollTop:Math.max(b,0),viewportHeight:g})};h.suppressFlushSync===!0?u():lS.flushSync(u),a.current!==null&&(b===a.current||b<=0||b===y-g)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,i]);te.useEffect(()=>{const h=r||s.current;return Hh(h),o(r||s.current),c({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",c,{passive:!0}),()=>{Hh(h),o(null),h.removeEventListener("scroll",c)}},[s,c,n,o,r]);function f(h){const y=s.current;if(!y||(i===!0?"offsetWidth"in y&&y.offsetWidth===0:"offsetHeight"in y&&y.offsetHeight===0))return;const g=h.behavior==="smooth";let b,v,u;Cc(y)?(v=Math.max(bo(y.document.documentElement,i===!0?"width":"height"),i===!0?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight),b=i===!0?y.innerWidth:y.innerHeight,u=i===!0?Lo(y,y.scrollX):y.scrollY):(v=y[i===!0?"scrollWidth":"scrollHeight"],b=bo(y,i===!0?"width":"height"),u=i===!0?Lo(y,y.scrollLeft):y.scrollTop);const p=v-b;if(h.top===void 0){y.scrollTo(h);return}const x=Math.ceil(Math.max(Math.min(p,h.top),0));if(h.top=x,yx(b,v)||x===u){e({scrollHeight:v,scrollTop:u,viewportHeight:b}),g&&t(!0);return}g?(a.current=x,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,i===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},left:Vh(y,x)}),y.scrollTo(h)}function m(h){i===!0&&(h={...h.behavior!==void 0?{behavior:h.behavior}:{},...h.top!==void 0?{left:Vh(s.current,h.top)}:{}}),s.current.scrollBy(h)}return{scrollByCallback:m,scrollerRef:s,scrollToCallback:f}}function bf(e){return e}const MI=xe(()=>{const e=W(a=>`Item ${a}`),t=W(a=>`Group ${a}`),n=W({}),o=W(bf),r=W("div"),i=W(oi),s=(a,l=null)=>yt(z(n,X(c=>c[a]),Me()),l);return{components:n,computeItemKey:o,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:r,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:i,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),qI=xe(([e,t])=>({...e,...t}),Ue($x,MI)),UI=({height:e})=>d.jsx("div",{style:{height:e}}),LI={overflowAnchor:"none",position:vf(),zIndex:1},Cx={overflowAnchor:"none"},DI={...Cx,display:"inline-block",height:"100%"},ny=te.memo(function({showTopList:e=!1}){const t=ce("listState"),n=Wt("sizeRanges"),o=ce("useWindowScroll"),r=ce("customScrollParent"),i=Wt("windowScrollContainerState"),s=Wt("scrollContainerState"),a=r||o?i:s,l=ce("itemContent"),c=ce("context"),f=ce("groupContent"),m=ce("trackItemSizes"),h=ce("itemSize"),y=ce("log"),g=Wt("gap"),b=ce("horizontalDirection"),{callbackRef:v}=tI(n,h,m,e?oi:a,y,g,r,b,ce("skipAnimationFrameInResizeObserver")),[u,p]=te.useState(0);wf("deviation",U=>{u!==U&&p(U)});const x=ce("EmptyPlaceholder"),S=ce("ScrollSeekPlaceholder")??UI,T=ce("ListComponent"),C=ce("ItemComponent"),$=ce("GroupComponent"),j=ce("computeItemKey"),R=ce("isSeeking"),M=ce("groupIndices").length>0,F=ce("alignToBottom"),V=ce("initialItemFinalLocationReached"),L=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginInlineStart:u!==0?u:F?"auto":0,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:u!==0?u:F?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...V?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&x!==null&&x!==void 0?d.jsx(x,{...ht(x,c)}):d.jsx(T,{...ht(T,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:v,style:L,children:(e?t.topItems:t.items).map(U=>{const D=U.originalIndex,Q=j(D+t.firstItemIndex,U.data,c);return R?P.createElement(S,{...ht(S,c),height:U.size,index:U.index,key:Q,type:U.type||"item",...U.type==="group"?{}:{groupIndex:U.groupIndex}}):U.type==="group"?P.createElement($,{...ht($,c),"data-index":D,"data-item-index":U.index,"data-known-size":U.size,key:Q,style:LI},f(U.index,c)):P.createElement(C,{...ht(C,c),...HI(C,U.data),"data-index":D,"data-item-group-index":U.groupIndex,"data-item-index":U.index,"data-known-size":U.size,key:Q,style:b?DI:Cx},M?l(U.index,U.groupIndex,U.data,c):l(U.index,U.data,c))})})}),zI={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},FI={outline:"none",overflowX:"auto",position:"relative"},xf=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),Ex=(e,t,n=0)=>({...xf(e),position:t?"relative":"absolute",top:t?-n:0}),BI={position:vf(),top:0,width:"100%",zIndex:1};function ht(e,t){if(typeof e!="string")return{context:t}}function HI(e,t){return{item:typeof e=="string"?void 0:t}}const VI=te.memo(function(){const e=ce("HeaderComponent"),t=Wt("headerHeight"),n=ce("HeaderFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,ce("skipAnimationFrameInResizeObserver")),r=ce("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null}),WI=te.memo(function(){const e=ce("FooterComponent"),t=Wt("footerHeight"),n=ce("HeaderFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,ce("skipAnimationFrameInResizeObserver")),r=ce("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null});function Px({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("scrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),f=t("scrollerRef"),m=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:y,scrollToCallback:g}=Nx(a,c,l,f,void 0,m);return e("scrollTo",g),e("scrollBy",h),d.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:y,style:{...m?FI:zI,...r},tabIndex:0,...s,...ht(l,i),children:o})})}function Ix({useEmitter:e,useEmitterValue:t,usePublisher:n}){return te.memo(function({children:o,style:r,context:i,...s}){const a=n("windowScrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),f=t("totalListHeight"),m=t("deviation"),h=t("customScrollParent"),y=te.useRef(null),g=t("scrollerRef"),{scrollByCallback:b,scrollerRef:v,scrollToCallback:u}=Nx(a,c,l,g,h);return jx(()=>{var p;return v.current=h||((p=y.current)==null?void 0:p.ownerDocument.defaultView),()=>{v.current=null}},[v,h]),e("windowScrollTo",u),e("scrollBy",b),d.jsx(l,{ref:y,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...f!==0?{height:f+m}:void 0},...s,...ht(l,i),children:o})})}const KI=({children:e})=>{const t=te.useContext(Tx),n=Wt("viewportHeight"),o=Wt("fixedItemHeight"),r=ce("alignToBottom"),i=ce("horizontalDirection"),s=te.useMemo(()=>ex(n,l=>bo(l,i?"width":"height")),[n,i]),a=Zo(s,!0,ce("skipAnimationFrameInResizeObserver"));return te.useEffect(()=>{t&&(n(t.viewportHeight),o(t.itemHeight))},[t,n,o]),d.jsx("div",{"data-viewport-type":"element",ref:a,style:xf(r),children:e})},GI=({children:e})=>{const t=te.useContext(Tx),n=Wt("windowViewportRect"),o=Wt("fixedItemHeight"),r=ce("customScrollParent"),i=ce("useWindowScroll"),s=ce("topListHeight"),a=rx(n,r,ce("skipAnimationFrameInResizeObserver")),l=ce("alignToBottom");return te.useEffect(()=>{t&&(o(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,o]),d.jsx("div",{"data-viewport-type":"window",ref:a,style:Ex(l,i,s),children:e})},JI=({children:e})=>{const t=ce("TopItemListComponent")??"div",n=ce("headerHeight"),o={...BI,marginTop:`${n}px`},r=ce("context");return d.jsx(t,{style:o,...ht(t,r),children:e})},QI=te.memo(function(e){const t=ce("useWindowScroll"),n=ce("topItemsIndexes").length>0,o=ce("customScrollParent"),r=ce("context");return d.jsxs(o||t?ZI:XI,{...e,context:r,children:[n&&d.jsx(JI,{children:d.jsx(ny,{showTopList:!0})}),d.jsxs(o||t?GI:KI,{children:[d.jsx(VI,{}),d.jsx(ny,{}),d.jsx(WI,{})]})]})}),{Component:YI,useEmitter:wf,useEmitterValue:ce,usePublisher:Wt}=kx(qI,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},QI),XI=Px({useEmitter:wf,useEmitterValue:ce,usePublisher:Wt}),ZI=Ix({useEmitter:wf,useEmitterValue:ce,usePublisher:Wt}),eO=YI,tO=xe(()=>{const e=W(c=>d.jsxs("td",{children:["Item $",c]})),t=W(null),n=W(c=>d.jsxs("td",{colSpan:1e3,children:["Group ",c]})),o=W(null),r=W(null),i=W({}),s=W(bf),a=W(oi),l=(c,f=null)=>yt(z(i,X(m=>m[c]),Me()),f);return{components:i,computeItemKey:s,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});Ue($x,tO);vf();const oy={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},nO={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:ry,floor:pl,max:Bi,min:Ec,round:iy}=Math;function sy(e,t,n){return Array.from({length:t-e+1}).map((o,r)=>({data:n===null?null:n[r+e],index:r+e}))}function oO(e){return{...nO,items:e}}function ia(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function rO(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const iO=xe(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:i,scrollBy:s,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:f,viewportHeight:m},h,y,{didMount:g,propsReady:b},{customScrollParent:v,useWindowScroll:u,windowScrollContainerState:p,windowScrollTo:x,windowViewportRect:S},T])=>{const C=W(0),$=W(0),j=W(oy),R=W({height:0,width:0}),M=W({height:0,width:0}),F=ve(),V=ve(),L=W(0),U=W(null),D=W({column:0,row:0}),Q=ve(),ee=ve(),q=W(!1),G=W(0),I=W(!0),_=W(!1),A=W(!1);$e(z(g,he(G),ae(([O,Y])=>Y!==0)),()=>{me(I,!1)}),$e(z(Qe(g,I,M,R,G,_),ae(([O,Y,ie,de,,we])=>O&&!Y&&ie.height!==0&&de.height!==0&&!we)),([,,,,O])=>{me(_,!0),mf(1,()=>{me(F,O)}),cn(z(c),()=>{me(t,[0,0]),me(I,!0)})}),oe(z(ee,ae(O=>O!=null&&O.scrollTop>0),yn(0)),$),$e(z(g,he(ee),ae(([,O])=>O!=null)),([,O])=>{O&&(me(R,O.viewport),me(M,O.item),me(D,O.gap),O.scrollTop>0&&(me(q,!0),cn(z(c,Qo(1)),Y=>{me(q,!1)}),me(l,{top:O.scrollTop})))}),oe(z(R,X(({height:O})=>O)),m),oe(z(Qe(se(R,ia),se(M,ia),se(D,(O,Y)=>O!==void 0&&O.column===Y.column&&O.row===Y.row),se(c)),X(([O,Y,ie,de])=>({gap:ie,item:Y,scrollTop:de,viewport:O}))),Q),oe(z(Qe(se(C),o,se(D,rO),se(M,ia),se(R,ia),se(U),se($),se(q),se(I),se(G)),ae(([,,,,,,,O])=>!O),X(([O,[Y,ie],de,we,ze,Ee,Se,,_e,Ye])=>{const{column:Pe,row:_n}=de,{height:Bn,width:_o}=we,{width:tr}=ze;if(Se===0&&(O===0||tr===0))return oy;if(_o===0){const Sf=hf(Ye,O),Mx=Sf+Math.max(Se-1,0);return oO(sy(Sf,Mx,Ee))}const Hn=Ox(tr,_o,Pe);let pn,Yt;_e?Y===0&&ie===0&&Se>0?(pn=0,Yt=Se-1):(pn=Hn*pl((Y+_n)/(Bn+_n)),Yt=Hn*ry((ie+_n)/(Bn+_n))-1,Yt=Ec(O-1,Bi(Yt,Hn-1)),pn=Ec(Yt,Bi(0,pn))):(pn=0,Yt=-1);const Vn=sy(pn,Yt,Ee),{bottom:nr,top:ri}=ay(ze,de,we,Vn),ii=ry(O/Hn),Vl=ii*Bn+(ii-1)*_n-nr;return{bottom:nr,itemHeight:Bn,items:Vn,itemWidth:_o,offsetBottom:Vl,offsetTop:ri,top:ri}})),j),oe(z(U,ae(O=>O!==null),X(O=>O.length)),C),oe(z(Qe(R,M,j,D),ae(([O,Y,{items:ie}])=>ie.length>0&&Y.height!==0&&O.height!==0),X(([O,Y,{items:ie},de])=>{const{bottom:we,top:ze}=ay(O,de,Y,ie);return[ze,we]}),Me(gs)),t);const E=W(!1);oe(z(c,he(E),X(([O,Y])=>Y||O!==0)),E);const w=Mt(z(Qe(j,C),ae(([{items:O}])=>O.length>0),he(E),ae(([[O,Y],ie])=>{const de=O.items[O.items.length-1].index===Y-1;return(ie||O.bottom>0&&O.itemHeight>0&&O.offsetBottom===0&&O.items.length===Y)&&de}),X(([[,O]])=>O-1),Me())),k=Mt(z(se(j),ae(({items:O})=>O.length>0&&O[0].index===0),yn(0),Me())),N=Mt(z(se(j),he(q),ae(([{items:O},Y])=>O.length>0&&!Y),X(([{items:O}])=>({endIndex:O[O.length-1].index,startIndex:O[0].index})),Me(dx),On(0)));oe(N,y.scrollSeekRangeChanged),oe(z(F,he(R,M,C,D),X(([O,Y,ie,de,we])=>{const ze=hx(O),{align:Ee,behavior:Se,offset:_e}=ze;let Ye=ze.index;Ye==="LAST"&&(Ye=de-1),Ye=Bi(0,Ye,Ec(de-1,Ye));let Pe=Jd(Y,we,ie,Ye);return Ee==="end"?Pe=iy(Pe-Y.height+ie.height):Ee==="center"&&(Pe=iy(Pe-Y.height/2+ie.height/2)),_e!==void 0&&_e!==0&&(Pe+=_e),{behavior:Se,top:Pe}})),l);const B=yt(z(j,X(O=>O.offsetBottom+O.bottom)),0);return oe(z(S,X(O=>({height:O.visibleHeight,width:O.visibleWidth}))),R),{customScrollParent:v,data:U,deviation:L,footerHeight:r,gap:D,headerHeight:i,increaseViewportBy:e,initialItemCount:$,itemDimensions:M,overscan:n,restoreStateFrom:ee,scrollBy:s,scrollContainerState:a,scrollHeight:V,scrollTo:l,scrollToIndex:F,scrollTop:c,smoothScrollTargetReached:f,totalCount:C,useWindowScroll:u,viewportDimensions:R,windowScrollContainerState:p,windowScrollTo:x,windowViewportRect:S,...y,gridState:j,horizontalDirection:A,initialTopMostItemIndex:G,totalListHeight:B,...h,endReached:w,propsReady:b,rangeChanged:N,startReached:k,stateChanged:Q,stateRestoreInProgress:q,...T}},Ue(yf,kt,Ps,wx,To,gf,ko));function Ox(e,t,n){return Bi(1,pl((e+n)/(pl(t)+n)))}function ay(e,t,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const i=Jd(e,t,n,o[0].index);return{bottom:Jd(e,t,n,o[o.length-1].index)+r,top:i}}function Jd(e,t,n,o){const r=Ox(e.width,n.width,t.column),i=pl(o/r),s=i*n.height+Bi(0,i-1)*t.row;return s>0?s+t.row:s}const sO=xe(()=>{const e=W(m=>`Item ${m}`),t=W({}),n=W(null),o=W("virtuoso-grid-item"),r=W("virtuoso-grid-list"),i=W(bf),s=W("div"),a=W(oi),l=(m,h=null)=>yt(z(t,X(y=>y[m]),Me()),h),c=W(!1),f=W(!1);return oe(se(f),c),{components:t,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:s,itemClassName:o,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:f,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),aO=xe(([e,t])=>({...e,...t}),Ue(iO,sO)),lO=te.memo(function(){const e=Re("gridState"),t=Re("listClassName"),n=Re("itemClassName"),o=Re("itemContent"),r=Re("computeItemKey"),i=Re("isSeeking"),s=Kt("scrollHeight"),a=Re("ItemComponent"),l=Re("ListComponent"),c=Re("ScrollSeekPlaceholder"),f=Re("context"),m=Kt("itemDimensions"),h=Kt("gap"),y=Re("log"),g=Re("stateRestoreInProgress"),b=Kt("reportReadyState"),v=Zo(te.useMemo(()=>u=>{const p=u.parentElement.parentElement.scrollHeight;s(p);const x=u.firstChild;if(x!==null){const{height:S,width:T}=x.getBoundingClientRect();m({height:S,width:T})}h({column:ly("column-gap",getComputedStyle(u).columnGap,y),row:ly("row-gap",getComputedStyle(u).rowGap,y)})},[s,m,h,y]),!0,!1);return jx(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),g?null:d.jsx(l,{className:t,ref:v,...ht(l,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(u=>{const p=r(u.index,u.data,f);return i?d.jsx(c,{...ht(c,f),height:e.itemHeight,index:u.index,width:e.itemWidth},p):P.createElement(a,{...ht(a,f),className:n,"data-index":u.index,key:p},o(u.index,u.data,f))})})}),cO=te.memo(function(){const e=Re("HeaderComponent"),t=Kt("headerHeight"),n=Re("headerFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,!1),r=Re("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null}),dO=te.memo(function(){const e=Re("FooterComponent"),t=Kt("footerHeight"),n=Re("headerFooterTag"),o=Zo(te.useMemo(()=>i=>{t(bo(i,"height"))},[t]),!0,!1),r=Re("context");return e!=null?d.jsx(n,{ref:o,children:d.jsx(e,{...ht(e,r)})}):null}),uO=({children:e})=>{const t=te.useContext(_x),n=Kt("itemDimensions"),o=Kt("viewportDimensions"),r=Zo(te.useMemo(()=>i=>{o(i.getBoundingClientRect())},[o]),!0,!1);return te.useEffect(()=>{t&&(o({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,o,n]),d.jsx("div",{ref:r,style:xf(!1),children:e})},pO=({children:e})=>{const t=te.useContext(_x),n=Kt("windowViewportRect"),o=Kt("itemDimensions"),r=Re("customScrollParent"),i=Re("useWindowScroll"),s=rx(n,r,!1);return te.useEffect(()=>{t&&(o({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,o]),d.jsx("div",{ref:s,style:Ex(!1,i),children:e})},fO=te.memo(function({...e}){const t=Re("useWindowScroll"),n=Re("customScrollParent"),o=n||t?hO:mO,r=n||t?pO:uO,i=Re("context");return d.jsx(o,{...e,...ht(o,i),children:d.jsxs(r,{children:[d.jsx(cO,{}),d.jsx(lO,{}),d.jsx(dO,{})]})})}),{useEmitter:Rx,useEmitterValue:Re,usePublisher:Kt}=kx(aO,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},fO),mO=Px({useEmitter:Rx,useEmitterValue:Re,usePublisher:Kt}),hO=Ix({useEmitter:Rx,useEmitterValue:Re,usePublisher:Kt});function ly(e,t,n){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&n(`${e} was not resolved to pixel value correctly`,t,nt.WARN),t==="normal"?0:parseInt(t??"0",10)}function yO(e){var o,r,i;if(e.kind!=="notification"||e.method!=="session/update")return null;const t=e.payload;if(!t||typeof t!="object")return null;const n=t.params;return!n||((o=n.update)==null?void 0:o.sessionUpdate)!=="agent_message_chunk"?null:{sessionId:String(n.sessionId??""),text:((i=(r=n.update)==null?void 0:r.content)==null?void 0:i.text)??""}}function gO(e){const t=[];let n=null;const o=()=>{if(n){if(n.messages.length===1){const r=n.messages[0];t.push({type:"message",message:r})}else{const r=n.messages[0],i=n.messages[n.messages.length-1];t.push({type:"stream-cluster",sessionId:n.sessionId,messages:n.messages,firstSeq:r.seq,lastSeq:i.seq,combinedText:n.text,firstTimestamp:r.timestamp,lastTimestamp:i.timestamp})}n=null}};for(const r of e){const i=yO(r);if(i&&n&&n.sessionId===i.sessionId){n.messages.push(r),n.text+=i.text;continue}o(),i?n={sessionId:i.sessionId,messages:[r],text:i.text}:t.push({type:"message",message:r})}return o(),t}function vO(e){var n;if(!e.payload||typeof e.payload!="object")return null;const t=e.payload.params;if(!t||typeof t!="object")return null;if(e.method==="session/prompt"){const o=t.prompt;if(!Array.isArray(o))return null;const r=[];for(const s of o)(s==null?void 0:s.type)==="text"&&typeof s.text=="string"&&r.push(s.text);const i=r.join(" ").trim();return i.length>0?i:null}if(e.method==="session/update"){const o=t.update;if(!o)return null;const r=((n=o.content)==null?void 0:n.text)??o.text;return typeof r=="string"&&r.length>0?r:null}return null}function bO(e){return e.method==="session/prompt"&&e.kind==="request"}const xO={request:"REQ",response:"RSP",notification:"NTF",error:"ERR",unknown:"???"},wO={request:"request — expects a response",response:"response — answer to a previous request",notification:"notification — one-way event, no response",error:"error — response carrying an error object",unknown:"unknown — could not classify as JSON-RPC"},SO={"editor-to-agent":"editor → agent (e.g. JetBrains/Zed sending to the AI)","agent-to-editor":"agent → editor (AI replying or calling the host)"};function $O(e){switch(e){case"error":return"text-accent-error";case"notification":return"text-accent-note";case"request":return"text-accent-out";case"response":return"text-accent-in";default:return"text-ink-muted"}}function kO({message:e,selected:t,paired:n=!1,latencyMs:o,validation:r,onSelect:i}){const s=e.direction==="editor-to-agent",a=e.kind==="error",l=o!==void 0?iE(o):null,c=vO(e),f=bO(e),m=r&&!r.skipped&&!r.valid;return d.jsxs("button",{type:"button",onClick:()=>i(e.seq),className:K("relative flex w-full items-center gap-3 px-4 py-1.5 text-left font-mono text-[12px] leading-5","border-b border-line-grid/70 transition-colors","hover:bg-surface-rowHover",t?"bg-surface-rowHover ring-1 ring-inset ring-accent-out/40":"",n&&!t?"bg-accent-out/[0.04] ring-1 ring-inset ring-accent-out/15":"",a?"bg-accent-error/[0.06]":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("absolute inset-y-0 left-0 w-[3px]",s?"bg-accent-out":"bg-accent-in",a?"bg-accent-error":"")}),d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(e.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:ps(e.timestamp)}),d.jsxs("span",{className:K("flex w-16 shrink-0 items-center gap-1 font-semibold",s?"text-accent-out":"text-accent-in"),title:SO[e.direction],children:[d.jsx("span",{"aria-hidden":!0,children:Vb(e.direction)}),d.jsx("span",{className:"text-[10px] tracking-widest",children:Hb(e.direction)})]}),d.jsx("span",{className:K("inline-flex w-12 shrink-0 items-center justify-center rounded-sm border px-1 text-[10px] font-semibold tracking-widest",$O(e.kind),"border-current/40"),title:wO[e.kind],children:xO[e.kind]}),d.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-3 overflow-hidden",children:[d.jsx("span",{className:K("shrink-0",f?"text-accent-out":"text-ink-primary"),children:e.method?e.method:"—"}),m&&r&&d.jsxs("span",{className:K("inline-flex shrink-0 items-center gap-0.5 rounded-sm border border-accent-error/40","bg-accent-error/10 px-1 text-[9px] font-semibold uppercase tracking-widest text-accent-error"),title:`fails ACP schema (${r.schemaName??"?"}): ${r.errors.map(h=>`${h.path==="/"?"":h.path+" "}${h.message}`).join(" · ")}`,children:["⚠ SPEC ",r.errors.length]}),c&&d.jsxs("span",{className:K("truncate",f?"text-accent-out/85":"text-ink-secondary"),title:c,children:["“",c,"”"]})]}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",title:e.rpcId!==void 0&&e.rpcId!==null?`id:${String(e.rpcId)}`:void 0,children:e.rpcId!==void 0&&e.rpcId!==null?`id:${aE(e.rpcId)}`:""}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Ll(e.raw.length)}),d.jsx("span",{className:K("w-20 shrink-0 text-right",l==="ok"&&"text-accent-ok",l==="warn"&&"text-accent-warn",l==="error"&&"text-accent-error",!l&&"text-ink-dim"),children:o!==void 0?`+${Vt(o)}`:""})]})}const TO=P.memo(kO);function _O({messages:e,combinedText:t,firstTimestamp:n,lastTimestamp:o,selectedSeq:r,onSelect:i}){const[s,a]=P.useState(!1),l=e[0],c=e[e.length-1],f=o-n,m=t.length>140?`${t.slice(0,140)}…`:t,h=r!==null&&e.some(y=>y.seq===r);return d.jsxs("div",{className:"border-b border-line-grid/70",children:[d.jsxs("button",{type:"button",onClick:()=>{a(y=>!y),i(l.seq)},className:K("relative flex w-full items-center gap-3 px-4 py-1.5 text-left font-mono text-[12px] leading-5","transition-colors hover:bg-surface-rowHover",h?"bg-surface-rowHover ring-1 ring-inset ring-accent-note/40":""),children:[d.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent-note"}),d.jsxs("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:[String(l.seq).padStart(3,"0"),"…",String(c.seq).padStart(3,"0")]}),d.jsx("span",{className:"w-24 shrink-0 text-ink-secondary",children:ps(n)}),d.jsxs("span",{className:"flex w-16 shrink-0 items-center gap-1 font-semibold text-accent-in",title:"agent → editor (AI replying or calling the host)",children:[d.jsx("span",{"aria-hidden":!0,children:"←"}),d.jsx("span",{className:"text-[10px] tracking-widest",children:"IN"})]}),d.jsx("span",{className:K("inline-flex w-12 shrink-0 items-center justify-center rounded-sm border border-accent-note/40 px-1 text-[10px] font-semibold tracking-widest text-accent-note"),title:`stream — ${e.length} consecutive agent_message_chunk notifications collapsed into one row`,children:"STR"}),d.jsxs("span",{className:"flex flex-1 items-center gap-2 truncate text-ink-primary",children:[d.jsx("span",{className:"inline-flex h-[14px] w-1 rounded-sm bg-accent-note/60","aria-hidden":!0}),d.jsx("span",{className:"truncate text-ink-secondary",children:m||d.jsx("span",{className:"text-ink-muted",children:"(empty stream)"})})]}),d.jsxs("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:[e.length," chunks"]}),d.jsx("span",{className:"w-20 shrink-0 text-right text-ink-muted",children:Vt(f)}),d.jsx("span",{"aria-hidden":!0,className:K("w-3 shrink-0 text-ink-muted transition-transform",s?"rotate-90":""),children:"▸"})]}),s&&d.jsx("div",{className:"border-l border-line-grid/70 bg-surface-base/40",children:e.map((y,g)=>d.jsxs("button",{type:"button",onClick:()=>i(y.seq),className:K("flex w-full items-center gap-3 px-8 py-1 text-left font-mono text-[11px] leading-5 text-ink-secondary","transition-colors hover:bg-surface-rowHover",r===y.seq?"bg-surface-rowHover text-ink-primary":""),children:[d.jsx("span",{className:"w-10 shrink-0 text-right text-ink-muted",children:String(y.seq).padStart(3,"0")}),d.jsx("span",{className:"w-24 shrink-0 text-ink-muted",children:ps(y.timestamp)}),d.jsxs("span",{className:"w-8 shrink-0 text-ink-muted",children:["#",g+1]}),d.jsx("span",{className:"flex-1 truncate text-ink-primary",children:jO(y)})]},y.seq))})]})}function jO(e){var o,r;const t=e.payload;if(!t||typeof t!="object")return"";const n=t.params;return((r=(o=n==null?void 0:n.update)==null?void 0:o.content)==null?void 0:r.text)??""}const NO=80;function CO(){const e=ne(u=>u.messages),t=ne(u=>u.selectedSeq),n=ne(u=>u.filters),o=ne(u=>u.playback.cap),r=ne(u=>u.select),i=P.useMemo(()=>gS(e,n,o),[e,n,o]),s=P.useMemo(()=>gO(i),[i]),a=P.useMemo(()=>Cl(e),[e]),l=P.useMemo(()=>ef(e),[e]),c=P.useMemo(()=>{const u=new Map;for(const p of e)u.set(p.seq,p.timestamp);return u},[e]),f=P.useMemo(()=>{if(t===null)return null;const u=a.get(t);if(u!==void 0)return u;for(const[p,x]of a)if(x===t)return p;return null},[t,a]),m=P.useRef(null),h=ne(u=>{var p;return((p=u.session)==null?void 0:p.id)??null}),y=ne(u=>u.replayDone),g=P.useRef(h),b=P.useRef(!1);P.useEffect(()=>{g.current!==h&&(g.current=h,b.current=!1)},[h]),P.useEffect(()=>{if(!y||h===null||b.current||s.length===0)return;b.current=!0;const u=s.length-1,p=window.setTimeout(()=>{var x;(x=m.current)==null||x.scrollToIndex({index:u,align:"end",behavior:"smooth"})},50);return()=>window.clearTimeout(p)},[y,h,s.length]);const v=u=>{const p=s[u];return p?EO(p,{selectedSeq:t,pairedSeq:f,onSelect:r,responseToRequest:a,reqTimestampBySeq:c,validationBySeq:l}):null};return d.jsxs("div",{className:"relative flex h-full flex-col",children:[s.length===0?d.jsx("div",{className:"flex h-full items-center justify-center bg-surface-base font-mono text-xs text-ink-muted",children:"no messages match current filters"}):d.jsx(eO,{ref:m,className:"flex-1 bg-surface-base",totalCount:s.length,itemContent:v,atBottomThreshold:NO,initialTopMostItemIndex:Math.max(0,s.length-1),followOutput:u=>u?"auto":!1,computeItemKey:u=>PO(s[u])}),d.jsx(IO,{total:e.length,shown:i.length})]})}function EO(e,t){if(e.type==="message"){const n=e.message,o=t.responseToRequest.get(n.seq),r=o!==void 0?n.timestamp-(t.reqTimestampBySeq.get(o)??n.timestamp):void 0,i=t.validationBySeq.get(n.seq);return d.jsx(TO,{message:n,selected:t.selectedSeq===n.seq,paired:t.pairedSeq===n.seq,...r!==void 0?{latencyMs:r}:{},...i!==void 0?{validation:i}:{},onSelect:t.onSelect})}return d.jsx(_O,{messages:e.messages,combinedText:e.combinedText,firstTimestamp:e.firstTimestamp,lastTimestamp:e.lastTimestamp,selectedSeq:t.selectedSeq,onSelect:t.onSelect})}function PO(e){return e.type==="message"?`m-${e.message.seq}`:`c-${e.firstSeq}-${e.lastSeq}`}function IO({total:e,shown:t}){return e===0||t===e?null:d.jsxs("div",{className:"border-t border-line bg-surface-elev/60 px-4 py-1 text-right font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:["showing ",t," of ",e]})}function OO({message:e,tone:t="info"}){if(!e)return null;const n=t==="success"?"border-accent-out/50 bg-accent-out/10 text-accent-out":t==="warn"?"border-accent-warn/50 bg-accent-warn/10 text-accent-warn":"border-accent-info/50 bg-accent-info/10 text-accent-info";return d.jsx("div",{role:"status",className:K("pointer-events-none fixed right-4 top-[60px] z-50 rounded-sm border px-3 py-2 font-mono text-[11px] uppercase tracking-widest shadow-lg backdrop-blur-sm",n),children:e})}function RO({onImportResult:e}){const[t,n]=P.useState(!1),[o,r]=P.useState(!1),i=P.useRef(null),s=P.useRef(null),a=ne(y=>y.session),l=ne(y=>y.messages.length),c=a!==null&&l>0;P.useEffect(()=>{if(!t)return;const y=b=>{i.current&&!i.current.contains(b.target)&&n(!1)},g=b=>{b.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",g)}},[t]);const f=()=>{var y;n(!1),(y=s.current)==null||y.click()},m=()=>{n(!1);const y=ne.getState();y.session&&y.messages.length>0&&Bb(y.session,y.messages)},h=async y=>{var b;const g=(b=y.target.files)==null?void 0:b[0];if(y.target.value="",!!g){r(!0);try{const v=await _v(g);await Qu(),ft.getState().setSelected(tl(v.id)),e==null||e(`imported ${g.name} · #${v.id} · ${v.messageCount} message${v.messageCount===1?"":"s"}`,"success")}catch(v){const u=v instanceof Error?v.message:String(v);e==null||e(`import failed: ${u}`,"warn")}finally{r(!1)}}};return d.jsxs("div",{ref:i,className:"relative",children:[d.jsx("input",{ref:s,type:"file",accept:"application/json,.json",onChange:h,className:"hidden","aria-hidden":"true",tabIndex:-1}),d.jsx("button",{type:"button",onClick:()=>n(y=>!y),title:"Session actions — import file · export","aria-haspopup":"menu","aria-expanded":t,"aria-label":"session actions",disabled:o,className:K("inline-flex h-7 w-7 items-center justify-center rounded-sm border font-mono text-[14px] leading-none transition-colors",t?"border-line-strong bg-surface-rowHover text-ink-primary":"border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",o&&"cursor-progress opacity-60"),children:d.jsx("span",{"aria-hidden":!0,children:"⋯"})}),t&&d.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+6px)] z-50 w-max overflow-hidden rounded-sm border border-line bg-surface-elev p-1 font-mono text-[11px] uppercase tracking-widest shadow-lg",children:[d.jsx(cy,{icon:"↑",label:"import",onClick:f,title:"Open a session JSON exported earlier — yours or someone else's."}),d.jsx(cy,{icon:"↓",label:"export",onClick:m,disabled:!c,title:"Download this session as JSON. Auth headers and proxy tokens (Authorization, X-Api-Key, JetBrains proxy_key) are redacted — safe to attach to a bug report. For an un-redacted copy (self-debug only), use 'acp-devtools export <id> --raw' in the CLI.",disabledTitle:"Nothing to export yet — wait for the first message."})]})]})}function cy({icon:e,label:t,onClick:n,disabled:o,title:r,disabledTitle:i}){return d.jsxs("button",{type:"button",role:"menuitem",disabled:o,onClick:n,title:o?i:r,className:K("flex w-full items-center gap-2 rounded-[2px] px-2 py-1.5 text-left transition-colors",o?"cursor-not-allowed text-ink-dim opacity-50":"text-ink-muted hover:bg-surface-rowHover hover:text-ink-secondary"),children:[d.jsx("span",{"aria-hidden":!0,className:"w-4 text-center text-[13px] leading-none",children:e}),d.jsx("span",{className:"flex-1",children:t})]})}function AO({onSelect:e,activeUrl:t,overrideUrl:n}){const o=ft(p=>p.captures),r=ft(p=>p.savedSessions),i=ft(p=>p.lastFetchAt),[s,a]=P.useState(!1),l=P.useRef(null);P.useEffect(()=>{if(!s)return;const p=x=>{l.current&&!l.current.contains(x.target)&&a(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);const c=o.find(p=>p.url===t)??null,f=t!==null&&TS(t)?_S(t):null,m=P.useMemo(()=>new Set(o.map(p=>p.sessionDbId).filter(p=>p!==null)),[o]),h=P.useMemo(()=>r.filter(p=>!m.has(p.id)),[r,m]),y=P.useMemo(()=>h.filter(p=>p.imported_at===null),[h]),g=P.useMemo(()=>h.filter(p=>p.imported_at!==null),[h]),b=f!==null?h.find(p=>p.id===f)??null:null,v=o.length+h.length;let u;return n?u="?ws override":c?u=tf(c):b?u=`#${b.id} · ${b.name??(b.client_name?`${b.client_name} · ${Rt(b.agent_command??"")}`:Rt(b.agent_command??""))}`:v===0?u="no captures":u="pick capture",d.jsxs("div",{ref:l,className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:K("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] uppercase tracking-widest transition-colors","border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary",s?"border-line-strong text-ink-primary":""),title:"Select a live capture or saved session",children:[d.jsx("span",{className:"inline-block w-[200px] truncate text-left",children:u}),v>1&&!n&&d.jsx("span",{className:"rounded-sm border border-line-strong px-1 text-[9px] text-ink-secondary",children:v}),d.jsx("span",{"aria-hidden":!0,className:K("transition-transform",s?"rotate-180":""),children:"▾"})]}),s&&d.jsxs("div",{className:K("absolute right-0 top-[calc(100%+6px)] z-50 w-[460px] rounded-md border border-line bg-surface-elev shadow-xl"),children:[d.jsxs(Pc,{children:["live captures · last poll"," ",i?`${Math.round((Date.now()-i)/1e3)}s ago`:"—"]}),o.length===0&&d.jsxs("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:["none. start a proxy with"," ",d.jsx("span",{className:"text-ink-secondary",children:"acp-devtools proxy …"})]}),d.jsx("ul",{className:"max-h-[260px] overflow-y-auto",children:o.map(p=>d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>{e(p.url),a(!1)},title:`${p.agentCommand} · ${p.url}${p.saveTo?" · saved to local store":" · not persisted"}`,className:K("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",p.url===t?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",p.url===t?"bg-accent-out animate-pulse-soft":"bg-accent-warn/50")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsx("span",{className:"text-accent-out",children:p.sessionDbId!==null?`#${p.sessionDbId}`:`pid ${p.pid}`}),d.jsx("span",{className:"text-ink-muted",children:" · "}),p.sessionName??(p.clientName?`${p.clientName} · ${Rt(p.agentCommand)}`:Rt(p.agentCommand))]}),d.jsx("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:Ar(p.startedAt)})]})},p.url))}),d.jsxs(Pc,{children:["saved · ",y.length," session",y.length===1?"":"s"]}),y.length===0&&d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:r.length===0?"no saved sessions yet":g.length>0?"no live-captured sessions yet":"all saved sessions are currently live"}),d.jsx("ul",{className:"max-h-[300px] overflow-y-auto",children:y.map(p=>d.jsx(dy,{s:p,activeUrl:t,onPick:x=>{e(x),a(!1)}},p.id))}),(g.length>0||r.some(p=>p.imported_at!==null))&&d.jsxs(d.Fragment,{children:[d.jsxs(Pc,{children:["imported · ",g.length," file",g.length===1?"":"s"]}),g.length===0?d.jsx("div",{className:"px-3 py-3 text-center font-mono text-[11px] text-ink-muted",children:"no imported files"}):d.jsx("ul",{className:"max-h-[200px] overflow-y-auto",children:g.map(p=>d.jsx(dy,{s:p,activeUrl:t,onPick:x=>{e(x),a(!1)}},p.id))})]}),n&&d.jsx("div",{className:"border-t border-line px-3 py-2 font-mono text-[10px] uppercase tracking-widest text-accent-warn",children:"?ws override active — discovery selection ignored"})]})]})}function Pc({children:e}){return d.jsx("div",{className:"border-b border-line bg-surface-base/50 px-3 py-1.5 font-mono text-[10px] uppercase tracking-widest text-ink-muted",children:e})}function dy({s:e,activeUrl:t,onPick:n}){const o=tl(e.id),r=o===t,i=s=>{s.stopPropagation();const a=e.name??Rt(e.agent_command??"");window.confirm(`Delete session #${e.id} ${a} forever?`)&&(async()=>{try{await kS(e.id),r&&ft.getState().setSelected(null),await Qu()}catch(l){const c=l instanceof Error?l.message:String(l);window.alert(`Delete failed: ${c}`)}})()};return d.jsxs("li",{className:"group relative",children:[d.jsxs("button",{type:"button",onClick:()=>n(o),title:`session #${e.id} · ${e.agent_command??""} · ${e.message_count} messages`,className:K("flex w-full items-baseline gap-3 border-b border-line-grid/70 px-3 py-2 text-left transition-colors hover:bg-surface-rowHover",r?"bg-surface-rowHover":""),children:[d.jsx("span",{"aria-hidden":!0,className:K("h-2 w-2 shrink-0 rounded-full",r?"bg-accent-note animate-pulse-soft":"bg-ink-dim")}),d.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-primary",children:[d.jsxs("span",{className:"text-accent-note",children:["#",e.id]}),d.jsx("span",{className:"text-ink-muted",children:" · "}),e.name??(e.client_name?`${e.client_name} · ${Rt(e.agent_command??"")}`:Rt(e.agent_command??""))]}),d.jsxs("span",{className:"shrink-0 font-mono text-[10px] uppercase tracking-widest text-ink-muted transition-colors group-hover:text-ink-secondary",children:[e.message_count,"msg · ",Ar(e.started_at)]})]}),d.jsx("button",{type:"button",onClick:i,"aria-label":`delete session #${e.id} forever`,title:"Delete this session permanently",className:K("absolute right-2 top-1/2 hidden h-6 w-6 -translate-y-1/2 items-center justify-center rounded-sm border border-line bg-surface-elev/70 text-[12px] leading-none text-ink-muted transition-colors","group-hover:flex hover:border-accent-error/70 hover:bg-surface-rowHover hover:text-accent-error"),children:d.jsx("span",{"aria-hidden":!0,children:"×"})})]})}const Ic=[{mode:"system",label:"AUTO",title:"follow OS theme",icon:"◐"},{mode:"light",label:"LIGHT",title:"force light theme",icon:"☀"},{mode:"dark",label:"DARK",title:"force dark theme",icon:"☾"}];function MO(){const e=Pd(s=>s.mode),t=Pd(s=>s.setMode),[n,o]=P.useState(!1),r=P.useRef(null);P.useEffect(()=>{if(!n)return;const s=a=>{r.current&&!r.current.contains(a.target)&&o(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const i=Ic.find(s=>s.mode===e)??Ic[0];return d.jsxs("div",{ref:r,className:"relative",children:[d.jsx("button",{type:"button",onClick:()=>o(s=>!s),title:`theme · ${i.title}`,"aria-haspopup":"menu","aria-expanded":n,className:K("inline-flex h-7 w-7 items-center justify-center rounded-sm border font-mono text-[12px] transition-colors",n?"border-line-strong bg-surface-rowHover text-ink-primary":"border-line bg-surface-row text-ink-secondary hover:border-line-strong hover:text-ink-primary"),children:d.jsx("span",{"aria-hidden":!0,children:i.icon})}),n&&d.jsx("div",{role:"menu",className:"absolute right-0 top-[calc(100%+6px)] z-50 inline-flex items-center gap-px rounded-sm border border-line bg-surface-elev p-px font-mono text-[10px] uppercase tracking-widest shadow-lg",children:Ic.map(s=>{const a=s.mode===e;return d.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":a,onClick:()=>{t(s.mode),o(!1)},title:s.title,className:K("inline-flex items-center gap-1 rounded-[2px] px-2 py-1 transition-colors",a?"bg-accent-out/15 text-accent-out":"text-ink-muted hover:bg-surface-rowHover hover:text-ink-secondary"),children:[d.jsx("span",{"aria-hidden":!0,children:s.icon}),d.jsx("span",{children:s.label})]},s.mode)})})]})}function qO({wsUrl:e,overrideUrl:t,activeUrl:n,isReplay:o,isImported:r=!1,onPickCapture:i,onImportResult:s,onOpenInfo:a,onOpenPerf:l,onOpenDiff:c}){const f=ne(b=>b.connection),m=ne(b=>b.session),h=ne(b=>b.lastError),y=ne(b=>b.messages.length>0?b.messages[b.messages.length-1].timestamp:null),g=Xb(5e3);return d.jsxs("header",{className:"flex items-center justify-between border-b border-line bg-surface-base px-5 py-2.5",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"wordmark-rule",children:d.jsx("span",{className:"font-display text-[18px] uppercase tracking-[0.18em] text-ink-primary",children:"acp.devtools"})}),d.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-ink-dim",children:"v0.3.0"})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[m&&(()=>{const{primary:b}=Ul(m),v=o||r,u=m.endedAt!==null?m.endedAt:y??m.startedAt,p=v?Ar(m.startedAt,u):Ar(m.startedAt,g),x=y!==null?g-y:null,S=!v&&x!==null&&x>5e3,T=_a(m.startedAt,g),C=r?"IMPORTED":o?"REPLAY":"SESSION",$=r?"session loaded from a JSON file on disk — not connected to any proxy":o?"replay of a saved session — proxy has ended":"live capture — proxy process is still running",j=r?"text-accent-warn":o?"text-accent-note":"text-accent-out";return d.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px] text-ink-secondary",children:[d.jsx("span",{className:"text-ink-muted",title:$,children:C}),d.jsx("span",{className:j,title:m.agentCommand?`session #${m.id} · ${m.agentCommand}`:"persisted session id",children:b}),d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsx("span",{title:`session started at ${T}`,children:_a(m.startedAt,g)}),p&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-muted",title:v?"capture duration (start → end of recorded session)":"how long the proxy process has been alive",children:[v?"lasted":"alive"," ",p]})]}),S&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-ink-muted",children:"·"}),d.jsxs("span",{className:"text-ink-dim",title:`time since the most recent ACP frame · last event ${_a(y,g)}`,children:["idle ",Ar(y,g)]})]})]})})(),d.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&d.jsx(AO,{onSelect:i,activeUrl:n,overrideUrl:t}),d.jsx(UO,{status:f,wsUrl:e,lastError:h,isReplay:o,isImported:r,onReconnect:SS})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[a&&m&&d.jsx("button",{type:"button",onClick:a,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Show session info — client/agent capabilities, runtime state","aria-label":"Open session info panel",children:"info"}),l&&m&&d.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Show performance dashboard — per-method latency stats and waterfall timeline","aria-label":"Open performance dashboard",children:"perf"}),c&&m&&d.jsx("button",{type:"button",onClick:c,className:"inline-flex h-7 items-center rounded-sm border border-line bg-surface-row px-3 font-mono text-[10px] uppercase tracking-widest text-ink-secondary transition-colors hover:bg-surface-rowHover hover:text-ink-primary",title:"Compare this session against another — metadata, per-method latency, and frame-level differences","aria-label":"Open session diff",children:"diff"}),d.jsx(RO,{...s?{onImportResult:s}:{}})]}),d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsx(MO,{})})]})]})}function UO({status:e,wsUrl:t,lastError:n,isReplay:o,isImported:r,onReconnect:i}){if(r)return d.jsxs("div",{className:"inline-flex h-7 cursor-default items-center gap-2 rounded-sm border border-accent-warn/40 bg-accent-warn/10 px-3 font-mono text-[10px] font-semibold uppercase tracking-widest text-accent-warn",title:`viewing data from a JSON file · ${t}`,children:[d.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 rounded-full bg-accent-warn"}),d.jsx("span",{className:"inline-block min-w-[52px] text-center",children:"FILE"})]});const a=e==="open"?o?"REPLAY":"LIVE":e==="connecting"?"WAITING":e==="idle"?"IDLE":e==="closed"?"CLOSED":"ERROR",c={idle:"text-ink-secondary bg-surface-row border-line",connecting:"text-accent-warn/80 bg-accent-warn/10 border-accent-warn/30",open:o?"text-accent-note bg-accent-note/10 border-accent-note/40":"text-accent-out bg-accent-out/10 border-accent-out/40",closed:"text-ink-secondary bg-surface-row border-line",error:"text-accent-error bg-accent-error/10 border-accent-error/40"},m=e==="open"?o?"bg-accent-note animate-pulse-soft":"bg-accent-out animate-pulse-soft":e==="connecting"?"bg-accent-warn/60 animate-pulse-soft":e==="error"?"bg-accent-error":"bg-ink-dim",h=e==="idle"||e==="closed"||e==="error",g=n||(e==="open"?`${o?"serving a recorded session from the local store":"connected to a live proxy capture"} · ${t}`:h?`click to reconnect · ${t}`:t);return d.jsxs("button",{type:"button",onClick:h?i:void 0,disabled:!h,className:K("inline-flex h-7 items-center gap-2 rounded-sm border px-3 font-mono text-[10px] font-semibold uppercase tracking-widest transition-colors",c[e],h?"cursor-pointer hover:bg-surface-rowHover":"cursor-default"),title:g,children:[d.jsx("span",{"aria-hidden":!0,className:K("inline-block h-2 w-2 rounded-full",m)}),d.jsx("span",{className:"inline-block min-w-[52px] text-center",children:a})]})}const ur=JN(),LO=ur?new URLSearchParams(typeof window<"u"?window.location.search:"").get("url"):null;function DO(){const e=ft(w=>w.captures),t=ft(w=>w.selectedUrl),n=ft(w=>w.setSelected),o=ne(w=>{var k;return((k=w.session)==null?void 0:k.importedAt)??null}),r=t,i=t!==null&&/\/replay\/\d+$/.test(t),s=o!==null;P.useEffect(()=>ur?void 0:IS(),[]),P.useEffect(()=>AS(),[]);const[a,l]=P.useState(null),c=P.useRef(new Set);P.useEffect(()=>{const w=gh(window.location.search),k=ne.getState(),N={};Object.keys(w.filters).length>0&&(N.filters={...k.filters,...w.filters}),w.selectedSeq!==null&&(N.selectedSeq=w.selectedSeq),w.detailTab!==null&&(N.detailTab=w.detailTab),w.playbackCap!==null&&(N.playback={...k.playback,cap:w.playbackCap}),Object.keys(N).length>0&&ne.setState(N),w.captureUrl&&ft.getState().setSelected(w.captureUrl)},[]);const[f,m]=P.useState(!1),[h,y]=P.useState(!1),[g,b]=P.useState(!1);P.useEffect(()=>{const w=()=>{const B=ne.getState(),O=ft.getState();nC({filters:B.filters,selectedSeq:B.selectedSeq,detailTab:B.detailTab,playbackCap:B.playback.cap,captureUrl:O.selectedUrl})},k=ne.subscribe(w),N=ft.subscribe(w);return w(),()=>{k(),N()}},[]);const v=()=>{f||(window.history.pushState({drawer:"info"},"",window.location.href),m(!0))},u=()=>{h||(window.history.pushState({drawer:"perf"},"",window.location.href),y(!0))},p=()=>{g||(window.history.pushState({drawer:"diff"},"",window.location.href),b(!0))},x=()=>{f&&window.history.back()},S=()=>{h&&window.history.back()},T=()=>{g&&window.history.back()},C=w=>{window.history.pushState({drawer:null},"",window.location.href),ne.getState().select(w),m(!1),y(!1),b(!1)};P.useEffect(()=>{const w=k=>{const N=k.state;m((N==null?void 0:N.drawer)==="info"),y((N==null?void 0:N.drawer)==="perf"),b((N==null?void 0:N.drawer)==="diff");const B=gh(window.location.search),O=ne.getState(),Y=ft.getState(),ie={};Object.keys(B.filters).length>0&&(ie.filters={...O.filters,...B.filters}),ie.selectedSeq=B.selectedSeq,ie.detailTab=B.detailTab??"tree",ie.playback={...O.playback,cap:B.playbackCap},ne.setState(ie),B.captureUrl!==Y.selectedUrl&&B.captureUrl&&Y.setSelected(B.captureUrl)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),P.useEffect(()=>{const w=new Set(e.map(Y=>Y.url));if(c.current=c.current,i){c.current=w;return}const k=e[0]??null,N=t===null,B=t!==null&&w.has(t),O=k!==null&&!c.current.has(k.url)&&c.current.size>0;e.length===0?t!==null&&n(null):N||!B?n(k.url):O&&k.url!==t&&(n(k.url),l({message:`switched → ${tf(k)}`,tone:"success"})),c.current=w},[e,t,n,i]),P.useEffect(()=>{if(!a)return;let w=3e3,k=Date.now(),N=null;const B=()=>{N===null&&document.visibilityState==="visible"&&(k=Date.now(),N=setTimeout(()=>l(null),w))},O=()=>{N!==null&&(clearTimeout(N),N=null,w=Math.max(0,w-(Date.now()-k)))},Y=()=>{document.visibilityState==="visible"?B():O()};return document.addEventListener("visibilitychange",Y),B(),()=>{document.removeEventListener("visibilitychange",Y),N&&clearTimeout(N)}},[a]),P.useEffect(()=>{if(ur){Cd();return}if(!r){Cd();return}Gu(r)},[r]);const[$,j]=P.useState(!1);P.useEffect(()=>{const w=k=>{if((k.metaKey||k.ctrlKey)&&(k.key==="k"||k.key==="K")){k.preventDefault(),j(B=>!B);return}if($)return;const N=k.target;if(!(N&&(N.tagName==="INPUT"||N.tagName==="TEXTAREA"))){if(k.key==="Escape"){ne.getState().select(null);return}if(k.key==="j"||k.key==="J"){uy(1);return}if(k.key==="k"||k.key==="K"){uy(-1);return}}};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[$]);const R=ne(w=>w.messages),M=ne(w=>w.session),F=ne(w=>w.selectedSeq),V=ne(w=>w.connection),L=ne(w=>w.lastError);P.useEffect(()=>{const w="ACP Devtools";if(!M){document.title=w;return}const{primary:k,secondary:N}=Ul(M),B=N?`${k} · ${N}`:k;document.title=`${B} — ${w}`},[M]);const U=P.useMemo(()=>vS(R,F),[R,F]),D=P.useMemo(()=>{const w=Cl(R),k=new Map;for(const[N,B]of w.entries())k.set(B,N);return{responseToRequest:w,requestToResponse:k}},[R]),Q=P.useMemo(()=>ef(R),[R]);let ee,q=null;if(U){if(U.kind==="response"||U.kind==="error"){const w=D.responseToRequest.get(U.seq);w!==void 0&&(q=R.find(k=>k.seq===w)??null,q&&(ee=U.timestamp-q.timestamp))}else if(U.kind==="request"){const w=D.requestToResponse.get(U.seq);w!==void 0&&(q=R.find(k=>k.seq===w)??null,q&&(ee=q.timestamp-U.timestamp))}}const G=R.length===0&&!M,I=r??"no capture selected",_=ur&&G,A=!ur&&G&&r===null&&e.length===0,E=!ur&&G&&!A;return d.jsxs("div",{className:"flex h-full flex-col bg-surface-base text-ink-primary",children:[d.jsx(OO,{message:(a==null?void 0:a.message)??null,tone:(a==null?void 0:a.tone)??"info"}),d.jsx(KC,{open:$,onClose:()=>j(!1)}),d.jsx(MP,{open:f,onClose:x}),d.jsx(SP,{open:h,onClose:S,onNavigateToSeq:C}),d.jsx(qE,{open:g,onClose:T}),d.jsx(qO,{wsUrl:I,overrideUrl:null,isReplay:i,isImported:s,onPickCapture:w=>{n(w),c.current.add(w)},onImportResult:(w,k)=>l({message:w,tone:k}),activeUrl:r,onOpenInfo:v,onOpenPerf:u,onOpenDiff:p}),d.jsx(ZE,{}),d.jsx("main",{className:"flex-1 overflow-hidden",children:_?d.jsx(OP,{initialUrl:LO}):A?d.jsx(YE,{status:V,lastError:L,url:I,captureCount:e.length}):E?d.jsx(YC,{status:V,url:I,lastError:L}):d.jsx(DP,{storageKey:"acp.split.leftPx",initialLeftFraction:.62,minLeft:420,minRight:360,left:d.jsxs("div",{className:"flex h-full flex-col",children:[d.jsx("div",{className:"min-h-0 flex-1",children:d.jsx(CO,{})}),(i||s)&&d.jsx(AP,{})]}),right:d.jsx(fE,{message:U,...ee!==void 0?{latencyMs:ee}:{},...q?{pairedRequest:q}:{},...U?(()=>{const w=Q.get(U.seq);return w?{validation:w}:{}})():{},onJumpToPaired:w=>ne.getState().select(w)})})}),d.jsx(zP,{})]})}function uy(e){const t=ne.getState(),{messages:n,selectedSeq:o}=t;if(n.length===0)return;if(o===null){const s=e===1?n[0]:n[n.length-1];s&&t.select(s.seq);return}const r=n.findIndex(s=>s.seq===o);if(r===-1){const s=n[0];s&&t.select(s.seq);return}const i=n[r+e];i&&t.select(i.seq)}const Ax=document.getElementById("root");if(!Ax)throw new Error("#root not found");Oc.createRoot(Ax).render(d.jsx(te.StrictMode,{children:d.jsx(DO,{})}));
1768
- //# sourceMappingURL=index-B3QArtIO.js.map