@i14ks/ccv 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +17 -5
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-BdWXIyBE.js → codemirror-DglS7E7o.js} +1 -1
  4. package/web/assets/{index-BaGoVOX2.js → index-B7uHyVeh.js} +1 -1
  5. package/web/assets/{index-Ca8CvnGG.js → index-BNQZ2BuM.js} +1 -1
  6. package/web/assets/{index-BysIpqtT.js → index-BSaDKcqT.js} +1 -1
  7. package/web/assets/{index-ZxlYmRHu.js → index-Bih5aV96.js} +1 -1
  8. package/web/assets/index-C9WU34g2.js +143 -0
  9. package/web/assets/{index-LJAvSv-o.js → index-CPPpWH9N.js} +1 -1
  10. package/web/assets/{index-CZ1qVXcb.js → index-CcSS0C_9.js} +1 -1
  11. package/web/assets/{index-D6yXt8v4.js → index-CcpjbDSq.js} +1 -1
  12. package/web/assets/{index-CfeCkS4B.js → index-CqPccRdt.js} +1 -1
  13. package/web/assets/{index-CyKzgfHd.js → index-CqVjAuXU.js} +1 -1
  14. package/web/assets/{index-CaiMt4h0.js → index-DXX0TArC.js} +1 -1
  15. package/web/assets/{index-BVZbJUdX.js → index-DaU2VyoE.js} +1 -1
  16. package/web/assets/{index-CHPLX3RU.css → index-DqlIDpi-.css} +1 -1
  17. package/web/assets/{index-CtJMqb_5.js → index-FOPyupKM.js} +1 -1
  18. package/web/assets/{index-BPJrlUj_.js → index-Sh9NP70k.js} +1 -1
  19. package/web/assets/{index-BrHQ2TSw.js → index-Ztgcimr5.js} +1 -1
  20. package/web/assets/{index-BdM-YzrJ.js → index-Zvy894-d.js} +1 -1
  21. package/web/assets/{index-C5zvd-WO.js → index-dIZtAfJR.js} +1 -1
  22. package/web/assets/{index-BUQkCY8p.js → index-g04_R-k1.js} +1 -1
  23. package/web/assets/{index-At4SIHW8.js → index-kNeFvnz8.js} +1 -1
  24. package/web/assets/{index-B2LO0l57.js → index-qU9Ojf7M.js} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-Dm1yPdNn.js +0 -143
@@ -0,0 +1,143 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CcpjbDSq.js","./index-Zvy894-d.js","./index-Bih5aV96.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-FOPyupKM.js","./index-DXX0TArC.js","./index-qU9Ojf7M.js","./index-Sh9NP70k.js","./index-CcSS0C_9.js","./index-Ztgcimr5.js","./index-CPPpWH9N.js","./index-DaU2VyoE.js","./index-B7uHyVeh.js","./index-dIZtAfJR.js","./index-kNeFvnz8.js","./index-BSaDKcqT.js","./index-BNQZ2BuM.js","./index-g04_R-k1.js","./index-CqVjAuXU.js","./index-CqPccRdt.js","./codemirror-DglS7E7o.js","./xterm-D6Mng-DB.js","./_commonjsHelpers-CqkleIqs.js","./addon-fit-CevVMrUA.js","./addon-web-links-CnB65OV_.js","./xterm-DYP7pi_n.css"])))=>i.map(i=>d[i]);
2
+ var F0=Object.defineProperty;var Kx=n=>{throw TypeError(n)};var P0=(n,s,i)=>s in n?F0(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i;var Jt=(n,s,i)=>P0(n,typeof s!="symbol"?s+"":s,i),Jh=(n,s,i)=>s.has(n)||Kx("Cannot "+i);var nt=(n,s,i)=>(Jh(n,s,"read from private field"),i?i.call(n):s.get(n)),Tn=(n,s,i)=>s.has(n)?Kx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(n):s.set(n,i),Bt=(n,s,i,c)=>(Jh(n,s,"write to private field"),c?c.call(n,i):s.set(n,i),i),$n=(n,s,i)=>(Jh(n,s,"access private method"),i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function c(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();var Wh={exports:{}},su={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Zx;function J0(){if(Zx)return su;Zx=1;var n=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function i(c,o,u){var h=null;if(u!==void 0&&(h=""+u),o.key!==void 0&&(h=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:u}}return su.Fragment=s,su.jsx=i,su.jsxs=i,su}var Fx;function W0(){return Fx||(Fx=1,Wh.exports=J0()),Wh.exports}var a=W0(),ep={exports:{}},ct={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var Px;function ev(){if(Px)return ct;Px=1;var n=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function S(C){return C===null||typeof C!="object"?null:(C=y&&C[y]||C["@@iterator"],typeof C=="function"?C:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,D={};function q(C,K,de){this.props=C,this.context=K,this.refs=D,this.updater=de||k}q.prototype.isReactComponent={},q.prototype.setState=function(C,K){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,K,"setState")},q.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function G(){}G.prototype=q.prototype;function Q(C,K,de){this.props=C,this.context=K,this.refs=D,this.updater=de||k}var z=Q.prototype=new G;z.constructor=Q,A(z,q.prototype),z.isPureReactComponent=!0;var $=Array.isArray;function E(){}var I={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function H(C,K,de){var _e=de.ref;return{$$typeof:n,type:C,key:K,ref:_e!==void 0?_e:null,props:de}}function B(C,K){return H(C.type,K,C.props)}function O(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function W(C){var K={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(de){return K[de]})}var he=/\/+/g;function je(C,K){return typeof C=="object"&&C!==null&&C.key!=null?W(""+C.key):K.toString(36)}function we(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(E,E):(C.status="pending",C.then(function(K){C.status==="pending"&&(C.status="fulfilled",C.value=K)},function(K){C.status==="pending"&&(C.status="rejected",C.reason=K)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function M(C,K,de,_e,Ae){var ze=typeof C;(ze==="undefined"||ze==="boolean")&&(C=null);var be=!1;if(C===null)be=!0;else switch(ze){case"bigint":case"string":case"number":be=!0;break;case"object":switch(C.$$typeof){case n:case s:be=!0;break;case _:return be=C._init,M(be(C._payload),K,de,_e,Ae)}}if(be)return Ae=Ae(C),be=_e===""?"."+je(C,0):_e,$(Ae)?(de="",be!=null&&(de=be.replace(he,"$&/")+"/"),M(Ae,K,de,"",function(Mt){return Mt})):Ae!=null&&(O(Ae)&&(Ae=B(Ae,de+(Ae.key==null||C&&C.key===Ae.key?"":(""+Ae.key).replace(he,"$&/")+"/")+be)),K.push(Ae)),1;be=0;var Ge=_e===""?".":_e+":";if($(C))for(var lt=0;lt<C.length;lt++)_e=C[lt],ze=Ge+je(_e,lt),be+=M(_e,K,de,ze,Ae);else if(lt=S(C),typeof lt=="function")for(C=lt.call(C),lt=0;!(_e=C.next()).done;)_e=_e.value,ze=Ge+je(_e,lt++),be+=M(_e,K,de,ze,Ae);else if(ze==="object"){if(typeof C.then=="function")return M(we(C),K,de,_e,Ae);throw K=String(C),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return be}function N(C,K,de){if(C==null)return C;var _e=[],Ae=0;return M(C,_e,"","",function(ze){return K.call(de,ze,Ae++)}),_e}function V(C){if(C._status===-1){var K=C._result;K=K(),K.then(function(de){(C._status===0||C._status===-1)&&(C._status=1,C._result=de)},function(de){(C._status===0||C._status===-1)&&(C._status=2,C._result=de)}),C._status===-1&&(C._status=0,C._result=K)}if(C._status===1)return C._result.default;throw C._result}var ae=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ke={map:N,forEach:function(C,K,de){N(C,function(){K.apply(this,arguments)},de)},count:function(C){var K=0;return N(C,function(){K++}),K},toArray:function(C){return N(C,function(K){return K})||[]},only:function(C){if(!O(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return ct.Activity=v,ct.Children=ke,ct.Component=q,ct.Fragment=i,ct.Profiler=o,ct.PureComponent=Q,ct.StrictMode=c,ct.Suspense=g,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,ct.__COMPILER_RUNTIME={__proto__:null,c:function(C){return I.H.useMemoCache(C)}},ct.cache=function(C){return function(){return C.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(C,K,de){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var _e=A({},C.props),Ae=C.key;if(K!=null)for(ze in K.key!==void 0&&(Ae=""+K.key),K)!X.call(K,ze)||ze==="key"||ze==="__self"||ze==="__source"||ze==="ref"&&K.ref===void 0||(_e[ze]=K[ze]);var ze=arguments.length-2;if(ze===1)_e.children=de;else if(1<ze){for(var be=Array(ze),Ge=0;Ge<ze;Ge++)be[Ge]=arguments[Ge+2];_e.children=be}return H(C.type,Ae,_e)},ct.createContext=function(C){return C={$$typeof:h,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},ct.createElement=function(C,K,de){var _e,Ae={},ze=null;if(K!=null)for(_e in K.key!==void 0&&(ze=""+K.key),K)X.call(K,_e)&&_e!=="key"&&_e!=="__self"&&_e!=="__source"&&(Ae[_e]=K[_e]);var be=arguments.length-2;if(be===1)Ae.children=de;else if(1<be){for(var Ge=Array(be),lt=0;lt<be;lt++)Ge[lt]=arguments[lt+2];Ae.children=Ge}if(C&&C.defaultProps)for(_e in be=C.defaultProps,be)Ae[_e]===void 0&&(Ae[_e]=be[_e]);return H(C,ze,Ae)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(C){return{$$typeof:m,render:C}},ct.isValidElement=O,ct.lazy=function(C){return{$$typeof:_,_payload:{_status:-1,_result:C},_init:V}},ct.memo=function(C,K){return{$$typeof:x,type:C,compare:K===void 0?null:K}},ct.startTransition=function(C){var K=I.T,de={};I.T=de;try{var _e=C(),Ae=I.S;Ae!==null&&Ae(de,_e),typeof _e=="object"&&_e!==null&&typeof _e.then=="function"&&_e.then(E,ae)}catch(ze){ae(ze)}finally{K!==null&&de.types!==null&&(K.types=de.types),I.T=K}},ct.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},ct.use=function(C){return I.H.use(C)},ct.useActionState=function(C,K,de){return I.H.useActionState(C,K,de)},ct.useCallback=function(C,K){return I.H.useCallback(C,K)},ct.useContext=function(C){return I.H.useContext(C)},ct.useDebugValue=function(){},ct.useDeferredValue=function(C,K){return I.H.useDeferredValue(C,K)},ct.useEffect=function(C,K){return I.H.useEffect(C,K)},ct.useEffectEvent=function(C){return I.H.useEffectEvent(C)},ct.useId=function(){return I.H.useId()},ct.useImperativeHandle=function(C,K,de){return I.H.useImperativeHandle(C,K,de)},ct.useInsertionEffect=function(C,K){return I.H.useInsertionEffect(C,K)},ct.useLayoutEffect=function(C,K){return I.H.useLayoutEffect(C,K)},ct.useMemo=function(C,K){return I.H.useMemo(C,K)},ct.useOptimistic=function(C,K){return I.H.useOptimistic(C,K)},ct.useReducer=function(C,K,de){return I.H.useReducer(C,K,de)},ct.useRef=function(C){return I.H.useRef(C)},ct.useState=function(C){return I.H.useState(C)},ct.useSyncExternalStore=function(C,K,de){return I.H.useSyncExternalStore(C,K,de)},ct.useTransition=function(){return I.H.useTransition()},ct.version="19.2.8",ct}var Jx;function qp(){return Jx||(Jx=1,ep.exports=ev()),ep.exports}var b=qp(),tp={exports:{}},lu={},np={exports:{}},sp={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Wx;function tv(){return Wx||(Wx=1,(function(n){function s(M,N){var V=M.length;M.push(N);e:for(;0<V;){var ae=V-1>>>1,ke=M[ae];if(0<o(ke,N))M[ae]=N,M[V]=ke,V=ae;else break e}}function i(M){return M.length===0?null:M[0]}function c(M){if(M.length===0)return null;var N=M[0],V=M.pop();if(V!==N){M[0]=V;e:for(var ae=0,ke=M.length,C=ke>>>1;ae<C;){var K=2*(ae+1)-1,de=M[K],_e=K+1,Ae=M[_e];if(0>o(de,V))_e<ke&&0>o(Ae,de)?(M[ae]=Ae,M[_e]=V,ae=_e):(M[ae]=de,M[K]=V,ae=K);else if(_e<ke&&0>o(Ae,V))M[ae]=Ae,M[_e]=V,ae=_e;else break e}}return N}function o(M,N){var V=M.sortIndex-N.sortIndex;return V!==0?V:M.id-N.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var g=[],x=[],_=1,v=null,y=3,S=!1,k=!1,A=!1,D=!1,q=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function z(M){for(var N=i(x);N!==null;){if(N.callback===null)c(x);else if(N.startTime<=M)c(x),N.sortIndex=N.expirationTime,s(g,N);else break;N=i(x)}}function $(M){if(A=!1,z(M),!k)if(i(g)!==null)k=!0,E||(E=!0,W());else{var N=i(x);N!==null&&we($,N.startTime-M)}}var E=!1,I=-1,X=5,H=-1;function B(){return D?!0:!(n.unstable_now()-H<X)}function O(){if(D=!1,E){var M=n.unstable_now();H=M;var N=!0;try{e:{k=!1,A&&(A=!1,G(I),I=-1),S=!0;var V=y;try{t:{for(z(M),v=i(g);v!==null&&!(v.expirationTime>M&&B());){var ae=v.callback;if(typeof ae=="function"){v.callback=null,y=v.priorityLevel;var ke=ae(v.expirationTime<=M);if(M=n.unstable_now(),typeof ke=="function"){v.callback=ke,z(M),N=!0;break t}v===i(g)&&c(g),z(M)}else c(g);v=i(g)}if(v!==null)N=!0;else{var C=i(x);C!==null&&we($,C.startTime-M),N=!1}}break e}finally{v=null,y=V,S=!1}N=void 0}}finally{N?W():E=!1}}}var W;if(typeof Q=="function")W=function(){Q(O)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,je=he.port2;he.port1.onmessage=O,W=function(){je.postMessage(null)}}else W=function(){q(O,0)};function we(M,N){I=q(function(){M(n.unstable_now())},N)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(M){switch(y){case 1:case 2:case 3:var N=3;break;default:N=y}var V=y;y=N;try{return M()}finally{y=V}},n.unstable_requestPaint=function(){D=!0},n.unstable_runWithPriority=function(M,N){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var V=y;y=M;try{return N()}finally{y=V}},n.unstable_scheduleCallback=function(M,N,V){var ae=n.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ae+V:ae):V=ae,M){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=V+ke,M={id:_++,callback:N,priorityLevel:M,startTime:V,expirationTime:ke,sortIndex:-1},V>ae?(M.sortIndex=V,s(x,M),i(g)===null&&M===i(x)&&(A?(G(I),I=-1):A=!0,we($,V-ae))):(M.sortIndex=ke,s(g,M),k||S||(k=!0,E||(E=!0,W()))),M},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(M){var N=y;return function(){var V=y;y=N;try{return M.apply(this,arguments)}finally{y=V}}}})(sp)),sp}var eb;function nv(){return eb||(eb=1,np.exports=tv()),np.exports}var lp={exports:{}},ks={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var tb;function sv(){if(tb)return ks;tb=1;var n=qp();function s(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var c={d:{f:i,r:function(){throw Error(s(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,x,_){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:g,containerInfo:x,implementation:_}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return ks.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ks.createPortal=function(g,x){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(s(299));return u(g,x,null,_)},ks.flushSync=function(g){var x=h.T,_=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=_,c.d.f()}},ks.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(g,x))},ks.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},ks.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var _=x.as,v=m(_,x.crossOrigin),y=typeof x.integrity=="string"?x.integrity:void 0,S=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:S}):_==="script"&&c.d.X(g,{crossOrigin:v,integrity:y,fetchPriority:S,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},ks.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=m(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(g)},ks.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,v=m(_,x.crossOrigin);c.d.L(g,_,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},ks.preloadModule=function(g,x){if(typeof g=="string")if(x){var _=m(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},ks.requestFormReset=function(g){c.d.r(g)},ks.unstable_batchedUpdates=function(g,x){return g(x)},ks.useFormState=function(g,x,_){return h.H.useFormState(g,x,_)},ks.useFormStatus=function(){return h.H.useHostTransitionStatus()},ks.version="19.2.8",ks}var nb;function T_(){if(nb)return lp.exports;nb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),lp.exports=sv(),lp.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var sb;function lv(){if(sb)return lu;sb=1;var n=nv(),s=qp(),i=T_();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(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 m(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 g(e){if(u(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(c(188));return t!==e?null:e}for(var l=e,r=t;;){var d=l.return;if(d===null)break;var f=d.alternate;if(f===null){if(r=d.return,r!==null){l=r;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===l)return g(d),e;if(f===r)return g(d),t;f=f.sibling}throw Error(c(188))}if(l.return!==r.return)l=d,r=f;else{for(var j=!1,w=d.child;w;){if(w===l){j=!0,l=d,r=f;break}if(w===r){j=!0,r=d,l=f;break}w=w.sibling}if(!j){for(w=f.child;w;){if(w===l){j=!0,l=f,r=d;break}if(w===r){j=!0,r=f,l=d;break}w=w.sibling}if(!j)throw Error(c(189))}}if(l.alternate!==r)throw Error(c(190))}if(l.tag!==3)throw Error(c(188));return l.stateNode.current===l?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),O=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=O&&e[O]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case q:return"Profiler";case D:return"StrictMode";case $:return"Suspense";case E:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case Q:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var we=Array.isArray,M=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},ae=[],ke=-1;function C(e){return{current:e}}function K(e){0>ke||(e.current=ae[ke],ae[ke]=null,ke--)}function de(e,t){ke++,ae[ke]=e.current,e.current=t}var _e=C(null),Ae=C(null),ze=C(null),be=C(null);function Ge(e,t){switch(de(ze,t),de(Ae,e),de(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xx(t),e=bx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(_e),de(_e,e)}function lt(){K(_e),K(Ae),K(ze)}function Mt(e){e.memoizedState!==null&&de(be,e);var t=_e.current,l=bx(t,e.type);t!==l&&(de(Ae,e),de(_e,l))}function fe(e){Ae.current===e&&(K(_e),K(Ae)),be.current===e&&(K(be),Wo._currentValue=V)}var at,oe;function Rt(e){if(at===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);at=t&&t[1]||"",oe=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+at+e+oe}var Be=!1;function qt(e,t){if(!e||Be)return"";Be=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ie){var se=ie}Reflect.construct(e,[],xe)}else{try{xe.call()}catch(ie){se=ie}e.call(xe.prototype)}}else{try{throw Error()}catch(ie){se=ie}(xe=e())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ie){if(ie&&se&&typeof ie.stack=="string")return[ie.stack,se.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=r.DetermineComponentFrameRoot(),j=f[0],w=f[1];if(j&&w){var U=j.split(`
45
+ `),te=w.split(`
46
+ `);for(d=r=0;r<U.length&&!U[r].includes("DetermineComponentFrameRoot");)r++;for(;d<te.length&&!te[d].includes("DetermineComponentFrameRoot");)d++;if(r===U.length||d===te.length)for(r=U.length-1,d=te.length-1;1<=r&&0<=d&&U[r]!==te[d];)d--;for(;1<=r&&0<=d;r--,d--)if(U[r]!==te[d]){if(r!==1||d!==1)do if(r--,d--,0>d||U[r]!==te[d]){var ue=`
47
+ `+U[r].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=r&&0<=d);break}}}finally{Be=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Rt(l):""}function Hn(e,t){switch(e.tag){case 26:case 27:case 5:return Rt(e.type);case 16:return Rt("Lazy");case 13:return e.child!==t&&t!==null?Rt("Suspense Fallback"):Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 15:return qt(e.type,!1);case 11:return qt(e.type.render,!1);case 1:return qt(e.type,!0);case 31:return Rt("Activity");default:return""}}function xt(e){try{var t="",l=null;do t+=Hn(e,l),l=e,e=e.return;while(e);return t}catch(r){return`
48
+ Error generating stack: `+r.message+`
49
+ `+r.stack}}var Kt=Object.prototype.hasOwnProperty,an=n.unstable_scheduleCallback,Vn=n.unstable_cancelCallback,jt=n.unstable_shouldYield,Z=n.unstable_requestPaint,Oe=n.unstable_now,Ye=n.unstable_getCurrentPriorityLevel,ut=n.unstable_ImmediatePriority,Ee=n.unstable_UserBlockingPriority,Te=n.unstable_NormalPriority,Me=n.unstable_LowPriority,Ve=n.unstable_IdlePriority,Ke=n.log,Pe=n.unstable_setDisableYieldValue,dt=null,Ct=null;function Cn(e){if(typeof Ke=="function"&&Pe(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(dt,e)}catch{}}var St=Math.clz32?Math.clz32:Ne,Lt=Math.log,re=Math.LN2;function Ne(e){return e>>>=0,e===0?32:31-(Lt(e)/re|0)|0}var Xe=256,We=262144,tt=4194304;function on(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 On(e,t,l){var r=e.pendingLanes;if(r===0)return 0;var d=0,f=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~f,r!==0?d=on(r):(j&=w,j!==0?d=on(j):l||(l=w&~e,l!==0&&(d=on(l))))):(w=r&~f,w!==0?d=on(w):j!==0?d=on(j):l||(l=r&~e,l!==0&&(d=on(l)))),d===0?0:t!==0&&t!==d&&(t&f)===0&&(f=d&-d,l=t&-t,f>=l||f===32&&(l&4194048)!==0)?t:d}function Wt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bn(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 Yt(){var e=tt;return tt<<=1,(tt&62914560)===0&&(tt=4194304),e}function zt(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function P(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pe(e,t,l,r,d,f){var j=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var w=e.entanglements,U=e.expirationTimes,te=e.hiddenUpdates;for(l=j&~l;0<l;){var ue=31-St(l),xe=1<<ue;w[ue]=0,U[ue]=-1;var se=te[ue];if(se!==null)for(te[ue]=null,ue=0;ue<se.length;ue++){var ie=se[ue];ie!==null&&(ie.lane&=-536870913)}l&=~xe}r!==0&&Re(e,r,0),f!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=f&~(j&~t))}function Re(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-St(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|l&261930}function Ze(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var r=31-St(l),d=1<<r;d&t|e[r]&t&&(e[r]|=t),l&=~d}}function It(e,t){var l=t&-t;return l=(l&42)!==0?1:rn(l),(l&(e.suspendedLanes|t))!==0?0:l}function rn(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 wt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function xs(){var e=N.p;return e!==0?e:(e=window.event,e===void 0?32:qx(e.type))}function Xn(e,t){var l=N.p;try{return N.p=e,t()}finally{N.p=l}}var ls=Math.random().toString(36).slice(2),cn="__reactFiber$"+ls,it="__reactProps$"+ls,un="__reactContainer$"+ls,Es="__reactEvents$"+ls,Ts="__reactListeners$"+ls,Cs="__reactHandles$"+ls,Hs="__reactResources$"+ls,as="__reactMarker$"+ls;function As(e){delete e[cn],delete e[it],delete e[Es],delete e[Ts],delete e[Cs]}function Zt(e){var t=e[cn];if(t)return t;for(var l=e.parentNode;l;){if(t=l[un]||l[cn]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Nx(e);e!==null;){if(l=e[cn])return l;e=Nx(e)}return t}e=l,l=e.parentNode}return null}function Bs(e){if(e=e[cn]||e[un]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _n(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function yn(e){var t=e[Hs];return t||(t=e[Hs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function st(e){e[as]=!0}var Pn=new Set,Qn={};function is(e,t){dn(e,t),dn(e+"Capture",t)}function dn(e,t){for(Qn[e]=t,e=0;e<t.length;e++)Pn.add(t[e])}var fl=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]*$"),Ms={},rs={};function Rs(e){return Kt.call(rs,e)?!0:Kt.call(Ms,e)?!1:fl.test(e)?rs[e]=!0:(Ms[e]=!0,!1)}function En(e,t,l){if(Rs(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Ln(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Bn(e,t,l,r){if(r===null)e.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+r)}}function en(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ni(e,t,l){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var d=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){l=""+j,f.call(this,j)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jl(e){if(!e._valueTracker){var t=Nl(e)?"checked":"value";e._valueTracker=ni(e,t,""+e[t])}}function An(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),r="";return e&&(r=Nl(e)?e.checked?"true":"false":e.value),e=r,e!==l?(t.setValue(e),!0):!1}function Sl(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 El=/[\n"\\]/g;function Jn(e){return e.replace(El,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tl(e,t,l,r,d,f,j,w){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+en(t)):e.value!==""+en(t)&&(e.value=""+en(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?qs(e,j,en(t)):l!=null?qs(e,j,en(l)):r!=null&&e.removeAttribute("value"),d==null&&f!=null&&(e.defaultChecked=!!f),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+en(w):e.removeAttribute("name")}function Wl(e,t,l,r,d,f,j,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||l!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Jl(e);return}l=l!=null?""+en(l):"",t=t!=null?""+en(t):l,w||t===e.value||(e.value=t),e.defaultValue=t}r=r??d,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=w?e.checked:!!r,e.defaultChecked=!!r,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),Jl(e)}function qs(e,t,l){t==="number"&&Sl(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function vn(e,t,l,r){if(e=e.options,t){t={};for(var d=0;d<l.length;d++)t["$"+l[d]]=!0;for(l=0;l<e.length;l++)d=t.hasOwnProperty("$"+e[l].value),e[l].selected!==d&&(e[l].selected=d),d&&r&&(e[l].defaultSelected=!0)}else{for(l=""+en(l),t=null,d=0;d<e.length;d++){if(e[d].value===l){e[d].selected=!0,r&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Se(e,t,l){if(t!=null&&(t=""+en(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+en(l):""}function R(e,t,l,r){if(t==null){if(r!=null){if(l!=null)throw Error(c(92));if(we(r)){if(1<r.length)throw Error(c(93));r=r[0]}l=r}l==null&&(l=""),t=l}l=en(t),e.defaultValue=l,r=e.textContent,r===l&&r!==""&&r!==null&&(e.value=r),Jl(e)}function J(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var ye=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 Ce(e,t,l){var r=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,l):typeof l!="number"||l===0||ye.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Qe(e,t,l){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var d in t)r=t[d],t.hasOwnProperty(d)&&l[d]!==r&&Ce(e,d,r)}else for(var f in t)t.hasOwnProperty(f)&&Ce(e,f,t[f])}function Je(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 Vt=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"]]),mt=/^[\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 tn(e){return mt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rt(){}var At=null;function fn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nl=null,Gs=null;function Ji(e){var t=Bs(e);if(t&&(e=t.stateNode)){var l=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(Tl(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Jn(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var r=l[t];if(r!==e&&r.form===e.form){var d=r[it]||null;if(!d)throw Error(c(90));Tl(r,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<l.length;t++)r=l[t],r.form===e.form&&An(r)}break e;case"textarea":Se(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&vn(e,!!l.multiple,t,!1)}}}var Cl=!1;function si(e,t,l){if(Cl)return e(t,l);Cl=!0;try{var r=e(t);return r}finally{if(Cl=!1,(nl!==null||Gs!==null)&&(ud(),nl&&(t=nl,e=Gs,Gs=nl=null,Ji(t),e)))for(t=0;t<e.length;t++)Ji(e[t])}}function jn(e,t){var l=e.stateNode;if(l===null)return null;var r=l[it]||null;if(r===null)return null;l=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(c(231,t,typeof l));return l}var bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wn=!1;if(bs)try{var hl={};Object.defineProperty(hl,"passive",{get:function(){Wn=!0}}),window.addEventListener("test",hl,hl),window.removeEventListener("test",hl,hl)}catch{Wn=!1}var T=null,ge=null,He=null;function bt(){if(He)return He;var e,t=ge,l=t.length,r,d="value"in T?T.value:T.textContent,f=d.length;for(e=0;e<l&&t[e]===d[e];e++);var j=l-e;for(r=1;r<=j&&t[l-r]===d[f-r];r++);return He=d.slice(e,1<r?1-r:void 0)}function _s(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 $r(){return!0}function Wi(){return!1}function ys(e){function t(l,r,d,f,j){this._reactName=l,this._targetInst=d,this.type=r,this.nativeEvent=f,this.target=j,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(l=e[w],this[w]=l?l(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?$r:Wi,this.isPropagationStopped=Wi,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=$r)},persist:function(){},isPersistent:$r}),t}var Al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yr=ys(Al),ea=v({},Al,{view:0,detail:0}),$s=ys(ea),ta,Ml,Rl,Ta=v({},ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:li,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!==Rl&&(Rl&&e.type==="mousemove"?(ta=e.screenX-Rl.screenX,Ml=e.screenY-Rl.screenY):Ml=ta=0,Rl=e),ta)},movementY:function(e){return"movementY"in e?e.movementY:Ml}}),er=ys(Ta),Ca=v({},Ta,{dataTransfer:0}),sl=ys(Ca),Vr=v({},ea,{relatedTarget:0}),Dl=ys(Vr),jf=v({},Al,{animationName:0,elapsedTime:0,pseudoElement:0}),na=ys(jf),tr=v({},Al,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xr=ys(tr),nr=v({},Al,{data:0}),sr=ys(nr),wf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},to={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"},Qr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mu(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qr[e])?!!t[e]:!1}function li(){return Mu}var Ru=v({},ea,{key:function(e){if(e.key){var t=wf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?to[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:li,charCode:function(e){return e.type==="keypress"?_s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ai=ys(Ru),ii=v({},Ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Du=ys(ii),no=v({},ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:li}),Kr=ys(no),so=v({},Al,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ou=ys(so),Zr=v({},Ta,{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}),Fr=ys(Zr),lo=v({},Al,{newState:0,oldState:0}),Pr=ys(lo),lr=[9,13,27,32],ao=bs&&"CompositionEvent"in window,sa=null;bs&&"documentMode"in document&&(sa=document.documentMode);var kf=bs&&"TextEvent"in window&&!sa,ar=bs&&(!ao||sa&&8<sa&&11>=sa),ir=" ",Jr=!1;function ri(e,t){switch(e){case"keyup":return lr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function la(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ol=!1;function io(e,t){switch(e){case"compositionend":return la(t);case"keypress":return t.which!==32?null:(Jr=!0,ir);case"textInput":return e=t.data,e===ir&&Jr?null:e;default:return null}}function Nf(e,t){if(Ol)return e==="compositionend"||!ao&&ri(e,t)?(e=bt(),He=ge=T=null,Ol=!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 ar&&t.locale!=="ko"?null:t.data;default:return null}}var aa={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 ia(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!aa[e.type]:t==="textarea"}function ro(e,t,l,r){nl?Gs?Gs.push(r):Gs=[r]:nl=r,t=xd(t,"onChange"),0<t.length&&(l=new Yr("onChange","change",null,l,r),e.push({event:l,listeners:t}))}var ra=null,ci=null;function Wr(e){dx(e,0)}function Ys(e){var t=_n(e);if(An(t))return e}function rr(e,t){if(e==="change")return t}var oi=!1;if(bs){var Ll;if(bs){var Aa="oninput"in document;if(!Aa){var hn=document.createElement("div");hn.setAttribute("oninput","return;"),Aa=typeof hn.oninput=="function"}Ll=Aa}else Ll=!1;oi=Ll&&(!document.documentMode||9<document.documentMode)}function cr(){ra&&(ra.detachEvent("onpropertychange",zl),ci=ra=null)}function zl(e){if(e.propertyName==="value"&&Ys(ci)){var t=[];ro(t,ci,e,fn(e)),si(Wr,t)}}function Sf(e,t,l){e==="focusin"?(cr(),ra=t,ci=l,ra.attachEvent("onpropertychange",zl)):e==="focusout"&&cr()}function ec(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ys(ci)}function co(e,t){if(e==="click")return Ys(t)}function Ef(e,t){if(e==="input"||e==="change")return Ys(t)}function Tf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var es=typeof Object.is=="function"?Object.is:Tf;function pl(e,t){if(es(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),r=Object.keys(t);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var d=l[r];if(!Kt.call(t,d)||!es(e[d],t[d]))return!1}return!0}function zn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function or(e,t){var l=zn(e);e=0;for(var r;l;){if(l.nodeType===3){if(r=e+l.textContent.length,e<=t&&r>=t)return{node:l,offset:t-e};e=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zn(l)}}function ur(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ur(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Sl(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Sl(e.document)}return t}function Mn(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 Lu=bs&&"documentMode"in document&&11>=document.documentMode,Ma=null,ll=null,ui=null,di=!1;function dr(e,t,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;di||Ma==null||Ma!==Sl(r)||(r=Ma,"selectionStart"in r&&Mn(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ui&&pl(ui,r)||(ui=r,r=xd(ll,"onSelect"),0<r.length&&(t=new Yr("onSelect","select",null,t,l),e.push({event:t,listeners:r}),t.target=Ma)))}function al(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Vs={animationend:al("Animation","AnimationEnd"),animationiteration:al("Animation","AnimationIteration"),animationstart:al("Animation","AnimationStart"),transitionrun:al("Transition","TransitionRun"),transitionstart:al("Transition","TransitionStart"),transitioncancel:al("Transition","TransitionCancel"),transitionend:al("Transition","TransitionEnd")},tc={},fi={};bs&&(fi=document.createElement("div").style,"AnimationEvent"in window||(delete Vs.animationend.animation,delete Vs.animationiteration.animation,delete Vs.animationstart.animation),"TransitionEvent"in window||delete Vs.transitionend.transition);function ml(e){if(tc[e])return tc[e];if(!Vs[e])return e;var t=Vs[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in fi)return tc[e]=t[l];return e}var hi=ml("animationend"),pi=ml("animationiteration"),uo=ml("animationstart"),fr=ml("transitionrun"),Cf=ml("transitionstart"),nc=ml("transitioncancel"),fo=ml("transitionend"),ne=new Map,Ra="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(" ");Ra.push("scrollEnd");function cs(e,t){ne.set(e,t),is(t,[e])}var ho=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)},vs=[],mi=0,po=0;function sc(){for(var e=mi,t=po=mi=0;t<e;){var l=vs[t];vs[t++]=null;var r=vs[t];vs[t++]=null;var d=vs[t];vs[t++]=null;var f=vs[t];if(vs[t++]=null,r!==null&&d!==null){var j=r.pending;j===null?d.next=d:(d.next=j.next,j.next=d),r.pending=d}f!==0&&zu(l,d,f)}}function lc(e,t,l,r){vs[mi++]=e,vs[mi++]=t,vs[mi++]=l,vs[mi++]=r,po|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function mo(e,t,l,r){return lc(e,t,l,r),ac(e)}function il(e,t){return lc(e,null,null,t),ac(e)}function zu(e,t,l){e.lanes|=l;var r=e.alternate;r!==null&&(r.lanes|=l);for(var d=!1,f=e.return;f!==null;)f.childLanes|=l,r=f.alternate,r!==null&&(r.childLanes|=l),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(d=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,d&&t!==null&&(d=31-St(l),e=f.hiddenUpdates,r=e[d],r===null?e[d]=[t]:r.push(t),t.lane=l|536870912),f):null}function ac(e){if(50<Xo)throw Xo=0,jh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var gi={};function Af(e,t,l,r){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ds(e,t,l,r){return new Af(e,t,l,r)}function go(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Il(e,t){var l=e.alternate;return l===null?(l=Ds(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Iu(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ul(e,t,l,r,d,f){var j=0;if(r=e,typeof e=="function")go(e)&&(j=1);else if(typeof e=="string")j=U0(e,l,_e.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=Ds(31,l,t,d),e.elementType=H,e.lanes=f,e;case A:return gl(l.children,d,f,t);case D:j=8,d|=24;break;case q:return e=Ds(12,l,t,d|2),e.elementType=q,e.lanes=f,e;case $:return e=Ds(13,l,t,d),e.elementType=$,e.lanes=f,e;case E:return e=Ds(19,l,t,d),e.elementType=E,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:j=10;break e;case G:j=9;break e;case z:j=11;break e;case I:j=14;break e;case X:j=16,r=null;break e}j=29,l=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=Ds(j,l,t,d),t.elementType=e,t.type=r,t.lanes=f,t}function gl(e,t,l,r){return e=Ds(7,e,r,t),e.lanes=l,e}function ic(e,t,l){return e=Ds(6,e,null,t),e.lanes=l,e}function Uu(e){var t=Ds(18,null,null,0);return t.stateNode=e,t}function rc(e,t,l){return t=Ds(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xo=new WeakMap;function js(e,t){if(typeof e=="object"&&e!==null){var l=xo.get(e);return l!==void 0?l:(t={value:e,source:t,stack:xt(t)},xo.set(e,t),t)}return{value:e,source:t,stack:xt(t)}}var ca=[],xi=0,bi=null,hr=0,Xs=[],Os=0,oa=null,Qs=1,rl="";function Hl(e,t){ca[xi++]=hr,ca[xi++]=bi,bi=e,hr=t}function bo(e,t,l){Xs[Os++]=Qs,Xs[Os++]=rl,Xs[Os++]=oa,oa=e;var r=Qs;e=rl;var d=32-St(r)-1;r&=~(1<<d),l+=1;var f=32-St(t)+d;if(30<f){var j=d-d%5;f=(r&(1<<j)-1).toString(32),r>>=j,d-=j,Qs=1<<32-St(t)+d|l<<d|r,rl=f+e}else Qs=1<<f|l<<d|r,rl=e}function _o(e){e.return!==null&&(Hl(e,1),bo(e,1,0))}function yo(e){for(;e===bi;)bi=ca[--xi],ca[xi]=null,hr=ca[--xi],ca[xi]=null;for(;e===oa;)oa=Xs[--Os],Xs[Os]=null,rl=Xs[--Os],Xs[Os]=null,Qs=Xs[--Os],Xs[Os]=null}function Hu(e,t){Xs[Os++]=Qs,Xs[Os++]=rl,Xs[Os++]=oa,Qs=t.id,rl=t.overflow,oa=e}var In=null,nn=null,ft=!1,xl=null,os=!1,vo=Error(c(519));function ua(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr(js(t,e)),vo}function Bu(e){var t=e.stateNode,l=e.type,r=e.memoizedProps;switch(t[cn]=e,t[it]=r,l){case"dialog":vt("cancel",t),vt("close",t);break;case"iframe":case"object":case"embed":vt("load",t);break;case"video":case"audio":for(l=0;l<Ko.length;l++)vt(Ko[l],t);break;case"source":vt("error",t);break;case"img":case"image":case"link":vt("error",t),vt("load",t);break;case"details":vt("toggle",t);break;case"input":vt("invalid",t),Wl(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":vt("invalid",t);break;case"textarea":vt("invalid",t),R(t,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||r.suppressHydrationWarning===!0||mx(t.textContent,l)?(r.popover!=null&&(vt("beforetoggle",t),vt("toggle",t)),r.onScroll!=null&&vt("scroll",t),r.onScrollEnd!=null&&vt("scrollend",t),r.onClick!=null&&(t.onclick=rt),t=!0):t=!1,t||ua(e,!0)}function _i(e){for(In=e.return;In;)switch(In.tag){case 5:case 31:case 13:os=!1;return;case 27:case 3:os=!0;return;default:In=In.return}}function Da(e){if(e!==In)return!1;if(!ft)return _i(e),ft=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Ih(e.type,e.memoizedProps)),l=!l),l&&nn&&ua(e),_i(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));nn=kx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));nn=kx(e)}else t===27?(t=nn,Oi(e.type)?(e=Gh,Gh=null,nn=e):nn=t):nn=In?yl(e.stateNode.nextSibling):null;return!0}function Oa(){nn=In=null,ft=!1}function cc(){var e=xl;return e!==null&&(Ws===null?Ws=e:Ws.push.apply(Ws,e),xl=null),e}function pr(e){xl===null?xl=[e]:xl.push(e)}var jo=C(null),La=null,Bl=null;function da(e,t,l){de(jo,t._currentValue),t._currentValue=l}function ql(e){e._currentValue=jo.current,K(jo)}function wo(e,t,l){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===l)break;e=e.return}}function ko(e,t,l,r){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var f=d.dependencies;if(f!==null){var j=d.child;f=f.firstContext;e:for(;f!==null;){var w=f;f=d;for(var U=0;U<t.length;U++)if(w.context===t[U]){f.lanes|=l,w=f.alternate,w!==null&&(w.lanes|=l),wo(f.return,l,e),r||(j=null);break e}f=w.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(c(341));j.lanes|=l,f=j.alternate,f!==null&&(f.lanes|=l),wo(j,l,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function yi(e,t,l,r){e=null;for(var d=t,f=!1;d!==null;){if(!f){if((d.flags&524288)!==0)f=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(c(387));if(j=j.memoizedProps,j!==null){var w=d.type;es(d.pendingProps.value,j.value)||(e!==null?e.push(w):e=[w])}}else if(d===be.current){if(j=d.alternate,j===null)throw Error(c(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Wo):e=[Wo])}d=d.return}e!==null&&ko(t,e,l,r),t.flags|=262144}function oc(e){for(e=e.firstContext;e!==null;){if(!es(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function za(e){La=e,Bl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kn(e){return qu(La,e)}function uc(e,t){return La===null&&za(e),qu(e,t)}function qu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Bl===null){if(e===null)throw Error(c(308));Bl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bl=Bl.next=t;return l}var Mf=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Rf=n.unstable_scheduleCallback,No=n.unstable_NormalPriority,wn={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vi(){return{controller:new Mf,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&Rf(No,function(){e.controller.abort()})}var gr=null,So=0,ji=0,wi=null;function Df(e,t){if(gr===null){var l=gr=[];So=0,ji=Th(),wi={status:"pending",value:void 0,then:function(r){l.push(r)}}}return So++,t.then(Gu,Gu),t}function Gu(){if(--So===0&&gr!==null){wi!==null&&(wi.status="fulfilled");var e=gr;gr=null,ji=0,wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Of(e,t){var l=[],r={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var d=0;d<l.length;d++)(0,l[d])(t)},function(d){for(r.status="rejected",r.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),r}var $u=M.S;M.S=function(e,t){Hg=Oe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Df(e,t),$u!==null&&$u(e,t)};var Ia=C(null);function Eo(){var e=Ia.current;return e!==null?e:sn.pooledCache}function dc(e,t){t===null?de(Ia,Ia.current):de(Ia,t.pool)}function Yu(){var e=Eo();return e===null?null:{parent:wn._currentValue,pool:e}}var ki=Error(c(460)),To=Error(c(474)),bl=Error(c(542)),Ks={then:function(){}};function Gl(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(rt,rt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xr(e),e;default:if(typeof t.status=="string")t.then(rt,rt);else{if(e=sn,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=r}},function(r){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xr(e),e}throw Ni=t,ki}}function Ua(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ni=l,ki):l}}var Ni=null;function Co(){if(Ni===null)throw Error(c(459));var e=Ni;return Ni=null,e}function xr(e){if(e===ki||e===bl)throw Error(c(483))}var Ha=null,br=0;function fa(e){var t=br;return br+=1,Ha===null&&(Ha=[]),Vu(Ha,e,t)}function Si(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fc(e,t){throw t.$$typeof===y?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function hc(e){function t(F,Y){if(e){var ee=F.deletions;ee===null?(F.deletions=[Y],F.flags|=16):ee.push(Y)}}function l(F,Y){if(!e)return null;for(;Y!==null;)t(F,Y),Y=Y.sibling;return null}function r(F){for(var Y=new Map;F!==null;)F.key!==null?Y.set(F.key,F):Y.set(F.index,F),F=F.sibling;return Y}function d(F,Y){return F=Il(F,Y),F.index=0,F.sibling=null,F}function f(F,Y,ee){return F.index=ee,e?(ee=F.alternate,ee!==null?(ee=ee.index,ee<Y?(F.flags|=67108866,Y):ee):(F.flags|=67108866,Y)):(F.flags|=1048576,Y)}function j(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function w(F,Y,ee,me){return Y===null||Y.tag!==6?(Y=ic(ee,F.mode,me),Y.return=F,Y):(Y=d(Y,ee),Y.return=F,Y)}function U(F,Y,ee,me){var Fe=ee.type;return Fe===A?ue(F,Y,ee.props.children,me,ee.key):Y!==null&&(Y.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===X&&Ua(Fe)===Y.type)?(Y=d(Y,ee.props),Si(Y,ee),Y.return=F,Y):(Y=Ul(ee.type,ee.key,ee.props,null,F.mode,me),Si(Y,ee),Y.return=F,Y)}function te(F,Y,ee,me){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ee.containerInfo||Y.stateNode.implementation!==ee.implementation?(Y=rc(ee,F.mode,me),Y.return=F,Y):(Y=d(Y,ee.children||[]),Y.return=F,Y)}function ue(F,Y,ee,me,Fe){return Y===null||Y.tag!==7?(Y=gl(ee,F.mode,me,Fe),Y.return=F,Y):(Y=d(Y,ee),Y.return=F,Y)}function xe(F,Y,ee){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=ic(""+Y,F.mode,ee),Y.return=F,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:return ee=Ul(Y.type,Y.key,Y.props,null,F.mode,ee),Si(ee,Y),ee.return=F,ee;case k:return Y=rc(Y,F.mode,ee),Y.return=F,Y;case X:return Y=Ua(Y),xe(F,Y,ee)}if(we(Y)||W(Y))return Y=gl(Y,F.mode,ee,null),Y.return=F,Y;if(typeof Y.then=="function")return xe(F,fa(Y),ee);if(Y.$$typeof===Q)return xe(F,uc(F,Y),ee);fc(F,Y)}return null}function se(F,Y,ee,me){var Fe=Y!==null?Y.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Fe!==null?null:w(F,Y,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:return ee.key===Fe?U(F,Y,ee,me):null;case k:return ee.key===Fe?te(F,Y,ee,me):null;case X:return ee=Ua(ee),se(F,Y,ee,me)}if(we(ee)||W(ee))return Fe!==null?null:ue(F,Y,ee,me,null);if(typeof ee.then=="function")return se(F,Y,fa(ee),me);if(ee.$$typeof===Q)return se(F,Y,uc(F,ee),me);fc(F,ee)}return null}function ie(F,Y,ee,me,Fe){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return F=F.get(ee)||null,w(Y,F,""+me,Fe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return F=F.get(me.key===null?ee:me.key)||null,U(Y,F,me,Fe);case k:return F=F.get(me.key===null?ee:me.key)||null,te(Y,F,me,Fe);case X:return me=Ua(me),ie(F,Y,ee,me,Fe)}if(we(me)||W(me))return F=F.get(ee)||null,ue(Y,F,me,Fe,null);if(typeof me.then=="function")return ie(F,Y,ee,fa(me),Fe);if(me.$$typeof===Q)return ie(F,Y,ee,uc(Y,me),Fe);fc(Y,me)}return null}function qe(F,Y,ee,me){for(var Fe=null,Dt=null,$e=Y,pt=Y=0,Nt=null;$e!==null&&pt<ee.length;pt++){$e.index>pt?(Nt=$e,$e=null):Nt=$e.sibling;var Ot=se(F,$e,ee[pt],me);if(Ot===null){$e===null&&($e=Nt);break}e&&$e&&Ot.alternate===null&&t(F,$e),Y=f(Ot,Y,pt),Dt===null?Fe=Ot:Dt.sibling=Ot,Dt=Ot,$e=Nt}if(pt===ee.length)return l(F,$e),ft&&Hl(F,pt),Fe;if($e===null){for(;pt<ee.length;pt++)$e=xe(F,ee[pt],me),$e!==null&&(Y=f($e,Y,pt),Dt===null?Fe=$e:Dt.sibling=$e,Dt=$e);return ft&&Hl(F,pt),Fe}for($e=r($e);pt<ee.length;pt++)Nt=ie($e,F,pt,ee[pt],me),Nt!==null&&(e&&Nt.alternate!==null&&$e.delete(Nt.key===null?pt:Nt.key),Y=f(Nt,Y,pt),Dt===null?Fe=Nt:Dt.sibling=Nt,Dt=Nt);return e&&$e.forEach(function(Hi){return t(F,Hi)}),ft&&Hl(F,pt),Fe}function et(F,Y,ee,me){if(ee==null)throw Error(c(151));for(var Fe=null,Dt=null,$e=Y,pt=Y=0,Nt=null,Ot=ee.next();$e!==null&&!Ot.done;pt++,Ot=ee.next()){$e.index>pt?(Nt=$e,$e=null):Nt=$e.sibling;var Hi=se(F,$e,Ot.value,me);if(Hi===null){$e===null&&($e=Nt);break}e&&$e&&Hi.alternate===null&&t(F,$e),Y=f(Hi,Y,pt),Dt===null?Fe=Hi:Dt.sibling=Hi,Dt=Hi,$e=Nt}if(Ot.done)return l(F,$e),ft&&Hl(F,pt),Fe;if($e===null){for(;!Ot.done;pt++,Ot=ee.next())Ot=xe(F,Ot.value,me),Ot!==null&&(Y=f(Ot,Y,pt),Dt===null?Fe=Ot:Dt.sibling=Ot,Dt=Ot);return ft&&Hl(F,pt),Fe}for($e=r($e);!Ot.done;pt++,Ot=ee.next())Ot=ie($e,F,pt,Ot.value,me),Ot!==null&&(e&&Ot.alternate!==null&&$e.delete(Ot.key===null?pt:Ot.key),Y=f(Ot,Y,pt),Dt===null?Fe=Ot:Dt.sibling=Ot,Dt=Ot);return e&&$e.forEach(function(Z0){return t(F,Z0)}),ft&&Hl(F,pt),Fe}function Pt(F,Y,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===A&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:e:{for(var Fe=ee.key;Y!==null;){if(Y.key===Fe){if(Fe=ee.type,Fe===A){if(Y.tag===7){l(F,Y.sibling),me=d(Y,ee.props.children),me.return=F,F=me;break e}}else if(Y.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===X&&Ua(Fe)===Y.type){l(F,Y.sibling),me=d(Y,ee.props),Si(me,ee),me.return=F,F=me;break e}l(F,Y);break}else t(F,Y);Y=Y.sibling}ee.type===A?(me=gl(ee.props.children,F.mode,me,ee.key),me.return=F,F=me):(me=Ul(ee.type,ee.key,ee.props,null,F.mode,me),Si(me,ee),me.return=F,F=me)}return j(F);case k:e:{for(Fe=ee.key;Y!==null;){if(Y.key===Fe)if(Y.tag===4&&Y.stateNode.containerInfo===ee.containerInfo&&Y.stateNode.implementation===ee.implementation){l(F,Y.sibling),me=d(Y,ee.children||[]),me.return=F,F=me;break e}else{l(F,Y);break}else t(F,Y);Y=Y.sibling}me=rc(ee,F.mode,me),me.return=F,F=me}return j(F);case X:return ee=Ua(ee),Pt(F,Y,ee,me)}if(we(ee))return qe(F,Y,ee,me);if(W(ee)){if(Fe=W(ee),typeof Fe!="function")throw Error(c(150));return ee=Fe.call(ee),et(F,Y,ee,me)}if(typeof ee.then=="function")return Pt(F,Y,fa(ee),me);if(ee.$$typeof===Q)return Pt(F,Y,uc(F,ee),me);fc(F,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Y!==null&&Y.tag===6?(l(F,Y.sibling),me=d(Y,ee),me.return=F,F=me):(l(F,Y),me=ic(ee,F.mode,me),me.return=F,F=me),j(F)):l(F,Y)}return function(F,Y,ee,me){try{br=0;var Fe=Pt(F,Y,ee,me);return Ha=null,Fe}catch($e){if($e===ki||$e===bl)throw $e;var Dt=Ds(29,$e,null,F.mode);return Dt.lanes=me,Dt.return=F,Dt}finally{}}}var Ba=hc(!0),_r=hc(!1),Ls=!1;function Ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(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 ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pa(e,t,l){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ht&2)!==0){var d=r.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),r.pending=t,t=ac(e),zu(e,null,l),t}return lc(e,r,t,l),ac(e)}function $l(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,l|=r,t.lanes=l,Ze(e,l)}}function yr(e,t){var l=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var d=null,f=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};f===null?d=f=j:f=f.next=j,l=l.next}while(l!==null);f===null?d=f=t:f=f.next=t}else d=f=t;l={baseState:r.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:r.shared,callbacks:r.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Mo=!1;function vr(){if(Mo){var e=wi;if(e!==null)throw e}}function zs(e,t,l,r){Mo=!1;var d=e.updateQueue;Ls=!1;var f=d.firstBaseUpdate,j=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var U=w,te=U.next;U.next=null,j===null?f=te:j.next=te,j=U;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,w=ue.lastBaseUpdate,w!==j&&(w===null?ue.firstBaseUpdate=te:w.next=te,ue.lastBaseUpdate=U))}if(f!==null){var xe=d.baseState;j=0,ue=te=U=null,w=f;do{var se=w.lane&-536870913,ie=se!==w.lane;if(ie?(kt&se)===se:(r&se)===se){se!==0&&se===ji&&(Mo=!0),ue!==null&&(ue=ue.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var qe=e,et=w;se=t;var Pt=l;switch(et.tag){case 1:if(qe=et.payload,typeof qe=="function"){xe=qe.call(Pt,xe,se);break e}xe=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=et.payload,se=typeof qe=="function"?qe.call(Pt,xe,se):qe,se==null)break e;xe=v({},xe,se);break e;case 2:Ls=!0}}se=w.callback,se!==null&&(e.flags|=64,ie&&(e.flags|=8192),ie=d.callbacks,ie===null?d.callbacks=[se]:ie.push(se))}else ie={lane:se,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ue===null?(te=ue=ie,U=xe):ue=ue.next=ie,j|=se;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;ie=w,w=ie.next,ie.next=null,d.lastBaseUpdate=ie,d.shared.pending=null}}while(!0);ue===null&&(U=xe),d.baseState=U,d.firstBaseUpdate=te,d.lastBaseUpdate=ue,f===null&&(d.shared.lanes=0),Ci|=j,e.lanes=j,e.memoizedState=xe}}function Xu(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Ro(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Xu(l[e],t)}var p=C(null),L=C(0);function ce(e,t){e=Ka,de(L,e),de(p,t),Ka=e|t.baseLanes}function Ue(){de(L,Ka),de(p,p.current)}function ht(){Ka=L.current,K(p),K(L)}var Ut=C(null),kn=null;function Zs(e){var t=e.alternate;de(Nn,Nn.current&1),de(Ut,e),kn===null&&(t===null||p.current!==null||t.memoizedState!==null)&&(kn=e)}function mc(e){de(Nn,Nn.current),de(Ut,e),kn===null&&(kn=e)}function Do(e){e.tag===22?(de(Nn,Nn.current),de(Ut,e),kn===null&&(kn=e)):Yl()}function Yl(){de(Nn,Nn.current),de(Ut,Ut.current)}function ws(e){K(Ut),kn===e&&(kn=null),K(Nn)}var Nn=C(0);function jr(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Bh(l)||qh(l)))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 _l=0,le=null,ve=null,Ie=null,gt=!1,_t=!1,us=!1,gc=0,Oo=0,xc=null,Hy=0;function Rn(){throw Error(c(321))}function Lf(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!es(e[l],t[l]))return!1;return!0}function zf(e,t,l,r,d,f){return _l=f,le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Fm:Pf,us=!1,f=l(r,d),us=!1,_t&&(f=mm(t,l,r,d)),pm(e),f}function pm(e){M.H=Io;var t=ve!==null&&ve.next!==null;if(_l=0,Ie=ve=le=null,gt=!1,Oo=0,xc=null,t)throw Error(c(300));e===null||qn||(e=e.dependencies,e!==null&&oc(e)&&(qn=!0))}function mm(e,t,l,r){le=e;var d=0;do{if(_t&&(xc=null),Oo=0,_t=!1,25<=d)throw Error(c(301));if(d+=1,Ie=ve=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}M.H=Pm,f=t(l,r)}while(_t);return f}function By(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Lo(t):t,e=e.useState()[0],(ve!==null?ve.memoizedState:null)!==e&&(le.flags|=1024),t}function If(){var e=gc!==0;return gc=0,e}function Uf(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Hf(e){if(gt){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gt=!1}_l=0,Ie=ve=le=null,_t=!1,Oo=gc=0,xc=null}function Is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?le.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function Un(){if(ve===null){var e=le.alternate;e=e!==null?e.memoizedState:null}else e=ve.next;var t=Ie===null?le.memoizedState:Ie.next;if(t!==null)Ie=t,ve=e;else{if(e===null)throw le.alternate===null?Error(c(467)):Error(c(310));ve=e,e={memoizedState:ve.memoizedState,baseState:ve.baseState,baseQueue:ve.baseQueue,queue:ve.queue,next:null},Ie===null?le.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function Qu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=Oo;return Oo+=1,xc===null&&(xc=[]),e=Vu(xc,e,t),t=le,(Ie===null?t.memoizedState:Ie.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Fm:Pf),e}function Ku(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Lo(e);if(e.$$typeof===Q)return Kn(e)}throw Error(c(438,String(e)))}function Bf(e){var t=null,l=le.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var r=le.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Qu(),le.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),r=0;r<e;r++)l[r]=B;return t.index++,l}function qa(e,t){return typeof t=="function"?t(e):t}function Zu(e){var t=Un();return qf(t,ve,e)}function qf(e,t,l){var r=e.queue;if(r===null)throw Error(c(311));r.lastRenderedReducer=l;var d=e.baseQueue,f=r.pending;if(f!==null){if(d!==null){var j=d.next;d.next=f.next,f.next=j}t.baseQueue=d=f,r.pending=null}if(f=e.baseState,d===null)e.memoizedState=f;else{t=d.next;var w=j=null,U=null,te=t,ue=!1;do{var xe=te.lane&-536870913;if(xe!==te.lane?(kt&xe)===xe:(_l&xe)===xe){var se=te.revertLane;if(se===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),xe===ji&&(ue=!0);else if((_l&se)===se){te=te.next,se===ji&&(ue=!0);continue}else xe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},U===null?(w=U=xe,j=f):U=U.next=xe,le.lanes|=se,Ci|=se;xe=te.action,us&&l(f,xe),f=te.hasEagerState?te.eagerState:l(f,xe)}else se={lane:xe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},U===null?(w=U=se,j=f):U=U.next=se,le.lanes|=xe,Ci|=xe;te=te.next}while(te!==null&&te!==t);if(U===null?j=f:U.next=w,!es(f,e.memoizedState)&&(qn=!0,ue&&(l=wi,l!==null)))throw l;e.memoizedState=f,e.baseState=j,e.baseQueue=U,r.lastRenderedState=f}return d===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Gf(e){var t=Un(),l=t.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=e;var r=l.dispatch,d=l.pending,f=t.memoizedState;if(d!==null){l.pending=null;var j=d=d.next;do f=e(f,j.action),j=j.next;while(j!==d);es(f,t.memoizedState)||(qn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),l.lastRenderedState=f}return[f,r]}function gm(e,t,l){var r=le,d=Un(),f=ft;if(f){if(l===void 0)throw Error(c(407));l=l()}else l=t();var j=!es((ve||d).memoizedState,l);if(j&&(d.memoizedState=l,qn=!0),d=d.queue,Vf(_m.bind(null,r,d,e),[e]),d.getSnapshot!==t||j||Ie!==null&&Ie.memoizedState.tag&1){if(r.flags|=2048,bc(9,{destroy:void 0},bm.bind(null,r,d,l,t),null),sn===null)throw Error(c(349));f||(_l&127)!==0||xm(r,t,l)}return l}function xm(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=le.updateQueue,t===null?(t=Qu(),le.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function bm(e,t,l,r){t.value=l,t.getSnapshot=r,ym(t)&&vm(e)}function _m(e,t,l){return l(function(){ym(t)&&vm(e)})}function ym(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!es(e,l)}catch{return!0}}function vm(e){var t=il(e,2);t!==null&&el(t,e,2)}function $f(e){var t=Is();if(typeof e=="function"){var l=e;if(e=l(),us){Cn(!0);try{l()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:e},t}function jm(e,t,l,r){return e.baseState=l,qf(e,ve,typeof r=="function"?r:qa)}function qy(e,t,l,r,d){if(Ju(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){f.listeners.push(j)}};M.T!==null?l(!0):f.isTransition=!1,r(f),l=t.pending,l===null?(f.next=t.pending=f,wm(t,f)):(f.next=l.next,t.pending=l.next=f)}}function wm(e,t){var l=t.action,r=t.payload,d=e.state;if(t.isTransition){var f=M.T,j={};M.T=j;try{var w=l(d,r),U=M.S;U!==null&&U(j,w),km(e,t,w)}catch(te){Yf(e,t,te)}finally{f!==null&&j.types!==null&&(f.types=j.types),M.T=f}}else try{f=l(d,r),km(e,t,f)}catch(te){Yf(e,t,te)}}function km(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Nm(e,t,r)},function(r){return Yf(e,t,r)}):Nm(e,t,l)}function Nm(e,t,l){t.status="fulfilled",t.value=l,Sm(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,wm(e,l)))}function Yf(e,t,l){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=l,Sm(t),t=t.next;while(t!==r)}e.action=null}function Sm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Em(e,t){return t}function Tm(e,t){if(ft){var l=sn.formState;if(l!==null){e:{var r=le;if(ft){if(nn){t:{for(var d=nn,f=os;d.nodeType!==8;){if(!f){d=null;break t}if(d=yl(d.nextSibling),d===null){d=null;break t}}f=d.data,d=f==="F!"||f==="F"?d:null}if(d){nn=yl(d.nextSibling),r=d.data==="F!";break e}}ua(r)}r=!1}r&&(t=l[0])}}return l=Is(),l.memoizedState=l.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Em,lastRenderedState:t},l.queue=r,l=Qm.bind(null,le,r),r.dispatch=l,r=$f(!1),f=Ff.bind(null,le,!1,r.queue),r=Is(),d={state:t,dispatch:null,action:e,pending:null},r.queue=d,l=qy.bind(null,le,d,f,l),d.dispatch=l,r.memoizedState=e,[t,l,!1]}function Cm(e){var t=Un();return Am(t,ve,e)}function Am(e,t,l){if(t=qf(e,t,Em)[0],e=Zu(qa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Lo(t)}catch(j){throw j===ki?bl:j}else r=t;t=Un();var d=t.queue,f=d.dispatch;return l!==t.memoizedState&&(le.flags|=2048,bc(9,{destroy:void 0},Gy.bind(null,d,l),null)),[r,f,e]}function Gy(e,t){e.action=t}function Mm(e){var t=Un(),l=ve;if(l!==null)return Am(t,l,e);Un(),t=t.memoizedState,l=Un();var r=l.queue.dispatch;return l.memoizedState=e,[t,r,!1]}function bc(e,t,l,r){return e={tag:e,create:l,deps:r,inst:t,next:null},t=le.updateQueue,t===null&&(t=Qu(),le.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(r=l.next,l.next=e,e.next=r,t.lastEffect=e),e}function Rm(){return Un().memoizedState}function Fu(e,t,l,r){var d=Is();le.flags|=e,d.memoizedState=bc(1|t,{destroy:void 0},l,r===void 0?null:r)}function Pu(e,t,l,r){var d=Un();r=r===void 0?null:r;var f=d.memoizedState.inst;ve!==null&&r!==null&&Lf(r,ve.memoizedState.deps)?d.memoizedState=bc(t,f,l,r):(le.flags|=e,d.memoizedState=bc(1|t,f,l,r))}function Dm(e,t){Fu(8390656,8,e,t)}function Vf(e,t){Pu(2048,8,e,t)}function $y(e){le.flags|=4;var t=le.updateQueue;if(t===null)t=Qu(),le.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Om(e){var t=Un().memoizedState;return $y({ref:t,nextImpl:e}),function(){if((Ht&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Lm(e,t){return Pu(4,2,e,t)}function zm(e,t){return Pu(4,4,e,t)}function Im(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Um(e,t,l){l=l!=null?l.concat([e]):null,Pu(4,4,Im.bind(null,t,e),l)}function Xf(){}function Hm(e,t){var l=Un();t=t===void 0?null:t;var r=l.memoizedState;return t!==null&&Lf(t,r[1])?r[0]:(l.memoizedState=[e,t],e)}function Bm(e,t){var l=Un();t=t===void 0?null:t;var r=l.memoizedState;if(t!==null&&Lf(t,r[1]))return r[0];if(r=e(),us){Cn(!0);try{e()}finally{Cn(!1)}}return l.memoizedState=[r,t],r}function Qf(e,t,l){return l===void 0||(_l&1073741824)!==0&&(kt&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=qg(),le.lanes|=e,Ci|=e,l)}function qm(e,t,l,r){return es(l,t)?l:p.current!==null?(e=Qf(e,l,r),es(e,t)||(qn=!0),e):(_l&42)===0||(_l&1073741824)!==0&&(kt&261930)===0?(qn=!0,e.memoizedState=l):(e=qg(),le.lanes|=e,Ci|=e,t)}function Gm(e,t,l,r,d){var f=N.p;N.p=f!==0&&8>f?f:8;var j=M.T,w={};M.T=w,Ff(e,!1,t,l);try{var U=d(),te=M.S;if(te!==null&&te(w,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ue=Of(U,r);zo(e,t,ue,ul(e))}else zo(e,t,r,ul(e))}catch(xe){zo(e,t,{then:function(){},status:"rejected",reason:xe},ul())}finally{N.p=f,j!==null&&w.types!==null&&(j.types=w.types),M.T=j}}function Yy(){}function Kf(e,t,l,r){if(e.tag!==5)throw Error(c(476));var d=$m(e).queue;Gm(e,d,t,V,l===null?Yy:function(){return Ym(e),l(r)})}function $m(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:V},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ym(e){var t=$m(e);t.next===null&&(t=e.alternate.memoizedState),zo(e,t.next.queue,{},ul())}function Zf(){return Kn(Wo)}function Vm(){return Un().memoizedState}function Xm(){return Un().memoizedState}function Vy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=ul();e=ha(l);var r=pa(t,e,l);r!==null&&(el(r,t,l),$l(r,t,l)),t={cache:vi()},e.payload=t;return}t=t.return}}function Xy(e,t,l){var r=ul();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ju(e)?Km(t,l):(l=mo(e,t,l,r),l!==null&&(el(l,e,r),Zm(l,t,r)))}function Qm(e,t,l){var r=ul();zo(e,t,l,r)}function zo(e,t,l,r){var d={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ju(e))Km(t,d);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var j=t.lastRenderedState,w=f(j,l);if(d.hasEagerState=!0,d.eagerState=w,es(w,j))return lc(e,t,d,0),sn===null&&sc(),!1}catch{}finally{}if(l=mo(e,t,d,r),l!==null)return el(l,e,r),Zm(l,t,r),!0}return!1}function Ff(e,t,l,r){if(r={lane:2,revertLane:Th(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ju(e)){if(t)throw Error(c(479))}else t=mo(e,l,r,2),t!==null&&el(t,e,2)}function Ju(e){var t=e.alternate;return e===le||t!==null&&t===le}function Km(e,t){_t=gt=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Zm(e,t,l){if((l&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,l|=r,t.lanes=l,Ze(e,l)}}var Io={readContext:Kn,use:Ku,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};Io.useEffectEvent=Rn;var Fm={readContext:Kn,use:Ku,useCallback:function(e,t){return Is().memoizedState=[e,t===void 0?null:t],e},useContext:Kn,useEffect:Dm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Fu(4194308,4,Im.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Fu(4194308,4,e,t)},useInsertionEffect:function(e,t){Fu(4,2,e,t)},useMemo:function(e,t){var l=Is();t=t===void 0?null:t;var r=e();if(us){Cn(!0);try{e()}finally{Cn(!1)}}return l.memoizedState=[r,t],r},useReducer:function(e,t,l){var r=Is();if(l!==void 0){var d=l(t);if(us){Cn(!0);try{l(t)}finally{Cn(!1)}}}else d=t;return r.memoizedState=r.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},r.queue=e,e=e.dispatch=Xy.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=Is();return e={current:e},t.memoizedState=e},useState:function(e){e=$f(e);var t=e.queue,l=Qm.bind(null,le,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Is();return Qf(l,e,t)},useTransition:function(){var e=$f(!1);return e=Gm.bind(null,le,e.queue,!0,!1),Is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var r=le,d=Is();if(ft){if(l===void 0)throw Error(c(407));l=l()}else{if(l=t(),sn===null)throw Error(c(349));(kt&127)!==0||xm(r,t,l)}d.memoizedState=l;var f={value:l,getSnapshot:t};return d.queue=f,Dm(_m.bind(null,r,f,e),[e]),r.flags|=2048,bc(9,{destroy:void 0},bm.bind(null,r,f,l,t),null),l},useId:function(){var e=Is(),t=sn.identifierPrefix;if(ft){var l=rl,r=Qs;l=(r&~(1<<32-St(r)-1)).toString(32)+l,t="_"+t+"R_"+l,l=gc++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Hy++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zf,useFormState:Tm,useActionState:Tm,useOptimistic:function(e){var t=Is();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Ff.bind(null,le,!0,l),l.dispatch=t,[e,t]},useMemoCache:Bf,useCacheRefresh:function(){return Is().memoizedState=Vy.bind(null,le)},useEffectEvent:function(e){var t=Is(),l={impl:e};return t.memoizedState=l,function(){if((Ht&2)!==0)throw Error(c(440));return l.impl.apply(void 0,arguments)}}},Pf={readContext:Kn,use:Ku,useCallback:Hm,useContext:Kn,useEffect:Vf,useImperativeHandle:Um,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Bm,useReducer:Zu,useRef:Rm,useState:function(){return Zu(qa)},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Un();return qm(l,ve.memoizedState,e,t)},useTransition:function(){var e=Zu(qa)[0],t=Un().memoizedState;return[typeof e=="boolean"?e:Lo(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:Zf,useFormState:Cm,useActionState:Cm,useOptimistic:function(e,t){var l=Un();return jm(l,ve,e,t)},useMemoCache:Bf,useCacheRefresh:Xm};Pf.useEffectEvent=Om;var Pm={readContext:Kn,use:Ku,useCallback:Hm,useContext:Kn,useEffect:Vf,useImperativeHandle:Um,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Bm,useReducer:Gf,useRef:Rm,useState:function(){return Gf(qa)},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Un();return ve===null?Qf(l,e,t):qm(l,ve.memoizedState,e,t)},useTransition:function(){var e=Gf(qa)[0],t=Un().memoizedState;return[typeof e=="boolean"?e:Lo(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:Zf,useFormState:Mm,useActionState:Mm,useOptimistic:function(e,t){var l=Un();return ve!==null?jm(l,ve,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Bf,useCacheRefresh:Xm};Pm.useEffectEvent=Om;function Jf(e,t,l,r){t=e.memoizedState,l=l(r,t),l=l==null?t:v({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Wf={enqueueSetState:function(e,t,l){e=e._reactInternals;var r=ul(),d=ha(r);d.payload=t,l!=null&&(d.callback=l),t=pa(e,d,r),t!==null&&(el(t,e,r),$l(t,e,r))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var r=ul(),d=ha(r);d.tag=1,d.payload=t,l!=null&&(d.callback=l),t=pa(e,d,r),t!==null&&(el(t,e,r),$l(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=ul(),r=ha(l);r.tag=2,t!=null&&(r.callback=t),t=pa(e,r,l),t!==null&&(el(t,e,l),$l(t,e,l))}};function Jm(e,t,l,r,d,f,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,f,j):t.prototype&&t.prototype.isPureReactComponent?!pl(l,r)||!pl(d,f):!0}function Wm(e,t,l,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,r),t.state!==e&&Wf.enqueueReplaceState(t,t.state,null)}function wr(e,t){var l=t;if("ref"in t){l={};for(var r in t)r!=="ref"&&(l[r]=t[r])}if(e=e.defaultProps){l===t&&(l=v({},l));for(var d in e)l[d]===void 0&&(l[d]=e[d])}return l}function eg(e){ho(e)}function tg(e){console.error(e)}function ng(e){ho(e)}function Wu(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function sg(e,t,l){try{var r=e.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function eh(e,t,l){return l=ha(l),l.tag=3,l.payload={element:null},l.callback=function(){Wu(e,t)},l}function lg(e){return e=ha(e),e.tag=3,e}function ag(e,t,l,r){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var f=r.value;e.payload=function(){return d(f)},e.callback=function(){sg(t,l,r)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){sg(t,l,r),typeof d!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var w=r.stack;this.componentDidCatch(r.value,{componentStack:w!==null?w:""})})}function Qy(e,t,l,r,d){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=l.alternate,t!==null&&yi(t,l,d,!0),l=Ut.current,l!==null){switch(l.tag){case 31:case 13:return kn===null?dd():l.alternate===null&&Dn===0&&(Dn=3),l.flags&=-257,l.flags|=65536,l.lanes=d,r===Ks?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([r]):t.add(r),Nh(e,r,d)),!1;case 22:return l.flags|=65536,r===Ks?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([r]):l.add(r)),Nh(e,r,d)),!1}throw Error(c(435,l.tag))}return Nh(e,r,d),dd(),!1}if(ft)return t=Ut.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,r!==vo&&(e=Error(c(422),{cause:r}),pr(js(e,l)))):(r!==vo&&(t=Error(c(423),{cause:r}),pr(js(t,l))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,r=js(r,l),d=eh(e.stateNode,r,d),yr(e,d),Dn!==4&&(Dn=2)),!1;var f=Error(c(520),{cause:r});if(f=js(f,l),Vo===null?Vo=[f]:Vo.push(f),Dn!==4&&(Dn=2),t===null)return!0;r=js(r,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=d&-d,l.lanes|=e,e=eh(l.stateNode,r,e),yr(l,e),!1;case 1:if(t=l.type,f=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ai===null||!Ai.has(f))))return l.flags|=65536,d&=-d,l.lanes|=d,d=lg(d),ag(d,e,l,r),yr(l,d),!1}l=l.return}while(l!==null);return!1}var th=Error(c(461)),qn=!1;function ds(e,t,l,r){t.child=e===null?_r(t,null,l,r):Ba(t,e.child,l,r)}function ig(e,t,l,r,d){l=l.render;var f=t.ref;if("ref"in r){var j={};for(var w in r)w!=="ref"&&(j[w]=r[w])}else j=r;return za(t),r=zf(e,t,l,j,f,d),w=If(),e!==null&&!qn?(Uf(e,t,d),Ga(e,t,d)):(ft&&w&&_o(t),t.flags|=1,ds(e,t,r,d),t.child)}function rg(e,t,l,r,d){if(e===null){var f=l.type;return typeof f=="function"&&!go(f)&&f.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=f,cg(e,t,f,r,d)):(e=Ul(l.type,null,r,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!oh(e,d)){var j=f.memoizedProps;if(l=l.compare,l=l!==null?l:pl,l(j,r)&&e.ref===t.ref)return Ga(e,t,d)}return t.flags|=1,e=Il(f,r),e.ref=t.ref,e.return=t,t.child=e}function cg(e,t,l,r,d){if(e!==null){var f=e.memoizedProps;if(pl(f,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=f,oh(e,d))(e.flags&131072)!==0&&(qn=!0);else return t.lanes=e.lanes,Ga(e,t,d)}return nh(e,t,l,r,d)}function og(e,t,l,r){var d=r.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|l:l,e!==null){for(r=t.child=e.child,d=0;r!==null;)d=d|r.lanes|r.childLanes,r=r.sibling;r=d&~f}else r=0,t.child=null;return ug(e,t,f,l,r)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&dc(t,f!==null?f.cachePool:null),f!==null?ce(t,f):Ue(),Do(t);else return r=t.lanes=536870912,ug(e,t,f!==null?f.baseLanes|l:l,l,r)}else f!==null?(dc(t,f.cachePool),ce(t,f),Yl(),t.memoizedState=null):(e!==null&&dc(t,null),Ue(),Yl());return ds(e,t,d,l),t.child}function Uo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ug(e,t,l,r,d){var f=Eo();return f=f===null?null:{parent:wn._currentValue,pool:f},t.memoizedState={baseLanes:l,cachePool:f},e!==null&&dc(t,null),Ue(),Do(t),e!==null&&yi(e,t,r,!0),t.childLanes=d,null}function ed(e,t){return t=nd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dg(e,t,l){return Ba(t,e.child,null,l),e=ed(t,t.pendingProps),e.flags|=2,ws(t),t.memoizedState=null,e}function Ky(e,t,l){var r=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ft){if(r.mode==="hidden")return e=ed(t,r),t.lanes=536870912,Uo(null,e);if(mc(t),(e=nn)?(e=wx(e,os),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:oa!==null?{id:Qs,overflow:rl}:null,retryLane:536870912,hydrationErrors:null},l=Uu(e),l.return=t,t.child=l,In=t,nn=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return ed(t,r)}var f=e.memoizedState;if(f!==null){var j=f.dehydrated;if(mc(t),d)if(t.flags&256)t.flags&=-257,t=dg(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(qn||yi(e,t,l,!1),d=(l&e.childLanes)!==0,qn||d){if(r=sn,r!==null&&(j=It(r,l),j!==0&&j!==f.retryLane))throw f.retryLane=j,il(e,j),el(r,e,j),th;dd(),t=dg(e,t,l)}else e=f.treeContext,nn=yl(j.nextSibling),In=t,ft=!0,xl=null,os=!1,e!==null&&Hu(t,e),t=ed(t,r),t.flags|=4096;return t}return e=Il(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function td(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(c(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function nh(e,t,l,r,d){return za(t),l=zf(e,t,l,r,void 0,d),r=If(),e!==null&&!qn?(Uf(e,t,d),Ga(e,t,d)):(ft&&r&&_o(t),t.flags|=1,ds(e,t,l,d),t.child)}function fg(e,t,l,r,d,f){return za(t),t.updateQueue=null,l=mm(t,r,l,d),pm(e),r=If(),e!==null&&!qn?(Uf(e,t,f),Ga(e,t,f)):(ft&&r&&_o(t),t.flags|=1,ds(e,t,l,f),t.child)}function hg(e,t,l,r,d){if(za(t),t.stateNode===null){var f=gi,j=l.contextType;typeof j=="object"&&j!==null&&(f=Kn(j)),f=new l(r,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Wf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=r,f.state=t.memoizedState,f.refs={},Ao(t),j=l.contextType,f.context=typeof j=="object"&&j!==null?Kn(j):gi,f.state=t.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(Jf(t,l,j,r),f.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(j=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),j!==f.state&&Wf.enqueueReplaceState(f,f.state,null),zs(t,r,f,d),vr(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,U=wr(l,w);f.props=U;var te=f.context,ue=l.contextType;j=gi,typeof ue=="object"&&ue!==null&&(j=Kn(ue));var xe=l.getDerivedStateFromProps;ue=typeof xe=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||te!==j)&&Wm(t,f,r,j),Ls=!1;var se=t.memoizedState;f.state=se,zs(t,r,f,d),vr(),te=t.memoizedState,w||se!==te||Ls?(typeof xe=="function"&&(Jf(t,l,xe,r),te=t.memoizedState),(U=Ls||Jm(t,l,U,r,se,te,j))?(ue||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=te),f.props=r,f.state=te,f.context=j,r=U):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,pc(e,t),j=t.memoizedProps,ue=wr(l,j),f.props=ue,xe=t.pendingProps,se=f.context,te=l.contextType,U=gi,typeof te=="object"&&te!==null&&(U=Kn(te)),w=l.getDerivedStateFromProps,(te=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(j!==xe||se!==U)&&Wm(t,f,r,U),Ls=!1,se=t.memoizedState,f.state=se,zs(t,r,f,d),vr();var ie=t.memoizedState;j!==xe||se!==ie||Ls||e!==null&&e.dependencies!==null&&oc(e.dependencies)?(typeof w=="function"&&(Jf(t,l,w,r),ie=t.memoizedState),(ue=Ls||Jm(t,l,ue,r,se,ie,U)||e!==null&&e.dependencies!==null&&oc(e.dependencies))?(te||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(r,ie,U),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,ie,U)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ie),f.props=r,f.state=ie,f.context=U,r=ue):(typeof f.componentDidUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),r=!1)}return f=r,td(e,t),r=(t.flags&128)!==0,f||r?(f=t.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&r?(t.child=Ba(t,e.child,null,d),t.child=Ba(t,null,l,d)):ds(e,t,l,d),t.memoizedState=f.state,e=t.child):e=Ga(e,t,d),e}function pg(e,t,l,r){return Oa(),t.flags|=256,ds(e,t,l,r),t.child}var sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(e){return{baseLanes:e,cachePool:Yu()}}function ah(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=ol),e}function mg(e,t,l){var r=t.pendingProps,d=!1,f=(t.flags&128)!==0,j;if((j=f)||(j=e!==null&&e.memoizedState===null?!1:(Nn.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(ft){if(d?Zs(t):Yl(),(e=nn)?(e=wx(e,os),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:oa!==null?{id:Qs,overflow:rl}:null,retryLane:536870912,hydrationErrors:null},l=Uu(e),l.return=t,t.child=l,In=t,nn=null)):e=null,e===null)throw ua(t);return qh(e)?t.lanes=32:t.lanes=536870912,null}var w=r.children;return r=r.fallback,d?(Yl(),d=t.mode,w=nd({mode:"hidden",children:w},d),r=gl(r,d,l,null),w.return=t,r.return=t,w.sibling=r,t.child=w,r=t.child,r.memoizedState=lh(l),r.childLanes=ah(e,j,l),t.memoizedState=sh,Uo(null,r)):(Zs(t),ih(t,w))}var U=e.memoizedState;if(U!==null&&(w=U.dehydrated,w!==null)){if(f)t.flags&256?(Zs(t),t.flags&=-257,t=rh(e,t,l)):t.memoizedState!==null?(Yl(),t.child=e.child,t.flags|=128,t=null):(Yl(),w=r.fallback,d=t.mode,r=nd({mode:"visible",children:r.children},d),w=gl(w,d,l,null),w.flags|=2,r.return=t,w.return=t,r.sibling=w,t.child=r,Ba(t,e.child,null,l),r=t.child,r.memoizedState=lh(l),r.childLanes=ah(e,j,l),t.memoizedState=sh,t=Uo(null,r));else if(Zs(t),qh(w)){if(j=w.nextSibling&&w.nextSibling.dataset,j)var te=j.dgst;j=te,r=Error(c(419)),r.stack="",r.digest=j,pr({value:r,source:null,stack:null}),t=rh(e,t,l)}else if(qn||yi(e,t,l,!1),j=(l&e.childLanes)!==0,qn||j){if(j=sn,j!==null&&(r=It(j,l),r!==0&&r!==U.retryLane))throw U.retryLane=r,il(e,r),el(j,e,r),th;Bh(w)||dd(),t=rh(e,t,l)}else Bh(w)?(t.flags|=192,t.child=e.child,t=null):(e=U.treeContext,nn=yl(w.nextSibling),In=t,ft=!0,xl=null,os=!1,e!==null&&Hu(t,e),t=ih(t,r.children),t.flags|=4096);return t}return d?(Yl(),w=r.fallback,d=t.mode,U=e.child,te=U.sibling,r=Il(U,{mode:"hidden",children:r.children}),r.subtreeFlags=U.subtreeFlags&65011712,te!==null?w=Il(te,w):(w=gl(w,d,l,null),w.flags|=2),w.return=t,r.return=t,r.sibling=w,t.child=r,Uo(null,r),r=t.child,w=e.child.memoizedState,w===null?w=lh(l):(d=w.cachePool,d!==null?(U=wn._currentValue,d=d.parent!==U?{parent:U,pool:U}:d):d=Yu(),w={baseLanes:w.baseLanes|l,cachePool:d}),r.memoizedState=w,r.childLanes=ah(e,j,l),t.memoizedState=sh,Uo(e.child,r)):(Zs(t),l=e.child,e=l.sibling,l=Il(l,{mode:"visible",children:r.children}),l.return=t,l.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=l,t.memoizedState=null,l)}function ih(e,t){return t=nd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function nd(e,t){return e=Ds(22,e,null,t),e.lanes=0,e}function rh(e,t,l){return Ba(t,e.child,null,l),e=ih(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gg(e,t,l){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wo(e.return,t,l)}function ch(e,t,l,r,d,f){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:d,treeForkCount:f}:(j.isBackwards=t,j.rendering=null,j.renderingStartTime=0,j.last=r,j.tail=l,j.tailMode=d,j.treeForkCount=f)}function xg(e,t,l){var r=t.pendingProps,d=r.revealOrder,f=r.tail;r=r.children;var j=Nn.current,w=(j&2)!==0;if(w?(j=j&1|2,t.flags|=128):j&=1,de(Nn,j),ds(e,t,r,l),r=ft?hr:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gg(e,l,t);else if(e.tag===19)gg(e,l,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(d){case"forwards":for(l=t.child,d=null;l!==null;)e=l.alternate,e!==null&&jr(e)===null&&(d=l),l=l.sibling;l=d,l===null?(d=t.child,t.child=null):(d=l.sibling,l.sibling=null),ch(t,!1,d,l,f,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&jr(e)===null){t.child=d;break}e=d.sibling,d.sibling=l,l=d,d=e}ch(t,!0,l,null,f,r);break;case"together":ch(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ga(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ci|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(yi(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,l=Il(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Il(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function oh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&oc(e)))}function Zy(e,t,l){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),da(t,wn,e.memoizedState.cache),Oa();break;case 27:case 5:Mt(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:da(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Zs(t),t.flags|=128,null):(l&t.child.childLanes)!==0?mg(e,t,l):(Zs(t),e=Ga(e,t,l),e!==null?e.sibling:null);Zs(t);break;case 19:var d=(e.flags&128)!==0;if(r=(l&t.childLanes)!==0,r||(yi(e,t,l,!1),r=(l&t.childLanes)!==0),d){if(r)return xg(e,t,l);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),de(Nn,Nn.current),r)break;return null;case 22:return t.lanes=0,og(e,t,l,t.pendingProps);case 24:da(t,wn,e.memoizedState.cache)}return Ga(e,t,l)}function bg(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)qn=!0;else{if(!oh(e,l)&&(t.flags&128)===0)return qn=!1,Zy(e,t,l);qn=(e.flags&131072)!==0}else qn=!1,ft&&(t.flags&1048576)!==0&&bo(t,hr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Ua(t.elementType),t.type=e,typeof e=="function")go(e)?(r=wr(e,r),t.tag=1,t=hg(null,t,e,r,l)):(t.tag=0,t=nh(null,t,e,r,l));else{if(e!=null){var d=e.$$typeof;if(d===z){t.tag=11,t=ig(null,t,e,r,l);break e}else if(d===I){t.tag=14,t=rg(null,t,e,r,l);break e}}throw t=je(e)||e,Error(c(306,t,""))}}return t;case 0:return nh(e,t,t.type,t.pendingProps,l);case 1:return r=t.type,d=wr(r,t.pendingProps),hg(e,t,r,d,l);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var f=t.memoizedState;d=f.element,pc(e,t),zs(t,r,null,l);var j=t.memoizedState;if(r=j.cache,da(t,wn,r),r!==f.cache&&ko(t,[wn],l,!0),vr(),r=j.element,f.isDehydrated)if(f={element:r,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=pg(e,t,r,l);break e}else if(r!==d){d=js(Error(c(424)),t),pr(d),t=pg(e,t,r,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(nn=yl(e.firstChild),In=t,ft=!0,xl=null,os=!0,l=_r(t,null,r,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Oa(),r===d){t=Ga(e,t,l);break e}ds(e,t,r,l)}t=t.child}return t;case 26:return td(e,t),e===null?(l=Cx(t.type,null,t.pendingProps,null))?t.memoizedState=l:ft||(l=t.type,e=t.pendingProps,r=bd(ze.current).createElement(l),r[cn]=t,r[it]=e,fs(r,l,e),st(r),t.stateNode=r):t.memoizedState=Cx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Mt(t),e===null&&ft&&(r=t.stateNode=Sx(t.type,t.pendingProps,ze.current),In=t,os=!0,d=nn,Oi(t.type)?(Gh=d,nn=yl(r.firstChild)):nn=d),ds(e,t,t.pendingProps.children,l),td(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ft&&((d=r=nn)&&(r=N0(r,t.type,t.pendingProps,os),r!==null?(t.stateNode=r,In=t,nn=yl(r.firstChild),os=!1,d=!0):d=!1),d||ua(t)),Mt(t),d=t.type,f=t.pendingProps,j=e!==null?e.memoizedProps:null,r=f.children,Ih(d,f)?r=null:j!==null&&Ih(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=zf(e,t,By,null,null,l),Wo._currentValue=d),td(e,t),ds(e,t,r,l),t.child;case 6:return e===null&&ft&&((e=l=nn)&&(l=S0(l,t.pendingProps,os),l!==null?(t.stateNode=l,In=t,nn=null,e=!0):e=!1),e||ua(t)),null;case 13:return mg(e,t,l);case 4:return Ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ba(t,null,r,l):ds(e,t,r,l),t.child;case 11:return ig(e,t,t.type,t.pendingProps,l);case 7:return ds(e,t,t.pendingProps,l),t.child;case 8:return ds(e,t,t.pendingProps.children,l),t.child;case 12:return ds(e,t,t.pendingProps.children,l),t.child;case 10:return r=t.pendingProps,da(t,t.type,r.value),ds(e,t,r.children,l),t.child;case 9:return d=t.type._context,r=t.pendingProps.children,za(t),d=Kn(d),r=r(d),t.flags|=1,ds(e,t,r,l),t.child;case 14:return rg(e,t,t.type,t.pendingProps,l);case 15:return cg(e,t,t.type,t.pendingProps,l);case 19:return xg(e,t,l);case 31:return Ky(e,t,l);case 22:return og(e,t,l,t.pendingProps);case 24:return za(t),r=Kn(wn),e===null?(d=Eo(),d===null&&(d=sn,f=vi(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=l),d=f),t.memoizedState={parent:r,cache:d},Ao(t),da(t,wn,d)):((e.lanes&l)!==0&&(pc(e,t),zs(t,null,null,l),vr()),d=e.memoizedState,f=t.memoizedState,d.parent!==r?(d={parent:r,cache:r},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),da(t,wn,r)):(r=f.cache,da(t,wn,r),r!==d.cache&&ko(t,[wn],l,!0))),ds(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function $a(e){e.flags|=4}function uh(e,t,l,r,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Vg())e.flags|=8192;else throw Ni=Ks,To}else e.flags&=-16777217}function _g(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ox(t))if(Vg())e.flags|=8192;else throw Ni=Ks,To}function sd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yt():536870912,e.lanes|=t,jc|=t)}function Ho(e,t){if(!ft)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pn(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,r=0;if(t)for(var d=e.child;d!==null;)l|=d.lanes|d.childLanes,r|=d.subtreeFlags&65011712,r|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)l|=d.lanes|d.childLanes,r|=d.subtreeFlags,r|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=r,e.childLanes=l,t}function Fy(e,t,l){var r=t.pendingProps;switch(yo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(t),null;case 1:return pn(t),null;case 3:return l=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ql(wn),lt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Da(t)?$a(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cc())),pn(t),null;case 26:var d=t.type,f=t.memoizedState;return e===null?($a(t),f!==null?(pn(t),_g(t,f)):(pn(t),uh(t,d,null,r,l))):f?f!==e.memoizedState?($a(t),pn(t),_g(t,f)):(pn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&$a(t),pn(t),uh(t,d,e,r,l)),null;case 27:if(fe(t),l=ze.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&$a(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return pn(t),null}e=_e.current,Da(t)?Bu(t):(e=Sx(d,r,l),t.stateNode=e,$a(t))}return pn(t),null;case 5:if(fe(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&$a(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return pn(t),null}if(f=_e.current,Da(t))Bu(t);else{var j=bd(ze.current);switch(f){case 1:f=j.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:f=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":f=j.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":f=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":f=j.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof r.is=="string"?j.createElement("select",{is:r.is}):j.createElement("select"),r.multiple?f.multiple=!0:r.size&&(f.size=r.size);break;default:f=typeof r.is=="string"?j.createElement(d,{is:r.is}):j.createElement(d)}}f[cn]=t,f[it]=r;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)f.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=f;e:switch(fs(f,d,r),d){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&$a(t)}}return pn(t),uh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&$a(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=ze.current,Da(t)){if(e=t.stateNode,l=t.memoizedProps,r=null,d=In,d!==null)switch(d.tag){case 27:case 5:r=d.memoizedProps}e[cn]=t,e=!!(e.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||mx(e.nodeValue,l)),e||ua(t,!0)}else e=bd(e).createTextNode(r),e[cn]=t,t.stateNode=e}return pn(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(r=Da(t),l!==null){if(e===null){if(!r)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[cn]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pn(t),e=!1}else l=cc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(ws(t),t):(ws(t),null);if((t.flags&128)!==0)throw Error(c(558))}return pn(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Da(t),r!==null&&r.dehydrated!==null){if(e===null){if(!d)throw Error(c(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(c(317));d[cn]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pn(t),d=!1}else d=cc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(ws(t),t):(ws(t),null)}return ws(t),(t.flags&128)!==0?(t.lanes=l,t):(l=r!==null,e=e!==null&&e.memoizedState!==null,l&&(r=t.child,d=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(d=r.alternate.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==d&&(r.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),sd(t,t.updateQueue),pn(t),null);case 4:return lt(),e===null&&Rh(t.stateNode.containerInfo),pn(t),null;case 10:return ql(t.type),pn(t),null;case 19:if(K(Nn),r=t.memoizedState,r===null)return pn(t),null;if(d=(t.flags&128)!==0,f=r.rendering,f===null)if(d)Ho(r,!1);else{if(Dn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=jr(e),f!==null){for(t.flags|=128,Ho(r,!1),e=f.updateQueue,t.updateQueue=e,sd(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Iu(l,e),l=l.sibling;return de(Nn,Nn.current&1|2),ft&&Hl(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>cd&&(t.flags|=128,d=!0,Ho(r,!1),t.lanes=4194304)}else{if(!d)if(e=jr(f),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,sd(t,e),Ho(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!ft)return pn(t),null}else 2*Oe()-r.renderingStartTime>cd&&l!==536870912&&(t.flags|=128,d=!0,Ho(r,!1),t.lanes=4194304);r.isBackwards?(f.sibling=t.child,t.child=f):(e=r.last,e!==null?e.sibling=f:t.child=f,r.last=f)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,l=Nn.current,de(Nn,d?l&1|2:l&1),ft&&Hl(t,r.treeForkCount),e):(pn(t),null);case 22:case 23:return ws(t),ht(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(l&536870912)!==0&&(t.flags&128)===0&&(pn(t),t.subtreeFlags&6&&(t.flags|=8192)):pn(t),l=t.updateQueue,l!==null&&sd(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==l&&(t.flags|=2048),e!==null&&K(Ia),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ql(wn),pn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Py(e,t){switch(yo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ql(wn),lt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(ws(t),t.alternate===null)throw Error(c(340));Oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ws(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Nn),null;case 4:return lt(),null;case 10:return ql(t.type),null;case 22:case 23:return ws(t),ht(),e!==null&&K(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ql(wn),null;case 25:return null;default:return null}}function yg(e,t){switch(yo(t),t.tag){case 3:ql(wn),lt();break;case 26:case 27:case 5:fe(t);break;case 4:lt();break;case 31:t.memoizedState!==null&&ws(t);break;case 13:ws(t);break;case 19:K(Nn);break;case 10:ql(t.type);break;case 22:case 23:ws(t),ht(),e!==null&&K(Ia);break;case 24:ql(wn)}}function Bo(e,t){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var d=r.next;l=d;do{if((l.tag&e)===e){r=void 0;var f=l.create,j=l.inst;r=f(),j.destroy=r}l=l.next}while(l!==d)}}catch(w){Qt(t,t.return,w)}}function Ei(e,t,l){try{var r=t.updateQueue,d=r!==null?r.lastEffect:null;if(d!==null){var f=d.next;r=f;do{if((r.tag&e)===e){var j=r.inst,w=j.destroy;if(w!==void 0){j.destroy=void 0,d=t;var U=l,te=w;try{te()}catch(ue){Qt(d,U,ue)}}}r=r.next}while(r!==f)}}catch(ue){Qt(t,t.return,ue)}}function vg(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Ro(t,l)}catch(r){Qt(e,e.return,r)}}}function jg(e,t,l){l.props=wr(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(r){Qt(e,t,r)}}function qo(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof l=="function"?e.refCleanup=l(r):l.current=r}}catch(d){Qt(e,t,d)}}function ma(e,t){var l=e.ref,r=e.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(d){Qt(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){Qt(e,t,d)}else l.current=null}function wg(e){var t=e.type,l=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(d){Qt(e,e.return,d)}}function dh(e,t,l){try{var r=e.stateNode;_0(r,e.type,l,t),r[it]=t}catch(d){Qt(e,e.return,d)}}function kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oi(e.type)||e.tag===4}function fh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kg(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&&Oi(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 hh(e,t,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=rt));else if(r!==4&&(r===27&&Oi(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(hh(e,t,l),e=e.sibling;e!==null;)hh(e,t,l),e=e.sibling}function ld(e,t,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(r!==4&&(r===27&&Oi(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(ld(e,t,l),e=e.sibling;e!==null;)ld(e,t,l),e=e.sibling}function Ng(e){var t=e.stateNode,l=e.memoizedProps;try{for(var r=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);fs(t,r,l),t[cn]=e,t[it]=l}catch(f){Qt(e,e.return,f)}}var Ya=!1,Gn=!1,ph=!1,Sg=typeof WeakSet=="function"?WeakSet:Set,ts=null;function Jy(e,t){if(e=e.containerInfo,Lh=Nd,e=oo(e),Mn(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var d=r.anchorOffset,f=r.focusNode;r=r.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var j=0,w=-1,U=-1,te=0,ue=0,xe=e,se=null;t:for(;;){for(var ie;xe!==l||d!==0&&xe.nodeType!==3||(w=j+d),xe!==f||r!==0&&xe.nodeType!==3||(U=j+r),xe.nodeType===3&&(j+=xe.nodeValue.length),(ie=xe.firstChild)!==null;)se=xe,xe=ie;for(;;){if(xe===e)break t;if(se===l&&++te===d&&(w=j),se===f&&++ue===r&&(U=j),(ie=xe.nextSibling)!==null)break;xe=se,se=xe.parentNode}xe=ie}l=w===-1||U===-1?null:{start:w,end:U}}else l=null}l=l||{start:0,end:0}}else l=null;for(zh={focusedElem:e,selectionRange:l},Nd=!1,ts=t;ts!==null;)if(t=ts,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ts=e;else for(;ts!==null;){switch(t=ts,f=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(l=0;l<e.length;l++)d=e[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,l=t,d=f.memoizedProps,f=f.memoizedState,r=l.stateNode;try{var qe=wr(l.type,d);e=r.getSnapshotBeforeUpdate(qe,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(et){Qt(l,l.return,et)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Hh(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hh(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,ts=e;break}ts=t.return}}function Eg(e,t,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:Xa(e,l),r&4&&Bo(5,l);break;case 1:if(Xa(e,l),r&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(j){Qt(l,l.return,j)}else{var d=wr(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){Qt(l,l.return,j)}}r&64&&vg(l),r&512&&qo(l,l.return);break;case 3:if(Xa(e,l),r&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Ro(e,t)}catch(j){Qt(l,l.return,j)}}break;case 27:t===null&&r&4&&Ng(l);case 26:case 5:Xa(e,l),t===null&&r&4&&wg(l),r&512&&qo(l,l.return);break;case 12:Xa(e,l);break;case 31:Xa(e,l),r&4&&Ag(e,l);break;case 13:Xa(e,l),r&4&&Mg(e,l),r&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=r0.bind(null,l),E0(e,l))));break;case 22:if(r=l.memoizedState!==null||Ya,!r){t=t!==null&&t.memoizedState!==null||Gn,d=Ya;var f=Gn;Ya=r,(Gn=t)&&!f?Qa(e,l,(l.subtreeFlags&8772)!==0):Xa(e,l),Ya=d,Gn=f}break;case 30:break;default:Xa(e,l)}}function Tg(e){var t=e.alternate;t!==null&&(e.alternate=null,Tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&As(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 Sn=null,Fs=!1;function Va(e,t,l){for(l=l.child;l!==null;)Cg(e,t,l),l=l.sibling}function Cg(e,t,l){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(dt,l)}catch{}switch(l.tag){case 26:Gn||ma(l,t),Va(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Gn||ma(l,t);var r=Sn,d=Fs;Oi(l.type)&&(Sn=l.stateNode,Fs=!1),Va(e,t,l),Fo(l.stateNode),Sn=r,Fs=d;break;case 5:Gn||ma(l,t);case 6:if(r=Sn,d=Fs,Sn=null,Va(e,t,l),Sn=r,Fs=d,Sn!==null)if(Fs)try{(Sn.nodeType===9?Sn.body:Sn.nodeName==="HTML"?Sn.ownerDocument.body:Sn).removeChild(l.stateNode)}catch(f){Qt(l,t,f)}else try{Sn.removeChild(l.stateNode)}catch(f){Qt(l,t,f)}break;case 18:Sn!==null&&(Fs?(e=Sn,vx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ac(e)):vx(Sn,l.stateNode));break;case 4:r=Sn,d=Fs,Sn=l.stateNode.containerInfo,Fs=!0,Va(e,t,l),Sn=r,Fs=d;break;case 0:case 11:case 14:case 15:Ei(2,l,t),Gn||Ei(4,l,t),Va(e,t,l);break;case 1:Gn||(ma(l,t),r=l.stateNode,typeof r.componentWillUnmount=="function"&&jg(l,t,r)),Va(e,t,l);break;case 21:Va(e,t,l);break;case 22:Gn=(r=Gn)||l.memoizedState!==null,Va(e,t,l),Gn=r;break;default:Va(e,t,l)}}function Ag(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ac(e)}catch(l){Qt(t,t.return,l)}}}function Mg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ac(e)}catch(l){Qt(t,t.return,l)}}function Wy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sg),t;default:throw Error(c(435,e.tag))}}function ad(e,t){var l=Wy(e);t.forEach(function(r){if(!l.has(r)){l.add(r);var d=c0.bind(null,e,r);r.then(d,d)}})}function Ps(e,t){var l=t.deletions;if(l!==null)for(var r=0;r<l.length;r++){var d=l[r],f=e,j=t,w=j;e:for(;w!==null;){switch(w.tag){case 27:if(Oi(w.type)){Sn=w.stateNode,Fs=!1;break e}break;case 5:Sn=w.stateNode,Fs=!1;break e;case 3:case 4:Sn=w.stateNode.containerInfo,Fs=!0;break e}w=w.return}if(Sn===null)throw Error(c(160));Cg(f,j,d),Sn=null,Fs=!1,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rg(t,e),t=t.sibling}var Vl=null;function Rg(e,t){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ps(t,e),Js(e),r&4&&(Ei(3,e,e.return),Bo(3,e),Ei(5,e,e.return));break;case 1:Ps(t,e),Js(e),r&512&&(Gn||l===null||ma(l,l.return)),r&64&&Ya&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var d=Vl;if(Ps(t,e),Js(e),r&512&&(Gn||l===null||ma(l,l.return)),r&4){var f=l!==null?l.memoizedState:null;if(r=e.memoizedState,l===null)if(r===null)if(e.stateNode===null){e:{r=e.type,l=e.memoizedProps,d=d.ownerDocument||d;t:switch(r){case"title":f=d.getElementsByTagName("title")[0],(!f||f[as]||f[cn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(r),d.head.insertBefore(f,d.querySelector("head > title"))),fs(f,r,l),f[cn]=e,st(f),r=f;break e;case"link":var j=Rx("link","href",d).get(r+(l.href||""));if(j){for(var w=0;w<j.length;w++)if(f=j[w],f.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&f.getAttribute("rel")===(l.rel==null?null:l.rel)&&f.getAttribute("title")===(l.title==null?null:l.title)&&f.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(w,1);break t}}f=d.createElement(r),fs(f,r,l),d.head.appendChild(f);break;case"meta":if(j=Rx("meta","content",d).get(r+(l.content||""))){for(w=0;w<j.length;w++)if(f=j[w],f.getAttribute("content")===(l.content==null?null:""+l.content)&&f.getAttribute("name")===(l.name==null?null:l.name)&&f.getAttribute("property")===(l.property==null?null:l.property)&&f.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&f.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(w,1);break t}}f=d.createElement(r),fs(f,r,l),d.head.appendChild(f);break;default:throw Error(c(468,r))}f[cn]=e,st(f),r=f}e.stateNode=r}else Dx(d,e.type,e.stateNode);else e.stateNode=Mx(d,r,e.memoizedProps);else f!==r?(f===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):f.count--,r===null?Dx(d,e.type,e.stateNode):Mx(d,r,e.memoizedProps)):r===null&&e.stateNode!==null&&dh(e,e.memoizedProps,l.memoizedProps)}break;case 27:Ps(t,e),Js(e),r&512&&(Gn||l===null||ma(l,l.return)),l!==null&&r&4&&dh(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Ps(t,e),Js(e),r&512&&(Gn||l===null||ma(l,l.return)),e.flags&32){d=e.stateNode;try{J(d,"")}catch(qe){Qt(e,e.return,qe)}}r&4&&e.stateNode!=null&&(d=e.memoizedProps,dh(e,d,l!==null?l.memoizedProps:d)),r&1024&&(ph=!0);break;case 6:if(Ps(t,e),Js(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,l=e.stateNode;try{l.nodeValue=r}catch(qe){Qt(e,e.return,qe)}}break;case 3:if(vd=null,d=Vl,Vl=_d(t.containerInfo),Ps(t,e),Vl=d,Js(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{Ac(t.containerInfo)}catch(qe){Qt(e,e.return,qe)}ph&&(ph=!1,Dg(e));break;case 4:r=Vl,Vl=_d(e.stateNode.containerInfo),Ps(t,e),Js(e),Vl=r;break;case 12:Ps(t,e),Js(e);break;case 31:Ps(t,e),Js(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ad(e,r)));break;case 13:Ps(t,e),Js(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(rd=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ad(e,r)));break;case 22:d=e.memoizedState!==null;var U=l!==null&&l.memoizedState!==null,te=Ya,ue=Gn;if(Ya=te||d,Gn=ue||U,Ps(t,e),Gn=ue,Ya=te,Js(e),r&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(l===null||U||Ya||Gn||kr(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){U=l=t;try{if(f=U.stateNode,d)j=f.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{w=U.stateNode;var xe=U.memoizedProps.style,se=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;w.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(qe){Qt(U,U.return,qe)}}}else if(t.tag===6){if(l===null){U=t;try{U.stateNode.nodeValue=d?"":U.memoizedProps}catch(qe){Qt(U,U.return,qe)}}}else if(t.tag===18){if(l===null){U=t;try{var ie=U.stateNode;d?jx(ie,!0):jx(U.stateNode,!1)}catch(qe){Qt(U,U.return,qe)}}}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;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,ad(e,l))));break;case 19:Ps(t,e),Js(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ad(e,r)));break;case 30:break;case 21:break;default:Ps(t,e),Js(e)}}function Js(e){var t=e.flags;if(t&2){try{for(var l,r=e.return;r!==null;){if(kg(r)){l=r;break}r=r.return}if(l==null)throw Error(c(160));switch(l.tag){case 27:var d=l.stateNode,f=fh(e);ld(e,f,d);break;case 5:var j=l.stateNode;l.flags&32&&(J(j,""),l.flags&=-33);var w=fh(e);ld(e,w,j);break;case 3:case 4:var U=l.stateNode.containerInfo,te=fh(e);hh(e,te,U);break;default:throw Error(c(161))}}catch(ue){Qt(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eg(e,t.alternate,t),t=t.sibling}function kr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ei(4,t,t.return),kr(t);break;case 1:ma(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&jg(t,t.return,l),kr(t);break;case 27:Fo(t.stateNode);case 26:case 5:ma(t,t.return),kr(t);break;case 22:t.memoizedState===null&&kr(t);break;case 30:kr(t);break;default:kr(t)}e=e.sibling}}function Qa(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,d=e,f=t,j=f.flags;switch(f.tag){case 0:case 11:case 15:Qa(d,f,l),Bo(4,f);break;case 1:if(Qa(d,f,l),r=f,d=r.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(te){Qt(r,r.return,te)}if(r=f,d=r.updateQueue,d!==null){var w=r.stateNode;try{var U=d.shared.hiddenCallbacks;if(U!==null)for(d.shared.hiddenCallbacks=null,d=0;d<U.length;d++)Xu(U[d],w)}catch(te){Qt(r,r.return,te)}}l&&j&64&&vg(f),qo(f,f.return);break;case 27:Ng(f);case 26:case 5:Qa(d,f,l),l&&r===null&&j&4&&wg(f),qo(f,f.return);break;case 12:Qa(d,f,l);break;case 31:Qa(d,f,l),l&&j&4&&Ag(d,f);break;case 13:Qa(d,f,l),l&&j&4&&Mg(d,f);break;case 22:f.memoizedState===null&&Qa(d,f,l),qo(f,f.return);break;case 30:break;default:Qa(d,f,l)}t=t.sibling}}function mh(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&mr(l))}function gh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e))}function Xl(e,t,l,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Og(e,t,l,r),t=t.sibling}function Og(e,t,l,r){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Xl(e,t,l,r),d&2048&&Bo(9,t);break;case 1:Xl(e,t,l,r);break;case 3:Xl(e,t,l,r),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e)));break;case 12:if(d&2048){Xl(e,t,l,r),e=t.stateNode;try{var f=t.memoizedProps,j=f.id,w=f.onPostCommit;typeof w=="function"&&w(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(U){Qt(t,t.return,U)}}else Xl(e,t,l,r);break;case 31:Xl(e,t,l,r);break;case 13:Xl(e,t,l,r);break;case 23:break;case 22:f=t.stateNode,j=t.alternate,t.memoizedState!==null?f._visibility&2?Xl(e,t,l,r):Go(e,t):f._visibility&2?Xl(e,t,l,r):(f._visibility|=2,_c(e,t,l,r,(t.subtreeFlags&10256)!==0||!1)),d&2048&&mh(j,t);break;case 24:Xl(e,t,l,r),d&2048&&gh(t.alternate,t);break;default:Xl(e,t,l,r)}}function _c(e,t,l,r,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,j=t,w=l,U=r,te=j.flags;switch(j.tag){case 0:case 11:case 15:_c(f,j,w,U,d),Bo(8,j);break;case 23:break;case 22:var ue=j.stateNode;j.memoizedState!==null?ue._visibility&2?_c(f,j,w,U,d):Go(f,j):(ue._visibility|=2,_c(f,j,w,U,d)),d&&te&2048&&mh(j.alternate,j);break;case 24:_c(f,j,w,U,d),d&&te&2048&&gh(j.alternate,j);break;default:_c(f,j,w,U,d)}t=t.sibling}}function Go(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,r=t,d=r.flags;switch(r.tag){case 22:Go(l,r),d&2048&&mh(r.alternate,r);break;case 24:Go(l,r),d&2048&&gh(r.alternate,r);break;default:Go(l,r)}t=t.sibling}}var $o=8192;function yc(e,t,l){if(e.subtreeFlags&$o)for(e=e.child;e!==null;)Lg(e,t,l),e=e.sibling}function Lg(e,t,l){switch(e.tag){case 26:yc(e,t,l),e.flags&$o&&e.memoizedState!==null&&H0(l,Vl,e.memoizedState,e.memoizedProps);break;case 5:yc(e,t,l);break;case 3:case 4:var r=Vl;Vl=_d(e.stateNode.containerInfo),yc(e,t,l),Vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=$o,$o=16777216,yc(e,t,l),$o=r):yc(e,t,l));break;default:yc(e,t,l)}}function zg(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 Yo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var r=t[l];ts=r,Ug(r,e)}zg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ig(e),e=e.sibling}function Ig(e){switch(e.tag){case 0:case 11:case 15:Yo(e),e.flags&2048&&Ei(9,e,e.return);break;case 3:Yo(e);break;case 12:Yo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,id(e)):Yo(e);break;default:Yo(e)}}function id(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var r=t[l];ts=r,Ug(r,e)}zg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ei(8,t,t.return),id(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,id(t));break;default:id(t)}e=e.sibling}}function Ug(e,t){for(;ts!==null;){var l=ts;switch(l.tag){case 0:case 11:case 15:Ei(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:mr(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,ts=r;else e:for(l=e;ts!==null;){r=ts;var d=r.sibling,f=r.return;if(Tg(r),r===l){ts=null;break e}if(d!==null){d.return=f,ts=d;break e}ts=f}}}var e0={getCacheForType:function(e){var t=Kn(wn),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Kn(wn).controller.signal}},t0=typeof WeakMap=="function"?WeakMap:Map,Ht=0,sn=null,yt=null,kt=0,Xt=0,cl=null,Ti=!1,vc=!1,xh=!1,Ka=0,Dn=0,Ci=0,Nr=0,bh=0,ol=0,jc=0,Vo=null,Ws=null,_h=!1,rd=0,Hg=0,cd=1/0,od=null,Ai=null,Zn=0,Mi=null,wc=null,Za=0,yh=0,vh=null,Bg=null,Xo=0,jh=null;function ul(){return(Ht&2)!==0&&kt!==0?kt&-kt:M.T!==null?Th():xs()}function qg(){if(ol===0)if((kt&536870912)===0||ft){var e=We;We<<=1,(We&3932160)===0&&(We=262144),ol=e}else ol=536870912;return e=Ut.current,e!==null&&(e.flags|=32),ol}function el(e,t,l){(e===sn&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)&&(kc(e,0),Ri(e,kt,ol,!1)),P(e,l),((Ht&2)===0||e!==sn)&&(e===sn&&((Ht&2)===0&&(Nr|=l),Dn===4&&Ri(e,kt,ol,!1)),ga(e))}function Gg(e,t,l){if((Ht&6)!==0)throw Error(c(327));var r=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Wt(e,t),d=r?l0(e,t):kh(e,t,!0),f=r;do{if(d===0){vc&&!r&&Ri(e,t,0,!1);break}else{if(l=e.current.alternate,f&&!n0(l)){d=kh(e,t,!1),f=!1;continue}if(d===2){if(f=t,e.errorRecoveryDisabledLanes&f)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var w=e;d=Vo;var U=w.current.memoizedState.isDehydrated;if(U&&(kc(w,j).flags|=256),j=kh(w,j,!1),j!==2){if(xh&&!U){w.errorRecoveryDisabledLanes|=f,Nr|=f,d=4;break e}f=Ws,Ws=d,f!==null&&(Ws===null?Ws=f:Ws.push.apply(Ws,f))}d=j}if(f=!1,d!==2)continue}}if(d===1){kc(e,0),Ri(e,t,0,!0);break}e:{switch(r=e,f=d,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ri(r,t,ol,!Ti);break e;case 2:Ws=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(d=rd+300-Oe(),10<d)){if(Ri(r,t,ol,!Ti),On(r,0,!0)!==0)break e;Za=t,r.timeoutHandle=_x($g.bind(null,r,l,Ws,od,_h,t,ol,Nr,jc,Ti,f,"Throttled",-0,0),d);break e}$g(r,l,Ws,od,_h,t,ol,Nr,jc,Ti,f,null,-0,0)}}break}while(!0);ga(e)}function $g(e,t,l,r,d,f,j,w,U,te,ue,xe,se,ie){if(e.timeoutHandle=-1,xe=t.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rt},Lg(t,f,xe);var qe=(f&62914560)===f?rd-Oe():(f&4194048)===f?Hg-Oe():0;if(qe=B0(xe,qe),qe!==null){Za=f,e.cancelPendingCommit=qe(Pg.bind(null,e,t,f,l,r,d,j,w,U,ue,xe,null,se,ie)),Ri(e,f,j,!te);return}}Pg(e,t,f,l,r,d,j,w,U)}function n0(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var d=l[r],f=d.getSnapshot;d=d.value;try{if(!es(f(),d))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Ri(e,t,l,r){t&=~bh,t&=~Nr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var d=t;0<d;){var f=31-St(d),j=1<<f;r[f]=-1,d&=~j}l!==0&&Re(e,l,t)}function ud(){return(Ht&6)===0?(Qo(0),!1):!0}function wh(){if(yt!==null){if(Xt===0)var e=yt.return;else e=yt,Bl=La=null,Hf(e),Ha=null,br=0,e=yt;for(;e!==null;)yg(e.alternate,e),e=e.return;yt=null}}function kc(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,j0(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Za=0,wh(),sn=e,yt=l=Il(e.current,null),kt=t,Xt=0,cl=null,Ti=!1,vc=Wt(e,t),xh=!1,jc=ol=bh=Nr=Ci=Dn=0,Ws=Vo=null,_h=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var d=31-St(r),f=1<<d;t|=e[d],r&=~f}return Ka=t,sc(),l}function Yg(e,t){le=null,M.H=Io,t===ki||t===bl?(t=Co(),Xt=3):t===To?(t=Co(),Xt=4):Xt=t===th?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cl=t,yt===null&&(Dn=1,Wu(e,js(t,e.current)))}function Vg(){var e=Ut.current;return e===null?!0:(kt&4194048)===kt?kn===null:(kt&62914560)===kt||(kt&536870912)!==0?e===kn:!1}function Xg(){var e=M.H;return M.H=Io,e===null?Io:e}function Qg(){var e=M.A;return M.A=e0,e}function dd(){Dn=4,Ti||(kt&4194048)!==kt&&Ut.current!==null||(vc=!0),(Ci&134217727)===0&&(Nr&134217727)===0||sn===null||Ri(sn,kt,ol,!1)}function kh(e,t,l){var r=Ht;Ht|=2;var d=Xg(),f=Qg();(sn!==e||kt!==t)&&(od=null,kc(e,t)),t=!1;var j=Dn;e:do try{if(Xt!==0&&yt!==null){var w=yt,U=cl;switch(Xt){case 8:wh(),j=6;break e;case 3:case 2:case 9:case 6:Ut.current===null&&(t=!0);var te=Xt;if(Xt=0,cl=null,Nc(e,w,U,te),l&&vc){j=0;break e}break;default:te=Xt,Xt=0,cl=null,Nc(e,w,U,te)}}s0(),j=Dn;break}catch(ue){Yg(e,ue)}while(!0);return t&&e.shellSuspendCounter++,Bl=La=null,Ht=r,M.H=d,M.A=f,yt===null&&(sn=null,kt=0,sc()),j}function s0(){for(;yt!==null;)Kg(yt)}function l0(e,t){var l=Ht;Ht|=2;var r=Xg(),d=Qg();sn!==e||kt!==t?(od=null,cd=Oe()+500,kc(e,t)):vc=Wt(e,t);e:do try{if(Xt!==0&&yt!==null){t=yt;var f=cl;t:switch(Xt){case 1:Xt=0,cl=null,Nc(e,t,f,1);break;case 2:case 9:if(Gl(f)){Xt=0,cl=null,Zg(t);break}t=function(){Xt!==2&&Xt!==9||sn!==e||(Xt=7),ga(e)},f.then(t,t);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:Gl(f)?(Xt=0,cl=null,Zg(t)):(Xt=0,cl=null,Nc(e,t,f,7));break;case 5:var j=null;switch(yt.tag){case 26:j=yt.memoizedState;case 5:case 27:var w=yt;if(j?Ox(j):w.stateNode.complete){Xt=0,cl=null;var U=w.sibling;if(U!==null)yt=U;else{var te=w.return;te!==null?(yt=te,fd(te)):yt=null}break t}}Xt=0,cl=null,Nc(e,t,f,5);break;case 6:Xt=0,cl=null,Nc(e,t,f,6);break;case 8:wh(),Dn=6;break e;default:throw Error(c(462))}}a0();break}catch(ue){Yg(e,ue)}while(!0);return Bl=La=null,M.H=r,M.A=d,Ht=l,yt!==null?0:(sn=null,kt=0,sc(),Dn)}function a0(){for(;yt!==null&&!jt();)Kg(yt)}function Kg(e){var t=bg(e.alternate,e,Ka);e.memoizedProps=e.pendingProps,t===null?fd(e):yt=t}function Zg(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=fg(l,t,t.pendingProps,t.type,void 0,kt);break;case 11:t=fg(l,t,t.pendingProps,t.type.render,t.ref,kt);break;case 5:Hf(t);default:yg(l,t),t=yt=Iu(t,Ka),t=bg(l,t,Ka)}e.memoizedProps=e.pendingProps,t===null?fd(e):yt=t}function Nc(e,t,l,r){Bl=La=null,Hf(t),Ha=null,br=0;var d=t.return;try{if(Qy(e,d,t,l,kt)){Dn=1,Wu(e,js(l,e.current)),yt=null;return}}catch(f){if(d!==null)throw yt=d,f;Dn=1,Wu(e,js(l,e.current)),yt=null;return}t.flags&32768?(ft||r===1?e=!0:vc||(kt&536870912)!==0?e=!1:(Ti=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ut.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fg(t,e)):fd(t)}function fd(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,Ti);return}e=t.return;var l=Fy(t.alternate,t,Ka);if(l!==null){yt=l;return}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);Dn===0&&(Dn=5)}function Fg(e,t){do{var l=Py(e.alternate,e);if(l!==null){l.flags&=32767,yt=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){yt=e;return}yt=e=l}while(e!==null);Dn=6,yt=null}function Pg(e,t,l,r,d,f,j,w,U){e.cancelPendingCommit=null;do hd();while(Zn!==0);if((Ht&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=po,pe(e,l,f,j,w,U),e===sn&&(yt=sn=null,kt=0),wc=t,Mi=e,Za=l,yh=f,vh=d,Bg=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,o0(Te,function(){return nx(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=M.T,M.T=null,d=N.p,N.p=2,j=Ht,Ht|=4;try{Jy(e,t,l)}finally{Ht=j,N.p=d,M.T=r}}Zn=1,Jg(),Wg(),ex()}}function Jg(){if(Zn===1){Zn=0;var e=Mi,t=wc,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var r=N.p;N.p=2;var d=Ht;Ht|=4;try{Rg(t,e);var f=zh,j=oo(e.containerInfo),w=f.focusedElem,U=f.selectionRange;if(j!==w&&w&&w.ownerDocument&&ur(w.ownerDocument.documentElement,w)){if(U!==null&&Mn(w)){var te=U.start,ue=U.end;if(ue===void 0&&(ue=te),"selectionStart"in w)w.selectionStart=te,w.selectionEnd=Math.min(ue,w.value.length);else{var xe=w.ownerDocument||document,se=xe&&xe.defaultView||window;if(se.getSelection){var ie=se.getSelection(),qe=w.textContent.length,et=Math.min(U.start,qe),Pt=U.end===void 0?et:Math.min(U.end,qe);!ie.extend&&et>Pt&&(j=Pt,Pt=et,et=j);var F=or(w,et),Y=or(w,Pt);if(F&&Y&&(ie.rangeCount!==1||ie.anchorNode!==F.node||ie.anchorOffset!==F.offset||ie.focusNode!==Y.node||ie.focusOffset!==Y.offset)){var ee=xe.createRange();ee.setStart(F.node,F.offset),ie.removeAllRanges(),et>Pt?(ie.addRange(ee),ie.extend(Y.node,Y.offset)):(ee.setEnd(Y.node,Y.offset),ie.addRange(ee))}}}}for(xe=[],ie=w;ie=ie.parentNode;)ie.nodeType===1&&xe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<xe.length;w++){var me=xe[w];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Nd=!!Lh,zh=Lh=null}finally{Ht=d,N.p=r,M.T=l}}e.current=t,Zn=2}}function Wg(){if(Zn===2){Zn=0;var e=Mi,t=wc,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var r=N.p;N.p=2;var d=Ht;Ht|=4;try{Eg(e,t.alternate,t)}finally{Ht=d,N.p=r,M.T=l}}Zn=3}}function ex(){if(Zn===4||Zn===3){Zn=0,Z();var e=Mi,t=wc,l=Za,r=Bg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Zn=5:(Zn=0,wc=Mi=null,tx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ai=null),wt(l),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(dt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=M.T,d=N.p,N.p=2,M.T=null;try{for(var f=e.onRecoverableError,j=0;j<r.length;j++){var w=r[j];f(w.value,{componentStack:w.stack})}}finally{M.T=t,N.p=d}}(Za&3)!==0&&hd(),ga(e),d=e.pendingLanes,(l&261930)!==0&&(d&42)!==0?e===jh?Xo++:(Xo=0,jh=e):Xo=0,Qo(0)}}function tx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function hd(){return Jg(),Wg(),ex(),nx()}function nx(){if(Zn!==5)return!1;var e=Mi,t=yh;yh=0;var l=wt(Za),r=M.T,d=N.p;try{N.p=32>l?32:l,M.T=null,l=vh,vh=null;var f=Mi,j=Za;if(Zn=0,wc=Mi=null,Za=0,(Ht&6)!==0)throw Error(c(331));var w=Ht;if(Ht|=4,Ig(f.current),Og(f,f.current,j,l),Ht=w,Qo(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(dt,f)}catch{}return!0}finally{N.p=d,M.T=r,tx(e,t)}}function sx(e,t,l){t=js(l,t),t=eh(e.stateNode,t,2),e=pa(e,t,2),e!==null&&(P(e,2),ga(e))}function Qt(e,t,l){if(e.tag===3)sx(e,e,l);else for(;t!==null;){if(t.tag===3){sx(t,e,l);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ai===null||!Ai.has(r))){e=js(l,e),l=lg(2),r=pa(t,l,2),r!==null&&(ag(l,r,t,e),P(r,2),ga(r));break}}t=t.return}}function Nh(e,t,l){var r=e.pingCache;if(r===null){r=e.pingCache=new t0;var d=new Set;r.set(t,d)}else d=r.get(t),d===void 0&&(d=new Set,r.set(t,d));d.has(l)||(xh=!0,d.add(l),e=i0.bind(null,e,t,l),t.then(e,e))}function i0(e,t,l){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,sn===e&&(kt&l)===l&&(Dn===4||Dn===3&&(kt&62914560)===kt&&300>Oe()-rd?(Ht&2)===0&&kc(e,0):bh|=l,jc===kt&&(jc=0)),ga(e)}function lx(e,t){t===0&&(t=Yt()),e=il(e,t),e!==null&&(P(e,t),ga(e))}function r0(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),lx(e,l)}function c0(e,t){var l=0;switch(e.tag){case 31:case 13:var r=e.stateNode,d=e.memoizedState;d!==null&&(l=d.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),lx(e,l)}function o0(e,t){return an(e,t)}var pd=null,Sc=null,Sh=!1,md=!1,Eh=!1,Di=0;function ga(e){e!==Sc&&e.next===null&&(Sc===null?pd=Sc=e:Sc=Sc.next=e),md=!0,Sh||(Sh=!0,d0())}function Qo(e,t){if(!Eh&&md){Eh=!0;do for(var l=!1,r=pd;r!==null;){if(e!==0){var d=r.pendingLanes;if(d===0)var f=0;else{var j=r.suspendedLanes,w=r.pingedLanes;f=(1<<31-St(42|e)+1)-1,f&=d&~(j&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(l=!0,cx(r,f))}else f=kt,f=On(r,r===sn?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||Wt(r,f)||(l=!0,cx(r,f));r=r.next}while(l);Eh=!1}}function u0(){ax()}function ax(){md=Sh=!1;var e=0;Di!==0&&v0()&&(e=Di);for(var t=Oe(),l=null,r=pd;r!==null;){var d=r.next,f=ix(r,t);f===0?(r.next=null,l===null?pd=d:l.next=d,d===null&&(Sc=l)):(l=r,(e!==0||(f&3)!==0)&&(md=!0)),r=d}Zn!==0&&Zn!==5||Qo(e),Di!==0&&(Di=0)}function ix(e,t){for(var l=e.suspendedLanes,r=e.pingedLanes,d=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var j=31-St(f),w=1<<j,U=d[j];U===-1?((w&l)===0||(w&r)!==0)&&(d[j]=bn(w,t)):U<=t&&(e.expiredLanes|=w),f&=~w}if(t=sn,l=kt,l=On(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,l===0||e===t&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Vn(r),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Wt(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(r!==null&&Vn(r),wt(l)){case 2:case 8:l=Ee;break;case 32:l=Te;break;case 268435456:l=Ve;break;default:l=Te}return r=rx.bind(null,e),l=an(l,r),e.callbackPriority=t,e.callbackNode=l,t}return r!==null&&r!==null&&Vn(r),e.callbackPriority=2,e.callbackNode=null,2}function rx(e,t){if(Zn!==0&&Zn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(hd()&&e.callbackNode!==l)return null;var r=kt;return r=On(e,e===sn?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gg(e,r,t),ix(e,Oe()),e.callbackNode!=null&&e.callbackNode===l?rx.bind(null,e):null)}function cx(e,t){if(hd())return null;Gg(e,t,!0)}function d0(){w0(function(){(Ht&6)!==0?an(ut,u0):ax()})}function Th(){if(Di===0){var e=ji;e===0&&(e=Xe,Xe<<=1,(Xe&261888)===0&&(Xe=256)),Di=e}return Di}function ox(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:tn(""+e)}function ux(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function f0(e,t,l,r,d){if(t==="submit"&&l&&l.stateNode===d){var f=ox((d[it]||null).action),j=r.submitter;j&&(t=(t=j[it]||null)?ox(t.formAction):j.getAttribute("formAction"),t!==null&&(f=t,j=null));var w=new Yr("action","action",null,r,d);e.push({event:w,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Di!==0){var U=j?ux(d,j):new FormData(d);Kf(l,{pending:!0,data:U,method:d.method,action:f},null,U)}}else typeof f=="function"&&(w.preventDefault(),U=j?ux(d,j):new FormData(d),Kf(l,{pending:!0,data:U,method:d.method,action:f},f,U))},currentTarget:d}]})}}for(var Ch=0;Ch<Ra.length;Ch++){var Ah=Ra[Ch],h0=Ah.toLowerCase(),p0=Ah[0].toUpperCase()+Ah.slice(1);cs(h0,"on"+p0)}cs(hi,"onAnimationEnd"),cs(pi,"onAnimationIteration"),cs(uo,"onAnimationStart"),cs("dblclick","onDoubleClick"),cs("focusin","onFocus"),cs("focusout","onBlur"),cs(fr,"onTransitionRun"),cs(Cf,"onTransitionStart"),cs(nc,"onTransitionCancel"),cs(fo,"onTransitionEnd"),dn("onMouseEnter",["mouseout","mouseover"]),dn("onMouseLeave",["mouseout","mouseover"]),dn("onPointerEnter",["pointerout","pointerover"]),dn("onPointerLeave",["pointerout","pointerover"]),is("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),is("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),is("onBeforeInput",["compositionend","keypress","textInput","paste"]),is("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),is("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),is("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ko="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(" "),m0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ko));function dx(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var r=e[l],d=r.event;r=r.listeners;e:{var f=void 0;if(t)for(var j=r.length-1;0<=j;j--){var w=r[j],U=w.instance,te=w.currentTarget;if(w=w.listener,U!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=te;try{f(d)}catch(ue){ho(ue)}d.currentTarget=null,f=U}else for(j=0;j<r.length;j++){if(w=r[j],U=w.instance,te=w.currentTarget,w=w.listener,U!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=te;try{f(d)}catch(ue){ho(ue)}d.currentTarget=null,f=U}}}}function vt(e,t){var l=t[Es];l===void 0&&(l=t[Es]=new Set);var r=e+"__bubble";l.has(r)||(fx(t,e,2,!1),l.add(r))}function Mh(e,t,l){var r=0;t&&(r|=4),fx(l,e,r,t)}var gd="_reactListening"+Math.random().toString(36).slice(2);function Rh(e){if(!e[gd]){e[gd]=!0,Pn.forEach(function(l){l!=="selectionchange"&&(m0.has(l)||Mh(l,!1,e),Mh(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gd]||(t[gd]=!0,Mh("selectionchange",!1,t))}}function fx(e,t,l,r){switch(qx(t)){case 2:var d=$0;break;case 8:d=Y0;break;default:d=Qh}l=d.bind(null,t,l,e),d=void 0,!Wn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),r?d!==void 0?e.addEventListener(t,l,{capture:!0,passive:d}):e.addEventListener(t,l,!0):d!==void 0?e.addEventListener(t,l,{passive:d}):e.addEventListener(t,l,!1)}function Dh(e,t,l,r,d){var f=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var j=r.tag;if(j===3||j===4){var w=r.stateNode.containerInfo;if(w===d)break;if(j===4)for(j=r.return;j!==null;){var U=j.tag;if((U===3||U===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;w!==null;){if(j=Zt(w),j===null)return;if(U=j.tag,U===5||U===6||U===26||U===27){r=f=j;continue e}w=w.parentNode}}r=r.return}si(function(){var te=f,ue=fn(l),xe=[];e:{var se=ne.get(e);if(se!==void 0){var ie=Yr,qe=e;switch(e){case"keypress":if(_s(l)===0)break e;case"keydown":case"keyup":ie=ai;break;case"focusin":qe="focus",ie=Dl;break;case"focusout":qe="blur",ie=Dl;break;case"beforeblur":case"afterblur":ie=Dl;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=er;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=sl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Kr;break;case hi:case pi:case uo:ie=na;break;case fo:ie=Ou;break;case"scroll":case"scrollend":ie=$s;break;case"wheel":ie=Fr;break;case"copy":case"cut":case"paste":ie=Xr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Du;break;case"toggle":case"beforetoggle":ie=Pr}var et=(t&4)!==0,Pt=!et&&(e==="scroll"||e==="scrollend"),F=et?se!==null?se+"Capture":null:se;et=[];for(var Y=te,ee;Y!==null;){var me=Y;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||F===null||(me=jn(Y,F),me!=null&&et.push(Zo(Y,me,ee))),Pt)break;Y=Y.return}0<et.length&&(se=new ie(se,qe,null,l,ue),xe.push({event:se,listeners:et}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",se&&l!==At&&(qe=l.relatedTarget||l.fromElement)&&(Zt(qe)||qe[un]))break e;if((ie||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,ie?(qe=l.relatedTarget||l.toElement,ie=te,qe=qe?Zt(qe):null,qe!==null&&(Pt=u(qe),et=qe.tag,qe!==Pt||et!==5&&et!==27&&et!==6)&&(qe=null)):(ie=null,qe=te),ie!==qe)){if(et=er,me="onMouseLeave",F="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(et=Du,me="onPointerLeave",F="onPointerEnter",Y="pointer"),Pt=ie==null?se:_n(ie),ee=qe==null?se:_n(qe),se=new et(me,Y+"leave",ie,l,ue),se.target=Pt,se.relatedTarget=ee,me=null,Zt(ue)===te&&(et=new et(F,Y+"enter",qe,l,ue),et.target=ee,et.relatedTarget=Pt,me=et),Pt=me,ie&&qe)t:{for(et=g0,F=ie,Y=qe,ee=0,me=F;me;me=et(me))ee++;me=0;for(var Fe=Y;Fe;Fe=et(Fe))me++;for(;0<ee-me;)F=et(F),ee--;for(;0<me-ee;)Y=et(Y),me--;for(;ee--;){if(F===Y||Y!==null&&F===Y.alternate){et=F;break t}F=et(F),Y=et(Y)}et=null}else et=null;ie!==null&&hx(xe,se,ie,et,!1),qe!==null&&Pt!==null&&hx(xe,Pt,qe,et,!0)}}e:{if(se=te?_n(te):window,ie=se.nodeName&&se.nodeName.toLowerCase(),ie==="select"||ie==="input"&&se.type==="file")var Dt=rr;else if(ia(se))if(oi)Dt=Ef;else{Dt=ec;var $e=Sf}else ie=se.nodeName,!ie||ie.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?te&&Je(te.elementType)&&(Dt=rr):Dt=co;if(Dt&&(Dt=Dt(e,te))){ro(xe,Dt,l,ue);break e}$e&&$e(e,se,te),e==="focusout"&&te&&se.type==="number"&&te.memoizedProps.value!=null&&qs(se,"number",se.value)}switch($e=te?_n(te):window,e){case"focusin":(ia($e)||$e.contentEditable==="true")&&(Ma=$e,ll=te,ui=null);break;case"focusout":ui=ll=Ma=null;break;case"mousedown":di=!0;break;case"contextmenu":case"mouseup":case"dragend":di=!1,dr(xe,l,ue);break;case"selectionchange":if(Lu)break;case"keydown":case"keyup":dr(xe,l,ue)}var pt;if(ao)e:{switch(e){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else Ol?ri(e,l)&&(Nt="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Nt="onCompositionStart");Nt&&(ar&&l.locale!=="ko"&&(Ol||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Ol&&(pt=bt()):(T=ue,ge="value"in T?T.value:T.textContent,Ol=!0)),$e=xd(te,Nt),0<$e.length&&(Nt=new sr(Nt,e,null,l,ue),xe.push({event:Nt,listeners:$e}),pt?Nt.data=pt:(pt=la(l),pt!==null&&(Nt.data=pt)))),(pt=kf?io(e,l):Nf(e,l))&&(Nt=xd(te,"onBeforeInput"),0<Nt.length&&($e=new sr("onBeforeInput","beforeinput",null,l,ue),xe.push({event:$e,listeners:Nt}),$e.data=pt)),f0(xe,e,te,l,ue)}dx(xe,t)})}function Zo(e,t,l){return{instance:e,listener:t,currentTarget:l}}function xd(e,t){for(var l=t+"Capture",r=[];e!==null;){var d=e,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=jn(e,l),d!=null&&r.unshift(Zo(e,d,f)),d=jn(e,t),d!=null&&r.push(Zo(e,d,f))),e.tag===3)return r;e=e.return}return[]}function g0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hx(e,t,l,r,d){for(var f=t._reactName,j=[];l!==null&&l!==r;){var w=l,U=w.alternate,te=w.stateNode;if(w=w.tag,U!==null&&U===r)break;w!==5&&w!==26&&w!==27||te===null||(U=te,d?(te=jn(l,f),te!=null&&j.unshift(Zo(l,te,U))):d||(te=jn(l,f),te!=null&&j.push(Zo(l,te,U)))),l=l.return}j.length!==0&&e.push({event:t,listeners:j})}var x0=/\r\n?/g,b0=/\u0000|\uFFFD/g;function px(e){return(typeof e=="string"?e:""+e).replace(x0,`
50
+ `).replace(b0,"")}function mx(e,t){return t=px(t),px(e)===t}function Ft(e,t,l,r,d,f){switch(l){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||J(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&J(e,""+r);break;case"className":Ln(e,"class",r);break;case"tabIndex":Ln(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ln(e,l,r);break;case"style":Qe(e,r,f);break;case"data":if(t!=="object"){Ln(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=tn(""+r),e.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(l,"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 f=="function"&&(l==="formAction"?(t!=="input"&&Ft(e,t,"name",d.name,d,null),Ft(e,t,"formEncType",d.formEncType,d,null),Ft(e,t,"formMethod",d.formMethod,d,null),Ft(e,t,"formTarget",d.formTarget,d,null)):(Ft(e,t,"encType",d.encType,d,null),Ft(e,t,"method",d.method,d,null),Ft(e,t,"target",d.target,d,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=tn(""+r),e.setAttribute(l,r);break;case"onClick":r!=null&&(e.onclick=rt);break;case"onScroll":r!=null&&vt("scroll",e);break;case"onScrollEnd":r!=null&&vt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(l=r.__html,l!=null){if(d.children!=null)throw Error(c(60));e.innerHTML=l}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}l=tn(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""+r):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":r===!0?e.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,r):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(l,r):e.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(l):e.setAttribute(l,r);break;case"popover":vt("beforetoggle",e),vt("toggle",e),En(e,"popover",r);break;case"xlinkActuate":Bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Bn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Bn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Bn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Bn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":En(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Vt.get(l)||l,En(e,l,r))}}function Oh(e,t,l,r,d,f){switch(l){case"style":Qe(e,r,f);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(l=r.__html,l!=null){if(d.children!=null)throw Error(c(60));e.innerHTML=l}}break;case"children":typeof r=="string"?J(e,r):(typeof r=="number"||typeof r=="bigint")&&J(e,""+r);break;case"onScroll":r!=null&&vt("scroll",e);break;case"onScrollEnd":r!=null&&vt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=rt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qn.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),t=l.slice(2,d?l.length-7:void 0),f=e[it]||null,f=f!=null?f[l]:null,typeof f=="function"&&e.removeEventListener(t,f,d),typeof r=="function")){typeof f!="function"&&f!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,r,d);break e}l in e?e[l]=r:r===!0?e.setAttribute(l,""):En(e,l,r)}}}function fs(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":vt("error",e),vt("load",e);var r=!1,d=!1,f;for(f in l)if(l.hasOwnProperty(f)){var j=l[f];if(j!=null)switch(f){case"src":r=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ft(e,t,f,j,l,null)}}d&&Ft(e,t,"srcSet",l.srcSet,l,null),r&&Ft(e,t,"src",l.src,l,null);return;case"input":vt("invalid",e);var w=f=j=d=null,U=null,te=null;for(r in l)if(l.hasOwnProperty(r)){var ue=l[r];if(ue!=null)switch(r){case"name":d=ue;break;case"type":j=ue;break;case"checked":U=ue;break;case"defaultChecked":te=ue;break;case"value":f=ue;break;case"defaultValue":w=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(c(137,t));break;default:Ft(e,t,r,ue,l,null)}}Wl(e,f,w,U,te,j,d,!1);return;case"select":vt("invalid",e),r=j=f=null;for(d in l)if(l.hasOwnProperty(d)&&(w=l[d],w!=null))switch(d){case"value":f=w;break;case"defaultValue":j=w;break;case"multiple":r=w;default:Ft(e,t,d,w,l,null)}t=f,l=j,e.multiple=!!r,t!=null?vn(e,!!r,t,!1):l!=null&&vn(e,!!r,l,!0);return;case"textarea":vt("invalid",e),f=d=r=null;for(j in l)if(l.hasOwnProperty(j)&&(w=l[j],w!=null))switch(j){case"value":r=w;break;case"defaultValue":d=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(c(91));break;default:Ft(e,t,j,w,l,null)}R(e,r,d,f);return;case"option":for(U in l)if(l.hasOwnProperty(U)&&(r=l[U],r!=null))switch(U){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ft(e,t,U,r,l,null)}return;case"dialog":vt("beforetoggle",e),vt("toggle",e),vt("cancel",e),vt("close",e);break;case"iframe":case"object":vt("load",e);break;case"video":case"audio":for(r=0;r<Ko.length;r++)vt(Ko[r],e);break;case"image":vt("error",e),vt("load",e);break;case"details":vt("toggle",e);break;case"embed":case"source":case"link":vt("error",e),vt("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(te in l)if(l.hasOwnProperty(te)&&(r=l[te],r!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ft(e,t,te,r,l,null)}return;default:if(Je(t)){for(ue in l)l.hasOwnProperty(ue)&&(r=l[ue],r!==void 0&&Oh(e,t,ue,r,l,void 0));return}}for(w in l)l.hasOwnProperty(w)&&(r=l[w],r!=null&&Ft(e,t,w,r,l,null))}function _0(e,t,l,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,f=null,j=null,w=null,U=null,te=null,ue=null;for(ie in l){var xe=l[ie];if(l.hasOwnProperty(ie)&&xe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":U=xe;default:r.hasOwnProperty(ie)||Ft(e,t,ie,null,r,xe)}}for(var se in r){var ie=r[se];if(xe=l[se],r.hasOwnProperty(se)&&(ie!=null||xe!=null))switch(se){case"type":f=ie;break;case"name":d=ie;break;case"checked":te=ie;break;case"defaultChecked":ue=ie;break;case"value":j=ie;break;case"defaultValue":w=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:ie!==xe&&Ft(e,t,se,ie,r,xe)}}Tl(e,j,w,U,te,ue,f,d);return;case"select":ie=j=w=se=null;for(f in l)if(U=l[f],l.hasOwnProperty(f)&&U!=null)switch(f){case"value":break;case"multiple":ie=U;default:r.hasOwnProperty(f)||Ft(e,t,f,null,r,U)}for(d in r)if(f=r[d],U=l[d],r.hasOwnProperty(d)&&(f!=null||U!=null))switch(d){case"value":se=f;break;case"defaultValue":w=f;break;case"multiple":j=f;default:f!==U&&Ft(e,t,d,f,r,U)}t=w,l=j,r=ie,se!=null?vn(e,!!l,se,!1):!!r!=!!l&&(t!=null?vn(e,!!l,t,!0):vn(e,!!l,l?[]:"",!1));return;case"textarea":ie=se=null;for(w in l)if(d=l[w],l.hasOwnProperty(w)&&d!=null&&!r.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ft(e,t,w,null,r,d)}for(j in r)if(d=r[j],f=l[j],r.hasOwnProperty(j)&&(d!=null||f!=null))switch(j){case"value":se=d;break;case"defaultValue":ie=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(c(91));break;default:d!==f&&Ft(e,t,j,d,r,f)}Se(e,se,ie);return;case"option":for(var qe in l)if(se=l[qe],l.hasOwnProperty(qe)&&se!=null&&!r.hasOwnProperty(qe))switch(qe){case"selected":e.selected=!1;break;default:Ft(e,t,qe,null,r,se)}for(U in r)if(se=r[U],ie=l[U],r.hasOwnProperty(U)&&se!==ie&&(se!=null||ie!=null))switch(U){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Ft(e,t,U,se,r,ie)}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 et in l)se=l[et],l.hasOwnProperty(et)&&se!=null&&!r.hasOwnProperty(et)&&Ft(e,t,et,null,r,se);for(te in r)if(se=r[te],ie=l[te],r.hasOwnProperty(te)&&se!==ie&&(se!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Ft(e,t,te,se,r,ie)}return;default:if(Je(t)){for(var Pt in l)se=l[Pt],l.hasOwnProperty(Pt)&&se!==void 0&&!r.hasOwnProperty(Pt)&&Oh(e,t,Pt,void 0,r,se);for(ue in r)se=r[ue],ie=l[ue],!r.hasOwnProperty(ue)||se===ie||se===void 0&&ie===void 0||Oh(e,t,ue,se,r,ie);return}}for(var F in l)se=l[F],l.hasOwnProperty(F)&&se!=null&&!r.hasOwnProperty(F)&&Ft(e,t,F,null,r,se);for(xe in r)se=r[xe],ie=l[xe],!r.hasOwnProperty(xe)||se===ie||se==null&&ie==null||Ft(e,t,xe,se,r,ie)}function gx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var d=l[r],f=d.transferSize,j=d.initiatorType,w=d.duration;if(f&&w&&gx(j)){for(j=0,w=d.responseEnd,r+=1;r<l.length;r++){var U=l[r],te=U.startTime;if(te>w)break;var ue=U.transferSize,xe=U.initiatorType;ue&&gx(xe)&&(U=U.responseEnd,j+=ue*(U<w?1:(w-te)/(U-te)))}if(--r,t+=8*(f+j)/(d.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 Lh=null,zh=null;function bd(e){return e.nodeType===9?e:e.ownerDocument}function xx(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 bx(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 Ih(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 Uh=null;function v0(){var e=window.event;return e&&e.type==="popstate"?e===Uh?!1:(Uh=e,!0):(Uh=null,!1)}var _x=typeof setTimeout=="function"?setTimeout:void 0,j0=typeof clearTimeout=="function"?clearTimeout:void 0,yx=typeof Promise=="function"?Promise:void 0,w0=typeof queueMicrotask=="function"?queueMicrotask:typeof yx<"u"?function(e){return yx.resolve(null).then(e).catch(k0)}:_x;function k0(e){setTimeout(function(){throw e})}function Oi(e){return e==="head"}function vx(e,t){var l=t,r=0;do{var d=l.nextSibling;if(e.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(r===0){e.removeChild(d),Ac(t);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")Fo(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Fo(l);for(var f=l.firstChild;f;){var j=f.nextSibling,w=f.nodeName;f[as]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||l.removeChild(f),f=j}}else l==="body"&&Fo(e.ownerDocument.body);l=d}while(l);Ac(t)}function jx(e,t){var l=e;e=0;do{var r=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=r}while(l)}function Hh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Hh(l),As(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function N0(e,t,l,r){for(;e.nodeType===1;){var d=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[as])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=yl(e.nextSibling),e===null)break}return null}function S0(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=yl(e.nextSibling),e===null))return null;return e}function wx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=yl(e.nextSibling),e===null))return null;return e}function Bh(e){return e.data==="$?"||e.data==="$~"}function qh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function E0(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var r=function(){t(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function yl(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 Gh=null;function kx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return yl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Nx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Sx(e,t,l){switch(t=bd(l),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Fo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);As(e)}var vl=new Map,Ex=new Set;function _d(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Fa=N.d;N.d={f:T0,r:C0,D:A0,C:M0,L:R0,m:D0,X:L0,S:O0,M:z0};function T0(){var e=Fa.f(),t=ud();return e||t}function C0(e){var t=Bs(e);t!==null&&t.tag===5&&t.type==="form"?Ym(t):Fa.r(e)}var Ec=typeof document>"u"?null:document;function Tx(e,t,l){var r=Ec;if(r&&typeof t=="string"&&t){var d=Jn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),Ex.has(d)||(Ex.add(d),e={rel:e,crossOrigin:l,href:t},r.querySelector(d)===null&&(t=r.createElement("link"),fs(t,"link",e),st(t),r.head.appendChild(t)))}}function A0(e){Fa.D(e),Tx("dns-prefetch",e,null)}function M0(e,t){Fa.C(e,t),Tx("preconnect",e,t)}function R0(e,t,l){Fa.L(e,t,l);var r=Ec;if(r&&e&&t){var d='link[rel="preload"][as="'+Jn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+Jn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+Jn(l.imageSizes)+'"]')):d+='[href="'+Jn(e)+'"]';var f=d;switch(t){case"style":f=Tc(e);break;case"script":f=Cc(e)}vl.has(f)||(e=v({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),vl.set(f,e),r.querySelector(d)!==null||t==="style"&&r.querySelector(Po(f))||t==="script"&&r.querySelector(Jo(f))||(t=r.createElement("link"),fs(t,"link",e),st(t),r.head.appendChild(t)))}}function D0(e,t){Fa.m(e,t);var l=Ec;if(l&&e){var r=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Jn(r)+'"][href="'+Jn(e)+'"]',f=d;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Cc(e)}if(!vl.has(f)&&(e=v({rel:"modulepreload",href:e},t),vl.set(f,e),l.querySelector(d)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Jo(f)))return}r=l.createElement("link"),fs(r,"link",e),st(r),l.head.appendChild(r)}}}function O0(e,t,l){Fa.S(e,t,l);var r=Ec;if(r&&e){var d=yn(r).hoistableStyles,f=Tc(e);t=t||"default";var j=d.get(f);if(!j){var w={loading:0,preload:null};if(j=r.querySelector(Po(f)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},l),(l=vl.get(f))&&$h(e,l);var U=j=r.createElement("link");st(U),fs(U,"link",e),U._p=new Promise(function(te,ue){U.onload=te,U.onerror=ue}),U.addEventListener("load",function(){w.loading|=1}),U.addEventListener("error",function(){w.loading|=2}),w.loading|=4,yd(j,t,r)}j={type:"stylesheet",instance:j,count:1,state:w},d.set(f,j)}}}function L0(e,t){Fa.X(e,t);var l=Ec;if(l&&e){var r=yn(l).hoistableScripts,d=Cc(e),f=r.get(d);f||(f=l.querySelector(Jo(d)),f||(e=v({src:e,async:!0},t),(t=vl.get(d))&&Yh(e,t),f=l.createElement("script"),st(f),fs(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(d,f))}}function z0(e,t){Fa.M(e,t);var l=Ec;if(l&&e){var r=yn(l).hoistableScripts,d=Cc(e),f=r.get(d);f||(f=l.querySelector(Jo(d)),f||(e=v({src:e,async:!0,type:"module"},t),(t=vl.get(d))&&Yh(e,t),f=l.createElement("script"),st(f),fs(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(d,f))}}function Cx(e,t,l,r){var d=(d=ze.current)?_d(d):null;if(!d)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Tc(l.href),l=yn(d).hoistableStyles,r=l.get(t),r||(r={type:"style",instance:null,count:0,state:null},l.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Tc(l.href);var f=yn(d).hoistableStyles,j=f.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,j),(f=d.querySelector(Po(e)))&&!f._p&&(j.instance=f,j.state.loading=5),vl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},vl.set(e,l),f||I0(d,e,l,j.state))),t&&r===null)throw Error(c(528,""));return j}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Cc(l),l=yn(d).hoistableScripts,r=l.get(t),r||(r={type:"script",instance:null,count:0,state:null},l.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Tc(e){return'href="'+Jn(e)+'"'}function Po(e){return'link[rel="stylesheet"]['+e+"]"}function Ax(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function I0(e,t,l,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),fs(t,"link",l),st(t),e.head.appendChild(t))}function Cc(e){return'[src="'+Jn(e)+'"]'}function Jo(e){return"script[async]"+e}function Mx(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Jn(l.href)+'"]');if(r)return t.instance=r,st(r),r;var d=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),st(r),fs(r,"style",d),yd(r,l.precedence,e),t.instance=r;case"stylesheet":d=Tc(l.href);var f=e.querySelector(Po(d));if(f)return t.state.loading|=4,t.instance=f,st(f),f;r=Ax(l),(d=vl.get(d))&&$h(r,d),f=(e.ownerDocument||e).createElement("link"),st(f);var j=f;return j._p=new Promise(function(w,U){j.onload=w,j.onerror=U}),fs(f,"link",r),t.state.loading|=4,yd(f,l.precedence,e),t.instance=f;case"script":return f=Cc(l.src),(d=e.querySelector(Jo(f)))?(t.instance=d,st(d),d):(r=l,(d=vl.get(f))&&(r=v({},l),Yh(r,d)),e=e.ownerDocument||e,d=e.createElement("script"),st(d),fs(d,"link",r),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,yd(r,l.precedence,e));return t.instance}function yd(e,t,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=r.length?r[r.length-1]:null,f=d,j=0;j<r.length;j++){var w=r[j];if(w.dataset.precedence===t)f=w;else if(f!==d)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var vd=null;function Rx(e,t,l){if(vd===null){var r=new Map,d=vd=new Map;d.set(l,r)}else d=vd,r=d.get(l),r||(r=new Map,d.set(l,r));if(r.has(e))return r;for(r.set(e,null),l=l.getElementsByTagName(e),d=0;d<l.length;d++){var f=l[d];if(!(f[as]||f[cn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var j=f.getAttribute(t)||"";j=e+j;var w=r.get(j);w?w.push(f):r.set(j,[f])}}return r}function Dx(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function U0(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ox(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function H0(e,t,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=Tc(r.href),f=t.querySelector(Po(d));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=jd.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=f,st(f);return}f=t.ownerDocument||t,r=Ax(r),(d=vl.get(d))&&$h(r,d),f=f.createElement("link"),st(f);var j=f;j._p=new Promise(function(w,U){j.onload=w,j.onerror=U}),fs(f,"link",r),l.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=jd.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Vh=0;function B0(e,t){return e.stylesheets&&e.count===0&&kd(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var r=setTimeout(function(){if(e.stylesheets&&kd(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Vh===0&&(Vh=62500*y0());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&kd(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Vh?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(d)}}:null}function jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wd=null;function kd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wd=new Map,t.forEach(q0,e),wd=null,jd.call(e))}function q0(e,t){if(!(t.state.loading&4)){var l=wd.get(e);if(l)var r=l.get(null);else{l=new Map,wd.set(e,l);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var j=d[f];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),r=j)}r&&l.set(null,r)}d=t.instance,j=d.getAttribute("data-precedence"),f=l.get(j)||r,f===r&&l.set(null,d),l.set(j,d),this.count++,r=jd.bind(this),d.addEventListener("load",r),d.addEventListener("error",r),f?f.parentNode.insertBefore(d,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Wo={$$typeof:Q,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function G0(e,t,l,r,d,f,j,w,U){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=zt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zt(0),this.hiddenUpdates=zt(null),this.identifierPrefix=r,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Lx(e,t,l,r,d,f,j,w,U,te,ue,xe){return e=new G0(e,t,l,j,U,te,ue,xe,w),t=1,f===!0&&(t|=24),f=Ds(3,null,null,t),e.current=f,f.stateNode=e,t=vi(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:l,cache:t},Ao(f),e}function zx(e){return e?(e=gi,e):gi}function Ix(e,t,l,r,d,f){d=zx(d),r.context===null?r.context=d:r.pendingContext=d,r=ha(t),r.payload={element:l},f=f===void 0?null:f,f!==null&&(r.callback=f),l=pa(e,r,t),l!==null&&(el(l,e,t),$l(l,e,t))}function Ux(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Xh(e,t){Ux(e,t),(e=e.alternate)&&Ux(e,t)}function Hx(e){if(e.tag===13||e.tag===31){var t=il(e,67108864);t!==null&&el(t,e,67108864),Xh(e,67108864)}}function Bx(e){if(e.tag===13||e.tag===31){var t=ul();t=rn(t);var l=il(e,t);l!==null&&el(l,e,t),Xh(e,t)}}var Nd=!0;function $0(e,t,l,r){var d=M.T;M.T=null;var f=N.p;try{N.p=2,Qh(e,t,l,r)}finally{N.p=f,M.T=d}}function Y0(e,t,l,r){var d=M.T;M.T=null;var f=N.p;try{N.p=8,Qh(e,t,l,r)}finally{N.p=f,M.T=d}}function Qh(e,t,l,r){if(Nd){var d=Kh(r);if(d===null)Dh(e,t,r,Sd,l),Gx(e,r);else if(X0(d,e,t,l,r))r.stopPropagation();else if(Gx(e,r),t&4&&-1<V0.indexOf(e)){for(;d!==null;){var f=Bs(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var j=on(f.pendingLanes);if(j!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;j;){var U=1<<31-St(j);w.entanglements[1]|=U,j&=~U}ga(f),(Ht&6)===0&&(cd=Oe()+500,Qo(0))}}break;case 31:case 13:w=il(f,2),w!==null&&el(w,f,2),ud(),Xh(f,2)}if(f=Kh(r),f===null&&Dh(e,t,r,Sd,l),f===d)break;d=f}d!==null&&r.stopPropagation()}else Dh(e,t,r,null,l)}}function Kh(e){return e=fn(e),Zh(e)}var Sd=null;function Zh(e){if(Sd=null,e=Zt(e),e!==null){var t=u(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=h(t),e!==null)return e;e=null}else if(l===31){if(e=m(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sd=e,null}function qx(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(Ye()){case ut:return 2;case Ee:return 8;case Te:case Me:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var Fh=!1,Li=null,zi=null,Ii=null,eu=new Map,tu=new Map,Ui=[],V0="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 Gx(e,t){switch(e){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":zi=null;break;case"mouseover":case"mouseout":Ii=null;break;case"pointerover":case"pointerout":eu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tu.delete(t.pointerId)}}function nu(e,t,l,r,d,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:l,eventSystemFlags:r,nativeEvent:f,targetContainers:[d]},t!==null&&(t=Bs(t),t!==null&&Hx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function X0(e,t,l,r,d){switch(t){case"focusin":return Li=nu(Li,e,t,l,r,d),!0;case"dragenter":return zi=nu(zi,e,t,l,r,d),!0;case"mouseover":return Ii=nu(Ii,e,t,l,r,d),!0;case"pointerover":var f=d.pointerId;return eu.set(f,nu(eu.get(f)||null,e,t,l,r,d)),!0;case"gotpointercapture":return f=d.pointerId,tu.set(f,nu(tu.get(f)||null,e,t,l,r,d)),!0}return!1}function $x(e){var t=Zt(e.target);if(t!==null){var l=u(t);if(l!==null){if(t=l.tag,t===13){if(t=h(l),t!==null){e.blockedOn=t,Xn(e.priority,function(){Bx(l)});return}}else if(t===31){if(t=m(l),t!==null){e.blockedOn=t,Xn(e.priority,function(){Bx(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ed(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Kh(e.nativeEvent);if(l===null){l=e.nativeEvent;var r=new l.constructor(l.type,l);At=r,l.target.dispatchEvent(r),At=null}else return t=Bs(l),t!==null&&Hx(t),e.blockedOn=l,!1;t.shift()}return!0}function Yx(e,t,l){Ed(e)&&l.delete(t)}function Q0(){Fh=!1,Li!==null&&Ed(Li)&&(Li=null),zi!==null&&Ed(zi)&&(zi=null),Ii!==null&&Ed(Ii)&&(Ii=null),eu.forEach(Yx),tu.forEach(Yx)}function Td(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Q0)))}var Cd=null;function Vx(e){Cd!==e&&(Cd=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Cd===e&&(Cd=null);for(var t=0;t<e.length;t+=3){var l=e[t],r=e[t+1],d=e[t+2];if(typeof r!="function"){if(Zh(r||l)===null)continue;break}var f=Bs(l);f!==null&&(e.splice(t,3),t-=3,Kf(f,{pending:!0,data:d,method:l.method,action:r},r,d))}}))}function Ac(e){function t(U){return Td(U,e)}Li!==null&&Td(Li,e),zi!==null&&Td(zi,e),Ii!==null&&Td(Ii,e),eu.forEach(t),tu.forEach(t);for(var l=0;l<Ui.length;l++){var r=Ui[l];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ui.length&&(l=Ui[0],l.blockedOn===null);)$x(l),l.blockedOn===null&&Ui.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var d=l[r],f=l[r+1],j=d[it]||null;if(typeof f=="function")j||Vx(l);else if(j){var w=null;if(f&&f.hasAttribute("formAction")){if(d=f,j=f[it]||null)w=j.formAction;else if(Zh(d)!==null)continue}else w=j.action;typeof w=="function"?l[r+1]=w:(l.splice(r,3),r-=3),Vx(l)}}}function Xx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(j){return d=j})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Ph(e){this._internalRoot=e}Ad.prototype.render=Ph.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var l=t.current,r=ul();Ix(l,r,e,t,null,null)},Ad.prototype.unmount=Ph.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ix(e.current,2,null,e,null,null),ud(),t[un]=null}};function Ad(e){this._internalRoot=e}Ad.prototype.unstable_scheduleHydration=function(e){if(e){var t=xs();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ui.length&&t!==0&&t<Ui[l].priority;l++);Ui.splice(l,0,e),l===0&&$x(e)}};var Qx=s.version;if(Qx!=="19.2.8")throw Error(c(527,Qx,"19.2.8"));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var K0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Md=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Md.isDisabled&&Md.supportsFiber)try{dt=Md.inject(K0),Ct=Md}catch{}}return lu.createRoot=function(e,t){if(!o(e))throw Error(c(299));var l=!1,r="",d=eg,f=tg,j=ng;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError)),t=Lx(e,1,!1,null,null,l,r,null,d,f,j,Xx),e[un]=t.current,Rh(e),new Ph(t)},lu.hydrateRoot=function(e,t,l){if(!o(e))throw Error(c(299));var r=!1,d="",f=eg,j=tg,w=ng,U=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(f=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError),l.formState!==void 0&&(U=l.formState)),t=Lx(e,1,!0,t,l??null,r,d,U,f,j,w,Xx),t.context=zx(null),l=t.current,r=ul(),r=rn(r),d=ha(r),d.callback=null,pa(l,d,r),l=r,t.current.lanes=l,P(t,l),ga(t),e[un]=t.current,Rh(e),new Ad(t)},lu.version="19.2.8",lu}var lb;function av(){if(lb)return tp.exports;lb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),tp.exports=lv(),tp.exports}var iv=av();const C_=1;function rv(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${A_(n)}`}function cv(n){const s=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),i=`${s.replace(/^-+|-+$/g,"")||"project"}-${A_(n)}`,c=rv(n);return[s,i].filter(o=>o!==c)}function A_(n){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return ov(s?n.toLowerCase():n)}function ov(n){let s=3735928559,i=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);s=Math.imul(s^o,2654435761),i=Math.imul(i^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&i)+(s>>>0)).toString(36)}var ei,$c,Yc,Vc,Xc,Cu,Qc,xf,M_;class uv{constructor(s){Tn(this,xf);Tn(this,ei,null);Tn(this,$c,new Set);Tn(this,Yc,500);Tn(this,Vc,null);Tn(this,Xc,!1);Tn(this,Cu,null);Tn(this,Qc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){Bt(this,Qc,s)}connect(){if(nt(this,Xc))return;const s=new WebSocket(this.url);Bt(this,ei,s),s.addEventListener("open",()=>{var i,c;Bt(this,Yc,500),this.send({type:"hello",protocol:C_,clientName:"ccv-web"}),(i=nt(this,Cu))==null||i.call(this),(c=nt(this,Qc))==null||c.call(this)}),s.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of nt(this,$c))o(c)}),s.addEventListener("close",()=>{var i;Bt(this,ei,null),(i=nt(this,Qc))==null||i.call(this),$n(this,xf,M_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){Bt(this,Cu,s)}on(s){return nt(this,$c).add(s),()=>nt(this,$c).delete(s)}send(s){var i;((i=nt(this,ei))==null?void 0:i.readyState)===WebSocket.OPEN&&nt(this,ei).send(JSON.stringify(s))}get connected(){var s;return((s=nt(this,ei))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;Bt(this,Xc,!0),(s=nt(this,ei))==null||s.close()}}ei=new WeakMap,$c=new WeakMap,Yc=new WeakMap,Vc=new WeakMap,Xc=new WeakMap,Cu=new WeakMap,Qc=new WeakMap,xf=new WeakSet,M_=function(){if(nt(this,Xc)||nt(this,Vc)!==null)return;const s=nt(this,Yc);Bt(this,Yc,Math.min(s*2,1e4)),Bt(this,Vc,window.setTimeout(()=>{Bt(this,Vc,null),this.connect()},s))};const dv=1,R_="ccv:relay",Wd="ccv:relay.host";function fv(){try{const n=localStorage.getItem(R_);if(!n)return null;const s=JSON.parse(n);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function D_(){localStorage.removeItem(R_)}var ka,Kc,Na,Zc,Fc,Ki,Mr,Rr,Zi,Dr,Pc,Or,Lr,gn,Gi,kp,O_,Cr,Np;class hv{constructor(s){Tn(this,gn);Tn(this,ka,null);Tn(this,Kc,new Set);Tn(this,Na,null);Tn(this,Zc,null);Tn(this,Fc,500);Tn(this,Ki,null);Tn(this,Mr,!1);Tn(this,Rr,!1);Tn(this,Zi,!1);Tn(this,Dr,null);Tn(this,Pc,"Подключаемся…");Tn(this,Or,0);Tn(this,Lr,[]);this.session=s}get connected(){return nt(this,Rr)&&nt(this,Zi)}get statusText(){return nt(this,Pc)}get hostId(){return nt(this,Dr)}on(s){return nt(this,Kc).add(s),()=>nt(this,Kc).delete(s)}onReconnect(s){Bt(this,Zc,s)}onStatus(s){Bt(this,Na,s)}connect(){nt(this,Mr)||$n(this,gn,kp).call(this)}send(s){if(!nt(this,Rr)){nt(this,Lr).length<64&&nt(this,Lr).push(s);return}$n(this,gn,Cr).call(this,{t:"client.frame",body:s})}close(){var s;Bt(this,Mr,!0),nt(this,Ki)!==null&&window.clearTimeout(nt(this,Ki)),(s=nt(this,ka))==null||s.close()}}ka=new WeakMap,Kc=new WeakMap,Na=new WeakMap,Zc=new WeakMap,Fc=new WeakMap,Ki=new WeakMap,Mr=new WeakMap,Rr=new WeakMap,Zi=new WeakMap,Dr=new WeakMap,Pc=new WeakMap,Or=new WeakMap,Lr=new WeakMap,gn=new WeakSet,Gi=function(s){var i;nt(this,Pc)!==s&&(Bt(this,Pc,s),(i=nt(this,Na))==null||i.call(this))},kp=async function(){if(nt(this,ka))return;if(!nt(this,Dr))try{Bt(this,Dr,await pv(this.session.token))}catch(c){$n(this,gn,Gi).call(this,c instanceof Error?c.message:String(c)),$n(this,gn,Np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${s}://${location.host}/relay/client`);Bt(this,ka,i),i.addEventListener("open",()=>{$n(this,gn,Cr).call(this,{t:"client.hello",protocol:dv,token:this.session.token})}),i.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}$n(this,gn,O_).call(this,o)}),i.addEventListener("close",()=>{var c;Bt(this,ka,null),Bt(this,Rr,!1),Bt(this,Zi,!1),$n(this,gn,Gi).call(this,"Нет связи с сервером"),(c=nt(this,Na))==null||c.call(this),$n(this,gn,Np).call(this)}),i.addEventListener("error",()=>i.close())},O_=function(s){var i,c,o,u,h,m,g;switch(s.t){case"client.ok":Bt(this,Fc,500),$n(this,gn,Cr).call(this,{t:"client.attach",hostId:nt(this,Dr)??"",...nt(this,Or)>0?{sinceRseq:nt(this,Or)}:{}});return;case"client.attached":Bt(this,Rr,!0),Bt(this,Zi,s.online),Bt(this,Or,s.rseq),$n(this,gn,Gi).call(this,s.online?"Хост на связи":"Компьютер не на связи"),$n(this,gn,Cr).call(this,{t:"client.frame",body:{type:"hello",protocol:C_,clientName:"ccv-web-relay"}});const x=nt(this,Lr);Bt(this,Lr,[]);for(const _ of x)$n(this,gn,Cr).call(this,{t:"client.frame",body:_});(i=nt(this,Zc))==null||i.call(this),(c=nt(this,Na))==null||c.call(this);return;case"host.frame":{s.rseq>0&&Bt(this,Or,s.rseq);const _=s.body;for(const v of nt(this,Kc))v(_);return}case"host.online":Bt(this,Zi,!0),$n(this,gn,Gi).call(this,"Хост на связи"),(o=nt(this,Zc))==null||o.call(this),(u=nt(this,Na))==null||u.call(this);return;case"host.offline":Bt(this,Zi,!1),$n(this,gn,Gi).call(this,"Компьютер не на связи"),(h=nt(this,Na))==null||h.call(this);return;case"ping":$n(this,gn,Cr).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){D_(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Wd),$n(this,gn,Gi).call(this,"Этот компьютер отвязан от аккаунта"),Bt(this,Mr,!0),(m=nt(this,ka))==null||m.close();return}s.code!=="offline"&&$n(this,gn,Gi).call(this,s.message),(g=nt(this,Na))==null||g.call(this);return}},Cr=function(s){var i;((i=nt(this,ka))==null?void 0:i.readyState)===WebSocket.OPEN&&nt(this,ka).send(JSON.stringify(s))},Np=function(){if(nt(this,Mr)||nt(this,Ki)!==null)return;const s=nt(this,Fc);Bt(this,Fc,Math.min(s*2,1e4)),Bt(this,Ki,window.setTimeout(()=>{Bt(this,Ki,null),$n(this,gn,kp).call(this)},s))};async function pv(n){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Wd,s),s;const i=localStorage.getItem(Wd);if(i)return i;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw D_(),location.href="/login",new Error("нужен вход");const u=(await c.json()).hosts??[];if(u.length===1&&u[0])return localStorage.setItem(Wd,u[0].id),u[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function ef(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const mv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function gv(){if(ef()==="local")return new uv(mv);const n=fv();return n?new hv(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const L_="ccv:drafts",xv=40,bv=2e4,_v=500;let mu=null,gu=null;function Gp(){if(mu)return mu;const n=new Map;try{const s=localStorage.getItem(L_);if(s){const i=JSON.parse(s);if(typeof i=="object"&&i!==null)for(const[c,o]of Object.entries(i))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return mu=n,window.addEventListener("pagehide",I_),n}function xu(n){return Gp().get(n)??""}function sf(n,s){const i=Gp(),c=s.slice(0,bv),o=i.has(n);if(o&&i.delete(n),c!=="")i.set(n,c);else if(!o)return;for(;i.size>xv;){const u=i.keys().next();if(u.done)break;i.delete(u.value)}jv(),vv()}function z_(){const n=new Set;for(const s of Gp().keys())n.add(s.startsWith("side:")?s.slice(5):s);return[...n].sort()}const Sp=new Set;let ab="";function yv(n){return Sp.add(n),()=>Sp.delete(n)}function vv(){const n=z_(),s=n.join(`
51
+ `);if(s!==ab){ab=s;for(const i of Sp)i(n)}}function jv(){gu===null&&(gu=window.setTimeout(I_,_v))}function I_(){if(gu!==null&&window.clearTimeout(gu),gu=null,!!mu)try{localStorage.setItem(L_,JSON.stringify(Object.fromEntries(mu)))}catch{}}const hs={items:[],pending:[],lastSeq:0,contextTokens:null},Fi={entries:[],total:0,loading:!1};function $p(n){var s;return((s=n.entries[0])==null?void 0:s.seq)??1}function U_(n){return n.total>0&&$p(n)>1}function H_(n,s){const i=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...s.entries.filter(o=>!i.has(o.seq))].sort((o,u)=>o.seq-u.seq),total:s.total,loading:!1}}function Yp(n){return bu(hs,n).items.map(s=>({...s,id:`h:${s.id}`}))}function bu(n,s){let i=n;for(const c of s)c.seq<=i.lastSeq||(i={...wv(i,c.event,c.seq),lastSeq:c.seq});return i}function wv(n,s,i){var o,u;const c=n.items;switch(s.kind){case"user.message":return xa(n,{id:`u${i}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return xa(n,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return Mc(n,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?xa(n,m):Mc(n,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return xa(n,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return Mc(n,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?xa(n,m):Mc(n,h,m)}case"tool.use":return xa(n,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return n;const m=c[h];return Mc(n,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(g=>g.requestId===s.requestId),m=n.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return Mc({...n,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...n,pending:m}:xa({...n,pending:m},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=n.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??n.contextTokens;return xa({...n,items:h,contextTokens:m},{id:`r${i}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((u=s.usage)==null?void 0:u.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?n:xa(n,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return xa(n,{id:`e${i}`,kind:"notice",tone:"error",text:s.message});case"state":return n;case"rewound":return n;default:return n}}function B_(n,s){let i=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(i===s)return n.slice(0,c);i++}return n}function q_(n,s,i){const c=s-i;if(c<=0)return[];let o=0;for(let u=0;u<n.length;u++)if(n[u].kind==="user"){if(o===c)return n.slice(0,u);o++}return n}function xa(n,s){return{...n,items:[...n.items,s]}}function Mc(n,s,i){const c=n.items.slice();return c[s]=i,{...n,items:c}}const Ep="ccv:theme",ap=["system","light","dark"];function kv(){const[n,s]=b.useState(Nv);b.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{var m;const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light",(m=document.querySelector('meta[name="theme-color"]'))==null||m.setAttribute("content",h?"#101115":"#f3f4f0")};return u(),o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[n]);const i=b.useCallback(o=>{try{localStorage.setItem(Ep,o)}catch{}s(o)},[]),c=b.useCallback(()=>{s(o=>{const u=ap[(ap.indexOf(o)+1)%ap.length];try{localStorage.setItem(Ep,u)}catch{}return u})},[]);return[n,i,c]}function Nv(){try{const n=localStorage.getItem(Ep);if(n==="gpt")return"dark";if(n==="light"||n==="dark"||n==="system")return n}catch{}return"dark"}const Vp=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],G_=[{value:"default",hint:"чтение свободно, изменения и выход из песочницы — с разрешения"},{value:"acceptEdits",hint:"работа внутри проекта, выход за границы — с разрешения"},{value:"plan",hint:"песочница только для чтения; изменения требуют разрешения"},{value:"bypassPermissions",hint:"полный доступ без подтверждений"}],$_=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],zr={sidebar:{side:"left",min:200,max:520,width:276,label:"сессий"},files:{side:"left",min:180,max:560,width:260,label:"файлов"},search:{side:"left",min:220,max:640,width:320,label:"поиска"},git:{side:"left",min:220,max:640,width:320,label:"истории"},ask:{side:"right",min:260,max:720,width:380,label:"вопроса"},comparison:{side:"right",min:320,max:1200,width:460,label:"второго разговора"}},ib=320,Y_="ccv:panes";function Sv(n){return`--${n}-w`}function V_(n,s){const i=zr[n];return Math.round(Math.min(i.max,Math.max(i.min,s)))}function Ev(){const n={};for(const s of Object.keys(zr))n[s]=zr[s].width;try{const s=localStorage.getItem(Y_);if(s){const i=JSON.parse(s);for(const c of Object.keys(zr)){const o=i[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=V_(c,o))}}}catch{}return n}function Tv(){const[n,s]=b.useState(Ev),i=b.useCallback(h=>{try{localStorage.setItem(Y_,JSON.stringify(h))}catch{}},[]),c=b.useCallback((h,m)=>{s(g=>{const x=V_(h,m);if(g[h]===x)return g;const _={...g,[h]:x};return i(_),_})},[i]),o=b.useCallback(h=>{s(m=>{const g={...m,[h]:zr[h].width};return i(g),g})},[i]),u={};for(const h of Object.keys(zr))u[Sv(h)]=`${n[h]}px`;return{widths:n,style:u,setWidth:c,reset:o}}const ip=260,X_=120,Cv=200,rb="ccv:terminal-h";function cb(n,s){return Math.round(Math.min(s,Math.max(X_,n)))}function Av(){const[n,s]=b.useState(()=>{try{const u=localStorage.getItem(rb);if(u){const h=Number(u);if(Number.isFinite(h))return cb(h,1/0)}}catch{}return ip}),i=b.useCallback(u=>{try{localStorage.setItem(rb,String(u))}catch{}},[]),c=b.useCallback((u,h)=>{const m=cb(u,h);s(g=>g===m?g:(i(m),m))},[i]),o=b.useCallback(()=>{s(ip),i(ip)},[i]);return{height:n,setHeight:c,reset:o}}function bf(n){const[s,i]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return b.useEffect(()=>{const c=window.matchMedia(n),o=()=>i(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),s}const Mv=500,Rv=6;function Dv({onLongPress:n,onClick:s,disabled:i=!1,thresholdMs:c=Mv,moveCancelPx:o=Rv}){const u=b.useRef(null),[h,m]=b.useState(!1),g=b.useCallback(()=>{u.current&&window.clearTimeout(u.current.timer),u.current=null,m(!1)},[]),x=b.useCallback(A=>{if(i||A.button!==0)return;const D={timer:0,x:A.clientX,y:A.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,m(!1),n()},c),u.current=D,m(!0)},[i,c,n]),_=b.useCallback(A=>{const D=u.current;!D||D.fired||Math.hypot(A.clientX-D.x,A.clientY-D.y)>o&&g()},[o,g]),v=b.useCallback(()=>{u.current&&!u.current.fired?g():m(!1)},[g]),y=b.useCallback(A=>{var D;if((D=u.current)!=null&&D.fired){u.current=null,A.preventDefault();return}if(!i){if(A.shiftKey){n();return}s()}},[i,s,n]),S=b.useCallback(A=>{A.preventDefault()},[]),k=b.useCallback(A=>{i||A.shiftKey&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),n())},[i,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:_,onPointerUp:v,onPointerCancel:v,onPointerLeave:v,onClick:y,onContextMenu:S,onKeyDown:k}}}const Ov={height:0,offsetTop:0,offsetLeft:0};function ob(){if(typeof window>"u")return Ov;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Lv(n){const[s,i]=b.useState(ob);return b.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const u=ob();i(h=>h.height===u.height&&h.offsetTop===u.offsetTop&&h.offsetLeft===u.offsetLeft?h:u)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[n]),s}function Xp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Br=Xp();function Q_(n){Br=n}var Ar={exec:()=>null};function Rc(n){let s=[];return i=>{let c=Math.max(0,Math.min(3,i-1)),o=s[c];return o||(o=n(c),s[c]=o),o}}function Tt(n,s=""){let i=typeof n=="string"?n:n.source,c={replace:(o,u)=>{let h=typeof u=="string"?u:u.source;return h=h.replace(Ns.caret,"$1"),i=i.replace(o,h),c},getRegex:()=>new RegExp(i,s)};return c}var zv=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),Ns={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Rc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Rc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Rc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Rc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Rc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Rc(n=>new RegExp(`^ {0,${n}}>`))},Iv=/^(?:[ \t]*(?:\n|$))+/,Uv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Au=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,K_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Z_=Tt(K_).replace(/bull/g,Qp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qv=Tt(K_).replace(/bull/g,Qp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Gv=/^[^\n]+/,Zp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$v=Tt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yv=Tt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Qp).getRegex(),_f="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Fp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vv=Tt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Fp).replace("tag",_f).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),F_=n=>Tt(Kp).replace("hr",Au).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_f).getRegex(),Xv=F_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Qv=F_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Kv=Tt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qv).getRegex(),Pp={blockquote:Kv,code:Uv,def:$v,fences:Hv,heading:Bv,hr:Au,html:Vv,lheading:Z_,list:Yv,newline:Iv,paragraph:Xv,table:Ar,text:Gv},ub=Tt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Au).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_f).getRegex(),Zv={...Pp,lheading:qv,table:ub,paragraph:Tt(Kp).replace("hr",Au).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ub).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_f).getRegex()},Fv={...Pp,html:Tt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ar,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Tt(Kp).replace("hr",Au).replace("heading",` *#{1,6} *[^
52
+ ]`).replace("lheading",Z_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,P_=/^( {2,}|\\)\n(?!\s*$)/,Wv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wc=/[\p{P}\p{S}]/u,yf=/[\s\p{P}\p{S}]/u,Jp=/[^\s\p{P}\p{S}]/u,ej=Tt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yf).getRegex(),J_=/(?!~)[\p{P}\p{S}]/u,tj=/(?!~)[\s\p{P}\p{S}]/u,nj=/(?:[^\s\p{P}\p{S}]|~)/u,sj=Tt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",zv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),W_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lj=Tt(W_,"u").replace(/punct/g,Wc).getRegex(),aj=Tt(W_,"u").replace(/punct/g,J_).getRegex(),ey="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ij=Tt(ey,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,yf).replace(/punct/g,Wc).getRegex(),rj=Tt(ey,"gu").replace(/notPunctSpace/g,nj).replace(/punctSpace/g,tj).replace(/punct/g,J_).getRegex(),cj=Tt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,yf).replace(/punct/g,Wc).getRegex(),oj=Tt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Wc).getRegex(),uj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",dj=Tt(uj,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,yf).replace(/punct/g,Wc).getRegex(),fj=Tt(/\\(punct)/,"gu").replace(/punct/g,Wc).getRegex(),hj=Tt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pj=Tt(Fp).replace("(?:-->|$)","-->").getRegex(),mj=Tt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",pj).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gj=Tt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",lf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ty=Tt(/^!?\[(label)\]\[(ref)\]/).replace("label",lf).replace("ref",Zp).getRegex(),ny=Tt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zp).getRegex(),xj=Tt("reflink|nolink(?!\\()","g").replace("reflink",ty).replace("nolink",ny).getRegex(),db=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wp={_backpedal:Ar,anyPunctuation:fj,autolink:hj,blockSkip:sj,br:P_,code:Jv,del:Ar,delLDelim:Ar,delRDelim:Ar,emStrongLDelim:lj,emStrongRDelimAst:ij,emStrongRDelimUnd:cj,escape:Pv,link:gj,nolink:ny,punctuation:ej,reflink:ty,reflinkSearch:xj,tag:mj,text:Wv,url:Ar},bj={...Wp,link:Tt(/^!?\[(label)\]\((.*?)\)/).replace("label",lf).getRegex(),reflink:Tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lf).getRegex()},Tp={...Wp,emStrongRDelimAst:rj,emStrongLDelim:aj,delLDelim:oj,delRDelim:dj,url:Tt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",db).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Tt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",db).getRegex()},_j={...Tp,br:Tt(P_).replace("{2,}","*").getRegex(),text:Tt(Tp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rd={normal:Pp,gfm:Zv,pedantic:Fv},au={normal:Wp,gfm:Tp,breaks:_j,pedantic:bj},yj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fb=n=>yj[n];function va(n,s){if(s){if(Ns.escapeTest.test(n))return n.replace(Ns.escapeReplace,fb)}else if(Ns.escapeTestNoEncode.test(n))return n.replace(Ns.escapeReplaceNoEncode,fb);return n}function hb(n){try{n=encodeURI(n).replace(Ns.percentDecode,"%")}catch{return null}return n}function pb(n,s){var u;let i=n.replace(Ns.findPipe,(h,m,g)=>{let x=!1,_=m;for(;--_>=0&&g[_]==="\\";)x=!x;return x?"|":" |"}),c=i.split(Ns.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((u=c.at(-1))!=null&&u.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(Ns.slashPipe,"|");return c}function Bi(n,s,i){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===s;)o++;return n.slice(0,c-o)}function mb(n){let s=n.split(`
53
+ `),i=s.length-1;for(;i>=0&&Ns.blankLine.test(s[i]);)i--;return s.length-i<=2?n:s.slice(0,i+1).join(`
54
+ `)}function vj(n,s){if(n.indexOf(s[1])===-1)return-1;let i=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===s[0])i++;else if(n[c]===s[1]&&(i--,i<0))return c;return i>0?-2:-1}function jj(n,s=0){let i=s,c="";for(let o of n)if(o===" "){let u=4-i%4;c+=" ".repeat(u),i+=u}else c+=o,i++;return c}function gb(n,s,i,c,o){let u=s.href,h=s.title||null,m=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:n[0].charAt(0)==="!"?"image":"link",raw:i,href:u,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function wj(n,s,i){let c=n.match(i.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
55
+ `).map(u=>{let h=u.match(i.other.beginningSpace);if(h===null)return u;let[m]=h;return m.length>=o.length?u.slice(o.length):u}).join(`
56
+ `)}var af=class{constructor(n){Jt(this,"options");Jt(this,"rules");Jt(this,"lexer");this.options=n||Br}space(n){let s=this.rules.block.newline.exec(n);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(n){let s=this.rules.block.code.exec(n);if(s){let i=this.options.pedantic?s[0]:mb(s[0]),c=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:c}}}fences(n){let s=this.rules.block.fences.exec(n);if(s){let i=s[0],c=wj(i,s[3]||"",this.rules);return{type:"code",raw:i,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(n){let s=this.rules.block.heading.exec(n);if(s){let i=s[2].trim();if(this.rules.other.endingHash.test(i)){let c=Bi(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:Bi(s[0],`
57
+ `),depth:s[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(n){let s=this.rules.block.hr.exec(n);if(s)return{type:"hr",raw:Bi(s[0],`
58
+ `)}}blockquote(n){let s=this.rules.block.blockquote.exec(n);if(s){let i=Bi(s[0],`
59
+ `).split(`
60
+ `),c="",o="",u=[];for(;i.length>0;){let h=!1,m=[],g;for(g=0;g<i.length;g++)if(this.rules.other.blockquoteStart.test(i[g]))m.push(i[g]),h=!0;else if(!h)m.push(i[g]);else break;i=i.slice(g);let x=m.join(`
61
+ `),_=x.replace(this.rules.other.blockquoteSetextReplace,`
62
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
63
+ ${x}`:x,o=o?`${o}
64
+ ${_}`:_;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,u,!0),this.lexer.state.top=v,i.length===0)break;let y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let S=y,k=S.raw+`
65
+ `+i.join(`
66
+ `),A=this.blockquote(k);u[u.length-1]=A,c=c.substring(0,c.length-S.raw.length)+A.raw,o=o.substring(0,o.length-S.text.length)+A.text;break}else if((y==null?void 0:y.type)==="list"){let S=y,k=S.raw+`
67
+ `+i.join(`
68
+ `),A=this.list(k);u[u.length-1]=A,c=c.substring(0,c.length-y.raw.length)+A.raw,o=o.substring(0,o.length-S.raw.length)+A.raw,i=k.substring(u.at(-1).raw.length).split(`
69
+ `);continue}}return{type:"blockquote",raw:c,tokens:u,text:o}}}list(n){let s=this.rules.block.list.exec(n);if(s){let i=s[1].trim(),c=i.length>1,o={type:"list",raw:"",ordered:c,start:c?+i.slice(0,-1):"",loose:!1,items:[]};i=c?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=c?i:"[*+-]");let u=this.rules.other.listItemRegex(i),h=!1;for(;n;){let g=!1,x="",_="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;x=s[0],n=n.substring(x.length);let v=jj(s[2].split(`
70
+ `,1)[0],s[1].length),y=n.split(`
71
+ `,1)[0],S=!v.trim(),k=0;if(this.options.pedantic?(k=2,_=v.trimStart()):S?k=s[1].length+1:(k=v.search(this.rules.other.nonSpaceChar),k=k>4?1:k,_=v.slice(k),k+=s[1].length),S&&this.rules.other.blankLine.test(y)&&(x+=y+`
72
+ `,n=n.substring(y.length+1),g=!0),!g){let A=this.rules.other.nextBulletRegex(k),D=this.rules.other.hrRegex(k),q=this.rules.other.fencesBeginRegex(k),G=this.rules.other.headingBeginRegex(k),Q=this.rules.other.htmlBeginRegex(k),z=this.rules.other.blockquoteBeginRegex(k);for(;n;){let $=n.split(`
73
+ `,1)[0],E;if(y=$,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),E=y):E=y.replace(this.rules.other.tabCharGlobal," "),q.test(y)||G.test(y)||Q.test(y)||z.test(y)||A.test(y)||D.test(y))break;if(E.search(this.rules.other.nonSpaceChar)>=k||!y.trim())_+=`
74
+ `+E.slice(k);else{if(S||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||q.test(v)||G.test(v)||D.test(v))break;_+=`
75
+ `+y}S=!y.trim(),x+=$+`
76
+ `,n=n.substring($.length+1),v=E.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=x}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(g.raw);if(_){let v={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};g.checked=v.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=v.raw+g.tokens[0].raw,g.tokens[0].text=v.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(v)):g.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):g.tokens.unshift(v)}}else g.task&&(g.task=!1);if(!o.loose){let _=g.tokens.filter(y=>y.type==="space"),v=_.length>0&&_.some(y=>this.rules.other.anyLine.test(y.raw));o.loose=v}}if(o.loose)for(let g of o.items){g.loose=!0;for(let x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(n){let s=this.rules.block.html.exec(n);if(s){let i=mb(s[0]);return{type:"html",block:!0,raw:i,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:i}}}def(n){let s=this.rules.block.def.exec(n);if(s){let i=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:i,raw:Bi(s[0],`
77
+ `),href:c,title:o}}}table(n){var h;let s=this.rules.block.table.exec(n);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let i=pb(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
78
+ `):[],u={type:"table",raw:Bi(s[0],`
79
+ `),header:[],align:[],rows:[]};if(i.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?u.align.push("right"):this.rules.other.tableAlignCenter.test(m)?u.align.push("center"):this.rules.other.tableAlignLeft.test(m)?u.align.push("left"):u.align.push(null);for(let m=0;m<i.length;m++)u.header.push({text:i[m],tokens:this.lexer.inline(i[m]),header:!0,align:u.align[m]});for(let m of o)u.rows.push(pb(m,u.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[x]})));return u}}lheading(n){let s=this.rules.block.lheading.exec(n);if(s){let i=s[1].trim();return{type:"heading",raw:Bi(s[0],`
80
+ `),depth:s[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(n){let s=this.rules.block.paragraph.exec(n);if(s){let i=s[1].charAt(s[1].length-1)===`
81
+ `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:i,tokens:this.lexer.inline(i)}}}text(n){let s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){let s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){let s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){let s=this.rules.inline.link.exec(n);if(s){let i=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let u=Bi(i.slice(0,-1),"\\");if((i.length-u.length)%2===0)return}else{let u=vj(s[2],"()");if(u===-2)return;if(u>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let u=this.rules.other.pedanticHrefTitle.exec(c);u&&(c=u[1],o=u[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?c=c.slice(1):c=c.slice(1,-1)),gb(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(n,s){let i;if((i=this.rules.inline.reflink.exec(n))||(i=this.rules.inline.nolink.exec(n))){let c=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let u=i[0].charAt(0);return{type:"text",raw:u,text:u}}return gb(i,o,i[0],this.lexer,this.rules)}}emStrong(n,s,i=""){let c=this.rules.inline.emStrongLDelim.exec(n);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,u,h,m=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*n.length+o);(c=x.exec(s))!==null;){if(u=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!u)continue;if(h=[...u].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let _=[...c[0]][0].length,v=n.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let S=v.slice(1,-1);return{type:"em",raw:v,text:S,tokens:this.lexer.inlineTokens(S)}}let y=v.slice(2,-2);return{type:"strong",raw:v,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let s=this.rules.inline.code.exec(n);if(s){let i=s[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return c&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:s[0],text:i}}}br(n){let s=this.rules.inline.br.exec(n);if(s)return{type:"br",raw:s[0]}}del(n,s,i=""){let c=this.rules.inline.delLDelim.exec(n);if(c&&(!c[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,u,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,s=s.slice(-1*n.length+o);(c=g.exec(s))!==null;){if(u=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!u||(h=[...u].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let x=[...c[0]][0].length,_=n.slice(0,o+c.index+x+h),v=_.slice(o,-o);return{type:"del",raw:_,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(n){let s=this.rules.inline.autolink.exec(n);if(s){let i,c;return s[2]==="@"?(i=s[1],c="mailto:"+i):(i=s[1],c=i),{type:"link",raw:s[0],text:i,href:c,tokens:[{type:"text",raw:i,text:i}]}}}url(n){var i;let s;if(s=this.rules.inline.url.exec(n)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let u;do u=s[0],s[0]=((i=this.rules.inline._backpedal.exec(s[0]))==null?void 0:i[0])??"";while(u!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let s=this.rules.inline.text.exec(n);if(s){let i=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:i}}}},Kl=class Cp{constructor(s){Jt(this,"tokens");Jt(this,"options");Jt(this,"state");Jt(this,"inlineQueue");Jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Br,this.options.tokenizer=this.options.tokenizer||new af,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:Ns,block:Rd.normal,inline:au.normal};this.options.pedantic?(i.block=Rd.pedantic,i.inline=au.pedantic):this.options.gfm&&(i.block=Rd.gfm,this.options.breaks?i.inline=au.breaks:i.inline=au.gfm),this.tokenizer.rules=i}static get rules(){return{block:Rd,inline:au}}static lex(s,i){return new Cp(i).lex(s)}static lexInline(s,i){return new Cp(i).inlineTokens(s)}lex(s){s=s.replace(Ns.carriageReturn,`
82
+ `),this.blockTokens(s,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let c=this.inlineQueue[i];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,i=[],c=!1){var u,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(Ns.tabCharGlobal," ").replace(Ns.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}let g;if((h=(u=this.options.extensions)==null?void 0:u.block)!=null&&h.some(_=>(g=_.call({lexer:this},s,i))?(s=s.substring(g.raw.length),i.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.substring(g.raw.length);let _=i.at(-1);g.raw.length===1&&_!==void 0?_.raw+=`
83
+ `:i.push(g);continue}if(g=this.tokenizer.code(s)){s=s.substring(g.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
84
+ `)?"":`
85
+ `)+g.raw,_.text+=`
86
+ `+g.text,this.inlineQueue.at(-1).src=_.text):i.push(g);continue}if(g=this.tokenizer.fences(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.def(s)){s=s.substring(g.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
87
+ `)?"":`
88
+ `)+g.raw,_.text+=`
89
+ `+g.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},i.push(g));continue}if(g=this.tokenizer.table(s)){s=s.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),i.push(g);continue}let x=s;if((m=this.options.extensions)!=null&&m.startBlock){let _=1/0,v=s.slice(1),y;this.options.extensions.startBlock.forEach(S=>{y=S.call({lexer:this},v),typeof y=="number"&&y>=0&&(_=Math.min(_,y))}),_<1/0&&_>=0&&(x=s.substring(0,_+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){let _=i.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
90
+ `)?"":`
91
+ `)+g.raw,_.text+=`
92
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(g),c=x.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.substring(g.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
93
+ `)?"":`
94
+ `)+g.raw,_.text+=`
95
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(g);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,i}inline(s,i=[]){return this.inlineQueue.push({src:s,tokens:i}),i}inlineTokens(s,i=[]){var m,g,x,_,v;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let y=Object.keys(this.tokens.links);y.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,S=>y.includes(S.slice(S.lastIndexOf("[")+1,-1))?"["+"a".repeat(S.length-2)+"]":S))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(y,S,k)=>{let A=k?k.length:0;return y.slice(0,A)+"["+"a".repeat(y.length-A-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,u="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(u=""),o=!1;let y;if((_=(x=this.options.extensions)==null?void 0:x.inline)!=null&&_.some(k=>(y=k.call({lexer:this},s,i))?(s=s.substring(y.raw.length),i.push(y),!0):!1))continue;if(y=this.tokenizer.escape(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.tag(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.link(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(y.raw.length);let k=i.at(-1);y.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=y.raw,k.text+=y.text):i.push(y);continue}if(y=this.tokenizer.emStrong(s,c,u)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.codespan(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.br(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.del(s,c,u)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.autolink(s)){s=s.substring(y.raw.length),i.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(s))){s=s.substring(y.raw.length),i.push(y);continue}let S=s;if((v=this.options.extensions)!=null&&v.startInline){let k=1/0,A=s.slice(1),D;this.options.extensions.startInline.forEach(q=>{D=q.call({lexer:this},A),typeof D=="number"&&D>=0&&(k=Math.min(k,D))}),k<1/0&&k>=0&&(S=s.substring(0,k+1))}if(y=this.tokenizer.inlineText(S)){s=s.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(u=y.raw.slice(-1)),o=!0;let k=i.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=y.raw,k.text+=y.text):i.push(y);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return i}infiniteLoopError(s){let i="Infinite loop on byte: "+s;if(this.options.silent)console.error(i);else throw new Error(i)}},rf=class{constructor(n){Jt(this,"options");Jt(this,"parser");this.options=n||Br}space(n){return""}code({text:n,lang:s,escaped:i}){var u;let c=(u=(s||"").match(Ns.notSpaceStart))==null?void 0:u[0],o=n.replace(Ns.endingNewline,"")+`
96
+ `;return c?'<pre><code class="language-'+va(c)+'">'+(i?o:va(o,!0))+`</code></pre>
97
+ `:"<pre><code>"+(i?o:va(o,!0))+`</code></pre>
98
+ `}blockquote({tokens:n}){return`<blockquote>
99
+ ${this.parser.parse(n)}</blockquote>
100
+ `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:s}){return`<h${s}>${this.parser.parseInline(n)}</h${s}>
101
+ `}hr(n){return`<hr>
102
+ `}list(n){let s=n.ordered,i=n.start,c="";for(let h=0;h<n.items.length;h++){let m=n.items[h];c+=this.listitem(m)}let o=s?"ol":"ul",u=s&&i!==1?' start="'+i+'"':"";return"<"+o+u+`>
103
+ `+c+"</"+o+`>
104
+ `}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
105
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
106
+ `}table(n){let s="",i="";for(let o=0;o<n.header.length;o++)i+=this.tablecell(n.header[o]);s+=this.tablerow({text:i});let c="";for(let o=0;o<n.rows.length;o++){let u=n.rows[o];i="";for(let h=0;h<u.length;h++)i+=this.tablecell(u[h]);c+=this.tablerow({text:i})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
107
+ <thead>
108
+ `+s+`</thead>
109
+ `+c+`</table>
110
+ `}tablerow({text:n}){return`<tr>
111
+ ${n}</tr>
112
+ `}tablecell(n){let s=this.parser.parseInline(n.tokens),i=n.header?"th":"td";return(n.align?`<${i} align="${n.align}">`:`<${i}>`)+s+`</${i}>
113
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${va(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:i}){let c=this.parser.parseInline(i),o=hb(n);if(o===null)return c;n=o;let u='<a href="'+n+'"';return s&&(u+=' title="'+va(s)+'"'),u+=">"+c+"</a>",u}image({href:n,title:s,text:i,tokens:c}){c&&(i=this.parser.parseInline(c,this.parser.textRenderer));let o=hb(n);if(o===null)return va(i);n=o;let u=`<img src="${n}" alt="${va(i)}"`;return s&&(u+=` title="${va(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:va(n.text)}},em=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Zl=class Ap{constructor(s){Jt(this,"options");Jt(this,"renderer");Jt(this,"textRenderer");this.options=s||Br,this.options.renderer=this.options.renderer||new rf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new em}static parse(s,i){return new Ap(i).parse(s)}static parseInline(s,i){return new Ap(i).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let i="";for(let u=0;u<s.length;u++){let h=s[u];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){i+=x||"";continue}}let m=h;switch(m.type){case"space":{i+=this.renderer.space(m);break}case"hr":{i+=this.renderer.hr(m);break}case"heading":{i+=this.renderer.heading(m);break}case"code":{i+=this.renderer.code(m);break}case"table":{i+=this.renderer.table(m);break}case"blockquote":{i+=this.renderer.blockquote(m);break}case"list":{i+=this.renderer.list(m);break}case"checkbox":{i+=this.renderer.checkbox(m);break}case"html":{i+=this.renderer.html(m);break}case"def":{i+=this.renderer.def(m);break}case"paragraph":{i+=this.renderer.paragraph(m);break}case"text":{i+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return i}parseInline(s,i=this.renderer){var o,u;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((u=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&u[m.type]){let x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=x||"";continue}}let g=m;switch(g.type){case"escape":{c+=i.text(g);break}case"html":{c+=i.html(g);break}case"link":{c+=i.link(g);break}case"image":{c+=i.image(g);break}case"checkbox":{c+=i.checkbox(g);break}case"strong":{c+=i.strong(g);break}case"em":{c+=i.em(g);break}case"codespan":{c+=i.codespan(g);break}case"br":{c+=i.br(g);break}case"del":{c+=i.del(g);break}case"text":{c+=i.text(g);break}default:{let x='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Jd,hu=(Jd=class{constructor(n){Jt(this,"options");Jt(this,"block");this.options=n||Br}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?Kl.lex:Kl.lexInline}provideParser(n=this.block){return n?Zl.parse:Zl.parseInline}},Jt(Jd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Jt(Jd,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Jd),kj=class{constructor(...n){Jt(this,"defaults",Xp());Jt(this,"options",this.setOptions);Jt(this,"parse",this.parseMarkdown(!0));Jt(this,"parseInline",this.parseMarkdown(!1));Jt(this,"Parser",Zl);Jt(this,"Renderer",rf);Jt(this,"TextRenderer",em);Jt(this,"Lexer",Kl);Jt(this,"Tokenizer",af);Jt(this,"Hooks",hu);this.use(...n)}walkTokens(n,s){var c,o;let i=[];for(let u of n)switch(i=i.concat(s.call(this,u)),u.type){case"table":{let h=u;for(let m of h.header)i=i.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)i=i.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=u;i=i.concat(this.walkTokens(h.items,s));break}default:{let h=u;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);i=i.concat(this.walkTokens(g,s))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,s)))}}return i}use(...n){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(i=>{let c={...i};if(c.async=this.defaults.async||c.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=s.renderers[o.name];u?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=u.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=s[o.level];u?u.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),i.renderer){let o=this.defaults.renderer||new rf(this.defaults);for(let u in i.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let h=u,m=i.renderer[h],g=o[h];o[h]=(...x)=>{let _=m.apply(o,x);return _===!1&&(_=g.apply(o,x)),_||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new af(this.defaults);for(let u in i.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let h=u,m=i.tokenizer[h],g=o[h];o[h]=(...x)=>{let _=m.apply(o,x);return _===!1&&(_=g.apply(o,x)),_}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new hu;for(let u in i.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let h=u,m=i.hooks[h],g=o[h];hu.passThroughHooks.has(u)?o[h]=x=>{if(this.defaults.async&&hu.passThroughHooksRespectAsync.has(u))return(async()=>{let v=await m.call(o,x);return g.call(o,v)})();let _=m.call(o,x);return g.call(o,_)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let v=await m.apply(o,x);return v===!1&&(v=await g.apply(o,x)),v})();let _=m.apply(o,x);return _===!1&&(_=g.apply(o,x)),_}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,u=i.walkTokens;c.walkTokens=function(h){let m=[];return m.push(u.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,s){return Kl.lex(n,s??this.defaults)}parser(n,s){return Zl.parse(n,s??this.defaults)}parseMarkdown(n){return(s,i)=>{let c={...i},o={...this.defaults,...c},u=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(n):n?Kl.lex:Kl.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(n):n?Zl.parse:Zl.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(u);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(n):n?Kl.lex:Kl.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(n):n?Zl.parse:Zl.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return u(h)}}}onError(n,s){return i=>{if(i.message+=`
114
+ Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+va(i.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(i);throw i}}},Hr=new kj;function $t(n,s){return Hr.parse(n,s)}$t.options=$t.setOptions=function(n){return Hr.setOptions(n),$t.defaults=Hr.defaults,Q_($t.defaults),$t};$t.getDefaults=Xp;$t.defaults=Br;$t.use=function(...n){return Hr.use(...n),$t.defaults=Hr.defaults,Q_($t.defaults),$t};$t.walkTokens=function(n,s){return Hr.walkTokens(n,s)};$t.parseInline=Hr.parseInline;$t.Parser=Zl;$t.parser=Zl.parse;$t.Renderer=rf;$t.TextRenderer=em;$t.Lexer=Kl;$t.lexer=Kl.lex;$t.Tokenizer=af;$t.Hooks=hu;$t.parse=$t;$t.options;$t.setOptions;$t.use;$t.walkTokens;$t.parseInline;Zl.parse;Kl.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function xb(n,s){(s==null||s>n.length)&&(s=n.length);for(var i=0,c=Array(s);i<s;i++)c[i]=n[i];return c}function Nj(n){if(Array.isArray(n))return n}function Sj(n,s){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var c,o,u,h,m=[],g=!0,x=!1;try{if(u=(i=i.call(n)).next,s!==0)for(;!(g=(c=u.call(i)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(_){x=!0,o=_}finally{try{if(!g&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function Ej(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
115
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tj(n,s){return Nj(n)||Sj(n,s)||Cj(n,s)||Ej()}function Cj(n,s){if(n){if(typeof n=="string")return xb(n,s);var i={}.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?xb(n,s):void 0}}const sy=Object.entries,bb=Object.setPrototypeOf,Aj=Object.isFrozen,Mj=Object.getPrototypeOf,Rj=Object.getOwnPropertyDescriptor;let ms=Object.freeze,gs=Object.seal,Ic=Object.create,ly=typeof Reflect<"u"&&Reflect,Mp=ly.apply,Rp=ly.construct;ms||(ms=function(s){return s});gs||(gs=function(s){return s});Mp||(Mp=function(s,i){for(var c=arguments.length,o=new Array(c>2?c-2:0),u=2;u<c;u++)o[u-2]=arguments[u];return s.apply(i,o)});Rp||(Rp=function(s){for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return new s(...c)});const Dc=Yn(Array.prototype.forEach),Dj=Yn(Array.prototype.lastIndexOf),_b=Yn(Array.prototype.pop),Oc=Yn(Array.prototype.push),Oj=Yn(Array.prototype.splice),Xi=Array.isArray,pu=Yn(String.prototype.toLowerCase),rp=Yn(String.prototype.toString),yb=Yn(String.prototype.match),iu=Yn(String.prototype.replace),vb=Yn(String.prototype.indexOf),Lj=Yn(String.prototype.trim),zj=Yn(Number.prototype.toString),Ij=Yn(Boolean.prototype.toString),jb=typeof BigInt>"u"?null:Yn(BigInt.prototype.toString),wb=typeof Symbol>"u"?null:Yn(Symbol.prototype.toString),ss=Yn(Object.prototype.hasOwnProperty),ru=Yn(Object.prototype.toString),ns=Yn(RegExp.prototype.test),Sr=Uj(TypeError);function Yn(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return Mp(n,s,c)}}function Uj(n){return function(){for(var s=arguments.length,i=new Array(s),c=0;c<s;c++)i[c]=arguments[c];return Rp(n,i)}}function Et(n,s){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pu;if(bb&&bb(n,null),!Xi(s))return n;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const u=i(o);u!==o&&(Aj(s)||(s[c]=u),o=u)}n[o]=!0}return n}function Hj(n){for(let s=0;s<n.length;s++)ss(n,s)||(n[s]=null);return n}function Us(n){const s=Ic(null);for(const c of sy(n)){var i=Tj(c,2);const o=i[0],u=i[1];ss(n,o)&&(Xi(u)?s[o]=Hj(u):u&&typeof u=="object"&&u.constructor===Object?s[o]=Us(u):s[o]=u)}return s}function Bj(n){switch(typeof n){case"string":return n;case"number":return zj(n);case"boolean":return Ij(n);case"bigint":return jb?jb(n):"0";case"symbol":return wb?wb(n):"Symbol()";case"undefined":return ru(n);case"function":case"object":{if(n===null)return ru(n);const s=n,i=ja(s,"toString");if(typeof i=="function"){const c=i(s);return typeof c=="string"?c:ru(c)}return ru(n)}default:return ru(n)}}function ja(n,s){for(;n!==null;){const c=Rj(n,s);if(c){if(c.get)return Yn(c.get);if(typeof c.value=="function")return Yn(c.value)}n=Mj(n)}function i(){return null}return i}function qj(n){try{return ns(n,""),!0}catch{return!1}}const kb=ms(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cp=ms(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),op=ms(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gj=ms(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),up=ms(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$j=ms(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nb=ms(["#text"]),Sb=ms(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),dp=ms(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Eb=ms(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Dd=ms(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yj=gs(/{{[\w\W]*|^[\w\W]*}}/g),Vj=gs(/<%[\w\W]*|^[\w\W]*%>/g),Xj=gs(/\${[\w\W]*/g),Qj=gs(/^data-[\-\w.\u00B7-\uFFFF]+$/),Kj=gs(/^aria-[\-\w]+$/),Tb=gs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zj=gs(/^(?:\w+script|data):/i),Fj=gs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pj=gs(/^html$/i),Jj=gs(/^[a-z][.\w]*(-[.\w]+)+$/i),Cb=gs(/<[/\w!]/g),Ab=gs(/<[/\w]/g),Wj=gs(/<\/no(script|embed|frames)/i),ew=gs(/\/>/i),dl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},tw=function(){return typeof window>"u"?null:window},nw=function(s,i){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(c=i.getAttribute(o));const u="dompurify"+(c?"#"+c:"");try{return s.createPolicy(u,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Mb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},qi=function(s,i,c,o){return ss(s,i)&&Xi(s[i])?Et(o.base?Us(o.base):{},s[i],o.transform):c};function ay(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tw();const s=Se=>ay(Se);if(s.version="3.4.12",s.removed=[],!n||!n.document||n.document.nodeType!==dl.document||!n.Element)return s.isSupported=!1,s;let i=n.document;const c=i,o=c.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,h=n.Node,m=n.Element,g=n.NodeFilter,x=n.NamedNodeMap;x===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const _=n.DOMParser,v=n.trustedTypes,y=m.prototype,S=ja(y,"cloneNode"),k=ja(y,"remove"),A=ja(y,"nextSibling"),D=ja(y,"childNodes"),q=ja(y,"parentNode"),G=ja(y,"shadowRoot"),Q=ja(y,"attributes"),z=h&&h.prototype?ja(h.prototype,"nodeType"):null,$=h&&h.prototype?ja(h.prototype,"nodeName"):null;if(typeof u=="function"){const Se=i.createElement("template");Se.content&&Se.content.ownerDocument&&(i=Se.content.ownerDocument)}let E,I="",X,H=!1,B=0;const O=function(){if(B>0)throw Sr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},W=function(R){O(),B++;try{return E.createHTML(R)}finally{B--}},he=function(R){O(),B++;try{return E.createScriptURL(R)}finally{B--}},je=function(){return H||(X=nw(v,o),H=!0),X},we=i,M=we.implementation,N=we.createNodeIterator,V=we.createDocumentFragment,ae=we.getElementsByTagName,ke=c.importNode;let C=Mb();s.isSupported=typeof sy=="function"&&typeof q=="function"&&M&&M.createHTMLDocument!==void 0;const K=Yj,de=Vj,_e=Xj,Ae=Qj,ze=Kj,be=Zj,Ge=Fj,lt=Jj;let Mt=Tb,fe=null;const at=Et({},[...kb,...cp,...op,...up,...Nb]);let oe=null;const Rt=Et({},[...Sb,...dp,...Eb,...Dd]);let Be=Object.seal(Ic(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qt=null,Hn=null;const xt=Object.seal(Ic(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Kt=!0,an=!0,Vn=!1,jt=!0,Z=!1,Oe=!0,Ye=!1,ut=!1,Ee=null,Te=null,Me=!1,Ve=!1,Ke=!1,Pe=!1,dt=!0,Ct=!1;const Cn="user-content-";let St=!0,Lt=!1,re={},Ne=null;const Xe=Et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let We=null;const tt=Et({},["audio","video","img","source","image","track"]);let on=null;const On=Et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wt="http://www.w3.org/1998/Math/MathML",bn="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let zt=Yt,P=!1,pe=null;const Re=Et({},[Wt,bn,Yt],rp),Ze=ms(["mi","mo","mn","ms","mtext"]);let It=Et({},Ze);const rn=ms(["annotation-xml"]);let wt=Et({},rn);const xs=Et({},["title","style","font","a","script"]);let Xn=null;const ls=["application/xhtml+xml","text/html"],cn="text/html";let it=null,un=null;const Es=i.createElement("form"),Ts=function(R){return R instanceof RegExp||R instanceof Function},Cs=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(un&&un===R)return;(!R||typeof R!="object")&&(R={}),R=Us(R),Xn=ls.indexOf(R.PARSER_MEDIA_TYPE)===-1?cn:R.PARSER_MEDIA_TYPE,it=Xn==="application/xhtml+xml"?rp:pu,fe=qi(R,"ALLOWED_TAGS",at,{transform:it}),oe=qi(R,"ALLOWED_ATTR",Rt,{transform:it}),pe=qi(R,"ALLOWED_NAMESPACES",Re,{transform:rp}),on=qi(R,"ADD_URI_SAFE_ATTR",On,{transform:it,base:On}),We=qi(R,"ADD_DATA_URI_TAGS",tt,{transform:it,base:tt}),Ne=qi(R,"FORBID_CONTENTS",Xe,{transform:it}),qt=qi(R,"FORBID_TAGS",Us({}),{transform:it}),Hn=qi(R,"FORBID_ATTR",Us({}),{transform:it}),re=ss(R,"USE_PROFILES")?R.USE_PROFILES&&typeof R.USE_PROFILES=="object"?Us(R.USE_PROFILES):R.USE_PROFILES:!1,Kt=R.ALLOW_ARIA_ATTR!==!1,an=R.ALLOW_DATA_ATTR!==!1,Vn=R.ALLOW_UNKNOWN_PROTOCOLS||!1,jt=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=R.SAFE_FOR_TEMPLATES||!1,Oe=R.SAFE_FOR_XML!==!1,Ye=R.WHOLE_DOCUMENT||!1,Ve=R.RETURN_DOM||!1,Ke=R.RETURN_DOM_FRAGMENT||!1,Pe=R.RETURN_TRUSTED_TYPE||!1,Me=R.FORCE_BODY||!1,dt=R.SANITIZE_DOM!==!1,Ct=R.SANITIZE_NAMED_PROPS||!1,St=R.KEEP_CONTENT!==!1,Lt=R.IN_PLACE||!1,Mt=qj(R.ALLOWED_URI_REGEXP)?R.ALLOWED_URI_REGEXP:Tb,zt=typeof R.NAMESPACE=="string"?R.NAMESPACE:Yt,It=ss(R,"MATHML_TEXT_INTEGRATION_POINTS")&&R.MATHML_TEXT_INTEGRATION_POINTS&&typeof R.MATHML_TEXT_INTEGRATION_POINTS=="object"?Us(R.MATHML_TEXT_INTEGRATION_POINTS):Et({},Ze),wt=ss(R,"HTML_INTEGRATION_POINTS")&&R.HTML_INTEGRATION_POINTS&&typeof R.HTML_INTEGRATION_POINTS=="object"?Us(R.HTML_INTEGRATION_POINTS):Et({},rn);const J=ss(R,"CUSTOM_ELEMENT_HANDLING")&&R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING=="object"?Us(R.CUSTOM_ELEMENT_HANDLING):Ic(null);if(Be=Ic(null),ss(J,"tagNameCheck")&&Ts(J.tagNameCheck)&&(Be.tagNameCheck=J.tagNameCheck),ss(J,"attributeNameCheck")&&Ts(J.attributeNameCheck)&&(Be.attributeNameCheck=J.attributeNameCheck),ss(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(Be.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),gs(Be),Z&&(an=!1),Ke&&(Ve=!0),re&&(fe=Et({},Nb),oe=Ic(null),re.html===!0&&(Et(fe,kb),Et(oe,Sb)),re.svg===!0&&(Et(fe,cp),Et(oe,dp),Et(oe,Dd)),re.svgFilters===!0&&(Et(fe,op),Et(oe,dp),Et(oe,Dd)),re.mathMl===!0&&(Et(fe,up),Et(oe,Eb),Et(oe,Dd))),xt.tagCheck=null,xt.attributeCheck=null,ss(R,"ADD_TAGS")&&(typeof R.ADD_TAGS=="function"?xt.tagCheck=R.ADD_TAGS:Xi(R.ADD_TAGS)&&(fe===at&&(fe=Us(fe)),Et(fe,R.ADD_TAGS,it))),ss(R,"ADD_ATTR")&&(typeof R.ADD_ATTR=="function"?xt.attributeCheck=R.ADD_ATTR:Xi(R.ADD_ATTR)&&(oe===Rt&&(oe=Us(oe)),Et(oe,R.ADD_ATTR,it))),ss(R,"ADD_URI_SAFE_ATTR")&&Xi(R.ADD_URI_SAFE_ATTR)&&Et(on,R.ADD_URI_SAFE_ATTR,it),ss(R,"FORBID_CONTENTS")&&Xi(R.FORBID_CONTENTS)&&(Ne===Xe&&(Ne=Us(Ne)),Et(Ne,R.FORBID_CONTENTS,it)),ss(R,"ADD_FORBID_CONTENTS")&&Xi(R.ADD_FORBID_CONTENTS)&&(Ne===Xe&&(Ne=Us(Ne)),Et(Ne,R.ADD_FORBID_CONTENTS,it)),St&&(fe["#text"]=!0),Ye&&Et(fe,["html","head","body"]),fe.table&&(Et(fe,["tbody"]),delete qt.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ye=E;E=R.TRUSTED_TYPES_POLICY;try{I=W("")}catch(Ce){throw E=ye,Ce}}else R.TRUSTED_TYPES_POLICY===null?(E=void 0,I=""):(E===void 0&&(E=je()),E&&typeof I=="string"&&(I=W("")));ms&&ms(R),un=R},Hs=Et({},[...cp,...op,...Gj]),as=Et({},[...up,...$j]),As=function(R,J,ye){return J.namespaceURI===Yt?R==="svg":J.namespaceURI===Wt?R==="svg"&&(ye==="annotation-xml"||It[ye]):!!Hs[R]},Zt=function(R,J,ye){return J.namespaceURI===Yt?R==="math":J.namespaceURI===bn?R==="math"&&wt[ye]:!!as[R]},Bs=function(R,J,ye){return J.namespaceURI===bn&&!wt[ye]||J.namespaceURI===Wt&&!It[ye]?!1:!as[R]&&(xs[R]||!Hs[R])},_n=function(R){let J=q(R);(!J||!J.tagName)&&(J={namespaceURI:zt,tagName:"template"});const ye=pu(R.tagName),Ce=pu(J.tagName);return pe[R.namespaceURI]?R.namespaceURI===bn?As(ye,J,Ce):R.namespaceURI===Wt?Zt(ye,J,Ce):R.namespaceURI===Yt?Bs(ye,J,Ce):!!(Xn==="application/xhtml+xml"&&pe[R.namespaceURI]):!1},yn=function(R){Oc(s.removed,{element:R});try{q(R).removeChild(R)}catch{if(k(R),!q(R))throw Sr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},st=function(R){is(R);const J=D(R);if(J){const Ce=[];Dc(J,Qe=>{Oc(Ce,Qe)}),Dc(Ce,Qe=>{try{k(Qe)}catch{}})}const ye=Q(R);if(ye)for(let Ce=ye.length-1;Ce>=0;--Ce){const Qe=ye[Ce],Je=Qe&&Qe.name;if(typeof Je=="string")try{R.removeAttribute(Je)}catch{}}},Pn=function(R,J){try{Oc(s.removed,{attribute:J.getAttributeNode(R),from:J})}catch{Oc(s.removed,{attribute:null,from:J})}if(J.removeAttribute(R),R==="is")if(Ve||Ke)try{yn(J)}catch{}else try{J.setAttribute(R,"")}catch{}},Qn=function(R){const J=Q(R);if(J)for(let ye=J.length-1;ye>=0;--ye){const Ce=J[ye],Qe=Ce&&Ce.name;if(!(typeof Qe!="string"||oe[it(Qe)]))try{R.removeAttribute(Qe)}catch{}}},is=function(R){const J=[R];for(;J.length>0;){const ye=J.pop();(z?z(ye):ye.nodeType)===dl.element&&Qn(ye);const Qe=D(ye);if(Qe)for(let Je=Qe.length-1;Je>=0;--Je)J.push(Qe[Je])}},dn=function(R){if(!Oe)return;const J=[R];for(;J.length>0;){const ye=J.pop(),Ce=z?z(ye):ye.nodeType;if(Ce===dl.processingInstruction||Ce===dl.comment&&ns(Ab,ye.data)){try{k(ye)}catch{}continue}if(Ce===dl.element){const Je=ye,Vt=it($?$(ye):ye.nodeName);try{Je.hasAttribute&&Je.hasAttribute("patchsrc")&&Je.removeAttribute("patchsrc"),Je.hasAttribute&&Je.hasAttribute("for")&&Vt!=="label"&&Vt!=="output"&&Je.removeAttribute("for")}catch{}}const Qe=D(ye);if(Qe)for(let Je=Qe.length-1;Je>=0;--Je)J.push(Qe[Je])}},fl=function(R){let J=null,ye=null;if(Me)R="<remove></remove>"+R;else{const Je=yb(R,/^[\r\n\t ]+/);ye=Je&&Je[0]}Xn==="application/xhtml+xml"&&zt===Yt&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const Ce=E?W(R):R;if(zt===Yt)try{J=new _().parseFromString(Ce,Xn)}catch{}if(!J||!J.documentElement){J=M.createDocument(zt,"template",null);try{J.documentElement.innerHTML=P?I:Ce}catch{}}const Qe=J.body||J.documentElement;return R&&ye&&Qe.insertBefore(i.createTextNode(ye),Qe.childNodes[0]||null),zt===Yt?ae.call(J,Ye?"html":"body")[0]:Ye?J.documentElement:Qe},Ms=function(R){return N.call(R.ownerDocument||R,R,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},rs=function(R){return R=iu(R,K," "),R=iu(R,de," "),R=iu(R,_e," "),R},Rs=function(R){var J;R.normalize();const ye=N.call(R.ownerDocument||R,R,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ce=ye.nextNode();for(;Ce;)Ce.data=rs(Ce.data),Ce=ye.nextNode();const Qe=(J=R.querySelectorAll)===null||J===void 0?void 0:J.call(R,"template");Qe&&Dc(Qe,Je=>{Ln(Je.content)&&Rs(Je.content)})},En=function(R){const J=$?$(R):null;return typeof J!="string"||it(J)!=="form"?!1:typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||R.attributes!==Q(R)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function"||R.nodeType!==z(R)||R.childNodes!==D(R)},Ln=function(R){if(!z||typeof R!="object"||R===null)return!1;try{return z(R)===dl.documentFragment}catch{return!1}},Bn=function(R){if(!z||typeof R!="object"||R===null)return!1;try{return typeof z(R)=="number"}catch{return!1}};function en(Se,R,J){Se.length!==0&&Dc(Se,ye=>{ye.call(s,R,J,un)})}const Nl=function(R,J){return!!(Oe&&R.hasChildNodes()&&!Bn(R.firstElementChild)&&ns(Cb,R.textContent)&&ns(Cb,R.innerHTML)||Oe&&R.namespaceURI===Yt&&J==="style"&&Bn(R.firstElementChild)||R.nodeType===dl.processingInstruction||Oe&&R.nodeType===dl.comment&&ns(Ab,R.data))},ni=function(R,J){if(!qt[J]&&El(J)&&(Be.tagNameCheck instanceof RegExp&&ns(Be.tagNameCheck,J)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(J)))return!1;if(St&&!Ne[J]){const ye=q(R),Ce=D(R);if(Ce&&ye){const Qe=Ce.length;for(let Je=Qe-1;Je>=0;--Je){const Vt=Lt?Ce[Je]:S(Ce[Je],!0);ye.insertBefore(Vt,A(R))}}}return yn(R),!0},Jl=function(R,J){if(en(C.beforeSanitizeElements,R,null),R!==J&&q(R)===null)return!0;if(En(R))return yn(R),!0;const ye=it($?$(R):R.nodeName);if(en(C.uponSanitizeElement,R,{tagName:ye,allowedTags:fe}),R!==J&&q(R)===null)return!0;if(Nl(R,ye))return yn(R),!0;if(qt[ye]||!(xt.tagCheck instanceof Function&&xt.tagCheck(ye))&&!fe[ye]){const Qe=ni(R,ye);return Qe===!1&&en(C.afterSanitizeElements,R,null),Qe}if((z?z(R):R.nodeType)===dl.element&&!_n(R)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&ns(Wj,R.innerHTML))return yn(R),!0;if(Z&&R.nodeType===dl.text){const Qe=rs(R.textContent);R.textContent!==Qe&&(Oc(s.removed,{element:R.cloneNode()}),R.textContent=Qe)}return en(C.afterSanitizeElements,R,null),!1},An=function(R,J,ye){if(Hn[J]||Oe&&J==="patchsrc"||Oe&&J==="for"&&R!=="label"&&R!=="output"||dt&&(J==="id"||J==="name")&&(ye in i||ye in Es))return!1;const Ce=oe[J]||xt.attributeCheck instanceof Function&&xt.attributeCheck(J,R);if(!(an&&ns(Ae,J))){if(!(Kt&&ns(ze,J))){if(Ce){if(!on[J]){if(!ns(Mt,iu(ye,Ge,""))){if(!((J==="src"||J==="xlink:href"||J==="href")&&R!=="script"&&vb(ye,"data:")===0&&We[R])){if(!(Vn&&!ns(be,iu(ye,Ge,"")))){if(ye)return!1}}}}}else if(!(El(R)&&(Be.tagNameCheck instanceof RegExp&&ns(Be.tagNameCheck,R)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(R))&&(Be.attributeNameCheck instanceof RegExp&&ns(Be.attributeNameCheck,J)||Be.attributeNameCheck instanceof Function&&Be.attributeNameCheck(J,R))||J==="is"&&Be.allowCustomizedBuiltInElements&&(Be.tagNameCheck instanceof RegExp&&ns(Be.tagNameCheck,ye)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(ye))))return!1}}return!0},Sl=Et({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),El=function(R){return!Sl[pu(R)]&&ns(lt,R)},Jn=function(R,J,ye,Ce){if(E&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ye)switch(v.getAttributeType(R,J)){case"TrustedHTML":return W(Ce);case"TrustedScriptURL":return he(Ce)}return Ce},Tl=function(R,J,ye,Ce){try{ye?R.setAttributeNS(ye,J,Ce):R.setAttribute(J,Ce),En(R)?yn(R):_b(s.removed)}catch{Pn(J,R)}},Wl=function(R){en(C.beforeSanitizeAttributes,R,null);const J=R.attributes;if(!J||En(R))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let Ce=J.length;const Qe=it(R.nodeName);for(;Ce--;){const Je=J[Ce],Vt=Je.name,mt=Je.namespaceURI,tn=Je.value,rt=it(Vt),At=tn;let fn=Vt==="value"?At:Lj(At);if(ye.attrName=rt,ye.attrValue=fn,ye.keepAttr=!0,ye.forceKeepAttr=void 0,en(C.uponSanitizeAttribute,R,ye),fn=ye.attrValue,Ct&&(rt==="id"||rt==="name")&&vb(fn,Cn)!==0&&(Pn(Vt,R),fn=Cn+fn),Oe&&ns(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,fn)){Pn(Vt,R);continue}if(rt==="attributename"&&yb(fn,"href")){Pn(Vt,R);continue}if(!ye.forceKeepAttr){if(!ye.keepAttr){Pn(Vt,R);continue}if(!jt&&ns(ew,fn)){Pn(Vt,R);continue}if(Z&&(fn=rs(fn)),!An(Qe,rt,fn)){Pn(Vt,R);continue}fn=Jn(Qe,rt,mt,fn),fn!==At&&Tl(R,Vt,mt,fn)}}en(C.afterSanitizeAttributes,R,null)},qs=function(R){let J=null;const ye=Ms(R);for(en(C.beforeSanitizeShadowDOM,R,null);J=ye.nextNode();)if(en(C.uponSanitizeShadowNode,J,null),Jl(J,R),Wl(J),Ln(J.content)&&qs(J.content),(z?z(J):J.nodeType)===dl.element){const Qe=G(J);Ln(Qe)&&(vn(Qe),qs(Qe))}en(C.afterSanitizeShadowDOM,R,null)},vn=function(R){const J=[{node:R,shadow:null}];for(;J.length>0;){const ye=J.pop();if(ye.shadow){qs(ye.shadow);continue}const Ce=ye.node,Je=(z?z(Ce):Ce.nodeType)===dl.element,Vt=D(Ce);if(Vt)for(let mt=Vt.length-1;mt>=0;--mt)J.push({node:Vt[mt],shadow:null});if(Je){const mt=$?$(Ce):null;if(typeof mt=="string"&&it(mt)==="template"){const tn=Ce.content;Ln(tn)&&J.push({node:tn,shadow:null})}}if(Je){const mt=G(Ce);Ln(mt)&&J.push({node:null,shadow:mt},{node:mt,shadow:null})}}};return s.sanitize=function(Se){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,ye=null,Ce=null,Qe=null;if(P=!Se,P&&(Se="<!-->"),typeof Se!="string"&&!Bn(Se)&&(Se=Bj(Se),typeof Se!="string"))throw Sr("dirty is not a string, aborting");if(!s.isSupported)return Se;ut?(fe=Ee,oe=Te):Cs(R),(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&(fe=Us(fe)),C.uponSanitizeAttribute.length>0&&(oe=Us(oe)),s.removed=[];const Je=Lt&&typeof Se!="string"&&Bn(Se);if(Je){dn(Se);const rt=$?$(Se):Se.nodeName;if(typeof rt=="string"){const At=it(rt);if(!fe[At]||qt[At])throw st(Se),Sr("root node is forbidden and cannot be sanitized in-place")}if(En(Se))throw st(Se),Sr("root node is clobbered and cannot be sanitized in-place");try{vn(Se)}catch(At){throw st(Se),At}}else if(Bn(Se))J=fl("<!---->"),ye=J.ownerDocument.importNode(Se,!0),ye.nodeType===dl.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?J=ye:J.appendChild(ye),vn(ye);else{if(!Ve&&!Z&&!Ye&&Se.indexOf("<")===-1)return E&&Pe?W(Se):Se;if(J=fl(Se),!J)return Ve?null:Pe?I:""}J&&Me&&yn(J.firstChild);const Vt=Je?Se:J,mt=Ms(Vt);try{for(;Ce=mt.nextNode();)Jl(Ce,Vt),Wl(Ce),Ln(Ce.content)&&qs(Ce.content)}catch(rt){throw Je&&(st(Se),Dc(s.removed,At=>{At.element&&is(At.element)})),rt}if(Je)return Dc(s.removed,rt=>{rt.element&&is(rt.element)}),Z&&Rs(Se),Se;if(Ve){if(Z&&Rs(J),Ke)for(Qe=V.call(J.ownerDocument);J.firstChild;)Qe.appendChild(J.firstChild);else Qe=J;return(oe.shadowroot||oe.shadowrootmode)&&(Qe=ke.call(c,Qe,!0)),Qe}let tn=Ye?J.outerHTML:J.innerHTML;return Ye&&fe["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&ns(Pj,J.ownerDocument.doctype.name)&&(tn="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
116
+ `+tn),Z&&(tn=rs(tn)),E&&Pe?W(tn):tn},s.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cs(Se),ut=!0,Ee=fe,Te=oe},s.clearConfig=function(){un=null,ut=!1,Ee=null,Te=null,E=X,I=""},s.isValidAttribute=function(Se,R,J){un||Cs({});const ye=it(Se),Ce=it(R);return An(ye,Ce,J)},s.addHook=function(Se,R){typeof R=="function"&&ss(C,Se)&&Oc(C[Se],R)},s.removeHook=function(Se,R){if(ss(C,Se)){if(R!==void 0){const J=Dj(C[Se],R);return J===-1?void 0:Oj(C[Se],J,1)[0]}return _b(C[Se])}},s.removeHooks=function(Se){ss(C,Se)&&(C[Se]=[])},s.removeAllHooks=function(){C=Mb()},s}var sw=ay();const lw=1024;let aw=0;class kl{constructor(s,i){this.from=s,this.to=i}}class xn{constructor(s={}){this.id=aw++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=Pl.match(s)),i=>{let c=s(i);return c===void 0?null:[this,c]}}}xn.closedBy=new xn({deserialize:n=>n.split(" ")});xn.openedBy=new xn({deserialize:n=>n.split(" ")});xn.group=new xn({deserialize:n=>n.split(" ")});xn.isolate=new xn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});xn.contextHash=new xn({perNode:!0});xn.lookAhead=new xn({perNode:!0});xn.mounted=new xn({perNode:!0});class qc{constructor(s,i,c,o=!1){this.tree=s,this.overlay=i,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[xn.mounted.id]}}const iw=Object.create(null);class Pl{constructor(s,i,c,o=0){this.name=s,this.props=i,this.id=c,this.flags=o}static define(s){let i=s.props&&s.props.length?Object.create(null):iw,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Pl(s.name||"",i,s.id,c);if(s.props){for(let u of s.props)if(Array.isArray(u)||(u=u(o)),u){if(u[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[u[0].id]=u[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let i=this.prop(xn.group);return i?i.indexOf(s)>-1:!1}return this.id==s}static match(s){let i=Object.create(null);for(let c in s)for(let o of c.split(" "))i[o]=s[c];return c=>{for(let o=c.prop(xn.group),u=-1;u<(o?o.length:0);u++){let h=i[u<0?c.name:o[u]];if(h)return h}}}}Pl.none=new Pl("",Object.create(null),0,8);class iy{constructor(s){this.types=s;for(let i=0;i<s.length;i++)if(s[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let i=[];for(let c of this.types){let o=null;for(let u of s){let h=u(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}i.push(o?new Pl(c.name,o,c.id,c.flags):c)}return new iy(i)}}const Od=new WeakMap,Rb=new WeakMap;var mn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(mn||(mn={}));class tl{constructor(s,i,c,o,u){if(this.type=s,this.children=i,this.positions=c,this.length=o,this.props=null,u&&u.length){this.props=Object.create(null);for(let[h,m]of u)this.props[typeof h=="number"?h:h.id]=m}}toString(){let s=qc.get(this);if(s&&!s.overlay)return s.tree.toString();let i="";for(let c of this.children){let o=c.toString();o&&(i&&(i+=","),i+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(s=0){return new cf(this.topNode,s)}cursorAt(s,i=0,c=0){let o=Od.get(this)||this.topNode,u=new cf(o);return u.moveTo(s,i),Od.set(this,u._tree),u}get topNode(){return new Ss(this,0,0,null)}resolve(s,i=0){let c=ju(Od.get(this)||this.topNode,s,i,!1);return Od.set(this,c),c}resolveInner(s,i=0){let c=ju(Rb.get(this)||this.topNode,s,i,!0);return Rb.set(this,c),c}resolveStack(s,i=0){return ow(this,s,i)}iterate(s){let{enter:i,leave:c,from:o=0,to:u=this.length}=s,h=s.mode||0,m=(h&mn.IncludeAnonymous)>0;for(let g=this.cursor(h|mn.IncludeAnonymous);;){let x=!1;if(g.from<=u&&g.to>=o&&(!m&&g.type.isAnonymous||i(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let i in this.props)s.push([+i,this.props[i]]);return s}balance(s={}){return this.children.length<=8?this:sm(Pl.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new tl(this.type,i,c,o,this.propValues),s.makeTree||((i,c,o)=>new tl(Pl.none,i,c,o)))}static build(s){return uw(s)}}tl.empty=new tl(Pl.none,[],[],0);class tm{constructor(s,i){this.buffer=s,this.index=i}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new tm(this.buffer,this.index)}}class Pi{constructor(s,i,c){this.buffer=s,this.length=i,this.set=c}get type(){return Pl.none}toString(){let s=[];for(let i=0;i<this.buffer.length;)s.push(this.childString(i)),i=this.buffer[i+3];return s.join(",")}childString(s){let i=this.buffer[s],c=this.buffer[s+3],o=this.set.types[i],u=o.name;if(/\W/.test(u)&&!o.isError&&(u=JSON.stringify(u)),s+=4,c==s)return u;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return u+"("+h.join(",")+")"}findChild(s,i,c,o,u){let{buffer:h}=this,m=-1;for(let g=s;g!=i&&!(ry(u,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,i,c){let o=this.buffer,u=new Uint16Array(i-s),h=0;for(let m=s,g=0;m<i;){u[g++]=o[m++],u[g++]=o[m++]-c;let x=u[g++]=o[m++]-c;u[g++]=o[m++]-s,h=Math.max(h,x)}return new Pi(u,h,this.set)}}function ry(n,s,i,c){switch(n){case-2:return i<s;case-1:return c>=s&&i<s;case 0:return i<s&&c>s;case 1:return i<=s&&c>s;case 2:return c>s;case 4:return!0}}function ju(n,s,i,c){for(var o;n.from==n.to||(i<1?n.from>=s:n.from>s)||(i>-1?n.to<=s:n.to<s);){let h=!c&&n instanceof Ss&&n.index<0?null:n.parent;if(!h)return n;n=h}let u=c?0:mn.IgnoreOverlays;if(c)for(let h=n,m=h.parent;m;h=m,m=h.parent)h instanceof Ss&&h.index<0&&((o=m.enter(s,i,u))===null||o===void 0?void 0:o.from)!=h.from&&(n=m);for(;;){let h=n.enter(s,i,u);if(!h)return n;n=h}}class cy{cursor(s=0){return new cf(this,s)}getChild(s,i=null,c=null){let o=Db(this,s,i,c);return o.length?o[0]:null}getChildren(s,i=null,c=null){return Db(this,s,i,c)}resolve(s,i=0){return ju(this,s,i,!1)}resolveInner(s,i=0){return ju(this,s,i,!0)}matchContext(s){return Dp(this.parent,s)}enterUnfinishedNodesBefore(s){let i=this.childBefore(s),c=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(c=i,i=o.prevSibling):i=o}return c}get node(){return this}get next(){return this.parent}}class Ss extends cy{constructor(s,i,c,o){super(),this._tree=s,this.from=i,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(s,i,c,o,u=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,x=i>0?m.length:-1;s!=x;s+=i){let _=m[s],v=g[s]+h.from,y;if(!(!(u&mn.EnterBracketed&&_ instanceof tl&&(y=qc.get(_))&&!y.overlay&&y.bracketed&&c>=v&&c<=v+_.length)&&!ry(o,c,v,v+_.length))){if(_ instanceof Pi){if(u&mn.ExcludeBuffers)continue;let S=_.findChild(0,_.buffer.length,i,c-v,o);if(S>-1)return new Ea(new rw(h,_,s,v),null,S)}else if(u&mn.IncludeAnonymous||!_.type.isAnonymous||nm(_)){let S;if(!(u&mn.IgnoreMounts)&&(S=qc.get(_))&&!S.overlay)return new Ss(S.tree,v,s,h);let k=new Ss(_,v,s,h);return u&mn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(i<0?_.children.length-1:0,i,c,o,u)}}}if(u&mn.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+i:s=i<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,i,c=0){let o;if(!(c&mn.IgnoreOverlays)&&(o=qc.get(this._tree))&&o.overlay){let u=s-this.from,h=c&mn.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((i>0||h?m<=u:m<u)&&(i<0||h?g>=u:g>u))return new Ss(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,i,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Db(n,s,i,c){let o=n.cursor(),u=[];if(!o.firstChild())return u;if(i!=null){for(let h=!1;!h;)if(h=o.type.is(i),!o.nextSibling())return u}for(;;){if(c!=null&&o.type.is(c))return u;if(o.type.is(s)&&u.push(o.node),!o.nextSibling())return c==null?u:[]}}function Dp(n,s,i=s.length-1){for(let c=n;i>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[i]&&s[i]!=c.name)return!1;i--}}return!0}class rw{constructor(s,i,c,o){this.parent=s,this.buffer=i,this.index=c,this.start=o}}class Ea extends cy{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,i,c){super(),this.context=s,this._parent=i,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,i,c){let{buffer:o}=this.context,u=o.findChild(this.index+4,o.buffer[this.index+3],s,i-this.context.start,c);return u<0?null:new Ea(this.context,this,u)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,i,c=0){if(c&mn.ExcludeBuffers)return null;let{buffer:o}=this.context,u=o.findChild(this.index+4,o.buffer[this.index+3],i>0?1:-1,s-this.context.start,i);return u<0?null:new Ea(this.context,this,u)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,i=s.buffer[this.index+3];return i<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new Ea(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new Ea(this.context,this._parent,s.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],i=[],{buffer:c}=this.context,o=this.index+4,u=c.buffer[this.index+3];if(u>o){let h=c.buffer[this.index+1];s.push(c.slice(o,u,h)),i.push(0)}return new tl(this.type,s,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function oy(n){if(!n.length)return null;let s=0,i=n[0];for(let u=1;u<n.length;u++){let h=n[u];(h.from>i.from||h.to<i.to)&&(i=h,s=u)}let c=i instanceof Ss&&i.index<0?null:i.parent,o=n.slice();return c?o[s]=c:o.splice(s,1),new cw(o,i)}class cw{constructor(s,i){this.heads=s,this.node=i}get next(){return oy(this.heads)}}function ow(n,s,i){let c=n.resolveInner(s,i),o=null;for(let u=c instanceof Ss?c:c.context.parent;u;u=u.parent)if(u.index<0){let h=u.parent;(o||(o=[c])).push(h.resolve(s,i)),u=h}else{let h=qc.get(u.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new Ss(h.tree,h.overlay[0].from+u.from,-1,u);(o||(o=[c])).push(ju(m,s,i,!1))}}return o?oy(o):c}class cf{get name(){return this.type.name}constructor(s,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~mn.EnterBracketed,s instanceof Ss)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,i){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=i||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof Ss?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,i,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,i,c,this.mode));let{buffer:o}=this.buffer,u=o.findChild(this.index+4,o.buffer[this.index+3],s,i-this.buffer.start,c);return u<0?!1:(this.stack.push(this.index),this.yieldBuf(u))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,i,c=this.mode){return this.buffer?c&mn.ExcludeBuffers?!1:this.enterChild(1,s,i):this.yield(this._tree.enter(s,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&mn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&mn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:i}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(i.findChild(o,this.index,-1,0,4))}else{let o=i.buffer[this.index+3];if(o<(c<0?i.buffer.length:i.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let i,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let u=0;u<this.index;u++)if(o.buffer.buffer[u+3]<this.index)return!1;({index:i,parent:c}=o)}else({index:i,_parent:c}=this._tree);for(;c;{index:i,_parent:c}=c)if(i>-1)for(let u=i+s,h=s<0?-1:c._tree.children.length;u!=h;u+=s){let m=c._tree.children[u];if(this.mode&mn.IncludeAnonymous||m instanceof Pi||!m.type.isAnonymous||nm(m))return!1}return!0}move(s,i){if(i&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,i=0){for(;(this.from==this.to||(i<1?this.from>=s:this.from>s)||(i>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,i););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,i=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,u=this.stack.length;u>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;i=h,c=u+1;break e}o=this.stack[--u]}for(let o=c;o<this.stack.length;o++)i=new Ea(this.buffer,i,this.stack[o]);return this.bufferNode=new Ea(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,i){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&i&&i(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return Dp(this.node.parent,s);let{buffer:i}=this.buffer,{types:c}=i.set;for(let o=s.length-1,u=this.stack.length-1;o>=0;u--){if(u<0)return Dp(this._tree,s,o);let h=c[i.buffer[this.stack[u]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function nm(n){return n.children.some(s=>s instanceof Pi||!s.type.isAnonymous||nm(s))}function uw(n){var s;let{buffer:i,nodeSet:c,maxBufferLength:o=lw,reused:u=[],minRepeatType:h=c.types.length}=n,m=Array.isArray(i)?new tm(i,i.length):i,g=c.types,x=0,_=0;function v($,E,I,X,H,B){let{id:O,start:W,end:he,size:je}=m,we=_,M=x;if(je<0)if(m.next(),je==-1){let C=u[O];I.push(C),X.push(W-$);return}else if(je==-3){x=O;return}else if(je==-4){_=O;return}else throw new RangeError(`Unrecognized record size: ${je}`);let N=g[O],V,ae,ke=W-$;if(he-W<=o&&(ae=D(m.pos-E,H))){let C=new Uint16Array(ae.size-ae.skip),K=m.pos-ae.size,de=C.length;for(;m.pos>K;)de=q(ae.start,C,de);V=new Pi(C,he-ae.start,c),ke=ae.start-$}else{let C=m.pos-je;m.next();let K=[],de=[],_e=O>=h?O:-1,Ae=0,ze=he;for(;m.pos>C;)_e>=0&&m.id==_e&&m.size>=0?(m.end<=ze-o&&(k(K,de,W,Ae,m.end,ze,_e,we,M),Ae=K.length,ze=m.end),m.next()):B>2500?y(W,C,K,de):v(W,C,K,de,_e,B+1);if(_e>=0&&Ae>0&&Ae<K.length&&k(K,de,W,Ae,W,ze,_e,we,M),K.reverse(),de.reverse(),_e>-1&&Ae>0){let be=S(N,M);V=sm(N,K,de,0,K.length,0,he-W,be,be)}else V=A(N,K,de,he-W,we-he,M)}I.push(V),X.push(ke)}function y($,E,I,X){let H=[],B=0,O=-1;for(;m.pos>E;){let{id:W,start:he,end:je,size:we}=m;if(we>4)m.next();else{if(O>-1&&he<O)break;O<0&&(O=je-o),H.push(W,he,je),B++,m.next()}}if(B){let W=new Uint16Array(B*4),he=H[H.length-2];for(let je=H.length-3,we=0;je>=0;je-=3)W[we++]=H[je],W[we++]=H[je+1]-he,W[we++]=H[je+2]-he,W[we++]=we;I.push(new Pi(W,H[2]-he,c)),X.push(he-$)}}function S($,E){return(I,X,H)=>{let B=0,O=I.length-1,W,he;if(O>=0&&(W=I[O])instanceof tl){if(!O&&W.type==$&&W.length==H)return W;(he=W.prop(xn.lookAhead))&&(B=X[O]+W.length+he)}return A($,I,X,H,B,E)}}function k($,E,I,X,H,B,O,W,he){let je=[],we=[];for(;$.length>X;)je.push($.pop()),we.push(E.pop()+I-H);$.push(A(c.types[O],je,we,B-H,W-B,he)),E.push(H-I)}function A($,E,I,X,H,B,O){if(B){let W=[xn.contextHash,B];O=O?[W].concat(O):[W]}if(H>25){let W=[xn.lookAhead,H];O=O?[W].concat(O):[W]}return new tl($,E,I,X,O)}function D($,E){let I=m.fork(),X=0,H=0,B=0,O=I.end-o,W={size:0,start:0,skip:0};e:for(let he=I.pos-$;I.pos>he;){let je=I.size;if(I.id==E&&je>=0){W.size=X,W.start=H,W.skip=B,B+=4,X+=4,I.next();continue}let we=I.pos-je;if(je<0||we<he||I.start<O)break;let M=I.id>=h?4:0,N=I.start;for(I.next();I.pos>we;){if(I.size<0)if(I.size==-3||I.size==-4)M+=4;else break e;else I.id>=h&&(M+=4);I.next()}H=N,X+=je,B+=M}return(E<0||X==$)&&(W.size=X,W.start=H,W.skip=B),W.size>4?W:void 0}function q($,E,I){let{id:X,start:H,end:B,size:O}=m;if(m.next(),O>=0&&X<h){let W=I;if(O>4){let he=m.pos-(O-4);for(;m.pos>he;)I=q($,E,I)}E[--I]=W,E[--I]=B-$,E[--I]=H-$,E[--I]=X}else O==-3?x=X:O==-4&&(_=X);return I}let G=[],Q=[];for(;m.pos>0;)v(n.start||0,n.bufferStart||0,G,Q,-1,0);let z=(s=n.length)!==null&&s!==void 0?s:G.length?Q[0]+G[0].length:0;return new tl(g[n.topID],G.reverse(),Q.reverse(),z)}const Ob=new WeakMap;function tf(n,s){if(!n.isAnonymous||s instanceof Pi||s.type!=n)return 1;let i=Ob.get(s);if(i==null){i=1;for(let c of s.children){if(c.type!=n||!(c instanceof tl)){i=1;break}i+=tf(n,c)}Ob.set(s,i)}return i}function sm(n,s,i,c,o,u,h,m,g){let x=0;for(let k=c;k<o;k++)x+=tf(n,s[k]);let _=Math.ceil(x*1.5/8),v=[],y=[];function S(k,A,D,q,G){for(let Q=D;Q<q;){let z=Q,$=A[Q],E=tf(n,k[Q]);for(Q++;Q<q;Q++){let I=tf(n,k[Q]);if(E+I>=_)break;E+=I}if(Q==z+1){if(E>_){let I=k[z];S(I.children,I.positions,0,I.children.length,A[z]+G);continue}v.push(k[z])}else{let I=A[Q-1]+k[Q-1].length-$;v.push(sm(n,k,A,z,Q,$,I,null,g))}y.push($+G-u)}}return S(s,i,c,o,0),(m||g)(v,y,h)}class TE{constructor(){this.map=new WeakMap}setBuffer(s,i,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(i,c)}getBuffer(s,i){let c=this.map.get(s);return c&&c.get(i)}set(s,i){s instanceof Ea?this.setBuffer(s.context.buffer,s.index,i):s instanceof Ss&&this.map.set(s.tree,i)}get(s){return s instanceof Ea?this.getBuffer(s.context.buffer,s.index):s instanceof Ss?this.map.get(s.tree):void 0}cursorSet(s,i){s.buffer?this.setBuffer(s.buffer.buffer,s.index,i):this.map.set(s.tree,i)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class wu{constructor(s,i,c,o,u=!1,h=!1){this.from=s,this.to=i,this.tree=c,this.offset=o,this.open=(u?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,i=[],c=!1){let o=[new wu(0,s.length,s,0,!1,c)];for(let u of i)u.to>s.length&&o.push(u);return o}static applyChanges(s,i,c=128){if(!i.length)return s;let o=[],u=1,h=s.length?s[0]:null;for(let m=0,g=0,x=0;;m++){let _=m<i.length?i[m]:null,v=_?_.fromA:1e9;if(v-g>=c)for(;h&&h.from<v;){let y=h;if(g>=y.from||v<=y.to||x){let S=Math.max(y.from,g)-x,k=Math.min(y.to,v)-x;y=S>=k?null:new wu(S,k,y.tree,y.offset+x,m>0,!!_)}if(y&&o.push(y),h.to>v)break;h=u<s.length?s[u++]:null}if(!_)break;g=_.toA,x=_.toA-_.toB}return o}}class CE{startParse(s,i,c){return typeof s=="string"&&(s=new dw(s)),c=c?c.length?c.map(o=>new kl(o.from,o.to)):[new kl(0,0)]:[new kl(0,s.length)],this.createParse(s,i||[],c)}parse(s,i,c){let o=this.startParse(s,i,c);for(;;){let u=o.advance();if(u)return u}}}class dw{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,i){return this.string.slice(s,i)}}function AE(n){return(s,i,c,o)=>new hw(s,n,i,c,o)}class Lb{constructor(s,i,c,o,u,h){this.parser=s,this.parse=i,this.overlay=c,this.bracketed=o,this.target=u,this.from=h}}function zb(n){if(!n.length||n.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class fw{constructor(s,i,c,o,u,h,m,g){this.parser=s,this.predicate=i,this.mounts=c,this.index=o,this.start=u,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const Op=new xn({perNode:!0});class hw{constructor(s,i,c,o,u){this.nest=i,this.input=c,this.fragments=o,this.ranges=u,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new tl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Op,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],i=s.parse.advance();if(i){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[xn.mounted.id]=new qc(i,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<s&&(s=Math.min(s,this.inner[i].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(s)}startInner(){let s=new gw(this.fragments),i=null,c=null,o=new cf(new Ss(this.baseTree,this.ranges[0].from,0,null),mn.IncludeAnonymous|mn.IgnoreMounts);e:for(let u,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(i){let x=i.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(x)for(let _ of x.mount.overlay){let v=_.from+x.pos,y=_.to+x.pos;v>=o.from&&y<=o.to&&!i.ranges.some(S=>S.from<y&&S.to>v)&&i.ranges.push({from:v,to:y})}}m=!1}else if(c&&(h=pw(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(u=this.nest(o,this.input))&&(o.from<o.to||!u.overlay)){o.tree||(mw(o),i&&i.depth++,c&&c.depth++);let x=s.findMounts(o.from,u.parser);if(typeof u.overlay=="function")i=new fw(u.parser,u.overlay,x,this.inner.length,o.from,!!u.bracketed,o.tree,i);else{let _=Hb(this.ranges,u.overlay||(o.from<o.to?[new kl(o.from,o.to)]:[]));_.length&&zb(_),(_.length||!u.overlay)&&this.inner.push(new Lb(u.parser,_.length?u.parser.startParse(this.input,Bb(x,_),_):u.parser.startParse(""),u.overlay?u.overlay.map(v=>new kl(v.from-o.from,v.to-o.from)):null,!!u.bracketed,o.tree,_.length?_[0].from:o.from)),u.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):m=!1}}else if(i&&(g=i.predicate(o))&&(g===!0&&(g=new kl(o.from,o.to)),g.from<g.to)){let x=i.ranges.length-1;x>=0&&i.ranges[x].to==g.from?i.ranges[x]={from:i.ranges[x].from,to:g.to}:i.ranges.push(g)}if(m&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let x=Hb(this.ranges,i.ranges);x.length&&(zb(x),this.inner.splice(i.index,0,new Lb(i.parser,i.parser.startParse(this.input,Bb(i.mounts,x),x),i.ranges.map(_=>new kl(_.from-i.start,_.to-i.start)),i.bracketed,i.target,x[0].from))),i=i.prev}c&&!--c.depth&&(c=c.prev)}}}}function pw(n,s,i){for(let c of n){if(c.from>=i)break;if(c.to>s)return c.from<=s&&c.to>=i?2:1}return 0}function Ib(n,s,i,c,o,u){if(s<i){let h=n.buffer[s+1];c.push(n.slice(s,i,h)),o.push(h-u)}}function mw(n){let{node:s}=n,i=[],c=s.context.buffer;do i.push(n.index),n.parent();while(!n.tree);let o=n.tree,u=o.children.indexOf(c),h=o.children[u],m=h.buffer,g=[u];function x(_,v,y,S,k,A){let D=i[A],q=[],G=[];Ib(h,_,D,q,G,S);let Q=m[D+1],z=m[D+2];g.push(q.length);let $=A?x(D+4,m[D+3],h.set.types[m[D]],Q,z-Q,A-1):s.toTree();return q.push($),G.push(Q-S),Ib(h,m[D+3],v,q,G,S),new tl(y,q,G,k)}o.children[u]=x(0,m.length,Pl.none,0,h.length,i.length-1);for(let _ of g){let v=n.tree.children[_],y=n.tree.positions[_];n.yield(new Ss(v,y+n.from,_,n._tree))}}class Ub{constructor(s,i){this.offset=i,this.done=!1,this.cursor=s.cursor(mn.IncludeAnonymous|mn.IgnoreMounts)}moveTo(s){let{cursor:i}=this,c=s-this.offset;for(;!this.done&&i.from<c;)if(!(i.to>=s&&i.enter(c,1,mn.IgnoreOverlays|mn.ExcludeBuffers)))if(i.to<=s)i.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==s.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof tl)i=i.children[0];else break}return!1}}class gw{constructor(s){var i;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(i=c.tree.prop(Op))!==null&&i!==void 0?i:c.to,this.inner=new Ub(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(s=i.tree.prop(Op))!==null&&s!==void 0?s:i.to,this.inner=new Ub(i.tree,-i.offset)}}findMounts(s,i){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let u=this.inner.cursor.node;u;u=u.parent){let h=(c=u.tree)===null||c===void 0?void 0:c.prop(xn.mounted);if(h&&h.parser==i)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=u.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:u.from-g.offset,mount:h})}}}return o}}function Hb(n,s){let i=null,c=s;for(let o=1,u=0;o<n.length;o++){let h=n[o-1].to,m=n[o].from;for(;u<c.length;u++){let g=c[u];if(g.from>=m)break;g.to<=h||(i||(c=i=s.slice()),g.from<h?(i[u]=new kl(g.from,h),g.to>m&&i.splice(u+1,0,new kl(m,g.to))):g.to>m?i[u--]=new kl(m,g.to):i.splice(u--,1))}}return c}function xw(n,s,i,c){let o=0,u=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let _=o==n.length?1e9:h?n[o].to:n[o].from,v=u==s.length?1e9:m?s[u].to:s[u].from;if(h!=m){let y=Math.max(g,i),S=Math.min(_,v,c);y<S&&x.push(new kl(y,S))}if(g=Math.min(_,v),g==1e9)break;_==g&&(h?(h=!1,o++):h=!0),v==g&&(m?(m=!1,u++):m=!0)}return x}function Bb(n,s){let i=[];for(let{pos:c,mount:o,frag:u}of n){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(u.from,h),x=Math.min(u.to,m);if(o.overlay){let _=o.overlay.map(y=>new kl(y.from+c,y.to+c)),v=xw(s,_,g,x);for(let y=0,S=g;;y++){let k=y==v.length,A=k?x:v[y].from;if(A>S&&i.push(new wu(S,A,o.tree,-h,u.from>=S||u.openStart,u.to<=A||u.openEnd)),k)break;S=v[y].to}}else i.push(new wu(g,x,o.tree,-h,u.from>=h||u.openStart,u.to<=m||u.openEnd))}return i}let bw=0;class wl{constructor(s,i,c,o){this.name=s,this.set=i,this.base=c,this.modified=o,this.id=bw++}toString(){let{name:s}=this;for(let i of this.modified)i.name&&(s=`${i.name}(${s})`);return s}static define(s,i){let c=typeof s=="string"?s:"?";if(s instanceof wl&&(i=s),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new wl(c,[],null,[]);if(o.set.push(o),i)for(let u of i.set)o.set.push(u);return o}static defineModifier(s){let i=new of(s);return c=>c.modified.indexOf(i)>-1?c:of.get(c.base||c,c.modified.concat(i).sort((o,u)=>o.id-u.id))}}let _w=0;class of{constructor(s){this.name=s,this.instances=[],this.id=_w++}static get(s,i){if(!i.length)return s;let c=i[0].instances.find(m=>m.base==s&&yw(i,m.modified));if(c)return c;let o=[],u=new wl(s.name,o,s,i);for(let m of i)m.instances.push(u);let h=vw(i);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(of.get(m,g));return u}}function yw(n,s){return n.length==s.length&&n.every((i,c)=>i==s[c])}function vw(n){let s=[[]];for(let i=0;i<n.length;i++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(n[i]));return s.sort((i,c)=>c.length-i.length)}function ME(n){let s=Object.create(null);for(let i in n){let c=n[i];Array.isArray(c)||(c=[c]);for(let o of i.split(" "))if(o){let u=[],h=2,m=o;for(let v=0;;){if(m=="..."&&v>0&&v+3==o.length){h=1;break}let y=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!y)throw new RangeError("Invalid path: "+o);if(u.push(y[0]=="*"?"":y[0][0]=='"'?JSON.parse(y[0]):y[0]),v+=y[0].length,v==o.length)break;let S=o[v++];if(v==o.length&&S=="!"){h=0;break}if(S!="/")throw new RangeError("Invalid path: "+o);m=o.slice(v)}let g=u.length-1,x=u[g];if(!x)throw new RangeError("Invalid path: "+o);let _=new ku(c,h,g>0?u.slice(0,g):null);s[x]=_.sort(s[x])}}return uy.add(s)}const uy=new xn({combine(n,s){let i,c,o;for(;n||s;){if(!n||s&&n.depth>=s.depth?(o=s,s=s.next):(o=n,n=n.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let u=new ku(o.tags,o.mode,o.context);i?i.next=u:c=u,i=u}return c}});class ku{constructor(s,i,c,o){this.tags=s,this.mode=i,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}ku.empty=new ku([],2,null);function dy(n,s){let i=Object.create(null);for(let u of n)if(!Array.isArray(u.tag))i[u.tag.id]=u.class;else for(let h of u.tag)i[h.id]=u.class;let{scope:c,all:o=null}=s||{};return{style:u=>{let h=o;for(let m of u)for(let g of m.set){let x=i[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function jw(n,s){let i=null;for(let c of n){let o=c.style(s);o&&(i=i?i+" "+o:o)}return i}function ww(n,s,i,c=0,o=n.length){let u=new Nw(c,Array.isArray(s)?s:[s],i);u.highlightRange(n.cursor(),c,o,"",u.highlighters),u.flush(o)}function kw(n,s,i,c,o,u=0,h=n.length){let m=u;function g(x,_){if(!(x<=m)){for(let v=n.slice(m,x),y=0;;){let S=v.indexOf(`
117
+ `,y),k=S<0?v.length:S;if(k>y&&c(v.slice(y,k),_),S<0)break;o(),y=S+1}m=x}}ww(s,i,(x,_,v)=>{g(x,""),g(_,v)},u,h),g(h,"")}class Nw{constructor(s,i,c){this.at=s,this.highlighters=i,this.span=c,this.class=""}startSpan(s,i){i!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=i)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,i,c,o,u){let{type:h,from:m,to:g}=s;if(m>=c||g<=i)return;h.isTop&&(u=this.highlighters.filter(S=>!S.scope||S.scope(h)));let x=o,_=Sw(s)||ku.empty,v=jw(u,_.tags);if(v&&(x&&(x+=" "),x+=v,_.mode==1&&(o+=(o?" ":"")+v)),this.startSpan(Math.max(i,m),x),_.opaque)return;let y=s.tree&&s.tree.prop(xn.mounted);if(y&&y.overlay){let S=s.node.enter(y.overlay[0].from+m,1),k=this.highlighters.filter(D=>!D.scope||D.scope(y.tree.type)),A=s.firstChild();for(let D=0,q=m;;D++){let G=D<y.overlay.length?y.overlay[D]:null,Q=G?G.from+m:g,z=Math.max(i,q),$=Math.min(c,Q);if(z<$&&A)for(;s.from<$&&(this.highlightRange(s,z,$,o,u),this.startSpan(Math.min($,s.to),x),!(s.to>=Q||!s.nextSibling())););if(!G||Q>c)break;q=G.to+m,q>i&&(this.highlightRange(S.cursor(),Math.max(i,G.from+m),Math.min(c,q),"",k),this.startSpan(Math.min(c,q),x))}A&&s.parent()}else if(s.firstChild()){y&&(o="");do if(!(s.to<=i)){if(s.from>=c)break;this.highlightRange(s,i,c,o,u),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function Sw(n){let s=n.type.prop(uy);for(;s&&s.context&&!n.matchContext(s.context);)s=s.next;return s||null}const De=wl.define,Ld=De(),Yi=De(),qb=De(Yi),Gb=De(Yi),Vi=De(),zd=De(Vi),fp=De(Vi),wa=De(),Er=De(wa),ba=De(),_a=De(),Lp=De(),cu=De(Lp),Id=De(),Le={comment:Ld,lineComment:De(Ld),blockComment:De(Ld),docComment:De(Ld),name:Yi,variableName:De(Yi),typeName:qb,tagName:De(qb),propertyName:Gb,attributeName:De(Gb),className:De(Yi),labelName:De(Yi),namespace:De(Yi),macroName:De(Yi),literal:Vi,string:zd,docString:De(zd),character:De(zd),attributeValue:De(zd),number:fp,integer:De(fp),float:De(fp),bool:De(Vi),regexp:De(Vi),escape:De(Vi),color:De(Vi),url:De(Vi),keyword:ba,self:De(ba),null:De(ba),atom:De(ba),unit:De(ba),modifier:De(ba),operatorKeyword:De(ba),controlKeyword:De(ba),definitionKeyword:De(ba),moduleKeyword:De(ba),operator:_a,derefOperator:De(_a),arithmeticOperator:De(_a),logicOperator:De(_a),bitwiseOperator:De(_a),compareOperator:De(_a),updateOperator:De(_a),definitionOperator:De(_a),typeOperator:De(_a),controlOperator:De(_a),punctuation:Lp,separator:De(Lp),bracket:cu,angleBracket:De(cu),squareBracket:De(cu),paren:De(cu),brace:De(cu),content:wa,heading:Er,heading1:De(Er),heading2:De(Er),heading3:De(Er),heading4:De(Er),heading5:De(Er),heading6:De(Er),contentSeparator:De(wa),list:De(wa),quote:De(wa),emphasis:De(wa),strong:De(wa),link:De(wa),monospace:De(wa),strikethrough:De(wa),inserted:De(),deleted:De(),changed:De(),invalid:De(),meta:Id,documentMeta:De(Id),annotation:De(Id),processingInstruction:De(Id),definition:wl.defineModifier("definition"),constant:wl.defineModifier("constant"),function:wl.defineModifier("function"),standard:wl.defineModifier("standard"),local:wl.defineModifier("local"),special:wl.defineModifier("special")};for(let n in Le){let s=Le[n];s instanceof wl&&(s.name=n)}dy([{tag:Le.link,class:"tok-link"},{tag:Le.heading,class:"tok-heading"},{tag:Le.emphasis,class:"tok-emphasis"},{tag:Le.strong,class:"tok-strong"},{tag:Le.keyword,class:"tok-keyword"},{tag:Le.atom,class:"tok-atom"},{tag:Le.bool,class:"tok-bool"},{tag:Le.url,class:"tok-url"},{tag:Le.labelName,class:"tok-labelName"},{tag:Le.inserted,class:"tok-inserted"},{tag:Le.deleted,class:"tok-deleted"},{tag:Le.literal,class:"tok-literal"},{tag:Le.string,class:"tok-string"},{tag:Le.number,class:"tok-number"},{tag:[Le.regexp,Le.escape,Le.special(Le.string)],class:"tok-string2"},{tag:Le.variableName,class:"tok-variableName"},{tag:Le.local(Le.variableName),class:"tok-variableName tok-local"},{tag:Le.definition(Le.variableName),class:"tok-variableName tok-definition"},{tag:Le.special(Le.variableName),class:"tok-variableName2"},{tag:Le.definition(Le.propertyName),class:"tok-propertyName tok-definition"},{tag:Le.typeName,class:"tok-typeName"},{tag:Le.namespace,class:"tok-namespace"},{tag:Le.className,class:"tok-className"},{tag:Le.macroName,class:"tok-macroName"},{tag:Le.propertyName,class:"tok-propertyName"},{tag:Le.operator,class:"tok-operator"},{tag:Le.comment,class:"tok-comment"},{tag:Le.meta,class:"tok-meta"},{tag:Le.invalid,class:"tok-invalid"},{tag:Le.punctuation,class:"tok-punctuation"}]);const Ew="modulepreload",Tw=function(n,s){return new URL(n,s).href},$b={},ot=function(s,i,c){let o=Promise.resolve();if(i&&i.length>0){let h=function(_){return Promise.all(_.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(i.map(_=>{if(_=Tw(_,c),_ in $b)return;$b[_]=!0;const v=_.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(!!c)for(let A=m.length-1;A>=0;A--){const D=m[A];if(D.href===_&&(!v||D.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${y}`))return;const k=document.createElement("link");if(k.rel=v?"stylesheet":Ew,v||(k.as="script"),k.crossOrigin="",k.href=_,x&&k.setAttribute("nonce",x),document.head.appendChild(k),v)return new Promise((A,D)=>{k.addEventListener("load",A),k.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${_}`)))})}))}function u(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&u(m.reason);return s().catch(u)})},fy={js:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-CcpjbDSq.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await ot(async()=>{const{json:n}=await import("./index-DXX0TArC.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await ot(async()=>{const{json:n}=await import("./index-DXX0TArC.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await ot(async()=>{const{css:n}=await import("./index-qU9Ojf7M.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await ot(async()=>{const{css:n}=await import("./index-qU9Ojf7M.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await ot(async()=>{const{css:n}=await import("./index-qU9Ojf7M.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await ot(async()=>{const{html:n}=await import("./index-Sh9NP70k.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await ot(async()=>{const{html:n}=await import("./index-Sh9NP70k.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await ot(async()=>{const{html:n}=await import("./index-Sh9NP70k.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await ot(async()=>{const{html:n}=await import("./index-Sh9NP70k.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await ot(async()=>{const{markdown:n}=await import("./index-CcSS0C_9.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await ot(async()=>{const{markdown:n}=await import("./index-CcSS0C_9.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await ot(async()=>{const{python:n}=await import("./index-Ztgcimr5.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await ot(async()=>{const{python:n}=await import("./index-Ztgcimr5.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await ot(async()=>{const{yaml:n}=await import("./index-CPPpWH9N.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await ot(async()=>{const{yaml:n}=await import("./index-CPPpWH9N.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await ot(async()=>{const{rust:n}=await import("./index-DaU2VyoE.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-B7uHyVeh.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-B7uHyVeh.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-B7uHyVeh.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-B7uHyVeh.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-B7uHyVeh.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await ot(async()=>{const{java:n}=await import("./index-dIZtAfJR.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await ot(async()=>{const{go:n}=await import("./index-kNeFvnz8.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await ot(async()=>{const{php:n}=await import("./index-BSaDKcqT.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await ot(async()=>{const{sql:n}=await import("./index-BNQZ2BuM.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await ot(async()=>{const{xml:n}=await import("./index-g04_R-k1.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await ot(async()=>{const{xml:n}=await import("./index-g04_R-k1.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},Cw={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},Aw={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function Mw(n){const s=Aw[n.toLowerCase()]??n.toLowerCase(),i=fy[s];return i?i().catch(()=>null):null}async function Rw(n){const s=(n.split("/").pop()??"").toLowerCase(),i=Cw[s]??s.split(".").pop()??"",c=fy[i];return c?c().catch(()=>null):null}const Dw=dy([{tag:[Le.keyword,Le.modifier,Le.controlKeyword,Le.moduleKeyword],class:"cmh-key"},{tag:[Le.propertyName],class:"cmh-prop"},{tag:[Le.function(Le.variableName),Le.labelName],class:"cmh-fn"},{tag:[Le.color,Le.constant(Le.name),Le.standard(Le.name),Le.bool],class:"cmh-const"},{tag:[Le.typeName,Le.className,Le.changed,Le.annotation,Le.self,Le.namespace],class:"cmh-type"},{tag:[Le.number,Le.integer,Le.float],class:"cmh-num"},{tag:[Le.string,Le.special(Le.string),Le.regexp],class:"cmh-str"},{tag:[Le.operator,Le.operatorKeyword,Le.escape],class:"cmh-op"},{tag:[Le.meta,Le.comment],class:"cmh-comment"},{tag:Le.invalid,class:"cmh-invalid"}]);function Ud(n){return n.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function Ow(n,s){const i=s?await Mw(s):null;if(!i)return Ud(n);try{const c=i.language.parser.parse(n);let o="";return kw(n,c,Dw,(u,h)=>{o+=h?`<span class="${h}">${Ud(u)}</span>`:Ud(u)},()=>{o+=`
118
+ `}),o}catch{return Ud(n)}}$t.setOptions({gfm:!0,breaks:!1});function hy(n){var i;const s=(i=n.split(".").pop())==null?void 0:i.toLowerCase();return s==="md"||s==="markdown"}async function vf(n){const s=await $t.parse(n,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const c=i;c.text=await Ow(c.text,c.lang??""),c.escaped=!0}});return sw.sanitize(s)}function Yb(n,s){return{path:n.path,text:n.content,saved:n.content,eol:n.eol,encoding:n.encoding,mtime:n.mtime,size:n.size,binary:n.binary,tooLarge:n.tooLarge,mediaMime:n.mediaMime,mediaTooLarge:n.mediaTooLarge,stale:!1,revision:s,previewMode:hy(n.path)}}function Pa(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function Lw(n){return n.split("/").pop()??n}function Ir(n){const s=n.lastIndexOf("/");return s===-1?"":n.slice(0,s)}function nf(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}var Nu=T_();function Qi({x:n,y:s,items:i,note:c,onClose:o}){const u=b.useRef(null),[h,m]=b.useState({left:n,top:s}),[g,x]=b.useState(()=>{const y=i.findIndex(S=>!S.disabled);return y===-1?0:y});b.useLayoutEffect(()=>{const y=u.current;if(!y)return;const S=y.getBoundingClientRect(),k=8,A=Math.max(k,Math.min(n,window.innerWidth-S.width-k)),D=Math.max(k,Math.min(s,window.innerHeight-S.height-k));m({left:A,top:D})},[n,s]),b.useLayoutEffect(()=>{var y;(y=u.current)==null||y.focus()},[]),b.useLayoutEffect(()=>{function y(k){var A;(A=u.current)!=null&&A.contains(k.target)||o()}function S(){o()}return document.addEventListener("mousedown",y),document.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("scroll",S,!0)}},[o]);function _(y){y.disabled||(y.onSelect(),o())}function v(y){if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),o();return}const S=i.map((k,A)=>({item:k,index:A})).filter(k=>!k.item.disabled);if(S.length!==0){if(y.key==="ArrowDown"||y.key==="ArrowUp"){y.preventDefault();const k=y.key==="ArrowDown"?1:-1,A=S.findIndex(q=>q.index===g),D=S[(((A===-1?0:A)+k)%S.length+S.length)%S.length];D&&x(D.index);return}if(y.key==="Enter"||y.key===" "){y.preventDefault();const k=i[g];k&&_(k)}}}return Nu.createPortal(a.jsxs("div",{ref:u,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:v,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),i.map((y,S)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":y.disabled,className:"ctxmenu__item"+(S===g?" is-cursor":""),onMouseEnter:()=>x(S),onClick:()=>_(y),children:[a.jsx("span",{className:"ctxmenu__label",children:y.label}),y.hint&&a.jsx("span",{className:"ctxmenu__hint",children:y.hint})]},y.id))]}),document.body)}const zw=3500,Iw=9e3,Vb=220;function qr({result:n,onDismiss:s}){const[i,c]=b.useState(n),[o,u]=b.useState(!1);if(b.useEffect(()=>{if(!n){c(null),u(!1);return}if(c(n),u(!1),n.url)return;const m=n.ok?zw:Iw,g=setTimeout(()=>u(!0),m),x=setTimeout(()=>c(null),m+Vb);return()=>{clearTimeout(g),clearTimeout(x)}},[n]),!i)return null;const h=()=>{u(!0),setTimeout(()=>{c(null),s==null||s()},Vb)};return a.jsxs("div",{className:"oplog "+(i.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(i.url?" oplog--dismissible":""),role:"status","aria-live":i.ok?"polite":"assertive",children:[i.message,i.url&&a.jsxs("a",{className:"oplog__link",href:i.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[i.url.replace(/^https?:\/\//,"")," ↗"]}),i.url&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Sa({value:n,className:s,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[u,h]=b.useState(n),m=b.useRef(null);b.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function g(){const x=u.trim();if(!x||x===n)return o();c(x)}return a.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:u,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:x=>h(x.target.value),onBlur:g,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&(x.preventDefault(),o())}})}function eo({active:n}){return n?a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 5h3V2"}),a.jsx("path",{d:"M14 5h-3V2"}),a.jsx("path",{d:"M2 11h3v3"}),a.jsx("path",{d:"M14 11h-3v3"})]}):a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2H2v3"}),a.jsx("path",{d:"M11 2h3v3"}),a.jsx("path",{d:"M2 11v3h3"}),a.jsx("path",{d:"M14 11v3h-3"})]})}const Uw=500,Tr="application/x-ccv-fs-path",Hw=200;function Bw({open:n,tree:s,expanded:i,activePath:c,dirty:o,gitChanges:u,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:_,onOpen:v,onCreate:y,onRename:S,onMove:k,onCopy:A,onDelete:D,onRefresh:q,onClose:G,zoomed:Q,onToggleZoom:z}){const[$,E]=b.useState(""),[I,X]=b.useState(null),[H,B]=b.useState(null),[O,W]=b.useState(null),[he,je]=b.useState(null),[we,M]=b.useState(null),[N,V]=b.useState(null),ae=bf("(hover: hover)"),ke=b.useRef(null),C=b.useMemo(()=>$w(u),[u]);function K(re){return!(!O||re===O.path||O.kind==="dir"&&re.startsWith(`${O.path}/`)||re===Ir(O.path))}function de(re){return!(!we||re===we.path||we.kind==="dir"&&re.startsWith(`${we.path}/`)||we.mode==="cut"&&re===Ir(we.path))}function _e(re){M({path:re.path,kind:re.kind,mode:"copy"})}function Ae(re){M({path:re.path,kind:re.kind,mode:"cut"})}function ze(re){!we||!de(re)||(re&&!i.has(re)&&_(re),we.mode==="cut"?(k(we.path,re),M(null)):A(we.path,re))}function be(re,Ne){const Xe=re.touches[0];if(!Xe)return;const We={timer:0,x:Xe.clientX,y:Xe.clientY,el:re.currentTarget,fired:!1};We.timer=window.setTimeout(()=>{We.fired=!0,Ne(We.x,We.y,We.el)},Uw),ke.current=We}function Ge(re){const Ne=ke.current,Xe=re.touches[0];!Ne||!Xe||Math.hypot(Xe.clientX-Ne.x,Xe.clientY-Ne.y)>10&&(window.clearTimeout(Ne.timer),ke.current=null)}function lt(re){const Ne=ke.current;Ne&&(window.clearTimeout(Ne.timer),Ne.fired&&re.preventDefault())}function Mt(){var re;return(re=ke.current)!=null&&re.fired?(ke.current=null,!0):!1}function fe(re,Ne,Xe,We){E((We==null?void 0:We.path)??""),V({x:re,y:Ne,opener:Xe,entry:We})}function at(){const re=N==null?void 0:N.opener;V(null),re!=null&&re.isConnected&&re.focus()}function oe(re){return{onContextMenu:Ne=>{Ne.preventDefault(),fe(Ne.clientX,Ne.clientY,Ne.currentTarget,re)},onTouchStart:Ne=>be(Ne,(Xe,We,tt)=>fe(Xe,We,tt,re)),onTouchMove:Ge,onTouchEnd:lt,onTouchCancel:lt}}function Rt(re){re.target===re.currentTarget&&(re.preventDefault(),fe(re.clientX,re.clientY,re.currentTarget,null))}function Be(re){re.target===re.currentTarget&&be(re,(Ne,Xe,We)=>fe(Ne,Xe,We,null))}function qt(re){if(!(re.ctrlKey||re.metaKey)||re.target instanceof HTMLInputElement)return;const Ne=re.key.toLowerCase();if(Ne==="v"){re.preventDefault(),ze(Pe());return}if(!$)return;const Xe=Xb(s,$);Xe&&(Ne==="c"?(re.preventDefault(),_e(Xe)):Ne==="x"&&(re.preventDefault(),Ae(Xe)))}function Hn(re){return Ne=>{Ne.dataTransfer.effectAllowed="move",Ne.dataTransfer.setData(Tr,re.path),W({path:re.path,kind:re.kind})}}function xt(){W(null),je(null)}function Kt(re){return Ne=>{Ne.dataTransfer.types.includes(Tr)&&(Ne.stopPropagation(),!(re.kind!=="dir"||!K(re.path))&&(Ne.preventDefault(),je(re.path)))}}function an(re){return Ne=>{if(!Ne.dataTransfer.types.includes(Tr)||(Ne.stopPropagation(),re.kind!=="dir"||!K(re.path)))return;Ne.preventDefault();const Xe=Ne.dataTransfer.getData(Tr);je(null),Xe&&k(Xe,re.path)}}function Vn(re){!re.dataTransfer.types.includes(Tr)||!K("")||(re.preventDefault(),je(""))}function jt(re){if(!re.dataTransfer.types.includes(Tr)||!K(""))return;re.preventDefault();const Ne=re.dataTransfer.getData(Tr);je(null),Ne&&k(Ne,"")}const[Z,Oe]=b.useState(""),Ye=Z.trim(),ut=Ye.length>0,Ee=b.useRef(null),Te=b.useRef(g);Te.current=g;function Me(re){Oe(re),Ee.current&&clearTimeout(Ee.current);const Ne=re.trim();if(!Ne){Te.current("");return}Ee.current=setTimeout(()=>Te.current(Ne),Hw)}function Ve(re){Ee.current&&clearTimeout(Ee.current),Oe(""),Te.current(""),E(re.path),x(re)}const Ke=ut&&(m==null?void 0:m.query)===Ye?m:null;function Pe(){if($==="")return"";const re=Xb(s,$);if((re==null?void 0:re.kind)==="dir")return $;const Ne=$.lastIndexOf("/");return Ne===-1?"":$.slice(0,Ne)}function dt(re,Ne){const Xe=Ne??Pe();Xe&&!i.has(Xe)&&_(Xe),B({parent:Xe,kind:re})}function Ct(){if(!N)return[];const re=We=>ae?We:void 0;if(!N.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:re("Ctrl+V"),disabled:!de(""),onSelect:()=>ze("")},{id:"new-file",label:"Создать файл",onSelect:()=>dt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>dt("dir","")}];const Ne=N.entry,Xe=[Ne.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>v(Ne.path)}:{id:"toggle",label:i.has(Ne.path)?"Свернуть":"Развернуть",onSelect:()=>_(Ne.path)},{id:"copy",label:"Копировать",hint:re("Ctrl+C"),onSelect:()=>_e(Ne)},{id:"cut",label:"Вырезать",hint:re("Ctrl+X"),onSelect:()=>Ae(Ne)}];return Ne.kind==="dir"&&(Xe.push({id:"paste",label:"Вставить",hint:re("Ctrl+V"),disabled:!de(Ne.path),onSelect:()=>ze(Ne.path)}),Xe.push({id:"new-file",label:"Создать файл",onSelect:()=>dt("file",Ne.path)}),Xe.push({id:"new-dir",label:"Создать каталог",onSelect:()=>dt("dir",Ne.path)})),Xe.push({id:"rename",label:"Переименовать",onSelect:()=>X(Ne.path)}),Xe.push({id:"delete",label:"Удалить",onSelect:()=>D(Ne)}),Xe}const Cn=ut?[]:St("",0);function St(re,Ne){const Xe=s[re],We=[];if(H&&H.parent===re&&We.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:Ja(Ne),children:[a.jsx("span",{className:"fsrow__icon",children:H.kind==="dir"?a.jsx(df,{}):a.jsx(ff,{})}),a.jsx(Sa,{className:"rename--file",value:"",placeholder:H.kind==="dir"?"имя каталога":"имя файла",onCommit:tt=>{B(null),y(re,H.kind,tt)},onCancel:()=>B(null)})]},`draft:${re}`)),!Xe)return We.push(a.jsx("p",{className:"fsrow__pending",style:Ja(Ne),children:"читаем…"},`wait:${re}`)),We;Xe.length===0&&!H&&We.push(a.jsx("p",{className:"fsrow__pending",style:Ja(Ne),children:"пусто"},`empty:${re}`));for(const tt of Xe){const on=tt.kind==="dir"&&i.has(tt.path);We.push(I===tt.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:Ja(Ne),children:[a.jsx("span",{className:"fsrow__icon",children:tt.kind==="dir"?a.jsx(df,{open:on}):a.jsx(ff,{})}),a.jsx(Sa,{className:"rename--file",value:tt.name,placeholder:"новое имя",onCommit:On=>{X(null),S(tt.path,On)},onCancel:()=>X(null)})]},tt.path):a.jsx(qw,{entry:tt,depth:Ne,open:on,active:tt.path===c,selected:tt.path===$,dirty:o.has(tt.path),gitStatus:C.get(tt.path),dragging:(O==null?void 0:O.path)===tt.path,dropTarget:he===tt.path,cut:(we==null?void 0:we.mode)==="cut"&&we.path===tt.path,onClick:()=>{Mt()||(E(tt.path),tt.kind==="dir"?_(tt.path):v(tt.path))},onRename:()=>X(tt.path),onDelete:()=>D(tt),onDragStart:Hn(tt),onDragEnd:xt,onDragOver:Kt(tt),onDrop:an(tt),...oe(tt)},tt.path)),on&&We.push(...St(tt.path,Ne+1))}return We}function Lt(){if(!Ke)return[a.jsx("p",{className:"fsrow__pending",style:Ja(0),children:"ищем…"},"search:wait")];if(Ke.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:Ja(0),children:"ничего не найдено"},"search:empty")];const re=Ke.entries.map(Ne=>a.jsx(Gw,{entry:Ne,gitStatus:C.get(Ne.path),onClick:()=>Ve(Ne)},Ne.path));return Ke.truncated&&re.push(a.jsxs("p",{className:"fsrow__pending",style:Ja(0),children:["показаны первые ",Ke.entries.length," — уточните запрос"]},"search:truncated")),re}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Q?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:qt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:re=>{z&&(re.target.closest("button")||z())},children:[a.jsx(Qw,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>dt("file"),children:a.jsx(Vw,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>dt("dir"),children:a.jsx(Xw,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:q,children:"↻"}),z&&a.jsx("button",{className:"sidepane__btn",title:Q?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Q?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Q,onClick:z,children:a.jsx(eo,{active:Q})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:G,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Kw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Z,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:re=>Me(re.target.value),onKeyDown:re=>{re.stopPropagation(),re.key==="Escape"&&(re.preventDefault(),Z?Me(""):re.currentTarget.blur())}}),Z&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Me(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(he===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Vn,onDrop:jt,onContextMenu:Rt,onTouchStart:Be,onTouchMove:Ge,onTouchEnd:lt,onTouchCancel:lt,children:ut?Lt():Cn}),a.jsx(qr,{result:h}),N&&a.jsx(Qi,{x:N.x,y:N.y,items:Ct(),onClose:at})]})}function qw({entry:n,depth:s,open:i,active:c,selected:o,dirty:u,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:_,onRename:v,onDelete:y,onDragStart:S,onDragEnd:k,onDragOver:A,onDrop:D,onContextMenu:q,onTouchStart:G,onTouchMove:Q,onTouchEnd:z,onTouchCancel:$}){const E="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return a.jsxs("div",{className:E,style:Ja(s),draggable:!0,onDragStart:S,onDragEnd:k,onDragOver:A,onDrop:D,onContextMenu:q,onTouchStart:G,onTouchMove:Q,onTouchEnd:z,onTouchCancel:$,children:[a.jsxs("button",{className:"fsrow__main",onClick:_,title:py(n),children:[a.jsx("span",{className:"fsrow__icon"+uf("fsrow__icon",h),children:n.kind==="dir"?a.jsx(df,{open:i}):a.jsx(ff,{})}),a.jsx("span",{className:"fsrow__name"+uf("fsrow__name",h),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),u&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:v,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:y,children:"✕"})]})}function Gw({entry:n,gitStatus:s,onClick:i}){const c=n.path.slice(0,n.path.length-n.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(n.ignored?" fsrow--ignored":""),style:Ja(0),onClick:i,title:py(n),children:[a.jsx("span",{className:"fsrow__icon"+uf("fsrow__icon",s),children:n.kind==="dir"?a.jsx(df,{}):a.jsx(ff,{})}),a.jsx("span",{className:"fsrow__name"+uf("fsrow__name",s),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function py(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function Ja(n){return{"--depth":n}}function Xb(n,s){var o;const i=s.lastIndexOf("/"),c=i===-1?"":s.slice(0,i);return((o=n[c])==null?void 0:o.find(u=>u.path===s))??null}function $w(n){const s=new Map,i={added:1,modified:2},c=(o,u)=>{const h=s.get(o);(!h||i[u]>i[h])&&s.set(o,u)};for(const o of n){const u=Yw(o.status);if(!u)continue;c(o.path,u);let h=Ir(o.path);for(;c(h,u),!!h;)h=Ir(h)}return s}function Yw(n){if(n==="??")return"added";const[s="",i=""]=n;return s==="A"||s==="R"||s==="C"?"added":s==="M"||i==="M"?"modified":null}function uf(n,s){return s?` ${n}--git-${s}`:""}function df({open:n=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:n?a.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function ff(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]})}function Vw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function Xw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function Qw(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),a.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function Kw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const Zw=200;function Fw({open:n,result:s,onSearch:i,onOpenMatch:c,onClose:o,zoomed:u,onToggleZoom:h}){const[m,g]=b.useState(""),x=m.trim(),_=x.length>0,v=b.useRef(null),y=b.useRef(i);y.current=i;function S(D){g(D),v.current&&clearTimeout(v.current);const q=D.trim();if(!q){y.current("");return}v.current=setTimeout(()=>y.current(q),Zw)}const k=_&&(s==null?void 0:s.query)===x?s:null;function A(){if(!k)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const D=[];let q="";for(const G of k.matches)G.path!==q&&(q=G.path,D.push(a.jsx("p",{className:"searchgroup__path",title:G.path,children:G.path},`path:${G.path}`))),D.push(a.jsx(Pw,{match:G,onClick:()=>c(G)},`${G.path}:${G.line}:${G.column}`));return k.truncated&&D.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),D}return a.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(u?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:D=>{h&&(D.target.closest("button")||h())},children:[a.jsx(Jw,{}),a.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&a.jsx("button",{className:"sidepane__btn",title:u?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":u?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":u,onClick:h,children:a.jsx(eo,{active:u})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Ww,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:D=>S(D.target.value),onKeyDown:D=>{D.stopPropagation(),D.key==="Escape"&&(D.preventDefault(),m?S(""):D.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>S(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:_?A():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Pw({match:n,onClick:s}){const i=n.lineText.slice(0,n.column-1),c=n.lineText.slice(n.column-1,n.column-1+n.matchLength),o=n.lineText.slice(n.column-1+n.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:s,title:`${n.path}:${n.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:n.line}),a.jsxs("span",{className:"searchmatch__text",children:[i,a.jsx("mark",{children:c}),o]})]})}function Jw(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function Ww(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Hd=null;function e1(){return Hd||(Hd=Promise.all([ot(()=>import("./index-CqVjAuXU.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),ot(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),ot(()=>import("./index-BHot-lnj.js"),[],import.meta.url),ot(()=>import("./index-CqPccRdt.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),ot(()=>import("./codemirror-DglS7E7o.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,s,i,c,o])=>({EditorView:s.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw Hd=null,n})),Hd}function t1({path:n,doc:s,revision:i,goto:c,onChange:o,onSave:u}){const h=b.useRef(null),m=b.useRef(null),g=b.useRef(null),x=b.useRef(new Map),_=b.useRef(new Map),v=b.useRef(new Set),y=b.useRef(null),S=b.useRef(o),k=b.useRef(u),A=b.useRef(n),D=b.useRef(i),q=b.useRef(s);S.current=o,k.current=u,A.current=n,D.current=i,q.current=s;const[G,Q]=b.useState("loading"),[z,$]=b.useState(!1);function E(X,H,B,O,W){const he=x.current.get(O),je=_.current.get(O)===W;if(he&&je)B.setState(he);else{const M=X.EditorState.create({doc:q.current,extensions:[X.basicSetup,X.Prec.highest(X.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(A.current),!0)}])),X.keymap.of([X.indentWithTab]),H.of([]),X.editorTheme,X.editorHighlight,X.EditorView.updateListener.of(N=>{N.docChanged&&S.current(A.current,N.state.doc.toString())})]});x.current.set(O,M),_.current.set(O,W),B.setState(M),v.current.delete(O)}if(v.current.has(O))return()=>{};let we=!1;return Rw(O).then(M=>{we||!M||A.current!==O||(B.dispatch({effects:H.reconfigure(M)}),x.current.set(O,B.state),v.current.add(O))}),()=>{we=!0}}b.useEffect(()=>{if(!h.current)return;let H=!1,B=null,O=null;Q("loading"),$(!1);const W=window.setTimeout(()=>{H||$(!0)},200);return(async()=>{let he;try{he=await e1()}catch{window.clearTimeout(W),H||Q("error");return}if(H||!h.current)return;window.clearTimeout(W);const je=new he.Compartment;y.current=je,g.current=he,O=new he.EditorView({parent:h.current}),m.current=O,B=E(he,je,O,A.current,D.current),Q("ready")})(),()=>{H=!0,window.clearTimeout(W),B==null||B(),O==null||O.destroy(),m.current===O&&(m.current=null),g.current=null,y.current=null}},[]),b.useEffect(()=>{const X=g.current,H=m.current,B=y.current;if(!(!X||!H||!B))return E(X,B,H,n,i)},[n,i]);const I=b.useRef(0);return b.useEffect(()=>{const X=m.current,H=g.current;if(!X||!H||!c||c.token===I.current)return;I.current=c.token;const B=X.state.doc.lines,O=Math.min(Math.max(c.line,1),B),W=X.state.doc.line(O),he=Math.min(W.from+Math.max(c.column-1,0),W.to);X.dispatch({selection:H.EditorSelection.cursor(he),effects:H.EditorView.scrollIntoView(he,{y:"center"})}),X.focus()},[c]),b.useEffect(()=>()=>{const X=m.current;X&&x.current.set(n,X.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(G==="ready"?"":" is-hidden")}),G==="loading"&&z&&a.jsxs("div",{className:"editor__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),G==="error"&&a.jsxs("div",{className:"editor__fallback",children:[a.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[a.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),a.jsx("pre",{className:"editor__fallback-text",children:s})]})]})}function Fl({value:n,options:s,onChange:i,className:c,title:o,ariaLabel:u,placeholder:h="—"}){const[m,g]=b.useState(!1),[x,_]=b.useState(0),v=b.useRef(null),y=b.useRef(null),S=s.find(D=>D.value===n)??null;b.useEffect(()=>{if(!m)return;const D=s.findIndex(q=>q.value===n);_(D===-1?0:D)},[m]),b.useEffect(()=>{if(!m)return;function D(q){var G;(G=v.current)!=null&&G.contains(q.target)||g(!1)}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[m]),b.useEffect(()=>{var D,q;m&&((q=(D=y.current)==null?void 0:D.querySelector(".is-cursor"))==null||q.scrollIntoView({block:"nearest"}))},[m,x]),b.useEffect(()=>{if(!m)return;const D=y.current,q=n1(v.current);if(!D||!q)return;const G=D.getBoundingClientRect().bottom-q.getBoundingClientRect().bottom;G>0&&(q.scrollTop+=Math.min(G+8,D.offsetHeight))},[m]);function k(D){g(!1),D.value!==n&&i(D.value)}function A(D){if(D.key==="Escape"){if(!m)return;D.preventDefault(),D.stopPropagation(),g(!1);return}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(D.preventDefault(),!m)return g(!0);const q=D.key==="ArrowDown"?1:s.length-1;return _(G=>(G+q)%s.length)}if(D.key==="Enter"||D.key===" "){if(D.preventDefault(),!m)return g(!0);const q=s[x];q&&k(q)}}return a.jsxs("div",{ref:v,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":u??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(D=>!D),onKeyDown:A,children:[a.jsx("span",{className:"select__value",children:(S==null?void 0:S.label)??h}),a.jsx(s1,{})]}),m&&a.jsx("div",{ref:y,className:"select__menu",role:"listbox","aria-label":u??o,children:s.map((D,q)=>a.jsxs("button",{type:"button",role:"option","aria-selected":D.value===n,className:"select__option"+(q===x?" is-cursor":"")+(D.value===n?" is-on":""),onMouseEnter:()=>_(q),onClick:()=>k(D),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:D.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:D.label}),D.hint&&a.jsx("span",{className:"select__hint",children:D.hint})]},D.value))})]})}function n1(n){let s=(n==null?void 0:n.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function s1(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function l1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function a1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M4.6 6.6h4"})]})}function i1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function r1({path:n,mime:s,base64:i,error:c,tooLarge:o,size:u,onRequestMedia:h}){b.useEffect(()=>{!o&&i===void 0&&c===void 0&&h(n)},[]);const m=c1(i,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",nf(u),"). Лимит — 64 МБ."]})}):c?a.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[a.jsx("p",{className:"mediaview__error",children:c}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(n),children:"Повторить"})]}):m?s.startsWith("image/")?a.jsx(u1,{url:m}):s.startsWith("video/")?a.jsx(f1,{url:m}):null:a.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[a.jsx("div",{className:"mediaview__progress",children:a.jsx("div",{className:"mediaview__progress-fill"})}),a.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function c1(n,s){const[i,c]=b.useState(null);return b.useEffect(()=>{if(n===void 0){c(null);return}const o=atob(n),u=new Uint8Array(o.length);for(let m=0;m<o.length;m++)u[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([u],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[n,s]),i}const $i=1,my=8,Bd=1.25;function o1(n){return Math.min(my,Math.max($i,n))}function u1({url:n}){const[s,i]=b.useState({scale:$i,x:0,y:0}),[c,o]=b.useState(!1),u=b.useRef(null),h=b.useRef(null);function m(S,k,A){i(D=>{const q=o1(D.scale*S);if(q===D.scale)return D;if(q<=$i)return{scale:$i,x:0,y:0};const G=(k-D.x)/D.scale,Q=(A-D.y)/D.scale;return{scale:q,x:k-q*G,y:A-q*Q}})}b.useEffect(()=>{const S=u.current;if(!S)return;function k(A){A.preventDefault();const D=S.getBoundingClientRect(),q=A.clientX-D.left-D.width/2,G=A.clientY-D.top-D.height/2;m(A.deltaY<0?Bd:1/Bd,q,G)}return S.addEventListener("wheel",k,{passive:!1}),()=>S.removeEventListener("wheel",k)},[]);function g(S){s.scale<=$i||(S.currentTarget.setPointerCapture(S.pointerId),h.current={pointerId:S.pointerId,startX:S.clientX,startY:S.clientY,origX:s.x,origY:s.y},o(!0))}function x(S){const k=h.current;!k||k.pointerId!==S.pointerId||i(A=>({...A,x:k.origX+(S.clientX-k.startX),y:k.origY+(S.clientY-k.startY)}))}function _(){h.current=null,o(!1)}const v=s.scale>$i,y=!v&&s.x===0&&s.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:u,className:"mediaview__stage"+(v?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:x,onPointerUp:_,onPointerCancel:_,children:a.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:s.scale<=$i,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Bd,0,0),children:a.jsx(a1,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:s.scale>=my,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Bd,0,0),children:a.jsx(l1,{})}),a.jsx("button",{className:"btn btn--sm",disabled:y,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>i({scale:$i,x:0,y:0}),children:a.jsx(i1,{})})]})]})}const d1=[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× — обычная"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"2",label:"2×"}];function f1({url:n}){const s=b.useRef(null),[i,c]=b.useState("1");return b.useEffect(()=>{s.current&&(s.current.playbackRate=Number(i))},[i]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:s,className:"mediaview__video",src:n,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Fl,{className:"mediaview__speedselect",value:i,onChange:c,ariaLabel:"Скорость воспроизведения",options:d1})]})]})}function h1({file:n,goto:s,onChange:i,onSave:c,onReload:o,onOverwrite:u,onRequestMedia:h,onTogglePreview:m}){const g=Pa(n),x=hy(n.path)&&!n.binary&&!n.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:n.path,children:n.path}),a.jsxs("span",{className:"editor__meta",children:[nf(n.size),n.eol==="crlf"&&" · CRLF"]}),x&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(n.previewMode?" is-on":""),role:"tab","aria-selected":n.previewMode,onClick:()=>!n.previewMode&&m(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&m(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:g?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>u(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?a.jsx(r1,{path:n.path,mime:n.mediaMime,base64:n.mediaBase64,error:n.mediaError,tooLarge:n.mediaTooLarge,size:n.size,onRequestMedia:h},n.path):n.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",nf(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",nf(n.size),"). Такие правит агент, а не браузер."]}):x&&n.previewMode?a.jsx(p1,{text:n.text}):a.jsx(t1,{path:n.path,doc:n.text,revision:n.revision,goto:s,onChange:i,onSave:c})]})}function p1({text:n}){const[s,i]=b.useState("");return b.useEffect(()=>{let c=!1;return vf(n).then(o=>{c||i(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function m1({files:n,activePath:s,busy:i,onSelect:c,onClose:o,zoomed:u,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(m=>a.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:Lw(m.path)}),Pa(m)?a.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):a.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),a.jsx("div",{className:"worktabs__spacer"}),h&&a.jsx("button",{className:"worktabs__zoom",title:u?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":u?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":u,onClick:h,children:a.jsx(eo,{active:u})})]})}function jl(n){return n.claudeSessionId??n.id}function qd(n,s,i,c){if(!s||s.length===0)return n;const o=new Map(s.map((m,g)=>[m,g])),u=[],h=[];for(const m of n)(o.has(i(m))?u:h).push(m);return u.sort((m,g)=>o.get(i(m))-o.get(i(g))),c==="top"?[...h,...u]:[...u,...h]}function Qb(n){return n.state!=="closed"}function Kb(n){return[...n.filter(Qb),...n.filter(s=>!Qb(s))]}function Gd(n,s,i,c){if(s===i||!n.includes(s)||!n.includes(i))return null;const o=n.filter(m=>m!==s),u=o.indexOf(i)+(c==="after"?1:0),h=[...o.slice(0,u),s,...o.slice(u)];return h.every((m,g)=>m===n[g])?null:h}function lm(n,s,i,c){const o=n%10,u=n%100;return o===1&&u!==11?s:o>=2&&o<=4&&(u<12||u>14)?i:c}function gy(n){return`${n} ${lm(n,"агент","агента","агентов")}`}function g1(n){const s=n.filter(o=>o.kind==="agent").length,i=n.length-s,c=[];return s>0&&c.push(gy(s)),i>0&&c.push(`${i} ${lm(i,"задача","задачи","задач")} в фоне`),c.join(" · ")}function x1(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function b1(n){const s=Math.max(0,Math.floor(n/1e3)),i=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,u=String(o).padStart(2,"0");return i>0?`${i}:${String(c).padStart(2,"0")}:${u}`:`${c}:${u}`}function _1(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function y1({tasks:n,onStop:s}){const[i,c]=b.useState(!1),[o,u]=b.useState(()=>Date.now()),[h,m]=b.useState(()=>new Set);b.useEffect(()=>{const x=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(x)},[]),b.useEffect(()=>{m(x=>{const _=new Set(n.map(y=>y.id)),v=new Set([...x].filter(y=>_.has(y)));return v.size===x.size?x:v})},[n]);const g=x=>{m(_=>new Set(_).add(x)),s(x),window.setTimeout(()=>{m(_=>{if(!_.has(x))return _;const v=new Set(_);return v.delete(x),v})},1e4)};return a.jsxs("div",{className:i?"tasks is-open":"tasks",children:[a.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":i,"aria-controls":"tasks-list",onClick:()=>c(x=>!x),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:g1(n)}),a.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),i&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(x=>{const _=h.has(x.id);return a.jsxs("li",{className:_?"task is-stopping":"task",children:[a.jsxs("div",{className:"task__main",children:[a.jsxs("div",{className:"task__head",children:[a.jsx("span",{className:"task__kind",children:x1(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:b1(o-x.startedAt)})]}),a.jsx("div",{className:"task__desc",title:x.description,children:x.description}),(x.activity||x.lastTool)&&a.jsx("div",{className:"task__activity",title:x.activity??x.lastTool??void 0,children:x.activity??x.lastTool}),a.jsxs("div",{className:"task__stats",children:[_1(x.tokens)," · ",x.toolUses," ",lm(x.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:_?"Останавливается":"Стоп"})]},x.id)})})]})}const v1=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function am({className:n}){return a.jsx("img",{src:v1,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const j1=450,w1=6,k1=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy · разговоры и инструменты"},{id:"codex",label:"Codex",hint:"OpenAI · сессии, инструменты и разрешения"}];function hf({disabled:n,providers:s,onStart:i}){const c=[...new Set(s)].flatMap(H=>k1.filter(B=>B.id===H)),o=c.length>1,[u,h]=b.useState(!1),[m,g]=b.useState(0),[x,_]=b.useState({left:0,top:0}),v=b.useRef(null),y=b.useRef(null),S=b.useRef(null);function k(){S.current&&window.clearTimeout(S.current.timer),S.current=null}function A(H=!1){H||k(),g(0),h(!0)}function D(H){var B;h(!1),H&&((B=v.current)==null||B.focus())}function q(H){if(n||!o||H.button!==0)return;const B={timer:0,x:H.clientX,y:H.clientY,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,A(!0)},j1),S.current=B}function G(H){const B=S.current;!B||B.fired||Math.hypot(H.clientX-B.x,H.clientY-B.y)>w1&&k()}function Q(){S.current&&!S.current.fired&&k()}function z(H){var O;if((O=S.current)!=null&&O.fired){S.current=null,H.preventDefault();return}if(n)return;const B=c[0];B&&i(B.id)}function $(H){o&&(H.preventDefault(),!n&&A())}function E(H){if(n||!o)return;(H.key==="ArrowDown"||H.key==="ArrowUp"||H.key==="Enter"&&H.shiftKey)&&(H.preventDefault(),A())}b.useLayoutEffect(()=>{if(!u)return;const H=v.current,B=y.current;if(!H||!B)return;const O=H.getBoundingClientRect(),W=B.getBoundingClientRect(),he=8,je=Math.max(he,Math.min(O.right-W.width,window.innerWidth-W.width-he));let we=O.top-W.height-8;we<he&&(we=Math.min(O.bottom+8,window.innerHeight-W.height-he)),_({left:je,top:we})},[u]),b.useLayoutEffect(()=>{var H;u&&((H=y.current)==null||H.focus())},[u]),b.useLayoutEffect(()=>{if(!u)return;function H(B){var W,he;const O=B.target;!((W=y.current)!=null&&W.contains(O))&&!((he=v.current)!=null&&he.contains(O))&&D(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[u]);function I(H){D(!1),i(H.id)}function X(H){if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),D(!0);return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();const B=H.key==="ArrowDown"?1:-1;g(O=>(O+B+c.length)%c.length);return}if(H.key==="Enter"||H.key===" "){H.preventDefault();const B=c[m];B&&I(B);return}H.key==="Tab"&&D(!1)}return a.jsxs("div",{className:"newsession",role:"group","aria-label":"Создать сессию",children:[a.jsx("button",{ref:v,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?u:void 0,onClick:z,onContextMenu:$,onPointerDown:q,onPointerMove:G,onPointerUp:Q,onPointerCancel:Q,onPointerLeave:Q,onKeyDown:E,children:"+ Сессия"}),o&&a.jsx("button",{type:"button",className:"btn btn--primary newsession__choose","aria-label":"Выбрать агента","aria-haspopup":"menu","aria-expanded":u,disabled:n,onClick:()=>u?D(!0):A(),children:a.jsx(N1,{})}),u&&o&&Nu.createPortal(a.jsx("div",{ref:y,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:X,children:c.map((H,B)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(B===m?" is-cursor":""),onMouseEnter:()=>g(B),onClick:()=>I(H),children:[a.jsx("span",{className:`newsession__mark newsession__mark--${H.id}`,"aria-hidden":"true",children:H.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):H.id==="antigravity"?a.jsx(am,{className:"newsession__mark-logo"}):a.jsx(S1,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:H.label}),a.jsx("span",{className:"newsession__hint",children:H.hint})]})]},H.id))}),document.body)]})}function N1(){return a.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function S1(){return a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const xy="ccv:sidebar.collapsed",by="ccv:sidebar.mode",_y="ccv:sidebar.foldersCollapsed",E1=500,hp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function T1({open:n,connected:s,status:i,workspaces:c,archivedWorkspaces:o,workspaceFolders:u,sessionFolders:h,pinnedFolders:m,sessions:g,archived:x,pinned:_,live:v,listOrder:y,liveSessionsFirst:S,onReorder:k,activeWorkspaceId:A,activeSessionId:D,onSelectWorkspace:q,onSelectSession:G,onRenameSession:Q,onStopSession:z,onPinSessions:$,onSelectPinned:E,onCloseWorkspaces:I,onRestoreWorkspaces:X,onArchiveSessions:H,onUnarchiveSessions:B,onCreateFolder:O,onRenameFolder:W,onSetFolderColor:he,onDeleteFolder:je,onAssignToFolder:we,onOpenWorkspace:M,onNewSession:N,enabledProviders:V,onOpenExtensions:ae,account:ke,onOpenAccount:C,relay:K,onOpenRelay:de,onOpenSettings:_e,themeMode:Ae,onCycleTheme:ze,navigation:be,dashboard:Ge=!1,onAllProjects:lt,onCompareSession:Mt}){var hl;const[fe,at]=b.useState(null),[oe,Rt]=b.useState(null),[Be,qt]=b.useState(null);function Hn(T){return(Be==null?void 0:Be.folderId)===T.id?Be.color??void 0:T.color}function xt(T){const ge=T&&Hn(T);return ge?{"--folder-color":ge}:void 0}function Kt(T){return T?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const an=b.useRef(void 0),[Vn,jt]=b.useState(null),[Z,Oe]=b.useState(""),[Ye,ut]=b.useState($1),[Ee,Te]=b.useState(Y1),[Me,Ve]=b.useState(V1);function Ke(T){Ve(T),Oe("");try{localStorage.setItem(by,T)}catch{}}const Pe=Z.trim().toLowerCase(),dt=Pe!=="",Ct=b.useMemo(()=>qd(c,y==null?void 0:y.workspaces,T=>T.id,"bottom"),[c,y]),Cn=b.useMemo(()=>{const T=qd(g,A?y==null?void 0:y.sessions[A]:void 0,jl,"top");return S?Kb(T):T},[g,y,A,S]),St=b.useMemo(()=>{const T=qd(_,y==null?void 0:y.pinned,jl,"bottom");return S?Kb(T):T},[_,y,S]),Lt=b.useMemo(()=>qd(v,y==null?void 0:y.live,jl,"bottom"),[v,y]),re=b.useMemo(()=>dt?Ct.filter(T=>T.name.toLowerCase().includes(Pe)||T.path.toLowerCase().includes(Pe)):Ct,[Ct,Pe,dt]),Ne=b.useMemo(()=>dt?o.filter(T=>T.name.toLowerCase().includes(Pe)||T.path.toLowerCase().includes(Pe)):o,[o,Pe,dt]),Xe=b.useMemo(()=>dt?Cn.filter(T=>(T.title??"").toLowerCase().includes(Pe)):Cn,[Cn,Pe,dt]),We=b.useMemo(()=>dt?x.filter(T=>(T.title??"").toLowerCase().includes(Pe)):x,[x,Pe,dt]),tt=T=>{var ge;return((ge=c.find(He=>He.id===T))==null?void 0:ge.name)??"—"},on=T=>{var ge;return(ge=c.find(He=>He.id===T))==null?void 0:ge.path},On=b.useMemo(()=>dt?St.filter(T=>(T.title??"").toLowerCase().includes(Pe)||tt(T.workspaceId).toLowerCase().includes(Pe)):St,[St,c,Pe,dt]),Wt=b.useMemo(()=>dt?Lt.filter(T=>(T.title??"").toLowerCase().includes(Pe)||tt(T.workspaceId).toLowerCase().includes(Pe)):Lt,[Lt,c,Pe,dt]),bn=!dt;function Yt(T){ut(ge=>{const He=ge.includes(T)?ge.filter(bt=>bt!==T):[...ge,T];try{localStorage.setItem(xy,JSON.stringify(He))}catch{}return He})}const zt=T=>!Ye.includes(T);function P(T){Te(ge=>{const He=ge.includes(T)?ge.filter(bt=>bt!==T):[...ge,T];try{localStorage.setItem(_y,JSON.stringify(He))}catch{}return He})}const pe=T=>!Ee.includes(T),Re=b.useMemo(()=>ou(re,u),[re,u]),Ze=b.useMemo(()=>ou(Ne,u),[Ne,u]),It=b.useMemo(()=>ou(Xe,h),[Xe,h]),rn=b.useMemo(()=>ou(We,h),[We,h]),wt=b.useMemo(()=>ou(On,m,T=>T.pinnedFolderId),[On,m]),xs=b.useMemo(()=>({groups:[],ungrouped:Wt}),[Wt]),Xn=((y==null?void 0:y.workspaces.length)??0)>0,ls=A?(((hl=y==null?void 0:y.sessions[A])==null?void 0:hl.length)??0)>0:!1,cn=((y==null?void 0:y.pinned.length)??0)>0,it=((y==null?void 0:y.live.length)??0)>0,un=$d({enabled:bn,scope:"workspaces",itemKey:T=>T.id,groups:Re.groups,ungrouped:Re.ungrouped,onReorder:k}),Es=$d({enabled:bn,scope:"sessions",workspaceId:A??void 0,itemKey:jl,groups:It.groups,ungrouped:It.ungrouped,onReorder:k}),Ts=$d({enabled:bn,scope:"pinned",itemKey:jl,groups:wt.groups,ungrouped:wt.ungrouped,onReorder:k}),Cs=$d({enabled:bn,scope:"live",itemKey:jl,groups:xs.groups,ungrouped:xs.ungrouped,onReorder:k});b.useEffect(()=>{var He;if(!Be)return;const ge=(He=[...wt.groups,...Re.groups,...Ze.groups,...It.groups,...rn.groups].find(bt=>bt.folder.id===Be.folderId))==null?void 0:He.folder;ge&&ge.color===(Be.color??void 0)&&qt(null)},[Be,wt,Re,Ze,It,rn]),b.useEffect(()=>()=>window.clearTimeout(an.current),[]);const Hs=mp(re),as=mp(Ne),As=mp(Xe),[Zt,Bs]=b.useState(null),[_n,yn]=b.useState(null),[st,Pn]=b.useState(null),[Qn,is]=b.useState(null),[dn,fl]=b.useState(null),Ms=b.useRef(null);function rs(T,ge){const He=T.touches[0];if(!He)return;const bt={timer:0,x:He.clientX,y:He.clientY,el:T.currentTarget,fired:!1};bt.timer=window.setTimeout(()=>{bt.fired=!0,ge(bt.x,bt.y,bt.el)},E1),Ms.current=bt}function Rs(T){const ge=Ms.current,He=T.touches[0];!ge||!He||Math.hypot(He.clientX-ge.x,He.clientY-ge.y)>10&&(window.clearTimeout(ge.timer),Ms.current=null)}function En(T){const ge=Ms.current;ge&&(window.clearTimeout(ge.timer),ge.fired&&T.preventDefault())}function Ln(){var T;return(T=Ms.current)!=null&&T.fired?(Ms.current=null,!0):!1}function Bn(){const T=Zt==null?void 0:Zt.opener;Bs(null),T!=null&&T.isConnected&&T.focus()}function en(){const T=_n==null?void 0:_n.opener;yn(null),T!=null&&T.isConnected&&T.focus()}function Nl(){const T=st==null?void 0:st.opener;Pn(null),T!=null&&T.isConnected&&T.focus()}function ni(){const T=Qn==null?void 0:Qn.opener;is(null),T!=null&&T.isConnected&&T.focus()}function Jl(){const T=dn==null?void 0:dn.opener;fl(null),T!=null&&T.isConnected&&T.focus()}function An(T){return{onContextMenu:ge=>{ge.preventDefault(),Bs({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:Hs.targetsFor(T)})},onTouchStart:ge=>rs(ge,(He,bt,_s)=>Bs({x:He,y:bt,opener:_s,ids:Hs.targetsFor(T)})),onTouchMove:Rs,onTouchEnd:En,onTouchCancel:En}}function Sl(T){return{onContextMenu:ge=>{ge.preventDefault(),yn({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:as.targetsFor(T)})},onTouchStart:ge=>rs(ge,(He,bt,_s)=>yn({x:He,y:bt,opener:_s,ids:as.targetsFor(T)})),onTouchMove:Rs,onTouchEnd:En,onTouchCancel:En}}function El(T){return{onContextMenu:ge=>{ge.preventDefault(),Pn({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:As.targetsFor(T)})},onTouchStart:ge=>rs(ge,(He,bt,_s)=>Pn({x:He,y:bt,opener:_s,ids:As.targetsFor(T)})),onTouchMove:Rs,onTouchEnd:En,onTouchCancel:En}}function Jn(T){return{onContextMenu:ge=>{ge.preventDefault(),is({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:[T.id]})},onTouchStart:ge=>rs(ge,(He,bt,_s)=>is({x:He,y:bt,opener:_s,ids:[T.id]})),onTouchMove:Rs,onTouchEnd:En,onTouchCancel:En}}function Tl(T){return{onContextMenu:ge=>{ge.preventDefault(),fl({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:[T.id]})},onTouchStart:ge=>rs(ge,(He,bt,_s)=>fl({x:He,y:bt,opener:_s,ids:[T.id]})),onTouchMove:Rs,onTouchEnd:En,onTouchCancel:En}}const Wl=g.filter(T=>T.state!=="closed").length,qs=Zt?re.find(T=>T.id===Zt.ids[0]):void 0,vn=Zt?[{id:"close",label:Zt.ids.length>1?`Закрыть проекты (${Zt.ids.length})`:"Закрыть проект",onSelect:()=>{I(Zt.ids),Hs.clear()}},...uu({folders:u,ids:Zt.ids,hasFolder:(qs==null?void 0:qs.folderId)!=null,assign:(T,ge)=>we("workspace",T,ge),onClear:()=>Hs.clear(),onNewFolder:()=>jt("workspace")}),...Zt.ids.length===1&&bn?un.menuItems(Zt.ids[0],Xn):[]]:[],Se=Zt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(A&&Zt.ids.includes(A)&&Wl>0?` в нём сейчас незавершённых сессий: ${Wl} — при закрытии они остановятся на хосте.`:""):void 0,R=_n?Ne.find(T=>T.id===_n.ids[0]):void 0,J=_n?[{id:"restore",label:_n.ids.length>1?`Вернуть проекты (${_n.ids.length})`:"Вернуть проект",onSelect:()=>{X(_n.ids),as.clear()}},...uu({folders:u,ids:_n.ids,hasFolder:(R==null?void 0:R.folderId)!=null,assign:(T,ge)=>we("workspace",T,ge),onClear:()=>as.clear(),onNewFolder:()=>jt("workspace")})]:[],ye=_n?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Ce=st?Xe.find(T=>T.id===st.ids[0]):void 0,Qe=(Ce==null?void 0:Ce.pinned)!==!0,Je=st?[...st.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>at(st.ids[0])}]:[],{id:"pin",label:Qe?st.ids.length>1?`Закрепить (${st.ids.length})`:"Закрепить":st.ids.length>1?`Открепить (${st.ids.length})`:"Открепить",onSelect:()=>{Ce&&$(Ce.workspaceId,st.ids,Qe),As.clear()}},{id:"archive",label:st.ids.length>1?`Убрать в архив (${st.ids.length})`:"Убрать в архив",onSelect:()=>{H(A,st.ids),As.clear()}},...uu({folders:h,ids:st.ids,hasFolder:(Ce==null?void 0:Ce.folderId)!=null,assign:(T,ge)=>we("session",T,ge,A),onClear:()=>As.clear(),onNewFolder:()=>jt("session")}),...st.ids.length===1&&bn&&Ce?Es.menuItems(jl(Ce),ls):[]]:[],Vt=st?hp:void 0,mt=Qn?On.find(T=>T.id===Qn.ids[0]):void 0,tn=Qn?[{id:"rename",label:"Переименовать",onSelect:()=>at(Qn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{mt&&$(mt.workspaceId,[mt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{mt&&H(mt.workspaceId,[mt.id])}},...mt&&mt.workspaceId===A?uu({folders:h,ids:[mt.id],hasFolder:mt.folderId!=null,assign:(T,ge)=>we("session",T,ge,mt.workspaceId),onClear:()=>{},onNewFolder:()=>jt("session")}):[],...R1(mt?uu({folders:m,ids:[mt.id],hasFolder:mt.pinnedFolderId!=null,assign:(T,ge)=>we("pinned",T,ge),onClear:()=>{},onNewFolder:()=>jt("pinned")}):[]),...bn&&mt?Ts.menuItems(jl(mt),cn):[]]:[],rt=dn?Wt.find(T=>T.id===dn.ids[0]):void 0,At=dn?[{id:"stop",label:"Остановить",onSelect:()=>{rt&&z(rt)}},{id:"rename",label:"Переименовать",onSelect:()=>at(dn.ids[0])},{id:"pin",label:(rt==null?void 0:rt.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{rt&&$(rt.workspaceId,[rt.id],rt.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{rt&&H(rt.workspaceId,[rt.id])}},...bn&&rt?Cs.menuItems(jl(rt),it):[]]:[];function fn(T,ge){return a.jsxs("div",{"data-row-key":T.id,className:Lc(T.id===A,Hs.selected.includes(T.id),!1,!!ge)+un.dropClass(T.id),style:xt(ge),...An(T),children:[Kt(ge),bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...un.gripHandlers(T.id),children:a.jsx(Yd,{})}),a.jsxs("button",{className:"row__main",onClick:He=>{Ln()||Hs.click(He,T,()=>q(T.id))},onKeyDown:He=>un.onKeyDown(T.id,He),children:[a.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:T.path,children:T.path})]})]},T.id)}function nl(T,ge){return a.jsxs("div",{className:Lc(T.id===A,as.selected.includes(T.id),!1,!!ge),style:xt(ge),...Sl(T),children:[Kt(ge),a.jsxs("button",{className:"row__main",onClick:He=>{Ln()||as.click(He,T,()=>q(T.id))},children:[a.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:W1(T)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>X([T.id]),children:"Вернуть"})]},T.id)}function Gs(T,ge){const He=jl(T);return a.jsxs("div",{"data-row-key":He,className:Lc(T.id===D,As.selected.includes(T.id),T.provider==="antigravity",!!ge)+Es.dropClass(He),style:xt(ge),...fe===T.id?{}:El(T),children:[Kt(ge),fe===T.id?a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:T.title??"",onCommit:bt=>{Q(T,bt),at(null)},onCancel:()=>at(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Es.gripHandlers(He),children:a.jsx(Yd,{})}),a.jsxs("button",{className:"row__main",onClick:bt=>{Ln()||As.click(bt,T,()=>G(T))},onKeyDown:bt=>Es.onKeyDown(He,bt),children:[a.jsx(Vd,{title:T.title??"Без названия",pinned:T.pinned===!0,provider:T.provider,projectName:tt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx(gp,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),Ge&&Mt&&a.jsx("button",{className:"hub-icon-btn",title:"Открыть вторым разговором","aria-label":`Открыть рядом: ${T.title??"Без названия"}`,onClick:()=>Mt(T),children:"◧"}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Ln()||at(T.id)},children:"✎"})]})]},T.id)}function Ji(T,ge){return a.jsxs("div",{className:Lc(T.id===D,!1,T.provider==="antigravity",!!ge),style:xt(ge),children:[Kt(ge),a.jsxs("button",{className:"row__main",onClick:()=>G(T),children:[a.jsx(Vd,{title:T.title??"Без названия",pinned:!1,provider:T.provider,projectName:tt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx("span",{className:"row__meta",children:J1(T)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>B([T.id]),children:"Вернуть"})]},T.id)}function Cl(T,ge){const He=jl(T);return a.jsxs("div",{"data-row-key":He,className:Lc(T.id===D,!1,T.provider==="antigravity",!!ge)+Ts.dropClass(He),style:xt(ge),...fe===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Jn(T)},children:[Kt(ge),fe===T.id?a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:T.title??"",onCommit:bt=>{Q(T,bt),at(null)},onCancel:()=>at(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ts.gripHandlers(He),children:a.jsx(Yd,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{Ln()||E(T)},onKeyDown:bt=>Ts.onKeyDown(He,bt),children:[a.jsx(Vd,{title:T.title??"Без названия",pinned:!1,provider:T.provider,projectName:tt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx(gp,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]})]})]},T.id)}function si(T){const ge=jl(T);return a.jsx("div",{"data-row-key":ge,className:Lc(T.id===D,!1,T.provider==="antigravity")+Cs.dropClass(ge),...fe===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Tl(T)},children:fe===T.id?a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:T.title??"",onCommit:He=>{Q(T,He),at(null)},onCancel:()=>at(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Cs.gripHandlers(ge),children:a.jsx(Yd,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{Ln()||E(T)},onKeyDown:He=>Cs.onKeyDown(ge,He),children:[a.jsx(Vd,{title:T.title??"Без названия",pinned:T.pinned===!0,provider:T.provider,projectName:tt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx(gp,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:He=>{He.stopPropagation(),!Ln()&&z(T)},children:a.jsx(H1,{})})]})},T.id)}function jn(T,ge){return a.jsx(I1,{folder:T,count:ge,open:pe(T.id),renaming:oe===T.id,onToggle:()=>P(T.id),onStartRename:()=>Rt(T.id),onCommitRename:He=>{W(T.id,He),Rt(null)},onCancelRename:()=>Rt(null),onDelete:()=>je(T.id),color:Hn(T),onPreviewColor:He=>{window.clearTimeout(an.current),qt({folderId:T.id,color:He})},onCommitColor:He=>{qt({folderId:T.id,color:He}),he(T.id,He),window.clearTimeout(an.current),an.current=window.setTimeout(()=>qt(null),4e3)},onResetColor:()=>{window.clearTimeout(an.current),qt(null),he(T.id,null)}},T.id)}const bs=Ge?"section":"aside",Wn=c.find(T=>T.id===A)??o.find(T=>T.id===A);return a.jsxs(bs,{className:Ge?"sidebar project-dashboard":n?"sidebar sidebar--open":"sidebar","aria-label":Ge?"Обзор проекта":"Навигация",children:[Ge?a.jsxs("header",{className:"project-dashboard__head",children:[a.jsx("button",{className:"project-dashboard__back",onClick:lt,children:"← Все проекты"}),a.jsxs("div",{className:"project-dashboard__title",children:[a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),a.jsx("h1",{children:Wn==null?void 0:Wn.name})]}),a.jsx(hf,{disabled:!s||!A,providers:V,onStart:N})]}),a.jsx("p",{className:"project-dashboard__path",title:Wn==null?void 0:Wn.path,children:Wn==null?void 0:Wn.path}),a.jsx("p",{className:"hub-description",children:"Разговоры и история проекта. Выберите сессию, чтобы продолжить работу."}),a.jsxs("div",{className:"project-dashboard__stats",children:[a.jsxs("span",{children:[a.jsx("strong",{children:g.length})," сессий"]}),a.jsxs("span",{children:[a.jsx("strong",{children:g.filter(T=>T.state!=="closed").length})," запущено"]}),a.jsxs("span",{children:[a.jsx("strong",{children:g.filter(T=>T.state==="waiting_permission").length})," ждут ответа"]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:"brand__symbol","aria-hidden":"true"}),a.jsxs("span",{className:"brand",children:["ЭФИР",a.jsx("span",{className:"brand__caption",children:"пространство возможностей"})]}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Fb[Ae]}`,"aria-label":`Тема: ${Fb[Ae]}. Переключить`,onClick:ze,children:a.jsx(X1,{mode:Ae})})]}),a.jsxs("div",{className:"sidebar__connection",role:"status",children:[a.jsx("span",{className:s?"dot dot--on":"dot"}),a.jsx("span",{children:s?"Пространство подключено":i})]}),be,a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Me==="default",className:Me==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ke("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Me==="pinned",className:Me==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ke("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Me==="live",className:Me==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ke("live"),children:[a.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),v.length>0&&a.jsx("span",{className:"sidebar__tab-count",children:v.length})]})]})]}),a.jsxs("div",{className:"fssearch fssearch--sidebar",children:[a.jsx(q1,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Z,spellCheck:!1,placeholder:Ge||Me!=="default"?"Найти сессию…":"Найти проект…","aria-label":Ge||Me!=="default"?"Поиск по сессиям":"Поиск по проектам",onChange:T=>Oe(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),Z?Oe(""):T.currentTarget.blur())}}),Z&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Oe(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Ge?a.jsx(a.Fragment,{children:A&&a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Сессии",count:Xe.length,open:zt("sessions"),onToggle:()=>Yt("sessions"),action:{label:"Новая папка сессий",onClick:()=>{jt("session"),zt("sessions")||Yt("sessions")}}}),zt("sessions")&&a.jsxs(a.Fragment,{children:[Vn==="session"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:"",placeholder:"Название папки",onCommit:T=>{O("session",T,A),jt(null)},onCancel:()=>jt(null)})})}),Xe.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:dt?"Ничего не найдено":"Пока ни одной"})}),It.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Gs(ge,T.folder))]},T.folder.id)),It.ungrouped.map(T=>Gs(T))]}),x.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Архив",count:We.length,open:zt("archive"),onToggle:()=>Yt("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),zt("archive")&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),We.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:dt?"Ничего не найдено":"Пока пусто"})}),rn.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Ji(ge,T.folder))]},T.folder.id)),rn.ungrouped.map(T=>Ji(T))]})]})]})}):Me==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Закреплённые",count:On.length,open:zt("pinned"),onToggle:()=>Yt("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{jt("pinned"),zt("pinned")||Yt("pinned")}}}),zt("pinned")&&a.jsxs(a.Fragment,{children:[Vn==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:"",placeholder:"Название папки",onCommit:T=>{O("pinned",T),jt(null)},onCancel:()=>jt(null)})})}),On.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:dt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),wt.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Cl(ge,T.folder))]},T.folder.id)),wt.ungrouped.map(T=>Cl(T))]})]}):Me==="live"?a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Запущенные",count:Wt.length,open:zt("live"),onToggle:()=>Yt("live")}),zt("live")&&a.jsxs(a.Fragment,{children:[Wt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:dt?"Ничего не найдено":"Нет запущенных сессий"})}),Wt.map(T=>si(T))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Проекты",count:re.length,open:zt("workspaces"),onToggle:()=>Yt("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{jt("workspace"),zt("workspaces")||Yt("workspaces")}}}),zt("workspaces")&&a.jsxs(a.Fragment,{children:[Vn==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:"",placeholder:"Название папки",onCommit:T=>{O("workspace",T),jt(null)},onCancel:()=>jt(null)})})}),re.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:dt?"Ничего не найдено":"Пока ни одного"})}),Re.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>fn(ge,T.folder))]},T.folder.id)),Re.ungrouped.map(T=>fn(T))]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Архив проектов",count:Ne.length,open:zt("workspacesArchive"),onToggle:()=>Yt("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),zt("workspacesArchive")&&a.jsxs(a.Fragment,{children:[Ne.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:dt?"Ничего не найдено":"Пока пусто"})}),Ze.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>nl(ge,T.folder))]},T.folder.id)),Ze.ungrouped.map(T=>nl(T))]})]})]})}),!Ge&&a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:C,children:[a.jsx("span",{className:ke!=null&&ke.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:ke===null?"Аккаунт":ke.loggedIn?ke.email||"Вход выполнен":"Войти в аккаунт"}),(ke==null?void 0:ke.plan)&&a.jsx("span",{className:"chip",children:ke.plan})]}),de&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:de,children:[a.jsx("span",{className:K!=null&&K.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:K===null?"Удалённый доступ":K.paired?K.connected?K.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(K==null?void 0:K.connected)&&K.clients>0&&a.jsx("span",{className:"chip",children:K.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!ae,title:"MCP-серверы и плагины",onClick:()=>ae==null?void 0:ae(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:_e,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:M,children:"+ Проект"}),a.jsx(hf,{disabled:!s||!A,providers:V,onStart:N})]})]}),Zt&&a.jsx(Qi,{x:Zt.x,y:Zt.y,items:vn,note:Se,onClose:Bn}),_n&&a.jsx(Qi,{x:_n.x,y:_n.y,items:J,note:ye,onClose:en}),st&&a.jsx(Qi,{x:st.x,y:st.y,items:Je,note:Vt,onClose:Nl}),Qn&&a.jsx(Qi,{x:Qn.x,y:Qn.y,items:tn,note:hp,onClose:ni}),dn&&a.jsx(Qi,{x:dn.x,y:dn.y,items:At,note:hp,onClose:Jl})]})}function Lc(n,s,i,c){const o=["row"];return c&&o.push("row--foldered"),n&&o.push("row--active"),s&&o.push("row--selected"),i&&o.push("row--antigravity"),o.join(" ")}function ou(n,s,i=c=>c.folderId){const c=new Map(s.map(m=>[m.id,m])),o=new Map,u=[];for(const m of n){const g=i(m),x=g?c.get(g):void 0;if(!x){u.push(m);continue}const _=o.get(x.id);_?_.push(m):o.set(x.id,[m])}return{groups:[...o.entries()].map(([m,g])=>({folder:c.get(m),items:g})).sort((m,g)=>m.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:u}}function C1(n,s,i){return[...n.flatMap(c=>c.items.map(i)),...s.map(i)]}const A1="\0ungrouped";function M1(n,s,i){const c=new Map;for(const o of n)for(const u of o.items)c.set(i(u),o.folder.id);for(const o of s)c.set(i(o),A1);return c}function pp(n,s,i,c,o){const u=[...s.map(m=>m.items),i].find(m=>m.some(g=>c(g)===n));if(!u)return null;const h=u.findIndex(m=>c(m)===n);return o==="up"?h<=0?null:{target:c(u[h-1]),position:"before"}:h===-1||h>=u.length-1?null:{target:c(u[h+1]),position:"after"}}function $d(n){const[s,i]=b.useState(null),[c,o]=b.useState(null),u=b.useMemo(()=>C1(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),h=b.useMemo(()=>M1(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]);function m(){i(null),o(null)}function g(q,G){n.enabled&&(G.preventDefault(),G.currentTarget.setPointerCapture(G.pointerId),i(q),o(null))}function x(q,G){var I;if(!s)return;const Q=(I=document.elementFromPoint(q,G))==null?void 0:I.closest("[data-row-key]"),z=Q==null?void 0:Q.dataset.rowKey;if(!z||z===s||h.get(z)!==h.get(s)){o(null);return}const $=Q.getBoundingClientRect(),E=G-$.top<$.height/2?"before":"after";o(X=>(X==null?void 0:X.key)===z&&X.position===E?X:{key:z,position:E})}function _(q){x(q.clientX,q.clientY)}function v(){if(s&&c){const q=Gd(u,s,c.key,c.position);q&&n.onReorder(n.scope,q,n.workspaceId)}m()}function y(q,G){if(!n.enabled)return;const Q=pp(q,n.groups,n.ungrouped,n.itemKey,G);if(!Q)return;const z=Gd(u,q,Q.target,Q.position);z&&n.onReorder(n.scope,z,n.workspaceId)}function S(q,G){const Q=pp(q,n.groups,n.ungrouped,n.itemKey,"up"),z=pp(q,n.groups,n.ungrouped,n.itemKey,"down"),$=[{id:"move-up",label:"Переместить выше",disabled:!Q,onSelect:()=>{if(!Q)return;const E=Gd(u,q,Q.target,Q.position);E&&n.onReorder(n.scope,E,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!z,onSelect:()=>{if(!z)return;const E=Gd(u,q,z.target,z.position);E&&n.onReorder(n.scope,E,n.workspaceId)}}];return G&&$.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),$}function k(q){return s===q?" row--dragging":(c==null?void 0:c.key)===q?c.position==="before"?" row--drop-before":" row--drop-after":""}function A(q){return{onPointerDown:G=>g(q,G),onPointerMove:_,onPointerUp:v,onPointerCancel:m}}function D(q,G){!G.altKey||G.key!=="ArrowUp"&&G.key!=="ArrowDown"||(G.preventDefault(),y(q,G.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:k,gripHandlers:A,onKeyDown:D,menuItems:S}}function uu(n){return[...[...n.folders].sort((i,c)=>i.name.localeCompare(c.name,"ru")).map(i=>({id:`folder:${i.id}`,label:`В папку «${i.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,i.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(i=>n.assign(i,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function R1(n){return n.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function mp(n){const[s,i]=b.useState([]),c=b.useRef(null);function o(){i([]),c.current=null}function u(m,g,x){if(m.ctrlKey||m.metaKey){i(_=>_.includes(g.id)?_.filter(v=>v!==g.id):[..._,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const _=n.findIndex(y=>y.id===c.current),v=n.findIndex(y=>y.id===g.id);if(_!==-1&&v!==-1){const[y,S]=_<v?[_,v]:[v,_];i(n.slice(y,S+1).map(k=>k.id));return}}o(),c.current=g.id,x()}function h(m){return s.includes(m.id)?s:(i([m.id]),c.current=m.id,[m.id])}return{selected:s,click:u,targetsFor:h,clear:o}}const D1={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},O1={width:22,height:22,borderRadius:6};function zc({title:n,count:s,open:i,onToggle:c,hint:o,action:u}){const h=i?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:D1,"aria-expanded":i,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(yy,{open:i}),a.jsx("span",{className:"sidebar__section-name",children:n}),a.jsx("span",{className:"sidebar__count",children:s})]}),u&&a.jsx("button",{className:"theme-btn",style:O1,title:u.label,"aria-label":u.label,onClick:u.onClick,children:a.jsx(G1,{})})]})}const Zb={paddingLeft:22},L1={display:"flex",alignItems:"center",gap:6,width:"100%"},z1={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function I1({folder:n,count:s,open:i,renaming:c,onToggle:o,onStartRename:u,onCommitRename:h,onCancelRename:m,onDelete:g,color:x,onPreviewColor:_,onCommitColor:v,onResetColor:y}){const S=b.useRef(null),k=b.useRef(v);return k.current=v,b.useEffect(()=>{const A=S.current;if(!A)return;const D=()=>k.current(A.value);return A.addEventListener("change",D),()=>A.removeEventListener("change",D)},[c]),c?a.jsx("div",{className:"row",style:Zb,children:a.jsx("div",{className:"row__main",children:a.jsx(Sa,{value:n.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):a.jsxs("div",{className:"row",style:Zb,children:[a.jsxs("button",{className:"row__main",style:L1,"aria-expanded":i,title:i?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:o,children:[a.jsx(yy,{open:i}),a.jsx("span",{style:z1,children:n.name}),a.jsx("span",{className:"sidebar__count",children:s})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${n.name}»`,onClick:u,children:"✎"}),a.jsxs("label",{className:x?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:x?{background:x}:void 0}),a.jsx("input",{ref:S,type:"color",value:x??U1(),"aria-label":`Цвет папки «${n.name}»`,onChange:A=>_(A.target.value)})]}),n.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${n.name}»`,onClick:y,children:"↺"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${n.name}»`,onClick:g,children:"✕"})]})}function U1(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}function yy({open:n}){return a.jsx("svg",{className:n?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Yd(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function H1(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function B1({className:n}){return a.jsxs("svg",{className:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),a.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),a.jsx("path",{d:"M8 12.2v1.4"})]})}function q1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function G1(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function $1(){try{const n=localStorage.getItem(xy);if(n===null)return["archive","workspacesArchive"];const s=JSON.parse(n);return Array.isArray(s)?s.filter(i=>i==="workspaces"||i==="workspacesArchive"||i==="sessions"||i==="archive"||i==="pinned"||i==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function Y1(){try{const n=localStorage.getItem(_y);if(n===null)return[];const s=JSON.parse(n);return Array.isArray(s)?s.filter(i=>typeof i=="string"):[]}catch{return[]}}function V1(){try{const n=localStorage.getItem(by);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Fb={system:"ритм системы",light:"свет",dark:"тьма"};function X1({mode:n}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return n==="dark"?a.jsx("svg",{...s,children:a.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):n==="light"?a.jsxs("svg",{...s,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):a.jsxs("svg",{...s,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Q1(n){const s=K1(n),i=(n.tasks??[]).filter(c=>c.kind==="agent").length;return i>0?`${s} · ${gy(i)}`:s}function K1(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":Z1(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function Z1(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function F1(n){switch(n.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return n.backgroundWork?"background":P1(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function P1(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function gp({session:n,tail:s}){return a.jsxs("span",{className:"row__meta",children:[a.jsxs("span",{className:`row__state row__state--${F1(n)}`,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),Q1(n)]})," · ",s]})}function Vd({title:n,pinned:s,provider:i,projectName:c,projectPath:o}){return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[s&&a.jsx(B1,{className:"row__pin"}),i==="codex"&&a.jsx("span",{className:"row__provider codex-mark",title:"Codex",children:"C"}),i==="antigravity"&&a.jsx(am,{className:"row__provider"}),n]}),a.jsx("span",{className:"row__project",title:o,children:c})]})}function J1(n){const s=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${s}`:s}function W1(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Gt=n=>n.claudeSessionId??n.id;function vy(n,s,i,c){const o=new Set([...s,...i].flatMap(h=>[h.id,Gt(h)])),u=s.map(h=>{const m=n.find(g=>g.id===h.id||Gt(g)===Gt(h));return!m||m.lastSeq<=h.lastSeq&&m.updatedAt<=h.updatedAt?h:{...h,...m,pinned:h.pinned,pinnedAt:h.pinnedAt,folderId:h.folderId,pinnedFolderId:h.pinnedFolderId,archivedAt:h.archivedAt,archivedAuto:h.archivedAuto}});for(const h of n)h.workspaceId===c&&h.state!=="closed"&&!o.has(h.id)&&!o.has(Gt(h))&&u.push(h);return u}const ln=n=>{var s;return((s=n.title)==null?void 0:s.trim())||"Новый разговор"},_u=n=>["running","reconnecting"].includes(n.state)||n.backgroundWork,Ur=n=>n.state!=="closed"&&n.state!=="error";function Gr(n){return n.state==="starting"?"Запускается":n.state==="waiting_permission"?"Нужен ваш ответ":n.state==="error"||n.lastTurn==="failed"?"Ошибка":n.state==="running"?"В работе":n.state==="reconnecting"?"Восстанавливает связь":n.backgroundWork?"Работает в фоне":n.state==="closed"?"На диске":n.lastTurn==="completed"?"Завершено":n.lastTurn==="interrupted"||n.lastTurn==="stopped"?"Приостановлено":"Готов к работе"}function Pb(n,s){var o;const i=new Set;let c=n;for(;!i.has(c);){i.add(c);const u=(o=s.find(h=>h.sessionId===c))==null?void 0:o.parentId;if(!u)return c;c=u}return n}function ek(){try{const n=JSON.parse(localStorage.getItem("ether:inbox.seen")??"{}");if(n&&typeof n=="object"&&!Array.isArray(n))return Object.fromEntries(Object.entries(n).filter(([,s])=>typeof s=="number"&&Number.isFinite(s)))}catch{}return{}}function tk(){try{const n=JSON.parse(localStorage.getItem("ether:conversations.open")??"[]");if(Array.isArray(n))return[...new Set(n.filter(s=>typeof s=="string"))]}catch{}return[]}function nk({connected:n,workspaces:s,send:i}){const[c,o]=b.useState(null),[u,h]=b.useState(tk),[m,g]=b.useState([]),[x,_]=b.useState({}),v=b.useRef(new Map),y=b.useRef(new Set),[S,k]=b.useState({});b.useEffect(()=>{try{localStorage.setItem("ether:conversations.open",JSON.stringify(u))}catch{}},[u]);const[A,D]=b.useState([]),q=b.useRef([]),[G,Q]=b.useState({}),[z,$]=b.useState({}),[E,I]=b.useState({}),[X,H]=b.useState({}),[B,O]=b.useState({}),[W,he]=b.useState({}),[je,we]=b.useState({}),M=b.useRef(null),[N,V]=b.useState([]),[ae,ke]=b.useState(ek),[C,K]=b.useState({}),[de,_e]=b.useState(null),Ae=b.useRef(new Map),ze=b.useRef(new Set);ze.current=new Set(s.map(Z=>Z.id));const be=b.useRef(null),Ge=b.useRef(G);Ge.current=G;const lt=b.useRef(X);lt.current=X;const Mt=b.useRef(E);Mt.current=E;const fe=s.map(Z=>Z.id).sort().join("|");b.useEffect(()=>{if(!n){Ae.current.clear(),y.current.clear(),v.current.clear(),g([]);return}for(const Z of s)i({type:"session.list",workspaceId:Z.id});q.current.includes("session-links")&&i({type:"session.links.get"})},[n,fe,i]);const at=b.useCallback(Z=>{var Ye,ut;const Oe=(Ee,Te)=>{if(!Ee||Ee===Te)return;_(Ve=>({...Ve,[Ee]:Te}));const Me=xu(Ee);Me&&!xu(Te)&&sf(Te,Me)};if(Z.type==="hello.ok"&&(q.current=Z.features??[],D(Z.features??[]),be.current&&be.current!==Z.hostId&&(I({}),H({}),K({}),Ae.current.clear()),be.current=Z.hostId),Z.type==="session.started"&&Z.requestId&&v.current.has(Z.requestId)){const Ee=v.current.get(Z.requestId);v.current.delete(Z.requestId),y.current.delete(Z.session.id),Oe(Ee.previousId,Z.session.id),g(Te=>Te.filter(Me=>Me!==(Ee.previousId??Z.requestId))),Q(Te=>({...Te,[Z.session.id]:Z.session})),h(Te=>[...new Set([...Te.filter(Me=>Me!==Ee.previousId),Z.session.id])]),o(null)}if(Z.type==="session.list"){for(const Ee of Z.sessions)Ee.state!=="closed"&&!Ee.parentSessionId&&!Ae.current.has(Ee.id)&&(Ae.current.set(Ee.id,0),i({type:"session.sync",sessionId:Ee.id,sinceSeq:0}));$(Ee=>({...Ee,[Z.workspaceId]:!0})),Q(Ee=>{const Te=Object.fromEntries(Object.entries(Ee).filter(([,Me])=>Me.workspaceId!==Z.workspaceId));for(const Me of[...vy(Object.values(Ee),Z.sessions,Z.archived,Z.workspaceId),...Z.archived])Me.parentSessionId||(Te[Me.id]=Me);return Te})}if(Z.type==="session.pinned"&&Q(Ee=>{const Te=new Set(Z.sessions.map(Gt)),Me=Object.fromEntries(Object.entries(Ee).map(([Ve,Ke])=>[Ve,{...Ke,pinned:Te.has(Gt(Ke))}]));for(const Ve of Z.sessions)Me[Ve.id]={...Ve,...Me[Ve.id],pinned:!0,pinnedAt:Ve.pinnedAt};return Me}),Z.type==="session.summary"||Z.type==="session.live"){const Ee=Z.type==="session.live"?Z.sessions:[Z.session];if(!q.current.includes("session-routing")&&Z.type==="session.summary")for(const[Te,Me]of v.current){const Ve=Z.session;if(!(Ve.workspaceId!==Me.workspaceId||Ve.provider!==Me.provider||Ve.state==="closed"||Me.known.has(Ve.id)&&Ve.id!==Me.resume&&Ve.claudeSessionId!==Me.resume)){v.current.delete(Te),Oe(Me.previousId,Ve.id),g(Ke=>Ke.filter(Pe=>Pe!==(Me.previousId??Te))),h(Ke=>[...new Set([...Ke.filter(Pe=>Pe!==Me.previousId),Ve.id])]);break}}if(Q(Te=>{const Me={...Te};for(const Ve of Ee)if(!(Ve.parentSessionId||!ze.current.has(Ve.workspaceId))){for(const[Ke,Pe]of Object.entries(Me))Pe.workspaceId===Ve.workspaceId&&Ke!==Ve.id&&Gt(Pe)===Gt(Ve)&&delete Me[Ke];Me[Ve.id]={...Me[Ve.id],...Ve,...Ve.state!=="closed"?{archivedAt:void 0}:{}}}return Me}),Z.type==="session.live")for(const Te of Ee)Te.parentSessionId||!ze.current.has(Te.workspaceId)||Ae.current.has(Te.id)||(Ae.current.set(Te.id,0),i({type:"session.sync",sessionId:Te.id,sinceSeq:0}))}if(Z.type==="session.events"){const Ee=Z.entries.findLast(Ke=>Ke.event.kind==="result");Ee&&K(Ke=>({...Ke,[Z.sessionId]:Ee.ts}));const Te=Z.entries.findLast(Ke=>{var Pe;return Ke.event.kind==="rewound"&&Ke.seq>(((Pe=Mt.current[Z.sessionId])==null?void 0:Pe.lastSeq)??0)}),Me=(Te==null?void 0:Te.event.kind)==="rewound"?Te.event.toUserIndex:null,Ve=Me===null?null:B_(((Ye=lt.current[Z.sessionId])==null?void 0:Ye.entries)??[],Me);Ve&&H(Ke=>({...Ke,[Z.sessionId]:{...Ke[Z.sessionId]??Fi,entries:Ve}})),I(Ke=>{let Pe=Ke[Z.sessionId]??hs;if(Te&&Te.seq>Pe.lastSeq&&Me!==null){const dt=(Ve==null?void 0:Ve.filter(Ct=>Ct.event.kind==="user.message").length)??0;Pe={...Pe,items:q_(Pe.items,Me,dt)}}return{...Ke,[Z.sessionId]:bu(Pe,Z.entries)}})}if(Z.type==="session.history"&&H(Ee=>({...Ee,[Z.sessionId]:H_(Ee[Z.sessionId]??Fi,Z)})),Z.type==="session.capabilities"&&O(Ee=>({...Ee,[Z.sessionId]:Z.capabilities})),Z.type==="usage.state"&&he(Ee=>({...Ee,[Z.sessionId]:Z.usage})),Z.type==="context.state"&&we(Ee=>({...Ee,[Z.sessionId]:Z.context})),Z.type==="fs.search"&&Z.scope==="comparison"&&Z.workspaceId===((ut=M.current)==null?void 0:ut.workspaceId)&&Z.query===M.current.query){const Ee=M.current.sessionId;Ee&&k(Te=>({...Te,[Ee]:{query:Z.query,entries:Z.entries}}))}if(Z.type==="fs.dir"&&M.current&&Z.workspaceId===M.current.workspaceId&&Z.path===M.current.path){const Ee=M.current.query,Te=Ee.slice(Ee.lastIndexOf("/")+1).toLocaleLowerCase(),Me={query:Ee,entries:Z.entries.filter(Ke=>Ke.name.toLocaleLowerCase().includes(Te))},Ve=M.current.sessionId;Ve&&k(Ke=>({...Ke,[Ve]:Me}))}if(Z.type==="session.links"&&(V(Z.links),_e(null)),Z.type==="session.closed"&&Q(Ee=>{const Te=Ee[Z.sessionId];return Te?{...Ee,[Z.sessionId]:{...Te,state:"closed",backgroundWork:!1}}:Ee}),Z.type==="error"&&["session.start","session.link","session.history","session.sync","permission.respond","prompt.send"].includes(Z.context??"")&&(_e(Z.message),Z.requestId&&v.current.has(Z.requestId))){const Ee=v.current.get(Z.requestId);v.current.delete(Z.requestId),g(Te=>Te.filter(Me=>Me!==(Ee.previousId??Z.requestId)))}},[i]),oe=b.useMemo(()=>Object.values(G).filter(Z=>ze.current.has(Z.workspaceId)).sort((Z,Oe)=>Oe.updatedAt-Z.updatedAt),[G,fe]),Rt=Z=>Z.state==="error"?Z.updatedAt:C[Z.id]??Z.updatedAt,Be=oe.filter(Z=>{var Oe;return!Z.archivedAt&&(Z.state==="waiting_permission"||(((Oe=E[Z.id])==null?void 0:Oe.pending.length)??0)>0||!_u(Z)&&(Z.state==="error"||Z.lastTurn==="failed"||Z.lastTurn==="completed")&&Rt(Z)>(ae[Gt(Z)]??0))}),qt=Be.filter(Z=>{var Oe;return Z.state==="waiting_permission"||(((Oe=E[Z.id])==null?void 0:Oe.pending.length)??0)>0}),Hn=b.useCallback(Z=>ke(Oe=>{const Ye=Z.state==="error"?Z.updatedAt:C[Z.id]??Z.updatedAt;if((Oe[Gt(Z)]??0)>=Ye)return Oe;const ut={...Oe,[Gt(Z)]:Ye};try{localStorage.setItem("ether:inbox.seen",JSON.stringify(ut))}catch{}return ut}),[C]),xt=b.useCallback(Z=>{h(Oe=>Oe.includes(Z.id)?Oe:[...Oe,Z.id]),o(null),_e(null)},[]);b.useEffect(()=>{if(n)for(const Z of u){const Oe=G[Z];!Oe||Oe.state==="closed"||y.current.has(Z)||(y.current.add(Z),i({type:"session.sync",sessionId:Z,sinceSeq:0}),H(Ye=>({...Ye,[Z]:{...Ye[Z]??Fi,loading:!0}})),i({type:"session.history",sessionId:Z}),i({type:"usage.get",sessionId:Z}),i({type:"context.get",sessionId:Z}))}},[u,G,n,i]);const Kt=b.useCallback((Z,Oe,Ye,ut=!1,Ee=Ye)=>{if(!n||Ee&&!ut&&[...v.current.values()].some(Me=>Me.previousId===Ee))return;const Te=crypto.randomUUID();v.current.set(Te,{workspaceId:Z,provider:Oe,resume:Ye,...Ee&&!ut?{previousId:Ee}:{},known:new Set(Object.keys(Ge.current))}),g(Me=>[...Me,Ee&&!ut?Ee:Te]),_e(null),i({type:"session.start",workspaceId:Z,provider:Oe,requestId:Te,...Ye?{resume:Ye,fork:ut}:{}})},[n,i]),an=b.useCallback(Z=>{h(Oe=>Oe.filter(Ye=>Ye!==Z))},[]),Vn=b.useCallback((Z,Oe)=>{var Te;const Ye=Ge.current[Z];if(k(Me=>{const Ve={...Me};return delete Ve[Z],Ve}),Oe===null||!Ye){((Te=M.current)==null?void 0:Te.sessionId)===Z&&(M.current=null);return}const ut=Oe.lastIndexOf("/"),Ee=ut>=0?Oe.slice(0,ut):"";M.current={workspaceId:Ye.workspaceId,sessionId:Z,query:Oe,...ut>=0||Oe===""?{path:Ee}:{}},ut>=0||Oe===""?i({type:"fs.list",workspaceId:Ye.workspaceId,path:Ee}):i({type:"fs.search",workspaceId:Ye.workspaceId,query:Oe,scope:"comparison"})},[i]),jt=b.useCallback(()=>{if(n){_e(null);for(const Z of s)i({type:"session.list",workspaceId:Z.id});for(const Z of Object.values(Ge.current))Z.state!=="closed"&&!Z.archivedAt&&i({type:"session.sync",sessionId:Z.id,sinceSeq:0});q.current.includes("session-links")&&i({type:"session.links.get"})}},[n,s,i]);return{view:c,setView:o,openedIds:u,replacements:x,launchingIds:m,launchSession:Kt,closeConversation:an,searchSession:Vn,contexts:S,sessions:G,allSessions:oe,loaded:z,timelines:E,histories:X,links:N,attention:Be,waiting:qt,markRead:Hn,handleFrame:at,capabilities:B,usage:W,context:je,supportsLinks:A.includes("session-links"),openConversation:xt,send:i,error:de,clearError:()=>_e(null),refresh:jt,supportsProviderDefaults:A.includes("provider-default-models"),loadHistory:(Z,Oe)=>{H(Ye=>({...Ye,[Z]:{...Ye[Z]??Fi,loading:!0}})),i({type:"session.history",sessionId:Z,before:Oe})}}}function im(n){return/read|glob|grep|search|list|fetch|browse/i.test(n)?{title:"Исследует контекст",detail:"Читает материалы и собирает сведения для вашей задачи."}:/write|edit|patch|create/i.test(n)?{title:"Вносит изменения",detail:"Работает с содержимым проекта. Детали доступны в карточке действия."}:/bash|shell|exec|command|terminal/i.test(n)?{title:"Выполняет команду",detail:"Ожидает результат выполнения. Вывод появится в журнале действий."}:/question|ask/i.test(n)?{title:"Уточняет детали",detail:"Готовит вопрос, чтобы точнее выполнить вашу задачу."}:{title:"Выполняет действие",detail:"Результат и подробности появятся в журнале по мере выполнения."}}function sk({waiting:n,activity:s,responding:i=!1}){const[c]=b.useState(Date.now),[o,u]=b.useState(0);b.useEffect(()=>{const g=window.setInterval(()=>u(Math.floor((Date.now()-c)/1e3)),1e3);return()=>window.clearInterval(g)},[c]);const h=n?{title:"Нужен ваш ответ",detail:"Процесс приостановлен. Ответьте на вопрос или рассмотрите запрос разрешения, чтобы продолжить."}:s?im(s):i?{title:"Формирует ответ",detail:"Ответ появляется постепенно. Вы можете читать его уже сейчас."}:{title:"Работает над задачей",detail:"Обрабатывает ваш запрос. Новые действия и результаты появятся здесь."},m=o<60?`${o} с`:`${Math.floor(o/60)} мин ${o%60} с`;return a.jsxs("div",{className:n?"process process--waiting":"process","aria-busy":!n,children:[a.jsxs("div",{className:"process__visual","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("i",{})]}),a.jsxs("div",{className:"process__content",children:[a.jsxs("div",{className:"process__heading",children:[a.jsx("span",{className:"process__eyebrow",children:n?"ОЖИДАНИЕ РЕШЕНИЯ":"ПРОЦЕСС В ДВИЖЕНИИ"}),a.jsx("span",{className:"process__time","aria-label":`С начала работы: ${m}`,children:m})]}),a.jsxs("div",{role:"status",className:"process__status",children:[a.jsx("strong",{children:h.title}),a.jsx("p",{children:h.detail})]}),s&&a.jsxs("span",{className:"process__activity",children:["Действие: ",s]}),a.jsxs("div",{className:"process__steps","aria-hidden":"true",children:[a.jsx("span",{className:"is-done",children:"Запрос принят"}),a.jsx("i",{}),a.jsx("span",{className:"is-current",children:n?"Ваше решение":"В работе"}),a.jsx("i",{}),a.jsx("span",{children:"Результат"})]})]})]})}function rm(n){const s=n.findLast(o=>o.kind==="user"),i=n.findLast(o=>o.kind==="assistant"),c=n.filter(o=>o.kind==="tool").slice(-3).map(o=>{if(o.kind!=="tool")return"";const u=o.input&&typeof o.input=="object"?o.input:{},h=[u.file_path,u.path,u.command,u.query].find(m=>typeof m=="string");return`${im(o.name).title}${h?` · ${String(h).slice(0,180)}`:` · ${o.name}`}${o.isError?" · ошибка":o.result===null?" · выполняется":" · готово"}`});return{prompt:(s==null?void 0:s.kind)==="user"?s.text:"",answer:(i==null?void 0:i.kind)==="assistant"?i.text:"",actions:c}}function lk({session:n,items:s,pendingCount:i}){const[c,o]=b.useState(()=>Date.now()-n.createdAt>3e5),u=rm(s);return!u.prompt&&!u.answer&&u.actions.length===0?null:a.jsxs("section",{className:"session-recap"+(c?" is-open":""),"aria-label":"Контекст сессии",children:[a.jsxs("button",{type:"button",className:"session-recap__toggle","aria-expanded":c,onClick:()=>o(!c),children:[a.jsx("span",{"aria-hidden":"true",children:"↳"}),a.jsx("strong",{children:"Вернуться в контекст"}),a.jsx("span",{className:"session-recap__preview",children:u.prompt.slice(0,130)||"Последние действия и результат"}),a.jsx("span",{"aria-hidden":"true",children:c?"−":"+"})]}),c&&a.jsxs("div",{className:"session-recap__body",children:[u.prompt&&a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНЯЯ ЗАДАЧА"}),a.jsx("p",{children:u.prompt.slice(0,700)})]}),u.actions.length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНИЕ ДЕЙСТВИЯ"}),a.jsx("ul",{children:u.actions.map((h,m)=>a.jsx("li",{children:h},m))})]}),u.answer&&a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНИЙ ОТВЕТ"}),a.jsxs("p",{children:[u.answer.slice(0,700),u.answer.length>700?"…":""]})]}),i>0&&a.jsxs("p",{className:"hub-warning",children:["Ожидают вашего решения: ",i,". Рассмотрите запрос в разговоре или во «Входящих»."]}),["interrupted","stopped","failed"].includes(n.lastTurn??"")&&a.jsx("p",{className:"hub-warning",children:"Предыдущий ход не завершён. Можно уточнить задачу и продолжить разговор."})]})]})}function ps({title:n,children:s,actions:i,className:c,sheet:o=!1,onClose:u}){const h=b.useRef(null);return b.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),u();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const _=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),v=_[0],y=_[_.length-1];!v||!y||(g.shiftKey&&document.activeElement===v?(g.preventDefault(),y.focus()):!g.shiftKey&&document.activeElement===y&&(g.preventDefault(),v.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[u]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&u()},children:a.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":n,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:n}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:u,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:s}),i&&a.jsx("div",{className:"modal__actions",children:i})]})})}function jy(n,s){if(n!=="ExitPlanMode"||!s||typeof s!="object")return null;const i=s.plan;return typeof i=="string"?i:null}const Jb=3,ak=15e5;function wy(n,s){if(!s||typeof s!="object")return null;const i=s,c=typeof i.file_path=="string"?i.file_path:"";if(!c)return null;if(n==="Write"){if(typeof i.content!="string")return null;const o=xp(i.content).map(u=>({type:"add",text:u}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(n==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=ok(ik(xp(i.old_string),xp(i.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(u=>u.type==="add").length,removed:o.filter(u=>u.type==="del").length,note:i.replace_all===!0?"все вхождения":null}}return null}function xp(n){if(n==="")return[];const s=n.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function ik(n,s){let i=0;for(;i<n.length&&i<s.length&&n[i]===s[i];)i++;let c=n.length,o=s.length;for(;c>i&&o>i&&n[c-1]===s[o-1];)c--,o--;const u=h=>({type:"ctx",text:h});return[...n.slice(0,i).map(u),...rk(n.slice(i,c),s.slice(i,o)),...n.slice(c).map(u)]}function rk(n,s){if(n.length===0&&s.length===0)return[];if(n.length===0)return s.map(_=>({type:"add",text:_}));if(s.length===0)return n.map(_=>({type:"del",text:_}));if((n.length+1)*(s.length+1)>ak)return[...n.map(_=>({type:"del",text:_})),...s.map(_=>({type:"add",text:_}))];const i=n.length,c=s.length,o=c+1,u=new Uint32Array((i+1)*o),h=(_,v)=>u[_*o+v]??0;for(let _=i-1;_>=0;_--)for(let v=c-1;v>=0;v--)u[_*o+v]=n[_]===s[v]?h(_+1,v+1)+1:Math.max(h(_+1,v),h(_,v+1));const m=[];let g=0,x=0;for(;g<i&&x<c;){const _=n[g],v=s[x];_===v?(m.push({type:"ctx",text:_}),g++,x++):h(g+1,x)>=h(g,x+1)?(m.push({type:"del",text:_}),g++):(m.push({type:"add",text:v}),x++)}for(;g<i;)m.push({type:"del",text:n[g++]});for(;x<c;)m.push({type:"add",text:s[x++]});return ck(m)}function ck(n){const s=[];let i=[];function c(){s.push(...i.filter(o=>o.type==="del")),s.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of n)o.type==="ctx"?(c(),s.push(o)):i.push(o);return c(),s}function ok(n){if(!n.some(u=>u.type!=="ctx"))return n;const s=n.map(()=>!1);n.forEach((u,h)=>{if(u.type!=="ctx")for(let m=Math.max(0,h-Jb);m<=Math.min(n.length-1,h+Jb);m++)s[m]=!0});const i=[];let c=[];function o(){c.length===1?i.push(...c):c.length>1&&i.push({type:"gap",text:`⋯ ${c.length} ${uk(c.length)} без изменений`}),c=[]}return n.forEach((u,h)=>{s[h]?(o(),i.push(u)):c.push(u)}),o(),i}function uk(n){const s=n%100;if(s>=11&&s<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}function cm({diff:n}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:n.filePath,children:n.filePath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]})]}),n.note&&a.jsx("div",{className:"diff__note",children:n.note}),a.jsx("div",{className:"diff__body",children:n.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):n.rows.map((s,i)=>a.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},i))})]})}function dk({request:n,plan:s,queued:i,collapsed:c,onCollapse:o,onAccept:u,onDecline:h}){const[m,g]=b.useState(s),[x,_]=b.useState("preview");b.useEffect(()=>{g(s),_("preview")},[n.requestId,s]);const v=m.trim().length>0;function y(){v&&u(n.requestId,m)}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:c,children:a.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[a.jsxs("div",{className:"plansheet__head",children:[a.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:a.jsx(hk,{})}),a.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",i>0&&` — ещё ${i} в очереди`]}),a.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(x==="preview"?" is-on":""),role:"tab","aria-selected":x==="preview",onClick:()=>_("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(x==="source"?" is-on":""),role:"tab","aria-selected":x==="source",onClick:()=>_("source"),children:"Код"})]}),a.jsx(om,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[n.reason&&a.jsx("p",{className:"plansheet__reason",children:n.reason}),a.jsx("div",{className:"plansheet__content",children:x==="preview"?a.jsx(fk,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:S=>g(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(n.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!v,autoFocus:!0,onClick:y,children:"Одобрить план"})]})]})})}function fk({text:n}){const[s,i]=b.useState("");return b.useEffect(()=>{let c=!1;return vf(n).then(o=>{c||i(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function hk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.4 2.5h5.6L13 5.5v7.4a.6.6 0 0 1-.6.6H4.4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z"}),a.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),a.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function om({onClick:n}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:n,title:"Свернуть — агент продолжит ждать","aria-label":"Свернуть",children:[a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 6 4 4 4-4"})}),a.jsx("span",{className:"decision-collapse__label",children:"Свернуть"})]})}function pk({request:n,queued:s,collapsed:i,onCollapse:c,onDecide:o}){const u=wy(n.toolName,n.input);return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:i,children:a.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Запрос разрешения",children:[a.jsxs("div",{className:"sheet__head",children:[a.jsxs("span",{className:"sheet__head-text",children:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),a.jsx(om,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:n.toolName}),n.reason&&a.jsx("p",{className:"sheet__reason",children:n.reason}),u?a.jsx(cm,{diff:u}):a.jsx("pre",{className:"code",children:JSON.stringify(n.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(n.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(n.requestId,"allow"),children:"Разрешить"})]})]})})}function mk({request:n,queued:s,collapsed:i,onCollapse:c,onAnswer:o,onDecline:u}){const{questions:h}=n,[m,g]=b.useState(()=>h.map(()=>new Set)),[x,_]=b.useState(()=>h.map(()=>"")),[v,y]=b.useState(()=>Wb(h));b.useEffect(()=>{g(h.map(()=>new Set)),_(h.map(()=>"")),y(Wb(h))},[n.requestId]);const S=b.useMemo(()=>xk(h,m,x),[h,m,x]),k=S!==null;function A($,E){var I,X;(X=(I=h[$])==null?void 0:I.options[E])!=null&&X.preview&&y(H=>{const B=H.slice();return B[$]=E,B})}function D($,E,I){g(X=>{const H=X.slice(),B=new Set(H[$]);return I?B.has(E)?B.delete(E):B.add(E):B.has(E)||(B.clear(),B.add(E)),H[$]=B,H}),E!=="other"&&A($,E)}function q($,E){_(I=>{const X=I.slice();return X[$]=E,X})}function G(){S&&o(n.requestId,S)}function Q($){$.key==="Enter"&&($.target.closest("button")||k&&($.preventDefault(),G()))}function z($){var H;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes($.key))return;const E=Array.from($.currentTarget.querySelectorAll("button.qsheet__option")),I=E.indexOf(document.activeElement);if(I===-1)return;$.preventDefault();const X=$.key==="ArrowDown"||$.key==="ArrowRight"?1:-1;(H=E[(I+X+E.length)%E.length])==null||H.focus()}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:i,children:a.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от агента",onKeyDown:Q,children:[a.jsxs("div",{className:"qsheet__head",children:[a.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),a.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,s>0&&` — ещё ${s} в очереди`]}),a.jsx(om,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[n.reason&&a.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map(($,E)=>a.jsx(gk,{q:$,qi:E,selected:m[E]??new Set,otherText:x[E]??"",previewIndex:v[E]??null,onToggle:D,onFocusOption:A,onOtherText:q,onOptionsKeyDown:z},E))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>u(n.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:G,children:"Ответить"})]})]})})}function gk({q:n,qi:s,selected:i,otherText:c,previewIndex:o,onToggle:u,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var S;const x=n.options.some(k=>k.preview),_=o!==null?(S=n.options[o])==null?void 0:S.preview:void 0,v=i.has("other"),y=n.multiSelect?"checkbox":"radio";return a.jsxs("div",{className:"qsheet__question",children:[a.jsxs("div",{className:"qsheet__qhead",children:[a.jsx("span",{className:"chip chip--accent",children:n.header}),a.jsx("span",{className:"qsheet__qtext",children:n.question})]}),a.jsxs("div",{className:"qsheet__options"+(n.multiSelect?"":" qsheet__options--radio"),role:n.multiSelect?"group":"radiogroup","aria-label":n.question,onKeyDown:g,children:[n.options.map((k,A)=>{const D=i.has(A);return a.jsxs("button",{type:"button",role:y,"aria-checked":D,className:"qsheet__option"+(D?" is-selected":""),onClick:()=>u(s,A,n.multiSelect),onFocus:()=>h(s,A),onMouseEnter:()=>h(s,A),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},A)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:y,"aria-checked":v,className:"qsheet__option qsheet__option--other"+(v?" is-selected":""),onClick:()=>u(s,"other",n.multiSelect),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),a.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),v&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:k=>m(s,k.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Wb(n){return n.map(s=>{const i=s.options.findIndex(c=>c.preview);return i===-1?null:i})}function xk(n,s,i){const c={};for(let o=0;o<n.length;o++){const u=n[o];if(!u)continue;const h=s[o]??new Set,m=[];for(let g=0;g<u.options.length;g++){const x=u.options[g];x&&h.has(g)&&m.push(x.label)}if(h.has("other")){const g=(i[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[u.question]=m.join(", ")}return c}function ky({hub:n,sessionId:s,onClose:i}){var _;const c=n.timelines[s],o=c==null?void 0:c.pending[0],u=b.useRef(null);if(b.useEffect(()=>{if(!o)return;const v=y=>{var D;if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),i();return}if(y.key!=="Tab")return;const S=(D=u.current)==null?void 0:D.querySelectorAll('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [tabindex="0"]'),k=S==null?void 0:S[0],A=S==null?void 0:S[S.length-1];y.shiftKey&&document.activeElement===k&&A?(y.preventDefault(),A.focus()):!y.shiftKey&&document.activeElement===A&&k&&(y.preventDefault(),k.focus())};return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[o==null?void 0:o.requestId,i]),!o)return null;const h=v=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"deny"}),m={queued:((c==null?void 0:c.pending.length)??1)-1,collapsed:!1,onCollapse:i},g=jy(o.toolName,o.input),x=(_=o.questions)!=null&&_.length?a.jsx(mk,{...m,request:{...o,questions:o.questions},onDecline:h,onAnswer:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"allow",answers:y})},o.requestId):g!==null?a.jsx(dk,{...m,request:o,plan:g,onDecline:h,onAccept:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"allow",plan:y})},o.requestId):a.jsx(pk,{...m,request:o,onDecide:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:y})},o.requestId);return a.jsx("div",{ref:u,className:"hub-decision",children:x})}const Xd=[{value:"research",label:"Исследование"},{value:"implementation",label:"Реализация"},{value:"review",label:"Проверка"},{value:"other",label:"Другой этап"}];function bk({hub:n}){return a.jsxs("nav",{className:"hub-navigation","aria-label":"Управление пространством",children:[a.jsxs("button",{className:n.view==="projects"?"is-active":"",onClick:()=>n.setView("projects"),children:[a.jsx("span",{"aria-hidden":"true",children:"▦"}),"Обзор проектов",a.jsx("span",{children:Object.keys(n.loaded).length})]}),a.jsxs("button",{className:n.view==="inbox"?"is-active":"",onClick:()=>n.setView("inbox"),children:[a.jsx("span",{"aria-hidden":"true",children:"◫"}),"Входящие",n.attention.length>0&&a.jsx("span",{className:n.waiting.length?"has-attention":"",children:n.attention.length})]}),a.jsxs("button",{onClick:()=>n.setView("command"),children:[a.jsx("span",{"aria-hidden":"true",children:"⌕"}),"Найти и перейти",a.jsx("kbd",{children:"Ctrl P"})]})]})}function _k(n){var m,g,x;const{hub:s}=n,[i,c]=b.useState(null),o=i?((m=s.timelines[i])==null?void 0:m.pending.length)??0:0;b.useEffect(()=>{i&&!o&&c(null)},[i,o]),b.useEffect(()=>{const _=v=>{(v.ctrlKey||v.metaKey)&&(v.code==="KeyP"||v.key.toLowerCase()==="p")&&!v.altKey&&!v.isComposing&&(v.preventDefault(),v.stopImmediatePropagation(),v.repeat||s.setView(s.view==="command"?null:"command"))};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[s.view,s.setView]);const u={projects:"Обзор проектов",inbox:"Входящие",command:"Найти и перейти",tasks:"Ветки задачи",compare:"Открыть параллельно"},h=i?s.sessions[i]:null;return a.jsxs(a.Fragment,{children:[s.view&&!i&&a.jsxs(ps,{title:u[s.view],className:s.view==="command"?"modal--palette":"modal--hub",onClose:()=>s.setView(null),children:[!n.connected&&a.jsx("p",{className:"hub-warning",role:"status",children:"Связь с хостом прервана. Данные ниже — последнее полученное состояние."}),s.error&&a.jsxs("div",{className:"hub-error",role:"alert",children:[s.error,a.jsx("button",{onClick:s.clearError,"aria-label":"Закрыть ошибку",children:"×"})]}),s.view==="projects"&&a.jsx(yk,{...n}),s.view==="inbox"&&a.jsx(vk,{...n,onReview:c}),s.view==="command"&&a.jsx(jk,{...n}),s.view==="tasks"&&a.jsx(kk,{...n},(g=n.activeSession)==null?void 0:g.id),s.view==="compare"&&a.jsx(wk,{...n})]}),i&&h&&o>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hub-decision-context",children:[a.jsxs("div",{children:[a.jsxs("span",{className:"hub-eyebrow",children:["ВХОДЯЩИЕ · ",(x=n.workspaces.find(_=>_.id===h.workspaceId))==null?void 0:x.name]}),a.jsx("strong",{children:ln(h)})]}),a.jsx("button",{className:"btn",onClick:()=>c(null),children:"← К входящим"})]}),a.jsx(ky,{hub:s,sessionId:i,onClose:()=>c(null)})]})]})}function Ny({session:n,workspace:s,onOpen:i,onCompare:c,detail:o}){return a.jsxs("div",{className:"hub-session-row",children:[a.jsxs("button",{className:"hub-session-row__main",onClick:i,children:[a.jsx("span",{className:"hub-session-dot"+(n.state==="waiting_permission"?" is-waiting":_u(n)?" is-running":"")}),a.jsxs("span",{children:[a.jsx("strong",{children:ln(n)}),a.jsxs("small",{children:[s&&`${s} · `,n.provider," · ",o??Gr(n)]})]})]}),c&&a.jsx("button",{className:"hub-icon-btn",onClick:c,"aria-label":`Открыть рядом: ${ln(n)}`,title:"Открыть вторым разговором",children:"◧"})]})}function yk({hub:n,workspaces:s,connected:i,onSelectWorkspace:c,onSelectSession:o,onOpenWorkspace:u,onNewSession:h}){const[m,g]=b.useState(""),[x,_]=b.useState("all"),v=s.filter(y=>{if(!`${y.name} ${y.path}`.toLocaleLowerCase().includes(m.toLocaleLowerCase()))return!1;const S=n.allSessions.filter(k=>k.workspaceId===y.id&&!k.archivedAt);return x==="all"||(x==="working"?S.some(_u):S.some(k=>k.state==="waiting_permission"))});return a.jsxs("div",{className:"projects-hub",children:[a.jsx("p",{className:"hub-description",children:"Все проекты в одном месте. Видно, где идёт работа, где нужен ваш ответ и к чему вы возвращались последним."}),a.jsxs("div",{className:"hub-stats",children:[a.jsxs("div",{children:[a.jsx("strong",{children:s.length}),a.jsx("span",{children:"проектов"})]}),a.jsxs("div",{children:[a.jsx("strong",{children:n.allSessions.filter(y=>!y.archivedAt&&_u(y)).length}),a.jsx("span",{children:"сессий в работе"})]}),a.jsxs("div",{className:n.waiting.length?"has-attention":"",children:[a.jsx("strong",{children:n.waiting.length}),a.jsx("span",{children:"ждут решения"})]}),a.jsxs("div",{children:[a.jsx("strong",{children:n.attention.filter(y=>y.lastTurn==="completed"&&y.state!=="running").length}),a.jsx("span",{children:"новых результатов"})]})]}),a.jsxs("div",{className:"hub-controls",children:[a.jsx("input",{className:"hub-input","aria-label":"Найти проект",placeholder:"Название или путь проекта…",value:m,onChange:y=>g(y.target.value)}),a.jsx("button",{className:"btn btn--primary",disabled:!i,onClick:u,children:"+ Проект"}),a.jsx("button",{className:"hub-icon-btn",disabled:!i,onClick:n.refresh,"aria-label":"Обновить обзор",title:"Обновить обзор",children:"↻"})]}),a.jsx("div",{className:"hub-filters","aria-label":"Фильтр проектов",children:[["all","Все"],["working","В работе"],["waiting","Нужен ответ"]].map(([y,S])=>a.jsx("button",{"aria-pressed":x===y,onClick:()=>_(y),children:S},y))}),a.jsx("div",{className:"hub-project-grid",children:v.map(y=>{const S=n.allSessions.filter(D=>D.workspaceId===y.id&&!D.archivedAt),k=S.filter(D=>D.state==="waiting_permission").length,A=S.filter(_u).length;return a.jsxs("article",{className:"hub-project"+(k?" hub-project--waiting":""),children:[a.jsxs("div",{className:"hub-project__head",children:[a.jsxs("button",{onClick:()=>c(y.id),children:[a.jsx("span",{className:"hub-eyebrow",children:"РАБОЧЕЕ ПРОСТРАНСТВО"}),a.jsx("h3",{children:y.name})]}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("p",{className:"hub-project__path",title:y.path,children:y.path}),a.jsx("div",{className:"hub-project__counts",children:n.loaded[y.id]?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[S.length," сессий"]}),a.jsxs("span",{children:[A," в работе"]}),k>0&&a.jsxs("span",{className:"hub-warning",children:[k," ждут ответа"]})]}):a.jsx("span",{children:"Загружаются сессии…"})}),a.jsxs("div",{className:"hub-project__recent",children:[S.slice(0,3).map(D=>a.jsx(Ny,{session:D,onOpen:()=>o(D),onCompare:()=>o(D,!0)},D.id)),n.loaded[y.id]&&!S.length&&a.jsx("p",{className:"hub-muted",children:"Здесь начнётся следующий разговор."})]}),a.jsxs("button",{className:"hub-project__new",disabled:!i,onClick:()=>h(y.id),children:["+ Новый разговор ",a.jsx("span",{"aria-hidden":"true",children:"→"})]})]},y.id)})}),!v.length&&a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:s.length?"Проекты не найдены":"Начните с проекта"}),a.jsx("p",{children:s.length?"Измените запрос или фильтр.":"Откройте папку, чтобы собрать файлы и разговоры в одном пространстве."})]})]})}function vk({hub:n,workspaces:s,connected:i,onSelectSession:c,onReview:o,providerFilter:u="all"}){const[h,m]=b.useState("all"),g=_=>{var v;return _.state==="waiting_permission"||(v=n.timelines[_.id])!=null&&v.pending.length?"waiting":_.state==="error"||_.lastTurn==="failed"?"error":"result"},x=n.attention.filter(_=>(u==="all"||_.provider===u)&&(h==="all"||g(_)===h)).sort((_,v)=>(g(_)==="waiting"?0:g(_)==="error"?1:2)-(g(v)==="waiting"?0:g(v)==="error"?1:2)||v.updatedAt-_.updatedAt);return a.jsxs("div",{children:[a.jsx("p",{className:"hub-description",children:"Вопросы, разрешения, ошибки и новые результаты из всех проектов. Нерешённые запросы остаются здесь до вашего ответа."}),a.jsxs("div",{className:"hub-filters",children:[[["all","Всё"],["waiting","Требует решения"],["error","Ошибки"],["result","Результаты"]].map(([_,v])=>a.jsx("button",{"aria-pressed":h===_,onClick:()=>m(_),children:v},_)),a.jsx("button",{className:"hub-mark-all",onClick:()=>n.attention.filter(_=>(u==="all"||_.provider===u)&&g(_)!=="waiting").forEach(n.markRead),children:"Прочитать результаты"})]}),a.jsx("div",{className:"hub-inbox",children:x.map(_=>{var D,q,G,Q;const v=n.timelines[_.id],y=v==null?void 0:v.pending[0],S=g(_),k=rm((v==null?void 0:v.items)??[]),A=(q=(D=y==null?void 0:y.questions)==null?void 0:D[0])==null?void 0:q.question;return a.jsxs("article",{className:"hub-inbox-item hub-inbox-item--"+S,children:[a.jsxs("div",{className:"hub-inbox-item__meta",children:[a.jsx("span",{className:"hub-pill",children:S==="waiting"?(G=y==null?void 0:y.questions)!=null&&G.length?"Вопрос":"Нужно разрешение":S==="error"?"Ошибка":"Задача завершена"}),a.jsxs("span",{children:[(Q=s.find(z=>z.id===_.workspaceId))==null?void 0:Q.name," · ",_.provider]})]}),a.jsx("h3",{children:ln(_)}),a.jsx("p",{children:A??(y?`${y.toolName}${y.reason?` · ${y.reason}`:""}`:k.answer.slice(0,220)||k.prompt.slice(0,220)||Gr(_))}),a.jsxs("div",{className:"hub-inbox-item__actions",children:[S==="waiting"&&y&&a.jsxs("button",{className:"btn btn--primary",disabled:!i,onClick:()=>o(_.id),children:["Рассмотреть",v.pending.length>1?` · ${v.pending.length}`:""]}),a.jsx("button",{className:"btn",onClick:()=>c(_),children:"Открыть разговор"}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>c(_,!0),children:"Открыть рядом"}),S!=="waiting"&&a.jsx("button",{className:"hub-read",onClick:()=>n.markRead(_),children:"Прочитано ✓"})]})]},_.id)})}),!x.length&&a.jsxs("div",{className:"hub-empty",children:[a.jsx("span",{className:"hub-empty__orbit","aria-hidden":"true",children:"✓"}),a.jsx("strong",{children:"Всё под контролем"}),a.jsx("p",{children:"Здесь появятся новые события, требующие внимания."})]})]})}function jk({hub:n,workspaces:s,activeWorkspaceId:i,connected:c,providerFilter:o="all",onSelectSession:u,onSelectWorkspace:h,onOpenWorkspace:m,onOpenFiles:g,onOpenSettings:x,onNewSession:_}){const[v,y]=b.useState(""),[S,k]=b.useState(0),A=b.useRef(null);b.useEffect(()=>{const G=setTimeout(()=>{var Q;return(Q=A.current)==null?void 0:Q.focus()},0);return()=>clearTimeout(G)},[]);const D=b.useMemo(()=>{const G=[{id:"projects",title:"Обзор проектов",hint:"Действие · все рабочие пространства",run:()=>n.setView("projects")},{id:"inbox",title:"Входящие",hint:"Действие · вопросы и результаты",run:()=>n.setView("inbox")},{id:"open",title:"Открыть проект",hint:"Действие · выбрать папку",run:m,disabled:!c},{id:"new",title:"Создать сессию",hint:"Действие · новый разговор в текущем проекте",run:()=>i&&_(i),disabled:!i||!c},{id:"files",title:"Открыть файлы проекта",hint:"Действие · дерево файлов и редактор",run:g,disabled:!i},{id:"settings",title:"Настройки пространства",hint:"Действие · темы и агенты",run:x},{id:"compare",title:"Открыть сессию параллельно",hint:"Действие · независимое окно сессии",run:()=>n.setView("compare")}],Q=s.map(E=>({id:"p:"+E.id,title:E.name,hint:"Проект · "+E.path,run:()=>h(E.id),disabled:!1})),z=n.allSessions.filter(E=>o==="all"||E.provider===o).map(E=>{var I;return{id:"s:"+E.id,title:ln(E),hint:`${E.archivedAt?"Архив · ":"Сессия · "}${((I=s.find(X=>X.id===E.workspaceId))==null?void 0:I.name)??""} · ${E.provider} · ${Gr(E)}`,run:()=>u(E),disabled:!c&&E.state==="closed"}}),$=v.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);return[...G,...Q,...z].filter(E=>$.every(I=>`${E.title} ${E.hint}`.toLocaleLowerCase().includes(I))).sort((E,I)=>Number(I.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))-Number(E.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))).slice(0,60)},[v,n.allSessions,s,c,i,o]),q=G=>{const Q=D[G];Q&&!Q.disabled&&(n.setView(null),Q.run())};return b.useEffect(()=>{var G;(G=document.getElementById(`hub-option-${S}`))==null||G.scrollIntoView({block:"nearest"})},[S]),a.jsxs("div",{className:"command-palette",children:[a.jsx("input",{ref:A,className:"hub-input command-palette__input",role:"combobox","aria-expanded":"true","aria-controls":"hub-command-results","aria-autocomplete":"list","aria-activedescendant":D[S]?`hub-option-${S}`:void 0,"aria-label":"Поиск проектов, сессий и действий",placeholder:"Проект, разговор или действие…",value:v,onChange:G=>{y(G.target.value),k(0)},onKeyDown:G=>{(G.key==="ArrowDown"||G.key==="ArrowUp")&&(G.preventDefault(),k(Q=>D.length?(Q+(G.key==="ArrowDown"?1:-1)+D.length)%D.length:0)),G.key==="Enter"&&(G.preventDefault(),q(S))}}),a.jsx("div",{className:"command-palette__results",role:"listbox",id:"hub-command-results","aria-label":"Результаты поиска",children:D.map((G,Q)=>a.jsxs("button",{role:"option","aria-selected":S===Q,"aria-disabled":G.disabled,disabled:G.disabled,id:`hub-option-${Q}`,className:S===Q?"is-selected":"",onMouseMove:()=>k(Q),onClick:()=>q(Q),children:[a.jsx("span",{className:"command-palette__kind","aria-hidden":"true",children:G.id.startsWith("p:")?"▦":G.id.startsWith("s:")?"◌":"↗"}),a.jsxs("span",{children:[a.jsx("strong",{children:G.title}),a.jsx("small",{children:G.hint})]}),a.jsx("span",{"aria-hidden":"true",children:"↵"})]},G.id))}),!D.length&&a.jsx("p",{className:"hub-empty",children:"Совпадений нет. Попробуйте название проекта или слово из заголовка сессии."}),a.jsxs("div",{className:"command-palette__foot",children:[a.jsx("span",{children:"↑ ↓ выбрать · Enter перейти"}),a.jsx("span",{children:"Esc закрыть"})]})]})}function wk({hub:n,workspaces:s,onSelectSession:i,providerFilter:c="all"}){const[o,u]=b.useState(""),h=n.allSessions.filter(m=>{var g;return(c==="all"||m.provider===c)&&!m.archivedAt&&`${ln(m)} ${(g=s.find(x=>x.id===m.workspaceId))==null?void 0:g.name}`.toLocaleLowerCase().includes(o.toLocaleLowerCase())});return a.jsxs("div",{children:[a.jsx("p",{className:"hub-description",children:"Выберите сессию для отдельного окна. У всех сессий одинаковые настройки и инструменты."}),a.jsx("input",{className:"hub-input",value:o,onChange:m=>u(m.target.value),"aria-label":"Найти сессию для параллельного просмотра",placeholder:"Сессия или проект…"}),a.jsx("div",{className:"hub-session-list",children:h.map(m=>{var g;return a.jsx(Ny,{session:m,workspace:(g=s.find(x=>x.id===m.workspaceId))==null?void 0:g.name,onOpen:()=>i(m,!0)},m.id)})}),!h.length&&a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:"Сессии не найдены"}),a.jsx("p",{children:"Измените поиск или создайте сессию в проекте."})]})]})}function kk({hub:n,activeSession:s,workspaces:i,providers:c,connected:o,onSelectSession:u,onStartStage:h}){var M;const m=s==null?void 0:s.workspaceId,g=n.allSessions.filter(N=>N.workspaceId===m),[x,_]=b.useState(s?Gt(s):""),v=g.find(N=>Gt(N)===x)??s,y=n.links.find(N=>N.sessionId===x),[S,k]=b.useState((y==null?void 0:y.parentId)??""),[A,D]=b.useState((y==null?void 0:y.stage)??"other"),[q,G]=b.useState("implementation"),[Q,z]=b.useState(s&&c.includes(s.provider)?s.provider:c[0]??"claude"),[$,E]=b.useState(!1),I=v?Pb(Gt(v),n.links):"",X=g.filter(N=>Pb(Gt(N),n.links)===I).sort((N,V)=>N.createdAt-V.createdAt),H=[],B=new Set,O=(N,V)=>{var ke;const ae=Gt(N);if(!B.has(ae)){B.add(ae),H.push({session:N,depth:V});for(const C of X)((ke=n.links.find(K=>K.sessionId===Gt(C)))==null?void 0:ke.parentId)===ae&&O(C,V+1)}},W=X.find(N=>Gt(N)===I);W&&O(W,0);for(const N of X)B.has(Gt(N))||O(N,0);const he=N=>{_(N);const V=n.links.find(ae=>ae.sessionId===N);k((V==null?void 0:V.parentId)??""),D((V==null?void 0:V.stage)??"other")};if(!s||!v)return a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:"Сначала откройте сессию"}),a.jsx("p",{children:"Её можно связать с другими разговорами и продолжить отдельным этапом."})]});if(!n.supportsLinks)return a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:"Обновите хост для веток задач"}),a.jsx("p",{children:"На этом компьютере работает предыдущая версия CLI. Обновите пакет командой ниже и перезапустите ccv. Проекты, поиск, входящие и разговоры доступны уже сейчас."}),a.jsx("code",{children:"npm install -g @i14ks/ccv@latest"})]});const je=v.provider===Q&&Q!=="antigravity",we=g.filter(N=>{var ke;let V=Gt(N);const ae=new Set;for(;V&&!ae.has(V);){if(V===x)return!1;ae.add(V),V=((ke=n.links.find(C=>C.sessionId===V))==null?void 0:ke.parentId)??null}return!0});return a.jsxs("div",{className:"task-hub",children:[a.jsx("p",{className:"hub-description",children:"Одна задача может пройти через несколько разговоров: исследование, реализацию и проверку. Связи сохраняются на хосте и доступны с других устройств."}),a.jsxs("p",{className:"hub-eyebrow",children:[(M=i.find(N=>N.id===m))==null?void 0:M.name," · ЦЕПОЧКА ЗАДАЧИ"]}),a.jsx("div",{className:"task-chain",children:H.map(({session:N,depth:V})=>{var C;const ae=n.links.find(K=>K.sessionId===Gt(N)),ke=g.find(K=>Gt(K)===(ae==null?void 0:ae.parentId));return a.jsxs("article",{className:"task-node"+(N.id===v.id?" is-current":""),style:{marginLeft:Math.min(V,4)*14},"data-depth":V,children:[a.jsx("div",{className:"task-node__rail","aria-hidden":"true",children:(ae==null?void 0:ae.kind)==="fork"?"⑂":"○"}),a.jsxs("div",{children:[a.jsxs("span",{className:"hub-eyebrow",children:[((C=Xd.find(K=>K.value===(ae==null?void 0:ae.stage)))==null?void 0:C.label)??"Начало задачи",N.archivedAt?" · архив":""]}),a.jsx("button",{className:"task-node__title",onClick:()=>u(N),children:ln(N)}),a.jsxs("p",{children:[ke?`Из «${ln(ke)}» · `:"",Gr(N)," · ",N.provider]})]}),a.jsx("button",{className:"hub-icon-btn",title:"Открыть рядом","aria-label":`Открыть рядом: ${ln(N)}`,onClick:()=>u(N,!0),children:"◧"})]},N.id)})}),a.jsxs("section",{className:"hub-form-section",children:[a.jsx("h3",{children:"Связать существующие разговоры"}),a.jsx("p",{className:"hub-muted",children:"Выберите разговор, его предыдущий этап и роль в задаче."}),a.jsxs("form",{className:"hub-link-form",onSubmit:N=>{N.preventDefault(),n.send({type:"session.link",workspaceId:m,sessionId:x,parentId:S||null,stage:A})},children:[a.jsxs("label",{children:["Разговор",a.jsx("select",{value:x,onChange:N=>he(N.target.value),children:g.map(N=>a.jsx("option",{value:Gt(N),children:ln(N)},N.id))})]}),a.jsxs("label",{children:["Предыдущий этап",a.jsxs("select",{value:S,onChange:N=>k(N.target.value),children:[a.jsx("option",{value:"",children:"Самостоятельная задача"}),we.map(N=>a.jsx("option",{value:Gt(N),children:ln(N)},N.id))]})]}),a.jsxs("label",{children:["Этап",a.jsx("select",{value:A,onChange:N=>D(N.target.value),children:Xd.map(N=>a.jsx("option",{value:N.value,children:N.label},N.value))})]}),a.jsx("button",{className:"btn",disabled:!o,children:"Сохранить связь"})]})]}),a.jsxs("section",{className:"hub-form-section",children:[a.jsx("h3",{children:"Продолжить новым этапом"}),a.jsxs("p",{className:"hub-muted",children:["Новый разговор будет связан с «",ln(v),"». Доступный контекст появится в черновике — его можно проверить перед отправкой.",v.state==="closed"&&!n.histories[v.id]&&" История не открыта: в черновике будут название и этап. Для переноса всей истории выберите ответвление разговора."]}),a.jsxs("form",{className:"hub-stage-form",onSubmit:N=>{var C,K,de;N.preventDefault();const V=rm([...Yp(((C=n.histories[v.id])==null?void 0:C.entries)??[]),...((K=n.timelines[v.id])==null?void 0:K.items)??[]]),ke=`Следующий этап: ${(de=Xd.find(_e=>_e.value===q))==null?void 0:de.label}.
119
+ Продолжаем задачу «${ln(v)}».${V.prompt?`
120
+
121
+ Последняя задача:
122
+ ${V.prompt.slice(0,3e3)}`:""}${V.answer?`
123
+
124
+ Последний ответ:
125
+ ${V.answer.slice(0,5e3)}`:""}
126
+
127
+ `;h(v,Q,q,$&&je,ke)},children:[a.jsxs("label",{children:["Следующий этап",a.jsx("select",{value:q,onChange:N=>G(N.target.value),children:Xd.map(N=>a.jsx("option",{value:N.value,children:N.label},N.value))})]}),a.jsxs("label",{children:["Агент",a.jsx("select",{value:Q,onChange:N=>{z(N.target.value),E(!1)},children:c.map(N=>a.jsx("option",{value:N,children:N==="claude"?"Claude":N==="codex"?"Codex":"Antigravity"},N))})]}),a.jsxs("label",{className:"hub-checkbox",children:[a.jsx("input",{type:"checkbox",checked:$&&je,disabled:!je,onChange:N=>E(N.target.checked)}),a.jsxs("span",{children:["Ответвить полный разговор",!je&&a.jsx("small",{children:"Доступно с тем же агентом, если он поддерживает форки."})]})]}),a.jsx("button",{className:"btn btn--primary",disabled:!o||!c.length,children:"Создать этап →"})]})]})]})}const Nk="ccv.dictation.lang",e_="ru-RU";function Sk(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function t_(){const n=window,s=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),i=s.find(Sk);return!i&&s.length>0&&Ql("распознавание подменено: родной реализации в странице нет"),i??s[0]??null}function Sy(){var n;try{return((n=localStorage.getItem(Nk))==null?void 0:n.trim())||e_}catch{return e_}}function Ql(n,s){s===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,s)}const Ek=3,Tk=400,Ck=5,Ak=250,Mk=2e3,Rk=2e4;async function Dk(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const Ok={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Sy()}`};function Lk(n){const[s]=b.useState(()=>t_()!==null),[i,c]=b.useState(!1),[o,u]=b.useState(null),h=b.useRef(null),m=b.useRef(!1),g=b.useRef(!1),x=b.useRef(n),_=b.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),v=b.useRef(null),y=b.useRef(!1),S=b.useRef(null),k=b.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=null},[]),A=b.useCallback(()=>{k();const z=async $=>{if(S.current=null,!(!m.current||y.current)){if(!$&&!await Dk()){if(Ql("ждём ответа на запрос доступа к микрофону"),!m.current||y.current)return;S.current=setTimeout(()=>void z(!0),Rk);return}Ql("движок не ответил на start()"),m.current=!1,c(!1),u("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};S.current=setTimeout(()=>void z(!1),Mk)},[k]);b.useEffect(()=>{x.current=n}),b.useEffect(()=>{const z=t_();if(!z)return;const $=new z;return $.lang=Sy(),$.continuous=!0,$.interimResults=!0,$.onstart=()=>{Ql("сессия открыта"),y.current=!0,k(),c(!0)},$.onaudiostart=()=>{Ql("пошёл звук с микрофона"),_.current.audio=!0},$.onresult=E=>{var B;if(g.current)return;let I="",X="";for(let O=E.resultIndex;O<E.results.length;O++){const W=E.results[O];if(!W)continue;const he=((B=W[0])==null?void 0:B.transcript)??"";W.isFinal?I+=he:X+=he}const H=_.current;H.heard=!0,H.everHeard=!0,Ql("распознано",{final:I,interim:X}),x.current(I,X)},$.onerror=E=>{_.current.lastError=E.error,Ql("ошибка движка",E.error),!(E.error==="no-speech"||E.error==="aborted")&&(m.current=!1,c(!1),u(Ok[E.error]??`Распознавание не работает: ${E.error}`))},$.onend=()=>{g.current=!1,y.current=!1;const E=_.current,I=Date.now()-E.openedAt;if(Ql("сессия закрыта",{мс:I,звук:E.audio,слова:E.heard,ошибка:E.lastError||null}),!m.current){c(!1);return}if(E.dead=!E.audio&&I<Tk?E.dead+1:0,E.dead>=Ck){m.current=!1,c(!1),u(E.lastError?`Распознавание не работает: ${E.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}E.silent=E.heard?0:E.silent+1,!E.everHeard&&!E.warned&&E.silent>=Ek&&(E.warned=!0,u(E.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),v.current=setTimeout(()=>{if(v.current=null,!!m.current){E.openedAt=Date.now(),E.audio=!1,E.heard=!1,E.lastError="",A();try{$.start()}catch{}}},Ak)},h.current=$,()=>{m.current=!1,v.current&&clearTimeout(v.current),v.current=null,k(),$.onend=null,$.onresult=null,$.onerror=null,$.onstart=null,$.onaudiostart=null,$.abort(),h.current=null}},[]);const D=b.useCallback(()=>{var z;if(m.current){if(m.current=!1,Ql("выключение микрофона"),v.current&&clearTimeout(v.current),v.current=null,k(),!y.current){c(!1);return}(z=h.current)==null||z.stop()}},[]),q=b.useCallback(()=>{const z=h.current;if(z){if(!window.isSecureContext){u("Микрофон доступен только по https или с localhost");return}u(null),m.current=!0,g.current=!1,v.current&&clearTimeout(v.current),v.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Ql("включение микрофона",{язык:z.lang}),A();try{z.start()}catch($){Ql("start() не прошёл",$)}}},[A]),G=b.useCallback(()=>{m.current?D():q()},[q,D]),Q=b.useCallback(()=>{var z;m.current&&y.current&&(g.current=!0,(z=h.current)==null||z.abort())},[]);return{supported:s,listening:i,error:o,toggle:G,stop:D,drop:Q}}const zk="(max-width: 860px)",n_=/^\/(\S*)$/,Ik=new Set(["model","permissions"]);function Uk(n){return Ik.has(n.name)||n.name.startsWith("__")}const Hk=new Set(["clear","rename"]),s_=/(?:^|\s)@([^\s@]*)$/,Bk=200,qk=100,Gk=190,$k=5,Yk=20*1024*1024,Vk=1568,Xk=.85;let l_=0;async function Qk(n){var v,y;if(!n.type.startsWith("image/")||n.size>Yk)return null;const s=await Kk(n);if(!s)return null;const{width:i,height:c}=s;if(i<=0||c<=0)return null;const o=Math.min(1,Vk/Math.max(i,c)),u=document.createElement("canvas");u.width=Math.max(1,Math.round(i*o)),u.height=Math.max(1,Math.round(c*o));const h=u.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,u.width,u.height),(y=(v=s.image).close)==null||y.call(v);const m=n.type==="image/png",g=m?"image/png":"image/jpeg",x=u.toDataURL(g,m?void 0:Xk),_=x.slice(x.indexOf(",")+1);return _?(l_+=1,{id:`att${l_}`,mediaType:g,data:_,previewUrl:x}):null}async function Kk(n){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(n);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const i=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(i),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(i),s(null)},c.src=i})}function Ey({disabled:n,busy:s,commands:i,showAllCommands:c=!1,suspended:o=!1,sessionTitle:u,contextResult:h,className:m,placeholder:g,draftKey:x,sendLabel:_="Отправить",autoFocus:v=!1,attachmentsEnabled:y=!0,sendBlocked:S=!1,onContextSearch:k,onCommand:A,onSend:D,onInterrupt:q,onEscape:G}){var zt;const Q=bf(zk),[z,$]=b.useState(()=>x?xu(x):""),[E,I]=b.useState(!1),[X,H]=b.useState(0),B=b.useRef(null),O=b.useRef(null),[W,he]=b.useState({position:"fixed"}),je=b.useRef(!1),we=b.useRef(null),[M,N]=b.useState(()=>x?xu(x).length:0),[V,ae]=b.useState([]),ke=b.useRef(null),C=b.useCallback(P=>{!y||P.length===0||Promise.all(P.map(Qk)).then(pe=>{const Re=pe.filter(Ze=>Ze!==null);Re.length!==0&&ae(Ze=>[...Ze,...Re].slice(0,$k))})},[y]);function K(P){ae(pe=>pe.filter(Re=>Re.id!==P))}function de(P){var Ze;if(!y)return;const pe=(Ze=P.clipboardData)==null?void 0:Ze.items;if(!pe)return;const Re=[];for(const It of pe){if(!It.type.startsWith("image/"))continue;const rn=It.getAsFile();rn&&Re.push(rn)}Re.length!==0&&(P.preventDefault(),C(Re))}function _e(P){const pe=P.target.files?Array.from(P.target.files):[];P.target.value="",C(pe)}b.useEffect(()=>{y||ae([])},[y]);const[Ae,ze]=b.useState([]),[be,Ge]=b.useState(-1),lt=b.useRef(""),[Mt,fe]=b.useState(""),at=Lk(b.useCallback((P,pe)=>{P&&$(Re=>bp(Re,P)),fe(pe.trim())},[])),oe=Mt?bp(z,Mt):z;b.useEffect(()=>{at.listening||Mt===""||($(P=>bp(P,Mt)),fe(""))},[at.listening,Mt]),b.useEffect(()=>{var P;v&&((P=B.current)==null||P.focus())},[v]);const Rt=b.useRef(new Map),Be=b.useRef(new Map),qt=b.useRef(x),Hn=b.useRef({text:z,caret:M});Hn.current={text:z,caret:M};const xt=b.useCallback((P,pe,Re)=>{pe===""?(Rt.current.delete(P),Be.current.delete(P)):(Rt.current.set(P,pe),Be.current.set(P,Re)),sf(P,pe)},[]),Kt=at.drop;b.useLayoutEffect(()=>{const P=qt.current;if(P===x)return;qt.current=x,P&&xt(P,Hn.current.text,Hn.current.caret);const pe=x?Rt.current.get(x)??xu(x):"",Re=x?Be.current.get(x):void 0,Ze=Math.min(Re??pe.length,pe.length);$(pe),N(Ze),we.current=[Ze,Ze],fe(""),H(0),I(!1),Ge(-1),lt.current="",ae([]),Kt()},[x,xt,Kt]),b.useEffect(()=>{x&&xt(x,z,M)},[x,z,M,xt]);const an=n?"Выберите сессию":S?"Нет VPN — отправка остановлена":g??"С чего начнём? Опишите задачу…",Vn=b.useRef(0),jt=b.useCallback(P=>{const pe=parseFloat(getComputedStyle(P).maxHeight),Re=Number.isFinite(pe)&&pe>0?pe:Gk;P.style.height="auto";const Ze=P.scrollHeight;P.style.height=`${Math.min(Ze,Re)}px`,P.style.overflowY=Ze>Re?"auto":"hidden"},[]);b.useEffect(()=>{const P=B.current;P&&jt(P)},[oe,an,n,jt]),b.useLayoutEffect(()=>{const P=B.current,pe=we.current;!P||!pe||(we.current=null,P.setSelectionRange(pe[0],pe[1]))}),b.useEffect(()=>{const P=B.current;if(!P)return;const pe=new ResizeObserver(([Re])=>{const Ze=Re==null?void 0:Re.contentRect.width;Ze===void 0||Math.abs(Ze-Vn.current)<1||(Vn.current=Ze,jt(P))});return pe.observe(P),()=>pe.disconnect()},[jt]);const Z=at.stop;b.useEffect(()=>{n&&Z()},[n,Z]);const Oe=b.useMemo(()=>at.error?{ok:!1,message:at.error}:null,[at.error]),Ye=b.useMemo(()=>{var Re;const P=(Re=n_.exec(z))==null?void 0:Re[1];if(P===void 0)return[];const pe=P.toLowerCase();return i.filter(Ze=>(c?!Ze.name.startsWith("__"):!Uk(Ze))&&_p(Ze,pe)<Ty).sort((Ze,It)=>_p(Ze,pe)-_p(It,pe))},[z,i,c]),ut=!o&&!E&&Ye.length>0,Ee=Math.min(X,Ye.length-1),Te=E||o?null:((zt=s_.exec(oe.slice(0,M)))==null?void 0:zt[1])??null,Me=b.useRef(k);Me.current=k,b.useEffect(()=>{if(Te===null||Te===""||Te.endsWith("/")){Me.current(Te);return}const P=setTimeout(()=>Me.current(Te),Bk);return()=>clearTimeout(P)},[Te]);const Ve=Te!==null&&(h==null?void 0:h.query)===Te,Ke=Ve?h.entries:[],Pe=Te!==null,dt=Pe&&!Ve,Ct=Math.min(X,Math.max(Ke.length-1,0));b.useEffect(()=>{var pe,Re;if(!ut&&!Pe)return;const P=ut?Ee:Ct;(Re=(pe=O.current)==null?void 0:pe.children[P])==null||Re.scrollIntoView({block:"nearest"})},[ut,Pe,Ee,Ct]);const Cn=ut||Pe;b.useLayoutEffect(()=>{var It;if(!Cn)return;const P=(It=B.current)==null?void 0:It.closest(".composer__inner");if(!P)return;const pe=()=>{var Cs;const rn=P.getBoundingClientRect(),wt=window.visualViewport,xs=((wt==null?void 0:wt.offsetLeft)??0)+8,Xn=((wt==null?void 0:wt.offsetTop)??0)+8,ls=xs+((wt==null?void 0:wt.width)??innerWidth)-16,cn=Xn+((wt==null?void 0:wt.height)??innerHeight)-16,it=Math.min(Math.max(260,rn.width),ls-xs),un=rn.top-Xn-8,Es=cn-rn.bottom-8,Ts=Math.min(320,Math.max(un,Es));he({position:"fixed",left:Math.max(xs,Math.min(rn.left,ls-it)),width:it,maxHeight:Math.max(80,Ts),top:un>=Es?Math.max(Xn,rn.top-Math.min(((Cs=O.current)==null?void 0:Cs.scrollHeight)??Ts,Ts)-8):rn.bottom+8,bottom:"auto",right:"auto",zIndex:80})};pe();const Re=new ResizeObserver(pe);Re.observe(P),window.addEventListener("resize",pe),window.addEventListener("scroll",pe,!0);const Ze=rn=>{var wt,xs,Xn;!((wt=O.current)!=null&&wt.contains(rn.target))&&!((Xn=(xs=B.current)==null?void 0:xs.closest(".composer"))!=null&&Xn.contains(rn.target))&&I(!0)};return document.addEventListener("mousedown",Ze),()=>{Re.disconnect(),window.removeEventListener("resize",pe),window.removeEventListener("scroll",pe,!0),document.removeEventListener("mousedown",Ze)}},[Cn,Ye.length,Ke.length]);function St(P,pe){var Re;$(P),N(pe),we.current=[pe,pe],H(0),I(!1),Mt!==""&&(fe(""),at.drop()),(Re=B.current)==null||Re.focus()}function Lt(){$(""),fe(""),H(0),N(0),I(!1),Ge(-1),lt.current="",ae([]),at.drop(),x&&xt(x,"",0)}function re(P){const pe=P.trim();if(pe===""&&V.length===0||n||S||je.current)return;const Re=D(pe,V.length>0?V.map(Ze=>({mediaType:Ze.mediaType,data:Ze.data})):void 0);if(Re instanceof Promise){je.current=!0,Re.then(Ze=>{je.current=!1,Ze&&Ne(pe)},()=>{je.current=!1});return}Re!==!1&&Ne(pe)}function Ne(P){P!==""&&ze(pe=>[P,...pe.filter(Re=>Re!==P)].slice(0,qk)),Lt()}function Xe(P){if(P<-1||P>=Ae.length)return;be===-1&&(lt.current=z);const pe=P===-1?lt.current:Ae[P]??"";Ge(P),St(pe,pe.length)}function We(){var Ze;const P=((Ze=B.current)==null?void 0:Ze.selectionStart)??oe.length,Re=`${P>0&&!/\s$/.test(oe.slice(0,P))?" ":""}@`;St(oe.slice(0,P)+Re+oe.slice(P),P+Re.length)}function tt(P){var It;const pe=(It=s_.exec(oe.slice(0,M)))==null?void 0:It[1];if(pe===void 0)return;const Re=M-pe.length-1,Ze=P.kind==="dir"?`@${P.path}/`:`@${P.path} `;St(oe.slice(0,Re)+Ze+oe.slice(M),Re+Ze.length)}function on(){var pe;if(S)return;const P=(pe=n_.exec(oe.trim()))==null?void 0:pe[1];if(P&&A(P)){Lt();return}re(oe)}function On(P,pe){$(P),N(pe),H(0),I(!1),Ge(-1),Mt!==""&&(fe(""),at.drop())}function Wt(P){var Ze;const pe=Hk.has(P.name)?u:null,Re=`/${P.name} `;$(Re+(pe??"")),N(Re.length+((pe==null?void 0:pe.length)??0)),pe&&(we.current=[Re.length,Re.length+pe.length]),H(0),(Ze=B.current)==null||Ze.focus()}function bn(P){if(A(P.name)){$(""),H(0),I(!1);return}P.argumentHint?Wt(P):re(`/${P.name}`)}function Yt(P){if(ut){if(P.key==="ArrowDown")return P.preventDefault(),H(pe=>(Math.min(pe,Ye.length-1)+1)%Ye.length);if(P.key==="ArrowUp"){P.preventDefault();const pe=Ye.length-1;return H(Re=>(Math.min(Re,pe)+pe)%Ye.length)}if(P.key==="Enter"&&!P.shiftKey){P.preventDefault();const pe=Ye[Ee];pe&&bn(pe);return}if(P.key==="Tab"){P.preventDefault();const pe=Ye[Ee];pe&&Wt(pe);return}if(P.key==="Escape"){P.preventDefault(),P.stopPropagation(),I(!0);return}}if(Pe){if(P.key==="ArrowDown"&&Ke.length>0)return P.preventDefault(),H(pe=>(Math.min(pe,Ke.length-1)+1)%Ke.length);if(P.key==="ArrowUp"&&Ke.length>0){P.preventDefault();const pe=Ke.length-1;return H(Re=>(Math.min(Re,pe)+pe)%Ke.length)}if(P.key==="Enter"&&!P.shiftKey||P.key==="Tab"){const pe=Ke[Ct];if(pe){P.preventDefault(),tt(pe);return}if(P.key==="Tab")return}if(P.key==="Escape"){P.preventDefault(),P.stopPropagation(),I(!0);return}}if((P.key==="ArrowUp"||P.key==="ArrowDown")&&!P.shiftKey){const pe=P.currentTarget,Re=pe.selectionStart;if(pe.selectionEnd===Re){const It=P.key==="ArrowUp"?be+1:be-1;It>=-1&&It<Ae.length&&requestAnimationFrame(()=>{pe.selectionStart===Re&&pe.selectionEnd===Re&&Xe(It)})}}if(P.key==="Escape"&&G){P.preventDefault(),P.stopPropagation(),G();return}P.key==="Enter"&&!P.shiftKey&&!Q&&(P.preventDefault(),on())}return a.jsx("div",{className:m?`composer ${m}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(qr,{result:Oe}),Pe&&!ut&&Nu.createPortal(a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:O,style:W,"data-session-commands":x??void 0,children:[Ke.map((P,pe)=>a.jsxs("button",{role:"option","aria-selected":pe===Ct,className:pe===Ct?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(pe),onMouseDown:Re=>{Re.preventDefault(),tt(P)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[P.name,P.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:P.path}),P.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},P.path)),Ke.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:dt?"ищем…":Te?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),document.body),ut&&Nu.createPortal(a.jsx("div",{className:"cmdmenu",role:"listbox",ref:O,style:W,"data-session-commands":x??void 0,children:Ye.map((P,pe)=>a.jsxs("button",{role:"option","aria-selected":pe===Ee,className:pe===Ee?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(pe),onMouseDown:Re=>{Re.preventDefault(),bn(P)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",P.name]}),P.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:P.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:P.description})]},P.name))}),document.body),V.length>0&&a.jsx("div",{className:"composer__attachments",children:V.map(P=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:P.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>K(P.id),children:a.jsx(eN,{})})]},P.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:We,children:a.jsx(Pk,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:ke,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:_e}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var P;return(P=ke.current)==null?void 0:P.click()},children:a.jsx(Wk,{})})]}),a.jsx("textarea",{ref:B,value:oe,"aria-label":"Сообщение агенту",disabled:n,placeholder:an,onChange:P=>On(P.target.value,P.target.selectionStart),onSelect:P=>N(P.currentTarget.selectionStart),onKeyDown:Yt,onPaste:de}),at.supported&&a.jsx("button",{type:"button",className:at.listening?"micbtn is-on":"micbtn",title:at.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":at.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":at.listening,disabled:n,onClick:at.toggle,children:a.jsx(tN,{on:at.listening})}),s?a.jsx("button",{className:"btn",onClick:q,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:on,disabled:n||S||oe.trim()===""&&V.length===0,"aria-label":_,title:S?"Нет VPN — отправка остановлена":_,children:[a.jsx("span",{className:"sendbtn__label",children:_}),a.jsx(Jk,{})]})]}),a.jsxs("div",{className:"composer__help",children:[a.jsxs("span",{children:[a.jsx("kbd",{children:"@"})," файлы проекта ",a.jsx("span",{"aria-hidden":"true",children:"·"})," ",a.jsx("kbd",{children:"/"})," команды"]}),a.jsxs("span",{className:"composer__keyboard",children:[a.jsx("kbd",{children:"Enter"})," отправить ",a.jsx("span",{"aria-hidden":"true",children:"·"})," ",a.jsx("kbd",{children:"Shift + Enter"})," новая строка"]})]})]})})}function bp(n,s){const i=s.trim();if(i==="")return n;const c=zp(i).slice(Zk(n,i)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function Zk(n,s){const i=zp(n),c=zp(s);for(let o=Math.min(i.length,c.length);o>0;o--)if(i.slice(i.length-o).every((u,h)=>Fk(u,c[h]??"")))return o;return 0}function zp(n){return n.split(/\s+/).filter(s=>s!=="")}function Fk(n,s){const i=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(n)===i(s)}function Pk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function Jk(){return a.jsx("svg",{className:"sendbtn__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function Wk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M10.8 4.2 5.9 9.1a2 2 0 0 0 2.8 2.8l4.6-4.6a3.3 3.3 0 0 0-4.7-4.7L3.9 7.3a4.6 4.6 0 0 0 6.5 6.5l4.4-4.4"})})}function eN(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function tN({on:n}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:n?"currentColor":"none"}),a.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),a.jsx("path",{d:"M8 12.8v1.5"})]})}const Ty=4;function _p(n,s){const i=n.name.toLowerCase();return i===s?0:i.startsWith(s)?1:n.aliases.some(c=>c.toLowerCase().startsWith(s))?2:i.includes(s)?3:Ty}async function ti(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const s=document.createElement("textarea");s.value=n,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function Ip(){try{return await navigator.clipboard.readText()}catch{return null}}const Cy=1600,Gc="Копировать",yu="Скопировано";function Jc({text:n,hint:s,className:i}){const[c,o]=b.useState(!1);return b.useEffect(()=>{if(!c)return;const u=setTimeout(()=>o(!1),Cy);return()=>clearTimeout(u)},[c]),b.useEffect(()=>o(!1),[n]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":c?yu:`${Gc} ${s}`,title:c?yu:`${Gc} ${s}`,onClick:()=>{ti(n).then(u=>{u&&o(!0)})},children:c?yu:Gc})}function um({items:n,busy:s,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:u=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:x="Опишите задачу — ответы, действия и результаты появятся здесь.",welcome:_}){var E;const v=b.useRef(null),y=b.useRef(null),S=b.useRef(!1);S.current=!!_&&n.length===0&&c.length===0;const k=b.useRef(!0),A=b.useRef(null),D=b.useRef(null),q=b.useRef(!1);b.useEffect(()=>{k.current=!0,A.current=null,q.current=!1,D.current!==null&&(clearTimeout(D.current),D.current=null)},[m]),b.useEffect(()=>{const I=v.current,X=y.current;if(!I||!X)return;function H(W){!I||W===I.scrollTop||(q.current=!0,I.scrollTop=W)}function B(){if(!I)return;const W=A.current;if(W){const he=i_(I,W.id);if(he){const je=he.getBoundingClientRect().top-I.getBoundingClientRect().top;H(I.scrollTop+(je-W.top))}D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{A.current=null},500);return}k.current&&H(S.current?0:I.scrollHeight)}const O=new ResizeObserver(B);return O.observe(X),()=>{O.disconnect(),D.current!==null&&clearTimeout(D.current)}},[]);function G(){const I=v.current;if(I){if(q.current){q.current=!1;return}k.current=I.scrollHeight-I.scrollTop-I.clientHeight<80}}function Q(){if(u)return;const I=v.current,X=c[0];if(I&&X){const H=i_(I,X.id);H&&(A.current={id:X.id,top:H.getBoundingClientRect().top-I.getBoundingClientRect().top})}h==null||h()}let z=0;function $(I){return I.kind==="user"?z++:-1}return a.jsx("div",{className:"transcript",ref:v,onScroll:G,children:a.jsxs("div",{className:"stream",ref:y,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:Q,disabled:u,children:u?"Загружаем…":"Показать более раннее"}),c.map(I=>a.jsx(a_,{item:I,userIndex:$(I),onEditMessage:g},I.id)),c.length>0&&n.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&n.length===0&&(_??a.jsx("p",{className:"empty",children:x})),n.map(I=>a.jsx(a_,{item:I,userIndex:$(I),onEditMessage:g},I.id)),s&&a.jsx(sk,{waiting:i,activity:(E=[...n].reverse().find(I=>I.kind==="tool"&&I.result===null))==null?void 0:E.name,responding:n.some(I=>I.kind==="assistant"&&I.streaming)},m)]})})}function a_({item:n,userIndex:s,onEditMessage:i}){switch(n.kind){case"user":return a.jsx(sN,{item:n,userIndex:s,onEditMessage:i});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[a.jsx(lN,{text:n.text}),n.streaming&&a.jsx("span",{className:"caret"}),n.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(Jc,{text:n.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":n.id,children:n.text});case"tool":return a.jsx(iN,{item:n});case"result":return a.jsxs("div",{className:"result-line","data-item-id":n.id,children:[a.jsx("span",{children:n.isError?"✗ "+n.subtype:"✓ готово"}),a.jsxs("span",{children:[(n.durationMs/1e3).toFixed(1)," с"]}),n.costUsd!==null&&a.jsxs("span",{children:["$",n.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",c_(n.inputTokens)," ↓",c_(n.outputTokens)]})]});case"notice":return a.jsx("div",{className:n.tone==="error"?"notice notice--error":"notice","data-item-id":n.id,children:n.text})}}const nN=500;function sN({item:n,userIndex:s,onEditMessage:i}){const[c,o]=b.useState(null),[u,h]=b.useState(!1),[m,g]=b.useState(n.text),x=b.useRef(null),_=b.useRef(!1),v=bf("(max-width: 860px)"),y=b.useRef(null);function S(X,H){o({x:X,y:H})}function k(X){X.preventDefault(),S(X.clientX,X.clientY)}function A(X){const H=X.touches[0];if(!H)return;const B={timer:0,x:H.clientX,y:H.clientY,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,S(B.x,B.y)},nN),y.current=B}function D(X){const H=y.current,B=X.touches[0];!H||!B||Math.hypot(B.clientX-H.x,B.clientY-H.y)>10&&(window.clearTimeout(H.timer),y.current=null)}function q(X){const H=y.current;H&&(window.clearTimeout(H.timer),H.fired&&X.preventDefault())}function G(){g(n.text),h(!0)}function Q(){h(!1)}function z(){const X=m.trim();if(X===""&&!(n.images&&n.images.length>0))return;const H=i==null?void 0:i(s,X,n.images);if(H instanceof Promise){if(_.current)return;_.current=!0,H.then(B=>{_.current=!1,B&&h(!1)},()=>{_.current=!1});return}H!==!1&&h(!1)}b.useEffect(()=>{const X=x.current;!X||!u||(X.style.height="auto",X.style.height=`${X.scrollHeight}px`)},[m,u]),b.useEffect(()=>{if(!u)return;const X=x.current;X&&(X.focus(),X.setSelectionRange(X.value.length,X.value.length))},[u]);function $(X){if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),Q();return}X.key==="Enter"&&!X.shiftKey&&!v&&(X.preventDefault(),z())}const E=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((X,H)=>a.jsx("img",{className:"msg--user__image",src:`data:${X.mediaType};base64,${X.data}`,alt:"Вложение"},H))});if(u){const X=m.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[E,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:H=>g(H.target.value),onKeyDown:$,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:Q,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:z,disabled:!X,children:"Сохранить"})]})]})]})}const I=[{id:"copy",label:"Копировать",onSelect:()=>void ti(n.text)},...i?[{id:"edit",label:"Изменить",onSelect:G}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:A,onTouchMove:D,onTouchEnd:q,onTouchCancel:q,children:[E,n.text,c&&a.jsx(Qi,{x:c.x,y:c.y,items:I,onClose:()=>o(null)})]})}function i_(n,s){const i=n.querySelectorAll("[data-item-id]");for(const c of i)if(c.dataset.itemId===s)return c;return null}function lN({text:n}){const[s,i]=b.useState(""),c=b.useRef([]);b.useEffect(()=>{let u=!1;return vf(n).then(h=>{u||i(aN(h))}),()=>{u=!0}},[n]),b.useEffect(()=>{const u=c.current;return()=>u.forEach(h=>clearTimeout(h))},[]);function o(u){var g,x;const h=u.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";m!==""&&ti(m).then(_=>{if(!_)return;h.textContent=yu,h.setAttribute("aria-label",yu),h.classList.add("copybtn--done");const v=window.setTimeout(()=>{h.isConnected&&(h.textContent=Gc,h.setAttribute("aria-label",Up),h.classList.remove("copybtn--done"))},Cy);c.current.push(v)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const Up=`${Gc} блок кода`;function aN(n){if(!n.includes("<pre"))return n;const s=new DOMParser().parseFromString(n,"text/html");for(const i of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",i.replaceWith(c),c.append(i);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Up),o.title=Up,o.textContent=Gc,c.append(o)}return s.body.innerHTML}function iN({item:n}){const[s,i]=b.useState(!1),c=n.result===null,o=wy(n.name,n.input),u=n.name==="AskUserQuestion"?oN(n.input):null;return a.jsxs("div",{className:"tool"+(c&&!n.awaitingPermission?" tool--running":"")+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[a.jsxs("button",{className:"tool__head","aria-expanded":s,onClick:()=>i(h=>!h),children:[a.jsx("span",{className:"tool__indicator","aria-hidden":"true",children:n.awaitingPermission?"Ⅱ":c?"◌":n.isError?"!":"✓"}),a.jsxs("span",{className:"tool__identity",children:[a.jsx("span",{className:"tool__name",children:im(n.name).title}),a.jsx("span",{className:"tool__technical",children:n.name})]}),a.jsx("span",{className:"tool__arg",children:u?cN(u):rN(n.input)}),a.jsx("span",{className:"tool__status",children:n.awaitingPermission?"Ваше решение":c?"Выполняется":n.isError?"Ошибка":"Готово"}),a.jsx("span",{className:"tool__chevron","aria-hidden":"true",children:s?"−":"+"})]}),s&&a.jsxs("div",{className:"tool__body",children:[u?a.jsx(uN,{questions:u,answers:n.answers}):o?a.jsx(cm,{diff:o}):a.jsx(r_,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!u||n.isError)&&a.jsx(r_,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function r_({text:n,hint:s,style:i}){return a.jsxs("div",{className:"codeblock",style:i,children:[a.jsx("pre",{className:"code",children:n}),a.jsx(Jc,{text:n,hint:s,className:"codeblock__copy"})]})}function rN(n){if(!n||typeof n!="object")return"";const s=n;for(const i of["file_path","command","pattern","path","url","prompt"]){const c=s[i];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function cN(n){var i;const s=n.map(c=>c.header).filter(c=>c.length>0);return s.length===n.length?s.join(" · "):((i=n[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function oN(n){if(typeof n!="object"||n===null)return null;const s=n.questions;if(!Array.isArray(s)||s.length===0)return null;const i=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:u,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:_,description:v,preview:y}=x;if(typeof _!="string"||typeof v!="string")return null;g.push({label:_,description:v,...typeof y=="string"?{preview:y}:{}})}i.push({question:o,header:typeof u=="string"?u:"",options:g,multiSelect:m===!0})}return i}function uN({questions:n,answers:s}){return a.jsx("div",{className:"tool__questions",children:n.map((i,c)=>a.jsxs("div",{className:"tool__question",children:[a.jsxs("div",{className:"tool__question-head",children:[i.header&&a.jsx("span",{className:"chip chip--accent",children:i.header}),a.jsx("span",{className:"tool__question-text",children:i.question})]}),a.jsx("div",{className:"tool__question-answer",children:s!=null&&s[i.question]?a.jsx("span",{className:"tool__answer-value",children:s[i.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function c_(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}const dN=75,fN=90;function hN({usage:n}){if(!(n!=null&&n.available))return null;const s=n.buckets??[],i=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...n.fiveHour?[{key:"five",label:"5 ч",window:n.fiveHour}]:[],...n.sevenDay?[{key:"week",label:"нед",window:n.sevenDay}]:[]];if(i.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return a.jsx("div",{className:"usage",title:gN(n,s),"aria-label":c,children:i.map(o=>a.jsx(pN,{label:o.label,window:o.window},o.key))})}function pN({label:n,window:s}){const i=Math.round(s.utilization),c=bN(s.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:n}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":n,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${mN(i)}`,style:{width:`${i}%`}})}),a.jsxs("span",{className:"usage__pct",children:[i,"%"]}),a.jsx("span",{className:"usage__reset",title:dm(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function mN(n){return n>=fN?" usage__fill--over":n>=dN?" usage__fill--warn":""}function gN(n,s){if(s.length>0)return xN(s);const i=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,u)=>{if(!u)return;const h=dm(u.resetsAt);i.push(`${o}: ${Math.round(u.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),i.join(`
128
+ `)}function xN(n){const s=["Квота Antigravity"];for(const i of n){const c=dm(i.window.resetsAt),o=Math.round(i.window.utilization);s.push(`${i.title}: ${o}%${c?`, ${c}`:""}`),i.description&&s.push(i.description)}return s.join(`
129
+ `)}function Ay(n){if(!n)return null;const s=new Date(n);return Number.isNaN(s.getTime())?null:s}function My(n){return n.getTime()-Date.now()<1440*60*1e3}function bN(n){const s=Ay(n);return s?My(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function dm(n){const s=Ay(n);return s?`обнулится ${My(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}const _N=2e5,yN=75,vN=90;function jN({tokens:n,maxTokens:s,fetchedAt:i}){if(n===null)return null;const c=s??_N,o=Math.min(100,Math.round(n/c*100)),u=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${i?`
130
+ обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return a.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:u,children:[a.jsx("span",{className:"contextbar__label",children:"контекст"}),a.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`contextbar__fill${wN(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function wN(n){return n>=vN?" contextbar__fill--over":n>=yN?" contextbar__fill--warn":""}function kN({connected:n,workspaceName:s,hasSession:i,onOpenWorkspace:c,onNewSession:o,onOpenFiles:u,onOpenSettings:h}){return a.jsxs("section",{className:"welcome","aria-labelledby":"welcome-title",children:[a.jsxs("div",{className:"welcome__eyebrow",children:[a.jsx("span",{})," МЕСТО, ГДЕ ИДЕИ ОБРЕТАЮТ ФОРМУ"]}),a.jsxs("div",{className:"eclipse","aria-hidden":"true",children:[a.jsx("div",{className:"eclipse__halo"}),a.jsx("div",{className:"eclipse__orbit eclipse__orbit--outer",children:a.jsx("i",{})}),a.jsx("div",{className:"eclipse__orbit eclipse__orbit--inner",children:a.jsx("i",{})}),a.jsx("div",{className:"eclipse__body"}),a.jsx("span",{className:"eclipse__star eclipse__star--one"}),a.jsx("span",{className:"eclipse__star eclipse__star--two"}),a.jsx("span",{className:"eclipse__coordinate",children:"СВЕТ / ТЬМА"})]}),a.jsxs("h1",{id:"welcome-title",children:["От мысли",a.jsx("br",{}),"к ",a.jsx("span",{children:"возможностям."})]}),a.jsx("p",{className:"welcome__description",children:"Одно пространство для больших идей и повседневных задач. Исследуйте, создавайте, меняйте — в своём ритме."}),a.jsxs("div",{className:"welcome__context",children:[a.jsx("span",{className:n?"dot dot--on":"dot"}),s?a.jsxs(a.Fragment,{children:["Рабочее пространство ",a.jsx("strong",{children:s})]}):"Начните с пространства для вашей работы"]}),a.jsxs("div",{className:"welcome__actions",children:[a.jsxs("button",{type:"button",className:"welcome-card",disabled:!n,onClick:i?()=>{var m;return(m=document.querySelector(".main .composer textarea"))==null?void 0:m.focus()}:s?o:c,children:[a.jsxs("span",{className:"welcome-card__top",children:[a.jsx("span",{className:"welcome-card__number",children:"01 / СОЗДАВАЙТЕ"}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("span",{className:"welcome-card__icon","aria-hidden":"true",children:"✧"}),a.jsx("strong",{children:i?"Начать с идеи":s?"Новый разговор":"Открыть пространство"}),a.jsx("span",{className:"welcome-card__description",children:i?"Опишите задачу своими словами. Ответы и действия появятся здесь.":s?"Создайте сессию с подключённым агентом и переходите к задаче.":"Выберите папку проекта: файлы, разговоры и результаты будут рядом."})]}),a.jsxs("button",{type:"button",className:"welcome-card",disabled:!n,onClick:s?u:c,children:[a.jsxs("span",{className:"welcome-card__top",children:[a.jsx("span",{className:"welcome-card__number",children:"02 / ИССЛЕДУЙТЕ"}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("span",{className:"welcome-card__icon","aria-hidden":"true",children:a.jsxs("svg",{viewBox:"0 0 24 24",width:"27",height:"27",fill:"none",stroke:"currentColor",strokeWidth:"1.2",children:[a.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),a.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),a.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),a.jsx("path",{d:"M14 17.5h7m-3.5-3.5v7"})]})}),a.jsx("strong",{children:"Ближе к деталям"}),a.jsx("span",{className:"welcome-card__description",children:"Откройте файлы, изучите структуру и соберите контекст для следующего шага."})]}),a.jsxs("button",{type:"button",className:"welcome-card",onClick:h,children:[a.jsxs("span",{className:"welcome-card__top",children:[a.jsx("span",{className:"welcome-card__number",children:"03 / НАСТРАИВАЙТЕ"}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("span",{className:"welcome-card__icon welcome-card__icon--circle","aria-hidden":"true",children:"◐"}),a.jsx("strong",{children:"На вашей стороне"}),a.jsx("span",{className:"welcome-card__description",children:"Выберите свет или тьму, подключите агентов и задайте правила работы."})]})]}),a.jsxs("p",{className:"welcome__footnote",children:[a.jsx("span",{"aria-hidden":"true",children:"↳"})," Ваши инструменты. Ваш подход. Единое пространство."]})]})}function NN({sessionId:n,hub:s,workspaces:i,connected:c,suspended:o=!1,networkBlocked:u,terminalEnabled:h,onTool:m,onStop:g,onPin:x,onClose:_,onCommand:v,onSend:y,editor:S,footer:k,className:A,children:D}){var K,de,_e,Ae,ze;const[q,G]=b.useState(!1),[Q,z]=b.useState(!1),$=((K=s.timelines[n])==null?void 0:K.pending.length)??0;b.useEffect(()=>{$||G(!1)},[$]);const E=s.sessions[n];if(!E)return null;const I=s.timelines[n]??hs,X=s.histories[n]??Fi,H=Yp(X.entries),B=s.capabilities[n],O=E.state==="running"||E.state==="waiting_permission",W=I.pending.length>0,he=E.state==="closed",je=E.state==="error",we=i.find(be=>be.id===E.workspaceId),M=(B==null?void 0:B.models)??[],N=M.find(be=>be.value===E.model||be.resolvedModel===E.model),V=N!=null&&N.supportsEffort?N.effortLevels.length?N.effortLevels:["low","medium","high"]:[],ae=E.provider==="codex"?G_:E.provider==="antigravity"?$_:Vp,ke=!c||he||je||O,C=(be,Ge)=>{be==="control.set_model"&&s.send({type:be,sessionId:n,model:Ge}),be==="control.set_mode"&&s.send({type:be,sessionId:n,mode:Ge}),be==="control.set_effort"&&s.send({type:be,sessionId:n,effort:Ge})};return a.jsxs("section",{className:"main session-pane"+(A?` ${A}`:""),"data-provider":E.provider,"aria-label":ln(E),children:[a.jsxs("header",{className:"session-pane__head",children:[a.jsxs("div",{className:"session-pane__identity",children:[a.jsxs("span",{className:"hub-eyebrow",children:[E.provider.toUpperCase()," · ",(we==null?void 0:we.name)??"ПРОЕКТ"]}),Q?a.jsx(Sa,{value:E.title??"",onCommit:be=>{s.send({type:"session.rename",workspaceId:E.workspaceId,sessionId:n,title:be}),z(!1)},onCancel:()=>z(!1)}):a.jsx("button",{className:"session-pane__title",title:"Переименовать сессию",onClick:()=>z(!0),children:ln(E)})]}),a.jsx("button",{className:"hub-icon-btn"+(E.pinned?" is-pinned":""),title:E.pinned?"Открепить":"Закрепить","aria-label":E.pinned?"Открепить сессию":"Закрепить сессию",onClick:()=>x(E),children:"☆"}),Ur(E)&&a.jsx("button",{className:"hub-icon-btn",title:"Остановить CLI, сохранив разговор","aria-label":"Остановить сессию",onClick:()=>g(E),children:"■"})]}),a.jsxs("div",{className:"session-pane__controls",children:[a.jsxs("span",{className:`session-status session-status--${E.state}`,children:[a.jsx("span",{className:`session-state-dot session-state-dot--${E.state}`}),Ur(E)?"Запущена":he?"Сохранена":"Ошибка"]}),a.jsx("span",{className:"session-pane__activity",children:Gr(E)}),a.jsxs("label",{children:[a.jsx("span",{children:"Модель"}),a.jsxs("select",{"aria-label":`Модель: ${ln(E)}`,disabled:ke||!M.length,value:(N==null?void 0:N.value)??E.model??"",onChange:be=>C("control.set_model",be.target.value),children:[!N&&a.jsx("option",{value:E.model??"",children:E.model??"Как в CLI"}),M.map(be=>a.jsx("option",{value:be.value,children:be.displayName},be.value))]})]}),V.length>0&&a.jsxs("label",{children:[a.jsx("span",{children:"Усилие"}),a.jsxs("select",{"aria-label":`Усилие: ${ln(E)}`,value:E.effort??"",disabled:ke,onChange:be=>C("control.set_effort",be.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Как в CLI"}),V.map(be=>a.jsx("option",{children:be},be))]})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Права"}),a.jsxs("select",{"aria-label":`Режим прав: ${ln(E)}`,value:E.permissionMode,disabled:ke,onChange:be=>C("control.set_mode",be.target.value),children:[!ae.some(be=>be.value===E.permissionMode)&&a.jsx("option",{value:E.permissionMode,children:E.permissionMode}),ae.map(be=>a.jsxs("option",{value:be.value,children:[be.value," — ",be.hint]},be.value))]})]}),E.provider==="claude"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"session-toggle","aria-pressed":E.thinking,disabled:ke,onClick:()=>s.send({type:"control.set_thinking",sessionId:n,enabled:!E.thinking}),children:"Размышления"}),V.includes("xhigh")&&a.jsx("button",{className:"session-toggle","aria-pressed":E.ultracode,disabled:ke,onClick:()=>s.send({type:"control.set_ultracode",sessionId:n,enabled:!E.ultracode}),children:"Ultracode"}),a.jsx("button",{className:"session-toggle","aria-pressed":E.switchModelsOnFlag,disabled:ke,onClick:()=>s.send({type:"control.set_flag_switch",sessionId:n,enabled:!E.switchModelsOnFlag}),children:"Смена модели по флагу"})]})]}),a.jsxs("nav",{className:"session-pane__tools","aria-label":`Инструменты: ${ln(E)}`,children:[[["files","Файлы"],["search","Поиск"],["git","Git"],["tasks","Ветки задачи"]].map(([be,Ge])=>a.jsx("button",{title:be==="files"?"Файлы проекта":Ge,onClick:()=>m(E,be),disabled:he||je,children:Ge},be)),h&&a.jsx("button",{onClick:()=>m(E,"terminal"),disabled:he||je,children:"Терминал"}),E.provider==="claude"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>m(E,"extensions"),disabled:he||je,children:"Расширения"}),a.jsx("button",{onClick:()=>m(E,"ask"),disabled:he||je,children:"Вопрос на полях"})]}),E.provider!=="antigravity"&&a.jsx("button",{disabled:ke,onClick:()=>s.launchSession(E.workspaceId,E.provider,Gt(E),!0),children:"Ответвить"}),a.jsx("button",{title:"Обновить лимиты и контекст",disabled:!c||he||je,onClick:()=>{s.send({type:"usage.get",sessionId:n}),s.send({type:"context.get",sessionId:n})},children:"↻"}),a.jsx(hN,{usage:s.usage[n]??null})]}),a.jsx(jN,{tokens:((de=s.context[n])==null?void 0:de.tokens)??I.contextTokens,maxTokens:((_e=s.context[n])==null?void 0:_e.maxTokens)??null,fetchedAt:((Ae=s.context[n])==null?void 0:Ae.fetchedAt)??null}),S??a.jsxs(a.Fragment,{children:[a.jsx(lk,{session:E,items:[...H,...I.items],pendingCount:I.pending.length}),a.jsx(um,{items:I.items,busy:O,waiting:W,sessionId:n,history:H,historyHasMore:U_(X),historyLoading:X.loading,onLoadHistory:()=>s.loadHistory(n,$p(X)),welcome:!he&&!je?a.jsx(kN,{connected:c,workspaceName:we==null?void 0:we.name,hasSession:!0,onOpenWorkspace:()=>m(E,"files"),onNewSession:()=>s.launchSession(E.workspaceId,E.provider),onOpenFiles:()=>m(E,"files"),onOpenSettings:()=>m(E,"settings")}):void 0,empty:he?"Разговор сохранён. Продолжите сессию, чтобы восстановить историю и настройки.":void 0,onEditMessage:E.provider==="antigravity"?void 0:(be,Ge,lt)=>{if(!c||u||he||je)return!1;const Mt=()=>s.send({type:"prompt.edit",sessionId:n,userIndex:be,text:Ge,images:lt});return y?y(E,Mt):(Mt(),!0)}}),(ze=E.tasks)!=null&&ze.length?a.jsx(y1,{tasks:E.tasks,onStop:be=>s.send({type:"task.stop",sessionId:n,taskId:be})}):null,W&&a.jsxs("button",{className:"session-pane__decision",onClick:()=>G(!0),children:["Нужен ваш ответ · запросов: ",I.pending.length,a.jsx("span",{children:"Рассмотреть →"})]}),he||je?a.jsxs("div",{className:"session-pane__resume",children:[a.jsx("p",{children:he?"Разговор сохранён на диске.":"Связь с CLI прервана."}),a.jsx("button",{className:"btn btn--primary",disabled:!c||s.launchingIds.includes(n),onClick:()=>s.launchSession(E.workspaceId,E.provider,Gt(E),!1,n),children:s.launchingIds.includes(n)?"Восстанавливается…":"Продолжить сессию"})]}):a.jsx(Ey,{className:"composer--session",suspended:o||s.view!==null||q&&W,disabled:!c,busy:O,commands:(B==null?void 0:B.commands)??[],showAllCommands:E.provider==="codex",sessionTitle:E.title,contextResult:s.contexts[n]??null,draftKey:n,sendBlocked:u,placeholder:E.state==="reconnecting"?"Сообщение отправится после восстановления связи":"Сообщение в эту сессию…",onContextSearch:be=>s.searchSession(n,be),onCommand:be=>be==="fork"?(s.launchSession(E.workspaceId,E.provider,Gt(E),!0),!0):be==="new"||be==="clear"?(s.launchSession(E.workspaceId,E.provider),!0):be==="resume"?(s.setView("command"),!0):be==="stop"?(s.send({type:"control.interrupt",sessionId:n}),!0):be==="exit"||be==="quit"?(g(E),!0):(v==null?void 0:v(E,be))??!1,onEscape:()=>{O&&!W&&s.send({type:"control.interrupt",sessionId:n})},onSend:(be,Ge)=>{if(!c||u)return!1;const lt=()=>s.send({type:"prompt.send",sessionId:n,text:be,images:Ge});return y?y(E,lt):(lt(),!0)},onInterrupt:()=>s.send({type:"control.interrupt",sessionId:n})})]}),D,k,!o&&q&&W&&Nu.createPortal(a.jsx(ky,{hub:s,sessionId:n,onClose:()=>G(!1)}),document.body)]})}const fm=()=>({version:1,root:null,floating:[],focused:null,maximized:null,preset:"tabs"}),Su=n=>({type:"tabs",id:crypto.randomUUID(),tabs:n,active:n[0]}),Hp=(n,s,i,c=.5)=>({type:"split",id:crypto.randomUUID(),axis:i,ratio:c,first:n,second:s});function Fn(n){return n?n.type==="tabs"?[n]:[...Fn(n.first),...Fn(n.second)]:[]}function Wa(n){return[...Fn(n.root),...n.floating.map(s=>s.group)].flatMap(s=>s.tabs)}function Eu(n,s){return n?s(n.type==="tabs"?n:{...n,first:Eu(n.first,s),second:Eu(n.second,s)}):null}function pf(n,s){if(!n)return null;if(n.type==="tabs"){const o=n.tabs.filter(u=>s.has(u));return o.length?{...n,tabs:o,active:o.includes(n.active)?n.active:o[0]}:null}const i=pf(n.first,s),c=pf(n.second,s);return i&&c?{...n,first:i,second:c}:i??c}function Ry(n,s,i,c){if(!n)return Su([i]);if(n.id===s){if(c==="center"&&n.type==="tabs")return{...n,tabs:[...n.tabs,i],active:i};const u=Su([i]);return c==="left"||c==="top"?Hp(u,n,c==="left"?"row":"column"):Hp(n,u,c==="bottom"?"column":"row")}if(n.type==="split")return{...n,first:o(n.first),second:o(n.second)};return n;function o(u){return Fn(u).some(h=>h.id===s)?Ry(u,s,i,c):u}}function vu(n,s){var g,x;const i=(g=[...Fn(n.root),...n.floating.map(_=>_.group)].find(_=>_.tabs.includes(s)))==null?void 0:g.id,c=new Set(Wa(n).filter(_=>_!==s)),o=n.floating.flatMap(_=>{const v=pf(_.group,c);return(v==null?void 0:v.type)==="tabs"?[{..._,group:v}]:[]}),u=pf(n.root,c),h=[...Fn(u),...o.map(_=>_.group)],m=n.focused===s?((x=h.find(_=>_.id===i)??h[0])==null?void 0:x.active)??null:n.focused;return{...n,root:u,floating:o,focused:m,maximized:n.maximized&&[...Fn(u),...o.map(_=>_.group)].some(_=>_.id===n.maximized)?n.maximized:null}}function Tu(n,s){if(!Wa(n).includes(s))return n;const i=m=>m.type==="tabs"&&m.tabs.includes(s)?{...m,active:s}:m,c=Math.max(0,...n.floating.map(m=>m.z))+1,o=[...Fn(n.root),...n.floating.map(m=>m.group)].find(m=>m.tabs.includes(s)),u=new Set(Fn(n.root).map(m=>m.id)),h=n.maximized&&u.has(n.maximized)&&o&&u.has(o.id)?o.id:n.maximized;return{...n,focused:s,maximized:h,root:Eu(n.root,i),floating:n.floating.map(m=>m.group.tabs.includes(s)?{...m,group:i(m.group),z:c}:m)}}function mf(n,s,i,c){var g;const o=[...Fn(n.root),...n.floating.map(x=>x.group)].find(x=>x.tabs.includes(s));if((o==null?void 0:o.id)===i&&o.tabs.length===1||(o==null?void 0:o.id)===i&&c==="center")return Tu(n,s);const u=vu(n,s),h=u.floating.find(x=>x.group.id===i);if(h&&c==="center")return{...u,focused:s,floating:u.floating.map(x=>x===h?{...x,group:{...x.group,tabs:[...x.group.tabs,s],active:s}}:x)};const m=Fn(u.root).some(x=>x.id===i)?i:((g=Fn(u.root).at(-1))==null?void 0:g.id)??null;return{...u,root:Ry(u.root,m,s,c),focused:s,maximized:null}}function yp(n,s,i=!1){if(Wa(n).includes(s)){const u=[...Fn(n.root),...n.floating.map(h=>h.group)].find(h=>h.tabs.includes(s));return i&&u&&u.tabs.length>1?mf(n,s,u.id,"right"):Tu(n,s)}const c=[...Fn(n.root),...n.floating.map(u=>u.group)],o=c.find(u=>u.tabs.includes(n.focused??""))??c[0];return mf(n,s,(o==null?void 0:o.id)??null,i?"right":"center")}function Dy(n,s,i=40,c=30){const o=vu(n,s);return{...o,focused:s,maximized:null,floating:[...o.floating,{group:Su([s]),x:i,y:c,width:580,height:560,z:Math.max(0,...o.floating.map(u=>u.z))+1}]}}function SN(n,s){const i=[...new Set(n)],c={...fm(),preset:s,focused:i[0]??null};if(!i.length)return c;if(s==="floating")return{...i.reduce((g,x,_)=>Dy(g,x,24+_%4*34,20+_%4*30),c),preset:s};if(s==="tabs")return{...c,root:Su(i)};const o=(g,x)=>g.length===1?g[0]:Hp(g[0],o(g.slice(1),x),x,1/g.length),u=i.map(g=>Su([g]));if(s!=="grid")return{...c,root:o(u,s==="columns"?"row":"column")};const h=Math.ceil(Math.sqrt(u.length)),m=[];for(let g=0;g<u.length;g+=h)m.push(o(u.slice(g,g+h),"row"));return{...c,root:o(m,"column")}}function Oy(n){if(!n||typeof n!="object"||!("version"in n)||n.version!==1)return fm();const s=n,i=new Set,c=new Set;function o(x,_=0){if(!x||typeof x!="object"||_>24)return null;const v=x;if(typeof v.id!="string"||c.has(v.id))return null;if(c.add(v.id),v.type==="tabs"&&Array.isArray(v.tabs)){const k=v.tabs.filter(A=>typeof A=="string"&&!i.has(A)&&!!i.add(A));return k.length?{type:"tabs",id:v.id,tabs:k,active:k.includes(v.active??"")?v.active:k[0]}:null}if(v.type!=="split")return null;const y=o(v.first,_+1),S=o(v.second,_+1);return y&&S?{type:"split",id:v.id,axis:v.axis==="column"?"column":"row",ratio:typeof v.ratio=="number"&&Number.isFinite(v.ratio)?Math.max(.1,Math.min(.9,v.ratio)):.5,first:y,second:S}:y??S}const u=o(s.root),h=(x,_,v,y)=>typeof x=="number"&&Number.isFinite(x)?Math.max(v,Math.min(y,x)):_,m=(Array.isArray(s.floating)?s.floating:[]).flatMap(x=>{if(!x||typeof x!="object")return[];const _=o(x.group);return(_==null?void 0:_.type)==="tabs"?[{group:_,x:h(x.x,30,0,5e3),y:h(x.y,30,0,5e3),width:h(x.width,580,280,3e3),height:h(x.height,560,280,2400),z:h(x.z,1,0,1e6)}]:[]}),g=[...Fn(u),...m.map(x=>x.group)].flatMap(x=>x.tabs);return{version:1,root:u,floating:m,focused:g.includes(s.focused??"")?s.focused:g[0]??null,maximized:[...Fn(u),...m.map(x=>x.group)].some(x=>x.id===s.maximized)?s.maximized:null,preset:["tabs","columns","rows","grid","floating","custom"].includes(s.preset??"")?s.preset:"tabs"}}const EN={center:"Объединить во вкладки",left:"Прикрепить слева",right:"Прикрепить справа",top:"Прикрепить сверху",bottom:"Прикрепить снизу"};function TN({controller:n,sessions:s,visibleIds:i,availableIds:c=i,onOpen:o,hidden:u=!1,expanded:h,onToggleExpanded:m,onClose:g,renderSession:x}){const{layout:_}=n,v=b.useRef(null),y=b.useRef(null),[S,k]=b.useState(null),[A,D]=b.useState({width:1e3,height:650}),[q,G]=b.useState(""),[Q,z]=b.useState(!1),$=b.useRef(null),E=b.useRef(null);function I(){$.current&&($.current.open=!1)}b.useEffect(()=>{function M(N){var V;N.target instanceof Node&&!((V=$.current)!=null&&V.contains(N.target))&&I()}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[]),b.useEffect(()=>{u&&(I(),z(!1))},[u]);const X=new Set(i),H=_.focused&&X.has(_.focused)?_.focused:i[0]??null;b.useEffect(()=>{const M=v.current;if(!M)return;const N=new ResizeObserver(()=>D({width:M.clientWidth,height:M.clientHeight}));return N.observe(M),()=>N.disconnect()},[]),b.useEffect(()=>()=>document.body.classList.remove("is-docking"),[]);const B=M=>Fn(M).some(N=>N.tabs.some(V=>X.has(V)));function O(M,N,V){var ke;if(M.button!==0)return;const ae=(ke=M.currentTarget.closest("[data-dock-group]"))==null?void 0:ke.getBoundingClientRect();ae&&(n.activate(N),y.current={id:N,startX:M.clientX,startY:M.clientY,offsetX:M.clientX-ae.x,offsetY:M.clientY-ae.y,floating:V,moved:!1,preview:null},M.currentTarget.setPointerCapture(M.pointerId))}function W(M){var C,K;const N=y.current,V=(C=v.current)==null?void 0:C.getBoundingClientRect();if(!N||!V||!N.moved&&Math.hypot(M.clientX-N.startX,M.clientY-N.startY)<6)return;N.moved=!0,document.body.classList.add("is-docking");let ae=null;const ke=Array.from(v.current.querySelectorAll("[data-dock-group]")).sort((de,_e)=>Number(_e.classList.contains("dock-group--floating"))-Number(de.classList.contains("dock-group--floating"))||Number(_e.style.zIndex||0)-Number(de.style.zIndex||0));for(const de of ke){if(((K=N.floating)==null?void 0:K.group.id)===de.dataset.dockGroup)continue;const _e=de.getBoundingClientRect();if(!_e.width||!_e.height)continue;const Ae=(M.clientX-_e.x)/_e.width,ze=(M.clientY-_e.y)/_e.height;if(Ae<0||Ae>1||ze<0||ze>1)continue;const be=[{side:"left",value:Ae},{side:"right",value:1-Ae},{side:"top",value:ze},{side:"bottom",value:1-ze}].sort((lt,Mt)=>lt.value-Mt.value),Ge=!de.classList.contains("dock-group--floating")&&be[0].value<.24?be[0].side:"center";ae={groupId:de.dataset.dockGroup,side:Ge,x:_e.x-V.x+(Ge==="right"?_e.width/2:0),y:_e.y-V.y+(Ge==="bottom"?_e.height/2:0),width:Ge==="left"||Ge==="right"?_e.width/2:_e.width,height:Ge==="top"||Ge==="bottom"?_e.height/2:_e.height};break}N.preview=ae,k(ae),N.floating&&!ae&&n.updateFloating(N.floating.group.id,{x:Math.max(0,Math.min(A.width-100,M.clientX-V.x-N.offsetX)),y:Math.max(0,Math.min(A.height-40,M.clientY-V.y-N.offsetY))})}function he(M,N=!1){const V=y.current;if(y.current=null,k(null),document.body.classList.remove("is-docking"),M.currentTarget.hasPointerCapture(M.pointerId)&&M.currentTarget.releasePointerCapture(M.pointerId),!(!(V!=null&&V.moved)||N)){if(V.preview)n.move(V.id,V.preview.groupId,V.preview.side);else if(!V.floating){const ae=v.current.getBoundingClientRect();n.float(V.id,Math.max(0,M.clientX-ae.x-120),Math.max(0,M.clientY-ae.y-15))}}}function je(M,N){const V=M.tabs.filter(C=>X.has(C));if(!V.length)return null;const ae=V.includes(M.active)?M.active:V[0],ke=_.maximized===M.id;return a.jsxs("section",{"data-dock-group":M.id,"data-active-session":ae,"data-selected":V.includes(H??""),className:"dock-group"+(N?" dock-group--floating":"")+(ke?" dock-group--maximized":""),style:N&&!ke?{left:Math.min(N.x,Math.max(0,A.width-Math.min(N.width,A.width))),top:Math.min(N.y,Math.max(0,A.height-Math.min(N.height,A.height))),width:Math.min(N.width,A.width),height:Math.min(N.height,A.height),zIndex:10+N.z}:void 0,onPointerDownCapture:()=>{H!==ae&&n.activate(ae)},children:[a.jsxs("div",{className:"dock-group__head",onDoubleClick:C=>{C.target.closest("[data-window-action]")||n.maximize(M.id)},children:[N&&a.jsx(MN,{window:N,bounds:A,onMove:n.updateFloating}),a.jsx("div",{className:"dock-tabs",role:"tablist","aria-label":"Сессии группы",children:V.map(C=>a.jsxs("div",{className:"dock-tab"+(C===ae?" is-active":""),children:[a.jsxs("button",{role:"tab","aria-selected":C===ae,"aria-controls":`session-panel-${C}`,"data-drag-session":C,title:`${ln(s[C])} · ${Gr(s[C])}. Перетащите для стыковки.`,onClick:()=>n.activate(C),onPointerDown:K=>O(K,C,N),onPointerMove:W,onPointerUp:he,onPointerCancel:K=>he(K,!0),onLostPointerCapture:K=>{y.current&&he(K,!0)},onKeyDown:K=>{K.key==="Escape"&&(y.current=null,k(null),document.body.classList.remove("is-docking"))},children:[a.jsx("span",{className:`session-state-dot session-state-dot--${s[C].state}`,"aria-hidden":"true"}),a.jsx("span",{children:ln(s[C])})]}),a.jsx("button",{className:"dock-tab__close","data-window-action":!0,"aria-label":`Закрыть вкладку: ${ln(s[C])}`,onClick:()=>g(C),children:"×"})]},C))}),a.jsxs("div",{className:"dock-group__actions",children:[a.jsx("button",{"data-window-action":!0,className:"dock-action",title:N?"Прикрепить окно":"Сделать плавающим окном","aria-label":N?"Прикрепить окно":"Сделать плавающим окном",onClick:()=>N?n.attachFloating(M.id):n.float(ae),children:"▣"}),a.jsx("button",{"data-window-action":!0,className:"dock-action",title:ke?"Восстановить размер окна":"Развернуть окно","aria-label":ke?"Восстановить размер окна":"Развернуть окно",onClick:()=>n.maximize(M.id),children:ke?"❐":"□"})]})]}),a.jsx("div",{className:"dock-group__body",role:"tabpanel",id:`session-panel-${ae}`,"data-session-id":ae,children:x(ae)}),N&&!ke&&a.jsx(AN,{window:N,bounds:A,onResize:n.updateFloating})]},M.id)}function we(M){return!M||!B(M)?null:M.type==="tabs"?je(M):B(M.first)?B(M.second)?a.jsxs("div",{className:`dock-split dock-split--${M.axis}`,children:[a.jsx("div",{className:"dock-split__child",style:{flexGrow:M.ratio},children:we(M.first)}),a.jsx(CN,{axis:M.axis,ratio:M.ratio,onResize:N=>n.resizeSplit(M.id,N)}),a.jsx("div",{className:"dock-split__child",style:{flexGrow:1-M.ratio},children:we(M.second)})]},M.id):we(M.first):we(M.second)}return a.jsxs("div",{className:"session-workspace",hidden:u,children:[a.jsxs("div",{className:"dock-toolbar","aria-label":"Режим просмотра сессий",children:[a.jsx("span",{children:"Рабочая область"}),a.jsxs("select",{className:"dock-toolbar__layout","aria-label":"Раскладка окон",value:_.preset,onChange:M=>n.arrange(M.target.value),children:[a.jsx("option",{value:"tabs",children:"Вкладки"}),a.jsx("option",{value:"columns",children:"Колонки"}),a.jsx("option",{value:"rows",children:"Строки"}),a.jsx("option",{value:"grid",children:"Сетка"}),a.jsx("option",{value:"floating",children:"Плавающие окна"}),a.jsx("option",{value:"custom",disabled:!0,children:"Своя раскладка"})]}),a.jsxs("select",{className:"dock-toolbar__session","aria-label":"Перейти к открытой сессии",value:H??"",onChange:M=>X.has(M.target.value)?n.activate(M.target.value):o==null?void 0:o(M.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Выберите запущенную сессию"}),c.map(M=>a.jsxs("option",{value:M,children:[ln(s[M]),X.has(M)?"":" · открыть окно"]},M))]}),a.jsxs("details",{className:"dock-layout-menu",ref:$,onKeyDown:M=>{var N,V;M.key==="Escape"&&((N=$.current)!=null&&N.open)&&(M.preventDefault(),M.stopPropagation(),I(),(V=E.current)==null||V.focus())},onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||I()},children:[a.jsx("summary",{ref:E,className:"dock-action","aria-label":"Действия с рабочей областью",title:"Действия с рабочей областью",children:"⋯"}),a.jsxs("div",{className:"dock-layout-menu__content",children:[a.jsx("button",{className:"btn btn--ghost",onClick:()=>{z(!Q),I()},children:"Сохранить раскладку"}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>{var M;n.arrange("grid"),I(),(M=E.current)==null||M.focus()},title:"Разместить открытые сессии без перекрытий",children:"Уместить"}),n.saved.length>0&&a.jsxs("select",{"aria-label":"Сохранённая рабочая область",value:"",onChange:M=>{var N;n.restore(M.target.value),I(),(N=E.current)==null||N.focus()},children:[a.jsx("option",{value:"",disabled:!0,children:"Сохранённые области…"}),n.saved.map(M=>a.jsx("option",{children:M},M))]}),a.jsx("p",{children:"Тяните вкладку к краю окна или в центр группы"})]})]}),a.jsxs("button",{className:"btn btn--ghost dock-toolbar__expand","aria-pressed":h,"aria-label":h?"Вернуть панели":"Развернуть рабочую область на всё окно",title:h?"Вернуть панели (Esc)":"Развернуть рабочую область на всё окно",onClick:()=>{I(),m()},children:[a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:h?"M9 3v6H3m18 0h-6V3M3 15h6v6m6 0v-6h6":"M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5"})}),a.jsx("span",{children:h?"Вернуть панели":"На всё окно"})]})]}),Q&&a.jsxs("form",{className:"dock-save",onKeyDown:M=>{var N;M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),z(!1),(N=E.current)==null||N.focus())},onSubmit:M=>{var N;M.preventDefault(),n.save(q),z(!1),G(""),(N=E.current)==null||N.focus()},children:[a.jsx("input",{className:"hub-input",autoFocus:!0,"aria-label":"Название раскладки",placeholder:"Название рабочей области",value:q,onChange:M=>G(M.target.value)}),a.jsx("button",{className:"btn",disabled:!q.trim(),children:"Сохранить"}),a.jsx("button",{type:"button",className:"btn btn--ghost",onClick:()=>{var M;z(!1),(M=E.current)==null||M.focus()},children:"Отмена"})]}),a.jsxs("div",{className:"conversation-board dock-board",ref:v,"aria-label":"Открытые сессии",children:[a.jsx("div",{className:"dock-docked-layer",hidden:!B(_.root),children:we(_.root)}),a.jsx("div",{className:"dock-floating-layer",children:_.floating.map(M=>je(M.group,M))}),!i.length&&a.jsxs("div",{className:"workspace-board-empty",children:[a.jsx("span",{"aria-hidden":"true",children:"◧"}),a.jsx("strong",{children:"Откройте сессии для работы"}),a.jsx("p",{children:"Обычное открытие добавляет вкладку. «Открыть параллельно» создаёт соседнее окно. Любую вкладку можно открепить и пристыковать обратно."})]}),S&&a.jsx("div",{className:"dock-preview",style:{left:S.x,top:S.y,width:S.width,height:S.height},children:a.jsx("span",{children:EN[S.side]})})]})]})}function CN({axis:n,ratio:s,onResize:i}){const c=b.useRef(null),o=()=>{c.current=null,document.body.classList.remove("is-docking")};return b.useEffect(()=>o,[]),a.jsx("div",{className:`dock-divider dock-divider--${n}`,role:"separator","aria-label":n==="row"?"Ширина окон":"Высота окон","aria-orientation":n==="row"?"vertical":"horizontal","aria-valuenow":Math.round(s*100),"aria-valuemin":10,"aria-valuemax":90,tabIndex:0,onPointerDown:u=>{u.button===0&&(c.current=u.currentTarget.parentElement.getBoundingClientRect(),u.currentTarget.setPointerCapture(u.pointerId),document.body.classList.add("is-docking"),u.preventDefault())},onPointerMove:u=>{const h=c.current;h&&i(n==="row"?(u.clientX-h.x)/h.width:(u.clientY-h.y)/h.height)},onPointerUp:o,onPointerCancel:o,onLostPointerCapture:o,onDoubleClick:()=>i(.5),onKeyDown:u=>{const h=u.key==="ArrowLeft"||u.key==="ArrowUp"?-.025:u.key==="ArrowRight"||u.key==="ArrowDown"?.025:0;h&&(u.preventDefault(),i(s+h))}})}function AN({window:n,bounds:s,onResize:i}){const c=b.useRef(null),o=(u,h)=>i(n.group.id,{width:Math.max(Math.min(280,s.width),Math.min(s.width,u)),height:Math.max(Math.min(260,s.height),Math.min(s.height,h))});return a.jsx("div",{className:"conversation-window__resize",role:"separator","aria-label":"Размер плавающего окна","aria-orientation":"vertical","aria-valuenow":Math.round(n.width),tabIndex:0,onPointerDown:u=>{if(u.button!==0)return;const h=u.currentTarget.parentElement.getBoundingClientRect();c.current={x:u.clientX,y:u.clientY,width:h.width,height:h.height},u.currentTarget.setPointerCapture(u.pointerId),u.preventDefault()},onPointerMove:u=>{const h=c.current;h&&o(h.width+u.clientX-h.x,h.height+u.clientY-h.y)},onPointerUp:()=>{c.current=null},onPointerCancel:()=>{c.current=null},onLostPointerCapture:()=>{c.current=null},onKeyDown:u=>{const h=u.key==="ArrowRight"?24:u.key==="ArrowLeft"?-24:0,m=u.key==="ArrowDown"?24:u.key==="ArrowUp"?-24:0;(h||m)&&(u.preventDefault(),o(n.width+h,n.height+m))},children:a.jsx("span",{"aria-hidden":"true",children:"◢"})})}function MN({window:n,bounds:s,onMove:i}){const c=b.useRef(null),o=(u,h)=>i(n.group.id,{x:Math.max(0,Math.min(s.width-Math.min(n.width,s.width),u)),y:Math.max(0,Math.min(s.height-Math.min(n.height,s.height),h))});return a.jsx("button",{"data-window-action":!0,className:"dock-float-grip",title:"Переместить плавающее окно","aria-label":"Переместить плавающее окно",onPointerDown:u=>{if(u.button!==0)return;const h=u.currentTarget.parentElement.parentElement.getBoundingClientRect(),m=u.currentTarget.closest(".dock-board").getBoundingClientRect();c.current={x:u.clientX,y:u.clientY,left:h.x-m.x,top:h.y-m.y},u.currentTarget.setPointerCapture(u.pointerId),u.preventDefault()},onPointerMove:u=>{const h=c.current;h&&o(h.left+u.clientX-h.x,h.top+u.clientY-h.y)},onPointerUp:()=>{c.current=null},onPointerCancel:()=>{c.current=null},onLostPointerCapture:()=>{c.current=null},onKeyDown:u=>{const h=u.key==="ArrowRight"?24:u.key==="ArrowLeft"?-24:0,m=u.key==="ArrowDown"?24:u.key==="ArrowUp"?-24:0;(h||m)&&(u.preventDefault(),o(n.x+h,n.y+m))},children:"⠿"})}const Ly="ether:dock-layout",RN={};function DN(){try{return Oy(JSON.parse(localStorage.getItem(Ly)??"null"))}catch{return fm()}}function ON(n,s=RN){const[i,c]=b.useState(DN),[o,u]=b.useState(()=>{try{const g=JSON.parse(localStorage.getItem("ether:dock-presets")??"{}");return g&&typeof g=="object"?Object.keys(g):[]}catch{return[]}}),h=n.join("|");b.useEffect(()=>{c(g=>{let x=g;const _=v=>{const y=new Set;let S=v;for(;s[S]&&!y.has(S);)y.add(S),S=s[S];return S};Wa(g).some(v=>_(v)!==v)&&(x={...x,focused:x.focused?_(x.focused):null,root:Eu(x.root,v=>v.type==="tabs"?{...v,tabs:v.tabs.map(_),active:_(v.active)}:v),floating:x.floating.map(v=>({...v,group:{...v.group,tabs:v.group.tabs.map(_),active:_(v.group.active)}}))});for(const v of Wa(x))n.includes(v)||(x=vu(x,v));for(const v of n)Wa(x).includes(v)||(x=yp(x,v,x.preset!=="tabs"));return x})},[h,s]),b.useEffect(()=>{try{localStorage.setItem(Ly,JSON.stringify(i))}catch{}},[i]);const m=b.useCallback((g,x=!1)=>c(_=>({...yp(_,g,x),preset:x?"custom":_.preset})),[]);return{layout:i,saved:o,open:m,activate:g=>c(x=>Tu(x,g)),close:g=>c(x=>vu(x,g)),move:(g,x,_)=>c(v=>({...mf(v,g,x,_),preset:"custom"})),float:(g,x,_)=>c(v=>({...Dy(v,g,x,_),preset:"custom"})),attachFloating:g=>c(x=>{var S,k;const _=x.floating.find(A=>A.group.id===g);if(!_)return x;let v=x,y=((S=Fn(v.root).at(-1))==null?void 0:S.id)??null;for(const[A,D]of _.group.tabs.entries())v=mf(v,D,y,A===0?"right":"center"),y=((k=Fn(v.root).find(q=>q.tabs.includes(D)))==null?void 0:k.id)??null;return v}),resizeSplit:(g,x)=>c(_=>({..._,root:Eu(_.root,v=>v.type==="split"&&v.id===g?{...v,ratio:Math.max(.1,Math.min(.9,x))}:v)})),updateFloating:(g,x)=>c(_=>({..._,floating:_.floating.map(v=>v.group.id===g?{...v,...x}:v)})),maximize:g=>c(x=>({...x,maximized:x.maximized===g?null:g})),arrange:g=>c(x=>{if(g==="custom")return x;const _=SN(Wa(x),g);return x.focused?Tu(_,x.focused):_}),save:g=>{const x=g.trim().slice(0,64);if(x)try{const _=JSON.parse(localStorage.getItem("ether:dock-presets")??"{}");localStorage.setItem("ether:dock-presets",JSON.stringify({..._,[x]:i})),u(Object.keys({..._,[x]:i}))}catch{}},restore:g=>{try{const x=Oy(JSON.parse(localStorage.getItem("ether:dock-presets")??"{}")[g]),_=new Set(n);let v=x;for(const y of Wa(v))_.has(y)||(v=vu(v,y));for(const y of n)Wa(v).includes(y)||(v=yp(v,y,v.preset!=="tabs"));c(v)}catch{}}}}const o_={codex:"Codex",claude:"Claude",antigravity:"Antigravity"};function LN({hub:n,workspaces:s,selectedWorkspaceId:i,providers:c,providerFilter:o,onProviderFilter:u,tab:h,onTab:m,sessionView:g,onSessionView:x,connected:_,status:v,onOpenSession:y,onSelectWorkspace:S,onNewSession:k,onOpenWorkspace:A,onSettings:D,onAccount:q,onRelay:G,onTheme:Q,onPin:z,onManageProject:$}){const[E,I]=b.useState(""),[X,H]=b.useState(!1),B=h==="sessions"&&g==="live",O=s.find(N=>N.id===i),W=N=>o==="all"||N.provider===o,he=n.allSessions.filter(N=>W(N)&&(!i||N.workspaceId===i)),je=he.filter(N=>{var V;return(X?!!N.archivedAt:h==="pinned"||!N.archivedAt)&&(h!=="pinned"||N.pinned)&&`${ln(N)} ${((V=s.find(ae=>ae.id===N.workspaceId))==null?void 0:V.name)??""}`.toLocaleLowerCase().includes(E.toLocaleLowerCase())}),we=s.filter(N=>`${N.name} ${N.path}`.toLocaleLowerCase().includes(E.toLocaleLowerCase())),M=o==="all"?c:c.filter(N=>N===o);return a.jsxs("section",{className:"workspace-library","aria-label":"Рабочее пространство",children:[a.jsxs("header",{className:"workspace-header",children:[a.jsxs("span",{className:"workspace-header__brand",children:[a.jsx("span",{className:"brand__symbol","aria-hidden":"true"}),"ЭФИР"]}),a.jsxs("span",{className:"workspace-header__status",role:"status",children:[a.jsx("span",{className:_?"dot dot--on":"dot"}),_?"Подключено":v]}),a.jsxs("button",{className:"workspace-header__search",onClick:()=>n.setView("command"),children:["Поиск проектов и сессий ",a.jsx("kbd",{children:"Ctrl P"})]}),a.jsxs("div",{className:"workspace-header__actions",children:[a.jsxs("button",{title:"Входящие",onClick:()=>n.setView("inbox"),children:["Входящие",n.attention.filter(W).length>0&&a.jsx("span",{className:"hub-count",children:n.attention.filter(W).length})]}),a.jsx("button",{title:"Аккаунт CLI",onClick:q,children:"Аккаунт"}),a.jsx("button",{title:"Удалённый доступ",onClick:G,children:"Доступ"}),a.jsx("button",{title:"Переключить тему",onClick:Q,children:"◐"}),a.jsx("button",{title:"Настройки приложения",onClick:D,children:"Настройки"})]})]}),a.jsxs("div",{className:"workspace-library__toolbar",children:[a.jsx("nav",{className:"workspace-library__tabs","aria-label":"Разделы рабочего пространства",children:[["projects","Проекты"],["sessions","Сессии"],["pinned","Закрепы"]].map(([N,V])=>a.jsx("button",{"aria-pressed":h===N,onClick:()=>{m(N),I(""),H(!1)},children:V},N))}),a.jsxs("select",{"aria-label":"Фильтр по CLI",value:o,onChange:N=>u(N.target.value),children:[a.jsx("option",{value:"all",children:"Все CLI"}),["codex","claude","antigravity"].map(N=>a.jsx("option",{value:N,children:o_[N]},N))]}),h!=="projects"&&a.jsxs("select",{"aria-label":"Фильтр по проекту",value:i??"",onChange:N=>S(N.target.value),children:[a.jsx("option",{value:"",children:"Все проекты"}),s.map(N=>a.jsx("option",{value:N.id,children:N.name},N.id))]}),a.jsx("span",{className:"workspace-library__spacer"}),a.jsx("button",{className:"btn btn--ghost",disabled:!_,onClick:A,children:"+ Проект"}),O&&a.jsx(hf,{disabled:!_||!M.length,providers:M,onStart:N=>k(O.id,N)})]}),h==="sessions"&&a.jsxs("nav",{className:"session-list-modes","aria-label":"Какие сессии показывать",children:[a.jsxs("button",{"aria-pressed":g==="all",onClick:()=>{x("all"),H(!1)},children:["Все сессии ",a.jsx("span",{children:he.filter(N=>!N.archivedAt).length})]}),a.jsxs("button",{"aria-pressed":g==="live",onClick:()=>{x("live"),H(!1)},children:["Запущенные ",a.jsx("span",{children:he.filter(Ur).length})]})]}),!B&&a.jsxs("div",{className:"workspace-library__browser",children:[a.jsxs("div",{className:"workspace-library__search",children:[a.jsx("input",{className:"hub-input","aria-label":h==="projects"?"Найти проект":"Найти сессию",placeholder:h==="projects"?"Название или путь проекта…":"Название сессии или проекта…",value:E,onChange:N=>I(N.target.value)}),h!=="projects"&&!(h==="sessions"&&g==="live")&&a.jsx("button",{className:"btn btn--ghost","aria-pressed":X,onClick:()=>H(!X),children:"Архив"}),h==="projects"&&a.jsx("button",{className:"btn btn--ghost",onClick:()=>$(null),children:"Папки и архив"}),a.jsx("button",{className:"hub-icon-btn",title:"Обновить",onClick:n.refresh,disabled:!_,children:"↻"})]}),h==="projects"?a.jsxs("div",{className:"workspace-projects",children:[we.map(N=>{const V=n.allSessions.filter(ae=>ae.workspaceId===N.id&&!ae.archivedAt&&W(ae));return a.jsxs("article",{className:"workspace-project",children:[a.jsxs("button",{className:"workspace-project__open",onClick:()=>{S(N.id,!0),m("sessions")},children:[a.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),a.jsx("strong",{children:N.name}),a.jsx("small",{title:N.path,children:N.path}),a.jsxs("span",{children:[V.length," сессий · ",V.filter(Ur).length," запущено"]})]}),a.jsxs("div",{className:"workspace-project__actions",children:[a.jsx(hf,{disabled:!_||!M.length,providers:M,onStart:ae=>k(N.id,ae)}),a.jsx("button",{className:"hub-icon-btn",title:"Папки и управление проектом",onClick:()=>{S(N.id),$(N.id)},children:"⋯"})]})]},N.id)}),!we.length&&a.jsx("p",{className:"hub-muted",children:"Проекты не найдены. Откройте папку проекта или измените фильтр CLI."})]}):a.jsxs("div",{className:"workspace-sessions",children:[je.map(N=>{var V;return a.jsxs("article",{className:`workspace-session workspace-session--${N.state}`,"data-session-state":N.state,children:[a.jsxs("button",{className:"workspace-session__open",onClick:()=>y(N),children:[a.jsxs("span",{className:"hub-eyebrow",children:[o_[N.provider]," · ",(V=s.find(ae=>ae.id===N.workspaceId))==null?void 0:V.name]}),a.jsx("strong",{children:ln(N)}),a.jsxs("small",{children:[a.jsx("span",{className:`session-state-dot session-state-dot--${N.state}`}),Ur(N)?"Запущена":N.state==="closed"?"Сохранена":"Остановлена"," · ",Gr(N)]})]}),a.jsx("button",{className:"workspace-session__pin"+(N.pinned?" is-pinned":""),"aria-label":`${N.pinned?"Открепить":"Закрепить"}: ${ln(N)}`,title:N.pinned?"Открепить":"Закрепить",onClick:()=>z(N),children:"☆"}),a.jsx("button",{className:"hub-icon-btn","aria-label":`Открыть параллельно: ${ln(N)}`,title:"Открыть в параллельном просмотре",onClick:()=>y(N,!0),children:"◧"})]},N.id)}),!je.length&&a.jsx("p",{className:"hub-muted",children:h==="pinned"?"Пока нет закреплённых сессий.":"Сессии не найдены. Создайте разговор или измените фильтры."})]})]}),n.launchingIds.length>0&&a.jsx("p",{className:"workspace-library__loading",role:"status",children:"Открывается разговор…"}),n.error&&a.jsxs("div",{className:"hub-error",role:"alert",children:[n.error,a.jsx("button",{onClick:n.clearError,children:"×"})]})]})}const zN=["low","medium","high"];function zy({models:n,value:s,effort:i,ultracode:c,thinking:o,switchOnFlag:u,showSwitchOnFlag:h=!0,showUltracode:m=!0,showThinking:g=!0,className:x,onModel:_,onEffort:v,onUltracode:y,onThinking:S,onSwitchOnFlag:k}){const[A,D]=b.useState(!1),[q,G]=b.useState(0),Q=b.useRef(null),z=b.useRef(null),$=n.find(B=>B.value===s)??null,E=$&&$.supportsEffort?$.effortLevels.length>0?$.effortLevels:zN:[],I=E.includes("xhigh");b.useEffect(()=>{if(!A)return;const B=n.findIndex(O=>O.value===s);G(B===-1?0:B)},[A]),b.useEffect(()=>{if(!A)return;function B(O){var W;(W=Q.current)!=null&&W.contains(O.target)||D(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[A]),b.useEffect(()=>{var B,O;A&&((O=(B=z.current)==null?void 0:B.querySelector(".is-cursor"))==null||O.scrollIntoView({block:"nearest"}))},[A,q]);function X(B){D(!1),B.value!==s&&_(B.value)}function H(B){if(B.key==="Escape"){if(!A)return;B.preventDefault(),B.stopPropagation(),D(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!A)return D(!0);if(n.length===0)return;const O=B.key==="ArrowDown"?1:n.length-1;return G(W=>(W+O)%n.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!A)return D(!0);const O=n[q];O&&X(O)}}return a.jsxs("div",{ref:Q,className:"select"+(A?" select--open":"")+(x?` ${x}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":A,onClick:()=>D(B=>!B),onKeyDown:H,children:[($==null?void 0:$.displayName)??s?a.jsx("span",{className:"select__value",children:($==null?void 0:$.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):E.length>0&&i&&a.jsx("span",{className:"select__suffix",children:i}),a.jsx(IN,{})]}),A&&a.jsxs("div",{ref:z,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((B,O)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":B.value===s,className:"select__option"+(O===q?" is-cursor":"")+(B.value===s?" is-on":""),onMouseEnter:()=>G(O),onClick:()=>X(B),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:B.displayName}),B.description&&a.jsx("span",{className:"select__hint",children:B.description})]},B.value)),E.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"modelmenu__sep",role:"separator"}),a.jsxs("div",{className:"modelmenu__row",children:[a.jsxs("span",{className:"modelmenu__label",children:["Усилие",a.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),a.jsx("span",{className:"modelmenu__levels",children:E.map(B=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":B===i,className:B===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>v(B),children:B},B))})]}),I&&m&&a.jsx(vp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),g&&($==null?void 0:$.supportsThinking)!==!1&&a.jsx(vp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>S(!o)}),h&&a.jsx(vp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:u,onToggle:()=>k(!u)})]})]})}function vp({label:n,desc:s,on:i,onToggle:c}){return a.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[a.jsxs("span",{className:"modelmenu__label",children:[n,a.jsx("span",{className:"modelmenu__desc",children:s})]}),a.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function IN(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function UN({candidates:n,searching:s,agentItems:i,agentBusy:c,error:o,roots:u,created:h,onSearch:m,onAskAgent:g,onInterrupt:x,onSubmit:_,onCreate:v,onClose:y}){const[S,k]=b.useState("open"),[A,D]=b.useState(""),[q,G]=b.useState(!1),[Q,z]=b.useState(""),[$,E]=b.useState(""),[I,X]=b.useState({git:!0,claudeMd:!0,agentsMd:!0,readme:!0}),H=A.trim(),B=H!=="",O=Q.trim(),W=$.trim(),he=O!==""&&W!=="";b.useEffect(()=>{Q===""&&u.length>0&&z(u[0])},[u]);const je=b.useRef(m);je.current=m,b.useEffect(()=>{if(S!=="open")return;const V=A.trim(),ae=setTimeout(()=>je.current(V),200);return()=>clearTimeout(ae)},[A,S]);function we(){B&&_(H)}function M(){he&&v(O,W,I)}function N(){B&&(G(!0),g(H))}return h?a.jsxs(ps,{title:"Новый проект",onClose:y,actions:a.jsx("button",{className:"btn btn--primary",onClick:y,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:h.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(V=>a.jsx("li",{children:V},V))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(ps,{title:"Новый проект",className:q&&S==="open"?"modal--wide":void 0,onClose:y,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:y,children:"Отмена"}),S==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!B,onClick:N,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!B,onClick:we,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!he,onClick:M,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(u_,{label:"Открыть",on:S==="open",onClick:()=>k("open")}),a.jsx(u_,{label:"Создать",on:S==="create",onClick:()=>k("create")})]}),S==="open"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),a.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),a.jsx("input",{id:"workspace-path",className:"input input--mono",value:A,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:V=>D(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),we())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(V=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:V.open,title:V.open?"Этот проект уже открыт":V.path,onClick:()=>D(V.path),onDoubleClick:()=>_(V.path),children:[a.jsx("span",{className:"find__name",children:V.name}),a.jsx("span",{className:"find__path",children:V.path}),a.jsx("span",{className:"find__note",children:qN(V)})]})},V.path))}),n.length===0&&B&&!s&&!q&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),q&&a.jsx("div",{className:"finds__agent",children:a.jsx(um,{items:i,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),a.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),a.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Q,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:V=>z(V.target.value)}),u.length>0&&a.jsx("div",{className:"newproj__roots",children:u.map(V=>a.jsx("button",{type:"button",className:V===O?"newproj__root is-on":"newproj__root",title:V,onClick:()=>z(V),children:BN(V)},V))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:$,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:V=>E(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),M())}}),a.jsx("p",{className:"newproj__preview",children:he?HN(O,W):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(Qd,{label:"AGENTS.md",desc:"инструкции проекта для Codex",on:I.agentsMd??!1,onToggle:()=>X(V=>({...V,agentsMd:!V.agentsMd}))}),a.jsx(Qd,{label:"git init",desc:"панель истории работает сразу",on:I.git,onToggle:()=>X(V=>({...V,git:!V.git}))}),a.jsx(Qd,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:I.claudeMd,onToggle:()=>X(V=>({...V,claudeMd:!V.claudeMd}))}),a.jsx(Qd,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:I.readme,onToggle:()=>X(V=>({...V,readme:!V.readme}))})]})]})]})}function u_({label:n,on:s,onClick:i}){return a.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:i,children:n})}function Qd({label:n,desc:s,on:i,onToggle:c}){return a.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:c,children:[a.jsxs("span",{className:"newproj__optlabel",children:[n,a.jsx("span",{className:"newproj__optdesc",children:s})]}),a.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function HN(n,s){const i=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+i+s}function BN(n){const s=n.includes("\\")?"\\":"/",i=n.split(/[\\/]/).filter(Boolean);return i.length<=2?n:`…${s}${i.slice(-2).join(s)}`}function qN(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${GN(n.sessions)}${$N(n.lastUsedAt)}`}function GN(n){const s=n%10,i=n%100;return i>=11&&i<=14?`${n} сессий`:s===1?`${n} сессия`:s>=2&&s<=4?`${n} сессии`:`${n} сессий`}function $N(n){if(!n)return"";const s=Math.floor((Date.now()-n)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const hm=7;function YN(n){const s=[],i=[];let c=1;for(const o of n){const u=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=d_(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const y of g){let S=s.indexOf(y);S===-1&&(S=d_(s),s[S]=y),x.push({from:h,to:S})}const _=[];for(let y=0;y<u.length;y++)u[y]===o.hash&&(_.push({from:y,to:h}),y!==h&&(s[y]=null));const v=[];for(let y=0;y<u.length;y++){const S=u[y];!S||S===o.hash||y===h||s[y]===S&&v.push(y)}VN(s),c=Math.max(c,s.length,h+1),i.push({commit:o,col:h,up:_,down:x,through:v})}return{rows:i,columns:Math.min(c,hm)}}function d_(n){const s=n.indexOf(null);return s!==-1?s:(n.push(null),n.length-1)}function VN(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const Iy=1500;function XN(n){const s=[];let i=!1;for(const c of n.patch.split(`
131
+ `)){if(s.length>=Iy){i=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:QN(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:s,added:n.added,removed:n.removed,note:KN(n,i)}}function QN(n){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!s)return n;const i=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),u=c>1?`строки ${i}–${i+c-1}`:`строка ${i}`;return o?`⋯ ${u} · ${o}`:`⋯ ${u}`}function KN(n,s){const i=[];return n.status==="added"&&i.push("новый файл"),n.status==="deleted"&&i.push("файл удалён"),n.status==="renamed"&&i.push(`переименован из ${n.oldPath}`),n.binary?i.push("двоичный файл"):n.patch===""&&i.push("содержимое не показано"),s&&i.push(`показаны первые ${Iy} строк`),i.length>0?i.join(" · "):null}function ZN({open:n,state:s,result:i,selected:c,busy:o,onRefresh:u,onShow:h,onCheckout:m,onPush:g,onPull:x,onPublish:_,onConnectRemote:v,onDismissResult:y,onClose:S,zoomed:k,onToggleZoom:A}){const D=YN((s==null?void 0:s.commits)??[]),q=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(G=>({value:G.name,label:G.name,hint:G.hash.slice(0,8)}))];return a.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:G=>{A&&(G.target.closest("button")||A())},children:[a.jsx(tS,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:u,children:"↻"}),A&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:A,children:a.jsx(eo,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:S,children:"✕"})]}),s===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Fl,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:q,onChange:G=>{G&&m(G,`ветку ${G}`)}}),a.jsx(Jc,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.detached&&a.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),a.jsx("div",{className:"gitbar__actions",children:o?a.jsxs("p",{className:"gitbar__busy",children:[a.jsx(aS,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(nS,{}),"Отправить",s.ahead>0&&a.jsx("span",{className:"gitbar__count",children:s.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[a.jsx(sS,{}),"Забрать",s.behind>0&&a.jsx("span",{className:"gitbar__count",children:s.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:a.jsx(lS,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:v,children:"уже есть репозиторий"})]})}),a.jsxs("div",{className:"sidepane__scroll",children:[a.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:a.jsxs("span",{className:"gitrow__body",children:[a.jsx("span",{className:"gitrow__subject",children:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${oS(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(G=>cS(G.path)).join(", "):"незакоммиченных изменений нет"})]})}),D.rows.map(G=>a.jsx(PN,{row:G,columns:D.columns,head:G.commit.hash===s.head,local:s.hasRemote&&!G.commit.pushed,active:c===G.commit.hash,onOpen:()=>h(G.commit.hash)},G.commit.hash)),D.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(qr,{result:i,onDismiss:y})]})}const du=50,f_=13,FN=500;function PN({row:n,columns:s,head:i,local:c,active:o,onOpen:u}){const{commit:h}=n,m=h.refs.map(iS).filter(Boolean),[g,x]=b.useState(null),_=b.useRef(null);function v(A){const D=A.touches[0];if(!D)return;const q={timer:0,x:D.clientX,y:D.clientY,fired:!1};q.timer=window.setTimeout(()=>{q.fired=!0,x({x:q.x,y:q.y})},FN),_.current=q}function y(A){const D=_.current,q=A.touches[0];!D||!q||Math.hypot(q.clientX-D.x,q.clientY-D.y)>10&&(window.clearTimeout(D.timer),_.current=null)}function S(A){const D=_.current;D&&(window.clearTimeout(D.timer),D.fired&&A.preventDefault())}function k(){const A=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void ti(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void ti(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void ti(h.subject)}],D=new Set;for(const q of h.refs){const G=q.startsWith("tag: "),Q=rS(q);!Q||D.has(Q)||(D.add(Q),A.push({id:`ref:${Q}`,label:G?"Копировать тег":"Копировать ветку",hint:Q,onSelect:()=>void ti(Q)}))}return A}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var A;if((A=_.current)!=null&&A.fired){_.current=null;return}u()},onContextMenu:A=>{A.preventDefault(),x({x:A.clientX,y:A.clientY})},onTouchStart:v,onTouchMove:y,onTouchEnd:S,onTouchCancel:S,children:[a.jsx(JN,{row:n,columns:s,head:i,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(A=>a.jsx("span",{className:"gitrow__ref",children:A},A)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",uS(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(Qi,{x:g.x,y:g.y,items:k(),onClose:()=>x(null)})]})}function JN({row:n,columns:s,head:i,local:c}){const o=s*f_+6,u=du/2,h=x=>8+Math.min(x,hm-1)*f_,m=c?"3.5 2.5":void 0,g=Kd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:du,viewBox:`0 0 ${o} ${du}`,"aria-hidden":"true",children:[n.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:du,style:{stroke:Kd(x)}},`t${x}`)),n.up.map((x,_)=>a.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${u-12} L${h(x.to)} ${u}`,fill:"none",style:{stroke:Kd(x.from),strokeDasharray:m}},`u${_}`)),n.down.map((x,_)=>a.jsx("path",{d:`M${h(x.from)} ${u} L${h(x.to)} ${u+12} L${h(x.to)} ${du}`,fill:"none",style:{stroke:Kd(x.to),strokeDasharray:m}},`d${_}`)),i&&a.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:u,r:n.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:u,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Kd(n){return`var(--lane-${n%hm})`}function WN({detail:n,local:s,onCheckout:i,onClose:c}){const o=n.hash==="";return a.jsxs(ps,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>i(n.hash,`коммит ${n.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),a.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&a.jsxs("div",{className:"commit__head",children:[a.jsxs("div",{className:"commit__line",children:[a.jsx("p",{className:"commit__subject",children:n.subject}),a.jsx(Jc,{text:n.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",dS(n.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:n.hash}),a.jsx(Jc,{text:n.hash,hint:"хеш коммита"})]}),s&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),n.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[n.parents.length>1?"слияние: ":"родитель: ",n.parents.map(u=>u.slice(0,8)).join(", ")]}),n.body&&a.jsx("pre",{className:"commit__body",children:n.body})]}),n.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),n.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):n.files.map(u=>a.jsx(eS,{file:u,defaultOpen:n.files.length<=3},u.path+u.oldPath))]})}function eS({file:n,defaultOpen:s}){const[i,c]=b.useState(s);return a.jsxs("div",{className:"commit__file",children:[a.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[a.jsx("span",{className:"commit__filepath",children:n.path||n.oldPath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]}),a.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&a.jsx(cm,{diff:XN(n)})]})}function tS(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),a.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),a.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),a.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function nS(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function sS(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function lS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"m13 13-2.6-2.6"})]})}function h_(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function aS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function iS(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function rS(n){const s=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function cS(n){const s=n.split("/");return s[s.length-1]??n}function oS(n){const s=n%100;if(s>=11&&s<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function uS(n){const s=Date.parse(n);if(Number.isNaN(s))return n;const i=Math.round((Date.now()-s)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const c=Math.round(i/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(s).toLocaleDateString()}function dS(n){const s=Date.parse(n);return Number.isNaN(s)?n:new Date(s).toLocaleString()}function p_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function fS({status:n,owners:s,files:i,defaultName:c,hasCommits:o,busy:u,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:x,onDismissResult:_,onClose:v}){var V;const[y,S]=b.useState(()=>p_(c)),[k,A]=b.useState(""),[D,q]=b.useState(""),[G,Q]=b.useState(!0),[z,$]=b.useState("Первый коммит"),[E,I]=b.useState(null),[X,H]=b.useState("");b.useEffect(()=>{!k&&s.length>0&&A(s[0].login)},[k,s]),b.useEffect(()=>{i&&E===null&&I(new Set(i.files))},[i,E]);const B=(n==null?void 0:n.connected)===!0,O=s.map(ae=>({value:ae.login,label:ae.login,hint:ae.kind==="org"?"организация":void 0})),W=b.useMemo(()=>{if(!i)return[];const ae=X.trim().toLowerCase();return ae?i.files.filter(ke=>ke.toLowerCase().includes(ae)):i.files},[i,X]),he=(E==null?void 0:E.size)??0,je=B&&y.trim()!==""&&k!==""&&u===""&&(o||he>0);function we(ae){I(ke=>{const C=new Set(ke??[]);return C.has(ae)?C.delete(ae):C.add(ae),C})}function M(ae){I(ke=>{const C=new Set(ke??[]);for(const K of W)ae?C.add(K):C.delete(K);return C})}function N(){if(!je)return;const ae=(i==null?void 0:i.files)??[];x({owner:k,name:y.trim(),description:D.trim(),private:G,include:o?[]:ae.filter(ke=>E==null?void 0:E.has(ke)),ignore:o?[]:ae.filter(ke=>!(E!=null&&E.has(ke))),message:o?"":z.trim()||"Первый коммит"})}return a.jsxs(ps,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:v,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!je,onClick:N,children:u||"Опубликовать"})]}),children:[a.jsx(hS,{status:n,onRefreshStatus:m,onSaveToken:g}),a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Имя"}),a.jsx("input",{className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",onChange:ae=>S(p_(ae.target.value))})]}),y.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),s.length>1?a.jsx(Fl,{className:"settings__select",value:k,options:O,onChange:A,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((V=s[0])==null?void 0:V.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:D,placeholder:"о чём проект — одной строкой",onChange:ae=>q(ae.target.value)})]}),a.jsxs("div",{className:"field publish__field",children:[a.jsx("span",{children:"Видимость"}),a.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[a.jsx(m_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:G,onClick:()=>Q(!0)}),a.jsx(m_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!G,onClick:()=>Q(!1)})]})]})]}),!o&&a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),i===null?a.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"publish__filehead",children:[a.jsxs("span",{className:"publish__filecount",children:[he," из ",i.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>M(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>M(!1),children:"Снять все"})]}),i.files.length>8&&a.jsx("input",{className:"input publish__filter",value:X,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:ae=>H(ae.target.value)}),a.jsx("div",{className:"publish__filelist",children:W.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):W.map(ae=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(E==null?void 0:E.has(ae))===!0,className:"publish__file",onClick:()=>we(ae),children:[a.jsx("span",{className:"publish__box"+(E!=null&&E.has(ae)?" is-on":""),"aria-hidden":"true",children:(E==null?void 0:E.has(ae))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:ae})]},ae))}),i.truncated&&a.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Сообщение коммита"}),a.jsx("input",{className:"input",value:z,onChange:ae=>$(ae.target.value)})]})]})]}),a.jsx(qr,{result:h,onDismiss:_})]})}function m_({title:n,desc:s,on:i,risky:c,onClick:o}){return a.jsxs("button",{type:"button",role:"radio","aria-checked":i,className:"access__card"+(i?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[n,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:s})]})]})}function hS({status:n,onRefreshStatus:s,onSaveToken:i}){const[c,o]=b.useState(""),[u,h]=b.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),n===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):n.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:n.login}),a.jsx("span",{className:"publish__accountvia",children:n.source==="gh"?"через GitHub CLI":"по личному токену"}),n.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>i(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[n.ghInstalled&&a.jsxs("p",{className:"modal__text",children:["В системе установлен ",a.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",a.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Личный токен GitHub"}),a.jsx(pS,{value:c,onChange:o,visible:u,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),a.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",a.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",a.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),n.message&&a.jsx("p",{className:"modal__error",children:n.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>i(c.trim()),children:"Сохранить токен"})]})]})]})}function pS({value:n,onChange:s,visible:i,onToggleVisible:c,placeholder:o,autoFocus:u}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:i?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:u,onChange:h=>s(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":i?"Скрыть токен":"Показать токен","aria-pressed":i,onClick:c,children:i?a.jsx(gS,{}):a.jsx(mS,{})})]})}function mS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function gS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),a.jsx("path",{d:"M2 14 14 2"})]})}function xS({busy:n,result:s,onSubmit:i,onDismissResult:c,onClose:o}){const[u,h]=b.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(u.trim())||/^[\w.-]+@[\w.-]+:.+/.test(u.trim());return a.jsxs(ps,{title:"Подключить существующий репозиторий",onClose:o,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||n!=="",onClick:()=>i(u.trim()),children:n||"Подключить"})]}),children:[a.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",a.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Адрес репозитория"}),a.jsx("input",{className:"input input--mono",value:u,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&n===""&&i(u.trim())}})]}),a.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",a.jsx("code",{children:"https://…"}),", ",a.jsx("code",{children:"ssh://…"}),", ",a.jsx("code",{children:"git://…"})," и"," ",a.jsx("code",{children:"git@host:path"}),"."]}),a.jsx(qr,{result:s,onDismiss:c})]})}function bS({open:n,items:s,busy:i,ready:c,sendBlocked:o,commands:u,contextResult:h,draftKey:m,models:g,model:x,effort:_,ultracode:v,thinking:y,switchOnFlag:S,onContextSearch:k,onCommand:A,onModel:D,onEffort:q,onUltracode:G,onThinking:Q,onSwitchOnFlag:z,onAsk:$,onInterrupt:E,onReset:I,onClose:X,zoomed:H,onToggleZoom:B}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(H?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:O=>{B&&(O.target.closest("button")||B())},children:[a.jsx(_S,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:I,children:"↻"}),B&&a.jsx("button",{className:"sidepane__btn",title:H?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":H?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":H,onClick:B,children:a.jsx(eo,{active:H})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:X,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(zy,{className:"select--compact",models:g,value:x,effort:_,ultracode:v,thinking:y,switchOnFlag:S,onModel:D,onEffort:q,onUltracode:G,onThinking:Q,onSwitchOnFlag:z}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(um,{items:s,busy:i,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Ey,{className:"composer--side",disabled:!c,busy:i,commands:u,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:A,onSend:$,onInterrupt:E,onEscape:i?E:X})]})}function _S(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function yS({tab:n,servers:s,plugins:i,marketplaces:c,catalog:o,result:u,auth:h,remote:m,actions:g,onTab:x,onClose:_}){const v=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:i.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(ps,{title:"Расширения",className:"modal--wide",onClose:_,children:[a.jsx("div",{className:"tabs",role:"tablist",children:v.map(y=>a.jsxs("button",{role:"tab","aria-selected":n===y.id,className:n===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>x(y.id),children:[y.label,a.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),n==="mcp"&&a.jsx(vS,{servers:s,auth:h,remote:m,actions:g}),n==="plugins"&&a.jsx(ES,{plugins:i,marketplaces:c,actions:g}),n==="catalog"&&a.jsx(TS,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(qr,{result:u})]})}function vS({servers:n,auth:s,remote:i,actions:c}){const[o,u]=b.useState(!1);return a.jsxs(a.Fragment,{children:[n.length===0&&!o&&a.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",a.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",a.jsx("code",{children:"claude mcp list"}),"."]}),a.jsx("ul",{className:"extlist",children:n.map(h=>{const m=(s==null?void 0:s.name)===h.name?s:null,g=m!==null&&m.active&&m.url==="",x=m!==null&&m.active&&m.url!=="";return a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:h.name}),a.jsx("span",{className:`chip chip--${kS(h.status)}`,children:wS[h.status]}),h.scope&&a.jsx("span",{className:"chip",children:h.scope}),h.transport&&a.jsx("span",{className:"chip",children:h.transport})]}),h.target&&a.jsx("div",{className:"extlist__meta",title:h.target,children:h.target}),h.error&&a.jsx("div",{className:"extlist__error",children:h.error}),h.tools.length>0&&a.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",h.tools.length," · ",h.tools.slice(0,6).join(", "),h.tools.length>6&&"…"]}),a.jsxs("div",{className:"extlist__actions",children:[h.status==="needs-auth"&&a.jsx("button",{className:x?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":x?"Начать заново":"Авторизовать"}),a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"reconnect"),children:"Переподключить"}),h.status==="disabled"?a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"enable"),children:"Включить"}):a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"disable"),children:"Выключить"}),h.editable&&a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>c.mcpRemove(h.name),children:"Удалить"})]}),m&&a.jsx(jS,{auth:m,remote:i,actions:c})]},h.name)})}),o?a.jsx(NS,{onCancel:()=>u(!1),onSubmit:(h,m)=>{c.mcpAdd(h,m),u(!1)}}):a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn btn--primary",onClick:()=>u(!0),children:"+ Сервер"})})]})}function jS({auth:n,remote:s,actions:i}){const[c,o]=b.useState("");function u(){const g=c.trim();g!==""&&(i.mcpAuthCallback(n.name,g),o(""))}if(!n.active)return n.error?a.jsx("div",{className:"extlist__error",children:n.error}):n.done?a.jsxs("div",{className:"extauth extauth--done",role:"status",children:[a.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=a.jsxs("div",{className:"extauth__paste",children:[s&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${n.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${n.name}`,"aria-label":"Адрес из строки браузера после входа",className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off",placeholder:"http://localhost:…/callback?code=…",onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),u())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:u,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:s?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=n.callbackExpected&&(s?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[n.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!s&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,n.error&&a.jsx("div",{className:"extlist__error",children:n.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const wS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function kS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function NS({onSubmit:n,onCancel:s}){const[i,c]=b.useState(""),[o,u]=b.useState("stdio"),[h,m]=b.useState(""),[g,x]=b.useState(""),[_,v]=b.useState(""),y=o==="stdio",S=i.trim()!==""&&(y?h.trim()!=="":g.trim()!=="");function k(){if(S)if(y){const[A,...D]=SS(h);n(i.trim(),{transport:"stdio",command:A??"",args:D,env:g_(_)})}else n(i.trim(),{transport:o,url:g.trim(),headers:g_(_)})}return a.jsxs("div",{className:"extform extform--card",children:[a.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),a.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:A=>c(A.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Fl,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:A=>u(A)}),y?a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),a.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:A=>m(A.target.value)})]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),a.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:A=>x(A.target.value)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[y?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),a.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:_,spellCheck:!1,placeholder:y?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:A=>v(A.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:k,children:"Подключить"})]})]})}function g_(n){const s={};for(const i of n.split(`
132
+ `)){const c=i.trim();if(!c)continue;const o=c.indexOf("="),u=c.indexOf(":"),h=o===-1?u:u===-1?o:Math.min(o,u);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function SS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function ES({plugins:n,marketplaces:s,actions:i}){const[c,o]=b.useState("");return a.jsxs(a.Fragment,{children:[n.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:n.map(u=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:u.name}),a.jsx("span",{className:u.enabled?"chip chip--ok":"chip chip--mute",children:u.enabled?"включён":"выключен"}),u.version&&u.version!=="unknown"&&a.jsx("span",{className:"chip",children:u.version}),u.scope&&a.jsx("span",{className:"chip",children:u.scope})]}),u.marketplace&&a.jsx("div",{className:"extlist__meta",children:u.marketplace}),u.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",u.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(u.id,!u.enabled),children:u.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(u.id),children:"Удалить"})]})]},u.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:s.map(u=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:u.name})}),u.source&&a.jsx("div",{className:"extlist__meta",children:u.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(u.name),children:"Отключить"})})]},u.name))}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:u=>o(u.target.value),onKeyDown:u=>{u.key!=="Enter"||c.trim()===""||(u.preventDefault(),i.marketplaceAdd(c.trim()),o(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{i.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const fu=30;function TS({catalog:n,hasMarketplaces:s,actions:i,onMarketplaces:c}){const[o,u]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(fu),[_,v]=b.useState(""),y=b.useMemo(()=>[...new Set(n.map(A=>A.category).filter(Boolean))].sort(),[n]),S=b.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(A=>h&&A.category!==h?!1:k?`${A.name} ${A.displayName} ${A.description} ${A.author}`.toLowerCase().includes(k):!0)},[n,o,h]);return n.length===0?a.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{u(k.target.value),x(fu)}}),a.jsx(Fl,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...y.map(k=>({value:k,label:k}))],onChange:k=>{m(k),x(fu)}})]}),S.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:S.slice(0,g).map(k=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&a.jsx("span",{className:"chip",children:k.version}),k.category&&a.jsx("span",{className:"chip",children:k.category})]}),k.description&&a.jsx("div",{className:"catalog__desc",children:k.description}),a.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>i.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),S.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(k=>k+fu),children:["Ещё ",Math.min(fu,S.length-g)," из ",S.length-g]})}),a.jsxs("div",{className:"extform",children:[a.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>v(k.target.value),onKeyDown:k=>{k.key!=="Enter"||_.trim()===""||(k.preventDefault(),i.pluginInstall(_.trim()),v(""))}}),a.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{i.pluginInstall(_.trim()),v("")},children:"Установить"})]})]})]})}function CS({status:n,login:s,actions:i,remote:c,runningSessions:o,onReconnect:u,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[x,_]=b.useState(""),[v,y]=b.useState(!1),[S,k]=b.useState(!1),A=u!==null&&(n==null?void 0:n.loggedIn)===!0&&!S&&!v,D=b.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const Q=s.output.trim();return Q===""?null:{ok:!0,message:Q}},[s.error,s.output]);function q(Q=x){const z=Q.trim();z!==""&&(i.submitCode(z),_(""))}function G(){if(o>0){y(!1),k(!0);return}i.login("claudeai",!0)}return a.jsxs(ps,{title:"Аккаунт",onClose:g,children:[n===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):n.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:n.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:RS[n.method]??n.method}),n.plan&&a.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&a.jsx("div",{className:"extlist__meta",children:n.organization})]}):a.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",a.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?a.jsx(DS,{login:s,remote:c,code:x,onCode:_,onSubmit:q,onCancel:i.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(qr,{result:D}),S&&a.jsx("p",{className:"account__warn",role:"alert",children:AS(o)}),A&&h&&a.jsx("p",{className:"account__note",children:m}),a.jsx("div",{className:`extbar${n!=null&&n.loggedIn?" account__bar":""}`,children:n!=null&&n.loggedIn?a.jsxs(a.Fragment,{children:[A&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
133
+ ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:u,children:[a.jsx(MS,{}),"Переподключить"]}),S?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:G,children:"Сменить аккаунт"}),v?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{y(!1),i.logout()},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{k(!1),y(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function AS(n){const s=n%10,i=n%100,c=s===1&&i!==11,o=c?"сессия":s>=2&&s<=4&&(i<12||i>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function MS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const RS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function DS({login:n,remote:s,code:i,onCode:c,onSubmit:o,onCancel:u}){var k;const[h,m]=b.useState(null),g=b.useRef(""),x=b.useRef({code:i,onCode:c,onSubmit:o});x.current={code:i,onCode:c,onSubmit:o};const _=b.useCallback(async A=>{const{code:D,onCode:q,onSubmit:G}=x.current;if(A&&D.trim()!=="")return;const Q=await Ip();if(Q===null){A||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const z=Q.trim();if(!x_(z)){A||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(A){if(g.current===z)return;g.current=z}m(null),q(z),G(z)},[]);b.useEffect(()=>{if(!n.awaitingCode)return;const A=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},[n.awaitingCode,_]);const v=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",y=i.trim()!==""&&!x_(i),S=h??(y?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[n.url?s?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:n.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),a.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),a.jsxs("div",{className:"account__raw",children:[a.jsx("span",{className:"account__rawurl",children:n.url}),a.jsx(Jc,{text:n.url,hint:"ссылку входа"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),a.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),a.jsxs("details",{className:"account__fallback",children:[a.jsx("summary",{children:"Браузер не открылся"}),a.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),a.jsx("a",{className:"account__link",href:n.url,target:"_blank",rel:"noreferrer",children:n.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),n.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:"auth-code",className:"input input--mono",value:i,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:A=>{m(null),c(A.target.value)},onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),o())}}),v&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:i.trim()==="",onClick:()=>o(),children:"Готово"})]}),S&&a.jsx("p",{className:"account__note account__note--code",children:S})]}),n.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:n.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:u,children:"Отменить вход"})})]})}function x_(n){const s=n.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[i,c]=s.split("#");return!!i&&!!c&&!/\s/.test(s)}function OS({state:n,onPair:s,onUnpair:i,onClose:c}){const[o,u]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(!1),_=b.useRef(null),v=(n==null?void 0:n.paired)===!0;b.useEffect(()=>{var S;v||(S=_.current)==null||S.focus()},[v]),b.useEffect(()=>{x(!1),v&&u("")},[v,n==null?void 0:n.error]);const y=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(ps,{title:"Удалённый доступ",onClose:c,children:v?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:b_(y)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(n==null?void 0:n.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:n!=null&&n.connected?"dot dot--on":"dot"})," ",n!=null&&n.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(n==null?void 0:n.clients)??0," вкладок"]})]})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),a.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),a.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):a.jsxs("div",{className:"relay",children:[a.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),a.jsxs("ol",{className:"relay__steps",children:[a.jsxs("li",{children:["Откройте ",a.jsx("b",{children:b_(y)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:S=>{S.preventDefault(),o.trim()&&(x(!0),s(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:S=>u(S.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Как назвать этот компьютер"}),a.jsx("input",{className:"input",value:h,onChange:S=>m(S.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function b_(n){try{return new URL(n).host}catch{return n}}const jp=[{id:"codex",label:"Codex",hint:"OpenAI Codex CLI · вход через /login или codex login"},{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],LS="",zS=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],IS=Vp.map(n=>({value:n.value,label:n.value,hint:n.hint})),Zd=3600*1e3,US=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Uc={"6h":6*Zd,"24h":24*Zd,"48h":48*Zd,"168h":168*Zd,never:0};function HS(n){return Uc[n]??Uc["48h"]}const BS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Fd=60*1e3,Hc={"5m":5*Fd,"10m":10*Fd,"30m":30*Fd,"60m":60*Fd,never:0};function qS(n){return Hc[n]??Hc["10m"]}function GS(n){const s=Object.entries(Hc).find(([,i])=>i===n);return s?s[0]:Object.keys(Hc).reduce((i,c)=>Math.abs(Hc[c]-n)<Math.abs(Hc[i]-n)?c:i)}function $S(n){const s=Object.entries(Uc).find(([,i])=>i===n);return s?s[0]:Object.keys(Uc).reduce((i,c)=>Math.abs(Uc[c]-n)<Math.abs(Uc[i]-n)?c:i)}const YS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Bc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function VS(n){return Bc[n]??Bc.off}function __(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function XS(n){const s=Object.entries(Bc).find(([,i])=>i===n);return s?s[0]:Object.keys(Bc).reduce((i,c)=>Math.abs(Bc[c]-n)<Math.abs(Bc[i]-n)?c:i)}const QS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function KS({themeMode:n,onThemeChange:s,settings:i,models:c,providerModels:o={},supportsProviderDefaults:u=!0,relayState:h,networkState:m,local:g,onChange:x,onEnableShell:_,onDisableShell:v,onOpenRelay:y,onClose:S}){const k=i===null,[A,D]=b.useState(""),[q,G]=b.useState(null),Q=!k&&i.networkGuardEnabled,z=(i==null?void 0:i.networkGuardBlockedCountries)??[];function $(){const O=A.trim().toUpperCase();if(O!==""){if(!/^[A-Z]{2}$/.test(O)){G("Нужен код из двух латинских букв, например RU или CN.");return}if(z.includes(O)){G(`Код ${O} уже в списке.`);return}G(null),D(""),x({networkGuardBlockedCountries:[...z,O]})}}const E=!k&&i.terminalEnabled===!0,I=!k&&i.liveSessionsFirst===!0,X=!E,H=O=>{const W=o[O]??(O==="claude"?c:[]);return[{value:LS,label:"Как в CLI",hint:"Из настроек этого CLI"},...W.map(he=>({value:he.value,label:he.displayName,hint:he.description})),...O==="claude"&&!W.length?zS:[]]};function B(){var O,W;return(h==null?void 0:h.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:X,onClick:y,children:"Связать компьютер"})]}):(O=h.shell)!=null&&O.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",h.shell.confirmedAt&&` Включено ${new Date(h.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:X,onClick:v,children:"Запретить"})]}):(W=h.shell)!=null&&W.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:h.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:X,onClick:_,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),g?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:X,onClick:_,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:X,onClick:_,children:"Прислать письмо"})]})]})}return a.jsx(ps,{title:"Настройки",onClose:S,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Тема оформления"}),a.jsx("p",{className:"settings__hint",children:"Свет и тьма — два состояния одного пространства. Оформление одинаково для всех подключённых агентов."}),a.jsx(Fl,{title:"Тема оформления",value:n,options:[{value:"system",label:"Ритм системы",hint:"следовать настройке вашего устройства"},{value:"light",label:"Свет",hint:"молочные поверхности и мягкие тени"},{value:"dark",label:"Тьма",hint:"графит, светящиеся орбиты и глубокие тени"}],onChange:O=>s(O)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Fl,{className:"settings__select",value:$S(i.autoArchiveAfterMs),options:US,onChange:O=>x({autoArchiveAfterMs:HS(O)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Fl,{className:"settings__select",value:GS(i.autoStopAfterMs),options:BS,onChange:O=>x({autoStopAfterMs:qS(O)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),a.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:i.limitStopFiveHourPct,onChange:O=>x({limitStopFiveHourPct:__(O.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:i.limitStopSevenDayPct,onChange:O=>x({limitStopSevenDayPct:__(O.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),a.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Q,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:Q?"switch is-on":"switch",onClick:()=>x({networkGuardEnabled:!Q}),children:a.jsx("span",{className:"switch__knob"})})]}),Q&&m&&a.jsx("p",{className:m.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:m.status==="blocked"?m.reason??"Маршрут не прошёл проверку.":m.country?`Сейчас: ${m.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:Q?"settings__field":"settings__field settings__nested is-disabled",children:[a.jsx("span",{className:"settings__field-label",children:"Запрещённые страны"}),a.jsxs("ul",{className:"countries","aria-label":"Запрещённые страны",children:[z.map(O=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:O}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${O} из списка`,disabled:!Q,onClick:()=>x({networkGuardBlockedCountries:z.filter(W=>W!==O)}),children:"×"})]},O)),z.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:O=>{O.preventDefault(),$()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:A,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!Q,"aria-label":"Код страны, две буквы","aria-invalid":q!==null,onChange:O=>{D(O.target.value.toUpperCase()),G(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!Q||A.trim()==="",children:"Добавить"})]}),q&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:q})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Fl,{className:"settings__select",value:XS(i.autoSaveAfterPauseMs),options:YS,onChange:O=>x({autoSaveAfterPauseMs:VS(O)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),jp.map(O=>{const W=(i==null?void 0:i.enabledProviders)??["claude","antigravity","codex"],he=!k&&W.includes(O.id),je=he&&W.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${O.id}`,"aria-hidden":"true",children:O.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):O.id==="antigravity"?a.jsx(am,{className:"newsession__mark-logo"}):a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),a.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[a.jsx("span",{className:"settings__field-label",children:O.label}),a.jsx("span",{className:"settings__hint",children:je?"Хотя бы один агент должен остаться включённым":O.hint})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":he,"aria-label":O.label,disabled:je,title:je?"Хотя бы один агент должен остаться включённым":void 0,className:he?"switch is-on":"switch",onClick:()=>{const we=jp.map(M=>M.id).filter(M=>M===O.id?!he:W.includes(M));x({enabledProviders:we})},children:a.jsx("span",{className:"switch__knob"})})]},O.id)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),jp.map(O=>{var W,he;return a.jsxs("div",{className:"settings__field settings__model-default",children:[a.jsx("label",{className:"settings__field-label",htmlFor:`default-model-${O.id}`,children:O.label}),a.jsxs("div",{children:[a.jsx("input",{id:`default-model-${O.id}`,className:"hub-input",list:`default-model-options-${O.id}`,"aria-label":`Модель по умолчанию: ${O.label}`,disabled:k||!u,placeholder:"Как в CLI",defaultValue:((W=i==null?void 0:i.startModels)==null?void 0:W[O.id])??(O.id==="claude"?i==null?void 0:i.startModel:"")??"",onBlur:je=>{var M;const we=je.currentTarget.value.trim()||null;we!==(((M=i==null?void 0:i.startModels)==null?void 0:M[O.id])??(O.id==="claude"?i==null?void 0:i.startModel:null)??null)&&x({startModels:{[O.id]:we}})},onKeyDown:je=>{je.key==="Enter"&&je.currentTarget.blur()}},`${O.id}:${((he=i==null?void 0:i.startModels)==null?void 0:he[O.id])??(O.id==="claude"?i==null?void 0:i.startModel:"")??""}`),a.jsx("datalist",{id:`default-model-options-${O.id}`,children:H(O.id).filter(je=>je.value).map(je=>a.jsx("option",{value:je.value,children:je.label},je.value))}),a.jsxs("small",{className:"settings__hint",children:["Выберите доступную модель или введите её ID. Пустое поле — настройки ",O.label,"."]})]})]},O.id)}),!k&&!u&&a.jsx("p",{className:"hub-warning",children:"Обновите ccv на компьютере, чтобы настроить модель отдельно для каждого CLI."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав Claude Code при старте"}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Fl,{className:"settings__select",value:i.startPermissionMode,options:IS,onChange:O=>x({startPermissionMode:O}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),a.jsx("section",{className:"settings__section",children:a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),a.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":I,"aria-label":"Запущенные сессии сверху",className:I?"switch is-on":"switch",onClick:()=>x({liveSessionsFirst:!I}),children:a.jsx("span",{className:"switch__knob"})})]})}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),a.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),a.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:QS.map(O=>{const W=!k&&i.folderAccess===O.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":W,disabled:k,className:"access__card"+(W?" is-on":"")+(O.risky?" access__card--risky":""),onClick:()=>x({folderAccess:O.value}),children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[O.title,O.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:O.description})]})]},O.value)})})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Терминал"}),a.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":E,"aria-label":"Терминал",className:E?"switch is-on":"switch",onClick:()=>x({terminalEnabled:!E}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(X?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),k?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[X&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),B()]})]})]})]})})}const y_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function ZS(n){if(!n)return"срок неизвестен";const s=new Date(n);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function FS({handoff:n,onContinue:s,onShow:i,onDismiss:c}){if(n.continuedAt!==void 0){const o=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${y_[n.limit]} (${Math.round(n.utilization)} %) — работа прервана ${new Date(n.stoppedAt).toLocaleString()}`;return a.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(n.continuedAt).toLocaleString(),"."]})," ",o,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:i,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}return a.jsxs("div",{className:"handoff",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[n.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(n.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[y_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",ZS(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,children:"Продолжить в новой сессии"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:i,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function PS({handoff:n,onClose:s}){const[i,c]=b.useState("");return b.useEffect(()=>{let o=!1;return vf(n.text).then(u=>{o||c(u)}),()=>{o=!0}},[n.text]),a.jsx(ps,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:i}})})}function JS({state:n}){return a.jsxs("div",{className:"netguard",role:"alert",children:[a.jsxs("svg",{className:"netguard__icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.8 14.2 13H1.8L8 1.8Z",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round"}),a.jsx("path",{d:"M8 6.4v3",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11.2",r:"0.8",fill:"currentColor"})]}),a.jsxs("div",{className:"netguard__copy",children:[a.jsx("strong",{className:"netguard__reason",children:n.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const gf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},WS=12e3;function eE(n){const s=n%10,i=n%100;return s===1&&i!==11?"сессии":"сессиях"}function tE({notices:n,onDismiss:s}){return n.length===0?null:a.jsx("div",{className:"limittoasts",children:n.map(i=>a.jsx(nE,{notice:i,onDismiss:()=>s(i.id)},i.id))})}function nE({notice:n,onDismiss:s}){return b.useEffect(()=>{const i=window.setTimeout(s,WS);return()=>window.clearTimeout(i)},[s]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:n.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",gf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",eE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",gf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}function sE(n,s,i=Date.now()){if(!n||!n.available||!s)return null;const c=[["fiveHour",n.fiveHour,s.limitStopFiveHourPct],["sevenDay",n.sevenDay,s.limitStopSevenDayPct]];for(const[o,u,h]of c){if(!u||h<=0||u.utilization<h)continue;const m=Date.parse(u.resetsAt);if(!(!Number.isFinite(m)||m<=i))return{limit:o,utilization:u.utilization,resetsAt:m}}return null}function lE(n,s=Date.now()){const i=new Date(n),c=i.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return i.toDateString()===new Date(s).toDateString()?c:`${i.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const aE=16;function iE({pane:n,width:s,onResize:i,onReset:c}){const o=zr[n],u=b.useRef(null);b.useEffect(()=>()=>{u.current&&document.body.classList.remove("is-resizing")},[]);function h(v){var D;const y=v.closest(".app"),S=y==null?void 0:y.querySelector(n==="sidebar"?":scope > .sidebar":n==="comparison"?".comparison":`.sidepane--${n}`),k=(S==null?void 0:S.getBoundingClientRect().width)??s,A=((D=y==null?void 0:y.querySelector(".main"))==null?void 0:D.getBoundingClientRect().width)??ib;return{width:k,max:Math.max(o.min,Math.min(o.max,k+A-ib))}}function m(v){v.button===0&&(u.current={x:v.clientX,...h(v.currentTarget)},v.currentTarget.setPointerCapture(v.pointerId),document.body.classList.add("is-resizing"),v.preventDefault())}function g(v){const y=u.current;if(!y)return;const S=o.side==="left"?v.clientX-y.x:y.x-v.clientX;i(Math.min(y.max,y.width+S))}function x(v){u.current&&(u.current=null,v.currentTarget.hasPointerCapture(v.pointerId)&&v.currentTarget.releasePointerCapture(v.pointerId),document.body.classList.remove("is-resizing"))}function _(v){const y=v.key==="ArrowRight"?1:v.key==="ArrowLeft"?-1:0;if(y===0)return;v.preventDefault();const S=h(v.currentTarget);i(Math.min(S.max,S.width+y*aE*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${n} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:m,onPointerMove:g,onPointerUp:x,onPointerCancel:x,onLostPointerCapture:x,onDoubleClick:c,onKeyDown:_,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const rE=16;function cE({height:n,onResize:s,onReset:i}){const c=b.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const _=x.getBoundingClientRect().height-Cv;return Math.round(n+Math.max(0,_))}function u(x){x.button===0&&(c.current={y:x.clientY,height:n,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const _=c.current;if(!_)return;const v=_.y-x.clientY;s(_.height+v,_.max)}function m(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const _=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;_!==0&&(x.preventDefault(),s(n+_*rE,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":X_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:u,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:i,onKeyDown:g,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function v_(){const n=document.documentElement,s=getComputedStyle(n),i=G=>s.getPropertyValue(G).trim(),c=i("--surface"),o=i("--text"),u=i("--text-2"),h=i("--muted"),m=i("--accent"),g=i("--accent-fg"),x=i("--select"),_=i("--danger"),v=i("--ok"),y=i("--warn"),S=i("--cm-fn"),k=i("--cm-key"),A=i("--cm-type"),D=j_(o,c,55),q=G=>j_(G,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:D,brightBlack:h,red:_,brightRed:q(_),green:v,brightGreen:q(v),yellow:y,brightYellow:q(y),blue:S,brightBlue:q(S),magenta:k,brightMagenta:q(k),cyan:A,brightCyan:q(A),white:u,brightWhite:o}}function oE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ya=null;function uE(n){return ya||(ya=document.createElement("span"),ya.style.position="fixed",ya.style.width="0",ya.style.height="0",ya.style.opacity="0",ya.style.pointerEvents="none",document.body.appendChild(ya)),ya.style.color=n,getComputedStyle(ya).color}function j_(n,s,i){return uE(`color-mix(in srgb, ${n} ${100-i}%, ${s} ${i}%)`)}let Pd=null;function dE(){return Pd||(Pd=Promise.all([ot(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),ot(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),ot(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),ot(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,s,i])=>({Terminal:n.Terminal,FitAddon:s.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(n=>{throw Pd=null,n})),Pd}function fE({terminals:n,activeId:s,blocked:i,error:c,onDismissError:o,height:u,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:x,onSelect:_,onOpen:v,onClose:y,onInput:S,onResize:k,onAttach:A,onHide:D,registerSink:q}){const[G,Q]=b.useState(()=>v_());return b.useEffect(()=>{const z=new MutationObserver(()=>Q(v_()));return z.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>z.disconnect()},[]),a.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:u,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:u},children:[a.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:z=>{x&&(z.target.closest("button")||x())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(z=>a.jsxs("div",{role:"tab","aria-selected":z.id===s,className:"termtab"+(z.id===s?" is-on":"")+(z.exitCode!==null?" termtab--exited":""),onDoubleClick:$=>{x&&($.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:z.cwd,onClick:()=>_(z.id),children:z.title}),z.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${z.exitCode}`,children:z.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${z.title}»`,onClick:()=>y(z.id),children:"✕"})]},z.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:v,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),x&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:x,children:a.jsx(eo,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:D,children:"✕"})]}),c&&n.length>0&&a.jsx(w_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?a.jsx(w_,{message:c,onRetry:i?null:v,onDismiss:o}):i?a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминал с удалённых устройств выключен"}),a.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):n.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:v,children:"Открыть терминал"})]}),n.map(z=>a.jsx(pE,{id:z.id,exitCode:z.exitCode,active:z.id===s,theme:G,mobile:m,onInput:S,onResize:k,onAttach:A,registerSink:q},z.id))]})]})}function w_({message:n,strip:s=!1,onRetry:i,onDismiss:c}){const{lede:o,hint:u,details:h}=hE(n);return a.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),u&&a.jsx("p",{className:"termfail__hint",children:u}),h&&a.jsxs("details",{className:"termfail__details",children:[a.jsx("summary",{children:"Подробности"}),a.jsx("pre",{children:h})]})]}),a.jsxs("div",{className:"termfail__bar",children:[i&&a.jsx("button",{className:"btn btn--primary",onClick:i,children:"Открыть терминал"}),a.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function hE(n){const[s="",...i]=n.trim().split(`
134
+
135
+ `),c=s.split(`
136
+ `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:i.join(`
137
+
138
+ `).trim()}}function pE({id:n,exitCode:s,active:i,theme:c,mobile:o,onInput:u,onResize:h,onAttach:m,registerSink:g}){const x=b.useRef(null),_=b.useRef(null),v=b.useRef(!1),y=b.useRef(o);y.current=o;const S=b.useRef(c),k=b.useRef(s),[A,D]=b.useState("loading"),[q,G]=b.useState(!1);return b.useEffect(()=>{if(!x.current)return;let z=!1,$=null;D("loading"),G(!1);const E=window.setTimeout(()=>{z||G(!0)},200);return(async()=>{var ke;let I;try{I=await dE()}catch{window.clearTimeout(E),z||D("error");return}if(z||!x.current)return;window.clearTimeout(E);const{Terminal:X,FitAddon:H,WebLinksAddon:B}=I,O=new X({fontFamily:oE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:S.current}),W=new H;O.loadAddon(W),O.loadAddon(new B),O.open(x.current),_.current=O,O.attachCustomKeyEventHandler(C=>{if(C.type!=="keydown"||!(C.ctrlKey||C.metaKey))return!0;if(C.key==="`")return C.preventDefault(),!1;if(C.key==="c"||C.key==="C"){const de=O.getSelection();return de?(C.preventDefault(),ti(de),!1):!C.shiftKey}return C.key==="v"||C.key==="V"?(C.preventDefault(),Ip().then(de=>{de&&O.paste(de)}),!1):!0});const he=C=>{C.preventDefault();const K=O.getSelection();if(K){ti(K),O.clearSelection();return}Ip().then(de=>{de&&O.paste(de)})};(ke=O.element)==null||ke.addEventListener("contextmenu",he);const je=O.onData(C=>u(n,C));let we={cols:O.cols,rows:O.rows},M=null;const N=O.onResize(({cols:C,rows:K})=>{M!==null&&window.clearTimeout(M),M=window.setTimeout(()=>{M=null,!(C===we.cols&&K===we.rows)&&(we={cols:C,rows:K},h(n,C,K))},100)}),V=new ResizeObserver(()=>{try{W.fit()}catch{return}y.current&&O.scrollToBottom()});V.observe(x.current);const ae=g(n,C=>{C.kind==="buffer"&&O.reset(),O.write(C.data)});m(n),k.current!==null&&!v.current&&(v.current=!0,O.write(`\r
139
+ \x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
140
+ `)),i&&O.focus(),$=()=>{var C;M!==null&&window.clearTimeout(M),V.disconnect(),(C=O.element)==null||C.removeEventListener("contextmenu",he),je.dispose(),N.dispose(),ae(),O.dispose(),_.current=null},D("ready")})(),()=>{z=!0,window.clearTimeout(E),$==null||$(),$=null}},[n]),b.useEffect(()=>{if(!o)return;const Q=x.current;if(!Q)return;let z=null,$=0,E=!1;const I=O=>{O.pointerType==="mouse"||z!==null||(z=O.pointerId,$=O.clientY,E=!1)},X=O=>{if(O.pointerId!==z)return;const W=$-O.clientY;if(!E){if(Math.abs(W)<4)return;E=!0,Q.setPointerCapture(O.pointerId)}$=O.clientY;const he=Q.querySelector(".xterm-viewport");he&&(he.scrollTop+=W)},H=O=>{O.pointerId===z&&(Q.hasPointerCapture(O.pointerId)&&Q.releasePointerCapture(O.pointerId),z=null,E=!1)},B=O=>O.stopPropagation();return Q.addEventListener("pointerdown",I),Q.addEventListener("pointermove",X),Q.addEventListener("pointerup",H),Q.addEventListener("pointercancel",H),Q.addEventListener("touchmove",B,{capture:!0}),()=>{Q.removeEventListener("pointerdown",I),Q.removeEventListener("pointermove",X),Q.removeEventListener("pointerup",H),Q.removeEventListener("pointercancel",H),Q.removeEventListener("touchmove",B,{capture:!0}),z!==null&&Q.hasPointerCapture(z)&&Q.releasePointerCapture(z)}},[o]),b.useEffect(()=>{S.current=c,_.current&&(_.current.options.theme=c)},[c]),b.useEffect(()=>{var Q;i&&((Q=_.current)==null||Q.focus())},[i]),b.useEffect(()=>{if(k.current=s,s===null){v.current=!1;return}if(v.current)return;const Q=_.current;Q&&(v.current=!0,Q.write(`\r
141
+ \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
142
+ `))},[s]),a.jsxs("div",{className:"termview"+(i?" is-active":""),children:[a.jsx("div",{ref:x,className:"termview__surface"+(A==="ready"?"":" is-hidden")}),A==="loading"&&q&&a.jsxs("div",{className:"termview__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),A==="error"&&a.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[a.jsx("p",{children:"Не удалось загрузить терминал"}),a.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),a.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const Bp="ccv:last-session",mE=300*1e3,gE=1e4;function xE(){try{const n=localStorage.getItem(Bp);if(!n)return null;const s=JSON.parse(n);if(typeof s!="object"||s===null)return null;const{workspaceId:i,sessionId:c,claudeSessionId:o}=s;return typeof i!="string"||c!==null&&typeof c!="string"?null:{workspaceId:i,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function bE(n,s){const i=n.find(o=>o.id===s);if(i)return i;const c=n.filter(o=>cv(o.path).includes(s));return c.length===1?c[0]:void 0}function _E(n,s){return n.id===s.sessionId?!0:s.claudeSessionId?n.id===s.claudeSessionId||n.claudeSessionId===s.claudeSessionId:!1}const yE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},wp=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],vE={active:!1,url:"",awaitingCode:!1,output:"",error:null};function k_(n,s,i){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return s;const o=i[c===-1?"":n.slice(0,c)];if(!o)return null;const u=n.slice(c+1).toLowerCase();return u===""?{query:n,entries:o}:{query:n,entries:o.filter(h=>h.name.toLowerCase().includes(u)).sort((h,m)=>N_(h.name,u)-N_(m.name,u))}}function N_(n,s){return n.toLowerCase().startsWith(s)?0:1}function S_(n,s){const i=n.find(o=>o.value===s)??n.find(o=>o.resolvedModel===s),c=s&&!i?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(i==null?void 0:i.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function jE(){var Ro;const n=b.useRef(null),s=b.useRef(null),i=b.useRef(!1),c=b.useRef(new Set),o=b.useCallback(p=>{var L;return(L=n.current)==null?void 0:L.send(p)},[]),u=b.useCallback(p=>{var L,ce,Ue;if(p.type==="session.start"){const ht=crypto.randomUUID();s.current={requestId:ht,workspaceId:p.workspaceId,provider:p.provider,resume:p.resume,known:new Set(c.current),draft:(L=s.current)==null?void 0:L.draft},(ce=n.current)==null||ce.send({...p,requestId:ht})}else(Ue=n.current)==null||Ue.send(p)},[]),[h,m]=b.useState(!1),[g,x]=b.useState("Нет связи с хостом"),[_,v]=b.useState(null),[y,S]=b.useState(null),k=(y==null?void 0:y.status)==="blocked",[A,D]=b.useState(!1),q=b.useMemo(()=>ef()==="relay",[]),[G,Q]=b.useState([]),z=nk({connected:h,workspaces:G,send:o}),$=ON(z.openedIds,z.replacements),[E,I]=b.useState(null),X=b.useRef(z.handleFrame);X.current=z.handleFrame;const[H,B]=b.useState([]),[O,W]=b.useState([]),[he,je]=b.useState([]),[we,M]=b.useState([]),[N,V]=b.useState([]),[ae,ke]=b.useState([]),[C,K]=b.useState([]),[de,_e]=b.useState([]),[Ae,ze]=b.useState(null),[be,Ge]=b.useState(null),[lt,Mt]=b.useState(null),[fe,at]=b.useState(null),[oe,Rt]=b.useState(null),[Be,qt]=b.useState(null),[Hn,xt]=b.useState(hs),[Kt,an]=b.useState(Fi),[Vn,jt]=b.useState(!1),[Z,Oe]=b.useState(()=>{try{const p=localStorage.getItem("ether:library.tab");if(p==="sessions"||p==="pinned")return p}catch{}return"projects"}),[Ye,ut]=b.useState(()=>{try{return localStorage.getItem("ether:library.project")||null}catch{return null}}),[Ee,Te]=b.useState(()=>{try{return localStorage.getItem("ether:session-list")==="live"?"live":"all"}catch{return"all"}});b.useEffect(()=>{try{localStorage.setItem("ether:session-list",Ee)}catch{}},[Ee]);const Me=Z==="sessions"&&Ee==="live",Ve=z.allSessions.filter(Ur),Ke=Ve.map(p=>p.id).sort().join("|"),Pe=b.useRef(new Set);b.useEffect(()=>{if(!Me){Pe.current.clear();return}const p=$.layout.focused;let L=!1;for(const ce of Ve)Pe.current.has(ce.id)||(Pe.current.add(ce.id),z.openedIds.includes(ce.id)||($.open(ce.id),z.openConversation(ce),L=!0));L&&p&&$.activate(p)},[Me,Ke]),b.useEffect(()=>{try{localStorage.setItem("ether:library.tab",Z),localStorage.setItem("ether:library.project",Ye??"")}catch{}},[Z,Ye]);const[dt,Ct]=b.useState(null),[Cn,St]=b.useState(!1),[Lt,re]=b.useState(()=>{try{const p=localStorage.getItem("ether:provider-filter");if(p&&["all","codex","claude","antigravity"].includes(p))return p}catch{}return"all"});b.useEffect(()=>{try{localStorage.setItem("ether:provider-filter",Lt)}catch{}},[Lt]);const[Ne,Xe]=b.useState(!1),We=bf("(max-width: 860px)"),[tt,on]=b.useState(!1);b.useEffect(()=>{We||on(!1)},[We]);const[On,Wt]=b.useState(!1),[bn,Yt]=b.useState([]),[zt,P]=b.useState(!1),[pe,Re]=b.useState(hs),[Ze,It]=b.useState(null),[rn,wt]=b.useState(null),[xs,Xn]=b.useState([]),[ls,cn]=b.useState(null),[it,un]=b.useState(null),[Es,Ts]=b.useState([]),[Cs,Hs]=b.useState([]),[as,As]=b.useState([]),[Zt,Bs]=b.useState([]),[_n,yn]=b.useState(null),[st,Pn]=b.useState(null),[Qn,is]=b.useState({}),[dn,fl]=b.useState(null),[Ms,rs]=b.useState({}),[Rs,En]=b.useState(null),[Ln,Bn]=b.useState([]),[en,Nl]=b.useState(!1),[ni,Jl]=b.useState(null),[An,Sl]=b.useState(null),El=(An==null?void 0:An.enabledProviders)??["claude","antigravity","codex"],[Jn,Tl]=b.useState(!1),[Wl,qs]=b.useState(vE),[vn,Se]=b.useState(null),[R,J]=b.useState(null),[ye,Ce]=b.useState(!1),[Qe,Je,Vt]=kv(),mt=Tv(),[tn,rt]=b.useState(!1),[At,fn]=b.useState(null),[nl,Gs]=b.useState(null),[Ji,Cl]=b.useState(null),[si,jn]=b.useState(null),[bs,Wn]=b.useState(null),[hl,T]=b.useState(""),[ge,He]=b.useState(null),[bt,_s]=b.useState([]),[$r,Wi]=b.useState(!1),[ys,Al]=b.useState(null),[Yr,ea]=b.useState(!1),[$s,ta]=b.useState(!1),[Ml,Rl]=b.useState({}),[Ta,er]=b.useState([""]),[Ca,sl]=b.useState([]),[Vr,Dl]=b.useState(null),[jf,na]=b.useState(null),[tr,Xr]=b.useState(null),[nr,sr]=b.useState(null),[wf,to]=b.useState(null),[Qr,Mu]=b.useState({}),[li,Ru]=b.useState({}),[ai,ii]=b.useState(!1),[Du,no]=b.useState(null),[Kr,so]=b.useState(null),Ou=b.useRef(0),Zr=b.useRef(null),[Fr,lo]=b.useState(!1),[Pr,lr]=b.useState([]),[ao,sa]=b.useState(null),[kf,ar]=b.useState(null),ir=Av(),Jr=Lv(We&&Fr),ri=b.useRef(new Map),la=(An==null?void 0:An.terminalEnabled)===!0,Ol=ef()==="relay"&&((Ro=_==null?void 0:_.shell)==null?void 0:Ro.enabled)!==!0,io=b.useRef(!1),Nf=b.useCallback((p,L)=>(ri.current.set(p,L),()=>{ri.current.get(p)===L&&ri.current.delete(p)}),[]),[aa,ia]=b.useState(!1),[ro,ra]=b.useState(null),[ci,Wr]=b.useState(hs),[Ys,rr]=b.useState(null),[oi,Ll]=b.useState({}),Aa=b.useRef([]),[hn,cr]=b.useState(null),[zl,Sf]=b.useState(!1),ec=b.useRef(null);function co(){if(!zl)ec.current={files:$s,search:ai,git:tn,ask:aa},ta(!1),ii(!1),rt(!1),ia(!1),cr(null);else if(ec.current){const p=ec.current;ta(p.files),ii(p.search),rt(p.git),ia(p.ask),ec.current=null}Sf(!zl)}b.useEffect(()=>{!Me&&zl&&co()},[Me,zl]);function Ef(p){cr(L=>L===p?null:p)}b.useEffect(()=>{(We||hn==="terminal"&&!Fr||hn==="files"&&!$s||hn==="search"&&!ai||hn==="git"&&!tn||hn==="ask"&&!aa||hn==="main"&&Ca.length===0)&&cr(null)},[hn,We,Fr,$s,ai,tn,aa,Ca.length]);const[Tf]=b.useState(xE),es=b.useRef(Tf),pl=b.useRef(!1),zn=b.useRef(null),or=b.useRef(null),ur=b.useRef(null),oo=b.useRef(0),Mn=b.useRef(null),Lu=b.useRef(0);zn.current=oe,Mn.current=fe,Lu.current=Hn.lastSeq;const Ma=b.useRef(Kt);Ma.current=Kt;const ll=b.useRef(null),ui=b.useRef(0);ui.current=ci.lastSeq;const di=b.useRef(null),dr=b.useRef(""),al=b.useRef(null),Vs=b.useRef([]),tc=b.useRef([""]);Vs.current=Ca,tc.current=Ta;const fi=b.useRef(new Map),ml=b.useRef(new Set),hi=b.useRef(null),pi=b.useRef(null),uo=b.useRef(0),fr=b.useRef(new Set);b.useEffect(()=>{const p=gv();if(!p)return;n.current=p;const L=()=>{m(p.connected),x(p.statusText)};p.onStatus(L),p.onReconnect(()=>{L(),rs({});const ht=zn.current;ht&&p.send({type:"session.sync",sessionId:ht,sinceSeq:Lu.current});const Ut=ll.current;Ut&&p.send({type:"session.sync",sessionId:Ut,sinceSeq:ui.current})});const ce=p.on(ht=>{X.current(ht),Cf(ht)});p.connect();const Ue=window.setInterval(()=>{L(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(Ue),p.close()}},[]);const Cf=b.useCallback(p=>{var ce,Ue,ht,Ut,kn,Zs,mc,Do,Yl,ws,Nn,jr,_l;const L=le=>{var Ie,gt,_t;const ve=(Ie=s.current)==null?void 0:Ie.draft;s.current=null,ve&&sf(le.id,ve),((gt=ur.current)==null?void 0:gt.workspaceId)===le.workspaceId&&(sf(le.id,ur.current.text),ur.current=null),zn.current=le.id,at(le.workspaceId),Rt(le.id),(_t=n.current)==null||_t.send({type:"session.sync",sessionId:le.id,sinceSeq:0})};switch(p.type){case"hello.ok":i.current=((ce=p.features)==null?void 0:ce.includes("session-routing"))??!1,m(!0);break;case"workspace.list":{Q(p.workspaces),B(p.archived),at(Ie=>{var us;if(Ie)return Ie;const gt=es.current,_t=gt&&bE(p.workspaces,gt.workspaceId);return gt&&_t&&_t.id!==gt.workspaceId&&(es.current={...gt,workspaceId:_t.id}),(_t==null?void 0:_t.id)??((us=p.workspaces[0])==null?void 0:us.id)??null});const le=al.current;if(!le)break;const ve=p.workspaces.find(Ie=>NE(Ie.path,le));if(!ve)break;al.current=null,Wt(!1),at(ve.id);break}case"workspace.candidates":if(p.query.trim()!==dr.current)break;Yt(p.candidates),p.source==="host"&&P(!1);break;case"finder.opened":di.current=p.sessionId;break;case"workspace.roots":Xn(p.roots);break;case"workspace.created":if(at(p.workspace.id),p.warnings.length===0){Wt(!1),wt(null);break}cn({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Mn.current)break;V(le=>vy(le,p.sessions,p.archived,p.workspaceId)),ke(p.archived);break;case"folder.list":W(p.workspaceFolders),je(p.sessionFolders),M(p.pinnedFolders??[]);break;case"session.pinned":K(p.sessions);break;case"session.live":for(const le of p.sessions)c.current.add(le.id);_e(p.sessions);break;case"order.state":Mt(p.order);break;case"session.summary":if(!i.current&&s.current){const le=s.current,ve=p.session;!ve.parentSessionId&&ve.workspaceId===le.workspaceId&&ve.state!=="closed"&&(!le.provider||le.provider===ve.provider)&&(!((Ue=le.known)!=null&&Ue.has(ve.id))||le.resume===ve.id||le.resume===ve.claudeSessionId)&&L(ve)}if(c.current.add(p.session.id),p.session.id===di.current){It(p.session);break}if(p.session.parentSessionId){p.session.id===ll.current&&rr(p.session);break}if(_e(le=>{const ve=le.findIndex(gt=>gt.id===p.session.id);if(p.session.state==="closed")return ve===-1?le:le.filter(gt=>gt.id!==p.session.id);if(ve===-1)return[...le,p.session];const Ie=le.slice();return Ie[ve]=p.session,Ie}),V(le=>{const ve=le.findIndex(gt=>gt.id===p.session.id);if(ve===-1)return[p.session,...le];const Ie=le.slice();return Ie[ve]=p.session,Ie}),K(le=>{const ve=le.findIndex(gt=>gt.id===p.session.id);if(ve===-1)return le;const Ie=le.slice();return Ie[ve]={...p.session,pinned:!0,...le[ve].pinnedAt?{pinnedAt:le[ve].pinnedAt}:{}},Ie}),((ht=or.current)==null?void 0:ht.sessionId)===p.session.id){const le=or.current;p.session.state==="error"?or.current=null:p.session.state!=="closed"&&(or.current=null,(Ut=n.current)==null||Ut.send({type:"prompt.send",sessionId:le.sessionId,text:le.text,images:le.images}))}break;case"session.started":{if(p.requestId!==((kn=s.current)==null?void 0:kn.requestId))break;L(p.session);break}case"usage.state":p.sessionId===zn.current&&(Se(p.usage),Ce(!1));break;case"context.state":p.sessionId===zn.current&&(J(p.context),Ce(!1));break;case"session.capabilities":p.sessionId===zn.current&&qt(p.capabilities);break;case"session.events":if(p.sessionId===ll.current){Wr(le=>bu(le,p.entries));break}if(p.sessionId===di.current){Re(le=>bu(le,p.entries));break}if(p.sessionId!==zn.current)break;for(const le of p.entries){if(le.event.kind!=="rewound")continue;const ve=le.event.toUserIndex,Ie=B_(Ma.current.entries,ve),gt=Ie.reduce((_t,us)=>us.event.kind==="user.message"?_t+1:_t,0);an(_t=>({..._t,entries:Ie})),xt(_t=>({..._t,items:q_(_t.items,ve,gt)}))}xt(le=>bu(le,p.entries));break;case"session.history":if(p.sessionId!==zn.current)break;an(le=>H_(le,p));break;case"side.opened":{if(p.parentSessionId!==zn.current)break;ll.current=p.sessionId,ra(p.sessionId);const le=Aa.current;Aa.current=[];for(const ve of le)ve(p.sessionId);break}case"side.closed":if(p.parentSessionId!==zn.current)break;ll.current=null,ra(null),Wr(hs),rr(null);break;case"git.state":if(p.workspaceId!==Mn.current)break;fn(p.state);break;case"git.commit":if(p.workspaceId!==Mn.current)break;Gs(p.detail);break;case"git.result":if(p.workspaceId!==Mn.current)break;jn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Gs(null),Cl(null),Wi(!1),ea(!1));break;case"git.busy":if(p.workspaceId!==Mn.current)break;T(p.label);break;case"git.files":if(p.workspaceId!==Mn.current)break;Al({files:p.files,truncated:p.truncated});break;case"github.status":He(p.status);break;case"github.owners":_s(p.owners);break;case"fs.dir":if(p.workspaceId!==Mn.current)break;Rl(le=>({...le,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Mn.current)break;if(p.scope!=="tree"){const le=p.scope;Ru(ve=>({...ve,[le]:{query:p.query,entries:p.entries}}));break}to({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Mn.current)break;no({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Mn.current)break;const le=ml.current.delete(p.file.path);sl(Ie=>{const gt=Ie.findIndex(gc=>gc.path===p.file.path);if(gt===-1)return[...Ie,Yb(p.file,++uo.current)];const _t=Ie[gt],us=Ie.slice();return us[gt]=_t.saved===p.file.content&&!Pa(_t)?{..._t,mtime:p.file.mtime,size:p.file.size,stale:!1}:Yb(p.file,++uo.current),us}),le&&Dl(p.file.path);const ve=Zr.current;ve&&ve.path===p.file.path&&(Zr.current=null,so({...ve,token:++Ou.current}));break}case"fs.media":{if(p.workspaceId!==Mn.current)break;fr.current.delete(p.path),sl(le=>le.map(ve=>ve.path===p.path?{...ve,mediaBase64:p.base64,mediaError:void 0}:ve));break}case"fs.mediaFailed":{if(p.workspaceId!==Mn.current)break;fr.current.delete(p.path),sl(le=>le.map(ve=>ve.path===p.path?{...ve,mediaError:p.message}:ve));break}case"fs.saved":{if(p.workspaceId!==Mn.current)break;const le=fi.current.get(p.path);fi.current.delete(p.path);const ve=le!==void 0;sl(gt=>gt.map(_t=>_t.path!==p.path?_t:ve?{..._t,saved:le,mtime:p.mtime,size:p.size,stale:!1}:{..._t,stale:!0}));const Ie=Vs.current.find(gt=>gt.path===p.path);!ve&&Ie&&!Pa(Ie)&&((Zs=n.current)==null||Zs.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(mc=n.current)==null||mc.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Mn.current)break;if(na({ok:p.ok,message:p.message}),p.ok||fi.current.delete(p.path),p.conflict&&sl(ve=>ve.map(Ie=>Ie.path===p.path?{...Ie,stale:!0}:Ie)),pi.current===p.path){const ve=pi.current;pi.current=null,p.ok&&(ml.current.add(ve),(Do=n.current)==null||Do.send({type:"fs.read",workspaceId:p.workspaceId,path:ve}))}const le=hi.current;if(p.ok&&le&&le.to===p.path){hi.current=null;const ve=Ie=>Ie===le.from?le.to:Ie.startsWith(`${le.from}/`)?le.to+Ie.slice(le.from.length):Ie;sl(Ie=>Ie.map(gt=>({...gt,path:ve(gt.path)}))),Dl(Ie=>Ie===null?null:ve(Ie)),er(Ie=>Ie.map(ve)),Rl(Ie=>{const gt={};for(const[_t,us]of Object.entries(Ie))_t===le.from||_t.startsWith(`${le.from}/`)||(gt[_t]=us);return gt})}p.ok&&((Yl=n.current)==null||Yl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Mn.current)break;lr(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Mn.current)break;ar(null),lr(le=>{const ve=le.findIndex(gt=>gt.id===p.terminal.id);if(ve===-1)return[...le,p.terminal];const Ie=le.slice();return Ie[ve]=p.terminal,Ie}),io.current&&(io.current=!1,sa(p.terminal.id));break;case"term.buffer":(ws=ri.current.get(p.id))==null||ws({kind:"buffer",data:p.data});break;case"term.data":(Nn=ri.current.get(p.id))==null||Nn({kind:"data",data:p.data});break;case"term.exit":lr(le=>le.map(ve=>ve.id===p.id?{...ve,exitCode:p.exitCode}:ve));break;case"term.closed":lr(le=>le.filter(ve=>ve.id!==p.id));break;case"mcp.list":p.sessionId===zn.current&&Ts(p.servers);break;case"mcp.auth":p.sessionId===zn.current&&Pn(p.state);break;case"plugin.list":if(p.sessionId!==zn.current)break;Hs(p.plugins),As(p.marketplaces),Bs(p.catalog);break;case"operation.result":p.sessionId===zn.current&&yn(p.result);break;case"auth.status":Jl(p.status);break;case"relay.state":v(p.state);break;case"network.state":S(p.state);break;case"settings.state":Sl(p.settings);break;case"handoff.state":is(le=>{if(!p.handoff){if(!(p.sessionId in le))return le;const ve={...le};return delete ve[p.sessionId],ve}return{...le,[p.sessionId]:p.handoff}});break;case"handoff.written":rs(le=>{if(!(p.sessionId in le))return le;const ve={...le};return delete ve[p.sessionId],ve}),p.handoff&&zn.current===p.sessionId?En(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":oo.current+=1,Bn(le=>[...le,{id:oo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":qs(p.state),p.state.active&&Nl(!0);break;case"session.closed":_e(le=>le.filter(ve=>ve.id!==p.sessionId)),V(le=>le.map(ve=>ve.id===p.sessionId?{...ve,state:"closed"}:ve));break;case"error":p.context==="session.start"&&p.requestId===((jr=s.current)==null?void 0:jr.requestId)&&(s.current=null,xt(le=>({...le,items:[...le.items,{id:crypto.randomUUID(),kind:"notice",tone:"error",text:p.message}]}))),console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(al.current=null,wt(p.message)),(_l=p.context)!=null&&_l.startsWith("term.")&&ar(p.message);break}},[]);b.useEffect(()=>{fe&&u({type:"session.list",workspaceId:fe})},[fe,u]),b.useEffect(()=>{h&&u({type:"session.pins"})},[h,u]),b.useEffect(()=>{h&&u({type:"settings.get"})},[h,u]),b.useEffect(()=>{if(h)return u({type:"session.drafts",sessionIds:z_()}),yv(p=>u({type:"session.drafts",sessionIds:p}))},[h,u]),b.useEffect(()=>{if(pl.current)return;const p=es.current;if(!p||!fe)return;if(p.sessionId===null){pl.current=!0;return}if(fe!==p.workspaceId){pl.current=!0;return}if(oe){pl.current=!0;return}if(N.length===0)return;const L=N.find(ce=>_E(ce,p));pl.current=!0,L&&L.state!=="closed"&&Os(L)},[N,fe,oe]),b.useEffect(()=>{!fe||Ol||!la||u({type:"term.list",workspaceId:fe})},[fe,Ol,la,u]),b.useEffect(()=>{sa(p=>{var L;return p&&Pr.some(ce=>ce.id===p)?p:((L=Pr[0])==null?void 0:L.id)??null})},[Pr]),b.useEffect(()=>{On&&u({type:"workspace.roots"})},[On,u]);const nc=b.useCallback(()=>{const p=zn.current;p&&(Ce(!0),u({type:"usage.get",sessionId:p}),u({type:"context.get",sessionId:p}))},[u]);b.useEffect(()=>{if(!ye)return;const p=window.setTimeout(()=>Ce(!1),gE);return()=>window.clearTimeout(p)},[ye]);const fo=b.useMemo(()=>{const p=Math.max((vn==null?void 0:vn.fetchedAt)??0,(R==null?void 0:R.fetchedAt)??0);return p>0?p:null},[vn==null?void 0:vn.fetchedAt,R==null?void 0:R.fetchedAt]);b.useEffect(()=>{if(J(null),!oe)return;nc();const p=()=>{document.hidden||nc()},L=window.setInterval(p,mE),ce=()=>{document.hidden||nc()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(L),document.removeEventListener("visibilitychange",ce)}},[oe,nc]),b.useEffect(()=>{if(!oe){an(Fi);return}an({...Fi,loading:!0}),u({type:"session.history",sessionId:oe})},[oe,u]),b.useCallback(()=>{!oe||Kt.loading||!U_(Kt)||(an(p=>({...p,loading:!0})),u({type:"session.history",sessionId:oe,before:$p(Kt)}))},[oe,Kt,u]),b.useMemo(()=>Yp(Kt.entries),[Kt.entries]);const ne=b.useMemo(()=>N.find(p=>p.id===oe)??null,[N,oe]),Ra=oe?(ne==null?void 0:ne.claudeSessionId)??oe:null,cs=Ra?Qn[Ra]??null:null;b.useEffect(()=>{Ra&&u({type:"handoff.get",sessionId:Ra})},[Ra,u]),b.useEffect(()=>{dn&&!(dn.sessionId in Qn)&&fl(null)},[Qn,dn]),b.useMemo(()=>{var ce;if(!vn)return null;const p=(((ce=vn.buckets)==null?void 0:ce.length)??0)>0,L=(ne==null?void 0:ne.provider)!=="claude";return p===L?vn:null},[vn,ne==null?void 0:ne.provider]),"Обновить лимиты и контекст"+(fo?`
143
+ обновлено в ${new Date(fo).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""),b.useEffect(()=>{document.documentElement.dataset.provider=(ne==null?void 0:ne.provider)??"claude"},[ne==null?void 0:ne.provider]),b.useEffect(()=>{(ne==null?void 0:ne.provider)!=="claude"&&ia(!1)},[ne==null?void 0:ne.provider]);const vs=G.find(p=>p.id===fe)??H.find(p=>p.id===fe)??null;b.useEffect(()=>{if(!fe||!oe)return;const p={workspaceId:fe,sessionId:oe,claudeSessionId:(ne==null?void 0:ne.claudeSessionId)??null};try{localStorage.setItem(Bp,JSON.stringify(p))}catch{}},[fe,oe,ne==null?void 0:ne.claudeSessionId]);function mi(p){al.current=p,wt(null),u({type:"workspace.open",path:p})}function po(p,L,ce){wt(null),u({type:"workspace.create",parent:p,name:L,init:ce})}function sc(p){if(dr.current=p,!p){Yt([]),P(!1);return}P(!0),u({type:"workspace.find",query:p})}function lc(p){dr.current=p,Re(hs),u({type:"workspace.find.agent",query:p})}function mo(){Wt(!1),wt(null),cn(null),Yt([]),Re(hs),It(null),dr.current="",al.current=null}function il(){const p=zn.current;p&&ll.current&&u({type:"side.reset",sessionId:p}),ll.current=null,ra(null),Wr(hs),rr(null),Ll({}),Aa.current=[]}function zu(p){u({type:"workspace.close",workspaceIds:p}),!(!fe||!p.includes(fe))&&(il(),at(null),Rt(null),V([]),ke([]),xt(hs),qt(null),Xe(!1))}function ac(p,L){u({type:"session.archive",workspaceId:p,sessionIds:L}),oe&&(L.includes(oe)||ne!=null&&ne.claudeSessionId&&L.includes(ne.claudeSessionId))&&(il(),Rt(null),xt(hs),qt(null),Xe(!1))}function gi(p){u({type:"workspace.restore",workspaceIds:p})}function Af(p,L,ce){u({type:"folder.create",scope:p,name:L,workspaceId:ce})}function Ds(p,L){u({type:"folder.rename",folderId:p,name:L})}function go(p,L){u({type:"folder.setColor",folderId:p,color:L})}function Il(p){u({type:"folder.delete",folderId:p})}function Iu(p,L,ce,Ue){u({type:"folder.assign",scope:p,itemId:L,folderId:ce,workspaceId:Ue})}function Ul(p,L=!1){Oe("sessions"),Te("live"),Ye&&Ye!==p.workspaceId&&ut(null),z.setView(null),z.markRead(p),St(!1),$.open(p.id,L),z.openConversation(p),(p.state==="closed"||p.state==="error")&&z.launchSession(p.workspaceId,p.provider,Gt(p),!1,p.id)}function gl(p,L=El[0]??"claude"){Oe("sessions"),Te("live"),z.setView(null),St(!1),ut(p),z.launchSession(p,L)}function ic(p,L){if(L==="settings"){os();return}if(L==="account"){ft();return}p.id!==oe&&Xs(p),I({sessionId:p.id,tool:L,toggle:p.id===oe})}b.useEffect(()=>{if(!E||E.sessionId!==oe)return;const p=E.tool;I(null),(p==="files"||p==="search"||p==="git")&&(ta(L=>p==="files"&&(!E.toggle||!L)),ii(L=>p==="search"&&(!E.toggle||!L)),rt(L=>p==="git"&&(!E.toggle||!L))),p==="terminal"&&lo(!0),p==="tasks"&&z.setView("tasks"),p==="extensions"&&In("mcp"),p==="ask"&&ia(!0)},[E,oe]),b.useEffect(()=>{ne&&!z.openedIds.includes(ne.id)&&z.openConversation(ne)},[ne==null?void 0:ne.id]);function Uu(p,L,ce,Ue,ht){Oe("sessions"),Te("live"),z.setView(null),ne&&z.openConversation(ne),js(p.workspaceId),s.current={requestId:"",draft:ht},u({type:"session.start",workspaceId:p.workspaceId,provider:L,taskParent:Gt(p),taskStage:ce,...Ue?{resume:Gt(p),fork:!0}:{}}),jt(!1)}function rc(p){z.setView(null),ut(p||null),Oe("sessions"),Te("all"),jt(!1)}function xo(){if(!oe)return;z.closeConversation(oe),Rt(null),pl.current=!0;const p={workspaceId:fe??"",sessionId:null,claudeSessionId:null};es.current=p;try{localStorage.setItem(Bp,JSON.stringify(p))}catch{}}function js(p){il(),Ia(),at(p),Rt(null),xt(hs),qt(null),Xe(!1),fn(null),Gs(null),Cl(null),jn(null),T(""),Wi(!1),Al(null),ea(!1),lr([]),sa(null)}function ca(p,L,ce){u({type:"session.pin",workspaceId:p,sessionIds:L,pinned:ce})}function xi(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function bi(p){if(xi(p)){ze(p);return}u({type:"session.close",sessionId:p.id})}function hr(p,L,ce){Mt(Ue=>{const ht=Ue??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!ce)return Ue;const Ut={...ht.sessions};return L&&L.length>0?Ut[ce]=L:delete Ut[ce],{...ht,sessions:Ut}}return{...ht,[p]:L??[]}}),u({type:"order.set",scope:p,ids:L,...ce?{workspaceId:ce}:{}})}function Xs(p){p.workspaceId!==fe&&js(p.workspaceId),Os(p)}function Os(p){if(jt(!1),il(),xt(hs),qt(null),Xe(!1),p.state==="closed"){Rt(null),u({type:"session.start",workspaceId:p.workspaceId,resume:p.id,provider:p.provider});return}Rt(p.id),u({type:"session.sync",sessionId:p.id,sinceSeq:0})}function oa(p,L=ne){const ce=(L==null?void 0:L.provider)!=="claude"?null:sE((L?z.usage[L.id]:null)??vn,An);return ce?new Promise(Ue=>{Ge(ht=>(ht==null||ht.resolve(!1),{warning:ce,resolve:Ue}))}).then(Ue=>(Ue&&p(),Ue)):(p(),!0)}function Qs(p){be&&(be.resolve(p),Ge(null))}function rl(p){const L=de.find(ce=>(ce.claudeSessionId??ce.id)===p.sessionId&&ce.state!=="closed");bo(p.workspaceId,p.sessionId,p.text),L&&u({type:"session.close",sessionId:L.id})}function Hl(p){bo(p.workspaceId,p.claudeSessionId??p.id,null)}function bo(p,L,ce){ur.current=ce===null?null:{workspaceId:p,text:ce},p!==fe?js(p):(il(),Rt(null),qt(null),xt(hs),Xe(!1)),u({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:L,...ce===null?{}:{fromHandoff:!0}}),jt(!1)}b.useEffect(()=>{Rs&&(En(null),rl(Rs))},[Rs]);function _o(p){Ms[p.id]||(rs(L=>({...L,[p.id]:!0})),u({type:"session.handoff",sessionId:p.id}))}function yo(p){u({type:"handoff.dismiss",sessionId:p})}function Hu(p,L){u({type:"session.rename",sessionId:p.id,title:L,workspaceId:p.workspaceId}),V(ce=>ce.map(Ue=>Ue.id===p.id?{...Ue,title:L}:Ue))}function In(p){oe&&(jt(!1),yn(null),Pn(null),un(p),u({type:"mcp.list",sessionId:oe}),u({type:"plugin.list",sessionId:oe}))}const nn={mcpAction:(p,L)=>{oe&&(yn(null),u({type:"mcp.action",sessionId:oe,name:p,action:L}))},mcpAuth:p=>{oe&&(yn(null),Pn({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),u({type:"mcp.auth",sessionId:oe,name:p}))},mcpAuthCallback:(p,L)=>{oe&&u({type:"mcp.auth_callback",sessionId:oe,name:p,callbackUrl:L})},mcpAdd:(p,L)=>{oe&&u({type:"mcp.add",sessionId:oe,name:p,draft:L})},mcpRemove:p=>{oe&&u({type:"mcp.remove",sessionId:oe,name:p})},pluginInstall:p=>{oe&&u({type:"plugin.install",sessionId:oe,spec:p})},pluginUninstall:p=>{oe&&u({type:"plugin.uninstall",sessionId:oe,id:p})},pluginToggle:(p,L)=>{oe&&u({type:"plugin.toggle",sessionId:oe,id:p,enabled:L})},marketplaceAdd:p=>{oe&&u({type:"marketplace.add",sessionId:oe,source:p})},marketplaceRemove:p=>{oe&&u({type:"marketplace.remove",sessionId:oe,name:p})}};function ft(){jt(!1),Nl(!0),u({type:"auth.status"})}const xl={login:(p,L)=>u({type:"auth.login",mode:p,switchAccount:L}),submitCode:p=>u({type:"auth.code",code:p}),cancel:()=>u({type:"auth.cancel"}),logout:()=>u({type:"auth.logout"})};function os(){jt(!1),Tl(!0),u({type:"settings.get"})}function vo(p){Sl(L=>L&&{...L,...p,startModels:{...L.startModels??{claude:L.startModel??null,codex:null,antigravity:null},...p.startModels}}),u({type:"settings.update",settings:p})}function ua(p){!oe||k||u({type:"side.ask",sessionId:oe,text:p})}function Bu(){oe&&(u({type:"side.reset",sessionId:oe}),ll.current=null,ra(null),Wr(hs),rr(null),Ll({}),Aa.current=[])}function _i(p){const L=ll.current;if(L){p(L);return}const ce=zn.current;ce&&(Aa.current.push(p),u({type:"side.open",sessionId:ce}))}function Da(){fe&&u({type:"git.state",workspaceId:fe})}function Oa(p){fe&&(Cl(p),u({type:"git.show",workspaceId:fe,ref:p}))}function cc(p,L){jn(null),Wn({target:p,label:L})}function pr(){!fe||!bs||(u({type:"git.checkout",workspaceId:fe,target:bs.target}),Wn(null))}function jo(){fe&&(jn(null),u({type:"git.push",workspaceId:fe}))}function La(p){fe&&(jn(null),u({type:"git.pull",workspaceId:fe,merge:p}))}function Bl(){fe&&(jn(null),Al(null),Wi(!0),u({type:"github.status"}),u({type:"github.owners"}),u({type:"git.files",workspaceId:fe}))}function da(p){fe&&(jn(null),u({type:"git.publish",workspaceId:fe,...p}))}function ql(p){fe&&(jn(null),u({type:"git.remote",workspaceId:fe,url:p}))}function wo(){jn(null),ea(!0)}function ko(p){u({type:"github.token",token:p}),u({type:"github.owners"})}function yi(){u({type:"github.status"}),u({type:"github.owners"})}b.useEffect(()=>{if(!(!$s||!fe))for(const p of Ta)p in Ml||u({type:"fs.list",workspaceId:fe,path:p})},[$s,Ta,Ml,fe,u]);function oc(p){er(L=>L.includes(p)?L.filter(ce=>ce!==p):[...L,p])}function za(p){if(!p){to(null);return}fe&&u({type:"fs.search",workspaceId:fe,query:p})}function Kn(p){if(!p){no(null);return}fe&&u({type:"fs.grep",workspaceId:fe,query:p})}const uc=b.useCallback((p,L)=>{Mu(ht=>({...ht,[p]:L}));const ce=Mn.current;if(L===null||!ce)return;const Ue=L.lastIndexOf("/");if(Ue!==-1){u({type:"fs.list",workspaceId:ce,path:L.slice(0,Ue)});return}if(L===""){u({type:"fs.list",workspaceId:ce,path:""});return}u({type:"fs.search",workspaceId:ce,query:L,scope:p})},[u]);b.useMemo(()=>k_(Qr.mention??null,li.mention??null,Ml),[Qr.mention,li.mention,Ml]);const qu=b.useMemo(()=>k_(Qr.side??null,li.side??null,Ml),[Qr.side,li.side,Ml]);function Mf(p){No(p.path,{line:p.line,column:p.column})}function Rf(p){const L=[];let ce=Ir(p.path);for(;L.push(ce),!!ce;)ce=Ir(ce);er(Ue=>{const ht=new Set(Ue);for(const Ut of L)ht.add(Ut);return p.kind==="dir"&&ht.add(p.path),[...ht]}),p.kind==="file"&&No(p.path)}function No(p,L){if(Vs.current.find(Ue=>Ue.path===p)){Dl(p),L&&so({path:p,...L,token:++Ou.current});return}fe&&(L&&(Zr.current={path:p,...L}),ml.current.add(p),u({type:"fs.read",workspaceId:fe,path:p}))}function wn(p,L=!1){const ce=Vs.current,Ue=ce.find(kn=>kn.path===p);if(Ue&&Pa(Ue)&&!L){sr(p);return}sr(null);const ht=ce.findIndex(kn=>kn.path===p),Ut=ce.filter(kn=>kn.path!==p);sl(Ut),Dl(kn=>{var Zs;return kn===p?((Zs=Ut[Math.min(ht,Ut.length-1)])==null?void 0:Zs.path)??null:kn})}function vi(p,L=!1){const ce=Vs.current.find(Ue=>Ue.path===p);!ce||!fe||!L&&!Pa(ce)||(fi.current.set(p,ce.text),u({type:"fs.write",workspaceId:fe,path:p,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...L?{force:!0}:{}}))}function mr(p){fe&&u({type:"fs.read",workspaceId:fe,path:p})}function gr(p){fe&&(fr.current.has(p)||(fr.current.add(p),u({type:"fs.readMedia",workspaceId:fe,path:p})))}const So=b.useRef(new Map);function ji(p){const L=So.current,ce=L.get(p);ce&&clearTimeout(ce);const Ue=(An==null?void 0:An.autoSaveAfterPauseMs)??0;Ue<=0||L.set(p,setTimeout(()=>{L.delete(p);const ht=Vs.current.find(Ut=>Ut.path===p);ht&&Pa(ht)&&!ht.stale&&vi(p)},Ue))}function wi(p,L,ce){if(!fe)return;const Ue=p?`${p}/${ce}`:ce;na(null),L==="file"&&(pi.current=Ue),u({type:"fs.create",workspaceId:fe,path:Ue,kind:L})}function Df(p,L){if(!fe)return;const ce=Ir(p),Ue=ce?`${ce}/${L}`:L;na(null),hi.current={from:p,to:Ue},u({type:"fs.rename",workspaceId:fe,path:p,to:Ue})}function Gu(p,L){if(!fe)return;const ce=p.slice(p.lastIndexOf("/")+1),Ue=L?`${L}/${ce}`:ce;Ue!==p&&(na(null),hi.current={from:p,to:Ue},u({type:"fs.rename",workspaceId:fe,path:p,to:Ue}))}function Of(p,L){fe&&(na(null),u({type:"fs.copy",workspaceId:fe,path:p,toDir:L}))}function $u(p){fe&&(na(null),Xr(null),u({type:"fs.delete",workspaceId:fe,path:p.path}),sl(L=>L.filter(ce=>ce.path!==p.path&&!ce.path.startsWith(`${p.path}/`))),Dl(L=>L&&(L===p.path||L.startsWith(`${p.path}/`))?null:L))}function Ia(){Rl({}),er([""]),sl([]),Dl(null),na(null),to(null),no(null),Mu({}),Ru({}),so(null),ml.current.clear(),fi.current.clear(),fr.current.clear(),Zr.current=null,hi.current=null,pi.current=null}function Eo(){!fe||Ol||!la||(ar(null),io.current=!0,u({type:"term.open",workspaceId:fe,cols:80,rows:24}))}function dc(p){u({type:"term.close",id:p})}b.useEffect(()=>{function p(L){if(L.key!=="Escape")return;if(hn!==null){const Ue=L.target;if(!(Ue instanceof HTMLElement&&Ue.closest(".termview, .editor, .sidepane"))){cr(null);return}}if(zl&&!L.defaultPrevented){const Ue=L.target;if(!(Ue instanceof HTMLElement&&Ue.closest('.termview, .editor, .sidepane, .modal-backdrop, [role="dialog"], [role="menu"]'))){L.preventDefault(),co();return}}if(!oe||Hn.pending.length>0)return;const ce=L.target;ce instanceof HTMLElement&&ce.closest('.sidepane, .editor, .session-pane, [role="dialog"], [role="menu"]')||u({type:"control.interrupt",sessionId:oe})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[oe,Hn.pending.length,u,hn,zl]),b.useEffect(()=>{function p(L){L.key!=="`"||!(L.ctrlKey||L.metaKey)||la&&(L.preventDefault(),lo(ce=>!ce))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[la]);const Yu=b.useMemo(()=>{const p=(Be==null?void 0:Be.commands)??[];return p.length===0||(ne==null?void 0:ne.provider)!=="claude"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...wp]},[Be,ne==null?void 0:ne.provider]);function ki(p){if((ne==null?void 0:ne.provider)==="codex"){if(p==="new"||p==="clear")return gl(ne.workspaceId,"codex"),!0;if(p==="resume")return z.setView("command"),!0;if(p==="stop")return u({type:"control.interrupt",sessionId:ne.id}),!0;if(p==="exit"||p==="quit")return u({type:"session.close",sessionId:ne.id}),xo(),!0}if(p==="fork"&&(ne==null?void 0:ne.provider)==="codex"&&oe&&!Ks){const ce=ne;return z.openConversation(ce),Rt(null),qt(null),xt(hs),u({type:"session.start",workspaceId:ce.workspaceId,provider:"codex",resume:ce.id,fork:!0}),!0}const L=yE[p];return L&&(ne==null?void 0:ne.provider)==="claude"?(In(L),!0):(ne==null?void 0:ne.provider)!=="claude"||!wp.some(ce=>ce.name===p)?!1:(ft(),p==="logout"&&xl.logout(),p==="switch-account"&&xl.login("claudeai",!0),!0)}const To=(ne==null?void 0:ne.state)==="waiting_permission",bl=(ne==null?void 0:ne.state)==="reconnecting",Ks=(ne==null?void 0:ne.state)==="running"||bl||To,Gl=Hn.pending[0]??null,Vu=Gl?jy(Gl.toolName,Gl.input):null,[Ua,Ni]=b.useState(()=>new Set);Gl&&Ua.has(Gl.requestId),Gl&&Gl.questions&&Gl.questions.length>0,b.useEffect(()=>{!tn&&!$s||!fe||Ks||u({type:"git.state",workspaceId:fe})},[tn,$s,fe,Ks,u]),b.useEffect(()=>{if(!(Ks||!fe)){$s&&Rl(p=>{const L={};for(const[ce,Ue]of Object.entries(p))tc.current.includes(ce)||(L[ce]=Ue);return L});for(const p of Vs.current)Pa(p)||u({type:"fs.read",workspaceId:fe,path:p.path})}},[Ks,fe,$s,u]),(ne==null?void 0:ne.cwd)??(Be==null||Be.cwd);const Co=(Be==null?void 0:Be.models)??[],xr=(ne==null?void 0:ne.model)??(Be==null?void 0:Be.model)??null,{rows:Ha,selected:br}=S_(Co,xr),fa=Ys?{model:Ys.model,effort:Ys.effort,ultracode:Ys.ultracode,thinking:Ys.thinking,switchOnFlag:Ys.switchModelsOnFlag}:{model:oi.model??xr,effort:oi.effort??(ne==null?void 0:ne.effort)??null,ultracode:oi.ultracode??(ne==null?void 0:ne.ultracode)??!1,thinking:oi.thinking??(ne==null?void 0:ne.thinking)??!0,switchOnFlag:oi.switchOnFlag??(ne==null?void 0:ne.switchModelsOnFlag)??!0},Si=S_(Co,fa.model),fc=(Ys==null?void 0:Ys.state)==="running",hc=Vr?Ca.find(p=>p.path===Vr)??null:null,Ba=new Set(Ca.filter(Pa).map(p=>p.path)),_r=p=>a.jsx(iE,{pane:p,width:mt.widths[p],onResize:L=>mt.setWidth(p,L),onReset:()=>mt.reset(p)}),Ls=p=>We?null:()=>Ef(p),Ao=(ne==null?void 0:ne.provider)==="codex"?G_:(ne==null?void 0:ne.provider)==="antigravity"?$_:Vp;Be&&(ne==null||ne.permissionMode,Ao.map(p=>({value:p.value,label:p.value,hint:p.hint}))),Ha.length>0&&(ne==null||ne.effort,ne==null||ne.ultracode,ne==null||ne.thinking,ne==null||ne.switchModelsOnFlag,ne==null||ne.provider,ne==null||ne.provider,ne==null||ne.provider),ne==null||ne.state;const pc=()=>{oe&&u({type:"session.reconnect",sessionId:oe})},ha=bl?"Сессия уже поднимает новый процесс":Ks?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён";oe&&(bl||(ne==null||ne.state));const pa=cs?a.jsx(FS,{handoff:cs,onContinue:()=>rl(cs),onShow:()=>fl(cs),onDismiss:()=>yo(cs.sessionId)}):null;ne&&ne.totalCostUsd>0&&`${ne.totalCostUsd.toFixed(3)}`,ne==null||ne.provider,ne&&ne.state;const $l=ne?Ms[ne.id]===!0:!1,yr=Dv({onLongPress:()=>{ne&&Hl(ne)},onClick:()=>{ne&&_o(ne)},disabled:$l});ne&&ne.state!=="closed"&&ne.provider==="claude"&&{className:$l||yr.holding,style:`${yr.thresholdMs}`,...yr.handlers};const Mo=hc?a.jsxs(a.Fragment,{children:[Ca.length>0&&a.jsx(m1,{files:Ca,activePath:Vr,busy:Ks,onSelect:Dl,onClose:p=>wn(p),zoomed:hn==="main",onToggleZoom:Ls("main")}),a.jsx(h1,{file:hc,goto:(Kr==null?void 0:Kr.path)===hc.path?Kr:null,onChange:(p,L)=>{sl(ce=>ce.map(Ue=>Ue.path===p?{...Ue,text:L}:Ue)),ji(p)},onSave:p=>vi(p),onReload:mr,onOverwrite:p=>vi(p,!0),onRequestMedia:gr,onTogglePreview:p=>sl(L=>L.map(ce=>ce.path===p?{...ce,previewMode:!ce.previewMode}:ce))})]}):void 0,vr=a.jsx(a.Fragment,{children:Fr&&la&&a.jsxs(a.Fragment,{children:[!We&&hn!=="terminal"&&a.jsx(cE,{height:ir.height,onResize:ir.setHeight,onReset:ir.reset}),a.jsx(fE,{mobile:We,zoomed:hn==="terminal",onToggleZoom:Ls("terminal"),terminals:Pr,activeId:ao,blocked:Ol,error:kf,onDismissError:()=>ar(null),height:We?Jr.height:ir.height,offset:We?{top:Jr.offsetTop,left:Jr.offsetLeft}:void 0,onSelect:sa,onOpen:Eo,onClose:dc,onInput:(p,L)=>u({type:"term.input",id:p,data:L}),onResize:(p,L,ce)=>u({type:"term.resize",id:p,cols:L,rows:ce}),onAttach:p=>u({type:"term.attach",id:p}),onHide:()=>lo(!1),registerSink:Nf})]})}),zs=dt??Ye??fe,Xu=(p=!1)=>a.jsx(T1,{dashboard:p,onAllProjects:()=>{St(!1),Oe("projects"),ut(null)},onCompareSession:L=>Ul(L,!0),open:p||Vn,connected:h,status:g,workspaces:G,archivedWorkspaces:H,workspaceFolders:O,sessionFolders:he.filter(L=>L.workspaceId===zs),pinnedFolders:we,sessions:N.filter(L=>L.workspaceId===zs&&(Lt==="all"||L.provider===Lt)),archived:ae.filter(L=>L.workspaceId===zs&&(Lt==="all"||L.provider===Lt)),pinned:C.filter(L=>Lt==="all"||L.provider===Lt),live:de.filter(L=>Lt==="all"||L.provider===Lt),listOrder:lt,liveSessionsFirst:(An==null?void 0:An.liveSessionsFirst)===!0,onReorder:hr,activeWorkspaceId:zs,activeSessionId:oe,onPinSessions:ca,onSelectPinned:Ul,onCloseWorkspaces:zu,onRestoreWorkspaces:gi,onArchiveSessions:ac,onUnarchiveSessions:L=>{zs&&u({type:"session.unarchive",workspaceId:zs,sessionIds:L})},onCreateFolder:Af,onRenameFolder:Ds,onSetFolderColor:go,onDeleteFolder:Il,onAssignToFolder:Iu,onSelectWorkspace:L=>{Ct(L),rc(L)},onSelectSession:Ul,onRenameSession:Hu,onStopSession:bi,onOpenWorkspace:()=>Wt(!0),onNewSession:L=>zs&&gl(zs,L),enabledProviders:El,onOpenExtensions:oe&&(ne==null?void 0:ne.provider)==="claude"?()=>In("mcp"):null,account:ni,onOpenAccount:ft,relay:_,onOpenRelay:q?null:()=>D(!0),onOpenSettings:os,themeMode:Qe,onCycleTheme:Vt,navigation:a.jsx(bk,{hub:z})},p?zs:"navigation");return a.jsxs("div",{className:"app app--workspace"+(Me?" app--running":" app--catalog")+(Me&&zl?" app--workspace-expanded":""),style:mt.style,children:[a.jsx(LN,{hub:z,workspaces:G,selectedWorkspaceId:Ye,providers:El,providerFilter:Lt,onProviderFilter:re,tab:Z,onTab:p=>{Oe(p),p==="pinned"&&ut(null)},connected:h,status:g,sessionView:Ee,onSessionView:Te,onOpenSession:Ul,onSelectWorkspace:(p,L)=>{ut(p||null),Oe("sessions"),L&&Te("all")},onNewSession:gl,onOpenWorkspace:()=>Wt(!0),onSettings:os,onAccount:ft,onRelay:()=>D(!0),onTheme:Vt,onPin:p=>ca(p.workspaceId,[p.id],!p.pinned),onManageProject:p=>{Ct(p),St(!0)}}),Cn&&a.jsx(ps,{title:dt?"Управление проектом":"Папки и архив проектов",className:"modal--hub modal--project-manager",onClose:()=>St(!1),children:Xu(dt!==null)}),a.jsx(Bw,{open:$s,tree:Ml,expanded:new Set(Ta),activePath:Vr,dirty:Ba,gitChanges:(At==null?void 0:At.changed)??[],result:jf,searchResult:wf,onSearch:za,onReveal:Rf,onToggle:oc,onOpen:No,onCreate:wi,onRename:Df,onMove:Gu,onCopy:Of,onDelete:Xr,onRefresh:()=>{na(null),Rl({}),Da()},onClose:()=>ta(!1),zoomed:hn==="files",onToggleZoom:Ls("files")}),$s&&hn!=="files"&&_r("files"),a.jsx(Fw,{open:ai,result:Du,onSearch:Kn,onOpenMatch:Mf,onClose:()=>ii(!1),zoomed:hn==="search",onToggleZoom:Ls("search")}),ai&&hn!=="search"&&_r("search"),a.jsx(ZN,{open:tn,state:At,result:si,selected:Ji,busy:hl,onRefresh:Da,onShow:Oa,onCheckout:cc,onPush:jo,onPull:La,onPublish:Bl,onConnectRemote:wo,onDismissResult:()=>jn(null),onClose:()=>rt(!1),zoomed:hn==="git",onToggleZoom:Ls("git")}),tn&&hn!=="git"&&_r("git"),a.jsx(TN,{controller:$,sessions:z.sessions,hidden:!Me,expanded:zl,onToggleExpanded:co,availableIds:Ve.filter(p=>(Lt==="all"||p.provider===Lt)&&(!Ye||p.workspaceId===Ye)).map(p=>p.id),onOpen:p=>Ul(z.sessions[p]),visibleIds:z.openedIds.filter(p=>z.sessions[p]&&Ur(z.sessions[p])&&(Lt==="all"||z.sessions[p].provider===Lt)&&(!Ye||z.sessions[p].workspaceId===Ye)),onClose:p=>{$.close(p),z.closeConversation(p),p===oe&&xo()},renderSession:p=>a.jsxs(NN,{sessionId:p,hub:z,workspaces:G,connected:h,suspended:!Me,networkBlocked:k,terminalEnabled:la,onTool:ic,onStop:bi,onPin:L=>ca(L.workspaceId,[L.id],!L.pinned),onClose:()=>{$.close(p),z.closeConversation(p)},onSend:(L,ce)=>oa(ce,L),onCommand:(L,ce)=>L.provider==="claude"&&["mcp","plugins","plugin"].includes(ce)?(ic(L,"extensions"),!0):L.provider==="claude"&&wp.some(Ue=>Ue.name===ce)?(ft(),!0):!1,editor:oe===p?Mo:void 0,footer:oe===p?vr:void 0,className:oe===p&&(hn==="main"||hn==="terminal")?"main--zoomed":void 0,children:[y&&k&&a.jsx(JS,{state:y}),oe===p&&pa]})}),a.jsx(bS,{open:aa,items:ci.items,busy:fc,ready:oe!==null,sendBlocked:k,commands:Yu,contextResult:qu,draftKey:oe,models:Si.rows,model:Si.selected,effort:fa.effort,ultracode:fa.ultracode,thinking:fa.thinking,switchOnFlag:fa.switchOnFlag,onContextSearch:p=>uc("side",p),onCommand:ki,onModel:p=>{p&&(Ll(L=>({...L,model:p})),_i(L=>u({type:"control.set_model",sessionId:L,model:p})))},onEffort:p=>{Ll(L=>({...L,effort:p,ultracode:!1})),_i(L=>u({type:"control.set_effort",sessionId:L,effort:p}))},onUltracode:p=>{Ll(L=>({...L,ultracode:p,...p?{effort:"xhigh"}:{}})),_i(L=>u({type:"control.set_ultracode",sessionId:L,enabled:p}))},onThinking:p=>{Ll(L=>({...L,thinking:p})),_i(L=>u({type:"control.set_thinking",sessionId:L,enabled:p}))},onSwitchOnFlag:p=>{Ll(L=>({...L,switchOnFlag:p})),_i(L=>u({type:"control.set_flag_switch",sessionId:L,enabled:p}))},onAsk:ua,onInterrupt:()=>{ro&&u({type:"control.interrupt",sessionId:ro})},onReset:Bu,onClose:()=>ia(!1),zoomed:hn==="ask",onToggleZoom:Ls("ask")}),aa&&hn!=="ask"&&_r("ask"),(tn||aa||$s||ai)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{rt(!1),ia(!1),ta(!1),ii(!1)}}),nl&&a.jsx(WN,{detail:nl,local:((At==null?void 0:At.hasRemote)??!1)&&(At==null?void 0:At.commits.some(p=>p.hash===nl.hash&&!p.pushed))===!0,onCheckout:cc,onClose:()=>{Gs(null),Cl(null)}}),be&&a.jsxs(ps,{title:"Лимит плана почти исчерпан",onClose:()=>Qs(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>Qs(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>Qs(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[gf[be.warning.limit][0].toUpperCase(),gf[be.warning.limit].slice(1)," использован на"," ",Math.round(be.warning.utilization)," %, сброс в"," ",lE(be.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),Ae&&a.jsx(ps,{title:"Остановить сессию?",onClose:()=>ze(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>ze(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{u({type:"session.close",sessionId:Ae.id}),ze(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),bs&&a.jsxs(ps,{title:"Переключить рабочее дерево?",onClose:()=>Wn(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Wn(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:pr,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",bs.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Ks&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),At&&At.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",At.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),$r&&a.jsx(fS,{status:ge,owners:bt,files:ys,defaultName:(vs==null?void 0:vs.name)??"",hasCommits:At===null||At.head!=="",busy:hl,result:si,onRefreshStatus:yi,onSaveToken:ko,onPublish:da,onDismissResult:()=>jn(null),onClose:()=>Wi(!1)}),Yr&&a.jsx(xS,{busy:hl,result:si,onSubmit:ql,onDismissResult:()=>jn(null),onClose:()=>ea(!1)}),tr&&a.jsx(ps,{title:tr.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Xr(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Xr(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>$u(tr),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[tr.path," будет удалён с диска",tr.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),nr&&a.jsx(ps,{title:"Закрыть без сохранения?",onClose:()=>sr(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>sr(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>wn(nr,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{vi(nr),wn(nr,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",nr," есть несохранённые правки."]})}),it&&a.jsx(yS,{tab:it,servers:Es,plugins:Cs,marketplaces:as,catalog:Zt,result:_n,auth:st,remote:q,actions:nn,onTab:un,onClose:()=>un(null)}),en&&a.jsx(CS,{status:ni,login:Wl,actions:xl,remote:q,runningSessions:N.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:oe?()=>{pc(),Nl(!1)}:null,reconnectBlocked:Ks,reconnectHint:ha,onClose:()=>Nl(!1)}),A&&a.jsx(OS,{state:_,onPair:(p,L)=>u({type:"relay.pair",code:p,...L?{name:L}:{}}),onUnpair:()=>u({type:"relay.unpair"}),onClose:()=>D(!1)}),Jn&&a.jsx(KS,{themeMode:Qe,onThemeChange:Je,settings:An,supportsProviderDefaults:z.supportsProviderDefaults,models:(ne==null?void 0:ne.provider)==="claude"?(Be==null?void 0:Be.models)??[]:[],providerModels:Object.fromEntries(["claude","codex","antigravity"].map(p=>{var L;return[p,((L=Object.entries(z.capabilities).find(([ce,Ue])=>{var ht;return((ht=z.sessions[ce])==null?void 0:ht.provider)===p&&Ue.models.length}))==null?void 0:L[1].models)??((ne==null?void 0:ne.provider)===p?(Be==null?void 0:Be.models)??[]:[])]})),relayState:_,networkState:y,local:ef()==="local",onChange:vo,onEnableShell:()=>u({type:"relay.shell.enable"}),onDisableShell:()=>u({type:"relay.shell.disable"}),onOpenRelay:()=>{Tl(!1),D(!0)},onClose:()=>Tl(!1)}),On&&a.jsx(UN,{candidates:bn,searching:zt,agentItems:pe.items,agentBusy:(Ze==null?void 0:Ze.state)==="running",error:rn,roots:xs,created:ls,onSearch:sc,onAskAgent:lc,onInterrupt:()=>{const p=di.current;p&&u({type:"control.interrupt",sessionId:p})},onSubmit:mi,onCreate:po,onClose:mo}),dn&&a.jsx(PS,{handoff:dn,onClose:()=>fl(null)}),a.jsx(_k,{providerFilter:Lt,hub:z,connected:h,workspaces:G,activeWorkspaceId:fe,activeSession:ne,providers:El,onSelectSession:Ul,onSelectWorkspace:rc,onOpenWorkspace:()=>{z.setView(null),Wt(!0)},onOpenSettings:()=>{z.setView(null),os()},onOpenFiles:()=>{z.setView(null),ta(!0),ii(!1),rt(!1)},onNewSession:gl,onStartStage:Uu}),a.jsx(tE,{notices:Ln,onDismiss:p=>Bn(L=>L.filter(ce=>ce.id!==p))})]})}function wE(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function kE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),a.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),a.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function NE(n,s){return E_(n)===E_(s)}function E_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function SE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const Uy=document.getElementById("root");if(!Uy)throw new Error("#root not found");iv.createRoot(Uy).render(a.jsx(b.StrictMode,{children:a.jsx(jE,{})}));export{lw as D,mn as I,xn as N,CE as P,wl as T,Pl as a,iy as b,tl as c,TE as d,dy as e,wu as f,ww as h,AE as p,ME as s,Le as t};