@i14ks/ccv 0.30.0 → 0.31.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 +20 -7
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-C4z5XNW9.js → codemirror-BdWXIyBE.js} +1 -1
  4. package/web/assets/{index-u00xWQNg.js → index-At4SIHW8.js} +1 -1
  5. package/web/assets/{index-po2296dn.js → index-B2LO0l57.js} +1 -1
  6. package/web/assets/{index-bPu_gqaI.js → index-BPJrlUj_.js} +1 -1
  7. package/web/assets/{index-CTg1EwJA.js → index-BUQkCY8p.js} +1 -1
  8. package/web/assets/{index-CQi4R7CF.js → index-BVZbJUdX.js} +1 -1
  9. package/web/assets/{index-C3JSbs5Y.js → index-BaGoVOX2.js} +1 -1
  10. package/web/assets/{index-Cxys5D35.js → index-BdM-YzrJ.js} +1 -1
  11. package/web/assets/{index-DztFqv4C.js → index-BrHQ2TSw.js} +1 -1
  12. package/web/assets/{index-Ca4B7wAH.js → index-BysIpqtT.js} +1 -1
  13. package/web/assets/{index-lk4qxiUA.js → index-C5zvd-WO.js} +1 -1
  14. package/web/assets/{index-txYMazKF.css → index-CHPLX3RU.css} +1 -1
  15. package/web/assets/{index-Cbicy5d2.js → index-CZ1qVXcb.js} +1 -1
  16. package/web/assets/{index-9Nat9dSu.js → index-Ca8CvnGG.js} +1 -1
  17. package/web/assets/{index-DfPLp5-Q.js → index-CaiMt4h0.js} +1 -1
  18. package/web/assets/{index-zXz6X_ro.js → index-CfeCkS4B.js} +1 -1
  19. package/web/assets/{index-Cc5e0VaU.js → index-CtJMqb_5.js} +1 -1
  20. package/web/assets/{index-BLhz6Q_f.js → index-CyKzgfHd.js} +1 -1
  21. package/web/assets/{index-K29cA4S6.js → index-D6yXt8v4.js} +1 -1
  22. package/web/assets/index-Dm1yPdNn.js +143 -0
  23. package/web/assets/{index-DL40CFHz.js → index-LJAvSv-o.js} +1 -1
  24. package/web/assets/{index-DuO49xlq.js → index-ZxlYmRHu.js} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-C1aD9jbe.js +0 -143
@@ -0,0 +1,143 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-D6yXt8v4.js","./index-BdM-YzrJ.js","./index-ZxlYmRHu.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-CtJMqb_5.js","./index-CaiMt4h0.js","./index-B2LO0l57.js","./index-BPJrlUj_.js","./index-CZ1qVXcb.js","./index-BrHQ2TSw.js","./index-LJAvSv-o.js","./index-BVZbJUdX.js","./index-BaGoVOX2.js","./index-C5zvd-WO.js","./index-At4SIHW8.js","./index-BysIpqtT.js","./index-Ca8CvnGG.js","./index-BUQkCY8p.js","./index-CyKzgfHd.js","./index-CfeCkS4B.js","./codemirror-BdWXIyBE.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 nn=(n,s,i)=>P0(n,typeof s!="symbol"?s+"":s,i),Jh=(n,s,i)=>s.has(n)||Kx("Cannot "+i);var et=(n,s,i)=>(Jh(n,s,"read from private field"),i?i.call(n):s.get(n)),jn=(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),Ht=(n,s,i,c)=>(Jh(n,s,"write to private field"),c?c.call(n,i):s.set(n,i),i),Gn=(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:{}},Zo={};/**
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 Zo;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 x in o)x!=="key"&&(u[x]=o[x])}else u=o;return o=u.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:u}}return Zo.Fragment=s,Zo.jsx=i,Zo.jsxs=i,Zo}var Fx;function W0(){return Fx||(Fx=1,Wh.exports=J0()),Wh.exports}var a=W0(),ep={exports:{}},rt={};/**
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 rt;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"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function N(E){return E===null||typeof E!="object"?null:(E=y&&E[y]||E["@@iterator"],typeof E=="function"?E:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function G(E,K,xe){this.props=E,this.context=K,this.refs=A,this.updater=xe||k}G.prototype.isReactComponent={},G.prototype.setState=function(E,K){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,K,"setState")},G.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Y(){}Y.prototype=G.prototype;function X(E,K,xe){this.props=E,this.context=K,this.refs=A,this.updater=xe||k}var B=X.prototype=new Y;B.constructor=X,T(B,G.prototype),B.isPureReactComponent=!0;var R=Array.isArray;function L(){}var H={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function O(E,K,xe){var ke=xe.ref;return{$$typeof:n,type:E,key:K,ref:ke!==void 0?ke:null,props:xe}}function I(E,K){return O(E.type,K,E.props)}function M(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function P(E){var K={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(xe){return K[xe]})}var re=/\/+/g;function _e(E,K){return typeof E=="object"&&E!==null&&E.key!=null?P(""+E.key):K.toString(36)}function we(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(L,L):(E.status="pending",E.then(function(K){E.status==="pending"&&(E.status="fulfilled",E.value=K)},function(K){E.status==="pending"&&(E.status="rejected",E.reason=K)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function q(E,K,xe,ke,Re){var me=typeof E;(me==="undefined"||me==="boolean")&&(E=null);var He=!1;if(E===null)He=!0;else switch(me){case"bigint":case"string":case"number":He=!0;break;case"object":switch(E.$$typeof){case n:case s:He=!0;break;case _:return He=E._init,q(He(E._payload),K,xe,ke,Re)}}if(He)return Re=Re(E),He=ke===""?"."+_e(E,0):ke,R(Re)?(xe="",He!=null&&(xe=He.replace(re,"$&/")+"/"),q(Re,K,xe,"",function(sn){return sn})):Re!=null&&(M(Re)&&(Re=I(Re,xe+(Re.key==null||E&&E.key===Re.key?"":(""+Re.key).replace(re,"$&/")+"/")+He)),K.push(Re)),1;He=0;var tt=ke===""?".":ke+":";if(R(E))for(var ot=0;ot<E.length;ot++)ke=E[ot],me=tt+_e(ke,ot),He+=q(ke,K,xe,me,Re);else if(ot=N(E),typeof ot=="function")for(E=ot.call(E),ot=0;!(ke=E.next()).done;)ke=ke.value,me=tt+_e(ke,ot++),He+=q(ke,K,xe,me,Re);else if(me==="object"){if(typeof E.then=="function")return q(we(E),K,xe,ke,Re);throw K=String(E),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return He}function $(E,K,xe){if(E==null)return E;var ke=[],Re=0;return q(E,ke,"","",function(me){return K.call(xe,me,Re++)}),ke}function W(E){if(E._status===-1){var K=E._result;K=K(),K.then(function(xe){(E._status===0||E._status===-1)&&(E._status=1,E._result=xe)},function(xe){(E._status===0||E._status===-1)&&(E._status=2,E._result=xe)}),E._status===-1&&(E._status=0,E._result=K)}if(E._status===1)return E._result.default;throw E._result}var Q=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=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(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},ve={map:$,forEach:function(E,K,xe){$(E,function(){K.apply(this,arguments)},xe)},count:function(E){var K=0;return $(E,function(){K++}),K},toArray:function(E){return $(E,function(K){return K})||[]},only:function(E){if(!M(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return rt.Activity=v,rt.Children=ve,rt.Component=G,rt.Fragment=i,rt.Profiler=o,rt.PureComponent=X,rt.StrictMode=c,rt.Suspense=p,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,rt.__COMPILER_RUNTIME={__proto__:null,c:function(E){return H.H.useMemoCache(E)}},rt.cache=function(E){return function(){return E.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(E,K,xe){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ke=T({},E.props),Re=E.key;if(K!=null)for(me in K.key!==void 0&&(Re=""+K.key),K)!D.call(K,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&K.ref===void 0||(ke[me]=K[me]);var me=arguments.length-2;if(me===1)ke.children=xe;else if(1<me){for(var He=Array(me),tt=0;tt<me;tt++)He[tt]=arguments[tt+2];ke.children=He}return O(E.type,Re,ke)},rt.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},rt.createElement=function(E,K,xe){var ke,Re={},me=null;if(K!=null)for(ke in K.key!==void 0&&(me=""+K.key),K)D.call(K,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(Re[ke]=K[ke]);var He=arguments.length-2;if(He===1)Re.children=xe;else if(1<He){for(var tt=Array(He),ot=0;ot<He;ot++)tt[ot]=arguments[ot+2];Re.children=tt}if(E&&E.defaultProps)for(ke in He=E.defaultProps,He)Re[ke]===void 0&&(Re[ke]=He[ke]);return O(E,me,Re)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(E){return{$$typeof:x,render:E}},rt.isValidElement=M,rt.lazy=function(E){return{$$typeof:_,_payload:{_status:-1,_result:E},_init:W}},rt.memo=function(E,K){return{$$typeof:g,type:E,compare:K===void 0?null:K}},rt.startTransition=function(E){var K=H.T,xe={};H.T=xe;try{var ke=E(),Re=H.S;Re!==null&&Re(xe,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(L,Q)}catch(me){Q(me)}finally{K!==null&&xe.types!==null&&(K.types=xe.types),H.T=K}},rt.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},rt.use=function(E){return H.H.use(E)},rt.useActionState=function(E,K,xe){return H.H.useActionState(E,K,xe)},rt.useCallback=function(E,K){return H.H.useCallback(E,K)},rt.useContext=function(E){return H.H.useContext(E)},rt.useDebugValue=function(){},rt.useDeferredValue=function(E,K){return H.H.useDeferredValue(E,K)},rt.useEffect=function(E,K){return H.H.useEffect(E,K)},rt.useEffectEvent=function(E){return H.H.useEffectEvent(E)},rt.useId=function(){return H.H.useId()},rt.useImperativeHandle=function(E,K,xe){return H.H.useImperativeHandle(E,K,xe)},rt.useInsertionEffect=function(E,K){return H.H.useInsertionEffect(E,K)},rt.useLayoutEffect=function(E,K){return H.H.useLayoutEffect(E,K)},rt.useMemo=function(E,K){return H.H.useMemo(E,K)},rt.useOptimistic=function(E,K){return H.H.useOptimistic(E,K)},rt.useReducer=function(E,K,xe){return H.H.useReducer(E,K,xe)},rt.useRef=function(E){return H.H.useRef(E)},rt.useState=function(E){return H.H.useState(E)},rt.useSyncExternalStore=function(E,K,xe){return H.H.useSyncExternalStore(E,K,xe)},rt.useTransition=function(){return H.H.useTransition()},rt.version="19.2.8",rt}var Jx;function qp(){return Jx||(Jx=1,ep.exports=ev()),ep.exports}var b=qp(),tp={exports:{}},Fo={},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(q,$){var W=q.length;q.push($);e:for(;0<W;){var Q=W-1>>>1,ve=q[Q];if(0<o(ve,$))q[Q]=$,q[W]=ve,W=Q;else break e}}function i(q){return q.length===0?null:q[0]}function c(q){if(q.length===0)return null;var $=q[0],W=q.pop();if(W!==$){q[0]=W;e:for(var Q=0,ve=q.length,E=ve>>>1;Q<E;){var K=2*(Q+1)-1,xe=q[K],ke=K+1,Re=q[ke];if(0>o(xe,W))ke<ve&&0>o(Re,xe)?(q[Q]=Re,q[ke]=W,Q=ke):(q[Q]=xe,q[K]=W,Q=K);else if(ke<ve&&0>o(Re,W))q[Q]=Re,q[ke]=W,Q=ke;else break e}}return $}function o(q,$){var W=q.sortIndex-$.sortIndex;return W!==0?W:q.id-$.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,x=h.now();n.unstable_now=function(){return h.now()-x}}var p=[],g=[],_=1,v=null,y=3,N=!1,k=!1,T=!1,A=!1,G=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function B(q){for(var $=i(g);$!==null;){if($.callback===null)c(g);else if($.startTime<=q)c(g),$.sortIndex=$.expirationTime,s(p,$);else break;$=i(g)}}function R(q){if(T=!1,B(q),!k)if(i(p)!==null)k=!0,L||(L=!0,P());else{var $=i(g);$!==null&&we(R,$.startTime-q)}}var L=!1,H=-1,D=5,O=-1;function I(){return A?!0:!(n.unstable_now()-O<D)}function M(){if(A=!1,L){var q=n.unstable_now();O=q;var $=!0;try{e:{k=!1,T&&(T=!1,Y(H),H=-1),N=!0;var W=y;try{t:{for(B(q),v=i(p);v!==null&&!(v.expirationTime>q&&I());){var Q=v.callback;if(typeof Q=="function"){v.callback=null,y=v.priorityLevel;var ve=Q(v.expirationTime<=q);if(q=n.unstable_now(),typeof ve=="function"){v.callback=ve,B(q),$=!0;break t}v===i(p)&&c(p),B(q)}else c(p);v=i(p)}if(v!==null)$=!0;else{var E=i(g);E!==null&&we(R,E.startTime-q),$=!1}}break e}finally{v=null,y=W,N=!1}$=void 0}}finally{$?P():L=!1}}}var P;if(typeof X=="function")P=function(){X(M)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,_e=re.port2;re.port1.onmessage=M,P=function(){_e.postMessage(null)}}else P=function(){G(M,0)};function we(q,$){H=G(function(){q(n.unstable_now())},$)}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(q){q.callback=null},n.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<q?Math.floor(1e3/q):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(q){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var W=y;y=$;try{return q()}finally{y=W}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(q,$){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var W=y;y=q;try{return $()}finally{y=W}},n.unstable_scheduleCallback=function(q,$,W){var Q=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Q+W:Q):W=Q,q){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=W+ve,q={id:_++,callback:$,priorityLevel:q,startTime:W,expirationTime:ve,sortIndex:-1},W>Q?(q.sortIndex=W,s(g,q),i(p)===null&&q===i(g)&&(T?(Y(H),H=-1):T=!0,we(R,W-Q))):(q.sortIndex=ve,s(p,q),k||N||(k=!0,L||(L=!0,P()))),q},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(q){var $=y;return function(){var W=y;y=$;try{return q.apply(this,arguments)}finally{y=W}}}})(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(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)g+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+p+"; visit "+g+" 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(p,g,_){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:p,containerInfo:g,implementation:_}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ks.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ks.createPortal=function(p,g){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(s(299));return u(p,g,null,_)},ks.flushSync=function(p){var g=h.T,_=c.p;try{if(h.T=null,c.p=2,p)return p()}finally{h.T=g,c.p=_,c.d.f()}},ks.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,c.d.C(p,g))},ks.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},ks.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var _=g.as,v=x(_,g.crossOrigin),y=typeof g.integrity=="string"?g.integrity:void 0,N=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;_==="style"?c.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:N}):_==="script"&&c.d.X(p,{crossOrigin:v,integrity:y,fetchPriority:N,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ks.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var _=x(g.as,g.crossOrigin);c.d.M(p,{crossOrigin:_,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&c.d.M(p)},ks.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var _=g.as,v=x(_,g.crossOrigin);c.d.L(p,_,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},ks.preloadModule=function(p,g){if(typeof p=="string")if(g){var _=x(g.as,g.crossOrigin);c.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:_,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else c.d.m(p)},ks.requestFormReset=function(p){c.d.r(p)},ks.unstable_batchedUpdates=function(p,g){return p(g)},ks.useFormState=function(p,g,_){return h.H.useFormState(p,g,_)},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 Fo;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 x(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 p(e){if(u(e)!==e)throw Error(c(188))}function g(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 p(d),e;if(f===r)return p(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"),N=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),X=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=M&&e[M]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function _e(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case G:return"Profiler";case A:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case O:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case X:return e.displayName||"Context";case Y:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:_e(e.type)||"Memo";case D:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var we=Array.isArray,q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Q=[],ve=-1;function E(e){return{current:e}}function K(e){0>ve||(e.current=Q[ve],Q[ve]=null,ve--)}function xe(e,t){ve++,Q[ve]=e.current,e.current=t}var ke=E(null),Re=E(null),me=E(null),He=E(null);function tt(e,t){switch(xe(me,t),xe(Re,e),xe(ke,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(ke),xe(ke,e)}function ot(){K(ke),K(Re),K(me)}function sn(e){e.memoizedState!==null&&xe(He,e);var t=ke.current,l=bx(t,e.type);t!==l&&(xe(Re,e),xe(ke,l))}function de(e){Re.current===e&&(K(ke),K(Re)),He.current===e&&(K(He),Vo._currentValue=W)}var st,oe;function Rt(e){if(st===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);st=t&&t[1]||"",oe=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+st+e+oe}var qe=!1;function Bt(e,t){if(!e||qe)return"";qe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ae){var le=ae}Reflect.construct(e,[],be)}else{try{be.call()}catch(ae){le=ae}e.call(be.prototype)}}else{try{throw Error()}catch(ae){le=ae}(be=e())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ae){if(ae&&le&&typeof ae.stack=="string")return[ae.stack,le.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
+ `),ne=w.split(`
46
+ `);for(d=r=0;r<U.length&&!U[r].includes("DetermineComponentFrameRoot");)r++;for(;d<ne.length&&!ne[d].includes("DetermineComponentFrameRoot");)d++;if(r===U.length||d===ne.length)for(r=U.length-1,d=ne.length-1;1<=r&&0<=d&&U[r]!==ne[d];)d--;for(;1<=r&&0<=d;r--,d--)if(U[r]!==ne[d]){if(r!==1||d!==1)do if(r--,d--,0>d||U[r]!==ne[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{qe=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Rt(l):""}function On(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 Bt(e.type,!1);case 11:return Bt(e.type.render,!1);case 1:return Bt(e.type,!0);case 31:return Rt("Activity");default:return""}}function xt(e){try{var t="",l=null;do t+=On(e,l),l=e,e=e.return;while(e);return t}catch(r){return`
48
+ Error generating stack: `+r.message+`
49
+ `+r.stack}}var Zt=Object.prototype.hasOwnProperty,on=n.unstable_scheduleCallback,Yn=n.unstable_cancelCallback,jt=n.unstable_shouldYield,Z=n.unstable_requestPaint,De=n.unstable_now,Ke=n.unstable_getCurrentPriorityLevel,ut=n.unstable_ImmediatePriority,Ee=n.unstable_UserBlockingPriority,Ce=n.unstable_NormalPriority,Oe=n.unstable_LowPriority,$e=n.unstable_IdlePriority,Ie=n.log,Pe=n.unstable_setDisableYieldValue,pt=null,wt=null;function Lt(e){if(typeof Ie=="function"&&Pe(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(pt,e)}catch{}}var Xt=Math.clz32?Math.clz32:je,_s=Math.log,ie=Math.LN2;function je(e){return e>>>=0,e===0?32:31-(_s(e)/ie|0)|0}var Xe=256,at=262144,Je=4194304;function ln(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vn(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=ln(r):(j&=w,j!==0?d=ln(j):l||(l=w&~e,l!==0&&(d=ln(l))))):(w=r&~f,w!==0?d=ln(w):j!==0?d=ln(j):l||(l=r&~e,l!==0&&(d=ln(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 gn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function un(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 Ft(){var e=Je;return Je<<=1,(Je&62914560)===0&&(Je=4194304),e}function zt(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function J(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fe(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,ne=e.hiddenUpdates;for(l=j&~l;0<l;){var ue=31-Xt(l),be=1<<ue;w[ue]=0,U[ue]=-1;var le=ne[ue];if(le!==null)for(ne[ue]=null,ue=0;ue<le.length;ue++){var ae=le[ue];ae!==null&&(ae.lane&=-536870913)}l&=~be}r!==0&&Me(e,r,0),f!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=f&~(j&~t))}function Me(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xt(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-Xt(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:an(l),(l&(e.suspendedLanes|t))!==0?0:l}function an(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 Et(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ys(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:qx(e.type))}function Xn(e,t){var l=$.p;try{return $.p=e,t()}finally{$.p=l}}var is=Math.random().toString(36).slice(2),dn="__reactFiber$"+is,lt="__reactProps$"+is,_n="__reactContainer$"+is,Es="__reactEvents$"+is,Ts="__reactListeners$"+is,Cs="__reactHandles$"+is,rs="__reactResources$"+is,cs="__reactMarker$"+is;function os(e){delete e[dn],delete e[lt],delete e[Es],delete e[Ts],delete e[Cs]}function qt(e){var t=e[dn];if(t)return t;for(var l=e.parentNode;l;){if(t=l[_n]||l[dn]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Nx(e);e!==null;){if(l=e[dn])return l;e=Nx(e)}return t}e=l,l=e.parentNode}return null}function Is(e){if(e=e[dn]||e[_n]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(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[rs];return t||(t=e[rs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[cs]=!0}var Jn=new Set,Qn={};function Wn(e,t){Tn(e,t),Tn(e+"Capture",t)}function Tn(e,t){for(Qn[e]=t,e=0;e<t.length;e++)Jn.add(t[e])}var wl=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]*$"),Us={},es={};function Hs(e){return Zt.call(es,e)?!0:Zt.call(Us,e)?!1:wl.test(e)?es[e]=!0:(Us[e]=!0,!1)}function wn(e,t,l){if(Hs(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 Tt(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 Ln(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 Gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ii(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xa(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 Yl(e){if(!e._valueTracker){var t=ii(e)?"checked":"value";e._valueTracker=xa(e,t,""+e[t])}}function ba(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),r="";return e&&(r=ii(e)?e.checked?"true":"false":e.value),e=r,e!==l?(t.setValue(e),!0):!1}function zn(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 ri=/[\n"\\]/g;function vn(e){return e.replace(ri,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Vl(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=""+Gt(t)):e.value!==""+Gt(t)&&(e.value=""+Gt(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?us(e,j,Gt(t)):l!=null?us(e,j,Gt(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=""+Gt(w):e.removeAttribute("name")}function kl(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)){Yl(e);return}l=l!=null?""+Gt(l):"",t=t!=null?""+Gt(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),Yl(e)}function us(e,t,l){t==="number"&&zn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function As(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=""+Gt(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 Ne(e,t,l){if(t!=null&&(t=""+Gt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Gt(l):""}function C(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=Gt(t),e.defaultValue=l,r=e.textContent,r===l&&r!==""&&r!==null&&(e.value=r),Yl(e)}function ee(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 Te(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 ze(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&&Te(e,d,r)}else for(var f in t)t.hasOwnProperty(f)&&Te(e,f,t[f])}function Fe(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 $t=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 In(e){return mt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function it(){}var Cn=null;function St(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bs=null,qs=null;function _a(e){var t=Is(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Vl(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="'+vn(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var r=l[t];if(r!==e&&r.form===e.form){var d=r[lt]||null;if(!d)throw Error(c(90));Vl(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&&ba(r)}break e;case"textarea":Ne(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&As(e,!!l.multiple,t,!1)}}}var ya=!1;function Hr(e,t,l){if(ya)return e(t,l);ya=!0;try{var r=e(t);return r}finally{if(ya=!1,(Bs!==null||qs!==null)&&(fd(),Bs&&(t=Bs,e=qs,qs=Bs=null,_a(t),e)))for(t=0;t<e.length;t++)_a(e[t])}}function el(e,t){var l=e.stateNode;if(l===null)return null;var r=l[lt]||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 tl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ms=!1;if(tl)try{var Xl={};Object.defineProperty(Xl,"passive",{get:function(){Ms=!0}}),window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{Ms=!1}var S=null,pe=null,Ue=null;function bt(){if(Ue)return Ue;var e,t=pe,l=t.length,r,d="value"in S?S.value:S.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 Ue=d.slice(e,1<r?1-r:void 0)}function Kn(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 vs(){return!0}function Fi(){return!1}function kn(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)?vs:Fi,this.isPropagationStopped=Fi,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=vs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=vs)},persist:function(){},isPersistent:vs}),t}var nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},va=kn(nl),Ql=v({},nl,{view:0,detail:0}),ja=kn(Ql),Rs,ci,sl,Br=v({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ui,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!==sl&&(sl&&e.type==="mousemove"?(Rs=e.screenX-sl.screenX,ci=e.screenY-sl.screenY):ci=Rs=0,sl=e),Rs)},movementY:function(e){return"movementY"in e?e.movementY:ci}}),Nl=kn(Br),Pi=v({},Br,{dataTransfer:0}),qr=kn(Pi),Ji=v({},Ql,{relatedTarget:0}),oi=kn(Ji),kf=v({},nl,{animationName:0,elapsedTime:0,pseudoElement:0}),no=kn(kf),Gr=v({},nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wu=kn(Gr),$r=v({},nl,{data:0}),so=kn($r),Wi={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yr={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"},Nf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lo(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nf[e])?!!t[e]:!1}function ui(){return lo}var ao=v({},Ql,{key:function(e){if(e.key){var t=Wi[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Kn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ui,charCode:function(e){return e.type==="keypress"?Kn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ku=kn(ao),Vr=v({},Br,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),er=kn(Vr),io=v({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ui}),Xr=kn(io),tr=v({},nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sf=kn(tr),Qr=v({},Br,{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}),Ef=kn(Qr),Kr=v({},nl,{newState:0,oldState:0}),Zr=kn(Kr),ro=[9,13,27,32],wa=tl&&"CompositionEvent"in window,ll=null;tl&&"documentMode"in document&&(ll=document.documentMode);var Fr=tl&&"TextEvent"in window&&!ll,Pr=tl&&(!wa||ll&&8<ll&&11>=ll),Nu=" ",Kl=!1;function di(e,t){switch(e){case"keyup":return ro.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function co(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sl=!1;function Su(e,t){switch(e){case"compositionend":return co(t);case"keypress":return t.which!==32?null:(Kl=!0,Nu);case"textInput":return e=t.data,e===Nu&&Kl?null:e;default:return null}}function Jr(e,t){if(Sl)return e==="compositionend"||!wa&&di(e,t)?(e=bt(),Ue=pe=S=null,Sl=!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 Pr&&t.locale!=="ko"?null:t.data;default:return null}}var El={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 nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!El[e.type]:t==="textarea"}function fi(e,t,l,r){Bs?qs?qs.push(r):qs=[r]:Bs=r,t=_d(t,"onChange"),0<t.length&&(l=new va("onChange","change",null,l,r),e.push({event:l,listeners:t}))}var al=null,Tl=null;function xn(e){dx(e,0)}function hi(e){var t=Pt(e);if(ba(t))return e}function Eu(e,t){if(e==="change")return t}var Tu=!1;if(tl){var pi;if(tl){var Zl="oninput"in document;if(!Zl){var An=document.createElement("div");An.setAttribute("oninput","return;"),Zl=typeof An.oninput=="function"}pi=Zl}else pi=!1;Tu=pi&&(!document.documentMode||9<document.documentMode)}function sr(){al&&(al.detachEvent("onpropertychange",lr),Tl=al=null)}function lr(e){if(e.propertyName==="value"&&hi(Tl)){var t=[];fi(t,Tl,e,St(e)),Hr(xn,t)}}function Cu(e,t,l){e==="focusin"?(sr(),al=t,Tl=l,al.attachEvent("onpropertychange",lr)):e==="focusout"&&sr()}function Un(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hi(Tl)}function Au(e,t){if(e==="click")return hi(t)}function Mu(e,t){if(e==="input"||e==="change")return hi(t)}function Cl(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var js=typeof Object.is=="function"?Object.is:Cl;function Fl(e,t){if(js(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(!Zt.call(t,d)||!js(e[d],t[d]))return!1}return!0}function ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mi(e,t){var l=ar(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=ar(l)}}function Pl(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pl(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=zn(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=zn(e.document)}return t}function ka(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 Wr=tl&&"documentMode"in document&&11>=document.documentMode,fl=null,Na=null,gi=null,Sa=!1;function Ru(e,t,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Sa||fl==null||fl!==zn(r)||(r=fl,"selectionStart"in r&&ka(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}),gi&&Fl(gi,r)||(gi=r,r=_d(Na,"onSelect"),0<r.length&&(t=new va("onSelect","select",null,t,l),e.push({event:t,listeners:r}),t.target=fl)))}function hl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ea={animationend:hl("Animation","AnimationEnd"),animationiteration:hl("Animation","AnimationIteration"),animationstart:hl("Animation","AnimationStart"),transitionrun:hl("Transition","TransitionRun"),transitionstart:hl("Transition","TransitionStart"),transitioncancel:hl("Transition","TransitionCancel"),transitionend:hl("Transition","TransitionEnd")},se={},xi={};tl&&(xi=document.createElement("div").style,"AnimationEvent"in window||(delete Ea.animationend.animation,delete Ea.animationiteration.animation,delete Ea.animationstart.animation),"TransitionEvent"in window||delete Ea.transitionend.transition);function il(e){if(se[e])return se[e];if(!Ea[e])return e;var t=Ea[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in xi)return se[e]=t[l];return e}var Tf=il("animationend"),ec=il("animationiteration"),Du=il("animationstart"),Cf=il("transitionrun"),Af=il("transitionstart"),Mf=il("transitioncancel"),Ou=il("transitionend"),bi=new Map,uo="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(" ");uo.push("scrollEnd");function rl(e,t){bi.set(e,t),Wn(t,[e])}var tc=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)},Gs=[],_i=0,fo=0;function nc(){for(var e=_i,t=fo=_i=0;t<e;){var l=Gs[t];Gs[t++]=null;var r=Gs[t];Gs[t++]=null;var d=Gs[t];Gs[t++]=null;var f=Gs[t];if(Gs[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&&ho(l,d,f)}}function sc(e,t,l,r){Gs[_i++]=e,Gs[_i++]=t,Gs[_i++]=l,Gs[_i++]=r,fo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ta(e,t,l,r){return sc(e,t,l,r),lc(e)}function pl(e,t){return sc(e,null,null,t),lc(e)}function ho(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-Xt(l),e=f.hiddenUpdates,r=e[d],r===null?e[d]=[t]:r.push(t),t.lane=l|536870912),f):null}function lc(e){if(50<Uo)throw Uo=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 Ca={};function Lu(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 Lu(e,t,l,r)}function ir(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Al(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 ac(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 ic(e,t,l,r,d,f){var j=0;if(r=e,typeof e=="function")ir(e)&&(j=1);else if(typeof e=="string")j=U0(e,l,ke.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case O:return e=ds(31,l,t,d),e.elementType=O,e.lanes=f,e;case T:return Aa(l.children,d,f,t);case A:j=8,d|=24;break;case G:return e=ds(12,l,t,d|2),e.elementType=G,e.lanes=f,e;case R:return e=ds(13,l,t,d),e.elementType=R,e.lanes=f,e;case L:return e=ds(19,l,t,d),e.elementType=L,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:j=10;break e;case Y:j=9;break e;case B:j=11;break e;case H:j=14;break e;case D: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 Aa(e,t,l,r){return e=ds(7,e,r,t),e.lanes=l,e}function rc(e,t,l){return e=ds(6,e,null,t),e.lanes=l,e}function zu(e){var t=ds(18,null,null,0);return t.stateNode=e,t}function rr(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 po=new WeakMap;function $s(e,t){if(typeof e=="object"&&e!==null){var l=po.get(e);return l!==void 0?l:(t={value:e,source:t,stack:xt(t)},po.set(e,t),t)}return{value:e,source:t,stack:xt(t)}}var Ma=[],yi=0,cc=null,cr=0,ws=[],Ys=0,Vs=null,Xs=1,Ds="";function Ml(e,t){Ma[yi++]=cr,Ma[yi++]=cc,cc=e,cr=t}function Iu(e,t,l){ws[Ys++]=Xs,ws[Ys++]=Ds,ws[Ys++]=Vs,Vs=e;var r=Xs;e=Ds;var d=32-Xt(r)-1;r&=~(1<<d),l+=1;var f=32-Xt(t)+d;if(30<f){var j=d-d%5;f=(r&(1<<j)-1).toString(32),r>>=j,d-=j,Xs=1<<32-Xt(t)+d|l<<d|r,Ds=f+e}else Xs=1<<f|l<<d|r,Ds=e}function mo(e){e.return!==null&&(Ml(e,1),Iu(e,1,0))}function Ra(e){for(;e===cc;)cc=Ma[--yi],Ma[yi]=null,cr=Ma[--yi],Ma[yi]=null;for(;e===Vs;)Vs=ws[--Ys],ws[Ys]=null,Ds=ws[--Ys],ws[Ys]=null,Xs=ws[--Ys],ws[Ys]=null}function go(e,t){ws[Ys++]=Xs,ws[Ys++]=Ds,ws[Ys++]=Vs,Xs=t.id,Ds=t.overflow,Vs=e}var Zn=null,Jt=null,_t=!1,Jl=null,Qs=!1,xo=Error(c(519));function Wl(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw or($s(t,e)),xo}function Uu(e){var t=e.stateNode,l=e.type,r=e.memoizedProps;switch(t[dn]=e,t[lt]=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<Bo.length;l++)vt(Bo[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),kl(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),C(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=it),t=!0):t=!1,t||Wl(e,!0)}function Hu(e){for(Zn=e.return;Zn;)switch(Zn.tag){case 5:case 31:case 13:Qs=!1;return;case 27:case 3:Qs=!0;return;default:Zn=Zn.return}}function vi(e){if(e!==Zn)return!1;if(!_t)return Hu(e),_t=!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&&Jt&&Wl(e),Hu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Jt=kx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Jt=kx(e)}else t===27?(t=Jt,Ri(e.type)?(e=Gh,Gh=null,Jt=e):Jt=t):Jt=Zn?bl(e.stateNode.nextSibling):null;return!0}function Da(){Jt=Zn=null,_t=!1}function bo(){var e=Jl;return e!==null&&(Ps===null?Ps=e:Ps.push.apply(Ps,e),Jl=null),e}function or(e){Jl===null?Jl=[e]:Jl.push(e)}var _o=E(null),Oa=null,Rl=null;function ea(e,t,l){xe(_o,t._currentValue),t._currentValue=l}function Dl(e){e._currentValue=_o.current,K(_o)}function ur(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 dr(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),ur(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),ur(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 Ol(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;js(d.pendingProps.value,j.value)||(e!==null?e.push(w):e=[w])}}else if(d===He.current){if(j=d.alternate,j===null)throw Error(c(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Vo):e=[Vo])}d=d.return}e!==null&&dr(t,e,l,r),t.flags|=262144}function oc(e){for(e=e.firstContext;e!==null;){if(!js(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function La(e){Oa=e,Rl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Fn(e){return Bu(Oa,e)}function uc(e,t){return Oa===null&&La(e),Bu(e,t)}function Bu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Rl===null){if(e===null)throw Error(c(308));Rl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Rl=Rl.next=t;return l}var Rf=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()})}},Df=n.unstable_scheduleCallback,Of=n.unstable_NormalPriority,Nn={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yo(){return{controller:new Rf,data:new Map,refCount:0}}function fr(e){e.refCount--,e.refCount===0&&Df(Of,function(){e.controller.abort()})}var hr=null,vo=0,ji=0,wi=null;function za(e,t){if(hr===null){var l=hr=[];vo=0,ji=Th(),wi={status:"pending",value:void 0,then:function(r){l.push(r)}}}return vo++,t.then(ml,ml),t}function ml(){if(--vo===0&&hr!==null){wi!==null&&(wi.status="fulfilled");var e=hr;hr=null,ji=0,wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ta(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 qu=q.S;q.S=function(e,t){Hg=De(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&za(e,t),qu!==null&&qu(e,t)};var Ia=E(null);function Gu(){var e=Ia.current;return e!==null?e:rn.pooledCache}function pr(e,t){t===null?xe(Ia,Ia.current):xe(Ia,t.pool)}function mr(){var e=Gu();return e===null?null:{parent:Nn._currentValue,pool:e}}var Ua=Error(c(460)),jo=Error(c(474)),na=Error(c(542)),gr={then:function(){}};function $u(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dc(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(it,it),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yu(e),e;default:if(typeof t.status=="string")t.then(it,it);else{if(e=rn,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,Yu(e),e}throw gl=t,Ua}}function Ha(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(gl=l,Ua):l}}var gl=null;function Ba(){if(gl===null)throw Error(c(459));var e=gl;return gl=null,e}function Yu(e){if(e===Ua||e===na)throw Error(c(483))}var qa=null,xr=0;function fc(e){var t=xr;return xr+=1,qa===null&&(qa=[]),dc(qa,e,t)}function Ll(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ki(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 Vu(e){function t(F,V){if(e){var te=F.deletions;te===null?(F.deletions=[V],F.flags|=16):te.push(V)}}function l(F,V){if(!e)return null;for(;V!==null;)t(F,V),V=V.sibling;return null}function r(F){for(var V=new Map;F!==null;)F.key!==null?V.set(F.key,F):V.set(F.index,F),F=F.sibling;return V}function d(F,V){return F=Al(F,V),F.index=0,F.sibling=null,F}function f(F,V,te){return F.index=te,e?(te=F.alternate,te!==null?(te=te.index,te<V?(F.flags|=67108866,V):te):(F.flags|=67108866,V)):(F.flags|=1048576,V)}function j(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function w(F,V,te,he){return V===null||V.tag!==6?(V=rc(te,F.mode,he),V.return=F,V):(V=d(V,te),V.return=F,V)}function U(F,V,te,he){var Qe=te.type;return Qe===T?ue(F,V,te.props.children,he,te.key):V!==null&&(V.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===D&&Ha(Qe)===V.type)?(V=d(V,te.props),Ll(V,te),V.return=F,V):(V=ic(te.type,te.key,te.props,null,F.mode,he),Ll(V,te),V.return=F,V)}function ne(F,V,te,he){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=rr(te,F.mode,he),V.return=F,V):(V=d(V,te.children||[]),V.return=F,V)}function ue(F,V,te,he,Qe){return V===null||V.tag!==7?(V=Aa(te,F.mode,he,Qe),V.return=F,V):(V=d(V,te),V.return=F,V)}function be(F,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=rc(""+V,F.mode,te),V.return=F,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case N:return te=ic(V.type,V.key,V.props,null,F.mode,te),Ll(te,V),te.return=F,te;case k:return V=rr(V,F.mode,te),V.return=F,V;case D:return V=Ha(V),be(F,V,te)}if(we(V)||P(V))return V=Aa(V,F.mode,te,null),V.return=F,V;if(typeof V.then=="function")return be(F,fc(V),te);if(V.$$typeof===X)return be(F,uc(F,V),te);ki(F,V)}return null}function le(F,V,te,he){var Qe=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Qe!==null?null:w(F,V,""+te,he);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case N:return te.key===Qe?U(F,V,te,he):null;case k:return te.key===Qe?ne(F,V,te,he):null;case D:return te=Ha(te),le(F,V,te,he)}if(we(te)||P(te))return Qe!==null?null:ue(F,V,te,he,null);if(typeof te.then=="function")return le(F,V,fc(te),he);if(te.$$typeof===X)return le(F,V,uc(F,te),he);ki(F,te)}return null}function ae(F,V,te,he,Qe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return F=F.get(te)||null,w(V,F,""+he,Qe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case N:return F=F.get(he.key===null?te:he.key)||null,U(V,F,he,Qe);case k:return F=F.get(he.key===null?te:he.key)||null,ne(V,F,he,Qe);case D:return he=Ha(he),ae(F,V,te,he,Qe)}if(we(he)||P(he))return F=F.get(te)||null,ue(V,F,he,Qe,null);if(typeof he.then=="function")return ae(F,V,te,fc(he),Qe);if(he.$$typeof===X)return ae(F,V,te,uc(V,he),Qe);ki(V,he)}return null}function Ge(F,V,te,he){for(var Qe=null,Dt=null,Ye=V,ht=V=0,Nt=null;Ye!==null&&ht<te.length;ht++){Ye.index>ht?(Nt=Ye,Ye=null):Nt=Ye.sibling;var Ot=le(F,Ye,te[ht],he);if(Ot===null){Ye===null&&(Ye=Nt);break}e&&Ye&&Ot.alternate===null&&t(F,Ye),V=f(Ot,V,ht),Dt===null?Qe=Ot:Dt.sibling=Ot,Dt=Ot,Ye=Nt}if(ht===te.length)return l(F,Ye),_t&&Ml(F,ht),Qe;if(Ye===null){for(;ht<te.length;ht++)Ye=be(F,te[ht],he),Ye!==null&&(V=f(Ye,V,ht),Dt===null?Qe=Ye:Dt.sibling=Ye,Dt=Ye);return _t&&Ml(F,ht),Qe}for(Ye=r(Ye);ht<te.length;ht++)Nt=ae(Ye,F,ht,te[ht],he),Nt!==null&&(e&&Nt.alternate!==null&&Ye.delete(Nt.key===null?ht:Nt.key),V=f(Nt,V,ht),Dt===null?Qe=Nt:Dt.sibling=Nt,Dt=Nt);return e&&Ye.forEach(function(Ii){return t(F,Ii)}),_t&&Ml(F,ht),Qe}function We(F,V,te,he){if(te==null)throw Error(c(151));for(var Qe=null,Dt=null,Ye=V,ht=V=0,Nt=null,Ot=te.next();Ye!==null&&!Ot.done;ht++,Ot=te.next()){Ye.index>ht?(Nt=Ye,Ye=null):Nt=Ye.sibling;var Ii=le(F,Ye,Ot.value,he);if(Ii===null){Ye===null&&(Ye=Nt);break}e&&Ye&&Ii.alternate===null&&t(F,Ye),V=f(Ii,V,ht),Dt===null?Qe=Ii:Dt.sibling=Ii,Dt=Ii,Ye=Nt}if(Ot.done)return l(F,Ye),_t&&Ml(F,ht),Qe;if(Ye===null){for(;!Ot.done;ht++,Ot=te.next())Ot=be(F,Ot.value,he),Ot!==null&&(V=f(Ot,V,ht),Dt===null?Qe=Ot:Dt.sibling=Ot,Dt=Ot);return _t&&Ml(F,ht),Qe}for(Ye=r(Ye);!Ot.done;ht++,Ot=te.next())Ot=ae(Ye,F,ht,Ot.value,he),Ot!==null&&(e&&Ot.alternate!==null&&Ye.delete(Ot.key===null?ht:Ot.key),V=f(Ot,V,ht),Dt===null?Qe=Ot:Dt.sibling=Ot,Dt=Ot);return e&&Ye.forEach(function(Z0){return t(F,Z0)}),_t&&Ml(F,ht),Qe}function tn(F,V,te,he){if(typeof te=="object"&&te!==null&&te.type===T&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case N:e:{for(var Qe=te.key;V!==null;){if(V.key===Qe){if(Qe=te.type,Qe===T){if(V.tag===7){l(F,V.sibling),he=d(V,te.props.children),he.return=F,F=he;break e}}else if(V.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===D&&Ha(Qe)===V.type){l(F,V.sibling),he=d(V,te.props),Ll(he,te),he.return=F,F=he;break e}l(F,V);break}else t(F,V);V=V.sibling}te.type===T?(he=Aa(te.props.children,F.mode,he,te.key),he.return=F,F=he):(he=ic(te.type,te.key,te.props,null,F.mode,he),Ll(he,te),he.return=F,F=he)}return j(F);case k:e:{for(Qe=te.key;V!==null;){if(V.key===Qe)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){l(F,V.sibling),he=d(V,te.children||[]),he.return=F,F=he;break e}else{l(F,V);break}else t(F,V);V=V.sibling}he=rr(te,F.mode,he),he.return=F,F=he}return j(F);case D:return te=Ha(te),tn(F,V,te,he)}if(we(te))return Ge(F,V,te,he);if(P(te)){if(Qe=P(te),typeof Qe!="function")throw Error(c(150));return te=Qe.call(te),We(F,V,te,he)}if(typeof te.then=="function")return tn(F,V,fc(te),he);if(te.$$typeof===X)return tn(F,V,uc(F,te),he);ki(F,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(l(F,V.sibling),he=d(V,te),he.return=F,F=he):(l(F,V),he=rc(te,F.mode,he),he.return=F,F=he),j(F)):l(F,V)}return function(F,V,te,he){try{xr=0;var Qe=tn(F,V,te,he);return qa=null,Qe}catch(Ye){if(Ye===Ua||Ye===na)throw Ye;var Dt=ds(29,Ye,null,F.mode);return Dt.lanes=he,Dt.return=F,Dt}finally{}}}var Ga=Vu(!0),xl=Vu(!1),sa=!1;function hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function m(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 z(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ce(e,t,l){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ut&2)!==0){var d=r.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),r.pending=t,t=lc(e),ho(e,null,l),t}return sc(e,r,t,l),lc(e)}function Be(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 ft(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 Mn=!1;function fs(){if(Mn){var e=wi;if(e!==null)throw e}}function zl(e,t,l,r){Mn=!1;var d=e.updateQueue;sa=!1;var f=d.firstBaseUpdate,j=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var U=w,ne=U.next;U.next=null,j===null?f=ne:j.next=ne,j=U;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,w=ue.lastBaseUpdate,w!==j&&(w===null?ue.firstBaseUpdate=ne:w.next=ne,ue.lastBaseUpdate=U))}if(f!==null){var be=d.baseState;j=0,ue=ne=U=null,w=f;do{var le=w.lane&-536870913,ae=le!==w.lane;if(ae?(kt&le)===le:(r&le)===le){le!==0&&le===ji&&(Mn=!0),ue!==null&&(ue=ue.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Ge=e,We=w;le=t;var tn=l;switch(We.tag){case 1:if(Ge=We.payload,typeof Ge=="function"){be=Ge.call(tn,be,le);break e}be=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=We.payload,le=typeof Ge=="function"?Ge.call(tn,be,le):Ge,le==null)break e;be=v({},be,le);break e;case 2:sa=!0}}le=w.callback,le!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=d.callbacks,ae===null?d.callbacks=[le]:ae.push(le))}else ae={lane:le,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ue===null?(ne=ue=ae,U=be):ue=ue.next=ae,j|=le;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;ae=w,w=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);ue===null&&(U=be),d.baseState=U,d.firstBaseUpdate=ne,d.lastBaseUpdate=ue,f===null&&(d.shared.lanes=0),Ei|=j,e.lanes=j,e.memoizedState=be}}function wo(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function ko(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)wo(l[e],t)}var $a=E(null),br=E(0);function No(e,t){e=Ja,xe(br,e),xe($a,t),Ja=e|t.baseLanes}function pc(){xe(br,Ja),xe($a,$a.current)}function mc(){Ja=br.current,K($a),K(br)}var ge=E(null),Se=null;function Ve(e){var t=e.alternate;xe(Rn,Rn.current&1),xe(ge,e),Se===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(Se=e)}function gt(e){xe(Rn,Rn.current),xe(ge,e),Se===null&&(Se=e)}function Mt(e){e.tag===22?(xe(Rn,Rn.current),xe(ge,e),Se===null&&(Se=e)):ts()}function ts(){xe(Rn,Rn.current),xe(ge,ge.current)}function Os(e){K(ge),Se===e&&(Se=null),K(Rn)}var Rn=E(0);function Xu(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 Ya=0,dt=null,Wt=null,Hn=null,Qu=!1,gc=!1,_r=!1,Ku=0,So=0,xc=null,Hy=0;function Sn(){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(!js(e[l],t[l]))return!1;return!0}function zf(e,t,l,r,d,f){return Ya=f,dt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?Fm:Pf,_r=!1,f=l(r,d),_r=!1,gc&&(f=mm(t,l,r,d)),pm(e),f}function pm(e){q.H=Co;var t=Wt!==null&&Wt.next!==null;if(Ya=0,Hn=Wt=dt=null,Qu=!1,So=0,xc=null,t)throw Error(c(300));e===null||Bn||(e=e.dependencies,e!==null&&oc(e)&&(Bn=!0))}function mm(e,t,l,r){dt=e;var d=0;do{if(gc&&(xc=null),So=0,gc=!1,25<=d)throw Error(c(301));if(d+=1,Hn=Wt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}q.H=Pm,f=t(l,r)}while(gc);return f}function By(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?Eo(t):t,e=e.useState()[0],(Wt!==null?Wt.memoizedState:null)!==e&&(dt.flags|=1024),t}function If(){var e=Ku!==0;return Ku=0,e}function Uf(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Hf(e){if(Qu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qu=!1}Ya=0,Hn=Wt=dt=null,gc=!1,So=Ku=0,xc=null}function Ls(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?dt.memoizedState=Hn=e:Hn=Hn.next=e,Hn}function Dn(){if(Wt===null){var e=dt.alternate;e=e!==null?e.memoizedState:null}else e=Wt.next;var t=Hn===null?dt.memoizedState:Hn.next;if(t!==null)Hn=t,Wt=e;else{if(e===null)throw dt.alternate===null?Error(c(467)):Error(c(310));Wt=e,e={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Hn===null?dt.memoizedState=Hn=e:Hn=Hn.next=e}return Hn}function Zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=So;return So+=1,xc===null&&(xc=[]),e=dc(xc,e,t),t=dt,(Hn===null?t.memoizedState:Hn.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?Fm:Pf),e}function Fu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Eo(e);if(e.$$typeof===X)return Fn(e)}throw Error(c(438,String(e)))}function Bf(e){var t=null,l=dt.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var r=dt.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=Zu(),dt.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]=I;return t.index++,l}function Va(e,t){return typeof t=="function"?t(e):t}function Pu(e){var t=Dn();return qf(t,Wt,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,ne=t,ue=!1;do{var be=ne.lane&-536870913;if(be!==ne.lane?(kt&be)===be:(Ya&be)===be){var le=ne.revertLane;if(le===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),be===ji&&(ue=!0);else if((Ya&le)===le){ne=ne.next,le===ji&&(ue=!0);continue}else be={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},U===null?(w=U=be,j=f):U=U.next=be,dt.lanes|=le,Ei|=le;be=ne.action,_r&&l(f,be),f=ne.hasEagerState?ne.eagerState:l(f,be)}else le={lane:be,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},U===null?(w=U=le,j=f):U=U.next=le,dt.lanes|=be,Ei|=be;ne=ne.next}while(ne!==null&&ne!==t);if(U===null?j=f:U.next=w,!js(f,e.memoizedState)&&(Bn=!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=Dn(),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);js(f,t.memoizedState)||(Bn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),l.lastRenderedState=f}return[f,r]}function gm(e,t,l){var r=dt,d=Dn(),f=_t;if(f){if(l===void 0)throw Error(c(407));l=l()}else l=t();var j=!js((Wt||d).memoizedState,l);if(j&&(d.memoizedState=l,Bn=!0),d=d.queue,Vf(_m.bind(null,r,d,e),[e]),d.getSnapshot!==t||j||Hn!==null&&Hn.memoizedState.tag&1){if(r.flags|=2048,bc(9,{destroy:void 0},bm.bind(null,r,d,l,t),null),rn===null)throw Error(c(349));f||(Ya&127)!==0||xm(r,t,l)}return l}function xm(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=dt.updateQueue,t===null?(t=Zu(),dt.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!js(e,l)}catch{return!0}}function vm(e){var t=pl(e,2);t!==null&&Js(t,e,2)}function $f(e){var t=Ls();if(typeof e=="function"){var l=e;if(e=l(),_r){Lt(!0);try{l()}finally{Lt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:e},t}function jm(e,t,l,r){return e.baseState=l,qf(e,Wt,typeof r=="function"?r:Va)}function qy(e,t,l,r,d){if(ed(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)}};q.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=q.T,j={};q.T=j;try{var w=l(d,r),U=q.S;U!==null&&U(j,w),km(e,t,w)}catch(ne){Yf(e,t,ne)}finally{f!==null&&j.types!==null&&(f.types=j.types),q.T=f}}else try{f=l(d,r),km(e,t,f)}catch(ne){Yf(e,t,ne)}}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(_t){var l=rn.formState;if(l!==null){e:{var r=dt;if(_t){if(Jt){t:{for(var d=Jt,f=Qs;d.nodeType!==8;){if(!f){d=null;break t}if(d=bl(d.nextSibling),d===null){d=null;break t}}f=d.data,d=f==="F!"||f==="F"?d:null}if(d){Jt=bl(d.nextSibling),r=d.data==="F!";break e}}Wl(r)}r=!1}r&&(t=l[0])}}return l=Ls(),l.memoizedState=l.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Em,lastRenderedState:t},l.queue=r,l=Qm.bind(null,dt,r),r.dispatch=l,r=$f(!1),f=Ff.bind(null,dt,!1,r.queue),r=Ls(),d={state:t,dispatch:null,action:e,pending:null},r.queue=d,l=qy.bind(null,dt,d,f,l),d.dispatch=l,r.memoizedState=e,[t,l,!1]}function Cm(e){var t=Dn();return Am(t,Wt,e)}function Am(e,t,l){if(t=qf(e,t,Em)[0],e=Pu(Va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Eo(t)}catch(j){throw j===Ua?na:j}else r=t;t=Dn();var d=t.queue,f=d.dispatch;return l!==t.memoizedState&&(dt.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=Dn(),l=Wt;if(l!==null)return Am(t,l,e);Dn(),t=t.memoizedState,l=Dn();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=dt.updateQueue,t===null&&(t=Zu(),dt.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 Dn().memoizedState}function Ju(e,t,l,r){var d=Ls();dt.flags|=e,d.memoizedState=bc(1|t,{destroy:void 0},l,r===void 0?null:r)}function Wu(e,t,l,r){var d=Dn();r=r===void 0?null:r;var f=d.memoizedState.inst;Wt!==null&&r!==null&&Lf(r,Wt.memoizedState.deps)?d.memoizedState=bc(t,f,l,r):(dt.flags|=e,d.memoizedState=bc(1|t,f,l,r))}function Dm(e,t){Ju(8390656,8,e,t)}function Vf(e,t){Wu(2048,8,e,t)}function $y(e){dt.flags|=4;var t=dt.updateQueue;if(t===null)t=Zu(),dt.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Om(e){var t=Dn().memoizedState;return $y({ref:t,nextImpl:e}),function(){if((Ut&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Lm(e,t){return Wu(4,2,e,t)}function zm(e,t){return Wu(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,Wu(4,4,Im.bind(null,t,e),l)}function Xf(){}function Hm(e,t){var l=Dn();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=Dn();t=t===void 0?null:t;var r=l.memoizedState;if(t!==null&&Lf(t,r[1]))return r[0];if(r=e(),_r){Lt(!0);try{e()}finally{Lt(!1)}}return l.memoizedState=[r,t],r}function Qf(e,t,l){return l===void 0||(Ya&1073741824)!==0&&(kt&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=qg(),dt.lanes|=e,Ei|=e,l)}function qm(e,t,l,r){return js(l,t)?l:$a.current!==null?(e=Qf(e,l,r),js(e,t)||(Bn=!0),e):(Ya&42)===0||(Ya&1073741824)!==0&&(kt&261930)===0?(Bn=!0,e.memoizedState=l):(e=qg(),dt.lanes|=e,Ei|=e,t)}function Gm(e,t,l,r,d){var f=$.p;$.p=f!==0&&8>f?f:8;var j=q.T,w={};q.T=w,Ff(e,!1,t,l);try{var U=d(),ne=q.S;if(ne!==null&&ne(w,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ue=ta(U,r);To(e,t,ue,ul(e))}else To(e,t,r,ul(e))}catch(be){To(e,t,{then:function(){},status:"rejected",reason:be},ul())}finally{$.p=f,j!==null&&w.types!==null&&(j.types=w.types),q.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,W,l===null?Yy:function(){return Ym(e),l(r)})}function $m(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:W},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,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),To(e,t.next.queue,{},ul())}function Zf(){return Fn(Vo)}function Vm(){return Dn().memoizedState}function Xm(){return Dn().memoizedState}function Vy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=ul();e=z(l);var r=ce(t,e,l);r!==null&&(Js(r,t,l),Be(r,t,l)),t={cache:yo()},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},ed(e)?Km(t,l):(l=Ta(e,t,l,r),l!==null&&(Js(l,e,r),Zm(l,t,r)))}function Qm(e,t,l){var r=ul();To(e,t,l,r)}function To(e,t,l,r){var d={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ed(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,js(w,j))return sc(e,t,d,0),rn===null&&nc(),!1}catch{}finally{}if(l=Ta(e,t,d,r),l!==null)return Js(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},ed(e)){if(t)throw Error(c(479))}else t=Ta(e,l,r,2),t!==null&&Js(t,e,2)}function ed(e){var t=e.alternate;return e===dt||t!==null&&t===dt}function Km(e,t){gc=Qu=!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 Co={readContext:Fn,use:Fu,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn};Co.useEffectEvent=Sn;var Fm={readContext:Fn,use:Fu,useCallback:function(e,t){return Ls().memoizedState=[e,t===void 0?null:t],e},useContext:Fn,useEffect:Dm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ju(4194308,4,Im.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ju(4194308,4,e,t)},useInsertionEffect:function(e,t){Ju(4,2,e,t)},useMemo:function(e,t){var l=Ls();t=t===void 0?null:t;var r=e();if(_r){Lt(!0);try{e()}finally{Lt(!1)}}return l.memoizedState=[r,t],r},useReducer:function(e,t,l){var r=Ls();if(l!==void 0){var d=l(t);if(_r){Lt(!0);try{l(t)}finally{Lt(!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,dt,e),[r.memoizedState,e]},useRef:function(e){var t=Ls();return e={current:e},t.memoizedState=e},useState:function(e){e=$f(e);var t=e.queue,l=Qm.bind(null,dt,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Ls();return Qf(l,e,t)},useTransition:function(){var e=$f(!1);return e=Gm.bind(null,dt,e.queue,!0,!1),Ls().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var r=dt,d=Ls();if(_t){if(l===void 0)throw Error(c(407));l=l()}else{if(l=t(),rn===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=Ls(),t=rn.identifierPrefix;if(_t){var l=Ds,r=Xs;l=(r&~(1<<32-Xt(r)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ku++,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=Ls();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,dt,!0,l),l.dispatch=t,[e,t]},useMemoCache:Bf,useCacheRefresh:function(){return Ls().memoizedState=Vy.bind(null,dt)},useEffectEvent:function(e){var t=Ls(),l={impl:e};return t.memoizedState=l,function(){if((Ut&2)!==0)throw Error(c(440));return l.impl.apply(void 0,arguments)}}},Pf={readContext:Fn,use:Fu,useCallback:Hm,useContext:Fn,useEffect:Vf,useImperativeHandle:Um,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Bm,useReducer:Pu,useRef:Rm,useState:function(){return Pu(Va)},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Dn();return qm(l,Wt.memoizedState,e,t)},useTransition:function(){var e=Pu(Va)[0],t=Dn().memoizedState;return[typeof e=="boolean"?e:Eo(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:Zf,useFormState:Cm,useActionState:Cm,useOptimistic:function(e,t){var l=Dn();return jm(l,Wt,e,t)},useMemoCache:Bf,useCacheRefresh:Xm};Pf.useEffectEvent=Om;var Pm={readContext:Fn,use:Fu,useCallback:Hm,useContext:Fn,useEffect:Vf,useImperativeHandle:Um,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Bm,useReducer:Gf,useRef:Rm,useState:function(){return Gf(Va)},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Dn();return Wt===null?Qf(l,e,t):qm(l,Wt.memoizedState,e,t)},useTransition:function(){var e=Gf(Va)[0],t=Dn().memoizedState;return[typeof e=="boolean"?e:Eo(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:Zf,useFormState:Mm,useActionState:Mm,useOptimistic:function(e,t){var l=Dn();return Wt!==null?jm(l,Wt,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=z(r);d.payload=t,l!=null&&(d.callback=l),t=ce(e,d,r),t!==null&&(Js(t,e,r),Be(t,e,r))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var r=ul(),d=z(r);d.tag=1,d.payload=t,l!=null&&(d.callback=l),t=ce(e,d,r),t!==null&&(Js(t,e,r),Be(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=ul(),r=z(l);r.tag=2,t!=null&&(r.callback=t),t=ce(e,r,l),t!==null&&(Js(t,e,l),Be(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?!Fl(l,r)||!Fl(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 yr(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){tc(e)}function tg(e){console.error(e)}function ng(e){tc(e)}function td(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=z(l),l.tag=3,l.payload={element:null},l.callback=function(){td(e,t)},l}function lg(e){return e=z(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"&&(Ti===null?Ti=new Set([this]):Ti.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&&Ol(t,l,d,!0),l=ge.current,l!==null){switch(l.tag){case 31:case 13:return Se===null?hd():l.alternate===null&&En===0&&(En=3),l.flags&=-257,l.flags|=65536,l.lanes=d,r===gr?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===gr?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),hd(),!1}if(_t)return t=ge.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,r!==xo&&(e=Error(c(422),{cause:r}),or($s(e,l)))):(r!==xo&&(t=Error(c(423),{cause:r}),or($s(t,l))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,r=$s(r,l),d=eh(e.stateNode,r,d),ft(e,d),En!==4&&(En=2)),!1;var f=Error(c(520),{cause:r});if(f=$s(f,l),Io===null?Io=[f]:Io.push(f),En!==4&&(En=2),t===null)return!0;r=$s(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),ft(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"&&(Ti===null||!Ti.has(f))))return l.flags|=65536,d&=-d,l.lanes|=d,d=lg(d),ag(d,e,l,r),ft(l,d),!1}l=l.return}while(l!==null);return!1}var th=Error(c(461)),Bn=!1;function hs(e,t,l,r){t.child=e===null?xl(t,null,l,r):Ga(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 La(t),r=zf(e,t,l,j,f,d),w=If(),e!==null&&!Bn?(Uf(e,t,d),Xa(e,t,d)):(_t&&w&&mo(t),t.flags|=1,hs(e,t,r,d),t.child)}function rg(e,t,l,r,d){if(e===null){var f=l.type;return typeof f=="function"&&!ir(f)&&f.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=f,cg(e,t,f,r,d)):(e=ic(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:Fl,l(j,r)&&e.ref===t.ref)return Xa(e,t,d)}return t.flags|=1,e=Al(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(Fl(f,r)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=r=f,oh(e,d))(e.flags&131072)!==0&&(Bn=!0);else return t.lanes=e.lanes,Xa(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&&pr(t,f!==null?f.cachePool:null),f!==null?No(t,f):pc(),Mt(t);else return r=t.lanes=536870912,ug(e,t,f!==null?f.baseLanes|l:l,l,r)}else f!==null?(pr(t,f.cachePool),No(t,f),ts(),t.memoizedState=null):(e!==null&&pr(t,null),pc(),ts());return hs(e,t,d,l),t.child}function Ao(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=Gu();return f=f===null?null:{parent:Nn._currentValue,pool:f},t.memoizedState={baseLanes:l,cachePool:f},e!==null&&pr(t,null),pc(),Mt(t),e!==null&&Ol(e,t,r,!0),t.childLanes=d,null}function nd(e,t){return t=ld({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 Ga(t,e.child,null,l),e=nd(t,t.pendingProps),e.flags|=2,Os(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(_t){if(r.mode==="hidden")return e=nd(t,r),t.lanes=536870912,Ao(null,e);if(gt(t),(e=Jt)?(e=wx(e,Qs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vs!==null?{id:Xs,overflow:Ds}:null,retryLane:536870912,hydrationErrors:null},l=zu(e),l.return=t,t.child=l,Zn=t,Jt=null)):e=null,e===null)throw Wl(t);return t.lanes=536870912,null}return nd(t,r)}var f=e.memoizedState;if(f!==null){var j=f.dehydrated;if(gt(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(Bn||Ol(e,t,l,!1),d=(l&e.childLanes)!==0,Bn||d){if(r=rn,r!==null&&(j=It(r,l),j!==0&&j!==f.retryLane))throw f.retryLane=j,pl(e,j),Js(r,e,j),th;hd(),t=dg(e,t,l)}else e=f.treeContext,Jt=bl(j.nextSibling),Zn=t,_t=!0,Jl=null,Qs=!1,e!==null&&go(t,e),t=nd(t,r),t.flags|=4096;return t}return e=Al(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sd(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 La(t),l=zf(e,t,l,r,void 0,d),r=If(),e!==null&&!Bn?(Uf(e,t,d),Xa(e,t,d)):(_t&&r&&mo(t),t.flags|=1,hs(e,t,l,d),t.child)}function fg(e,t,l,r,d,f){return La(t),t.updateQueue=null,l=mm(t,r,l,d),pm(e),r=If(),e!==null&&!Bn?(Uf(e,t,f),Xa(e,t,f)):(_t&&r&&mo(t),t.flags|=1,hs(e,t,l,f),t.child)}function hg(e,t,l,r,d){if(La(t),t.stateNode===null){var f=Ca,j=l.contextType;typeof j=="object"&&j!==null&&(f=Fn(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={},hc(t),j=l.contextType,f.context=typeof j=="object"&&j!==null?Fn(j):Ca,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),zl(t,r,f,d),fs(),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=yr(l,w);f.props=U;var ne=f.context,ue=l.contextType;j=Ca,typeof ue=="object"&&ue!==null&&(j=Fn(ue));var be=l.getDerivedStateFromProps;ue=typeof be=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||ne!==j)&&Wm(t,f,r,j),sa=!1;var le=t.memoizedState;f.state=le,zl(t,r,f,d),fs(),ne=t.memoizedState,w||le!==ne||sa?(typeof be=="function"&&(Jf(t,l,be,r),ne=t.memoizedState),(U=sa||Jm(t,l,U,r,le,ne,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=ne),f.props=r,f.state=ne,f.context=j,r=U):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,m(e,t),j=t.memoizedProps,ue=yr(l,j),f.props=ue,be=t.pendingProps,le=f.context,ne=l.contextType,U=Ca,typeof ne=="object"&&ne!==null&&(U=Fn(ne)),w=l.getDerivedStateFromProps,(ne=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(j!==be||le!==U)&&Wm(t,f,r,U),sa=!1,le=t.memoizedState,f.state=le,zl(t,r,f,d),fs();var ae=t.memoizedState;j!==be||le!==ae||sa||e!==null&&e.dependencies!==null&&oc(e.dependencies)?(typeof w=="function"&&(Jf(t,l,w,r),ae=t.memoizedState),(ue=sa||Jm(t,l,ue,r,le,ae,U)||e!==null&&e.dependencies!==null&&oc(e.dependencies))?(ne||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(r,ae,U),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,ae,U)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||j===e.memoizedProps&&le===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&le===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ae),f.props=r,f.state=ae,f.context=U,r=ue):(typeof f.componentDidUpdate!="function"||j===e.memoizedProps&&le===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&le===e.memoizedState||(t.flags|=1024),r=!1)}return f=r,sd(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=Ga(t,e.child,null,d),t.child=Ga(t,null,l,d)):hs(e,t,l,d),t.memoizedState=f.state,e=t.child):e=Xa(e,t,d),e}function pg(e,t,l,r){return Da(),t.flags|=256,hs(e,t,l,r),t.child}var sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(e){return{baseLanes:e,cachePool:mr()}}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:(Rn.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(_t){if(d?Ve(t):ts(),(e=Jt)?(e=wx(e,Qs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vs!==null?{id:Xs,overflow:Ds}:null,retryLane:536870912,hydrationErrors:null},l=zu(e),l.return=t,t.child=l,Zn=t,Jt=null)):e=null,e===null)throw Wl(t);return qh(e)?t.lanes=32:t.lanes=536870912,null}var w=r.children;return r=r.fallback,d?(ts(),d=t.mode,w=ld({mode:"hidden",children:w},d),r=Aa(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,Ao(null,r)):(Ve(t),ih(t,w))}var U=e.memoizedState;if(U!==null&&(w=U.dehydrated,w!==null)){if(f)t.flags&256?(Ve(t),t.flags&=-257,t=rh(e,t,l)):t.memoizedState!==null?(ts(),t.child=e.child,t.flags|=128,t=null):(ts(),w=r.fallback,d=t.mode,r=ld({mode:"visible",children:r.children},d),w=Aa(w,d,l,null),w.flags|=2,r.return=t,w.return=t,r.sibling=w,t.child=r,Ga(t,e.child,null,l),r=t.child,r.memoizedState=lh(l),r.childLanes=ah(e,j,l),t.memoizedState=sh,t=Ao(null,r));else if(Ve(t),qh(w)){if(j=w.nextSibling&&w.nextSibling.dataset,j)var ne=j.dgst;j=ne,r=Error(c(419)),r.stack="",r.digest=j,or({value:r,source:null,stack:null}),t=rh(e,t,l)}else if(Bn||Ol(e,t,l,!1),j=(l&e.childLanes)!==0,Bn||j){if(j=rn,j!==null&&(r=It(j,l),r!==0&&r!==U.retryLane))throw U.retryLane=r,pl(e,r),Js(j,e,r),th;Bh(w)||hd(),t=rh(e,t,l)}else Bh(w)?(t.flags|=192,t.child=e.child,t=null):(e=U.treeContext,Jt=bl(w.nextSibling),Zn=t,_t=!0,Jl=null,Qs=!1,e!==null&&go(t,e),t=ih(t,r.children),t.flags|=4096);return t}return d?(ts(),w=r.fallback,d=t.mode,U=e.child,ne=U.sibling,r=Al(U,{mode:"hidden",children:r.children}),r.subtreeFlags=U.subtreeFlags&65011712,ne!==null?w=Al(ne,w):(w=Aa(w,d,l,null),w.flags|=2),w.return=t,r.return=t,r.sibling=w,t.child=r,Ao(null,r),r=t.child,w=e.child.memoizedState,w===null?w=lh(l):(d=w.cachePool,d!==null?(U=Nn._currentValue,d=d.parent!==U?{parent:U,pool:U}:d):d=mr(),w={baseLanes:w.baseLanes|l,cachePool:d}),r.memoizedState=w,r.childLanes=ah(e,j,l),t.memoizedState=sh,Ao(e.child,r)):(Ve(t),l=e.child,e=l.sibling,l=Al(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=ld({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ld(e,t){return e=ds(22,e,null,t),e.lanes=0,e}function rh(e,t,l){return Ga(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),ur(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=Rn.current,w=(j&2)!==0;if(w?(j=j&1|2,t.flags|=128):j&=1,xe(Rn,j),hs(e,t,r,l),r=_t?cr: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&&Xu(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&&Xu(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 Xa(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ei|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ol(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=Al(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Al(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:tt(t,t.stateNode.containerInfo),ea(t,Nn,e.memoizedState.cache),Da();break;case 27:case 5:sn(t);break;case 4:tt(t,t.stateNode.containerInfo);break;case 10:ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gt(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ve(t),t.flags|=128,null):(l&t.child.childLanes)!==0?mg(e,t,l):(Ve(t),e=Xa(e,t,l),e!==null?e.sibling:null);Ve(t);break;case 19:var d=(e.flags&128)!==0;if(r=(l&t.childLanes)!==0,r||(Ol(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),xe(Rn,Rn.current),r)break;return null;case 22:return t.lanes=0,og(e,t,l,t.pendingProps);case 24:ea(t,Nn,e.memoizedState.cache)}return Xa(e,t,l)}function bg(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Bn=!0;else{if(!oh(e,l)&&(t.flags&128)===0)return Bn=!1,Zy(e,t,l);Bn=(e.flags&131072)!==0}else Bn=!1,_t&&(t.flags&1048576)!==0&&Iu(t,cr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Ha(t.elementType),t.type=e,typeof e=="function")ir(e)?(r=yr(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===B){t.tag=11,t=ig(null,t,e,r,l);break e}else if(d===H){t.tag=14,t=rg(null,t,e,r,l);break e}}throw t=_e(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=yr(r,t.pendingProps),hg(e,t,r,d,l);case 3:e:{if(tt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var f=t.memoizedState;d=f.element,m(e,t),zl(t,r,null,l);var j=t.memoizedState;if(r=j.cache,ea(t,Nn,r),r!==f.cache&&dr(t,[Nn],l,!0),fs(),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=$s(Error(c(424)),t),or(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(Jt=bl(e.firstChild),Zn=t,_t=!0,Jl=null,Qs=!0,l=xl(t,null,r,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Da(),r===d){t=Xa(e,t,l);break e}hs(e,t,r,l)}t=t.child}return t;case 26:return sd(e,t),e===null?(l=Cx(t.type,null,t.pendingProps,null))?t.memoizedState=l:_t||(l=t.type,e=t.pendingProps,r=yd(me.current).createElement(l),r[dn]=t,r[lt]=e,ps(r,l,e),nt(r),t.stateNode=r):t.memoizedState=Cx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return sn(t),e===null&&_t&&(r=t.stateNode=Sx(t.type,t.pendingProps,me.current),Zn=t,Qs=!0,d=Jt,Ri(t.type)?(Gh=d,Jt=bl(r.firstChild)):Jt=d),hs(e,t,t.pendingProps.children,l),sd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_t&&((d=r=Jt)&&(r=N0(r,t.type,t.pendingProps,Qs),r!==null?(t.stateNode=r,Zn=t,Jt=bl(r.firstChild),Qs=!1,d=!0):d=!1),d||Wl(t)),sn(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),Vo._currentValue=d),sd(e,t),hs(e,t,r,l),t.child;case 6:return e===null&&_t&&((e=l=Jt)&&(l=S0(l,t.pendingProps,Qs),l!==null?(t.stateNode=l,Zn=t,Jt=null,e=!0):e=!1),e||Wl(t)),null;case 13:return mg(e,t,l);case 4:return tt(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ga(t,null,r,l):hs(e,t,r,l),t.child;case 11:return ig(e,t,t.type,t.pendingProps,l);case 7:return hs(e,t,t.pendingProps,l),t.child;case 8:return hs(e,t,t.pendingProps.children,l),t.child;case 12:return hs(e,t,t.pendingProps.children,l),t.child;case 10:return r=t.pendingProps,ea(t,t.type,r.value),hs(e,t,r.children,l),t.child;case 9:return d=t.type._context,r=t.pendingProps.children,La(t),d=Fn(d),r=r(d),t.flags|=1,hs(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 La(t),r=Fn(Nn),e===null?(d=Gu(),d===null&&(d=rn,f=yo(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=l),d=f),t.memoizedState={parent:r,cache:d},hc(t),ea(t,Nn,d)):((e.lanes&l)!==0&&(m(e,t),zl(t,null,null,l),fs()),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),ea(t,Nn,r)):(r=f.cache,ea(t,Nn,r),r!==d.cache&&dr(t,[Nn],l,!0))),hs(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Qa(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 gl=gr,jo}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 gl=gr,jo}function ad(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ft():536870912,e.lanes|=t,jc|=t)}function Mo(e,t){if(!_t)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 fn(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(Ra(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(t),null;case 1:return fn(t),null;case 3:return l=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Dl(Nn),ot(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(vi(t)?Qa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,bo())),fn(t),null;case 26:var d=t.type,f=t.memoizedState;return e===null?(Qa(t),f!==null?(fn(t),_g(t,f)):(fn(t),uh(t,d,null,r,l))):f?f!==e.memoizedState?(Qa(t),fn(t),_g(t,f)):(fn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Qa(t),fn(t),uh(t,d,e,r,l)),null;case 27:if(de(t),l=me.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Qa(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return fn(t),null}e=ke.current,vi(t)?Uu(t):(e=Sx(d,r,l),t.stateNode=e,Qa(t))}return fn(t),null;case 5:if(de(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Qa(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return fn(t),null}if(f=ke.current,vi(t))Uu(t);else{var j=yd(me.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[dn]=t,f[lt]=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(ps(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&&Qa(t)}}return fn(t),uh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Qa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=me.current,vi(t)){if(e=t.stateNode,l=t.memoizedProps,r=null,d=Zn,d!==null)switch(d.tag){case 27:case 5:r=d.memoizedProps}e[dn]=t,e=!!(e.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||mx(e.nodeValue,l)),e||Wl(t,!0)}else e=yd(e).createTextNode(r),e[dn]=t,t.stateNode=e}return fn(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(r=vi(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[dn]=t}else Da(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fn(t),e=!1}else l=bo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Os(t),t):(Os(t),null);if((t.flags&128)!==0)throw Error(c(558))}return fn(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=vi(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[dn]=t}else Da(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;fn(t),d=!1}else d=bo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Os(t),t):(Os(t),null)}return Os(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),ad(t,t.updateQueue),fn(t),null);case 4:return ot(),e===null&&Rh(t.stateNode.containerInfo),fn(t),null;case 10:return Dl(t.type),fn(t),null;case 19:if(K(Rn),r=t.memoizedState,r===null)return fn(t),null;if(d=(t.flags&128)!==0,f=r.rendering,f===null)if(d)Mo(r,!1);else{if(En!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Xu(e),f!==null){for(t.flags|=128,Mo(r,!1),e=f.updateQueue,t.updateQueue=e,ad(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)ac(l,e),l=l.sibling;return xe(Rn,Rn.current&1|2),_t&&Ml(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>ud&&(t.flags|=128,d=!0,Mo(r,!1),t.lanes=4194304)}else{if(!d)if(e=Xu(f),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ad(t,e),Mo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!_t)return fn(t),null}else 2*De()-r.renderingStartTime>ud&&l!==536870912&&(t.flags|=128,d=!0,Mo(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=De(),e.sibling=null,l=Rn.current,xe(Rn,d?l&1|2:l&1),_t&&Ml(t,r.treeForkCount),e):(fn(t),null);case 22:case 23:return Os(t),mc(),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&&(fn(t),t.subtreeFlags&6&&(t.flags|=8192)):fn(t),l=t.updateQueue,l!==null&&ad(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),Dl(Nn),fn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Py(e,t){switch(Ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(Nn),ot(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(Os(t),t.alternate===null)throw Error(c(340));Da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Os(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Rn),null;case 4:return ot(),null;case 10:return Dl(t.type),null;case 22:case 23:return Os(t),mc(),e!==null&&K(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(Nn),null;case 25:return null;default:return null}}function yg(e,t){switch(Ra(t),t.tag){case 3:Dl(Nn),ot();break;case 26:case 27:case 5:de(t);break;case 4:ot();break;case 31:t.memoizedState!==null&&Os(t);break;case 13:Os(t);break;case 19:K(Rn);break;case 10:Dl(t.type);break;case 22:case 23:Os(t),mc(),e!==null&&K(Ia);break;case 24:Dl(Nn)}}function Ro(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){Kt(t,t.return,w)}}function Ni(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,ne=w;try{ne()}catch(ue){Kt(d,U,ue)}}}r=r.next}while(r!==f)}}catch(ue){Kt(t,t.return,ue)}}function vg(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ko(t,l)}catch(r){Kt(e,e.return,r)}}}function jg(e,t,l){l.props=yr(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(r){Kt(e,t,r)}}function Do(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){Kt(e,t,d)}}function la(e,t){var l=e.ref,r=e.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(d){Kt(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){Kt(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){Kt(e,e.return,d)}}function dh(e,t,l){try{var r=e.stateNode;_0(r,e.type,l,t),r[lt]=t}catch(d){Kt(e,e.return,d)}}function kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ri(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&&Ri(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=it));else if(r!==4&&(r===27&&Ri(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 id(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&&Ri(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(id(e,t,l),e=e.sibling;e!==null;)id(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]);ps(t,r,l),t[dn]=e,t[lt]=l}catch(f){Kt(e,e.return,f)}}var Ka=!1,qn=!1,ph=!1,Sg=typeof WeakSet=="function"?WeakSet:Set,ns=null;function Jy(e,t){if(e=e.containerInfo,Lh=Ed,e=oo(e),ka(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,ne=0,ue=0,be=e,le=null;t:for(;;){for(var ae;be!==l||d!==0&&be.nodeType!==3||(w=j+d),be!==f||r!==0&&be.nodeType!==3||(U=j+r),be.nodeType===3&&(j+=be.nodeValue.length),(ae=be.firstChild)!==null;)le=be,be=ae;for(;;){if(be===e)break t;if(le===l&&++ne===d&&(w=j),le===f&&++ue===r&&(U=j),(ae=be.nextSibling)!==null)break;be=le,le=be.parentNode}be=ae}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},Ed=!1,ns=t;ns!==null;)if(t=ns,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ns=e;else for(;ns!==null;){switch(t=ns,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 Ge=yr(l.type,d);e=r.getSnapshotBeforeUpdate(Ge,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(We){Kt(l,l.return,We)}}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,ns=e;break}ns=t.return}}function Eg(e,t,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:Fa(e,l),r&4&&Ro(5,l);break;case 1:if(Fa(e,l),r&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(j){Kt(l,l.return,j)}else{var d=yr(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){Kt(l,l.return,j)}}r&64&&vg(l),r&512&&Do(l,l.return);break;case 3:if(Fa(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{ko(e,t)}catch(j){Kt(l,l.return,j)}}break;case 27:t===null&&r&4&&Ng(l);case 26:case 5:Fa(e,l),t===null&&r&4&&wg(l),r&512&&Do(l,l.return);break;case 12:Fa(e,l);break;case 31:Fa(e,l),r&4&&Ag(e,l);break;case 13:Fa(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||Ka,!r){t=t!==null&&t.memoizedState!==null||qn,d=Ka;var f=qn;Ka=r,(qn=t)&&!f?Pa(e,l,(l.subtreeFlags&8772)!==0):Fa(e,l),Ka=d,qn=f}break;case 30:break;default:Fa(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&&os(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 bn=null,Ks=!1;function Za(e,t,l){for(l=l.child;l!==null;)Cg(e,t,l),l=l.sibling}function Cg(e,t,l){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(pt,l)}catch{}switch(l.tag){case 26:qn||la(l,t),Za(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qn||la(l,t);var r=bn,d=Ks;Ri(l.type)&&(bn=l.stateNode,Ks=!1),Za(e,t,l),Go(l.stateNode),bn=r,Ks=d;break;case 5:qn||la(l,t);case 6:if(r=bn,d=Ks,bn=null,Za(e,t,l),bn=r,Ks=d,bn!==null)if(Ks)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(l.stateNode)}catch(f){Kt(l,t,f)}else try{bn.removeChild(l.stateNode)}catch(f){Kt(l,t,f)}break;case 18:bn!==null&&(Ks?(e=bn,vx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ac(e)):vx(bn,l.stateNode));break;case 4:r=bn,d=Ks,bn=l.stateNode.containerInfo,Ks=!0,Za(e,t,l),bn=r,Ks=d;break;case 0:case 11:case 14:case 15:Ni(2,l,t),qn||Ni(4,l,t),Za(e,t,l);break;case 1:qn||(la(l,t),r=l.stateNode,typeof r.componentWillUnmount=="function"&&jg(l,t,r)),Za(e,t,l);break;case 21:Za(e,t,l);break;case 22:qn=(r=qn)||l.memoizedState!==null,Za(e,t,l),qn=r;break;default:Za(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){Kt(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){Kt(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 rd(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 Zs(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(Ri(w.type)){bn=w.stateNode,Ks=!1;break e}break;case 5:bn=w.stateNode,Ks=!1;break e;case 3:case 4:bn=w.stateNode.containerInfo,Ks=!0;break e}w=w.return}if(bn===null)throw Error(c(160));Cg(f,j,d),bn=null,Ks=!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 Il=null;function Rg(e,t){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zs(t,e),Fs(e),r&4&&(Ni(3,e,e.return),Ro(3,e),Ni(5,e,e.return));break;case 1:Zs(t,e),Fs(e),r&512&&(qn||l===null||la(l,l.return)),r&64&&Ka&&(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=Il;if(Zs(t,e),Fs(e),r&512&&(qn||l===null||la(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[cs]||f[dn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(r),d.head.insertBefore(f,d.querySelector("head > title"))),ps(f,r,l),f[dn]=e,nt(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),ps(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),ps(f,r,l),d.head.appendChild(f);break;default:throw Error(c(468,r))}f[dn]=e,nt(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:Zs(t,e),Fs(e),r&512&&(qn||l===null||la(l,l.return)),l!==null&&r&4&&dh(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Zs(t,e),Fs(e),r&512&&(qn||l===null||la(l,l.return)),e.flags&32){d=e.stateNode;try{ee(d,"")}catch(Ge){Kt(e,e.return,Ge)}}r&4&&e.stateNode!=null&&(d=e.memoizedProps,dh(e,d,l!==null?l.memoizedProps:d)),r&1024&&(ph=!0);break;case 6:if(Zs(t,e),Fs(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,l=e.stateNode;try{l.nodeValue=r}catch(Ge){Kt(e,e.return,Ge)}}break;case 3:if(wd=null,d=Il,Il=vd(t.containerInfo),Zs(t,e),Il=d,Fs(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{Ac(t.containerInfo)}catch(Ge){Kt(e,e.return,Ge)}ph&&(ph=!1,Dg(e));break;case 4:r=Il,Il=vd(e.stateNode.containerInfo),Zs(t,e),Fs(e),Il=r;break;case 12:Zs(t,e),Fs(e);break;case 31:Zs(t,e),Fs(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,rd(e,r)));break;case 13:Zs(t,e),Fs(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(od=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,rd(e,r)));break;case 22:d=e.memoizedState!==null;var U=l!==null&&l.memoizedState!==null,ne=Ka,ue=qn;if(Ka=ne||d,qn=ue||U,Zs(t,e),qn=ue,Ka=ne,Fs(e),r&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(l===null||U||Ka||qn||vr(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 be=U.memoizedProps.style,le=be!=null&&be.hasOwnProperty("display")?be.display:null;w.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Ge){Kt(U,U.return,Ge)}}}else if(t.tag===6){if(l===null){U=t;try{U.stateNode.nodeValue=d?"":U.memoizedProps}catch(Ge){Kt(U,U.return,Ge)}}}else if(t.tag===18){if(l===null){U=t;try{var ae=U.stateNode;d?jx(ae,!0):jx(U.stateNode,!1)}catch(Ge){Kt(U,U.return,Ge)}}}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,rd(e,l))));break;case 19:Zs(t,e),Fs(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,rd(e,r)));break;case 30:break;case 21:break;default:Zs(t,e),Fs(e)}}function Fs(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);id(e,f,d);break;case 5:var j=l.stateNode;l.flags&32&&(ee(j,""),l.flags&=-33);var w=fh(e);id(e,w,j);break;case 3:case 4:var U=l.stateNode.containerInfo,ne=fh(e);hh(e,ne,U);break;default:throw Error(c(161))}}catch(ue){Kt(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 Fa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eg(e,t.alternate,t),t=t.sibling}function vr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ni(4,t,t.return),vr(t);break;case 1:la(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&jg(t,t.return,l),vr(t);break;case 27:Go(t.stateNode);case 26:case 5:la(t,t.return),vr(t);break;case 22:t.memoizedState===null&&vr(t);break;case 30:vr(t);break;default:vr(t)}e=e.sibling}}function Pa(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:Pa(d,f,l),Ro(4,f);break;case 1:if(Pa(d,f,l),r=f,d=r.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(ne){Kt(r,r.return,ne)}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++)wo(U[d],w)}catch(ne){Kt(r,r.return,ne)}}l&&j&64&&vg(f),Do(f,f.return);break;case 27:Ng(f);case 26:case 5:Pa(d,f,l),l&&r===null&&j&4&&wg(f),Do(f,f.return);break;case 12:Pa(d,f,l);break;case 31:Pa(d,f,l),l&&j&4&&Ag(d,f);break;case 13:Pa(d,f,l),l&&j&4&&Mg(d,f);break;case 22:f.memoizedState===null&&Pa(d,f,l),Do(f,f.return);break;case 30:break;default:Pa(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&&fr(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&&fr(e))}function Ul(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:Ul(e,t,l,r),d&2048&&Ro(9,t);break;case 1:Ul(e,t,l,r);break;case 3:Ul(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&&fr(e)));break;case 12:if(d&2048){Ul(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){Kt(t,t.return,U)}}else Ul(e,t,l,r);break;case 31:Ul(e,t,l,r);break;case 13:Ul(e,t,l,r);break;case 23:break;case 22:f=t.stateNode,j=t.alternate,t.memoizedState!==null?f._visibility&2?Ul(e,t,l,r):Oo(e,t):f._visibility&2?Ul(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:Ul(e,t,l,r),d&2048&&gh(t.alternate,t);break;default:Ul(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,ne=j.flags;switch(j.tag){case 0:case 11:case 15:_c(f,j,w,U,d),Ro(8,j);break;case 23:break;case 22:var ue=j.stateNode;j.memoizedState!==null?ue._visibility&2?_c(f,j,w,U,d):Oo(f,j):(ue._visibility|=2,_c(f,j,w,U,d)),d&&ne&2048&&mh(j.alternate,j);break;case 24:_c(f,j,w,U,d),d&&ne&2048&&gh(j.alternate,j);break;default:_c(f,j,w,U,d)}t=t.sibling}}function Oo(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:Oo(l,r),d&2048&&mh(r.alternate,r);break;case 24:Oo(l,r),d&2048&&gh(r.alternate,r);break;default:Oo(l,r)}t=t.sibling}}var Lo=8192;function yc(e,t,l){if(e.subtreeFlags&Lo)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&Lo&&e.memoizedState!==null&&H0(l,Il,e.memoizedState,e.memoizedProps);break;case 5:yc(e,t,l);break;case 3:case 4:var r=Il;Il=vd(e.stateNode.containerInfo),yc(e,t,l),Il=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Lo,Lo=16777216,yc(e,t,l),Lo=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 zo(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];ns=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:zo(e),e.flags&2048&&Ni(9,e,e.return);break;case 3:zo(e);break;case 12:zo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,cd(e)):zo(e);break;default:zo(e)}}function cd(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];ns=r,Ug(r,e)}zg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ni(8,t,t.return),cd(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,cd(t));break;default:cd(t)}e=e.sibling}}function Ug(e,t){for(;ns!==null;){var l=ns;switch(l.tag){case 0:case 11:case 15:Ni(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:fr(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,ns=r;else e:for(l=e;ns!==null;){r=ns;var d=r.sibling,f=r.return;if(Tg(r),r===l){ns=null;break e}if(d!==null){d.return=f,ns=d;break e}ns=f}}}var e0={getCacheForType:function(e){var t=Fn(Nn),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Fn(Nn).controller.signal}},t0=typeof WeakMap=="function"?WeakMap:Map,Ut=0,rn=null,yt=null,kt=0,Qt=0,cl=null,Si=!1,vc=!1,xh=!1,Ja=0,En=0,Ei=0,jr=0,bh=0,ol=0,jc=0,Io=null,Ps=null,_h=!1,od=0,Hg=0,ud=1/0,dd=null,Ti=null,Pn=0,Ci=null,wc=null,Wa=0,yh=0,vh=null,Bg=null,Uo=0,jh=null;function ul(){return(Ut&2)!==0&&kt!==0?kt&-kt:q.T!==null?Th():ys()}function qg(){if(ol===0)if((kt&536870912)===0||_t){var e=at;at<<=1,(at&3932160)===0&&(at=262144),ol=e}else ol=536870912;return e=ge.current,e!==null&&(e.flags|=32),ol}function Js(e,t,l){(e===rn&&(Qt===2||Qt===9)||e.cancelPendingCommit!==null)&&(kc(e,0),Ai(e,kt,ol,!1)),J(e,l),((Ut&2)===0||e!==rn)&&(e===rn&&((Ut&2)===0&&(jr|=l),En===4&&Ai(e,kt,ol,!1)),aa(e))}function Gg(e,t,l){if((Ut&6)!==0)throw Error(c(327));var r=!l&&(t&127)===0&&(t&e.expiredLanes)===0||gn(e,t),d=r?l0(e,t):kh(e,t,!0),f=r;do{if(d===0){vc&&!r&&Ai(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=Io;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,jr|=f,d=4;break e}f=Ps,Ps=d,f!==null&&(Ps===null?Ps=f:Ps.push.apply(Ps,f))}d=j}if(f=!1,d!==2)continue}}if(d===1){kc(e,0),Ai(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:Ai(r,t,ol,!Si);break e;case 2:Ps=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(d=od+300-De(),10<d)){if(Ai(r,t,ol,!Si),Vn(r,0,!0)!==0)break e;Wa=t,r.timeoutHandle=_x($g.bind(null,r,l,Ps,dd,_h,t,ol,jr,jc,Si,f,"Throttled",-0,0),d);break e}$g(r,l,Ps,dd,_h,t,ol,jr,jc,Si,f,null,-0,0)}}break}while(!0);aa(e)}function $g(e,t,l,r,d,f,j,w,U,ne,ue,be,le,ae){if(e.timeoutHandle=-1,be=t.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:it},Lg(t,f,be);var Ge=(f&62914560)===f?od-De():(f&4194048)===f?Hg-De():0;if(Ge=B0(be,Ge),Ge!==null){Wa=f,e.cancelPendingCommit=Ge(Pg.bind(null,e,t,f,l,r,d,j,w,U,ue,be,null,le,ae)),Ai(e,f,j,!ne);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(!js(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 Ai(e,t,l,r){t&=~bh,t&=~jr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var d=t;0<d;){var f=31-Xt(d),j=1<<f;r[f]=-1,d&=~j}l!==0&&Me(e,l,t)}function fd(){return(Ut&6)===0?(Ho(0),!1):!0}function wh(){if(yt!==null){if(Qt===0)var e=yt.return;else e=yt,Rl=Oa=null,Hf(e),qa=null,xr=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()),Wa=0,wh(),rn=e,yt=l=Al(e.current,null),kt=t,Qt=0,cl=null,Si=!1,vc=gn(e,t),xh=!1,jc=ol=bh=jr=Ei=En=0,Ps=Io=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-Xt(r),f=1<<d;t|=e[d],r&=~f}return Ja=t,nc(),l}function Yg(e,t){dt=null,q.H=Co,t===Ua||t===na?(t=Ba(),Qt=3):t===jo?(t=Ba(),Qt=4):Qt=t===th?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cl=t,yt===null&&(En=1,td(e,$s(t,e.current)))}function Vg(){var e=ge.current;return e===null?!0:(kt&4194048)===kt?Se===null:(kt&62914560)===kt||(kt&536870912)!==0?e===Se:!1}function Xg(){var e=q.H;return q.H=Co,e===null?Co:e}function Qg(){var e=q.A;return q.A=e0,e}function hd(){En=4,Si||(kt&4194048)!==kt&&ge.current!==null||(vc=!0),(Ei&134217727)===0&&(jr&134217727)===0||rn===null||Ai(rn,kt,ol,!1)}function kh(e,t,l){var r=Ut;Ut|=2;var d=Xg(),f=Qg();(rn!==e||kt!==t)&&(dd=null,kc(e,t)),t=!1;var j=En;e:do try{if(Qt!==0&&yt!==null){var w=yt,U=cl;switch(Qt){case 8:wh(),j=6;break e;case 3:case 2:case 9:case 6:ge.current===null&&(t=!0);var ne=Qt;if(Qt=0,cl=null,Nc(e,w,U,ne),l&&vc){j=0;break e}break;default:ne=Qt,Qt=0,cl=null,Nc(e,w,U,ne)}}s0(),j=En;break}catch(ue){Yg(e,ue)}while(!0);return t&&e.shellSuspendCounter++,Rl=Oa=null,Ut=r,q.H=d,q.A=f,yt===null&&(rn=null,kt=0,nc()),j}function s0(){for(;yt!==null;)Kg(yt)}function l0(e,t){var l=Ut;Ut|=2;var r=Xg(),d=Qg();rn!==e||kt!==t?(dd=null,ud=De()+500,kc(e,t)):vc=gn(e,t);e:do try{if(Qt!==0&&yt!==null){t=yt;var f=cl;t:switch(Qt){case 1:Qt=0,cl=null,Nc(e,t,f,1);break;case 2:case 9:if($u(f)){Qt=0,cl=null,Zg(t);break}t=function(){Qt!==2&&Qt!==9||rn!==e||(Qt=7),aa(e)},f.then(t,t);break e;case 3:Qt=7;break e;case 4:Qt=5;break e;case 7:$u(f)?(Qt=0,cl=null,Zg(t)):(Qt=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){Qt=0,cl=null;var U=w.sibling;if(U!==null)yt=U;else{var ne=w.return;ne!==null?(yt=ne,pd(ne)):yt=null}break t}}Qt=0,cl=null,Nc(e,t,f,5);break;case 6:Qt=0,cl=null,Nc(e,t,f,6);break;case 8:wh(),En=6;break e;default:throw Error(c(462))}}a0();break}catch(ue){Yg(e,ue)}while(!0);return Rl=Oa=null,q.H=r,q.A=d,Ut=l,yt!==null?0:(rn=null,kt=0,nc(),En)}function a0(){for(;yt!==null&&!jt();)Kg(yt)}function Kg(e){var t=bg(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?pd(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=ac(t,Ja),t=bg(l,t,Ja)}e.memoizedProps=e.pendingProps,t===null?pd(e):yt=t}function Nc(e,t,l,r){Rl=Oa=null,Hf(t),qa=null,xr=0;var d=t.return;try{if(Qy(e,d,t,l,kt)){En=1,td(e,$s(l,e.current)),yt=null;return}}catch(f){if(d!==null)throw yt=d,f;En=1,td(e,$s(l,e.current)),yt=null;return}t.flags&32768?(_t||r===1?e=!0:vc||(kt&536870912)!==0?e=!1:(Si=e=!0,(r===2||r===9||r===3||r===6)&&(r=ge.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fg(t,e)):pd(t)}function pd(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,Si);return}e=t.return;var l=Fy(t.alternate,t,Ja);if(l!==null){yt=l;return}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);En===0&&(En=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);En=6,yt=null}function Pg(e,t,l,r,d,f,j,w,U){e.cancelPendingCommit=null;do md();while(Pn!==0);if((Ut&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=fo,fe(e,l,f,j,w,U),e===rn&&(yt=rn=null,kt=0),wc=t,Ci=e,Wa=l,yh=f,vh=d,Bg=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,o0(Ce,function(){return nx(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=q.T,q.T=null,d=$.p,$.p=2,j=Ut,Ut|=4;try{Jy(e,t,l)}finally{Ut=j,$.p=d,q.T=r}}Pn=1,Jg(),Wg(),ex()}}function Jg(){if(Pn===1){Pn=0;var e=Ci,t=wc,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=q.T,q.T=null;var r=$.p;$.p=2;var d=Ut;Ut|=4;try{Rg(t,e);var f=zh,j=oo(e.containerInfo),w=f.focusedElem,U=f.selectionRange;if(j!==w&&w&&w.ownerDocument&&Pl(w.ownerDocument.documentElement,w)){if(U!==null&&ka(w)){var ne=U.start,ue=U.end;if(ue===void 0&&(ue=ne),"selectionStart"in w)w.selectionStart=ne,w.selectionEnd=Math.min(ue,w.value.length);else{var be=w.ownerDocument||document,le=be&&be.defaultView||window;if(le.getSelection){var ae=le.getSelection(),Ge=w.textContent.length,We=Math.min(U.start,Ge),tn=U.end===void 0?We:Math.min(U.end,Ge);!ae.extend&&We>tn&&(j=tn,tn=We,We=j);var F=mi(w,We),V=mi(w,tn);if(F&&V&&(ae.rangeCount!==1||ae.anchorNode!==F.node||ae.anchorOffset!==F.offset||ae.focusNode!==V.node||ae.focusOffset!==V.offset)){var te=be.createRange();te.setStart(F.node,F.offset),ae.removeAllRanges(),We>tn?(ae.addRange(te),ae.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),ae.addRange(te))}}}}for(be=[],ae=w;ae=ae.parentNode;)ae.nodeType===1&&be.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<be.length;w++){var he=be[w];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Ed=!!Lh,zh=Lh=null}finally{Ut=d,$.p=r,q.T=l}}e.current=t,Pn=2}}function Wg(){if(Pn===2){Pn=0;var e=Ci,t=wc,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=q.T,q.T=null;var r=$.p;$.p=2;var d=Ut;Ut|=4;try{Eg(e,t.alternate,t)}finally{Ut=d,$.p=r,q.T=l}}Pn=3}}function ex(){if(Pn===4||Pn===3){Pn=0,Z();var e=Ci,t=wc,l=Wa,r=Bg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pn=5:(Pn=0,wc=Ci=null,tx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ti=null),Et(l),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(pt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=q.T,d=$.p,$.p=2,q.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{q.T=t,$.p=d}}(Wa&3)!==0&&md(),aa(e),d=e.pendingLanes,(l&261930)!==0&&(d&42)!==0?e===jh?Uo++:(Uo=0,jh=e):Uo=0,Ho(0)}}function tx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fr(t)))}function md(){return Jg(),Wg(),ex(),nx()}function nx(){if(Pn!==5)return!1;var e=Ci,t=yh;yh=0;var l=Et(Wa),r=q.T,d=$.p;try{$.p=32>l?32:l,q.T=null,l=vh,vh=null;var f=Ci,j=Wa;if(Pn=0,wc=Ci=null,Wa=0,(Ut&6)!==0)throw Error(c(331));var w=Ut;if(Ut|=4,Ig(f.current),Og(f,f.current,j,l),Ut=w,Ho(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(pt,f)}catch{}return!0}finally{$.p=d,q.T=r,tx(e,t)}}function sx(e,t,l){t=$s(l,t),t=eh(e.stateNode,t,2),e=ce(e,t,2),e!==null&&(J(e,2),aa(e))}function Kt(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"&&(Ti===null||!Ti.has(r))){e=$s(l,e),l=lg(2),r=ce(t,l,2),r!==null&&(ag(l,r,t,e),J(r,2),aa(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,rn===e&&(kt&l)===l&&(En===4||En===3&&(kt&62914560)===kt&&300>De()-od?(Ut&2)===0&&kc(e,0):bh|=l,jc===kt&&(jc=0)),aa(e)}function lx(e,t){t===0&&(t=Ft()),e=pl(e,t),e!==null&&(J(e,t),aa(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 on(e,t)}var gd=null,Sc=null,Sh=!1,xd=!1,Eh=!1,Mi=0;function aa(e){e!==Sc&&e.next===null&&(Sc===null?gd=Sc=e:Sc=Sc.next=e),xd=!0,Sh||(Sh=!0,d0())}function Ho(e,t){if(!Eh&&xd){Eh=!0;do for(var l=!1,r=gd;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-Xt(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=Vn(r,r===rn?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||gn(r,f)||(l=!0,cx(r,f));r=r.next}while(l);Eh=!1}}function u0(){ax()}function ax(){xd=Sh=!1;var e=0;Mi!==0&&v0()&&(e=Mi);for(var t=De(),l=null,r=gd;r!==null;){var d=r.next,f=ix(r,t);f===0?(r.next=null,l===null?gd=d:l.next=d,d===null&&(Sc=l)):(l=r,(e!==0||(f&3)!==0)&&(xd=!0)),r=d}Pn!==0&&Pn!==5||Ho(e),Mi!==0&&(Mi=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-Xt(f),w=1<<j,U=d[j];U===-1?((w&l)===0||(w&r)!==0)&&(d[j]=un(w,t)):U<=t&&(e.expiredLanes|=w),f&=~w}if(t=rn,l=kt,l=Vn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,l===0||e===t&&(Qt===2||Qt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Yn(r),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||gn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(r!==null&&Yn(r),Et(l)){case 2:case 8:l=Ee;break;case 32:l=Ce;break;case 268435456:l=$e;break;default:l=Ce}return r=rx.bind(null,e),l=on(l,r),e.callbackPriority=t,e.callbackNode=l,t}return r!==null&&r!==null&&Yn(r),e.callbackPriority=2,e.callbackNode=null,2}function rx(e,t){if(Pn!==0&&Pn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(md()&&e.callbackNode!==l)return null;var r=kt;return r=Vn(e,e===rn?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gg(e,r,t),ix(e,De()),e.callbackNode!=null&&e.callbackNode===l?rx.bind(null,e):null)}function cx(e,t){if(md())return null;Gg(e,t,!0)}function d0(){w0(function(){(Ut&6)!==0?on(ut,u0):ax()})}function Th(){if(Mi===0){var e=ji;e===0&&(e=Xe,Xe<<=1,(Xe&261888)===0&&(Xe=256)),Mi=e}return Mi}function ox(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:In(""+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[lt]||null).action),j=r.submitter;j&&(t=(t=j[lt]||null)?ox(t.formAction):j.getAttribute("formAction"),t!==null&&(f=t,j=null));var w=new va("action","action",null,r,d);e.push({event:w,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mi!==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<uo.length;Ch++){var Ah=uo[Ch],h0=Ah.toLowerCase(),p0=Ah[0].toUpperCase()+Ah.slice(1);rl(h0,"on"+p0)}rl(Tf,"onAnimationEnd"),rl(ec,"onAnimationIteration"),rl(Du,"onAnimationStart"),rl("dblclick","onDoubleClick"),rl("focusin","onFocus"),rl("focusout","onBlur"),rl(Cf,"onTransitionRun"),rl(Af,"onTransitionStart"),rl(Mf,"onTransitionCancel"),rl(Ou,"onTransitionEnd"),Tn("onMouseEnter",["mouseout","mouseover"]),Tn("onMouseLeave",["mouseout","mouseover"]),Tn("onPointerEnter",["pointerout","pointerover"]),Tn("onPointerLeave",["pointerout","pointerover"]),Wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bo="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(Bo));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,ne=w.currentTarget;if(w=w.listener,U!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=ne;try{f(d)}catch(ue){tc(ue)}d.currentTarget=null,f=U}else for(j=0;j<r.length;j++){if(w=r[j],U=w.instance,ne=w.currentTarget,w=w.listener,U!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=ne;try{f(d)}catch(ue){tc(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 bd="_reactListening"+Math.random().toString(36).slice(2);function Rh(e){if(!e[bd]){e[bd]=!0,Jn.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[bd]||(t[bd]=!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,!Ms||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=qt(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}Hr(function(){var ne=f,ue=St(l),be=[];e:{var le=bi.get(e);if(le!==void 0){var ae=va,Ge=e;switch(e){case"keypress":if(Kn(l)===0)break e;case"keydown":case"keyup":ae=ku;break;case"focusin":Ge="focus",ae=oi;break;case"focusout":Ge="blur",ae=oi;break;case"beforeblur":case"afterblur":ae=oi;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":ae=Nl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=qr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Xr;break;case Tf:case ec:case Du:ae=no;break;case Ou:ae=Sf;break;case"scroll":case"scrollend":ae=ja;break;case"wheel":ae=Ef;break;case"copy":case"cut":case"paste":ae=wu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=er;break;case"toggle":case"beforetoggle":ae=Zr}var We=(t&4)!==0,tn=!We&&(e==="scroll"||e==="scrollend"),F=We?le!==null?le+"Capture":null:le;We=[];for(var V=ne,te;V!==null;){var he=V;if(te=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||te===null||F===null||(he=el(V,F),he!=null&&We.push(qo(V,he,te))),tn)break;V=V.return}0<We.length&&(le=new ae(le,Ge,null,l,ue),be.push({event:le,listeners:We}))}}if((t&7)===0){e:{if(le=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",le&&l!==Cn&&(Ge=l.relatedTarget||l.fromElement)&&(qt(Ge)||Ge[_n]))break e;if((ae||le)&&(le=ue.window===ue?ue:(le=ue.ownerDocument)?le.defaultView||le.parentWindow:window,ae?(Ge=l.relatedTarget||l.toElement,ae=ne,Ge=Ge?qt(Ge):null,Ge!==null&&(tn=u(Ge),We=Ge.tag,Ge!==tn||We!==5&&We!==27&&We!==6)&&(Ge=null)):(ae=null,Ge=ne),ae!==Ge)){if(We=Nl,he="onMouseLeave",F="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(We=er,he="onPointerLeave",F="onPointerEnter",V="pointer"),tn=ae==null?le:Pt(ae),te=Ge==null?le:Pt(Ge),le=new We(he,V+"leave",ae,l,ue),le.target=tn,le.relatedTarget=te,he=null,qt(ue)===ne&&(We=new We(F,V+"enter",Ge,l,ue),We.target=te,We.relatedTarget=tn,he=We),tn=he,ae&&Ge)t:{for(We=g0,F=ae,V=Ge,te=0,he=F;he;he=We(he))te++;he=0;for(var Qe=V;Qe;Qe=We(Qe))he++;for(;0<te-he;)F=We(F),te--;for(;0<he-te;)V=We(V),he--;for(;te--;){if(F===V||V!==null&&F===V.alternate){We=F;break t}F=We(F),V=We(V)}We=null}else We=null;ae!==null&&hx(be,le,ae,We,!1),Ge!==null&&tn!==null&&hx(be,tn,Ge,We,!0)}}e:{if(le=ne?Pt(ne):window,ae=le.nodeName&&le.nodeName.toLowerCase(),ae==="select"||ae==="input"&&le.type==="file")var Dt=Eu;else if(nr(le))if(Tu)Dt=Mu;else{Dt=Un;var Ye=Cu}else ae=le.nodeName,!ae||ae.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ne&&Fe(ne.elementType)&&(Dt=Eu):Dt=Au;if(Dt&&(Dt=Dt(e,ne))){fi(be,Dt,l,ue);break e}Ye&&Ye(e,le,ne),e==="focusout"&&ne&&le.type==="number"&&ne.memoizedProps.value!=null&&us(le,"number",le.value)}switch(Ye=ne?Pt(ne):window,e){case"focusin":(nr(Ye)||Ye.contentEditable==="true")&&(fl=Ye,Na=ne,gi=null);break;case"focusout":gi=Na=fl=null;break;case"mousedown":Sa=!0;break;case"contextmenu":case"mouseup":case"dragend":Sa=!1,Ru(be,l,ue);break;case"selectionchange":if(Wr)break;case"keydown":case"keyup":Ru(be,l,ue)}var ht;if(wa)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 Sl?di(e,l)&&(Nt="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Nt="onCompositionStart");Nt&&(Pr&&l.locale!=="ko"&&(Sl||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Sl&&(ht=bt()):(S=ue,pe="value"in S?S.value:S.textContent,Sl=!0)),Ye=_d(ne,Nt),0<Ye.length&&(Nt=new so(Nt,e,null,l,ue),be.push({event:Nt,listeners:Ye}),ht?Nt.data=ht:(ht=co(l),ht!==null&&(Nt.data=ht)))),(ht=Fr?Su(e,l):Jr(e,l))&&(Nt=_d(ne,"onBeforeInput"),0<Nt.length&&(Ye=new so("onBeforeInput","beforeinput",null,l,ue),be.push({event:Ye,listeners:Nt}),Ye.data=ht)),f0(be,e,ne,l,ue)}dx(be,t)})}function qo(e,t,l){return{instance:e,listener:t,currentTarget:l}}function _d(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=el(e,l),d!=null&&r.unshift(qo(e,d,f)),d=el(e,t),d!=null&&r.push(qo(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,ne=w.stateNode;if(w=w.tag,U!==null&&U===r)break;w!==5&&w!==26&&w!==27||ne===null||(U=ne,d?(ne=el(l,f),ne!=null&&j.unshift(qo(l,ne,U))):d||(ne=el(l,f),ne!=null&&j.push(qo(l,ne,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 en(e,t,l,r,d,f){switch(l){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||ee(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&ee(e,""+r);break;case"className":Tt(e,"class",r);break;case"tabIndex":Tt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Tt(e,l,r);break;case"style":ze(e,r,f);break;case"data":if(t!=="object"){Tt(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=In(""+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"&&en(e,t,"name",d.name,d,null),en(e,t,"formEncType",d.formEncType,d,null),en(e,t,"formMethod",d.formMethod,d,null),en(e,t,"formTarget",d.formTarget,d,null)):(en(e,t,"encType",d.encType,d,null),en(e,t,"method",d.method,d,null),en(e,t,"target",d.target,d,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=In(""+r),e.setAttribute(l,r);break;case"onClick":r!=null&&(e.onclick=it);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=In(""+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),wn(e,"popover",r);break;case"xlinkActuate":Ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ln(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ln(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ln(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ln(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":wn(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=$t.get(l)||l,wn(e,l,r))}}function Oh(e,t,l,r,d,f){switch(l){case"style":ze(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"?ee(e,r):(typeof r=="number"||typeof r=="bigint")&&ee(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=it);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[lt]||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,""):wn(e,l,r)}}}function ps(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:en(e,t,f,j,l,null)}}d&&en(e,t,"srcSet",l.srcSet,l,null),r&&en(e,t,"src",l.src,l,null);return;case"input":vt("invalid",e);var w=f=j=d=null,U=null,ne=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":ne=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:en(e,t,r,ue,l,null)}}kl(e,f,w,U,ne,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:en(e,t,d,w,l,null)}t=f,l=j,e.multiple=!!r,t!=null?As(e,!!r,t,!1):l!=null&&As(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:en(e,t,j,w,l,null)}C(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:en(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<Bo.length;r++)vt(Bo[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(ne in l)if(l.hasOwnProperty(ne)&&(r=l[ne],r!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:en(e,t,ne,r,l,null)}return;default:if(Fe(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&&en(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,ne=null,ue=null;for(ae in l){var be=l[ae];if(l.hasOwnProperty(ae)&&be!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":U=be;default:r.hasOwnProperty(ae)||en(e,t,ae,null,r,be)}}for(var le in r){var ae=r[le];if(be=l[le],r.hasOwnProperty(le)&&(ae!=null||be!=null))switch(le){case"type":f=ae;break;case"name":d=ae;break;case"checked":ne=ae;break;case"defaultChecked":ue=ae;break;case"value":j=ae;break;case"defaultValue":w=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(c(137,t));break;default:ae!==be&&en(e,t,le,ae,r,be)}}Vl(e,j,w,U,ne,ue,f,d);return;case"select":ae=j=w=le=null;for(f in l)if(U=l[f],l.hasOwnProperty(f)&&U!=null)switch(f){case"value":break;case"multiple":ae=U;default:r.hasOwnProperty(f)||en(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":le=f;break;case"defaultValue":w=f;break;case"multiple":j=f;default:f!==U&&en(e,t,d,f,r,U)}t=w,l=j,r=ae,le!=null?As(e,!!l,le,!1):!!r!=!!l&&(t!=null?As(e,!!l,t,!0):As(e,!!l,l?[]:"",!1));return;case"textarea":ae=le=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:en(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":le=d;break;case"defaultValue":ae=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(c(91));break;default:d!==f&&en(e,t,j,d,r,f)}Ne(e,le,ae);return;case"option":for(var Ge in l)if(le=l[Ge],l.hasOwnProperty(Ge)&&le!=null&&!r.hasOwnProperty(Ge))switch(Ge){case"selected":e.selected=!1;break;default:en(e,t,Ge,null,r,le)}for(U in r)if(le=r[U],ae=l[U],r.hasOwnProperty(U)&&le!==ae&&(le!=null||ae!=null))switch(U){case"selected":e.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:en(e,t,U,le,r,ae)}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 We in l)le=l[We],l.hasOwnProperty(We)&&le!=null&&!r.hasOwnProperty(We)&&en(e,t,We,null,r,le);for(ne in r)if(le=r[ne],ae=l[ne],r.hasOwnProperty(ne)&&le!==ae&&(le!=null||ae!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(c(137,t));break;default:en(e,t,ne,le,r,ae)}return;default:if(Fe(t)){for(var tn in l)le=l[tn],l.hasOwnProperty(tn)&&le!==void 0&&!r.hasOwnProperty(tn)&&Oh(e,t,tn,void 0,r,le);for(ue in r)le=r[ue],ae=l[ue],!r.hasOwnProperty(ue)||le===ae||le===void 0&&ae===void 0||Oh(e,t,ue,le,r,ae);return}}for(var F in l)le=l[F],l.hasOwnProperty(F)&&le!=null&&!r.hasOwnProperty(F)&&en(e,t,F,null,r,le);for(be in r)le=r[be],ae=l[be],!r.hasOwnProperty(be)||le===ae||le==null&&ae==null||en(e,t,be,le,r,ae)}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],ne=U.startTime;if(ne>w)break;var ue=U.transferSize,be=U.initiatorType;ue&&gx(be)&&(U=U.responseEnd,j+=ue*(U<w?1:(w-ne)/(U-ne)))}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 yd(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 Ri(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")Go(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Go(l);for(var f=l.firstChild;f;){var j=f.nextSibling,w=f.nodeName;f[cs]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||l.removeChild(f),f=j}}else l==="body"&&Go(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),os(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[cs])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=bl(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=bl(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=bl(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 bl(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 bl(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=yd(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 Go(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);os(e)}var _l=new Map,Ex=new Set;function vd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ei=$.d;$.d={f:T0,r:C0,D:A0,C:M0,L:R0,m:D0,X:L0,S:O0,M:z0};function T0(){var e=ei.f(),t=fd();return e||t}function C0(e){var t=Is(e);t!==null&&t.tag===5&&t.type==="form"?Ym(t):ei.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=vn(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"),ps(t,"link",e),nt(t),r.head.appendChild(t)))}}function A0(e){ei.D(e),Tx("dns-prefetch",e,null)}function M0(e,t){ei.C(e,t),Tx("preconnect",e,t)}function R0(e,t,l){ei.L(e,t,l);var r=Ec;if(r&&e&&t){var d='link[rel="preload"][as="'+vn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+vn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+vn(l.imageSizes)+'"]')):d+='[href="'+vn(e)+'"]';var f=d;switch(t){case"style":f=Tc(e);break;case"script":f=Cc(e)}_l.has(f)||(e=v({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),_l.set(f,e),r.querySelector(d)!==null||t==="style"&&r.querySelector($o(f))||t==="script"&&r.querySelector(Yo(f))||(t=r.createElement("link"),ps(t,"link",e),nt(t),r.head.appendChild(t)))}}function D0(e,t){ei.m(e,t);var l=Ec;if(l&&e){var r=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+vn(r)+'"][href="'+vn(e)+'"]',f=d;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Cc(e)}if(!_l.has(f)&&(e=v({rel:"modulepreload",href:e},t),_l.set(f,e),l.querySelector(d)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Yo(f)))return}r=l.createElement("link"),ps(r,"link",e),nt(r),l.head.appendChild(r)}}}function O0(e,t,l){ei.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($o(f)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},l),(l=_l.get(f))&&$h(e,l);var U=j=r.createElement("link");nt(U),ps(U,"link",e),U._p=new Promise(function(ne,ue){U.onload=ne,U.onerror=ue}),U.addEventListener("load",function(){w.loading|=1}),U.addEventListener("error",function(){w.loading|=2}),w.loading|=4,jd(j,t,r)}j={type:"stylesheet",instance:j,count:1,state:w},d.set(f,j)}}}function L0(e,t){ei.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(Yo(d)),f||(e=v({src:e,async:!0},t),(t=_l.get(d))&&Yh(e,t),f=l.createElement("script"),nt(f),ps(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(d,f))}}function z0(e,t){ei.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(Yo(d)),f||(e=v({src:e,async:!0,type:"module"},t),(t=_l.get(d))&&Yh(e,t),f=l.createElement("script"),nt(f),ps(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=me.current)?vd(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($o(e)))&&!f._p&&(j.instance=f,j.state.loading=5),_l.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},_l.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="'+vn(e)+'"'}function $o(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}),ps(t,"link",l),nt(t),e.head.appendChild(t))}function Cc(e){return'[src="'+vn(e)+'"]'}function Yo(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~="'+vn(l.href)+'"]');if(r)return t.instance=r,nt(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"),nt(r),ps(r,"style",d),jd(r,l.precedence,e),t.instance=r;case"stylesheet":d=Tc(l.href);var f=e.querySelector($o(d));if(f)return t.state.loading|=4,t.instance=f,nt(f),f;r=Ax(l),(d=_l.get(d))&&$h(r,d),f=(e.ownerDocument||e).createElement("link"),nt(f);var j=f;return j._p=new Promise(function(w,U){j.onload=w,j.onerror=U}),ps(f,"link",r),t.state.loading|=4,jd(f,l.precedence,e),t.instance=f;case"script":return f=Cc(l.src),(d=e.querySelector(Yo(f)))?(t.instance=d,nt(d),d):(r=l,(d=_l.get(f))&&(r=v({},l),Yh(r,d)),e=e.ownerDocument||e,d=e.createElement("script"),nt(d),ps(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,jd(r,l.precedence,e));return t.instance}function jd(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 wd=null;function Rx(e,t,l){if(wd===null){var r=new Map,d=wd=new Map;d.set(l,r)}else d=wd,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[cs]||f[dn]||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($o(d));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=kd.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=f,nt(f);return}f=t.ownerDocument||t,r=Ax(r),(d=_l.get(d))&&$h(r,d),f=f.createElement("link"),nt(f);var j=f;j._p=new Promise(function(w,U){j.onload=w,j.onerror=U}),ps(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=kd.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Vh=0;function B0(e,t){return e.stylesheets&&e.count===0&&Sd(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var r=setTimeout(function(){if(e.stylesheets&&Sd(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&&Sd(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 kd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nd=null;function Sd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nd=new Map,t.forEach(q0,e),Nd=null,kd.call(e))}function q0(e,t){if(!(t.state.loading&4)){var l=Nd.get(e);if(l)var r=l.get(null);else{l=new Map,Nd.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=kd.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 Vo={$$typeof:X,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_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,ne,ue,be){return e=new G0(e,t,l,j,U,ne,ue,be,w),t=1,f===!0&&(t|=24),f=ds(3,null,null,t),e.current=f,f.stateNode=e,t=yo(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:l,cache:t},hc(f),e}function zx(e){return e?(e=Ca,e):Ca}function Ix(e,t,l,r,d,f){d=zx(d),r.context===null?r.context=d:r.pendingContext=d,r=z(t),r.payload={element:l},f=f===void 0?null:f,f!==null&&(r.callback=f),l=ce(e,r,t),l!==null&&(Js(l,e,t),Be(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=pl(e,67108864);t!==null&&Js(t,e,67108864),Xh(e,67108864)}}function Bx(e){if(e.tag===13||e.tag===31){var t=ul();t=an(t);var l=pl(e,t);l!==null&&Js(l,e,t),Xh(e,t)}}var Ed=!0;function $0(e,t,l,r){var d=q.T;q.T=null;var f=$.p;try{$.p=2,Qh(e,t,l,r)}finally{$.p=f,q.T=d}}function Y0(e,t,l,r){var d=q.T;q.T=null;var f=$.p;try{$.p=8,Qh(e,t,l,r)}finally{$.p=f,q.T=d}}function Qh(e,t,l,r){if(Ed){var d=Kh(r);if(d===null)Dh(e,t,r,Td,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=Is(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var j=ln(f.pendingLanes);if(j!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;j;){var U=1<<31-Xt(j);w.entanglements[1]|=U,j&=~U}aa(f),(Ut&6)===0&&(ud=De()+500,Ho(0))}}break;case 31:case 13:w=pl(f,2),w!==null&&Js(w,f,2),fd(),Xh(f,2)}if(f=Kh(r),f===null&&Dh(e,t,r,Td,l),f===d)break;d=f}d!==null&&r.stopPropagation()}else Dh(e,t,r,null,l)}}function Kh(e){return e=St(e),Zh(e)}var Td=null;function Zh(e){if(Td=null,e=qt(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=x(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 Td=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(Ke()){case ut:return 2;case Ee:return 8;case Ce:case Oe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Fh=!1,Di=null,Oi=null,Li=null,Xo=new Map,Qo=new Map,zi=[],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":Di=null;break;case"dragenter":case"dragleave":Oi=null;break;case"mouseover":case"mouseout":Li=null;break;case"pointerover":case"pointerout":Xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(t.pointerId)}}function Ko(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=Is(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 Di=Ko(Di,e,t,l,r,d),!0;case"dragenter":return Oi=Ko(Oi,e,t,l,r,d),!0;case"mouseover":return Li=Ko(Li,e,t,l,r,d),!0;case"pointerover":var f=d.pointerId;return Xo.set(f,Ko(Xo.get(f)||null,e,t,l,r,d)),!0;case"gotpointercapture":return f=d.pointerId,Qo.set(f,Ko(Qo.get(f)||null,e,t,l,r,d)),!0}return!1}function $x(e){var t=qt(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=x(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 Cd(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);Cn=r,l.target.dispatchEvent(r),Cn=null}else return t=Is(l),t!==null&&Hx(t),e.blockedOn=l,!1;t.shift()}return!0}function Yx(e,t,l){Cd(e)&&l.delete(t)}function Q0(){Fh=!1,Di!==null&&Cd(Di)&&(Di=null),Oi!==null&&Cd(Oi)&&(Oi=null),Li!==null&&Cd(Li)&&(Li=null),Xo.forEach(Yx),Qo.forEach(Yx)}function Ad(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Q0)))}var Md=null;function Vx(e){Md!==e&&(Md=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Md===e&&(Md=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=Is(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 Ad(U,e)}Di!==null&&Ad(Di,e),Oi!==null&&Ad(Oi,e),Li!==null&&Ad(Li,e),Xo.forEach(t),Qo.forEach(t);for(var l=0;l<zi.length;l++){var r=zi[l];r.blockedOn===e&&(r.blockedOn=null)}for(;0<zi.length&&(l=zi[0],l.blockedOn===null);)$x(l),l.blockedOn===null&&zi.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[lt]||null;if(typeof f=="function")j||Vx(l);else if(j){var w=null;if(f&&f.hasAttribute("formAction")){if(d=f,j=f[lt]||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}Rd.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)},Rd.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),fd(),t[_n]=null}};function Rd(e){this._internalRoot=e}Rd.prototype.unstable_scheduleHydration=function(e){if(e){var t=ys();e={blockedOn:null,target:e,priority:t};for(var l=0;l<zi.length&&t!==0&&t<zi[l].priority;l++);zi.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"));$.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=g(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:q,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dd.isDisabled&&Dd.supportsFiber)try{pt=Dd.inject(K0),wt=Dd}catch{}}return Fo.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[_n]=t.current,Rh(e),new Ph(t)},Fo.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=an(r),d=z(r),d.callback=null,ce(l,d,r),l=r,t.current.lanes=l,J(t,l),aa(t),e[_n]=t.current,Rh(e),new Rd(t)},Fo.version="19.2.8",Fo}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 li,Yc,Vc,Xc,Qc,vu,Kc,_f,M_;class uv{constructor(s){jn(this,_f);jn(this,li,null);jn(this,Yc,new Set);jn(this,Vc,500);jn(this,Xc,null);jn(this,Qc,!1);jn(this,vu,null);jn(this,Kc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){Ht(this,Kc,s)}connect(){if(et(this,Qc))return;const s=new WebSocket(this.url);Ht(this,li,s),s.addEventListener("open",()=>{var i,c;Ht(this,Vc,500),this.send({type:"hello",protocol:C_,clientName:"ccv-web"}),(i=et(this,vu))==null||i.call(this),(c=et(this,Kc))==null||c.call(this)}),s.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of et(this,Yc))o(c)}),s.addEventListener("close",()=>{var i;Ht(this,li,null),(i=et(this,Kc))==null||i.call(this),Gn(this,_f,M_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){Ht(this,vu,s)}on(s){return et(this,Yc).add(s),()=>et(this,Yc).delete(s)}send(s){var i;((i=et(this,li))==null?void 0:i.readyState)===WebSocket.OPEN&&et(this,li).send(JSON.stringify(s))}get connected(){var s;return((s=et(this,li))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;Ht(this,Qc,!0),(s=et(this,li))==null||s.close()}}li=new WeakMap,Yc=new WeakMap,Vc=new WeakMap,Xc=new WeakMap,Qc=new WeakMap,vu=new WeakMap,Kc=new WeakMap,_f=new WeakSet,M_=function(){if(et(this,Qc)||et(this,Xc)!==null)return;const s=et(this,Vc);Ht(this,Vc,Math.min(s*2,1e4)),Ht(this,Xc,window.setTimeout(()=>{Ht(this,Xc,null),this.connect()},s))};const dv=1,R_="ccv:relay",tf="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 ha,Zc,pa,Fc,Pc,Xi,Tr,Cr,Qi,Ar,Jc,Mr,Rr,pn,Bi,kp,O_,Sr,Np;class hv{constructor(s){jn(this,pn);jn(this,ha,null);jn(this,Zc,new Set);jn(this,pa,null);jn(this,Fc,null);jn(this,Pc,500);jn(this,Xi,null);jn(this,Tr,!1);jn(this,Cr,!1);jn(this,Qi,!1);jn(this,Ar,null);jn(this,Jc,"Подключаемся…");jn(this,Mr,0);jn(this,Rr,[]);this.session=s}get connected(){return et(this,Cr)&&et(this,Qi)}get statusText(){return et(this,Jc)}get hostId(){return et(this,Ar)}on(s){return et(this,Zc).add(s),()=>et(this,Zc).delete(s)}onReconnect(s){Ht(this,Fc,s)}onStatus(s){Ht(this,pa,s)}connect(){et(this,Tr)||Gn(this,pn,kp).call(this)}send(s){if(!et(this,Cr)){et(this,Rr).length<64&&et(this,Rr).push(s);return}Gn(this,pn,Sr).call(this,{t:"client.frame",body:s})}close(){var s;Ht(this,Tr,!0),et(this,Xi)!==null&&window.clearTimeout(et(this,Xi)),(s=et(this,ha))==null||s.close()}}ha=new WeakMap,Zc=new WeakMap,pa=new WeakMap,Fc=new WeakMap,Pc=new WeakMap,Xi=new WeakMap,Tr=new WeakMap,Cr=new WeakMap,Qi=new WeakMap,Ar=new WeakMap,Jc=new WeakMap,Mr=new WeakMap,Rr=new WeakMap,pn=new WeakSet,Bi=function(s){var i;et(this,Jc)!==s&&(Ht(this,Jc,s),(i=et(this,pa))==null||i.call(this))},kp=async function(){if(et(this,ha))return;if(!et(this,Ar))try{Ht(this,Ar,await pv(this.session.token))}catch(c){Gn(this,pn,Bi).call(this,c instanceof Error?c.message:String(c)),Gn(this,pn,Np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${s}://${location.host}/relay/client`);Ht(this,ha,i),i.addEventListener("open",()=>{Gn(this,pn,Sr).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}Gn(this,pn,O_).call(this,o)}),i.addEventListener("close",()=>{var c;Ht(this,ha,null),Ht(this,Cr,!1),Ht(this,Qi,!1),Gn(this,pn,Bi).call(this,"Нет связи с сервером"),(c=et(this,pa))==null||c.call(this),Gn(this,pn,Np).call(this)}),i.addEventListener("error",()=>i.close())},O_=function(s){var i,c,o,u,h,x,p;switch(s.t){case"client.ok":Ht(this,Pc,500),Gn(this,pn,Sr).call(this,{t:"client.attach",hostId:et(this,Ar)??"",...et(this,Mr)>0?{sinceRseq:et(this,Mr)}:{}});return;case"client.attached":Ht(this,Cr,!0),Ht(this,Qi,s.online),Ht(this,Mr,s.rseq),Gn(this,pn,Bi).call(this,s.online?"Хост на связи":"Компьютер не на связи"),Gn(this,pn,Sr).call(this,{t:"client.frame",body:{type:"hello",protocol:C_,clientName:"ccv-web-relay"}});const g=et(this,Rr);Ht(this,Rr,[]);for(const _ of g)Gn(this,pn,Sr).call(this,{t:"client.frame",body:_});(i=et(this,Fc))==null||i.call(this),(c=et(this,pa))==null||c.call(this);return;case"host.frame":{s.rseq>0&&Ht(this,Mr,s.rseq);const _=s.body;for(const v of et(this,Zc))v(_);return}case"host.online":Ht(this,Qi,!0),Gn(this,pn,Bi).call(this,"Хост на связи"),(o=et(this,Fc))==null||o.call(this),(u=et(this,pa))==null||u.call(this);return;case"host.offline":Ht(this,Qi,!1),Gn(this,pn,Bi).call(this,"Компьютер не на связи"),(h=et(this,pa))==null||h.call(this);return;case"ping":Gn(this,pn,Sr).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(tf),Gn(this,pn,Bi).call(this,"Этот компьютер отвязан от аккаунта"),Ht(this,Tr,!0),(x=et(this,ha))==null||x.close();return}s.code!=="offline"&&Gn(this,pn,Bi).call(this,s.message),(p=et(this,pa))==null||p.call(this);return}},Sr=function(s){var i;((i=et(this,ha))==null?void 0:i.readyState)===WebSocket.OPEN&&et(this,ha).send(JSON.stringify(s))},Np=function(){if(et(this,Tr)||et(this,Xi)!==null)return;const s=et(this,Pc);Ht(this,Pc,Math.min(s*2,1e4)),Ht(this,Xi,window.setTimeout(()=>{Ht(this,Xi,null),Gn(this,pn,kp).call(this)},s))};async function pv(n){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(tf,s),s;const i=localStorage.getItem(tf);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(tf,u[0].id),u[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function nf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const mv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function gv(){if(nf()==="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 ru=null,cu=null;function Gp(){if(ru)return ru;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 ru=n,window.addEventListener("pagehide",I_),n}function ou(n){return Gp().get(n)??""}function af(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(){cu===null&&(cu=window.setTimeout(I_,_v))}function I_(){if(cu!==null&&window.clearTimeout(cu),cu=null,!!ru)try{localStorage.setItem(L_,JSON.stringify(Object.fromEntries(ru)))}catch{}}const ms={items:[],pending:[],lastSeq:0,contextTokens:null},Ki={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 uu(ms,n).items.map(s=>({...s,id:`h:${s.id}`}))}function uu(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 ia(n,{id:`u${i}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(p=>p.id===s.blockId);if(h===-1)return ia(n,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const x=c[h];return Mc(n,h,{...x,text:x.text+s.text})}case"assistant.text":{const h=c.findIndex(p=>p.id===s.blockId),x={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?ia(n,x):Mc(n,h,x)}case"thinking.delta":{const h=c.findIndex(p=>p.id===s.blockId);if(h===-1)return ia(n,{id:s.blockId,kind:"thinking",text:s.text});const x=c[h];return Mc(n,h,{...x,text:x.text+s.text})}case"assistant.thinking":{const h=c.findIndex(p=>p.id===s.blockId),x={id:s.blockId,kind:"thinking",text:s.text};return h===-1?ia(n,x):Mc(n,h,x)}case"tool.use":return ia(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(p=>p.kind==="tool"&&p.toolUseId===s.toolUseId);if(h===-1)return n;const x=c[h];return Mc(n,h,{...x,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(p=>p.requestId===s.requestId),x=n.pending.filter(p=>p.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const p=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===h.toolUseId);if(p!==-1){const g=c[p];return Mc({...n,pending:x},p,{...g,answers:s.answers})}}return s.decision==="allow"?{...n,pending:x}:ia({...n,pending:x},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=n.items.map(p=>p.kind==="assistant"&&p.streaming?{...p,streaming:!1}:p),x=s.contextTokens??n.contextTokens;return ia({...n,items:h,contextTokens:x},{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:ia(n,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ia(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 ia(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 x;const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light",(x=document.querySelector('meta[name="theme-color"]'))==null||x.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:"разрешено всё, включая команды"}],Dr={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=Dr[n];return Math.round(Math.min(i.max,Math.max(i.min,s)))}function Ev(){const n={};for(const s of Object.keys(Dr))n[s]=Dr[s].width;try{const s=localStorage.getItem(Y_);if(s){const i=JSON.parse(s);for(const c of Object.keys(Dr)){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,x)=>{s(p=>{const g=V_(h,x);if(p[h]===g)return p;const _={...p,[h]:g};return i(_),_})},[i]),o=b.useCallback(h=>{s(x=>{const p={...x,[h]:Dr[h].width};return i(p),p})},[i]),u={};for(const h of Object.keys(Dr))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 x=cb(u,h);s(p=>p===x?p:(i(x),x))},[i]),o=b.useCallback(()=>{s(ip),i(ip)},[i]);return{height:n,setHeight:c,reset:o}}function yf(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,x]=b.useState(!1),p=b.useCallback(()=>{u.current&&window.clearTimeout(u.current.timer),u.current=null,x(!1)},[]),g=b.useCallback(T=>{if(i||T.button!==0)return;const A={timer:0,x:T.clientX,y:T.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,x(!1),n()},c),u.current=A,x(!0)},[i,c,n]),_=b.useCallback(T=>{const A=u.current;!A||A.fired||Math.hypot(T.clientX-A.x,T.clientY-A.y)>o&&p()},[o,p]),v=b.useCallback(()=>{u.current&&!u.current.fired?p():x(!1)},[p]),y=b.useCallback(T=>{var A;if((A=u.current)!=null&&A.fired){u.current=null,T.preventDefault();return}if(!i){if(T.shiftKey){n();return}s()}},[i,s,n]),N=b.useCallback(T=>{T.preventDefault()},[]),k=b.useCallback(T=>{i||T.shiftKey&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),n())},[i,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:g,onPointerMove:_,onPointerUp:v,onPointerCancel:v,onPointerLeave:v,onClick:y,onContextMenu:N,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 zr=Xp();function Q_(n){zr=n}var Er={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 At(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|$)|$)/,ju=/^ {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_=At(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=At(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=At(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yv=At(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Qp).getRegex(),vf="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=At("^ {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",vf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),F_=n=>At(Kp).replace("hr",ju).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",vf).getRegex(),Xv=F_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Qv=F_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Kv=At(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qv).getRegex(),Pp={blockquote:Kv,code:Uv,def:$v,fences:Hv,heading:Bv,hr:ju,html:Vv,lheading:Z_,list:Yv,newline:Iv,paragraph:Xv,table:Er,text:Gv},ub=At("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ju).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",vf).getRegex(),Zv={...Pp,lheading:qv,table:ub,paragraph:At(Kp).replace("hr",ju).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",vf).getRegex()},Fv={...Pp,html:At(`^ *(?: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:Er,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:At(Kp).replace("hr",ju).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)))/,eo=/[\p{P}\p{S}]/u,jf=/[\s\p{P}\p{S}]/u,Jp=/[^\s\p{P}\p{S}]/u,ej=At(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jf).getRegex(),J_=/(?!~)[\p{P}\p{S}]/u,tj=/(?!~)[\s\p{P}\p{S}]/u,nj=/(?:[^\s\p{P}\p{S}]|~)/u,sj=At(/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=At(W_,"u").replace(/punct/g,eo).getRegex(),aj=At(W_,"u").replace(/punct/g,J_).getRegex(),ey="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ij=At(ey,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,jf).replace(/punct/g,eo).getRegex(),rj=At(ey,"gu").replace(/notPunctSpace/g,nj).replace(/punctSpace/g,tj).replace(/punct/g,J_).getRegex(),cj=At("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,jf).replace(/punct/g,eo).getRegex(),oj=At(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,eo).getRegex(),uj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",dj=At(uj,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,jf).replace(/punct/g,eo).getRegex(),fj=At(/\\(punct)/,"gu").replace(/punct/g,eo).getRegex(),hj=At(/^<(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=At(Fp).replace("(?:-->|$)","-->").getRegex(),mj=At("^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(),rf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gj=At(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",rf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ty=At(/^!?\[(label)\]\[(ref)\]/).replace("label",rf).replace("ref",Zp).getRegex(),ny=At(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zp).getRegex(),xj=At("reflink|nolink(?!\\()","g").replace("reflink",ty).replace("nolink",ny).getRegex(),db=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wp={_backpedal:Er,anyPunctuation:fj,autolink:hj,blockSkip:sj,br:P_,code:Jv,del:Er,delLDelim:Er,delRDelim:Er,emStrongLDelim:lj,emStrongRDelimAst:ij,emStrongRDelimUnd:cj,escape:Pv,link:gj,nolink:ny,punctuation:ej,reflink:ty,reflinkSearch:xj,tag:mj,text:Wv,url:Er},bj={...Wp,link:At(/^!?\[(label)\]\((.*?)\)/).replace("label",rf).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rf).getRegex()},Tp={...Wp,emStrongRDelimAst:rj,emStrongLDelim:aj,delLDelim:oj,delRDelim:dj,url:At(/^((?: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:At(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {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:At(P_).replace("{2,}","*").getRegex(),text:At(Tp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Od={normal:Pp,gfm:Zv,pedantic:Fv},Po={normal:Wp,gfm:Tp,breaks:_j,pedantic:bj},yj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fb=n=>yj[n];function ua(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,x,p)=>{let g=!1,_=x;for(;--_>=0&&p[_]==="\\";)g=!g;return g?"|":" |"}),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 Ui(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,x=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let p={type:n[0].charAt(0)==="!"?"image":"link",raw:i,href:u,title:h,text:x,tokens:c.inlineTokens(x)};return c.state.inLink=!1,p}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[x]=h;return x.length>=o.length?u.slice(o.length):u}).join(`
56
+ `)}var cf=class{constructor(n){nn(this,"options");nn(this,"rules");nn(this,"lexer");this.options=n||zr}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=Ui(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:Ui(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:Ui(s[0],`
58
+ `)}}blockquote(n){let s=this.rules.block.blockquote.exec(n);if(s){let i=Ui(s[0],`
59
+ `).split(`
60
+ `),c="",o="",u=[];for(;i.length>0;){let h=!1,x=[],p;for(p=0;p<i.length;p++)if(this.rules.other.blockquoteStart.test(i[p]))x.push(i[p]),h=!0;else if(!h)x.push(i[p]);else break;i=i.slice(p);let g=x.join(`
61
+ `),_=g.replace(this.rules.other.blockquoteSetextReplace,`
62
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
63
+ ${g}`:g,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 N=y,k=N.raw+`
65
+ `+i.join(`
66
+ `),T=this.blockquote(k);u[u.length-1]=T,c=c.substring(0,c.length-N.raw.length)+T.raw,o=o.substring(0,o.length-N.text.length)+T.text;break}else if((y==null?void 0:y.type)==="list"){let N=y,k=N.raw+`
67
+ `+i.join(`
68
+ `),T=this.list(k);u[u.length-1]=T,c=c.substring(0,c.length-y.raw.length)+T.raw,o=o.substring(0,o.length-N.raw.length)+T.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 p=!1,g="",_="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;g=s[0],n=n.substring(g.length);let v=jj(s[2].split(`
70
+ `,1)[0],s[1].length),y=n.split(`
71
+ `,1)[0],N=!v.trim(),k=0;if(this.options.pedantic?(k=2,_=v.trimStart()):N?k=s[1].length+1:(k=v.search(this.rules.other.nonSpaceChar),k=k>4?1:k,_=v.slice(k),k+=s[1].length),N&&this.rules.other.blankLine.test(y)&&(g+=y+`
72
+ `,n=n.substring(y.length+1),p=!0),!p){let T=this.rules.other.nextBulletRegex(k),A=this.rules.other.hrRegex(k),G=this.rules.other.fencesBeginRegex(k),Y=this.rules.other.headingBeginRegex(k),X=this.rules.other.htmlBeginRegex(k),B=this.rules.other.blockquoteBeginRegex(k);for(;n;){let R=n.split(`
73
+ `,1)[0],L;if(y=R,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),L=y):L=y.replace(this.rules.other.tabCharGlobal," "),G.test(y)||Y.test(y)||X.test(y)||B.test(y)||T.test(y)||A.test(y))break;if(L.search(this.rules.other.nonSpaceChar)>=k||!y.trim())_+=`
74
+ `+L.slice(k);else{if(N||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(v)||Y.test(v)||A.test(v))break;_+=`
75
+ `+y}N=!y.trim(),g+=R+`
76
+ `,n=n.substring(R.length+1),v=L.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(h=!0)),o.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=g}let x=o.items.at(-1);if(x)x.raw=x.raw.trimEnd(),x.text=x.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]);let g=p.tokens[0];if(p.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){p.text=p.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.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(p.raw);if(_){let v={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};p.checked=v.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=v.raw+p.tokens[0].raw,p.tokens[0].text=v.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(v)):p.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):p.tokens.unshift(v)}}else p.task&&(p.task=!1);if(!o.loose){let _=p.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 p of o.items){p.loose=!0;for(let g of p.tokens)g.type==="text"&&(g.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:Ui(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:Ui(s[0],`
79
+ `),header:[],align:[],rows:[]};if(i.length===c.length){for(let x of c)this.rules.other.tableAlignRight.test(x)?u.align.push("right"):this.rules.other.tableAlignCenter.test(x)?u.align.push("center"):this.rules.other.tableAlignLeft.test(x)?u.align.push("left"):u.align.push(null);for(let x=0;x<i.length;x++)u.header.push({text:i[x],tokens:this.lexer.inline(i[x]),header:!0,align:u.align[x]});for(let x of o)u.rows.push(pb(x,u.header.length).map((p,g)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:u.align[g]})));return u}}lheading(n){let s=this.rules.block.lheading.exec(n);if(s){let i=s[1].trim();return{type:"heading",raw:Ui(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=Ui(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,x=o,p=0,g=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;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)continue;if(h=[...u].length,c[3]||c[4]){x+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){p+=h;continue}if(x-=h,x>0)continue;h=Math.min(h,h+x+p);let _=[...c[0]][0].length,v=n.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let N=v.slice(1,-1);return{type:"em",raw:v,text:N,tokens:this.lexer.inlineTokens(N)}}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,x=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,s=s.slice(-1*n.length+o);(c=p.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]){x+=h;continue}if(x-=h,x>0)continue;h=Math.min(h,h+x);let g=[...c[0]][0].length,_=n.slice(0,o+c.index+g+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}}}},Bl=class Cp{constructor(s){nn(this,"tokens");nn(this,"options");nn(this,"state");nn(this,"inlineQueue");nn(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||zr,this.options.tokenizer=this.options.tokenizer||new cf,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:Od.normal,inline:Po.normal};this.options.pedantic?(i.block=Od.pedantic,i.inline=Po.pedantic):this.options.gfm&&(i.block=Od.gfm,this.options.breaks?i.inline=Po.breaks:i.inline=Po.gfm),this.tokenizer.rules=i}static get rules(){return{block:Od,inline:Po}}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,x;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 p;if((h=(u=this.options.extensions)==null?void 0:u.block)!=null&&h.some(_=>(p=_.call({lexer:this},s,i))?(s=s.substring(p.raw.length),i.push(p),!0):!1))continue;if(p=this.tokenizer.space(s)){s=s.substring(p.raw.length);let _=i.at(-1);p.raw.length===1&&_!==void 0?_.raw+=`
83
+ `:i.push(p);continue}if(p=this.tokenizer.code(s)){s=s.substring(p.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
84
+ `)?"":`
85
+ `)+p.raw,_.text+=`
86
+ `+p.text,this.inlineQueue.at(-1).src=_.text):i.push(p);continue}if(p=this.tokenizer.fences(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.heading(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.hr(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.blockquote(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.list(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.html(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.def(s)){s=s.substring(p.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
87
+ `)?"":`
88
+ `)+p.raw,_.text+=`
89
+ `+p.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[p.tag]||(this.tokens.links[p.tag]={href:p.href,title:p.title},i.push(p));continue}if(p=this.tokenizer.table(s)){s=s.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.lheading(s)){s=s.substring(p.raw.length),i.push(p);continue}let g=s;if((x=this.options.extensions)!=null&&x.startBlock){let _=1/0,v=s.slice(1),y;this.options.extensions.startBlock.forEach(N=>{y=N.call({lexer:this},v),typeof y=="number"&&y>=0&&(_=Math.min(_,y))}),_<1/0&&_>=0&&(g=s.substring(0,_+1))}if(this.state.top&&(p=this.tokenizer.paragraph(g))){let _=i.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
90
+ `)?"":`
91
+ `)+p.raw,_.text+=`
92
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(p),c=g.length!==s.length,s=s.substring(p.raw.length);continue}if(p=this.tokenizer.text(s)){s=s.substring(p.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
93
+ `)?"":`
94
+ `)+p.raw,_.text+=`
95
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(p);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 x,p,g,_,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,N=>y.includes(N.slice(N.lastIndexOf("[")+1,-1))?"["+"a".repeat(N.length-2)+"]":N))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(y,N,k)=>{let T=k?k.length:0;return y.slice(0,T)+"["+"a".repeat(y.length-T-2)+"]"}),c=((p=(x=this.options.hooks)==null?void 0:x.emStrongMask)==null?void 0:p.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((_=(g=this.options.extensions)==null?void 0:g.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 N=s;if((v=this.options.extensions)!=null&&v.startInline){let k=1/0,T=s.slice(1),A;this.options.extensions.startInline.forEach(G=>{A=G.call({lexer:this},T),typeof A=="number"&&A>=0&&(k=Math.min(k,A))}),k<1/0&&k>=0&&(N=s.substring(0,k+1))}if(y=this.tokenizer.inlineText(N)){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)}},of=class{constructor(n){nn(this,"options");nn(this,"parser");this.options=n||zr}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-'+ua(c)+'">'+(i?o:ua(o,!0))+`</code></pre>
97
+ `:"<pre><code>"+(i?o:ua(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 x=n.items[h];c+=this.listitem(x)}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>${ua(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="'+ua(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 ua(i);n=o;let u=`<img src="${n}" alt="${ua(i)}"`;return s&&(u+=` title="${ua(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ua(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}},ql=class Ap{constructor(s){nn(this,"options");nn(this,"renderer");nn(this,"textRenderer");this.options=s||zr,this.options.renderer=this.options.renderer||new of,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 p=h,g=this.options.extensions.renderers[p.type].call({parser:this},p);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){i+=g||"";continue}}let x=h;switch(x.type){case"space":{i+=this.renderer.space(x);break}case"hr":{i+=this.renderer.hr(x);break}case"heading":{i+=this.renderer.heading(x);break}case"code":{i+=this.renderer.code(x);break}case"table":{i+=this.renderer.table(x);break}case"blockquote":{i+=this.renderer.blockquote(x);break}case"list":{i+=this.renderer.list(x);break}case"checkbox":{i+=this.renderer.checkbox(x);break}case"html":{i+=this.renderer.html(x);break}case"def":{i+=this.renderer.def(x);break}case"paragraph":{i+=this.renderer.paragraph(x);break}case"text":{i+=this.renderer.text(x);break}default:{let p='Token with "'+x.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}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 x=s[h];if((u=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&u[x.type]){let g=this.options.extensions.renderers[x.type].call({parser:this},x);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(x.type)){c+=g||"";continue}}let p=x;switch(p.type){case"escape":{c+=i.text(p);break}case"html":{c+=i.html(p);break}case"link":{c+=i.link(p);break}case"image":{c+=i.image(p);break}case"checkbox":{c+=i.checkbox(p);break}case"strong":{c+=i.strong(p);break}case"em":{c+=i.em(p);break}case"codespan":{c+=i.codespan(p);break}case"br":{c+=i.br(p);break}case"del":{c+=i.del(p);break}case"text":{c+=i.text(p);break}default:{let g='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return c}},ef,au=(ef=class{constructor(n){nn(this,"options");nn(this,"block");this.options=n||zr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?Bl.lex:Bl.lexInline}provideParser(n=this.block){return n?ql.parse:ql.parseInline}},nn(ef,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),nn(ef,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ef),kj=class{constructor(...n){nn(this,"defaults",Xp());nn(this,"options",this.setOptions);nn(this,"parse",this.parseMarkdown(!0));nn(this,"parseInline",this.parseMarkdown(!1));nn(this,"Parser",ql);nn(this,"Renderer",of);nn(this,"TextRenderer",em);nn(this,"Lexer",Bl);nn(this,"Tokenizer",cf);nn(this,"Hooks",au);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 x of h.header)i=i.concat(this.walkTokens(x.tokens,s));for(let x of h.rows)for(let p of x)i=i.concat(this.walkTokens(p.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(x=>{let p=h[x].flat(1/0);i=i.concat(this.walkTokens(p,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 x=o.renderer.apply(this,h);return x===!1&&(x=u.apply(this,h)),x}: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 of(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,x=i.renderer[h],p=o[h];o[h]=(...g)=>{let _=x.apply(o,g);return _===!1&&(_=p.apply(o,g)),_||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new cf(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,x=i.tokenizer[h],p=o[h];o[h]=(...g)=>{let _=x.apply(o,g);return _===!1&&(_=p.apply(o,g)),_}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new au;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,x=i.hooks[h],p=o[h];au.passThroughHooks.has(u)?o[h]=g=>{if(this.defaults.async&&au.passThroughHooksRespectAsync.has(u))return(async()=>{let v=await x.call(o,g);return p.call(o,v)})();let _=x.call(o,g);return p.call(o,_)}:o[h]=(...g)=>{if(this.defaults.async)return(async()=>{let v=await x.apply(o,g);return v===!1&&(v=await p.apply(o,g)),v})();let _=x.apply(o,g);return _===!1&&(_=p.apply(o,g)),_}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,u=i.walkTokens;c.walkTokens=function(h){let x=[];return x.push(u.call(this,h)),o&&(x=x.concat(o.call(this,h))),x}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,s){return Bl.lex(n,s??this.defaults)}parser(n,s){return ql.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,x=await(o.hooks?await o.hooks.provideLexer(n):n?Bl.lex:Bl.lexInline)(h,o),p=o.hooks?await o.hooks.processAllTokens(x):x;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let g=await(o.hooks?await o.hooks.provideParser(n):n?ql.parse:ql.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(g):g})().catch(u);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(n):n?Bl.lex:Bl.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let x=(o.hooks?o.hooks.provideParser(n):n?ql.parse:ql.parseInline)(h,o);return o.hooks&&(x=o.hooks.postprocess(x)),x}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>"+ua(i.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(i);throw i}}},Lr=new kj;function Vt(n,s){return Lr.parse(n,s)}Vt.options=Vt.setOptions=function(n){return Lr.setOptions(n),Vt.defaults=Lr.defaults,Q_(Vt.defaults),Vt};Vt.getDefaults=Xp;Vt.defaults=zr;Vt.use=function(...n){return Lr.use(...n),Vt.defaults=Lr.defaults,Q_(Vt.defaults),Vt};Vt.walkTokens=function(n,s){return Lr.walkTokens(n,s)};Vt.parseInline=Lr.parseInline;Vt.Parser=ql;Vt.parser=ql.parse;Vt.Renderer=of;Vt.TextRenderer=em;Vt.Lexer=Bl;Vt.lexer=Bl.lex;Vt.Tokenizer=cf;Vt.Hooks=au;Vt.parse=Vt;Vt.options;Vt.setOptions;Vt.use;Vt.walkTokens;Vt.parseInline;ql.parse;Bl.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,x=[],p=!0,g=!1;try{if(u=(i=i.call(n)).next,s!==0)for(;!(p=(c=u.call(i)).done)&&(x.push(c.value),x.length!==s);p=!0);}catch(_){g=!0,o=_}finally{try{if(!p&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(g)throw o}}return x}}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 xs=Object.freeze,bs=Object.seal,Ic=Object.create,ly=typeof Reflect<"u"&&Reflect,Mp=ly.apply,Rp=ly.construct;xs||(xs=function(s){return s});bs||(bs=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=$n(Array.prototype.forEach),Dj=$n(Array.prototype.lastIndexOf),_b=$n(Array.prototype.pop),Oc=$n(Array.prototype.push),Oj=$n(Array.prototype.splice),Yi=Array.isArray,iu=$n(String.prototype.toLowerCase),rp=$n(String.prototype.toString),yb=$n(String.prototype.match),Jo=$n(String.prototype.replace),vb=$n(String.prototype.indexOf),Lj=$n(String.prototype.trim),zj=$n(Number.prototype.toString),Ij=$n(Boolean.prototype.toString),jb=typeof BigInt>"u"?null:$n(BigInt.prototype.toString),wb=typeof Symbol>"u"?null:$n(Symbol.prototype.toString),ls=$n(Object.prototype.hasOwnProperty),Wo=$n(Object.prototype.toString),ss=$n(RegExp.prototype.test),wr=Uj(TypeError);function $n(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 Ct(n,s){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:iu;if(bb&&bb(n,null),!Yi(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++)ls(n,s)||(n[s]=null);return n}function zs(n){const s=Ic(null);for(const c of sy(n)){var i=Tj(c,2);const o=i[0],u=i[1];ls(n,o)&&(Yi(u)?s[o]=Hj(u):u&&typeof u=="object"&&u.constructor===Object?s[o]=zs(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 Wo(n);case"function":case"object":{if(n===null)return Wo(n);const s=n,i=da(s,"toString");if(typeof i=="function"){const c=i(s);return typeof c=="string"?c:Wo(c)}return Wo(n)}default:return Wo(n)}}function da(n,s){for(;n!==null;){const c=Rj(n,s);if(c){if(c.get)return $n(c.get);if(typeof c.value=="function")return $n(c.value)}n=Mj(n)}function i(){return null}return i}function qj(n){try{return ss(n,""),!0}catch{return!1}}const kb=xs(["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=xs(["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=xs(["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=xs(["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=xs(["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=xs(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nb=xs(["#text"]),Sb=xs(["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=xs(["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=xs(["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"]),Ld=xs(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yj=bs(/{{[\w\W]*|^[\w\W]*}}/g),Vj=bs(/<%[\w\W]*|^[\w\W]*%>/g),Xj=bs(/\${[\w\W]*/g),Qj=bs(/^data-[\-\w.\u00B7-\uFFFF]+$/),Kj=bs(/^aria-[\-\w]+$/),Tb=bs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zj=bs(/^(?:\w+script|data):/i),Fj=bs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pj=bs(/^html$/i),Jj=bs(/^[a-z][.\w]*(-[.\w]+)+$/i),Cb=bs(/<[/\w!]/g),Ab=bs(/<[/\w]/g),Wj=bs(/<\/no(script|embed|frames)/i),ew=bs(/\/>/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:[]}},Hi=function(s,i,c,o){return ls(s,i)&&Yi(s[i])?Ct(o.base?zs(o.base):{},s[i],o.transform):c};function ay(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tw();const s=Ne=>ay(Ne);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,x=n.Element,p=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const _=n.DOMParser,v=n.trustedTypes,y=x.prototype,N=da(y,"cloneNode"),k=da(y,"remove"),T=da(y,"nextSibling"),A=da(y,"childNodes"),G=da(y,"parentNode"),Y=da(y,"shadowRoot"),X=da(y,"attributes"),B=h&&h.prototype?da(h.prototype,"nodeType"):null,R=h&&h.prototype?da(h.prototype,"nodeName"):null;if(typeof u=="function"){const Ne=i.createElement("template");Ne.content&&Ne.content.ownerDocument&&(i=Ne.content.ownerDocument)}let L,H="",D,O=!1,I=0;const M=function(){if(I>0)throw wr('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.')},P=function(C){M(),I++;try{return L.createHTML(C)}finally{I--}},re=function(C){M(),I++;try{return L.createScriptURL(C)}finally{I--}},_e=function(){return O||(D=nw(v,o),O=!0),D},we=i,q=we.implementation,$=we.createNodeIterator,W=we.createDocumentFragment,Q=we.getElementsByTagName,ve=c.importNode;let E=Mb();s.isSupported=typeof sy=="function"&&typeof G=="function"&&q&&q.createHTMLDocument!==void 0;const K=Yj,xe=Vj,ke=Xj,Re=Qj,me=Kj,He=Zj,tt=Fj,ot=Jj;let sn=Tb,de=null;const st=Ct({},[...kb,...cp,...op,...up,...Nb]);let oe=null;const Rt=Ct({},[...Sb,...dp,...Eb,...Ld]);let qe=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}})),Bt=null,On=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 Zt=!0,on=!0,Yn=!1,jt=!0,Z=!1,De=!0,Ke=!1,ut=!1,Ee=null,Ce=null,Oe=!1,$e=!1,Ie=!1,Pe=!1,pt=!0,wt=!1;const Lt="user-content-";let Xt=!0,_s=!1,ie={},je=null;const Xe=Ct({},["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 at=null;const Je=Ct({},["audio","video","img","source","image","track"]);let ln=null;const Vn=Ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gn="http://www.w3.org/1998/Math/MathML",un="http://www.w3.org/2000/svg",Ft="http://www.w3.org/1999/xhtml";let zt=Ft,J=!1,fe=null;const Me=Ct({},[gn,un,Ft],rp),Ze=xs(["mi","mo","mn","ms","mtext"]);let It=Ct({},Ze);const an=xs(["annotation-xml"]);let Et=Ct({},an);const ys=Ct({},["title","style","font","a","script"]);let Xn=null;const is=["application/xhtml+xml","text/html"],dn="text/html";let lt=null,_n=null;const Es=i.createElement("form"),Ts=function(C){return C instanceof RegExp||C instanceof Function},Cs=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_n&&_n===C)return;(!C||typeof C!="object")&&(C={}),C=zs(C),Xn=is.indexOf(C.PARSER_MEDIA_TYPE)===-1?dn:C.PARSER_MEDIA_TYPE,lt=Xn==="application/xhtml+xml"?rp:iu,de=Hi(C,"ALLOWED_TAGS",st,{transform:lt}),oe=Hi(C,"ALLOWED_ATTR",Rt,{transform:lt}),fe=Hi(C,"ALLOWED_NAMESPACES",Me,{transform:rp}),ln=Hi(C,"ADD_URI_SAFE_ATTR",Vn,{transform:lt,base:Vn}),at=Hi(C,"ADD_DATA_URI_TAGS",Je,{transform:lt,base:Je}),je=Hi(C,"FORBID_CONTENTS",Xe,{transform:lt}),Bt=Hi(C,"FORBID_TAGS",zs({}),{transform:lt}),On=Hi(C,"FORBID_ATTR",zs({}),{transform:lt}),ie=ls(C,"USE_PROFILES")?C.USE_PROFILES&&typeof C.USE_PROFILES=="object"?zs(C.USE_PROFILES):C.USE_PROFILES:!1,Zt=C.ALLOW_ARIA_ATTR!==!1,on=C.ALLOW_DATA_ATTR!==!1,Yn=C.ALLOW_UNKNOWN_PROTOCOLS||!1,jt=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=C.SAFE_FOR_TEMPLATES||!1,De=C.SAFE_FOR_XML!==!1,Ke=C.WHOLE_DOCUMENT||!1,$e=C.RETURN_DOM||!1,Ie=C.RETURN_DOM_FRAGMENT||!1,Pe=C.RETURN_TRUSTED_TYPE||!1,Oe=C.FORCE_BODY||!1,pt=C.SANITIZE_DOM!==!1,wt=C.SANITIZE_NAMED_PROPS||!1,Xt=C.KEEP_CONTENT!==!1,_s=C.IN_PLACE||!1,sn=qj(C.ALLOWED_URI_REGEXP)?C.ALLOWED_URI_REGEXP:Tb,zt=typeof C.NAMESPACE=="string"?C.NAMESPACE:Ft,It=ls(C,"MATHML_TEXT_INTEGRATION_POINTS")&&C.MATHML_TEXT_INTEGRATION_POINTS&&typeof C.MATHML_TEXT_INTEGRATION_POINTS=="object"?zs(C.MATHML_TEXT_INTEGRATION_POINTS):Ct({},Ze),Et=ls(C,"HTML_INTEGRATION_POINTS")&&C.HTML_INTEGRATION_POINTS&&typeof C.HTML_INTEGRATION_POINTS=="object"?zs(C.HTML_INTEGRATION_POINTS):Ct({},an);const ee=ls(C,"CUSTOM_ELEMENT_HANDLING")&&C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING=="object"?zs(C.CUSTOM_ELEMENT_HANDLING):Ic(null);if(qe=Ic(null),ls(ee,"tagNameCheck")&&Ts(ee.tagNameCheck)&&(qe.tagNameCheck=ee.tagNameCheck),ls(ee,"attributeNameCheck")&&Ts(ee.attributeNameCheck)&&(qe.attributeNameCheck=ee.attributeNameCheck),ls(ee,"allowCustomizedBuiltInElements")&&typeof ee.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=ee.allowCustomizedBuiltInElements),bs(qe),Z&&(on=!1),Ie&&($e=!0),ie&&(de=Ct({},Nb),oe=Ic(null),ie.html===!0&&(Ct(de,kb),Ct(oe,Sb)),ie.svg===!0&&(Ct(de,cp),Ct(oe,dp),Ct(oe,Ld)),ie.svgFilters===!0&&(Ct(de,op),Ct(oe,dp),Ct(oe,Ld)),ie.mathMl===!0&&(Ct(de,up),Ct(oe,Eb),Ct(oe,Ld))),xt.tagCheck=null,xt.attributeCheck=null,ls(C,"ADD_TAGS")&&(typeof C.ADD_TAGS=="function"?xt.tagCheck=C.ADD_TAGS:Yi(C.ADD_TAGS)&&(de===st&&(de=zs(de)),Ct(de,C.ADD_TAGS,lt))),ls(C,"ADD_ATTR")&&(typeof C.ADD_ATTR=="function"?xt.attributeCheck=C.ADD_ATTR:Yi(C.ADD_ATTR)&&(oe===Rt&&(oe=zs(oe)),Ct(oe,C.ADD_ATTR,lt))),ls(C,"ADD_URI_SAFE_ATTR")&&Yi(C.ADD_URI_SAFE_ATTR)&&Ct(ln,C.ADD_URI_SAFE_ATTR,lt),ls(C,"FORBID_CONTENTS")&&Yi(C.FORBID_CONTENTS)&&(je===Xe&&(je=zs(je)),Ct(je,C.FORBID_CONTENTS,lt)),ls(C,"ADD_FORBID_CONTENTS")&&Yi(C.ADD_FORBID_CONTENTS)&&(je===Xe&&(je=zs(je)),Ct(je,C.ADD_FORBID_CONTENTS,lt)),Xt&&(de["#text"]=!0),Ke&&Ct(de,["html","head","body"]),de.table&&(Ct(de,["tbody"]),delete Bt.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw wr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ye=L;L=C.TRUSTED_TYPES_POLICY;try{H=P("")}catch(Te){throw L=ye,Te}}else C.TRUSTED_TYPES_POLICY===null?(L=void 0,H=""):(L===void 0&&(L=_e()),L&&typeof H=="string"&&(H=P("")));xs&&xs(C),_n=C},rs=Ct({},[...cp,...op,...Gj]),cs=Ct({},[...up,...$j]),os=function(C,ee,ye){return ee.namespaceURI===Ft?C==="svg":ee.namespaceURI===gn?C==="svg"&&(ye==="annotation-xml"||It[ye]):!!rs[C]},qt=function(C,ee,ye){return ee.namespaceURI===Ft?C==="math":ee.namespaceURI===un?C==="math"&&Et[ye]:!!cs[C]},Is=function(C,ee,ye){return ee.namespaceURI===un&&!Et[ye]||ee.namespaceURI===gn&&!It[ye]?!1:!cs[C]&&(ys[C]||!rs[C])},Pt=function(C){let ee=G(C);(!ee||!ee.tagName)&&(ee={namespaceURI:zt,tagName:"template"});const ye=iu(C.tagName),Te=iu(ee.tagName);return fe[C.namespaceURI]?C.namespaceURI===un?os(ye,ee,Te):C.namespaceURI===gn?qt(ye,ee,Te):C.namespaceURI===Ft?Is(ye,ee,Te):!!(Xn==="application/xhtml+xml"&&fe[C.namespaceURI]):!1},yn=function(C){Oc(s.removed,{element:C});try{G(C).removeChild(C)}catch{if(k(C),!G(C))throw wr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},nt=function(C){Wn(C);const ee=A(C);if(ee){const Te=[];Dc(ee,ze=>{Oc(Te,ze)}),Dc(Te,ze=>{try{k(ze)}catch{}})}const ye=X(C);if(ye)for(let Te=ye.length-1;Te>=0;--Te){const ze=ye[Te],Fe=ze&&ze.name;if(typeof Fe=="string")try{C.removeAttribute(Fe)}catch{}}},Jn=function(C,ee){try{Oc(s.removed,{attribute:ee.getAttributeNode(C),from:ee})}catch{Oc(s.removed,{attribute:null,from:ee})}if(ee.removeAttribute(C),C==="is")if($e||Ie)try{yn(ee)}catch{}else try{ee.setAttribute(C,"")}catch{}},Qn=function(C){const ee=X(C);if(ee)for(let ye=ee.length-1;ye>=0;--ye){const Te=ee[ye],ze=Te&&Te.name;if(!(typeof ze!="string"||oe[lt(ze)]))try{C.removeAttribute(ze)}catch{}}},Wn=function(C){const ee=[C];for(;ee.length>0;){const ye=ee.pop();(B?B(ye):ye.nodeType)===dl.element&&Qn(ye);const ze=A(ye);if(ze)for(let Fe=ze.length-1;Fe>=0;--Fe)ee.push(ze[Fe])}},Tn=function(C){if(!De)return;const ee=[C];for(;ee.length>0;){const ye=ee.pop(),Te=B?B(ye):ye.nodeType;if(Te===dl.processingInstruction||Te===dl.comment&&ss(Ab,ye.data)){try{k(ye)}catch{}continue}if(Te===dl.element){const Fe=ye,$t=lt(R?R(ye):ye.nodeName);try{Fe.hasAttribute&&Fe.hasAttribute("patchsrc")&&Fe.removeAttribute("patchsrc"),Fe.hasAttribute&&Fe.hasAttribute("for")&&$t!=="label"&&$t!=="output"&&Fe.removeAttribute("for")}catch{}}const ze=A(ye);if(ze)for(let Fe=ze.length-1;Fe>=0;--Fe)ee.push(ze[Fe])}},wl=function(C){let ee=null,ye=null;if(Oe)C="<remove></remove>"+C;else{const Fe=yb(C,/^[\r\n\t ]+/);ye=Fe&&Fe[0]}Xn==="application/xhtml+xml"&&zt===Ft&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Te=L?P(C):C;if(zt===Ft)try{ee=new _().parseFromString(Te,Xn)}catch{}if(!ee||!ee.documentElement){ee=q.createDocument(zt,"template",null);try{ee.documentElement.innerHTML=J?H:Te}catch{}}const ze=ee.body||ee.documentElement;return C&&ye&&ze.insertBefore(i.createTextNode(ye),ze.childNodes[0]||null),zt===Ft?Q.call(ee,Ke?"html":"body")[0]:Ke?ee.documentElement:ze},Us=function(C){return $.call(C.ownerDocument||C,C,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},es=function(C){return C=Jo(C,K," "),C=Jo(C,xe," "),C=Jo(C,ke," "),C},Hs=function(C){var ee;C.normalize();const ye=$.call(C.ownerDocument||C,C,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null);let Te=ye.nextNode();for(;Te;)Te.data=es(Te.data),Te=ye.nextNode();const ze=(ee=C.querySelectorAll)===null||ee===void 0?void 0:ee.call(C,"template");ze&&Dc(ze,Fe=>{Tt(Fe.content)&&Hs(Fe.content)})},wn=function(C){const ee=R?R(C):null;return typeof ee!="string"||lt(ee)!=="form"?!1:typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||C.attributes!==X(C)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function"||C.nodeType!==B(C)||C.childNodes!==A(C)},Tt=function(C){if(!B||typeof C!="object"||C===null)return!1;try{return B(C)===dl.documentFragment}catch{return!1}},Ln=function(C){if(!B||typeof C!="object"||C===null)return!1;try{return typeof B(C)=="number"}catch{return!1}};function Gt(Ne,C,ee){Ne.length!==0&&Dc(Ne,ye=>{ye.call(s,C,ee,_n)})}const ii=function(C,ee){return!!(De&&C.hasChildNodes()&&!Ln(C.firstElementChild)&&ss(Cb,C.textContent)&&ss(Cb,C.innerHTML)||De&&C.namespaceURI===Ft&&ee==="style"&&Ln(C.firstElementChild)||C.nodeType===dl.processingInstruction||De&&C.nodeType===dl.comment&&ss(Ab,C.data))},xa=function(C,ee){if(!Bt[ee]&&ri(ee)&&(qe.tagNameCheck instanceof RegExp&&ss(qe.tagNameCheck,ee)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(ee)))return!1;if(Xt&&!je[ee]){const ye=G(C),Te=A(C);if(Te&&ye){const ze=Te.length;for(let Fe=ze-1;Fe>=0;--Fe){const $t=_s?Te[Fe]:N(Te[Fe],!0);ye.insertBefore($t,T(C))}}}return yn(C),!0},Yl=function(C,ee){if(Gt(E.beforeSanitizeElements,C,null),C!==ee&&G(C)===null)return!0;if(wn(C))return yn(C),!0;const ye=lt(R?R(C):C.nodeName);if(Gt(E.uponSanitizeElement,C,{tagName:ye,allowedTags:de}),C!==ee&&G(C)===null)return!0;if(ii(C,ye))return yn(C),!0;if(Bt[ye]||!(xt.tagCheck instanceof Function&&xt.tagCheck(ye))&&!de[ye]){const ze=xa(C,ye);return ze===!1&&Gt(E.afterSanitizeElements,C,null),ze}if((B?B(C):C.nodeType)===dl.element&&!Pt(C)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&ss(Wj,C.innerHTML))return yn(C),!0;if(Z&&C.nodeType===dl.text){const ze=es(C.textContent);C.textContent!==ze&&(Oc(s.removed,{element:C.cloneNode()}),C.textContent=ze)}return Gt(E.afterSanitizeElements,C,null),!1},ba=function(C,ee,ye){if(On[ee]||De&&ee==="patchsrc"||De&&ee==="for"&&C!=="label"&&C!=="output"||pt&&(ee==="id"||ee==="name")&&(ye in i||ye in Es))return!1;const Te=oe[ee]||xt.attributeCheck instanceof Function&&xt.attributeCheck(ee,C);if(!(on&&ss(Re,ee))){if(!(Zt&&ss(me,ee))){if(Te){if(!ln[ee]){if(!ss(sn,Jo(ye,tt,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&C!=="script"&&vb(ye,"data:")===0&&at[C])){if(!(Yn&&!ss(He,Jo(ye,tt,"")))){if(ye)return!1}}}}}else if(!(ri(C)&&(qe.tagNameCheck instanceof RegExp&&ss(qe.tagNameCheck,C)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(C))&&(qe.attributeNameCheck instanceof RegExp&&ss(qe.attributeNameCheck,ee)||qe.attributeNameCheck instanceof Function&&qe.attributeNameCheck(ee,C))||ee==="is"&&qe.allowCustomizedBuiltInElements&&(qe.tagNameCheck instanceof RegExp&&ss(qe.tagNameCheck,ye)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(ye))))return!1}}return!0},zn=Ct({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ri=function(C){return!zn[iu(C)]&&ss(ot,C)},vn=function(C,ee,ye,Te){if(L&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ye)switch(v.getAttributeType(C,ee)){case"TrustedHTML":return P(Te);case"TrustedScriptURL":return re(Te)}return Te},Vl=function(C,ee,ye,Te){try{ye?C.setAttributeNS(ye,ee,Te):C.setAttribute(ee,Te),wn(C)?yn(C):_b(s.removed)}catch{Jn(ee,C)}},kl=function(C){Gt(E.beforeSanitizeAttributes,C,null);const ee=C.attributes;if(!ee||wn(C))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let Te=ee.length;const ze=lt(C.nodeName);for(;Te--;){const Fe=ee[Te],$t=Fe.name,mt=Fe.namespaceURI,In=Fe.value,it=lt($t),Cn=In;let St=$t==="value"?Cn:Lj(Cn);if(ye.attrName=it,ye.attrValue=St,ye.keepAttr=!0,ye.forceKeepAttr=void 0,Gt(E.uponSanitizeAttribute,C,ye),St=ye.attrValue,wt&&(it==="id"||it==="name")&&vb(St,Lt)!==0&&(Jn($t,C),St=Lt+St),De&&ss(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,St)){Jn($t,C);continue}if(it==="attributename"&&yb(St,"href")){Jn($t,C);continue}if(!ye.forceKeepAttr){if(!ye.keepAttr){Jn($t,C);continue}if(!jt&&ss(ew,St)){Jn($t,C);continue}if(Z&&(St=es(St)),!ba(ze,it,St)){Jn($t,C);continue}St=vn(ze,it,mt,St),St!==Cn&&Vl(C,$t,mt,St)}}Gt(E.afterSanitizeAttributes,C,null)},us=function(C){let ee=null;const ye=Us(C);for(Gt(E.beforeSanitizeShadowDOM,C,null);ee=ye.nextNode();)if(Gt(E.uponSanitizeShadowNode,ee,null),Yl(ee,C),kl(ee),Tt(ee.content)&&us(ee.content),(B?B(ee):ee.nodeType)===dl.element){const ze=Y(ee);Tt(ze)&&(As(ze),us(ze))}Gt(E.afterSanitizeShadowDOM,C,null)},As=function(C){const ee=[{node:C,shadow:null}];for(;ee.length>0;){const ye=ee.pop();if(ye.shadow){us(ye.shadow);continue}const Te=ye.node,Fe=(B?B(Te):Te.nodeType)===dl.element,$t=A(Te);if($t)for(let mt=$t.length-1;mt>=0;--mt)ee.push({node:$t[mt],shadow:null});if(Fe){const mt=R?R(Te):null;if(typeof mt=="string"&&lt(mt)==="template"){const In=Te.content;Tt(In)&&ee.push({node:In,shadow:null})}}if(Fe){const mt=Y(Te);Tt(mt)&&ee.push({node:null,shadow:mt},{node:mt,shadow:null})}}};return s.sanitize=function(Ne){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,ye=null,Te=null,ze=null;if(J=!Ne,J&&(Ne="<!-->"),typeof Ne!="string"&&!Ln(Ne)&&(Ne=Bj(Ne),typeof Ne!="string"))throw wr("dirty is not a string, aborting");if(!s.isSupported)return Ne;ut?(de=Ee,oe=Ce):Cs(C),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(de=zs(de)),E.uponSanitizeAttribute.length>0&&(oe=zs(oe)),s.removed=[];const Fe=_s&&typeof Ne!="string"&&Ln(Ne);if(Fe){Tn(Ne);const it=R?R(Ne):Ne.nodeName;if(typeof it=="string"){const Cn=lt(it);if(!de[Cn]||Bt[Cn])throw nt(Ne),wr("root node is forbidden and cannot be sanitized in-place")}if(wn(Ne))throw nt(Ne),wr("root node is clobbered and cannot be sanitized in-place");try{As(Ne)}catch(Cn){throw nt(Ne),Cn}}else if(Ln(Ne))ee=wl("<!---->"),ye=ee.ownerDocument.importNode(Ne,!0),ye.nodeType===dl.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?ee=ye:ee.appendChild(ye),As(ye);else{if(!$e&&!Z&&!Ke&&Ne.indexOf("<")===-1)return L&&Pe?P(Ne):Ne;if(ee=wl(Ne),!ee)return $e?null:Pe?H:""}ee&&Oe&&yn(ee.firstChild);const $t=Fe?Ne:ee,mt=Us($t);try{for(;Te=mt.nextNode();)Yl(Te,$t),kl(Te),Tt(Te.content)&&us(Te.content)}catch(it){throw Fe&&(nt(Ne),Dc(s.removed,Cn=>{Cn.element&&Wn(Cn.element)})),it}if(Fe)return Dc(s.removed,it=>{it.element&&Wn(it.element)}),Z&&Hs(Ne),Ne;if($e){if(Z&&Hs(ee),Ie)for(ze=W.call(ee.ownerDocument);ee.firstChild;)ze.appendChild(ee.firstChild);else ze=ee;return(oe.shadowroot||oe.shadowrootmode)&&(ze=ve.call(c,ze,!0)),ze}let In=Ke?ee.outerHTML:ee.innerHTML;return Ke&&de["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&ss(Pj,ee.ownerDocument.doctype.name)&&(In="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
116
+ `+In),Z&&(In=es(In)),L&&Pe?P(In):In},s.setConfig=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cs(Ne),ut=!0,Ee=de,Ce=oe},s.clearConfig=function(){_n=null,ut=!1,Ee=null,Ce=null,L=D,H=""},s.isValidAttribute=function(Ne,C,ee){_n||Cs({});const ye=lt(Ne),Te=lt(C);return ba(ye,Te,ee)},s.addHook=function(Ne,C){typeof C=="function"&&ls(E,Ne)&&Oc(E[Ne],C)},s.removeHook=function(Ne,C){if(ls(E,Ne)){if(C!==void 0){const ee=Dj(E[Ne],C);return ee===-1?void 0:Oj(E[Ne],ee,1)[0]}return _b(E[Ne])}},s.removeHooks=function(Ne){ls(E,Ne)&&(E[Ne]=[])},s.removeAllHooks=function(){E=Mb()},s}var sw=ay();const lw=1024;let aw=0;class jl{constructor(s,i){this.from=s,this.to=i}}class mn{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=$l.match(s)),i=>{let c=s(i);return c===void 0?null:[this,c]}}}mn.closedBy=new mn({deserialize:n=>n.split(" ")});mn.openedBy=new mn({deserialize:n=>n.split(" ")});mn.group=new mn({deserialize:n=>n.split(" ")});mn.isolate=new mn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});mn.contextHash=new mn({perNode:!0});mn.lookAhead=new mn({perNode:!0});mn.mounted=new mn({perNode:!0});class Gc{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[mn.mounted.id]}}const iw=Object.create(null);class $l{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 $l(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(mn.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(mn.group),u=-1;u<(o?o.length:0);u++){let h=i[u<0?c.name:o[u]];if(h)return h}}}}$l.none=new $l("",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 x=h[1],p=h[0];p.combine&&p.id in o&&(x=p.combine(o[p.id],x)),o[p.id]=x}}i.push(o?new $l(c.name,o,c.id,c.flags):c)}return new iy(i)}}const zd=new WeakMap,Rb=new WeakMap;var hn;(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"})(hn||(hn={}));class Ws{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,x]of u)this.props[typeof h=="number"?h:h.id]=x}}toString(){let s=Gc.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 uf(this.topNode,s)}cursorAt(s,i=0,c=0){let o=zd.get(this)||this.topNode,u=new uf(o);return u.moveTo(s,i),zd.set(this,u._tree),u}get topNode(){return new Ss(this,0,0,null)}resolve(s,i=0){let c=pu(zd.get(this)||this.topNode,s,i,!1);return zd.set(this,c),c}resolveInner(s,i=0){let c=pu(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,x=(h&hn.IncludeAnonymous)>0;for(let p=this.cursor(h|hn.IncludeAnonymous);;){let g=!1;if(p.from<=u&&p.to>=o&&(!x&&p.type.isAnonymous||i(p)!==!1)){if(p.firstChild())continue;g=!0}for(;g&&c&&(x||!p.type.isAnonymous)&&c(p),!p.nextSibling();){if(!p.parent())return;g=!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($l.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new Ws(this.type,i,c,o,this.propValues),s.makeTree||((i,c,o)=>new Ws($l.none,i,c,o)))}static build(s){return uw(s)}}Ws.empty=new Ws($l.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 Zi{constructor(s,i,c){this.buffer=s,this.length=i,this.set=c}get type(){return $l.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,x=-1;for(let p=s;p!=i&&!(ry(u,o,h[p+1],h[p+2])&&(x=p,c>0));p=h[p+3]);return x}slice(s,i,c){let o=this.buffer,u=new Uint16Array(i-s),h=0;for(let x=s,p=0;x<i;){u[p++]=o[x++],u[p++]=o[x++]-c;let g=u[p++]=o[x++]-c;u[p++]=o[x++]-s,h=Math.max(h,g)}return new Zi(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 pu(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:hn.IgnoreOverlays;if(c)for(let h=n,x=h.parent;x;h=x,x=h.parent)h instanceof Ss&&h.index<0&&((o=x.enter(s,i,u))===null||o===void 0?void 0:o.from)!=h.from&&(n=x);for(;;){let h=n.enter(s,i,u);if(!h)return n;n=h}}class cy{cursor(s=0){return new uf(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 pu(this,s,i,!1)}resolveInner(s,i=0){return pu(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:x,positions:p}=h._tree,g=i>0?x.length:-1;s!=g;s+=i){let _=x[s],v=p[s]+h.from,y;if(!(!(u&hn.EnterBracketed&&_ instanceof Ws&&(y=Gc.get(_))&&!y.overlay&&y.bracketed&&c>=v&&c<=v+_.length)&&!ry(o,c,v,v+_.length))){if(_ instanceof Zi){if(u&hn.ExcludeBuffers)continue;let N=_.findChild(0,_.buffer.length,i,c-v,o);if(N>-1)return new ga(new rw(h,_,s,v),null,N)}else if(u&hn.IncludeAnonymous||!_.type.isAnonymous||nm(_)){let N;if(!(u&hn.IgnoreMounts)&&(N=Gc.get(_))&&!N.overlay)return new Ss(N.tree,v,s,h);let k=new Ss(_,v,s,h);return u&hn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(i<0?_.children.length-1:0,i,c,o,u)}}}if(u&hn.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&hn.IgnoreOverlays)&&(o=Gc.get(this._tree))&&o.overlay){let u=s-this.from,h=c&hn.EnterBracketed&&o.bracketed;for(let{from:x,to:p}of o.overlay)if((i>0||h?x<=u:x<u)&&(i<0||h?p>=u:p>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 ga 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 ga(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&hn.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 ga(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 ga(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 ga(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 Ws(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=Gc.get(u.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let x=new Ss(h.tree,h.overlay[0].from+u.from,-1,u);(o||(o=[c])).push(pu(x,s,i,!1))}}return o?oy(o):c}class uf{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&~hn.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&hn.ExcludeBuffers?!1:this.enterChild(1,s,i):this.yield(this._tree.enter(s,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&hn.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 x=c._tree.children[u];if(this.mode&hn.IncludeAnonymous||x instanceof Zi||!x.type.isAnonymous||nm(x))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 ga(this.buffer,i,this.stack[o]);return this.bufferNode=new ga(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 Zi||!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,x=Array.isArray(i)?new tm(i,i.length):i,p=c.types,g=0,_=0;function v(R,L,H,D,O,I){let{id:M,start:P,end:re,size:_e}=x,we=_,q=g;if(_e<0)if(x.next(),_e==-1){let E=u[M];H.push(E),D.push(P-R);return}else if(_e==-3){g=M;return}else if(_e==-4){_=M;return}else throw new RangeError(`Unrecognized record size: ${_e}`);let $=p[M],W,Q,ve=P-R;if(re-P<=o&&(Q=A(x.pos-L,O))){let E=new Uint16Array(Q.size-Q.skip),K=x.pos-Q.size,xe=E.length;for(;x.pos>K;)xe=G(Q.start,E,xe);W=new Zi(E,re-Q.start,c),ve=Q.start-R}else{let E=x.pos-_e;x.next();let K=[],xe=[],ke=M>=h?M:-1,Re=0,me=re;for(;x.pos>E;)ke>=0&&x.id==ke&&x.size>=0?(x.end<=me-o&&(k(K,xe,P,Re,x.end,me,ke,we,q),Re=K.length,me=x.end),x.next()):I>2500?y(P,E,K,xe):v(P,E,K,xe,ke,I+1);if(ke>=0&&Re>0&&Re<K.length&&k(K,xe,P,Re,P,me,ke,we,q),K.reverse(),xe.reverse(),ke>-1&&Re>0){let He=N($,q);W=sm($,K,xe,0,K.length,0,re-P,He,He)}else W=T($,K,xe,re-P,we-re,q)}H.push(W),D.push(ve)}function y(R,L,H,D){let O=[],I=0,M=-1;for(;x.pos>L;){let{id:P,start:re,end:_e,size:we}=x;if(we>4)x.next();else{if(M>-1&&re<M)break;M<0&&(M=_e-o),O.push(P,re,_e),I++,x.next()}}if(I){let P=new Uint16Array(I*4),re=O[O.length-2];for(let _e=O.length-3,we=0;_e>=0;_e-=3)P[we++]=O[_e],P[we++]=O[_e+1]-re,P[we++]=O[_e+2]-re,P[we++]=we;H.push(new Zi(P,O[2]-re,c)),D.push(re-R)}}function N(R,L){return(H,D,O)=>{let I=0,M=H.length-1,P,re;if(M>=0&&(P=H[M])instanceof Ws){if(!M&&P.type==R&&P.length==O)return P;(re=P.prop(mn.lookAhead))&&(I=D[M]+P.length+re)}return T(R,H,D,O,I,L)}}function k(R,L,H,D,O,I,M,P,re){let _e=[],we=[];for(;R.length>D;)_e.push(R.pop()),we.push(L.pop()+H-O);R.push(T(c.types[M],_e,we,I-O,P-I,re)),L.push(O-H)}function T(R,L,H,D,O,I,M){if(I){let P=[mn.contextHash,I];M=M?[P].concat(M):[P]}if(O>25){let P=[mn.lookAhead,O];M=M?[P].concat(M):[P]}return new Ws(R,L,H,D,M)}function A(R,L){let H=x.fork(),D=0,O=0,I=0,M=H.end-o,P={size:0,start:0,skip:0};e:for(let re=H.pos-R;H.pos>re;){let _e=H.size;if(H.id==L&&_e>=0){P.size=D,P.start=O,P.skip=I,I+=4,D+=4,H.next();continue}let we=H.pos-_e;if(_e<0||we<re||H.start<M)break;let q=H.id>=h?4:0,$=H.start;for(H.next();H.pos>we;){if(H.size<0)if(H.size==-3||H.size==-4)q+=4;else break e;else H.id>=h&&(q+=4);H.next()}O=$,D+=_e,I+=q}return(L<0||D==R)&&(P.size=D,P.start=O,P.skip=I),P.size>4?P:void 0}function G(R,L,H){let{id:D,start:O,end:I,size:M}=x;if(x.next(),M>=0&&D<h){let P=H;if(M>4){let re=x.pos-(M-4);for(;x.pos>re;)H=G(R,L,H)}L[--H]=P,L[--H]=I-R,L[--H]=O-R,L[--H]=D}else M==-3?g=D:M==-4&&(_=D);return H}let Y=[],X=[];for(;x.pos>0;)v(n.start||0,n.bufferStart||0,Y,X,-1,0);let B=(s=n.length)!==null&&s!==void 0?s:Y.length?X[0]+Y[0].length:0;return new Ws(p[n.topID],Y.reverse(),X.reverse(),B)}const Ob=new WeakMap;function sf(n,s){if(!n.isAnonymous||s instanceof Zi||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 Ws)){i=1;break}i+=sf(n,c)}Ob.set(s,i)}return i}function sm(n,s,i,c,o,u,h,x,p){let g=0;for(let k=c;k<o;k++)g+=sf(n,s[k]);let _=Math.ceil(g*1.5/8),v=[],y=[];function N(k,T,A,G,Y){for(let X=A;X<G;){let B=X,R=T[X],L=sf(n,k[X]);for(X++;X<G;X++){let H=sf(n,k[X]);if(L+H>=_)break;L+=H}if(X==B+1){if(L>_){let H=k[B];N(H.children,H.positions,0,H.children.length,T[B]+Y);continue}v.push(k[B])}else{let H=T[X-1]+k[X-1].length-R;v.push(sm(n,k,T,B,X,R,H,null,p))}y.push(R+Y-u)}}return N(s,i,c,o,0),(x||p)(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 ga?this.setBuffer(s.context.buffer,s.index,i):s instanceof Ss&&this.map.set(s.tree,i)}get(s){return s instanceof ga?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 mu{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 mu(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 x=0,p=0,g=0;;x++){let _=x<i.length?i[x]:null,v=_?_.fromA:1e9;if(v-p>=c)for(;h&&h.from<v;){let y=h;if(p>=y.from||v<=y.to||g){let N=Math.max(y.from,p)-g,k=Math.min(y.to,v)-g;y=N>=k?null:new mu(N,k,y.tree,y.offset+g,x>0,!!_)}if(y&&o.push(y),h.to>v)break;h=u<s.length?s[u++]:null}if(!_)break;p=_.toA,g=_.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 jl(o.from,o.to)):[new jl(0,0)]:[new jl(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,x,p){this.parser=s,this.predicate=i,this.mounts=c,this.index=o,this.start=u,this.bracketed=h,this.target=x,this.prev=p,this.depth=0,this.ranges=[]}}const Op=new mn({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 Ws(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[mn.mounted.id]=new Gc(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 uf(new Ss(this.baseTree,this.ranges[0].from,0,null),hn.IncludeAnonymous|hn.IgnoreMounts);e:for(let u,h;;){let x=!0,p;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)x=!1;else if(s.hasNode(o)){if(i){let g=i.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(g)for(let _ of g.mount.overlay){let v=_.from+g.pos,y=_.to+g.pos;v>=o.from&&y<=o.to&&!i.ranges.some(N=>N.from<y&&N.to>v)&&i.ranges.push({from:v,to:y})}}x=!1}else if(c&&(h=pw(c.ranges,o.from,o.to)))x=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 g=s.findMounts(o.from,u.parser);if(typeof u.overlay=="function")i=new fw(u.parser,u.overlay,g,this.inner.length,o.from,!!u.bracketed,o.tree,i);else{let _=Hb(this.ranges,u.overlay||(o.from<o.to?[new jl(o.from,o.to)]:[]));_.length&&zb(_),(_.length||!u.overlay)&&this.inner.push(new Lb(u.parser,_.length?u.parser.startParse(this.input,Bb(g,_),_):u.parser.startParse(""),u.overlay?u.overlay.map(v=>new jl(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}):x=!1}}else if(i&&(p=i.predicate(o))&&(p===!0&&(p=new jl(o.from,o.to)),p.from<p.to)){let g=i.ranges.length-1;g>=0&&i.ranges[g].to==p.from?i.ranges[g]={from:i.ranges[g].from,to:p.to}:i.ranges.push(p)}if(x&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let g=Hb(this.ranges,i.ranges);g.length&&(zb(g),this.inner.splice(i.index,0,new Lb(i.parser,i.parser.startParse(this.input,Bb(i.mounts,g),g),i.ranges.map(_=>new jl(_.from-i.start,_.to-i.start)),i.bracketed,i.target,g[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],x=h.buffer,p=[u];function g(_,v,y,N,k,T){let A=i[T],G=[],Y=[];Ib(h,_,A,G,Y,N);let X=x[A+1],B=x[A+2];p.push(G.length);let R=T?g(A+4,x[A+3],h.set.types[x[A]],X,B-X,T-1):s.toTree();return G.push(R),Y.push(X-N),Ib(h,x[A+3],v,G,Y,N),new Ws(y,G,Y,k)}o.children[u]=g(0,x.length,$l.none,0,h.length,i.length-1);for(let _ of p){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(hn.IncludeAnonymous|hn.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,hn.IgnoreOverlays|hn.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 Ws)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(mn.mounted);if(h&&h.parser==i)for(let x=this.fragI;x<this.fragments.length;x++){let p=this.fragments[x];if(p.from>=u.to)break;p.tree==this.curFrag.tree&&o.push({frag:p,pos:u.from-p.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,x=n[o].from;for(;u<c.length;u++){let p=c[u];if(p.from>=x)break;p.to<=h||(i||(c=i=s.slice()),p.from<h?(i[u]=new jl(p.from,h),p.to>x&&i.splice(u+1,0,new jl(x,p.to))):p.to>x?i[u--]=new jl(x,p.to):i.splice(u--,1))}}return c}function xw(n,s,i,c){let o=0,u=0,h=!1,x=!1,p=-1e9,g=[];for(;;){let _=o==n.length?1e9:h?n[o].to:n[o].from,v=u==s.length?1e9:x?s[u].to:s[u].from;if(h!=x){let y=Math.max(p,i),N=Math.min(_,v,c);y<N&&g.push(new jl(y,N))}if(p=Math.min(_,v),p==1e9)break;_==p&&(h?(h=!1,o++):h=!0),v==p&&(x?(x=!1,u++):x=!0)}return g}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),x=h+o.tree.length,p=Math.max(u.from,h),g=Math.min(u.to,x);if(o.overlay){let _=o.overlay.map(y=>new jl(y.from+c,y.to+c)),v=xw(s,_,p,g);for(let y=0,N=p;;y++){let k=y==v.length,T=k?g:v[y].from;if(T>N&&i.push(new mu(N,T,o.tree,-h,u.from>=N||u.openStart,u.to<=T||u.openEnd)),k)break;N=v[y].to}}else i.push(new mu(p,g,o.tree,-h,u.from>=h||u.openStart,u.to<=x||u.openEnd))}return i}let bw=0;class vl{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 vl&&(i=s),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new vl(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 df(s);return c=>c.modified.indexOf(i)>-1?c:df.get(c.base||c,c.modified.concat(i).sort((o,u)=>o.id-u.id))}}let _w=0;class df{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(x=>x.base==s&&yw(i,x.modified));if(c)return c;let o=[],u=new vl(s.name,o,s,i);for(let x of i)x.instances.push(u);let h=vw(i);for(let x of s.set)if(!x.modified.length)for(let p of h)o.push(df.get(x,p));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,x=o;for(let v=0;;){if(x=="..."&&v>0&&v+3==o.length){h=1;break}let y=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(x);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 N=o[v++];if(v==o.length&&N=="!"){h=0;break}if(N!="/")throw new RangeError("Invalid path: "+o);x=o.slice(v)}let p=u.length-1,g=u[p];if(!g)throw new RangeError("Invalid path: "+o);let _=new gu(c,h,p>0?u.slice(0,p):null);s[g]=_.sort(s[g])}}return uy.add(s)}const uy=new mn({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 gu(o.tags,o.mode,o.context);i?i.next=u:c=u,i=u}return c}});class gu{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}}gu.empty=new gu([],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 x of u)for(let p of x.set){let g=i[p.id];if(g){h=h?h+" "+g:g;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 x=u;function p(g,_){if(!(g<=x)){for(let v=n.slice(x,g),y=0;;){let N=v.indexOf(`
117
+ `,y),k=N<0?v.length:N;if(k>y&&c(v.slice(y,k),_),N<0)break;o(),y=N+1}x=g}}ww(s,i,(g,_,v)=>{p(g,""),p(_,v)},u,h),p(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:x,to:p}=s;if(x>=c||p<=i)return;h.isTop&&(u=this.highlighters.filter(N=>!N.scope||N.scope(h)));let g=o,_=Sw(s)||gu.empty,v=jw(u,_.tags);if(v&&(g&&(g+=" "),g+=v,_.mode==1&&(o+=(o?" ":"")+v)),this.startSpan(Math.max(i,x),g),_.opaque)return;let y=s.tree&&s.tree.prop(mn.mounted);if(y&&y.overlay){let N=s.node.enter(y.overlay[0].from+x,1),k=this.highlighters.filter(A=>!A.scope||A.scope(y.tree.type)),T=s.firstChild();for(let A=0,G=x;;A++){let Y=A<y.overlay.length?y.overlay[A]:null,X=Y?Y.from+x:p,B=Math.max(i,G),R=Math.min(c,X);if(B<R&&T)for(;s.from<R&&(this.highlightRange(s,B,R,o,u),this.startSpan(Math.min(R,s.to),g),!(s.to>=X||!s.nextSibling())););if(!Y||X>c)break;G=Y.to+x,G>i&&(this.highlightRange(N.cursor(),Math.max(i,Y.from+x),Math.min(c,G),"",k),this.startSpan(Math.min(c,G),g))}T&&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),g)}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 Ae=vl.define,Id=Ae(),Gi=Ae(),qb=Ae(Gi),Gb=Ae(Gi),$i=Ae(),Ud=Ae($i),fp=Ae($i),fa=Ae(),kr=Ae(fa),ra=Ae(),ca=Ae(),Lp=Ae(),eu=Ae(Lp),Hd=Ae(),Le={comment:Id,lineComment:Ae(Id),blockComment:Ae(Id),docComment:Ae(Id),name:Gi,variableName:Ae(Gi),typeName:qb,tagName:Ae(qb),propertyName:Gb,attributeName:Ae(Gb),className:Ae(Gi),labelName:Ae(Gi),namespace:Ae(Gi),macroName:Ae(Gi),literal:$i,string:Ud,docString:Ae(Ud),character:Ae(Ud),attributeValue:Ae(Ud),number:fp,integer:Ae(fp),float:Ae(fp),bool:Ae($i),regexp:Ae($i),escape:Ae($i),color:Ae($i),url:Ae($i),keyword:ra,self:Ae(ra),null:Ae(ra),atom:Ae(ra),unit:Ae(ra),modifier:Ae(ra),operatorKeyword:Ae(ra),controlKeyword:Ae(ra),definitionKeyword:Ae(ra),moduleKeyword:Ae(ra),operator:ca,derefOperator:Ae(ca),arithmeticOperator:Ae(ca),logicOperator:Ae(ca),bitwiseOperator:Ae(ca),compareOperator:Ae(ca),updateOperator:Ae(ca),definitionOperator:Ae(ca),typeOperator:Ae(ca),controlOperator:Ae(ca),punctuation:Lp,separator:Ae(Lp),bracket:eu,angleBracket:Ae(eu),squareBracket:Ae(eu),paren:Ae(eu),brace:Ae(eu),content:fa,heading:kr,heading1:Ae(kr),heading2:Ae(kr),heading3:Ae(kr),heading4:Ae(kr),heading5:Ae(kr),heading6:Ae(kr),contentSeparator:Ae(fa),list:Ae(fa),quote:Ae(fa),emphasis:Ae(fa),strong:Ae(fa),link:Ae(fa),monospace:Ae(fa),strikethrough:Ae(fa),inserted:Ae(),deleted:Ae(),changed:Ae(),invalid:Ae(),meta:Hd,documentMeta:Ae(Hd),annotation:Ae(Hd),processingInstruction:Ae(Hd),definition:vl.defineModifier("definition"),constant:vl.defineModifier("constant"),function:vl.defineModifier("function"),standard:vl.defineModifier("standard"),local:vl.defineModifier("local"),special:vl.defineModifier("special")};for(let n in Le){let s=Le[n];s instanceof vl&&(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={},ct=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 x=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.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 T=x.length-1;T>=0;T--){const A=x[T];if(A.href===_&&(!v||A.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=_,g&&k.setAttribute("nonce",g),document.head.appendChild(k),v)return new Promise((T,A)=>{k.addEventListener("load",T),k.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${_}`)))})}))}function u(h){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=h,window.dispatchEvent(x),!x.defaultPrevented)throw h}return o.then(h=>{for(const x of h||[])x.status==="rejected"&&u(x.reason);return s().catch(u)})},fy={js:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await ct(async()=>{const{javascript:n}=await import("./index-D6yXt8v4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await ct(async()=>{const{json:n}=await import("./index-CaiMt4h0.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await ct(async()=>{const{json:n}=await import("./index-CaiMt4h0.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await ct(async()=>{const{css:n}=await import("./index-B2LO0l57.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await ct(async()=>{const{css:n}=await import("./index-B2LO0l57.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await ct(async()=>{const{css:n}=await import("./index-B2LO0l57.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await ct(async()=>{const{html:n}=await import("./index-BPJrlUj_.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await ct(async()=>{const{html:n}=await import("./index-BPJrlUj_.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await ct(async()=>{const{html:n}=await import("./index-BPJrlUj_.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await ct(async()=>{const{html:n}=await import("./index-BPJrlUj_.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await ct(async()=>{const{markdown:n}=await import("./index-CZ1qVXcb.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await ct(async()=>{const{markdown:n}=await import("./index-CZ1qVXcb.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await ct(async()=>{const{python:n}=await import("./index-BrHQ2TSw.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await ct(async()=>{const{python:n}=await import("./index-BrHQ2TSw.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await ct(async()=>{const{yaml:n}=await import("./index-LJAvSv-o.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await ct(async()=>{const{yaml:n}=await import("./index-LJAvSv-o.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await ct(async()=>{const{rust:n}=await import("./index-BVZbJUdX.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await ct(async()=>{const{cpp:n}=await import("./index-BaGoVOX2.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await ct(async()=>{const{cpp:n}=await import("./index-BaGoVOX2.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await ct(async()=>{const{cpp:n}=await import("./index-BaGoVOX2.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await ct(async()=>{const{cpp:n}=await import("./index-BaGoVOX2.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await ct(async()=>{const{cpp:n}=await import("./index-BaGoVOX2.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await ct(async()=>{const{java:n}=await import("./index-C5zvd-WO.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await ct(async()=>{const{go:n}=await import("./index-At4SIHW8.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await ct(async()=>{const{php:n}=await import("./index-BysIpqtT.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await ct(async()=>{const{sql:n}=await import("./index-Ca8CvnGG.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await ct(async()=>{const{xml:n}=await import("./index-BUQkCY8p.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await ct(async()=>{const{xml:n}=await import("./index-BUQkCY8p.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 Bd(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 Bd(n);try{const c=i.language.parser.parse(n);let o="";return kw(n,c,Dw,(u,h)=>{o+=h?`<span class="${h}">${Bd(u)}</span>`:Bd(u)},()=>{o+=`
118
+ `}),o}catch{return Bd(n)}}Vt.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 wf(n){const s=await Vt.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 ti(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function Lw(n){return n.split("/").pop()??n}function Or(n){const s=n.lastIndexOf("/");return s===-1?"":n.slice(0,s)}function lf(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}var xu=T_();function Vi({x:n,y:s,items:i,note:c,onClose:o}){const u=b.useRef(null),[h,x]=b.useState({left:n,top:s}),[p,g]=b.useState(()=>{const y=i.findIndex(N=>!N.disabled);return y===-1?0:y});b.useLayoutEffect(()=>{const y=u.current;if(!y)return;const N=y.getBoundingClientRect(),k=8,T=Math.max(k,Math.min(n,window.innerWidth-N.width-k)),A=Math.max(k,Math.min(s,window.innerHeight-N.height-k));x({left:T,top:A})},[n,s]),b.useLayoutEffect(()=>{var y;(y=u.current)==null||y.focus()},[]),b.useLayoutEffect(()=>{function y(k){var T;(T=u.current)!=null&&T.contains(k.target)||o()}function N(){o()}return document.addEventListener("mousedown",y),document.addEventListener("scroll",N,!0),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("scroll",N,!0)}},[o]);function _(y){y.disabled||(y.onSelect(),o())}function v(y){if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),o();return}const N=i.map((k,T)=>({item:k,index:T})).filter(k=>!k.item.disabled);if(N.length!==0){if(y.key==="ArrowDown"||y.key==="ArrowUp"){y.preventDefault();const k=y.key==="ArrowDown"?1:-1,T=N.findIndex(G=>G.index===p),A=N[(((T===-1?0:T)+k)%N.length+N.length)%N.length];A&&g(A.index);return}if(y.key==="Enter"||y.key===" "){y.preventDefault();const k=i[p];k&&_(k)}}}return xu.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,N)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":y.disabled,className:"ctxmenu__item"+(N===p?" is-cursor":""),onMouseEnter:()=>g(N),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 Ir({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 x=n.ok?zw:Iw,p=setTimeout(()=>u(!0),x),g=setTimeout(()=>c(null),x+Vb);return()=>{clearTimeout(p),clearTimeout(g)}},[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:x=>x.stopPropagation(),children:[i.url.replace(/^https?:\/\//,"")," ↗"]}),i.url&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ma({value:n,className:s,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[u,h]=b.useState(n),x=b.useRef(null);b.useEffect(()=>{var g;(g=x.current)==null||g.select()},[]);function p(){const g=u.trim();if(!g||g===n)return o();c(g)}return a.jsx("input",{ref:x,className:s?`rename ${s}`:"rename",value:u,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:g=>h(g.target.value),onBlur:p,onKeyDown:g=>{g.stopPropagation(),g.key==="Enter"?(g.preventDefault(),p()):g.key==="Escape"&&(g.preventDefault(),o())}})}function to({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,Nr="application/x-ccv-fs-path",Hw=200;function Bw({open:n,tree:s,expanded:i,activePath:c,dirty:o,gitChanges:u,result:h,searchResult:x,onSearch:p,onReveal:g,onToggle:_,onOpen:v,onCreate:y,onRename:N,onMove:k,onCopy:T,onDelete:A,onRefresh:G,onClose:Y,zoomed:X,onToggleZoom:B}){const[R,L]=b.useState(""),[H,D]=b.useState(null),[O,I]=b.useState(null),[M,P]=b.useState(null),[re,_e]=b.useState(null),[we,q]=b.useState(null),[$,W]=b.useState(null),Q=yf("(hover: hover)"),ve=b.useRef(null),E=b.useMemo(()=>$w(u),[u]);function K(ie){return!(!M||ie===M.path||M.kind==="dir"&&ie.startsWith(`${M.path}/`)||ie===Or(M.path))}function xe(ie){return!(!we||ie===we.path||we.kind==="dir"&&ie.startsWith(`${we.path}/`)||we.mode==="cut"&&ie===Or(we.path))}function ke(ie){q({path:ie.path,kind:ie.kind,mode:"copy"})}function Re(ie){q({path:ie.path,kind:ie.kind,mode:"cut"})}function me(ie){!we||!xe(ie)||(ie&&!i.has(ie)&&_(ie),we.mode==="cut"?(k(we.path,ie),q(null)):T(we.path,ie))}function He(ie,je){const Xe=ie.touches[0];if(!Xe)return;const at={timer:0,x:Xe.clientX,y:Xe.clientY,el:ie.currentTarget,fired:!1};at.timer=window.setTimeout(()=>{at.fired=!0,je(at.x,at.y,at.el)},Uw),ve.current=at}function tt(ie){const je=ve.current,Xe=ie.touches[0];!je||!Xe||Math.hypot(Xe.clientX-je.x,Xe.clientY-je.y)>10&&(window.clearTimeout(je.timer),ve.current=null)}function ot(ie){const je=ve.current;je&&(window.clearTimeout(je.timer),je.fired&&ie.preventDefault())}function sn(){var ie;return(ie=ve.current)!=null&&ie.fired?(ve.current=null,!0):!1}function de(ie,je,Xe,at){L((at==null?void 0:at.path)??""),W({x:ie,y:je,opener:Xe,entry:at})}function st(){const ie=$==null?void 0:$.opener;W(null),ie!=null&&ie.isConnected&&ie.focus()}function oe(ie){return{onContextMenu:je=>{je.preventDefault(),de(je.clientX,je.clientY,je.currentTarget,ie)},onTouchStart:je=>He(je,(Xe,at,Je)=>de(Xe,at,Je,ie)),onTouchMove:tt,onTouchEnd:ot,onTouchCancel:ot}}function Rt(ie){ie.target===ie.currentTarget&&(ie.preventDefault(),de(ie.clientX,ie.clientY,ie.currentTarget,null))}function qe(ie){ie.target===ie.currentTarget&&He(ie,(je,Xe,at)=>de(je,Xe,at,null))}function Bt(ie){if(!(ie.ctrlKey||ie.metaKey)||ie.target instanceof HTMLInputElement)return;const je=ie.key.toLowerCase();if(je==="v"){ie.preventDefault(),me(Pe());return}if(!R)return;const Xe=Xb(s,R);Xe&&(je==="c"?(ie.preventDefault(),ke(Xe)):je==="x"&&(ie.preventDefault(),Re(Xe)))}function On(ie){return je=>{je.dataTransfer.effectAllowed="move",je.dataTransfer.setData(Nr,ie.path),P({path:ie.path,kind:ie.kind})}}function xt(){P(null),_e(null)}function Zt(ie){return je=>{je.dataTransfer.types.includes(Nr)&&(je.stopPropagation(),!(ie.kind!=="dir"||!K(ie.path))&&(je.preventDefault(),_e(ie.path)))}}function on(ie){return je=>{if(!je.dataTransfer.types.includes(Nr)||(je.stopPropagation(),ie.kind!=="dir"||!K(ie.path)))return;je.preventDefault();const Xe=je.dataTransfer.getData(Nr);_e(null),Xe&&k(Xe,ie.path)}}function Yn(ie){!ie.dataTransfer.types.includes(Nr)||!K("")||(ie.preventDefault(),_e(""))}function jt(ie){if(!ie.dataTransfer.types.includes(Nr)||!K(""))return;ie.preventDefault();const je=ie.dataTransfer.getData(Nr);_e(null),je&&k(je,"")}const[Z,De]=b.useState(""),Ke=Z.trim(),ut=Ke.length>0,Ee=b.useRef(null),Ce=b.useRef(p);Ce.current=p;function Oe(ie){De(ie),Ee.current&&clearTimeout(Ee.current);const je=ie.trim();if(!je){Ce.current("");return}Ee.current=setTimeout(()=>Ce.current(je),Hw)}function $e(ie){Ee.current&&clearTimeout(Ee.current),De(""),Ce.current(""),L(ie.path),g(ie)}const Ie=ut&&(x==null?void 0:x.query)===Ke?x:null;function Pe(){if(R==="")return"";const ie=Xb(s,R);if((ie==null?void 0:ie.kind)==="dir")return R;const je=R.lastIndexOf("/");return je===-1?"":R.slice(0,je)}function pt(ie,je){const Xe=je??Pe();Xe&&!i.has(Xe)&&_(Xe),I({parent:Xe,kind:ie})}function wt(){if(!$)return[];const ie=at=>Q?at:void 0;if(!$.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ie("Ctrl+V"),disabled:!xe(""),onSelect:()=>me("")},{id:"new-file",label:"Создать файл",onSelect:()=>pt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>pt("dir","")}];const je=$.entry,Xe=[je.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>v(je.path)}:{id:"toggle",label:i.has(je.path)?"Свернуть":"Развернуть",onSelect:()=>_(je.path)},{id:"copy",label:"Копировать",hint:ie("Ctrl+C"),onSelect:()=>ke(je)},{id:"cut",label:"Вырезать",hint:ie("Ctrl+X"),onSelect:()=>Re(je)}];return je.kind==="dir"&&(Xe.push({id:"paste",label:"Вставить",hint:ie("Ctrl+V"),disabled:!xe(je.path),onSelect:()=>me(je.path)}),Xe.push({id:"new-file",label:"Создать файл",onSelect:()=>pt("file",je.path)}),Xe.push({id:"new-dir",label:"Создать каталог",onSelect:()=>pt("dir",je.path)})),Xe.push({id:"rename",label:"Переименовать",onSelect:()=>D(je.path)}),Xe.push({id:"delete",label:"Удалить",onSelect:()=>A(je)}),Xe}const Lt=ut?[]:Xt("",0);function Xt(ie,je){const Xe=s[ie],at=[];if(O&&O.parent===ie&&at.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:ni(je),children:[a.jsx("span",{className:"fsrow__icon",children:O.kind==="dir"?a.jsx(hf,{}):a.jsx(pf,{})}),a.jsx(ma,{className:"rename--file",value:"",placeholder:O.kind==="dir"?"имя каталога":"имя файла",onCommit:Je=>{I(null),y(ie,O.kind,Je)},onCancel:()=>I(null)})]},`draft:${ie}`)),!Xe)return at.push(a.jsx("p",{className:"fsrow__pending",style:ni(je),children:"читаем…"},`wait:${ie}`)),at;Xe.length===0&&!O&&at.push(a.jsx("p",{className:"fsrow__pending",style:ni(je),children:"пусто"},`empty:${ie}`));for(const Je of Xe){const ln=Je.kind==="dir"&&i.has(Je.path);at.push(H===Je.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:ni(je),children:[a.jsx("span",{className:"fsrow__icon",children:Je.kind==="dir"?a.jsx(hf,{open:ln}):a.jsx(pf,{})}),a.jsx(ma,{className:"rename--file",value:Je.name,placeholder:"новое имя",onCommit:Vn=>{D(null),N(Je.path,Vn)},onCancel:()=>D(null)})]},Je.path):a.jsx(qw,{entry:Je,depth:je,open:ln,active:Je.path===c,selected:Je.path===R,dirty:o.has(Je.path),gitStatus:E.get(Je.path),dragging:(M==null?void 0:M.path)===Je.path,dropTarget:re===Je.path,cut:(we==null?void 0:we.mode)==="cut"&&we.path===Je.path,onClick:()=>{sn()||(L(Je.path),Je.kind==="dir"?_(Je.path):v(Je.path))},onRename:()=>D(Je.path),onDelete:()=>A(Je),onDragStart:On(Je),onDragEnd:xt,onDragOver:Zt(Je),onDrop:on(Je),...oe(Je)},Je.path)),ln&&at.push(...Xt(Je.path,je+1))}return at}function _s(){if(!Ie)return[a.jsx("p",{className:"fsrow__pending",style:ni(0),children:"ищем…"},"search:wait")];if(Ie.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:ni(0),children:"ничего не найдено"},"search:empty")];const ie=Ie.entries.map(je=>a.jsx(Gw,{entry:je,gitStatus:E.get(je.path),onClick:()=>$e(je)},je.path));return Ie.truncated&&ie.push(a.jsxs("p",{className:"fsrow__pending",style:ni(0),children:["показаны первые ",Ie.entries.length," — уточните запрос"]},"search:truncated")),ie}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(X?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:Bt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:ie=>{B&&(ie.target.closest("button")||B())},children:[a.jsx(Qw,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>pt("file"),children:a.jsx(Vw,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>pt("dir"),children:a.jsx(Xw,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:G,children:"↻"}),B&&a.jsx("button",{className:"sidepane__btn",title:X?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":X?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":X,onClick:B,children:a.jsx(to,{active:X})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:Y,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:ie=>Oe(ie.target.value),onKeyDown:ie=>{ie.stopPropagation(),ie.key==="Escape"&&(ie.preventDefault(),Z?Oe(""):ie.currentTarget.blur())}}),Z&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Oe(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(re===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Yn,onDrop:jt,onContextMenu:Rt,onTouchStart:qe,onTouchMove:tt,onTouchEnd:ot,onTouchCancel:ot,children:ut?_s():Lt}),a.jsx(Ir,{result:h}),$&&a.jsx(Vi,{x:$.x,y:$.y,items:wt(),onClose:st})]})}function qw({entry:n,depth:s,open:i,active:c,selected:o,dirty:u,gitStatus:h,dragging:x,dropTarget:p,cut:g,onClick:_,onRename:v,onDelete:y,onDragStart:N,onDragEnd:k,onDragOver:T,onDrop:A,onContextMenu:G,onTouchStart:Y,onTouchMove:X,onTouchEnd:B,onTouchCancel:R}){const L="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(x?" fsrow--dragging":"")+(p?" fsrow--drop-target":"")+(g?" fsrow--cut":"");return a.jsxs("div",{className:L,style:ni(s),draggable:!0,onDragStart:N,onDragEnd:k,onDragOver:T,onDrop:A,onContextMenu:G,onTouchStart:Y,onTouchMove:X,onTouchEnd:B,onTouchCancel:R,children:[a.jsxs("button",{className:"fsrow__main",onClick:_,title:py(n),children:[a.jsx("span",{className:"fsrow__icon"+ff("fsrow__icon",h),children:n.kind==="dir"?a.jsx(hf,{open:i}):a.jsx(pf,{})}),a.jsx("span",{className:"fsrow__name"+ff("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:ni(0),onClick:i,title:py(n),children:[a.jsx("span",{className:"fsrow__icon"+ff("fsrow__icon",s),children:n.kind==="dir"?a.jsx(hf,{}):a.jsx(pf,{})}),a.jsx("span",{className:"fsrow__name"+ff("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 ni(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=Or(o.path);for(;c(h,u),!!h;)h=Or(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 ff(n,s){return s?` ${n}--git-${s}`:""}function hf({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 pf(){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[x,p]=b.useState(""),g=x.trim(),_=g.length>0,v=b.useRef(null),y=b.useRef(i);y.current=i;function N(A){p(A),v.current&&clearTimeout(v.current);const G=A.trim();if(!G){y.current("");return}v.current=setTimeout(()=>y.current(G),Zw)}const k=_&&(s==null?void 0:s.query)===g?s:null;function T(){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 A=[];let G="";for(const Y of k.matches)Y.path!==G&&(G=Y.path,A.push(a.jsx("p",{className:"searchgroup__path",title:Y.path,children:Y.path},`path:${Y.path}`))),A.push(a.jsx(Pw,{match:Y,onClick:()=>c(Y)},`${Y.path}:${Y.line}:${Y.column}`));return k.truncated&&A.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),A}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:A=>{h&&(A.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(to,{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:x,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>N(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),x?N(""):A.currentTarget.blur())}}),x&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>N(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:_?T():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 qd=null;function e1(){return qd||(qd=Promise.all([ct(()=>import("./index-CyKzgfHd.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),ct(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),ct(()=>import("./index-BHot-lnj.js"),[],import.meta.url),ct(()=>import("./index-CfeCkS4B.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),ct(()=>import("./codemirror-BdWXIyBE.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 qd=null,n})),qd}function t1({path:n,doc:s,revision:i,goto:c,onChange:o,onSave:u}){const h=b.useRef(null),x=b.useRef(null),p=b.useRef(null),g=b.useRef(new Map),_=b.useRef(new Map),v=b.useRef(new Set),y=b.useRef(null),N=b.useRef(o),k=b.useRef(u),T=b.useRef(n),A=b.useRef(i),G=b.useRef(s);N.current=o,k.current=u,T.current=n,A.current=i,G.current=s;const[Y,X]=b.useState("loading"),[B,R]=b.useState(!1);function L(D,O,I,M,P){const re=g.current.get(M),_e=_.current.get(M)===P;if(re&&_e)I.setState(re);else{const q=D.EditorState.create({doc:G.current,extensions:[D.basicSetup,D.Prec.highest(D.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(T.current),!0)}])),D.keymap.of([D.indentWithTab]),O.of([]),D.editorTheme,D.editorHighlight,D.EditorView.updateListener.of($=>{$.docChanged&&N.current(T.current,$.state.doc.toString())})]});g.current.set(M,q),_.current.set(M,P),I.setState(q),v.current.delete(M)}if(v.current.has(M))return()=>{};let we=!1;return Rw(M).then(q=>{we||!q||T.current!==M||(I.dispatch({effects:O.reconfigure(q)}),g.current.set(M,I.state),v.current.add(M))}),()=>{we=!0}}b.useEffect(()=>{if(!h.current)return;let O=!1,I=null,M=null;X("loading"),R(!1);const P=window.setTimeout(()=>{O||R(!0)},200);return(async()=>{let re;try{re=await e1()}catch{window.clearTimeout(P),O||X("error");return}if(O||!h.current)return;window.clearTimeout(P);const _e=new re.Compartment;y.current=_e,p.current=re,M=new re.EditorView({parent:h.current}),x.current=M,I=L(re,_e,M,T.current,A.current),X("ready")})(),()=>{O=!0,window.clearTimeout(P),I==null||I(),M==null||M.destroy(),x.current===M&&(x.current=null),p.current=null,y.current=null}},[]),b.useEffect(()=>{const D=p.current,O=x.current,I=y.current;if(!(!D||!O||!I))return L(D,I,O,n,i)},[n,i]);const H=b.useRef(0);return b.useEffect(()=>{const D=x.current,O=p.current;if(!D||!O||!c||c.token===H.current)return;H.current=c.token;const I=D.state.doc.lines,M=Math.min(Math.max(c.line,1),I),P=D.state.doc.line(M),re=Math.min(P.from+Math.max(c.column-1,0),P.to);D.dispatch({selection:O.EditorSelection.cursor(re),effects:O.EditorView.scrollIntoView(re,{y:"center"})}),D.focus()},[c]),b.useEffect(()=>()=>{const D=x.current;D&&g.current.set(n,D.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(Y==="ready"?"":" is-hidden")}),Y==="loading"&&B&&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:"Загружается редактор…"})]}),Y==="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 Gl({value:n,options:s,onChange:i,className:c,title:o,ariaLabel:u,placeholder:h="—"}){const[x,p]=b.useState(!1),[g,_]=b.useState(0),v=b.useRef(null),y=b.useRef(null),N=s.find(A=>A.value===n)??null;b.useEffect(()=>{if(!x)return;const A=s.findIndex(G=>G.value===n);_(A===-1?0:A)},[x]),b.useEffect(()=>{if(!x)return;function A(G){var Y;(Y=v.current)!=null&&Y.contains(G.target)||p(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[x]),b.useEffect(()=>{var A,G;x&&((G=(A=y.current)==null?void 0:A.querySelector(".is-cursor"))==null||G.scrollIntoView({block:"nearest"}))},[x,g]),b.useEffect(()=>{if(!x)return;const A=y.current,G=n1(v.current);if(!A||!G)return;const Y=A.getBoundingClientRect().bottom-G.getBoundingClientRect().bottom;Y>0&&(G.scrollTop+=Math.min(Y+8,A.offsetHeight))},[x]);function k(A){p(!1),A.value!==n&&i(A.value)}function T(A){if(A.key==="Escape"){if(!x)return;A.preventDefault(),A.stopPropagation(),p(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!x)return p(!0);const G=A.key==="ArrowDown"?1:s.length-1;return _(Y=>(Y+G)%s.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!x)return p(!0);const G=s[g];G&&k(G)}}return a.jsxs("div",{ref:v,className:"select"+(x?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":u??o,"aria-haspopup":"listbox","aria-expanded":x,onClick:()=>p(A=>!A),onKeyDown:T,children:[a.jsx("span",{className:"select__value",children:(N==null?void 0:N.label)??h}),a.jsx(s1,{})]}),x&&a.jsx("div",{ref:y,className:"select__menu",role:"listbox","aria-label":u??o,children:s.map((A,G)=>a.jsxs("button",{type:"button",role:"option","aria-selected":A.value===n,className:"select__option"+(G===g?" is-cursor":"")+(A.value===n?" is-on":""),onMouseEnter:()=>_(G),onClick:()=>k(A),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:A.label}),A.hint&&a.jsx("span",{className:"select__hint",children:A.hint})]},A.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 x=c1(i,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",lf(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:"Повторить"})]}):x?s.startsWith("image/")?a.jsx(u1,{url:x}):s.startsWith("video/")?a.jsx(f1,{url:x}):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 x=0;x<o.length;x++)u[x]=o.charCodeAt(x);const h=URL.createObjectURL(new Blob([u],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[n,s]),i}const qi=1,my=8,Gd=1.25;function o1(n){return Math.min(my,Math.max(qi,n))}function u1({url:n}){const[s,i]=b.useState({scale:qi,x:0,y:0}),[c,o]=b.useState(!1),u=b.useRef(null),h=b.useRef(null);function x(N,k,T){i(A=>{const G=o1(A.scale*N);if(G===A.scale)return A;if(G<=qi)return{scale:qi,x:0,y:0};const Y=(k-A.x)/A.scale,X=(T-A.y)/A.scale;return{scale:G,x:k-G*Y,y:T-G*X}})}b.useEffect(()=>{const N=u.current;if(!N)return;function k(T){T.preventDefault();const A=N.getBoundingClientRect(),G=T.clientX-A.left-A.width/2,Y=T.clientY-A.top-A.height/2;x(T.deltaY<0?Gd:1/Gd,G,Y)}return N.addEventListener("wheel",k,{passive:!1}),()=>N.removeEventListener("wheel",k)},[]);function p(N){s.scale<=qi||(N.currentTarget.setPointerCapture(N.pointerId),h.current={pointerId:N.pointerId,startX:N.clientX,startY:N.clientY,origX:s.x,origY:s.y},o(!0))}function g(N){const k=h.current;!k||k.pointerId!==N.pointerId||i(T=>({...T,x:k.origX+(N.clientX-k.startX),y:k.origY+(N.clientY-k.startY)}))}function _(){h.current=null,o(!1)}const v=s.scale>qi,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:p,onPointerMove:g,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<=qi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>x(1/Gd,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:()=>x(Gd,0,0),children:a.jsx(l1,{})}),a.jsx("button",{className:"btn btn--sm",disabled:y,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>i({scale:qi,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(Gl,{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:x}){const p=ti(n),g=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:[lf(n.size),n.eol==="crlf"&&" · CRLF"]}),g&&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&&x(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&x(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!p,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:p?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",p?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),p&&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:["Это не текстовый файл — редактировать его здесь нечем. ",lf(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",lf(n.size),"). Такие правит агент, а не браузер."]}):g&&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 wf(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:x=>{h&&(x.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(x=>a.jsxs("div",{className:"worktab"+(x.path===s?" is-on":""),role:"tab","aria-selected":x.path===s,onDoubleClick:p=>{h&&(p.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:x.path,onClick:()=>c(x.path),children:Lw(x.path)}),ti(x)?a.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${x.path}`,onClick:()=>o(x.path)}):a.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${x.path}`,onClick:()=>o(x.path),children:"✕"})]},x.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(to,{active:u})})]})}function yl(n){return n.claudeSessionId??n.id}function $d(n,s,i,c){if(!s||s.length===0)return n;const o=new Map(s.map((x,p)=>[x,p])),u=[],h=[];for(const x of n)(o.has(i(x))?u:h).push(x);return u.sort((x,p)=>o.get(i(x))-o.get(i(p))),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 Yd(n,s,i,c){if(s===i||!n.includes(s)||!n.includes(i))return null;const o=n.filter(x=>x!==s),u=o.indexOf(i)+(c==="after"?1:0),h=[...o.slice(0,u),s,...o.slice(u)];return h.every((x,p)=>x===n[p])?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,x]=b.useState(()=>new Set);b.useEffect(()=>{const g=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(g)},[]),b.useEffect(()=>{x(g=>{const _=new Set(n.map(y=>y.id)),v=new Set([...g].filter(y=>_.has(y)));return v.size===g.size?g:v})},[n]);const p=g=>{x(_=>new Set(_).add(g)),s(g),window.setTimeout(()=>{x(_=>{if(!_.has(g))return _;const v=new Set(_);return v.delete(g),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(g=>!g),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(g=>{const _=h.has(g.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(g)}),g.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:b1(o-g.startedAt)})]}),a.jsx("div",{className:"task__desc",title:g.description,children:g.description}),(g.activity||g.lastTool)&&a.jsx("div",{className:"task__activity",title:g.activity??g.lastTool??void 0,children:g.activity??g.lastTool}),a.jsxs("div",{className:"task__stats",children:[_1(g.tokens)," · ",g.toolUses," ",lm(g.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${g.description}`,onClick:()=>p(g.id),children:_?"Останавливается":"Стоп"})]},g.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 mf({disabled:n,providers:s,onStart:i}){const c=[...new Set(s)].flatMap(O=>k1.filter(I=>I.id===O)),o=c.length>1,[u,h]=b.useState(!1),[x,p]=b.useState(0),[g,_]=b.useState({left:0,top:0}),v=b.useRef(null),y=b.useRef(null),N=b.useRef(null);function k(){N.current&&window.clearTimeout(N.current.timer),N.current=null}function T(O=!1){O||k(),p(0),h(!0)}function A(O){var I;h(!1),O&&((I=v.current)==null||I.focus())}function G(O){if(n||!o||O.button!==0)return;const I={timer:0,x:O.clientX,y:O.clientY,fired:!1};I.timer=window.setTimeout(()=>{I.fired=!0,T(!0)},j1),N.current=I}function Y(O){const I=N.current;!I||I.fired||Math.hypot(O.clientX-I.x,O.clientY-I.y)>w1&&k()}function X(){N.current&&!N.current.fired&&k()}function B(O){var M;if((M=N.current)!=null&&M.fired){N.current=null,O.preventDefault();return}if(n)return;const I=c[0];I&&i(I.id)}function R(O){o&&(O.preventDefault(),!n&&T())}function L(O){if(n||!o)return;(O.key==="ArrowDown"||O.key==="ArrowUp"||O.key==="Enter"&&O.shiftKey)&&(O.preventDefault(),T())}b.useLayoutEffect(()=>{if(!u)return;const O=v.current,I=y.current;if(!O||!I)return;const M=O.getBoundingClientRect(),P=I.getBoundingClientRect(),re=8,_e=Math.max(re,Math.min(M.right-P.width,window.innerWidth-P.width-re));let we=M.top-P.height-8;we<re&&(we=Math.min(M.bottom+8,window.innerHeight-P.height-re)),_({left:_e,top:we})},[u]),b.useLayoutEffect(()=>{var O;u&&((O=y.current)==null||O.focus())},[u]),b.useLayoutEffect(()=>{if(!u)return;function O(I){var P,re;const M=I.target;!((P=y.current)!=null&&P.contains(M))&&!((re=v.current)!=null&&re.contains(M))&&A(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[u]);function H(O){A(!1),i(O.id)}function D(O){if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),A(!0);return}if(O.key==="ArrowDown"||O.key==="ArrowUp"){O.preventDefault();const I=O.key==="ArrowDown"?1:-1;p(M=>(M+I+c.length)%c.length);return}if(O.key==="Enter"||O.key===" "){O.preventDefault();const I=c[x];I&&H(I);return}O.key==="Tab"&&A(!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:B,onContextMenu:R,onPointerDown:G,onPointerMove:Y,onPointerUp:X,onPointerCancel:X,onPointerLeave:X,onKeyDown:L,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?A(!0):T(),children:a.jsx(N1,{})}),u&&o&&xu.createPortal(a.jsx("div",{ref:y,className:"newsession__menu",style:{left:g.left,top:g.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:D,children:c.map((O,I)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(I===x?" is-cursor":""),onMouseEnter:()=>p(I),onClick:()=>H(O),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(S1,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:O.label}),a.jsx("span",{className:"newsession__hint",children:O.hint})]})]},O.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:x,sessions:p,archived:g,pinned:_,live:v,listOrder:y,liveSessionsFirst:N,onReorder:k,activeWorkspaceId:T,activeSessionId:A,onSelectWorkspace:G,onSelectSession:Y,onRenameSession:X,onStopSession:B,onPinSessions:R,onSelectPinned:L,onCloseWorkspaces:H,onRestoreWorkspaces:D,onArchiveSessions:O,onUnarchiveSessions:I,onCreateFolder:M,onRenameFolder:P,onSetFolderColor:re,onDeleteFolder:_e,onAssignToFolder:we,onOpenWorkspace:q,onNewSession:$,enabledProviders:W,onOpenExtensions:Q,account:ve,onOpenAccount:E,relay:K,onOpenRelay:xe,onOpenSettings:ke,themeMode:Re,onCycleTheme:me,navigation:He,dashboard:tt=!1,onAllProjects:ot,onCompareSession:sn}){var Xl;const[de,st]=b.useState(null),[oe,Rt]=b.useState(null),[qe,Bt]=b.useState(null);function On(S){return(qe==null?void 0:qe.folderId)===S.id?qe.color??void 0:S.color}function xt(S){const pe=S&&On(S);return pe?{"--folder-color":pe}:void 0}function Zt(S){return S?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const on=b.useRef(void 0),[Yn,jt]=b.useState(null),[Z,De]=b.useState(""),[Ke,ut]=b.useState($1),[Ee,Ce]=b.useState(Y1),[Oe,$e]=b.useState(V1);function Ie(S){$e(S),De("");try{localStorage.setItem(by,S)}catch{}}const Pe=Z.trim().toLowerCase(),pt=Pe!=="",wt=b.useMemo(()=>$d(c,y==null?void 0:y.workspaces,S=>S.id,"bottom"),[c,y]),Lt=b.useMemo(()=>{const S=$d(p,T?y==null?void 0:y.sessions[T]:void 0,yl,"top");return N?Kb(S):S},[p,y,T,N]),Xt=b.useMemo(()=>{const S=$d(_,y==null?void 0:y.pinned,yl,"bottom");return N?Kb(S):S},[_,y,N]),_s=b.useMemo(()=>$d(v,y==null?void 0:y.live,yl,"bottom"),[v,y]),ie=b.useMemo(()=>pt?wt.filter(S=>S.name.toLowerCase().includes(Pe)||S.path.toLowerCase().includes(Pe)):wt,[wt,Pe,pt]),je=b.useMemo(()=>pt?o.filter(S=>S.name.toLowerCase().includes(Pe)||S.path.toLowerCase().includes(Pe)):o,[o,Pe,pt]),Xe=b.useMemo(()=>pt?Lt.filter(S=>(S.title??"").toLowerCase().includes(Pe)):Lt,[Lt,Pe,pt]),at=b.useMemo(()=>pt?g.filter(S=>(S.title??"").toLowerCase().includes(Pe)):g,[g,Pe,pt]),Je=S=>{var pe;return((pe=c.find(Ue=>Ue.id===S))==null?void 0:pe.name)??"—"},ln=S=>{var pe;return(pe=c.find(Ue=>Ue.id===S))==null?void 0:pe.path},Vn=b.useMemo(()=>pt?Xt.filter(S=>(S.title??"").toLowerCase().includes(Pe)||Je(S.workspaceId).toLowerCase().includes(Pe)):Xt,[Xt,c,Pe,pt]),gn=b.useMemo(()=>pt?_s.filter(S=>(S.title??"").toLowerCase().includes(Pe)||Je(S.workspaceId).toLowerCase().includes(Pe)):_s,[_s,c,Pe,pt]),un=!pt;function Ft(S){ut(pe=>{const Ue=pe.includes(S)?pe.filter(bt=>bt!==S):[...pe,S];try{localStorage.setItem(xy,JSON.stringify(Ue))}catch{}return Ue})}const zt=S=>!Ke.includes(S);function J(S){Ce(pe=>{const Ue=pe.includes(S)?pe.filter(bt=>bt!==S):[...pe,S];try{localStorage.setItem(_y,JSON.stringify(Ue))}catch{}return Ue})}const fe=S=>!Ee.includes(S),Me=b.useMemo(()=>tu(ie,u),[ie,u]),Ze=b.useMemo(()=>tu(je,u),[je,u]),It=b.useMemo(()=>tu(Xe,h),[Xe,h]),an=b.useMemo(()=>tu(at,h),[at,h]),Et=b.useMemo(()=>tu(Vn,x,S=>S.pinnedFolderId),[Vn,x]),ys=b.useMemo(()=>({groups:[],ungrouped:gn}),[gn]),Xn=((y==null?void 0:y.workspaces.length)??0)>0,is=T?(((Xl=y==null?void 0:y.sessions[T])==null?void 0:Xl.length)??0)>0:!1,dn=((y==null?void 0:y.pinned.length)??0)>0,lt=((y==null?void 0:y.live.length)??0)>0,_n=Vd({enabled:un,scope:"workspaces",itemKey:S=>S.id,groups:Me.groups,ungrouped:Me.ungrouped,onReorder:k}),Es=Vd({enabled:un,scope:"sessions",workspaceId:T??void 0,itemKey:yl,groups:It.groups,ungrouped:It.ungrouped,onReorder:k}),Ts=Vd({enabled:un,scope:"pinned",itemKey:yl,groups:Et.groups,ungrouped:Et.ungrouped,onReorder:k}),Cs=Vd({enabled:un,scope:"live",itemKey:yl,groups:ys.groups,ungrouped:ys.ungrouped,onReorder:k});b.useEffect(()=>{var Ue;if(!qe)return;const pe=(Ue=[...Et.groups,...Me.groups,...Ze.groups,...It.groups,...an.groups].find(bt=>bt.folder.id===qe.folderId))==null?void 0:Ue.folder;pe&&pe.color===(qe.color??void 0)&&Bt(null)},[qe,Et,Me,Ze,It,an]),b.useEffect(()=>()=>window.clearTimeout(on.current),[]);const rs=mp(ie),cs=mp(je),os=mp(Xe),[qt,Is]=b.useState(null),[Pt,yn]=b.useState(null),[nt,Jn]=b.useState(null),[Qn,Wn]=b.useState(null),[Tn,wl]=b.useState(null),Us=b.useRef(null);function es(S,pe){const Ue=S.touches[0];if(!Ue)return;const bt={timer:0,x:Ue.clientX,y:Ue.clientY,el:S.currentTarget,fired:!1};bt.timer=window.setTimeout(()=>{bt.fired=!0,pe(bt.x,bt.y,bt.el)},E1),Us.current=bt}function Hs(S){const pe=Us.current,Ue=S.touches[0];!pe||!Ue||Math.hypot(Ue.clientX-pe.x,Ue.clientY-pe.y)>10&&(window.clearTimeout(pe.timer),Us.current=null)}function wn(S){const pe=Us.current;pe&&(window.clearTimeout(pe.timer),pe.fired&&S.preventDefault())}function Tt(){var S;return(S=Us.current)!=null&&S.fired?(Us.current=null,!0):!1}function Ln(){const S=qt==null?void 0:qt.opener;Is(null),S!=null&&S.isConnected&&S.focus()}function Gt(){const S=Pt==null?void 0:Pt.opener;yn(null),S!=null&&S.isConnected&&S.focus()}function ii(){const S=nt==null?void 0:nt.opener;Jn(null),S!=null&&S.isConnected&&S.focus()}function xa(){const S=Qn==null?void 0:Qn.opener;Wn(null),S!=null&&S.isConnected&&S.focus()}function Yl(){const S=Tn==null?void 0:Tn.opener;wl(null),S!=null&&S.isConnected&&S.focus()}function ba(S){return{onContextMenu:pe=>{pe.preventDefault(),Is({x:pe.clientX,y:pe.clientY,opener:pe.currentTarget,ids:rs.targetsFor(S)})},onTouchStart:pe=>es(pe,(Ue,bt,Kn)=>Is({x:Ue,y:bt,opener:Kn,ids:rs.targetsFor(S)})),onTouchMove:Hs,onTouchEnd:wn,onTouchCancel:wn}}function zn(S){return{onContextMenu:pe=>{pe.preventDefault(),yn({x:pe.clientX,y:pe.clientY,opener:pe.currentTarget,ids:cs.targetsFor(S)})},onTouchStart:pe=>es(pe,(Ue,bt,Kn)=>yn({x:Ue,y:bt,opener:Kn,ids:cs.targetsFor(S)})),onTouchMove:Hs,onTouchEnd:wn,onTouchCancel:wn}}function ri(S){return{onContextMenu:pe=>{pe.preventDefault(),Jn({x:pe.clientX,y:pe.clientY,opener:pe.currentTarget,ids:os.targetsFor(S)})},onTouchStart:pe=>es(pe,(Ue,bt,Kn)=>Jn({x:Ue,y:bt,opener:Kn,ids:os.targetsFor(S)})),onTouchMove:Hs,onTouchEnd:wn,onTouchCancel:wn}}function vn(S){return{onContextMenu:pe=>{pe.preventDefault(),Wn({x:pe.clientX,y:pe.clientY,opener:pe.currentTarget,ids:[S.id]})},onTouchStart:pe=>es(pe,(Ue,bt,Kn)=>Wn({x:Ue,y:bt,opener:Kn,ids:[S.id]})),onTouchMove:Hs,onTouchEnd:wn,onTouchCancel:wn}}function Vl(S){return{onContextMenu:pe=>{pe.preventDefault(),wl({x:pe.clientX,y:pe.clientY,opener:pe.currentTarget,ids:[S.id]})},onTouchStart:pe=>es(pe,(Ue,bt,Kn)=>wl({x:Ue,y:bt,opener:Kn,ids:[S.id]})),onTouchMove:Hs,onTouchEnd:wn,onTouchCancel:wn}}const kl=p.filter(S=>S.state!=="closed").length,us=qt?ie.find(S=>S.id===qt.ids[0]):void 0,As=qt?[{id:"close",label:qt.ids.length>1?`Закрыть проекты (${qt.ids.length})`:"Закрыть проект",onSelect:()=>{H(qt.ids),rs.clear()}},...nu({folders:u,ids:qt.ids,hasFolder:(us==null?void 0:us.folderId)!=null,assign:(S,pe)=>we("workspace",S,pe),onClear:()=>rs.clear(),onNewFolder:()=>jt("workspace")}),...qt.ids.length===1&&un?_n.menuItems(qt.ids[0],Xn):[]]:[],Ne=qt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(T&&qt.ids.includes(T)&&kl>0?` в нём сейчас незавершённых сессий: ${kl} — при закрытии они остановятся на хосте.`:""):void 0,C=Pt?je.find(S=>S.id===Pt.ids[0]):void 0,ee=Pt?[{id:"restore",label:Pt.ids.length>1?`Вернуть проекты (${Pt.ids.length})`:"Вернуть проект",onSelect:()=>{D(Pt.ids),cs.clear()}},...nu({folders:u,ids:Pt.ids,hasFolder:(C==null?void 0:C.folderId)!=null,assign:(S,pe)=>we("workspace",S,pe),onClear:()=>cs.clear(),onNewFolder:()=>jt("workspace")})]:[],ye=Pt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Te=nt?Xe.find(S=>S.id===nt.ids[0]):void 0,ze=(Te==null?void 0:Te.pinned)!==!0,Fe=nt?[...nt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>st(nt.ids[0])}]:[],{id:"pin",label:ze?nt.ids.length>1?`Закрепить (${nt.ids.length})`:"Закрепить":nt.ids.length>1?`Открепить (${nt.ids.length})`:"Открепить",onSelect:()=>{Te&&R(Te.workspaceId,nt.ids,ze),os.clear()}},{id:"archive",label:nt.ids.length>1?`Убрать в архив (${nt.ids.length})`:"Убрать в архив",onSelect:()=>{O(T,nt.ids),os.clear()}},...nu({folders:h,ids:nt.ids,hasFolder:(Te==null?void 0:Te.folderId)!=null,assign:(S,pe)=>we("session",S,pe,T),onClear:()=>os.clear(),onNewFolder:()=>jt("session")}),...nt.ids.length===1&&un&&Te?Es.menuItems(yl(Te),is):[]]:[],$t=nt?hp:void 0,mt=Qn?Vn.find(S=>S.id===Qn.ids[0]):void 0,In=Qn?[{id:"rename",label:"Переименовать",onSelect:()=>st(Qn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{mt&&R(mt.workspaceId,[mt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{mt&&O(mt.workspaceId,[mt.id])}},...mt&&mt.workspaceId===T?nu({folders:h,ids:[mt.id],hasFolder:mt.folderId!=null,assign:(S,pe)=>we("session",S,pe,mt.workspaceId),onClear:()=>{},onNewFolder:()=>jt("session")}):[],...R1(mt?nu({folders:x,ids:[mt.id],hasFolder:mt.pinnedFolderId!=null,assign:(S,pe)=>we("pinned",S,pe),onClear:()=>{},onNewFolder:()=>jt("pinned")}):[]),...un&&mt?Ts.menuItems(yl(mt),dn):[]]:[],it=Tn?gn.find(S=>S.id===Tn.ids[0]):void 0,Cn=Tn?[{id:"stop",label:"Остановить",onSelect:()=>{it&&B(it)}},{id:"rename",label:"Переименовать",onSelect:()=>st(Tn.ids[0])},{id:"pin",label:(it==null?void 0:it.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{it&&R(it.workspaceId,[it.id],it.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{it&&O(it.workspaceId,[it.id])}},...un&&it?Cs.menuItems(yl(it),lt):[]]:[];function St(S,pe){return a.jsxs("div",{"data-row-key":S.id,className:Lc(S.id===T,rs.selected.includes(S.id),!1,!!pe)+_n.dropClass(S.id),style:xt(pe),...ba(S),children:[Zt(pe),un&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",..._n.gripHandlers(S.id),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:Ue=>{Tt()||rs.click(Ue,S,()=>G(S.id))},onKeyDown:Ue=>_n.onKeyDown(S.id,Ue),children:[a.jsxs("span",{className:"row__title",children:[S.name,S.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:S.path,children:S.path})]})]},S.id)}function Bs(S,pe){return a.jsxs("div",{className:Lc(S.id===T,cs.selected.includes(S.id),!1,!!pe),style:xt(pe),...zn(S),children:[Zt(pe),a.jsxs("button",{className:"row__main",onClick:Ue=>{Tt()||cs.click(Ue,S,()=>G(S.id))},children:[a.jsxs("span",{className:"row__title",children:[S.name,S.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:W1(S)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>D([S.id]),children:"Вернуть"})]},S.id)}function qs(S,pe){const Ue=yl(S);return a.jsxs("div",{"data-row-key":Ue,className:Lc(S.id===A,os.selected.includes(S.id),S.provider==="antigravity",!!pe)+Es.dropClass(Ue),style:xt(pe),...de===S.id?{}:ri(S),children:[Zt(pe),de===S.id?a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:S.title??"",onCommit:bt=>{X(S,bt),st(null)},onCancel:()=>st(null)})}):a.jsxs(a.Fragment,{children:[un&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Es.gripHandlers(Ue),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:bt=>{Tt()||os.click(bt,S,()=>Y(S))},onKeyDown:bt=>Es.onKeyDown(Ue,bt),children:[a.jsx(Qd,{title:S.title??"Без названия",pinned:S.pinned===!0,provider:S.provider,projectName:Je(S.workspaceId),projectPath:ln(S.workspaceId)}),a.jsx(gp,{session:S,tail:new Date(S.updatedAt).toLocaleString()})]}),tt&&sn&&a.jsx("button",{className:"hub-icon-btn",title:"Открыть вторым разговором","aria-label":`Открыть рядом: ${S.title??"Без названия"}`,onClick:()=>sn(S),children:"◧"}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Tt()||st(S.id)},children:"✎"})]})]},S.id)}function _a(S,pe){return a.jsxs("div",{className:Lc(S.id===A,!1,S.provider==="antigravity",!!pe),style:xt(pe),children:[Zt(pe),a.jsxs("button",{className:"row__main",onClick:()=>Y(S),children:[a.jsx(Qd,{title:S.title??"Без названия",pinned:!1,provider:S.provider,projectName:Je(S.workspaceId),projectPath:ln(S.workspaceId)}),a.jsx("span",{className:"row__meta",children:J1(S)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>I([S.id]),children:"Вернуть"})]},S.id)}function ya(S,pe){const Ue=yl(S);return a.jsxs("div",{"data-row-key":Ue,className:Lc(S.id===A,!1,S.provider==="antigravity",!!pe)+Ts.dropClass(Ue),style:xt(pe),...de===S.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...vn(S)},children:[Zt(pe),de===S.id?a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:S.title??"",onCommit:bt=>{X(S,bt),st(null)},onCancel:()=>st(null)})}):a.jsxs(a.Fragment,{children:[un&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ts.gripHandlers(Ue),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{Tt()||L(S)},onKeyDown:bt=>Ts.onKeyDown(Ue,bt),children:[a.jsx(Qd,{title:S.title??"Без названия",pinned:!1,provider:S.provider,projectName:Je(S.workspaceId),projectPath:ln(S.workspaceId)}),a.jsx(gp,{session:S,tail:new Date(S.updatedAt).toLocaleString()})]})]})]},S.id)}function Hr(S){const pe=yl(S);return a.jsx("div",{"data-row-key":pe,className:Lc(S.id===A,!1,S.provider==="antigravity")+Cs.dropClass(pe),...de===S.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Vl(S)},children:de===S.id?a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:S.title??"",onCommit:Ue=>{X(S,Ue),st(null)},onCancel:()=>st(null)})}):a.jsxs(a.Fragment,{children:[un&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Cs.gripHandlers(pe),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{Tt()||L(S)},onKeyDown:Ue=>Cs.onKeyDown(pe,Ue),children:[a.jsx(Qd,{title:S.title??"Без названия",pinned:S.pinned===!0,provider:S.provider,projectName:Je(S.workspaceId),projectPath:ln(S.workspaceId)}),a.jsx(gp,{session:S,tail:new Date(S.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Ue=>{Ue.stopPropagation(),!Tt()&&B(S)},children:a.jsx(H1,{})})]})},S.id)}function el(S,pe){return a.jsx(I1,{folder:S,count:pe,open:fe(S.id),renaming:oe===S.id,onToggle:()=>J(S.id),onStartRename:()=>Rt(S.id),onCommitRename:Ue=>{P(S.id,Ue),Rt(null)},onCancelRename:()=>Rt(null),onDelete:()=>_e(S.id),color:On(S),onPreviewColor:Ue=>{window.clearTimeout(on.current),Bt({folderId:S.id,color:Ue})},onCommitColor:Ue=>{Bt({folderId:S.id,color:Ue}),re(S.id,Ue),window.clearTimeout(on.current),on.current=window.setTimeout(()=>Bt(null),4e3)},onResetColor:()=>{window.clearTimeout(on.current),Bt(null),re(S.id,null)}},S.id)}const tl=tt?"section":"aside",Ms=c.find(S=>S.id===T)??o.find(S=>S.id===T);return a.jsxs(tl,{className:tt?"sidebar project-dashboard":n?"sidebar sidebar--open":"sidebar","aria-label":tt?"Обзор проекта":"Навигация",children:[tt?a.jsxs("header",{className:"project-dashboard__head",children:[a.jsx("button",{className:"project-dashboard__back",onClick:ot,children:"← Все проекты"}),a.jsxs("div",{className:"project-dashboard__title",children:[a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),a.jsx("h1",{children:Ms==null?void 0:Ms.name})]}),a.jsx(mf,{disabled:!s||!T,providers:W,onStart:$})]}),a.jsx("p",{className:"project-dashboard__path",title:Ms==null?void 0:Ms.path,children:Ms==null?void 0:Ms.path}),a.jsx("p",{className:"hub-description",children:"Разговоры и история проекта. Выберите сессию, чтобы продолжить работу."}),a.jsxs("div",{className:"project-dashboard__stats",children:[a.jsxs("span",{children:[a.jsx("strong",{children:p.length})," сессий"]}),a.jsxs("span",{children:[a.jsx("strong",{children:p.filter(S=>S.state!=="closed").length})," запущено"]}),a.jsxs("span",{children:[a.jsx("strong",{children:p.filter(S=>S.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[Re]}`,"aria-label":`Тема: ${Fb[Re]}. Переключить`,onClick:me,children:a.jsx(X1,{mode:Re})})]}),a.jsxs("div",{className:"sidebar__connection",role:"status",children:[a.jsx("span",{className:s?"dot dot--on":"dot"}),a.jsx("span",{children:s?"Пространство подключено":i})]}),He,a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Oe==="default",className:Oe==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ie("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Oe==="pinned",className:Oe==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ie("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Oe==="live",className:Oe==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ie("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:tt||Oe!=="default"?"Найти сессию…":"Найти проект…","aria-label":tt||Oe!=="default"?"Поиск по сессиям":"Поиск по проектам",onChange:S=>De(S.target.value),onKeyDown:S=>{S.stopPropagation(),S.key==="Escape"&&(S.preventDefault(),Z?De(""):S.currentTarget.blur())}}),Z&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>De(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:tt?a.jsx(a.Fragment,{children:T&&a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Сессии",count:Xe.length,open:zt("sessions"),onToggle:()=>Ft("sessions"),action:{label:"Новая папка сессий",onClick:()=>{jt("session"),zt("sessions")||Ft("sessions")}}}),zt("sessions")&&a.jsxs(a.Fragment,{children:[Yn==="session"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:"",placeholder:"Название папки",onCommit:S=>{M("session",S,T),jt(null)},onCancel:()=>jt(null)})})}),Xe.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока ни одной"})}),It.groups.map(S=>a.jsxs(b.Fragment,{children:[el(S.folder,S.items.length),fe(S.folder.id)&&S.items.map(pe=>qs(pe,S.folder))]},S.folder.id)),It.ungrouped.map(S=>qs(S))]}),g.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Архив",count:at.length,open:zt("archive"),onToggle:()=>Ft("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),zt("archive")&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),at.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока пусто"})}),an.groups.map(S=>a.jsxs(b.Fragment,{children:[el(S.folder,S.items.length),fe(S.folder.id)&&S.items.map(pe=>_a(pe,S.folder))]},S.folder.id)),an.ungrouped.map(S=>_a(S))]})]})]})}):Oe==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Закреплённые",count:Vn.length,open:zt("pinned"),onToggle:()=>Ft("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{jt("pinned"),zt("pinned")||Ft("pinned")}}}),zt("pinned")&&a.jsxs(a.Fragment,{children:[Yn==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:"",placeholder:"Название папки",onCommit:S=>{M("pinned",S),jt(null)},onCancel:()=>jt(null)})})}),Vn.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Et.groups.map(S=>a.jsxs(b.Fragment,{children:[el(S.folder,S.items.length),fe(S.folder.id)&&S.items.map(pe=>ya(pe,S.folder))]},S.folder.id)),Et.ungrouped.map(S=>ya(S))]})]}):Oe==="live"?a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Запущенные",count:gn.length,open:zt("live"),onToggle:()=>Ft("live")}),zt("live")&&a.jsxs(a.Fragment,{children:[gn.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Нет запущенных сессий"})}),gn.map(S=>Hr(S))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Проекты",count:ie.length,open:zt("workspaces"),onToggle:()=>Ft("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{jt("workspace"),zt("workspaces")||Ft("workspaces")}}}),zt("workspaces")&&a.jsxs(a.Fragment,{children:[Yn==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:"",placeholder:"Название папки",onCommit:S=>{M("workspace",S),jt(null)},onCancel:()=>jt(null)})})}),ie.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока ни одного"})}),Me.groups.map(S=>a.jsxs(b.Fragment,{children:[el(S.folder,S.items.length),fe(S.folder.id)&&S.items.map(pe=>St(pe,S.folder))]},S.folder.id)),Me.ungrouped.map(S=>St(S))]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(zc,{title:"Архив проектов",count:je.length,open:zt("workspacesArchive"),onToggle:()=>Ft("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),zt("workspacesArchive")&&a.jsxs(a.Fragment,{children:[je.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока пусто"})}),Ze.groups.map(S=>a.jsxs(b.Fragment,{children:[el(S.folder,S.items.length),fe(S.folder.id)&&S.items.map(pe=>Bs(pe,S.folder))]},S.folder.id)),Ze.ungrouped.map(S=>Bs(S))]})]})]})}),!tt&&a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:E,children:[a.jsx("span",{className:ve!=null&&ve.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:ve===null?"Аккаунт":ve.loggedIn?ve.email||"Вход выполнен":"Войти в аккаунт"}),(ve==null?void 0:ve.plan)&&a.jsx("span",{className:"chip",children:ve.plan})]}),xe&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:xe,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:!Q,title:"MCP-серверы и плагины",onClick:()=>Q==null?void 0:Q(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:ke,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:q,children:"+ Проект"}),a.jsx(mf,{disabled:!s||!T,providers:W,onStart:$})]})]}),qt&&a.jsx(Vi,{x:qt.x,y:qt.y,items:As,note:Ne,onClose:Ln}),Pt&&a.jsx(Vi,{x:Pt.x,y:Pt.y,items:ee,note:ye,onClose:Gt}),nt&&a.jsx(Vi,{x:nt.x,y:nt.y,items:Fe,note:$t,onClose:ii}),Qn&&a.jsx(Vi,{x:Qn.x,y:Qn.y,items:In,note:hp,onClose:xa}),Tn&&a.jsx(Vi,{x:Tn.x,y:Tn.y,items:Cn,note:hp,onClose:Yl})]})}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 tu(n,s,i=c=>c.folderId){const c=new Map(s.map(x=>[x.id,x])),o=new Map,u=[];for(const x of n){const p=i(x),g=p?c.get(p):void 0;if(!g){u.push(x);continue}const _=o.get(g.id);_?_.push(x):o.set(g.id,[x])}return{groups:[...o.entries()].map(([x,p])=>({folder:c.get(x),items:p})).sort((x,p)=>x.folder.name.localeCompare(p.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(x=>x.items),i].find(x=>x.some(p=>c(p)===n));if(!u)return null;const h=u.findIndex(x=>c(x)===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 Vd(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 x(){i(null),o(null)}function p(G,Y){n.enabled&&(Y.preventDefault(),Y.currentTarget.setPointerCapture(Y.pointerId),i(G),o(null))}function g(G,Y){var H;if(!s)return;const X=(H=document.elementFromPoint(G,Y))==null?void 0:H.closest("[data-row-key]"),B=X==null?void 0:X.dataset.rowKey;if(!B||B===s||h.get(B)!==h.get(s)){o(null);return}const R=X.getBoundingClientRect(),L=Y-R.top<R.height/2?"before":"after";o(D=>(D==null?void 0:D.key)===B&&D.position===L?D:{key:B,position:L})}function _(G){g(G.clientX,G.clientY)}function v(){if(s&&c){const G=Yd(u,s,c.key,c.position);G&&n.onReorder(n.scope,G,n.workspaceId)}x()}function y(G,Y){if(!n.enabled)return;const X=pp(G,n.groups,n.ungrouped,n.itemKey,Y);if(!X)return;const B=Yd(u,G,X.target,X.position);B&&n.onReorder(n.scope,B,n.workspaceId)}function N(G,Y){const X=pp(G,n.groups,n.ungrouped,n.itemKey,"up"),B=pp(G,n.groups,n.ungrouped,n.itemKey,"down"),R=[{id:"move-up",label:"Переместить выше",disabled:!X,onSelect:()=>{if(!X)return;const L=Yd(u,G,X.target,X.position);L&&n.onReorder(n.scope,L,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!B,onSelect:()=>{if(!B)return;const L=Yd(u,G,B.target,B.position);L&&n.onReorder(n.scope,L,n.workspaceId)}}];return Y&&R.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),R}function k(G){return s===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function T(G){return{onPointerDown:Y=>p(G,Y),onPointerMove:_,onPointerUp:v,onPointerCancel:x}}function A(G,Y){!Y.altKey||Y.key!=="ArrowUp"&&Y.key!=="ArrowDown"||(Y.preventDefault(),y(G,Y.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:k,gripHandlers:T,onKeyDown:A,menuItems:N}}function nu(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(x,p,g){if(x.ctrlKey||x.metaKey){i(_=>_.includes(p.id)?_.filter(v=>v!==p.id):[..._,p.id]),c.current=p.id;return}if(x.shiftKey&&c.current){const _=n.findIndex(y=>y.id===c.current),v=n.findIndex(y=>y.id===p.id);if(_!==-1&&v!==-1){const[y,N]=_<v?[_,v]:[v,_];i(n.slice(y,N+1).map(k=>k.id));return}}o(),c.current=p.id,g()}function h(x){return s.includes(x.id)?s:(i([x.id]),c.current=x.id,[x.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:x,onDelete:p,color:g,onPreviewColor:_,onCommitColor:v,onResetColor:y}){const N=b.useRef(null),k=b.useRef(v);return k.current=v,b.useEffect(()=>{const T=N.current;if(!T)return;const A=()=>k.current(T.value);return T.addEventListener("change",A),()=>T.removeEventListener("change",A)},[c]),c?a.jsx("div",{className:"row",style:Zb,children:a.jsx("div",{className:"row__main",children:a.jsx(ma,{value:n.name,placeholder:"Название папки",onCommit:h,onCancel:x})})}):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:g?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:g?{background:g}:void 0}),a.jsx("input",{ref:N,type:"color",value:g??U1(),"aria-label":`Цвет папки «${n.name}»`,onChange:T=>_(T.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:p,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 Xd(){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 Qd({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 Yt=n=>n.claudeSessionId??n.id;function vy(n,s,i,c){const o=new Set([...s,...i].flatMap(h=>[h.id,Yt(h)])),u=s.map(h=>{const x=n.find(p=>p.id===h.id||Yt(p)===Yt(h));return!x||x.lastSeq<=h.lastSeq&&x.updatedAt<=h.updatedAt?h:{...h,...x,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(Yt(h))&&u.push(h);return u}const cn=n=>{var s;return((s=n.title)==null?void 0:s.trim())||"Новый разговор"},du=n=>["running","reconnecting"].includes(n.state)||n.backgroundWork,Uc=n=>n.state!=="closed"&&n.state!=="error";function Ur(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),[x,p]=b.useState([]),[g,_]=b.useState({}),v=b.useRef(new Map),y=b.useRef(new Set),[N,k]=b.useState({});b.useEffect(()=>{try{localStorage.setItem("ether:conversations.open",JSON.stringify(u))}catch{}},[u]);const[T,A]=b.useState([]),G=b.useRef([]),[Y,X]=b.useState({}),[B,R]=b.useState({}),[L,H]=b.useState({}),[D,O]=b.useState({}),[I,M]=b.useState({}),[P,re]=b.useState({}),[_e,we]=b.useState({}),q=b.useRef(null),[$,W]=b.useState([]),[Q,ve]=b.useState(ek),[E,K]=b.useState({}),[xe,ke]=b.useState(null),Re=b.useRef(new Map),me=b.useRef(new Set);me.current=new Set(s.map(Z=>Z.id));const He=b.useRef(null),tt=b.useRef(Y);tt.current=Y;const ot=b.useRef(D);ot.current=D;const sn=b.useRef(L);sn.current=L;const de=s.map(Z=>Z.id).sort().join("|");b.useEffect(()=>{if(!n){Re.current.clear(),y.current.clear(),v.current.clear(),p([]);return}for(const Z of s)i({type:"session.list",workspaceId:Z.id});G.current.includes("session-links")&&i({type:"session.links.get"})},[n,de,i]);const st=b.useCallback(Z=>{var Ke,ut;const De=(Ee,Ce)=>{if(!Ee||Ee===Ce)return;_($e=>({...$e,[Ee]:Ce}));const Oe=ou(Ee);Oe&&!ou(Ce)&&af(Ce,Oe)};if(Z.type==="hello.ok"&&(G.current=Z.features??[],A(Z.features??[]),He.current&&He.current!==Z.hostId&&(H({}),O({}),K({}),Re.current.clear()),He.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),De(Ee.previousId,Z.session.id),p(Ce=>Ce.filter(Oe=>Oe!==(Ee.previousId??Z.requestId))),X(Ce=>({...Ce,[Z.session.id]:Z.session})),h(Ce=>[...new Set([...Ce.filter(Oe=>Oe!==Ee.previousId),Z.session.id])]),o(null)}if(Z.type==="session.list"){for(const Ee of Z.sessions)Ee.state!=="closed"&&!Ee.parentSessionId&&!Re.current.has(Ee.id)&&(Re.current.set(Ee.id,0),i({type:"session.sync",sessionId:Ee.id,sinceSeq:0}));R(Ee=>({...Ee,[Z.workspaceId]:!0})),X(Ee=>{const Ce=Object.fromEntries(Object.entries(Ee).filter(([,Oe])=>Oe.workspaceId!==Z.workspaceId));for(const Oe of[...vy(Object.values(Ee),Z.sessions,Z.archived,Z.workspaceId),...Z.archived])Oe.parentSessionId||(Ce[Oe.id]=Oe);return Ce})}if(Z.type==="session.pinned"&&X(Ee=>{const Ce=new Set(Z.sessions.map(Yt)),Oe=Object.fromEntries(Object.entries(Ee).map(([$e,Ie])=>[$e,{...Ie,pinned:Ce.has(Yt(Ie))}]));for(const $e of Z.sessions)Oe[$e.id]={...$e,...Oe[$e.id],pinned:!0,pinnedAt:$e.pinnedAt};return Oe}),Z.type==="session.summary"||Z.type==="session.live"){const Ee=Z.type==="session.live"?Z.sessions:[Z.session];if(!G.current.includes("session-routing")&&Z.type==="session.summary")for(const[Ce,Oe]of v.current){const $e=Z.session;if(!($e.workspaceId!==Oe.workspaceId||$e.provider!==Oe.provider||$e.state==="closed"||Oe.known.has($e.id)&&$e.id!==Oe.resume&&$e.claudeSessionId!==Oe.resume)){v.current.delete(Ce),De(Oe.previousId,$e.id),p(Ie=>Ie.filter(Pe=>Pe!==(Oe.previousId??Ce))),h(Ie=>[...new Set([...Ie.filter(Pe=>Pe!==Oe.previousId),$e.id])]);break}}if(X(Ce=>{const Oe={...Ce};for(const $e of Ee)if(!($e.parentSessionId||!me.current.has($e.workspaceId))){for(const[Ie,Pe]of Object.entries(Oe))Pe.workspaceId===$e.workspaceId&&Ie!==$e.id&&Yt(Pe)===Yt($e)&&delete Oe[Ie];Oe[$e.id]={...Oe[$e.id],...$e,...$e.state!=="closed"?{archivedAt:void 0}:{}}}return Oe}),Z.type==="session.live")for(const Ce of Ee)Ce.parentSessionId||!me.current.has(Ce.workspaceId)||Re.current.has(Ce.id)||(Re.current.set(Ce.id,0),i({type:"session.sync",sessionId:Ce.id,sinceSeq:0}))}if(Z.type==="session.events"){const Ee=Z.entries.findLast(Ie=>Ie.event.kind==="result");Ee&&K(Ie=>({...Ie,[Z.sessionId]:Ee.ts}));const Ce=Z.entries.findLast(Ie=>{var Pe;return Ie.event.kind==="rewound"&&Ie.seq>(((Pe=sn.current[Z.sessionId])==null?void 0:Pe.lastSeq)??0)}),Oe=(Ce==null?void 0:Ce.event.kind)==="rewound"?Ce.event.toUserIndex:null,$e=Oe===null?null:B_(((Ke=ot.current[Z.sessionId])==null?void 0:Ke.entries)??[],Oe);$e&&O(Ie=>({...Ie,[Z.sessionId]:{...Ie[Z.sessionId]??Ki,entries:$e}})),H(Ie=>{let Pe=Ie[Z.sessionId]??ms;if(Ce&&Ce.seq>Pe.lastSeq&&Oe!==null){const pt=($e==null?void 0:$e.filter(wt=>wt.event.kind==="user.message").length)??0;Pe={...Pe,items:q_(Pe.items,Oe,pt)}}return{...Ie,[Z.sessionId]:uu(Pe,Z.entries)}})}if(Z.type==="session.history"&&O(Ee=>({...Ee,[Z.sessionId]:H_(Ee[Z.sessionId]??Ki,Z)})),Z.type==="session.capabilities"&&M(Ee=>({...Ee,[Z.sessionId]:Z.capabilities})),Z.type==="usage.state"&&re(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=q.current)==null?void 0:ut.workspaceId)&&Z.query===q.current.query){const Ee=q.current.sessionId;Ee&&k(Ce=>({...Ce,[Ee]:{query:Z.query,entries:Z.entries}}))}if(Z.type==="fs.dir"&&q.current&&Z.workspaceId===q.current.workspaceId&&Z.path===q.current.path){const Ee=q.current.query,Ce=Ee.slice(Ee.lastIndexOf("/")+1).toLocaleLowerCase(),Oe={query:Ee,entries:Z.entries.filter(Ie=>Ie.name.toLocaleLowerCase().includes(Ce))},$e=q.current.sessionId;$e&&k(Ie=>({...Ie,[$e]:Oe}))}if(Z.type==="session.links"&&(W(Z.links),ke(null)),Z.type==="session.closed"&&X(Ee=>{const Ce=Ee[Z.sessionId];return Ce?{...Ee,[Z.sessionId]:{...Ce,state:"closed",backgroundWork:!1}}:Ee}),Z.type==="error"&&["session.start","session.link","session.history","session.sync","permission.respond","prompt.send"].includes(Z.context??"")&&(ke(Z.message),Z.requestId&&v.current.has(Z.requestId))){const Ee=v.current.get(Z.requestId);v.current.delete(Z.requestId),p(Ce=>Ce.filter(Oe=>Oe!==(Ee.previousId??Z.requestId)))}},[i]),oe=b.useMemo(()=>Object.values(Y).filter(Z=>me.current.has(Z.workspaceId)).sort((Z,De)=>De.updatedAt-Z.updatedAt),[Y,de]),Rt=Z=>Z.state==="error"?Z.updatedAt:E[Z.id]??Z.updatedAt,qe=oe.filter(Z=>{var De;return!Z.archivedAt&&(Z.state==="waiting_permission"||(((De=L[Z.id])==null?void 0:De.pending.length)??0)>0||!du(Z)&&(Z.state==="error"||Z.lastTurn==="failed"||Z.lastTurn==="completed")&&Rt(Z)>(Q[Yt(Z)]??0))}),Bt=qe.filter(Z=>{var De;return Z.state==="waiting_permission"||(((De=L[Z.id])==null?void 0:De.pending.length)??0)>0}),On=b.useCallback(Z=>ve(De=>{const Ke=Z.state==="error"?Z.updatedAt:E[Z.id]??Z.updatedAt;if((De[Yt(Z)]??0)>=Ke)return De;const ut={...De,[Yt(Z)]:Ke};try{localStorage.setItem("ether:inbox.seen",JSON.stringify(ut))}catch{}return ut}),[E]),xt=b.useCallback(Z=>{h(De=>De.includes(Z.id)?De:[...De,Z.id]),o(null),ke(null)},[]);b.useEffect(()=>{if(n)for(const Z of u){const De=Y[Z];!De||De.state==="closed"||y.current.has(Z)||(y.current.add(Z),i({type:"session.sync",sessionId:Z,sinceSeq:0}),O(Ke=>({...Ke,[Z]:{...Ke[Z]??Ki,loading:!0}})),i({type:"session.history",sessionId:Z}),i({type:"usage.get",sessionId:Z}),i({type:"context.get",sessionId:Z}))}},[u,Y,n,i]);const Zt=b.useCallback((Z,De,Ke,ut=!1,Ee=Ke)=>{if(!n||Ee&&!ut&&[...v.current.values()].some(Oe=>Oe.previousId===Ee))return;const Ce=crypto.randomUUID();v.current.set(Ce,{workspaceId:Z,provider:De,resume:Ke,...Ee&&!ut?{previousId:Ee}:{},known:new Set(Object.keys(tt.current))}),p(Oe=>[...Oe,Ee&&!ut?Ee:Ce]),ke(null),i({type:"session.start",workspaceId:Z,provider:De,requestId:Ce,...Ke?{resume:Ke,fork:ut}:{}})},[n,i]),on=b.useCallback(Z=>{h(De=>De.filter(Ke=>Ke!==Z))},[]),Yn=b.useCallback((Z,De)=>{var Ce;const Ke=tt.current[Z];if(k(Oe=>{const $e={...Oe};return delete $e[Z],$e}),De===null||!Ke){((Ce=q.current)==null?void 0:Ce.sessionId)===Z&&(q.current=null);return}const ut=De.lastIndexOf("/"),Ee=ut>=0?De.slice(0,ut):"";q.current={workspaceId:Ke.workspaceId,sessionId:Z,query:De,...ut>=0||De===""?{path:Ee}:{}},ut>=0||De===""?i({type:"fs.list",workspaceId:Ke.workspaceId,path:Ee}):i({type:"fs.search",workspaceId:Ke.workspaceId,query:De,scope:"comparison"})},[i]),jt=b.useCallback(()=>{if(n){ke(null);for(const Z of s)i({type:"session.list",workspaceId:Z.id});for(const Z of Object.values(tt.current))Z.state!=="closed"&&!Z.archivedAt&&i({type:"session.sync",sessionId:Z.id,sinceSeq:0});G.current.includes("session-links")&&i({type:"session.links.get"})}},[n,s,i]);return{view:c,setView:o,openedIds:u,replacements:g,launchingIds:x,launchSession:Zt,closeConversation:on,searchSession:Yn,contexts:N,sessions:Y,allSessions:oe,loaded:B,timelines:L,histories:D,links:$,attention:qe,waiting:Bt,markRead:On,handleFrame:st,capabilities:I,usage:P,context:_e,supportsLinks:T.includes("session-links"),openConversation:xt,send:i,error:xe,clearError:()=>ke(null),refresh:jt,supportsProviderDefaults:T.includes("provider-default-models"),loadHistory:(Z,De)=>{O(Ke=>({...Ke,[Z]:{...Ke[Z]??Ki,loading:!0}})),i({type:"session.history",sessionId:Z,before:De})}}}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 p=window.setInterval(()=>u(Math.floor((Date.now()-c)/1e3)),1e3);return()=>window.clearInterval(p)},[c]);const h=n?{title:"Нужен ваш ответ",detail:"Процесс приостановлен. Ответьте на вопрос или рассмотрите запрос разрешения, чтобы продолжить."}:s?im(s):i?{title:"Формирует ответ",detail:"Ответ появляется постепенно. Вы можете читать его уже сейчас."}:{title:"Работает над задачей",detail:"Обрабатывает ваш запрос. Новые действия и результаты появятся здесь."},x=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":`С начала работы: ${x}`,children:x})]}),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(x=>typeof x=="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,x)=>a.jsx("li",{children:h},x))})]}),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 gs({title:n,children:s,actions:i,className:c,sheet:o=!1,onClose:u}){const h=b.useRef(null);return b.useEffect(()=>{function x(p){if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),u();return}if(p.key!=="Tab")return;const g=h.current;if(!g)return;const _=g.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),v=_[0],y=_[_.length-1];!v||!y||(p.shiftKey&&document.activeElement===v?(p.preventDefault(),y.focus()):!p.shiftKey&&document.activeElement===y&&(p.preventDefault(),v.focus()))}return document.addEventListener("keydown",x,!0),()=>document.removeEventListener("keydown",x,!0)},[u]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:x=>{x.target===x.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 x=[];let p=0,g=0;for(;p<i&&g<c;){const _=n[p],v=s[g];_===v?(x.push({type:"ctx",text:_}),p++,g++):h(p+1,g)>=h(p,g+1)?(x.push({type:"del",text:_}),p++):(x.push({type:"add",text:v}),g++)}for(;p<i;)x.push({type:"del",text:n[p++]});for(;g<c;)x.push({type:"add",text:s[g++]});return ck(x)}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 x=Math.max(0,h-Jb);x<=Math.min(n.length-1,h+Jb);x++)s[x]=!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[x,p]=b.useState(s),[g,_]=b.useState("preview");b.useEffect(()=>{p(s),_("preview")},[n.requestId,s]);const v=x.trim().length>0;function y(){v&&u(n.requestId,x)}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"+(g==="preview"?" is-on":""),role:"tab","aria-selected":g==="preview",onClick:()=>_("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(g==="source"?" is-on":""),role:"tab","aria-selected":g==="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:g==="preview"?a.jsx(fk,{text:x}):a.jsx("textarea",{className:"plansheet__source",value:x,onChange:N=>p(N.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 wf(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,[x,p]=b.useState(()=>h.map(()=>new Set)),[g,_]=b.useState(()=>h.map(()=>"")),[v,y]=b.useState(()=>Wb(h));b.useEffect(()=>{p(h.map(()=>new Set)),_(h.map(()=>"")),y(Wb(h))},[n.requestId]);const N=b.useMemo(()=>xk(h,x,g),[h,x,g]),k=N!==null;function T(R,L){var H,D;(D=(H=h[R])==null?void 0:H.options[L])!=null&&D.preview&&y(O=>{const I=O.slice();return I[R]=L,I})}function A(R,L,H){p(D=>{const O=D.slice(),I=new Set(O[R]);return H?I.has(L)?I.delete(L):I.add(L):I.has(L)||(I.clear(),I.add(L)),O[R]=I,O}),L!=="other"&&T(R,L)}function G(R,L){_(H=>{const D=H.slice();return D[R]=L,D})}function Y(){N&&o(n.requestId,N)}function X(R){R.key==="Enter"&&(R.target.closest("button")||k&&(R.preventDefault(),Y()))}function B(R){var O;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(R.key))return;const L=Array.from(R.currentTarget.querySelectorAll("button.qsheet__option")),H=L.indexOf(document.activeElement);if(H===-1)return;R.preventDefault();const D=R.key==="ArrowDown"||R.key==="ArrowRight"?1:-1;(O=L[(H+D+L.length)%L.length])==null||O.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:X,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((R,L)=>a.jsx(gk,{q:R,qi:L,selected:x[L]??new Set,otherText:g[L]??"",previewIndex:v[L]??null,onToggle:A,onFocusOption:T,onOtherText:G,onOptionsKeyDown:B},L))]}),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:Y,children:"Ответить"})]})]})})}function gk({q:n,qi:s,selected:i,otherText:c,previewIndex:o,onToggle:u,onFocusOption:h,onOtherText:x,onOptionsKeyDown:p}){var N;const g=n.options.some(k=>k.preview),_=o!==null?(N=n.options[o])==null?void 0:N.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:p,children:[n.options.map((k,T)=>{const A=i.has(T);return a.jsxs("button",{type:"button",role:y,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>u(s,T,n.multiSelect),onFocus:()=>h(s,T),onMouseEnter:()=>h(s,T),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})]})]},T)}),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=>x(s,k.target.value),autoFocus:!0})]})]}),g&&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,x=[];for(let p=0;p<u.options.length;p++){const g=u.options[p];g&&h.has(p)&&x.push(g.label)}if(h.has("other")){const p=(i[o]??"").trim();p&&x.push(p)}if(x.length===0)return null;c[u.question]=x.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 A;if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),i();return}if(y.key!=="Tab")return;const N=(A=u.current)==null?void 0:A.querySelectorAll('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [tabindex="0"]'),k=N==null?void 0:N[0],T=N==null?void 0:N[N.length-1];y.shiftKey&&document.activeElement===k&&T?(y.preventDefault(),T.focus()):!y.shiftKey&&document.activeElement===T&&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"}),x={queued:((c==null?void 0:c.pending.length)??1)-1,collapsed:!1,onCollapse:i},p=jy(o.toolName,o.input),g=(_=o.questions)!=null&&_.length?a.jsx(mk,{...x,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):p!==null?a.jsx(dk,{...x,request:o,plan:p,onDecline:h,onAccept:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"allow",plan:y})},o.requestId):a.jsx(pk,{...x,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:g})}const Kd=[{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 x,p,g;const{hub:s}=n,[i,c]=b.useState(null),o=i?((x=s.timelines[i])==null?void 0:x.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(gs,{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},(p=n.activeSession)==null?void 0:p.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:["ВХОДЯЩИЕ · ",(g=n.workspaces.find(_=>_.id===h.workspaceId))==null?void 0:g.name]}),a.jsx("strong",{children:cn(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":du(n)?" is-running":"")}),a.jsxs("span",{children:[a.jsx("strong",{children:cn(n)}),a.jsxs("small",{children:[s&&`${s} · `,n.provider," · ",o??Ur(n)]})]})]}),c&&a.jsx("button",{className:"hub-icon-btn",onClick:c,"aria-label":`Открыть рядом: ${cn(n)}`,title:"Открыть вторым разговором",children:"◧"})]})}function yk({hub:n,workspaces:s,connected:i,onSelectWorkspace:c,onSelectSession:o,onOpenWorkspace:u,onNewSession:h}){const[x,p]=b.useState(""),[g,_]=b.useState("all"),v=s.filter(y=>{if(!`${y.name} ${y.path}`.toLocaleLowerCase().includes(x.toLocaleLowerCase()))return!1;const N=n.allSessions.filter(k=>k.workspaceId===y.id&&!k.archivedAt);return g==="all"||(g==="working"?N.some(du):N.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&&du(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:x,onChange:y=>p(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,N])=>a.jsx("button",{"aria-pressed":g===y,onClick:()=>_(y),children:N},y))}),a.jsx("div",{className:"hub-project-grid",children:v.map(y=>{const N=n.allSessions.filter(A=>A.workspaceId===y.id&&!A.archivedAt),k=N.filter(A=>A.state==="waiting_permission").length,T=N.filter(du).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:[N.length," сессий"]}),a.jsxs("span",{children:[T," в работе"]}),k>0&&a.jsxs("span",{className:"hub-warning",children:[k," ждут ответа"]})]}):a.jsx("span",{children:"Загружаются сессии…"})}),a.jsxs("div",{className:"hub-project__recent",children:[N.slice(0,3).map(A=>a.jsx(Ny,{session:A,onOpen:()=>o(A),onCompare:()=>o(A,!0)},A.id)),n.loaded[y.id]&&!N.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,x]=b.useState("all"),p=_=>{var v;return _.state==="waiting_permission"||(v=n.timelines[_.id])!=null&&v.pending.length?"waiting":_.state==="error"||_.lastTurn==="failed"?"error":"result"},g=n.attention.filter(_=>(u==="all"||_.provider===u)&&(h==="all"||p(_)===h)).sort((_,v)=>(p(_)==="waiting"?0:p(_)==="error"?1:2)-(p(v)==="waiting"?0:p(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:()=>x(_),children:v},_)),a.jsx("button",{className:"hub-mark-all",onClick:()=>n.attention.filter(_=>(u==="all"||_.provider===u)&&p(_)!=="waiting").forEach(n.markRead),children:"Прочитать результаты"})]}),a.jsx("div",{className:"hub-inbox",children:g.map(_=>{var A,G,Y,X;const v=n.timelines[_.id],y=v==null?void 0:v.pending[0],N=p(_),k=rm((v==null?void 0:v.items)??[]),T=(G=(A=y==null?void 0:y.questions)==null?void 0:A[0])==null?void 0:G.question;return a.jsxs("article",{className:"hub-inbox-item hub-inbox-item--"+N,children:[a.jsxs("div",{className:"hub-inbox-item__meta",children:[a.jsx("span",{className:"hub-pill",children:N==="waiting"?(Y=y==null?void 0:y.questions)!=null&&Y.length?"Вопрос":"Нужно разрешение":N==="error"?"Ошибка":"Задача завершена"}),a.jsxs("span",{children:[(X=s.find(B=>B.id===_.workspaceId))==null?void 0:X.name," · ",_.provider]})]}),a.jsx("h3",{children:cn(_)}),a.jsx("p",{children:T??(y?`${y.toolName}${y.reason?` · ${y.reason}`:""}`:k.answer.slice(0,220)||k.prompt.slice(0,220)||Ur(_))}),a.jsxs("div",{className:"hub-inbox-item__actions",children:[N==="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:"Открыть рядом"}),N!=="waiting"&&a.jsx("button",{className:"hub-read",onClick:()=>n.markRead(_),children:"Прочитано ✓"})]})]},_.id)})}),!g.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:x,onOpenFiles:p,onOpenSettings:g,onNewSession:_}){const[v,y]=b.useState(""),[N,k]=b.useState(0),T=b.useRef(null);b.useEffect(()=>{const Y=setTimeout(()=>{var X;return(X=T.current)==null?void 0:X.focus()},0);return()=>clearTimeout(Y)},[]);const A=b.useMemo(()=>{const Y=[{id:"projects",title:"Обзор проектов",hint:"Действие · все рабочие пространства",run:()=>n.setView("projects")},{id:"inbox",title:"Входящие",hint:"Действие · вопросы и результаты",run:()=>n.setView("inbox")},{id:"open",title:"Открыть проект",hint:"Действие · выбрать папку",run:x,disabled:!c},{id:"new",title:"Создать сессию",hint:"Действие · новый разговор в текущем проекте",run:()=>i&&_(i),disabled:!i||!c},{id:"files",title:"Открыть файлы проекта",hint:"Действие · дерево файлов и редактор",run:p,disabled:!i},{id:"settings",title:"Настройки пространства",hint:"Действие · темы и агенты",run:g},{id:"compare",title:"Открыть сессию параллельно",hint:"Действие · независимое окно сессии",run:()=>n.setView("compare")}],X=s.map(L=>({id:"p:"+L.id,title:L.name,hint:"Проект · "+L.path,run:()=>h(L.id),disabled:!1})),B=n.allSessions.filter(L=>o==="all"||L.provider===o).map(L=>{var H;return{id:"s:"+L.id,title:cn(L),hint:`${L.archivedAt?"Архив · ":"Сессия · "}${((H=s.find(D=>D.id===L.workspaceId))==null?void 0:H.name)??""} · ${L.provider} · ${Ur(L)}`,run:()=>u(L),disabled:!c&&L.state==="closed"}}),R=v.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);return[...Y,...X,...B].filter(L=>R.every(H=>`${L.title} ${L.hint}`.toLocaleLowerCase().includes(H))).sort((L,H)=>Number(H.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))-Number(L.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))).slice(0,60)},[v,n.allSessions,s,c,i,o]),G=Y=>{const X=A[Y];X&&!X.disabled&&(n.setView(null),X.run())};return b.useEffect(()=>{var Y;(Y=document.getElementById(`hub-option-${N}`))==null||Y.scrollIntoView({block:"nearest"})},[N]),a.jsxs("div",{className:"command-palette",children:[a.jsx("input",{ref:T,className:"hub-input command-palette__input",role:"combobox","aria-expanded":"true","aria-controls":"hub-command-results","aria-autocomplete":"list","aria-activedescendant":A[N]?`hub-option-${N}`:void 0,"aria-label":"Поиск проектов, сессий и действий",placeholder:"Проект, разговор или действие…",value:v,onChange:Y=>{y(Y.target.value),k(0)},onKeyDown:Y=>{(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Y.preventDefault(),k(X=>A.length?(X+(Y.key==="ArrowDown"?1:-1)+A.length)%A.length:0)),Y.key==="Enter"&&(Y.preventDefault(),G(N))}}),a.jsx("div",{className:"command-palette__results",role:"listbox",id:"hub-command-results","aria-label":"Результаты поиска",children:A.map((Y,X)=>a.jsxs("button",{role:"option","aria-selected":N===X,"aria-disabled":Y.disabled,disabled:Y.disabled,id:`hub-option-${X}`,className:N===X?"is-selected":"",onMouseMove:()=>k(X),onClick:()=>G(X),children:[a.jsx("span",{className:"command-palette__kind","aria-hidden":"true",children:Y.id.startsWith("p:")?"▦":Y.id.startsWith("s:")?"◌":"↗"}),a.jsxs("span",{children:[a.jsx("strong",{children:Y.title}),a.jsx("small",{children:Y.hint})]}),a.jsx("span",{"aria-hidden":"true",children:"↵"})]},Y.id))}),!A.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(x=>{var p;return(c==="all"||x.provider===c)&&!x.archivedAt&&`${cn(x)} ${(p=s.find(g=>g.id===x.workspaceId))==null?void 0:p.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:x=>u(x.target.value),"aria-label":"Найти сессию для параллельного просмотра",placeholder:"Сессия или проект…"}),a.jsx("div",{className:"hub-session-list",children:h.map(x=>{var p;return a.jsx(Ny,{session:x,workspace:(p=s.find(g=>g.id===x.workspaceId))==null?void 0:p.name,onOpen:()=>i(x,!0)},x.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 q;const x=s==null?void 0:s.workspaceId,p=n.allSessions.filter($=>$.workspaceId===x),[g,_]=b.useState(s?Yt(s):""),v=p.find($=>Yt($)===g)??s,y=n.links.find($=>$.sessionId===g),[N,k]=b.useState((y==null?void 0:y.parentId)??""),[T,A]=b.useState((y==null?void 0:y.stage)??"other"),[G,Y]=b.useState("implementation"),[X,B]=b.useState(c.includes((s==null?void 0:s.provider)??"claude")?s.provider:c[0]??"claude"),[R,L]=b.useState(!1),H=v?Pb(Yt(v),n.links):"",D=p.filter($=>Pb(Yt($),n.links)===H).sort(($,W)=>$.createdAt-W.createdAt),O=[],I=new Set,M=($,W)=>{var ve;const Q=Yt($);if(!I.has(Q)){I.add(Q),O.push({session:$,depth:W});for(const E of D)((ve=n.links.find(K=>K.sessionId===Yt(E)))==null?void 0:ve.parentId)===Q&&M(E,W+1)}},P=D.find($=>Yt($)===H);P&&M(P,0);for(const $ of D)I.has(Yt($))||M($,0);const re=$=>{_($);const W=n.links.find(Q=>Q.sessionId===$);k((W==null?void 0:W.parentId)??""),A((W==null?void 0:W.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 _e=v.provider===X&&X!=="antigravity",we=p.filter($=>{var ve;let W=Yt($);const Q=new Set;for(;W&&!Q.has(W);){if(W===g)return!1;Q.add(W),W=((ve=n.links.find(E=>E.sessionId===W))==null?void 0:ve.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:[(q=i.find($=>$.id===x))==null?void 0:q.name," · ЦЕПОЧКА ЗАДАЧИ"]}),a.jsx("div",{className:"task-chain",children:O.map(({session:$,depth:W})=>{var E;const Q=n.links.find(K=>K.sessionId===Yt($)),ve=p.find(K=>Yt(K)===(Q==null?void 0:Q.parentId));return a.jsxs("article",{className:"task-node"+($.id===v.id?" is-current":""),style:{marginLeft:Math.min(W,4)*14},"data-depth":W,children:[a.jsx("div",{className:"task-node__rail","aria-hidden":"true",children:(Q==null?void 0:Q.kind)==="fork"?"⑂":"○"}),a.jsxs("div",{children:[a.jsxs("span",{className:"hub-eyebrow",children:[((E=Kd.find(K=>K.value===(Q==null?void 0:Q.stage)))==null?void 0:E.label)??"Начало задачи",$.archivedAt?" · архив":""]}),a.jsx("button",{className:"task-node__title",onClick:()=>u($),children:cn($)}),a.jsxs("p",{children:[ve?`Из «${cn(ve)}» · `:"",Ur($)," · ",$.provider]})]}),a.jsx("button",{className:"hub-icon-btn",title:"Открыть рядом","aria-label":`Открыть рядом: ${cn($)}`,onClick:()=>u($,!0),children:"◧"})]},$.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:$=>{$.preventDefault(),n.send({type:"session.link",workspaceId:x,sessionId:g,parentId:N||null,stage:T})},children:[a.jsxs("label",{children:["Разговор",a.jsx("select",{value:g,onChange:$=>re($.target.value),children:p.map($=>a.jsx("option",{value:Yt($),children:cn($)},$.id))})]}),a.jsxs("label",{children:["Предыдущий этап",a.jsxs("select",{value:N,onChange:$=>k($.target.value),children:[a.jsx("option",{value:"",children:"Самостоятельная задача"}),we.map($=>a.jsx("option",{value:Yt($),children:cn($)},$.id))]})]}),a.jsxs("label",{children:["Этап",a.jsx("select",{value:T,onChange:$=>A($.target.value),children:Kd.map($=>a.jsx("option",{value:$.value,children:$.label},$.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:["Новый разговор будет связан с «",cn(v),"». Доступный контекст появится в черновике — его можно проверить перед отправкой.",v.state==="closed"&&!n.histories[v.id]&&" История не открыта: в черновике будут название и этап. Для переноса всей истории выберите ответвление разговора."]}),a.jsxs("form",{className:"hub-stage-form",onSubmit:$=>{var E,K,xe;$.preventDefault();const W=rm([...Yp(((E=n.histories[v.id])==null?void 0:E.entries)??[]),...((K=n.timelines[v.id])==null?void 0:K.items)??[]]),ve=`Следующий этап: ${(xe=Kd.find(ke=>ke.value===G))==null?void 0:xe.label}.
119
+ Продолжаем задачу «${cn(v)}».${W.prompt?`
120
+
121
+ Последняя задача:
122
+ ${W.prompt.slice(0,3e3)}`:""}${W.answer?`
123
+
124
+ Последний ответ:
125
+ ${W.answer.slice(0,5e3)}`:""}
126
+
127
+ `;h(v,X,G,R&&_e,ve)},children:[a.jsxs("label",{children:["Следующий этап",a.jsx("select",{value:G,onChange:$=>Y($.target.value),children:Kd.map($=>a.jsx("option",{value:$.value,children:$.label},$.value))})]}),a.jsxs("label",{children:["Агент",a.jsx("select",{value:X,onChange:$=>{B($.target.value),L(!1)},children:c.map($=>a.jsx("option",{value:$,children:$==="claude"?"Claude":$==="codex"?"Codex":"Antigravity"},$))})]}),a.jsxs("label",{className:"hub-checkbox",children:[a.jsx("input",{type:"checkbox",checked:R&&_e,disabled:!_e,onChange:$=>L($.target.checked)}),a.jsxs("span",{children:["Ответвить полный разговор",!_e&&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&&Hl("распознавание подменено: родной реализации в странице нет"),i??s[0]??null}function Sy(){var n;try{return((n=localStorage.getItem(Nk))==null?void 0:n.trim())||e_}catch{return e_}}function Hl(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),x=b.useRef(!1),p=b.useRef(!1),g=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),N=b.useRef(null),k=b.useCallback(()=>{N.current&&clearTimeout(N.current),N.current=null},[]),T=b.useCallback(()=>{k();const B=async R=>{if(N.current=null,!(!x.current||y.current)){if(!R&&!await Dk()){if(Hl("ждём ответа на запрос доступа к микрофону"),!x.current||y.current)return;N.current=setTimeout(()=>void B(!0),Rk);return}Hl("движок не ответил на start()"),x.current=!1,c(!1),u("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};N.current=setTimeout(()=>void B(!1),Mk)},[k]);b.useEffect(()=>{g.current=n}),b.useEffect(()=>{const B=t_();if(!B)return;const R=new B;return R.lang=Sy(),R.continuous=!0,R.interimResults=!0,R.onstart=()=>{Hl("сессия открыта"),y.current=!0,k(),c(!0)},R.onaudiostart=()=>{Hl("пошёл звук с микрофона"),_.current.audio=!0},R.onresult=L=>{var I;if(p.current)return;let H="",D="";for(let M=L.resultIndex;M<L.results.length;M++){const P=L.results[M];if(!P)continue;const re=((I=P[0])==null?void 0:I.transcript)??"";P.isFinal?H+=re:D+=re}const O=_.current;O.heard=!0,O.everHeard=!0,Hl("распознано",{final:H,interim:D}),g.current(H,D)},R.onerror=L=>{_.current.lastError=L.error,Hl("ошибка движка",L.error),!(L.error==="no-speech"||L.error==="aborted")&&(x.current=!1,c(!1),u(Ok[L.error]??`Распознавание не работает: ${L.error}`))},R.onend=()=>{p.current=!1,y.current=!1;const L=_.current,H=Date.now()-L.openedAt;if(Hl("сессия закрыта",{мс:H,звук:L.audio,слова:L.heard,ошибка:L.lastError||null}),!x.current){c(!1);return}if(L.dead=!L.audio&&H<Tk?L.dead+1:0,L.dead>=Ck){x.current=!1,c(!1),u(L.lastError?`Распознавание не работает: ${L.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}L.silent=L.heard?0:L.silent+1,!L.everHeard&&!L.warned&&L.silent>=Ek&&(L.warned=!0,u(L.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),v.current=setTimeout(()=>{if(v.current=null,!!x.current){L.openedAt=Date.now(),L.audio=!1,L.heard=!1,L.lastError="",T();try{R.start()}catch{}}},Ak)},h.current=R,()=>{x.current=!1,v.current&&clearTimeout(v.current),v.current=null,k(),R.onend=null,R.onresult=null,R.onerror=null,R.onstart=null,R.onaudiostart=null,R.abort(),h.current=null}},[]);const A=b.useCallback(()=>{var B;if(x.current){if(x.current=!1,Hl("выключение микрофона"),v.current&&clearTimeout(v.current),v.current=null,k(),!y.current){c(!1);return}(B=h.current)==null||B.stop()}},[]),G=b.useCallback(()=>{const B=h.current;if(B){if(!window.isSecureContext){u("Микрофон доступен только по https или с localhost");return}u(null),x.current=!0,p.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),Hl("включение микрофона",{язык:B.lang}),T();try{B.start()}catch(R){Hl("start() не прошёл",R)}}},[T]),Y=b.useCallback(()=>{x.current?A():G()},[G,A]),X=b.useCallback(()=>{var B;x.current&&y.current&&(p.current=!0,(B=h.current)==null||B.abort())},[]);return{supported:s,listening:i,error:o,toggle:Y,stop:A,drop:X}}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 x=n.type==="image/png",p=x?"image/png":"image/jpeg",g=u.toDataURL(p,x?void 0:Xk),_=g.slice(g.indexOf(",")+1);return _?(l_+=1,{id:`att${l_}`,mediaType:p,data:_,previewUrl:g}):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:x,placeholder:p,draftKey:g,sendLabel:_="Отправить",autoFocus:v=!1,attachmentsEnabled:y=!0,sendBlocked:N=!1,onContextSearch:k,onCommand:T,onSend:A,onInterrupt:G,onEscape:Y}){var zt;const X=yf(zk),[B,R]=b.useState(()=>g?ou(g):""),[L,H]=b.useState(!1),[D,O]=b.useState(0),I=b.useRef(null),M=b.useRef(null),[P,re]=b.useState({position:"fixed"}),_e=b.useRef(!1),we=b.useRef(null),[q,$]=b.useState(()=>g?ou(g).length:0),[W,Q]=b.useState([]),ve=b.useRef(null),E=b.useCallback(J=>{!y||J.length===0||Promise.all(J.map(Qk)).then(fe=>{const Me=fe.filter(Ze=>Ze!==null);Me.length!==0&&Q(Ze=>[...Ze,...Me].slice(0,$k))})},[y]);function K(J){Q(fe=>fe.filter(Me=>Me.id!==J))}function xe(J){var Ze;if(!y)return;const fe=(Ze=J.clipboardData)==null?void 0:Ze.items;if(!fe)return;const Me=[];for(const It of fe){if(!It.type.startsWith("image/"))continue;const an=It.getAsFile();an&&Me.push(an)}Me.length!==0&&(J.preventDefault(),E(Me))}function ke(J){const fe=J.target.files?Array.from(J.target.files):[];J.target.value="",E(fe)}b.useEffect(()=>{y||Q([])},[y]);const[Re,me]=b.useState([]),[He,tt]=b.useState(-1),ot=b.useRef(""),[sn,de]=b.useState(""),st=Lk(b.useCallback((J,fe)=>{J&&R(Me=>bp(Me,J)),de(fe.trim())},[])),oe=sn?bp(B,sn):B;b.useEffect(()=>{st.listening||sn===""||(R(J=>bp(J,sn)),de(""))},[st.listening,sn]),b.useEffect(()=>{var J;v&&((J=I.current)==null||J.focus())},[v]);const Rt=b.useRef(new Map),qe=b.useRef(new Map),Bt=b.useRef(g),On=b.useRef({text:B,caret:q});On.current={text:B,caret:q};const xt=b.useCallback((J,fe,Me)=>{fe===""?(Rt.current.delete(J),qe.current.delete(J)):(Rt.current.set(J,fe),qe.current.set(J,Me)),af(J,fe)},[]),Zt=st.drop;b.useLayoutEffect(()=>{const J=Bt.current;if(J===g)return;Bt.current=g,J&&xt(J,On.current.text,On.current.caret);const fe=g?Rt.current.get(g)??ou(g):"",Me=g?qe.current.get(g):void 0,Ze=Math.min(Me??fe.length,fe.length);R(fe),$(Ze),we.current=[Ze,Ze],de(""),O(0),H(!1),tt(-1),ot.current="",Q([]),Zt()},[g,xt,Zt]),b.useEffect(()=>{g&&xt(g,B,q)},[g,B,q,xt]);const on=n?"Выберите сессию":N?"Нет VPN — отправка остановлена":p??"С чего начнём? Опишите задачу…",Yn=b.useRef(0),jt=b.useCallback(J=>{const fe=parseFloat(getComputedStyle(J).maxHeight),Me=Number.isFinite(fe)&&fe>0?fe:Gk;J.style.height="auto";const Ze=J.scrollHeight;J.style.height=`${Math.min(Ze,Me)}px`,J.style.overflowY=Ze>Me?"auto":"hidden"},[]);b.useEffect(()=>{const J=I.current;J&&jt(J)},[oe,on,n,jt]),b.useLayoutEffect(()=>{const J=I.current,fe=we.current;!J||!fe||(we.current=null,J.setSelectionRange(fe[0],fe[1]))}),b.useEffect(()=>{const J=I.current;if(!J)return;const fe=new ResizeObserver(([Me])=>{const Ze=Me==null?void 0:Me.contentRect.width;Ze===void 0||Math.abs(Ze-Yn.current)<1||(Yn.current=Ze,jt(J))});return fe.observe(J),()=>fe.disconnect()},[jt]);const Z=st.stop;b.useEffect(()=>{n&&Z()},[n,Z]);const De=b.useMemo(()=>st.error?{ok:!1,message:st.error}:null,[st.error]),Ke=b.useMemo(()=>{var Me;const J=(Me=n_.exec(B))==null?void 0:Me[1];if(J===void 0)return[];const fe=J.toLowerCase();return i.filter(Ze=>(c?!Ze.name.startsWith("__"):!Uk(Ze))&&_p(Ze,fe)<Ty).sort((Ze,It)=>_p(Ze,fe)-_p(It,fe))},[B,i,c]),ut=!o&&!L&&Ke.length>0,Ee=Math.min(D,Ke.length-1),Ce=L||o?null:((zt=s_.exec(oe.slice(0,q)))==null?void 0:zt[1])??null,Oe=b.useRef(k);Oe.current=k,b.useEffect(()=>{if(Ce===null||Ce===""||Ce.endsWith("/")){Oe.current(Ce);return}const J=setTimeout(()=>Oe.current(Ce),Bk);return()=>clearTimeout(J)},[Ce]);const $e=Ce!==null&&(h==null?void 0:h.query)===Ce,Ie=$e?h.entries:[],Pe=Ce!==null,pt=Pe&&!$e,wt=Math.min(D,Math.max(Ie.length-1,0));b.useEffect(()=>{var fe,Me;if(!ut&&!Pe)return;const J=ut?Ee:wt;(Me=(fe=M.current)==null?void 0:fe.children[J])==null||Me.scrollIntoView({block:"nearest"})},[ut,Pe,Ee,wt]);const Lt=ut||Pe;b.useLayoutEffect(()=>{var It;if(!Lt)return;const J=(It=I.current)==null?void 0:It.closest(".composer__inner");if(!J)return;const fe=()=>{var Cs;const an=J.getBoundingClientRect(),Et=window.visualViewport,ys=((Et==null?void 0:Et.offsetLeft)??0)+8,Xn=((Et==null?void 0:Et.offsetTop)??0)+8,is=ys+((Et==null?void 0:Et.width)??innerWidth)-16,dn=Xn+((Et==null?void 0:Et.height)??innerHeight)-16,lt=Math.min(Math.max(260,an.width),is-ys),_n=an.top-Xn-8,Es=dn-an.bottom-8,Ts=Math.min(320,Math.max(_n,Es));re({position:"fixed",left:Math.max(ys,Math.min(an.left,is-lt)),width:lt,maxHeight:Math.max(80,Ts),top:_n>=Es?Math.max(Xn,an.top-Math.min(((Cs=M.current)==null?void 0:Cs.scrollHeight)??Ts,Ts)-8):an.bottom+8,bottom:"auto",right:"auto",zIndex:80})};fe();const Me=new ResizeObserver(fe);Me.observe(J),window.addEventListener("resize",fe),window.addEventListener("scroll",fe,!0);const Ze=an=>{var Et,ys,Xn;!((Et=M.current)!=null&&Et.contains(an.target))&&!((Xn=(ys=I.current)==null?void 0:ys.closest(".composer"))!=null&&Xn.contains(an.target))&&H(!0)};return document.addEventListener("mousedown",Ze),()=>{Me.disconnect(),window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe,!0),document.removeEventListener("mousedown",Ze)}},[Lt,Ke.length,Ie.length]);function Xt(J,fe){var Me;R(J),$(fe),we.current=[fe,fe],O(0),H(!1),sn!==""&&(de(""),st.drop()),(Me=I.current)==null||Me.focus()}function _s(){R(""),de(""),O(0),$(0),H(!1),tt(-1),ot.current="",Q([]),st.drop(),g&&xt(g,"",0)}function ie(J){const fe=J.trim();if(fe===""&&W.length===0||n||N||_e.current)return;const Me=A(fe,W.length>0?W.map(Ze=>({mediaType:Ze.mediaType,data:Ze.data})):void 0);if(Me instanceof Promise){_e.current=!0,Me.then(Ze=>{_e.current=!1,Ze&&je(fe)},()=>{_e.current=!1});return}Me!==!1&&je(fe)}function je(J){J!==""&&me(fe=>[J,...fe.filter(Me=>Me!==J)].slice(0,qk)),_s()}function Xe(J){if(J<-1||J>=Re.length)return;He===-1&&(ot.current=B);const fe=J===-1?ot.current:Re[J]??"";tt(J),Xt(fe,fe.length)}function at(){var Ze;const J=((Ze=I.current)==null?void 0:Ze.selectionStart)??oe.length,Me=`${J>0&&!/\s$/.test(oe.slice(0,J))?" ":""}@`;Xt(oe.slice(0,J)+Me+oe.slice(J),J+Me.length)}function Je(J){var It;const fe=(It=s_.exec(oe.slice(0,q)))==null?void 0:It[1];if(fe===void 0)return;const Me=q-fe.length-1,Ze=J.kind==="dir"?`@${J.path}/`:`@${J.path} `;Xt(oe.slice(0,Me)+Ze+oe.slice(q),Me+Ze.length)}function ln(){var fe;if(N)return;const J=(fe=n_.exec(oe.trim()))==null?void 0:fe[1];if(J&&T(J)){_s();return}ie(oe)}function Vn(J,fe){R(J),$(fe),O(0),H(!1),tt(-1),sn!==""&&(de(""),st.drop())}function gn(J){var Ze;const fe=Hk.has(J.name)?u:null,Me=`/${J.name} `;R(Me+(fe??"")),$(Me.length+((fe==null?void 0:fe.length)??0)),fe&&(we.current=[Me.length,Me.length+fe.length]),O(0),(Ze=I.current)==null||Ze.focus()}function un(J){if(T(J.name)){R(""),O(0),H(!1);return}J.argumentHint?gn(J):ie(`/${J.name}`)}function Ft(J){if(ut){if(J.key==="ArrowDown")return J.preventDefault(),O(fe=>(Math.min(fe,Ke.length-1)+1)%Ke.length);if(J.key==="ArrowUp"){J.preventDefault();const fe=Ke.length-1;return O(Me=>(Math.min(Me,fe)+fe)%Ke.length)}if(J.key==="Enter"&&!J.shiftKey){J.preventDefault();const fe=Ke[Ee];fe&&un(fe);return}if(J.key==="Tab"){J.preventDefault();const fe=Ke[Ee];fe&&gn(fe);return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),H(!0);return}}if(Pe){if(J.key==="ArrowDown"&&Ie.length>0)return J.preventDefault(),O(fe=>(Math.min(fe,Ie.length-1)+1)%Ie.length);if(J.key==="ArrowUp"&&Ie.length>0){J.preventDefault();const fe=Ie.length-1;return O(Me=>(Math.min(Me,fe)+fe)%Ie.length)}if(J.key==="Enter"&&!J.shiftKey||J.key==="Tab"){const fe=Ie[wt];if(fe){J.preventDefault(),Je(fe);return}if(J.key==="Tab")return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),H(!0);return}}if((J.key==="ArrowUp"||J.key==="ArrowDown")&&!J.shiftKey){const fe=J.currentTarget,Me=fe.selectionStart;if(fe.selectionEnd===Me){const It=J.key==="ArrowUp"?He+1:He-1;It>=-1&&It<Re.length&&requestAnimationFrame(()=>{fe.selectionStart===Me&&fe.selectionEnd===Me&&Xe(It)})}}if(J.key==="Escape"&&Y){J.preventDefault(),J.stopPropagation(),Y();return}J.key==="Enter"&&!J.shiftKey&&!X&&(J.preventDefault(),ln())}return a.jsx("div",{className:x?`composer ${x}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Ir,{result:De}),Pe&&!ut&&xu.createPortal(a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:M,style:P,"data-session-commands":g??void 0,children:[Ie.map((J,fe)=>a.jsxs("button",{role:"option","aria-selected":fe===wt,className:fe===wt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>O(fe),onMouseDown:Me=>{Me.preventDefault(),Je(J)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[J.name,J.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:J.path}),J.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},J.path)),Ie.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:pt?"ищем…":Ce?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),document.body),ut&&xu.createPortal(a.jsx("div",{className:"cmdmenu",role:"listbox",ref:M,style:P,"data-session-commands":g??void 0,children:Ke.map((J,fe)=>a.jsxs("button",{role:"option","aria-selected":fe===Ee,className:fe===Ee?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>O(fe),onMouseDown:Me=>{Me.preventDefault(),un(J)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",J.name]}),J.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:J.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:J.description})]},J.name))}),document.body),W.length>0&&a.jsx("div",{className:"composer__attachments",children:W.map(J=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:J.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>K(J.id),children:a.jsx(eN,{})})]},J.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:at,children:a.jsx(Pk,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:ve,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:ke}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var J;return(J=ve.current)==null?void 0:J.click()},children:a.jsx(Wk,{})})]}),a.jsx("textarea",{ref:I,value:oe,"aria-label":"Сообщение агенту",disabled:n,placeholder:on,onChange:J=>Vn(J.target.value,J.target.selectionStart),onSelect:J=>$(J.currentTarget.selectionStart),onKeyDown:Ft,onPaste:xe}),st.supported&&a.jsx("button",{type:"button",className:st.listening?"micbtn is-on":"micbtn",title:st.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":st.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":st.listening,disabled:n,onClick:st.toggle,children:a.jsx(tN,{on:st.listening})}),s?a.jsx("button",{className:"btn",onClick:G,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:ln,disabled:n||N||oe.trim()===""&&W.length===0,"aria-label":_,title:N?"Нет 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 ai(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,$c="Копировать",fu="Скопировано";function Wc({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?fu:`${$c} ${s}`,title:c?fu:`${$c} ${s}`,onClick:()=>{ai(n).then(u=>{u&&o(!0)})},children:c?fu:$c})}function um({items:n,busy:s,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:u=!1,onLoadHistory:h,sessionId:x,onEditMessage:p,empty:g="Опишите задачу — ответы, действия и результаты появятся здесь.",welcome:_}){var L;const v=b.useRef(null),y=b.useRef(null),N=b.useRef(!1);N.current=!!_&&n.length===0&&c.length===0;const k=b.useRef(!0),T=b.useRef(null),A=b.useRef(null),G=b.useRef(!1);b.useEffect(()=>{k.current=!0,T.current=null,G.current=!1,A.current!==null&&(clearTimeout(A.current),A.current=null)},[x]),b.useEffect(()=>{const H=v.current,D=y.current;if(!H||!D)return;function O(P){!H||P===H.scrollTop||(G.current=!0,H.scrollTop=P)}function I(){if(!H)return;const P=T.current;if(P){const re=i_(H,P.id);if(re){const _e=re.getBoundingClientRect().top-H.getBoundingClientRect().top;O(H.scrollTop+(_e-P.top))}A.current!==null&&clearTimeout(A.current),A.current=setTimeout(()=>{T.current=null},500);return}k.current&&O(N.current?0:H.scrollHeight)}const M=new ResizeObserver(I);return M.observe(D),()=>{M.disconnect(),A.current!==null&&clearTimeout(A.current)}},[]);function Y(){const H=v.current;if(H){if(G.current){G.current=!1;return}k.current=H.scrollHeight-H.scrollTop-H.clientHeight<80}}function X(){if(u)return;const H=v.current,D=c[0];if(H&&D){const O=i_(H,D.id);O&&(T.current={id:D.id,top:O.getBoundingClientRect().top-H.getBoundingClientRect().top})}h==null||h()}let B=0;function R(H){return H.kind==="user"?B++:-1}return a.jsx("div",{className:"transcript",ref:v,onScroll:Y,children:a.jsxs("div",{className:"stream",ref:y,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:X,disabled:u,children:u?"Загружаем…":"Показать более раннее"}),c.map(H=>a.jsx(a_,{item:H,userIndex:R(H),onEditMessage:p},H.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:g})),n.map(H=>a.jsx(a_,{item:H,userIndex:R(H),onEditMessage:p},H.id)),s&&a.jsx(sk,{waiting:i,activity:(L=[...n].reverse().find(H=>H.kind==="tool"&&H.result===null))==null?void 0:L.name,responding:n.some(H=>H.kind==="assistant"&&H.streaming)},x)]})})}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(Wc,{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),[x,p]=b.useState(n.text),g=b.useRef(null),_=b.useRef(!1),v=yf("(max-width: 860px)"),y=b.useRef(null);function N(D,O){o({x:D,y:O})}function k(D){D.preventDefault(),N(D.clientX,D.clientY)}function T(D){const O=D.touches[0];if(!O)return;const I={timer:0,x:O.clientX,y:O.clientY,fired:!1};I.timer=window.setTimeout(()=>{I.fired=!0,N(I.x,I.y)},nN),y.current=I}function A(D){const O=y.current,I=D.touches[0];!O||!I||Math.hypot(I.clientX-O.x,I.clientY-O.y)>10&&(window.clearTimeout(O.timer),y.current=null)}function G(D){const O=y.current;O&&(window.clearTimeout(O.timer),O.fired&&D.preventDefault())}function Y(){p(n.text),h(!0)}function X(){h(!1)}function B(){const D=x.trim();if(D===""&&!(n.images&&n.images.length>0))return;const O=i==null?void 0:i(s,D,n.images);if(O instanceof Promise){if(_.current)return;_.current=!0,O.then(I=>{_.current=!1,I&&h(!1)},()=>{_.current=!1});return}O!==!1&&h(!1)}b.useEffect(()=>{const D=g.current;!D||!u||(D.style.height="auto",D.style.height=`${D.scrollHeight}px`)},[x,u]),b.useEffect(()=>{if(!u)return;const D=g.current;D&&(D.focus(),D.setSelectionRange(D.value.length,D.value.length))},[u]);function R(D){if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),X();return}D.key==="Enter"&&!D.shiftKey&&!v&&(D.preventDefault(),B())}const L=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((D,O)=>a.jsx("img",{className:"msg--user__image",src:`data:${D.mediaType};base64,${D.data}`,alt:"Вложение"},O))});if(u){const D=x.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[L,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:g,className:"msg--user__edit-field",value:x,onChange:O=>p(O.target.value),onKeyDown:R,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:X,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:B,disabled:!D,children:"Сохранить"})]})]})]})}const H=[{id:"copy",label:"Копировать",onSelect:()=>void ai(n.text)},...i?[{id:"edit",label:"Изменить",onSelect:Y}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:T,onTouchMove:A,onTouchEnd:G,onTouchCancel:G,children:[L,n.text,c&&a.jsx(Vi,{x:c.x,y:c.y,items:H,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 wf(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 p,g;const h=u.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const x=((g=(p=h.parentElement)==null?void 0:p.querySelector("pre"))==null?void 0:g.textContent)??"";x!==""&&ai(x).then(_=>{if(!_)return;h.textContent=fu,h.setAttribute("aria-label",fu),h.classList.add("copybtn--done");const v=window.setTimeout(()=>{h.isConnected&&(h.textContent=$c,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=`${$c} блок кода`;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=$c,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(Wc,{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:x}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const p=[];for(const g of h){if(typeof g!="object"||g===null)return null;const{label:_,description:v,preview:y}=g;if(typeof _!="string"||typeof v!="string")return null;p.push({label:_,description:v,...typeof y=="string"?{preview:y}:{}})}i.push({question:o,header:typeof u=="string"?u:"",options:p,multiSelect:x===!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 x;return(x=document.querySelector(".main .composer textarea"))==null?void 0:x.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,networkBlocked:o,terminalEnabled:u,onTool:h,onStop:x,onPin:p,onClose:g,onCommand:_,onSend:v,editor:y,footer:N,className:k,children:T}){var E,K,xe,ke,Re;const[A,G]=b.useState(!1),[Y,X]=b.useState(!1),B=((E=s.timelines[n])==null?void 0:E.pending.length)??0;b.useEffect(()=>{B||G(!1)},[B]);const R=s.sessions[n];if(!R)return null;const L=s.timelines[n]??ms,H=s.histories[n]??Ki,D=Yp(H.entries),O=s.capabilities[n],I=R.state==="running"||R.state==="waiting_permission",M=L.pending.length>0,P=R.state==="closed",re=R.state==="error",_e=i.find(me=>me.id===R.workspaceId),we=(O==null?void 0:O.models)??[],q=we.find(me=>me.value===R.model||me.resolvedModel===R.model),$=q!=null&&q.supportsEffort?q.effortLevels.length?q.effortLevels:["low","medium","high"]:[],W=R.provider==="codex"?G_:R.provider==="antigravity"?$_:Vp,Q=!c||P||re||I,ve=(me,He)=>{me==="control.set_model"&&s.send({type:me,sessionId:n,model:He}),me==="control.set_mode"&&s.send({type:me,sessionId:n,mode:He}),me==="control.set_effort"&&s.send({type:me,sessionId:n,effort:He})};return a.jsxs("section",{className:"main session-pane"+(k?` ${k}`:""),"data-provider":R.provider,"aria-label":cn(R),children:[a.jsxs("header",{className:"session-pane__head",children:[a.jsxs("div",{className:"session-pane__identity",children:[a.jsxs("span",{className:"hub-eyebrow",children:[R.provider.toUpperCase()," · ",(_e==null?void 0:_e.name)??"ПРОЕКТ"]}),Y?a.jsx(ma,{value:R.title??"",onCommit:me=>{s.send({type:"session.rename",workspaceId:R.workspaceId,sessionId:n,title:me}),X(!1)},onCancel:()=>X(!1)}):a.jsx("button",{className:"session-pane__title",title:"Переименовать сессию",onClick:()=>X(!0),children:cn(R)})]}),a.jsx("button",{className:"hub-icon-btn"+(R.pinned?" is-pinned":""),title:R.pinned?"Открепить":"Закрепить","aria-label":R.pinned?"Открепить сессию":"Закрепить сессию",onClick:()=>p(R),children:"☆"}),Uc(R)&&a.jsx("button",{className:"hub-icon-btn",title:"Остановить CLI, сохранив разговор","aria-label":"Остановить сессию",onClick:()=>x(R),children:"■"})]}),a.jsxs("div",{className:"session-pane__controls",children:[a.jsxs("span",{className:`session-status session-status--${R.state}`,children:[a.jsx("span",{className:`session-state-dot session-state-dot--${R.state}`}),Uc(R)?"Запущена":P?"Сохранена":"Ошибка"]}),a.jsx("span",{className:"session-pane__activity",children:Ur(R)}),a.jsxs("label",{children:[a.jsx("span",{children:"Модель"}),a.jsxs("select",{"aria-label":`Модель: ${cn(R)}`,disabled:Q||!we.length,value:(q==null?void 0:q.value)??R.model??"",onChange:me=>ve("control.set_model",me.target.value),children:[!q&&a.jsx("option",{value:R.model??"",children:R.model??"Как в CLI"}),we.map(me=>a.jsx("option",{value:me.value,children:me.displayName},me.value))]})]}),$.length>0&&a.jsxs("label",{children:[a.jsx("span",{children:"Усилие"}),a.jsxs("select",{"aria-label":`Усилие: ${cn(R)}`,value:R.effort??"",disabled:Q,onChange:me=>ve("control.set_effort",me.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Как в CLI"}),$.map(me=>a.jsx("option",{children:me},me))]})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Права"}),a.jsxs("select",{"aria-label":`Режим прав: ${cn(R)}`,value:R.permissionMode,disabled:Q,onChange:me=>ve("control.set_mode",me.target.value),children:[!W.some(me=>me.value===R.permissionMode)&&a.jsx("option",{value:R.permissionMode,children:R.permissionMode}),W.map(me=>a.jsxs("option",{value:me.value,children:[me.value," — ",me.hint]},me.value))]})]}),R.provider==="claude"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"session-toggle","aria-pressed":R.thinking,disabled:Q,onClick:()=>s.send({type:"control.set_thinking",sessionId:n,enabled:!R.thinking}),children:"Размышления"}),$.includes("xhigh")&&a.jsx("button",{className:"session-toggle","aria-pressed":R.ultracode,disabled:Q,onClick:()=>s.send({type:"control.set_ultracode",sessionId:n,enabled:!R.ultracode}),children:"Ultracode"}),a.jsx("button",{className:"session-toggle","aria-pressed":R.switchModelsOnFlag,disabled:Q,onClick:()=>s.send({type:"control.set_flag_switch",sessionId:n,enabled:!R.switchModelsOnFlag}),children:"Смена модели по флагу"})]})]}),a.jsxs("nav",{className:"session-pane__tools","aria-label":`Инструменты: ${cn(R)}`,children:[[["files","Файлы"],["search","Поиск"],["git","Git"],["tasks","Ветки задачи"]].map(([me,He])=>a.jsx("button",{title:me==="files"?"Файлы проекта":He,onClick:()=>h(R,me),disabled:P||re,children:He},me)),u&&a.jsx("button",{onClick:()=>h(R,"terminal"),disabled:P||re,children:"Терминал"}),R.provider==="claude"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>h(R,"extensions"),disabled:P||re,children:"Расширения"}),a.jsx("button",{onClick:()=>h(R,"ask"),disabled:P||re,children:"Вопрос на полях"})]}),R.provider!=="antigravity"&&a.jsx("button",{disabled:Q,onClick:()=>s.launchSession(R.workspaceId,R.provider,Yt(R),!0),children:"Ответвить"}),a.jsx("button",{title:"Обновить лимиты и контекст",disabled:!c||P||re,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:((K=s.context[n])==null?void 0:K.tokens)??L.contextTokens,maxTokens:((xe=s.context[n])==null?void 0:xe.maxTokens)??null,fetchedAt:((ke=s.context[n])==null?void 0:ke.fetchedAt)??null}),y??a.jsxs(a.Fragment,{children:[a.jsx(lk,{session:R,items:[...D,...L.items],pendingCount:L.pending.length}),a.jsx(um,{items:L.items,busy:I,waiting:M,sessionId:n,history:D,historyHasMore:U_(H),historyLoading:H.loading,onLoadHistory:()=>s.loadHistory(n,$p(H)),welcome:!P&&!re?a.jsx(kN,{connected:c,workspaceName:_e==null?void 0:_e.name,hasSession:!0,onOpenWorkspace:()=>h(R,"files"),onNewSession:()=>s.launchSession(R.workspaceId,R.provider),onOpenFiles:()=>h(R,"files"),onOpenSettings:()=>h(R,"settings")}):void 0,empty:P?"Разговор сохранён. Продолжите сессию, чтобы восстановить историю и настройки.":void 0,onEditMessage:R.provider==="antigravity"?void 0:(me,He,tt)=>{if(!c||o||P||re)return!1;const ot=()=>s.send({type:"prompt.edit",sessionId:n,userIndex:me,text:He,images:tt});return v?v(R,ot):(ot(),!0)}}),(Re=R.tasks)!=null&&Re.length?a.jsx(y1,{tasks:R.tasks,onStop:me=>s.send({type:"task.stop",sessionId:n,taskId:me})}):null,M&&a.jsxs("button",{className:"session-pane__decision",onClick:()=>G(!0),children:["Нужен ваш ответ · запросов: ",L.pending.length,a.jsx("span",{children:"Рассмотреть →"})]}),P||re?a.jsxs("div",{className:"session-pane__resume",children:[a.jsx("p",{children:P?"Разговор сохранён на диске.":"Связь с CLI прервана."}),a.jsx("button",{className:"btn btn--primary",disabled:!c||s.launchingIds.includes(n),onClick:()=>s.launchSession(R.workspaceId,R.provider,Yt(R),!1,n),children:s.launchingIds.includes(n)?"Восстанавливается…":"Продолжить сессию"})]}):a.jsx(Ey,{className:"composer--session",suspended:s.view!==null||A&&M,disabled:!c,busy:I,commands:(O==null?void 0:O.commands)??[],showAllCommands:R.provider==="codex",sessionTitle:R.title,contextResult:s.contexts[n]??null,draftKey:n,sendBlocked:o,placeholder:R.state==="reconnecting"?"Сообщение отправится после восстановления связи":"Сообщение в эту сессию…",onContextSearch:me=>s.searchSession(n,me),onCommand:me=>me==="fork"?(s.launchSession(R.workspaceId,R.provider,Yt(R),!0),!0):me==="new"||me==="clear"?(s.launchSession(R.workspaceId,R.provider),!0):me==="resume"?(s.setView("command"),!0):me==="stop"?(s.send({type:"control.interrupt",sessionId:n}),!0):me==="exit"||me==="quit"?(x(R),!0):(_==null?void 0:_(R,me))??!1,onEscape:()=>{I&&!M&&s.send({type:"control.interrupt",sessionId:n})},onSend:(me,He)=>{if(!c||o)return!1;const tt=()=>s.send({type:"prompt.send",sessionId:n,text:me,images:He});return v?v(R,tt):(tt(),!0)},onInterrupt:()=>s.send({type:"control.interrupt",sessionId:n})})]}),T,N,A&&M&&xu.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"}),bu=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 as(n){return n?n.type==="tabs"?[n]:[...as(n.first),...as(n.second)]:[]}function si(n){return[...as(n.root),...n.floating.map(s=>s.group)].flatMap(s=>s.tabs)}function _u(n,s){return n?s(n.type==="tabs"?n:{...n,first:_u(n.first,s),second:_u(n.second,s)}):null}function gf(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=gf(n.first,s),c=gf(n.second,s);return i&&c?{...n,first:i,second:c}:i??c}function Ry(n,s,i,c){if(!n)return bu([i]);if(n.id===s){if(c==="center"&&n.type==="tabs")return{...n,tabs:[...n.tabs,i],active:i};const u=bu([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 as(u).some(h=>h.id===s)?Ry(u,s,i,c):u}}function hu(n,s){var p,g;const i=(p=[...as(n.root),...n.floating.map(_=>_.group)].find(_=>_.tabs.includes(s)))==null?void 0:p.id,c=new Set(si(n).filter(_=>_!==s)),o=n.floating.flatMap(_=>{const v=gf(_.group,c);return(v==null?void 0:v.type)==="tabs"?[{..._,group:v}]:[]}),u=gf(n.root,c),h=[...as(u),...o.map(_=>_.group)],x=n.focused===s?((g=h.find(_=>_.id===i)??h[0])==null?void 0:g.active)??null:n.focused;return{...n,root:u,floating:o,focused:x,maximized:n.maximized&&[...as(u),...o.map(_=>_.group)].some(_=>_.id===n.maximized)?n.maximized:null}}function yu(n,s){if(!si(n).includes(s))return n;const i=u=>u.type==="tabs"&&u.tabs.includes(s)?{...u,active:s}:u,c=Math.max(0,...n.floating.map(u=>u.z))+1,o=[...as(n.root),...n.floating.map(u=>u.group)].find(u=>u.tabs.includes(s));return{...n,focused:s,maximized:n.maximized?(o==null?void 0:o.id)??null:null,root:_u(n.root,i),floating:n.floating.map(u=>u.group.tabs.includes(s)?{...u,group:i(u.group),z:c}:u)}}function xf(n,s,i,c){var p;const o=[...as(n.root),...n.floating.map(g=>g.group)].find(g=>g.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 yu(n,s);const u=hu(n,s),h=u.floating.find(g=>g.group.id===i);if(h&&c==="center")return{...u,focused:s,floating:u.floating.map(g=>g===h?{...g,group:{...g.group,tabs:[...g.group.tabs,s],active:s}}:g)};const x=as(u.root).some(g=>g.id===i)?i:((p=as(u.root).at(-1))==null?void 0:p.id)??null;return{...u,root:Ry(u.root,x,s,c),focused:s,maximized:null}}function yp(n,s,i=!1){if(si(n).includes(s)){const u=[...as(n.root),...n.floating.map(h=>h.group)].find(h=>h.tabs.includes(s));return i&&u&&u.tabs.length>1?xf(n,s,u.id,"right"):yu(n,s)}const c=[...as(n.root),...n.floating.map(u=>u.group)],o=c.find(u=>u.tabs.includes(n.focused??""))??c[0];return xf(n,s,(o==null?void 0:o.id)??null,i?"right":"center")}function Dy(n,s,i=40,c=30){const o=hu(n,s);return{...o,focused:s,maximized:null,floating:[...o.floating,{group:bu([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((p,g,_)=>Dy(p,g,24+_%4*34,20+_%4*30),c),preset:s};if(s==="tabs")return{...c,root:bu(i)};const o=(p,g)=>p.length===1?p[0]:Hp(p[0],o(p.slice(1),g),g,1/p.length),u=i.map(p=>bu([p]));if(s!=="grid")return{...c,root:o(u,s==="columns"?"row":"column")};const h=Math.ceil(Math.sqrt(u.length)),x=[];for(let p=0;p<u.length;p+=h)x.push(o(u.slice(p,p+h),"row"));return{...c,root:o(x,"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(g,_=0){if(!g||typeof g!="object"||_>24)return null;const v=g;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(T=>typeof T=="string"&&!i.has(T)&&!!i.add(T));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),N=o(v.second,_+1);return y&&N?{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:N}:y??N}const u=o(s.root),h=(g,_,v,y)=>typeof g=="number"&&Number.isFinite(g)?Math.max(v,Math.min(y,g)):_,x=(Array.isArray(s.floating)?s.floating:[]).flatMap(g=>{if(!g||typeof g!="object")return[];const _=o(g.group);return(_==null?void 0:_.type)==="tabs"?[{group:_,x:h(g.x,30,0,5e3),y:h(g.y,30,0,5e3),width:h(g.width,580,280,3e3),height:h(g.height,560,280,2400),z:h(g.z,1,0,1e6)}]:[]}),p=[...as(u),...x.map(g=>g.group)].flatMap(g=>g.tabs);return{version:1,root:u,floating:x,focused:p.includes(s.focused??"")?s.focused:p[0]??null,maximized:[...as(u),...x.map(g=>g.group)].some(g=>g.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,onClose:c,renderSession:o}){const{layout:u}=n,h=b.useRef(null),x=b.useRef(null),[p,g]=b.useState(null),[_,v]=b.useState({width:1e3,height:650}),[y,N]=b.useState(""),[k,T]=b.useState(!1),A=new Set(i),G=u.focused&&A.has(u.focused)?u.focused:i[0]??null;b.useEffect(()=>{const D=h.current;if(!D)return;const O=new ResizeObserver(()=>v({width:D.clientWidth,height:D.clientHeight}));return O.observe(D),()=>O.disconnect()},[]),b.useEffect(()=>()=>document.body.classList.remove("is-docking"),[]);const Y=D=>as(D).some(O=>O.tabs.some(I=>A.has(I)));function X(D,O,I){var P;if(D.button!==0)return;const M=(P=D.currentTarget.closest("[data-dock-group]"))==null?void 0:P.getBoundingClientRect();M&&(n.activate(O),x.current={id:O,startX:D.clientX,startY:D.clientY,offsetX:D.clientX-M.x,offsetY:D.clientY-M.y,floating:I,moved:!1,preview:null},D.currentTarget.setPointerCapture(D.pointerId))}function B(D){var re,_e;const O=x.current,I=(re=h.current)==null?void 0:re.getBoundingClientRect();if(!O||!I||!O.moved&&Math.hypot(D.clientX-O.startX,D.clientY-O.startY)<6)return;O.moved=!0,document.body.classList.add("is-docking");let M=null;const P=Array.from(h.current.querySelectorAll("[data-dock-group]")).reverse();for(const we of P){if(((_e=O.floating)==null?void 0:_e.group.id)===we.dataset.dockGroup)continue;const q=we.getBoundingClientRect(),$=(D.clientX-q.x)/q.width,W=(D.clientY-q.y)/q.height;if($<0||$>1||W<0||W>1)continue;const Q=[{side:"left",value:$},{side:"right",value:1-$},{side:"top",value:W},{side:"bottom",value:1-W}].sort((E,K)=>E.value-K.value),ve=!we.classList.contains("dock-group--floating")&&Q[0].value<.24?Q[0].side:"center";M={groupId:we.dataset.dockGroup,side:ve,x:q.x-I.x+(ve==="right"?q.width/2:0),y:q.y-I.y+(ve==="bottom"?q.height/2:0),width:ve==="left"||ve==="right"?q.width/2:q.width,height:ve==="top"||ve==="bottom"?q.height/2:q.height};break}O.preview=M,g(M),O.floating&&!M&&n.updateFloating(O.floating.group.id,{x:Math.max(0,Math.min(_.width-100,D.clientX-I.x-O.offsetX)),y:Math.max(0,Math.min(_.height-40,D.clientY-I.y-O.offsetY))})}function R(D,O=!1){const I=x.current;if(x.current=null,g(null),document.body.classList.remove("is-docking"),D.currentTarget.hasPointerCapture(D.pointerId)&&D.currentTarget.releasePointerCapture(D.pointerId),!(!(I!=null&&I.moved)||O)){if(I.preview)n.move(I.id,I.preview.groupId,I.preview.side);else if(!I.floating){const M=h.current.getBoundingClientRect();n.float(I.id,Math.max(0,D.clientX-M.x-120),Math.max(0,D.clientY-M.y-15))}}}function L(D,O){const I=D.tabs.filter(re=>A.has(re));if(!I.length)return null;const M=I.includes(D.active)?D.active:I[0],P=u.maximized===D.id;return a.jsxs("section",{"data-dock-group":D.id,"data-active-session":M,"data-selected":I.includes(G??""),className:"dock-group"+(O?" dock-group--floating":"")+(P?" dock-group--maximized":""),style:O&&!P?{left:Math.min(O.x,Math.max(0,_.width-Math.min(O.width,_.width))),top:Math.min(O.y,Math.max(0,_.height-Math.min(O.height,_.height))),width:Math.min(O.width,_.width),height:Math.min(O.height,_.height),zIndex:10+O.z}:void 0,onPointerDownCapture:()=>{G!==M&&n.activate(M)},children:[a.jsxs("div",{className:"dock-group__head",onDoubleClick:re=>{re.target.closest("[data-window-action]")||n.maximize(D.id)},children:[O&&a.jsx(MN,{window:O,bounds:_,onMove:n.updateFloating}),a.jsx("div",{className:"dock-tabs",role:"tablist","aria-label":"Сессии группы",children:I.map(re=>a.jsxs("div",{className:"dock-tab"+(re===M?" is-active":""),children:[a.jsxs("button",{role:"tab","aria-selected":re===M,"aria-controls":`session-panel-${re}`,"data-drag-session":re,title:`${cn(s[re])} · ${Ur(s[re])}. Перетащите для стыковки.`,onClick:()=>n.activate(re),onPointerDown:_e=>X(_e,re,O),onPointerMove:B,onPointerUp:R,onPointerCancel:_e=>R(_e,!0),onLostPointerCapture:_e=>{x.current&&R(_e,!0)},onKeyDown:_e=>{_e.key==="Escape"&&(x.current=null,g(null),document.body.classList.remove("is-docking"))},children:[a.jsx("span",{className:`session-state-dot session-state-dot--${s[re].state}`,"aria-hidden":"true"}),a.jsx("span",{children:cn(s[re])})]}),a.jsx("button",{className:"dock-tab__close","data-window-action":!0,"aria-label":`Закрыть вкладку: ${cn(s[re])}`,onClick:()=>c(re),children:"×"})]},re))}),a.jsxs("div",{className:"dock-group__actions",children:[a.jsx("button",{"data-window-action":!0,className:"dock-action",title:O?"Прикрепить окно":"Сделать плавающим окном","aria-label":O?"Прикрепить окно":"Сделать плавающим окном",onClick:()=>O?n.attachFloating(D.id):n.float(M),children:"▣"}),a.jsx("button",{"data-window-action":!0,className:"dock-action",title:P?"Восстановить размер окна":"Развернуть окно","aria-label":P?"Восстановить размер окна":"Развернуть окно",onClick:()=>n.maximize(D.id),children:P?"❐":"□"})]})]}),a.jsx("div",{className:"dock-group__body",role:"tabpanel",id:`session-panel-${M}`,"data-session-id":M,children:o(M)}),O&&!P&&a.jsx(AN,{window:O,bounds:_,onResize:n.updateFloating})]},D.id)}function H(D){return!D||!Y(D)?null:D.type==="tabs"?L(D):Y(D.first)?Y(D.second)?a.jsxs("div",{className:`dock-split dock-split--${D.axis}`,children:[a.jsx("div",{className:"dock-split__child",style:{flexGrow:D.ratio},children:H(D.first)}),a.jsx(CN,{axis:D.axis,ratio:D.ratio,onResize:O=>n.resizeSplit(D.id,O)}),a.jsx("div",{className:"dock-split__child",style:{flexGrow:1-D.ratio},children:H(D.second)})]},D.id):H(D.first):H(D.second)}return a.jsxs("div",{className:"session-workspace",children:[a.jsxs("div",{className:"dock-toolbar","aria-label":"Режим просмотра сессий",children:[a.jsx("span",{children:"Рабочая область"}),a.jsxs("select",{"aria-label":"Раскладка окон",value:u.preset,onChange:D=>n.arrange(D.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",{"aria-label":"Перейти к открытой сессии",value:G??"",onChange:D=>n.activate(D.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Нет открытых сессий"}),i.map(D=>a.jsx("option",{value:D,children:cn(s[D])},D))]}),n.saved.length>0&&a.jsxs("select",{"aria-label":"Сохранённая рабочая область",value:"",onChange:D=>n.restore(D.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Сохранённые области…"}),n.saved.map(D=>a.jsx("option",{children:D},D))]}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>T(!k),children:"Сохранить раскладку"}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>n.arrange("grid"),title:"Разместить открытые сессии без перекрытий",children:"Уместить"}),a.jsx("span",{className:"dock-toolbar__hint",children:"Тяните вкладку к краю окна или в центр группы"})]}),k&&a.jsxs("form",{className:"dock-save",onSubmit:D=>{D.preventDefault(),n.save(y),T(!1),N("")},children:[a.jsx("input",{className:"hub-input",autoFocus:!0,"aria-label":"Название раскладки",placeholder:"Название рабочей области",value:y,onChange:D=>N(D.target.value)}),a.jsx("button",{className:"btn",disabled:!y.trim(),children:"Сохранить"})]}),a.jsxs("div",{className:"conversation-board dock-board",ref:h,"aria-label":"Открытые сессии",children:[H(u.root),u.floating.map(D=>L(D.group,D)),!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:"Обычное открытие добавляет вкладку. «Открыть параллельно» создаёт соседнее окно. Любую вкладку можно открепить и пристыковать обратно."})]}),p&&a.jsx("div",{className:"dock-preview",style:{left:p.x,top:p.y,width:p.width,height:p.height},children:a.jsx("span",{children:EN[p.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,x=u.key==="ArrowDown"?24:u.key==="ArrowUp"?-24:0;(h||x)&&(u.preventDefault(),o(n.width+h,n.height+x))},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(),x=u.currentTarget.closest(".dock-board").getBoundingClientRect();c.current={x:u.clientX,y:u.clientY,left:h.x-x.x,top:h.y-x.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,x=u.key==="ArrowDown"?24:u.key==="ArrowUp"?-24:0;(h||x)&&(u.preventDefault(),o(n.x+h,n.y+x))},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 p=JSON.parse(localStorage.getItem("ether:dock-presets")??"{}");return p&&typeof p=="object"?Object.keys(p):[]}catch{return[]}}),h=n.join("|");b.useEffect(()=>{c(p=>{let g=p;const _=v=>{const y=new Set;let N=v;for(;s[N]&&!y.has(N);)y.add(N),N=s[N];return N};si(p).some(v=>_(v)!==v)&&(g={...g,focused:g.focused?_(g.focused):null,root:_u(g.root,v=>v.type==="tabs"?{...v,tabs:v.tabs.map(_),active:_(v.active)}:v),floating:g.floating.map(v=>({...v,group:{...v.group,tabs:v.group.tabs.map(_),active:_(v.group.active)}}))});for(const v of si(g))n.includes(v)||(g=hu(g,v));for(const v of n)si(g).includes(v)||(g=yp(g,v,g.preset!=="tabs"));return g})},[h,s]),b.useEffect(()=>{try{localStorage.setItem(Ly,JSON.stringify(i))}catch{}},[i]);const x=b.useCallback((p,g=!1)=>c(_=>({...yp(_,p,g),preset:g?"custom":_.preset})),[]);return{layout:i,saved:o,open:x,activate:p=>c(g=>yu(g,p)),close:p=>c(g=>hu(g,p)),move:(p,g,_)=>c(v=>({...xf(v,p,g,_),preset:"custom"})),float:(p,g,_)=>c(v=>({...Dy(v,p,g,_),preset:"custom"})),attachFloating:p=>c(g=>{var N,k;const _=g.floating.find(T=>T.group.id===p);if(!_)return g;let v=g,y=((N=as(v.root).at(-1))==null?void 0:N.id)??null;for(const[T,A]of _.group.tabs.entries())v=xf(v,A,y,T===0?"right":"center"),y=((k=as(v.root).find(G=>G.tabs.includes(A)))==null?void 0:k.id)??null;return v}),resizeSplit:(p,g)=>c(_=>({..._,root:_u(_.root,v=>v.type==="split"&&v.id===p?{...v,ratio:Math.max(.1,Math.min(.9,g))}:v)})),updateFloating:(p,g)=>c(_=>({..._,floating:_.floating.map(v=>v.group.id===p?{...v,...g}:v)})),maximize:p=>c(g=>({...g,maximized:g.maximized===p?null:p})),arrange:p=>c(g=>{if(p==="custom")return g;const _=SN(si(g),p);return g.focused?yu(_,g.focused):_}),save:p=>{const g=p.trim().slice(0,64);if(g)try{const _=JSON.parse(localStorage.getItem("ether:dock-presets")??"{}");localStorage.setItem("ether:dock-presets",JSON.stringify({..._,[g]:i})),u(Object.keys({..._,[g]:i}))}catch{}},restore:p=>{try{const g=Oy(JSON.parse(localStorage.getItem("ether:dock-presets")??"{}")[p]),_=new Set(n);let v=g;for(const y of si(v))_.has(y)||(v=hu(v,y));for(const y of n)si(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:x,connected:p,status:g,hasConversations:_,onOpenSession:v,onSelectWorkspace:y,onNewSession:N,onOpenWorkspace:k,onSettings:T,onAccount:A,onRelay:G,onTheme:Y,onPin:X,onManageProject:B}){const[R,L]=b.useState(""),[H,D]=b.useState(!0),[O,I]=b.useState(!1),[M,P]=b.useState(()=>{try{return localStorage.getItem("ether:session-list")==="live"?"live":"all"}catch{return"all"}}),re=s.find(Q=>Q.id===i),_e=Q=>o==="all"||Q.provider===o,we=n.allSessions.filter(Q=>_e(Q)&&(!i||Q.workspaceId===i)),q=we.filter(Q=>{var ve;return(h==="sessions"&&M==="live"?Uc(Q):O?!!Q.archivedAt:h==="pinned"||!Q.archivedAt)&&(h!=="pinned"||Q.pinned)&&`${cn(Q)} ${((ve=s.find(E=>E.id===Q.workspaceId))==null?void 0:ve.name)??""}`.toLocaleLowerCase().includes(R.toLocaleLowerCase())}),$=s.filter(Q=>`${Q.name} ${Q.path}`.toLocaleLowerCase().includes(R.toLocaleLowerCase())),W=o==="all"?c:c.filter(Q=>Q===o);return a.jsxs("section",{className:"workspace-library"+(_?" workspace-library--compact":""),"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:p?"dot dot--on":"dot"}),p?"Подключено":g]}),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(_e).length>0&&a.jsx("span",{className:"hub-count",children:n.attention.filter(_e).length})]}),a.jsx("button",{title:"Аккаунт CLI",onClick:A,children:"Аккаунт"}),a.jsx("button",{title:"Удалённый доступ",onClick:G,children:"Доступ"}),a.jsx("button",{title:"Переключить тему",onClick:Y,children:"◐"}),a.jsx("button",{title:"Настройки приложения",onClick:T,children:"Настройки"})]})]}),a.jsxs("div",{className:"workspace-library__toolbar",children:[a.jsx("nav",{className:"workspace-library__tabs","aria-label":"Разделы рабочего пространства",children:[["projects","Проекты"],["sessions","Сессии"],["pinned","Закрепы"]].map(([Q,ve])=>a.jsx("button",{"aria-pressed":h===Q&&H,onClick:()=>{x(Q),D(h===Q?!H:!0),L(""),I(!1)},children:ve},Q))}),a.jsxs("select",{"aria-label":"Фильтр по CLI",value:o,onChange:Q=>u(Q.target.value),children:[a.jsx("option",{value:"all",children:"Все CLI"}),["codex","claude","antigravity"].map(Q=>a.jsx("option",{value:Q,children:o_[Q]},Q))]}),h!=="projects"&&a.jsxs("select",{"aria-label":"Фильтр по проекту",value:i??"",onChange:Q=>y(Q.target.value),children:[a.jsx("option",{value:"",children:"Все проекты"}),s.map(Q=>a.jsx("option",{value:Q.id,children:Q.name},Q.id))]}),a.jsx("span",{className:"workspace-library__spacer"}),a.jsx("button",{className:"btn btn--ghost",disabled:!p,onClick:k,children:"+ Проект"}),re&&a.jsx(mf,{disabled:!p||!W.length,providers:W,onStart:Q=>N(re.id,Q)})]}),H&&a.jsxs("div",{className:"workspace-library__browser",children:[h==="sessions"&&a.jsxs("nav",{className:"session-list-modes","aria-label":"Какие сессии показывать",children:[a.jsxs("button",{"aria-pressed":M==="all",onClick:()=>{P("all"),I(!1);try{localStorage.setItem("ether:session-list","all")}catch{}},children:["Все сессии ",a.jsx("span",{children:we.filter(Q=>!Q.archivedAt).length})]}),a.jsxs("button",{"aria-pressed":M==="live",onClick:()=>{P("live"),I(!1);try{localStorage.setItem("ether:session-list","live")}catch{}},children:["Запущенные ",a.jsx("span",{children:we.filter(Uc).length})]})]}),a.jsxs("div",{className:"workspace-library__search",children:[a.jsx("input",{className:"hub-input","aria-label":h==="projects"?"Найти проект":"Найти сессию",placeholder:h==="projects"?"Название или путь проекта…":"Название сессии или проекта…",value:R,onChange:Q=>L(Q.target.value)}),h!=="projects"&&!(h==="sessions"&&M==="live")&&a.jsx("button",{className:"btn btn--ghost","aria-pressed":O,onClick:()=>I(!O),children:"Архив"}),h==="projects"&&a.jsx("button",{className:"btn btn--ghost",onClick:()=>B(null),children:"Папки и архив"}),a.jsx("button",{className:"hub-icon-btn",title:"Обновить",onClick:n.refresh,disabled:!p,children:"↻"})]}),h==="projects"?a.jsxs("div",{className:"workspace-projects",children:[$.map(Q=>{const ve=n.allSessions.filter(E=>E.workspaceId===Q.id&&!E.archivedAt&&_e(E));return a.jsxs("article",{className:"workspace-project",children:[a.jsxs("button",{className:"workspace-project__open",onClick:()=>{y(Q.id),x("sessions")},children:[a.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),a.jsx("strong",{children:Q.name}),a.jsx("small",{title:Q.path,children:Q.path}),a.jsxs("span",{children:[ve.length," сессий · ",ve.filter(Uc).length," запущено"]})]}),a.jsxs("div",{className:"workspace-project__actions",children:[a.jsx(mf,{disabled:!p||!W.length,providers:W,onStart:E=>N(Q.id,E)}),a.jsx("button",{className:"hub-icon-btn",title:"Папки и управление проектом",onClick:()=>{y(Q.id),B(Q.id)},children:"⋯"})]})]},Q.id)}),!$.length&&a.jsx("p",{className:"hub-muted",children:"Проекты не найдены. Откройте папку проекта или измените фильтр CLI."})]}):a.jsxs("div",{className:"workspace-sessions",children:[q.map(Q=>{var ve;return a.jsxs("article",{className:`workspace-session workspace-session--${Q.state}`,"data-session-state":Q.state,children:[a.jsxs("button",{className:"workspace-session__open",onClick:()=>v(Q),children:[a.jsxs("span",{className:"hub-eyebrow",children:[o_[Q.provider]," · ",(ve=s.find(E=>E.id===Q.workspaceId))==null?void 0:ve.name]}),a.jsx("strong",{children:cn(Q)}),a.jsxs("small",{children:[a.jsx("span",{className:`session-state-dot session-state-dot--${Q.state}`}),Uc(Q)?"Запущена":Q.state==="closed"?"Сохранена":"Остановлена"," · ",Ur(Q)]})]}),a.jsx("button",{className:"workspace-session__pin"+(Q.pinned?" is-pinned":""),"aria-label":`${Q.pinned?"Открепить":"Закрепить"}: ${cn(Q)}`,title:Q.pinned?"Открепить":"Закрепить",onClick:()=>X(Q),children:"☆"}),a.jsx("button",{className:"hub-icon-btn","aria-label":`Открыть параллельно: ${cn(Q)}`,title:"Открыть в параллельном просмотре",onClick:()=>v(Q,!0),children:"◧"})]},Q.id)}),!q.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:x=!0,showThinking:p=!0,className:g,onModel:_,onEffort:v,onUltracode:y,onThinking:N,onSwitchOnFlag:k}){const[T,A]=b.useState(!1),[G,Y]=b.useState(0),X=b.useRef(null),B=b.useRef(null),R=n.find(I=>I.value===s)??null,L=R&&R.supportsEffort?R.effortLevels.length>0?R.effortLevels:zN:[],H=L.includes("xhigh");b.useEffect(()=>{if(!T)return;const I=n.findIndex(M=>M.value===s);Y(I===-1?0:I)},[T]),b.useEffect(()=>{if(!T)return;function I(M){var P;(P=X.current)!=null&&P.contains(M.target)||A(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[T]),b.useEffect(()=>{var I,M;T&&((M=(I=B.current)==null?void 0:I.querySelector(".is-cursor"))==null||M.scrollIntoView({block:"nearest"}))},[T,G]);function D(I){A(!1),I.value!==s&&_(I.value)}function O(I){if(I.key==="Escape"){if(!T)return;I.preventDefault(),I.stopPropagation(),A(!1);return}if(I.key==="ArrowDown"||I.key==="ArrowUp"){if(I.preventDefault(),!T)return A(!0);if(n.length===0)return;const M=I.key==="ArrowDown"?1:n.length-1;return Y(P=>(P+M)%n.length)}if(I.key==="Enter"||I.key===" "){if(I.preventDefault(),!T)return A(!0);const M=n[G];M&&D(M)}}return a.jsxs("div",{ref:X,className:"select"+(T?" select--open":"")+(g?` ${g}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":T,onClick:()=>A(I=>!I),onKeyDown:O,children:[(R==null?void 0:R.displayName)??s?a.jsx("span",{className:"select__value",children:(R==null?void 0:R.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):L.length>0&&i&&a.jsx("span",{className:"select__suffix",children:i}),a.jsx(IN,{})]}),T&&a.jsxs("div",{ref:B,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((I,M)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":I.value===s,className:"select__option"+(M===G?" is-cursor":"")+(I.value===s?" is-on":""),onMouseEnter:()=>Y(M),onClick:()=>D(I),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:I.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:I.displayName}),I.description&&a.jsx("span",{className:"select__hint",children:I.description})]},I.value)),L.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:L.map(I=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":I===i,className:I===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>v(I),children:I},I))})]}),H&&x&&a.jsx(vp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),p&&(R==null?void 0:R.supportsThinking)!==!1&&a.jsx(vp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>N(!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:x,onAskAgent:p,onInterrupt:g,onSubmit:_,onCreate:v,onClose:y}){const[N,k]=b.useState("open"),[T,A]=b.useState(""),[G,Y]=b.useState(!1),[X,B]=b.useState(""),[R,L]=b.useState(""),[H,D]=b.useState({git:!0,claudeMd:!0,agentsMd:!0,readme:!0}),O=T.trim(),I=O!=="",M=X.trim(),P=R.trim(),re=M!==""&&P!=="";b.useEffect(()=>{X===""&&u.length>0&&B(u[0])},[u]);const _e=b.useRef(x);_e.current=x,b.useEffect(()=>{if(N!=="open")return;const W=T.trim(),Q=setTimeout(()=>_e.current(W),200);return()=>clearTimeout(Q)},[T,N]);function we(){I&&_(O)}function q(){re&&v(M,P,H)}function $(){I&&(Y(!0),p(O))}return h?a.jsxs(gs,{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(W=>a.jsx("li",{children:W},W))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(gs,{title:"Новый проект",className:G&&N==="open"?"modal--wide":void 0,onClose:y,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:y,children:"Отмена"}),N==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:g,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!I,onClick:$,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!I,onClick:we,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!re,onClick:q,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(u_,{label:"Открыть",on:N==="open",onClick:()=>k("open")}),a.jsx(u_,{label:"Создать",on:N==="create",onClick:()=>k("create")})]}),N==="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:T,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:W=>A(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),we())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(W=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:W.open,title:W.open?"Этот проект уже открыт":W.path,onClick:()=>A(W.path),onDoubleClick:()=>_(W.path),children:[a.jsx("span",{className:"find__name",children:W.name}),a.jsx("span",{className:"find__path",children:W.path}),a.jsx("span",{className:"find__note",children:qN(W)})]})},W.path))}),n.length===0&&I&&!s&&!G&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),G&&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:X,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:W=>B(W.target.value)}),u.length>0&&a.jsx("div",{className:"newproj__roots",children:u.map(W=>a.jsx("button",{type:"button",className:W===M?"newproj__root is-on":"newproj__root",title:W,onClick:()=>B(W),children:BN(W)},W))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:R,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:W=>L(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),q())}}),a.jsx("p",{className:"newproj__preview",children:re?HN(M,P):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(Zd,{label:"AGENTS.md",desc:"инструкции проекта для Codex",on:H.agentsMd??!1,onToggle:()=>D(W=>({...W,agentsMd:!W.agentsMd}))}),a.jsx(Zd,{label:"git init",desc:"панель истории работает сразу",on:H.git,onToggle:()=>D(W=>({...W,git:!W.git}))}),a.jsx(Zd,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:H.claudeMd,onToggle:()=>D(W=>({...W,claudeMd:!W.claudeMd}))}),a.jsx(Zd,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:H.readme,onToggle:()=>D(W=>({...W,readme:!W.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 Zd({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[x,...p]=o.parents;s[h]=x??null;const g=[];x!==void 0&&g.push({from:h,to:h});for(const y of p){let N=s.indexOf(y);N===-1&&(N=d_(s),s[N]=y),g.push({from:h,to:N})}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 N=u[y];!N||N===o.hash||y===h||s[y]===N&&v.push(y)}VN(s),c=Math.max(c,s.length,h+1),i.push({commit:o,col:h,up:_,down:g,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:x,onPush:p,onPull:g,onPublish:_,onConnectRemote:v,onDismissResult:y,onClose:N,zoomed:k,onToggleZoom:T}){const A=YN((s==null?void 0:s.commits)??[]),G=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(Y=>({value:Y.name,label:Y.name,hint:Y.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:Y=>{T&&(Y.target.closest("button")||T())},children:[a.jsx(tS,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:u,children:"↻"}),T&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:T,children:a.jsx(to,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:N,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(Gl,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:G,onChange:Y=>{Y&&x(Y,`ветку ${Y}`)}}),a.jsx(Wc,{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:p,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:()=>g(!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:()=>g(!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(Y=>cS(Y.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(Y=>a.jsx(PN,{row:Y,columns:A.columns,head:Y.commit.hash===s.head,local:s.hasRemote&&!Y.commit.pushed,active:c===Y.commit.hash,onOpen:()=>h(Y.commit.hash)},Y.commit.hash)),A.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(Ir,{result:i,onDismiss:y})]})}const su=50,f_=13,FN=500;function PN({row:n,columns:s,head:i,local:c,active:o,onOpen:u}){const{commit:h}=n,x=h.refs.map(iS).filter(Boolean),[p,g]=b.useState(null),_=b.useRef(null);function v(T){const A=T.touches[0];if(!A)return;const G={timer:0,x:A.clientX,y:A.clientY,fired:!1};G.timer=window.setTimeout(()=>{G.fired=!0,g({x:G.x,y:G.y})},FN),_.current=G}function y(T){const A=_.current,G=T.touches[0];!A||!G||Math.hypot(G.clientX-A.x,G.clientY-A.y)>10&&(window.clearTimeout(A.timer),_.current=null)}function N(T){const A=_.current;A&&(window.clearTimeout(A.timer),A.fired&&T.preventDefault())}function k(){const T=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void ai(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void ai(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void ai(h.subject)}],A=new Set;for(const G of h.refs){const Y=G.startsWith("tag: "),X=rS(G);!X||A.has(X)||(A.add(X),T.push({id:`ref:${X}`,label:Y?"Копировать тег":"Копировать ветку",hint:X,onSelect:()=>void ai(X)}))}return T}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var T;if((T=_.current)!=null&&T.fired){_.current=null;return}u()},onContextMenu:T=>{T.preventDefault(),g({x:T.clientX,y:T.clientY})},onTouchStart:v,onTouchMove:y,onTouchEnd:N,onTouchCancel:N,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:[x.map(T=>a.jsx("span",{className:"gitrow__ref",children:T},T)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",uS(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),p&&a.jsx(Vi,{x:p.x,y:p.y,items:k(),onClose:()=>g(null)})]})}function JN({row:n,columns:s,head:i,local:c}){const o=s*f_+6,u=su/2,h=g=>8+Math.min(g,hm-1)*f_,x=c?"3.5 2.5":void 0,p=Fd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:su,viewBox:`0 0 ${o} ${su}`,"aria-hidden":"true",children:[n.through.map(g=>a.jsx("line",{x1:h(g),y1:0,x2:h(g),y2:su,style:{stroke:Fd(g)}},`t${g}`)),n.up.map((g,_)=>a.jsx("path",{d:`M${h(g.from)} 0 L${h(g.from)} ${u-12} L${h(g.to)} ${u}`,fill:"none",style:{stroke:Fd(g.from),strokeDasharray:x}},`u${_}`)),n.down.map((g,_)=>a.jsx("path",{d:`M${h(g.from)} ${u} L${h(g.to)} ${u+12} L${h(g.to)} ${su}`,fill:"none",style:{stroke:Fd(g.to),strokeDasharray:x}},`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:p,fill:c?void 0:p}})]})}function Fd(n){return`var(--lane-${n%hm})`}function WN({detail:n,local:s,onCheckout:i,onClose:c}){const o=n.hash==="";return a.jsxs(gs,{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(Wc,{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(Wc,{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:x,onSaveToken:p,onPublish:g,onDismissResult:_,onClose:v}){var W;const[y,N]=b.useState(()=>p_(c)),[k,T]=b.useState(""),[A,G]=b.useState(""),[Y,X]=b.useState(!0),[B,R]=b.useState("Первый коммит"),[L,H]=b.useState(null),[D,O]=b.useState("");b.useEffect(()=>{!k&&s.length>0&&T(s[0].login)},[k,s]),b.useEffect(()=>{i&&L===null&&H(new Set(i.files))},[i,L]);const I=(n==null?void 0:n.connected)===!0,M=s.map(Q=>({value:Q.login,label:Q.login,hint:Q.kind==="org"?"организация":void 0})),P=b.useMemo(()=>{if(!i)return[];const Q=D.trim().toLowerCase();return Q?i.files.filter(ve=>ve.toLowerCase().includes(Q)):i.files},[i,D]),re=(L==null?void 0:L.size)??0,_e=I&&y.trim()!==""&&k!==""&&u===""&&(o||re>0);function we(Q){H(ve=>{const E=new Set(ve??[]);return E.has(Q)?E.delete(Q):E.add(Q),E})}function q(Q){H(ve=>{const E=new Set(ve??[]);for(const K of P)Q?E.add(K):E.delete(K);return E})}function $(){if(!_e)return;const Q=(i==null?void 0:i.files)??[];g({owner:k,name:y.trim(),description:A.trim(),private:Y,include:o?[]:Q.filter(ve=>L==null?void 0:L.has(ve)),ignore:o?[]:Q.filter(ve=>!(L!=null&&L.has(ve))),message:o?"":B.trim()||"Первый коммит"})}return a.jsxs(gs,{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:!_e,onClick:$,children:u||"Опубликовать"})]}),children:[a.jsx(hS,{status:n,onRefreshStatus:x,onSaveToken:p}),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:Q=>N(p_(Q.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(Gl,{className:"settings__select",value:k,options:M,onChange:T,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((W=s[0])==null?void 0:W.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:Q=>G(Q.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:Y,onClick:()=>X(!0)}),a.jsx(m_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!Y,onClick:()=>X(!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:[re," из ",i.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>q(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>q(!1),children:"Снять все"})]}),i.files.length>8&&a.jsx("input",{className:"input publish__filter",value:D,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:Q=>O(Q.target.value)}),a.jsx("div",{className:"publish__filelist",children:P.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):P.map(Q=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(L==null?void 0:L.has(Q))===!0,className:"publish__file",onClick:()=>we(Q),children:[a.jsx("span",{className:"publish__box"+(L!=null&&L.has(Q)?" is-on":""),"aria-hidden":"true",children:(L==null?void 0:L.has(Q))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:Q})]},Q))}),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:B,onChange:Q=>R(Q.target.value)})]})]})]}),a.jsx(Ir,{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(x=>!x),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(""),x=/^(https?|ssh|git):\/\/\S+/i.test(u.trim())||/^[\w.-]+@[\w.-]+:.+/.test(u.trim());return a.jsxs(gs,{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:!x||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:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&x&&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(Ir,{result:s,onDismiss:c})]})}function bS({open:n,items:s,busy:i,ready:c,sendBlocked:o,commands:u,contextResult:h,draftKey:x,models:p,model:g,effort:_,ultracode:v,thinking:y,switchOnFlag:N,onContextSearch:k,onCommand:T,onModel:A,onEffort:G,onUltracode:Y,onThinking:X,onSwitchOnFlag:B,onAsk:R,onInterrupt:L,onReset:H,onClose:D,zoomed:O,onToggleZoom:I}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(O?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:M=>{I&&(M.target.closest("button")||I())},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:H,children:"↻"}),I&&a.jsx("button",{className:"sidepane__btn",title:O?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":O?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":O,onClick:I,children:a.jsx(to,{active:O})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),p.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(zy,{className:"select--compact",models:p,value:g,effort:_,ultracode:v,thinking:y,switchOnFlag:N,onModel:A,onEffort:G,onUltracode:Y,onThinking:X,onSwitchOnFlag:B}),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:x?`side:${x}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:T,onSend:R,onInterrupt:L,onEscape:i?L:D})]})}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:x,actions:p,onTab:g,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(gs,{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:()=>g(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:x,actions:p}),n==="plugins"&&a.jsx(ES,{plugins:i,marketplaces:c,actions:p}),n==="catalog"&&a.jsx(TS,{catalog:o,hasMarketplaces:c.length>0,actions:p,onMarketplaces:()=>g("plugins")}),a.jsx(Ir,{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 x=(s==null?void 0:s.name)===h.name?s:null,p=x!==null&&x.active&&x.url==="",g=x!==null&&x.active&&x.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:g?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:p,onClick:()=>c.mcpAuth(h.name),children:p?"Запускаем вход…":g?"Начать заново":"Авторизовать"}),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:"Удалить"})]}),x&&a.jsx(jS,{auth:x,remote:i,actions:c})]},h.name)})}),o?a.jsx(NS,{onCancel:()=>u(!1),onSubmit:(h,x)=>{c.mcpAdd(h,x),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 p=c.trim();p!==""&&(i.mcpAuthCallback(n.name,p),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:p=>o(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.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 — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),x=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:"На этом компьютере окно обновится само, как только вы войдёте."})]}),x,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,x]=b.useState(""),[p,g]=b.useState(""),[_,v]=b.useState(""),y=o==="stdio",N=i.trim()!==""&&(y?h.trim()!=="":p.trim()!=="");function k(){if(N)if(y){const[T,...A]=SS(h);n(i.trim(),{transport:"stdio",command:T??"",args:A,env:g_(_)})}else n(i.trim(),{transport:o,url:p.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:T=>c(T.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Gl,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:T=>u(T)}),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:T=>x(T.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:p,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:T=>g(T.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:T=>v(T.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!N,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 lu=30;function TS({catalog:n,hasMarketplaces:s,actions:i,onMarketplaces:c}){const[o,u]=b.useState(""),[h,x]=b.useState(""),[p,g]=b.useState(lu),[_,v]=b.useState(""),y=b.useMemo(()=>[...new Set(n.map(T=>T.category).filter(Boolean))].sort(),[n]),N=b.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(T=>h&&T.category!==h?!1:k?`${T.name} ${T.displayName} ${T.description} ${T.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),g(lu)}}),a.jsx(Gl,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...y.map(k=>({value:k,label:k}))],onChange:k=>{x(k),g(lu)}})]}),N.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:N.slice(0,p).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))}),N.length>p&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>g(k=>k+lu),children:["Ещё ",Math.min(lu,N.length-p)," из ",N.length-p]})}),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:x,onClose:p}){const[g,_]=b.useState(""),[v,y]=b.useState(!1),[N,k]=b.useState(!1),T=u!==null&&(n==null?void 0:n.loggedIn)===!0&&!N&&!v,A=b.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const X=s.output.trim();return X===""?null:{ok:!0,message:X}},[s.error,s.output]);function G(X=g){const B=X.trim();B!==""&&(i.submitCode(B),_(""))}function Y(){if(o>0){y(!1),k(!0);return}i.login("claudeai",!0)}return a.jsxs(gs,{title:"Аккаунт",onClose:p,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:g,onCode:_,onSubmit:G,onCancel:i.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(Ir,{result:A}),N&&a.jsx("p",{className:"account__warn",role:"alert",children:AS(o)}),T&&h&&a.jsx("p",{className:"account__note",children:x}),a.jsx("div",{className:`extbar${n!=null&&n.loggedIn?" account__bar":""}`,children:n!=null&&n.loggedIn?a.jsxs(a.Fragment,{children:[T&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
133
+ ${x}`,"aria-label":"Переподключить сессию",disabled:h,onClick:u,children:[a.jsx(MS,{}),"Переподключить"]}),N?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:Y,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,x]=b.useState(null),p=b.useRef(""),g=b.useRef({code:i,onCode:c,onSubmit:o});g.current={code:i,onCode:c,onSubmit:o};const _=b.useCallback(async T=>{const{code:A,onCode:G,onSubmit:Y}=g.current;if(T&&A.trim()!=="")return;const X=await Ip();if(X===null){T||x("Не получилось прочитать буфер — вставьте код в поле руками.");return}const B=X.trim();if(!x_(B)){T||x("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(T){if(p.current===B)return;p.current=B}x(null),G(B),Y(B)},[]);b.useEffect(()=>{if(!n.awaitingCode)return;const T=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[n.awaitingCode,_]);const v=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",y=i.trim()!==""&&!x_(i),N=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(Wc,{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:T=>{x(null),c(T.target.value)},onKeyDown:T=>{T.key==="Enter"&&(T.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:"Готово"})]}),N&&a.jsx("p",{className:"account__note account__note--code",children:N})]}),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,x]=b.useState(""),[p,g]=b.useState(!1),_=b.useRef(null),v=(n==null?void 0:n.paired)===!0;b.useEffect(()=>{var N;v||(N=_.current)==null||N.focus()},[v]),b.useEffect(()=>{g(!1),v&&u("")},[v,n==null?void 0:n.error]);const y=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(gs,{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:N=>{N.preventDefault(),o.trim()&&(g(!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:N=>u(N.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:N=>x(N.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()||p,children:p?"Связываем…":"Связать"})]})]})})}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})),Pd=3600*1e3,US=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Hc={"6h":6*Pd,"24h":24*Pd,"48h":48*Pd,"168h":168*Pd,never:0};function HS(n){return Hc[n]??Hc["48h"]}const BS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Jd=60*1e3,Bc={"5m":5*Jd,"10m":10*Jd,"30m":30*Jd,"60m":60*Jd,never:0};function qS(n){return Bc[n]??Bc["10m"]}function GS(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)}function $S(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)}const YS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],qc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function VS(n){return qc[n]??qc.off}function __(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function XS(n){const s=Object.entries(qc).find(([,i])=>i===n);return s?s[0]:Object.keys(qc).reduce((i,c)=>Math.abs(qc[c]-n)<Math.abs(qc[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:x,local:p,onChange:g,onEnableShell:_,onDisableShell:v,onOpenRelay:y,onClose:N}){const k=i===null,[T,A]=b.useState(""),[G,Y]=b.useState(null),X=!k&&i.networkGuardEnabled,B=(i==null?void 0:i.networkGuardBlockedCountries)??[];function R(){const M=T.trim().toUpperCase();if(M!==""){if(!/^[A-Z]{2}$/.test(M)){Y("Нужен код из двух латинских букв, например RU или CN.");return}if(B.includes(M)){Y(`Код ${M} уже в списке.`);return}Y(null),A(""),g({networkGuardBlockedCountries:[...B,M]})}}const L=!k&&i.terminalEnabled===!0,H=!k&&i.liveSessionsFirst===!0,D=!L,O=M=>{const P=o[M]??(M==="claude"?c:[]);return[{value:LS,label:"Как в CLI",hint:"Из настроек этого CLI"},...P.map(re=>({value:re.value,label:re.displayName,hint:re.description})),...M==="claude"&&!P.length?zS:[]]};function I(){var M,P;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:D,onClick:y,children:"Связать компьютер"})]}):(M=h.shell)!=null&&M.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:D,onClick:v,children:"Запретить"})]}):(P=h.shell)!=null&&P.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:D,onClick:_,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),p?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:D,onClick:_,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:D,onClick:_,children:"Прислать письмо"})]})]})}return a.jsx(gs,{title:"Настройки",onClose:N,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(Gl,{title:"Тема оформления",value:n,options:[{value:"system",label:"Ритм системы",hint:"следовать настройке вашего устройства"},{value:"light",label:"Свет",hint:"молочные поверхности и мягкие тени"},{value:"dark",label:"Тьма",hint:"графит, светящиеся орбиты и глубокие тени"}],onChange:M=>s(M)})]}),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(Gl,{className:"settings__select",value:$S(i.autoArchiveAfterMs),options:US,onChange:M=>g({autoArchiveAfterMs:HS(M)}),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(Gl,{className:"settings__select",value:GS(i.autoStopAfterMs),options:BS,onChange:M=>g({autoStopAfterMs:qS(M)}),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:M=>g({limitStopFiveHourPct:__(M.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:M=>g({limitStopSevenDayPct:__(M.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":X,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:X?"switch is-on":"switch",onClick:()=>g({networkGuardEnabled:!X}),children:a.jsx("span",{className:"switch__knob"})})]}),X&&x&&a.jsx("p",{className:x.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:x.status==="blocked"?x.reason??"Маршрут не прошёл проверку.":x.country?`Сейчас: ${x.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:X?"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:[B.map(M=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:M}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${M} из списка`,disabled:!X,onClick:()=>g({networkGuardBlockedCountries:B.filter(P=>P!==M)}),children:"×"})]},M)),B.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:M=>{M.preventDefault(),R()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:T,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!X,"aria-label":"Код страны, две буквы","aria-invalid":G!==null,onChange:M=>{A(M.target.value.toUpperCase()),Y(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!X||T.trim()==="",children:"Добавить"})]}),G&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:G})]})]}),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(Gl,{className:"settings__select",value:XS(i.autoSaveAfterPauseMs),options:YS,onChange:M=>g({autoSaveAfterPauseMs:VS(M)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),jp.map(M=>{const P=(i==null?void 0:i.enabledProviders)??["claude","antigravity","codex"],re=!k&&P.includes(M.id),_e=re&&P.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${M.id}`,"aria-hidden":"true",children:M.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):M.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:M.label}),a.jsx("span",{className:"settings__hint",children:_e?"Хотя бы один агент должен остаться включённым":M.hint})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":re,"aria-label":M.label,disabled:_e,title:_e?"Хотя бы один агент должен остаться включённым":void 0,className:re?"switch is-on":"switch",onClick:()=>{const we=jp.map(q=>q.id).filter(q=>q===M.id?!re:P.includes(q));g({enabledProviders:we})},children:a.jsx("span",{className:"switch__knob"})})]},M.id)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),jp.map(M=>{var P,re;return a.jsxs("div",{className:"settings__field settings__model-default",children:[a.jsx("label",{className:"settings__field-label",htmlFor:`default-model-${M.id}`,children:M.label}),a.jsxs("div",{children:[a.jsx("input",{id:`default-model-${M.id}`,className:"hub-input",list:`default-model-options-${M.id}`,"aria-label":`Модель по умолчанию: ${M.label}`,disabled:k||!u,placeholder:"Как в CLI",defaultValue:((P=i==null?void 0:i.startModels)==null?void 0:P[M.id])??(M.id==="claude"?i==null?void 0:i.startModel:"")??"",onBlur:_e=>{var q;const we=_e.currentTarget.value.trim()||null;we!==(((q=i==null?void 0:i.startModels)==null?void 0:q[M.id])??(M.id==="claude"?i==null?void 0:i.startModel:null)??null)&&g({startModels:{[M.id]:we}})},onKeyDown:_e=>{_e.key==="Enter"&&_e.currentTarget.blur()}},`${M.id}:${((re=i==null?void 0:i.startModels)==null?void 0:re[M.id])??(M.id==="claude"?i==null?void 0:i.startModel:"")??""}`),a.jsx("datalist",{id:`default-model-options-${M.id}`,children:O(M.id).filter(_e=>_e.value).map(_e=>a.jsx("option",{value:_e.value,children:_e.label},_e.value))}),a.jsxs("small",{className:"settings__hint",children:["Выберите доступную модель или введите её ID. Пустое поле — настройки ",M.label,"."]})]})]},M.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(Gl,{className:"settings__select",value:i.startPermissionMode,options:IS,onChange:M=>g({startPermissionMode:M}),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":H,"aria-label":"Запущенные сессии сверху",className:H?"switch is-on":"switch",onClick:()=>g({liveSessionsFirst:!H}),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(M=>{const P=!k&&i.folderAccess===M.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":P,disabled:k,className:"access__card"+(P?" is-on":"")+(M.risky?" access__card--risky":""),onClick:()=>g({folderAccess:M.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:[M.title,M.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:M.description})]})]},M.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":L,"aria-label":"Терминал",className:L?"switch is-on":"switch",onClick:()=>g({terminalEnabled:!L}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(D?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),k?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[D&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),I()]})]})]})]})})}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 wf(n.text).then(u=>{o||c(u)}),()=>{o=!0}},[n.text]),a.jsx(gs,{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 bf={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:["Достигнут ",bf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",eE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",bf[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 x=Date.parse(u.resetsAt);if(!(!Number.isFinite(x)||x<=i))return{limit:o,utilization:u.utilization,resetsAt:x}}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=Dr[n],u=b.useRef(null);b.useEffect(()=>()=>{u.current&&document.body.classList.remove("is-resizing")},[]);function h(v){var A;const y=v.closest(".app"),N=y==null?void 0:y.querySelector(n==="sidebar"?":scope > .sidebar":n==="comparison"?".comparison":`.sidepane--${n}`),k=(N==null?void 0:N.getBoundingClientRect().width)??s,T=((A=y==null?void 0:y.querySelector(".main"))==null?void 0:A.getBoundingClientRect().width)??ib;return{width:k,max:Math.max(o.min,Math.min(o.max,k+T-ib))}}function x(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 p(v){const y=u.current;if(!y)return;const N=o.side==="left"?v.clientX-y.x:y.x-v.clientX;i(Math.min(y.max,y.width+N))}function g(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 N=h(v.currentTarget);i(Math.min(N.max,N.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:x,onPointerMove:p,onPointerUp:g,onPointerCancel:g,onLostPointerCapture:g,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 g=document.querySelector(".main .transcript, .main .editor");if(!g)return 1/0;const _=g.getBoundingClientRect().height-Cv;return Math.round(n+Math.max(0,_))}function u(g){g.button===0&&(c.current={y:g.clientY,height:n,max:o()},g.currentTarget.setPointerCapture(g.pointerId),document.body.classList.add("is-resizing-row"),g.preventDefault())}function h(g){const _=c.current;if(!_)return;const v=_.y-g.clientY;s(_.height+v,_.max)}function x(g){c.current&&(c.current=null,g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),document.body.classList.remove("is-resizing-row"))}function p(g){const _=g.key==="ArrowUp"?1:g.key==="ArrowDown"?-1:0;_!==0&&(g.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:x,onPointerCancel:x,onDoubleClick:i,onKeyDown:p,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function v_(){const n=document.documentElement,s=getComputedStyle(n),i=Y=>s.getPropertyValue(Y).trim(),c=i("--surface"),o=i("--text"),u=i("--text-2"),h=i("--muted"),x=i("--accent"),p=i("--accent-fg"),g=i("--select"),_=i("--danger"),v=i("--ok"),y=i("--warn"),N=i("--cm-fn"),k=i("--cm-key"),T=i("--cm-type"),A=j_(o,c,55),G=Y=>j_(Y,"#ffffff",25);return{background:c,foreground:o,cursor:x,cursorAccent:p,selectionBackground:g,black:A,brightBlack:h,red:_,brightRed:G(_),green:v,brightGreen:G(v),yellow:y,brightYellow:G(y),blue:N,brightBlue:G(N),magenta:k,brightMagenta:G(k),cyan:T,brightCyan:G(T),white:u,brightWhite:o}}function oE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let oa=null;function uE(n){return oa||(oa=document.createElement("span"),oa.style.position="fixed",oa.style.width="0",oa.style.height="0",oa.style.opacity="0",oa.style.pointerEvents="none",document.body.appendChild(oa)),oa.style.color=n,getComputedStyle(oa).color}function j_(n,s,i){return uE(`color-mix(in srgb, ${n} ${100-i}%, ${s} ${i}%)`)}let Wd=null;function dE(){return Wd||(Wd=Promise.all([ct(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),ct(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),ct(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),ct(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,s,i])=>({Terminal:n.Terminal,FitAddon:s.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(n=>{throw Wd=null,n})),Wd}function fE({terminals:n,activeId:s,blocked:i,error:c,onDismissError:o,height:u,offset:h,mobile:x=!1,zoomed:p,onToggleZoom:g,onSelect:_,onOpen:v,onClose:y,onInput:N,onResize:k,onAttach:T,onHide:A,registerSink:G}){const[Y,X]=b.useState(()=>v_());return b.useEffect(()=>{const B=new MutationObserver(()=>X(v_()));return B.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>B.disconnect()},[]),a.jsxs("div",{className:"termpanel"+(x?" termpanel--mobile":"")+(!x&&p?" termpanel--zoomed":""),style:x?{height:u,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:p?void 0:{height:u},children:[a.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:B=>{g&&(B.target.closest("button")||g())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(B=>a.jsxs("div",{role:"tab","aria-selected":B.id===s,className:"termtab"+(B.id===s?" is-on":"")+(B.exitCode!==null?" termtab--exited":""),onDoubleClick:R=>{g&&(R.target.closest(".termtab__close")||g())},children:[a.jsx("button",{className:"termtab__name",title:B.cwd,onClick:()=>_(B.id),children:B.title}),B.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${B.exitCode}`,children:B.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${B.title}»`,onClick:()=>y(B.id),children:"✕"})]},B.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:v,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),g&&a.jsx("button",{className:"termpanel__zoom",title:p?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":p?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":p,onClick:g,children:a.jsx(to,{active:p})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,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(B=>a.jsx(pE,{id:B.id,exitCode:B.exitCode,active:B.id===s,theme:Y,mobile:x,onInput:N,onResize:k,onAttach:T,registerSink:G},B.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:x,registerSink:p}){const g=b.useRef(null),_=b.useRef(null),v=b.useRef(!1),y=b.useRef(o);y.current=o;const N=b.useRef(c),k=b.useRef(s),[T,A]=b.useState("loading"),[G,Y]=b.useState(!1);return b.useEffect(()=>{if(!g.current)return;let B=!1,R=null;A("loading"),Y(!1);const L=window.setTimeout(()=>{B||Y(!0)},200);return(async()=>{var ve;let H;try{H=await dE()}catch{window.clearTimeout(L),B||A("error");return}if(B||!g.current)return;window.clearTimeout(L);const{Terminal:D,FitAddon:O,WebLinksAddon:I}=H,M=new D({fontFamily:oE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:N.current}),P=new O;M.loadAddon(P),M.loadAddon(new I),M.open(g.current),_.current=M,M.attachCustomKeyEventHandler(E=>{if(E.type!=="keydown"||!(E.ctrlKey||E.metaKey))return!0;if(E.key==="`")return E.preventDefault(),!1;if(E.key==="c"||E.key==="C"){const xe=M.getSelection();return xe?(E.preventDefault(),ai(xe),!1):!E.shiftKey}return E.key==="v"||E.key==="V"?(E.preventDefault(),Ip().then(xe=>{xe&&M.paste(xe)}),!1):!0});const re=E=>{E.preventDefault();const K=M.getSelection();if(K){ai(K),M.clearSelection();return}Ip().then(xe=>{xe&&M.paste(xe)})};(ve=M.element)==null||ve.addEventListener("contextmenu",re);const _e=M.onData(E=>u(n,E));let we={cols:M.cols,rows:M.rows},q=null;const $=M.onResize(({cols:E,rows:K})=>{q!==null&&window.clearTimeout(q),q=window.setTimeout(()=>{q=null,!(E===we.cols&&K===we.rows)&&(we={cols:E,rows:K},h(n,E,K))},100)}),W=new ResizeObserver(()=>{try{P.fit()}catch{return}y.current&&M.scrollToBottom()});W.observe(g.current);const Q=p(n,E=>{E.kind==="buffer"&&M.reset(),M.write(E.data)});x(n),k.current!==null&&!v.current&&(v.current=!0,M.write(`\r
139
+ \x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
140
+ `)),i&&M.focus(),R=()=>{var E;q!==null&&window.clearTimeout(q),W.disconnect(),(E=M.element)==null||E.removeEventListener("contextmenu",re),_e.dispose(),$.dispose(),Q(),M.dispose(),_.current=null},A("ready")})(),()=>{B=!0,window.clearTimeout(L),R==null||R(),R=null}},[n]),b.useEffect(()=>{if(!o)return;const X=g.current;if(!X)return;let B=null,R=0,L=!1;const H=M=>{M.pointerType==="mouse"||B!==null||(B=M.pointerId,R=M.clientY,L=!1)},D=M=>{if(M.pointerId!==B)return;const P=R-M.clientY;if(!L){if(Math.abs(P)<4)return;L=!0,X.setPointerCapture(M.pointerId)}R=M.clientY;const re=X.querySelector(".xterm-viewport");re&&(re.scrollTop+=P)},O=M=>{M.pointerId===B&&(X.hasPointerCapture(M.pointerId)&&X.releasePointerCapture(M.pointerId),B=null,L=!1)},I=M=>M.stopPropagation();return X.addEventListener("pointerdown",H),X.addEventListener("pointermove",D),X.addEventListener("pointerup",O),X.addEventListener("pointercancel",O),X.addEventListener("touchmove",I,{capture:!0}),()=>{X.removeEventListener("pointerdown",H),X.removeEventListener("pointermove",D),X.removeEventListener("pointerup",O),X.removeEventListener("pointercancel",O),X.removeEventListener("touchmove",I,{capture:!0}),B!==null&&X.hasPointerCapture(B)&&X.releasePointerCapture(B)}},[o]),b.useEffect(()=>{N.current=c,_.current&&(_.current.options.theme=c)},[c]),b.useEffect(()=>{var X;i&&((X=_.current)==null||X.focus())},[i]),b.useEffect(()=>{if(k.current=s,s===null){v.current=!1;return}if(v.current)return;const X=_.current;X&&(v.current=!0,X.write(`\r
141
+ \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
142
+ `))},[s]),a.jsxs("div",{className:"termview"+(i?" is-active":""),children:[a.jsx("div",{ref:g,className:"termview__surface"+(T==="ready"?"":" is-hidden")}),T==="loading"&&G&&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:"Загружается терминал…"})]}),T==="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,x)=>N_(h.name,u)-N_(x.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 hc;const n=b.useRef(null),s=b.useRef(null),i=b.useRef(!1),c=b.useRef(new Set),o=b.useCallback(m=>{var z;return(z=n.current)==null?void 0:z.send(m)},[]),u=b.useCallback(m=>{var z,ce,Be;if(m.type==="session.start"){const ft=crypto.randomUUID();s.current={requestId:ft,workspaceId:m.workspaceId,provider:m.provider,resume:m.resume,known:new Set(c.current),draft:(z=s.current)==null?void 0:z.draft},(ce=n.current)==null||ce.send({...m,requestId:ft})}else(Be=n.current)==null||Be.send(m)},[]),[h,x]=b.useState(!1),[p,g]=b.useState("Нет связи с хостом"),[_,v]=b.useState(null),[y,N]=b.useState(null),k=(y==null?void 0:y.status)==="blocked",[T,A]=b.useState(!1),G=b.useMemo(()=>nf()==="relay",[]),[Y,X]=b.useState([]),B=nk({connected:h,workspaces:Y,send:o}),R=ON(B.openedIds,B.replacements),[L,H]=b.useState(null),D=b.useRef(B.handleFrame);D.current=B.handleFrame;const[O,I]=b.useState([]),[M,P]=b.useState([]),[re,_e]=b.useState([]),[we,q]=b.useState([]),[$,W]=b.useState([]),[Q,ve]=b.useState([]),[E,K]=b.useState([]),[xe,ke]=b.useState([]),[Re,me]=b.useState(null),[He,tt]=b.useState(null),[ot,sn]=b.useState(null),[de,st]=b.useState(null),[oe,Rt]=b.useState(null),[qe,Bt]=b.useState(null),[On,xt]=b.useState(ms),[Zt,on]=b.useState(Ki),[Yn,jt]=b.useState(!1),[Z,De]=b.useState(()=>{try{const m=localStorage.getItem("ether:library.tab");if(m==="sessions"||m==="pinned")return m}catch{}return"projects"}),[Ke,ut]=b.useState(()=>{try{return localStorage.getItem("ether:library.project")||null}catch{return null}});b.useEffect(()=>{try{localStorage.setItem("ether:library.tab",Z),localStorage.setItem("ether:library.project",Ke??"")}catch{}},[Z,Ke]);const[Ee,Ce]=b.useState(null),[Oe,$e]=b.useState(!1),[Ie,Pe]=b.useState(()=>{try{const m=localStorage.getItem("ether:provider-filter");if(m&&["all","codex","claude","antigravity"].includes(m))return m}catch{}return"all"});b.useEffect(()=>{try{localStorage.setItem("ether:provider-filter",Ie)}catch{}},[Ie]);const[pt,wt]=b.useState(!1),Lt=yf("(max-width: 860px)"),[Xt,_s]=b.useState(!1);b.useEffect(()=>{Lt||_s(!1)},[Lt]);const[ie,je]=b.useState(!1),[Xe,at]=b.useState([]),[Je,ln]=b.useState(!1),[Vn,gn]=b.useState(ms),[un,Ft]=b.useState(null),[zt,J]=b.useState(null),[fe,Me]=b.useState([]),[Ze,It]=b.useState(null),[an,Et]=b.useState(null),[ys,Xn]=b.useState([]),[is,dn]=b.useState([]),[lt,_n]=b.useState([]),[Es,Ts]=b.useState([]),[Cs,rs]=b.useState(null),[cs,os]=b.useState(null),[qt,Is]=b.useState({}),[Pt,yn]=b.useState(null),[nt,Jn]=b.useState({}),[Qn,Wn]=b.useState(null),[Tn,wl]=b.useState([]),[Us,es]=b.useState(!1),[Hs,wn]=b.useState(null),[Tt,Ln]=b.useState(null),Gt=(Tt==null?void 0:Tt.enabledProviders)??["claude","antigravity","codex"],[ii,xa]=b.useState(!1),[Yl,ba]=b.useState(vE),[zn,ri]=b.useState(null),[vn,Vl]=b.useState(null),[kl,us]=b.useState(!1),[As,Ne,C]=kv(),ee=Tv(),[ye,Te]=b.useState(!1),[ze,Fe]=b.useState(null),[$t,mt]=b.useState(null),[In,it]=b.useState(null),[Cn,St]=b.useState(null),[Bs,qs]=b.useState(null),[_a,ya]=b.useState(""),[Hr,el]=b.useState(null),[tl,Ms]=b.useState([]),[Xl,S]=b.useState(!1),[pe,Ue]=b.useState(null),[bt,Kn]=b.useState(!1),[vs,Fi]=b.useState(!1),[kn,nl]=b.useState({}),[va,Ql]=b.useState([""]),[ja,Rs]=b.useState([]),[ci,sl]=b.useState(null),[Br,Nl]=b.useState(null),[Pi,qr]=b.useState(null),[Ji,oi]=b.useState(null),[kf,no]=b.useState(null),[Gr,wu]=b.useState({}),[$r,so]=b.useState({}),[Wi,Yr]=b.useState(!1),[Nf,lo]=b.useState(null),[ui,ao]=b.useState(null),ku=b.useRef(0),Vr=b.useRef(null),[er,io]=b.useState(!1),[Xr,tr]=b.useState([]),[Sf,Qr]=b.useState(null),[Ef,Kr]=b.useState(null),Zr=Av(),ro=Lv(Lt&&er),wa=b.useRef(new Map),ll=(Tt==null?void 0:Tt.terminalEnabled)===!0,Fr=nf()==="relay"&&((hc=_==null?void 0:_.shell)==null?void 0:hc.enabled)!==!0,Pr=b.useRef(!1),Nu=b.useCallback((m,z)=>(wa.current.set(m,z),()=>{wa.current.get(m)===z&&wa.current.delete(m)}),[]),[Kl,di]=b.useState(!1),[co,Sl]=b.useState(null),[Su,Jr]=b.useState(ms),[El,nr]=b.useState(null),[fi,al]=b.useState({}),Tl=b.useRef([]),[xn,hi]=b.useState(null);function Eu(m){hi(z=>z===m?null:m)}b.useEffect(()=>{(Lt||xn==="terminal"&&!er||xn==="files"&&!vs||xn==="search"&&!Wi||xn==="git"&&!ye||xn==="ask"&&!Kl||xn==="main"&&ja.length===0)&&hi(null)},[xn,Lt,er,vs,Wi,ye,Kl,ja.length]);const[Tu]=b.useState(xE),pi=b.useRef(Tu),Zl=b.useRef(!1),An=b.useRef(null),sr=b.useRef(null),lr=b.useRef(null),Cu=b.useRef(0),Un=b.useRef(null),Au=b.useRef(0);An.current=oe,Un.current=de,Au.current=On.lastSeq;const Mu=b.useRef(Zt);Mu.current=Zt;const Cl=b.useRef(null),js=b.useRef(0);js.current=Su.lastSeq;const Fl=b.useRef(null),ar=b.useRef(""),mi=b.useRef(null),Pl=b.useRef([]),oo=b.useRef([""]);Pl.current=ja,oo.current=va;const ka=b.useRef(new Map),Wr=b.useRef(new Set),fl=b.useRef(null),Na=b.useRef(null),gi=b.useRef(0),Sa=b.useRef(new Set);b.useEffect(()=>{const m=gv();if(!m)return;n.current=m;const z=()=>{x(m.connected),g(m.statusText)};m.onStatus(z),m.onReconnect(()=>{z(),Jn({});const ft=An.current;ft&&m.send({type:"session.sync",sessionId:ft,sinceSeq:Au.current});const Mn=Cl.current;Mn&&m.send({type:"session.sync",sessionId:Mn,sinceSeq:js.current})});const ce=m.on(ft=>{D.current(ft),Ru(ft)});m.connect();const Be=window.setInterval(()=>{z(),m.connected&&m.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(Be),m.close()}},[]);const Ru=b.useCallback(m=>{var ce,Be,ft,Mn,fs,zl,wo,ko,$a,br,No,pc,mc;const z=ge=>{var Ve,gt,Mt;const Se=(Ve=s.current)==null?void 0:Ve.draft;s.current=null,Se&&af(ge.id,Se),((gt=lr.current)==null?void 0:gt.workspaceId)===ge.workspaceId&&(af(ge.id,lr.current.text),lr.current=null),An.current=ge.id,st(ge.workspaceId),Rt(ge.id),(Mt=n.current)==null||Mt.send({type:"session.sync",sessionId:ge.id,sinceSeq:0})};switch(m.type){case"hello.ok":i.current=((ce=m.features)==null?void 0:ce.includes("session-routing"))??!1,x(!0);break;case"workspace.list":{X(m.workspaces),I(m.archived),st(Ve=>{var ts;if(Ve)return Ve;const gt=pi.current,Mt=gt&&bE(m.workspaces,gt.workspaceId);return gt&&Mt&&Mt.id!==gt.workspaceId&&(pi.current={...gt,workspaceId:Mt.id}),(Mt==null?void 0:Mt.id)??((ts=m.workspaces[0])==null?void 0:ts.id)??null});const ge=mi.current;if(!ge)break;const Se=m.workspaces.find(Ve=>NE(Ve.path,ge));if(!Se)break;mi.current=null,je(!1),st(Se.id);break}case"workspace.candidates":if(m.query.trim()!==ar.current)break;at(m.candidates),m.source==="host"&&ln(!1);break;case"finder.opened":Fl.current=m.sessionId;break;case"workspace.roots":Me(m.roots);break;case"workspace.created":if(st(m.workspace.id),m.warnings.length===0){je(!1),J(null);break}It({path:m.workspace.path,warnings:m.warnings});break;case"session.list":if(m.workspaceId!==Un.current)break;W(ge=>vy(ge,m.sessions,m.archived,m.workspaceId)),ve(m.archived);break;case"folder.list":P(m.workspaceFolders),_e(m.sessionFolders),q(m.pinnedFolders??[]);break;case"session.pinned":K(m.sessions);break;case"session.live":for(const ge of m.sessions)c.current.add(ge.id);ke(m.sessions);break;case"order.state":sn(m.order);break;case"session.summary":if(!i.current&&s.current){const ge=s.current,Se=m.session;!Se.parentSessionId&&Se.workspaceId===ge.workspaceId&&Se.state!=="closed"&&(!ge.provider||ge.provider===Se.provider)&&(!((Be=ge.known)!=null&&Be.has(Se.id))||ge.resume===Se.id||ge.resume===Se.claudeSessionId)&&z(Se)}if(c.current.add(m.session.id),m.session.id===Fl.current){Ft(m.session);break}if(m.session.parentSessionId){m.session.id===Cl.current&&nr(m.session);break}if(ke(ge=>{const Se=ge.findIndex(gt=>gt.id===m.session.id);if(m.session.state==="closed")return Se===-1?ge:ge.filter(gt=>gt.id!==m.session.id);if(Se===-1)return[...ge,m.session];const Ve=ge.slice();return Ve[Se]=m.session,Ve}),W(ge=>{const Se=ge.findIndex(gt=>gt.id===m.session.id);if(Se===-1)return[m.session,...ge];const Ve=ge.slice();return Ve[Se]=m.session,Ve}),K(ge=>{const Se=ge.findIndex(gt=>gt.id===m.session.id);if(Se===-1)return ge;const Ve=ge.slice();return Ve[Se]={...m.session,pinned:!0,...ge[Se].pinnedAt?{pinnedAt:ge[Se].pinnedAt}:{}},Ve}),((ft=sr.current)==null?void 0:ft.sessionId)===m.session.id){const ge=sr.current;m.session.state==="error"?sr.current=null:m.session.state!=="closed"&&(sr.current=null,(Mn=n.current)==null||Mn.send({type:"prompt.send",sessionId:ge.sessionId,text:ge.text,images:ge.images}))}break;case"session.started":{if(m.requestId!==((fs=s.current)==null?void 0:fs.requestId))break;z(m.session);break}case"usage.state":m.sessionId===An.current&&(ri(m.usage),us(!1));break;case"context.state":m.sessionId===An.current&&(Vl(m.context),us(!1));break;case"session.capabilities":m.sessionId===An.current&&Bt(m.capabilities);break;case"session.events":if(m.sessionId===Cl.current){Jr(ge=>uu(ge,m.entries));break}if(m.sessionId===Fl.current){gn(ge=>uu(ge,m.entries));break}if(m.sessionId!==An.current)break;for(const ge of m.entries){if(ge.event.kind!=="rewound")continue;const Se=ge.event.toUserIndex,Ve=B_(Mu.current.entries,Se),gt=Ve.reduce((Mt,ts)=>ts.event.kind==="user.message"?Mt+1:Mt,0);on(Mt=>({...Mt,entries:Ve})),xt(Mt=>({...Mt,items:q_(Mt.items,Se,gt)}))}xt(ge=>uu(ge,m.entries));break;case"session.history":if(m.sessionId!==An.current)break;on(ge=>H_(ge,m));break;case"side.opened":{if(m.parentSessionId!==An.current)break;Cl.current=m.sessionId,Sl(m.sessionId);const ge=Tl.current;Tl.current=[];for(const Se of ge)Se(m.sessionId);break}case"side.closed":if(m.parentSessionId!==An.current)break;Cl.current=null,Sl(null),Jr(ms),nr(null);break;case"git.state":if(m.workspaceId!==Un.current)break;Fe(m.state);break;case"git.commit":if(m.workspaceId!==Un.current)break;mt(m.detail);break;case"git.result":if(m.workspaceId!==Un.current)break;St({ok:m.ok,message:m.message,url:m.url}),m.ok&&(mt(null),it(null),S(!1),Kn(!1));break;case"git.busy":if(m.workspaceId!==Un.current)break;ya(m.label);break;case"git.files":if(m.workspaceId!==Un.current)break;Ue({files:m.files,truncated:m.truncated});break;case"github.status":el(m.status);break;case"github.owners":Ms(m.owners);break;case"fs.dir":if(m.workspaceId!==Un.current)break;nl(ge=>({...ge,[m.path]:m.entries}));break;case"fs.search":if(m.workspaceId!==Un.current)break;if(m.scope!=="tree"){const ge=m.scope;so(Se=>({...Se,[ge]:{query:m.query,entries:m.entries}}));break}no({query:m.query,entries:m.entries,truncated:m.truncated});break;case"fs.grep":if(m.workspaceId!==Un.current)break;lo({query:m.query,matches:m.matches,truncated:m.truncated});break;case"fs.file":{if(m.workspaceId!==Un.current)break;const ge=Wr.current.delete(m.file.path);Rs(Ve=>{const gt=Ve.findIndex(Os=>Os.path===m.file.path);if(gt===-1)return[...Ve,Yb(m.file,++gi.current)];const Mt=Ve[gt],ts=Ve.slice();return ts[gt]=Mt.saved===m.file.content&&!ti(Mt)?{...Mt,mtime:m.file.mtime,size:m.file.size,stale:!1}:Yb(m.file,++gi.current),ts}),ge&&sl(m.file.path);const Se=Vr.current;Se&&Se.path===m.file.path&&(Vr.current=null,ao({...Se,token:++ku.current}));break}case"fs.media":{if(m.workspaceId!==Un.current)break;Sa.current.delete(m.path),Rs(ge=>ge.map(Se=>Se.path===m.path?{...Se,mediaBase64:m.base64,mediaError:void 0}:Se));break}case"fs.mediaFailed":{if(m.workspaceId!==Un.current)break;Sa.current.delete(m.path),Rs(ge=>ge.map(Se=>Se.path===m.path?{...Se,mediaError:m.message}:Se));break}case"fs.saved":{if(m.workspaceId!==Un.current)break;const ge=ka.current.get(m.path);ka.current.delete(m.path);const Se=ge!==void 0;Rs(gt=>gt.map(Mt=>Mt.path!==m.path?Mt:Se?{...Mt,saved:ge,mtime:m.mtime,size:m.size,stale:!1}:{...Mt,stale:!0}));const Ve=Pl.current.find(gt=>gt.path===m.path);!Se&&Ve&&!ti(Ve)&&((zl=n.current)==null||zl.send({type:"fs.read",workspaceId:m.workspaceId,path:m.path})),(wo=n.current)==null||wo.send({type:"git.state",workspaceId:m.workspaceId});break}case"fs.result":{if(m.workspaceId!==Un.current)break;if(Nl({ok:m.ok,message:m.message}),m.ok||ka.current.delete(m.path),m.conflict&&Rs(Se=>Se.map(Ve=>Ve.path===m.path?{...Ve,stale:!0}:Ve)),Na.current===m.path){const Se=Na.current;Na.current=null,m.ok&&(Wr.current.add(Se),(ko=n.current)==null||ko.send({type:"fs.read",workspaceId:m.workspaceId,path:Se}))}const ge=fl.current;if(m.ok&&ge&&ge.to===m.path){fl.current=null;const Se=Ve=>Ve===ge.from?ge.to:Ve.startsWith(`${ge.from}/`)?ge.to+Ve.slice(ge.from.length):Ve;Rs(Ve=>Ve.map(gt=>({...gt,path:Se(gt.path)}))),sl(Ve=>Ve===null?null:Se(Ve)),Ql(Ve=>Ve.map(Se)),nl(Ve=>{const gt={};for(const[Mt,ts]of Object.entries(Ve))Mt===ge.from||Mt.startsWith(`${ge.from}/`)||(gt[Mt]=ts);return gt})}m.ok&&(($a=n.current)==null||$a.send({type:"git.state",workspaceId:m.workspaceId}));break}case"term.list":if(m.workspaceId!==Un.current)break;tr(m.terminals);break;case"term.opened":if(m.terminal.workspaceId!==Un.current)break;Kr(null),tr(ge=>{const Se=ge.findIndex(gt=>gt.id===m.terminal.id);if(Se===-1)return[...ge,m.terminal];const Ve=ge.slice();return Ve[Se]=m.terminal,Ve}),Pr.current&&(Pr.current=!1,Qr(m.terminal.id));break;case"term.buffer":(br=wa.current.get(m.id))==null||br({kind:"buffer",data:m.data});break;case"term.data":(No=wa.current.get(m.id))==null||No({kind:"data",data:m.data});break;case"term.exit":tr(ge=>ge.map(Se=>Se.id===m.id?{...Se,exitCode:m.exitCode}:Se));break;case"term.closed":tr(ge=>ge.filter(Se=>Se.id!==m.id));break;case"mcp.list":m.sessionId===An.current&&Xn(m.servers);break;case"mcp.auth":m.sessionId===An.current&&os(m.state);break;case"plugin.list":if(m.sessionId!==An.current)break;dn(m.plugins),_n(m.marketplaces),Ts(m.catalog);break;case"operation.result":m.sessionId===An.current&&rs(m.result);break;case"auth.status":wn(m.status);break;case"relay.state":v(m.state);break;case"network.state":N(m.state);break;case"settings.state":Ln(m.settings);break;case"handoff.state":Is(ge=>{if(!m.handoff){if(!(m.sessionId in ge))return ge;const Se={...ge};return delete Se[m.sessionId],Se}return{...ge,[m.sessionId]:m.handoff}});break;case"handoff.written":Jn(ge=>{if(!(m.sessionId in ge))return ge;const Se={...ge};return delete Se[m.sessionId],Se}),m.handoff&&An.current===m.sessionId?Wn(m.handoff):m.handoff||console.warn("[handoff] хост не смог записать хэндофф",m.sessionId);break;case"limit.stopped":Cu.current+=1,wl(ge=>[...ge,{id:Cu.current,limit:m.limit,utilization:m.utilization,stopped:m.stopped,handoffs:m.handoffs}]);break;case"auth.login":ba(m.state),m.state.active&&es(!0);break;case"session.closed":ke(ge=>ge.filter(Se=>Se.id!==m.sessionId)),W(ge=>ge.map(Se=>Se.id===m.sessionId?{...Se,state:"closed"}:Se));break;case"error":m.context==="session.start"&&m.requestId===((pc=s.current)==null?void 0:pc.requestId)&&(s.current=null,xt(ge=>({...ge,items:[...ge.items,{id:crypto.randomUUID(),kind:"notice",tone:"error",text:m.message}]}))),console.error("[host]",m.message,m.context??""),(m.context==="workspace.open"||m.context==="workspace.create")&&(mi.current=null,J(m.message)),(mc=m.context)!=null&&mc.startsWith("term.")&&Kr(m.message);break}},[]);b.useEffect(()=>{de&&u({type:"session.list",workspaceId:de})},[de,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(m=>u({type:"session.drafts",sessionIds:m}))},[h,u]),b.useEffect(()=>{if(Zl.current)return;const m=pi.current;if(!m||!de)return;if(m.sessionId===null){Zl.current=!0;return}if(de!==m.workspaceId){Zl.current=!0;return}if(oe){Zl.current=!0;return}if($.length===0)return;const z=$.find(ce=>_E(ce,m));Zl.current=!0,z&&z.state!=="closed"&&rc(z)},[$,de,oe]),b.useEffect(()=>{!de||Fr||!ll||u({type:"term.list",workspaceId:de})},[de,Fr,ll,u]),b.useEffect(()=>{Qr(m=>{var z;return m&&Xr.some(ce=>ce.id===m)?m:((z=Xr[0])==null?void 0:z.id)??null})},[Xr]),b.useEffect(()=>{ie&&u({type:"workspace.roots"})},[ie,u]);const hl=b.useCallback(()=>{const m=An.current;m&&(us(!0),u({type:"usage.get",sessionId:m}),u({type:"context.get",sessionId:m}))},[u]);b.useEffect(()=>{if(!kl)return;const m=window.setTimeout(()=>us(!1),gE);return()=>window.clearTimeout(m)},[kl]);const Ea=b.useMemo(()=>{const m=Math.max((zn==null?void 0:zn.fetchedAt)??0,(vn==null?void 0:vn.fetchedAt)??0);return m>0?m:null},[zn==null?void 0:zn.fetchedAt,vn==null?void 0:vn.fetchedAt]);b.useEffect(()=>{if(Vl(null),!oe)return;hl();const m=()=>{document.hidden||hl()},z=window.setInterval(m,mE),ce=()=>{document.hidden||hl()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(z),document.removeEventListener("visibilitychange",ce)}},[oe,hl]),b.useEffect(()=>{if(!oe){on(Ki);return}on({...Ki,loading:!0}),u({type:"session.history",sessionId:oe})},[oe,u]),b.useCallback(()=>{!oe||Zt.loading||!U_(Zt)||(on(m=>({...m,loading:!0})),u({type:"session.history",sessionId:oe,before:$p(Zt)}))},[oe,Zt,u]),b.useMemo(()=>Yp(Zt.entries),[Zt.entries]);const se=b.useMemo(()=>$.find(m=>m.id===oe)??null,[$,oe]),xi=oe?(se==null?void 0:se.claudeSessionId)??oe:null,il=xi?qt[xi]??null:null;b.useEffect(()=>{xi&&u({type:"handoff.get",sessionId:xi})},[xi,u]),b.useEffect(()=>{Pt&&!(Pt.sessionId in qt)&&yn(null)},[qt,Pt]),b.useMemo(()=>{var ce;if(!zn)return null;const m=(((ce=zn.buckets)==null?void 0:ce.length)??0)>0,z=(se==null?void 0:se.provider)!=="claude";return m===z?zn:null},[zn,se==null?void 0:se.provider]),"Обновить лимиты и контекст"+(Ea?`
143
+ обновлено в ${new Date(Ea).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""),b.useEffect(()=>{document.documentElement.dataset.provider=(se==null?void 0:se.provider)??"claude"},[se==null?void 0:se.provider]),b.useEffect(()=>{(se==null?void 0:se.provider)!=="claude"&&di(!1)},[se==null?void 0:se.provider]);const ec=Y.find(m=>m.id===de)??O.find(m=>m.id===de)??null;b.useEffect(()=>{if(!de||!oe)return;const m={workspaceId:de,sessionId:oe,claudeSessionId:(se==null?void 0:se.claudeSessionId)??null};try{localStorage.setItem(Bp,JSON.stringify(m))}catch{}},[de,oe,se==null?void 0:se.claudeSessionId]);function Du(m){mi.current=m,J(null),u({type:"workspace.open",path:m})}function Cf(m,z,ce){J(null),u({type:"workspace.create",parent:m,name:z,init:ce})}function Af(m){if(ar.current=m,!m){at([]),ln(!1);return}ln(!0),u({type:"workspace.find",query:m})}function Mf(m){ar.current=m,gn(ms),u({type:"workspace.find.agent",query:m})}function Ou(){je(!1),J(null),It(null),at([]),gn(ms),Ft(null),ar.current="",mi.current=null}function bi(){const m=An.current;m&&Cl.current&&u({type:"side.reset",sessionId:m}),Cl.current=null,Sl(null),Jr(ms),nr(null),al({}),Tl.current=[]}function uo(m){u({type:"workspace.close",workspaceIds:m}),!(!de||!m.includes(de))&&(bi(),st(null),Rt(null),W([]),ve([]),xt(ms),Bt(null),wt(!1))}function rl(m,z){u({type:"session.archive",workspaceId:m,sessionIds:z}),oe&&(z.includes(oe)||se!=null&&se.claudeSessionId&&z.includes(se.claudeSessionId))&&(bi(),Rt(null),xt(ms),Bt(null),wt(!1))}function tc(m){u({type:"workspace.restore",workspaceIds:m})}function Gs(m,z,ce){u({type:"folder.create",scope:m,name:z,workspaceId:ce})}function _i(m,z){u({type:"folder.rename",folderId:m,name:z})}function fo(m,z){u({type:"folder.setColor",folderId:m,color:z})}function nc(m){u({type:"folder.delete",folderId:m})}function sc(m,z,ce,Be){u({type:"folder.assign",scope:m,itemId:z,folderId:ce,workspaceId:Be})}function Ta(m,z=!1){B.setView(null),B.markRead(m),$e(!1),R.open(m.id,z),B.openConversation(m),m.state==="closed"&&B.launchSession(m.workspaceId,m.provider,Yt(m),!1,m.id)}function pl(m,z=Gt[0]??"claude"){B.setView(null),$e(!1),ut(m),B.launchSession(m,z)}function ho(m,z){if(z==="settings"){Ds();return}if(z==="account"){Vs();return}m.id!==oe&&Aa(m),H({sessionId:m.id,tool:z,toggle:m.id===oe})}b.useEffect(()=>{if(!L||L.sessionId!==oe)return;const m=L.tool;H(null),(m==="files"||m==="search"||m==="git")&&(Fi(z=>m==="files"&&(!L.toggle||!z)),Yr(z=>m==="search"&&(!L.toggle||!z)),Te(z=>m==="git"&&(!L.toggle||!z))),m==="terminal"&&io(!0),m==="tasks"&&B.setView("tasks"),m==="extensions"&&ws("mcp"),m==="ask"&&di(!0)},[L,oe]),b.useEffect(()=>{se&&!B.openedIds.includes(se.id)&&B.openConversation(se)},[se==null?void 0:se.id]);function lc(m,z,ce,Be,ft){B.setView(null),se&&B.openConversation(se),ds(m.workspaceId),s.current={requestId:"",draft:ft},u({type:"session.start",workspaceId:m.workspaceId,provider:z,taskParent:Yt(m),taskStage:ce,...Be?{resume:Yt(m),fork:!0}:{}}),jt(!1)}function Ca(m){B.setView(null),ut(m||null),De("sessions"),jt(!1)}function Lu(){if(!oe)return;B.closeConversation(oe),Rt(null),Zl.current=!0;const m={workspaceId:de??"",sessionId:null,claudeSessionId:null};pi.current=m;try{localStorage.setItem(Bp,JSON.stringify(m))}catch{}}function ds(m){bi(),yo(),st(m),Rt(null),xt(ms),Bt(null),wt(!1),Fe(null),mt(null),it(null),St(null),ya(""),S(!1),Ue(null),Kn(!1),tr([]),Qr(null)}function ir(m,z,ce){u({type:"session.pin",workspaceId:m,sessionIds:z,pinned:ce})}function Al(m){return m.state==="running"||m.state==="waiting_permission"||m.state==="reconnecting"||m.backgroundWork}function ac(m){if(Al(m)){me(m);return}u({type:"session.close",sessionId:m.id})}function ic(m,z,ce){sn(Be=>{const ft=Be??{workspaces:[],sessions:{},pinned:[],live:[]};if(m==="sessions"){if(!ce)return Be;const Mn={...ft.sessions};return z&&z.length>0?Mn[ce]=z:delete Mn[ce],{...ft,sessions:Mn}}return{...ft,[m]:z??[]}}),u({type:"order.set",scope:m,ids:z,...ce?{workspaceId:ce}:{}})}function Aa(m){m.workspaceId!==de&&ds(m.workspaceId),rc(m)}function rc(m){if(jt(!1),bi(),xt(ms),Bt(null),wt(!1),m.state==="closed"){Rt(null),u({type:"session.start",workspaceId:m.workspaceId,resume:m.id,provider:m.provider});return}Rt(m.id),u({type:"session.sync",sessionId:m.id,sinceSeq:0})}function zu(m,z=se){const ce=(z==null?void 0:z.provider)!=="claude"?null:sE((z?B.usage[z.id]:null)??zn,Tt);return ce?new Promise(Be=>{tt(ft=>(ft==null||ft.resolve(!1),{warning:ce,resolve:Be}))}).then(Be=>(Be&&m(),Be)):(m(),!0)}function rr(m){He&&(He.resolve(m),tt(null))}function po(m){const z=xe.find(ce=>(ce.claudeSessionId??ce.id)===m.sessionId&&ce.state!=="closed");Ma(m.workspaceId,m.sessionId,m.text),z&&u({type:"session.close",sessionId:z.id})}function $s(m){Ma(m.workspaceId,m.claudeSessionId??m.id,null)}function Ma(m,z,ce){lr.current=ce===null?null:{workspaceId:m,text:ce},m!==de?ds(m):(bi(),Rt(null),Bt(null),xt(ms),wt(!1)),u({type:"session.start",workspaceId:m,provider:"claude",continuesFrom:z,...ce===null?{}:{fromHandoff:!0}}),jt(!1)}b.useEffect(()=>{Qn&&(Wn(null),po(Qn))},[Qn]);function yi(m){nt[m.id]||(Jn(z=>({...z,[m.id]:!0})),u({type:"session.handoff",sessionId:m.id}))}function cc(m){u({type:"handoff.dismiss",sessionId:m})}function cr(m,z){u({type:"session.rename",sessionId:m.id,title:z,workspaceId:m.workspaceId}),W(ce=>ce.map(Be=>Be.id===m.id?{...Be,title:z}:Be))}function ws(m){oe&&(jt(!1),rs(null),os(null),Et(m),u({type:"mcp.list",sessionId:oe}),u({type:"plugin.list",sessionId:oe}))}const Ys={mcpAction:(m,z)=>{oe&&(rs(null),u({type:"mcp.action",sessionId:oe,name:m,action:z}))},mcpAuth:m=>{oe&&(rs(null),os({name:m,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),u({type:"mcp.auth",sessionId:oe,name:m}))},mcpAuthCallback:(m,z)=>{oe&&u({type:"mcp.auth_callback",sessionId:oe,name:m,callbackUrl:z})},mcpAdd:(m,z)=>{oe&&u({type:"mcp.add",sessionId:oe,name:m,draft:z})},mcpRemove:m=>{oe&&u({type:"mcp.remove",sessionId:oe,name:m})},pluginInstall:m=>{oe&&u({type:"plugin.install",sessionId:oe,spec:m})},pluginUninstall:m=>{oe&&u({type:"plugin.uninstall",sessionId:oe,id:m})},pluginToggle:(m,z)=>{oe&&u({type:"plugin.toggle",sessionId:oe,id:m,enabled:z})},marketplaceAdd:m=>{oe&&u({type:"marketplace.add",sessionId:oe,source:m})},marketplaceRemove:m=>{oe&&u({type:"marketplace.remove",sessionId:oe,name:m})}};function Vs(){jt(!1),es(!0),u({type:"auth.status"})}const Xs={login:(m,z)=>u({type:"auth.login",mode:m,switchAccount:z}),submitCode:m=>u({type:"auth.code",code:m}),cancel:()=>u({type:"auth.cancel"}),logout:()=>u({type:"auth.logout"})};function Ds(){jt(!1),xa(!0),u({type:"settings.get"})}function Ml(m){Ln(z=>z&&{...z,...m,startModels:{...z.startModels??{claude:z.startModel??null,codex:null,antigravity:null},...m.startModels}}),u({type:"settings.update",settings:m})}function Iu(m){!oe||k||u({type:"side.ask",sessionId:oe,text:m})}function mo(){oe&&(u({type:"side.reset",sessionId:oe}),Cl.current=null,Sl(null),Jr(ms),nr(null),al({}),Tl.current=[])}function Ra(m){const z=Cl.current;if(z){m(z);return}const ce=An.current;ce&&(Tl.current.push(m),u({type:"side.open",sessionId:ce}))}function go(){de&&u({type:"git.state",workspaceId:de})}function Zn(m){de&&(it(m),u({type:"git.show",workspaceId:de,ref:m}))}function Jt(m,z){St(null),qs({target:m,label:z})}function _t(){!de||!Bs||(u({type:"git.checkout",workspaceId:de,target:Bs.target}),qs(null))}function Jl(){de&&(St(null),u({type:"git.push",workspaceId:de}))}function Qs(m){de&&(St(null),u({type:"git.pull",workspaceId:de,merge:m}))}function xo(){de&&(St(null),Ue(null),S(!0),u({type:"github.status"}),u({type:"github.owners"}),u({type:"git.files",workspaceId:de}))}function Wl(m){de&&(St(null),u({type:"git.publish",workspaceId:de,...m}))}function Uu(m){de&&(St(null),u({type:"git.remote",workspaceId:de,url:m}))}function Hu(){St(null),Kn(!0)}function vi(m){u({type:"github.token",token:m}),u({type:"github.owners"})}function Da(){u({type:"github.status"}),u({type:"github.owners"})}b.useEffect(()=>{if(!(!vs||!de))for(const m of va)m in kn||u({type:"fs.list",workspaceId:de,path:m})},[vs,va,kn,de,u]);function bo(m){Ql(z=>z.includes(m)?z.filter(ce=>ce!==m):[...z,m])}function or(m){if(!m){no(null);return}de&&u({type:"fs.search",workspaceId:de,query:m})}function _o(m){if(!m){lo(null);return}de&&u({type:"fs.grep",workspaceId:de,query:m})}const Oa=b.useCallback((m,z)=>{wu(ft=>({...ft,[m]:z}));const ce=Un.current;if(z===null||!ce)return;const Be=z.lastIndexOf("/");if(Be!==-1){u({type:"fs.list",workspaceId:ce,path:z.slice(0,Be)});return}if(z===""){u({type:"fs.list",workspaceId:ce,path:""});return}u({type:"fs.search",workspaceId:ce,query:z,scope:m})},[u]);b.useMemo(()=>k_(Gr.mention??null,$r.mention??null,kn),[Gr.mention,$r.mention,kn]);const Rl=b.useMemo(()=>k_(Gr.side??null,$r.side??null,kn),[Gr.side,$r.side,kn]);function ea(m){ur(m.path,{line:m.line,column:m.column})}function Dl(m){const z=[];let ce=Or(m.path);for(;z.push(ce),!!ce;)ce=Or(ce);Ql(Be=>{const ft=new Set(Be);for(const Mn of z)ft.add(Mn);return m.kind==="dir"&&ft.add(m.path),[...ft]}),m.kind==="file"&&ur(m.path)}function ur(m,z){if(Pl.current.find(Be=>Be.path===m)){sl(m),z&&ao({path:m,...z,token:++ku.current});return}de&&(z&&(Vr.current={path:m,...z}),Wr.current.add(m),u({type:"fs.read",workspaceId:de,path:m}))}function dr(m,z=!1){const ce=Pl.current,Be=ce.find(fs=>fs.path===m);if(Be&&ti(Be)&&!z){oi(m);return}oi(null);const ft=ce.findIndex(fs=>fs.path===m),Mn=ce.filter(fs=>fs.path!==m);Rs(Mn),sl(fs=>{var zl;return fs===m?((zl=Mn[Math.min(ft,Mn.length-1)])==null?void 0:zl.path)??null:fs})}function Ol(m,z=!1){const ce=Pl.current.find(Be=>Be.path===m);!ce||!de||!z&&!ti(ce)||(ka.current.set(m,ce.text),u({type:"fs.write",workspaceId:de,path:m,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...z?{force:!0}:{}}))}function oc(m){de&&u({type:"fs.read",workspaceId:de,path:m})}function La(m){de&&(Sa.current.has(m)||(Sa.current.add(m),u({type:"fs.readMedia",workspaceId:de,path:m})))}const Fn=b.useRef(new Map);function uc(m){const z=Fn.current,ce=z.get(m);ce&&clearTimeout(ce);const Be=(Tt==null?void 0:Tt.autoSaveAfterPauseMs)??0;Be<=0||z.set(m,setTimeout(()=>{z.delete(m);const ft=Pl.current.find(Mn=>Mn.path===m);ft&&ti(ft)&&!ft.stale&&Ol(m)},Be))}function Bu(m,z,ce){if(!de)return;const Be=m?`${m}/${ce}`:ce;Nl(null),z==="file"&&(Na.current=Be),u({type:"fs.create",workspaceId:de,path:Be,kind:z})}function Rf(m,z){if(!de)return;const ce=Or(m),Be=ce?`${ce}/${z}`:z;Nl(null),fl.current={from:m,to:Be},u({type:"fs.rename",workspaceId:de,path:m,to:Be})}function Df(m,z){if(!de)return;const ce=m.slice(m.lastIndexOf("/")+1),Be=z?`${z}/${ce}`:ce;Be!==m&&(Nl(null),fl.current={from:m,to:Be},u({type:"fs.rename",workspaceId:de,path:m,to:Be}))}function Of(m,z){de&&(Nl(null),u({type:"fs.copy",workspaceId:de,path:m,toDir:z}))}function Nn(m){de&&(Nl(null),qr(null),u({type:"fs.delete",workspaceId:de,path:m.path}),Rs(z=>z.filter(ce=>ce.path!==m.path&&!ce.path.startsWith(`${m.path}/`))),sl(z=>z&&(z===m.path||z.startsWith(`${m.path}/`))?null:z))}function yo(){nl({}),Ql([""]),Rs([]),sl(null),Nl(null),no(null),lo(null),wu({}),so({}),ao(null),Wr.current.clear(),ka.current.clear(),Sa.current.clear(),Vr.current=null,fl.current=null,Na.current=null}function fr(){!de||Fr||!ll||(Kr(null),Pr.current=!0,u({type:"term.open",workspaceId:de,cols:80,rows:24}))}function hr(m){u({type:"term.close",id:m})}b.useEffect(()=>{function m(z){if(z.key!=="Escape")return;if(xn!==null){const Be=z.target;if(!(Be instanceof HTMLElement&&Be.closest(".termview, .editor, .sidepane"))){hi(null);return}}if(!oe||On.pending.length>0)return;const ce=z.target;ce instanceof HTMLElement&&ce.closest('.sidepane, .editor, .session-pane, [role="dialog"], [role="menu"]')||u({type:"control.interrupt",sessionId:oe})}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[oe,On.pending.length,u,xn]),b.useEffect(()=>{function m(z){z.key!=="`"||!(z.ctrlKey||z.metaKey)||ll&&(z.preventDefault(),io(ce=>!ce))}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[ll]);const vo=b.useMemo(()=>{const m=(qe==null?void 0:qe.commands)??[];return m.length===0||(se==null?void 0:se.provider)!=="claude"?m:[...m,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...wp]},[qe,se==null?void 0:se.provider]);function ji(m){if((se==null?void 0:se.provider)==="codex"){if(m==="new"||m==="clear")return pl(se.workspaceId,"codex"),!0;if(m==="resume")return B.setView("command"),!0;if(m==="stop")return u({type:"control.interrupt",sessionId:se.id}),!0;if(m==="exit"||m==="quit")return u({type:"session.close",sessionId:se.id}),Lu(),!0}if(m==="fork"&&(se==null?void 0:se.provider)==="codex"&&oe&&!ml){const ce=se;return B.openConversation(ce),Rt(null),Bt(null),xt(ms),u({type:"session.start",workspaceId:ce.workspaceId,provider:"codex",resume:ce.id,fork:!0}),!0}const z=yE[m];return z&&(se==null?void 0:se.provider)==="claude"?(ws(z),!0):(se==null?void 0:se.provider)!=="claude"||!wp.some(ce=>ce.name===m)?!1:(Vs(),m==="logout"&&Xs.logout(),m==="switch-account"&&Xs.login("claudeai",!0),!0)}const wi=(se==null?void 0:se.state)==="waiting_permission",za=(se==null?void 0:se.state)==="reconnecting",ml=(se==null?void 0:se.state)==="running"||za||wi,ta=On.pending[0]??null,qu=ta?jy(ta.toolName,ta.input):null,[Ia,Gu]=b.useState(()=>new Set);ta&&Ia.has(ta.requestId),ta&&ta.questions&&ta.questions.length>0,b.useEffect(()=>{!ye&&!vs||!de||ml||u({type:"git.state",workspaceId:de})},[ye,vs,de,ml,u]),b.useEffect(()=>{if(!(ml||!de)){vs&&nl(m=>{const z={};for(const[ce,Be]of Object.entries(m))oo.current.includes(ce)||(z[ce]=Be);return z});for(const m of Pl.current)ti(m)||u({type:"fs.read",workspaceId:de,path:m.path})}},[ml,de,vs,u]),(se==null?void 0:se.cwd)??(qe==null||qe.cwd);const pr=(qe==null?void 0:qe.models)??[],mr=(se==null?void 0:se.model)??(qe==null?void 0:qe.model)??null,{rows:Ua,selected:jo}=S_(pr,mr),na=El?{model:El.model,effort:El.effort,ultracode:El.ultracode,thinking:El.thinking,switchOnFlag:El.switchModelsOnFlag}:{model:fi.model??mr,effort:fi.effort??(se==null?void 0:se.effort)??null,ultracode:fi.ultracode??(se==null?void 0:se.ultracode)??!1,thinking:fi.thinking??(se==null?void 0:se.thinking)??!0,switchOnFlag:fi.switchOnFlag??(se==null?void 0:se.switchModelsOnFlag)??!0},gr=S_(pr,na.model),$u=(El==null?void 0:El.state)==="running",dc=ci?ja.find(m=>m.path===ci)??null:null,Ha=new Set(ja.filter(ti).map(m=>m.path)),gl=m=>a.jsx(iE,{pane:m,width:ee.widths[m],onResize:z=>ee.setWidth(m,z),onReset:()=>ee.reset(m)}),Ba=m=>Lt?null:()=>Eu(m),Yu=(se==null?void 0:se.provider)==="codex"?G_:(se==null?void 0:se.provider)==="antigravity"?$_:Vp;qe&&(se==null||se.permissionMode,Yu.map(m=>({value:m.value,label:m.value,hint:m.hint}))),Ua.length>0&&(se==null||se.effort,se==null||se.ultracode,se==null||se.thinking,se==null||se.switchModelsOnFlag,se==null||se.provider,se==null||se.provider,se==null||se.provider),se==null||se.state;const qa=()=>{oe&&u({type:"session.reconnect",sessionId:oe})},xr=za?"Сессия уже поднимает новый процесс":ml?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён";oe&&(za||(se==null||se.state));const fc=il?a.jsx(FS,{handoff:il,onContinue:()=>po(il),onShow:()=>yn(il),onDismiss:()=>cc(il.sessionId)}):null;se&&se.totalCostUsd>0&&`${se.totalCostUsd.toFixed(3)}`,se==null||se.provider,se&&se.state;const Ll=se?nt[se.id]===!0:!1,ki=Dv({onLongPress:()=>{se&&$s(se)},onClick:()=>{se&&yi(se)},disabled:Ll});se&&se.state!=="closed"&&se.provider==="claude"&&{className:Ll||ki.holding,style:`${ki.thresholdMs}`,...ki.handlers};const Vu=dc?a.jsxs(a.Fragment,{children:[ja.length>0&&a.jsx(m1,{files:ja,activePath:ci,busy:ml,onSelect:sl,onClose:m=>dr(m),zoomed:xn==="main",onToggleZoom:Ba("main")}),a.jsx(h1,{file:dc,goto:(ui==null?void 0:ui.path)===dc.path?ui:null,onChange:(m,z)=>{Rs(ce=>ce.map(Be=>Be.path===m?{...Be,text:z}:Be)),uc(m)},onSave:m=>Ol(m),onReload:oc,onOverwrite:m=>Ol(m,!0),onRequestMedia:La,onTogglePreview:m=>Rs(z=>z.map(ce=>ce.path===m?{...ce,previewMode:!ce.previewMode}:ce))})]}):void 0,Ga=a.jsx(a.Fragment,{children:er&&ll&&a.jsxs(a.Fragment,{children:[!Lt&&xn!=="terminal"&&a.jsx(cE,{height:Zr.height,onResize:Zr.setHeight,onReset:Zr.reset}),a.jsx(fE,{mobile:Lt,zoomed:xn==="terminal",onToggleZoom:Ba("terminal"),terminals:Xr,activeId:Sf,blocked:Fr,error:Ef,onDismissError:()=>Kr(null),height:Lt?ro.height:Zr.height,offset:Lt?{top:ro.offsetTop,left:ro.offsetLeft}:void 0,onSelect:Qr,onOpen:fr,onClose:hr,onInput:(m,z)=>u({type:"term.input",id:m,data:z}),onResize:(m,z,ce)=>u({type:"term.resize",id:m,cols:z,rows:ce}),onAttach:m=>u({type:"term.attach",id:m}),onHide:()=>io(!1),registerSink:Nu})]})}),xl=Ee??Ke??de,sa=(m=!1)=>a.jsx(T1,{dashboard:m,onAllProjects:()=>{$e(!1),De("projects"),ut(null)},onCompareSession:z=>Ta(z,!0),open:m||Yn,connected:h,status:p,workspaces:Y,archivedWorkspaces:O,workspaceFolders:M,sessionFolders:re.filter(z=>z.workspaceId===xl),pinnedFolders:we,sessions:$.filter(z=>z.workspaceId===xl&&(Ie==="all"||z.provider===Ie)),archived:Q.filter(z=>z.workspaceId===xl&&(Ie==="all"||z.provider===Ie)),pinned:E.filter(z=>Ie==="all"||z.provider===Ie),live:xe.filter(z=>Ie==="all"||z.provider===Ie),listOrder:ot,liveSessionsFirst:(Tt==null?void 0:Tt.liveSessionsFirst)===!0,onReorder:ic,activeWorkspaceId:xl,activeSessionId:oe,onPinSessions:ir,onSelectPinned:Ta,onCloseWorkspaces:uo,onRestoreWorkspaces:tc,onArchiveSessions:rl,onUnarchiveSessions:z=>{xl&&u({type:"session.unarchive",workspaceId:xl,sessionIds:z})},onCreateFolder:Gs,onRenameFolder:_i,onSetFolderColor:fo,onDeleteFolder:nc,onAssignToFolder:sc,onSelectWorkspace:z=>{Ce(z),Ca(z)},onSelectSession:Ta,onRenameSession:cr,onStopSession:ac,onOpenWorkspace:()=>je(!0),onNewSession:z=>xl&&pl(xl,z),enabledProviders:Gt,onOpenExtensions:oe&&(se==null?void 0:se.provider)==="claude"?()=>ws("mcp"):null,account:Hs,onOpenAccount:Vs,relay:_,onOpenRelay:G?null:()=>A(!0),onOpenSettings:Ds,themeMode:As,onCycleTheme:C,navigation:a.jsx(bk,{hub:B})},m?xl:"navigation");return a.jsxs("div",{className:"app app--workspace",style:ee.style,children:[a.jsx(LN,{hub:B,workspaces:Y,selectedWorkspaceId:Ke,providers:Gt,providerFilter:Ie,onProviderFilter:Pe,tab:Z,onTab:m=>{De(m),m==="pinned"&&ut(null)},connected:h,status:p,hasConversations:!!oe||B.openedIds.length>0,onOpenSession:Ta,onSelectWorkspace:m=>{ut(m||null),De("sessions")},onNewSession:pl,onOpenWorkspace:()=>je(!0),onSettings:Ds,onAccount:Vs,onRelay:()=>A(!0),onTheme:C,onPin:m=>ir(m.workspaceId,[m.id],!m.pinned),onManageProject:m=>{Ce(m),$e(!0)}}),Oe&&a.jsx(gs,{title:Ee?"Управление проектом":"Папки и архив проектов",className:"modal--hub modal--project-manager",onClose:()=>$e(!1),children:sa(Ee!==null)}),a.jsx(Bw,{open:vs,tree:kn,expanded:new Set(va),activePath:ci,dirty:Ha,gitChanges:(ze==null?void 0:ze.changed)??[],result:Br,searchResult:kf,onSearch:or,onReveal:Dl,onToggle:bo,onOpen:ur,onCreate:Bu,onRename:Rf,onMove:Df,onCopy:Of,onDelete:qr,onRefresh:()=>{Nl(null),nl({}),go()},onClose:()=>Fi(!1),zoomed:xn==="files",onToggleZoom:Ba("files")}),vs&&xn!=="files"&&gl("files"),a.jsx(Fw,{open:Wi,result:Nf,onSearch:_o,onOpenMatch:ea,onClose:()=>Yr(!1),zoomed:xn==="search",onToggleZoom:Ba("search")}),Wi&&xn!=="search"&&gl("search"),a.jsx(ZN,{open:ye,state:ze,result:Cn,selected:In,busy:_a,onRefresh:go,onShow:Zn,onCheckout:Jt,onPush:Jl,onPull:Qs,onPublish:xo,onConnectRemote:Hu,onDismissResult:()=>St(null),onClose:()=>Te(!1),zoomed:xn==="git",onToggleZoom:Ba("git")}),ye&&xn!=="git"&&gl("git"),a.jsx(TN,{controller:R,sessions:B.sessions,visibleIds:B.openedIds.filter(m=>B.sessions[m]&&(Ie==="all"||B.sessions[m].provider===Ie)),onClose:m=>{R.close(m),B.closeConversation(m),m===oe&&Lu()},renderSession:m=>a.jsxs(NN,{sessionId:m,hub:B,workspaces:Y,connected:h,networkBlocked:k,terminalEnabled:ll,onTool:ho,onStop:ac,onPin:z=>ir(z.workspaceId,[z.id],!z.pinned),onClose:()=>{R.close(m),B.closeConversation(m)},onSend:(z,ce)=>zu(ce,z),onCommand:(z,ce)=>z.provider==="claude"&&["mcp","plugins","plugin"].includes(ce)?(ho(z,"extensions"),!0):z.provider==="claude"&&wp.some(Be=>Be.name===ce)?(Vs(),!0):!1,editor:oe===m?Vu:void 0,footer:oe===m?Ga:void 0,className:oe===m&&(xn==="main"||xn==="terminal")?"main--zoomed":void 0,children:[y&&k&&a.jsx(JS,{state:y}),oe===m&&fc]})}),a.jsx(bS,{open:Kl,items:Su.items,busy:$u,ready:oe!==null,sendBlocked:k,commands:vo,contextResult:Rl,draftKey:oe,models:gr.rows,model:gr.selected,effort:na.effort,ultracode:na.ultracode,thinking:na.thinking,switchOnFlag:na.switchOnFlag,onContextSearch:m=>Oa("side",m),onCommand:ji,onModel:m=>{m&&(al(z=>({...z,model:m})),Ra(z=>u({type:"control.set_model",sessionId:z,model:m})))},onEffort:m=>{al(z=>({...z,effort:m,ultracode:!1})),Ra(z=>u({type:"control.set_effort",sessionId:z,effort:m}))},onUltracode:m=>{al(z=>({...z,ultracode:m,...m?{effort:"xhigh"}:{}})),Ra(z=>u({type:"control.set_ultracode",sessionId:z,enabled:m}))},onThinking:m=>{al(z=>({...z,thinking:m})),Ra(z=>u({type:"control.set_thinking",sessionId:z,enabled:m}))},onSwitchOnFlag:m=>{al(z=>({...z,switchOnFlag:m})),Ra(z=>u({type:"control.set_flag_switch",sessionId:z,enabled:m}))},onAsk:Iu,onInterrupt:()=>{co&&u({type:"control.interrupt",sessionId:co})},onReset:mo,onClose:()=>di(!1),zoomed:xn==="ask",onToggleZoom:Ba("ask")}),Kl&&xn!=="ask"&&gl("ask"),(ye||Kl||vs||Wi)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{Te(!1),di(!1),Fi(!1),Yr(!1)}}),$t&&a.jsx(WN,{detail:$t,local:((ze==null?void 0:ze.hasRemote)??!1)&&(ze==null?void 0:ze.commits.some(m=>m.hash===$t.hash&&!m.pushed))===!0,onCheckout:Jt,onClose:()=>{mt(null),it(null)}}),He&&a.jsxs(gs,{title:"Лимит плана почти исчерпан",onClose:()=>rr(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>rr(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>rr(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[bf[He.warning.limit][0].toUpperCase(),bf[He.warning.limit].slice(1)," использован на"," ",Math.round(He.warning.utilization)," %, сброс в"," ",lE(He.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),Re&&a.jsx(gs,{title:"Остановить сессию?",onClose:()=>me(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>me(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{u({type:"session.close",sessionId:Re.id}),me(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Bs&&a.jsxs(gs,{title:"Переключить рабочее дерево?",onClose:()=>qs(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>qs(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:_t,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",Bs.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),ml&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),ze&&ze.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",ze.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Xl&&a.jsx(fS,{status:Hr,owners:tl,files:pe,defaultName:(ec==null?void 0:ec.name)??"",hasCommits:ze===null||ze.head!=="",busy:_a,result:Cn,onRefreshStatus:Da,onSaveToken:vi,onPublish:Wl,onDismissResult:()=>St(null),onClose:()=>S(!1)}),bt&&a.jsx(xS,{busy:_a,result:Cn,onSubmit:Uu,onDismissResult:()=>St(null),onClose:()=>Kn(!1)}),Pi&&a.jsx(gs,{title:Pi.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>qr(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>qr(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Nn(Pi),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[Pi.path," будет удалён с диска",Pi.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Ji&&a.jsx(gs,{title:"Закрыть без сохранения?",onClose:()=>oi(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>oi(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>dr(Ji,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Ol(Ji),dr(Ji,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Ji," есть несохранённые правки."]})}),an&&a.jsx(yS,{tab:an,servers:ys,plugins:is,marketplaces:lt,catalog:Es,result:Cs,auth:cs,remote:G,actions:Ys,onTab:Et,onClose:()=>Et(null)}),Us&&a.jsx(CS,{status:Hs,login:Yl,actions:Xs,remote:G,runningSessions:$.filter(m=>m.state==="running"||m.state==="waiting_permission").length,onReconnect:oe?()=>{qa(),es(!1)}:null,reconnectBlocked:ml,reconnectHint:xr,onClose:()=>es(!1)}),T&&a.jsx(OS,{state:_,onPair:(m,z)=>u({type:"relay.pair",code:m,...z?{name:z}:{}}),onUnpair:()=>u({type:"relay.unpair"}),onClose:()=>A(!1)}),ii&&a.jsx(KS,{themeMode:As,onThemeChange:Ne,settings:Tt,supportsProviderDefaults:B.supportsProviderDefaults,models:(se==null?void 0:se.provider)==="claude"?(qe==null?void 0:qe.models)??[]:[],providerModels:Object.fromEntries(["claude","codex","antigravity"].map(m=>{var z;return[m,((z=Object.entries(B.capabilities).find(([ce,Be])=>{var ft;return((ft=B.sessions[ce])==null?void 0:ft.provider)===m&&Be.models.length}))==null?void 0:z[1].models)??((se==null?void 0:se.provider)===m?(qe==null?void 0:qe.models)??[]:[])]})),relayState:_,networkState:y,local:nf()==="local",onChange:Ml,onEnableShell:()=>u({type:"relay.shell.enable"}),onDisableShell:()=>u({type:"relay.shell.disable"}),onOpenRelay:()=>{xa(!1),A(!0)},onClose:()=>xa(!1)}),ie&&a.jsx(UN,{candidates:Xe,searching:Je,agentItems:Vn.items,agentBusy:(un==null?void 0:un.state)==="running",error:zt,roots:fe,created:Ze,onSearch:Af,onAskAgent:Mf,onInterrupt:()=>{const m=Fl.current;m&&u({type:"control.interrupt",sessionId:m})},onSubmit:Du,onCreate:Cf,onClose:Ou}),Pt&&a.jsx(PS,{handoff:Pt,onClose:()=>yn(null)}),a.jsx(_k,{providerFilter:Ie,hub:B,connected:h,workspaces:Y,activeWorkspaceId:de,activeSession:se,providers:Gt,onSelectSession:Ta,onSelectWorkspace:Ca,onOpenWorkspace:()=>{B.setView(null),je(!0)},onOpenSettings:()=>{B.setView(null),Ds()},onOpenFiles:()=>{B.setView(null),Fi(!0),Yr(!1),Te(!1)},onNewSession:pl,onStartStage:lc}),a.jsx(tE,{notices:Tn,onDismiss:m=>wl(z=>z.filter(ce=>ce.id!==m))})]})}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,hn as I,mn as N,CE as P,vl as T,$l as a,iy as b,Ws as c,TE as d,dy as e,mu as f,ww as h,AE as p,ME as s,Le as t};