@jaato/web-coder-ui 0.1.2 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -3
- package/bin/jaato-web-coder-ui.d.ts +2 -0
- package/dist/assets/barlow-condensed-latin-500-normal-BgYH2mbd.woff2 +0 -0
- package/dist/assets/barlow-condensed-latin-500-normal-HIEiP5Ov.woff +0 -0
- package/dist/assets/barlow-condensed-latin-600-normal-BFJEwTuo.woff +0 -0
- package/dist/assets/barlow-condensed-latin-600-normal-DepVgxBB.woff2 +0 -0
- package/dist/assets/barlow-condensed-latin-ext-500-normal-B1RE8WP7.woff +0 -0
- package/dist/assets/barlow-condensed-latin-ext-500-normal-yA5ONLQ9.woff2 +0 -0
- package/dist/assets/barlow-condensed-latin-ext-600-normal-18ESti3H.woff2 +0 -0
- package/dist/assets/barlow-condensed-latin-ext-600-normal-Clv9cIcR.woff +0 -0
- package/dist/assets/barlow-condensed-vietnamese-500-normal-CsrJDWc5.woff +0 -0
- package/dist/assets/barlow-condensed-vietnamese-500-normal-DjeaNLFD.woff2 +0 -0
- package/dist/assets/barlow-condensed-vietnamese-600-normal-A5AYRdjN.woff2 +0 -0
- package/dist/assets/barlow-condensed-vietnamese-600-normal-CNlPk46_.woff +0 -0
- package/dist/assets/barlow-latin-400-normal-fsAxiSwU.woff +0 -0
- package/dist/assets/barlow-latin-400-normal-qiz4-Cze.woff2 +0 -0
- package/dist/assets/barlow-latin-500-normal-BPAOfeC8.woff2 +0 -0
- package/dist/assets/barlow-latin-500-normal-C1h8hMer.woff +0 -0
- package/dist/assets/barlow-latin-600-normal-CNwfPWQD.woff +0 -0
- package/dist/assets/barlow-latin-600-normal-DILqtrty.woff2 +0 -0
- package/dist/assets/barlow-latin-ext-400-normal-CvBsJvxq.woff +0 -0
- package/dist/assets/barlow-latin-ext-400-normal-HxX4XjxC.woff2 +0 -0
- package/dist/assets/barlow-latin-ext-500-normal-CJPcKP2Q.woff +0 -0
- package/dist/assets/barlow-latin-ext-500-normal-DOaysfXq.woff2 +0 -0
- package/dist/assets/barlow-latin-ext-600-normal-B8NK_A3D.woff2 +0 -0
- package/dist/assets/barlow-latin-ext-600-normal-DMVRjfRT.woff +0 -0
- package/dist/assets/barlow-vietnamese-400-normal-BFeobeCK.woff +0 -0
- package/dist/assets/barlow-vietnamese-400-normal-Dpl4UHAZ.woff2 +0 -0
- package/dist/assets/barlow-vietnamese-500-normal-GNfB7rCE.woff +0 -0
- package/dist/assets/barlow-vietnamese-500-normal-zTViEIzf.woff2 +0 -0
- package/dist/assets/barlow-vietnamese-600-normal-CA_GiK2e.woff +0 -0
- package/dist/assets/barlow-vietnamese-600-normal-DcjprdFV.woff2 +0 -0
- package/dist/assets/index-BRRXHsCQ.js +30 -0
- package/dist/assets/index-D6cHhK7P.css +1 -0
- package/dist/build-info.json +4 -4
- package/dist/index.html +2 -2
- package/package.json +3 -1
- package/dist/assets/index-CrrfI72I.js +0 -23
- package/dist/assets/index-Dcvrkw9g.css +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&i(p)}).observe(document,{childList:!0,subtree:!0});function l(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(c){if(c.ep)return;c.ep=!0;const f=l(c);fetch(c.href,f)}})();function u_(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Bo={exports:{}},Yl={};var gm;function c_(){if(gm)return Yl;gm=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function l(i,c,f){var p=null;if(f!==void 0&&(p=""+f),c.key!==void 0&&(p=""+c.key),"key"in c){f={};for(var h in c)h!=="key"&&(f[h]=c[h])}else f=c;return c=f.ref,{$$typeof:s,type:i,key:p,ref:c!==void 0?c:null,props:f}}return Yl.Fragment=o,Yl.jsx=l,Yl.jsxs=l,Yl}var _m;function f_(){return _m||(_m=1,Bo.exports=c_()),Bo.exports}var d=f_(),Go={exports:{}},oe={};var ym;function d_(){if(ym)return oe;ym=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),N=Symbol.iterator;function R(v){return v===null||typeof v!="object"?null:(v=N&&v[N]||v["@@iterator"],typeof v=="function"?v:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,V={};function K(v,z,$){this.props=v,this.context=z,this.refs=V,this.updater=$||B}K.prototype.isReactComponent={},K.prototype.setState=function(v,z){if(typeof v!="object"&&typeof v!="function"&&v!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,v,z,"setState")},K.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function ee(){}ee.prototype=K.prototype;function ne(v,z,$){this.props=v,this.context=z,this.refs=V,this.updater=$||B}var I=ne.prototype=new ee;I.constructor=ne,M(I,K.prototype),I.isPureReactComponent=!0;var W=Array.isArray;function de(){}var Z={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function G(v,z,$){var F=$.ref;return{$$typeof:s,type:v,key:z,ref:F!==void 0?F:null,props:$}}function ie(v,z){return G(v.type,z,v.props)}function te(v){return typeof v=="object"&&v!==null&&v.$$typeof===s}function Q(v){var z={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function($){return z[$]})}var we=/\/+/g;function ze(v,z){return typeof v=="object"&&v!==null&&v.key!=null?Q(""+v.key):z.toString(36)}function Ce(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status=="string"?v.then(de,de):(v.status="pending",v.then(function(z){v.status==="pending"&&(v.status="fulfilled",v.value=z)},function(z){v.status==="pending"&&(v.status="rejected",v.reason=z)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function C(v,z,$,F,ue){var me=typeof v;(me==="undefined"||me==="boolean")&&(v=null);var Ee=!1;if(v===null)Ee=!0;else switch(me){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(v.$$typeof){case s:case o:Ee=!0;break;case b:return Ee=v._init,C(Ee(v._payload),z,$,F,ue)}}if(Ee)return ue=ue(v),Ee=F===""?"."+ze(v,0):F,W(ue)?($="",Ee!=null&&($=Ee.replace(we,"$&/")+"/"),C(ue,z,$,"",function(Za){return Za})):ue!=null&&(te(ue)&&(ue=ie(ue,$+(ue.key==null||v&&v.key===ue.key?"":(""+ue.key).replace(we,"$&/")+"/")+Ee)),z.push(ue)),1;Ee=0;var lt=F===""?".":F+":";if(W(v))for(var Be=0;Be<v.length;Be++)F=v[Be],me=lt+ze(F,Be),Ee+=C(F,z,$,me,ue);else if(Be=R(v),typeof Be=="function")for(v=Be.call(v),Be=0;!(F=v.next()).done;)F=F.value,me=lt+ze(F,Be++),Ee+=C(F,z,$,me,ue);else if(me==="object"){if(typeof v.then=="function")return C(Ce(v),z,$,F,ue);throw z=String(v),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function X(v,z,$){if(v==null)return v;var F=[],ue=0;return C(v,F,"","",function(me){return z.call($,me,ue++)}),F}function re(v){if(v._status===-1){var z=v._result;z=z(),z.then(function($){(v._status===0||v._status===-1)&&(v._status=1,v._result=$)},function($){(v._status===0||v._status===-1)&&(v._status=2,v._result=$)}),v._status===-1&&(v._status=0,v._result=z)}if(v._status===1)return v._result.default;throw v._result}var Se=typeof reportError=="function"?reportError:function(v){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v=="object"&&v!==null&&typeof v.message=="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",v);return}console.error(v)},H={map:X,forEach:function(v,z,$){X(v,function(){z.apply(this,arguments)},$)},count:function(v){var z=0;return X(v,function(){z++}),z},toArray:function(v){return X(v,function(z){return z})||[]},only:function(v){if(!te(v))throw Error("React.Children.only expected to receive a single React element child.");return v}};return oe.Activity=S,oe.Children=H,oe.Component=K,oe.Fragment=l,oe.Profiler=c,oe.PureComponent=ne,oe.StrictMode=i,oe.Suspense=y,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,oe.__COMPILER_RUNTIME={__proto__:null,c:function(v){return Z.H.useMemoCache(v)}},oe.cache=function(v){return function(){return v.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(v,z,$){if(v==null)throw Error("The argument must be a React element, but you passed "+v+".");var F=M({},v.props),ue=v.key;if(z!=null)for(me in z.key!==void 0&&(ue=""+z.key),z)!le.call(z,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&z.ref===void 0||(F[me]=z[me]);var me=arguments.length-2;if(me===1)F.children=$;else if(1<me){for(var Ee=Array(me),lt=0;lt<me;lt++)Ee[lt]=arguments[lt+2];F.children=Ee}return G(v.type,ue,F)},oe.createContext=function(v){return v={$$typeof:p,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null},v.Provider=v,v.Consumer={$$typeof:f,_context:v},v},oe.createElement=function(v,z,$){var F,ue={},me=null;if(z!=null)for(F in z.key!==void 0&&(me=""+z.key),z)le.call(z,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(ue[F]=z[F]);var Ee=arguments.length-2;if(Ee===1)ue.children=$;else if(1<Ee){for(var lt=Array(Ee),Be=0;Be<Ee;Be++)lt[Be]=arguments[Be+2];ue.children=lt}if(v&&v.defaultProps)for(F in Ee=v.defaultProps,Ee)ue[F]===void 0&&(ue[F]=Ee[F]);return G(v,me,ue)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(v){return{$$typeof:h,render:v}},oe.isValidElement=te,oe.lazy=function(v){return{$$typeof:b,_payload:{_status:-1,_result:v},_init:re}},oe.memo=function(v,z){return{$$typeof:_,type:v,compare:z===void 0?null:z}},oe.startTransition=function(v){var z=Z.T,$={};Z.T=$;try{var F=v(),ue=Z.S;ue!==null&&ue($,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(de,Se)}catch(me){Se(me)}finally{z!==null&&$.types!==null&&(z.types=$.types),Z.T=z}},oe.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},oe.use=function(v){return Z.H.use(v)},oe.useActionState=function(v,z,$){return Z.H.useActionState(v,z,$)},oe.useCallback=function(v,z){return Z.H.useCallback(v,z)},oe.useContext=function(v){return Z.H.useContext(v)},oe.useDebugValue=function(){},oe.useDeferredValue=function(v,z){return Z.H.useDeferredValue(v,z)},oe.useEffect=function(v,z){return Z.H.useEffect(v,z)},oe.useEffectEvent=function(v){return Z.H.useEffectEvent(v)},oe.useId=function(){return Z.H.useId()},oe.useImperativeHandle=function(v,z,$){return Z.H.useImperativeHandle(v,z,$)},oe.useInsertionEffect=function(v,z){return Z.H.useInsertionEffect(v,z)},oe.useLayoutEffect=function(v,z){return Z.H.useLayoutEffect(v,z)},oe.useMemo=function(v,z){return Z.H.useMemo(v,z)},oe.useOptimistic=function(v,z){return Z.H.useOptimistic(v,z)},oe.useReducer=function(v,z,$){return Z.H.useReducer(v,z,$)},oe.useRef=function(v){return Z.H.useRef(v)},oe.useState=function(v){return Z.H.useState(v)},oe.useSyncExternalStore=function(v,z,$){return Z.H.useSyncExternalStore(v,z,$)},oe.useTransition=function(){return Z.H.useTransition()},oe.version="19.2.8",oe}var bm;function cu(){return bm||(bm=1,Go.exports=d_()),Go.exports}var Y=cu();const pi=u_(Y);var Yo={exports:{}},Ql={},Qo={exports:{}},Vo={};var xm;function m_(){return xm||(xm=1,(function(s){function o(C,X){var re=C.length;C.push(X);e:for(;0<re;){var Se=re-1>>>1,H=C[Se];if(0<c(H,X))C[Se]=X,C[re]=H,re=Se;else break e}}function l(C){return C.length===0?null:C[0]}function i(C){if(C.length===0)return null;var X=C[0],re=C.pop();if(re!==X){C[0]=re;e:for(var Se=0,H=C.length,v=H>>>1;Se<v;){var z=2*(Se+1)-1,$=C[z],F=z+1,ue=C[F];if(0>c($,re))F<H&&0>c(ue,$)?(C[Se]=ue,C[F]=re,Se=F):(C[Se]=$,C[z]=re,Se=z);else if(F<H&&0>c(ue,re))C[Se]=ue,C[F]=re,Se=F;else break e}}return X}function c(C,X){var re=C.sortIndex-X.sortIndex;return re!==0?re:C.id-X.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var p=Date,h=p.now();s.unstable_now=function(){return p.now()-h}}var y=[],_=[],b=1,S=null,N=3,R=!1,B=!1,M=!1,V=!1,K=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,ne=typeof setImmediate<"u"?setImmediate:null;function I(C){for(var X=l(_);X!==null;){if(X.callback===null)i(_);else if(X.startTime<=C)i(_),X.sortIndex=X.expirationTime,o(y,X);else break;X=l(_)}}function W(C){if(M=!1,I(C),!B)if(l(y)!==null)B=!0,de||(de=!0,Q());else{var X=l(_);X!==null&&Ce(W,X.startTime-C)}}var de=!1,Z=-1,le=5,G=-1;function ie(){return V?!0:!(s.unstable_now()-G<le)}function te(){if(V=!1,de){var C=s.unstable_now();G=C;var X=!0;try{e:{B=!1,M&&(M=!1,ee(Z),Z=-1),R=!0;var re=N;try{t:{for(I(C),S=l(y);S!==null&&!(S.expirationTime>C&&ie());){var Se=S.callback;if(typeof Se=="function"){S.callback=null,N=S.priorityLevel;var H=Se(S.expirationTime<=C);if(C=s.unstable_now(),typeof H=="function"){S.callback=H,I(C),X=!0;break t}S===l(y)&&i(y),I(C)}else i(y);S=l(y)}if(S!==null)X=!0;else{var v=l(_);v!==null&&Ce(W,v.startTime-C),X=!1}}break e}finally{S=null,N=re,R=!1}X=void 0}}finally{X?Q():de=!1}}}var Q;if(typeof ne=="function")Q=function(){ne(te)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,ze=we.port2;we.port1.onmessage=te,Q=function(){ze.postMessage(null)}}else Q=function(){K(te,0)};function Ce(C,X){Z=K(function(){C(s.unstable_now())},X)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(C){C.callback=null},s.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<C?Math.floor(1e3/C):5},s.unstable_getCurrentPriorityLevel=function(){return N},s.unstable_next=function(C){switch(N){case 1:case 2:case 3:var X=3;break;default:X=N}var re=N;N=X;try{return C()}finally{N=re}},s.unstable_requestPaint=function(){V=!0},s.unstable_runWithPriority=function(C,X){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var re=N;N=C;try{return X()}finally{N=re}},s.unstable_scheduleCallback=function(C,X,re){var Se=s.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Se+re:Se):re=Se,C){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=re+H,C={id:b++,callback:X,priorityLevel:C,startTime:re,expirationTime:H,sortIndex:-1},re>Se?(C.sortIndex=re,o(_,C),l(y)===null&&C===l(_)&&(M?(ee(Z),Z=-1):M=!0,Ce(W,re-Se))):(C.sortIndex=H,o(y,C),B||R||(B=!0,de||(de=!0,Q()))),C},s.unstable_shouldYield=ie,s.unstable_wrapCallback=function(C){var X=N;return function(){var re=N;N=X;try{return C.apply(this,arguments)}finally{N=re}}}})(Vo)),Vo}var vm;function p_(){return vm||(vm=1,Qo.exports=m_()),Qo.exports}var Xo={exports:{}},at={};var Sm;function h_(){if(Sm)return at;Sm=1;var s=cu();function o(y){var _="https://react.dev/errors/"+y;if(1<arguments.length){_+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)_+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var i={d:{f:l,r:function(){throw Error(o(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(y,_,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:S==null?null:""+S,children:y,containerInfo:_,implementation:b}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(y,_){if(y==="font")return"";if(typeof _=="string")return _==="use-credentials"?_:""}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,at.createPortal=function(y,_){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(o(299));return f(y,_,null,b)},at.flushSync=function(y){var _=p.T,b=i.p;try{if(p.T=null,i.p=2,y)return y()}finally{p.T=_,i.p=b,i.d.f()}},at.preconnect=function(y,_){typeof y=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,i.d.C(y,_))},at.prefetchDNS=function(y){typeof y=="string"&&i.d.D(y)},at.preinit=function(y,_){if(typeof y=="string"&&_&&typeof _.as=="string"){var b=_.as,S=h(b,_.crossOrigin),N=typeof _.integrity=="string"?_.integrity:void 0,R=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;b==="style"?i.d.S(y,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:S,integrity:N,fetchPriority:R}):b==="script"&&i.d.X(y,{crossOrigin:S,integrity:N,fetchPriority:R,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},at.preinitModule=function(y,_){if(typeof y=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var b=h(_.as,_.crossOrigin);i.d.M(y,{crossOrigin:b,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&i.d.M(y)},at.preload=function(y,_){if(typeof y=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var b=_.as,S=h(b,_.crossOrigin);i.d.L(y,b,{crossOrigin:S,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0,type:typeof _.type=="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority=="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy=="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet=="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes=="string"?_.imageSizes:void 0,media:typeof _.media=="string"?_.media:void 0})}},at.preloadModule=function(y,_){if(typeof y=="string")if(_){var b=h(_.as,_.crossOrigin);i.d.m(y,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:b,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else i.d.m(y)},at.requestFormReset=function(y){i.d.r(y)},at.unstable_batchedUpdates=function(y,_){return y(_)},at.useFormState=function(y,_,b){return p.H.useFormState(y,_,b)},at.useFormStatus=function(){return p.H.useHostTransitionStatus()},at.version="19.2.8",at}var Em;function cp(){if(Em)return Xo.exports;Em=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),Xo.exports=h_(),Xo.exports}var Tm;function g_(){if(Tm)return Ql;Tm=1;var s=p_(),o=cu(),l=cp();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(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 h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(f(e)!==e)throw Error(i(188))}function _(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var u=r.alternate;if(u===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===u.child){for(u=r.child;u;){if(u===n)return y(r),e;if(u===a)return y(r),t;u=u.sibling}throw Error(i(188))}if(n.return!==a.return)n=r,a=u;else{for(var m=!1,g=r.child;g;){if(g===n){m=!0,n=r,a=u;break}if(g===a){m=!0,a=r,n=u;break}g=g.sibling}if(!m){for(g=u.child;g;){if(g===n){m=!0,n=u,a=r;break}if(g===a){m=!0,a=u,n=r;break}g=g.sibling}if(!m)throw Error(i(189))}}if(n.alternate!==a)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,N=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var we=Symbol.for("react.client.reference");function ze(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case K:return"Profiler";case V:return"StrictMode";case W:return"Suspense";case de:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case ne:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:ze(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return ze(e(t))}catch{}}return null}var Ce=Array.isArray,C=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},Se=[],H=-1;function v(e){return{current:e}}function z(e){0>H||(e.current=Se[H],Se[H]=null,H--)}function $(e,t){H++,Se[H]=e.current,e.current=t}var F=v(null),ue=v(null),me=v(null),Ee=v(null);function lt(e,t){switch($(me,t),$(ue,e),$(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Bd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(F),$(F,e)}function Be(){z(F),z(ue),z(me)}function Za(e){e.memoizedState!==null&&$(Ee,e);var t=F.current,n=Bd(t,e.type);t!==n&&($(ue,e),$(F,n))}function Jl(e){ue.current===e&&(z(F),z(ue)),Ee.current===e&&(z(Ee),ql._currentValue=re)}var vi,pu;function Un(e){if(vi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);vi=t&&t[1]||"",pu=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+vi+e+pu}var Si=!1;function Ei(e,t){if(!e||Si)return"";Si=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(j){var A=j}Reflect.construct(e,[],U)}else{try{U.call()}catch(j){A=j}e.call(U.prototype)}}else{try{throw Error()}catch(j){A=j}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(j){if(j&&A&&typeof j.stack=="string")return[j.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),m=u[0],g=u[1];if(m&&g){var x=m.split(`
|
|
4
|
+
`),k=g.split(`
|
|
5
|
+
`);for(r=a=0;a<x.length&&!x[a].includes("DetermineComponentFrameRoot");)a++;for(;r<k.length&&!k[r].includes("DetermineComponentFrameRoot");)r++;if(a===x.length||r===k.length)for(a=x.length-1,r=k.length-1;1<=a&&0<=r&&x[a]!==k[r];)r--;for(;1<=a&&0<=r;a--,r--)if(x[a]!==k[r]){if(a!==1||r!==1)do if(a--,r--,0>r||x[a]!==k[r]){var O=`
|
|
6
|
+
`+x[a].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),O}while(1<=a&&0<=r);break}}}finally{Si=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Un(n):""}function Bp(e,t){switch(e.tag){case 26:case 27:case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return e.child!==t&&t!==null?Un("Suspense Fallback"):Un("Suspense");case 19:return Un("SuspenseList");case 0:case 15:return Ei(e.type,!1);case 11:return Ei(e.type.render,!1);case 1:return Ei(e.type,!0);case 31:return Un("Activity");default:return""}}function hu(e){try{var t="",n=null;do t+=Bp(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
7
|
+
Error generating stack: `+a.message+`
|
|
8
|
+
`+a.stack}}var Ti=Object.prototype.hasOwnProperty,Ni=s.unstable_scheduleCallback,wi=s.unstable_cancelCallback,Gp=s.unstable_shouldYield,Yp=s.unstable_requestPaint,pt=s.unstable_now,Qp=s.unstable_getCurrentPriorityLevel,gu=s.unstable_ImmediatePriority,_u=s.unstable_UserBlockingPriority,Wl=s.unstable_NormalPriority,Vp=s.unstable_LowPriority,yu=s.unstable_IdlePriority,Xp=s.log,Kp=s.unstable_setDisableYieldValue,Ja=null,ht=null;function fn(e){if(typeof Xp=="function"&&Kp(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(Ja,e)}catch{}}var gt=Math.clz32?Math.clz32:Zp,Ip=Math.log,$p=Math.LN2;function Zp(e){return e>>>=0,e===0?32:31-(Ip(e)/$p|0)|0}var Fl=256,Pl=262144,es=4194304;function Ln(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ts(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,u=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~u,a!==0?r=Ln(a):(m&=g,m!==0?r=Ln(m):n||(n=g&~e,n!==0&&(r=Ln(n))))):(g=a&~u,g!==0?r=Ln(g):m!==0?r=Ln(m):n||(n=a&~e,n!==0&&(r=Ln(n)))),r===0?0:t!==0&&t!==r&&(t&u)===0&&(u=r&-r,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:r}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Jp(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bu(){var e=es;return es<<=1,(es&62914560)===0&&(es=4194304),e}function ki(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Wp(e,t,n,a,r,u){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,x=e.expirationTimes,k=e.hiddenUpdates;for(n=m&~n;0<n;){var O=31-gt(n),U=1<<O;g[O]=0,x[O]=-1;var A=k[O];if(A!==null)for(k[O]=null,O=0;O<A.length;O++){var j=A[O];j!==null&&(j.lane&=-536870913)}n&=~U}a!==0&&xu(e,a,0),u!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=u&~(m&~t))}function xu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-gt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function vu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-gt(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function Su(e,t){var n=t&-t;return n=(n&42)!==0?1:Ai(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ai(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ji(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Eu(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:um(e.type))}function Tu(e,t){var n=X.p;try{return X.p=e,t()}finally{X.p=n}}var dn=Math.random().toString(36).slice(2),Fe="__reactFiber$"+dn,rt="__reactProps$"+dn,ia="__reactContainer$"+dn,Oi="__reactEvents$"+dn,Fp="__reactListeners$"+dn,Pp="__reactHandles$"+dn,Nu="__reactResources$"+dn,Pa="__reactMarker$"+dn;function Ci(e){delete e[Fe],delete e[rt],delete e[Oi],delete e[Fp],delete e[Pp]}function ra(e){var t=e[Fe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ia]||n[Fe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Id(e);e!==null;){if(n=e[Fe])return n;e=Id(e)}return t}e=n,n=e.parentNode}return null}function oa(e){if(e=e[Fe]||e[ia]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function el(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ua(e){var t=e[Nu];return t||(t=e[Nu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ze(e){e[Pa]=!0}var wu=new Set,ku={};function qn(e,t){ca(e,t),ca(e+"Capture",t)}function ca(e,t){for(ku[e]=t,e=0;e<t.length;e++)wu.add(t[e])}var eh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Au={},ju={};function th(e){return Ti.call(ju,e)?!0:Ti.call(Au,e)?!1:eh.test(e)?ju[e]=!0:(Au[e]=!0,!1)}function ns(e,t,n){if(th(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function as(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Xt(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ou(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nh(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(m){n=""+m,u.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ri(e){if(!e._valueTracker){var t=Ou(e)?"checked":"value";e._valueTracker=nh(e,t,""+e[t])}}function Cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Ou(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function ls(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}}var ah=/[\n"\\]/g;function kt(e){return e.replace(ah,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mi(e,t,n,a,r,u,m,g){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wt(t)):e.value!==""+wt(t)&&(e.value=""+wt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?Di(e,m,wt(t)):n!=null?Di(e,m,wt(n)):a!=null&&e.removeAttribute("value"),r==null&&u!=null&&(e.defaultChecked=!!u),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+wt(g):e.removeAttribute("name")}function Ru(e,t,n,a,r,u,m,g){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ri(e);return}n=n!=null?""+wt(n):"",t=t!=null?""+wt(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Ri(e)}function Di(e,t,n){t==="number"&&ls(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function fa(e,t,n,a){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&&a&&(e[n].defaultSelected=!0)}else{for(n=""+wt(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Mu(e,t,n){if(t!=null&&(t=""+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+wt(n):""}function Du(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(i(92));if(Ce(a)){if(1<a.length)throw Error(i(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=wt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Ri(e)}function da(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zu(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||lh.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Uu(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&zu(e,r,a)}else for(var u in t)t.hasOwnProperty(u)&&zu(e,u,t[u])}function zi(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ih=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ss(e){return ih.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kt(){}var Ui=null;function Li(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ma=null,pa=null;function Lu(e){var t=oa(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mi(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+kt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[rt]||null;if(!r)throw Error(i(90));Mi(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Cu(a)}break e;case"textarea":Mu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&fa(e,!!n.multiple,t,!1)}}}var qi=!1;function qu(e,t,n){if(qi)return e(t,n);qi=!0;try{var a=e(t);return a}finally{if(qi=!1,(ma!==null||pa!==null)&&(Ks(),ma&&(t=ma,e=pa,pa=ma=null,Lu(t),e)))for(t=0;t<e.length;t++)Lu(e[t])}}function tl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[rt]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var It=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hi=!1;if(It)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Hi=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Hi=!1}var mn=null,Bi=null,is=null;function Hu(){if(is)return is;var e,t=Bi,n=t.length,a,r="value"in mn?mn.value:mn.textContent,u=r.length;for(e=0;e<n&&t[e]===r[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===r[u-a];a++);return is=r.slice(e,1<a?1-a:void 0)}function rs(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 os(){return!0}function Bu(){return!1}function ot(e){function t(n,a,r,u,m){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=u,this.target=m,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(u):u[g]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?os:Bu,this.isPropagationStopped=Bu,this}return S(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=os)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=os)},persist:function(){},isPersistent:os}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},us=ot(Hn),al=S({},Hn,{view:0,detail:0}),rh=ot(al),Gi,Yi,ll,cs=S({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vi,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!==ll&&(ll&&e.type==="mousemove"?(Gi=e.screenX-ll.screenX,Yi=e.screenY-ll.screenY):Yi=Gi=0,ll=e),Gi)},movementY:function(e){return"movementY"in e?e.movementY:Yi}}),Gu=ot(cs),oh=S({},cs,{dataTransfer:0}),uh=ot(oh),ch=S({},al,{relatedTarget:0}),Qi=ot(ch),fh=S({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0}),dh=ot(fh),mh=S({},Hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ph=ot(mh),hh=S({},Hn,{data:0}),Yu=ot(hh),gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_h={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"},yh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yh[e])?!!t[e]:!1}function Vi(){return bh}var xh=S({},al,{key:function(e){if(e.key){var t=gh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_h[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vi,charCode:function(e){return e.type==="keypress"?rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vh=ot(xh),Sh=S({},cs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qu=ot(Sh),Eh=S({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vi}),Th=ot(Eh),Nh=S({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),wh=ot(Nh),kh=S({},cs,{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}),Ah=ot(kh),jh=S({},Hn,{newState:0,oldState:0}),Oh=ot(jh),Ch=[9,13,27,32],Xi=It&&"CompositionEvent"in window,sl=null;It&&"documentMode"in document&&(sl=document.documentMode);var Rh=It&&"TextEvent"in window&&!sl,Vu=It&&(!Xi||sl&&8<sl&&11>=sl),Xu=" ",Ku=!1;function Iu(e,t){switch(e){case"keyup":return Ch.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $u(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ha=!1;function Mh(e,t){switch(e){case"compositionend":return $u(t);case"keypress":return t.which!==32?null:(Ku=!0,Xu);case"textInput":return e=t.data,e===Xu&&Ku?null:e;default:return null}}function Dh(e,t){if(ha)return e==="compositionend"||!Xi&&Iu(e,t)?(e=Hu(),is=Bi=mn=null,ha=!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 Vu&&t.locale!=="ko"?null:t.data;default:return null}}var zh={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 Zu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zh[e.type]:t==="textarea"}function Ju(e,t,n,a){ma?pa?pa.push(a):pa=[a]:ma=a,t=Ps(t,"onChange"),0<t.length&&(n=new us("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var il=null,rl=null;function Uh(e){Md(e,0)}function fs(e){var t=el(e);if(Cu(t))return e}function Wu(e,t){if(e==="change")return t}var Fu=!1;if(It){var Ki;if(It){var Ii="oninput"in document;if(!Ii){var Pu=document.createElement("div");Pu.setAttribute("oninput","return;"),Ii=typeof Pu.oninput=="function"}Ki=Ii}else Ki=!1;Fu=Ki&&(!document.documentMode||9<document.documentMode)}function ec(){il&&(il.detachEvent("onpropertychange",tc),rl=il=null)}function tc(e){if(e.propertyName==="value"&&fs(rl)){var t=[];Ju(t,rl,e,Li(e)),qu(Uh,t)}}function Lh(e,t,n){e==="focusin"?(ec(),il=t,rl=n,il.attachEvent("onpropertychange",tc)):e==="focusout"&&ec()}function qh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fs(rl)}function Hh(e,t){if(e==="click")return fs(t)}function Bh(e,t){if(e==="input"||e==="change")return fs(t)}function Gh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:Gh;function ol(e,t){if(_t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Ti.call(t,r)||!_t(e[r],t[r]))return!1}return!0}function nc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ac(e,t){var n=nc(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nc(n)}}function lc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ls(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ls(e.document)}return t}function $i(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Yh=It&&"documentMode"in document&&11>=document.documentMode,ga=null,Zi=null,ul=null,Ji=!1;function ic(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ji||ga==null||ga!==ls(a)||(a=ga,"selectionStart"in a&&$i(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ul&&ol(ul,a)||(ul=a,a=Ps(Zi,"onSelect"),0<a.length&&(t=new us("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ga)))}function Bn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _a={animationend:Bn("Animation","AnimationEnd"),animationiteration:Bn("Animation","AnimationIteration"),animationstart:Bn("Animation","AnimationStart"),transitionrun:Bn("Transition","TransitionRun"),transitionstart:Bn("Transition","TransitionStart"),transitioncancel:Bn("Transition","TransitionCancel"),transitionend:Bn("Transition","TransitionEnd")},Wi={},rc={};It&&(rc=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Gn(e){if(Wi[e])return Wi[e];if(!_a[e])return e;var t=_a[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in rc)return Wi[e]=t[n];return e}var oc=Gn("animationend"),uc=Gn("animationiteration"),cc=Gn("animationstart"),Qh=Gn("transitionrun"),Vh=Gn("transitionstart"),Xh=Gn("transitioncancel"),fc=Gn("transitionend"),dc=new Map,Fi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Fi.push("scrollEnd");function Ut(e,t){dc.set(e,t),qn(t,[e])}var ds=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},At=[],ya=0,Pi=0;function ms(){for(var e=ya,t=Pi=ya=0;t<e;){var n=At[t];At[t++]=null;var a=At[t];At[t++]=null;var r=At[t];At[t++]=null;var u=At[t];if(At[t++]=null,a!==null&&r!==null){var m=a.pending;m===null?r.next=r:(r.next=m.next,m.next=r),a.pending=r}u!==0&&mc(n,r,u)}}function ps(e,t,n,a){At[ya++]=e,At[ya++]=t,At[ya++]=n,At[ya++]=a,Pi|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function er(e,t,n,a){return ps(e,t,n,a),hs(e)}function Yn(e,t){return ps(e,null,null,t),hs(e)}function mc(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,u=e.return;u!==null;)u.childLanes|=n,a=u.alternate,a!==null&&(a.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(r=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,r&&t!==null&&(r=31-gt(n),e=u.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),u):null}function hs(e){if(50<Cl)throw Cl=0,uo=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ba={};function Kh(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,a){return new Kh(e,t,n,a)}function tr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $t(e,t){var n=e.alternate;return n===null?(n=yt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function pc(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function gs(e,t,n,a,r,u){var m=0;if(a=e,typeof e=="function")tr(e)&&(m=1);else if(typeof e=="string")m=Wg(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=yt(31,n,t,r),e.elementType=G,e.lanes=u,e;case M:return Qn(n.children,r,u,t);case V:m=8,r|=24;break;case K:return e=yt(12,n,t,r|2),e.elementType=K,e.lanes=u,e;case W:return e=yt(13,n,t,r),e.elementType=W,e.lanes=u,e;case de:return e=yt(19,n,t,r),e.elementType=de,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ne:m=10;break e;case ee:m=9;break e;case I:m=11;break e;case Z:m=14;break e;case le:m=16,a=null;break e}m=29,n=Error(i(130,e===null?"null":typeof e,"")),a=null}return t=yt(m,n,t,r),t.elementType=e,t.type=a,t.lanes=u,t}function Qn(e,t,n,a){return e=yt(7,e,a,t),e.lanes=n,e}function nr(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function hc(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function ar(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gc=new WeakMap;function jt(e,t){if(typeof e=="object"&&e!==null){var n=gc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:hu(t)},gc.set(e,t),t)}return{value:e,source:t,stack:hu(t)}}var xa=[],va=0,_s=null,cl=0,Ot=[],Ct=0,pn=null,Ht=1,Bt="";function Zt(e,t){xa[va++]=cl,xa[va++]=_s,_s=e,cl=t}function _c(e,t,n){Ot[Ct++]=Ht,Ot[Ct++]=Bt,Ot[Ct++]=pn,pn=e;var a=Ht;e=Bt;var r=32-gt(a)-1;a&=~(1<<r),n+=1;var u=32-gt(t)+r;if(30<u){var m=r-r%5;u=(a&(1<<m)-1).toString(32),a>>=m,r-=m,Ht=1<<32-gt(t)+r|n<<r|a,Bt=u+e}else Ht=1<<u|n<<r|a,Bt=e}function lr(e){e.return!==null&&(Zt(e,1),_c(e,1,0))}function sr(e){for(;e===_s;)_s=xa[--va],xa[va]=null,cl=xa[--va],xa[va]=null;for(;e===pn;)pn=Ot[--Ct],Ot[Ct]=null,Bt=Ot[--Ct],Ot[Ct]=null,Ht=Ot[--Ct],Ot[Ct]=null}function yc(e,t){Ot[Ct++]=Ht,Ot[Ct++]=Bt,Ot[Ct++]=pn,Ht=t.id,Bt=t.overflow,pn=e}var Pe=null,Re=null,ye=!1,hn=null,Rt=!1,ir=Error(i(519));function gn(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fl(jt(t,e)),ir}function bc(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Fe]=e,t[rt]=a,n){case"dialog":he("cancel",t),he("close",t);break;case"iframe":case"object":case"embed":he("load",t);break;case"video":case"audio":for(n=0;n<Ml.length;n++)he(Ml[n],t);break;case"source":he("error",t);break;case"img":case"image":case"link":he("error",t),he("load",t);break;case"details":he("toggle",t);break;case"input":he("invalid",t),Ru(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":he("invalid",t);break;case"textarea":he("invalid",t),Du(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Ld(t.textContent,n)?(a.popover!=null&&(he("beforetoggle",t),he("toggle",t)),a.onScroll!=null&&he("scroll",t),a.onScrollEnd!=null&&he("scrollend",t),a.onClick!=null&&(t.onclick=Kt),t=!0):t=!1,t||gn(e,!0)}function xc(e){for(Pe=e.return;Pe;)switch(Pe.tag){case 5:case 31:case 13:Rt=!1;return;case 27:case 3:Rt=!0;return;default:Pe=Pe.return}}function Sa(e){if(e!==Pe)return!1;if(!ye)return xc(e),ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||No(e.type,e.memoizedProps)),n=!n),n&&Re&&gn(e),xc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Re=Kd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Re=Kd(e)}else t===27?(t=Re,On(e.type)?(e=Oo,Oo=null,Re=e):Re=t):Re=Pe?Dt(e.stateNode.nextSibling):null;return!0}function Vn(){Re=Pe=null,ye=!1}function rr(){var e=hn;return e!==null&&(dt===null?dt=e:dt.push.apply(dt,e),hn=null),e}function fl(e){hn===null?hn=[e]:hn.push(e)}var or=v(null),Xn=null,Jt=null;function _n(e,t,n){$(or,t._currentValue),t._currentValue=n}function Wt(e){e._currentValue=or.current,z(or)}function ur(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function cr(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var u=r.dependencies;if(u!==null){var m=r.child;u=u.firstContext;e:for(;u!==null;){var g=u;u=r;for(var x=0;x<t.length;x++)if(g.context===t[x]){u.lanes|=n,g=u.alternate,g!==null&&(g.lanes|=n),ur(u.return,n,e),a||(m=null);break e}u=g.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(i(341));m.lanes|=n,u=m.alternate,u!==null&&(u.lanes|=n),ur(m,n,e),m=null}else m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===e){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function Ea(e,t,n,a){e=null;for(var r=t,u=!1;r!==null;){if(!u){if((r.flags&524288)!==0)u=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(i(387));if(m=m.memoizedProps,m!==null){var g=r.type;_t(r.pendingProps.value,m.value)||(e!==null?e.push(g):e=[g])}}else if(r===Ee.current){if(m=r.alternate,m===null)throw Error(i(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(ql):e=[ql])}r=r.return}e!==null&&cr(t,e,n,a),t.flags|=262144}function ys(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Kn(e){Xn=e,Jt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function et(e){return vc(Xn,e)}function bs(e,t){return Xn===null&&Kn(e),vc(e,t)}function vc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Jt===null){if(e===null)throw Error(i(308));Jt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jt=Jt.next=t;return n}var Ih=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},$h=s.unstable_scheduleCallback,Zh=s.unstable_NormalPriority,Ve={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fr(){return{controller:new Ih,data:new Map,refCount:0}}function dl(e){e.refCount--,e.refCount===0&&$h(Zh,function(){e.controller.abort()})}var ml=null,dr=0,Ta=0,Na=null;function Jh(e,t){if(ml===null){var n=ml=[];dr=0,Ta=go(),Na={status:"pending",value:void 0,then:function(a){n.push(a)}}}return dr++,t.then(Sc,Sc),t}function Sc(){if(--dr===0&&ml!==null){Na!==null&&(Na.status="fulfilled");var e=ml;ml=null,Ta=0,Na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wh(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var Ec=C.S;C.S=function(e,t){rd=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jh(e,t),Ec!==null&&Ec(e,t)};var In=v(null);function mr(){var e=In.current;return e!==null?e:Oe.pooledCache}function xs(e,t){t===null?$(In,In.current):$(In,t.pool)}function Tc(){var e=mr();return e===null?null:{parent:Ve._currentValue,pool:e}}var wa=Error(i(460)),pr=Error(i(474)),vs=Error(i(542)),Ss={then:function(){}};function Nc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wc(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ac(e),e;default:if(typeof t.status=="string")t.then(Kt,Kt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ac(e),e}throw Zn=t,wa}}function $n(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zn=n,wa):n}}var Zn=null;function kc(){if(Zn===null)throw Error(i(459));var e=Zn;return Zn=null,e}function Ac(e){if(e===wa||e===vs)throw Error(i(483))}var ka=null,pl=0;function Es(e){var t=pl;return pl+=1,ka===null&&(ka=[]),wc(ka,e,t)}function hl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ts(e,t){throw t.$$typeof===N?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function jc(e){function t(T,E){if(e){var w=T.deletions;w===null?(T.deletions=[E],T.flags|=16):w.push(E)}}function n(T,E){if(!e)return null;for(;E!==null;)t(T,E),E=E.sibling;return null}function a(T){for(var E=new Map;T!==null;)T.key!==null?E.set(T.key,T):E.set(T.index,T),T=T.sibling;return E}function r(T,E){return T=$t(T,E),T.index=0,T.sibling=null,T}function u(T,E,w){return T.index=w,e?(w=T.alternate,w!==null?(w=w.index,w<E?(T.flags|=67108866,E):w):(T.flags|=67108866,E)):(T.flags|=1048576,E)}function m(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function g(T,E,w,D){return E===null||E.tag!==6?(E=nr(w,T.mode,D),E.return=T,E):(E=r(E,w),E.return=T,E)}function x(T,E,w,D){var ae=w.type;return ae===M?O(T,E,w.props.children,D,w.key):E!==null&&(E.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===le&&$n(ae)===E.type)?(E=r(E,w.props),hl(E,w),E.return=T,E):(E=gs(w.type,w.key,w.props,null,T.mode,D),hl(E,w),E.return=T,E)}function k(T,E,w,D){return E===null||E.tag!==4||E.stateNode.containerInfo!==w.containerInfo||E.stateNode.implementation!==w.implementation?(E=ar(w,T.mode,D),E.return=T,E):(E=r(E,w.children||[]),E.return=T,E)}function O(T,E,w,D,ae){return E===null||E.tag!==7?(E=Qn(w,T.mode,D,ae),E.return=T,E):(E=r(E,w),E.return=T,E)}function U(T,E,w){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=nr(""+E,T.mode,w),E.return=T,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case R:return w=gs(E.type,E.key,E.props,null,T.mode,w),hl(w,E),w.return=T,w;case B:return E=ar(E,T.mode,w),E.return=T,E;case le:return E=$n(E),U(T,E,w)}if(Ce(E)||Q(E))return E=Qn(E,T.mode,w,null),E.return=T,E;if(typeof E.then=="function")return U(T,Es(E),w);if(E.$$typeof===ne)return U(T,bs(T,E),w);Ts(T,E)}return null}function A(T,E,w,D){var ae=E!==null?E.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return ae!==null?null:g(T,E,""+w,D);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case R:return w.key===ae?x(T,E,w,D):null;case B:return w.key===ae?k(T,E,w,D):null;case le:return w=$n(w),A(T,E,w,D)}if(Ce(w)||Q(w))return ae!==null?null:O(T,E,w,D,null);if(typeof w.then=="function")return A(T,E,Es(w),D);if(w.$$typeof===ne)return A(T,E,bs(T,w),D);Ts(T,w)}return null}function j(T,E,w,D,ae){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return T=T.get(w)||null,g(E,T,""+D,ae);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case R:return T=T.get(D.key===null?w:D.key)||null,x(E,T,D,ae);case B:return T=T.get(D.key===null?w:D.key)||null,k(E,T,D,ae);case le:return D=$n(D),j(T,E,w,D,ae)}if(Ce(D)||Q(D))return T=T.get(w)||null,O(E,T,D,ae,null);if(typeof D.then=="function")return j(T,E,w,Es(D),ae);if(D.$$typeof===ne)return j(T,E,w,bs(E,D),ae);Ts(E,D)}return null}function J(T,E,w,D){for(var ae=null,be=null,P=E,fe=E=0,_e=null;P!==null&&fe<w.length;fe++){P.index>fe?(_e=P,P=null):_e=P.sibling;var xe=A(T,P,w[fe],D);if(xe===null){P===null&&(P=_e);break}e&&P&&xe.alternate===null&&t(T,P),E=u(xe,E,fe),be===null?ae=xe:be.sibling=xe,be=xe,P=_e}if(fe===w.length)return n(T,P),ye&&Zt(T,fe),ae;if(P===null){for(;fe<w.length;fe++)P=U(T,w[fe],D),P!==null&&(E=u(P,E,fe),be===null?ae=P:be.sibling=P,be=P);return ye&&Zt(T,fe),ae}for(P=a(P);fe<w.length;fe++)_e=j(P,T,fe,w[fe],D),_e!==null&&(e&&_e.alternate!==null&&P.delete(_e.key===null?fe:_e.key),E=u(_e,E,fe),be===null?ae=_e:be.sibling=_e,be=_e);return e&&P.forEach(function(zn){return t(T,zn)}),ye&&Zt(T,fe),ae}function se(T,E,w,D){if(w==null)throw Error(i(151));for(var ae=null,be=null,P=E,fe=E=0,_e=null,xe=w.next();P!==null&&!xe.done;fe++,xe=w.next()){P.index>fe?(_e=P,P=null):_e=P.sibling;var zn=A(T,P,xe.value,D);if(zn===null){P===null&&(P=_e);break}e&&P&&zn.alternate===null&&t(T,P),E=u(zn,E,fe),be===null?ae=zn:be.sibling=zn,be=zn,P=_e}if(xe.done)return n(T,P),ye&&Zt(T,fe),ae;if(P===null){for(;!xe.done;fe++,xe=w.next())xe=U(T,xe.value,D),xe!==null&&(E=u(xe,E,fe),be===null?ae=xe:be.sibling=xe,be=xe);return ye&&Zt(T,fe),ae}for(P=a(P);!xe.done;fe++,xe=w.next())xe=j(P,T,fe,xe.value,D),xe!==null&&(e&&xe.alternate!==null&&P.delete(xe.key===null?fe:xe.key),E=u(xe,E,fe),be===null?ae=xe:be.sibling=xe,be=xe);return e&&P.forEach(function(o_){return t(T,o_)}),ye&&Zt(T,fe),ae}function je(T,E,w,D){if(typeof w=="object"&&w!==null&&w.type===M&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case R:e:{for(var ae=w.key;E!==null;){if(E.key===ae){if(ae=w.type,ae===M){if(E.tag===7){n(T,E.sibling),D=r(E,w.props.children),D.return=T,T=D;break e}}else if(E.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===le&&$n(ae)===E.type){n(T,E.sibling),D=r(E,w.props),hl(D,w),D.return=T,T=D;break e}n(T,E);break}else t(T,E);E=E.sibling}w.type===M?(D=Qn(w.props.children,T.mode,D,w.key),D.return=T,T=D):(D=gs(w.type,w.key,w.props,null,T.mode,D),hl(D,w),D.return=T,T=D)}return m(T);case B:e:{for(ae=w.key;E!==null;){if(E.key===ae)if(E.tag===4&&E.stateNode.containerInfo===w.containerInfo&&E.stateNode.implementation===w.implementation){n(T,E.sibling),D=r(E,w.children||[]),D.return=T,T=D;break e}else{n(T,E);break}else t(T,E);E=E.sibling}D=ar(w,T.mode,D),D.return=T,T=D}return m(T);case le:return w=$n(w),je(T,E,w,D)}if(Ce(w))return J(T,E,w,D);if(Q(w)){if(ae=Q(w),typeof ae!="function")throw Error(i(150));return w=ae.call(w),se(T,E,w,D)}if(typeof w.then=="function")return je(T,E,Es(w),D);if(w.$$typeof===ne)return je(T,E,bs(T,w),D);Ts(T,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,E!==null&&E.tag===6?(n(T,E.sibling),D=r(E,w),D.return=T,T=D):(n(T,E),D=nr(w,T.mode,D),D.return=T,T=D),m(T)):n(T,E)}return function(T,E,w,D){try{pl=0;var ae=je(T,E,w,D);return ka=null,ae}catch(P){if(P===wa||P===vs)throw P;var be=yt(29,P,null,T.mode);return be.lanes=D,be.return=T,be}}}var Jn=jc(!0),Oc=jc(!1),yn=!1;function hr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xn(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ve&2)!==0){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=hs(e),mc(e,null,n),t}return ps(e,a,t,n),hs(e)}function gl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,vu(e,n)}}function _r(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?r=u=m:u=u.next=m,n=n.next}while(n!==null);u===null?r=u=t:u=u.next=t}else r=u=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var yr=!1;function _l(){if(yr){var e=Na;if(e!==null)throw e}}function yl(e,t,n,a){yr=!1;var r=e.updateQueue;yn=!1;var u=r.firstBaseUpdate,m=r.lastBaseUpdate,g=r.shared.pending;if(g!==null){r.shared.pending=null;var x=g,k=x.next;x.next=null,m===null?u=k:m.next=k,m=x;var O=e.alternate;O!==null&&(O=O.updateQueue,g=O.lastBaseUpdate,g!==m&&(g===null?O.firstBaseUpdate=k:g.next=k,O.lastBaseUpdate=x))}if(u!==null){var U=r.baseState;m=0,O=k=x=null,g=u;do{var A=g.lane&-536870913,j=A!==g.lane;if(j?(ge&A)===A:(a&A)===A){A!==0&&A===Ta&&(yr=!0),O!==null&&(O=O.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var J=e,se=g;A=t;var je=n;switch(se.tag){case 1:if(J=se.payload,typeof J=="function"){U=J.call(je,U,A);break e}U=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=se.payload,A=typeof J=="function"?J.call(je,U,A):J,A==null)break e;U=S({},U,A);break e;case 2:yn=!0}}A=g.callback,A!==null&&(e.flags|=64,j&&(e.flags|=8192),j=r.callbacks,j===null?r.callbacks=[A]:j.push(A))}else j={lane:A,tag:g.tag,payload:g.payload,callback:g.callback,next:null},O===null?(k=O=j,x=U):O=O.next=j,m|=A;if(g=g.next,g===null){if(g=r.shared.pending,g===null)break;j=g,g=j.next,j.next=null,r.lastBaseUpdate=j,r.shared.pending=null}}while(!0);O===null&&(x=U),r.baseState=x,r.firstBaseUpdate=k,r.lastBaseUpdate=O,u===null&&(r.shared.lanes=0),Nn|=m,e.lanes=m,e.memoizedState=U}}function Cc(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Rc(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Cc(n[e],t)}var Aa=v(null),Ns=v(0);function Mc(e,t){e=rn,$(Ns,e),$(Aa,t),rn=e|t.baseLanes}function br(){$(Ns,rn),$(Aa,Aa.current)}function xr(){rn=Ns.current,z(Aa),z(Ns)}var bt=v(null),Mt=null;function vn(e){var t=e.alternate;$(Ge,Ge.current&1),$(bt,e),Mt===null&&(t===null||Aa.current!==null||t.memoizedState!==null)&&(Mt=e)}function vr(e){$(Ge,Ge.current),$(bt,e),Mt===null&&(Mt=e)}function Dc(e){e.tag===22?($(Ge,Ge.current),$(bt,e),Mt===null&&(Mt=e)):Sn()}function Sn(){$(Ge,Ge.current),$(bt,bt.current)}function xt(e){z(bt),Mt===e&&(Mt=null),z(Ge)}var Ge=v(0);function ws(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ao(n)||jo(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Ft=0,ce=null,ke=null,Xe=null,ks=!1,ja=!1,Wn=!1,As=0,bl=0,Oa=null,Fh=0;function Le(){throw Error(i(321))}function Sr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_t(e[n],t[n]))return!1;return!0}function Er(e,t,n,a,r,u){return Ft=u,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?yf:qr,Wn=!1,u=n(a,r),Wn=!1,ja&&(u=Uc(t,n,a,r)),zc(e),u}function zc(e){C.H=Sl;var t=ke!==null&&ke.next!==null;if(Ft=0,Xe=ke=ce=null,ks=!1,bl=0,Oa=null,t)throw Error(i(300));e===null||Ke||(e=e.dependencies,e!==null&&ys(e)&&(Ke=!0))}function Uc(e,t,n,a){ce=e;var r=0;do{if(ja&&(Oa=null),bl=0,ja=!1,25<=r)throw Error(i(301));if(r+=1,Xe=ke=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}C.H=bf,u=t(n,a)}while(ja);return u}function Ph(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?xl(t):t,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(ce.flags|=1024),t}function Tr(){var e=As!==0;return As=0,e}function Nr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wr(e){if(ks){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ks=!1}Ft=0,Xe=ke=ce=null,ja=!1,bl=As=0,Oa=null}function st(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ce.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ye(){if(ke===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=Xe===null?ce.memoizedState:Xe.next;if(t!==null)Xe=t,ke=e;else{if(e===null)throw ce.alternate===null?Error(i(467)):Error(i(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Xe===null?ce.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function js(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xl(e){var t=bl;return bl+=1,Oa===null&&(Oa=[]),e=wc(Oa,e,t),t=ce,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?yf:qr),e}function Os(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xl(e);if(e.$$typeof===ne)return et(e)}throw Error(i(438,String(e)))}function kr(e){var t=null,n=ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=ce.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=js(),ce.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=ie;return t.index++,n}function Pt(e,t){return typeof t=="function"?t(e):t}function Cs(e){var t=Ye();return Ar(t,ke,e)}function Ar(e,t,n){var a=e.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var r=e.baseQueue,u=a.pending;if(u!==null){if(r!==null){var m=r.next;r.next=u.next,u.next=m}t.baseQueue=r=u,a.pending=null}if(u=e.baseState,r===null)e.memoizedState=u;else{t=r.next;var g=m=null,x=null,k=t,O=!1;do{var U=k.lane&-536870913;if(U!==k.lane?(ge&U)===U:(Ft&U)===U){var A=k.revertLane;if(A===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),U===Ta&&(O=!0);else if((Ft&A)===A){k=k.next,A===Ta&&(O=!0);continue}else U={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},x===null?(g=x=U,m=u):x=x.next=U,ce.lanes|=A,Nn|=A;U=k.action,Wn&&n(u,U),u=k.hasEagerState?k.eagerState:n(u,U)}else A={lane:U,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},x===null?(g=x=A,m=u):x=x.next=A,ce.lanes|=U,Nn|=U;k=k.next}while(k!==null&&k!==t);if(x===null?m=u:x.next=g,!_t(u,e.memoizedState)&&(Ke=!0,O&&(n=Na,n!==null)))throw n;e.memoizedState=u,e.baseState=m,e.baseQueue=x,a.lastRenderedState=u}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function jr(e){var t=Ye(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,u=t.memoizedState;if(r!==null){n.pending=null;var m=r=r.next;do u=e(u,m.action),m=m.next;while(m!==r);_t(u,t.memoizedState)||(Ke=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,a]}function Lc(e,t,n){var a=ce,r=Ye(),u=ye;if(u){if(n===void 0)throw Error(i(407));n=n()}else n=t();var m=!_t((ke||r).memoizedState,n);if(m&&(r.memoizedState=n,Ke=!0),r=r.queue,Rr(Bc.bind(null,a,r,e),[e]),r.getSnapshot!==t||m||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,Ca(9,{destroy:void 0},Hc.bind(null,a,r,n,t),null),Oe===null)throw Error(i(349));u||(Ft&127)!==0||qc(a,t,n)}return n}function qc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ce.updateQueue,t===null?(t=js(),ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Hc(e,t,n,a){t.value=n,t.getSnapshot=a,Gc(t)&&Yc(e)}function Bc(e,t,n){return n(function(){Gc(t)&&Yc(e)})}function Gc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_t(e,n)}catch{return!0}}function Yc(e){var t=Yn(e,2);t!==null&&mt(t,e,2)}function Or(e){var t=st();if(typeof e=="function"){var n=e;if(e=n(),Wn){fn(!0);try{n()}finally{fn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:e},t}function Qc(e,t,n,a){return e.baseState=n,Ar(e,ke,typeof a=="function"?a:Pt)}function eg(e,t,n,a,r){if(Ds(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){u.listeners.push(m)}};C.T!==null?n(!0):u.isTransition=!1,a(u),n=t.pending,n===null?(u.next=t.pending=u,Vc(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Vc(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var u=C.T,m={};C.T=m;try{var g=n(r,a),x=C.S;x!==null&&x(m,g),Xc(e,t,g)}catch(k){Cr(e,t,k)}finally{u!==null&&m.types!==null&&(u.types=m.types),C.T=u}}else try{u=n(r,a),Xc(e,t,u)}catch(k){Cr(e,t,k)}}function Xc(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Kc(e,t,a)},function(a){return Cr(e,t,a)}):Kc(e,t,n)}function Kc(e,t,n){t.status="fulfilled",t.value=n,Ic(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vc(e,n)))}function Cr(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Ic(t),t=t.next;while(t!==a)}e.action=null}function Ic(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $c(e,t){return t}function Zc(e,t){if(ye){var n=Oe.formState;if(n!==null){e:{var a=ce;if(ye){if(Re){t:{for(var r=Re,u=Rt;r.nodeType!==8;){if(!u){r=null;break t}if(r=Dt(r.nextSibling),r===null){r=null;break t}}u=r.data,r=u==="F!"||u==="F"?r:null}if(r){Re=Dt(r.nextSibling),a=r.data==="F!";break e}}gn(a)}a=!1}a&&(t=n[0])}}return n=st(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$c,lastRenderedState:t},n.queue=a,n=hf.bind(null,ce,a),a.dispatch=n,a=Or(!1),u=Lr.bind(null,ce,!1,a.queue),a=st(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=eg.bind(null,ce,r,u,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function Jc(e){var t=Ye();return Wc(t,ke,e)}function Wc(e,t,n){if(t=Ar(e,t,$c)[0],e=Cs(Pt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=xl(t)}catch(m){throw m===wa?vs:m}else a=t;t=Ye();var r=t.queue,u=r.dispatch;return n!==t.memoizedState&&(ce.flags|=2048,Ca(9,{destroy:void 0},tg.bind(null,r,n),null)),[a,u,e]}function tg(e,t){e.action=t}function Fc(e){var t=Ye(),n=ke;if(n!==null)return Wc(t,n,e);Ye(),t=t.memoizedState,n=Ye();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ca(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=ce.updateQueue,t===null&&(t=js(),ce.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Pc(){return Ye().memoizedState}function Rs(e,t,n,a){var r=st();ce.flags|=e,r.memoizedState=Ca(1|t,{destroy:void 0},n,a===void 0?null:a)}function Ms(e,t,n,a){var r=Ye();a=a===void 0?null:a;var u=r.memoizedState.inst;ke!==null&&a!==null&&Sr(a,ke.memoizedState.deps)?r.memoizedState=Ca(t,u,n,a):(ce.flags|=e,r.memoizedState=Ca(1|t,u,n,a))}function ef(e,t){Rs(8390656,8,e,t)}function Rr(e,t){Ms(2048,8,e,t)}function ng(e){ce.flags|=4;var t=ce.updateQueue;if(t===null)t=js(),ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function tf(e){var t=Ye().memoizedState;return ng({ref:t,nextImpl:e}),function(){if((ve&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function nf(e,t){return Ms(4,2,e,t)}function af(e,t){return Ms(4,4,e,t)}function lf(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sf(e,t,n){n=n!=null?n.concat([e]):null,Ms(4,4,lf.bind(null,t,e),n)}function Mr(){}function rf(e,t){var n=Ye();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Sr(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function of(e,t){var n=Ye();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Sr(t,a[1]))return a[0];if(a=e(),Wn){fn(!0);try{e()}finally{fn(!1)}}return n.memoizedState=[a,t],a}function Dr(e,t,n){return n===void 0||(Ft&1073741824)!==0&&(ge&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=ud(),ce.lanes|=e,Nn|=e,n)}function uf(e,t,n,a){return _t(n,t)?n:Aa.current!==null?(e=Dr(e,n,a),_t(e,t)||(Ke=!0),e):(Ft&42)===0||(Ft&1073741824)!==0&&(ge&261930)===0?(Ke=!0,e.memoizedState=n):(e=ud(),ce.lanes|=e,Nn|=e,t)}function cf(e,t,n,a,r){var u=X.p;X.p=u!==0&&8>u?u:8;var m=C.T,g={};C.T=g,Lr(e,!1,t,n);try{var x=r(),k=C.S;if(k!==null&&k(g,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var O=Wh(x,a);vl(e,t,O,Et(e))}else vl(e,t,a,Et(e))}catch(U){vl(e,t,{then:function(){},status:"rejected",reason:U},Et())}finally{X.p=u,m!==null&&g.types!==null&&(m.types=g.types),C.T=m}}function ag(){}function zr(e,t,n,a){if(e.tag!==5)throw Error(i(476));var r=ff(e).queue;cf(e,r,t,re,n===null?ag:function(){return df(e),n(a)})}function ff(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function df(e){var t=ff(e);t.next===null&&(t=e.alternate.memoizedState),vl(e,t.next.queue,{},Et())}function Ur(){return et(ql)}function mf(){return Ye().memoizedState}function pf(){return Ye().memoizedState}function lg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Et();e=bn(n);var a=xn(t,e,n);a!==null&&(mt(a,t,n),gl(a,t,n)),t={cache:fr()},e.payload=t;return}t=t.return}}function sg(e,t,n){var a=Et();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e)?gf(t,n):(n=er(e,t,n,a),n!==null&&(mt(n,e,a),_f(n,t,a)))}function hf(e,t,n){var a=Et();vl(e,t,n,a)}function vl(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))gf(t,r);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var m=t.lastRenderedState,g=u(m,n);if(r.hasEagerState=!0,r.eagerState=g,_t(g,m))return ps(e,t,r,0),Oe===null&&ms(),!1}catch{}if(n=er(e,t,r,a),n!==null)return mt(n,e,a),_f(n,t,a),!0}return!1}function Lr(e,t,n,a){if(a={lane:2,revertLane:go(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(i(479))}else t=er(e,n,a,2),t!==null&&mt(t,e,2)}function Ds(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function gf(e,t){ja=ks=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _f(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,vu(e,n)}}var Sl={readContext:et,use:Os,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Sl.useEffectEvent=Le;var yf={readContext:et,use:Os,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:ef,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Rs(4194308,4,lf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=st();t=t===void 0?null:t;var a=e();if(Wn){fn(!0);try{e()}finally{fn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=st();if(n!==void 0){var r=n(t);if(Wn){fn(!0);try{n(t)}finally{fn(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=sg.bind(null,ce,e),[a.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=Or(e);var t=e.queue,n=hf.bind(null,ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Mr,useDeferredValue:function(e,t){var n=st();return Dr(n,e,t)},useTransition:function(){var e=Or(!1);return e=cf.bind(null,ce,e.queue,!0,!1),st().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ce,r=st();if(ye){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Oe===null)throw Error(i(349));(ge&127)!==0||qc(a,t,n)}r.memoizedState=n;var u={value:n,getSnapshot:t};return r.queue=u,ef(Bc.bind(null,a,u,e),[e]),a.flags|=2048,Ca(9,{destroy:void 0},Hc.bind(null,a,u,n,t),null),n},useId:function(){var e=st(),t=Oe.identifierPrefix;if(ye){var n=Bt,a=Ht;n=(a&~(1<<32-gt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=As++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Fh++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ur,useFormState:Zc,useActionState:Zc,useOptimistic:function(e){var t=st();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Lr.bind(null,ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:kr,useCacheRefresh:function(){return st().memoizedState=lg.bind(null,ce)},useEffectEvent:function(e){var t=st(),n={impl:e};return t.memoizedState=n,function(){if((ve&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},qr={readContext:et,use:Os,useCallback:rf,useContext:et,useEffect:Rr,useImperativeHandle:sf,useInsertionEffect:nf,useLayoutEffect:af,useMemo:of,useReducer:Cs,useRef:Pc,useState:function(){return Cs(Pt)},useDebugValue:Mr,useDeferredValue:function(e,t){var n=Ye();return uf(n,ke.memoizedState,e,t)},useTransition:function(){var e=Cs(Pt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:xl(e),t]},useSyncExternalStore:Lc,useId:mf,useHostTransitionStatus:Ur,useFormState:Jc,useActionState:Jc,useOptimistic:function(e,t){var n=Ye();return Qc(n,ke,e,t)},useMemoCache:kr,useCacheRefresh:pf};qr.useEffectEvent=tf;var bf={readContext:et,use:Os,useCallback:rf,useContext:et,useEffect:Rr,useImperativeHandle:sf,useInsertionEffect:nf,useLayoutEffect:af,useMemo:of,useReducer:jr,useRef:Pc,useState:function(){return jr(Pt)},useDebugValue:Mr,useDeferredValue:function(e,t){var n=Ye();return ke===null?Dr(n,e,t):uf(n,ke.memoizedState,e,t)},useTransition:function(){var e=jr(Pt)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:xl(e),t]},useSyncExternalStore:Lc,useId:mf,useHostTransitionStatus:Ur,useFormState:Fc,useActionState:Fc,useOptimistic:function(e,t){var n=Ye();return ke!==null?Qc(n,ke,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:kr,useCacheRefresh:pf};bf.useEffectEvent=tf;function Hr(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Br={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Et(),r=bn(a);r.payload=t,n!=null&&(r.callback=n),t=xn(e,r,a),t!==null&&(mt(t,e,a),gl(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Et(),r=bn(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=xn(e,r,a),t!==null&&(mt(t,e,a),gl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Et(),a=bn(n);a.tag=2,t!=null&&(a.callback=t),t=xn(e,a,n),t!==null&&(mt(t,e,n),gl(t,e,n))}};function xf(e,t,n,a,r,u,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,m):t.prototype&&t.prototype.isPureReactComponent?!ol(n,a)||!ol(r,u):!0}function vf(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Br.enqueueReplaceState(t,t.state,null)}function Fn(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=S({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function Sf(e){ds(e)}function Ef(e){console.error(e)}function Tf(e){ds(e)}function zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Nf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Gr(e,t,n){return n=bn(n),n.tag=3,n.payload={element:null},n.callback=function(){zs(e,t)},n}function wf(e){return e=bn(e),e.tag=3,e}function kf(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var u=a.value;e.payload=function(){return r(u)},e.callback=function(){Nf(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Nf(t,n,a),typeof r!="function"&&(wn===null?wn=new Set([this]):wn.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function ig(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Ea(t,n,r,!0),n=bt.current,n!==null){switch(n.tag){case 31:case 13:return Mt===null?Is():n.alternate===null&&qe===0&&(qe=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===Ss?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),mo(e,a,r)),!1;case 22:return n.flags|=65536,a===Ss?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),mo(e,a,r)),!1}throw Error(i(435,n.tag))}return mo(e,a,r),Is(),!1}if(ye)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==ir&&(e=Error(i(422),{cause:a}),fl(jt(e,n)))):(a!==ir&&(t=Error(i(423),{cause:a}),fl(jt(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=jt(a,n),r=Gr(e.stateNode,a,r),_r(e,r),qe!==4&&(qe=2)),!1;var u=Error(i(520),{cause:a});if(u=jt(u,n),Ol===null?Ol=[u]:Ol.push(u),qe!==4&&(qe=2),t===null)return!0;a=jt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Gr(n.stateNode,a,e),_r(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(wn===null||!wn.has(u))))return n.flags|=65536,r&=-r,n.lanes|=r,r=wf(r),kf(r,e,n,a),_r(n,r),!1}n=n.return}while(n!==null);return!1}var Yr=Error(i(461)),Ke=!1;function tt(e,t,n,a){t.child=e===null?Oc(t,null,n,a):Jn(t,e.child,n,a)}function Af(e,t,n,a,r){n=n.render;var u=t.ref;if("ref"in a){var m={};for(var g in a)g!=="ref"&&(m[g]=a[g])}else m=a;return Kn(t),a=Er(e,t,n,m,u,r),g=Tr(),e!==null&&!Ke?(Nr(e,t,r),en(e,t,r)):(ye&&g&&lr(t),t.flags|=1,tt(e,t,a,r),t.child)}function jf(e,t,n,a,r){if(e===null){var u=n.type;return typeof u=="function"&&!tr(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Of(e,t,u,a,r)):(e=gs(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Jr(e,r)){var m=u.memoizedProps;if(n=n.compare,n=n!==null?n:ol,n(m,a)&&e.ref===t.ref)return en(e,t,r)}return t.flags|=1,e=$t(u,a),e.ref=t.ref,e.return=t,t.child=e}function Of(e,t,n,a,r){if(e!==null){var u=e.memoizedProps;if(ol(u,a)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=a=u,Jr(e,r))(e.flags&131072)!==0&&(Ke=!0);else return t.lanes=e.lanes,en(e,t,r)}return Qr(e,t,n,a,r)}function Cf(e,t,n,a){var r=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(a=t.child=e.child,r=0;a!==null;)r=r|a.lanes|a.childLanes,a=a.sibling;a=r&~u}else a=0,t.child=null;return Rf(e,t,u,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xs(t,u!==null?u.cachePool:null),u!==null?Mc(t,u):br(),Dc(t);else return a=t.lanes=536870912,Rf(e,t,u!==null?u.baseLanes|n:n,n,a)}else u!==null?(xs(t,u.cachePool),Mc(t,u),Sn(),t.memoizedState=null):(e!==null&&xs(t,null),br(),Sn());return tt(e,t,r,n),t.child}function El(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rf(e,t,n,a,r){var u=mr();return u=u===null?null:{parent:Ve._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&xs(t,null),br(),Dc(t),e!==null&&Ea(e,t,a,!0),t.childLanes=r,null}function Us(e,t){return t=qs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Mf(e,t,n){return Jn(t,e.child,null,n),e=Us(t,t.pendingProps),e.flags|=2,xt(t),t.memoizedState=null,e}function rg(e,t,n){var a=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ye){if(a.mode==="hidden")return e=Us(t,a),t.lanes=536870912,El(null,e);if(vr(t),(e=Re)?(e=Xd(e,Rt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pn!==null?{id:Ht,overflow:Bt}:null,retryLane:536870912,hydrationErrors:null},n=hc(e),n.return=t,t.child=n,Pe=t,Re=null)):e=null,e===null)throw gn(t);return t.lanes=536870912,null}return Us(t,a)}var u=e.memoizedState;if(u!==null){var m=u.dehydrated;if(vr(t),r)if(t.flags&256)t.flags&=-257,t=Mf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ke||Ea(e,t,n,!1),r=(n&e.childLanes)!==0,Ke||r){if(a=Oe,a!==null&&(m=Su(a,n),m!==0&&m!==u.retryLane))throw u.retryLane=m,Yn(e,m),mt(a,e,m),Yr;Is(),t=Mf(e,t,n)}else e=u.treeContext,Re=Dt(m.nextSibling),Pe=t,ye=!0,hn=null,Rt=!1,e!==null&&yc(t,e),t=Us(t,a),t.flags|=4096;return t}return e=$t(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ls(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Qr(e,t,n,a,r){return Kn(t),n=Er(e,t,n,a,void 0,r),a=Tr(),e!==null&&!Ke?(Nr(e,t,r),en(e,t,r)):(ye&&a&&lr(t),t.flags|=1,tt(e,t,n,r),t.child)}function Df(e,t,n,a,r,u){return Kn(t),t.updateQueue=null,n=Uc(t,a,n,r),zc(e),a=Tr(),e!==null&&!Ke?(Nr(e,t,u),en(e,t,u)):(ye&&a&&lr(t),t.flags|=1,tt(e,t,n,u),t.child)}function zf(e,t,n,a,r){if(Kn(t),t.stateNode===null){var u=ba,m=n.contextType;typeof m=="object"&&m!==null&&(u=et(m)),u=new n(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Br,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},hr(t),m=n.contextType,u.context=typeof m=="object"&&m!==null?et(m):ba,u.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Hr(t,n,m,a),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(m=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),m!==u.state&&Br.enqueueReplaceState(u,u.state,null),yl(t,a,u,r),_l(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var g=t.memoizedProps,x=Fn(n,g);u.props=x;var k=u.context,O=n.contextType;m=ba,typeof O=="object"&&O!==null&&(m=et(O));var U=n.getDerivedStateFromProps;O=typeof U=="function"||typeof u.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,O||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g||k!==m)&&vf(t,u,a,m),yn=!1;var A=t.memoizedState;u.state=A,yl(t,a,u,r),_l(),k=t.memoizedState,g||A!==k||yn?(typeof U=="function"&&(Hr(t,n,U,a),k=t.memoizedState),(x=yn||xf(t,n,x,a,A,k,m))?(O||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=k),u.props=a,u.state=k,u.context=m,a=x):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,gr(e,t),m=t.memoizedProps,O=Fn(n,m),u.props=O,U=t.pendingProps,A=u.context,k=n.contextType,x=ba,typeof k=="object"&&k!==null&&(x=et(k)),g=n.getDerivedStateFromProps,(k=typeof g=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==U||A!==x)&&vf(t,u,a,x),yn=!1,A=t.memoizedState,u.state=A,yl(t,a,u,r),_l();var j=t.memoizedState;m!==U||A!==j||yn||e!==null&&e.dependencies!==null&&ys(e.dependencies)?(typeof g=="function"&&(Hr(t,n,g,a),j=t.memoizedState),(O=yn||xf(t,n,O,a,A,j,x)||e!==null&&e.dependencies!==null&&ys(e.dependencies))?(k||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,j,x),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,j,x)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=j),u.props=a,u.state=j,u.context=x,a=O):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Ls(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Jn(t,e.child,null,r),t.child=Jn(t,null,n,r)):tt(e,t,n,r),t.memoizedState=u.state,e=t.child):e=en(e,t,r),e}function Uf(e,t,n,a){return Vn(),t.flags|=256,tt(e,t,n,a),t.child}var Vr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xr(e){return{baseLanes:e,cachePool:Tc()}}function Kr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=St),e}function Lf(e,t,n){var a=t.pendingProps,r=!1,u=(t.flags&128)!==0,m;if((m=u)||(m=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),m&&(r=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(ye){if(r?vn(t):Sn(),(e=Re)?(e=Xd(e,Rt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pn!==null?{id:Ht,overflow:Bt}:null,retryLane:536870912,hydrationErrors:null},n=hc(e),n.return=t,t.child=n,Pe=t,Re=null)):e=null,e===null)throw gn(t);return jo(e)?t.lanes=32:t.lanes=536870912,null}var g=a.children;return a=a.fallback,r?(Sn(),r=t.mode,g=qs({mode:"hidden",children:g},r),a=Qn(a,r,n,null),g.return=t,a.return=t,g.sibling=a,t.child=g,a=t.child,a.memoizedState=Xr(n),a.childLanes=Kr(e,m,n),t.memoizedState=Vr,El(null,a)):(vn(t),Ir(t,g))}var x=e.memoizedState;if(x!==null&&(g=x.dehydrated,g!==null)){if(u)t.flags&256?(vn(t),t.flags&=-257,t=$r(e,t,n)):t.memoizedState!==null?(Sn(),t.child=e.child,t.flags|=128,t=null):(Sn(),g=a.fallback,r=t.mode,a=qs({mode:"visible",children:a.children},r),g=Qn(g,r,n,null),g.flags|=2,a.return=t,g.return=t,a.sibling=g,t.child=a,Jn(t,e.child,null,n),a=t.child,a.memoizedState=Xr(n),a.childLanes=Kr(e,m,n),t.memoizedState=Vr,t=El(null,a));else if(vn(t),jo(g)){if(m=g.nextSibling&&g.nextSibling.dataset,m)var k=m.dgst;m=k,a=Error(i(419)),a.stack="",a.digest=m,fl({value:a,source:null,stack:null}),t=$r(e,t,n)}else if(Ke||Ea(e,t,n,!1),m=(n&e.childLanes)!==0,Ke||m){if(m=Oe,m!==null&&(a=Su(m,n),a!==0&&a!==x.retryLane))throw x.retryLane=a,Yn(e,a),mt(m,e,a),Yr;Ao(g)||Is(),t=$r(e,t,n)}else Ao(g)?(t.flags|=192,t.child=e.child,t=null):(e=x.treeContext,Re=Dt(g.nextSibling),Pe=t,ye=!0,hn=null,Rt=!1,e!==null&&yc(t,e),t=Ir(t,a.children),t.flags|=4096);return t}return r?(Sn(),g=a.fallback,r=t.mode,x=e.child,k=x.sibling,a=$t(x,{mode:"hidden",children:a.children}),a.subtreeFlags=x.subtreeFlags&65011712,k!==null?g=$t(k,g):(g=Qn(g,r,n,null),g.flags|=2),g.return=t,a.return=t,a.sibling=g,t.child=a,El(null,a),a=t.child,g=e.child.memoizedState,g===null?g=Xr(n):(r=g.cachePool,r!==null?(x=Ve._currentValue,r=r.parent!==x?{parent:x,pool:x}:r):r=Tc(),g={baseLanes:g.baseLanes|n,cachePool:r}),a.memoizedState=g,a.childLanes=Kr(e,m,n),t.memoizedState=Vr,El(e.child,a)):(vn(t),n=e.child,e=n.sibling,n=$t(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Ir(e,t){return t=qs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function qs(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function $r(e,t,n){return Jn(t,e.child,null,n),e=Ir(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ur(e.return,t,n)}function Zr(e,t,n,a,r,u){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r,treeForkCount:u}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=r,m.treeForkCount=u)}function Hf(e,t,n){var a=t.pendingProps,r=a.revealOrder,u=a.tail;a=a.children;var m=Ge.current,g=(m&2)!==0;if(g?(m=m&1|2,t.flags|=128):m&=1,$(Ge,m),tt(e,t,a,n),a=ye?cl:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&qf(e,n,t);else if(e.tag===19)qf(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}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ws(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Zr(t,!1,r,n,u,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ws(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Zr(t,!0,n,null,u,a);break;case"together":Zr(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function en(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=$t(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$t(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Jr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ys(e)))}function og(e,t,n){switch(t.tag){case 3:lt(t,t.stateNode.containerInfo),_n(t,Ve,e.memoizedState.cache),Vn();break;case 27:case 5:Za(t);break;case 4:lt(t,t.stateNode.containerInfo);break;case 10:_n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,vr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(vn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Lf(e,t,n):(vn(t),e=en(e,t,n),e!==null?e.sibling:null);vn(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ea(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return Hf(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),$(Ge,Ge.current),a)break;return null;case 22:return t.lanes=0,Cf(e,t,n,t.pendingProps);case 24:_n(t,Ve,e.memoizedState.cache)}return en(e,t,n)}function Bf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ke=!0;else{if(!Jr(e,n)&&(t.flags&128)===0)return Ke=!1,og(e,t,n);Ke=(e.flags&131072)!==0}else Ke=!1,ye&&(t.flags&1048576)!==0&&_c(t,cl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=$n(t.elementType),t.type=e,typeof e=="function")tr(e)?(a=Fn(e,a),t.tag=1,t=zf(null,t,e,a,n)):(t.tag=0,t=Qr(null,t,e,a,n));else{if(e!=null){var r=e.$$typeof;if(r===I){t.tag=11,t=Af(null,t,e,a,n);break e}else if(r===Z){t.tag=14,t=jf(null,t,e,a,n);break e}}throw t=ze(e)||e,Error(i(306,t,""))}}return t;case 0:return Qr(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=Fn(a,t.pendingProps),zf(e,t,a,r,n);case 3:e:{if(lt(t,t.stateNode.containerInfo),e===null)throw Error(i(387));a=t.pendingProps;var u=t.memoizedState;r=u.element,gr(e,t),yl(t,a,null,n);var m=t.memoizedState;if(a=m.cache,_n(t,Ve,a),a!==u.cache&&cr(t,[Ve],n,!0),_l(),a=m.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Uf(e,t,a,n);break e}else if(a!==r){r=jt(Error(i(424)),t),fl(r),t=Uf(e,t,a,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Re=Dt(e.firstChild),Pe=t,ye=!0,hn=null,Rt=!0,n=Oc(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vn(),a===r){t=en(e,t,n);break e}tt(e,t,a,n)}t=t.child}return t;case 26:return Ls(e,t),e===null?(n=Wd(t.type,null,t.pendingProps,null))?t.memoizedState=n:ye||(n=t.type,e=t.pendingProps,a=ei(me.current).createElement(n),a[Fe]=t,a[rt]=e,nt(a,n,e),Ze(a),t.stateNode=a):t.memoizedState=Wd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Za(t),e===null&&ye&&(a=t.stateNode=$d(t.type,t.pendingProps,me.current),Pe=t,Rt=!0,r=Re,On(t.type)?(Oo=r,Re=Dt(a.firstChild)):Re=r),tt(e,t,t.pendingProps.children,n),Ls(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ye&&((r=a=Re)&&(a=qg(a,t.type,t.pendingProps,Rt),a!==null?(t.stateNode=a,Pe=t,Re=Dt(a.firstChild),Rt=!1,r=!0):r=!1),r||gn(t)),Za(t),r=t.type,u=t.pendingProps,m=e!==null?e.memoizedProps:null,a=u.children,No(r,u)?a=null:m!==null&&No(r,m)&&(t.flags|=32),t.memoizedState!==null&&(r=Er(e,t,Ph,null,null,n),ql._currentValue=r),Ls(e,t),tt(e,t,a,n),t.child;case 6:return e===null&&ye&&((e=n=Re)&&(n=Hg(n,t.pendingProps,Rt),n!==null?(t.stateNode=n,Pe=t,Re=null,e=!0):e=!1),e||gn(t)),null;case 13:return Lf(e,t,n);case 4:return lt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Jn(t,null,a,n):tt(e,t,a,n),t.child;case 11:return Af(e,t,t.type,t.pendingProps,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,_n(t,t.type,a.value),tt(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,Kn(t),r=et(r),a=a(r),t.flags|=1,tt(e,t,a,n),t.child;case 14:return jf(e,t,t.type,t.pendingProps,n);case 15:return Of(e,t,t.type,t.pendingProps,n);case 19:return Hf(e,t,n);case 31:return rg(e,t,n);case 22:return Cf(e,t,n,t.pendingProps);case 24:return Kn(t),a=et(Ve),e===null?(r=mr(),r===null&&(r=Oe,u=fr(),r.pooledCache=u,u.refCount++,u!==null&&(r.pooledCacheLanes|=n),r=u),t.memoizedState={parent:a,cache:r},hr(t),_n(t,Ve,r)):((e.lanes&n)!==0&&(gr(e,t),yl(t,null,null,n),_l()),r=e.memoizedState,u=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),_n(t,Ve,a)):(a=u.cache,_n(t,Ve,a),a!==r.cache&&cr(t,[Ve],n,!0))),tt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function tn(e){e.flags|=4}function Wr(e,t,n,a,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(md())e.flags|=8192;else throw Zn=Ss,pr}else e.flags&=-16777217}function Gf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nm(t))if(md())e.flags|=8192;else throw Zn=Ss,pr}function Hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bu():536870912,e.lanes|=t,za|=t)}function Tl(e,t){if(!ye)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 a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&65011712,a|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function ug(e,t,n){var a=t.pendingProps;switch(sr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return Me(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wt(Ve),Be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Sa(t)?tn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,rr())),Me(t),null;case 26:var r=t.type,u=t.memoizedState;return e===null?(tn(t),u!==null?(Me(t),Gf(t,u)):(Me(t),Wr(t,r,null,a,n))):u?u!==e.memoizedState?(tn(t),Me(t),Gf(t,u)):(Me(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&tn(t),Me(t),Wr(t,r,e,a,n)),null;case 27:if(Jl(t),n=me.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&tn(t);else{if(!a){if(t.stateNode===null)throw Error(i(166));return Me(t),null}e=F.current,Sa(t)?bc(t):(e=$d(r,a,n),t.stateNode=e,tn(t))}return Me(t),null;case 5:if(Jl(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&tn(t);else{if(!a){if(t.stateNode===null)throw Error(i(166));return Me(t),null}if(u=F.current,Sa(t))bc(t);else{var m=ei(me.current);switch(u){case 1:u=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:u=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":u=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":u=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":u=m.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?m.createElement(r,{is:a.is}):m.createElement(r)}}u[Fe]=t,u[rt]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)u.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=u;e:switch(nt(u,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&tn(t)}}return Me(t),Wr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&tn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(i(166));if(e=me.current,Sa(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=Pe,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Fe]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Ld(e.nodeValue,n)),e||gn(t,!0)}else e=ei(e).createTextNode(a),e[Fe]=t,t.stateNode=e}return Me(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Sa(t),n!==null){if(e===null){if(!a)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Fe]=t}else Vn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else n=rr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(xt(t),t):(xt(t),null);if((t.flags&128)!==0)throw Error(i(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Sa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(i(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));r[Fe]=t}else Vn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),r=!1}else r=rr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(xt(t),t):(xt(t),null)}return xt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hs(t,t.updateQueue),Me(t),null);case 4:return Be(),e===null&&xo(t.stateNode.containerInfo),Me(t),null;case 10:return Wt(t.type),Me(t),null;case 19:if(z(Ge),a=t.memoizedState,a===null)return Me(t),null;if(r=(t.flags&128)!==0,u=a.rendering,u===null)if(r)Tl(a,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ws(e),u!==null){for(t.flags|=128,Tl(a,!1),e=u.updateQueue,t.updateQueue=e,Hs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pc(n,e),n=n.sibling;return $(Ge,Ge.current&1|2),ye&&Zt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&pt()>Vs&&(t.flags|=128,r=!0,Tl(a,!1),t.lanes=4194304)}else{if(!r)if(e=ws(u),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hs(t,e),Tl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ye)return Me(t),null}else 2*pt()-a.renderingStartTime>Vs&&n!==536870912&&(t.flags|=128,r=!0,Tl(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=pt(),e.sibling=null,n=Ge.current,$(Ge,r?n&1|2:n&1),ye&&Zt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return xt(t),xr(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),n=t.updateQueue,n!==null&&Hs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&z(In),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wt(Ve),Me(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function cg(e,t){switch(sr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wt(Ve),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jl(t),null;case 31:if(t.memoizedState!==null){if(xt(t),t.alternate===null)throw Error(i(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(Ge),null;case 4:return Be(),null;case 10:return Wt(t.type),null;case 22:case 23:return xt(t),xr(),e!==null&&z(In),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wt(Ve),null;case 25:return null;default:return null}}function Yf(e,t){switch(sr(t),t.tag){case 3:Wt(Ve),Be();break;case 26:case 27:case 5:Jl(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&xt(t);break;case 13:xt(t);break;case 19:z(Ge);break;case 10:Wt(t.type);break;case 22:case 23:xt(t),xr(),e!==null&&z(In);break;case 24:Wt(Ve)}}function Nl(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var u=n.create,m=n.inst;a=u(),m.destroy=a}n=n.next}while(n!==r)}}catch(g){Ne(t,t.return,g)}}function En(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var u=r.next;a=u;do{if((a.tag&e)===e){var m=a.inst,g=m.destroy;if(g!==void 0){m.destroy=void 0,r=t;var x=n,k=g;try{k()}catch(O){Ne(r,x,O)}}}a=a.next}while(a!==u)}}catch(O){Ne(t,t.return,O)}}function Qf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Rc(t,n)}catch(a){Ne(e,e.return,a)}}}function Vf(e,t,n){n.props=Fn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ne(e,t,a)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){Ne(e,t,r)}}function Gt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){Ne(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ne(e,t,r)}else n.current=null}function Xf(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){Ne(e,e.return,r)}}function Fr(e,t,n){try{var a=e.stateNode;Rg(a,e.type,n,t),a[rt]=t}catch(r){Ne(e,e.return,r)}}function Kf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&On(e.type)||e.tag===4}function Pr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&On(e.type)||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 eo(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kt));else if(a!==4&&(a===27&&On(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(eo(e,t,n),e=e.sibling;e!==null;)eo(e,t,n),e=e.sibling}function Bs(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&On(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Bs(e,t,n),e=e.sibling;e!==null;)Bs(e,t,n),e=e.sibling}function If(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);nt(t,a,n),t[Fe]=e,t[rt]=n}catch(u){Ne(e,e.return,u)}}var nn=!1,Ie=!1,to=!1,$f=typeof WeakSet=="function"?WeakSet:Set,Je=null;function fg(e,t){if(e=e.containerInfo,Eo=ri,e=sc(e),$i(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var m=0,g=-1,x=-1,k=0,O=0,U=e,A=null;t:for(;;){for(var j;U!==n||r!==0&&U.nodeType!==3||(g=m+r),U!==u||a!==0&&U.nodeType!==3||(x=m+a),U.nodeType===3&&(m+=U.nodeValue.length),(j=U.firstChild)!==null;)A=U,U=j;for(;;){if(U===e)break t;if(A===n&&++k===r&&(g=m),A===u&&++O===a&&(x=m),(j=U.nextSibling)!==null)break;U=A,A=U.parentNode}U=j}n=g===-1||x===-1?null:{start:g,end:x}}else n=null}n=n||{start:0,end:0}}else n=null;for(To={focusedElem:e,selectionRange:n},ri=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,r=u.memoizedProps,u=u.memoizedState,a=n.stateNode;try{var J=Fn(n.type,r);e=a.getSnapshotBeforeUpdate(J,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(se){Ne(n,n.return,se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ko(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ko(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function Zf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ln(e,n),a&4&&Nl(5,n);break;case 1:if(ln(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Ne(n,n.return,m)}else{var r=Fn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ne(n,n.return,m)}}a&64&&Qf(n),a&512&&wl(n,n.return);break;case 3:if(ln(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Rc(e,t)}catch(m){Ne(n,n.return,m)}}break;case 27:t===null&&a&4&&If(n);case 26:case 5:ln(e,n),t===null&&a&4&&Xf(n),a&512&&wl(n,n.return);break;case 12:ln(e,n);break;case 31:ln(e,n),a&4&&Ff(e,n);break;case 13:ln(e,n),a&4&&Pf(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xg.bind(null,n),Bg(e,n))));break;case 22:if(a=n.memoizedState!==null||nn,!a){t=t!==null&&t.memoizedState!==null||Ie,r=nn;var u=Ie;nn=a,(Ie=t)&&!u?sn(e,n,(n.subtreeFlags&8772)!==0):ln(e,n),nn=r,Ie=u}break;case 30:break;default:ln(e,n)}}function Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ci(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ue=null,ut=!1;function an(e,t,n){for(n=n.child;n!==null;)Wf(e,t,n),n=n.sibling}function Wf(e,t,n){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Ja,n)}catch{}switch(n.tag){case 26:Ie||Gt(n,t),an(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ie||Gt(n,t);var a=Ue,r=ut;On(n.type)&&(Ue=n.stateNode,ut=!1),an(e,t,n),zl(n.stateNode),Ue=a,ut=r;break;case 5:Ie||Gt(n,t);case 6:if(a=Ue,r=ut,Ue=null,an(e,t,n),Ue=a,ut=r,Ue!==null)if(ut)try{(Ue.nodeType===9?Ue.body:Ue.nodeName==="HTML"?Ue.ownerDocument.body:Ue).removeChild(n.stateNode)}catch(u){Ne(n,t,u)}else try{Ue.removeChild(n.stateNode)}catch(u){Ne(n,t,u)}break;case 18:Ue!==null&&(ut?(e=Ue,Qd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Qa(e)):Qd(Ue,n.stateNode));break;case 4:a=Ue,r=ut,Ue=n.stateNode.containerInfo,ut=!0,an(e,t,n),Ue=a,ut=r;break;case 0:case 11:case 14:case 15:En(2,n,t),Ie||En(4,n,t),an(e,t,n);break;case 1:Ie||(Gt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Vf(n,t,a)),an(e,t,n);break;case 21:an(e,t,n);break;case 22:Ie=(a=Ie)||n.memoizedState!==null,an(e,t,n),Ie=a;break;default:an(e,t,n)}}function Ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qa(e)}catch(n){Ne(t,t.return,n)}}}function Pf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qa(e)}catch(n){Ne(t,t.return,n)}}function dg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $f),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $f),t;default:throw Error(i(435,e.tag))}}function Gs(e,t){var n=dg(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var r=vg.bind(null,e,a);a.then(r,r)}})}function ct(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a],u=e,m=t,g=m;e:for(;g!==null;){switch(g.tag){case 27:if(On(g.type)){Ue=g.stateNode,ut=!1;break e}break;case 5:Ue=g.stateNode,ut=!1;break e;case 3:case 4:Ue=g.stateNode.containerInfo,ut=!0;break e}g=g.return}if(Ue===null)throw Error(i(160));Wf(u,m,r),Ue=null,ut=!1,u=r.alternate,u!==null&&(u.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ed(t,e),t=t.sibling}var Lt=null;function ed(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ct(t,e),ft(e),a&4&&(En(3,e,e.return),Nl(3,e),En(5,e,e.return));break;case 1:ct(t,e),ft(e),a&512&&(Ie||n===null||Gt(n,n.return)),a&64&&nn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var r=Lt;if(ct(t,e),ft(e),a&512&&(Ie||n===null||Gt(n,n.return)),a&4){var u=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(a){case"title":u=r.getElementsByTagName("title")[0],(!u||u[Pa]||u[Fe]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=r.createElement(a),r.head.insertBefore(u,r.querySelector("head > title"))),nt(u,a,n),u[Fe]=e,Ze(u),a=u;break e;case"link":var m=em("link","href",r).get(a+(n.href||""));if(m){for(var g=0;g<m.length;g++)if(u=m[g],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(g,1);break t}}u=r.createElement(a),nt(u,a,n),r.head.appendChild(u);break;case"meta":if(m=em("meta","content",r).get(a+(n.content||""))){for(g=0;g<m.length;g++)if(u=m[g],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(g,1);break t}}u=r.createElement(a),nt(u,a,n),r.head.appendChild(u);break;default:throw Error(i(468,a))}u[Fe]=e,Ze(u),a=u}e.stateNode=a}else tm(r,e.type,e.stateNode);else e.stateNode=Pd(r,a,e.memoizedProps);else u!==a?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,a===null?tm(r,e.type,e.stateNode):Pd(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Fr(e,e.memoizedProps,n.memoizedProps)}break;case 27:ct(t,e),ft(e),a&512&&(Ie||n===null||Gt(n,n.return)),n!==null&&a&4&&Fr(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ct(t,e),ft(e),a&512&&(Ie||n===null||Gt(n,n.return)),e.flags&32){r=e.stateNode;try{da(r,"")}catch(J){Ne(e,e.return,J)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,Fr(e,r,n!==null?n.memoizedProps:r)),a&1024&&(to=!0);break;case 6:if(ct(t,e),ft(e),a&4){if(e.stateNode===null)throw Error(i(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(J){Ne(e,e.return,J)}}break;case 3:if(ai=null,r=Lt,Lt=ti(t.containerInfo),ct(t,e),Lt=r,ft(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Qa(t.containerInfo)}catch(J){Ne(e,e.return,J)}to&&(to=!1,td(e));break;case 4:a=Lt,Lt=ti(e.stateNode.containerInfo),ct(t,e),ft(e),Lt=a;break;case 12:ct(t,e),ft(e);break;case 31:ct(t,e),ft(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gs(e,a)));break;case 13:ct(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Qs=pt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gs(e,a)));break;case 22:r=e.memoizedState!==null;var x=n!==null&&n.memoizedState!==null,k=nn,O=Ie;if(nn=k||r,Ie=O||x,ct(t,e),Ie=O,nn=k,ft(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||x||nn||Ie||Pn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){x=n=t;try{if(u=x.stateNode,r)m=u.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{g=x.stateNode;var U=x.memoizedProps.style,A=U!=null&&U.hasOwnProperty("display")?U.display:null;g.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(J){Ne(x,x.return,J)}}}else if(t.tag===6){if(n===null){x=t;try{x.stateNode.nodeValue=r?"":x.memoizedProps}catch(J){Ne(x,x.return,J)}}}else if(t.tag===18){if(n===null){x=t;try{var j=x.stateNode;r?Vd(j,!0):Vd(x.stateNode,!1)}catch(J){Ne(x,x.return,J)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Gs(e,n))));break;case 19:ct(t,e),ft(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gs(e,a)));break;case 30:break;case 21:break;default:ct(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Kf(a)){n=a;break}a=a.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var r=n.stateNode,u=Pr(e);Bs(e,u,r);break;case 5:var m=n.stateNode;n.flags&32&&(da(m,""),n.flags&=-33);var g=Pr(e);Bs(e,g,m);break;case 3:case 4:var x=n.stateNode.containerInfo,k=Pr(e);eo(e,k,x);break;default:throw Error(i(161))}}catch(O){Ne(e,e.return,O)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function td(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;td(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ln(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zf(e,t.alternate,t),t=t.sibling}function Pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:En(4,t,t.return),Pn(t);break;case 1:Gt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Vf(t,t.return,n),Pn(t);break;case 27:zl(t.stateNode);case 26:case 5:Gt(t,t.return),Pn(t);break;case 22:t.memoizedState===null&&Pn(t);break;case 30:Pn(t);break;default:Pn(t)}e=e.sibling}}function sn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,r=e,u=t,m=u.flags;switch(u.tag){case 0:case 11:case 15:sn(r,u,n),Nl(4,u);break;case 1:if(sn(r,u,n),a=u,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(k){Ne(a,a.return,k)}if(a=u,r=a.updateQueue,r!==null){var g=a.stateNode;try{var x=r.shared.hiddenCallbacks;if(x!==null)for(r.shared.hiddenCallbacks=null,r=0;r<x.length;r++)Cc(x[r],g)}catch(k){Ne(a,a.return,k)}}n&&m&64&&Qf(u),wl(u,u.return);break;case 27:If(u);case 26:case 5:sn(r,u,n),n&&a===null&&m&4&&Xf(u),wl(u,u.return);break;case 12:sn(r,u,n);break;case 31:sn(r,u,n),n&&m&4&&Ff(r,u);break;case 13:sn(r,u,n),n&&m&4&&Pf(r,u);break;case 22:u.memoizedState===null&&sn(r,u,n),wl(u,u.return);break;case 30:break;default:sn(r,u,n)}t=t.sibling}}function no(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&dl(n))}function ao(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e))}function qt(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)nd(e,t,n,a),t=t.sibling}function nd(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:qt(e,t,n,a),r&2048&&Nl(9,t);break;case 1:qt(e,t,n,a);break;case 3:qt(e,t,n,a),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e)));break;case 12:if(r&2048){qt(e,t,n,a),e=t.stateNode;try{var u=t.memoizedProps,m=u.id,g=u.onPostCommit;typeof g=="function"&&g(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(x){Ne(t,t.return,x)}}else qt(e,t,n,a);break;case 31:qt(e,t,n,a);break;case 13:qt(e,t,n,a);break;case 23:break;case 22:u=t.stateNode,m=t.alternate,t.memoizedState!==null?u._visibility&2?qt(e,t,n,a):kl(e,t):u._visibility&2?qt(e,t,n,a):(u._visibility|=2,Ra(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),r&2048&&no(m,t);break;case 24:qt(e,t,n,a),r&2048&&ao(t.alternate,t);break;default:qt(e,t,n,a)}}function Ra(e,t,n,a,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,m=t,g=n,x=a,k=m.flags;switch(m.tag){case 0:case 11:case 15:Ra(u,m,g,x,r),Nl(8,m);break;case 23:break;case 22:var O=m.stateNode;m.memoizedState!==null?O._visibility&2?Ra(u,m,g,x,r):kl(u,m):(O._visibility|=2,Ra(u,m,g,x,r)),r&&k&2048&&no(m.alternate,m);break;case 24:Ra(u,m,g,x,r),r&&k&2048&&ao(m.alternate,m);break;default:Ra(u,m,g,x,r)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:kl(n,a),r&2048&&no(a.alternate,a);break;case 24:kl(n,a),r&2048&&ao(a.alternate,a);break;default:kl(n,a)}t=t.sibling}}var Al=8192;function Ma(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)ad(e,t,n),e=e.sibling}function ad(e,t,n){switch(e.tag){case 26:Ma(e,t,n),e.flags&Al&&e.memoizedState!==null&&Fg(n,Lt,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,t,n);break;case 3:case 4:var a=Lt;Lt=ti(e.stateNode.containerInfo),Ma(e,t,n),Lt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Al,Al=16777216,Ma(e,t,n),Al=a):Ma(e,t,n));break;default:Ma(e,t,n)}}function ld(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Je=a,id(a,e)}ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sd(e),e=e.sibling}function sd(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&En(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ys(e)):jl(e);break;default:jl(e)}}function Ys(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Je=a,id(a,e)}ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:En(8,t,t.return),Ys(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ys(t));break;default:Ys(t)}e=e.sibling}}function id(e,t){for(;Je!==null;){var n=Je;switch(n.tag){case 0:case 11:case 15:En(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:dl(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Je=a;else e:for(n=e;Je!==null;){a=Je;var r=a.sibling,u=a.return;if(Jf(a),a===n){Je=null;break e}if(r!==null){r.return=u,Je=r;break e}Je=u}}}var mg={getCacheForType:function(e){var t=et(Ve),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return et(Ve).controller.signal}},pg=typeof WeakMap=="function"?WeakMap:Map,ve=0,Oe=null,pe=null,ge=0,Te=0,vt=null,Tn=!1,Da=!1,lo=!1,rn=0,qe=0,Nn=0,ea=0,so=0,St=0,za=0,Ol=null,dt=null,io=!1,Qs=0,rd=0,Vs=1/0,Xs=null,wn=null,$e=0,kn=null,Ua=null,on=0,ro=0,oo=null,od=null,Cl=0,uo=null;function Et(){return(ve&2)!==0&&ge!==0?ge&-ge:C.T!==null?go():Eu()}function ud(){if(St===0)if((ge&536870912)===0||ye){var e=Pl;Pl<<=1,(Pl&3932160)===0&&(Pl=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function mt(e,t,n){(e===Oe&&(Te===2||Te===9)||e.cancelPendingCommit!==null)&&(La(e,0),An(e,ge,St,!1)),Fa(e,n),((ve&2)===0||e!==Oe)&&(e===Oe&&((ve&2)===0&&(ea|=n),qe===4&&An(e,ge,St,!1)),Yt(e))}function cd(e,t,n){if((ve&6)!==0)throw Error(i(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Wa(e,t),r=a?_g(e,t):fo(e,t,!0),u=a;do{if(r===0){Da&&!a&&An(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!hg(n)){r=fo(e,t,!1),u=!1;continue}if(r===2){if(u=t,e.errorRecoveryDisabledLanes&u)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var g=e;r=Ol;var x=g.current.memoizedState.isDehydrated;if(x&&(La(g,m).flags|=256),m=fo(g,m,!1),m!==2){if(lo&&!x){g.errorRecoveryDisabledLanes|=u,ea|=u,r=4;break e}u=dt,dt=r,u!==null&&(dt===null?dt=u:dt.push.apply(dt,u))}r=m}if(u=!1,r!==2)continue}}if(r===1){La(e,0),An(e,t,0,!0);break}e:{switch(a=e,u=r,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:An(a,t,St,!Tn);break e;case 2:dt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(r=Qs+300-pt(),10<r)){if(An(a,t,St,!Tn),ts(a,0,!0)!==0)break e;on=t,a.timeoutHandle=Gd(fd.bind(null,a,n,dt,Xs,io,t,St,ea,za,Tn,u,"Throttled",-0,0),r);break e}fd(a,n,dt,Xs,io,t,St,ea,za,Tn,u,null,-0,0)}}break}while(!0);Yt(e)}function fd(e,t,n,a,r,u,m,g,x,k,O,U,A,j){if(e.timeoutHandle=-1,U=t.subtreeFlags,U&8192||(U&16785408)===16785408){U={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kt},ad(t,u,U);var J=(u&62914560)===u?Qs-pt():(u&4194048)===u?rd-pt():0;if(J=Pg(U,J),J!==null){on=u,e.cancelPendingCommit=J(bd.bind(null,e,t,u,n,a,r,m,g,x,O,U,null,A,j)),An(e,u,m,!k);return}}bd(e,t,u,n,a,r,m,g,x)}function hg(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],u=r.getSnapshot;r=r.value;try{if(!_t(u(),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 An(e,t,n,a){t&=~so,t&=~ea,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var u=31-gt(r),m=1<<u;a[u]=-1,r&=~m}n!==0&&xu(e,n,t)}function Ks(){return(ve&6)===0?(Rl(0),!1):!0}function co(){if(pe!==null){if(Te===0)var e=pe.return;else e=pe,Jt=Xn=null,wr(e),ka=null,pl=0,e=pe;for(;e!==null;)Yf(e.alternate,e),e=e.return;pe=null}}function La(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,zg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),on=0,co(),Oe=e,pe=n=$t(e.current,null),ge=t,Te=0,vt=null,Tn=!1,Da=Wa(e,t),lo=!1,za=St=so=ea=Nn=qe=0,dt=Ol=null,io=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-gt(a),u=1<<r;t|=e[r],a&=~u}return rn=t,ms(),n}function dd(e,t){ce=null,C.H=Sl,t===wa||t===vs?(t=kc(),Te=3):t===pr?(t=kc(),Te=4):Te=t===Yr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vt=t,pe===null&&(qe=1,zs(e,jt(t,e.current)))}function md(){var e=bt.current;return e===null?!0:(ge&4194048)===ge?Mt===null:(ge&62914560)===ge||(ge&536870912)!==0?e===Mt:!1}function pd(){var e=C.H;return C.H=Sl,e===null?Sl:e}function hd(){var e=C.A;return C.A=mg,e}function Is(){qe=4,Tn||(ge&4194048)!==ge&&bt.current!==null||(Da=!0),(Nn&134217727)===0&&(ea&134217727)===0||Oe===null||An(Oe,ge,St,!1)}function fo(e,t,n){var a=ve;ve|=2;var r=pd(),u=hd();(Oe!==e||ge!==t)&&(Xs=null,La(e,t)),t=!1;var m=qe;e:do try{if(Te!==0&&pe!==null){var g=pe,x=vt;switch(Te){case 8:co(),m=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var k=Te;if(Te=0,vt=null,qa(e,g,x,k),n&&Da){m=0;break e}break;default:k=Te,Te=0,vt=null,qa(e,g,x,k)}}gg(),m=qe;break}catch(O){dd(e,O)}while(!0);return t&&e.shellSuspendCounter++,Jt=Xn=null,ve=a,C.H=r,C.A=u,pe===null&&(Oe=null,ge=0,ms()),m}function gg(){for(;pe!==null;)gd(pe)}function _g(e,t){var n=ve;ve|=2;var a=pd(),r=hd();Oe!==e||ge!==t?(Xs=null,Vs=pt()+500,La(e,t)):Da=Wa(e,t);e:do try{if(Te!==0&&pe!==null){t=pe;var u=vt;t:switch(Te){case 1:Te=0,vt=null,qa(e,t,u,1);break;case 2:case 9:if(Nc(u)){Te=0,vt=null,_d(t);break}t=function(){Te!==2&&Te!==9||Oe!==e||(Te=7),Yt(e)},u.then(t,t);break e;case 3:Te=7;break e;case 4:Te=5;break e;case 7:Nc(u)?(Te=0,vt=null,_d(t)):(Te=0,vt=null,qa(e,t,u,7));break;case 5:var m=null;switch(pe.tag){case 26:m=pe.memoizedState;case 5:case 27:var g=pe;if(m?nm(m):g.stateNode.complete){Te=0,vt=null;var x=g.sibling;if(x!==null)pe=x;else{var k=g.return;k!==null?(pe=k,$s(k)):pe=null}break t}}Te=0,vt=null,qa(e,t,u,5);break;case 6:Te=0,vt=null,qa(e,t,u,6);break;case 8:co(),qe=6;break e;default:throw Error(i(462))}}yg();break}catch(O){dd(e,O)}while(!0);return Jt=Xn=null,C.H=a,C.A=r,ve=n,pe!==null?0:(Oe=null,ge=0,ms(),qe)}function yg(){for(;pe!==null&&!Gp();)gd(pe)}function gd(e){var t=Bf(e.alternate,e,rn);e.memoizedProps=e.pendingProps,t===null?$s(e):pe=t}function _d(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Df(n,t,t.pendingProps,t.type,void 0,ge);break;case 11:t=Df(n,t,t.pendingProps,t.type.render,t.ref,ge);break;case 5:wr(t);default:Yf(n,t),t=pe=pc(t,rn),t=Bf(n,t,rn)}e.memoizedProps=e.pendingProps,t===null?$s(e):pe=t}function qa(e,t,n,a){Jt=Xn=null,wr(t),ka=null,pl=0;var r=t.return;try{if(ig(e,r,t,n,ge)){qe=1,zs(e,jt(n,e.current)),pe=null;return}}catch(u){if(r!==null)throw pe=r,u;qe=1,zs(e,jt(n,e.current)),pe=null;return}t.flags&32768?(ye||a===1?e=!0:Da||(ge&536870912)!==0?e=!1:(Tn=e=!0,(a===2||a===9||a===3||a===6)&&(a=bt.current,a!==null&&a.tag===13&&(a.flags|=16384))),yd(t,e)):$s(t)}function $s(e){var t=e;do{if((t.flags&32768)!==0){yd(t,Tn);return}e=t.return;var n=ug(t.alternate,t,rn);if(n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);qe===0&&(qe=5)}function yd(e,t){do{var n=cg(e.alternate,e);if(n!==null){n.flags&=32767,pe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=n}while(e!==null);qe=6,pe=null}function bd(e,t,n,a,r,u,m,g,x){e.cancelPendingCommit=null;do Zs();while($e!==0);if((ve&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=Pi,Wp(e,n,u,m,g,x),e===Oe&&(pe=Oe=null,ge=0),Ua=t,kn=e,on=n,ro=u,oo=r,od=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Sg(Wl,function(){return Td(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=C.T,C.T=null,r=X.p,X.p=2,m=ve,ve|=4;try{fg(e,t,n)}finally{ve=m,X.p=r,C.T=a}}$e=1,xd(),vd(),Sd()}}function xd(){if($e===1){$e=0;var e=kn,t=Ua,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var a=X.p;X.p=2;var r=ve;ve|=4;try{ed(t,e);var u=To,m=sc(e.containerInfo),g=u.focusedElem,x=u.selectionRange;if(m!==g&&g&&g.ownerDocument&&lc(g.ownerDocument.documentElement,g)){if(x!==null&&$i(g)){var k=x.start,O=x.end;if(O===void 0&&(O=k),"selectionStart"in g)g.selectionStart=k,g.selectionEnd=Math.min(O,g.value.length);else{var U=g.ownerDocument||document,A=U&&U.defaultView||window;if(A.getSelection){var j=A.getSelection(),J=g.textContent.length,se=Math.min(x.start,J),je=x.end===void 0?se:Math.min(x.end,J);!j.extend&&se>je&&(m=je,je=se,se=m);var T=ac(g,se),E=ac(g,je);if(T&&E&&(j.rangeCount!==1||j.anchorNode!==T.node||j.anchorOffset!==T.offset||j.focusNode!==E.node||j.focusOffset!==E.offset)){var w=U.createRange();w.setStart(T.node,T.offset),j.removeAllRanges(),se>je?(j.addRange(w),j.extend(E.node,E.offset)):(w.setEnd(E.node,E.offset),j.addRange(w))}}}}for(U=[],j=g;j=j.parentNode;)j.nodeType===1&&U.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<U.length;g++){var D=U[g];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}ri=!!Eo,To=Eo=null}finally{ve=r,X.p=a,C.T=n}}e.current=t,$e=2}}function vd(){if($e===2){$e=0;var e=kn,t=Ua,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var a=X.p;X.p=2;var r=ve;ve|=4;try{Zf(e,t.alternate,t)}finally{ve=r,X.p=a,C.T=n}}$e=3}}function Sd(){if($e===4||$e===3){$e=0,Yp();var e=kn,t=Ua,n=on,a=od;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?$e=5:($e=0,Ua=kn=null,Ed(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(wn=null),ji(n),t=t.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Ja,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=C.T,r=X.p,X.p=2,C.T=null;try{for(var u=e.onRecoverableError,m=0;m<a.length;m++){var g=a[m];u(g.value,{componentStack:g.stack})}}finally{C.T=t,X.p=r}}(on&3)!==0&&Zs(),Yt(e),r=e.pendingLanes,(n&261930)!==0&&(r&42)!==0?e===uo?Cl++:(Cl=0,uo=e):Cl=0,Rl(0)}}function Ed(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dl(t)))}function Zs(){return xd(),vd(),Sd(),Td()}function Td(){if($e!==5)return!1;var e=kn,t=ro;ro=0;var n=ji(on),a=C.T,r=X.p;try{X.p=32>n?32:n,C.T=null,n=oo,oo=null;var u=kn,m=on;if($e=0,Ua=kn=null,on=0,(ve&6)!==0)throw Error(i(331));var g=ve;if(ve|=4,sd(u.current),nd(u,u.current,m,n),ve=g,Rl(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Ja,u)}catch{}return!0}finally{X.p=r,C.T=a,Ed(e,t)}}function Nd(e,t,n){t=jt(n,t),t=Gr(e.stateNode,t,2),e=xn(e,t,2),e!==null&&(Fa(e,2),Yt(e))}function Ne(e,t,n){if(e.tag===3)Nd(e,e,n);else for(;t!==null;){if(t.tag===3){Nd(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(wn===null||!wn.has(a))){e=jt(n,e),n=wf(2),a=xn(t,n,2),a!==null&&(kf(n,a,t,e),Fa(a,2),Yt(a));break}}t=t.return}}function mo(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new pg;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(lo=!0,r.add(n),e=bg.bind(null,e,t,n),t.then(e,e))}function bg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Oe===e&&(ge&n)===n&&(qe===4||qe===3&&(ge&62914560)===ge&&300>pt()-Qs?(ve&2)===0&&La(e,0):so|=n,za===ge&&(za=0)),Yt(e)}function wd(e,t){t===0&&(t=bu()),e=Yn(e,t),e!==null&&(Fa(e,t),Yt(e))}function xg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wd(e,n)}function vg(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(i(314))}a!==null&&a.delete(t),wd(e,n)}function Sg(e,t){return Ni(e,t)}var Js=null,Ha=null,po=!1,Ws=!1,ho=!1,jn=0;function Yt(e){e!==Ha&&e.next===null&&(Ha===null?Js=Ha=e:Ha=Ha.next=e),Ws=!0,po||(po=!0,Tg())}function Rl(e,t){if(!ho&&Ws){ho=!0;do for(var n=!1,a=Js;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var u=0;else{var m=a.suspendedLanes,g=a.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=r&~(m&~g),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Od(a,u))}else u=ge,u=ts(a,a===Oe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Wa(a,u)||(n=!0,Od(a,u));a=a.next}while(n);ho=!1}}function Eg(){kd()}function kd(){Ws=po=!1;var e=0;jn!==0&&Dg()&&(e=jn);for(var t=pt(),n=null,a=Js;a!==null;){var r=a.next,u=Ad(a,t);u===0?(a.next=null,n===null?Js=r:n.next=r,r===null&&(Ha=n)):(n=a,(e!==0||(u&3)!==0)&&(Ws=!0)),a=r}$e!==0&&$e!==5||Rl(e),jn!==0&&(jn=0)}function Ad(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var m=31-gt(u),g=1<<m,x=r[m];x===-1?((g&n)===0||(g&a)!==0)&&(r[m]=Jp(g,t)):x<=t&&(e.expiredLanes|=g),u&=~g}if(t=Oe,n=ge,n=ts(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Te===2||Te===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&wi(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Wa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&wi(a),ji(n)){case 2:case 8:n=_u;break;case 32:n=Wl;break;case 268435456:n=yu;break;default:n=Wl}return a=jd.bind(null,e),n=Ni(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&wi(a),e.callbackPriority=2,e.callbackNode=null,2}function jd(e,t){if($e!==0&&$e!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zs()&&e.callbackNode!==n)return null;var a=ge;return a=ts(e,e===Oe?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(cd(e,a,t),Ad(e,pt()),e.callbackNode!=null&&e.callbackNode===n?jd.bind(null,e):null)}function Od(e,t){if(Zs())return null;cd(e,t,!0)}function Tg(){Ug(function(){(ve&6)!==0?Ni(gu,Eg):kd()})}function go(){if(jn===0){var e=Ta;e===0&&(e=Fl,Fl<<=1,(Fl&261888)===0&&(Fl=256)),jn=e}return jn}function Cd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ss(""+e)}function Rd(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ng(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var u=Cd((r[rt]||null).action),m=a.submitter;m&&(t=(t=m[rt]||null)?Cd(t.formAction):m.getAttribute("formAction"),t!==null&&(u=t,m=null));var g=new us("action","action",null,a,r);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(jn!==0){var x=m?Rd(r,m):new FormData(r);zr(n,{pending:!0,data:x,method:r.method,action:u},null,x)}}else typeof u=="function"&&(g.preventDefault(),x=m?Rd(r,m):new FormData(r),zr(n,{pending:!0,data:x,method:r.method,action:u},u,x))},currentTarget:r}]})}}for(var _o=0;_o<Fi.length;_o++){var yo=Fi[_o],wg=yo.toLowerCase(),kg=yo[0].toUpperCase()+yo.slice(1);Ut(wg,"on"+kg)}Ut(oc,"onAnimationEnd"),Ut(uc,"onAnimationIteration"),Ut(cc,"onAnimationStart"),Ut("dblclick","onDoubleClick"),Ut("focusin","onFocus"),Ut("focusout","onBlur"),Ut(Qh,"onTransitionRun"),Ut(Vh,"onTransitionStart"),Ut(Xh,"onTransitionCancel"),Ut(fc,"onTransitionEnd"),ca("onMouseEnter",["mouseout","mouseover"]),ca("onMouseLeave",["mouseout","mouseover"]),ca("onPointerEnter",["pointerout","pointerover"]),ca("onPointerLeave",["pointerout","pointerover"]),qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ml="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(" "),Ag=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ml));function Md(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var m=a.length-1;0<=m;m--){var g=a[m],x=g.instance,k=g.currentTarget;if(g=g.listener,x!==u&&r.isPropagationStopped())break e;u=g,r.currentTarget=k;try{u(r)}catch(O){ds(O)}r.currentTarget=null,u=x}else for(m=0;m<a.length;m++){if(g=a[m],x=g.instance,k=g.currentTarget,g=g.listener,x!==u&&r.isPropagationStopped())break e;u=g,r.currentTarget=k;try{u(r)}catch(O){ds(O)}r.currentTarget=null,u=x}}}}function he(e,t){var n=t[Oi];n===void 0&&(n=t[Oi]=new Set);var a=e+"__bubble";n.has(a)||(Dd(t,e,2,!1),n.add(a))}function bo(e,t,n){var a=0;t&&(a|=4),Dd(n,e,a,t)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function xo(e){if(!e[Fs]){e[Fs]=!0,wu.forEach(function(n){n!=="selectionchange"&&(Ag.has(n)||bo(n,!1,e),bo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fs]||(t[Fs]=!0,bo("selectionchange",!1,t))}}function Dd(e,t,n,a){switch(um(t)){case 2:var r=n_;break;case 8:r=a_;break;default:r=zo}n=r.bind(null,t,n,e),r=void 0,!Hi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?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 vo(e,t,n,a,r){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var g=a.stateNode.containerInfo;if(g===r)break;if(m===4)for(m=a.return;m!==null;){var x=m.tag;if((x===3||x===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;g!==null;){if(m=ra(g),m===null)return;if(x=m.tag,x===5||x===6||x===26||x===27){a=u=m;continue e}g=g.parentNode}}a=a.return}qu(function(){var k=u,O=Li(n),U=[];e:{var A=dc.get(e);if(A!==void 0){var j=us,J=e;switch(e){case"keypress":if(rs(n)===0)break e;case"keydown":case"keyup":j=vh;break;case"focusin":J="focus",j=Qi;break;case"focusout":J="blur",j=Qi;break;case"beforeblur":case"afterblur":j=Qi;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":j=Gu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=uh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=Th;break;case oc:case uc:case cc:j=dh;break;case fc:j=wh;break;case"scroll":case"scrollend":j=rh;break;case"wheel":j=Ah;break;case"copy":case"cut":case"paste":j=ph;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=Qu;break;case"toggle":case"beforetoggle":j=Oh}var se=(t&4)!==0,je=!se&&(e==="scroll"||e==="scrollend"),T=se?A!==null?A+"Capture":null:A;se=[];for(var E=k,w;E!==null;){var D=E;if(w=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||w===null||T===null||(D=tl(E,T),D!=null&&se.push(Dl(E,D,w))),je)break;E=E.return}0<se.length&&(A=new j(A,J,null,n,O),U.push({event:A,listeners:se}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",A&&n!==Ui&&(J=n.relatedTarget||n.fromElement)&&(ra(J)||J[ia]))break e;if((j||A)&&(A=O.window===O?O:(A=O.ownerDocument)?A.defaultView||A.parentWindow:window,j?(J=n.relatedTarget||n.toElement,j=k,J=J?ra(J):null,J!==null&&(je=f(J),se=J.tag,J!==je||se!==5&&se!==27&&se!==6)&&(J=null)):(j=null,J=k),j!==J)){if(se=Gu,D="onMouseLeave",T="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(se=Qu,D="onPointerLeave",T="onPointerEnter",E="pointer"),je=j==null?A:el(j),w=J==null?A:el(J),A=new se(D,E+"leave",j,n,O),A.target=je,A.relatedTarget=w,D=null,ra(O)===k&&(se=new se(T,E+"enter",J,n,O),se.target=w,se.relatedTarget=je,D=se),je=D,j&&J)t:{for(se=jg,T=j,E=J,w=0,D=T;D;D=se(D))w++;D=0;for(var ae=E;ae;ae=se(ae))D++;for(;0<w-D;)T=se(T),w--;for(;0<D-w;)E=se(E),D--;for(;w--;){if(T===E||E!==null&&T===E.alternate){se=T;break t}T=se(T),E=se(E)}se=null}else se=null;j!==null&&zd(U,A,j,se,!1),J!==null&&je!==null&&zd(U,je,J,se,!0)}}e:{if(A=k?el(k):window,j=A.nodeName&&A.nodeName.toLowerCase(),j==="select"||j==="input"&&A.type==="file")var be=Wu;else if(Zu(A))if(Fu)be=Bh;else{be=qh;var P=Lh}else j=A.nodeName,!j||j.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?k&&zi(k.elementType)&&(be=Wu):be=Hh;if(be&&(be=be(e,k))){Ju(U,be,n,O);break e}P&&P(e,A,k),e==="focusout"&&k&&A.type==="number"&&k.memoizedProps.value!=null&&Di(A,"number",A.value)}switch(P=k?el(k):window,e){case"focusin":(Zu(P)||P.contentEditable==="true")&&(ga=P,Zi=k,ul=null);break;case"focusout":ul=Zi=ga=null;break;case"mousedown":Ji=!0;break;case"contextmenu":case"mouseup":case"dragend":Ji=!1,ic(U,n,O);break;case"selectionchange":if(Yh)break;case"keydown":case"keyup":ic(U,n,O)}var fe;if(Xi)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else ha?Iu(e,n)&&(_e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_e="onCompositionStart");_e&&(Vu&&n.locale!=="ko"&&(ha||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&ha&&(fe=Hu()):(mn=O,Bi="value"in mn?mn.value:mn.textContent,ha=!0)),P=Ps(k,_e),0<P.length&&(_e=new Yu(_e,e,null,n,O),U.push({event:_e,listeners:P}),fe?_e.data=fe:(fe=$u(n),fe!==null&&(_e.data=fe)))),(fe=Rh?Mh(e,n):Dh(e,n))&&(_e=Ps(k,"onBeforeInput"),0<_e.length&&(P=new Yu("onBeforeInput","beforeinput",null,n,O),U.push({event:P,listeners:_e}),P.data=fe)),Ng(U,e,k,n,O)}Md(U,t)})}function Dl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ps(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,u=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||u===null||(r=tl(e,n),r!=null&&a.unshift(Dl(e,r,u)),r=tl(e,t),r!=null&&a.push(Dl(e,r,u))),e.tag===3)return a;e=e.return}return[]}function jg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(e,t,n,a,r){for(var u=t._reactName,m=[];n!==null&&n!==a;){var g=n,x=g.alternate,k=g.stateNode;if(g=g.tag,x!==null&&x===a)break;g!==5&&g!==26&&g!==27||k===null||(x=k,r?(k=tl(n,u),k!=null&&m.unshift(Dl(n,k,x))):r||(k=tl(n,u),k!=null&&m.push(Dl(n,k,x)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Og=/\r\n?/g,Cg=/\u0000|\uFFFD/g;function Ud(e){return(typeof e=="string"?e:""+e).replace(Og,`
|
|
9
|
+
`).replace(Cg,"")}function Ld(e,t){return t=Ud(t),Ud(e)===t}function Ae(e,t,n,a,r,u){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||da(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&da(e,""+a);break;case"className":as(e,"class",a);break;case"tabIndex":as(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":as(e,n,a);break;case"style":Uu(e,a,u);break;case"data":if(t!=="object"){as(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=ss(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&Ae(e,t,"name",r.name,r,null),Ae(e,t,"formEncType",r.formEncType,r,null),Ae(e,t,"formMethod",r.formMethod,r,null),Ae(e,t,"formTarget",r.formTarget,r,null)):(Ae(e,t,"encType",r.encType,r,null),Ae(e,t,"method",r.method,r,null),Ae(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=ss(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Kt);break;case"onScroll":a!=null&&he("scroll",e);break;case"onScrollEnd":a!=null&&he("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(i(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=ss(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":he("beforetoggle",e),he("toggle",e),ns(e,"popover",a);break;case"xlinkActuate":Xt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Xt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Xt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Xt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Xt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Xt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ns(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=sh.get(n)||n,ns(e,n,a))}}function So(e,t,n,a,r,u){switch(n){case"style":Uu(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(i(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof a=="string"?da(e,a):(typeof a=="number"||typeof a=="bigint")&&da(e,""+a);break;case"onScroll":a!=null&&he("scroll",e);break;case"onScrollEnd":a!=null&&he("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Kt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ku.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),u=e[rt]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,r),typeof a=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,r);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):ns(e,n,a)}}}function nt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":he("error",e),he("load",e);var a=!1,r=!1,u;for(u in n)if(n.hasOwnProperty(u)){var m=n[u];if(m!=null)switch(u){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ae(e,t,u,m,n,null)}}r&&Ae(e,t,"srcSet",n.srcSet,n,null),a&&Ae(e,t,"src",n.src,n,null);return;case"input":he("invalid",e);var g=u=m=r=null,x=null,k=null;for(a in n)if(n.hasOwnProperty(a)){var O=n[a];if(O!=null)switch(a){case"name":r=O;break;case"type":m=O;break;case"checked":x=O;break;case"defaultChecked":k=O;break;case"value":u=O;break;case"defaultValue":g=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(i(137,t));break;default:Ae(e,t,a,O,n,null)}}Ru(e,u,g,x,k,m,r,!1);return;case"select":he("invalid",e),a=m=u=null;for(r in n)if(n.hasOwnProperty(r)&&(g=n[r],g!=null))switch(r){case"value":u=g;break;case"defaultValue":m=g;break;case"multiple":a=g;default:Ae(e,t,r,g,n,null)}t=u,n=m,e.multiple=!!a,t!=null?fa(e,!!a,t,!1):n!=null&&fa(e,!!a,n,!0);return;case"textarea":he("invalid",e),u=r=a=null;for(m in n)if(n.hasOwnProperty(m)&&(g=n[m],g!=null))switch(m){case"value":a=g;break;case"defaultValue":r=g;break;case"children":u=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:Ae(e,t,m,g,n,null)}Du(e,a,r,u);return;case"option":for(x in n)n.hasOwnProperty(x)&&(a=n[x],a!=null)&&(x==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":Ae(e,t,x,a,n,null));return;case"dialog":he("beforetoggle",e),he("toggle",e),he("cancel",e),he("close",e);break;case"iframe":case"object":he("load",e);break;case"video":case"audio":for(a=0;a<Ml.length;a++)he(Ml[a],e);break;case"image":he("error",e),he("load",e);break;case"details":he("toggle",e);break;case"embed":case"source":case"link":he("error",e),he("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(k in n)if(n.hasOwnProperty(k)&&(a=n[k],a!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ae(e,t,k,a,n,null)}return;default:if(zi(t)){for(O in n)n.hasOwnProperty(O)&&(a=n[O],a!==void 0&&So(e,t,O,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&Ae(e,t,g,a,n,null))}function Rg(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,u=null,m=null,g=null,x=null,k=null,O=null;for(j in n){var U=n[j];if(n.hasOwnProperty(j)&&U!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":x=U;default:a.hasOwnProperty(j)||Ae(e,t,j,null,a,U)}}for(var A in a){var j=a[A];if(U=n[A],a.hasOwnProperty(A)&&(j!=null||U!=null))switch(A){case"type":u=j;break;case"name":r=j;break;case"checked":k=j;break;case"defaultChecked":O=j;break;case"value":m=j;break;case"defaultValue":g=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(137,t));break;default:j!==U&&Ae(e,t,A,j,a,U)}}Mi(e,m,g,x,k,O,u,r);return;case"select":j=m=g=A=null;for(u in n)if(x=n[u],n.hasOwnProperty(u)&&x!=null)switch(u){case"value":break;case"multiple":j=x;default:a.hasOwnProperty(u)||Ae(e,t,u,null,a,x)}for(r in a)if(u=a[r],x=n[r],a.hasOwnProperty(r)&&(u!=null||x!=null))switch(r){case"value":A=u;break;case"defaultValue":g=u;break;case"multiple":m=u;default:u!==x&&Ae(e,t,r,u,a,x)}t=g,n=m,a=j,A!=null?fa(e,!!n,A,!1):!!a!=!!n&&(t!=null?fa(e,!!n,t,!0):fa(e,!!n,n?[]:"",!1));return;case"textarea":j=A=null;for(g in n)if(r=n[g],n.hasOwnProperty(g)&&r!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Ae(e,t,g,null,a,r)}for(m in a)if(r=a[m],u=n[m],a.hasOwnProperty(m)&&(r!=null||u!=null))switch(m){case"value":A=r;break;case"defaultValue":j=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(i(91));break;default:r!==u&&Ae(e,t,m,r,a,u)}Mu(e,A,j);return;case"option":for(var J in n)A=n[J],n.hasOwnProperty(J)&&A!=null&&!a.hasOwnProperty(J)&&(J==="selected"?e.selected=!1:Ae(e,t,J,null,a,A));for(x in a)A=a[x],j=n[x],a.hasOwnProperty(x)&&A!==j&&(A!=null||j!=null)&&(x==="selected"?e.selected=A&&typeof A!="function"&&typeof A!="symbol":Ae(e,t,x,A,a,j));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var se in n)A=n[se],n.hasOwnProperty(se)&&A!=null&&!a.hasOwnProperty(se)&&Ae(e,t,se,null,a,A);for(k in a)if(A=a[k],j=n[k],a.hasOwnProperty(k)&&A!==j&&(A!=null||j!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(137,t));break;default:Ae(e,t,k,A,a,j)}return;default:if(zi(t)){for(var je in n)A=n[je],n.hasOwnProperty(je)&&A!==void 0&&!a.hasOwnProperty(je)&&So(e,t,je,void 0,a,A);for(O in a)A=a[O],j=n[O],!a.hasOwnProperty(O)||A===j||A===void 0&&j===void 0||So(e,t,O,A,a,j);return}}for(var T in n)A=n[T],n.hasOwnProperty(T)&&A!=null&&!a.hasOwnProperty(T)&&Ae(e,t,T,null,a,A);for(U in a)A=a[U],j=n[U],!a.hasOwnProperty(U)||A===j||A==null&&j==null||Ae(e,t,U,A,a,j)}function qd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var r=n[a],u=r.transferSize,m=r.initiatorType,g=r.duration;if(u&&g&&qd(m)){for(m=0,g=r.responseEnd,a+=1;a<n.length;a++){var x=n[a],k=x.startTime;if(k>g)break;var O=x.transferSize,U=x.initiatorType;O&&qd(U)&&(x=x.responseEnd,m+=O*(x<g?1:(g-k)/(x-k)))}if(--a,t+=8*(u+m)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Eo=null,To=null;function ei(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Bd(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function No(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wo=null;function Dg(){var e=window.event;return e&&e.type==="popstate"?e===wo?!1:(wo=e,!0):(wo=null,!1)}var Gd=typeof setTimeout=="function"?setTimeout:void 0,zg=typeof clearTimeout=="function"?clearTimeout:void 0,Yd=typeof Promise=="function"?Promise:void 0,Ug=typeof queueMicrotask=="function"?queueMicrotask:typeof Yd<"u"?function(e){return Yd.resolve(null).then(e).catch(Lg)}:Gd;function Lg(e){setTimeout(function(){throw e})}function On(e){return e==="head"}function Qd(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(r),Qa(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")zl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,zl(n);for(var u=n.firstChild;u;){var m=u.nextSibling,g=u.nodeName;u[Pa]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=m}}else n==="body"&&zl(e.ownerDocument.body);n=r}while(n);Qa(t)}function Vd(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function ko(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ko(n),Ci(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function qg(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Pa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Dt(e.nextSibling),e===null)break}return null}function Hg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Dt(e.nextSibling),e===null))return null;return e}function Xd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dt(e.nextSibling),e===null))return null;return e}function Ao(e){return e.data==="$?"||e.data==="$~"}function jo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Dt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Oo=null;function Kd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Dt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Id(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function $d(e,t,n){switch(t=ei(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function zl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ci(e)}var zt=new Map,Zd=new Set;function ti(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var un=X.d;X.d={f:Gg,r:Yg,D:Qg,C:Vg,L:Xg,m:Kg,X:$g,S:Ig,M:Zg};function Gg(){var e=un.f(),t=Ks();return e||t}function Yg(e){var t=oa(e);t!==null&&t.tag===5&&t.type==="form"?df(t):un.r(e)}var Ba=typeof document>"u"?null:document;function Jd(e,t,n){var a=Ba;if(a&&typeof t=="string"&&t){var r=kt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Zd.has(r)||(Zd.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),nt(t,"link",e),Ze(t),a.head.appendChild(t)))}}function Qg(e){un.D(e),Jd("dns-prefetch",e,null)}function Vg(e,t){un.C(e,t),Jd("preconnect",e,t)}function Xg(e,t,n){un.L(e,t,n);var a=Ba;if(a&&e&&t){var r='link[rel="preload"][as="'+kt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+kt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+kt(n.imageSizes)+'"]')):r+='[href="'+kt(e)+'"]';var u=r;switch(t){case"style":u=Ga(e);break;case"script":u=Ya(e)}zt.has(u)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),zt.set(u,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(Ul(u))||t==="script"&&a.querySelector(Ll(u))||(t=a.createElement("link"),nt(t,"link",e),Ze(t),a.head.appendChild(t)))}}function Kg(e,t){un.m(e,t);var n=Ba;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+kt(a)+'"][href="'+kt(e)+'"]',u=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ya(e)}if(!zt.has(u)&&(e=S({rel:"modulepreload",href:e},t),zt.set(u,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ll(u)))return}a=n.createElement("link"),nt(a,"link",e),Ze(a),n.head.appendChild(a)}}}function Ig(e,t,n){un.S(e,t,n);var a=Ba;if(a&&e){var r=ua(a).hoistableStyles,u=Ga(e);t=t||"default";var m=r.get(u);if(!m){var g={loading:0,preload:null};if(m=a.querySelector(Ul(u)))g.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=zt.get(u))&&Co(e,n);var x=m=a.createElement("link");Ze(x),nt(x,"link",e),x._p=new Promise(function(k,O){x.onload=k,x.onerror=O}),x.addEventListener("load",function(){g.loading|=1}),x.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ni(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:g},r.set(u,m)}}}function $g(e,t){un.X(e,t);var n=Ba;if(n&&e){var a=ua(n).hoistableScripts,r=Ya(e),u=a.get(r);u||(u=n.querySelector(Ll(r)),u||(e=S({src:e,async:!0},t),(t=zt.get(r))&&Ro(e,t),u=n.createElement("script"),Ze(u),nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(r,u))}}function Zg(e,t){un.M(e,t);var n=Ba;if(n&&e){var a=ua(n).hoistableScripts,r=Ya(e),u=a.get(r);u||(u=n.querySelector(Ll(r)),u||(e=S({src:e,async:!0,type:"module"},t),(t=zt.get(r))&&Ro(e,t),u=n.createElement("script"),Ze(u),nt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(r,u))}}function Wd(e,t,n,a){var r=(r=me.current)?ti(r):null;if(!r)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ga(n.href),n=ua(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ga(n.href);var u=ua(r).hoistableStyles,m=u.get(e);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,m),(u=r.querySelector(Ul(e)))&&!u._p&&(m.instance=u,m.state.loading=5),zt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},zt.set(e,n),u||Jg(r,e,n,m.state))),t&&a===null)throw Error(i(528,""));return m}if(t&&a!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ya(n),n=ua(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ga(e){return'href="'+kt(e)+'"'}function Ul(e){return'link[rel="stylesheet"]['+e+"]"}function Fd(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function Jg(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nt(t,"link",n),Ze(t),e.head.appendChild(t))}function Ya(e){return'[src="'+kt(e)+'"]'}function Ll(e){return"script[async]"+e}function Pd(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+kt(n.href)+'"]');if(a)return t.instance=a,Ze(a),a;var r=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ze(a),nt(a,"style",r),ni(a,n.precedence,e),t.instance=a;case"stylesheet":r=Ga(n.href);var u=e.querySelector(Ul(r));if(u)return t.state.loading|=4,t.instance=u,Ze(u),u;a=Fd(n),(r=zt.get(r))&&Co(a,r),u=(e.ownerDocument||e).createElement("link"),Ze(u);var m=u;return m._p=new Promise(function(g,x){m.onload=g,m.onerror=x}),nt(u,"link",a),t.state.loading|=4,ni(u,n.precedence,e),t.instance=u;case"script":return u=Ya(n.src),(r=e.querySelector(Ll(u)))?(t.instance=r,Ze(r),r):(a=n,(r=zt.get(u))&&(a=S({},n),Ro(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ze(r),nt(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ni(a,n.precedence,e));return t.instance}function ni(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,u=r,m=0;m<a.length;m++){var g=a[m];if(g.dataset.precedence===t)u=g;else if(u!==r)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Co(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ro(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ai=null;function em(e,t,n){if(ai===null){var a=new Map,r=ai=new Map;r.set(n,a)}else r=ai,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var u=n[r];if(!(u[Pa]||u[Fe]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var m=u.getAttribute(t)||"";m=e+m;var g=a.get(m);g?g.push(u):a.set(m,[u])}}return a}function tm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Wg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function nm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Fg(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Ga(a.href),u=t.querySelector(Ul(r));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=li.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Ze(u);return}u=t.ownerDocument||t,a=Fd(a),(r=zt.get(r))&&Co(a,r),u=u.createElement("link"),Ze(u);var m=u;m._p=new Promise(function(g,x){m.onload=g,m.onerror=x}),nt(u,"link",a),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=li.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Mo=0;function Pg(e,t){return e.stylesheets&&e.count===0&&ii(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&ii(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Mo===0&&(Mo=62500*Mg());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ii(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Mo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function li(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ii(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var si=null;function ii(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,si=new Map,t.forEach(e_,e),si=null,li.call(e))}function e_(e,t){if(!(t.state.loading&4)){var n=si.get(e);if(n)var a=n.get(null);else{n=new Map,si.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<r.length;u++){var m=r[u];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}r=t.instance,m=r.getAttribute("data-precedence"),u=n.get(m)||a,u===a&&n.set(null,r),n.set(m,r),this.count++,a=li.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),u?u.parentNode.insertBefore(r,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var ql={$$typeof:ne,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function t_(e,t,n,a,r,u,m,g,x){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ki(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ki(0),this.hiddenUpdates=ki(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=u,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function am(e,t,n,a,r,u,m,g,x,k,O,U){return e=new t_(e,t,n,m,x,k,O,U,g),t=1,u===!0&&(t|=24),u=yt(3,null,null,t),e.current=u,u.stateNode=e,t=fr(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:n,cache:t},hr(u),e}function lm(e){return e?(e=ba,e):ba}function sm(e,t,n,a,r,u){r=lm(r),a.context===null?a.context=r:a.pendingContext=r,a=bn(t),a.payload={element:n},u=u===void 0?null:u,u!==null&&(a.callback=u),n=xn(e,a,t),n!==null&&(mt(n,e,t),gl(n,e,t))}function im(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Do(e,t){im(e,t),(e=e.alternate)&&im(e,t)}function rm(e){if(e.tag===13||e.tag===31){var t=Yn(e,67108864);t!==null&&mt(t,e,67108864),Do(e,67108864)}}function om(e){if(e.tag===13||e.tag===31){var t=Et();t=Ai(t);var n=Yn(e,t);n!==null&&mt(n,e,t),Do(e,t)}}var ri=!0;function n_(e,t,n,a){var r=C.T;C.T=null;var u=X.p;try{X.p=2,zo(e,t,n,a)}finally{X.p=u,C.T=r}}function a_(e,t,n,a){var r=C.T;C.T=null;var u=X.p;try{X.p=8,zo(e,t,n,a)}finally{X.p=u,C.T=r}}function zo(e,t,n,a){if(ri){var r=Uo(a);if(r===null)vo(e,t,a,oi,n),cm(e,a);else if(s_(r,e,t,n,a))a.stopPropagation();else if(cm(e,a),t&4&&-1<l_.indexOf(e)){for(;r!==null;){var u=oa(r);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var m=Ln(u.pendingLanes);if(m!==0){var g=u;for(g.pendingLanes|=2,g.entangledLanes|=2;m;){var x=1<<31-gt(m);g.entanglements[1]|=x,m&=~x}Yt(u),(ve&6)===0&&(Vs=pt()+500,Rl(0))}}break;case 31:case 13:g=Yn(u,2),g!==null&&mt(g,u,2),Ks(),Do(u,2)}if(u=Uo(a),u===null&&vo(e,t,a,oi,n),u===r)break;r=u}r!==null&&a.stopPropagation()}else vo(e,t,a,null,n)}}function Uo(e){return e=Li(e),Lo(e)}var oi=null;function Lo(e){if(oi=null,e=ra(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=h(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 oi=e,null}function um(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qp()){case gu:return 2;case _u:return 8;case Wl:case Vp:return 32;case yu:return 268435456;default:return 32}default:return 32}}var qo=!1,Cn=null,Rn=null,Mn=null,Hl=new Map,Bl=new Map,Dn=[],l_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function cm(e,t){switch(e){case"focusin":case"focusout":Cn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Hl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(t.pointerId)}}function Gl(e,t,n,a,r,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:u,targetContainers:[r]},t!==null&&(t=oa(t),t!==null&&rm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function s_(e,t,n,a,r){switch(t){case"focusin":return Cn=Gl(Cn,e,t,n,a,r),!0;case"dragenter":return Rn=Gl(Rn,e,t,n,a,r),!0;case"mouseover":return Mn=Gl(Mn,e,t,n,a,r),!0;case"pointerover":var u=r.pointerId;return Hl.set(u,Gl(Hl.get(u)||null,e,t,n,a,r)),!0;case"gotpointercapture":return u=r.pointerId,Bl.set(u,Gl(Bl.get(u)||null,e,t,n,a,r)),!0}return!1}function fm(e){var t=ra(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,Tu(e.priority,function(){om(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Tu(e.priority,function(){om(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 ui(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uo(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Ui=a,n.target.dispatchEvent(a),Ui=null}else return t=oa(n),t!==null&&rm(t),e.blockedOn=n,!1;t.shift()}return!0}function dm(e,t,n){ui(e)&&n.delete(t)}function i_(){qo=!1,Cn!==null&&ui(Cn)&&(Cn=null),Rn!==null&&ui(Rn)&&(Rn=null),Mn!==null&&ui(Mn)&&(Mn=null),Hl.forEach(dm),Bl.forEach(dm)}function ci(e,t){e.blockedOn===t&&(e.blockedOn=null,qo||(qo=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,i_)))}var fi=null;function mm(e){fi!==e&&(fi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){fi===e&&(fi=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(Lo(a||n)===null)continue;break}var u=oa(n);u!==null&&(e.splice(t,3),t-=3,zr(u,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function Qa(e){function t(x){return ci(x,e)}Cn!==null&&ci(Cn,e),Rn!==null&&ci(Rn,e),Mn!==null&&ci(Mn,e),Hl.forEach(t),Bl.forEach(t);for(var n=0;n<Dn.length;n++){var a=Dn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Dn.length&&(n=Dn[0],n.blockedOn===null);)fm(n),n.blockedOn===null&&Dn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],u=n[a+1],m=r[rt]||null;if(typeof u=="function")m||mm(n);else if(m){var g=null;if(u&&u.hasAttribute("formAction")){if(r=u,m=u[rt]||null)g=m.formAction;else if(Lo(r)!==null)continue}else g=m.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),mm(n)}}}function pm(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Ho(e){this._internalRoot=e}di.prototype.render=Ho.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,a=Et();sm(n,a,e,t,null,null)},di.prototype.unmount=Ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sm(e.current,2,null,e,null,null),Ks(),t[ia]=null}};function di(e){this._internalRoot=e}di.prototype.unstable_scheduleHydration=function(e){if(e){var t=Eu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dn.length&&t!==0&&t<Dn[n].priority;n++);Dn.splice(n,0,e),n===0&&fm(e)}};var hm=o.version;if(hm!=="19.2.8")throw Error(i(527,hm,"19.2.8"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=_(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var r_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mi.isDisabled&&mi.supportsFiber)try{Ja=mi.inject(r_),ht=mi}catch{}}return Ql.createRoot=function(e,t){if(!c(e))throw Error(i(299));var n=!1,a="",r=Sf,u=Ef,m=Tf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=am(e,1,!1,null,null,n,a,null,r,u,m,pm),e[ia]=t.current,xo(e),new Ho(t)},Ql.hydrateRoot=function(e,t,n){if(!c(e))throw Error(i(299));var a=!1,r="",u=Sf,m=Ef,g=Tf,x=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(x=n.formState)),t=am(e,1,!0,t,n??null,a,r,x,u,m,g,pm),t.context=lm(null),n=t.current,a=Et(),a=Ai(a),r=bn(a),r.callback=null,xn(n,r,a),n=a,t.current.lanes=n,Fa(t,n),Yt(t),e[ia]=t.current,xo(e),new di(t)},Ql.version="19.2.8",Ql}var Nm;function __(){if(Nm)return Yo.exports;Nm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),Yo.exports=g_(),Yo.exports}var y_=__();const wm=s=>{let o;const l=new Set,i=(_,b)=>{const S=typeof _=="function"?_(o):_;if(!Object.is(S,o)){const N=o;o=b??(typeof S!="object"||S===null)?S:Object.assign({},o,S),l.forEach(R=>R(o,N))}},c=()=>o,h={setState:i,getState:c,getInitialState:()=>y,subscribe:_=>(l.add(_),()=>l.delete(_))},y=o=s(i,c,h);return h},b_=(s=>s?wm(s):wm),x_=s=>s;function v_(s,o=x_){const l=pi.useSyncExternalStore(s.subscribe,pi.useCallback(()=>o(s.getState()),[s,o]),pi.useCallback(()=>o(s.getInitialState()),[s,o]));return pi.useDebugValue(l),l}const S_=s=>{const o=b_(s),l=i=>v_(o,i);return Object.assign(l,o),l},E_=(s=>S_),q={CONNECTED:"connected",DISCONNECTED:"disconnected",AGENT_CREATED:"agent.created",AGENT_OUTPUT:"agent.output",AGENT_STATUS_CHANGED:"agent.status_changed",AGENT_COMPLETED:"agent.completed",AGENT_ERROR:"agent.error",SESSION_TERMINATED:"session.terminated",TOOL_CALL_START:"tool.call_start",TOOL_CALL_END:"tool.call_end",TOOL_OUTPUT:"tool.output",PERMISSION_REQUESTED:"permission.requested",PERMISSION_INPUT_MODE:"permission.input_mode",PERMISSION_RESOLVED:"permission.resolved",PERMISSION_RESPONSE:"permission.response",PERMISSION_STATUS:"permission.status",CLARIFICATION_INPUT_MODE:"clarification.input_mode",CLARIFICATION_QUESTION:"clarification.question",CLARIFICATION_RESOLVED:"clarification.resolved",CLARIFICATION_RESPONSE:"clarification.response",CLARIFICATION_BATCH:"clarification.batch",CLARIFICATION_BATCH_RESPONSE:"clarification.batch_response",REFERENCE_SELECTION_REQUESTED:"reference_selection.requested",REFERENCE_SELECTION_RESOLVED:"reference_selection.resolved",REFERENCE_SELECTION_RESPONSE:"reference_selection.response",PLAN_UPDATED:"plan.updated",PLAN_STEP_UPDATED:"plan.step_updated",PLAN_CLEARED:"plan.cleared",CONTEXT_UPDATED:"context.updated",TURN_COMPLETED:"turn.completed",SYSTEM_MESSAGE:"system.message",HELP_TEXT:"help.text",ERROR:"error",INIT_PROGRESS:"init.progress",RETRY:"retry",SESSION_LIST:"session.list",SESSION_INFO:"session.info",SEND_MESSAGE:"message.send",STOP:"session.stop",COMMAND:"command.execute",COMMAND_LIST_REQUEST:"command.list_request",COMMAND_LIST:"command.list",COMMAND_LIST_REFRESH:"command.list_refresh",TOOL_DISABLE_REQUEST:"tools.disable",TOOLS_REGISTER_CLIENT:"tools.register_client",TOOL_EXECUTE_REQUEST:"tool.execute_request",TOOL_EXECUTE_RESULT:"tool.execute_result",HISTORY_REQUEST:"history.request",HISTORY:"history",CLIENT_CONFIG:"client.config",POST_AUTH_SETUP:"auth.setup",POST_AUTH_SETUP_RESPONSE:"auth.setup_response",WORKSPACE_LIST_REQUEST:"workspace.list",WORKSPACE_LIST:"workspace.list_response",WORKSPACE_CREATE_REQUEST:"workspace.create",WORKSPACE_CREATED:"workspace.created",WORKSPACE_SELECT_REQUEST:"workspace.select",WORKSPACE_DELETE_REQUEST:"workspace.delete",WORKSPACE_DELETED:"workspace.deleted",CONFIG_STATUS:"config.status",CONFIG_UPDATE_REQUEST:"config.update",CONFIG_UPDATED:"config.updated",WORKSPACE_FILES_STAGE_REQUEST:"workspace.files.stage_request",WORKSPACE_FILES_STAGED:"workspace.files.staged",SESSION_PROFILES:"session.profiles",WORKSPACE_FILES_CHANGED:"workspace.files_changed",WORKSPACE_FILES_SNAPSHOT:"workspace.files_snapshot",WORKSPACE_IGNORE_RESULT:"workspace.ignore.result",INJECT_PROMPT_REQUEST:"inject_prompt.request",REPLAY_MESSAGES_REQUEST:"replay_messages.request",RESOLVE_FORK_POINT_REQUEST:"resolve_fork_point.request",PERMISSION_ADD_WHITELIST_REQUEST:"permission.add_whitelist",PERMISSION_ADD_BLACKLIST_REQUEST:"permission.add_blacklist",PERMISSION_REMOVE_REQUEST:"permission.remove",PERMISSION_CLEAR_REQUEST:"permission.clear",PERMISSION_SET_DEFAULT_REQUEST:"permission.set_default",PERMISSION_POLICY_SNAPSHOT_REQUEST:"permission.policy_snapshot.request"};class Tt extends Error{constructor(o){super(o),this.name="ConnectionError"}}class Ko extends Error{constructor(o="Client is reconnecting"){super(o),this.name="ReconnectingError"}}class hi extends Error{constructor(o="Connection is closed"){super(o),this.name="ConnectionClosedError"}}class km extends Error{serverProtocol;minProtocol;serverVersion;constructor(o,l,i){const c=i??"unknown",f=o.split(".").map(y=>parseInt(y,10)),p=l.split(".").map(y=>parseInt(y,10));let h="version mismatch";!Number.isNaN(f[0])&&!Number.isNaN(p[0])&&f[0]!==p[0]?h=`major-version mismatch (server speaks ${f[0]}.x, client needs ${p[0]}.x) — wire shapes are incompatible`:!Number.isNaN(f[1])&&!Number.isNaN(p[1])&&f[1]<p[1]&&(h=`server minor ${f[1]} is below client's required minor ${p[1]} — daemon is missing fields the client depends on`),super(`Server protocol ${o} is not supported by this client (requires >= ${l}): ${h}. Daemon package: ${c}.`),this.name="IncompatibleServerError",this.serverProtocol=o,this.minProtocol=l,this.serverVersion=c}get minVersion(){return this.minProtocol}}class T_ extends Error{errorType;errorSummary;constructor(o,l){super(`${o??"AgentError"}: ${l??""}`.replace(/: $/,"")),this.name="AgentError",this.errorType=o,this.errorSummary=l}}class N_ extends Error{toolName;constructor(o){super(`tool ${JSON.stringify(o)} requested permission but no onPermission callback was set — pass onPermission to session(...) or use the low-level subscribe(PERMISSION_REQUESTED) API via s.client`),this.name="PermissionUnhandled",this.toolName=o}}class w_ extends Error{field;value;constructor(o,l){super(`${o}=${JSON.stringify(l)} is a relative path and cannot cross the daemon boundary: its meaning depends on the cwd of whichever process reads it, and the two sides do not share one. Resolve it to an absolute path in the process whose cwd it is relative to.`),this.name="RelativePathAcrossBoundaryError",this.field=o,this.value=l}}var He=(s=>(s.DISCONNECTED="disconnected",s.CONNECTED="connected",s.RECONNECTING="reconnecting",s.CLOSED="closed",s))(He||{});const k_={autoReconnect:!0,maxReconnectAttempts:null,initialBackoffSeconds:1,maxBackoffSeconds:30,jitterFactor:.1,autoReattachSessionId:!1};function A_(s){if(s.headers||s.token==null)return s.url;const o=new URL(s.url);return o.searchParams.set("token",s.token),o.toString()}function j_(s){const o=s.openTimeoutMs??5e3,l=A_(s),i=globalThis.WebSocket;if(i==null)return Promise.reject(new Tt("No WebSocket implementation available. Ensure Node 21+ or a browser environment."));let c;try{s.headers?c=new i(l,{headers:s.headers}):c=new i(l)}catch(S){return Promise.reject(new Tt(`WebSocket constructor failed: ${S.message}`))}c.binaryType="arraybuffer";const f=[],p=[];let h=!1,y=null;const _=[],b=()=>{for(h=!0;p.length;)p.shift()(null)};return new Promise((S,N)=>{let R=setTimeout(()=>{try{c.close()}catch{}N(new Tt(`WebSocket open timed out after ${o}ms`))},o);c.onopen=()=>{R&&(clearTimeout(R),R=null),S({sendEvent(V){if(h)throw new Tt("Transport is closed");c.send(JSON.stringify(V))},sendRawEvent(V){if(h)throw new Tt("Transport is closed");c.send(JSON.stringify(V))},sendBinary(V){if(h)throw new Tt("Transport is closed");c.send(V)},async*events(){for(;;){if(f.length>0){yield f.shift();continue}if(h)return;const V=await new Promise(K=>{p.push(K)});if(V==null)return;yield V}},close(V,K){try{c.close(V??1e3,K??"")}catch{}},onClose(V){y?V(y):_.push(V)},get isOpen(){return!h}})},c.onerror=()=>{R&&(clearTimeout(R),R=null,N(new Tt("WebSocket error during open")))},c.onmessage=M=>{let V;if(typeof M.data=="string")V=M.data;else if(M.data instanceof ArrayBuffer)V=new TextDecoder().decode(M.data);else if(M.data?.text){M.data.text().then(K=>{B(K)});return}else{try{c.close(1003,"unsupported frame type")}catch{}return}B(V)},c.onclose=M=>{if(R){clearTimeout(R),R=null,N(new Tt(`WebSocket closed before open (code=${M.code}, reason=${M.reason||"<empty>"})`));return}y={code:M.code,reason:M.reason||""},b();for(const V of _)try{V(y)}catch{}};function B(M){let V;try{V=JSON.parse(M)}catch{try{c.close(1003,"invalid JSON frame")}catch{}return}p.length>0?p.shift()(V):f.push(V)}})}Symbol.asyncDispose??=Symbol.for("Symbol.asyncDispose");const Am=["model"];class O_{#e;#n;#t=null;#s;constructor(o,l,i){this.#e=o,this.#n=l,o.subscribe(q.PERMISSION_REQUESTED,c=>{this.#i(c)}),i&&i.size>0&&(this.#s=i,o.subscribe(q.TOOL_EXECUTE_REQUEST,c=>{this.#r(c)}))}get client(){return this.#e}get sessionId(){return this.#e.sessionId}async#i(o){const l=o,i=l?.request_id??"";if(this.#n){const c=await this.#n(o);await this.#e.respondToPermission(i,c||"n")}else this.#t=l?.tool_name??"?",await this.#e.respondToPermission(i,"n")}async#r(o){const l=o,i=l?.call_id??"",c=l?.tool_name?this.#s?.get(l.tool_name):void 0;if(!c){await this.#e.respondToToolExecution(i,"",`no handler for host tool ${JSON.stringify(l?.tool_name)}`);return}try{const f=await c(l?.tool_args??{}),p=typeof f=="string"?f:JSON.stringify(f);await this.#e.respondToToolExecution(i,p)}catch(f){await this.#e.respondToToolExecution(i,"",f instanceof Error?f.message:String(f))}}#a(o){if(this.#t!==null){const l=this.#t;throw this.#t=null,new N_(l)}if(o.reason==="error")throw new T_(o.errorType,o.errorSummary)}#l(o,l){const i=l;o.reason??=i?.reason??"natural",i?.error_type&&(o.errorType=i.error_type),i?.error_summary&&(o.errorSummary=i.error_summary)}async ask(o,l={}){const i=l.sources===void 0?Am:l.sources,c=[],f={};let p;const h=new Promise(R=>{p=R}),y=R=>{const B=R;(i===null||B?.source!=null&&i.includes(B.source))&&B?.text&&c.push(B.text)},_=R=>{this.#l(f,R),p()},b=this.#e.subscribe(q.AGENT_OUTPUT,y),S=this.#e.subscribeOnce(q.SESSION_TERMINATED,_),N=this.#e.subscribeOnce(q.TURN_COMPLETED,_);try{await this.#e.sendMessage(o,l.attachments,l.parallelTools),await h}finally{b(),S(),N()}return this.#a(f),c.join("")}async complete(o,l={}){const i={};let c=null,f;const p=new Promise(N=>{f=N}),h=N=>{c=N?.payload??null},y=N=>{this.#l(i,N),f()},_=this.#e.subscribeOnce(q.AGENT_COMPLETED,h),b=this.#e.subscribeOnce(q.SESSION_TERMINATED,y),S=this.#e.subscribeOnce(q.TURN_COMPLETED,y);try{await this.#e.sendMessage(o,l.attachments,l.parallelTools),await p}finally{_(),b(),S()}return this.#a(i),c}async*stream(o,l={}){const i=l.sources===void 0?Am:l.sources,c=[],f={};let p=!1,h=null;const y=()=>{if(h){const B=h;h=null,B()}},_=B=>{const M=B;(i===null||M?.source!=null&&i.includes(M.source))&&M?.text&&(c.push(M.text),y())},b=B=>{this.#l(f,B),p=!0,y()},S=this.#e.subscribe(q.AGENT_OUTPUT,_),N=this.#e.subscribeOnce(q.SESSION_TERMINATED,b),R=this.#e.subscribeOnce(q.TURN_COMPLETED,b);try{for(await this.#e.sendMessage(o,l.attachments,l.parallelTools);;){if(c.length>0){yield c.shift();continue}if(p)break;await new Promise(B=>{h=B})}}finally{S(),N(),R()}this.#a(f)}async close(){await this.#e.close()}async[Symbol.asyncDispose](){await this.close()}}function C_(s,o){return s.sessionId?Promise.resolve(s.sessionId):new Promise(l=>{let i;const c=s.subscribe(q.SESSION_INFO,()=>{clearTimeout(i),c(),l(s.sessionId)});i=setTimeout(()=>{c(),l(null)},o)})}function R_(s){return s.startsWith("/")||s.startsWith("\\\\")||/^[A-Za-z]:[\\/]/.test(s)}function jm(s,o){if(o!==void 0&&o!==""&&!R_(o))throw new w_(s,o)}async function M_(s){const o={...s.presentation??{},client_type:s.clientType??"api"};jm("workspacePath",s.workspacePath),jm("configRoot",s.configRoot);const l={presentation:o};s.workspacePath!==void 0&&(l.working_dir=s.workspacePath),s.envFile!==void 0&&(l.env_file=s.envFile),s.configRoot!==void 0&&(l.config_root=s.configRoot),s.apparmor!==void 0&&(l.apparmor=s.apparmor);const i={url:s.url,token:s.token,headers:s.headers,minProtocolVersion:s.minProtocolVersion,recovery:s.recovery,openTimeoutMs:s.openTimeoutMs,clientConfig:l},c=new fp(i);s.onStatusChange&&c.onStatus(s.onStatusChange),await c.connect();const f=new Map;if(s.clientTools&&s.clientTools.length>0){const _=s.clientTools.map(b=>{const{handler:S,...N}=b;return S&&typeof b.name=="string"&&f.set(b.name,S),N});await c.registerClientTools(_)}const p=s.sessionTimeoutMs??6e4,h=C_(c,p);if(await c.createSession({profile:s.profile,agent:s.agent,agentParams:s.agentParams,cascadeDriverId:s.cascadeDriverId}),!await h)throw await c.close(),new Error(`session.new did not produce a session id within ${p}ms — check provider auth / the daemon log`);return new O_(c,s.onPermission,f)}const D_="1.0",Om="1.5",Cm="1.6",Rm="1.11",Mm="1.12";function Dm(s){const o=s.split(".");if(o.length<2)return null;const l=parseInt(o[0],10),i=parseInt(o[1],10);return Number.isNaN(l)||Number.isNaN(i)?null:[l,i]}function Vl(s,o){const l=Dm(s),i=Dm(o);return l==null||i==null||l[0]!==i[0]?!1:l[1]>=i[1]}class fp{_options;_recovery;_transport=null;_state=He.DISCONNECTED;_serverVersion=null;_serverProtocolVersion=null;_clientId=null;_sessionId=null;_statusHandlers=[];_typedHandlers=new Map;_catchallHandlers=[];_handlerIdCounter=0;_bufferedEvents=[];_eventLoopActive=!1;_reconnectAttempts=0;_reconnectTimer=null;_explicitClose=!1;constructor(o){if(this._options=o,this._recovery={...k_,...o.recovery??{}},this._recovery.autoReattachSessionId){let l=!1;this.onStatus(i=>{if(i.state===He.RECONNECTING){l=!0;return}i.state===He.CONNECTED&&l&&this._sessionId&&(l=!1,this.attachSession(this._sessionId))})}}get state(){return this._state}get isConnected(){return this._state===He.CONNECTED}get serverVersion(){return this._serverVersion}get serverProtocolVersion(){return this._serverProtocolVersion}get clientId(){return this._clientId}get sessionId(){return this._sessionId}onStatus(o){return this._statusHandlers.push(o),()=>{const l=this._statusHandlers.indexOf(o);l>=0&&this._statusHandlers.splice(l,1)}}async connect(){if(this._state!==He.CONNECTED){if(this._state===He.CLOSED)throw new hi("Client was closed; construct a new instance");this._explicitClose=!1,await this._openOnce(),this._startEventLoop()}}async close(){this._explicitClose=!0,this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._transport&&(this._transport.close(1e3,"client close"),this._transport=null),this._transition(He.CLOSED)}subscribe(o,l){return this._addTypedHandler(o,l,!1)}subscribeOnce(o,l){return this._addTypedHandler(o,l,!0)}subscribeAll(o){return this._addCatchallHandler(o,!1)}subscribeMany(o){const l=[];for(const i of Object.keys(o)){const c=o[i];c&&l.push(this._addTypedHandler(i,c,!1))}return()=>{for(const i of l)i()}}_addTypedHandler(o,l,i){const c=++this._handlerIdCounter,f={handler:l,once:i,id:c};let p=this._typedHandlers.get(o);return p||(p=[],this._typedHandlers.set(o,p)),p.push(f),()=>this._removeTypedHandlerId(o,c)}_addCatchallHandler(o,l){const i=++this._handlerIdCounter,c={handler:o,once:l,id:i};return this._catchallHandlers.push(c),()=>this._removeCatchallHandlerId(i)}_removeTypedHandlerId(o,l){const i=this._typedHandlers.get(o);if(!i)return;const c=i.findIndex(f=>f.id===l);c>=0&&i.splice(c,1)}_removeCatchallHandlerId(o){const l=this._catchallHandlers.findIndex(i=>i.id===o);l>=0&&this._catchallHandlers.splice(l,1)}async sendMessage(o,l,i){await this._sendEvent({type:q.SEND_MESSAGE,text:o,attachments:l??[],parallel_tools:i??null})}async stop(o){await this._sendEvent({type:q.STOP,agent_id:o??null})}async respondToPermission(o,l,i){await this._sendEvent({type:q.PERMISSION_RESPONSE,request_id:o,response:l,edited_arguments:i??null})}async respondToPostAuthSetup(o,l){await this._sendEvent({type:q.POST_AUTH_SETUP_RESPONSE,request_id:o,connect:l.connect,model_name:l.modelName??"",persist_env:l.persistEnv??!1})}async respondToClarification(o,l,i=0){await this._sendEvent({type:q.CLARIFICATION_RESPONSE,request_id:o,question_index:i,response:l})}async respondToClarificationBatch(o,l,i=!1,c){const f=!i&&c!==void 0&&Object.keys(c).length>0;f&&this._requireClarificationAttachmentProtocol(),await this._sendEvent({type:q.CLARIFICATION_BATCH_RESPONSE,request_id:o,answers:l,cancelled:i,answer_attachments:f?c:{}})}_requireClarificationAttachmentProtocol(){if(!(this._serverProtocolVersion!==null&&Vl(this._serverProtocolVersion,Cm)))throw new Error(`respondToClarificationBatch: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and would DROP the answer attachments (needs >= ${Cm}). Answer the clarification in text, or upgrade the daemon.`)}async respondToReferenceSelection(o,l){await this._sendEvent({type:q.REFERENCE_SELECTION_RESPONSE,request_id:o,response:l})}async respondToToolExecution(o,l="",i=""){await this._sendEvent({type:q.TOOL_EXECUTE_RESULT,call_id:o,result:l,error:i})}async createSession(o={}){const l=o.name?[o.name]:[];let i;if(typeof o.profile=="string")l.push("--profile",o.profile);else if(o.profile!==void 0&&o.profile!==null&&typeof o.profile=="object")i={spec:o.profile};else if(o.profile!==void 0&&o.profile!==null)throw new TypeError(`createSession: 'profile' must be string (name) or object (inline spec), got ${typeof o.profile}`);if(o.agent&&l.push("--agent",o.agent),o.agentParams)for(const[c,f]of Object.entries(o.agentParams))l.push(`${c}=${f}`);o.cascadeDriverId&&l.push("--cascade-driver-id",o.cascadeDriverId),await this._sendEvent({type:q.COMMAND,command:"session.new",args:l,payload:i})}static session(o){return M_(o)}async attachSession(o){await this._sendEvent({type:q.COMMAND,command:"session.attach",args:[o]}),this._sessionId=o}async getDefaultSession(){await this._sendEvent({type:q.COMMAND,command:"session.default",args:[]})}async listSessions(){await this._sendEvent({type:q.COMMAND,command:"session.list",args:[]})}async listProfiles(){await this._sendEvent({type:q.COMMAND,command:"session.profiles",args:[]})}async endSession(){await this._sendEvent({type:q.COMMAND,command:"session.end",args:[]})}async reloadSessionEnv(o){if(this._serverProtocolVersion===null||!Vl(this._serverProtocolVersion,Rm))throw new Error(`reloadSessionEnv: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and does not serve session.reload_env (needs >= ${Rm}). It would ignore the command silently. Upgrade the daemon, or start a new session to pick up the credential.`);await this._sendEvent({type:q.COMMAND,command:"session.reload_env",args:o?[o]:[]})}async toggleWorkspaceIgnore(o){if(this._serverProtocolVersion===null||!Vl(this._serverProtocolVersion,Mm))throw new Error(`toggleWorkspaceIgnore: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and does not serve workspace.ignore (needs >= ${Mm}). It would ignore the command silently. Upgrade the daemon, or edit the workspace's .gitignore directly.`);await this._sendEvent({type:q.COMMAND,command:"workspace.ignore",args:[o]})}async deleteSession(o){await this._sendEvent({type:q.COMMAND,command:"session.delete",args:[o]})}async executeCommand(o,l,i){await this._sendEvent({type:q.COMMAND,command:o,args:l??[],payload:i??null})}async sendRawEvent(o){if(this._state===He.RECONNECTING)throw new Ko;if(this._state===He.CLOSED)throw new hi;if(this._transport==null)throw new Tt("No active transport — call connect() first");this._transport.sendRawEvent(o)}async disableTool(o){await this._sendEvent({type:q.TOOL_DISABLE_REQUEST,tool_name:o})}async requestCommandList(){await this._sendEvent({type:q.COMMAND_LIST_REQUEST})}async requestHistory(o="main"){await this._sendEvent({type:q.HISTORY_REQUEST,agent_id:o})}async registerClientTools(o,l){await this._sendEvent({type:q.TOOLS_REGISTER_CLIENT,tools:o,categories:l??{}})}async injectPrompt(o,l="user",i,c){c&&c.length>0&&this._requireAttachmentResumeProtocol("injectPrompt"),await this._sendEvent({type:q.INJECT_PROMPT_REQUEST,text:o,source_type:l,source_id:i??null,attachments:c??[]})}async wakeSession(o,l="",i){const c=i?.attachments??[];if(!l&&c.length===0)throw new Error("wakeSession requires text or attachments — a wake with no content drives a turn the model has nothing to answer");const f={session_id:o,text:l,source:i?.source??"user"};i?.eventId!==void 0&&(f.event_id=i.eventId),c.length>0&&(this._requireAttachmentResumeProtocol("wakeSession"),f.attachments=c),await this.executeCommand("session.wake",[],f)}_requireAttachmentResumeProtocol(o){if(!(this._serverProtocolVersion!==null&&Vl(this._serverProtocolVersion,Om)))throw new Error(`${o}: this daemon speaks protocol ${this._serverProtocolVersion??"unknown"} and would DROP the attachments (needs >= ${Om}). Send the content through sendMessage() on a live session, or upgrade the daemon.`)}async replayMessages(o,l,i=120){await this._sendEvent({type:q.REPLAY_MESSAGES_REQUEST,request_id:o,messages:l??null,timeout_seconds:i})}async resolveForkPoint(o,l={}){await this._sendEvent({type:q.RESOLVE_FORK_POINT_REQUEST,request_id:o,after_message:l.afterMessage??null,after_tool_call:l.afterToolCall??null,after_timestamp:l.afterTimestamp??null})}async addWhitelistTools(o,l){await this._sendEvent({type:q.PERMISSION_ADD_WHITELIST_REQUEST,tools:o??[],patterns:l??[]})}async addBlacklistTools(o,l){await this._sendEvent({type:q.PERMISSION_ADD_BLACKLIST_REQUEST,tools:o??[],patterns:l??[]})}async removePermissionRules(o,l,i){await this._sendEvent({type:q.PERMISSION_REMOVE_REQUEST,target:o,tools:l??[],patterns:i??[]})}async clearPermissionRules(o="all"){await this._sendEvent({type:q.PERMISSION_CLEAR_REQUEST,target:o})}async setDefaultPolicy(o){await this._sendEvent({type:q.PERMISSION_SET_DEFAULT_REQUEST,policy:o})}async requestPolicySnapshot(o=""){await this._sendEvent({type:q.PERMISSION_POLICY_SNAPSHOT_REQUEST,request_id:o})}async stageFiles(o,l){if(this._state!==He.CONNECTED)throw this._state===He.RECONNECTING?new Ko:new hi;if(this._transport==null)throw new Tt("No active transport — call connect() first");const i=this._transport,c=l.map(p=>({name:p.name,size:(p.data instanceof ArrayBuffer,p.data.byteLength),content_type:p.contentType??null,mode:p.mode??null})),f=this._waitForNextEvent(p=>p.type===q.WORKSPACE_FILES_STAGED);i.sendEvent({type:q.WORKSPACE_FILES_STAGE_REQUEST,workspace_id:o,files:c});for(const p of l)i.sendBinary(p.data);return f}_waitForNextEvent(o){return new Promise(l=>{const i=this.subscribeAll(c=>{o(c)&&(i(),l(c))})})}async _sendEvent(o){if(this._state===He.RECONNECTING)throw new Ko;if(this._state===He.CLOSED)throw new hi;if(this._transport==null)throw new Tt("No active transport — call connect() first");this._transport.sendEvent(o)}async _resolveToken(){const o=this._options.token;return typeof o=="function"?await o():o}async _openOnce(){const o=await this._resolveToken(),l=await j_({url:this._options.url,token:o,headers:this._options.headers,openTimeoutMs:this._options.openTimeoutMs});this._transport=l,l.onClose(_=>this._handleClose(_));const i=l.events(),c=await i.next();if(c.done)throw this._transport=null,new Tt("Server closed connection before sending ConnectedEvent");const f=c.value;if(f.type!==q.CONNECTED)throw this._transport=null,l.close(),new Tt(`Expected ConnectedEvent from server, got ${f.type}`);const p=f,h=p.server_info??{};this._serverVersion=h.server_version??null,this._clientId=h.client_id??null,this._serverProtocolVersion=p.protocol_version??null;const y=this._options.minProtocolVersion??D_;if(this._serverProtocolVersion==null||!Vl(this._serverProtocolVersion,y))throw this._transport=null,l.close(1002,"incompatible protocol version"),new km(this._serverProtocolVersion??"unknown",y,this._serverVersion??void 0);if(this._options.clientConfig){const _={type:q.CLIENT_CONFIG,timestamp:new Date().toISOString(),...this._options.clientConfig};l.sendEvent(_)}this._reconnectAttempts=0,this._transition(He.CONNECTED,{serverVersion:this._serverVersion??void 0,clientId:this._clientId??void 0}),this._dispatchEvent(p),this._pumpFromIterator(i)}async _pumpFromIterator(o){try{for(;;){const l=await o.next();if(l.done)return;this._dispatchEvent(l.value)}}catch{}}_startEventLoop(){if(!this._eventLoopActive)for(this._eventLoopActive=!0;this._bufferedEvents.length>0;){const o=this._bufferedEvents.shift();this._dispatchEvent(o)}}_dispatchEvent(o){const l=o.session_id;l&&o.type===q.SESSION_INFO&&(this._sessionId=l);const i=this._typedHandlers.get(o.type),c=i?i.slice():[],f=this._catchallHandlers.slice();for(const p of c)p.once&&this._removeTypedHandlerId(o.type,p.id),this._invokeHandler(p.handler,o);for(const p of f)p.once&&this._removeCatchallHandlerId(p.id),this._invokeHandler(p.handler,o)}_invokeHandler(o,l){let i;try{i=o(l)}catch(c){console.error("[JaatoClient] subscriber threw:",c);return}i&&typeof i.then=="function"&&i.catch(c=>{console.error("[JaatoClient] async subscriber rejected:",c)})}_handleClose(o){if(this._transport=null,this._explicitClose||this._state===He.CLOSED){this._transition(He.CLOSED,{reason:o.reason||`code ${o.code}`});return}if(!this._recovery.autoReconnect){this._transition(He.CLOSED,{reason:`connection lost (code ${o.code})`});return}this._scheduleReconnect()}_scheduleReconnect(){if(this._reconnectAttempts+=1,this._recovery.maxReconnectAttempts!=null&&this._reconnectAttempts>this._recovery.maxReconnectAttempts){this._transition(He.CLOSED,{reason:`max reconnect attempts (${this._recovery.maxReconnectAttempts}) exceeded`});return}const o=Math.min(this._recovery.initialBackoffSeconds*Math.pow(2,this._reconnectAttempts-1),this._recovery.maxBackoffSeconds),l=o*this._recovery.jitterFactor*(Math.random()*2-1),i=Math.max(0,o+l);this._transition(He.RECONNECTING,{reconnectAttempt:this._reconnectAttempts,reconnectDelaySeconds:i}),this._reconnectTimer=setTimeout(()=>{this._reconnectTimer=null,this._attemptReconnect().catch(()=>{})},i*1e3)}async _attemptReconnect(){try{await this._openOnce()}catch(o){if(o instanceof km){this._transition(He.CLOSED,{reason:o.message});return}this._scheduleReconnect()}}_transition(o,l={}){if(o===this._state&&o!==He.RECONNECTING)return;this._state=o;const i={state:o,...l};for(const c of this._statusHandlers)try{c(i)}catch(f){console.error("[JaatoClient] status handler threw:",f)}}}const dp=[{name:"help",description:"Show available commands"},{name:"history",description:"Show conversation history"},{name:"exit",description:"Detach from the session"},{name:"quit",description:"Detach from the session"},{name:"stop",description:"Stop current model generation"},{name:"clear",description:"Clear output display"},{name:"context",description:"Show context window usage"},{name:"reset",description:"Clear conversation history"},{name:"theme",description:"Switch the UI theme (theme <name>)"}],z_=new Set(dp.map(s=>s.name)),U_=new Set(["tools","session","permissions","model","mcp","save","resume","memory","lsp","todo","waypoint","background","prompt-library","clarification","multimodal","notebook","references","sandbox","workspace","reliability"]),L_=[{name:"tools",description:"Manage tools available to the model"},{name:"tools list",description:"List all tools with enabled/disabled status"},{name:"tools enable",description:"Enable a tool (tools enable <name>|all)"},{name:"tools disable",description:"Disable a tool (tools disable <name>|all)"},{name:"model",description:"Switch to a different model"},{name:"session",description:"Manage sessions"},{name:"session list",description:"List sessions"},{name:"session new",description:"Create a new session"},{name:"session attach",description:"Attach to an existing session"},{name:"permissions",description:"Manage tool permissions"},{name:"permissions status",description:"Show permission status"},{name:"permissions whitelist",description:"Whitelist tools or patterns"},{name:"permissions blacklist",description:"Blacklist tools or patterns"},{name:"save",description:"Save current session"},{name:"resume",description:"Resume a saved session"},{name:"sessions",description:"List saved sessions"},{name:"plan",description:"Show current plan status"}];function mp(s,o={}){const l=s.trim();if(!l)return{action:"message",text:""};if(o.verbatim)return{action:"message",text:l};const i=l.toLowerCase(),c=l.split(/\s+/),f=(c[0]??"").toLowerCase(),p=c.slice(1);if(i==="exit"||i==="quit"||i==="q")return{action:"exit"};if(i==="stop")return{action:"stop"};if(i==="clear")return{action:"clear"};if(i==="help")return{action:"help"};if(i==="context")return{action:"context"};if(i==="history")return{action:"history"};if(f==="reset")return{action:"server",command:"reset",args:p};if(f==="tools"||f==="session"){const h=p[0]??"list";return{action:"server",command:`${f}.${h}`,args:p.slice(1)}}if(U_.has(f))return{action:"server",command:f,args:p};if(f==="theme")return{action:"server",command:"theme",args:p};for(const h of o.serverCommands??[]){const y=h.name.trim().toLowerCase().split(/\s+/)[0];if(!(!y||z_.has(y))&&(i===y||i.startsWith(y+" ")))return{action:"server",command:y,args:p}}return{action:"message",text:l}}function zm(s,o){const l=mp(s,{serverCommands:o});return l.action==="message"?null:l.action==="server"?l.command??"":l.action}function q_(s,o){const l=s.replace(/^\s+/,"");if(l.includes("@")||l.startsWith("/")||l.startsWith("%"))return[];if(l.includes(`
|
|
10
|
+
`))return[];const i=/\s$/.test(l),c=l.trim()===""?[]:l.trim().split(/\s+/),f=new Set,p=[],h=(b,S,N)=>{const R=b.toLowerCase();f.has(R)||(f.add(R),p.push({insert:b,label:S,description:N}))};if(c.length===0){for(const b of o){const S=b.name.split(/\s+/)[0];S===b.name?h(S,b.name,b.description):h(S,S,void 0)}return p}const y=c[0].toLowerCase();if(c.length===1&&!i){for(const b of o){const S=b.name.split(/\s+/)[0];S.toLowerCase().startsWith(y)&&(S===b.name?h(S,b.name,b.description):h(S,S,void 0))}return p}const _=c.length===1?"":(c[1]??"").toLowerCase();if(c.length>2||c.length===2&&i)return[];for(const b of o){const S=b.name.split(/\s+/);if(S.length<2||S[0].toLowerCase()!==y)continue;const N=S[1];N.toLowerCase().startsWith(_)&&h(`${S[0]} ${N}`,`${S[0]} ${N}`,b.description)}return p}function pp(s){const o=new Map;for(const l of[...dp,...L_])o.set(l.name,l);for(const l of s)l.name&&o.set(l.name,l);return[...o.values()]}function Il(s){return typeof s=="string"&&s?s:void 0}function H_(s,o){return typeof s=="string"?s:s&&typeof s=="object"?Il(s.text)??Il(s.label)??`choice ${o}`:`choice ${o}`}function Um(s){const o=s&&typeof s=="object"?s:{},l=Array.isArray(o.choices)?o.choices:Array.isArray(o.options)?o.options:[],i=l.map((y,_)=>H_(y,_+1));let c=null;const f=l.findIndex(y=>!!y&&typeof y=="object"&&y.default===!0);f>=0?c=f+1:typeof o.default_choice=="number"?c=o.default_choice:(typeof o.default=="number"||typeof o.default=="string"&&o.default)&&(c=o.default);const p=l.map(y=>!!y&&typeof y=="object"&&y.expects_attachment===!0),h=o.required===!1||o.optional===!0;return{...o,question_text:Il(o.question_text)??Il(o.text),question_type:Il(o.question_type),options:i,default:c,optional:h,expects_attachment:p.some(Boolean)?p:void 0}}function B_(s){return s.question_type==="multiple_choice"}function G_(s){if(s==null)return null;if(typeof s=="number")return Number.isFinite(s)?{count:s,byName:[]}:null;if(!Array.isArray(s))return null;const o=new Map;for(const l of s){const i=l&&typeof l=="object"&&typeof l.name=="string"?l.name:typeof l=="string"?l:"?";o.set(i,(o.get(i)??0)+1)}return{count:s.length,byName:[...o.entries()]}}function Y_(s){if(s.count===0)return"no tool calls";const o=`${s.count} tool call${s.count===1?"":"s"}`;if(s.byName.length===0)return o;const l=s.byName.map(([i,c])=>c>1?`${i} ×${c}`:i).join(", ");return`${o} (${l})`}function Q_(s){if(!s||typeof s!="object")return null;const o=s,l=String(o.id??o.session_id??"");return l?{id:l,name:String(o.name??""),description:String(o.description??""),provider:String(o.model_provider??""),model:String(o.model_name??""),isLoaded:o.is_loaded===!0,isCurrent:o.is_current===!0,clientCount:Number(o.client_count??0)||0,turnCount:Number(o.turn_count??0)||0,workspacePath:String(o.workspace_path??""),createdBy:o.created_by?String(o.created_by):void 0}:null}function Lm(s){return Array.isArray(s)?s.map(Q_).filter(o=>o!==null):[]}function V_(s){if(s.length===0)return`No sessions available.
|
|
11
|
+
Use 'session new' to create one.`;const o=["Sessions:"," Use 'session attach <id>' to switch sessions",""];for(const l of s){const i=l.isCurrent?"▶":l.isLoaded?"●":"○",c=l.description||l.name,f=[` ${i} ${l.id}${c&&c!==l.id?` - ${c}`:""}`,l.provider?` [${l.provider}/${l.model}]`:"",l.clientCount?`, ${l.clientCount} client(s)`:"",l.turnCount?`, ${l.turnCount} turns`:""];o.push(f.join("")),l.workspacePath&&o.push(` ${l.workspacePath}`)}return o.push(""," ▶ current ● loaded ○ on disk"),o.join(`
|
|
12
|
+
`)}const hp=["session attach","session delete","resume"];function X_(s,o){const l=s.replace(/^\s+/,""),i=l.toLowerCase();for(const c of hp){if(!i.startsWith(c+" "))continue;const f=l.slice(c.length+1);if(/\s/.test(f.trim()))return null;const p=f.trim().toLowerCase();return o.filter(h=>h.id.toLowerCase().startsWith(p)).map(h=>({insert:`${c} ${h.id}`,label:h.id,description:[h.isCurrent?"current":h.isLoaded?"loaded":"on disk",h.description||h.name,h.provider?`${h.provider}/${h.model}`:"",h.workspacePath].filter(Boolean).join(" · ")}))}return null}function K_(s){const o=s.replace(/^\s+/,"").toLowerCase();return hp.some(l=>o.startsWith(l+" "))}function I_(s,o){return o?s.filter(l=>l.workspacePath?o.path&&l.workspacePath.replace(/\/+$/,"")===o.path.replace(/\/+$/,"")?!0:l.workspacePath.replace(/\/+$/,"").split("/").pop()===o.name:!1):[]}function gp(s){return typeof s.text=="string"?s.text:""}function $_(s){const o=s.result??s.response;if(o==null)return"";if(typeof o=="string")return o;try{return JSON.stringify(o,null,2)}catch{return String(o)}}function Z_(s,o,l,i){const c=[],f=new Map,p=Array.isArray(s)?s:[];for(const h of p){const y=String(h.role??"");let _="";for(const b of h.parts??[]){const S=String(b.type??"");if(S==="text")_+=gp(b);else if(S==="function_call"){_.trim()&&(c.push(y==="user"?{id:l(),kind:"user",agentId:o,text:_}:{id:l(),kind:"text",agentId:o,source:"model",text:_}),_="");const N=String(b.id??b.call_id??l()),R={id:l(),kind:"tool",agentId:o,callId:N,toolName:String(b.name??"tool"),args:b.args??{},status:"success",startedAt:0,output:"",media:[],expanded:i};f.set(N,R),c.push(R)}else if(S==="function_response"){const N=String(b.call_id??b.id??""),R=f.get(N)??[...f.values()].reverse().find(B=>B.toolName===String(b.name??"")&&!B.output);R&&(R.output=$_(b),b.is_error===!0&&(R.status="error"),f.delete(R.callId))}}_.trim()&&c.push(y==="user"?{id:l(),kind:"user",agentId:o,text:_}:{id:l(),kind:"text",agentId:o,source:"model",text:_})}return c}function J_(s,o){const l=Array.isArray(s)?s:[];if(l.length===0)return"No conversation history.";const i=Array.isArray(o)?o:[],c=[`Conversation History (${l.length} messages, ${i.length} turns):`,""];let f=0;return l.forEach((p,h)=>{const y=String(p.role??"unknown");c.push(y==="user"?"[User]":y==="model"?"[Model]":`[${y}]`);for(const S of p.parts??[]){const N=String(S.type??"");if(N==="text"){const R=gp(S);c.push(` ${R.length>500?R.slice(0,500)+"...":R}`)}else N==="function_call"?c.push(` [Function Call: ${String(S.name??"unknown")}]`):N==="function_response"&&c.push(` [Function Response: ${String(S.name??"unknown")}]`)}const _=h===l.length-1,b=!_&&String(l[h+1]?.role)==="user";if(y==="model"&&(_||b)){const S=i[f];if(S){const N=Number(S.prompt??0),R=Number(S.output??0),B=Number(S.total??N+R);c.push(` --- Turn ${f+1}: ${B.toLocaleString()} tokens (in: ${N.toLocaleString()}, out: ${R.toLocaleString()}) ---`)}f+=1}}),c.join(`
|
|
13
|
+
`)}const au=300,lu=220,su=720,_p="jaato.railWidth";function yp(s){return Number.isFinite(s)?Math.min(su,Math.max(lu,Math.round(s))):au}function W_(){try{const s=localStorage.getItem(_p);return s==null?au:yp(Number(s))}catch{return au}}function F_(s){try{localStorage.setItem(_p,String(s))}catch{}}const Vt="main";let P_=0;const We=()=>`b${++P_}`,qm=()=>({sessionId:null,session:{},initProgress:null,agents:{[Vt]:{id:Vt,name:"main",type:"main",status:"idle"}},agentOrder:[Vt],selectedAgentId:Vt,blocks:{[Vt]:[]},toolOwner:{},permissions:[],clarifications:[],referenceSelections:[],postAuth:null,plan:{},context:{},workspaceFiles:{},workspaceHidden:[],workspaceShowHidden:!1,workspaceIgnored:{},workspaceNotice:null,permissionStatus:null,processing:{},exitChoice:null});function Qe(s){const o=s.agent_id;return typeof o=="string"&&o?o:Vt}function Qt(s,o){s.agents[o]||(s.agents={...s.agents,[o]:{id:o,name:o,type:"subagent",status:"idle"}},s.agentOrder=[...s.agentOrder,o]),s.blocks[o]||(s.blocks={...s.blocks,[o]:[]})}function it(s,o,l){s.blocks={...s.blocks,[o]:l}}function bp(s,o,l){if(!o)return null;const i=s.toolOwner[o]??l,c=s.blocks[i]??[];for(let f=c.length-1;f>=0;f--){const p=c[f];if(p&&p.kind==="tool"&&p.callId===o)return{agentId:i,index:f}}return null}function Hm(s,o,l,i){const c=bp(s,o,l);if(!c)return!1;const f=[...s.blocks[c.agentId]??[]];return f[c.index]=i(f[c.index]),it(s,c.agentId,f),!0}function Bm(s,o,l){const i=String(o.request_id??"");if(!i)return;const c=s.permissions.find(y=>y.requestId===i),f=Array.isArray(o.response_options)&&o.response_options.length?o.response_options:c?.options??[],p={requestId:i,agentId:Qe(o),toolName:String(o.tool_name??c?.toolName??""),callId:o.call_id??c?.callId??null,toolArgs:o.tool_args??c?.toolArgs??{},options:f,promptLines:o.prompt_lines??c?.promptLines??[],formatHint:o.format_hint??c?.formatHint??null,warnings:o.warnings??c?.warnings??null,warningLevel:o.warning_level??c?.warningLevel??null,editableMetadata:o.editable_metadata??c?.editableMetadata??null,focus:c?.focus??0,inputMode:l||(c?.inputMode??!1)};s.permissions=c?s.permissions.map(y=>y.requestId===i?p:y):[...s.permissions,p];const h=s.agents[p.agentId];h&&(s.agents={...s.agents,[p.agentId]:{...h,status:"awaiting_permission"}})}function ey(s,o){const l=o;switch(l.type){case q.CONNECTED:{const i=l.server_info??{};s.connection={...s.connection,phase:"connected",serverVersion:i.server_version??s.connection.serverVersion??null,protocolVersion:l.protocol_version??s.connection.protocolVersion??null};break}case q.AGENT_CREATED:{const i=Qe(l),c={id:i,name:String(l.agent_name??i),type:String(l.agent_type??(i===Vt?"main":"subagent")),parentId:l.parent_agent_id??null,profile:l.profile_name??null,status:s.agents[i]?.status??"idle"};s.agents={...s.agents,[i]:c},s.agentOrder.includes(i)||(s.agentOrder=[...s.agentOrder,i]),s.blocks[i]||(s.blocks={...s.blocks,[i]:[]});break}case q.AGENT_OUTPUT:{const i=Qe(l);Qt(s,i);const c=String(l.text??""),f=String(l.source??"model"),p=[...s.blocks[i]??[]],h=p[p.length-1];if(f==="user"||f==="parent"){if(l.mode==="append"&&h&&h.kind==="user"&&h.echoed)p[p.length-1]={...h,text:h.text+c};else{let y=p.length-1;for(;y>=0&&p[y].kind!=="user";)y-=1;const _=y>=0?p[y]:void 0;_&&!_.echoed&&_.text===c?p[y]={..._,echoed:!0}:p.push({id:We(),kind:"user",agentId:i,text:c,echoed:!0})}it(s,i,p);break}l.mode==="append"&&h&&h.kind==="text"&&h.source===f?p[p.length-1]={...h,text:h.text+c}:p.push({id:We(),kind:"text",agentId:i,source:f,text:c}),it(s,i,p);break}case q.AGENT_STATUS_CHANGED:{const i=Qe(l);Qt(s,i);const c=s.agents[i],f=String(l.status??c.status);s.agents={...s.agents,[i]:{...c,status:f,error:l.error??null}},s.processing={...s.processing,[i]:f==="processing"||f==="running"};break}case q.AGENT_COMPLETED:case q.AGENT_ERROR:{const i=Qe(l);Qt(s,i);const c=s.agents[i],f=l.type===q.AGENT_ERROR;if(s.agents={...s.agents,[i]:{...c,status:f?"error":"finished",error:f?String(l.error??""):null}},s.processing={...s.processing,[i]:!1},f){const p=[...s.blocks[i]??[]];p.push({id:We(),kind:"system",agentId:i,text:String(l.error??"agent error"),style:"error"}),it(s,i,p)}break}case q.TOOL_CALL_START:{const i=Qe(l);Qt(s,i);const c=String(l.call_id??We()),f={id:We(),kind:"tool",agentId:i,callId:c,toolName:String(l.tool_name??"tool"),args:l.tool_args??{},status:"running",startedAt:Date.now(),output:"",media:[],expanded:s.ui.showTools};it(s,i,[...s.blocks[i]??[],f]),s.toolOwner={...s.toolOwner,[c]:i};break}case q.TOOL_CALL_END:{const i=Qe(l),c=l.success!==!1&&l.is_error_result!==!0;if(!Hm(s,l.call_id,i,p=>({...p,status:c?"success":"error",durationSeconds:l.duration_seconds??null,errorMessage:l.error_message??null,resultStatus:l.result_status??null,isErrorResult:l.is_error_result===!0,backgrounded:l.backgrounded===!0,continuationId:l.continuation_id??null,showOutput:l.show_output===!0,showPopup:l.show_popup===!0,expanded:p.expanded||l.show_output===!0||!c}))){Qt(s,i);const p=String(l.call_id??We());it(s,i,[...s.blocks[i]??[],{id:We(),kind:"tool",agentId:i,callId:p,toolName:String(l.tool_name??"tool"),args:{},status:c?"success":"error",startedAt:Date.now(),output:"",media:[],expanded:!c,errorMessage:l.error_message??null}])}s.ui.popupCallId&&s.ui.popupCallId===l.call_id&&!l.continuation_id&&(s.ui={...s.ui,popupCallId:null});break}case q.TOOL_OUTPUT:{const i=Qe(l),c=l.call_id,f=l.mime_type,p=l.data_b64,h=String(l.chunk??""),y=f&&p?{mimeType:f,dataB64:p,streamId:l.stream_id,sequence:l.sequence,final:l.final===!0}:null;if(c==="model-output"){Qt(s,i);const b=[...s.blocks[i]??[]],S=b[b.length-1],N=l.final===!0?"success":"running";S&&S.kind==="tool"&&S.callId==="model-output"&&S.status==="running"?b[b.length-1]={...S,output:h?S.output+h:S.output,media:y?[...S.media,y]:S.media,status:N}:(y||h)&&b.push({id:We(),kind:"tool",agentId:i,callId:"model-output",toolName:"model output",args:{},status:N,startedAt:Date.now(),output:h,media:y?[y]:[],expanded:!0}),it(s,i,b);break}if(Hm(s,c,i,b=>({...b,output:h?b.output+h:b.output,media:y?[...b.media,y]:b.media}))&&h&&s.ui.popupCallId==null){const b=bp(s,c,i),S=b?s.blocks[b.agentId]?.[b.index]:void 0;S&&S.status==="running"&&(s.ui={...s.ui,popupCallId:S.callId})}break}case q.PERMISSION_REQUESTED:Bm(s,l,!1);break;case q.PERMISSION_INPUT_MODE:Bm(s,l,!0);break;case q.PERMISSION_RESOLVED:{const i=String(l.request_id??"");s.permissions=s.permissions.filter(p=>p.requestId!==i);const c=Qe(l),f=s.agents[c];f&&f.status==="awaiting_permission"&&(s.agents={...s.agents,[c]:{...f,status:"processing"}});break}case q.PERMISSION_STATUS:s.permissionStatus={effectiveDefault:String(l.effective_default??"ask"),suspensionScope:l.suspension_scope??null};break;case q.SESSION_LIST:{const i=Lm(l.sessions);if(s.sessions=i,s.sessionListSilent>0){s.sessionListSilent-=1;break}const c=s.selectedAgentId;it(s,c,[...s.blocks[c]??[],{id:We(),kind:"system",agentId:c,text:V_(i),style:"help"}]);break}case q.HISTORY:{const i=String(l.agent_id??s.selectedAgentId);Qt(s,i),s.historyMode==="replay"?(s.historyMode="listing",it(s,i,[...s.blocks[i]??[],...Z_(l.history,i,We,s.ui.showTools)])):it(s,i,[...s.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:J_(l.history,l.turn_accounting),style:"help"}]);break}case q.CLARIFICATION_BATCH:{const i=String(l.request_id??"");if(!i)break;const c=s.clarifications.find(p=>p.requestId===i),f={requestId:i,agentId:Qe(l),toolName:String(l.tool_name??""),context:l.context??null,questions:(Array.isArray(l.questions)?l.questions:[]).map(Um),index:c?.index??0,answers:c?.answers??[],batchOnly:l.batch_only===!0,inputMode:c?.inputMode??l.batch_only===!0};s.clarifications=c?s.clarifications.map(p=>p.requestId===i?f:p):[...s.clarifications,f];break}case q.CLARIFICATION_QUESTION:{const i=String(l.request_id??"");if(!i)break;const c=Number(l.question_index??0),f=Um({question_text:l.question_text,question_type:l.question_type,options:l.options??[]}),p=s.clarifications.find(h=>h.requestId===i);if(p){const h=[...p.questions];h[c]={...h[c]??{},...f},s.clarifications=s.clarifications.map(y=>y.requestId===i?{...y,questions:h,index:c}:y)}else{const h=[];h[c]=f,s.clarifications=[...s.clarifications,{requestId:i,agentId:Qe(l),toolName:String(l.tool_name??""),questions:h,index:c,answers:[],batchOnly:!1,inputMode:!1}]}break}case q.CLARIFICATION_INPUT_MODE:{const i=String(l.request_id??""),c=Number(l.question_index??0);s.clarifications.find(p=>p.requestId===i)?s.clarifications=s.clarifications.map(p=>p.requestId===i?{...p,index:c,inputMode:!0}:p):s.clarifications=[...s.clarifications,{requestId:i,agentId:Qe(l),toolName:String(l.tool_name??""),questions:[],index:c,answers:[],batchOnly:!1,inputMode:!0}];break}case q.CLARIFICATION_RESOLVED:{const i=String(l.request_id??"");s.clarifications=s.clarifications.filter(c=>c.requestId!==i);break}case q.REFERENCE_SELECTION_REQUESTED:{const i=String(l.request_id??"");if(!i)break;s.referenceSelections=[...s.referenceSelections.filter(c=>c.requestId!==i),{requestId:i,agentId:Qe(l),prompt:String(l.prompt??l.message??"Select a reference"),options:l.options??[]}];break}case q.REFERENCE_SELECTION_RESOLVED:s.referenceSelections=s.referenceSelections.filter(i=>i.requestId!==String(l.request_id??""));break;case q.POST_AUTH_SETUP:{const i=(l.available_models??[]).filter(c=>c&&c.name).map(c=>({name:String(c.name),description:c.description?String(c.description):void 0}));s.postAuth={requestId:String(l.request_id??""),providerName:String(l.provider_name??""),providerDisplayName:String(l.provider_display_name??l.provider_name??""),models:i,hasActiveSession:l.has_active_session===!0,currentProvider:l.current_provider||void 0,currentModel:l.current_model||void 0,workspacePath:l.workspace_path||void 0};break}case q.PLAN_UPDATED:{const i=Qe(l);s.plan={...s.plan,[i]:{name:String(l.plan_name??"Plan"),steps:l.steps??[]}};break}case q.PLAN_STEP_UPDATED:{const i=Qe(l),c=s.plan[i]??{name:"Plan",steps:[]},f=l.step_id,p={step_id:f,sequence:l.sequence,content:l.content,status:l.status,result:l.result,error:l.error,blocked_by:l.blocked_by,depends_on:l.depends_on},h=c.steps.findIndex(_=>_.step_id===f),y=[...c.steps];h>=0?y[h]={...y[h],...p}:y.push(p),s.plan={...s.plan,[i]:{...c,steps:y}};break}case q.PLAN_CLEARED:{const i=Qe(l),{[i]:c,...f}=s.plan;s.plan=f;break}case q.CONTEXT_UPDATED:{const i=Qe(l),c=s.context[i];s.context={...s.context,[i]:{...c??{usage:{}},usage:l.usage??c?.usage??{},contextLimit:l.context_limit??c?.contextLimit??null,percentUsed:l.percent_used??c?.percentUsed??null,tokensRemaining:l.tokens_remaining??c?.tokensRemaining??null,turns:l.turns??c?.turns??null}};break}case q.TURN_COMPLETED:{const i=Qe(l),c=s.context[i]??{usage:{}};s.context={...s.context,[i]:{...c,lastTurn:{turnNumber:l.turn_number,durationSeconds:l.duration_seconds,toolCalls:G_(l.function_calls),finishReason:l.finish_reason,usage:l.usage}}},s.processing={...s.processing,[i]:!1};const f=s.agents[i];f&&f.status==="processing"&&(s.agents={...s.agents,[i]:{...f,status:"idle"}});break}case q.SYSTEM_MESSAGE:{const i=Qe(l);Qt(s,i),it(s,i,[...s.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:String(l.message??""),style:String(l.style??"info")}]);break}case q.HELP_TEXT:{const i=s.selectedAgentId,f=(l.lines??[]).map(p=>Array.isArray(p)?String(p[0]??""):String(p)).join(`
|
|
14
|
+
`)||String(l.text??"");it(s,i,[...s.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:f,style:"help"}]);break}case q.ERROR:{if(String(l.error??"").toLowerCase().includes("workspace mode not enabled")){s.workspace={...s.workspace,mode:"disabled"};break}const i=Qe(l);Qt(s,i),it(s,i,[...s.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:`${l.error_type?`[${String(l.error_type)}] `:""}${String(l.error??"error")}`,style:"error"}]);break}case q.RETRY:{const i=Qe(l);Qt(s,i),it(s,i,[...s.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:`Retrying (${String(l.attempt??"?")}/${String(l.max_attempts??"?")}): ${String(l.reason??l.error??"")}`,style:"warning"}]);break}case q.INIT_PROGRESS:s.initProgress={step:l.step,status:l.status,message:l.message,stepNumber:l.step_number,totalSteps:l.total_steps},(l.status==="complete"||l.status==="done"||l.status==="ready")&&(s.initProgress=null);break;case q.SESSION_INFO:{const i=l.session_id;i&&(s.sessionId=i),Array.isArray(l.sessions)&&(s.sessions=Lm(l.sessions)),s.session={...s.session,name:l.session_name??s.session.name??null,provider:l.model_provider??s.session.provider??null,model:l.model_name??s.session.model??null,profile:l.profile_name??s.session.profile??null,models:l.models??s.session.models};break}case q.SESSION_PROFILES:s.profiles=(l.profiles??[]).map(i=>({...i,name:String(i.name??"")}));break;case q.SESSION_TERMINATED:case q.DISCONNECTED:{const i=s.selectedAgentId;it(s,i,[...s.blocks[i]??[],{id:We(),kind:"system",agentId:i,text:l.type===q.SESSION_TERMINATED?`Session ended${l.reason?`: ${String(l.reason)}`:""}`:"Disconnected",style:"warning"}]);break}case q.COMMAND_LIST:s.commands=pp((l.commands??[]).map(i=>({name:String(i.name??""),description:i.description})));break;case q.WORKSPACE_LIST:s.workspace={...s.workspace,mode:"enabled",root:l.root,list:(l.workspaces??[]).map(i=>({...i,name:String(i.name??""),configured:i.configured===!0}))};break;case q.WORKSPACE_CREATED:{const i=l.workspace??{},c=String(i.name??l.name??"");if(!c)break;const f={...i,name:c,path:i.path??l.path??null,configured:i.configured===!0};s.workspace={...s.workspace,list:[...s.workspace.list.filter(p=>p.name!==c),f]};break}case q.WORKSPACE_DELETED:{const i=String(l.name??"");if(l.ok===!1){s.workspace={...s.workspace,notice:{text:String(l.error||`Could not delete workspace ${i}`),error:!0}};break}s.workspace={...s.workspace,list:s.workspace.list.filter(c=>c.name!==i),selected:s.workspace.selected===i?void 0:s.workspace.selected,config:s.workspace.config?.workspace===i?void 0:s.workspace.config,notice:{text:`Workspace ${i} deleted`}};break}case q.CONFIG_UPDATED:{const i=String(l.workspace??s.workspace.selected??"");if(l.success===!1){s.workspace={...s.workspace,notice:{text:String(l.error||`Could not save the configuration of ${i}`),error:!0}};break}const c=l.provider||null,f=l.model||null,p=s.workspace.config,h={workspace:i,configured:c!==null,provider:c,model:f,availableProviders:p?.availableProviders??[],missingFields:[...c?[]:["provider"],...f?[]:["model"]]};s.workspace={...s.workspace,config:h,selected:i||s.workspace.selected,list:s.workspace.list.map(y=>y.name===i?{...y,configured:h.configured,provider:c,model:f}:y)};break}case q.CONFIG_STATUS:{const i={workspace:String(l.workspace??s.workspace.selected??""),configured:l.configured===!0,provider:l.provider??null,model:l.model??null,availableProviders:l.available_providers??[],missingFields:l.missing_fields??[]};s.workspace={...s.workspace,config:i,selected:i.workspace||s.workspace.selected};break}case q.WORKSPACE_FILES_CHANGED:{const i={...s.workspaceFiles};for(const c of l.changes??[]){const f=c.path??c.file;if(!f)continue;const p=c.status??c.change??c.type??"modified";p==="deleted"?delete i[f]:i[f]=p}s.workspaceFiles=i;break}case q.WORKSPACE_FILES_SNAPSHOT:{const i={};for(const c of l.files??[])if(typeof c=="string")i[c]="modified";else if(c&&typeof c=="object"){const f=c,p=f.path??f.file,h=f.status??f.change??f.type??"modified";p&&h!=="deleted"&&(i[p]=h)}s.workspaceFiles=i;break}case q.WORKSPACE_IGNORE_RESULT:{const i=String(l.path??"");if(l.ok===!1){s.workspaceNotice={text:String(l.error||`Could not update .gitignore for ${i}`),error:!0};break}const c=l.ignored===!0;s.workspaceIgnored={...s.workspaceIgnored,[i]:c},s.workspaceNotice={text:`${i} ${c?"added to":"removed from"} .gitignore`};break}}return s}const L=E_()((s,o)=>({connection:{phase:"disconnected"},url:"",screen:"connect",credentialsUrl:null,backend:null,workspace:{mode:"unknown",list:[]},profiles:[],sessions:[],sessionListSilent:0,historyMode:"listing",commands:pp([]),uploads:[],...qm(),ui:{showPlan:!1,showBudget:!1,showWorkspace:!1,showTools:!1,theme:"light",popupCallId:null,railWidth:W_()},dispatch:l=>s(i=>{const c={...i};for(const f of l)ey(c,f);return c}),setConnection:l=>s(i=>({connection:{...i.connection,...l}})),setUrl:l=>s({url:l}),setScreen:l=>s({screen:l}),setCredentialsUrl:l=>s({credentialsUrl:l}),setBackend:l=>s({backend:l}),setWorkspaceMode:l=>s(i=>({workspace:{...i.workspace,mode:l}})),selectWorkspace:l=>s(i=>({workspace:{...i.workspace,selected:l}})),selectAgent:l=>s({selectedAgentId:l}),addUserBlock:(l,i)=>s(c=>({blocks:{...c.blocks,[l]:[...c.blocks[l]??[],{id:We(),kind:"user",agentId:l,text:i}]}})),addSystemBlock:(l,i,c="info")=>s(f=>({blocks:{...f.blocks,[l]:[...f.blocks[l]??[],{id:We(),kind:"system",agentId:l,text:i,style:c}]}})),clearOutput:l=>s(i=>({blocks:{...i.blocks,[l]:[]}})),toggleTool:(l,i)=>s(c=>({blocks:{...c.blocks,[l]:(c.blocks[l]??[]).map(f=>f.id===i&&f.kind==="tool"?{...f,expanded:!f.expanded}:f)}})),setAllToolsExpanded:(l,i)=>s(c=>({blocks:{...c.blocks,[l]:(c.blocks[l]??[]).map(f=>f.kind==="tool"?{...f,expanded:i}:f)}})),resolvePermission:l=>s(i=>({permissions:i.permissions.filter(c=>c.requestId!==l)})),openExitChoice:(l,i)=>s({exitChoice:{running:l,options:i,focus:0}}),closeExitChoice:()=>s({exitChoice:null}),focusExitChoice:l=>s(i=>i.exitChoice?{exitChoice:{...i.exitChoice,focus:l}}:{}),focusPermission:(l,i)=>s(c=>({permissions:c.permissions.map(f=>f.requestId===l?{...f,focus:i}:f)})),answerClarification:(l,i)=>{const c=o().clarifications.find(h=>h.requestId===l);if(!c)return;const f=[...c.answers];f[c.index]=i;const p={...c,answers:f,index:c.index+1,inputMode:c.batchOnly};return s(h=>({clarifications:h.clarifications.map(y=>y.requestId===l?p:y)})),p},dismissClarification:l=>s(i=>({clarifications:i.clarifications.filter(c=>c.requestId!==l)})),dismissReferenceSelection:l=>s(i=>({referenceSelections:i.referenceSelections.filter(c=>c.requestId!==l)})),dismissPostAuth:()=>s({postAuth:null}),toggleUi:l=>s(i=>({ui:{...i.ui,[l]:!i.ui[l]}})),setToolsExpanded:l=>s(i=>({ui:{...i.ui,showTools:l},blocks:Object.fromEntries(Object.entries(i.blocks).map(([c,f])=>[c,f.map(p=>p.kind==="tool"?{...p,expanded:l}:p)]))})),setSessionListSilent:l=>s(i=>({sessionListSilent:Math.max(0,i.sessionListSilent+l)})),setHistoryMode:l=>s({historyMode:l}),toggleWorkspaceHidden:l=>s(i=>({workspaceHidden:i.workspaceHidden.includes(l)?i.workspaceHidden.filter(c=>c!==l):[...i.workspaceHidden,l]})),toggleWorkspaceShowHidden:()=>s(l=>({workspaceShowHidden:!l.workspaceShowHidden})),setWorkspaceNotice:l=>s(()=>({workspaceNotice:l})),setWorkspaceListNotice:l=>s(i=>({workspace:{...i.workspace,notice:l}})),setTheme:l=>s(i=>({ui:{...i.ui,theme:l}})),setPopup:l=>s(i=>({ui:{...i.ui,popupCallId:l}})),setRailWidth:l=>s(i=>{const c=yp(l);return F_(c),{ui:{...i.ui,railWidth:c}}}),addUploads:l=>s(i=>({uploads:[...i.uploads,...l]})),updateUpload:(l,i)=>s(c=>({uploads:c.uploads.map(f=>f.id===l?{...f,...i}:f)})),removeUpload:l=>s(i=>({uploads:i.uploads.filter(c=>c.id!==l)})),takeUploads:()=>{const l=o().uploads.filter(i=>i.status==="staged").map(i=>i.path);return s(i=>({uploads:i.uploads.filter(c=>c.status==="queued"||c.status==="staging")})),l},resetSessionState:()=>s(()=>({...qm()}))})),ty=s=>o=>o.blocks[s]??ny,ny=[],ay="dark",ly="Default dark theme",sy="1.0",iy={primary:"#5fd7ff",secondary:"#87d787",accent:"#d7af87",success:"#5fd75f",warning:"#ffff5f",error:"#ff5f5f",muted:"#808080",background:"#1a1a1a",surface:"#333333",text:"#ffffff",text_muted:"#aaaaaa"},ry={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#404040"},agent_tab_hint:{fg:"#606060",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#5f87ff"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#404040"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#555555",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#5f87ff",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#af87ff",bg:"surface"},plan_dependency:{fg:"#af87ff",dim:!0},plan_received_output:{fg:"#5fafaf",dim:!0},user_header:{fg:"success",bold:!0},user_header_separator:{fg:"success",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"primary",dim:!0},thinking_header_separator:{dim:!0},thinking_border:{fg:"primary",dim:!0},thinking_content:{dim:!0,italic:!0},thinking_footer:{fg:"primary",dim:!0},thinking_footer_separator:{dim:!0},tool_output:{fg:"#87D7D7",italic:!0},tool_source_label:{fg:"#808080",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#5fafaf"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"success",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#87d7d7",bg:"#2d2d3d"},markdown_link:{fg:"#5f87ff",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#808080"},pane_separator_focused:{fg:"#5f87ff",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"success",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#5f87ff"},budget_gc_ephemeral:{dim:!0}},oy={name:ay,description:ly,version:sy,colors:iy,semantic:ry},uy="light",cy="Light theme for bright terminals",fy="1.0",dy={primary:"#0077cc",secondary:"#006600",accent:"#996600",success:"#006600",warning:"#996600",error:"#cc0000",muted:"#666666",background:"#f5f5f5",surface:"#ffffff",text:"#000000",text_muted:"#666666"},my={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#aaaaaa"},agent_tab_hint:{fg:"#888888",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#0055cc"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#aaaaaa"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#bbbbbb",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#0055cc",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"#666666",italic:!0},plan_popup_empty_border:{fg:"#888888"},plan_popup_scroll_indicator:{fg:"#666666",italic:!0},plan_popup_hint:{fg:"#666666"},plan_popup_step_number:{fg:"#555555"},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"#555555"},plan_popup_error_prefix:{fg:"#555555"},plan_popup_separator:{fg:"#888888"},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"#555555"},plan_blocked:{fg:"#7744aa",bg:"surface"},plan_dependency:{fg:"#7744aa"},plan_received_output:{fg:"#227788"},user_header:{fg:"success",bold:!0},user_header_separator:{fg:"success",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#555555"},thinking_header_separator:{fg:"#888888"},thinking_border:{fg:"#888888"},thinking_content:{fg:"#555555",italic:!0},thinking_footer:{fg:"#555555"},thinking_footer_separator:{fg:"#888888"},tool_output:{fg:"#006688",italic:!0},tool_source_label:{fg:"#555555",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"#0055cc",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#006688"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"#666666"},tool_output_popup_hint:{fg:"#666666",italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"success",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#0055aa",bg:"#e8e8f0"},markdown_link:{fg:"#0055aa",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#aaaaaa"},pane_separator_focused:{fg:"#0055cc",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"success",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#0055cc"},budget_gc_ephemeral:{fg:"#888888"}},py={name:uy,description:cy,version:fy,colors:dy,semantic:my},hy="high-contrast",gy="High contrast theme for accessibility",_y="1.0",yy={primary:"#00ffff",secondary:"#00ff00",accent:"#ffaa00",success:"#00ff00",warning:"#ffff00",error:"#ff0000",muted:"#aaaaaa",background:"#000000",surface:"#1a1a1a",text:"#ffffff",text_muted:"#cccccc"},by={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#404040"},agent_tab_hint:{fg:"#606060",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#5f87ff"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#404040"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#555555",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#5f87ff",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"#aaaaaa",italic:!0},plan_popup_empty_border:{fg:"#aaaaaa"},plan_popup_scroll_indicator:{fg:"#cccccc",italic:!0},plan_popup_hint:{fg:"#cccccc"},plan_popup_step_number:{fg:"#aaaaaa"},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"#aaaaaa"},plan_popup_error_prefix:{fg:"#aaaaaa"},plan_popup_separator:{fg:"#aaaaaa"},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"#cccccc"},plan_blocked:{fg:"#cc88ff",bg:"surface"},plan_dependency:{fg:"#cc88ff"},plan_received_output:{fg:"#66dddd"},user_header:{fg:"success",bold:!0},user_header_separator:{fg:"success",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#cccccc"},thinking_header_separator:{fg:"#aaaaaa"},thinking_border:{fg:"#cccccc"},thinking_content:{fg:"#cccccc",italic:!0},thinking_footer:{fg:"#cccccc"},thinking_footer_separator:{fg:"#aaaaaa"},tool_output:{fg:"#87D7D7",italic:!0},tool_source_label:{fg:"#808080",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#66dddd"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"#cccccc"},tool_output_popup_hint:{fg:"#cccccc",italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"success",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#00ffff",bg:"#1a1a2e"},markdown_link:{fg:"#66ccff",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"#aaaaaa"},pane_separator:{fg:"#aaaaaa"},pane_separator_focused:{fg:"#00ffff",bold:!0},hint:{fg:"#cccccc",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"success",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#5f87ff"},budget_gc_ephemeral:{fg:"#aaaaaa"}},xy={name:hy,description:gy,version:_y,colors:yy,semantic:by},vy="dracula",Sy="Dracula-inspired theme with pink accents and purple-tinted dark background",Ey="1.0",Ty={primary:"#ff79c6",secondary:"#50fa7b",accent:"#ffb86c",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",muted:"#6272a4",background:"#282a36",surface:"#44475a",text:"#f8f8f2",text_muted:"#6272a4"},Ny={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#44475a"},agent_tab_hint:{fg:"#6272a4",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#bd93f9"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#44475a"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#6272a4",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#bd93f9",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#bd93f9",bg:"surface"},plan_dependency:{fg:"#bd93f9",dim:!0},plan_received_output:{fg:"#8be9fd",dim:!0},user_header:{fg:"secondary",bold:!0},user_header_separator:{fg:"secondary",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#bd93f9",dim:!0},thinking_header_separator:{fg:"#bd93f9",dim:!0},thinking_border:{fg:"#bd93f9",dim:!0},thinking_content:{fg:"#6272a4",dim:!0,italic:!0},thinking_footer:{fg:"#bd93f9",dim:!0},thinking_footer_separator:{fg:"#bd93f9",dim:!0},tool_output:{fg:"#8be9fd",italic:!0},tool_source_label:{fg:"#6272a4",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#8be9fd"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"secondary",bold:!0},notebook_output_label:{fg:"#8be9fd",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#8be9fd",bg:"#383a59"},markdown_link:{fg:"#bd93f9",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#6272a4"},pane_separator_focused:{fg:"#8be9fd",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"#bd93f9",fg:"text"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#bd93f9"},budget_gc_ephemeral:{fg:"#6272a4"}},wy={name:vy,description:Sy,version:Ey,colors:Ty,semantic:Ny},ky="latte",Ay="Light cream theme with orange accents",jy="1.0",Oy={primary:"#e07040",secondary:"#40a040",accent:"#d08030",success:"#40a040",warning:"#c09020",error:"#c04040",muted:"#908070",background:"#f8f4f0",surface:"#ffffff",text:"#3d3530",text_muted:"#807060"},Cy={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#d0c8c0"},agent_tab_hint:{fg:"#a09080",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#4080c0"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#d0c8c0"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#c0b8b0",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#4080c0",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#8839ef",bg:"surface"},plan_dependency:{fg:"#8839ef"},plan_received_output:{fg:"#179299"},user_header:{fg:"secondary",bold:!0},user_header_separator:{fg:"secondary",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"#a08060",dim:!0},thinking_header_separator:{fg:"#a08060",dim:!0},thinking_border:{fg:"#a08060",dim:!0},thinking_content:{fg:"#807060",dim:!0,italic:!0},thinking_footer:{fg:"#a08060",dim:!0},thinking_footer_separator:{fg:"#a08060",dim:!0},tool_output:{fg:"#408080",italic:!0},tool_source_label:{fg:"#908070",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#179299"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"secondary",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#1e66f5",bg:"#f0ece8"},markdown_link:{fg:"#1e66f5",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#aaaaaa"},pane_separator_focused:{fg:"#0055cc",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"primary",fg:"#ffffff"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#4080c0"},budget_gc_ephemeral:{fg:"#a09080"}},Ry={name:ky,description:Ay,version:jy,colors:Oy,semantic:Cy},My="mocha",Dy="Warm brownish theme with teal accents",zy="1.0",Uy={primary:"#5fd7d7",secondary:"#87d787",accent:"#d7875f",success:"#87d787",warning:"#d7d75f",error:"#d75f5f",muted:"#8a7a6a",background:"#3d2b2b",surface:"#4a3838",text:"#e8e0d8",text_muted:"#a89888"},Ly={agent_tab_selected:{fg:"primary",bold:!0,underline:!0},agent_tab_dim:{fg:"muted"},agent_tab_separator:{fg:"#5a4a4a"},agent_tab_hint:{fg:"#7a6a5a",italic:!0},agent_tab_scroll:{fg:"primary",bold:!0},agent_processing:{fg:"#87afff"},agent_awaiting:{fg:"primary"},agent_finished:{fg:"muted"},agent_error:{fg:"error"},agent_permission:{fg:"warning"},agent_popup_border:{fg:"primary"},agent_popup_icon:{fg:"primary"},agent_popup_name:{fg:"text",bold:!0},session_bar_bg:{bg:"background"},session_bar_label:{fg:"muted"},session_bar_id:{fg:"primary"},session_bar_separator:{fg:"#5a4a4a"},session_bar_description:{fg:"secondary"},session_bar_workspace:{fg:"accent"},status_bar_bg:{bg:"surface"},status_bar_label:{fg:"muted",bg:"surface"},status_bar_value:{fg:"text",bg:"surface",bold:!0},status_bar_separator:{fg:"#6a5a5a",bg:"surface"},status_bar_warning:{fg:"warning"},output_panel_bg:{bg:"background"},plan_pending:{fg:"muted",bg:"surface"},plan_in_progress:{fg:"#87afff",bg:"surface"},plan_completed:{fg:"success",bg:"surface"},plan_failed:{fg:"error",bg:"surface"},plan_skipped:{fg:"warning",bg:"surface"},plan_active:{fg:"primary",bg:"surface"},plan_cancelled:{fg:"warning",bg:"surface",dim:!0},plan_popup_border:{fg:"primary"},plan_popup_background:{bg:"background"},plan_result:{fg:"success",dim:!0},plan_error_text:{fg:"error",dim:!0},plan_popup_empty:{fg:"muted",dim:!0,italic:!0},plan_popup_empty_border:{fg:"muted",dim:!0},plan_popup_scroll_indicator:{fg:"muted",dim:!0,italic:!0},plan_popup_hint:{fg:"muted",dim:!0},plan_popup_step_number:{fg:"muted",dim:!0},plan_popup_step_description:{fg:"text"},plan_popup_step_active:{fg:"text",bold:!0},plan_popup_result_prefix:{fg:"muted",dim:!0},plan_popup_error_prefix:{fg:"muted",dim:!0},plan_popup_separator:{fg:"muted",dim:!0},plan_popup_progress:{fg:"text",bold:!0},plan_popup_progress_detail:{fg:"muted",dim:!0},plan_blocked:{fg:"#cba6f7",bg:"surface"},plan_dependency:{fg:"#cba6f7",dim:!0},plan_received_output:{fg:"#94e2d5",dim:!0},user_header:{fg:"secondary",bold:!0},user_header_separator:{fg:"secondary",dim:!0},model_header:{fg:"primary",bold:!0},model_header_separator:{fg:"primary",dim:!0},thinking_header:{fg:"accent",dim:!0},thinking_header_separator:{fg:"accent",dim:!0},thinking_border:{fg:"accent",dim:!0},thinking_content:{fg:"#a89888",dim:!0,italic:!0},thinking_footer:{fg:"accent",dim:!0},thinking_footer_separator:{fg:"accent",dim:!0},tool_output:{fg:"#87d7d7",italic:!0},tool_source_label:{fg:"#8a7a6a",dim:!0},tool_name:{fg:"primary"},tool_border:{dim:!0},tool_success:{fg:"success"},tool_error:{fg:"error",dim:!0},tool_pending:{fg:"warning",bold:!0},tool_duration:{dim:!0},tool_selected:{fg:"text"},tool_unselected:{dim:!0},tool_indicator:{fg:"primary",dim:!0},workspace_popup_border:{fg:"primary"},workspace_popup_background:{bg:"background"},tool_output_popup_border:{fg:"#94e2d5"},tool_output_popup_background:{fg:"text",bg:"background"},tool_output_popup_header:{fg:"text",bold:!0},tool_output_popup_scroll:{fg:"muted",dim:!0},tool_output_popup_hint:{fg:"muted",dim:!0,italic:!0},file_output_header:{fg:"primary",bold:!0},notebook_input_label:{fg:"secondary",bold:!0},notebook_output_label:{fg:"primary",bold:!0},notebook_error_label:{fg:"error",bold:!0},inline_code:{fg:"#94e2d5",bg:"#453838"},markdown_link:{fg:"#89b4fa",underline:!0},line:{fg:"text"},permission_prompt:{fg:"warning",bold:!0},permission_text:{fg:"primary"},permission_denied:{fg:"error",dim:!0},clarification_label:{fg:"primary"},clarification_icon:{fg:"primary"},clarification_required:{fg:"warning"},clarification_answer:{fg:"success",dim:!0},clarification_question:{dim:!0},clarification_resolved:{fg:"success",bold:!0},security_error_header:{fg:"error",bold:!0},security_error_text:{fg:"error"},security_warning_header:{fg:"warning",bold:!0},security_warning_text:{fg:"warning"},security_info_header:{fg:"primary",bold:!0},security_info_text:{fg:"primary"},system_info:{dim:!0},system_highlight:{fg:"primary"},system_error:{fg:"error"},system_error_bold:{fg:"error",bold:!0},system_warning:{fg:"warning"},system_success:{fg:"success"},system_emphasis:{bold:!0},system_version:{fg:"primary",bold:!0},system_progress:{dim:!0,italic:!0},system_init_error:{fg:"error",dim:!0},pager_nav:{fg:"primary",bold:!0},spinner:{fg:"primary"},separator:{fg:"muted",dim:!0},pane_separator:{fg:"#808080"},pane_separator_focused:{fg:"#5f87ff",bold:!0},hint:{fg:"muted",italic:!0},scroll_indicator:{fg:"muted",dim:!0,italic:!0},scroll_arrow:{fg:"primary",dim:!0},muted:{dim:!0},emphasis:{bold:!0},warning_icon:{fg:"warning"},panel_border:{fg:"primary"},tree_connector:{dim:!0},truncation:{fg:"primary",dim:!0,italic:!0},debug_line_number:{fg:"muted",dim:!0},completion_bg:{bg:"surface",fg:"text"},completion_selected:{bg:"primary",fg:"#3d2b2b"},completion_meta:{bg:"surface",fg:"muted"},pending_prompt:{fg:"primary"},pending_prompt_overflow:{fg:"muted",italic:!0},input_text:{fg:"text"},input_prompt:{fg:"primary",bold:!0},search_prompt:{fg:"warning",bold:!0},search_match:{bg:"warning",fg:"background",bold:!0},search_match_current:{bg:"primary",fg:"background",bold:!0},budget_panel_border:{fg:"primary"},budget_popup_background:{bg:"background"},budget_header:{bold:!0},budget_gc_locked:{fg:"error"},budget_gc_preservable:{fg:"warning"},budget_gc_partial:{fg:"#87afff"},budget_gc_ephemeral:{fg:"#8a7a6a"}},qy={name:My,description:Dy,version:zy,colors:Uy,semantic:Ly},Hy=[oy,py,xy,wy,Ry,qy],la=Object.fromEntries(Hy.map(s=>[s.name,s])),Gm=Object.keys(la),Ym={light:"#5980a6",dark:"#94bce3"},By={light:{background:"#f2f2f3",surface:"#ffffff",text:"#1d1f20",text_muted:"#5d5d60",muted:"#7a7a7d"},dark:{surface:"#202223"}};function Gy(s){const o=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(s);if(!o)return 0;const[l,i,c]=[o[1],o[2],o[3]].map(f=>parseInt(f,16)/255);return .2126*l+.7152*i+.0722*c}function xp(s){const o=la[s];return o?Gy(o.colors.background)<.5:!0}function Yy(s){const o=la[s]??la.light;return{...{...o.colors,...By[o.name]??{}},steel:xp(o.name)?Ym.dark:Ym.light}}function vp(s){const o=la[s]??la.light,l=document.documentElement,i=Yy(o.name),c={"--c-primary":i.primary,"--c-secondary":i.secondary,"--c-accent":i.accent??i.secondary,"--c-success":i.success,"--c-warning":i.warning,"--c-error":i.error,"--c-muted":i.muted,"--c-bg":i.background,"--c-surface":i.surface,"--c-text":i.text,"--c-text-muted":i.text_muted,"--c-steel":i.steel};for(const[f,p]of Object.entries(c))l.style.setProperty(f,p);l.dataset.theme=o.name,l.style.colorScheme=xp(o.name)?"dark":"light"}const Sp="jaato.theme",Qy="light";function Vy(){try{const s=localStorage.getItem(Sp);if(s&&la[s])return s}catch{}return Qy}function Xy(s){try{localStorage.setItem(Sp,s)}catch{}}let sa=null,_i=[],iu=!1;function Qm(){if(iu=!1,!_i.length)return;const s=_i;_i=[],L.getState().dispatch(s)}function Ky(s){_i.push(s),!iu&&(iu=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(Qm):setTimeout(Qm,16))}function Iy(s){const o={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected",RECONNECTING:"reconnecting",CLOSED:"closed"},l=String(s.state),i=o[l]??o[l.toUpperCase()]??"disconnected";L.getState().setConnection({phase:i,detail:s.reason,attempt:s.attempt,serverVersion:s.serverVersion??void 0})}function $y(){return{client_type:"web",content_width:typeof window<"u"?Math.max(40,Math.floor(window.innerWidth*.7/8)):120,content_height:null,supports_markdown:!0,supports_tables:!0,supports_code_blocks:!0,supports_images:!0,supports_rich_text:!0,supports_unicode:!0,supports_mermaid:!1,supports_expandable_content:!0,renderable_media:["image/*","audio/*"]}}async function Zy(s){await fu();const o=L.getState();o.setUrl(s.url),o.setConnection({phase:"connecting",detail:void 0});const l=new fp({url:s.url,token:s.token,clientConfig:{presentation:$y()}});l.onStatus(Iy),l.subscribeAll(i=>Ky(i)),sa=l;try{await l.connect()}catch(i){throw sa=null,L.getState().setConnection({phase:"disconnected",detail:i instanceof Error?i.message:String(i)}),i}return l}async function fu(){const s=sa;sa=null,s&&await s.close().catch(()=>{})}function De(){if(!sa)throw new Error("Not connected");return sa}function Zl(){return sa!==null}async function Ep(){await De().sendRawEvent({type:q.WORKSPACE_LIST_REQUEST})}async function Vm(s){await De().sendRawEvent({type:q.WORKSPACE_SELECT_REQUEST,name:s})}async function Jy(s){await De().sendRawEvent({type:q.WORKSPACE_CREATE_REQUEST,name:s})}async function Wy(s){await De().sendRawEvent({type:q.WORKSPACE_DELETE_REQUEST,name:s})}async function Fy(s){await De().sendRawEvent({type:q.CONFIG_UPDATE_REQUEST,...s})}function Py(s=4e3){const o=De();return new Promise(l=>{let i=!1;const c=y=>{i||(i=!0,f(),p(),clearTimeout(h),L.getState().setWorkspaceMode(y),l(y))},f=o.subscribe(q.WORKSPACE_LIST,()=>c("enabled")),p=o.subscribe(q.ERROR,y=>{String(y.error??"").toLowerCase().includes("workspace mode")&&c("disabled")}),h=setTimeout(()=>c("unknown"),s);Ep().catch(()=>c("unknown"))})}const ru="jaato.exited";function Tp(s=Np()){try{s?.setItem(ru,"1")}catch{}}function eb(s=Np()){try{return!s||s.getItem(ru)!=="1"?!1:(s.removeItem(ru),!0)}catch{return!1}}function Np(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}function tb(s){if(!s||typeof s!="object")return{};const o=s,l={};return typeof o.daemon=="string"&&o.daemon&&(l.daemon=o.daemon),typeof o.token=="string"&&o.token&&(l.token=o.token),typeof o.ticketUrl=="string"&&o.ticketUrl&&(l.ticketUrl=o.ticketUrl),typeof o.loginUrl=="string"&&o.loginUrl&&(l.loginUrl=o.loginUrl),typeof o.sessionUrl=="string"&&o.sessionUrl&&(l.sessionUrl=o.sessionUrl),typeof o.logoutUrl=="string"&&o.logoutUrl&&(l.logoutUrl=o.logoutUrl),typeof o.credentialsUrl=="string"&&o.credentialsUrl&&(l.credentialsUrl=o.credentialsUrl),typeof o.autoConnect=="boolean"&&(l.autoConnect=o.autoConnect),l}async function nb(s=fetch){try{const o=await s("./config.json",{cache:"no-store"});return o.ok?(o.headers.get("content-type")??"").includes("application/json")?tb(await o.json()):{}:{}}catch{return{}}}class du extends Error{constructor(o){super("Sign in required"),this.loginUrl=o,this.name="SignInRequiredError"}loginUrl}function ab(s){const o=s.fetchImpl??fetch;return async()=>{const l=await o(s.ticketUrl,{method:"POST",credentials:"same-origin",cache:"no-store",headers:{Accept:"application/json"}});if(l.status===401)throw new du(s.loginUrl);if(l.status===503)throw new Error("The sign-in backend cannot issue a ticket right now (daemon at capacity or unreachable); retrying.");if(!l.ok)throw new Error(`Ticket request failed: HTTP ${l.status}`);const i=await l.json();if(typeof i.ticket!="string"||!i.ticket)throw new Error("Ticket response carried no ticket");return i.ticket}}function Xm(s,o){const[l]=s.split(/[?#]/,1),i=(l??"").lastIndexOf("/");return i<0?o:`${(l??"").slice(0,i+1)}${o}`}async function lb(s,o=fetch){try{const l=await o(s,{credentials:"same-origin",cache:"no-store",headers:{Accept:"application/json"}});if(!l.ok||!(l.headers.get("content-type")??"").includes("application/json"))return null;const i=await l.json();return typeof i.user=="string"&&i.user?{user:i.user}:null}catch{return null}}var Km={ui:"0.1.9",sdk:"0.7.3",protocolMin:"1.0",commit:"afd067a",builtAt:"2026-09-17T07:53:38.365Z"};const sb={ui:"unknown",sdk:"unknown",protocolMin:"unknown",commit:"unknown",builtAt:""},Ka=typeof Km<"u"?Km:sb;function wp(s=Ka){return`jaato-web-coder-ui ${s.ui} · @jaato/sdk ${s.sdk} · protocol ≥ ${s.protocolMin} · ${s.commit}`}const ib={hairline:"",steel:"plate-steel",warning:"plate-warning",error:"plate-error"};function Nt({as:s,edge:o="hairline",ground:l=!1,corners:i="all",className:c="",children:f,...p}){const h=s??"div";return d.jsxs(h,{className:`plate ${ib[o]} ${l?"plate-ground":""} ${c}`,...p,children:[i!=="none"&&d.jsx("i",{className:"corner tl","aria-hidden":"true"}),i==="all"&&d.jsx("i",{className:"corner tr","aria-hidden":"true"}),i==="all"&&d.jsx("i",{className:"corner bl","aria-hidden":"true"}),i!=="none"&&d.jsx("i",{className:"corner br","aria-hidden":"true"}),f]})}function rb(){try{const o=localStorage.getItem("jaato.url");if(o)return o}catch{}return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws`}function ob(s){if(!s.ticketUrl)return null;const o=s.loginUrl??"./auth/login";return{provider:ab({ticketUrl:s.ticketUrl,loginUrl:o}),loginUrl:o,sessionUrl:s.sessionUrl??Xm(s.ticketUrl,"session"),logoutUrl:s.logoutUrl??Xm(s.ticketUrl,"logout")}}const Im=[["Sessions","Start from a profile, or pick up a session where you left it."],["Tools you approve","Shell, files and the web — each call asks before it runs."],["Plans and subagents","Watch the plan unfold; every subagent gets its own tab."]];function ub(){const[s,o]=Y.useState(rb),[l,i]=Y.useState(()=>{try{return sessionStorage.getItem("jaato.token")??""}catch{return""}}),[c,f]=Y.useState(!1),[p,h]=Y.useState(null),[y,_]=Y.useState(null),[b,S]=Y.useState(null),[N,R]=Y.useState(null),[B,M]=Y.useState(null),V=L(Z=>Z.connection),K=L(Z=>Z.setScreen),ee=Y.useRef(!1),ne=async(Z,le)=>{Z?.preventDefault();const G=le?.url??s,ie=le?.token??b?.provider??l;f(!0),h(null),M(null);try{try{localStorage.setItem("jaato.url",G),typeof ie=="string"&&sessionStorage.setItem("jaato.token",ie)}catch{}await Zy({url:G,token:ie||void 0});const te=await Py();K(te==="enabled"?"workspaces":"session")}catch(te){te instanceof du?M(te.loginUrl):h(te instanceof Error?te.message:String(te))}finally{f(!1)}};Y.useEffect(()=>{let Z=!1;return nb().then(le=>{if(Z||ee.current||(ee.current=!0,_(le),L.getState().setCredentialsUrl(le.credentialsUrl??null),!le.daemon&&!le.token&&!le.ticketUrl))return;const G=le.daemon??s;o(G);let ie=le.token??l;const te=ob(le);te?(S(te),ie=te.provider,L.getState().setBackend({logoutUrl:te.logoutUrl,user:null}),lb(te.sessionUrl).then(Q=>{Z||!Q||(R(Q.user),L.getState().setBackend({logoutUrl:te.logoutUrl,user:Q.user}))})):le.token&&i(le.token),le.autoConnect&&G&&!eb()&&ne(void 0,{url:G,token:ie})}),()=>{Z=!0}},[]);const I=!!y&&!!(y.daemon||y.token||y.ticketUrl),W=!1,de=y===null?"Preparing":B?"Sign in to continue":b?N?"Welcome back":"Your environment":I?"Your environment":"Where is your daemon?";return d.jsx("div",{className:"h-full overflow-auto flex items-center justify-center p-6 sm:p-12",children:d.jsxs(Nt,{className:"w-full max-w-[860px] grid grid-cols-1 md:grid-cols-[1fr_1px_1fr]",children:[d.jsxs("div",{className:"p-7 flex flex-col gap-4",children:[d.jsxs("div",{className:"flex items-baseline gap-2.5",children:[d.jsx("span",{className:"display text-[40px] leading-none",children:"jaato"}),d.jsx("span",{className:"kicker tracking-[0.18em]",children:"web coding environment"})]}),d.jsx("h1",{className:"display text-[26px] leading-[1.15] m-0",children:"Your coding agent, in the browser."}),d.jsx("p",{className:"m-0 text-sm text-text-muted max-w-[34ch]",children:"Everything the terminal client does — sessions, tools, plans, permissions — from a tab, on any machine."}),d.jsx("ol",{className:"mt-auto pt-4 border-t hairline list-none m-0 p-0",children:Im.map(([Z,le],G)=>d.jsxs("li",{className:`flex gap-3 py-2 ${G<Im.length-1?"border-b hairline":""}`,children:[d.jsx("span",{className:"font-mono text-[11px] text-steel w-[22px] shrink-0 pt-0.5",children:String(G+1).padStart(2,"0")}),d.jsxs("div",{children:[d.jsx("div",{className:"chrome text-[13px] font-medium",children:Z}),d.jsx("div",{className:"text-[13px] text-text-muted",children:le})]})]},Z))})]}),d.jsx("div",{className:"hidden md:block bg-divider","aria-hidden":"true"}),d.jsxs("form",{onSubmit:ne,className:"p-7 flex flex-col gap-4 border-t md:border-t-0 hairline",children:[d.jsx("div",{className:"kicker tracking-[0.16em]",children:de}),y===null?d.jsx("div",{className:"text-sm text-text-muted",children:"Preparing your environment…"}):B?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"text-sm text-text-muted max-w-[36ch]",children:"Sign in to open your coding environment. Sign in with your usual account; nothing to copy or paste."}),d.jsx(Nt,{edge:"steel",className:"p-0",style:{"--corner-color":"color-mix(in srgb, var(--c-bg) 60%, transparent)"},children:d.jsx("a",{href:B,className:"btn btn-primary w-full text-[16px] py-2.5 no-underline border-0",children:"Sign in"})}),d.jsx("div",{className:"text-xs text-text-muted",children:"Your sign-in backend issues a per-user ticket for each connection."})]}):N||c||I&&!p?d.jsxs("div",{className:"space-y-1",children:[N&&d.jsxs("div",{className:"text-base",children:["Welcome back, ",d.jsx("span",{className:"font-semibold",children:N}),"."]}),c?d.jsx("div",{className:"text-sm text-text-muted",children:V.detail??"Opening your coding environment…"}):I&&!p?d.jsx("div",{className:"text-sm text-text-muted",children:"Ready when you are."}):null]}):null,p&&d.jsx("div",{className:"border border-error/40 p-3 text-sm text-error whitespace-pre-wrap",role:"alert",children:p}),y!==null&&!B&&d.jsx("button",{type:"submit",disabled:c||!s,className:"btn btn-primary text-[16px] py-2.5",children:c?"Connecting…":p?"Try again":I?"Open my environment":"Connect"}),y!==null&&!B&&d.jsxs("details",{open:!I,className:"group border-t hairline pt-3 text-sm",children:[d.jsxs("summary",{className:"cursor-pointer select-none list-none flex items-baseline gap-2.5 [&::-webkit-details-marker]:hidden",children:[d.jsx("span",{className:"text-text-muted transition-transform group-open:rotate-90",children:"▸"}),d.jsxs("span",{children:[d.jsx("span",{className:"kicker kicker-muted tracking-[0.12em] text-[12px] block",children:"Daemon settings"}),d.jsx("span",{className:"text-[13px] text-text-muted",children:I?"WebSocket URL and bearer token — only if the served target is wrong.":"Point the page at a jaato daemon started with --web-socket."})]})]}),d.jsxs("div",{className:"mt-3 space-y-3",children:[d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"field-label",children:"WebSocket URL"}),d.jsx("input",{value:s,onChange:Z=>o(Z.target.value),className:"input input-mono",placeholder:"ws://host:8080",autoFocus:!I})]}),!b&&d.jsxs("label",{className:"block",children:[d.jsxs("span",{className:"field-label",children:["Bearer token ",d.jsxs("span",{className:"opacity-70",children:["(from ",d.jsx("code",{className:"font-mono",children:"~/.jaato/ws.token"}),"; leave empty for ",d.jsx("code",{className:"font-mono",children:"--ws-unsafe-no-auth"}),")"]})]}),d.jsx("input",{value:l,onChange:Z=>i(Z.target.value),type:"password",autoComplete:"off",className:"input input-mono"})]}),W]})]}),b&&N&&d.jsxs("div",{className:"text-xs text-text-muted",children:["Not ",N,"? ",d.jsx("a",{href:b.logoutUrl,className:"link",children:"Sign out"})]}),d.jsxs("dl",{className:"kv mt-auto pt-3 border-t hairline text-[11px] m-0","data-testid":"build-info",title:wp(),children:[d.jsx("dt",{children:"ui"}),d.jsx("dd",{className:"text-text m-0",children:Ka.ui}),d.jsx("dt",{children:"sdk"}),d.jsxs("dd",{className:"text-text m-0",children:["@jaato/sdk ",Ka.sdk]}),d.jsx("dt",{children:"protocol"}),d.jsxs("dd",{className:"text-text m-0",children:["≥ ",Ka.protocolMin]}),d.jsx("dt",{children:"commit"}),d.jsx("dd",{className:"text-text m-0",children:Ka.commit})]})]})]})})}const $m=10*1024*1024,Zm=50*1024*1024;function cb(s){return s.trim().replace(/\\/g,"/").split("/").filter(o=>o&&o!==".").join("/")}function fb(s,o,l){const i=(o||s).replace(/\\/g,"/"),c=i.split("/").filter(h=>h&&h!=="."),f=cb(l);if(!c.length)return null;const p=[...f?f.split("/"):[],...c];return p.some(h=>h==="..")||i.startsWith("/")||/^[a-zA-Z]:/.test(i)?null:p.join("/")}function db(s){return s>=1024*1024?`${(s/(1024*1024)).toFixed(1)} MB`:s>=1024?`${Math.round(s/1024)} kB`:`${s} B`}function mb(s){const o=s.reduce((l,i)=>l+Math.max(i,0),0);if(o>Zm){const l=`declared total ${o} bytes exceeds cap ${Zm}`;return s.map(()=>({reason:l}))}return s.map(l=>({reason:l>$m?`declared size ${l} bytes exceeds per-file cap ${$m}`:null}))}function pb(s){return s.length?`
|
|
15
|
+
|
|
16
|
+
Attached files, staged in the workspace: ${s.map(l=>/\s/.test(l)?`"${l}"`:l).join(", ")}`:""}function Jm(s,o,l=""){const[i,c=""]=s.split(/\?(.*)/s,2);return`${i}/${encodeURIComponent(o)}${l}${c?`?${c}`:""}`}function hb(s,o){return`${s.includes("?")?`${s}&`:`${s}?`}provider=${encodeURIComponent(o)}`}async function gi(s,o){if(s.status===401)return new du("./auth/login");let l="";try{l=String((await s.json()).error??"")}catch{}return new Error(`${o}: HTTP ${s.status}${l?` (${l})`:""}`)}function mu(s,o=fetch){const l={credentials:"same-origin",cache:"no-store"},i={Accept:"application/json","Content-Type":"application/json"};return{async list(c){const f=await o(hb(s,c),{...l,headers:{Accept:"application/json"}});if(!f.ok)throw await gi(f,"Listing stored keys failed");const p=await f.json();return Array.isArray(p.entries)?p.entries.filter(h=>h&&typeof h.id=="string"):[]},async add(c,f,p){const h=await o(s,{...l,method:"POST",headers:i,body:JSON.stringify({provider:c,secret:f,label:p||void 0})});if(!h.ok)throw await gi(h,"Storing the key failed");const y=await h.json();if(!y.entry||typeof y.entry.id!="string")throw new Error("Storing the key failed: no entry in the answer");return y.entry},async reveal(c){const f=await o(Jm(s,c,"/reveal"),{...l,method:"POST",headers:{Accept:"application/json"}});if(!f.ok)throw await gi(f,"Reading the stored key failed");const p=await f.json();if(typeof p.secret!="string"||!p.secret)throw new Error("Reading the stored key failed: no secret in the answer");return p.secret},async remove(c){const f=await o(Jm(s,c),{...l,method:"DELETE"});if(!f.ok&&f.status!==404)throw await gi(f,"Deleting the stored key failed")}}}function gb(s){return!s.hint||s.label.endsWith(s.hint)?s.label:`${s.label} (…${s.hint})`}const _b=/^[a-z0-9_-]+-auth$/i,yb=12e4;let ou=null;function bb(s,o,l=Date.now()){if(!s||!_b.test(s)||(o?.[0]??"").toLowerCase()!=="key")return;const i=o?.[1];i&&(ou={secret:i,at:l},Sb())}function xb(s=Date.now()){const o=ou;return ou=null,o&&s-o.at<=yb?o.secret:null}async function vb(s,o,l=Date.now()){if(!s||!s.providerName)return null;const i=xb(l);if(!i||!o)return null;try{return await o.add(s.providerName,i),{provider:s.providerName}}catch{return null}}let Wm=!1;function Sb(){if(Wm)return;Wm=!0;let s=L.getState().postAuth;L.subscribe(o=>{o.postAuth!==s&&(s=o.postAuth,vb(o.postAuth,o.credentialsUrl?mu(o.credentialsUrl):null))})}const Eb=4e3;function Tb(s){const o=s?{key:"d",label:"Detach",description:"The task continues in the background; reconnect later"}:{key:"d",label:"Detach",description:"Keep the session on the daemon; reconnect later"},l=s?{key:"e",label:"End session",description:"Cancel the task and delete the session"}:{key:"e",label:"End session",description:"Delete the session from the daemon"},i={key:"r",label:"Return",description:"Return to the session"};return s?[{key:"c",label:"Cancel task and exit",description:"Stop the turn, keep the session on the daemon"},o,l,i]:[o,l,i]}function Nb(s){return s==="enabled"?"workspaces":"connect"}async function kp(){const s=L.getState();if(!s.sessionId)return $l();const o=Object.values(s.processing).some(Boolean);s.openExitChoice(o,Tb(o))}async function Ap(s){const o=L.getState(),l=o.exitChoice;if(!l)return;const i=s.trim().toLowerCase()||l.options[l.focus]?.key||"r";if(o.closeExitChoice(),!l.options.some(f=>f.key===i)||i==="r"){o.addSystemBlock(o.selectedAgentId,"Returning to session.","dim");return}if(i==="c"){try{await De().stop()}catch{}return $l()}return i==="d"?$l():wb(l.running)}async function $l(){Tp(),await fu(),L.getState().setScreen("connect")}async function wb(s){const l=L.getState().sessionId;if(!l||!Zl())return $l();const i=De();if(s)try{await i.stop()}catch{}const c=kb(l);await i.deleteSession(l);const f=await c,p=L.getState();if(f.kind==="missing"&&p.addSystemBlock(p.selectedAgentId,f.text,"warning"),p.resetSessionState(),Nb(p.workspace.mode)==="connect")return $l();p.setScreen("workspaces")}function kb(s){return new Promise(o=>{const l=De();let i=!1;const c=h=>{i||(i=!0,f(),clearTimeout(p),o(h))},f=l.subscribe(q.SYSTEM_MESSAGE,h=>{const y=String(h.message??"");y.includes(`'${s}' not found`)?c({kind:"missing",text:y}):(y.includes(`'${s}' deleted`)||y.startsWith("Session deleted:"))&&c({kind:"deleted",text:y})}),p=setTimeout(()=>c({kind:"silent",text:""}),Eb)})}const Xa=[];function Ab(s){s.trim()&&Xa[Xa.length-1]!==s&&(Xa.push(s),Xa.length>200&&Xa.shift())}async function jp(s,o){L.getState().resolvePermission(s),await De().respondToPermission(s,o)}async function Op(s,o){const l=L.getState(),i=l.answerClarification(s.requestId,o);if(i){if(!s.batchOnly){await De().respondToClarification(s.requestId,o,s.index),l.dismissClarification(s.requestId);return}i.index>=i.questions.length&&(await De().respondToClarificationBatch(s.requestId,i.answers),l.dismissClarification(s.requestId))}}async function Cp(s){L.getState().dismissClarification(s.requestId),s.batchOnly?await De().respondToClarificationBatch(s.requestId,[],!0):await De().respondToClarification(s.requestId,"cancel",s.index)}async function Fm(s,o){L.getState().dismissPostAuth(),await De().respondToPostAuthSetup(s,o)}async function jb(s){const o=L.getState();try{await De().toggleWorkspaceIgnore(s)}catch(l){o.setWorkspaceNotice({text:String(l instanceof Error?l.message:l),error:!0})}}async function Rp(s,o){L.getState().dismissReferenceSelection(s),await De().respondToReferenceSelection(s,o)}function Ob(){return["Commands are typed as plain words (no / prefix). The composer proposes matches as you type;","press Esc on the proposal to send the word verbatim instead.","",...L.getState().commands.map(l=>` ${l.name.padEnd(28)} ${l.description??""}`.trimEnd()),"","References: @path (file) @@path (sandbox) %name (prompt library) /name (.jaato/commands)","Keys: Ctrl+P plan · Ctrl+B budget · Alt+W files · Ctrl+T tools · Ctrl+A next agent · Ctrl+O next running tool"].join(`
|
|
17
|
+
`)}function Cb(s){const o=L.getState().context[s];if(!o)return"No usage reported yet.";const l=o.usage;return[`Context usage for ${s}`,` prompt tokens: ${l.prompt_tokens??"–"}`,` output tokens: ${l.output_tokens??"–"}`,` total tokens: ${l.total_tokens??"–"}`,` limit: ${o.contextLimit??"–"}`,` percent used: ${o.percentUsed!=null?o.percentUsed.toFixed(1)+"%":"–"}`,` turns: ${o.turns??"–"}`].join(`
|
|
18
|
+
`)}async function Mp(){const s=L.getState();if(Zl()){s.setSessionListSilent(1);try{await De().listSessions()}catch{s.setSessionListSilent(-1)}}}async function Dp(s){const o=L.getState();o.resetSessionState(),o.setHistoryMode("replay");const l=De();try{await l.attachSession(s),await l.requestHistory(Vt)}catch(i){throw L.getState().setHistoryMode("listing"),i}}async function Rb(){Tp(),await fu(),L.getState().setScreen("connect")}async function Pm(s,o){const l=L.getState(),i=l.selectedAgentId||Vt,c=s.trim();if(l.exitChoice){await Ap(c);return}const f=l.permissions.find(b=>b.agentId===i)??l.permissions[0];if(f){const b=c||(f.options[f.focus]?.key??"");if(!b)return;await jp(f.requestId,b);return}const p=l.clarifications.find(b=>b.agentId===i&&b.inputMode)??l.clarifications.find(b=>b.inputMode);if(p){if(c.toLowerCase()==="cancel")return Cp(p);const b=p.questions[p.index],S=c||(b?.default!=null?String(b.default):"");await Op(p,S);return}const h=l.referenceSelections.find(b=>b.agentId===i)??l.referenceSelections[0];if(h&&c){await Rp(h.requestId,c);return}if(!c)return;Ab(s);const y=mp(s,{serverCommands:l.commands,verbatim:o}),_=De();switch(y.action){case"exit":await kp();return;case"stop":await _.stop();return;case"clear":l.clearOutput(i);return;case"help":l.addSystemBlock(i,Ob(),"help");return;case"context":l.addSystemBlock(i,Cb(i),"help");return;case"history":l.setHistoryMode("listing"),await _.requestHistory(i);return;case"server":{if(y.command==="theme"){const b=y.args?.[0];b&&Gm.includes(b)?(vp(b),Xy(b),l.setTheme(b),l.addSystemBlock(i,`Theme: ${b}`,"info")):l.addSystemBlock(i,`Themes: ${Gm.join(", ")}`,"info");return}if(y.command==="session.attach"&&y.args?.[0]){await Dp(y.args[0]);return}bb(y.command,y.args),l.addUserBlock(i,s),await _.executeCommand(y.command??"",y.args??[]);return}case"message":{const b=(y.text??s)+pb(l.takeUploads());l.addUserBlock(i,b),l.dispatch([{type:q.AGENT_STATUS_CHANGED,agent_id:i,status:"processing"}]),await _.sendMessage(b);return}}}const Io="__new__",$o="";function Mb({credentialsUrl:s,provider:o,value:l,onChange:i,onError:c,reloadKey:f=0}){const[p,h]=Y.useState([]),[y,_]=Y.useState(null),[b,S]=Y.useState(!1),N=s?mu(s):null;Y.useEffect(()=>{if(!N||!o){h([]),_(null);return}let I=!1;return N.list(o).then(W=>{I||(h(W),_(o),l.kind==="none"&&W.length>0&&i({kind:"stored",id:W[W.length-1].id}),l.kind==="stored"&&!W.some(de=>de.id===l.id)&&i({kind:"none"}))}).catch(W=>{I||c(W instanceof Error?W.message:String(W))}),()=>{I=!0}},[s,o,f]);const R=async I=>{if(N){S(!0);try{await N.remove(I),h(W=>W.filter(de=>de.id!==I)),l.kind==="stored"&&l.id===I&&i({kind:"none"})}catch(W){c(W instanceof Error?W.message:String(W))}finally{S(!1)}}},B=l.kind==="new"?l.secret:"",M=l.kind==="new"?l.label:"",V=I=>i({kind:"new",secret:I.secret??B,label:I.label??M}),K="input input-mono mt-1";if(!N)return d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"field-label",children:"API key"}),d.jsx("input",{"aria-label":"API key",value:B,onChange:I=>V({secret:I.target.value}),type:"password",autoComplete:"off",className:K})]});const ee=l.kind==="stored"?l.id:l.kind==="new"?Io:$o,ne=l.kind==="stored"?p.find(I=>I.id===l.id):void 0;return d.jsxs("div",{className:"block","data-testid":"credential-picker",children:[d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"field-label",children:"API key"}),d.jsxs("select",{"aria-label":"API key",value:ee,disabled:!o,onChange:I=>{const W=I.target.value;i(W===Io?{kind:"new",secret:"",label:""}:W===$o?{kind:"none"}:{kind:"stored",id:W})},className:"input",children:[d.jsx("option",{value:$o,children:y===o&&p.length===0?"— no stored key —":"—"}),p.map(I=>d.jsx("option",{value:I.id,children:gb(I)},I.id)),d.jsx("option",{value:Io,children:"New key…"})]})]}),ne&&d.jsxs("div",{className:"mt-1 flex items-center justify-between text-[11px] text-text-muted",children:[d.jsxs("span",{children:["stored ",new Date(ne.createdAt).toLocaleDateString()]}),d.jsx("button",{type:"button",disabled:b,onClick:()=>R(ne.id),className:"link hover:text-error","aria-label":`Forget stored key ${ne.label}`,children:"forget"})]}),l.kind==="new"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{"aria-label":"New API key",value:B,onChange:I=>V({secret:I.target.value}),type:"password",autoComplete:"off",placeholder:"paste the key",className:K}),d.jsx("input",{"aria-label":"Key label",value:M,onChange:I=>V({label:I.target.value}),placeholder:"label (optional) — e.g. work account",className:`${K} text-xs`})]})]})}const Xl="px-3.5 py-2 text-left font-medium border-b hairline kicker kicker-muted",ep="px-3.5 py-2.5 border-b hairline align-middle";function Db(s){if(!s)return"—";const o=new Date(s);if(Number.isNaN(o.getTime()))return s;const l=new Date,i=o.toDateString()===l.toDateString(),c=o.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});return i?`${c} today`:`${o.toLocaleDateString(void 0,{day:"numeric",month:"short"})} ${c}`}function zb(){const s=L(Q=>Q.workspace),o=L(Q=>Q.setScreen),l=L(Q=>Q.setWorkspaceListNotice),i=L(Q=>Q.credentialsUrl),c=L(Q=>Q.backend),[f,p]=Y.useState(""),[h,y]=Y.useState(""),[_,b]=Y.useState(""),[S,N]=Y.useState({kind:"none"}),[R,B]=Y.useState(0),[M,V]=Y.useState(!1),[K,ee]=Y.useState(null),[ne,I]=Y.useState(null);Y.useEffect(()=>{Ep().catch(()=>{})},[]),Y.useEffect(()=>{s.config&&(y(s.config.provider??""),b(s.config.model??""))},[s.config]);const W=async Q=>{V(!0);try{await Vm(Q),o("session")}finally{V(!1)}},de=async Q=>{V(!0);try{await Vm(Q),ee(Q)}finally{V(!1)}},Z=async Q=>{V(!0);try{await Wy(Q)}finally{V(!1),I(null)}},le=async Q=>{Q.preventDefault(),f.trim()&&(await Jy(f.trim()),p(""))},G=async()=>{const Q=i?mu(i):null;if(S.kind==="stored")return{apiKey:Q?await Q.reveal(S.id):void 0};if(S.kind==="new"&&S.secret.trim()){const we=S.secret.trim();let ze;if(Q&&h)try{ze=(await Q.add(h,we,S.label.trim()||void 0)).id}catch(Ce){l({text:`Key applied, but not stored for later: ${Ce instanceof Error?Ce.message:String(Ce)}`,error:!0})}return{apiKey:we,storedId:ze}}return{}},ie=async Q=>{Q.preventDefault(),V(!0);try{const{apiKey:we,storedId:ze}=await G();await Fy({provider:h||void 0,model:_||void 0,api_key:we}),S.kind==="new"&&(N(ze?{kind:"stored",id:ze}:{kind:"none"}),B(Ce=>Ce+1))}catch(we){l({text:we instanceof Error?we.message:String(we),error:!0})}finally{V(!1)}},te=s.config;return d.jsx("div",{className:"h-full overflow-auto p-6 sm:p-10 flex justify-center",children:d.jsxs("div",{className:"w-full max-w-[880px] flex flex-col gap-5",children:[d.jsxs("header",{className:"flex items-end justify-between gap-4 border-b hairline pb-2.5",children:[d.jsxs("div",{children:[d.jsx("div",{className:"kicker tracking-[0.16em]",children:s.root?"Workspace root":"Pick a workspace"}),d.jsx("h1",{className:"display text-[30px] m-0",children:"Workspaces"})]}),d.jsxs("div",{className:"text-right space-y-0.5",children:[d.jsxs("div",{className:"font-mono text-xs text-text-muted",children:[s.root??"workspace mode"," · ",s.list.length," ",s.list.length===1?"entry":"entries"]}),d.jsxs("div",{className:"text-xs text-text-muted",children:[c?.user&&d.jsxs(d.Fragment,{children:["Signed in as ",d.jsx("span",{className:"font-semibold text-text",children:c.user})," · "]}),c?d.jsx("a",{href:c.logoutUrl,className:"link",children:"Sign out"}):d.jsx("button",{type:"button",onClick:()=>{Rb().catch(()=>{})},className:"link",children:"Disconnect"})]})]})]}),s.notice&&d.jsx("div",{role:"status",className:`text-xs ${s.notice.error?"text-error":"text-text-muted"}`,children:s.notice.text}),d.jsx(Nt,{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full border-collapse text-sm",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:Xl,children:"Workspace"}),d.jsx("th",{className:Xl,children:"Provider · model"}),d.jsx("th",{className:Xl,children:"Owner"}),d.jsx("th",{className:Xl,children:"Last opened"}),d.jsx("th",{className:`${Xl} text-right`,children:"Actions"})]})}),d.jsxs("tbody",{className:"font-mono text-[13px]",children:[s.list.length===0&&d.jsx("tr",{children:d.jsx("td",{colSpan:5,className:"px-3.5 py-3 font-sans text-sm text-text-muted italic",children:"No workspaces yet — create one below."})}),s.list.map((Q,we)=>{const Ce=we===s.list.length-1?ep.replace("border-b hairline",""):ep;return d.jsxs("tr",{className:s.selected===Q.name?"tint":"hover:bg-tint/60",children:[d.jsx("td",{className:`${Ce} whitespace-nowrap`,children:d.jsxs("button",{type:"button",disabled:M,onClick:()=>W(Q.name),className:"text-left hover:text-steel",children:[d.jsx("span",{className:`mr-2 ${Q.configured?"text-success":"text-warning"}`,children:Q.configured?"●":"○"}),Q.name]})}),d.jsx("td",{className:`${Ce} ${Q.configured?"":"text-text-muted"}`,children:Q.configured?[Q.provider,Q.model].filter(Boolean).join(" / "):d.jsxs(d.Fragment,{children:["no provider in ",d.jsx("span",{className:"text-text",children:".env"})," — sign in from the prompt, or configure"]})}),d.jsx("td",{className:`${Ce} text-text-muted`,children:Q.owner?d.jsx("span",{title:`Owned by ${Q.owner}`,children:Q.owner}):"—"}),d.jsx("td",{className:`${Ce} text-text-muted whitespace-nowrap`,children:Db(Q.last_accessed)}),d.jsx("td",{className:`${Ce} text-right whitespace-nowrap`,children:ne===Q.name?d.jsxs("span",{className:"inline-flex items-center gap-2 font-sans text-xs",role:"group","aria-label":`Confirm deleting workspace ${Q.name}`,children:[d.jsxs("span",{className:"text-warning",children:["delete ",Q.name," and its sessions?"]}),d.jsx("button",{type:"button",disabled:M,onClick:()=>Z(Q.name),className:"btn btn-sm btn-danger","aria-label":`Confirm delete workspace ${Q.name}`,children:"Delete"}),d.jsx("button",{type:"button",onClick:()=>I(null),className:"btn btn-sm","aria-label":"Cancel delete",children:"Cancel"})]}):d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx("button",{type:"button",disabled:M,onClick:()=>W(Q.name),className:`btn btn-sm ${s.selected===Q.name?"btn-steel":"text-steel"}`,"aria-label":`Open workspace ${Q.name}`,children:"Open"}),d.jsx("button",{type:"button",disabled:M,onClick:()=>de(Q.name),className:"btn btn-sm btn-quiet border-transparent","aria-label":`Configure workspace ${Q.name}`,children:"Configure"}),d.jsx("button",{type:"button",disabled:M,onClick:()=>I(Q.name),className:"btn btn-sm btn-quiet border-transparent hover:text-error","aria-label":`Delete workspace ${Q.name}`,children:"Delete"})]})})]},Q.name)})]})]})}),d.jsxs("form",{onSubmit:le,className:"flex items-center gap-3",children:[d.jsx("input",{value:f,onChange:Q=>p(Q.target.value),placeholder:"new-workspace-name",className:"input input-mono flex-1","aria-label":"New workspace name"}),d.jsx("button",{type:"submit",className:"btn",children:"Create"}),d.jsx("span",{className:"flex-1"}),d.jsx("button",{type:"button",className:"link text-[13px]",onClick:()=>o("session"),title:"The daemon provisions a fresh workspace for the session under its workspace root",children:"Open a session in a server-provisioned workspace"})]}),te&&K===te.workspace&&d.jsxs(Nt,{role:"group","aria-label":"Manual provider configuration",className:"flex flex-col",children:[d.jsxs("div",{className:"flex items-baseline gap-3 px-5 py-3.5 border-b hairline",children:[d.jsx("span",{className:"kicker tracking-[0.16em]",children:"Configure"}),d.jsx("span",{className:"font-mono text-[16px]",children:te.workspace}),d.jsx("span",{className:"flex-1"}),d.jsx("span",{className:"font-mono text-xs text-text-muted",children:te.configured?"configured":`missing: ${te.missingFields.join(", ")||"provider"}`})]}),d.jsxs("form",{onSubmit:ie,className:"p-5 flex flex-col gap-4",children:[d.jsxs("div",{className:"text-xs text-text-muted",children:["Writes ",d.jsx("span",{className:"font-mono",children:"JAATO_PROVIDER"})," / ",d.jsx("span",{className:"font-mono",children:"MODEL_NAME"})," (and the key) to this workspace's ",d.jsx("span",{className:"font-mono",children:".env"}),". Optional: an auth command from the prompt does the same after signing you in."]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 text-sm",children:[d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"field-label",children:"Provider"}),d.jsxs("select",{value:h,onChange:Q=>y(Q.target.value),className:"input",children:[d.jsx("option",{value:"",children:"—"}),te.availableProviders.map(Q=>d.jsx("option",{value:Q,children:Q},Q))]})]}),d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"field-label",children:"Model"}),d.jsx("input",{value:_,onChange:Q=>b(Q.target.value),className:"input input-mono"})]}),d.jsx(Mb,{credentialsUrl:i,provider:h,value:S,onChange:N,reloadKey:R,onError:Q=>l({text:Q,error:!0})})]}),d.jsxs("div",{className:"flex items-center gap-2 border-t hairline pt-4",children:[d.jsx("button",{type:"submit",disabled:M,className:"btn btn-steel",children:"Save configuration"}),d.jsx("button",{type:"button",onClick:()=>ee(null),className:"btn btn-quiet",children:"Close"}),d.jsx("span",{className:"flex-1"}),d.jsx("button",{type:"button",onClick:()=>o("session"),className:"btn btn-primary",children:"Open session →"})]})]})]})]})})}var Ub=cp();function Lb(s,o,l){const i=new Array(s);return new Proxy(i,{get(c,f,p){if(typeof f=="string"){const h=f.charCodeAt(0);if(h>=48&&h<=57){const y=+f;if(Number.isInteger(y)&&y>=0&&y<s){let _=c[y];if(!_){const b=o[y*2];_=c[y]={index:y,key:l(y),start:b,size:o[y*2+1],end:b+o[y*2+1],lane:0}}return _}}if(f==="length")return s}return Reflect.get(c,f,p)}})}function Va(s,o,l){let i=l.initialDeps??[],c,f=!0;function p(){const h=s();return(h.length!==i.length||h.some((_,b)=>i[b]!==_))&&(i=h,c=o(...h),l?.onChange&&!(f&&l.skipInitialOnChange)&&l.onChange(c),f=!1),c}return p.updateDeps=h=>{i=h},p}function tp(s,o){if(s===void 0)throw new Error("Unexpected undefined");return s}const qb=(s,o)=>Math.abs(s-o)<1.01,Hb=(s,o,l)=>{let i;return Object.assign(function(...c){s.clearTimeout(i),i=s.setTimeout(()=>o.apply(this,c),l)},{cancel:()=>{s.clearTimeout(i)}})};let Kl;const Zo=()=>{if(Kl!==void 0)return Kl;if(typeof navigator>"u")return Kl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Kl=!0;const s=navigator.maxTouchPoints;return Kl=navigator.platform==="MacIntel"&&s!==void 0&&s>0},np=s=>{const{offsetWidth:o,offsetHeight:l}=s;return{width:o,height:l}},Bb=s=>s,Gb=s=>{const o=Math.max(s.startIndex-s.overscan,0),i=Math.min(s.endIndex+s.overscan,s.count-1)-o+1,c=new Array(i);for(let f=0;f<i;f++)c[f]=o+f;return c},Yb=(s,o)=>{const l=s.scrollElement;if(!l)return;const i=s.targetWindow;if(!i)return;const c=p=>{const{width:h,height:y}=p;o({width:Math.round(h),height:Math.round(y)})};if(c(np(l)),!i.ResizeObserver)return()=>{};const f=new i.ResizeObserver(p=>{const h=()=>{const y=p[0];if(y?.borderBoxSize){const _=y.borderBoxSize[0];if(_){c({width:_.inlineSize,height:_.blockSize});return}}c(np(l))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()});return f.observe(l,{box:"border-box"}),()=>{f.unobserve(l)}},yi={passive:!0},Qb=typeof window>"u"?!0:"onscrollend"in window,Vb=(s,o,l)=>{const i=s.scrollElement;if(!i)return;const c=s.targetWindow;if(!c)return;const f=s.options.useScrollendEvent&&Qb;let p=0;const h=f?null:Hb(c,()=>o(p,!1),s.options.isScrollingResetDelay),y=S=>()=>{p=l(i),h?.(),o(p,S)},_=y(!0),b=y(!1);return i.addEventListener("scroll",_,yi),f&&i.addEventListener("scrollend",b,yi),()=>{i.removeEventListener("scroll",_),f&&i.removeEventListener("scrollend",b),h?.cancel()}},Xb=(s,o)=>Vb(s,o,l=>{const{horizontal:i,isRtl:c}=s.options;return i?l.scrollLeft*(c&&-1||1):l.scrollTop}),Kb=(s,o,l)=>{if(l.options.useCachedMeasurements){const i=l.indexFromElement(s),c=l.options.getItemKey(i);return l.itemSizeCache.get(c)??l.options.estimateSize(i)}if(o?.borderBoxSize){const i=o.borderBoxSize[0];if(i)return Math.round(i[l.options.horizontal?"inlineSize":"blockSize"])}if(!o){const i=l.indexFromElement(s),c=l.options.getItemKey(i),f=l.itemSizeCache.get(c);if(f!==void 0)return f}return s[l.options.horizontal?"offsetWidth":"offsetHeight"]},Ib=(s,{adjustments:o=0,behavior:l},i)=>{var c,f;(f=(c=i.scrollElement)==null?void 0:c.scrollTo)==null||f.call(c,{[i.options.horizontal?"left":"top"]:s+o,behavior:l})},$b=Ib;class Zb{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var l,i,c;return((c=(i=(l=this.targetWindow)==null?void 0:l.performance)==null?void 0:i.now)==null?void 0:c.call(i))??Date.now()},this.observer=(()=>{let l=null;const i=()=>l||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:l=new this.targetWindow.ResizeObserver(c=>{c.forEach(f=>{const p=()=>{const h=f.target,y=this.indexFromElement(h);if(!h.isConnected){this.observer.unobserve(h);for(const[_,b]of this.elementsCache)if(b===h){this.elementsCache.delete(_);break}return}this.isIndexInRange(y)&&this.shouldMeasureDuringScroll(y)&&this.resizeItem(y,this.options.measureElement(h,f,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()})}));return{disconnect:()=>{var c;(c=i())==null||c.disconnect(),l=null},observe:c=>{var f;return(f=i())==null?void 0:f.observe(c,{box:"border-box"})},unobserve:c=>{var f;return(f=i())==null?void 0:f.unobserve(c)}}})(),this.range=null,this.setOptions=l=>{var i,c;const f={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Bb,rangeExtractor:Gb,onChange:()=>{},measureElement:Kb,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const N in l){const R=l[N];R!==void 0&&(f[N]=R)}const p=this.options;let h=null,y=null,_=!1;if(p!==void 0&&p.enabled&&f.enabled&&f.anchorTo==="end"&&this.scrollElement!==null){const N=p.count,R=f.count,B=this.getMeasurements(),M=N>0?((i=B[0])==null?void 0:i.key)??p.getItemKey(0):null,V=N>0?((c=B[N-1])==null?void 0:c.key)??p.getItemKey(N-1):null;if(R!==N||N>0&&R>0&&(f.getItemKey(0)!==M||f.getItemKey(R-1)!==V)){_=!0;const ne=N>0?this.getVirtualItemForOffset(this.getScrollOffset())??B[0]:null;ne&&(h=[ne.key,this.getScrollOffset()-ne.start]);const I=f.followOnAppend===!0?"auto":f.followOnAppend||null;I&&R>N&&this.isAtEnd(p.scrollEndThreshold)&&(N===0||f.getItemKey(R-1)!==V)&&(y=I)}}this.options=f,_&&(this.pendingMin=0,this.itemSizeCacheVersion++);let b=!1,S=0;if(h&&this.scrollOffset!==null){const[N,R]=h,B=this.getMeasurements(),{count:M,getItemKey:V}=this.options;let K=0;for(;K<M&&V(K)!==N;)K++;if(K<M){const ee=B[K];if(ee){const ne=Math.max(0,ee.start+R);ne!==this.scrollOffset&&(S=ne-this.scrollOffset,this.scrollOffset=ne,b=!0)}}}(b||y)&&(this.pendingScrollAnchor=[b?h[0]:null,b?h[1]:0,y,S])},this.notify=l=>{var i,c;(c=(i=this.options).onChange)==null||c.call(i,this,l)},this.maybeNotify=Va(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),l=>{this.notify(l)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(l=>l()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var l;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((l=this.scrollElement)==null?void 0:l.window)??null,this.elementsCache.forEach(f=>{this.observer.observe(f)}),this.unsubs.push(this.options.observeElementRect(this,f=>{this.scrollRect=f,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(f,p)=>{if(p&&this._intendedScrollOffset===null&&f===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(f-this._intendedScrollOffset)<1.5&&(f=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(f-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const h=this.getScrollOffset();this.scrollDirection=p?h===f?this.scrollDirection:h<f?"forward":"backward":null,this.scrollOffset=f,this.isScrolling=p,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const f=this.scrollElement,p=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},h=()=>{this._iosTouching=!1,!(!Zo()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};f.addEventListener("touchstart",p,yi),f.addEventListener("touchend",h,yi),this.unsubs.push(()=>{f.removeEventListener("touchstart",p),f.removeEventListener("touchend",h),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const c=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,c&&this.scrollElement&&this.options.enabled){const[f,p,h,y]=c;f!==null&&!h&&(Zo()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?y!==0&&(this._iosDeferredAdjustment+=y):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),h&&this.scrollToEnd({behavior:h})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:l,maxAtWrite:i}=this._clampedAdjustment,c=this.getMaxScrollOffset();c>i+.5&&(this._clampedAdjustment=l>c+.5?{target:l,maxAtWrite:c}:null,this._scrollToOffset(l,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const l=this.getScrollOffset(),i=this.getMaxScrollOffset();if(l<0||l>i)return;if(this._iosDeferredAdjustment<0&&l>=i-1){this._iosDeferredAdjustment=0;return}const c=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(l,{adjustments:this.scrollAdjustments+=c,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Va(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(l,i,c,f,p,h,y,_)=>(this.prevLanes!==void 0&&this.prevLanes!==h&&(this.lanesChangedFlag=!0),this.prevLanes=h,this.pendingMin=null,{count:l,paddingStart:i,scrollMargin:c,getItemKey:f,enabled:p,lanes:h,laneAssignmentMode:y,gap:_}),{key:!1}),this.isIndexInRange=l=>l>=0&&l<this.options.count,this.getMeasurements=Va(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:l,paddingStart:i,scrollMargin:c,getItemKey:f,enabled:p,lanes:h,laneAssignmentMode:y,gap:_},b)=>{const S=this.itemSizeCache;if(!p)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>l)for(const K of this.laneAssignments.keys())K>=l&&this.laneAssignments.delete(K);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(K=>{this.itemSizeCache.set(K.key,K.size)}));const N=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===l&&(this.lanesSettling=!1),h===1){const K=l*2;let ee=this._flatMeasurements;if(!ee||ee.length<K){const W=new Float64Array(K);ee&&N>0&&W.set(ee.subarray(0,N*2)),ee=W,this._flatMeasurements=ee}let ne;if(N===0)ne=i+c;else{const W=N-1;ne=ee[W*2]+ee[W*2+1]+_}for(let W=N;W<l;W++){const de=f(W),Z=S.get(de),le=typeof Z=="number"?Z:this.options.estimateSize(W);ee[W*2]=ne,ee[W*2+1]=le,ne+=le+_}const I=Lb(l,ee,f);return this.measurementsCache=I,I}const R=this.measurementsCache.slice(0,N),B=new Array(h).fill(void 0),M=new Float64Array(h);let V=0;for(let K=0;K<N;K++){const ee=R[K];ee&&(B[ee.lane]===void 0&&V++,B[ee.lane]=K,M[ee.lane]=ee.end)}for(let K=N;K<l;K++){const ee=f(K),ne=this.laneAssignments.get(K);let I,W;const de=y==="estimate"||S.has(ee);if(ne!==void 0&&this.options.lanes>1){I=ne;const ie=B[I],te=ie!==void 0?R[ie]:void 0;W=te?te.end+_:i+c}else if(V===h){let ie=0,te=M[0],Q=B[0];for(let we=1;we<h;we++){const ze=M[we];(ze<te||ze===te&&B[we]<Q)&&(ie=we,te=ze,Q=B[we])}I=ie,W=te+_,de&&this.laneAssignments.set(K,I)}else I=K%this.options.lanes,W=i+c,de&&this.laneAssignments.set(K,I);const Z=S.get(ee),le=typeof Z=="number"?Z:this.options.estimateSize(K),G=W+le;R[K]={index:K,start:W,size:le,end:G,key:ee,lane:I},B[I]===void 0&&V++,B[I]=K,M[I]=G}return this.measurementsCache=R,R},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Va(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(l,i,c,f)=>l.length===0||i===0?(this.range=null,null):(this.range=Wb(l,i,c,f,f===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Va(()=>{let l=null,i=null;const c=this.calculateRange();return c&&(l=c.startIndex,i=c.endIndex),this.maybeNotify.updateDeps([this.isScrolling,l,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,l,i]},(l,i,c,f,p)=>f===null||p===null?[]:l({startIndex:f,endIndex:p,overscan:i,count:c}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=l=>{const i=this.options.indexAttribute,c=l.getAttribute(i);return c?parseInt(c,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=l=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const c=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(c!==void 0&&this.range){const f=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),p=Math.max(0,c-f),h=Math.min(this.options.count-1,c+f);return l>=p&&l<=h}return!0},this.measureElement=l=>{if(!l){this.elementsCache.forEach((p,h)=>{p.isConnected||(this.observer.unobserve(p),this.elementsCache.delete(h))});return}const i=this.indexFromElement(l);if(!this.isIndexInRange(i))return;const c=this.options.getItemKey(i),f=this.elementsCache.get(c);f!==l&&(f&&this.observer.unobserve(f),this.observer.observe(l),this.elementsCache.set(c,l)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(l,void 0,this))},this.resizeItem=(l,i)=>{var c,f;if(!this.isIndexInRange(l))return;let p,h,y;const _=this._flatMeasurements;if(this.options.lanes===1&&_!==null)y=this.options.getItemKey(l),h=_[l*2],p=_[l*2+1];else{const N=this.measurementsCache[l];if(!N)return;y=N.key,h=N.start,p=N.size}const b=this.itemSizeCache.get(y)??p,S=i-b;if(S!==0){const N=this.options.anchorTo==="end"&&((c=this.scrollState)==null?void 0:c.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,R=N?this.getTotalSize():0,B=this.getScrollOffset()+this.scrollAdjustments,V=!this.itemSizeCache.has(y)?h<B:h+b<=B&&this.scrollDirection!=="backward",K=((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[l]??{index:l,key:y,start:h,size:p,end:h+p,lane:0},S,this):V);(this.pendingMin===null||l<this.pendingMin)&&(this.pendingMin=l),this.itemSizeCache.set(y,i),this.itemSizeCacheVersion++;let ee=!1;N?ee=this.applyScrollAdjustment(this.getTotalSize()-R):K&&(ee=this.applyScrollAdjustment(S)),this.notify(ee),this._retryClampedAdjustment()}},this.getVirtualItems=Va(()=>[this.getVirtualIndexes(),this.getMeasurements()],(l,i)=>{const c=[];for(let f=0,p=l.length;f<p;f++){const h=l[f],y=i[h];c.push(y)}return c},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=l=>{const i=this.getMeasurements();if(i.length===0)return;const c=this._flatMeasurements,f=this.options.lanes===1&&c!=null,p=zp(0,i.length-1,f?h=>c[h*2]:h=>tp(i[h]).start,l);return tp(i[p])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const l=this.scrollElement.document.documentElement;return this.options.horizontal?l.scrollWidth-this.scrollElement.innerWidth:l.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(l=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=l,this.getOffsetForAlignment=(l,i,c=0)=>{if(!this.scrollElement)return 0;const f=this.getSize(),p=this.getScrollOffset();i==="auto"&&(i=l>=p+f?"end":"start"),i==="center"?l+=(c-f)/2:i==="end"&&(l-=f);const h=this.getMaxScrollOffset();return Math.max(Math.min(h,l),0)},this.getOffsetForIndex=(l,i="auto")=>{l=Math.max(0,Math.min(l,this.options.count-1));const c=this.getSize(),f=this.getScrollOffset(),p=this.measurementsCache[l];if(!p)return;if(i==="auto")if(p.end>=f+c-this.options.scrollPaddingEnd)i="end";else if(p.start<=f+this.options.scrollPaddingStart)i="start";else return[f,i];if(i==="end"&&l===this.options.count-1)return[this.getMaxScrollOffset(),i];const h=i==="end"?p.end+this.options.scrollPaddingEnd:p.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(h,i,p.size),i]},this.scrollToOffset=(l,{align:i="start",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0;const f=this.getOffsetForAlignment(l,i),p=this.now();this.scrollState={index:null,align:i,behavior:c,startedAt:p,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollToIndex=(l,{align:i="auto",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0,l=Math.max(0,Math.min(l,this.options.count-1));const f=this.getOffsetForIndex(l,i);if(!f)return;const[p,h]=f,y=this.now();this.scrollState={index:l,align:h,behavior:c,startedAt:y,lastTargetOffset:p,stableFrames:0},this._scrollToOffset(p,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollBy=(l,{behavior:i="auto"}={})=>{const c=this.getScrollOffset()+l,f=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:f,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:l="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:l});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:l})},this.getTotalSize=()=>{var l;const i=this.getMeasurements();let c;if(i.length===0)c=this.options.paddingStart;else if(this.options.lanes===1){const f=i.length-1,p=this._flatMeasurements;p!=null?c=p[f*2]+p[f*2+1]:c=((l=i[f])==null?void 0:l.end)??0}else{const f=Array(this.options.lanes).fill(null);let p=i.length-1;for(;p>=0&&f.some(h=>h===null);){const h=i[p];f[h.lane]===null&&(f[h.lane]=h.end),p--}c=Math.max(...f.filter(h=>h!==null))}return Math.max(c-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const l=[];if(this.itemSizeCache.size===0)return l;const i=this.getMeasurements();for(const c of i)c&&this.itemSizeCache.has(c.key)&&l.push({index:c.index,key:c.key,start:c.start,size:c.size,end:c.end,lane:c.lane});return l},this._scrollToOffset=(l,{adjustments:i,behavior:c})=>{this._intendedScrollOffset=l+(i??0),this.options.scrollToFn(l,{behavior:c,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(o)}applyScrollAdjustment(o,l){if(o===0)return!1;if(Zo()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=o,!1;{const i=this.getScrollOffset()+this.scrollAdjustments+o,c=this.scrollElement,f=c!==null&&("scrollHeight"in c||"document"in c)?this.getMaxScrollOffset():null;return this._clampedAdjustment=f!==null&&i>f+.5?{target:i,maxAtWrite:f}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:l}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,c=i?i[0]:this.scrollState.lastTargetOffset,f=1,p=c!==this.scrollState.lastTargetOffset;if(!p&&qb(c,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=f){this.getScrollOffset()!==c&&this._scrollToOffset(c,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,p){const h=this.getSize()||600,y=Math.abs(c-this.getScrollOffset()),_=this.scrollState.behavior==="smooth"&&y>h;this.scrollState.lastTargetOffset=c,_||(this.scrollState.behavior="auto"),this._scrollToOffset(c,{adjustments:void 0,behavior:_?"smooth":"auto"})}this.scheduleScrollReconcile()}}const zp=(s,o,l,i)=>{for(;s<=o;){const c=(s+o)/2|0,f=l(c);if(f<i)s=c+1;else if(f>i)o=c-1;else return c}return s>0?s-1:0};function Jb(s,o,l){let i=0;for(;i<=o;){const c=(i+o)/2|0,f=s[c*2];if(f<l)i=c+1;else if(f>l)o=c-1;else return c}return i>0?i-1:0}function Wb(s,o,l,i,c){const f=s.length-1;if(s.length<=i)return{startIndex:0,endIndex:f};if(i===1&&c!==null){const _=Jb(c,f,l);let b=_;const S=l+o;for(;b<f&&c[b*2]+c[b*2+1]<S;)b++;return{startIndex:_,endIndex:b}}let h=zp(0,f,_=>s[_].start,l),y=h;if(i===1)for(;y<f&&s[y].end<l+o;)y++;else if(i>1){const _=Array(i).fill(0);for(;y<f&&_.some(S=>S<l+o);){const S=s[y];_[S.lane]=S.end,y++}const b=Array(i).fill(l+o);for(;h>=0&&b.some(S=>S>=l);){const S=s[h];b[S.lane]=S.start,h--}h=Math.max(0,h-h%i),y=Math.min(f,y+(i-1-y%i))}return{startIndex:h,endIndex:y}}const Jo=typeof document<"u"?Y.useLayoutEffect:Y.useEffect;function Fb({useFlushSync:s=!0,directDomUpdates:o=!1,directDomUpdatesMode:l="transform",...i}){const c=Y.useReducer(b=>b+1,0)[1],f=Y.useRef({enabled:o,mode:l,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});f.current.enabled=o,f.current.mode=l;const p=b=>{const S=f.current;if(!S.enabled||!S.container)return;const N=b.getTotalSize();if(N!==S.lastSize){S.lastSize=N;const R=b.options.horizontal?"width":"height";S.container.style[R]=`${N}px`}},h=b=>{const S=f.current;if(!S.enabled||!S.container)return;p(b);const N=!!b.options.horizontal,R=S.mode==="transform",B=N?"left":"top",M=b.options.scrollMargin,V=b.getVirtualItems();for(const K of V){const ee=K.start-M,ne=b.elementsCache.get(K.key);ne&&S.lastPositions.get(ne)!==ee&&(S.lastPositions.set(ne,ee),R?ne.style.transform=N?`translate3d(${ee}px, 0, 0)`:`translate3d(0, ${ee}px, 0)`:ne.style[B]=`${ee}px`)}},y={...i,onChange:(b,S)=>{var N;const R=f.current;let B=!0;if(R.enabled){h(b);const M=b.range,V=R.prevRange;B=!V||V.isScrolling!==b.isScrolling||V.startIndex!==M?.startIndex||V.endIndex!==M?.endIndex,B&&(R.prevRange=M?{startIndex:M.startIndex,endIndex:M.endIndex,isScrolling:b.isScrolling}:null)}B&&(s&&S?Ub.flushSync(c):c()),(N=i.onChange)==null||N.call(i,b,S)}},[_]=Y.useState(()=>{const b=new Zb(y);return Object.assign(b,{containerRef:S=>{const N=f.current;if(N.container=S,N.lastSize=null,S&&N.enabled){const R=b.getTotalSize();N.lastSize=R;const B=b.options.horizontal?"width":"height";S.style[B]=`${R}px`}}})});return _.setOptions(y),Jo(()=>_._didMount(),[]),Jo(()=>(p(_),_._willUpdate())),Jo(()=>{h(_)}),_}function Pb(s){return Fb({observeElementRect:Yb,observeElementOffset:Xb,scrollToFn:$b,...s})}const ex='<j-code(?:\\s+language="([^"]*)")?>\\n?([\\s\\S]*?)<\\/j-code>\\n?|<j-table>\\n?([\\s\\S]*?)<\\/j-table>\\n?',tx='<j-line(?:\\s+n="(\\d+)")?>([\\s\\S]*?)<\\/j-line>',nx='<j-tok(?:\\s+t="([^"]*)")?>([\\s\\S]*?)<\\/j-tok>',ap="<j-tr>([\\s\\S]*?)<\\/j-tr>",ax="<j-t[hd]>([\\s\\S]*?)<\\/j-t[hd]>",lx=/<j-thead>\n?([\s\S]*?)<\/j-thead>/,$a=s=>new RegExp(s,"g");function Ia(s){return s.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function sx(s){const o=[],l=$a(nx);let i=0,c;for(;(c=l.exec(s))!==null;)c.index>i&&o.push({t:"",text:Ia(s.slice(i,c.index))}),o.push({t:c[1]??"",text:Ia(c[2]??"")}),i=c.index+c[0].length;return i<s.length&&o.push({t:"",text:Ia(s.slice(i))}),o}function ix(s){const o=[],l=$a(tx);let i,c=!1;for(;(i=l.exec(s))!==null;)c=!0,o.push({n:i[1]?Number(i[1]):null,tokens:sx(i[2]??"")});if(!c)for(const f of s.replace(/\n$/,"").split(`
|
|
19
|
+
`))o.push({n:null,tokens:[{t:"",text:Ia(f)}]});return o}function lp(s){const o=[],l=$a(ax);let i;for(;(i=l.exec(s))!==null;)o.push(Ia((i[1]??"").trim()));return o}function rx(s){let o=[],l=s;const i=lx.exec(s);if(i){const h=i[1]??"",y=$a(ap).exec(h);o=lp(y?y[1]??"":h),l=s.slice(i.index+i[0].length)}const c=[],f=$a(ap);let p;for(;(p=f.exec(l))!==null;)c.push(lp(p[1]??""));return{head:o,rows:c}}function ox(s){const o=[],l=$a(ex);let i=0,c;for(;(c=l.exec(s))!==null;)c.index>i&&o.push({kind:"text",text:s.slice(i,c.index)}),c[3]!==void 0?o.push({kind:"table",...rx(c[3])}):o.push({kind:"code",language:Ia(c[1]??""),lines:ix(c[2]??"")}),i=c.index+c[0].length;return i<s.length&&o.push({kind:"text",text:s.slice(i)}),o}const ux="(`+)([\\s\\S]*?[^`])\\1(?!`)|\\*\\*([^*]+)\\*\\*|(?<!\\w)__([^_]+)__(?!\\w)|\\*([^*\\s][^*]*?)\\*|(?<!\\w)_([^_\\s][^_]*?)_(?!\\w)|\\[([^\\]]+)\\]\\((https?:\\/\\/[^\\s)]+)\\)";function na(s){const o=[],l=new RegExp(ux,"g");let i=0,c;for(;(c=l.exec(s))!==null;)c.index>i&&o.push({kind:"text",text:s.slice(i,c.index)}),c[2]!==void 0?o.push({kind:"code",text:c[2]}):c[3]!==void 0||c[4]!==void 0?o.push({kind:"strong",children:na(c[3]??c[4]??"")}):c[5]!==void 0||c[6]!==void 0?o.push({kind:"em",children:na(c[5]??c[6]??"")}):c[7]!==void 0&&c[8]!==void 0&&o.push({kind:"link",href:c[8],children:na(c[7])}),i=c.index+c[0].length;return i<s.length&&o.push({kind:"text",text:s.slice(i)}),o}function cx(s){const o=[],l=s.replace(/\r\n?/g,`
|
|
20
|
+
`).split(`
|
|
21
|
+
`);let i=0;const c=[],f=()=>{c.length&&(o.push({kind:"paragraph",children:na(c.join(`
|
|
22
|
+
`))}),c.length=0)};for(;i<l.length;){const p=l[i];if(/^\s*$/.test(p)){f(),i++;continue}if(/^```/.test(p)){f();const _=[];for(i++;i<l.length&&!/^```/.test(l[i]);)_.push(l[i]),i++;i++,o.push({kind:"pre",text:_.join(`
|
|
23
|
+
`)});continue}const h=/^(#{1,6})\s+(.*)$/.exec(p);if(h){f(),o.push({kind:"heading",level:h[1].length,children:na(h[2])}),i++;continue}if(/^\s*([-*_])(\s*\1){2,}\s*$/.test(p)){f(),o.push({kind:"rule"}),i++;continue}if(/^\s*>\s?/.test(p)){f();const _=[];for(;i<l.length&&/^\s*>\s?/.test(l[i]);)_.push(l[i].replace(/^\s*>\s?/,"")),i++;o.push({kind:"quote",children:na(_.join(`
|
|
24
|
+
`))});continue}const y=/^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(p);if(y){f();const _=/\d/.test(y[1]),b=[];for(;i<l.length;){const S=/^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(l[i]);if(!S)break;let N=S[2];for(i++;i<l.length&&/^\s{2,}\S/.test(l[i])&&!/^\s*([-*+]|\d+[.)])\s+/.test(l[i]);)N+=`
|
|
25
|
+
`+l[i].trim(),i++;b.push(na(N))}o.push({kind:"list",ordered:_,items:b});continue}c.push(p),i++}return f(),o}const fx={nf:"function",fm:"function",nc:"class",nn:"class",ne:"class",nt:"tag",nb:"builtin",bp:"builtin",no:"builtin",kc:"keyword",kt:"class",nd:"decorator",na:"attribute",nv:"name",vc:"name",vg:"name",vi:"name",vm:"name",gd:"deleted",gi:"inserted",gh:"heading",gu:"heading",gp:"prompt",gr:"error",gt:"error",err:"error",w:"text","":"text"};function dx(s){const o=fx[s];if(o)return o;switch(s[0]){case"k":return"keyword";case"n":return"name";case"s":return"string";case"l":return"string";case"m":return"number";case"i":return"number";case"o":return"operator";case"p":return"punctuation";case"c":return"comment";case"g":return"text";default:return"text"}}function mx(s){return`tok tok-${dx(s)}`}function aa({nodes:s}){return d.jsx(d.Fragment,{children:s.map((o,l)=>{switch(o.kind){case"text":return d.jsx("span",{children:o.text},l);case"code":return d.jsx("code",{className:"inline",children:o.text},l);case"strong":return d.jsx("strong",{children:d.jsx(aa,{nodes:o.children})},l);case"em":return d.jsx("em",{children:d.jsx(aa,{nodes:o.children})},l);case"link":return d.jsx("a",{href:o.href,target:"_blank",rel:"noreferrer noopener",children:d.jsx(aa,{nodes:o.children})},l)}})})}function px({blocks:s}){return d.jsx(d.Fragment,{children:s.map((o,l)=>{switch(o.kind){case"paragraph":return d.jsx("p",{className:"whitespace-pre-wrap break-words",children:d.jsx(aa,{nodes:o.children})},l);case"heading":{const i=`h${Math.min(4,o.level)}`;return d.jsx(i,{children:d.jsx(aa,{nodes:o.children})},l)}case"list":{const i=o.ordered?"ol":"ul";return d.jsx(i,{children:o.items.map((c,f)=>d.jsx("li",{className:"whitespace-pre-wrap",children:d.jsx(aa,{nodes:c})},f))},l)}case"quote":return d.jsx("blockquote",{className:"whitespace-pre-wrap",children:d.jsx(aa,{nodes:o.children})},l);case"rule":return d.jsx("hr",{},l);case"pre":return d.jsx("pre",{className:"code-block plate plate-ground p-2.5 my-1.5 overflow-x-auto whitespace-pre",children:o.text},l)}})})}function hx({lines:s}){const o=s.some(l=>l.n!==null);return d.jsx("pre",{className:"code-block overflow-x-auto whitespace-pre p-2",children:s.map((l,i)=>d.jsxs("div",{children:[o&&d.jsx("span",{className:"ln",children:l.n??""}),l.tokens.map((c,f)=>c.t?d.jsx("span",{className:mx(c.t),children:c.text},f):d.jsx("span",{children:c.text},f)),l.tokens.length===0&&" "]},i))})}function gx({language:s,lines:o}){const l=o.map(i=>i.tokens.map(c=>c.text).join("")).join(`
|
|
26
|
+
`);return d.jsxs(Nt,{ground:!0,corners:"two",className:"my-2",children:[d.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1 border-b hairline",children:[d.jsx("span",{className:"kicker kicker-muted",children:s||"text"}),d.jsx("button",{type:"button",className:"chrome-sm font-heading uppercase tracking-[0.1em] text-text-muted hover:text-steel",onClick:()=>navigator.clipboard?.writeText(l).catch(()=>{}),title:"Copy code",children:"copy"})]}),d.jsx(hx,{lines:o})]})}function _x({head:s,rows:o}){return d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"j-table",children:[s.length>0&&d.jsx("thead",{children:d.jsx("tr",{children:s.map((l,i)=>d.jsx("th",{children:l},i))})}),d.jsx("tbody",{children:o.map((l,i)=>d.jsx("tr",{children:l.map((c,f)=>d.jsx("td",{children:c},f))},i))})]})})}function yx({seg:s}){return s.kind==="code"?d.jsx(gx,{language:s.language,lines:s.lines}):s.kind==="table"?d.jsx(_x,{head:s.head,rows:s.rows}):d.jsx(px,{blocks:cx(s.text)})}const Up=Y.memo(function({text:o}){const l=Y.useMemo(()=>ox(o),[o]);return d.jsx("div",{className:"prose-j",children:l.map((i,c)=>d.jsx(yx,{seg:i},c))})});function bx({lines:s}){return d.jsx("pre",{className:"code-block whitespace-pre overflow-x-auto p-2",children:s.map((o,l)=>{let i="";return o.startsWith("+++")||o.startsWith("---")?i="diff-meta":o.startsWith("@@")?i="diff-hunk":o.startsWith("+")?i="diff-add":o.startsWith("-")&&(i="diff-del"),d.jsx("div",{className:i,children:o||" "},l)})})}function xx(s){const[o,...l]=s.split(";").map(c=>c.trim());if(o!=="audio/pcm"&&o!=="audio/l16"&&o!=="audio/L16")return null;const i={};for(const c of l){const[f,p]=c.split("=");f&&p&&(i[f.toLowerCase()]=p)}return{rate:Number(i.rate??24e3),bits:Number(i.bits??16),channels:Number(i.channels??1)}}function vx(s){const o=atob(s),l=new Uint8Array(o.length);for(let i=0;i<o.length;i++)l[i]=o.charCodeAt(i);return l}class Sx{ctx=null;nextAt=0;played=0;feed(o,l,i){for(;this.played<o.length;this.played++){const c=o[this.played],f=vx(c.dataB64),p=new Int16Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/2));if(!p.length)continue;this.ctx??=new AudioContext({sampleRate:l});const h=Math.floor(p.length/i),y=this.ctx.createBuffer(i,h,l);for(let S=0;S<i;S++){const N=y.getChannelData(S);for(let R=0;R<h;R++)N[R]=p[R*i+S]/32768}const _=this.ctx.createBufferSource();_.buffer=y,_.connect(this.ctx.destination);const b=Math.max(this.ctx.currentTime+.02,this.nextAt);_.start(b),this.nextAt=b+y.duration}}close(){this.ctx?.close().catch(()=>{}),this.ctx=null}}function Ex({items:s,mime:o}){const l=Y.useRef(null),i=Y.useMemo(()=>xx(o),[o]);Y.useEffect(()=>{i&&(l.current??=new Sx,l.current.feed(s,i.rate,i.channels))},[s,i]),Y.useEffect(()=>()=>l.current?.close(),[]);const c=i?s.reduce((f,p)=>f+p.dataB64.length*3/4,0)/(i.rate*2*i.channels):0;return d.jsxs("div",{className:"text-xs text-text-muted font-mono",children:["🔊 pcm ",i?.rate??"?"," Hz · ",c.toFixed(1),"s",s.at(-1)?.final?"":" · streaming"]})}function Tx({items:s}){if(!s.length)return null;const o=new Map;for(const l of s){const i=l.streamId??`${l.mimeType}#single`,c=o.get(i)??[];c.push(l),o.set(i,c)}return d.jsx("div",{className:"flex flex-col gap-2 p-2",children:[...o.entries()].map(([l,i])=>{const c=i[0].mimeType,f=c.split(";")[0].trim().toLowerCase();if(f.startsWith("image/")){const p=i.map(h=>h.dataB64).join("");return d.jsx("img",{alt:"tool output",className:"max-h-96 rounded-md border hairline",src:`data:${f};base64,${p}`},l)}if(f==="audio/pcm"||f==="audio/l16")return d.jsx(Ex,{items:i,mime:c},l);if(f.startsWith("audio/")){const p=i.map(h=>h.dataB64).join("");return d.jsx("audio",{controls:!0,preload:"auto",src:`data:${f};base64,${p}`},l)}if(f==="application/pdf"){const p=i.map(h=>h.dataB64).join("");return d.jsx("a",{className:"text-primary underline text-xs",href:`data:${f};base64,${p}`,target:"_blank",rel:"noreferrer",children:"Open PDF attachment"},l)}return d.jsxs("div",{className:"text-xs text-text-muted",children:["[",c,": ",i.length," chunk(s), not renderable here]"]},l)})})}function Nx(s,o=110){const l=[];for(const[c,f]of Object.entries(s)){let p;if(typeof f=="string")p=f;else{if(f==null)continue;p=JSON.stringify(f)}p=p.replace(/\s+/g," "),l.push(`${c}=${p.length>60?p.slice(0,57)+"…":p}`)}const i=l.join(" ");return i.length>o?i.slice(0,o-1)+"…":i}function wx({status:s}){return s==="running"?d.jsx("span",{className:"text-primary pulse","aria-label":"running",children:"●"}):s==="success"?d.jsx("span",{className:"text-success","aria-label":"succeeded",children:"✓"}):d.jsx("span",{className:"text-error","aria-label":"failed",children:"✗"})}const kx=Y.memo(function({block:o}){const l=L(p=>p.toggleTool),i=L(p=>p.setPopup),c=o.output.length>0||o.media.length>0||!!o.errorMessage,f=o.status==="running";return d.jsxs("div",{"data-testid":"tool-block",className:"border-t hairline",children:[d.jsxs("button",{type:"button",onClick:()=>l(o.agentId,o.id),className:`w-full flex items-center gap-3 py-1.5 pr-1 text-left ${f?"bg-steel/8":"hover:bg-tint/70"}`,"aria-expanded":o.expanded,children:[d.jsx("span",{className:"w-3 shrink-0 text-center",children:d.jsx(wx,{status:o.status})}),d.jsx("span",{className:`chrome w-[120px] shrink-0 truncate ${o.status==="error"?"text-error":""}`,children:o.toolName}),d.jsx("span",{className:"font-mono text-xs text-text-muted truncate flex-1",children:Nx(o.args)}),o.backgrounded&&d.jsx("span",{className:"kicker kicker-muted text-[10px]",children:"bg"}),f&&o.output?d.jsx("span",{role:"button",tabIndex:0,className:"chrome-sm font-heading font-medium uppercase tracking-[0.08em] text-steel w-[52px] text-right",onClick:p=>{p.stopPropagation(),i(o.callId)},onKeyDown:p=>{p.key==="Enter"&&(p.stopPropagation(),i(o.callId))},title:"Follow live output",children:"Follow"}):typeof o.durationSeconds=="number"?d.jsxs("span",{className:"font-mono text-[11px] text-text-muted w-[52px] text-right",children:[o.durationSeconds.toFixed(o.durationSeconds<10?2:1),"s"]}):d.jsx("span",{className:"w-[52px]"})]}),o.expanded&&c&&d.jsxs(Nt,{ground:!0,corners:"two",edge:o.status==="error"?"error":"hairline",className:"ml-6 mt-0.5 mb-2.5",children:[o.errorMessage&&d.jsx("div",{className:"px-3 py-1.5 text-error text-xs whitespace-pre-wrap",children:o.errorMessage}),o.output&&(o.output.includes("<j-")?d.jsx("div",{className:"px-3 py-1.5 text-[13px]",children:d.jsx(Up,{text:o.output})}):d.jsx("pre",{className:"code-block whitespace-pre-wrap break-words px-3 py-2 max-h-[60vh] overflow-auto",children:o.output})),d.jsx(Tx,{items:o.media})]})]})}),Ax=Y.memo(function({block:o}){const l=o.source==="model";return d.jsxs("div",{className:`py-1.5 ${l?"":"text-[13px]"}`,children:[!l&&o.source!=="system"&&d.jsx("div",{className:"kicker kicker-muted text-[10px]",children:o.source}),d.jsx("div",{className:l?"":"text-text-muted",children:d.jsx(Up,{text:o.text})})]})}),jx=Y.memo(function({block:o,turn:l}){return d.jsxs("div",{className:"my-2.5 flex items-start gap-3",children:[d.jsx("span",{className:"font-mono text-[10px] text-steel w-9 shrink-0 pt-2.5 select-none","aria-hidden":"true",children:l?`T${l}`:""}),d.jsx("span",{className:"flex-1"}),d.jsx("div",{className:"max-w-[76%] tint border-l-2 border-steel px-3 py-2 whitespace-pre-wrap break-words text-[15px]",children:o.text})]})}),sp={error:"text-error",warning:"text-warning",success:"text-success",hint:"text-text-muted italic",help:"text-text-muted font-mono text-xs whitespace-pre",info:"text-text-muted"},Ox=Y.memo(function({block:o}){const l=sp[o.style]??sp[o.style.split("_")[0]??""]??"text-text-muted";return d.jsx("div",{className:`py-0.5 text-[13px] whitespace-pre-wrap ${l}`,children:o.text})});function Cx({block:s,turn:o}){switch(s.kind){case"text":return d.jsx(Ax,{block:s});case"user":return d.jsx(jx,{block:s,turn:o});case"system":return d.jsx(Ox,{block:s});case"tool":return d.jsx(kx,{block:s})}}function Rx({agentId:s}){const o=L(ty(s)),l=Y.useRef(null),[i,c]=Y.useState(!0),f=Y.useMemo(()=>{const N=new Map;let R=0;for(const B of o)B.kind==="user"&&N.set(B.id,++R);return N},[o]),p=Pb({count:o.length,getScrollElement:()=>l.current,estimateSize:()=>64,overscan:8,getItemKey:N=>o[N]?.id??N}),h=Y.useRef(0),y=Y.useRef(null),_=o[o.length-1],b=_?`${_.id}:${_.kind==="text"?_.text.length:_.kind==="tool"?_.output.length+(_.expanded?1:0):0}`:null;Y.useLayoutEffect(()=>{if(i&&(o.length!==h.current||b!==y.current)){h.current=o.length,y.current=b;const N=l.current;N&&requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight})}},[o.length,b,i]),Y.useEffect(()=>{const N=l.current;if(!N)return;const R=()=>{const B=N.scrollHeight-N.scrollTop-N.clientHeight<24;c(B)};return N.addEventListener("scroll",R,{passive:!0}),()=>N.removeEventListener("scroll",R)},[]),Y.useEffect(()=>{const N=R=>{const B=R.target,M=B&&(B.tagName==="TEXTAREA"||B.tagName==="INPUT");if(M&&R.key!=="End"&&R.key!=="Home")return;const V=l.current;V&&(R.key==="End"&&(R.ctrlKey||!M)&&(V.scrollTop=V.scrollHeight,c(!0)),R.key==="Home"&&(R.ctrlKey||!M)&&(V.scrollTop=0,c(!1)),!M&&R.key==="PageDown"&&(V.scrollTop+=V.clientHeight*.9),!M&&R.key==="PageUp"&&(V.scrollTop-=V.clientHeight*.9))};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[]);const S=p.getVirtualItems();return d.jsxs("div",{ref:l,className:"relative flex-1 overflow-y-auto px-5 py-3","data-testid":"output-pane",children:[o.length===0&&d.jsx("div",{className:"h-full flex items-center justify-center text-text-muted text-sm select-none",children:d.jsxs("div",{className:"text-center max-w-[52ch] space-y-2",children:[d.jsx("div",{className:"display text-[34px] text-text",children:"jaato"}),d.jsxs("div",{children:["Type a message, or a command such as ",d.jsx("kbd",{children:"help"}),", ",d.jsx("kbd",{children:"tools"}),", ",d.jsx("kbd",{children:"model"}),"."]}),d.jsxs("div",{children:["Commands are plain words — the composer proposes them as you type; ",d.jsx("kbd",{children:"Esc"})," dismisses the proposal to send the word verbatim."]})]})}),d.jsx("div",{style:{height:p.getTotalSize(),position:"relative",width:"100%"},children:S.map(N=>{const R=o[N.index];return d.jsx("div",{"data-index":N.index,ref:p.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:d.jsx(Cx,{block:R,turn:f.get(R.id)})},N.key)})}),!i&&o.length>0&&d.jsx("button",{type:"button",className:"sticky bottom-3 left-1/2 -translate-x-1/2 btn btn-sm bg-surface text-text-muted shadow-md",onClick:()=>{const N=l.current;N&&(N.scrollTop=N.scrollHeight),c(!0)},children:"↓ follow output"})]})}function Mx({agentId:s}){const o=L(h=>h.blocks[s]),l=L(h=>h.ui.popupCallId),i=L(h=>h.setPopup),c=Y.useMemo(()=>(o??[]).filter(h=>h.kind==="tool"&&h.status==="running"&&h.output.length>0),[o]),f=c.find(h=>h.callId===l)??null,p=Y.useRef(null);return Y.useEffect(()=>{const h=p.current;h&&(h.scrollTop=h.scrollHeight)},[f?.output.length]),Y.useEffect(()=>{const h=y=>{if(y.ctrlKey&&y.key.toLowerCase()==="o"&&c.length){y.preventDefault();const _=c.findIndex(b=>b.callId===l);i(c[(_+1)%c.length].callId)}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[c,l,i]),f?d.jsxs(Nt,{ground:!0,edge:"steel",className:"absolute right-5 bottom-[104px] w-[min(560px,70%)] max-h-[45vh] flex flex-col shadow-lg z-20",role:"dialog","aria-label":"Live tool output",children:[d.jsxs("div",{className:"flex items-center gap-2.5 px-2.5 py-1.5 border-b hairline",children:[c.map(h=>d.jsxs("button",{type:"button",onClick:()=>i(h.callId),className:`kicker tracking-[0.12em] text-[12px] ${h.callId===f.callId?"":"kicker-muted hover:text-text"}`,children:[h.callId===f.callId?"Live · ":"",h.toolName]},h.callId)),d.jsx("span",{className:"flex-1"}),d.jsx("span",{className:"font-mono text-[10px] text-text-muted hidden md:inline",children:"Ctrl+O next"}),d.jsx("button",{type:"button",className:"text-text-muted hover:text-text",onClick:()=>i(null),"aria-label":"Close",children:"✕"})]}),d.jsx("pre",{ref:p,className:"code-block whitespace-pre-wrap break-words px-3 py-2.5 overflow-auto flex-1",children:f.output})]}):null}const ta=new Map;let Wo=Promise.resolve(),Dx=0;function zx(){return Zl()&&uu(L.getState())}function uu(s){return!!(s.sessionId||s.workspace.selected)}L.subscribe((s,o)=>{uu(s)&&!uu(o)&&Zl()&&s.uploads.some(l=>l.status==="queued")&&xi().catch(()=>{})});function bi(s,o){if(!s.length)return;const l=L.getState(),i=mb(s.map(f=>f.size)),c=s.map((f,p)=>{const h=`up-${++Dx}`,y=f.webkitRelativePath??"",_=fb(f.name,y,o),b=_===null?"name must be a non-empty workspace-relative path with no '..' components":i[p].reason;return b?{id:h,path:_??f.name,size:f.size,status:"failed",error:b}:(ta.set(h,f),{id:h,path:_,size:f.size,status:"queued"})});l.addUploads(c),zx()&&xi().catch(()=>{})}function Ux(s){ta.delete(s),L.getState().removeUpload(s)}function xi(){return Wo=Wo.then(()=>Lx()).catch(()=>{}),Wo}async function Lx(){const s=L.getState(),o=s.uploads.filter(f=>f.status==="queued"&&ta.has(f.id));if(!o.length)return;for(const f of o)s.updateUpload(f.id,{status:"staging"});const l=s.selectedAgentId||Vt,i=[],c=[];for(const f of o){const p=ta.get(f.id);try{i.push({name:f.path,data:await p.arrayBuffer(),contentType:p.type||void 0}),c.push(f)}catch(h){ta.delete(f.id),s.updateUpload(f.id,{status:"failed",error:`could not read the file: ${h instanceof Error?h.message:String(h)}`})}}if(c.length)try{const f=await De().stageFiles("",i),p=new Set(f.staged??[]),h=new Map((f.failed??[]).map(b=>[b.name,b.error||b.category||"failed"])),y=[],_=[];for(const b of c)if(ta.delete(b.id),p.has(b.path))s.updateUpload(b.id,{status:"staged"}),y.push(b.path);else{const S=h.get(b.path)??"the daemon did not report this file";s.updateUpload(b.id,{status:"failed",error:S}),_.push(`${b.path}: ${S}`)}y.length&&s.addSystemBlock(l,`Staged into the workspace: ${y.join(", ")}`,"info"),_.length&&s.addSystemBlock(l,`Not staged:
|
|
27
|
+
${_.join(`
|
|
28
|
+
`)}`,"error")}catch(f){const p=f instanceof Error?f.message:String(f);for(const h of c)ta.delete(h.id),s.updateUpload(h.id,{status:"failed",error:p});s.addSystemBlock(l,`Staging failed: ${p}`,"error")}}function qx(s=6e4){return new Promise(o=>{let l=()=>{};const i=setTimeout(()=>{l(),o(!1)},s);l=De().subscribe(q.SESSION_INFO,()=>{clearTimeout(i),l(),o(!0)})})}async function ip(s){const o=L.getState();if(!o.uploads.some(c=>c.status==="queued"))return s();if(o.workspace.selected)return await xi(),s();const i=qx();await s(),await i&&await xi()}const rp={queued:{text:"○",cls:"text-text-muted"},staging:{text:"●",cls:"text-primary pulse"},staged:{text:"✓",cls:"text-success"},failed:{text:"✗",cls:"text-error"}};function Lp({hint:s,always:o}){const l=L(p=>p.uploads),[i,c]=Y.useState(""),f=Y.useRef(null);return!o&&l.length===0?d.jsx("input",{ref:f,type:"file",multiple:!0,className:"hidden","aria-label":"Attach files","data-attach-input":!0,onChange:p=>{bi(Array.from(p.target.files??[]),i),p.target.value=""}}):d.jsxs("div",{className:"plate plate-ground mb-2 text-[13px]",role:"group","aria-label":"Attached files",children:[d.jsx("input",{ref:f,type:"file",multiple:!0,className:"hidden","aria-label":"Attach files","data-attach-input":!0,onChange:p=>{bi(Array.from(p.target.files??[]),i),p.target.value=""}}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2 border-b hairline",children:[d.jsx("button",{type:"button",onClick:()=>f.current?.click(),className:"btn btn-sm btn-steel",children:"Attach files"}),d.jsxs("label",{className:"flex items-center gap-2 text-text-muted",children:[d.jsx("span",{className:"kicker kicker-muted",children:"into"}),d.jsx("input",{value:i,onChange:p=>c(p.target.value),placeholder:"workspace root","aria-label":"Folder for the next files",className:"input input-mono text-[12px] py-0.5 w-40"})]}),d.jsx("span",{className:"text-[12px] text-text-muted",children:s})]}),l.length>0&&d.jsx("ul",{className:"flex flex-wrap gap-1.5 px-3 py-2","aria-label":"Attachments",children:l.map(p=>d.jsxs("li",{"data-status":p.status,title:p.error??p.path,className:`flex items-center gap-1.5 border hairline px-2 py-0.5 font-mono text-[12px] ${p.status==="failed"?"border-error":""}`,children:[d.jsx("span",{className:rp[p.status].cls,"aria-label":p.status,children:rp[p.status].text}),d.jsx("span",{className:"max-w-[18rem] truncate",children:p.path}),d.jsx("span",{className:"text-text-muted",children:db(p.size)}),p.status==="failed"&&d.jsx("span",{className:"text-error truncate max-w-[16rem]",children:p.error}),d.jsx("button",{type:"button",onClick:()=>Ux(p.id),"aria-label":`Remove ${p.path}`,className:"text-text-muted hover:text-error px-0.5",children:"×"})]},p.id))})]})}function Fo(s){if(!s)return[];const o=[];for(const l of Array.from(s.items??[])){if(l.kind!=="file")continue;const i=l.getAsFile();i&&o.push(i)}return!o.length&&s.files?.length&&o.push(...Array.from(s.files)),o}function Po(s){return(s.trimStart().split(/\s+/)[0]??"").toLowerCase()}function Hx({commands:s,disabled:o,captureMode:l,history:i,onSubmit:c,onEscapeEmpty:f}){const[p,h]=Y.useState(""),[y,_]=Y.useState(!1),[b,S]=Y.useState(!1),[N,R]=Y.useState(0),[B,M]=Y.useState(null),[V,K]=Y.useState(0),[ee,ne]=Y.useState(!1),I=Y.useRef(null),W=Y.useRef(""),de=p.slice(0,V),Z=L(H=>H.sessions),le=Y.useMemo(()=>{if(l||y||b)return[];if(!p.trim()&&!de.length)return[];const H=X_(de,Z);return H!==null?H.slice(0,12):q_(de,s).slice(0,12)},[de,p,s,Z,l,y,b]),G=Y.useRef(!1);Y.useEffect(()=>{if(!l){if(!K_(de)){G.current=!1;return}G.current||(G.current=!0,Mp().catch(()=>{}))}},[de,l]);const ie=le.length>0;Y.useEffect(()=>{R(0)},[le.length,de]),Y.useEffect(()=>{const H=Po(p);if(!p.trim()){_(!1),S(!1),W.current="";return}(y||b)&&H!==W.current&&(_(!1),S(!1))},[p,y,b]);const te=!l&&!y?zm(p,s):null,Q=!l&&y?zm(p,s):null,we=Y.useCallback(()=>{const H=I.current;H&&(H.style.height="0px",H.style.height=Math.min(H.scrollHeight,240)+"px")},[]);Y.useEffect(we,[p,we]);const ze=Y.useRef(null);Y.useLayoutEffect(()=>{const H=ze.current;H!==null&&(ze.current=null,I.current?.setSelectionRange(H,H),K(H))},[p]);const Ce=H=>{const v=p.slice(V).replace(/^\S*/,""),z=H.insert+" "+v.replace(/^\s+/,"");ze.current=H.insert.length+1,h(z)},C=()=>{const H=p.replace(/\s+$/,"");!H&&!l||(c(H,y),h(""),_(!1),S(!1),M(null))},X=H=>{if(H.key==="Tab"&&!l){if(H.preventDefault(),ie){H.shiftKey?R(v=>(v-1+le.length)%le.length):(le.length===1||N>=0)&&Ce(le[N]??le[0]);return}_(!1),S(!1),W.current="";return}if(ie&&(H.key==="ArrowDown"||H.key==="ArrowUp")){H.preventDefault(),R(v=>H.key==="ArrowDown"?(v+1)%le.length:(v-1+le.length)%le.length);return}if(H.key==="Escape"){if(ie){H.preventDefault(),_(!0),S(!0),W.current=Po(p);return}if(!p){f?.();return}if(te){H.preventDefault(),_(!0),S(!0),W.current=Po(p);return}return}if(H.key==="Enter"&&!H.shiftKey&&!H.altKey&&!H.ctrlKey&&!H.metaKey&&!H.nativeEvent.isComposing){H.preventDefault(),C();return}if(H.key==="ArrowUp"&&!ie&&i.length&&(p===""||B!==null)&&re()){H.preventDefault();const v=B===null?i.length-1:Math.max(0,B-1);M(v),h(i[v]??"");return}if(H.key==="ArrowDown"&&!ie&&B!==null){H.preventDefault();const v=B+1;v>=i.length?(M(null),h("")):(M(v),h(i[v]??""))}},re=()=>{const H=I.current;return H?!H.value.slice(0,H.selectionStart).includes(`
|
|
29
|
+
`):!0},Se=l?l.placeholder:"Message the agent — or type a command (help, tools, model …)";return d.jsxs("div",{className:"relative",children:[ie&&d.jsxs("div",{role:"listbox","aria-label":"Command proposals",className:"plate plate-ground absolute bottom-full mb-1.5 left-0 w-[min(34rem,100%)] shadow-md text-[13px] z-30",children:[le.map((H,v)=>d.jsxs("div",{role:"option","aria-selected":v===N,onMouseDown:z=>{z.preventDefault(),Ce(H)},className:`flex items-baseline gap-3 px-2.5 py-1 cursor-pointer ${v===N?"bg-surface text-steel":"hover:bg-tint"}`,children:[d.jsx("span",{className:"font-mono",children:H.label}),H.description&&d.jsx("span",{className:"text-text-muted text-xs truncate",children:H.description})]},H.insert)),d.jsxs("div",{className:"px-2.5 py-1 text-[11px] text-text-muted border-t hairline flex gap-3",children:[d.jsxs("span",{children:[d.jsx("kbd",{children:"Tab"})," complete"]}),d.jsxs("span",{children:[d.jsx("kbd",{children:"Enter"})," run"]}),d.jsxs("span",{children:[d.jsx("kbd",{children:"Esc"})," not a command — send as text"]})]})]}),d.jsx(Lp,{hint:"Staged into the session's workspace now; the next message names them."}),d.jsxs("div",{className:`flex items-end gap-2.5 border px-3 py-2 bg-surface ${l?"border-warning":"border-steel"} ${ee?"bg-tint outline outline-1 outline-steel":""}`,onDragOver:H=>{(Fo(H.dataTransfer).length||H.dataTransfer.types.includes("Files"))&&(H.preventDefault(),ne(!0))},onDragLeave:()=>ne(!1),onDrop:H=>{const v=Fo(H.dataTransfer);ne(!1),v.length&&(H.preventDefault(),bi(v,""))},onPaste:H=>{const v=Fo(H.clipboardData);v.length&&(H.preventDefault(),bi(v,""))},children:[d.jsx("span",{className:`font-mono select-none pb-[3px] ${l?"text-warning":"text-steel"}`,children:l?"?":"›"}),d.jsx("textarea",{ref:I,value:p,rows:1,disabled:o,placeholder:Se,"aria-label":"Prompt",spellCheck:!te,onChange:H=>{h(H.target.value),K(H.target.selectionStart??H.target.value.length)},onSelect:H=>K(H.target.selectionStart??0),onKeyDown:X,className:"flex-1 resize-none bg-transparent outline-none font-mono text-[13.5px] leading-5 placeholder:text-text-muted max-h-60"}),d.jsx("button",{type:"button",onClick:()=>document.querySelector("[data-attach-input]")?.click(),disabled:o,className:"chrome-sm font-heading font-medium uppercase tracking-[0.08em] pb-[3px] text-text-muted hover:text-steel disabled:opacity-40","aria-label":"Attach",title:"Attach files to the workspace (or drop / paste them here)",children:"Attach"}),d.jsxs("button",{type:"button",onClick:C,disabled:o||!p.trim()&&!l,className:`chrome-sm font-heading font-medium uppercase tracking-[0.08em] pb-[3px] disabled:opacity-40 ${l?"text-warning":"text-steel"}`,"aria-label":"Send",children:[l?"Answer":"Send"," ⏎"]})]}),d.jsx("div",{className:`mt-1.5 pl-2.5 border-l-2 text-[13px] text-text-muted flex items-center gap-3 min-h-5 ${l?"border-warning":"border-steel"}`,children:l&&l.suggestions?.length?d.jsxs("span",{children:["A key answers the prompt — ",l.suggestions.map(H=>d.jsx("kbd",{className:"mx-0.5",children:H},H))," · anything longer is sent to the agent as a reply"]}):l?d.jsx("span",{children:"Enter sends your answer"}):te?d.jsxs("span",{children:["Enter runs command ",d.jsx("span",{className:"font-mono text-steel",children:te})," · Esc to send as text instead"]}):Q?d.jsxs("span",{children:["Sending as text (not the ",d.jsx("span",{className:"font-mono",children:Q})," command) · Tab to make it a command"]}):d.jsx("span",{children:"Enter sends a message · a first word that names a command runs it · Esc sends it verbatim · Shift+Enter for a newline · drop or paste files to stage them"})})]})}function eu(s){return/\b(deny|denied|never|reject|no)\b/i.test(`${s.label??""} ${s.action??""}`)||s.key==="n"}function Bx({p:s,onRespond:o}){const l=L(_=>_.focusPermission);Y.useEffect(()=>{const _=b=>{const S=b.target,N=S&&(S.tagName==="TEXTAREA"||S.tagName==="INPUT");if(b.key==="Tab"&&!N){b.preventDefault();const R=s.options.length||1;l(s.requestId,(s.focus+(b.shiftKey?-1:1)+R)%R)}};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[s,l]);const i=Object.entries(s.toolArgs??{}),c=s.warningLevel??"warning",f=s.options.length?s.options:[{key:"y",label:"yes"},{key:"n",label:"no"}],p=f.map((_,b)=>[_,b]).filter(([_])=>!eu(_)),h=f.map((_,b)=>[_,b]).filter(([_])=>eu(_)),y=([_,b])=>d.jsxs("button",{type:"button",onClick:()=>o(_.key),title:_.description??_.action??void 0,className:`btn ${b===s.focus?"btn-primary":eu(_)?"btn-danger":""}`,"aria-current":b===s.focus?"true":void 0,children:[_.label??_.key," ",d.jsx("span",{className:"key",children:_.key})]},_.key+b);return d.jsxs(Nt,{edge:"warning",className:"my-3",role:"group","aria-label":`Permission request for ${s.toolName}`,children:[d.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3 border-b hairline",children:[d.jsx("span",{className:"text-warning",children:"⚠"}),d.jsx("span",{className:"kicker text-warning",children:"Permission requested for"}),d.jsx("span",{className:"font-mono text-sm",children:s.toolName}),d.jsx("span",{className:"flex-1"}),d.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:["agent ",s.agentId]})]}),s.promptLines.length>0?s.formatHint==="diff"?d.jsx(bx,{lines:s.promptLines}):d.jsx("pre",{className:"code-block whitespace-pre-wrap px-3.5 py-2.5 max-h-[40vh] overflow-auto",children:s.promptLines.join(`
|
|
30
|
+
`)}):i.length>0?d.jsx("dl",{className:"px-3.5 py-2.5 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px] font-mono max-h-[40vh] overflow-auto m-0",children:i.map(([_,b])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"text-text-muted",children:_}),d.jsx("dd",{className:"whitespace-pre-wrap break-words m-0",children:typeof b=="string"?b:JSON.stringify(b,null,2)})]},_))}):null,s.warnings&&d.jsx("div",{className:`px-3.5 py-2 text-[13px] whitespace-pre-wrap border-t hairline ${c==="error"?"text-error":c==="info"?"text-text-muted":"text-warning"}`,children:s.warnings}),d.jsxs("div",{className:"px-3.5 py-3 flex flex-wrap items-center gap-2.5 border-t hairline",children:[p.map(y),d.jsx("span",{className:"flex-1"}),h.map(y)]})]})}function Gx({x:s,onAnswer:o}){const l=L(f=>f.focusExitChoice);Y.useEffect(()=>{const f=p=>{const h=p.target,y=h&&(h.tagName==="TEXTAREA"||h.tagName==="INPUT");if(p.key==="Tab"&&!y){p.preventDefault();const _=s.options.length||1;l((s.focus+(p.shiftKey?-1:1)+_)%_)}else p.key==="Escape"&&(p.preventDefault(),o("r"))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,l,o]);const i=(f,p)=>d.jsxs("button",{type:"button",onClick:()=>o(f.key),title:f.description,className:`btn ${p===s.focus?"btn-primary":f.key==="e"?"btn-danger":""}`,"aria-current":p===s.focus?"true":void 0,children:[f.label," ",d.jsx("span",{className:"key",children:f.key})]},f.key),c=s.options.findIndex(f=>f.key==="r");return d.jsxs(Nt,{edge:"warning",className:"my-3",role:"group","aria-label":"Exit options",children:[d.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3 border-b hairline",children:[d.jsx("span",{className:"text-warning",children:"⚠"}),d.jsx("span",{className:"kicker text-warning",children:s.running?"Task in progress":"Exit options"}),d.jsx("span",{className:"text-[13px] text-text-muted",children:s.running?"What would you like to do?":"What should become of the session?"})]}),d.jsx("ul",{className:"px-3.5 py-2 m-0 list-none text-[13px] text-text-muted flex flex-col gap-0.5",children:s.options.map(f=>d.jsxs("li",{children:[d.jsxs("span",{className:"font-mono text-text",children:["[",f.key,"]"]})," ",f.label," ",d.jsxs("span",{children:["— ",f.description]})]},f.key))}),d.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-2 border-t hairline",children:[s.options.map((f,p)=>f.key==="r"?null:i(f,p)),d.jsx("span",{className:"flex-1"}),c>=0&&i(s.options[c],c)]})]})}function op({p:s,onRespond:o,alreadyConfigured:l=!1}){const[i,c]=Y.useState(s.models[0]?.name??""),[f,p]=Y.useState(!!s.workspacePath&&!l),h=i.trim().length>0,y=s.hasActiveSession?`Signed in to ${s.providerDisplayName}. Switch this session to it? (currently ${[s.currentProvider,s.currentModel].filter(Boolean).join(" / ")})`:`Signed in to ${s.providerDisplayName}. Open a session with it?`;return d.jsxs(Nt,{edge:"steel",className:"my-3",role:"group","aria-label":"Post-auth setup",children:[d.jsxs("div",{className:"px-3.5 py-2.5 border-b hairline flex items-baseline gap-3",children:[d.jsx("span",{className:"kicker",children:"Signed in"}),d.jsx("span",{className:"text-[15px]",children:y})]}),d.jsxs("form",{className:"px-3.5 py-3 space-y-3 text-sm",onSubmit:_=>{_.preventDefault(),h&&o({connect:!0,modelName:i.trim(),persistEnv:f})},children:[d.jsxs("label",{className:"block max-w-md",children:[d.jsx("span",{className:"field-label",children:"Model"}),s.models.length>0?d.jsxs("select",{"aria-label":"Model",value:i,onChange:_=>c(_.target.value),className:"input input-mono",children:[s.models.map(_=>d.jsxs("option",{value:_.name,children:[_.name,_.description?` — ${_.description}`:""]},_.name)),d.jsx("option",{value:"",children:"other…"})]}):null,(s.models.length===0||i==="")&&d.jsx("input",{"aria-label":"Model name",value:i,onChange:_=>c(_.target.value),placeholder:"model name",className:"input input-mono mt-1"})]}),s.workspacePath&&!l&&d.jsxs("label",{className:"flex items-center gap-2 text-xs text-text-muted",children:[d.jsx("input",{type:"checkbox",checked:f,onChange:_=>p(_.target.checked)}),"Save provider and model to ",d.jsxs("span",{className:"font-mono",children:[s.workspacePath,"/.env"]})]}),d.jsxs("div",{className:"flex gap-2 pt-1",children:[d.jsx("button",{type:"submit",disabled:!h,className:"btn btn-primary",children:s.hasActiveSession?"Switch":"Open session"}),d.jsx("button",{type:"button",onClick:()=>o({connect:!1}),className:"btn btn-quiet",children:"Not now"})]})]})]})}function Yx({c:s,onAnswer:o,onCancel:l}){const i=s.questions[s.index],c=s.questions.length||s.index+1;return d.jsxs(Nt,{edge:"steel",className:"my-3",role:"group","aria-label":"Clarification",children:[d.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3 border-b hairline",children:[d.jsx("span",{className:"text-steel",children:"?"}),d.jsx("span",{className:"kicker",children:"The agent needs clarification"}),d.jsx("span",{className:"flex-1"}),d.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:[s.index+1,"/",c,s.toolName?` · ${s.toolName}`:""]})]}),s.context&&s.index===0&&d.jsx("div",{className:"px-3.5 pt-2.5 text-[13px] text-text-muted whitespace-pre-wrap",children:s.context}),d.jsx("div",{className:"px-3.5 py-2.5 text-[15px] whitespace-pre-wrap",children:i?.question_text??(s.inputMode?"Please answer in the box below.":"Waiting for the question…")}),i&&B_(i)&&d.jsxs("div",{className:"px-3.5 pb-1.5 text-[12px] text-text-muted",children:["Pick one or more: click a choice, or type the numbers comma-separated (e.g. ",d.jsx("kbd",{children:"1,3"}),")."]}),i?.options&&i.options.length>0&&d.jsx("div",{className:"px-3.5 pb-3 flex flex-wrap gap-2",children:i.options.map((f,p)=>d.jsxs("button",{type:"button",onClick:()=>o(String(p+1)),className:`btn btn-md normal-case tracking-normal font-sans font-normal text-left ${i.default===p+1?"btn-steel":""}`,children:[d.jsx("span",{className:"font-mono text-[11px] text-steel",children:p+1}),f,i.default===p+1&&d.jsx("span",{className:"text-text-muted text-xs",children:"(default)"}),i.expects_attachment?.[p]&&d.jsx("span",{className:"text-text-muted",title:"This choice expects you to attach a file",children:"📎"})]},p))}),d.jsxs("div",{className:"px-3.5 py-2 border-t hairline text-[12px] text-text-muted flex gap-4",children:[i&&d.jsx("span",{children:i.optional?"optional (Enter on empty skips)":"required"}),i?.default!=null&&d.jsxs("span",{children:["default: ",d.jsx("kbd",{children:String(i.default)})," (Enter on empty)"]}),d.jsx("span",{className:"flex-1"}),d.jsx("button",{type:"button",className:"link",onClick:l,children:"cancel"})]})]})}function Qx({r:s,onRespond:o}){return d.jsxs(Nt,{edge:"steel",className:"my-3",role:"group","aria-label":"Reference selection",children:[d.jsxs("div",{className:"px-3.5 py-2.5 border-b hairline flex items-baseline gap-3",children:[d.jsx("span",{className:"kicker",children:"Reference"}),d.jsx("span",{className:"text-[15px]",children:s.prompt})]}),d.jsx("div",{className:"px-3.5 py-3 flex flex-wrap gap-2",children:s.options.map((l,i)=>d.jsx("button",{type:"button",onClick:()=>o(l),className:"btn btn-md normal-case tracking-normal font-mono font-normal",children:l},i))})]})}const up={pending:["○","text-text-muted"],in_progress:["◐","text-primary"],active:["◐","text-primary"],completed:["●","text-success"],done:["●","text-success"],failed:["✗","text-error"],skipped:["–","text-warning"],cancelled:["–","text-warning"],blocked:["⊘","text-warning"]};function Vx(s){if(!s)return null;const o=s.steps.length;return`${s.steps.filter(i=>i.status==="completed"||i.status==="done").length}/${o}`}function Xx({agentId:s}){const o=L(c=>c.plan[s]);if(!o)return d.jsx("div",{className:"px-3.5 py-3 text-xs text-text-muted italic",children:"No plan yet."});const l=o.steps.length,i=o.steps.filter(c=>c.status==="completed"||c.status==="done").length;return d.jsxs("div",{className:"px-3.5 py-3 text-[13.5px]",children:[d.jsx("div",{className:"display text-[16px] mb-2",children:o.name}),d.jsx("div",{className:"bar mb-2.5",children:d.jsx("span",{className:"bg-success",style:{width:l?`${i/l*100}%`:0}})}),d.jsx("ol",{className:"space-y-1.5 list-none m-0 p-0",children:[...o.steps].sort((c,f)=>(c.sequence??0)-(f.sequence??0)).map((c,f)=>{const[p,h]=up[c.status??"pending"]??up.pending;return d.jsxs("li",{className:"flex gap-2.5",children:[d.jsx("span",{className:`${h} w-3 shrink-0`,children:p}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:c.status==="in_progress"||c.status==="active"?"font-medium":c.status==="completed"||c.status==="done"?"text-text-muted":"",children:c.content}),c.result&&d.jsxs("div",{className:"text-xs text-success/80 whitespace-pre-wrap",children:["↳ ",c.result]}),c.error&&d.jsxs("div",{className:"text-xs text-error/90 whitespace-pre-wrap",children:["↳ ",c.error]}),c.blocked_by&&c.blocked_by.length>0&&d.jsxs("div",{className:"text-xs text-warning",children:["blocked by ",c.blocked_by.join(", ")]})]})]},c.step_id??f)})})]})}function cn(s){return s==null?"–":s>=1e6?(s/1e6).toFixed(2)+"M":s>=1e4?(s/1e3).toFixed(1)+"k":String(s)}function Kx({agentId:s}){const o=L(f=>f.context[s]);if(!o)return d.jsx("div",{className:"px-3.5 py-3 text-xs text-text-muted italic",children:"No usage reported yet."});const l=o.percentUsed??(o.contextLimit&&o.usage.total_tokens?o.usage.total_tokens/o.contextLimit*100:null),i=o.usage,c=[["prompt",cn(i.prompt_tokens)],["output",cn(i.output_tokens)],["cache read",cn(i.cache_read_tokens)],["cache write",cn(i.cache_creation_tokens)],["reasoning",cn(i.reasoning_tokens??i.thinking_tokens)],["total / limit",`${cn(i.total_tokens)} / ${cn(o.contextLimit)}`],["remaining",cn(o.tokensRemaining)],["turns",cn(o.turns)]];return i.cost_usd!=null&&c.push(["cost",`$${Number(i.cost_usd).toFixed(4)}`]),d.jsxs("div",{className:"px-3.5 py-3 text-[13px]",children:[d.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[d.jsx("span",{className:"display text-[16px]",children:"Context"}),d.jsx("span",{className:"font-mono text-[11px] text-text-muted",children:l!=null?`${l.toFixed(1)}%`:""})]}),d.jsx("div",{className:"bar mb-3",children:d.jsx("span",{className:l!=null&&l>80?"bg-error":l!=null&&l>60?"bg-warning":"",style:{width:`${Math.min(100,l??0)}%`}})}),d.jsx("dl",{className:"kv m-0",children:c.map(([f,p])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{children:f}),d.jsx("dd",{className:"m-0",children:p})]},f))}),o.lastTurn&&d.jsxs("div",{className:"mt-3 text-xs text-text-muted",children:["Last turn",o.lastTurn.turnNumber!=null?` #${o.lastTurn.turnNumber}`:"",": ",o.lastTurn.durationSeconds!=null?`${o.lastTurn.durationSeconds.toFixed(1)}s`:"",o.lastTurn.toolCalls?` · ${Y_(o.lastTurn.toolCalls)}`:"",o.lastTurn.finishReason?` · ${o.lastTurn.finishReason}`:""]})]})}function Ix(s){const o={name:"",path:"",children:new Map};for(const[l,i]of Object.entries(s)){const c=l.split("/").filter(Boolean);let f=o;c.forEach((p,h)=>{let y=f.children.get(p);y||(y={name:p,path:c.slice(0,h+1).join("/"),children:new Map},f.children.set(p,y)),h===c.length-1&&(y.change=i),f=y})}return o}function $x(s){return s.children.size?`${s.path}/`:s.path}function qp(s,o){return o.some(l=>l===s||l.endsWith("/")&&s.startsWith(l))}function Zx(s,o){return Object.keys(s).filter(l=>qp(l,o)).length}const Jx={created:"text-success",added:"text-success",modified:"text-warning",deleted:"text-error"};function Wx({id:s,hidden:o,ignored:l}){const i=L(f=>f.toggleWorkspaceHidden),c="font-heading uppercase tracking-[0.08em] text-[10px] px-1 text-text-muted hover:text-steel opacity-60 group-hover:opacity-100 focus:opacity-100";return d.jsxs("span",{className:"ml-auto shrink-0 flex gap-1",children:[d.jsx("button",{type:"button",className:c,onClick:()=>i(s),"aria-label":`${o?"Unhide":"Hide"} ${s}`,title:o?"Show this entry again":"Hide this entry from the panel (this session only)",children:o?"unhide":"hide"}),d.jsx("button",{type:"button",className:c,onClick:()=>{jb(s).catch(()=>{})},"aria-label":`${l?"Remove":"Add"} ${s} ${l?"from":"to"} .gitignore`,title:l?"Remove this entry from the workspace .gitignore":"Add this entry to the workspace .gitignore",children:l?"unignore":"ignore"})]})}function Hp({node:s,depth:o,hidden:l,showHidden:i,ignored:c}){const f=[...s.children.values()].sort((p,h)=>(p.children.size?0:1)-(h.children.size?0:1)||p.name.localeCompare(h.name));return d.jsx("ul",{className:"list-none m-0 p-0",children:f.map(p=>{const h=$x(p),y=p.children.size>0,_=qp(h,l);if(_&&!i)return null;const b=y?d.jsxs("span",{className:"text-text-muted",children:["▾ ",p.name,"/"]}):d.jsxs("span",{className:Jx[p.change??""]??"",title:p.change,children:[p.change==="deleted"?"−":p.change==="created"||p.change==="added"?"+":"~"," ",p.name]});return d.jsxs("li",{className:"font-mono text-[11.5px] leading-[1.8]",children:[d.jsxs("div",{className:`group flex items-center gap-1 pr-1 ${_?"opacity-50":""}`,style:{paddingLeft:o*12},"data-hidden":_||void 0,children:[_&&d.jsx("span",{className:"text-text-muted",title:"Hidden",children:"H"}),b,c[h]&&d.jsx("span",{className:"text-text-muted text-[10px]",title:"In .gitignore",children:"i"}),d.jsx(Wx,{id:h,hidden:_,ignored:c[h]})]}),y&&d.jsx(Hp,{node:p,depth:o+1,hidden:l,showHidden:i,ignored:c})]},p.path)})})}function Fx(){const s=L(_=>_.workspaceFiles),o=L(_=>_.workspaceHidden),l=L(_=>_.workspaceShowHidden),i=L(_=>_.toggleWorkspaceShowHidden),c=L(_=>_.workspaceIgnored),f=L(_=>_.workspaceNotice),p=Y.useMemo(()=>Ix(s),[s]),h=Object.keys(s).length,y=Y.useMemo(()=>Zx(s,o),[s,o]);return d.jsxs("div",{className:"px-3.5 py-3",children:[f&&d.jsx("div",{role:"status",className:`text-[11px] mb-2 ${f.error?"text-error":"text-text-muted"}`,children:f.text}),h===0?d.jsx("div",{className:"text-xs text-text-muted italic",children:"No files changed yet."}):d.jsx(Hp,{node:p,depth:0,hidden:o,showHidden:l,ignored:c}),y>0&&d.jsxs("div",{className:"mt-2 text-[11px] text-text-muted flex items-center gap-2",children:[d.jsxs("span",{children:[y," hidden"]}),d.jsx("button",{type:"button",className:"link",onClick:i,children:l?"hide hidden":"show hidden"})]}),h>0&&d.jsxs("div",{className:"mt-2.5 text-xs text-text-muted",children:[d.jsx("span",{className:"font-heading uppercase tracking-[0.08em] text-[10px]",children:"hide"})," drops an entry from the panel; ",d.jsx("span",{className:"font-heading uppercase tracking-[0.08em] text-[10px]",children:"ignore"})," adds it to ",d.jsx("span",{className:"font-mono",children:".gitignore"}),"."]})]})}const tu={processing:["●","text-primary pulse"],running:["●","text-primary pulse"],awaiting_permission:["⚠","text-warning"],awaiting_clarification:["?","text-steel"],finished:["✓","text-text-muted"],completed:["✓","text-text-muted"],error:["✗","text-error"],idle:["○","text-text-muted"]};function Px(){const s=L(f=>f.agents),o=L(f=>f.agentOrder),l=L(f=>f.selectedAgentId),i=L(f=>f.selectAgent),c=L(f=>f.permissions);return d.jsx("div",{role:"tablist",className:"flex items-stretch overflow-x-auto",title:"Ctrl+A selects the next agent",children:o.map(f=>{const p=s[f];if(!p)return null;const h=c.some(S=>S.agentId===f),[y,_]=h?tu.awaiting_permission:tu[p.status]??tu.idle,b=f===l;return d.jsxs("button",{role:"tab","aria-selected":b,onClick:()=>i(f),className:`flex items-center gap-2 px-3.5 border-r hairline whitespace-nowrap ${b?`bg-surface text-text shadow-[inset_0_-2px_0_var(--c-steel)] ${h?"shadow-[inset_0_-2px_0_var(--c-warning)]":""}`:"text-text-muted hover:text-text"}`,title:p.profile?`${p.type} · ${p.profile}`:p.type,children:[d.jsx("span",{className:_,children:y}),d.jsx("span",{className:`chrome ${b?"":"font-medium"}`,children:p.name})]},f)})})}function e0(){const s=L(_=>_.connection),o=L(_=>_.sessionId),l=L(_=>_.permissionStatus),i=L(_=>_.permissions.length),c=L(_=>_.toggleUi),f=L(_=>_.setToolsExpanded),p=L(_=>_.ui),h=s.phase==="connected"?"bg-success":s.phase==="reconnecting"||s.phase==="connecting"?"bg-warning pulse":"bg-error",y=_=>`chrome-sm font-heading font-medium uppercase tracking-[0.12em] ${_?"text-steel":"text-text-muted hover:text-steel"}`;return d.jsxs("div",{className:"flex items-center gap-4 px-4 h-[26px] text-[11px] bg-surface border-t hairline font-mono text-text-muted select-none shrink-0",children:[d.jsxs("span",{className:"flex items-center gap-1.5 text-text",children:[d.jsx("span",{className:`inline-block w-1.5 h-1.5 ${h}`}),s.phase,s.attempt?` #${s.attempt}`:""]}),d.jsxs("span",{title:wp(),children:[s.serverVersion?`server ${s.serverVersion} · `:"","ui ",Ka.ui]}),o&&d.jsxs("span",{title:o,children:["session ",o.slice(0,8)]}),l&&d.jsxs("span",{title:"Permission default policy (permissions default allow|deny|ask)","data-testid":"permission-status",className:i?"text-warning":"",children:[d.jsx("span",{children:"permissions "}),l.suspensionScope?d.jsxs("span",{className:"text-success",children:["allow ",d.jsxs("span",{className:"text-text-muted",children:["(",l.suspensionScope,")"]})]}):d.jsx("span",{className:i?"":l.effectiveDefault==="deny"?"text-warning":l.effectiveDefault==="allow"?"text-success":"text-text",children:l.effectiveDefault}),i>0&&d.jsxs("span",{children:[" · ",i," waiting"]})]}),d.jsx("span",{className:"flex-1"}),d.jsx("button",{type:"button",onClick:()=>c("showPlan"),className:y(p.showPlan),title:"Toggle plan (Ctrl+P)","aria-label":"Toggle plan (Ctrl+P)",children:"Plan"}),d.jsx("button",{type:"button",onClick:()=>c("showBudget"),className:y(p.showBudget),title:"Toggle budget (Ctrl+B)","aria-label":"Toggle budget (Ctrl+B)",children:"Budget"}),d.jsx("button",{type:"button",onClick:()=>c("showWorkspace"),className:y(p.showWorkspace),title:"Toggle workspace changes (Alt+W)","aria-label":"Toggle workspace changes (Alt+W)",children:"Files"}),d.jsx("button",{type:"button",onClick:()=>f(!p.showTools),className:y(p.showTools),title:p.showTools?"Tool call boxes expanded — click to collapse them (Ctrl+T)":"Tool call boxes collapsed — click to expand them (Ctrl+T)","aria-label":"Toggle tool call boxes (Ctrl+T)",children:"Tools"}),d.jsx("button",{type:"button",onClick:()=>{kp().catch(()=>{})},className:`${y(!1)} hover:text-error`,title:"Leave: detach from the session, or end it (the exit command)","aria-label":"Exit (detach from or end the session)",children:"Exit"})]})}function t0(){const s=L(h=>h.ui.railWidth),o=L(h=>h.setRailWidth),l=Y.useRef(null),i=Y.useCallback(h=>{h.button!==0&&h.pointerType==="mouse"||(l.current={startX:h.clientX,startW:s},h.currentTarget.setPointerCapture(h.pointerId),h.preventDefault())},[s]),c=Y.useCallback(h=>{const y=l.current;y&&o(y.startW+(y.startX-h.clientX))},[o]),f=Y.useCallback(h=>{l.current=null;try{h.currentTarget.releasePointerCapture(h.pointerId)}catch{}},[]),p=Y.useCallback(h=>{const y=h.shiftKey?64:16;h.key==="ArrowLeft"?(o(s+y),h.preventDefault()):h.key==="ArrowRight"?(o(s-y),h.preventDefault()):h.key==="Home"?(o(su),h.preventDefault()):h.key==="End"&&(o(lu),h.preventDefault())},[o,s]);return d.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize the session rail","aria-valuemin":lu,"aria-valuemax":su,"aria-valuenow":s,tabIndex:0,title:"Drag to resize the rail",className:"hidden md:block shrink-0 w-[7px] -mr-[4px] -ml-[3px] z-10 cursor-col-resize select-none outline-none hover:bg-steel/40 focus-visible:bg-steel/60 active:bg-steel/60",style:{touchAction:"none"},onPointerDown:i,onPointerMove:c,onPointerUp:f,onPointerCancel:f,onKeyDown:p})}function n0(){Y.useEffect(()=>{const s=o=>{const l=o.key.toLowerCase(),i=o.ctrlKey||o.metaKey,c=L.getState();if(i&&l==="p")o.preventDefault(),c.toggleUi("showPlan");else if(i&&l==="b")o.preventDefault(),c.toggleUi("showBudget");else if((i||o.altKey)&&l==="w"&&(o.altKey||o.shiftKey))o.preventDefault(),c.toggleUi("showWorkspace");else if(i&&l==="t")o.preventDefault(),c.setToolsExpanded(!c.ui.showTools);else if(i&&l==="a"&&!o.target?.matches?.("textarea,input")){o.preventDefault();const f=c.agentOrder.indexOf(c.selectedAgentId);c.selectAgent(c.agentOrder[(f+1)%c.agentOrder.length]??c.selectedAgentId)}else i&&l==="c"&&!o.target?.matches?.("textarea,input")&&!window.getSelection()?.toString()&&Zl()&&c.processing[c.selectedAgentId]&&(o.preventDefault(),De().stop().catch(()=>{}))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[])}function a0(){const s=L(p=>p.session),o=L(p=>p.workspace.selected),l=L(p=>p.selectedAgentId),c=L(p=>p.context[l])?.percentUsed,f=[s.provider,s.model].filter(Boolean).join(" / ");return d.jsxs("header",{className:"flex items-stretch h-[46px] border-b hairline shrink-0",children:[d.jsx("div",{className:"flex items-center px-4 border-r hairline",children:d.jsx("span",{className:"display text-[18px] tracking-[0.02em]",children:"jaato"})}),d.jsx(Px,{}),d.jsx("span",{className:"flex-1"}),d.jsxs("div",{className:"hidden md:flex items-center gap-[18px] px-[18px] font-mono text-xs",children:[o&&d.jsxs("span",{children:[d.jsx("span",{className:"text-text-muted",children:"ws "}),o]}),f&&d.jsxs("span",{children:[d.jsx("span",{className:"text-text-muted",children:"model "}),f]}),s.profile&&d.jsxs("span",{children:[d.jsx("span",{className:"text-text-muted",children:"profile "}),s.profile]}),c!=null&&d.jsxs("span",{className:"flex items-center gap-2",title:"Context window used",children:[d.jsx("span",{className:"text-text-muted",children:"ctx"}),d.jsx("span",{className:"inline-block w-[84px] h-1.5 bg-[color-mix(in_srgb,var(--c-text)_16%,var(--c-bg))]",children:d.jsx("span",{className:`block h-full ${c>80?"bg-error":c>60?"bg-warning":"bg-steel"}`,style:{width:`${Math.min(100,c)}%`}})}),d.jsxs("span",{className:c>80?"text-error":c>60?"text-warning":"",children:[c.toFixed(0),"%"]})]})]})]})}function nu({title:s,value:o,open:l,onToggle:i,children:c}){return d.jsxs(d.Fragment,{children:[d.jsxs("button",{type:"button",onClick:i,className:"flex items-baseline justify-between px-3.5 py-2 border-b hairline w-full text-left hover:bg-tint/60","aria-expanded":l,"aria-label":`${l?"Close":"Open"} ${s}`,children:[d.jsx("span",{className:"kicker",children:s}),d.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:[o?`${o} `:"",l?"▾":"▸"]})]}),l&&d.jsx("section",{"aria-label":s,className:"border-b hairline overflow-auto min-h-0 shrink-0 max-h-[60%]",children:c})]})}function l0({agentId:s}){const o=L(h=>h.ui),l=L(h=>h.toggleUi),i=L(h=>h.plan[s]),c=L(h=>h.context[s]),f=L(h=>Object.keys(h.workspaceFiles).length),p=c?.usage.cost_usd!=null?`$${Number(c.usage.cost_usd).toFixed(4)}`:c?.percentUsed!=null?`${c.percentUsed.toFixed(0)}%`:null;return d.jsxs("aside",{className:"hidden md:flex shrink-0 border-l hairline bg-surface flex-col min-h-0 overflow-auto",style:{width:o.railWidth},"aria-label":"Session rail",children:[d.jsx(nu,{title:"Plan",value:Vx(i),open:o.showPlan,onToggle:()=>l("showPlan"),children:d.jsx(Xx,{agentId:s})}),d.jsx(nu,{title:"Budget",value:p,open:o.showBudget,onToggle:()=>l("showBudget"),children:d.jsx(Kx,{agentId:s})}),d.jsx(nu,{title:"Files",value:f?`${f} changed`:null,open:o.showWorkspace,onToggle:()=>l("showWorkspace"),children:d.jsx(Fx,{})})]})}function s0(s){return s.filter(o=>/-auth$/.test(o.name)&&!o.name.includes(" "))}function i0({onPick:s,onAttach:o,onAuth:l,onSkip:i}){const c=L(M=>M.profiles),f=L(M=>M.commands),p=L(M=>M.workspace),h=L(M=>M.sessions);Y.useEffect(()=>{Mp().catch(()=>{})},[]);const y=s0(f),_=p.selected?p.list.find(M=>M.name===p.selected)??{name:p.selected}:void 0,b=p.config&&p.config.workspace===p.selected?p.config:void 0,S=b?.configured===!0,N=[b?.provider,b?.model].filter(Boolean).join(" / "),R=_?I_(h,_):h,B="flex gap-3 py-2.5 border-t hairline w-full text-left hover:bg-tint/60";return d.jsx("div",{className:"h-full flex items-center justify-center p-6 sm:p-12 overflow-auto",children:d.jsxs(Nt,{className:"w-full max-w-[880px] flex flex-col","data-testid":"session-picker",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-5 py-4 border-b hairline",children:[d.jsx("div",{className:"flex items-baseline gap-3",children:_?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"kicker tracking-[0.16em]",children:"Workspace"}),d.jsx("span",{className:"font-mono text-[16px]",children:_.name})]}):d.jsx("span",{className:"display text-[20px]",children:"New session"})}),S&&d.jsxs("div",{className:"font-mono text-xs text-text-muted",children:[N," ",d.jsx("span",{className:"text-steel",children:"from .env"})]})]}),d.jsxs("div",{className:`grid grid-cols-1 ${R.length>0?"md:grid-cols-[1fr_1px_1fr]":""}`,children:[R.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-2.5","aria-label":"Resume a session",children:[d.jsx("div",{className:"kicker kicker-muted text-[12px]",children:"Resume"}),d.jsx("div",{className:"flex flex-col max-h-72 overflow-auto",children:R.map(M=>d.jsxs("button",{type:"button",onClick:()=>o(M.id),"aria-label":`Resume session ${M.id}`,className:B,children:[d.jsx("span",{className:M.isLoaded?"text-success":"text-text-muted",children:M.isLoaded?"●":"○"}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block font-mono text-[13px]",children:M.id}),d.jsx("span",{className:"block text-[13px] text-text-muted truncate",children:[M.description||M.name,M.provider?`${M.provider}/${M.model}`:"",M.turnCount?`${M.turnCount} turns`:""].filter(Boolean).join(" · ")})]}),d.jsx("span",{className:`btn btn-sm self-center ${M.isLoaded?"btn-steel":"btn-quiet"}`,children:"Attach"})]},M.id))})]}),d.jsx("div",{className:"hidden md:block bg-divider","aria-hidden":"true"})]}),d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-2.5",children:[d.jsx("div",{className:"kicker kicker-muted text-[12px]",children:R.length>0?"Start new — agent profile":"Agent profile"}),d.jsxs("div",{className:"flex flex-col max-h-80 overflow-auto",children:[d.jsxs("button",{type:"button",onClick:()=>s(null),className:B,children:[d.jsx("span",{className:"font-mono text-[11px] text-steel w-[22px] shrink-0 pt-0.5",children:"01"}),d.jsxs("span",{className:"min-w-0",children:[d.jsx("span",{className:"block font-mono text-[13px]",children:"default"}),d.jsx("span",{className:"block text-[13px] text-text-muted",children:S?N:"the workspace .env provider and model"})]})]}),c.map((M,V)=>d.jsxs("button",{type:"button",onClick:()=>s(M.name),className:B,children:[d.jsx("span",{className:"font-mono text-[11px] text-steel w-[22px] shrink-0 pt-0.5",children:String(V+2).padStart(2,"0")}),d.jsxs("span",{className:"min-w-0",children:[d.jsx("span",{className:"block font-mono text-[13px]",children:M.name}),d.jsx("span",{className:"block text-[13px] text-text-muted",children:[M.description,[M.provider,M.model].filter(Boolean).join("/")].filter(Boolean).join(" · ")})]})]},M.name))]})]})]}),d.jsxs("div",{className:"px-5 pt-3 border-t hairline","aria-label":"Files for the session",children:[d.jsx("div",{className:"kicker kicker-muted text-[12px] mb-1.5",children:"Files for the session"}),d.jsx(Lp,{always:!0,hint:_?"Staged into this workspace before the session opens.":"Staged into the session's workspace as soon as it is provisioned."})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3 border-t hairline",children:[y.length>0&&!S&&d.jsxs("div",{className:"flex flex-wrap items-center gap-3","aria-label":"Sign in to a provider",children:[d.jsx("span",{className:"kicker kicker-muted",children:"Sign in first"}),y.map(M=>d.jsxs("button",{type:"button",onClick:()=>l(`${M.name} login`),className:"font-mono text-xs border hairline px-2 py-1 hover:border-steel hover:text-steel",title:M.description,children:[M.name," login"]},M.name)),d.jsx("span",{className:"text-[12px] text-text-muted",children:"No provider configured yet? Sign in first; the daemon then offers to open the session for you."})]}),d.jsx("span",{className:"flex-1"}),d.jsx("button",{type:"button",onClick:i,className:"link text-[13px]",children:"Go to the prompt without a session"})]})]})})}function r0(){n0();const s=L(G=>G.sessionId),o=L(G=>G.selectedAgentId),l=L(G=>G.commands),i=L(G=>G.initProgress),c=L(G=>G.permissions),f=L(G=>G.exitChoice),p=L(G=>G.clarifications),h=L(G=>G.referenceSelections),y=L(G=>G.postAuth),_=L(G=>G.workspace.config),b=L(G=>G.processing[o]??!1),[S,N]=Y.useState(!0),[R,B]=Y.useState(!1),M=Y.useRef(!1);Y.useEffect(()=>{if(M.current)return;M.current=!0;const G=De();return G.requestCommandList().catch(()=>{}),G.listProfiles().catch(()=>{}),G.subscribe(q.COMMAND_LIST_REFRESH,()=>{G.requestCommandList().catch(()=>{})})},[]);const V=async G=>{N(!1),B(!0);try{const ie=De();await ip(()=>ie.createSession(G?{profile:G}:{}))}finally{B(!1)}},K=c.filter(G=>G.agentId===o),ee=p.filter(G=>G.agentId===o),ne=h.filter(G=>G.agentId===o),I=Y.useMemo(()=>{if(f)return{kind:"exit",placeholder:`Exit: ${f.options.map(te=>te.key).join(" · ")}`,suggestions:f.options.map(te=>te.key)};const G=K[0];return G?{kind:"permission",placeholder:`Answer ${G.toolName} — ${G.options.map(te=>te.key).join(" · ")||"y · n"}, or type a reply`,suggestions:G.options.map(te=>te.key)}:ee.find(te=>te.inputMode)?{kind:"clarification",placeholder:"Type your answer (or a choice number) and press Enter"}:ne[0]?{kind:"reference",placeholder:"Type the reference to use"}:null},[f,K,ee,ne]),W=G=>{N(!1),Pm(G,!1).catch(ie=>L.getState().addSystemBlock(o,String(ie),"error"))},de=G=>{N(!1),ip(()=>Dp(G)).catch(ie=>L.getState().addSystemBlock(o,String(ie),"error"))},Z=!!(y&&_?.configured&&_.provider===y.providerName),le=y?d.jsx("div",{className:"px-5",children:d.jsx(op,{p:y,alreadyConfigured:Z,onRespond:G=>{Fm(y.requestId,G).catch(ie=>L.getState().addSystemBlock(o,String(ie),"error"))}})}):null;return S&&!s?d.jsxs("div",{className:"h-full flex flex-col",children:[le,d.jsx("div",{className:"flex-1 min-h-0",children:d.jsx(i0,{onPick:V,onAttach:de,onAuth:W,onSkip:()=>N(!1)})})]}):d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsx(a0,{}),d.jsxs("div",{className:"flex-1 flex min-h-0",children:[d.jsxs("main",{className:"flex-1 flex flex-col min-w-0 relative",children:[(R||i)&&d.jsxs("div",{className:"px-5 py-1 kicker kicker-muted border-b hairline flex items-center gap-2",children:[d.jsx("span",{className:"pulse text-primary",children:"●"}),i?`${i.message??i.step??"initialising"}${i.stepNumber!=null&&i.totalSteps?` (${i.stepNumber}/${i.totalSteps})`:""}`:"Creating session…"]}),d.jsx(Rx,{agentId:o}),d.jsxs("div",{className:"px-5",children:[f&&d.jsx(Gx,{x:f,onAnswer:G=>{Ap(G).catch(ie=>L.getState().addSystemBlock(o,String(ie),"error"))}}),K.map(G=>d.jsx(Bx,{p:G,onRespond:ie=>jp(G.requestId,ie)},G.requestId)),ee.map(G=>d.jsx(Yx,{c:G,onAnswer:ie=>Op(G,ie),onCancel:()=>Cp(G)},G.requestId)),ne.map(G=>d.jsx(Qx,{r:G,onRespond:ie=>Rp(G.requestId,ie)},G.requestId)),y&&o==="main"&&d.jsx(op,{p:y,alreadyConfigured:Z,onRespond:G=>{Fm(y.requestId,G).catch(ie=>L.getState().addSystemBlock(o,String(ie),"error"))}})]}),d.jsxs("div",{className:"px-5 pb-3 pt-2.5 border-t hairline",children:[b&&!I&&d.jsxs("div",{className:"kicker kicker-muted text-[12px] tracking-[0.1em] mb-1.5 flex items-center gap-2",children:[d.jsx("span",{className:"pulse text-primary",children:"●"})," Agent working — type to queue a follow-up · ",d.jsx("span",{className:"font-mono normal-case tracking-normal",children:"stop"})," or Ctrl+C to interrupt"]}),d.jsx(Hx,{commands:l,history:Xa,captureMode:I,onSubmit:(G,ie)=>{Pm(G,ie).catch(te=>L.getState().addSystemBlock(o,String(te),"error"))}})]}),d.jsx(Mx,{agentId:o})]}),d.jsx(t0,{}),d.jsx(l0,{agentId:o})]}),d.jsx(e0,{})]})}function o0(){const s=L(i=>i.screen),o=L(i=>i.ui.theme),l=L(i=>i.setTheme);return Y.useEffect(()=>{l(Vy())},[l]),Y.useEffect(()=>{vp(o)},[o]),s==="connect"?d.jsx(ub,{}):s==="workspaces"?d.jsx(zb,{}):d.jsx(r0,{})}y_.createRoot(document.getElementById("root")).render(d.jsx(Y.StrictMode,{children:d.jsx(o0,{})}));
|