@i14ks/ccv 0.29.0 → 0.30.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.
- package/README.md +33 -16
- package/bundle/ccv.mjs +178 -34
- package/package.json +1 -1
- package/web/assets/{codemirror-CDWDRYM6.js → codemirror-C4z5XNW9.js} +1 -1
- package/web/assets/{index-ChI_MBJ6.js → index-9Nat9dSu.js} +1 -1
- package/web/assets/{index-Ca9uYBli.js → index-BLhz6Q_f.js} +1 -1
- package/web/assets/index-C1aD9jbe.js +143 -0
- package/web/assets/{index-C01LPRKQ.js → index-C3JSbs5Y.js} +1 -1
- package/web/assets/{index-BnBusVyC.js → index-CQi4R7CF.js} +1 -1
- package/web/assets/{index-QKzVwILH.js → index-CTg1EwJA.js} +1 -1
- package/web/assets/{index-DP031YpP.js → index-Ca4B7wAH.js} +1 -1
- package/web/assets/{index-DlcxNT3u.js → index-Cbicy5d2.js} +1 -1
- package/web/assets/{index-BRmKWLDC.js → index-Cc5e0VaU.js} +1 -1
- package/web/assets/{index-DgD9cb9g.js → index-Cxys5D35.js} +1 -1
- package/web/assets/{index-hRb8ersw.js → index-DL40CFHz.js} +1 -1
- package/web/assets/{index-BUfKKp57.js → index-DfPLp5-Q.js} +1 -1
- package/web/assets/{index-CbA_-czu.js → index-DuO49xlq.js} +1 -1
- package/web/assets/{index-B_iQhvb3.js → index-DztFqv4C.js} +1 -1
- package/web/assets/{index-qjyqA6zd.js → index-K29cA4S6.js} +1 -1
- package/web/assets/{index-iahStfDc.js → index-bPu_gqaI.js} +1 -1
- package/web/assets/{index-D6qzdOs0.js → index-lk4qxiUA.js} +1 -1
- package/web/assets/{index-Dru7wmxV.js → index-po2296dn.js} +1 -1
- package/web/assets/{index-Cy2389er.css → index-txYMazKF.css} +1 -1
- package/web/assets/{index-DikEtRL5.js → index-u00xWQNg.js} +1 -1
- package/web/assets/{index-CwNolSfU.js → index-zXz6X_ro.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-BFpQjWPN.js +0 -143
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-qjyqA6zd.js","./index-DgD9cb9g.js","./index-CbA_-czu.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-BRmKWLDC.js","./index-BUfKKp57.js","./index-Dru7wmxV.js","./index-iahStfDc.js","./index-DlcxNT3u.js","./index-B_iQhvb3.js","./index-hRb8ersw.js","./index-BnBusVyC.js","./index-C01LPRKQ.js","./index-D6qzdOs0.js","./index-DikEtRL5.js","./index-DP031YpP.js","./index-ChI_MBJ6.js","./index-QKzVwILH.js","./index-Ca9uYBli.js","./index-CwNolSfU.js","./codemirror-CDWDRYM6.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 G0=Object.defineProperty;var Ix=n=>{throw TypeError(n)};var $0=(n,l,r)=>l in n?G0(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r;var Zt=(n,l,r)=>$0(n,typeof l!="symbol"?l+"":l,r),qh=(n,l,r)=>l.has(n)||Ix("Cannot "+r);var We=(n,l,r)=>(qh(n,l,"read from private field"),r?r.call(n):l.get(n)),jn=(n,l,r)=>l.has(n)?Ix("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,r),zt=(n,l,r,c)=>(qh(n,l,"write to private field"),c?c.call(n,r):l.set(n,r),r),$n=(n,l,r)=>(qh(n,l,"access private method"),r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.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 r(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=r(o);fetch(o.href,u)}})();var Gh={exports:{}},Fo={};/**
|
|
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 Ux;function Y0(){if(Ux)return Fo;Ux=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(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 p in o)p!=="key"&&(u[p]=o[p])}else u=o;return o=u.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:u}}return Fo.Fragment=l,Fo.jsx=r,Fo.jsxs=r,Fo}var Hx;function V0(){return Hx||(Hx=1,Gh.exports=Y0()),Gh.exports}var i=V0(),$h={exports:{}},ct={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Bx;function X0(){if(Bx)return ct;Bx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=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"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),_=Symbol.iterator;function S(T){return T===null||typeof T!="object"?null:(T=_&&T[_]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function D(T,K,de){this.props=T,this.context=K,this.refs=A,this.updater=de||k}D.prototype.isReactComponent={},D.prototype.setState=function(T,K){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,K,"setState")},D.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function q(){}q.prototype=D.prototype;function Q(T,K,de){this.props=T,this.context=K,this.refs=A,this.updater=de||k}var z=Q.prototype=new q;z.constructor=Q,E(z,D.prototype),z.isPureReactComponent=!0;var H=Array.isArray;function L(){}var U={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function R(T,K,de){var _e=de.ref;return{$$typeof:n,type:T,key:K,ref:_e!==void 0?_e:null,props:de}}function I(T,K){return R(T.type,K,T.props)}function G(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function se(T){var K={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(de){return K[de]})}var je=/\/+/g;function we(T,K){return typeof T=="object"&&T!==null&&T.key!=null?se(""+T.key):K.toString(36)}function Ne(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(L,L):(T.status="pending",T.then(function(K){T.status==="pending"&&(T.status="fulfilled",T.value=K)},function(K){T.status==="pending"&&(T.status="rejected",T.reason=K)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function Z(T,K,de,_e,Me){var ze=typeof T;(ze==="undefined"||ze==="boolean")&&(T=null);var Ve=!1;if(T===null)Ve=!0;else switch(ze){case"bigint":case"string":case"number":Ve=!0;break;case"object":switch(T.$$typeof){case n:case l:Ve=!0;break;case v:return Ve=T._init,Z(Ve(T._payload),K,de,_e,Me)}}if(Ve)return Me=Me(T),Ve=_e===""?"."+we(T,0):_e,H(Me)?(de="",Ve!=null&&(de=Ve.replace(je,"$&/")+"/"),Z(Me,K,de,"",function(pe){return pe})):Me!=null&&(G(Me)&&(Me=I(Me,de+(Me.key==null||T&&T.key===Me.key?"":(""+Me.key).replace(je,"$&/")+"/")+Ve)),K.push(Me)),1;Ve=0;var re=_e===""?".":_e+":";if(H(T))for(var Ye=0;Ye<T.length;Ye++)_e=T[Ye],ze=re+we(_e,Ye),Ve+=Z(_e,K,de,ze,Me);else if(Ye=S(T),typeof Ye=="function")for(T=Ye.call(T),Ye=0;!(_e=T.next()).done;)_e=_e.value,ze=re+we(_e,Ye++),Ve+=Z(_e,K,de,ze,Me);else if(ze==="object"){if(typeof T.then=="function")return Z(Ne(T),K,de,_e,Me);throw K=String(T),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Ve}function $(T,K,de){if(T==null)return T;var _e=[],Me=0;return Z(T,_e,"","",function(ze){return K.call(de,ze,Me++)}),_e}function ne(T){if(T._status===-1){var K=T._result;K=K(),K.then(function(de){(T._status===0||T._status===-1)&&(T._status=1,T._result=de)},function(de){(T._status===0||T._status===-1)&&(T._status=2,T._result=de)}),T._status===-1&&(T._status=0,T._result=K)}if(T._status===1)return T._result.default;throw T._result}var me=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},ke={map:$,forEach:function(T,K,de){$(T,function(){K.apply(this,arguments)},de)},count:function(T){var K=0;return $(T,function(){K++}),K},toArray:function(T){return $(T,function(K){return K})||[]},only:function(T){if(!G(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return ct.Activity=j,ct.Children=ke,ct.Component=D,ct.Fragment=r,ct.Profiler=o,ct.PureComponent=Q,ct.StrictMode=c,ct.Suspense=g,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,ct.__COMPILER_RUNTIME={__proto__:null,c:function(T){return U.H.useMemoCache(T)}},ct.cache=function(T){return function(){return T.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(T,K,de){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var _e=E({},T.props),Me=T.key;if(K!=null)for(ze in K.key!==void 0&&(Me=""+K.key),K)!V.call(K,ze)||ze==="key"||ze==="__self"||ze==="__source"||ze==="ref"&&K.ref===void 0||(_e[ze]=K[ze]);var ze=arguments.length-2;if(ze===1)_e.children=de;else if(1<ze){for(var Ve=Array(ze),re=0;re<ze;re++)Ve[re]=arguments[re+2];_e.children=Ve}return R(T.type,Me,_e)},ct.createContext=function(T){return T={$$typeof:h,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:u,_context:T},T},ct.createElement=function(T,K,de){var _e,Me={},ze=null;if(K!=null)for(_e in K.key!==void 0&&(ze=""+K.key),K)V.call(K,_e)&&_e!=="key"&&_e!=="__self"&&_e!=="__source"&&(Me[_e]=K[_e]);var Ve=arguments.length-2;if(Ve===1)Me.children=de;else if(1<Ve){for(var re=Array(Ve),Ye=0;Ye<Ve;Ye++)re[Ye]=arguments[Ye+2];Me.children=re}if(T&&T.defaultProps)for(_e in Ve=T.defaultProps,Ve)Me[_e]===void 0&&(Me[_e]=Ve[_e]);return R(T,ze,Me)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(T){return{$$typeof:p,render:T}},ct.isValidElement=G,ct.lazy=function(T){return{$$typeof:v,_payload:{_status:-1,_result:T},_init:ne}},ct.memo=function(T,K){return{$$typeof:x,type:T,compare:K===void 0?null:K}},ct.startTransition=function(T){var K=U.T,de={};U.T=de;try{var _e=T(),Me=U.S;Me!==null&&Me(de,_e),typeof _e=="object"&&_e!==null&&typeof _e.then=="function"&&_e.then(L,me)}catch(ze){me(ze)}finally{K!==null&&de.types!==null&&(K.types=de.types),U.T=K}},ct.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},ct.use=function(T){return U.H.use(T)},ct.useActionState=function(T,K,de){return U.H.useActionState(T,K,de)},ct.useCallback=function(T,K){return U.H.useCallback(T,K)},ct.useContext=function(T){return U.H.useContext(T)},ct.useDebugValue=function(){},ct.useDeferredValue=function(T,K){return U.H.useDeferredValue(T,K)},ct.useEffect=function(T,K){return U.H.useEffect(T,K)},ct.useEffectEvent=function(T){return U.H.useEffectEvent(T)},ct.useId=function(){return U.H.useId()},ct.useImperativeHandle=function(T,K,de){return U.H.useImperativeHandle(T,K,de)},ct.useInsertionEffect=function(T,K){return U.H.useInsertionEffect(T,K)},ct.useLayoutEffect=function(T,K){return U.H.useLayoutEffect(T,K)},ct.useMemo=function(T,K){return U.H.useMemo(T,K)},ct.useOptimistic=function(T,K){return U.H.useOptimistic(T,K)},ct.useReducer=function(T,K,de){return U.H.useReducer(T,K,de)},ct.useRef=function(T){return U.H.useRef(T)},ct.useState=function(T){return U.H.useState(T)},ct.useSyncExternalStore=function(T,K,de){return U.H.useSyncExternalStore(T,K,de)},ct.useTransition=function(){return U.H.useTransition()},ct.version="19.2.8",ct}var qx;function Rp(){return qx||(qx=1,$h.exports=X0()),$h.exports}var b=Rp(),Yh={exports:{}},Jo={},Vh={exports:{}},Xh={};/**
|
|
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 Gx;function Q0(){return Gx||(Gx=1,(function(n){function l(Z,$){var ne=Z.length;Z.push($);e:for(;0<ne;){var me=ne-1>>>1,ke=Z[me];if(0<o(ke,$))Z[me]=$,Z[ne]=ke,ne=me;else break e}}function r(Z){return Z.length===0?null:Z[0]}function c(Z){if(Z.length===0)return null;var $=Z[0],ne=Z.pop();if(ne!==$){Z[0]=ne;e:for(var me=0,ke=Z.length,T=ke>>>1;me<T;){var K=2*(me+1)-1,de=Z[K],_e=K+1,Me=Z[_e];if(0>o(de,ne))_e<ke&&0>o(Me,de)?(Z[me]=Me,Z[_e]=ne,me=_e):(Z[me]=de,Z[K]=ne,me=K);else if(_e<ke&&0>o(Me,ne))Z[me]=Me,Z[_e]=ne,me=_e;else break e}}return $}function o(Z,$){var ne=Z.sortIndex-$.sortIndex;return ne!==0?ne:Z.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,p=h.now();n.unstable_now=function(){return h.now()-p}}var g=[],x=[],v=1,j=null,_=3,S=!1,k=!1,E=!1,A=!1,D=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function z(Z){for(var $=r(x);$!==null;){if($.callback===null)c(x);else if($.startTime<=Z)c(x),$.sortIndex=$.expirationTime,l(g,$);else break;$=r(x)}}function H(Z){if(E=!1,z(Z),!k)if(r(g)!==null)k=!0,L||(L=!0,se());else{var $=r(x);$!==null&&Ne(H,$.startTime-Z)}}var L=!1,U=-1,V=5,R=-1;function I(){return A?!0:!(n.unstable_now()-R<V)}function G(){if(A=!1,L){var Z=n.unstable_now();R=Z;var $=!0;try{e:{k=!1,E&&(E=!1,q(U),U=-1),S=!0;var ne=_;try{t:{for(z(Z),j=r(g);j!==null&&!(j.expirationTime>Z&&I());){var me=j.callback;if(typeof me=="function"){j.callback=null,_=j.priorityLevel;var ke=me(j.expirationTime<=Z);if(Z=n.unstable_now(),typeof ke=="function"){j.callback=ke,z(Z),$=!0;break t}j===r(g)&&c(g),z(Z)}else c(g);j=r(g)}if(j!==null)$=!0;else{var T=r(x);T!==null&&Ne(H,T.startTime-Z),$=!1}}break e}finally{j=null,_=ne,S=!1}$=void 0}}finally{$?se():L=!1}}}var se;if(typeof Q=="function")se=function(){Q(G)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,we=je.port2;je.port1.onmessage=G,se=function(){we.postMessage(null)}}else se=function(){D(G,0)};function Ne(Z,$){U=D(function(){Z(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(Z){Z.callback=null},n.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<Z?Math.floor(1e3/Z):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(Z){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var ne=_;_=$;try{return Z()}finally{_=ne}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(Z,$){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ne=_;_=Z;try{return $()}finally{_=ne}},n.unstable_scheduleCallback=function(Z,$,ne){var me=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?me+ne:me):ne=me,Z){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=ne+ke,Z={id:v++,callback:$,priorityLevel:Z,startTime:ne,expirationTime:ke,sortIndex:-1},ne>me?(Z.sortIndex=ne,l(x,Z),r(g)===null&&Z===r(x)&&(E?(q(U),U=-1):E=!0,Ne(H,ne-me))):(Z.sortIndex=ke,l(g,Z),k||S||(k=!0,L||(L=!0,se()))),Z},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(Z){var $=_;return function(){var ne=_;_=$;try{return Z.apply(this,arguments)}finally{_=ne}}}})(Xh)),Xh}var $x;function K0(){return $x||($x=1,Vh.exports=Q0()),Vh.exports}var Qh={exports:{}},Es={};/**
|
|
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 Yx;function Z0(){if(Yx)return Es;Yx=1;var n=Rp();function l(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)x+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,x,v){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:x,implementation:v}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Es.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Es.createPortal=function(g,x){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(l(299));return u(g,x,null,v)},Es.flushSync=function(g){var x=h.T,v=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=v,c.d.f()}},Es.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(g,x))},Es.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},Es.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var v=x.as,j=p(v,x.crossOrigin),_=typeof x.integrity=="string"?x.integrity:void 0,S=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;v==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:_,fetchPriority:S}):v==="script"&&c.d.X(g,{crossOrigin:j,integrity:_,fetchPriority:S,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Es.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var v=p(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(g)},Es.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var v=x.as,j=p(v,x.crossOrigin);c.d.L(g,v,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Es.preloadModule=function(g,x){if(typeof g=="string")if(x){var v=p(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},Es.requestFormReset=function(g){c.d.r(g)},Es.unstable_batchedUpdates=function(g,x){return g(x)},Es.useFormState=function(g,x,v){return h.H.useFormState(g,x,v)},Es.useFormStatus=function(){return h.H.useHostTransitionStatus()},Es.version="19.2.8",Es}var Vx;function b_(){if(Vx)return Qh.exports;Vx=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(l){console.error(l)}}return n(),Qh.exports=Z0(),Qh.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 Xx;function F0(){if(Xx)return Jo;Xx=1;var n=K0(),l=Rp(),r=b_();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s: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 p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,a=t;;){var d=s.return;if(d===null)break;var f=d.alternate;if(f===null){if(a=d.return,a!==null){s=a;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===s)return g(d),e;if(f===a)return g(d),t;f=f.sibling}throw Error(c(188))}if(s.return!==a.return)s=d,a=f;else{for(var y=!1,w=d.child;w;){if(w===s){y=!0,s=d,a=f;break}if(w===a){y=!0,a=d,s=f;break}w=w.sibling}if(!y){for(w=f.child;w;){if(w===s){y=!0,s=f,a=d;break}if(w===a){y=!0,a=f,s=d;break}w=w.sibling}if(!y)throw Error(c(189))}}if(s.alternate!==a)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,_=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var je=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case D:return"Profiler";case A:return"StrictMode";case H:return"Suspense";case L:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case Q:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var Ne=Array.isArray,Z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},me=[],ke=-1;function T(e){return{current:e}}function K(e){0>ke||(e.current=me[ke],me[ke]=null,ke--)}function de(e,t){ke++,me[ke]=e.current,e.current=t}var _e=T(null),Me=T(null),ze=T(null),Ve=T(null);function re(e,t){switch(de(ze,t),de(Me,e),de(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ax(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ax(t),e=rx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(_e),de(_e,e)}function Ye(){K(_e),K(Me),K(ze)}function pe(e){e.memoizedState!==null&&de(Ve,e);var t=_e.current,s=rx(t,e.type);t!==s&&(de(Me,e),de(_e,s))}function Ge(e){Me.current===e&&(K(_e),K(Me)),Ve.current===e&&(K(Ve),Xo._currentValue=ne)}var dt,nt;function bt(e){if(dt===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);dt=t&&t[1]||"",nt=-1<s.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+dt+e+nt}var Xe=!1;function Ct(e,t){if(!e||Xe)return"";Xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(le){var te=le}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(le){te=le}e.call(ge.prototype)}}else{try{throw Error()}catch(le){te=le}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(le){if(le&&te&&typeof le.stack=="string")return[le.stack,te.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),y=f[0],w=f[1];if(y&&w){var M=y.split(`
|
|
45
|
-
`),W=w.split(`
|
|
46
|
-
`);for(d=a=0;a<M.length&&!M[a].includes("DetermineComponentFrameRoot");)a++;for(;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;if(a===M.length||d===W.length)for(a=M.length-1,d=W.length-1;1<=a&&0<=d&&M[a]!==W[d];)d--;for(;1<=a&&0<=d;a--,d--)if(M[a]!==W[d]){if(a!==1||d!==1)do if(a--,d--,0>d||M[a]!==W[d]){var oe=`
|
|
47
|
-
`+M[a].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=a&&0<=d);break}}}finally{Xe=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?bt(s):""}function ee(e,t){switch(e.tag){case 26:case 27:case 5:return bt(e.type);case 16:return bt("Lazy");case 13:return e.child!==t&&t!==null?bt("Suspense Fallback"):bt("Suspense");case 19:return bt("SuspenseList");case 0:case 15:return Ct(e.type,!1);case 11:return Ct(e.type.render,!1);case 1:return Ct(e.type,!0);case 31:return bt("Activity");default:return""}}function Ze(e){try{var t="",s=null;do t+=ee(e,s),s=e,e=e.return;while(e);return t}catch(a){return`
|
|
48
|
-
Error generating stack: `+a.message+`
|
|
49
|
-
`+a.stack}}var st=Object.prototype.hasOwnProperty,Be=n.unstable_scheduleCallback,Fe=n.unstable_cancelCallback,De=n.unstable_shouldYield,ut=n.unstable_requestPaint,Ce=n.unstable_now,kt=n.unstable_getCurrentPriorityLevel,Ft=n.unstable_ImmediatePriority,Ht=n.unstable_UserBlockingPriority,nn=n.unstable_NormalPriority,fn=n.unstable_LowPriority,_n=n.unstable_IdlePriority,wn=n.log,St=n.unstable_setDisableYieldValue,ft=null,$t=null;function Cn(e){if(typeof wn=="function"&&St(e),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(ft,e)}catch{}}var At=Math.clz32?Math.clz32:ye,hs=Math.log,ie=Math.LN2;function ye(e){return e>>>=0,e===0?32:31-(hs(e)/ie|0)|0}var He=256,lt=262144,Je=4194304;function sn(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 F(e,t,s){var a=e.pendingLanes;if(a===0)return 0;var d=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=a&134217727;return w!==0?(a=w&~f,a!==0?d=sn(a):(y&=w,y!==0?d=sn(y):s||(s=w&~e,s!==0&&(d=sn(s))))):(w=a&~f,w!==0?d=sn(w):y!==0?d=sn(y):s||(s=a&~e,s!==0&&(d=sn(s)))),d===0?0:t!==0&&t!==d&&(t&f)===0&&(f=d&-d,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:d}function he(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Se(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 Ie(){var e=Je;return Je<<=1,(Je&62914560)===0&&(Je=4194304),e}function gt(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function ps(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Us(e,t,s,a,d,f){var y=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var w=e.entanglements,M=e.expirationTimes,W=e.hiddenUpdates;for(s=y&~s;0<s;){var oe=31-At(s),ge=1<<oe;w[oe]=0,M[oe]=-1;var te=W[oe];if(te!==null)for(W[oe]=null,oe=0;oe<te.length;oe++){var le=te[oe];le!==null&&(le.lane&=-536870913)}s&=~ge}a!==0&&Ws(e,a,0),f!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~t))}function Ws(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-At(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|s&261930}function As(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var a=31-At(s),d=1<<a;d&t|e[a]&t&&(e[a]|=t),s&=~d}}function Rs(e,t){var s=t&-t;return s=(s&42)!==0?1:Ms(s),(s&(e.suspendedLanes|t))!==0?0:s}function Ms(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 Jn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ji(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Ax(e.type))}function ms(e,t){var s=$.p;try{return $.p=e,t()}finally{$.p=s}}var gs=Math.random().toString(36).slice(2),hn="__reactFiber$"+gs,it="__reactProps$"+gs,Nn="__reactContainer$"+gs,el="__reactEvents$"+gs,Nl="__reactListeners$"+gs,tl="__reactHandles$"+gs,Hs="__reactResources$"+gs,Ln="__reactMarker$"+gs;function xs(e){delete e[hn],delete e[it],delete e[el],delete e[Nl],delete e[tl]}function Yt(e){var t=e[hn];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Nn]||s[hn]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=px(e);e!==null;){if(s=e[hn])return s;e=px(e)}return t}e=s,s=e.parentNode}return null}function Jt(e){if(e=e[hn]||e[Nn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ln(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function pn(e){var t=e[Hs];return t||(t=e[Hs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Ln]=!0}var Pn=new Set,is={};function as(e,t){Dt(e,t),Dt(e+"Capture",t)}function Dt(e,t){for(is[e]=t,e=0;e<t.length;e++)Pn.add(t[e])}var Xl=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]*$"),Vt={},bs={};function Wn(e){return st.call(bs,e)?!0:st.call(Vt,e)?!1:Xl.test(e)?bs[e]=!0:(Vt[e]=!0,!1)}function an(e,t,s){if(Wn(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function kn(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Vn(e,t,s,a){if(a===null)e.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+a)}}function Pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _s(e,t,s){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var d=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(y){s=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rs(e){if(!e._valueTracker){var t=kl(e)?"checked":"value";e._valueTracker=_s(e,t,""+e[t])}}function yn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),a="";return e&&(a=kl(e)?e.checked?"true":"false":e.value),e=a,e!==s?(t.setValue(e),!0):!1}function Sl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ql=/[\n"\\]/g;function An(e){return e.replace(Ql,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wi(e,t,s,a,d,f,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pt(t)):e.value!==""+Pt(t)&&(e.value=""+Pt(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?ys(e,y,Pt(t)):s!=null?ys(e,y,Pt(s)):a!=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=""+Pt(w):e.removeAttribute("name")}function nl(e,t,s,a,d,f,y,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){rs(e);return}s=s!=null?""+Pt(s):"",t=t!=null?""+Pt(t):s,w||t===e.value||(e.value=t),e.defaultValue=t}a=a??d,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=w?e.checked:!!a,e.defaultChecked=!!a,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),rs(e)}function ys(e,t,s){t==="number"&&Sl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function rn(e,t,s,a){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&a&&(e[s].defaultSelected=!0)}else{for(s=""+Pt(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,a&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function ve(e,t,s){if(t!=null&&(t=""+Pt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Pt(s):""}function C(e,t,s,a){if(t==null){if(a!=null){if(s!=null)throw Error(c(92));if(Ne(a)){if(1<a.length)throw Error(c(93));a=a[0]}s=a}s==null&&(s=""),t=s}s=Pt(t),e.defaultValue=s,a=e.textContent,a===s&&a!==""&&a!==null&&(e.value=a),rs(e)}function J(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var xe=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 Ee(e,t,s){var a=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,s):typeof s!="number"||s===0||xe.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function qe(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var a in s)!s.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var d in t)a=t[d],t.hasOwnProperty(d)&&s[d]!==a&&Ee(e,d,a)}else for(var f in t)t.hasOwnProperty(f)&&Ee(e,f,t[f])}function Qe(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 Xt=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"]]),_t=/^[\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 vn(e){return _t.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ht(){}var Rn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bs=null,gn=null;function qs(e){var t=Jt(e);if(t&&(e=t.stateNode)){var s=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(wi(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+An(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var a=s[t];if(a!==e&&a.form===e.form){var d=a[it]||null;if(!d)throw Error(c(90));wi(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<s.length;t++)a=s[t],a.form===e.form&&yn(a)}break e;case"textarea":ve(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&rn(e,!!s.multiple,t,!1)}}}var Gs=!1;function Kl(e,t,s){if(Gs)return e(t,s);Gs=!0;try{var a=e(t);return a}finally{if(Gs=!1,(Bs!==null||gn!==null)&&(id(),Bs&&(t=Bs,e=gn,gn=Bs=null,qs(t),e)))for(t=0;t<e.length;t++)qs(e[t])}}function vs(e,t){var s=e.stateNode;if(s===null)return null;var a=s[it]||null;if(a===null)return null;s=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var js=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mn=!1;if(js)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Mn=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Mn=!1}var N=null,ue=null,Oe=null;function at(){if(Oe)return Oe;var e,t=ue,s=t.length,a,d="value"in N?N.value:N.textContent,f=d.length;for(e=0;e<s&&t[e]===d[e];e++);var y=s-e;for(a=1;a<=y&&t[s-a]===d[f-a];a++);return Oe=d.slice(e,1<a?1-a:void 0)}function In(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 Ni(){return!0}function na(){return!1}function Xn(e){function t(s,a,d,f,y){this._reactName=s,this._targetInst=d,this.type=a,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(s=e[w],this[w]=s?s(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ni:na,this.isPropagationStopped=na,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ni)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ni)},persist:function(){},isPersistent:Ni}),t}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sa=Xn(ki),Zl=j({},ki,{view:0,detail:0}),bu=Xn(Zl),la,Lr,$s,sl=j({},Zl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qa,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!==$s&&($s&&e.type==="mousemove"?(la=e.screenX-$s.screenX,Lr=e.screenY-$s.screenY):Lr=la=0,$s=e),la)},movementY:function(e){return"movementY"in e?e.movementY:Lr}}),_u=Xn(sl),Wc=j({},sl,{dataTransfer:0}),zr=Xn(Wc),eo=j({},Zl,{relatedTarget:0}),Ir=Xn(eo),Ur=j({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),ia=Xn(Ur),to=j({},ki,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hr=Xn(to),Xa=j({},ki,{data:0}),yu=Xn(Xa),Br={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},qr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qr[e])?!!t[e]:!1}function Qa(){return Gr}var Ka=j({},Zl,{key:function(e){if(e.key){var t=Br[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=In(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qa,charCode:function(e){return e.type==="keypress"?In(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?In(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Si=Xn(Ka),$r=j({},sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yr=Xn($r),mf=j({},Zl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qa}),Fl=Xn(mf),Za=j({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),vu=Xn(Za),Vr=j({},sl,{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}),ju=Xn(Vr),Xr=j({},ki,{newState:0,oldState:0}),El=Xn(Xr),Qr=[9,13,27,32],Ei=js&&"CompositionEvent"in window,ll=null;js&&"documentMode"in document&&(ll=document.documentMode);var Fa=js&&"TextEvent"in window&&!ll,Bt=js&&(!Ei||ll&&8<ll&&11>=ll),Kr=" ",wu=!1;function Nu(e,t){switch(e){case"keyup":return Qr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ja(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var il=!1;function Un(e,t){switch(e){case"compositionend":return Ja(t);case"keypress":return t.which!==32?null:(wu=!0,Kr);case"textInput":return e=t.data,e===Kr&&wu?null:e;default:return null}}function Pa(e,t){if(il)return e==="compositionend"||!Ei&&Nu(e,t)?(e=at(),Oe=ue=N=null,il=!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 Bt&&t.locale!=="ko"?null:t.data;default:return null}}var Zr={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 no(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Zr[e.type]:t==="textarea"}function Dn(e,t,s,a){Bs?gn?gn.push(a):gn=[a]:Bs=a,t=fd(t,"onChange"),0<t.length&&(s=new sa("onChange","change",null,s,a),e.push({event:s,listeners:t}))}var aa=null,ra=null;function Tl(e){ex(e,0)}function Wa(e){var t=ln(e);if(yn(t))return e}function er(e,t){if(e==="change")return t}var tr=!1;if(js){var Ti;if(js){var Cl="oninput"in document;if(!Cl){var so=document.createElement("div");so.setAttribute("oninput","return;"),Cl=typeof so.oninput=="function"}Ti=Cl}else Ti=!1;tr=Ti&&(!document.documentMode||9<document.documentMode)}function ca(){aa&&(aa.detachEvent("onpropertychange",nr),ra=aa=null)}function nr(e){if(e.propertyName==="value"&&Wa(ra)){var t=[];Dn(t,ra,e,mn(e)),Kl(Tl,t)}}function sr(e,t,s){e==="focusin"?(ca(),aa=t,ra=s,aa.attachEvent("onpropertychange",nr)):e==="focusout"&&ca()}function lr(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wa(ra)}function ku(e,t){if(e==="click")return Wa(t)}function ir(e,t){if(e==="input"||e==="change")return Wa(t)}function gf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hn=typeof Object.is=="function"?Object.is:gf;function Ci(e,t){if(Hn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(a=0;a<s.length;a++){var d=s[a];if(!st.call(t,d)||!Hn(e[d],t[d]))return!1}return!0}function Su(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lo(e,t){var s=Su(e);e=0;for(var a;s;){if(s.nodeType===3){if(a=e+s.textContent.length,e<=t&&a>=t)return{node:s,offset:t-e};e=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Su(s)}}function Y(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Y(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oa(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Sl(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Sl(e.document)}return t}function Ai(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 Eu=js&&"documentMode"in document&&11>=document.documentMode,Ri=null,io=null,es=null,ao=!1;function Tu(e,t,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ao||Ri==null||Ri!==Sl(a)||(a=Ri,"selectionStart"in a&&Ai(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),es&&Ci(es,a)||(es=a,a=fd(io,"onSelect"),0<a.length&&(t=new sa("onSelect","select",null,t,s),e.push({event:t,listeners:a}),t.target=Ri)))}function Mi(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ua={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},ro={},Di={};js&&(Di=document.createElement("div").style,"AnimationEvent"in window||(delete ua.animationend.animation,delete ua.animationiteration.animation,delete ua.animationstart.animation),"TransitionEvent"in window||delete ua.transitionend.transition);function Oi(e){if(ro[e])return ro[e];if(!ua[e])return e;var t=ua[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Di)return ro[e]=t[s];return e}var Cu=Oi("animationend"),Au=Oi("animationiteration"),Ru=Oi("animationstart"),xf=Oi("transitionrun"),bf=Oi("transitionstart"),_f=Oi("transitioncancel"),Mu=Oi("transitionend"),co=new Map,Fr="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(" ");Fr.push("scrollEnd");function al(e,t){co.set(e,t),as(t,[e])}var Jr=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)},ws=[],dl=0,oo=0;function Pr(){for(var e=dl,t=oo=dl=0;t<e;){var s=ws[t];ws[t++]=null;var a=ws[t];ws[t++]=null;var d=ws[t];ws[t++]=null;var f=ws[t];if(ws[t++]=null,a!==null&&d!==null){var y=a.pending;y===null?d.next=d:(d.next=y.next,y.next=d),a.pending=d}f!==0&&Wr(s,d,f)}}function da(e,t,s,a){ws[dl++]=e,ws[dl++]=t,ws[dl++]=s,ws[dl++]=a,oo|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function uo(e,t,s,a){return da(e,t,s,a),ec(e)}function Al(e,t){return da(e,null,null,t),ec(e)}function Wr(e,t,s){e.lanes|=s;var a=e.alternate;a!==null&&(a.lanes|=s);for(var d=!1,f=e.return;f!==null;)f.childLanes|=s,a=f.alternate,a!==null&&(a.childLanes|=s),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-At(s),e=f.hiddenUpdates,a=e[d],a===null?e[d]=[t]:a.push(t),t.lane=s|536870912),f):null}function ec(e){if(50<Ho)throw Ho=0,dh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Li={};function fo(e,t,s,a){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ns(e,t,s,a){return new fo(e,t,s,a)}function tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fl(e,t){var s=e.alternate;return s===null?(s=Ns(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function ho(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function nc(e,t,s,a,d,f){var y=0;if(a=e,typeof e=="function")tc(e)&&(y=1);else if(typeof e=="string")y=A0(e,s,_e.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Ns(31,s,t,d),e.elementType=R,e.lanes=f,e;case E:return Jl(s.children,d,f,t);case A:y=8,d|=24;break;case D:return e=Ns(12,s,t,d|2),e.elementType=D,e.lanes=f,e;case H:return e=Ns(13,s,t,d),e.elementType=H,e.lanes=f,e;case L:return e=Ns(19,s,t,d),e.elementType=L,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:y=10;break e;case q:y=9;break e;case z:y=11;break e;case U:y=14;break e;case V:y=16,a=null;break e}y=29,s=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=Ns(y,s,t,d),t.elementType=e,t.type=a,t.lanes=f,t}function Jl(e,t,s,a){return e=Ns(7,e,a,t),e.lanes=s,e}function sc(e,t,s){return e=Ns(6,e,null,t),e.lanes=s,e}function Du(e){var t=Ns(18,null,null,0);return t.stateNode=e,t}function lc(e,t,s){return t=Ns(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ic=new WeakMap;function ks(e,t){if(typeof e=="object"&&e!==null){var s=ic.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ze(t)},ic.set(e,t),t)}return{value:e,source:t,stack:Ze(t)}}var fa=[],ha=0,ac=null,Rl=0,Ds=[],Ys=0,Ml=null,hl=1,pl="";function Dl(e,t){fa[ha++]=Rl,fa[ha++]=ac,ac=e,Rl=t}function Ou(e,t,s){Ds[Ys++]=hl,Ds[Ys++]=pl,Ds[Ys++]=Ml,Ml=e;var a=hl;e=pl;var d=32-At(a)-1;a&=~(1<<d),s+=1;var f=32-At(t)+d;if(30<f){var y=d-d%5;f=(a&(1<<y)-1).toString(32),a>>=y,d-=y,hl=1<<32-At(t)+d|s<<d|a,pl=f+e}else hl=1<<f|s<<d|a,pl=e}function po(e){e.return!==null&&(Dl(e,1),Ou(e,1,0))}function mo(e){for(;e===ac;)ac=fa[--ha],fa[ha]=null,Rl=fa[--ha],fa[ha]=null;for(;e===Ml;)Ml=Ds[--Ys],Ds[Ys]=null,pl=Ds[--Ys],Ds[Ys]=null,hl=Ds[--Ys],Ds[Ys]=null}function Lu(e,t){Ds[Ys++]=hl,Ds[Ys++]=pl,Ds[Ys++]=Ml,hl=t.id,pl=t.overflow,Ml=e}var Qn=null,Wt=null,yt=!1,Pl=null,Vs=!1,rc=Error(c(519));function Wl(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ei(ks(t,e)),rc}function zu(e){var t=e.stateNode,s=e.type,a=e.memoizedProps;switch(t[hn]=e,t[it]=a,s){case"dialog":jt("cancel",t),jt("close",t);break;case"iframe":case"object":case"embed":jt("load",t);break;case"video":case"audio":for(s=0;s<qo.length;s++)jt(qo[s],t);break;case"source":jt("error",t);break;case"img":case"image":case"link":jt("error",t),jt("load",t);break;case"details":jt("toggle",t);break;case"input":jt("invalid",t),nl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":jt("invalid",t);break;case"textarea":jt("invalid",t),C(t,a.value,a.defaultValue,a.children)}s=a.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||a.suppressHydrationWarning===!0||lx(t.textContent,s)?(a.popover!=null&&(jt("beforetoggle",t),jt("toggle",t)),a.onScroll!=null&&jt("scroll",t),a.onScrollEnd!=null&&jt("scrollend",t),a.onClick!=null&&(t.onclick=ht),t=!0):t=!1,t||Wl(e,!0)}function Iu(e){for(Qn=e.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:Vs=!1;return;case 27:case 3:Vs=!0;return;default:Qn=Qn.return}}function pa(e){if(e!==Qn)return!1;if(!yt)return Iu(e),yt=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Sh(e.type,e.memoizedProps)),s=!s),s&&Wt&&Wl(e),Iu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Wt=hx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Wt=hx(e)}else t===27?(t=Wt,Ta(e.type)?(e=Rh,Rh=null,Wt=e):Wt=t):Wt=Qn?bl(e.stateNode.nextSibling):null;return!0}function Ol(){Wt=Qn=null,yt=!1}function ar(){var e=Pl;return e!==null&&(Fs===null?Fs=e:Fs.push.apply(Fs,e),Pl=null),e}function ei(e){Pl===null?Pl=[e]:Pl.push(e)}var go=T(null),zi=null,Ll=null;function ti(e,t,s){de(go,t._currentValue),t._currentValue=s}function zl(e){e._currentValue=go.current,K(go)}function xo(e,t,s){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===s)break;e=e.return}}function bo(e,t,s,a){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var f=d.dependencies;if(f!==null){var y=d.child;f=f.firstContext;e:for(;f!==null;){var w=f;f=d;for(var M=0;M<t.length;M++)if(w.context===t[M]){f.lanes|=s,w=f.alternate,w!==null&&(w.lanes|=s),xo(f.return,s,e),a||(y=null);break e}f=w.next}}else if(d.tag===18){if(y=d.return,y===null)throw Error(c(341));y.lanes|=s,f=y.alternate,f!==null&&(f.lanes|=s),xo(y,s,e),y=null}else y=d.child;if(y!==null)y.return=d;else for(y=d;y!==null;){if(y===e){y=null;break}if(d=y.sibling,d!==null){d.return=y.return,y=d;break}y=y.return}d=y}}function ma(e,t,s,a){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 y=d.alternate;if(y===null)throw Error(c(387));if(y=y.memoizedProps,y!==null){var w=d.type;Hn(d.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(d===Ve.current){if(y=d.alternate,y===null)throw Error(c(387));y.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Xo):e=[Xo])}d=d.return}e!==null&&bo(t,e,s,a),t.flags|=262144}function cc(e){for(e=e.firstContext;e!==null;){if(!Hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ii(e){zi=e,Ll=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kn(e){return Uu(zi,e)}function oc(e,t){return zi===null&&Ii(e),Uu(e,t)}function Uu(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ll===null){if(e===null)throw Error(c(308));Ll=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ll=Ll.next=t;return s}var yf=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},vf=n.unstable_scheduleCallback,jf=n.unstable_NormalPriority,Sn={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uc(){return{controller:new yf,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&vf(jf,function(){e.controller.abort()})}var ni=null,Os=0,Zn=0,Ot=null;function _o(e,t){if(ni===null){var s=ni=[];Os=0,Zn=xh(),Ot={status:"pending",value:void 0,then:function(a){s.push(a)}}}return Os++,t.then(Hu,Hu),t}function Hu(){if(--Os===0&&ni!==null){Ot!==null&&(Ot.status="fulfilled");var e=ni;ni=null,Zn=0,Ot=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wf(e,t){var s=[],a={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var d=0;d<s.length;d++)(0,s[d])(t)},function(d){for(a.status="rejected",a.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),a}var rr=Z.S;Z.S=function(e,t){Tg=Ce(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_o(e,t),rr!==null&&rr(e,t)};var si=T(null);function xa(){var e=si.current;return e!==null?e:en.pooledCache}function ba(e,t){t===null?de(si,si.current):de(si,t.pool)}function yo(){var e=xa();return e===null?null:{parent:Sn._currentValue,pool:e}}var Il=Error(c(460)),dc=Error(c(474)),fc=Error(c(542)),li={then:function(){}};function vo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bu(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ht,ht),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bi(e),e;default:if(typeof t.status=="string")t.then(ht,ht);else{if(e=en,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=a}},function(a){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bi(e),e}throw Ui=t,Il}}function ml(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ui=s,Il):s}}var Ui=null;function Hi(){if(Ui===null)throw Error(c(459));var e=Ui;return Ui=null,e}function Bi(e){if(e===Il||e===fc)throw Error(c(483))}var _a=null,ya=0;function cr(e){var t=ya;return ya+=1,_a===null&&(_a=[]),Bu(_a,e,t)}function or(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hc(e,t){throw t.$$typeof===_?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function jo(e){function t(X,B){if(e){var P=X.deletions;P===null?(X.deletions=[B],X.flags|=16):P.push(B)}}function s(X,B){if(!e)return null;for(;B!==null;)t(X,B),B=B.sibling;return null}function a(X){for(var B=new Map;X!==null;)X.key!==null?B.set(X.key,X):B.set(X.index,X),X=X.sibling;return B}function d(X,B){return X=fl(X,B),X.index=0,X.sibling=null,X}function f(X,B,P){return X.index=P,e?(P=X.alternate,P!==null?(P=P.index,P<B?(X.flags|=67108866,B):P):(X.flags|=67108866,B)):(X.flags|=1048576,B)}function y(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function w(X,B,P,fe){return B===null||B.tag!==6?(B=sc(P,X.mode,fe),B.return=X,B):(B=d(B,P),B.return=X,B)}function M(X,B,P,fe){var $e=P.type;return $e===E?oe(X,B,P.props.children,fe,P.key):B!==null&&(B.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===V&&ml($e)===B.type)?(B=d(B,P.props),or(B,P),B.return=X,B):(B=nc(P.type,P.key,P.props,null,X.mode,fe),or(B,P),B.return=X,B)}function W(X,B,P,fe){return B===null||B.tag!==4||B.stateNode.containerInfo!==P.containerInfo||B.stateNode.implementation!==P.implementation?(B=lc(P,X.mode,fe),B.return=X,B):(B=d(B,P.children||[]),B.return=X,B)}function oe(X,B,P,fe,$e){return B===null||B.tag!==7?(B=Jl(P,X.mode,fe,$e),B.return=X,B):(B=d(B,P),B.return=X,B)}function ge(X,B,P){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=sc(""+B,X.mode,P),B.return=X,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case S:return P=nc(B.type,B.key,B.props,null,X.mode,P),or(P,B),P.return=X,P;case k:return B=lc(B,X.mode,P),B.return=X,B;case V:return B=ml(B),ge(X,B,P)}if(Ne(B)||se(B))return B=Jl(B,X.mode,P,null),B.return=X,B;if(typeof B.then=="function")return ge(X,cr(B),P);if(B.$$typeof===Q)return ge(X,oc(X,B),P);hc(X,B)}return null}function te(X,B,P,fe){var $e=B!==null?B.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return $e!==null?null:w(X,B,""+P,fe);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case S:return P.key===$e?M(X,B,P,fe):null;case k:return P.key===$e?W(X,B,P,fe):null;case V:return P=ml(P),te(X,B,P,fe)}if(Ne(P)||se(P))return $e!==null?null:oe(X,B,P,fe,null);if(typeof P.then=="function")return te(X,B,cr(P),fe);if(P.$$typeof===Q)return te(X,B,oc(X,P),fe);hc(X,P)}return null}function le(X,B,P,fe,$e){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return X=X.get(P)||null,w(B,X,""+fe,$e);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case S:return X=X.get(fe.key===null?P:fe.key)||null,M(B,X,fe,$e);case k:return X=X.get(fe.key===null?P:fe.key)||null,W(B,X,fe,$e);case V:return fe=ml(fe),le(X,B,P,fe,$e)}if(Ne(fe)||se(fe))return X=X.get(P)||null,oe(B,X,fe,$e,null);if(typeof fe.then=="function")return le(X,B,P,cr(fe),$e);if(fe.$$typeof===Q)return le(X,B,P,oc(B,fe),$e);hc(B,fe)}return null}function Le(X,B,P,fe){for(var $e=null,Rt=null,Ue=B,mt=B=0,Nt=null;Ue!==null&&mt<P.length;mt++){Ue.index>mt?(Nt=Ue,Ue=null):Nt=Ue.sibling;var Mt=te(X,Ue,P[mt],fe);if(Mt===null){Ue===null&&(Ue=Nt);break}e&&Ue&&Mt.alternate===null&&t(X,Ue),B=f(Mt,B,mt),Rt===null?$e=Mt:Rt.sibling=Mt,Rt=Mt,Ue=Nt}if(mt===P.length)return s(X,Ue),yt&&Dl(X,mt),$e;if(Ue===null){for(;mt<P.length;mt++)Ue=ge(X,P[mt],fe),Ue!==null&&(B=f(Ue,B,mt),Rt===null?$e=Ue:Rt.sibling=Ue,Rt=Ue);return yt&&Dl(X,mt),$e}for(Ue=a(Ue);mt<P.length;mt++)Nt=le(Ue,X,mt,P[mt],fe),Nt!==null&&(e&&Nt.alternate!==null&&Ue.delete(Nt.key===null?mt:Nt.key),B=f(Nt,B,mt),Rt===null?$e=Nt:Rt.sibling=Nt,Rt=Nt);return e&&Ue.forEach(function(Da){return t(X,Da)}),yt&&Dl(X,mt),$e}function Pe(X,B,P,fe){if(P==null)throw Error(c(151));for(var $e=null,Rt=null,Ue=B,mt=B=0,Nt=null,Mt=P.next();Ue!==null&&!Mt.done;mt++,Mt=P.next()){Ue.index>mt?(Nt=Ue,Ue=null):Nt=Ue.sibling;var Da=te(X,Ue,Mt.value,fe);if(Da===null){Ue===null&&(Ue=Nt);break}e&&Ue&&Da.alternate===null&&t(X,Ue),B=f(Da,B,mt),Rt===null?$e=Da:Rt.sibling=Da,Rt=Da,Ue=Nt}if(Mt.done)return s(X,Ue),yt&&Dl(X,mt),$e;if(Ue===null){for(;!Mt.done;mt++,Mt=P.next())Mt=ge(X,Mt.value,fe),Mt!==null&&(B=f(Mt,B,mt),Rt===null?$e=Mt:Rt.sibling=Mt,Rt=Mt);return yt&&Dl(X,mt),$e}for(Ue=a(Ue);!Mt.done;mt++,Mt=P.next())Mt=le(Ue,X,mt,Mt.value,fe),Mt!==null&&(e&&Mt.alternate!==null&&Ue.delete(Mt.key===null?mt:Mt.key),B=f(Mt,B,mt),Rt===null?$e=Mt:Rt.sibling=Mt,Rt=Mt);return e&&Ue.forEach(function(q0){return t(X,q0)}),yt&&Dl(X,mt),$e}function Kt(X,B,P,fe){if(typeof P=="object"&&P!==null&&P.type===E&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case S:e:{for(var $e=P.key;B!==null;){if(B.key===$e){if($e=P.type,$e===E){if(B.tag===7){s(X,B.sibling),fe=d(B,P.props.children),fe.return=X,X=fe;break e}}else if(B.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===V&&ml($e)===B.type){s(X,B.sibling),fe=d(B,P.props),or(fe,P),fe.return=X,X=fe;break e}s(X,B);break}else t(X,B);B=B.sibling}P.type===E?(fe=Jl(P.props.children,X.mode,fe,P.key),fe.return=X,X=fe):(fe=nc(P.type,P.key,P.props,null,X.mode,fe),or(fe,P),fe.return=X,X=fe)}return y(X);case k:e:{for($e=P.key;B!==null;){if(B.key===$e)if(B.tag===4&&B.stateNode.containerInfo===P.containerInfo&&B.stateNode.implementation===P.implementation){s(X,B.sibling),fe=d(B,P.children||[]),fe.return=X,X=fe;break e}else{s(X,B);break}else t(X,B);B=B.sibling}fe=lc(P,X.mode,fe),fe.return=X,X=fe}return y(X);case V:return P=ml(P),Kt(X,B,P,fe)}if(Ne(P))return Le(X,B,P,fe);if(se(P)){if($e=se(P),typeof $e!="function")throw Error(c(150));return P=$e.call(P),Pe(X,B,P,fe)}if(typeof P.then=="function")return Kt(X,B,cr(P),fe);if(P.$$typeof===Q)return Kt(X,B,oc(X,P),fe);hc(X,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,B!==null&&B.tag===6?(s(X,B.sibling),fe=d(B,P),fe.return=X,X=fe):(s(X,B),fe=sc(P,X.mode,fe),fe.return=X,X=fe),y(X)):s(X,B)}return function(X,B,P,fe){try{ya=0;var $e=Kt(X,B,P,fe);return _a=null,$e}catch(Ue){if(Ue===Il||Ue===fc)throw Ue;var Rt=Ns(29,Ue,null,X.mode);return Rt.lanes=fe,Rt.return=X,Rt}finally{}}}var ii=jo(!0),qu=jo(!1),ai=!1;function wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ur(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 Ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ri(e,t,s){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Lt&2)!==0){var d=a.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),a.pending=t,t=ec(e),Wr(e,null,s),t}return da(e,a,t,s),ec(e)}function gl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,s|=a,t.lanes=s,As(e,s)}}function dr(e,t){var s=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,s===a)){var d=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?d=f=y:f=f.next=y,s=s.next}while(s!==null);f===null?d=f=t:f=f.next=t}else d=f=t;s={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var No=!1;function fr(){if(No){var e=Ot;if(e!==null)throw e}}function hr(e,t,s,a){No=!1;var d=e.updateQueue;ai=!1;var f=d.firstBaseUpdate,y=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var M=w,W=M.next;M.next=null,y===null?f=W:y.next=W,y=M;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,w=oe.lastBaseUpdate,w!==y&&(w===null?oe.firstBaseUpdate=W:w.next=W,oe.lastBaseUpdate=M))}if(f!==null){var ge=d.baseState;y=0,oe=W=M=null,w=f;do{var te=w.lane&-536870913,le=te!==w.lane;if(le?(wt&te)===te:(a&te)===te){te!==0&&te===Zn&&(No=!0),oe!==null&&(oe=oe.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Le=e,Pe=w;te=t;var Kt=s;switch(Pe.tag){case 1:if(Le=Pe.payload,typeof Le=="function"){ge=Le.call(Kt,ge,te);break e}ge=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Pe.payload,te=typeof Le=="function"?Le.call(Kt,ge,te):Le,te==null)break e;ge=j({},ge,te);break e;case 2:ai=!0}}te=w.callback,te!==null&&(e.flags|=64,le&&(e.flags|=8192),le=d.callbacks,le===null?d.callbacks=[te]:le.push(te))}else le={lane:te,tag:w.tag,payload:w.payload,callback:w.callback,next:null},oe===null?(W=oe=le,M=ge):oe=oe.next=le,y|=te;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;le=w,w=le.next,le.next=null,d.lastBaseUpdate=le,d.shared.pending=null}}while(!0);oe===null&&(M=ge),d.baseState=M,d.firstBaseUpdate=W,d.lastBaseUpdate=oe,f===null&&(d.shared.lanes=0),wa|=y,e.lanes=y,e.memoizedState=ge}}function ko(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function So(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)ko(s[e],t)}var qi=T(null),m=T(0);function O(e,t){e=Fi,de(m,e),de(qi,t),Fi=e|t.baseLanes}function ce(){de(m,Fi),de(qi,qi.current)}function Ae(){Fi=m.current,K(qi),K(m)}var rt=T(null),It=null;function Bn(e){var t=e.alternate;de(xn,xn.current&1),de(rt,e),It===null&&(t===null||qi.current!==null||t.memoizedState!==null)&&(It=e)}function Gi(e){de(xn,xn.current),de(rt,e),It===null&&(It=e)}function Eo(e){e.tag===22?(de(xn,xn.current),de(rt,e),It===null&&(It=e)):Hl()}function Hl(){de(xn,xn.current),de(rt,rt.current)}function Ss(e){K(rt),It===e&&(It=null),K(xn)}var xn=T(0);function pr(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ch(s)||Ah(s)))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 xl=0,tt=null,ae=null,be=null,Ke=!1,pt=!1,xt=!1,Xs=0,mr=0,pc=null,Ry=0;function En(){throw Error(c(321))}function Nf(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Hn(e[s],t[s]))return!1;return!0}function kf(e,t,s,a,d,f){return xl=f,tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Z.H=e===null||e.memoizedState===null?Hm:Bf,xt=!1,f=s(a,d),xt=!1,pt&&(f=lm(t,s,a,d)),sm(e),f}function sm(e){Z.H=Ao;var t=ae!==null&&ae.next!==null;if(xl=0,be=ae=tt=null,Ke=!1,mr=0,pc=null,t)throw Error(c(300));e===null||qn||(e=e.dependencies,e!==null&&cc(e)&&(qn=!0))}function lm(e,t,s,a){tt=e;var d=0;do{if(pt&&(pc=null),mr=0,pt=!1,25<=d)throw Error(c(301));if(d+=1,be=ae=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}Z.H=Bm,f=t(s,a)}while(pt);return f}function My(){var e=Z.H,t=e.useState()[0];return t=typeof t.then=="function"?To(t):t,e=e.useState()[0],(ae!==null?ae.memoizedState:null)!==e&&(tt.flags|=1024),t}function Sf(){var e=Xs!==0;return Xs=0,e}function Ef(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Tf(e){if(Ke){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ke=!1}xl=0,be=ae=tt=null,pt=!1,mr=Xs=0,pc=null}function Ls(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return be===null?tt.memoizedState=be=e:be=be.next=e,be}function On(){if(ae===null){var e=tt.alternate;e=e!==null?e.memoizedState:null}else e=ae.next;var t=be===null?tt.memoizedState:be.next;if(t!==null)be=t,ae=e;else{if(e===null)throw tt.alternate===null?Error(c(467)):Error(c(310));ae=e,e={memoizedState:ae.memoizedState,baseState:ae.baseState,baseQueue:ae.baseQueue,queue:ae.queue,next:null},be===null?tt.memoizedState=be=e:be=be.next=e}return be}function Gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=mr;return mr+=1,pc===null&&(pc=[]),e=Bu(pc,e,t),t=tt,(be===null?t.memoizedState:be.next)===null&&(t=t.alternate,Z.H=t===null||t.memoizedState===null?Hm:Bf),e}function $u(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return To(e);if(e.$$typeof===Q)return Kn(e)}throw Error(c(438,String(e)))}function Cf(e){var t=null,s=tt.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var a=tt.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Gu(),tt.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),a=0;a<e;a++)s[a]=I;return t.index++,s}function $i(e,t){return typeof t=="function"?t(e):t}function Yu(e){var t=On();return Af(t,ae,e)}function Af(e,t,s){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=s;var d=e.baseQueue,f=a.pending;if(f!==null){if(d!==null){var y=d.next;d.next=f.next,f.next=y}t.baseQueue=d=f,a.pending=null}if(f=e.baseState,d===null)e.memoizedState=f;else{t=d.next;var w=y=null,M=null,W=t,oe=!1;do{var ge=W.lane&-536870913;if(ge!==W.lane?(wt&ge)===ge:(xl&ge)===ge){var te=W.revertLane;if(te===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),ge===Zn&&(oe=!0);else if((xl&te)===te){W=W.next,te===Zn&&(oe=!0);continue}else ge={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},M===null?(w=M=ge,y=f):M=M.next=ge,tt.lanes|=te,wa|=te;ge=W.action,xt&&s(f,ge),f=W.hasEagerState?W.eagerState:s(f,ge)}else te={lane:ge,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},M===null?(w=M=te,y=f):M=M.next=te,tt.lanes|=ge,wa|=ge;W=W.next}while(W!==null&&W!==t);if(M===null?y=f:M.next=w,!Hn(f,e.memoizedState)&&(qn=!0,oe&&(s=Ot,s!==null)))throw s;e.memoizedState=f,e.baseState=y,e.baseQueue=M,a.lastRenderedState=f}return d===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Rf(e){var t=On(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var a=s.dispatch,d=s.pending,f=t.memoizedState;if(d!==null){s.pending=null;var y=d=d.next;do f=e(f,y.action),y=y.next;while(y!==d);Hn(f,t.memoizedState)||(qn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,a]}function im(e,t,s){var a=tt,d=On(),f=yt;if(f){if(s===void 0)throw Error(c(407));s=s()}else s=t();var y=!Hn((ae||d).memoizedState,s);if(y&&(d.memoizedState=s,qn=!0),d=d.queue,Of(cm.bind(null,a,d,e),[e]),d.getSnapshot!==t||y||be!==null&&be.memoizedState.tag&1){if(a.flags|=2048,mc(9,{destroy:void 0},rm.bind(null,a,d,s,t),null),en===null)throw Error(c(349));f||(xl&127)!==0||am(a,t,s)}return s}function am(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=tt.updateQueue,t===null?(t=Gu(),tt.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function rm(e,t,s,a){t.value=s,t.getSnapshot=a,om(t)&&um(e)}function cm(e,t,s){return s(function(){om(t)&&um(e)})}function om(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Hn(e,s)}catch{return!0}}function um(e){var t=Al(e,2);t!==null&&Js(t,e,2)}function Mf(e){var t=Ls();if(typeof e=="function"){var s=e;if(e=s(),xt){Cn(!0);try{s()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:e},t}function dm(e,t,s,a){return e.baseState=s,Af(e,ae,typeof a=="function"?a:$i)}function Dy(e,t,s,a,d){if(Qu(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(y){f.listeners.push(y)}};Z.T!==null?s(!0):f.isTransition=!1,a(f),s=t.pending,s===null?(f.next=t.pending=f,fm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function fm(e,t){var s=t.action,a=t.payload,d=e.state;if(t.isTransition){var f=Z.T,y={};Z.T=y;try{var w=s(d,a),M=Z.S;M!==null&&M(y,w),hm(e,t,w)}catch(W){Df(e,t,W)}finally{f!==null&&y.types!==null&&(f.types=y.types),Z.T=f}}else try{f=s(d,a),hm(e,t,f)}catch(W){Df(e,t,W)}}function hm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(a){pm(e,t,a)},function(a){return Df(e,t,a)}):pm(e,t,s)}function pm(e,t,s){t.status="fulfilled",t.value=s,mm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,fm(e,s)))}function Df(e,t,s){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=s,mm(t),t=t.next;while(t!==a)}e.action=null}function mm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gm(e,t){return t}function xm(e,t){if(yt){var s=en.formState;if(s!==null){e:{var a=tt;if(yt){if(Wt){t:{for(var d=Wt,f=Vs;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){Wt=bl(d.nextSibling),a=d.data==="F!";break e}}Wl(a)}a=!1}a&&(t=s[0])}}return s=Ls(),s.memoizedState=s.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gm,lastRenderedState:t},s.queue=a,s=zm.bind(null,tt,a),a.dispatch=s,a=Mf(!1),f=Hf.bind(null,tt,!1,a.queue),a=Ls(),d={state:t,dispatch:null,action:e,pending:null},a.queue=d,s=Dy.bind(null,tt,d,f,s),d.dispatch=s,a.memoizedState=e,[t,s,!1]}function bm(e){var t=On();return _m(t,ae,e)}function _m(e,t,s){if(t=Af(e,t,gm)[0],e=Yu($i)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=To(t)}catch(y){throw y===Il?fc:y}else a=t;t=On();var d=t.queue,f=d.dispatch;return s!==t.memoizedState&&(tt.flags|=2048,mc(9,{destroy:void 0},Oy.bind(null,d,s),null)),[a,f,e]}function Oy(e,t){e.action=t}function ym(e){var t=On(),s=ae;if(s!==null)return _m(t,s,e);On(),t=t.memoizedState,s=On();var a=s.queue.dispatch;return s.memoizedState=e,[t,a,!1]}function mc(e,t,s,a){return e={tag:e,create:s,deps:a,inst:t,next:null},t=tt.updateQueue,t===null&&(t=Gu(),tt.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(a=s.next,s.next=e,e.next=a,t.lastEffect=e),e}function vm(){return On().memoizedState}function Vu(e,t,s,a){var d=Ls();tt.flags|=e,d.memoizedState=mc(1|t,{destroy:void 0},s,a===void 0?null:a)}function Xu(e,t,s,a){var d=On();a=a===void 0?null:a;var f=d.memoizedState.inst;ae!==null&&a!==null&&Nf(a,ae.memoizedState.deps)?d.memoizedState=mc(t,f,s,a):(tt.flags|=e,d.memoizedState=mc(1|t,f,s,a))}function jm(e,t){Vu(8390656,8,e,t)}function Of(e,t){Xu(2048,8,e,t)}function Ly(e){tt.flags|=4;var t=tt.updateQueue;if(t===null)t=Gu(),tt.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function wm(e){var t=On().memoizedState;return Ly({ref:t,nextImpl:e}),function(){if((Lt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Nm(e,t){return Xu(4,2,e,t)}function km(e,t){return Xu(4,4,e,t)}function Sm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Em(e,t,s){s=s!=null?s.concat([e]):null,Xu(4,4,Sm.bind(null,t,e),s)}function Lf(){}function Tm(e,t){var s=On();t=t===void 0?null:t;var a=s.memoizedState;return t!==null&&Nf(t,a[1])?a[0]:(s.memoizedState=[e,t],e)}function Cm(e,t){var s=On();t=t===void 0?null:t;var a=s.memoizedState;if(t!==null&&Nf(t,a[1]))return a[0];if(a=e(),xt){Cn(!0);try{e()}finally{Cn(!1)}}return s.memoizedState=[a,t],a}function zf(e,t,s){return s===void 0||(xl&1073741824)!==0&&(wt&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Ag(),tt.lanes|=e,wa|=e,s)}function Am(e,t,s,a){return Hn(s,t)?s:qi.current!==null?(e=zf(e,s,a),Hn(e,t)||(qn=!0),e):(xl&42)===0||(xl&1073741824)!==0&&(wt&261930)===0?(qn=!0,e.memoizedState=s):(e=Ag(),tt.lanes|=e,wa|=e,t)}function Rm(e,t,s,a,d){var f=$.p;$.p=f!==0&&8>f?f:8;var y=Z.T,w={};Z.T=w,Hf(e,!1,t,s);try{var M=d(),W=Z.S;if(W!==null&&W(w,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var oe=wf(M,a);Co(e,t,oe,ol(e))}else Co(e,t,a,ol(e))}catch(ge){Co(e,t,{then:function(){},status:"rejected",reason:ge},ol())}finally{$.p=f,y!==null&&w.types!==null&&(y.types=w.types),Z.T=y}}function zy(){}function If(e,t,s,a){if(e.tag!==5)throw Error(c(476));var d=Mm(e).queue;Rm(e,d,t,ne,s===null?zy:function(){return Dm(e),s(a)})}function Mm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:ne},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dm(e){var t=Mm(e);t.next===null&&(t=e.alternate.memoizedState),Co(e,t.next.queue,{},ol())}function Uf(){return Kn(Xo)}function Om(){return On().memoizedState}function Lm(){return On().memoizedState}function Iy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=ol();e=Ul(s);var a=ri(t,e,s);a!==null&&(Js(a,t,s),gl(a,t,s)),t={cache:uc()},e.payload=t;return}t=t.return}}function Uy(e,t,s){var a=ol();s={lane:a,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Qu(e)?Im(t,s):(s=uo(e,t,s,a),s!==null&&(Js(s,e,a),Um(s,t,a)))}function zm(e,t,s){var a=ol();Co(e,t,s,a)}function Co(e,t,s,a){var d={lane:a,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Qu(e))Im(t,d);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,w=f(y,s);if(d.hasEagerState=!0,d.eagerState=w,Hn(w,y))return da(e,t,d,0),en===null&&Pr(),!1}catch{}finally{}if(s=uo(e,t,d,a),s!==null)return Js(s,e,a),Um(s,t,a),!0}return!1}function Hf(e,t,s,a){if(a={lane:2,revertLane:xh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Qu(e)){if(t)throw Error(c(479))}else t=uo(e,s,a,2),t!==null&&Js(t,e,2)}function Qu(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function Im(e,t){pt=Ke=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Um(e,t,s){if((s&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,s|=a,t.lanes=s,As(e,s)}}var Ao={readContext:Kn,use:$u,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};Ao.useEffectEvent=En;var Hm={readContext:Kn,use:$u,useCallback:function(e,t){return Ls().memoizedState=[e,t===void 0?null:t],e},useContext:Kn,useEffect:jm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Vu(4194308,4,Sm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Vu(4194308,4,e,t)},useInsertionEffect:function(e,t){Vu(4,2,e,t)},useMemo:function(e,t){var s=Ls();t=t===void 0?null:t;var a=e();if(xt){Cn(!0);try{e()}finally{Cn(!1)}}return s.memoizedState=[a,t],a},useReducer:function(e,t,s){var a=Ls();if(s!==void 0){var d=s(t);if(xt){Cn(!0);try{s(t)}finally{Cn(!1)}}}else d=t;return a.memoizedState=a.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},a.queue=e,e=e.dispatch=Uy.bind(null,tt,e),[a.memoizedState,e]},useRef:function(e){var t=Ls();return e={current:e},t.memoizedState=e},useState:function(e){e=Mf(e);var t=e.queue,s=zm.bind(null,tt,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Lf,useDeferredValue:function(e,t){var s=Ls();return zf(s,e,t)},useTransition:function(){var e=Mf(!1);return e=Rm.bind(null,tt,e.queue,!0,!1),Ls().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var a=tt,d=Ls();if(yt){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),en===null)throw Error(c(349));(wt&127)!==0||am(a,t,s)}d.memoizedState=s;var f={value:s,getSnapshot:t};return d.queue=f,jm(cm.bind(null,a,f,e),[e]),a.flags|=2048,mc(9,{destroy:void 0},rm.bind(null,a,f,s,t),null),s},useId:function(){var e=Ls(),t=en.identifierPrefix;if(yt){var s=pl,a=hl;s=(a&~(1<<32-At(a)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Xs++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Ry++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Uf,useFormState:xm,useActionState:xm,useOptimistic:function(e){var t=Ls();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Hf.bind(null,tt,!0,s),s.dispatch=t,[e,t]},useMemoCache:Cf,useCacheRefresh:function(){return Ls().memoizedState=Iy.bind(null,tt)},useEffectEvent:function(e){var t=Ls(),s={impl:e};return t.memoizedState=s,function(){if((Lt&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},Bf={readContext:Kn,use:$u,useCallback:Tm,useContext:Kn,useEffect:Of,useImperativeHandle:Em,useInsertionEffect:Nm,useLayoutEffect:km,useMemo:Cm,useReducer:Yu,useRef:vm,useState:function(){return Yu($i)},useDebugValue:Lf,useDeferredValue:function(e,t){var s=On();return Am(s,ae.memoizedState,e,t)},useTransition:function(){var e=Yu($i)[0],t=On().memoizedState;return[typeof e=="boolean"?e:To(e),t]},useSyncExternalStore:im,useId:Om,useHostTransitionStatus:Uf,useFormState:bm,useActionState:bm,useOptimistic:function(e,t){var s=On();return dm(s,ae,e,t)},useMemoCache:Cf,useCacheRefresh:Lm};Bf.useEffectEvent=wm;var Bm={readContext:Kn,use:$u,useCallback:Tm,useContext:Kn,useEffect:Of,useImperativeHandle:Em,useInsertionEffect:Nm,useLayoutEffect:km,useMemo:Cm,useReducer:Rf,useRef:vm,useState:function(){return Rf($i)},useDebugValue:Lf,useDeferredValue:function(e,t){var s=On();return ae===null?zf(s,e,t):Am(s,ae.memoizedState,e,t)},useTransition:function(){var e=Rf($i)[0],t=On().memoizedState;return[typeof e=="boolean"?e:To(e),t]},useSyncExternalStore:im,useId:Om,useHostTransitionStatus:Uf,useFormState:ym,useActionState:ym,useOptimistic:function(e,t){var s=On();return ae!==null?dm(s,ae,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Cf,useCacheRefresh:Lm};Bm.useEffectEvent=wm;function qf(e,t,s,a){t=e.memoizedState,s=s(a,t),s=s==null?t:j({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Gf={enqueueSetState:function(e,t,s){e=e._reactInternals;var a=ol(),d=Ul(a);d.payload=t,s!=null&&(d.callback=s),t=ri(e,d,a),t!==null&&(Js(t,e,a),gl(t,e,a))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var a=ol(),d=Ul(a);d.tag=1,d.payload=t,s!=null&&(d.callback=s),t=ri(e,d,a),t!==null&&(Js(t,e,a),gl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=ol(),a=Ul(s);a.tag=2,t!=null&&(a.callback=t),t=ri(e,a,s),t!==null&&(Js(t,e,s),gl(t,e,s))}};function qm(e,t,s,a,d,f,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,y):t.prototype&&t.prototype.isPureReactComponent?!Ci(s,a)||!Ci(d,f):!0}function Gm(e,t,s,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,a),t.state!==e&&Gf.enqueueReplaceState(t,t.state,null)}function gr(e,t){var s=t;if("ref"in t){s={};for(var a in t)a!=="ref"&&(s[a]=t[a])}if(e=e.defaultProps){s===t&&(s=j({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function $m(e){Jr(e)}function Ym(e){console.error(e)}function Vm(e){Jr(e)}function Ku(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Xm(e,t,s){try{var a=e.onCaughtError;a(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function $f(e,t,s){return s=Ul(s),s.tag=3,s.payload={element:null},s.callback=function(){Ku(e,t)},s}function Qm(e){return e=Ul(e),e.tag=3,e}function Km(e,t,s,a){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var f=a.value;e.payload=function(){return d(f)},e.callback=function(){Xm(t,s,a)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Xm(t,s,a),typeof d!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var w=a.stack;this.componentDidCatch(a.value,{componentStack:w!==null?w:""})})}function Hy(e,t,s,a,d){if(s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=s.alternate,t!==null&&ma(t,s,d,!0),s=rt.current,s!==null){switch(s.tag){case 31:case 13:return It===null?ad():s.alternate===null&&Tn===0&&(Tn=3),s.flags&=-257,s.flags|=65536,s.lanes=d,a===li?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([a]):t.add(a),ph(e,a,d)),!1;case 22:return s.flags|=65536,a===li?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([a]):s.add(a)),ph(e,a,d)),!1}throw Error(c(435,s.tag))}return ph(e,a,d),ad(),!1}if(yt)return t=rt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,a!==rc&&(e=Error(c(422),{cause:a}),ei(ks(e,s)))):(a!==rc&&(t=Error(c(423),{cause:a}),ei(ks(t,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,a=ks(a,s),d=$f(e.stateNode,a,d),dr(e,d),Tn!==4&&(Tn=2)),!1;var f=Error(c(520),{cause:a});if(f=ks(f,s),Uo===null?Uo=[f]:Uo.push(f),Tn!==4&&(Tn=2),t===null)return!0;a=ks(a,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=$f(s.stateNode,a,e),dr(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Na===null||!Na.has(f))))return s.flags|=65536,d&=-d,s.lanes|=d,d=Qm(d),Km(d,e,s,a),dr(s,d),!1}s=s.return}while(s!==null);return!1}var Yf=Error(c(461)),qn=!1;function cs(e,t,s,a){t.child=e===null?qu(t,null,s,a):ii(t,e.child,s,a)}function Zm(e,t,s,a,d){s=s.render;var f=t.ref;if("ref"in a){var y={};for(var w in a)w!=="ref"&&(y[w]=a[w])}else y=a;return Ii(t),a=kf(e,t,s,y,f,d),w=Sf(),e!==null&&!qn?(Ef(e,t,d),Yi(e,t,d)):(yt&&w&&po(t),t.flags|=1,cs(e,t,a,d),t.child)}function Fm(e,t,s,a,d){if(e===null){var f=s.type;return typeof f=="function"&&!tc(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,Jm(e,t,f,a,d)):(e=nc(s.type,null,a,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Pf(e,d)){var y=f.memoizedProps;if(s=s.compare,s=s!==null?s:Ci,s(y,a)&&e.ref===t.ref)return Yi(e,t,d)}return t.flags|=1,e=fl(f,a),e.ref=t.ref,e.return=t,t.child=e}function Jm(e,t,s,a,d){if(e!==null){var f=e.memoizedProps;if(Ci(f,a)&&e.ref===t.ref)if(qn=!1,t.pendingProps=a=f,Pf(e,d))(e.flags&131072)!==0&&(qn=!0);else return t.lanes=e.lanes,Yi(e,t,d)}return Vf(e,t,s,a,d)}function Pm(e,t,s,a){var d=a.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(a=t.child=e.child,d=0;a!==null;)d=d|a.lanes|a.childLanes,a=a.sibling;a=d&~f}else a=0,t.child=null;return Wm(e,t,f,s,a)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,f!==null?f.cachePool:null),f!==null?O(t,f):ce(),Eo(t);else return a=t.lanes=536870912,Wm(e,t,f!==null?f.baseLanes|s:s,s,a)}else f!==null?(ba(t,f.cachePool),O(t,f),Hl(),t.memoizedState=null):(e!==null&&ba(t,null),ce(),Hl());return cs(e,t,d,s),t.child}function Ro(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wm(e,t,s,a,d){var f=xa();return f=f===null?null:{parent:Sn._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&ba(t,null),ce(),Eo(t),e!==null&&ma(e,t,a,!0),t.childLanes=d,null}function Zu(e,t){return t=Ju({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function eg(e,t,s){return ii(t,e.child,null,s),e=Zu(t,t.pendingProps),e.flags|=2,Ss(t),t.memoizedState=null,e}function By(e,t,s){var a=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(yt){if(a.mode==="hidden")return e=Zu(t,a),t.lanes=536870912,Ro(null,e);if(Gi(t),(e=Wt)?(e=fx(e,Vs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ml!==null?{id:hl,overflow:pl}:null,retryLane:536870912,hydrationErrors:null},s=Du(e),s.return=t,t.child=s,Qn=t,Wt=null)):e=null,e===null)throw Wl(t);return t.lanes=536870912,null}return Zu(t,a)}var f=e.memoizedState;if(f!==null){var y=f.dehydrated;if(Gi(t),d)if(t.flags&256)t.flags&=-257,t=eg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(qn||ma(e,t,s,!1),d=(s&e.childLanes)!==0,qn||d){if(a=en,a!==null&&(y=Rs(a,s),y!==0&&y!==f.retryLane))throw f.retryLane=y,Al(e,y),Js(a,e,y),Yf;ad(),t=eg(e,t,s)}else e=f.treeContext,Wt=bl(y.nextSibling),Qn=t,yt=!0,Pl=null,Vs=!1,e!==null&&Lu(t,e),t=Zu(t,a),t.flags|=4096;return t}return e=fl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fu(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Vf(e,t,s,a,d){return Ii(t),s=kf(e,t,s,a,void 0,d),a=Sf(),e!==null&&!qn?(Ef(e,t,d),Yi(e,t,d)):(yt&&a&&po(t),t.flags|=1,cs(e,t,s,d),t.child)}function tg(e,t,s,a,d,f){return Ii(t),t.updateQueue=null,s=lm(t,a,s,d),sm(e),a=Sf(),e!==null&&!qn?(Ef(e,t,f),Yi(e,t,f)):(yt&&a&&po(t),t.flags|=1,cs(e,t,s,f),t.child)}function ng(e,t,s,a,d){if(Ii(t),t.stateNode===null){var f=Li,y=s.contextType;typeof y=="object"&&y!==null&&(f=Kn(y)),f=new s(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Gf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},wo(t),y=s.contextType,f.context=typeof y=="object"&&y!==null?Kn(y):Li,f.state=t.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(qf(t,s,y,a),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&Gf.enqueueReplaceState(f,f.state,null),hr(t,a,f,d),fr(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,M=gr(s,w);f.props=M;var W=f.context,oe=s.contextType;y=Li,typeof oe=="object"&&oe!==null&&(y=Kn(oe));var ge=s.getDerivedStateFromProps;oe=typeof ge=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,oe||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||W!==y)&&Gm(t,f,a,y),ai=!1;var te=t.memoizedState;f.state=te,hr(t,a,f,d),fr(),W=t.memoizedState,w||te!==W||ai?(typeof ge=="function"&&(qf(t,s,ge,a),W=t.memoizedState),(M=ai||qm(t,s,M,a,te,W,y))?(oe||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=a,t.memoizedState=W),f.props=a,f.state=W,f.context=y,a=M):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,ur(e,t),y=t.memoizedProps,oe=gr(s,y),f.props=oe,ge=t.pendingProps,te=f.context,W=s.contextType,M=Li,typeof W=="object"&&W!==null&&(M=Kn(W)),w=s.getDerivedStateFromProps,(W=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==ge||te!==M)&&Gm(t,f,a,M),ai=!1,te=t.memoizedState,f.state=te,hr(t,a,f,d),fr();var le=t.memoizedState;y!==ge||te!==le||ai||e!==null&&e.dependencies!==null&&cc(e.dependencies)?(typeof w=="function"&&(qf(t,s,w,a),le=t.memoizedState),(oe=ai||qm(t,s,oe,a,te,le,M)||e!==null&&e.dependencies!==null&&cc(e.dependencies))?(W||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,le,M),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,le,M)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=le),f.props=a,f.state=le,f.context=M,a=oe):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,Fu(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,s=a&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=ii(t,e.child,null,d),t.child=ii(t,null,s,d)):cs(e,t,s,d),t.memoizedState=f.state,e=t.child):e=Yi(e,t,d),e}function sg(e,t,s,a){return Ol(),t.flags|=256,cs(e,t,s,a),t.child}var Xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qf(e){return{baseLanes:e,cachePool:yo()}}function Kf(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=cl),e}function lg(e,t,s){var a=t.pendingProps,d=!1,f=(t.flags&128)!==0,y;if((y=f)||(y=e!==null&&e.memoizedState===null?!1:(xn.current&2)!==0),y&&(d=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(yt){if(d?Bn(t):Hl(),(e=Wt)?(e=fx(e,Vs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ml!==null?{id:hl,overflow:pl}:null,retryLane:536870912,hydrationErrors:null},s=Du(e),s.return=t,t.child=s,Qn=t,Wt=null)):e=null,e===null)throw Wl(t);return Ah(e)?t.lanes=32:t.lanes=536870912,null}var w=a.children;return a=a.fallback,d?(Hl(),d=t.mode,w=Ju({mode:"hidden",children:w},d),a=Jl(a,d,s,null),w.return=t,a.return=t,w.sibling=a,t.child=w,a=t.child,a.memoizedState=Qf(s),a.childLanes=Kf(e,y,s),t.memoizedState=Xf,Ro(null,a)):(Bn(t),Zf(t,w))}var M=e.memoizedState;if(M!==null&&(w=M.dehydrated,w!==null)){if(f)t.flags&256?(Bn(t),t.flags&=-257,t=Ff(e,t,s)):t.memoizedState!==null?(Hl(),t.child=e.child,t.flags|=128,t=null):(Hl(),w=a.fallback,d=t.mode,a=Ju({mode:"visible",children:a.children},d),w=Jl(w,d,s,null),w.flags|=2,a.return=t,w.return=t,a.sibling=w,t.child=a,ii(t,e.child,null,s),a=t.child,a.memoizedState=Qf(s),a.childLanes=Kf(e,y,s),t.memoizedState=Xf,t=Ro(null,a));else if(Bn(t),Ah(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var W=y.dgst;y=W,a=Error(c(419)),a.stack="",a.digest=y,ei({value:a,source:null,stack:null}),t=Ff(e,t,s)}else if(qn||ma(e,t,s,!1),y=(s&e.childLanes)!==0,qn||y){if(y=en,y!==null&&(a=Rs(y,s),a!==0&&a!==M.retryLane))throw M.retryLane=a,Al(e,a),Js(y,e,a),Yf;Ch(w)||ad(),t=Ff(e,t,s)}else Ch(w)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Wt=bl(w.nextSibling),Qn=t,yt=!0,Pl=null,Vs=!1,e!==null&&Lu(t,e),t=Zf(t,a.children),t.flags|=4096);return t}return d?(Hl(),w=a.fallback,d=t.mode,M=e.child,W=M.sibling,a=fl(M,{mode:"hidden",children:a.children}),a.subtreeFlags=M.subtreeFlags&65011712,W!==null?w=fl(W,w):(w=Jl(w,d,s,null),w.flags|=2),w.return=t,a.return=t,a.sibling=w,t.child=a,Ro(null,a),a=t.child,w=e.child.memoizedState,w===null?w=Qf(s):(d=w.cachePool,d!==null?(M=Sn._currentValue,d=d.parent!==M?{parent:M,pool:M}:d):d=yo(),w={baseLanes:w.baseLanes|s,cachePool:d}),a.memoizedState=w,a.childLanes=Kf(e,y,s),t.memoizedState=Xf,Ro(e.child,a)):(Bn(t),s=e.child,e=s.sibling,s=fl(s,{mode:"visible",children:a.children}),s.return=t,s.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=s,t.memoizedState=null,s)}function Zf(e,t){return t=Ju({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ju(e,t){return e=Ns(22,e,null,t),e.lanes=0,e}function Ff(e,t,s){return ii(t,e.child,null,s),e=Zf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ig(e,t,s){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),xo(e.return,t,s)}function Jf(e,t,s,a,d,f){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:s,tailMode:d,treeForkCount:f}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=a,y.tail=s,y.tailMode=d,y.treeForkCount=f)}function ag(e,t,s){var a=t.pendingProps,d=a.revealOrder,f=a.tail;a=a.children;var y=xn.current,w=(y&2)!==0;if(w?(y=y&1|2,t.flags|=128):y&=1,de(xn,y),cs(e,t,a,s),a=yt?Rl:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ig(e,s,t);else if(e.tag===19)ig(e,s,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(s=t.child,d=null;s!==null;)e=s.alternate,e!==null&&pr(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),Jf(t,!1,d,s,f,a);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&pr(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Jf(t,!0,s,null,f,a);break;case"together":Jf(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Yi(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),wa|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ma(e,t,s,!1),(s&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,s=fl(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=fl(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Pf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&cc(e)))}function qy(e,t,s){switch(t.tag){case 3:re(t,t.stateNode.containerInfo),ti(t,Sn,e.memoizedState.cache),Ol();break;case 27:case 5:pe(t);break;case 4:re(t,t.stateNode.containerInfo);break;case 10:ti(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Bn(t),t.flags|=128,null):(s&t.child.childLanes)!==0?lg(e,t,s):(Bn(t),e=Yi(e,t,s),e!==null?e.sibling:null);Bn(t);break;case 19:var d=(e.flags&128)!==0;if(a=(s&t.childLanes)!==0,a||(ma(e,t,s,!1),a=(s&t.childLanes)!==0),d){if(a)return ag(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),de(xn,xn.current),a)break;return null;case 22:return t.lanes=0,Pm(e,t,s,t.pendingProps);case 24:ti(t,Sn,e.memoizedState.cache)}return Yi(e,t,s)}function rg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)qn=!0;else{if(!Pf(e,s)&&(t.flags&128)===0)return qn=!1,qy(e,t,s);qn=(e.flags&131072)!==0}else qn=!1,yt&&(t.flags&1048576)!==0&&Ou(t,Rl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ml(t.elementType),t.type=e,typeof e=="function")tc(e)?(a=gr(e,a),t.tag=1,t=ng(null,t,e,a,s)):(t.tag=0,t=Vf(null,t,e,a,s));else{if(e!=null){var d=e.$$typeof;if(d===z){t.tag=11,t=Zm(null,t,e,a,s);break e}else if(d===U){t.tag=14,t=Fm(null,t,e,a,s);break e}}throw t=we(e)||e,Error(c(306,t,""))}}return t;case 0:return Vf(e,t,t.type,t.pendingProps,s);case 1:return a=t.type,d=gr(a,t.pendingProps),ng(e,t,a,d,s);case 3:e:{if(re(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;d=f.element,ur(e,t),hr(t,a,null,s);var y=t.memoizedState;if(a=y.cache,ti(t,Sn,a),a!==f.cache&&bo(t,[Sn],s,!0),fr(),a=y.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=sg(e,t,a,s);break e}else if(a!==d){d=ks(Error(c(424)),t),ei(d),t=sg(e,t,a,s);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(Wt=bl(e.firstChild),Qn=t,yt=!0,Pl=null,Vs=!0,s=qu(t,null,a,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ol(),a===d){t=Yi(e,t,s);break e}cs(e,t,a,s)}t=t.child}return t;case 26:return Fu(e,t),e===null?(s=bx(t.type,null,t.pendingProps,null))?t.memoizedState=s:yt||(s=t.type,e=t.pendingProps,a=hd(ze.current).createElement(s),a[hn]=t,a[it]=e,os(a,s,e),et(a),t.stateNode=a):t.memoizedState=bx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&yt&&(a=t.stateNode=mx(t.type,t.pendingProps,ze.current),Qn=t,Vs=!0,d=Wt,Ta(t.type)?(Rh=d,Wt=bl(a.firstChild)):Wt=d),cs(e,t,t.pendingProps.children,s),Fu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&yt&&((d=a=Wt)&&(a=x0(a,t.type,t.pendingProps,Vs),a!==null?(t.stateNode=a,Qn=t,Wt=bl(a.firstChild),Vs=!1,d=!0):d=!1),d||Wl(t)),pe(t),d=t.type,f=t.pendingProps,y=e!==null?e.memoizedProps:null,a=f.children,Sh(d,f)?a=null:y!==null&&Sh(d,y)&&(t.flags|=32),t.memoizedState!==null&&(d=kf(e,t,My,null,null,s),Xo._currentValue=d),Fu(e,t),cs(e,t,a,s),t.child;case 6:return e===null&&yt&&((e=s=Wt)&&(s=b0(s,t.pendingProps,Vs),s!==null?(t.stateNode=s,Qn=t,Wt=null,e=!0):e=!1),e||Wl(t)),null;case 13:return lg(e,t,s);case 4:return re(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ii(t,null,a,s):cs(e,t,a,s),t.child;case 11:return Zm(e,t,t.type,t.pendingProps,s);case 7:return cs(e,t,t.pendingProps,s),t.child;case 8:return cs(e,t,t.pendingProps.children,s),t.child;case 12:return cs(e,t,t.pendingProps.children,s),t.child;case 10:return a=t.pendingProps,ti(t,t.type,a.value),cs(e,t,a.children,s),t.child;case 9:return d=t.type._context,a=t.pendingProps.children,Ii(t),d=Kn(d),a=a(d),t.flags|=1,cs(e,t,a,s),t.child;case 14:return Fm(e,t,t.type,t.pendingProps,s);case 15:return Jm(e,t,t.type,t.pendingProps,s);case 19:return ag(e,t,s);case 31:return By(e,t,s);case 22:return Pm(e,t,s,t.pendingProps);case 24:return Ii(t),a=Kn(Sn),e===null?(d=xa(),d===null&&(d=en,f=uc(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=s),d=f),t.memoizedState={parent:a,cache:d},wo(t),ti(t,Sn,d)):((e.lanes&s)!==0&&(ur(e,t),hr(t,null,null,s),fr()),d=e.memoizedState,f=t.memoizedState,d.parent!==a?(d={parent:a,cache:a},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),ti(t,Sn,a)):(a=f.cache,ti(t,Sn,a),a!==d.cache&&bo(t,[Sn],s,!0))),cs(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Vi(e){e.flags|=4}function Wf(e,t,s,a,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(Og())e.flags|=8192;else throw Ui=li,dc}else e.flags&=-16777217}function cg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wx(t))if(Og())e.flags|=8192;else throw Ui=li,dc}function Pu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ie():536870912,e.lanes|=t,_c|=t)}function Mo(e,t){if(!yt)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,a=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,a|=d.subtreeFlags&65011712,a|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,a|=d.subtreeFlags,a|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=a,e.childLanes=s,t}function Gy(e,t,s){var a=t.pendingProps;switch(mo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(t),null;case 1:return cn(t),null;case 3:return s=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),zl(Sn),Ye(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(pa(t)?Vi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ar())),cn(t),null;case 26:var d=t.type,f=t.memoizedState;return e===null?(Vi(t),f!==null?(cn(t),cg(t,f)):(cn(t),Wf(t,d,null,a,s))):f?f!==e.memoizedState?(Vi(t),cn(t),cg(t,f)):(cn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Vi(t),cn(t),Wf(t,d,e,a,s)),null;case 27:if(Ge(t),s=ze.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Vi(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return cn(t),null}e=_e.current,pa(t)?zu(t):(e=mx(d,a,s),t.stateNode=e,Vi(t))}return cn(t),null;case 5:if(Ge(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Vi(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return cn(t),null}if(f=_e.current,pa(t))zu(t);else{var y=hd(ze.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?y.createElement("select",{is:a.is}):y.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?y.createElement(d,{is:a.is}):y.createElement(d)}}f[hn]=t,f[it]=a;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=f;e:switch(os(f,d,a),d){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Vi(t)}}return cn(t),Wf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Vi(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=ze.current,pa(t)){if(e=t.stateNode,s=t.memoizedProps,a=null,d=Qn,d!==null)switch(d.tag){case 27:case 5:a=d.memoizedProps}e[hn]=t,e=!!(e.nodeValue===s||a!==null&&a.suppressHydrationWarning===!0||lx(e.nodeValue,s)),e||Wl(t,!0)}else e=hd(e).createTextNode(a),e[hn]=t,t.stateNode=e}return cn(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(a=pa(t),s!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[hn]=t}else Ol(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;cn(t),e=!1}else s=ar(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Ss(t),t):(Ss(t),null);if((t.flags&128)!==0)throw Error(c(558))}return cn(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=pa(t),a!==null&&a.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[hn]=t}else Ol(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;cn(t),d=!1}else d=ar(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Ss(t),t):(Ss(t),null)}return Ss(t),(t.flags&128)!==0?(t.lanes=s,t):(s=a!==null,e=e!==null&&e.memoizedState!==null,s&&(a=t.child,d=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(d=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==d&&(a.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Pu(t,t.updateQueue),cn(t),null);case 4:return Ye(),e===null&&vh(t.stateNode.containerInfo),cn(t),null;case 10:return zl(t.type),cn(t),null;case 19:if(K(xn),a=t.memoizedState,a===null)return cn(t),null;if(d=(t.flags&128)!==0,f=a.rendering,f===null)if(d)Mo(a,!1);else{if(Tn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=pr(e),f!==null){for(t.flags|=128,Mo(a,!1),e=f.updateQueue,t.updateQueue=e,Pu(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)ho(s,e),s=s.sibling;return de(xn,xn.current&1|2),yt&&Dl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ce()>sd&&(t.flags|=128,d=!0,Mo(a,!1),t.lanes=4194304)}else{if(!d)if(e=pr(f),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,Pu(t,e),Mo(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!yt)return cn(t),null}else 2*Ce()-a.renderingStartTime>sd&&s!==536870912&&(t.flags|=128,d=!0,Mo(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Ce(),e.sibling=null,s=xn.current,de(xn,d?s&1|2:s&1),yt&&Dl(t,a.treeForkCount),e):(cn(t),null);case 22:case 23:return Ss(t),Ae(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(s&536870912)!==0&&(t.flags&128)===0&&(cn(t),t.subtreeFlags&6&&(t.flags|=8192)):cn(t),s=t.updateQueue,s!==null&&Pu(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==s&&(t.flags|=2048),e!==null&&K(si),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),zl(Sn),cn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function $y(e,t){switch(mo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zl(Sn),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ge(t),null;case 31:if(t.memoizedState!==null){if(Ss(t),t.alternate===null)throw Error(c(340));Ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ss(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(xn),null;case 4:return Ye(),null;case 10:return zl(t.type),null;case 22:case 23:return Ss(t),Ae(),e!==null&&K(si),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zl(Sn),null;case 25:return null;default:return null}}function og(e,t){switch(mo(t),t.tag){case 3:zl(Sn),Ye();break;case 26:case 27:case 5:Ge(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Ss(t);break;case 13:Ss(t);break;case 19:K(xn);break;case 10:zl(t.type);break;case 22:case 23:Ss(t),Ae(),e!==null&&K(si);break;case 24:zl(Sn)}}function Do(e,t){try{var s=t.updateQueue,a=s!==null?s.lastEffect:null;if(a!==null){var d=a.next;s=d;do{if((s.tag&e)===e){a=void 0;var f=s.create,y=s.inst;a=f(),y.destroy=a}s=s.next}while(s!==d)}}catch(w){Gt(t,t.return,w)}}function va(e,t,s){try{var a=t.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var f=d.next;a=f;do{if((a.tag&e)===e){var y=a.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,d=t;var M=s,W=w;try{W()}catch(oe){Gt(d,M,oe)}}}a=a.next}while(a!==f)}}catch(oe){Gt(t,t.return,oe)}}function ug(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{So(t,s)}catch(a){Gt(e,e.return,a)}}}function dg(e,t,s){s.props=gr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(a){Gt(e,t,a)}}function Oo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof s=="function"?e.refCleanup=s(a):s.current=a}}catch(d){Gt(e,t,d)}}function ci(e,t){var s=e.ref,a=e.refCleanup;if(s!==null)if(typeof a=="function")try{a()}catch(d){Gt(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){Gt(e,t,d)}else s.current=null}function fg(e){var t=e.type,s=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&a.focus();break e;case"img":s.src?a.src=s.src:s.srcSet&&(a.srcset=s.srcSet)}}catch(d){Gt(e,e.return,d)}}function eh(e,t,s){try{var a=e.stateNode;d0(a,e.type,s,t),a[it]=t}catch(d){Gt(e,e.return,d)}}function hg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hg(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&&Ta(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 nh(e,t,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ht));else if(a!==4&&(a===27&&Ta(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(nh(e,t,s),e=e.sibling;e!==null;)nh(e,t,s),e=e.sibling}function Wu(e,t,s){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(a!==4&&(a===27&&Ta(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Wu(e,t,s),e=e.sibling;e!==null;)Wu(e,t,s),e=e.sibling}function pg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var a=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);os(t,a,s),t[hn]=e,t[it]=s}catch(f){Gt(e,e.return,f)}}var Xi=!1,Gn=!1,sh=!1,mg=typeof WeakSet=="function"?WeakSet:Set,ts=null;function Yy(e,t){if(e=e.containerInfo,Nh=yd,e=oa(e),Ai(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var a=s.getSelection&&s.getSelection();if(a&&a.rangeCount!==0){s=a.anchorNode;var d=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var y=0,w=-1,M=-1,W=0,oe=0,ge=e,te=null;t:for(;;){for(var le;ge!==s||d!==0&&ge.nodeType!==3||(w=y+d),ge!==f||a!==0&&ge.nodeType!==3||(M=y+a),ge.nodeType===3&&(y+=ge.nodeValue.length),(le=ge.firstChild)!==null;)te=ge,ge=le;for(;;){if(ge===e)break t;if(te===s&&++W===d&&(w=y),te===f&&++oe===a&&(M=y),(le=ge.nextSibling)!==null)break;ge=te,te=ge.parentNode}ge=le}s=w===-1||M===-1?null:{start:w,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(kh={focusedElem:e,selectionRange:s},yd=!1,ts=t;ts!==null;)if(t=ts,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ts=e;else for(;ts!==null;){switch(t=ts,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,d=f.memoizedProps,f=f.memoizedState,a=s.stateNode;try{var Le=gr(s.type,d);e=a.getSnapshotBeforeUpdate(Le,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(Pe){Gt(s,s.return,Pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Th(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Th(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,ts=e;break}ts=t.return}}function gg(e,t,s){var a=s.flags;switch(s.tag){case 0:case 11:case 15:Ki(e,s),a&4&&Do(5,s);break;case 1:if(Ki(e,s),a&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(y){Gt(s,s.return,y)}else{var d=gr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Gt(s,s.return,y)}}a&64&&ug(s),a&512&&Oo(s,s.return);break;case 3:if(Ki(e,s),a&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{So(e,t)}catch(y){Gt(s,s.return,y)}}break;case 27:t===null&&a&4&&pg(s);case 26:case 5:Ki(e,s),t===null&&a&4&&fg(s),a&512&&Oo(s,s.return);break;case 12:Ki(e,s);break;case 31:Ki(e,s),a&4&&_g(e,s);break;case 13:Ki(e,s),a&4&&yg(e,s),a&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Wy.bind(null,s),_0(e,s))));break;case 22:if(a=s.memoizedState!==null||Xi,!a){t=t!==null&&t.memoizedState!==null||Gn,d=Xi;var f=Gn;Xi=a,(Gn=t)&&!f?Zi(e,s,(s.subtreeFlags&8772)!==0):Ki(e,s),Xi=d,Gn=f}break;case 30:break;default:Ki(e,s)}}function xg(e){var t=e.alternate;t!==null&&(e.alternate=null,xg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xs(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,Qs=!1;function Qi(e,t,s){for(s=s.child;s!==null;)bg(e,t,s),s=s.sibling}function bg(e,t,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(ft,s)}catch{}switch(s.tag){case 26:Gn||ci(s,t),Qi(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Gn||ci(s,t);var a=bn,d=Qs;Ta(s.type)&&(bn=s.stateNode,Qs=!1),Qi(e,t,s),$o(s.stateNode),bn=a,Qs=d;break;case 5:Gn||ci(s,t);case 6:if(a=bn,d=Qs,bn=null,Qi(e,t,s),bn=a,Qs=d,bn!==null)if(Qs)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(s.stateNode)}catch(f){Gt(s,t,f)}else try{bn.removeChild(s.stateNode)}catch(f){Gt(s,t,f)}break;case 18:bn!==null&&(Qs?(e=bn,ux(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ec(e)):ux(bn,s.stateNode));break;case 4:a=bn,d=Qs,bn=s.stateNode.containerInfo,Qs=!0,Qi(e,t,s),bn=a,Qs=d;break;case 0:case 11:case 14:case 15:va(2,s,t),Gn||va(4,s,t),Qi(e,t,s);break;case 1:Gn||(ci(s,t),a=s.stateNode,typeof a.componentWillUnmount=="function"&&dg(s,t,a)),Qi(e,t,s);break;case 21:Qi(e,t,s);break;case 22:Gn=(a=Gn)||s.memoizedState!==null,Qi(e,t,s),Gn=a;break;default:Qi(e,t,s)}}function _g(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ec(e)}catch(s){Gt(t,t.return,s)}}}function yg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ec(e)}catch(s){Gt(t,t.return,s)}}function Vy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mg),t;default:throw Error(c(435,e.tag))}}function ed(e,t){var s=Vy(e);t.forEach(function(a){if(!s.has(a)){s.add(a);var d=e0.bind(null,e,a);a.then(d,d)}})}function Ks(e,t){var s=t.deletions;if(s!==null)for(var a=0;a<s.length;a++){var d=s[a],f=e,y=t,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(Ta(w.type)){bn=w.stateNode,Qs=!1;break e}break;case 5:bn=w.stateNode,Qs=!1;break e;case 3:case 4:bn=w.stateNode.containerInfo,Qs=!0;break e}w=w.return}if(bn===null)throw Error(c(160));bg(f,y,d),bn=null,Qs=!1,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vg(t,e),t=t.sibling}var Bl=null;function vg(e,t){var s=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ks(t,e),Zs(e),a&4&&(va(3,e,e.return),Do(3,e),va(5,e,e.return));break;case 1:Ks(t,e),Zs(e),a&512&&(Gn||s===null||ci(s,s.return)),a&64&&Xi&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?a:s.concat(a))));break;case 26:var d=Bl;if(Ks(t,e),Zs(e),a&512&&(Gn||s===null||ci(s,s.return)),a&4){var f=s!==null?s.memoizedState:null;if(a=e.memoizedState,s===null)if(a===null)if(e.stateNode===null){e:{a=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(a){case"title":f=d.getElementsByTagName("title")[0],(!f||f[Ln]||f[hn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(a),d.head.insertBefore(f,d.querySelector("head > title"))),os(f,a,s),f[hn]=e,et(f),a=f;break e;case"link":var y=vx("link","href",d).get(a+(s.href||""));if(y){for(var w=0;w<y.length;w++)if(f=y[w],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(w,1);break t}}f=d.createElement(a),os(f,a,s),d.head.appendChild(f);break;case"meta":if(y=vx("meta","content",d).get(a+(s.content||""))){for(w=0;w<y.length;w++)if(f=y[w],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(w,1);break t}}f=d.createElement(a),os(f,a,s),d.head.appendChild(f);break;default:throw Error(c(468,a))}f[hn]=e,et(f),a=f}e.stateNode=a}else jx(d,e.type,e.stateNode);else e.stateNode=yx(d,a,e.memoizedProps);else f!==a?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,a===null?jx(d,e.type,e.stateNode):yx(d,a,e.memoizedProps)):a===null&&e.stateNode!==null&&eh(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ks(t,e),Zs(e),a&512&&(Gn||s===null||ci(s,s.return)),s!==null&&a&4&&eh(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ks(t,e),Zs(e),a&512&&(Gn||s===null||ci(s,s.return)),e.flags&32){d=e.stateNode;try{J(d,"")}catch(Le){Gt(e,e.return,Le)}}a&4&&e.stateNode!=null&&(d=e.memoizedProps,eh(e,d,s!==null?s.memoizedProps:d)),a&1024&&(sh=!0);break;case 6:if(Ks(t,e),Zs(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,s=e.stateNode;try{s.nodeValue=a}catch(Le){Gt(e,e.return,Le)}}break;case 3:if(gd=null,d=Bl,Bl=pd(t.containerInfo),Ks(t,e),Bl=d,Zs(e),a&4&&s!==null&&s.memoizedState.isDehydrated)try{Ec(t.containerInfo)}catch(Le){Gt(e,e.return,Le)}sh&&(sh=!1,jg(e));break;case 4:a=Bl,Bl=pd(e.stateNode.containerInfo),Ks(t,e),Zs(e),Bl=a;break;case 12:Ks(t,e),Zs(e);break;case 31:Ks(t,e),Zs(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ed(e,a)));break;case 13:Ks(t,e),Zs(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(nd=Ce()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ed(e,a)));break;case 22:d=e.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,W=Xi,oe=Gn;if(Xi=W||d,Gn=oe||M,Ks(t,e),Gn=oe,Xi=W,Zs(e),a&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(s===null||M||Xi||Gn||xr(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){M=s=t;try{if(f=M.stateNode,d)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=M.stateNode;var ge=M.memoizedProps.style,te=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;w.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Le){Gt(M,M.return,Le)}}}else if(t.tag===6){if(s===null){M=t;try{M.stateNode.nodeValue=d?"":M.memoizedProps}catch(Le){Gt(M,M.return,Le)}}}else if(t.tag===18){if(s===null){M=t;try{var le=M.stateNode;d?dx(le,!0):dx(M.stateNode,!1)}catch(Le){Gt(M,M.return,Le)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(s=a.retryQueue,s!==null&&(a.retryQueue=null,ed(e,s))));break;case 19:Ks(t,e),Zs(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ed(e,a)));break;case 30:break;case 21:break;default:Ks(t,e),Zs(e)}}function Zs(e){var t=e.flags;if(t&2){try{for(var s,a=e.return;a!==null;){if(hg(a)){s=a;break}a=a.return}if(s==null)throw Error(c(160));switch(s.tag){case 27:var d=s.stateNode,f=th(e);Wu(e,f,d);break;case 5:var y=s.stateNode;s.flags&32&&(J(y,""),s.flags&=-33);var w=th(e);Wu(e,w,y);break;case 3:case 4:var M=s.stateNode.containerInfo,W=th(e);nh(e,W,M);break;default:throw Error(c(161))}}catch(oe){Gt(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;jg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ki(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gg(e,t.alternate,t),t=t.sibling}function xr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:va(4,t,t.return),xr(t);break;case 1:ci(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&dg(t,t.return,s),xr(t);break;case 27:$o(t.stateNode);case 26:case 5:ci(t,t.return),xr(t);break;case 22:t.memoizedState===null&&xr(t);break;case 30:xr(t);break;default:xr(t)}e=e.sibling}}function Zi(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,d=e,f=t,y=f.flags;switch(f.tag){case 0:case 11:case 15:Zi(d,f,s),Do(4,f);break;case 1:if(Zi(d,f,s),a=f,d=a.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(W){Gt(a,a.return,W)}if(a=f,d=a.updateQueue,d!==null){var w=a.stateNode;try{var M=d.shared.hiddenCallbacks;if(M!==null)for(d.shared.hiddenCallbacks=null,d=0;d<M.length;d++)ko(M[d],w)}catch(W){Gt(a,a.return,W)}}s&&y&64&&ug(f),Oo(f,f.return);break;case 27:pg(f);case 26:case 5:Zi(d,f,s),s&&a===null&&y&4&&fg(f),Oo(f,f.return);break;case 12:Zi(d,f,s);break;case 31:Zi(d,f,s),s&&y&4&&_g(d,f);break;case 13:Zi(d,f,s),s&&y&4&&yg(d,f);break;case 22:f.memoizedState===null&&Zi(d,f,s),Oo(f,f.return);break;case 30:break;default:Zi(d,f,s)}t=t.sibling}}function lh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ga(s))}function ih(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function ql(e,t,s,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wg(e,t,s,a),t=t.sibling}function wg(e,t,s,a){var d=t.flags;switch(t.tag){case 0:case 11:case 15:ql(e,t,s,a),d&2048&&Do(9,t);break;case 1:ql(e,t,s,a);break;case 3:ql(e,t,s,a),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(d&2048){ql(e,t,s,a),e=t.stateNode;try{var f=t.memoizedProps,y=f.id,w=f.onPostCommit;typeof w=="function"&&w(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Gt(t,t.return,M)}}else ql(e,t,s,a);break;case 31:ql(e,t,s,a);break;case 13:ql(e,t,s,a);break;case 23:break;case 22:f=t.stateNode,y=t.alternate,t.memoizedState!==null?f._visibility&2?ql(e,t,s,a):Lo(e,t):f._visibility&2?ql(e,t,s,a):(f._visibility|=2,gc(e,t,s,a,(t.subtreeFlags&10256)!==0||!1)),d&2048&&lh(y,t);break;case 24:ql(e,t,s,a),d&2048&&ih(t.alternate,t);break;default:ql(e,t,s,a)}}function gc(e,t,s,a,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,y=t,w=s,M=a,W=y.flags;switch(y.tag){case 0:case 11:case 15:gc(f,y,w,M,d),Do(8,y);break;case 23:break;case 22:var oe=y.stateNode;y.memoizedState!==null?oe._visibility&2?gc(f,y,w,M,d):Lo(f,y):(oe._visibility|=2,gc(f,y,w,M,d)),d&&W&2048&&lh(y.alternate,y);break;case 24:gc(f,y,w,M,d),d&&W&2048&&ih(y.alternate,y);break;default:gc(f,y,w,M,d)}t=t.sibling}}function Lo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,a=t,d=a.flags;switch(a.tag){case 22:Lo(s,a),d&2048&&lh(a.alternate,a);break;case 24:Lo(s,a),d&2048&&ih(a.alternate,a);break;default:Lo(s,a)}t=t.sibling}}var zo=8192;function xc(e,t,s){if(e.subtreeFlags&zo)for(e=e.child;e!==null;)Ng(e,t,s),e=e.sibling}function Ng(e,t,s){switch(e.tag){case 26:xc(e,t,s),e.flags&zo&&e.memoizedState!==null&&R0(s,Bl,e.memoizedState,e.memoizedProps);break;case 5:xc(e,t,s);break;case 3:case 4:var a=Bl;Bl=pd(e.stateNode.containerInfo),xc(e,t,s),Bl=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=zo,zo=16777216,xc(e,t,s),zo=a):xc(e,t,s));break;default:xc(e,t,s)}}function kg(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 Io(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var a=t[s];ts=a,Eg(a,e)}kg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sg(e),e=e.sibling}function Sg(e){switch(e.tag){case 0:case 11:case 15:Io(e),e.flags&2048&&va(9,e,e.return);break;case 3:Io(e);break;case 12:Io(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,td(e)):Io(e);break;default:Io(e)}}function td(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var a=t[s];ts=a,Eg(a,e)}kg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:va(8,t,t.return),td(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,td(t));break;default:td(t)}e=e.sibling}}function Eg(e,t){for(;ts!==null;){var s=ts;switch(s.tag){case 0:case 11:case 15:va(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var a=s.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:ga(s.memoizedState.cache)}if(a=s.child,a!==null)a.return=s,ts=a;else e:for(s=e;ts!==null;){a=ts;var d=a.sibling,f=a.return;if(xg(a),a===s){ts=null;break e}if(d!==null){d.return=f,ts=d;break e}ts=f}}}var Xy={getCacheForType:function(e){var t=Kn(Sn),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Kn(Sn).controller.signal}},Qy=typeof WeakMap=="function"?WeakMap:Map,Lt=0,en=null,vt=null,wt=0,qt=0,rl=null,ja=!1,bc=!1,ah=!1,Fi=0,Tn=0,wa=0,br=0,rh=0,cl=0,_c=0,Uo=null,Fs=null,ch=!1,nd=0,Tg=0,sd=1/0,ld=null,Na=null,Fn=0,ka=null,yc=null,Ji=0,oh=0,uh=null,Cg=null,Ho=0,dh=null;function ol(){return(Lt&2)!==0&&wt!==0?wt&-wt:Z.T!==null?xh():ji()}function Ag(){if(cl===0)if((wt&536870912)===0||yt){var e=lt;lt<<=1,(lt&3932160)===0&&(lt=262144),cl=e}else cl=536870912;return e=rt.current,e!==null&&(e.flags|=32),cl}function Js(e,t,s){(e===en&&(qt===2||qt===9)||e.cancelPendingCommit!==null)&&(vc(e,0),Sa(e,wt,cl,!1)),ps(e,s),((Lt&2)===0||e!==en)&&(e===en&&((Lt&2)===0&&(br|=s),Tn===4&&Sa(e,wt,cl,!1)),oi(e))}function Rg(e,t,s){if((Lt&6)!==0)throw Error(c(327));var a=!s&&(t&127)===0&&(t&e.expiredLanes)===0||he(e,t),d=a?Fy(e,t):hh(e,t,!0),f=a;do{if(d===0){bc&&!a&&Sa(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!Ky(s)){d=hh(e,t,!1),f=!1;continue}if(d===2){if(f=t,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var w=e;d=Uo;var M=w.current.memoizedState.isDehydrated;if(M&&(vc(w,y).flags|=256),y=hh(w,y,!1),y!==2){if(ah&&!M){w.errorRecoveryDisabledLanes|=f,br|=f,d=4;break e}f=Fs,Fs=d,f!==null&&(Fs===null?Fs=f:Fs.push.apply(Fs,f))}d=y}if(f=!1,d!==2)continue}}if(d===1){vc(e,0),Sa(e,t,0,!0);break}e:{switch(a=e,f=d,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Sa(a,t,cl,!ja);break e;case 2:Fs=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(d=nd+300-Ce(),10<d)){if(Sa(a,t,cl,!ja),F(a,0,!0)!==0)break e;Ji=t,a.timeoutHandle=cx(Mg.bind(null,a,s,Fs,ld,ch,t,cl,br,_c,ja,f,"Throttled",-0,0),d);break e}Mg(a,s,Fs,ld,ch,t,cl,br,_c,ja,f,null,-0,0)}}break}while(!0);oi(e)}function Mg(e,t,s,a,d,f,y,w,M,W,oe,ge,te,le){if(e.timeoutHandle=-1,ge=t.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ht},Ng(t,f,ge);var Le=(f&62914560)===f?nd-Ce():(f&4194048)===f?Tg-Ce():0;if(Le=M0(ge,Le),Le!==null){Ji=f,e.cancelPendingCommit=Le(Bg.bind(null,e,t,f,s,a,d,y,w,M,oe,ge,null,te,le)),Sa(e,f,y,!W);return}}Bg(e,t,f,s,a,d,y,w,M)}function Ky(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var a=0;a<s.length;a++){var d=s[a],f=d.getSnapshot;d=d.value;try{if(!Hn(f(),d))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Sa(e,t,s,a){t&=~rh,t&=~br,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var d=t;0<d;){var f=31-At(d),y=1<<f;a[f]=-1,d&=~y}s!==0&&Ws(e,s,t)}function id(){return(Lt&6)===0?(Bo(0),!1):!0}function fh(){if(vt!==null){if(qt===0)var e=vt.return;else e=vt,Ll=zi=null,Tf(e),_a=null,ya=0,e=vt;for(;e!==null;)og(e.alternate,e),e=e.return;vt=null}}function vc(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,p0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Ji=0,fh(),en=e,vt=s=fl(e.current,null),wt=t,qt=0,rl=null,ja=!1,bc=he(e,t),ah=!1,_c=cl=rh=br=wa=Tn=0,Fs=Uo=null,ch=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var d=31-At(a),f=1<<d;t|=e[d],a&=~f}return Fi=t,Pr(),s}function Dg(e,t){tt=null,Z.H=Ao,t===Il||t===fc?(t=Hi(),qt=3):t===dc?(t=Hi(),qt=4):qt=t===Yf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,rl=t,vt===null&&(Tn=1,Ku(e,ks(t,e.current)))}function Og(){var e=rt.current;return e===null?!0:(wt&4194048)===wt?It===null:(wt&62914560)===wt||(wt&536870912)!==0?e===It:!1}function Lg(){var e=Z.H;return Z.H=Ao,e===null?Ao:e}function zg(){var e=Z.A;return Z.A=Xy,e}function ad(){Tn=4,ja||(wt&4194048)!==wt&&rt.current!==null||(bc=!0),(wa&134217727)===0&&(br&134217727)===0||en===null||Sa(en,wt,cl,!1)}function hh(e,t,s){var a=Lt;Lt|=2;var d=Lg(),f=zg();(en!==e||wt!==t)&&(ld=null,vc(e,t)),t=!1;var y=Tn;e:do try{if(qt!==0&&vt!==null){var w=vt,M=rl;switch(qt){case 8:fh(),y=6;break e;case 3:case 2:case 9:case 6:rt.current===null&&(t=!0);var W=qt;if(qt=0,rl=null,jc(e,w,M,W),s&&bc){y=0;break e}break;default:W=qt,qt=0,rl=null,jc(e,w,M,W)}}Zy(),y=Tn;break}catch(oe){Dg(e,oe)}while(!0);return t&&e.shellSuspendCounter++,Ll=zi=null,Lt=a,Z.H=d,Z.A=f,vt===null&&(en=null,wt=0,Pr()),y}function Zy(){for(;vt!==null;)Ig(vt)}function Fy(e,t){var s=Lt;Lt|=2;var a=Lg(),d=zg();en!==e||wt!==t?(ld=null,sd=Ce()+500,vc(e,t)):bc=he(e,t);e:do try{if(qt!==0&&vt!==null){t=vt;var f=rl;t:switch(qt){case 1:qt=0,rl=null,jc(e,t,f,1);break;case 2:case 9:if(vo(f)){qt=0,rl=null,Ug(t);break}t=function(){qt!==2&&qt!==9||en!==e||(qt=7),oi(e)},f.then(t,t);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:vo(f)?(qt=0,rl=null,Ug(t)):(qt=0,rl=null,jc(e,t,f,7));break;case 5:var y=null;switch(vt.tag){case 26:y=vt.memoizedState;case 5:case 27:var w=vt;if(y?wx(y):w.stateNode.complete){qt=0,rl=null;var M=w.sibling;if(M!==null)vt=M;else{var W=w.return;W!==null?(vt=W,rd(W)):vt=null}break t}}qt=0,rl=null,jc(e,t,f,5);break;case 6:qt=0,rl=null,jc(e,t,f,6);break;case 8:fh(),Tn=6;break e;default:throw Error(c(462))}}Jy();break}catch(oe){Dg(e,oe)}while(!0);return Ll=zi=null,Z.H=a,Z.A=d,Lt=s,vt!==null?0:(en=null,wt=0,Pr(),Tn)}function Jy(){for(;vt!==null&&!De();)Ig(vt)}function Ig(e){var t=rg(e.alternate,e,Fi);e.memoizedProps=e.pendingProps,t===null?rd(e):vt=t}function Ug(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=tg(s,t,t.pendingProps,t.type,void 0,wt);break;case 11:t=tg(s,t,t.pendingProps,t.type.render,t.ref,wt);break;case 5:Tf(t);default:og(s,t),t=vt=ho(t,Fi),t=rg(s,t,Fi)}e.memoizedProps=e.pendingProps,t===null?rd(e):vt=t}function jc(e,t,s,a){Ll=zi=null,Tf(t),_a=null,ya=0;var d=t.return;try{if(Hy(e,d,t,s,wt)){Tn=1,Ku(e,ks(s,e.current)),vt=null;return}}catch(f){if(d!==null)throw vt=d,f;Tn=1,Ku(e,ks(s,e.current)),vt=null;return}t.flags&32768?(yt||a===1?e=!0:bc||(wt&536870912)!==0?e=!1:(ja=e=!0,(a===2||a===9||a===3||a===6)&&(a=rt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Hg(t,e)):rd(t)}function rd(e){var t=e;do{if((t.flags&32768)!==0){Hg(t,ja);return}e=t.return;var s=Gy(t.alternate,t,Fi);if(s!==null){vt=s;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Tn===0&&(Tn=5)}function Hg(e,t){do{var s=$y(e.alternate,e);if(s!==null){s.flags&=32767,vt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){vt=e;return}vt=e=s}while(e!==null);Tn=6,vt=null}function Bg(e,t,s,a,d,f,y,w,M){e.cancelPendingCommit=null;do cd();while(Fn!==0);if((Lt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=oo,Us(e,s,f,y,w,M),e===en&&(vt=en=null,wt=0),yc=t,ka=e,Ji=s,oh=f,uh=d,Cg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,t0(nn,function(){return Vg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=Z.T,Z.T=null,d=$.p,$.p=2,y=Lt,Lt|=4;try{Yy(e,t,s)}finally{Lt=y,$.p=d,Z.T=a}}Fn=1,qg(),Gg(),$g()}}function qg(){if(Fn===1){Fn=0;var e=ka,t=yc,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var a=$.p;$.p=2;var d=Lt;Lt|=4;try{vg(t,e);var f=kh,y=oa(e.containerInfo),w=f.focusedElem,M=f.selectionRange;if(y!==w&&w&&w.ownerDocument&&Y(w.ownerDocument.documentElement,w)){if(M!==null&&Ai(w)){var W=M.start,oe=M.end;if(oe===void 0&&(oe=W),"selectionStart"in w)w.selectionStart=W,w.selectionEnd=Math.min(oe,w.value.length);else{var ge=w.ownerDocument||document,te=ge&&ge.defaultView||window;if(te.getSelection){var le=te.getSelection(),Le=w.textContent.length,Pe=Math.min(M.start,Le),Kt=M.end===void 0?Pe:Math.min(M.end,Le);!le.extend&&Pe>Kt&&(y=Kt,Kt=Pe,Pe=y);var X=lo(w,Pe),B=lo(w,Kt);if(X&&B&&(le.rangeCount!==1||le.anchorNode!==X.node||le.anchorOffset!==X.offset||le.focusNode!==B.node||le.focusOffset!==B.offset)){var P=ge.createRange();P.setStart(X.node,X.offset),le.removeAllRanges(),Pe>Kt?(le.addRange(P),le.extend(B.node,B.offset)):(P.setEnd(B.node,B.offset),le.addRange(P))}}}}for(ge=[],le=w;le=le.parentNode;)le.nodeType===1&&ge.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ge.length;w++){var fe=ge[w];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}yd=!!Nh,kh=Nh=null}finally{Lt=d,$.p=a,Z.T=s}}e.current=t,Fn=2}}function Gg(){if(Fn===2){Fn=0;var e=ka,t=yc,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var a=$.p;$.p=2;var d=Lt;Lt|=4;try{gg(e,t.alternate,t)}finally{Lt=d,$.p=a,Z.T=s}}Fn=3}}function $g(){if(Fn===4||Fn===3){Fn=0,ut();var e=ka,t=yc,s=Ji,a=Cg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Fn=5:(Fn=0,yc=ka=null,Yg(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Na=null),Jn(s),t=t.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(ft,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=Z.T,d=$.p,$.p=2,Z.T=null;try{for(var f=e.onRecoverableError,y=0;y<a.length;y++){var w=a[y];f(w.value,{componentStack:w.stack})}}finally{Z.T=t,$.p=d}}(Ji&3)!==0&&cd(),oi(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===dh?Ho++:(Ho=0,dh=e):Ho=0,Bo(0)}}function Yg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function cd(){return qg(),Gg(),$g(),Vg()}function Vg(){if(Fn!==5)return!1;var e=ka,t=oh;oh=0;var s=Jn(Ji),a=Z.T,d=$.p;try{$.p=32>s?32:s,Z.T=null,s=uh,uh=null;var f=ka,y=Ji;if(Fn=0,yc=ka=null,Ji=0,(Lt&6)!==0)throw Error(c(331));var w=Lt;if(Lt|=4,Sg(f.current),wg(f,f.current,y,s),Lt=w,Bo(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(ft,f)}catch{}return!0}finally{$.p=d,Z.T=a,Yg(e,t)}}function Xg(e,t,s){t=ks(s,t),t=$f(e.stateNode,t,2),e=ri(e,t,2),e!==null&&(ps(e,2),oi(e))}function Gt(e,t,s){if(e.tag===3)Xg(e,e,s);else for(;t!==null;){if(t.tag===3){Xg(t,e,s);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Na===null||!Na.has(a))){e=ks(s,e),s=Qm(2),a=ri(t,s,2),a!==null&&(Km(s,a,t,e),ps(a,2),oi(a));break}}t=t.return}}function ph(e,t,s){var a=e.pingCache;if(a===null){a=e.pingCache=new Qy;var d=new Set;a.set(t,d)}else d=a.get(t),d===void 0&&(d=new Set,a.set(t,d));d.has(s)||(ah=!0,d.add(s),e=Py.bind(null,e,t,s),t.then(e,e))}function Py(e,t,s){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,en===e&&(wt&s)===s&&(Tn===4||Tn===3&&(wt&62914560)===wt&&300>Ce()-nd?(Lt&2)===0&&vc(e,0):rh|=s,_c===wt&&(_c=0)),oi(e)}function Qg(e,t){t===0&&(t=Ie()),e=Al(e,t),e!==null&&(ps(e,t),oi(e))}function Wy(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Qg(e,s)}function e0(e,t){var s=0;switch(e.tag){case 31:case 13:var a=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),Qg(e,s)}function t0(e,t){return Be(e,t)}var od=null,wc=null,mh=!1,ud=!1,gh=!1,Ea=0;function oi(e){e!==wc&&e.next===null&&(wc===null?od=wc=e:wc=wc.next=e),ud=!0,mh||(mh=!0,s0())}function Bo(e,t){if(!gh&&ud){gh=!0;do for(var s=!1,a=od;a!==null;){if(e!==0){var d=a.pendingLanes;if(d===0)var f=0;else{var y=a.suspendedLanes,w=a.pingedLanes;f=(1<<31-At(42|e)+1)-1,f&=d&~(y&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,Jg(a,f))}else f=wt,f=F(a,a===en?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||he(a,f)||(s=!0,Jg(a,f));a=a.next}while(s);gh=!1}}function n0(){Kg()}function Kg(){ud=mh=!1;var e=0;Ea!==0&&h0()&&(e=Ea);for(var t=Ce(),s=null,a=od;a!==null;){var d=a.next,f=Zg(a,t);f===0?(a.next=null,s===null?od=d:s.next=d,d===null&&(wc=s)):(s=a,(e!==0||(f&3)!==0)&&(ud=!0)),a=d}Fn!==0&&Fn!==5||Bo(e),Ea!==0&&(Ea=0)}function Zg(e,t){for(var s=e.suspendedLanes,a=e.pingedLanes,d=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-At(f),w=1<<y,M=d[y];M===-1?((w&s)===0||(w&a)!==0)&&(d[y]=Se(w,t)):M<=t&&(e.expiredLanes|=w),f&=~w}if(t=en,s=wt,s=F(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,s===0||e===t&&(qt===2||qt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Fe(a),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||he(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(a!==null&&Fe(a),Jn(s)){case 2:case 8:s=Ht;break;case 32:s=nn;break;case 268435456:s=_n;break;default:s=nn}return a=Fg.bind(null,e),s=Be(s,a),e.callbackPriority=t,e.callbackNode=s,t}return a!==null&&a!==null&&Fe(a),e.callbackPriority=2,e.callbackNode=null,2}function Fg(e,t){if(Fn!==0&&Fn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(cd()&&e.callbackNode!==s)return null;var a=wt;return a=F(e,e===en?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Rg(e,a,t),Zg(e,Ce()),e.callbackNode!=null&&e.callbackNode===s?Fg.bind(null,e):null)}function Jg(e,t){if(cd())return null;Rg(e,t,!0)}function s0(){m0(function(){(Lt&6)!==0?Be(Ft,n0):Kg()})}function xh(){if(Ea===0){var e=Zn;e===0&&(e=He,He<<=1,(He&261888)===0&&(He=256)),Ea=e}return Ea}function Pg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vn(""+e)}function Wg(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function l0(e,t,s,a,d){if(t==="submit"&&s&&s.stateNode===d){var f=Pg((d[it]||null).action),y=a.submitter;y&&(t=(t=y[it]||null)?Pg(t.formAction):y.getAttribute("formAction"),t!==null&&(f=t,y=null));var w=new sa("action","action",null,a,d);e.push({event:w,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ea!==0){var M=y?Wg(d,y):new FormData(d);If(s,{pending:!0,data:M,method:d.method,action:f},null,M)}}else typeof f=="function"&&(w.preventDefault(),M=y?Wg(d,y):new FormData(d),If(s,{pending:!0,data:M,method:d.method,action:f},f,M))},currentTarget:d}]})}}for(var bh=0;bh<Fr.length;bh++){var _h=Fr[bh],i0=_h.toLowerCase(),a0=_h[0].toUpperCase()+_h.slice(1);al(i0,"on"+a0)}al(Cu,"onAnimationEnd"),al(Au,"onAnimationIteration"),al(Ru,"onAnimationStart"),al("dblclick","onDoubleClick"),al("focusin","onFocus"),al("focusout","onBlur"),al(xf,"onTransitionRun"),al(bf,"onTransitionStart"),al(_f,"onTransitionCancel"),al(Mu,"onTransitionEnd"),Dt("onMouseEnter",["mouseout","mouseover"]),Dt("onMouseLeave",["mouseout","mouseover"]),Dt("onPointerEnter",["pointerout","pointerover"]),Dt("onPointerLeave",["pointerout","pointerover"]),as("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),as("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),as("onBeforeInput",["compositionend","keypress","textInput","paste"]),as("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),as("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),as("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="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(" "),r0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function ex(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var a=e[s],d=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var y=a.length-1;0<=y;y--){var w=a[y],M=w.instance,W=w.currentTarget;if(w=w.listener,M!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=W;try{f(d)}catch(oe){Jr(oe)}d.currentTarget=null,f=M}else for(y=0;y<a.length;y++){if(w=a[y],M=w.instance,W=w.currentTarget,w=w.listener,M!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=W;try{f(d)}catch(oe){Jr(oe)}d.currentTarget=null,f=M}}}}function jt(e,t){var s=t[el];s===void 0&&(s=t[el]=new Set);var a=e+"__bubble";s.has(a)||(tx(t,e,2,!1),s.add(a))}function yh(e,t,s){var a=0;t&&(a|=4),tx(s,e,a,t)}var dd="_reactListening"+Math.random().toString(36).slice(2);function vh(e){if(!e[dd]){e[dd]=!0,Pn.forEach(function(s){s!=="selectionchange"&&(r0.has(s)||yh(s,!1,e),yh(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dd]||(t[dd]=!0,yh("selectionchange",!1,t))}}function tx(e,t,s,a){switch(Ax(t)){case 2:var d=L0;break;case 8:d=z0;break;default:d=zh}s=d.bind(null,t,s,e),d=void 0,!Mn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),a?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function jh(e,t,s,a,d){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var y=a.tag;if(y===3||y===4){var w=a.stateNode.containerInfo;if(w===d)break;if(y===4)for(y=a.return;y!==null;){var M=y.tag;if((M===3||M===4)&&y.stateNode.containerInfo===d)return;y=y.return}for(;w!==null;){if(y=Yt(w),y===null)return;if(M=y.tag,M===5||M===6||M===26||M===27){a=f=y;continue e}w=w.parentNode}}a=a.return}Kl(function(){var W=f,oe=mn(s),ge=[];e:{var te=co.get(e);if(te!==void 0){var le=sa,Le=e;switch(e){case"keypress":if(In(s)===0)break e;case"keydown":case"keyup":le=Si;break;case"focusin":Le="focus",le=Ir;break;case"focusout":Le="blur",le=Ir;break;case"beforeblur":case"afterblur":le=Ir;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=_u;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=zr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=Fl;break;case Cu:case Au:case Ru:le=ia;break;case Mu:le=vu;break;case"scroll":case"scrollend":le=bu;break;case"wheel":le=ju;break;case"copy":case"cut":case"paste":le=Hr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Yr;break;case"toggle":case"beforetoggle":le=El}var Pe=(t&4)!==0,Kt=!Pe&&(e==="scroll"||e==="scrollend"),X=Pe?te!==null?te+"Capture":null:te;Pe=[];for(var B=W,P;B!==null;){var fe=B;if(P=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||P===null||X===null||(fe=vs(B,X),fe!=null&&Pe.push(Go(B,fe,P))),Kt)break;B=B.return}0<Pe.length&&(te=new le(te,Le,null,s,oe),ge.push({event:te,listeners:Pe}))}}if((t&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",te&&s!==Rn&&(Le=s.relatedTarget||s.fromElement)&&(Yt(Le)||Le[Nn]))break e;if((le||te)&&(te=oe.window===oe?oe:(te=oe.ownerDocument)?te.defaultView||te.parentWindow:window,le?(Le=s.relatedTarget||s.toElement,le=W,Le=Le?Yt(Le):null,Le!==null&&(Kt=u(Le),Pe=Le.tag,Le!==Kt||Pe!==5&&Pe!==27&&Pe!==6)&&(Le=null)):(le=null,Le=W),le!==Le)){if(Pe=_u,fe="onMouseLeave",X="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(Pe=Yr,fe="onPointerLeave",X="onPointerEnter",B="pointer"),Kt=le==null?te:ln(le),P=Le==null?te:ln(Le),te=new Pe(fe,B+"leave",le,s,oe),te.target=Kt,te.relatedTarget=P,fe=null,Yt(oe)===W&&(Pe=new Pe(X,B+"enter",Le,s,oe),Pe.target=P,Pe.relatedTarget=Kt,fe=Pe),Kt=fe,le&&Le)t:{for(Pe=c0,X=le,B=Le,P=0,fe=X;fe;fe=Pe(fe))P++;fe=0;for(var $e=B;$e;$e=Pe($e))fe++;for(;0<P-fe;)X=Pe(X),P--;for(;0<fe-P;)B=Pe(B),fe--;for(;P--;){if(X===B||B!==null&&X===B.alternate){Pe=X;break t}X=Pe(X),B=Pe(B)}Pe=null}else Pe=null;le!==null&&nx(ge,te,le,Pe,!1),Le!==null&&Kt!==null&&nx(ge,Kt,Le,Pe,!0)}}e:{if(te=W?ln(W):window,le=te.nodeName&&te.nodeName.toLowerCase(),le==="select"||le==="input"&&te.type==="file")var Rt=er;else if(no(te))if(tr)Rt=ir;else{Rt=lr;var Ue=sr}else le=te.nodeName,!le||le.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&Qe(W.elementType)&&(Rt=er):Rt=ku;if(Rt&&(Rt=Rt(e,W))){Dn(ge,Rt,s,oe);break e}Ue&&Ue(e,te,W),e==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&ys(te,"number",te.value)}switch(Ue=W?ln(W):window,e){case"focusin":(no(Ue)||Ue.contentEditable==="true")&&(Ri=Ue,io=W,es=null);break;case"focusout":es=io=Ri=null;break;case"mousedown":ao=!0;break;case"contextmenu":case"mouseup":case"dragend":ao=!1,Tu(ge,s,oe);break;case"selectionchange":if(Eu)break;case"keydown":case"keyup":Tu(ge,s,oe)}var mt;if(Ei)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 il?Nu(e,s)&&(Nt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Nt="onCompositionStart");Nt&&(Bt&&s.locale!=="ko"&&(il||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&il&&(mt=at()):(N=oe,ue="value"in N?N.value:N.textContent,il=!0)),Ue=fd(W,Nt),0<Ue.length&&(Nt=new yu(Nt,e,null,s,oe),ge.push({event:Nt,listeners:Ue}),mt?Nt.data=mt:(mt=Ja(s),mt!==null&&(Nt.data=mt)))),(mt=Fa?Un(e,s):Pa(e,s))&&(Nt=fd(W,"onBeforeInput"),0<Nt.length&&(Ue=new yu("onBeforeInput","beforeinput",null,s,oe),ge.push({event:Ue,listeners:Nt}),Ue.data=mt)),l0(ge,e,W,s,oe)}ex(ge,t)})}function Go(e,t,s){return{instance:e,listener:t,currentTarget:s}}function fd(e,t){for(var s=t+"Capture",a=[];e!==null;){var d=e,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=vs(e,s),d!=null&&a.unshift(Go(e,d,f)),d=vs(e,t),d!=null&&a.push(Go(e,d,f))),e.tag===3)return a;e=e.return}return[]}function c0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function nx(e,t,s,a,d){for(var f=t._reactName,y=[];s!==null&&s!==a;){var w=s,M=w.alternate,W=w.stateNode;if(w=w.tag,M!==null&&M===a)break;w!==5&&w!==26&&w!==27||W===null||(M=W,d?(W=vs(s,f),W!=null&&y.unshift(Go(s,W,M))):d||(W=vs(s,f),W!=null&&y.push(Go(s,W,M)))),s=s.return}y.length!==0&&e.push({event:t,listeners:y})}var o0=/\r\n?/g,u0=/\u0000|\uFFFD/g;function sx(e){return(typeof e=="string"?e:""+e).replace(o0,`
|
|
50
|
-
`).replace(u0,"")}function lx(e,t){return t=sx(t),sx(e)===t}function Qt(e,t,s,a,d,f){switch(s){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||J(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&J(e,""+a);break;case"className":kn(e,"class",a);break;case"tabIndex":kn(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":kn(e,s,a);break;case"style":qe(e,a,f);break;case"data":if(t!=="object"){kn(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(s);break}a=vn(""+a),e.setAttribute(s,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(s,"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"&&(s==="formAction"?(t!=="input"&&Qt(e,t,"name",d.name,d,null),Qt(e,t,"formEncType",d.formEncType,d,null),Qt(e,t,"formMethod",d.formMethod,d,null),Qt(e,t,"formTarget",d.formTarget,d,null)):(Qt(e,t,"encType",d.encType,d,null),Qt(e,t,"method",d.method,d,null),Qt(e,t,"target",d.target,d,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(s);break}a=vn(""+a),e.setAttribute(s,a);break;case"onClick":a!=null&&(e.onclick=ht);break;case"onScroll":a!=null&&jt("scroll",e);break;case"onScrollEnd":a!=null&&jt("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(s=a.__html,s!=null){if(d.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}s=vn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(s,""+a):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":a===!0?e.setAttribute(s,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(s,a):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(s,a):e.removeAttribute(s);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(s):e.setAttribute(s,a);break;case"popover":jt("beforetoggle",e),jt("toggle",e),an(e,"popover",a);break;case"xlinkActuate":Vn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Vn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Vn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Vn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Vn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Vn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Vn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Vn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Vn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":an(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Xt.get(s)||s,an(e,s,a))}}function wh(e,t,s,a,d,f){switch(s){case"style":qe(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(s=a.__html,s!=null){if(d.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"children":typeof a=="string"?J(e,a):(typeof a=="number"||typeof a=="bigint")&&J(e,""+a);break;case"onScroll":a!=null&&jt("scroll",e);break;case"onScrollEnd":a!=null&&jt("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ht);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!is.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),t=s.slice(2,d?s.length-7:void 0),f=e[it]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,d),typeof a=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,a,d);break e}s in e?e[s]=a:a===!0?e.setAttribute(s,""):an(e,s,a)}}}function os(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",e),jt("load",e);var a=!1,d=!1,f;for(f in s)if(s.hasOwnProperty(f)){var y=s[f];if(y!=null)switch(f){case"src":a=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,f,y,s,null)}}d&&Qt(e,t,"srcSet",s.srcSet,s,null),a&&Qt(e,t,"src",s.src,s,null);return;case"input":jt("invalid",e);var w=f=y=d=null,M=null,W=null;for(a in s)if(s.hasOwnProperty(a)){var oe=s[a];if(oe!=null)switch(a){case"name":d=oe;break;case"type":y=oe;break;case"checked":M=oe;break;case"defaultChecked":W=oe;break;case"value":f=oe;break;case"defaultValue":w=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(c(137,t));break;default:Qt(e,t,a,oe,s,null)}}nl(e,f,w,M,W,y,d,!1);return;case"select":jt("invalid",e),a=y=f=null;for(d in s)if(s.hasOwnProperty(d)&&(w=s[d],w!=null))switch(d){case"value":f=w;break;case"defaultValue":y=w;break;case"multiple":a=w;default:Qt(e,t,d,w,s,null)}t=f,s=y,e.multiple=!!a,t!=null?rn(e,!!a,t,!1):s!=null&&rn(e,!!a,s,!0);return;case"textarea":jt("invalid",e),f=d=a=null;for(y in s)if(s.hasOwnProperty(y)&&(w=s[y],w!=null))switch(y){case"value":a=w;break;case"defaultValue":d=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(c(91));break;default:Qt(e,t,y,w,s,null)}C(e,a,d,f);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(a=s[M],a!=null))switch(M){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Qt(e,t,M,a,s,null)}return;case"dialog":jt("beforetoggle",e),jt("toggle",e),jt("cancel",e),jt("close",e);break;case"iframe":case"object":jt("load",e);break;case"video":case"audio":for(a=0;a<qo.length;a++)jt(qo[a],e);break;case"image":jt("error",e),jt("load",e);break;case"details":jt("toggle",e);break;case"embed":case"source":case"link":jt("error",e),jt("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(W in s)if(s.hasOwnProperty(W)&&(a=s[W],a!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,W,a,s,null)}return;default:if(Qe(t)){for(oe in s)s.hasOwnProperty(oe)&&(a=s[oe],a!==void 0&&wh(e,t,oe,a,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(a=s[w],a!=null&&Qt(e,t,w,a,s,null))}function d0(e,t,s,a){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,y=null,w=null,M=null,W=null,oe=null;for(le in s){var ge=s[le];if(s.hasOwnProperty(le)&&ge!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":M=ge;default:a.hasOwnProperty(le)||Qt(e,t,le,null,a,ge)}}for(var te in a){var le=a[te];if(ge=s[te],a.hasOwnProperty(te)&&(le!=null||ge!=null))switch(te){case"type":f=le;break;case"name":d=le;break;case"checked":W=le;break;case"defaultChecked":oe=le;break;case"value":y=le;break;case"defaultValue":w=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(c(137,t));break;default:le!==ge&&Qt(e,t,te,le,a,ge)}}wi(e,y,w,M,W,oe,f,d);return;case"select":le=y=w=te=null;for(f in s)if(M=s[f],s.hasOwnProperty(f)&&M!=null)switch(f){case"value":break;case"multiple":le=M;default:a.hasOwnProperty(f)||Qt(e,t,f,null,a,M)}for(d in a)if(f=a[d],M=s[d],a.hasOwnProperty(d)&&(f!=null||M!=null))switch(d){case"value":te=f;break;case"defaultValue":w=f;break;case"multiple":y=f;default:f!==M&&Qt(e,t,d,f,a,M)}t=w,s=y,a=le,te!=null?rn(e,!!s,te,!1):!!a!=!!s&&(t!=null?rn(e,!!s,t,!0):rn(e,!!s,s?[]:"",!1));return;case"textarea":le=te=null;for(w in s)if(d=s[w],s.hasOwnProperty(w)&&d!=null&&!a.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Qt(e,t,w,null,a,d)}for(y in a)if(d=a[y],f=s[y],a.hasOwnProperty(y)&&(d!=null||f!=null))switch(y){case"value":te=d;break;case"defaultValue":le=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(c(91));break;default:d!==f&&Qt(e,t,y,d,a,f)}ve(e,te,le);return;case"option":for(var Le in s)if(te=s[Le],s.hasOwnProperty(Le)&&te!=null&&!a.hasOwnProperty(Le))switch(Le){case"selected":e.selected=!1;break;default:Qt(e,t,Le,null,a,te)}for(M in a)if(te=a[M],le=s[M],a.hasOwnProperty(M)&&te!==le&&(te!=null||le!=null))switch(M){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:Qt(e,t,M,te,a,le)}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 Pe in s)te=s[Pe],s.hasOwnProperty(Pe)&&te!=null&&!a.hasOwnProperty(Pe)&&Qt(e,t,Pe,null,a,te);for(W in a)if(te=a[W],le=s[W],a.hasOwnProperty(W)&&te!==le&&(te!=null||le!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(c(137,t));break;default:Qt(e,t,W,te,a,le)}return;default:if(Qe(t)){for(var Kt in s)te=s[Kt],s.hasOwnProperty(Kt)&&te!==void 0&&!a.hasOwnProperty(Kt)&&wh(e,t,Kt,void 0,a,te);for(oe in a)te=a[oe],le=s[oe],!a.hasOwnProperty(oe)||te===le||te===void 0&&le===void 0||wh(e,t,oe,te,a,le);return}}for(var X in s)te=s[X],s.hasOwnProperty(X)&&te!=null&&!a.hasOwnProperty(X)&&Qt(e,t,X,null,a,te);for(ge in a)te=a[ge],le=s[ge],!a.hasOwnProperty(ge)||te===le||te==null&&le==null||Qt(e,t,ge,te,a,le)}function ix(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function f0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),a=0;a<s.length;a++){var d=s[a],f=d.transferSize,y=d.initiatorType,w=d.duration;if(f&&w&&ix(y)){for(y=0,w=d.responseEnd,a+=1;a<s.length;a++){var M=s[a],W=M.startTime;if(W>w)break;var oe=M.transferSize,ge=M.initiatorType;oe&&ix(ge)&&(M=M.responseEnd,y+=oe*(M<w?1:(w-W)/(M-W)))}if(--a,t+=8*(f+y)/(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 Nh=null,kh=null;function hd(e){return e.nodeType===9?e:e.ownerDocument}function ax(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 rx(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 Sh(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 Eh=null;function h0(){var e=window.event;return e&&e.type==="popstate"?e===Eh?!1:(Eh=e,!0):(Eh=null,!1)}var cx=typeof setTimeout=="function"?setTimeout:void 0,p0=typeof clearTimeout=="function"?clearTimeout:void 0,ox=typeof Promise=="function"?Promise:void 0,m0=typeof queueMicrotask=="function"?queueMicrotask:typeof ox<"u"?function(e){return ox.resolve(null).then(e).catch(g0)}:cx;function g0(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function ux(e,t){var s=t,a=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(a===0){e.removeChild(d),Ec(t);return}a--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")a++;else if(s==="html")$o(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,$o(s);for(var f=s.firstChild;f;){var y=f.nextSibling,w=f.nodeName;f[Ln]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=y}}else s==="body"&&$o(e.ownerDocument.body);s=d}while(s);Ec(t)}function dx(e,t){var s=e;e=0;do{var a=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),a&&a.nodeType===8)if(s=a.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=a}while(s)}function Th(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Th(s),xs(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function x0(e,t,s,a){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ln])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 b0(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=bl(e.nextSibling),e===null))return null;return e}function fx(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 Ch(e){return e.data==="$?"||e.data==="$~"}function Ah(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var a=function(){t(),s.removeEventListener("DOMContentLoaded",a)};s.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}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 Rh=null;function hx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return bl(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function px(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function mx(e,t,s){switch(t=hd(s),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 $o(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xs(e)}var _l=new Map,gx=new Set;function pd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pi=$.d;$.d={f:y0,r:v0,D:j0,C:w0,L:N0,m:k0,X:E0,S:S0,M:T0};function y0(){var e=Pi.f(),t=id();return e||t}function v0(e){var t=Jt(e);t!==null&&t.tag===5&&t.type==="form"?Dm(t):Pi.r(e)}var Nc=typeof document>"u"?null:document;function xx(e,t,s){var a=Nc;if(a&&typeof t=="string"&&t){var d=An(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),gx.has(d)||(gx.add(d),e={rel:e,crossOrigin:s,href:t},a.querySelector(d)===null&&(t=a.createElement("link"),os(t,"link",e),et(t),a.head.appendChild(t)))}}function j0(e){Pi.D(e),xx("dns-prefetch",e,null)}function w0(e,t){Pi.C(e,t),xx("preconnect",e,t)}function N0(e,t,s){Pi.L(e,t,s);var a=Nc;if(a&&e&&t){var d='link[rel="preload"][as="'+An(t)+'"]';t==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+An(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+An(s.imageSizes)+'"]')):d+='[href="'+An(e)+'"]';var f=d;switch(t){case"style":f=kc(e);break;case"script":f=Sc(e)}_l.has(f)||(e=j({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),_l.set(f,e),a.querySelector(d)!==null||t==="style"&&a.querySelector(Yo(f))||t==="script"&&a.querySelector(Vo(f))||(t=a.createElement("link"),os(t,"link",e),et(t),a.head.appendChild(t)))}}function k0(e,t){Pi.m(e,t);var s=Nc;if(s&&e){var a=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+An(a)+'"][href="'+An(e)+'"]',f=d;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Sc(e)}if(!_l.has(f)&&(e=j({rel:"modulepreload",href:e},t),_l.set(f,e),s.querySelector(d)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Vo(f)))return}a=s.createElement("link"),os(a,"link",e),et(a),s.head.appendChild(a)}}}function S0(e,t,s){Pi.S(e,t,s);var a=Nc;if(a&&e){var d=pn(a).hoistableStyles,f=kc(e);t=t||"default";var y=d.get(f);if(!y){var w={loading:0,preload:null};if(y=a.querySelector(Yo(f)))w.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},s),(s=_l.get(f))&&Mh(e,s);var M=y=a.createElement("link");et(M),os(M,"link",e),M._p=new Promise(function(W,oe){M.onload=W,M.onerror=oe}),M.addEventListener("load",function(){w.loading|=1}),M.addEventListener("error",function(){w.loading|=2}),w.loading|=4,md(y,t,a)}y={type:"stylesheet",instance:y,count:1,state:w},d.set(f,y)}}}function E0(e,t){Pi.X(e,t);var s=Nc;if(s&&e){var a=pn(s).hoistableScripts,d=Sc(e),f=a.get(d);f||(f=s.querySelector(Vo(d)),f||(e=j({src:e,async:!0},t),(t=_l.get(d))&&Dh(e,t),f=s.createElement("script"),et(f),os(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(d,f))}}function T0(e,t){Pi.M(e,t);var s=Nc;if(s&&e){var a=pn(s).hoistableScripts,d=Sc(e),f=a.get(d);f||(f=s.querySelector(Vo(d)),f||(e=j({src:e,async:!0,type:"module"},t),(t=_l.get(d))&&Dh(e,t),f=s.createElement("script"),et(f),os(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(d,f))}}function bx(e,t,s,a){var d=(d=ze.current)?pd(d):null;if(!d)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=kc(s.href),s=pn(d).hoistableStyles,a=s.get(t),a||(a={type:"style",instance:null,count:0,state:null},s.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=kc(s.href);var f=pn(d).hoistableStyles,y=f.get(e);if(y||(d=d.ownerDocument||d,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=d.querySelector(Yo(e)))&&!f._p&&(y.instance=f,y.state.loading=5),_l.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},_l.set(e,s),f||C0(d,e,s,y.state))),t&&a===null)throw Error(c(528,""));return y}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sc(s),s=pn(d).hoistableScripts,a=s.get(t),a||(a={type:"script",instance:null,count:0,state:null},s.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function kc(e){return'href="'+An(e)+'"'}function Yo(e){return'link[rel="stylesheet"]['+e+"]"}function _x(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function C0(e,t,s,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),os(t,"link",s),et(t),e.head.appendChild(t))}function Sc(e){return'[src="'+An(e)+'"]'}function Vo(e){return"script[async]"+e}function yx(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+An(s.href)+'"]');if(a)return t.instance=a,et(a),a;var d=j({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),et(a),os(a,"style",d),md(a,s.precedence,e),t.instance=a;case"stylesheet":d=kc(s.href);var f=e.querySelector(Yo(d));if(f)return t.state.loading|=4,t.instance=f,et(f),f;a=_x(s),(d=_l.get(d))&&Mh(a,d),f=(e.ownerDocument||e).createElement("link"),et(f);var y=f;return y._p=new Promise(function(w,M){y.onload=w,y.onerror=M}),os(f,"link",a),t.state.loading|=4,md(f,s.precedence,e),t.instance=f;case"script":return f=Sc(s.src),(d=e.querySelector(Vo(f)))?(t.instance=d,et(d),d):(a=s,(d=_l.get(f))&&(a=j({},s),Dh(a,d)),e=e.ownerDocument||e,d=e.createElement("script"),et(d),os(d,"link",a),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&&(a=t.instance,t.state.loading|=4,md(a,s.precedence,e));return t.instance}function md(e,t,s){for(var a=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=a.length?a[a.length-1]:null,f=d,y=0;y<a.length;y++){var w=a[y];if(w.dataset.precedence===t)f=w;else if(f!==d)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Mh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Dh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gd=null;function vx(e,t,s){if(gd===null){var a=new Map,d=gd=new Map;d.set(s,a)}else d=gd,a=d.get(s),a||(a=new Map,d.set(s,a));if(a.has(e))return a;for(a.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var f=s[d];if(!(f[Ln]||f[hn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(t)||"";y=e+y;var w=a.get(y);w?w.push(f):a.set(y,[f])}}return a}function jx(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function A0(e,t,s){if(s===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 wx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function R0(e,t,s,a){if(s.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=kc(a.href),f=t.querySelector(Yo(d));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xd.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,et(f);return}f=t.ownerDocument||t,a=_x(a),(d=_l.get(d))&&Mh(a,d),f=f.createElement("link"),et(f);var y=f;y._p=new Promise(function(w,M){y.onload=w,y.onerror=M}),os(f,"link",a),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=xd.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Oh=0;function M0(e,t){return e.stylesheets&&e.count===0&&_d(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var a=setTimeout(function(){if(e.stylesheets&&_d(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Oh===0&&(Oh=62500*f0());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_d(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Oh?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(d)}}:null}function xd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_d(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bd=null;function _d(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bd=new Map,t.forEach(D0,e),bd=null,xd.call(e))}function D0(e,t){if(!(t.state.loading&4)){var s=bd.get(e);if(s)var a=s.get(null);else{s=new Map,bd.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var y=d[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),a=y)}a&&s.set(null,a)}d=t.instance,y=d.getAttribute("data-precedence"),f=s.get(y)||a,f===a&&s.set(null,d),s.set(y,d),this.count++,a=xd.bind(this),d.addEventListener("load",a),d.addEventListener("error",a),f?f.parentNode.insertBefore(d,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Xo={$$typeof:Q,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function O0(e,t,s,a,d,f,y,w,M){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=gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.hiddenUpdates=gt(null),this.identifierPrefix=a,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Nx(e,t,s,a,d,f,y,w,M,W,oe,ge){return e=new O0(e,t,s,y,M,W,oe,ge,w),t=1,f===!0&&(t|=24),f=Ns(3,null,null,t),e.current=f,f.stateNode=e,t=uc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:s,cache:t},wo(f),e}function kx(e){return e?(e=Li,e):Li}function Sx(e,t,s,a,d,f){d=kx(d),a.context===null?a.context=d:a.pendingContext=d,a=Ul(t),a.payload={element:s},f=f===void 0?null:f,f!==null&&(a.callback=f),s=ri(e,a,t),s!==null&&(Js(s,e,t),gl(s,e,t))}function Ex(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Lh(e,t){Ex(e,t),(e=e.alternate)&&Ex(e,t)}function Tx(e){if(e.tag===13||e.tag===31){var t=Al(e,67108864);t!==null&&Js(t,e,67108864),Lh(e,67108864)}}function Cx(e){if(e.tag===13||e.tag===31){var t=ol();t=Ms(t);var s=Al(e,t);s!==null&&Js(s,e,t),Lh(e,t)}}var yd=!0;function L0(e,t,s,a){var d=Z.T;Z.T=null;var f=$.p;try{$.p=2,zh(e,t,s,a)}finally{$.p=f,Z.T=d}}function z0(e,t,s,a){var d=Z.T;Z.T=null;var f=$.p;try{$.p=8,zh(e,t,s,a)}finally{$.p=f,Z.T=d}}function zh(e,t,s,a){if(yd){var d=Ih(a);if(d===null)jh(e,t,a,vd,s),Rx(e,a);else if(U0(d,e,t,s,a))a.stopPropagation();else if(Rx(e,a),t&4&&-1<I0.indexOf(e)){for(;d!==null;){var f=Jt(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=sn(f.pendingLanes);if(y!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var M=1<<31-At(y);w.entanglements[1]|=M,y&=~M}oi(f),(Lt&6)===0&&(sd=Ce()+500,Bo(0))}}break;case 31:case 13:w=Al(f,2),w!==null&&Js(w,f,2),id(),Lh(f,2)}if(f=Ih(a),f===null&&jh(e,t,a,vd,s),f===d)break;d=f}d!==null&&a.stopPropagation()}else jh(e,t,a,null,s)}}function Ih(e){return e=mn(e),Uh(e)}var vd=null;function Uh(e){if(vd=null,e=Yt(e),e!==null){var t=u(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vd=e,null}function Ax(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(kt()){case Ft:return 2;case Ht:return 8;case nn:case fn:return 32;case _n:return 268435456;default:return 32}default:return 32}}var Hh=!1,Ca=null,Aa=null,Ra=null,Qo=new Map,Ko=new Map,Ma=[],I0="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 Rx(e,t){switch(e){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":Qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ko.delete(t.pointerId)}}function Zo(e,t,s,a,d,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:a,nativeEvent:f,targetContainers:[d]},t!==null&&(t=Jt(t),t!==null&&Tx(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function U0(e,t,s,a,d){switch(t){case"focusin":return Ca=Zo(Ca,e,t,s,a,d),!0;case"dragenter":return Aa=Zo(Aa,e,t,s,a,d),!0;case"mouseover":return Ra=Zo(Ra,e,t,s,a,d),!0;case"pointerover":var f=d.pointerId;return Qo.set(f,Zo(Qo.get(f)||null,e,t,s,a,d)),!0;case"gotpointercapture":return f=d.pointerId,Ko.set(f,Zo(Ko.get(f)||null,e,t,s,a,d)),!0}return!1}function Mx(e){var t=Yt(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,ms(e.priority,function(){Cx(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,ms(e.priority,function(){Cx(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Ih(e.nativeEvent);if(s===null){s=e.nativeEvent;var a=new s.constructor(s.type,s);Rn=a,s.target.dispatchEvent(a),Rn=null}else return t=Jt(s),t!==null&&Tx(t),e.blockedOn=s,!1;t.shift()}return!0}function Dx(e,t,s){jd(e)&&s.delete(t)}function H0(){Hh=!1,Ca!==null&&jd(Ca)&&(Ca=null),Aa!==null&&jd(Aa)&&(Aa=null),Ra!==null&&jd(Ra)&&(Ra=null),Qo.forEach(Dx),Ko.forEach(Dx)}function wd(e,t){e.blockedOn===t&&(e.blockedOn=null,Hh||(Hh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,H0)))}var Nd=null;function Ox(e){Nd!==e&&(Nd=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Nd===e&&(Nd=null);for(var t=0;t<e.length;t+=3){var s=e[t],a=e[t+1],d=e[t+2];if(typeof a!="function"){if(Uh(a||s)===null)continue;break}var f=Jt(s);f!==null&&(e.splice(t,3),t-=3,If(f,{pending:!0,data:d,method:s.method,action:a},a,d))}}))}function Ec(e){function t(M){return wd(M,e)}Ca!==null&&wd(Ca,e),Aa!==null&&wd(Aa,e),Ra!==null&&wd(Ra,e),Qo.forEach(t),Ko.forEach(t);for(var s=0;s<Ma.length;s++){var a=Ma[s];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ma.length&&(s=Ma[0],s.blockedOn===null);)Mx(s),s.blockedOn===null&&Ma.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(a=0;a<s.length;a+=3){var d=s[a],f=s[a+1],y=d[it]||null;if(typeof f=="function")y||Ox(s);else if(y){var w=null;if(f&&f.hasAttribute("formAction")){if(d=f,y=f[it]||null)w=y.formAction;else if(Uh(d)!==null)continue}else w=y.action;typeof w=="function"?s[a+1]=w:(s.splice(a,3),a-=3),Ox(s)}}}function Lx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return d=y})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),a||setTimeout(s,20)}function s(){if(!a&&!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 a=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Bh(e){this._internalRoot=e}kd.prototype.render=Bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,a=ol();Sx(s,a,e,t,null,null)},kd.prototype.unmount=Bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sx(e.current,2,null,e,null,null),id(),t[Nn]=null}};function kd(e){this._internalRoot=e}kd.prototype.unstable_scheduleHydration=function(e){if(e){var t=ji();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ma.length&&t!==0&&t<Ma[s].priority;s++);Ma.splice(s,0,e),s===0&&Mx(e)}};var zx=l.version;if(zx!=="19.2.8")throw Error(c(527,zx,"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=x(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var B0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sd.isDisabled&&Sd.supportsFiber)try{ft=Sd.inject(B0),$t=Sd}catch{}}return Jo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var s=!1,a="",d=$m,f=Ym,y=Vm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=Nx(e,1,!1,null,null,s,a,null,d,f,y,Lx),e[Nn]=t.current,vh(e),new Bh(t)},Jo.hydrateRoot=function(e,t,s){if(!o(e))throw Error(c(299));var a=!1,d="",f=$m,y=Ym,w=Vm,M=null;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),t=Nx(e,1,!0,t,s??null,a,d,M,f,y,w,Lx),t.context=kx(null),s=t.current,a=ol(),a=Ms(a),d=Ul(a),d.callback=null,ri(s,d,a),s=a,t.current.lanes=s,ps(t,s),oi(t),e[Nn]=t.current,vh(e),new kd(t)},Jo.version="19.2.8",Jo}var Qx;function J0(){if(Qx)return Yh.exports;Qx=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(l){console.error(l)}}return n(),Yh.exports=F0(),Yh.exports}var P0=J0();const __=1;function W0(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${y_(n)}`}function ev(n){const l=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${l.replace(/^-+|-+$/g,"")||"project"}-${y_(n)}`,c=W0(n);return[l,r].filter(o=>o!==c)}function y_(n){const l=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return tv(l?n.toLowerCase():n)}function tv(n){let l=3735928559,r=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);l=Math.imul(l^o,2654435761),r=Math.imul(r^o,1597334677)}return l=Math.imul(l^l>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(l^l>>>13,3266489909),(4294967296*(2097151&r)+(l>>>0)).toString(36)}var ta,qc,Gc,$c,Yc,mu,Vc,cf,v_;class nv{constructor(l){jn(this,cf);jn(this,ta,null);jn(this,qc,new Set);jn(this,Gc,500);jn(this,$c,null);jn(this,Yc,!1);jn(this,mu,null);jn(this,Vc,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){zt(this,Vc,l)}connect(){if(We(this,Yc))return;const l=new WebSocket(this.url);zt(this,ta,l),l.addEventListener("open",()=>{var r,c;zt(this,Gc,500),this.send({type:"hello",protocol:__,clientName:"ccv-web"}),(r=We(this,mu))==null||r.call(this),(c=We(this,Vc))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of We(this,qc))o(c)}),l.addEventListener("close",()=>{var r;zt(this,ta,null),(r=We(this,Vc))==null||r.call(this),$n(this,cf,v_).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){zt(this,mu,l)}on(l){return We(this,qc).add(l),()=>We(this,qc).delete(l)}send(l){var r;((r=We(this,ta))==null?void 0:r.readyState)===WebSocket.OPEN&&We(this,ta).send(JSON.stringify(l))}get connected(){var l;return((l=We(this,ta))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;zt(this,Yc,!0),(l=We(this,ta))==null||l.close()}}ta=new WeakMap,qc=new WeakMap,Gc=new WeakMap,$c=new WeakMap,Yc=new WeakMap,mu=new WeakMap,Vc=new WeakMap,cf=new WeakSet,v_=function(){if(We(this,Yc)||We(this,$c)!==null)return;const l=We(this,Gc);zt(this,Gc,Math.min(l*2,1e4)),zt(this,$c,window.setTimeout(()=>{zt(this,$c,null),this.connect()},l))};const sv=1,j_="ccv:relay",Kd="ccv:relay.host";function lv(){try{const n=localStorage.getItem(j_);if(!n)return null;const l=JSON.parse(n);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function w_(){localStorage.removeItem(j_)}var xi,Xc,bi,Qc,Kc,Ga,Nr,kr,$a,Sr,Zc,Er,Tr,un,za,fp,N_,jr,hp;class iv{constructor(l){jn(this,un);jn(this,xi,null);jn(this,Xc,new Set);jn(this,bi,null);jn(this,Qc,null);jn(this,Kc,500);jn(this,Ga,null);jn(this,Nr,!1);jn(this,kr,!1);jn(this,$a,!1);jn(this,Sr,null);jn(this,Zc,"Подключаемся…");jn(this,Er,0);jn(this,Tr,[]);this.session=l}get connected(){return We(this,kr)&&We(this,$a)}get statusText(){return We(this,Zc)}get hostId(){return We(this,Sr)}on(l){return We(this,Xc).add(l),()=>We(this,Xc).delete(l)}onReconnect(l){zt(this,Qc,l)}onStatus(l){zt(this,bi,l)}connect(){We(this,Nr)||$n(this,un,fp).call(this)}send(l){if(!We(this,kr)){We(this,Tr).length<64&&We(this,Tr).push(l);return}$n(this,un,jr).call(this,{t:"client.frame",body:l})}close(){var l;zt(this,Nr,!0),We(this,Ga)!==null&&window.clearTimeout(We(this,Ga)),(l=We(this,xi))==null||l.close()}}xi=new WeakMap,Xc=new WeakMap,bi=new WeakMap,Qc=new WeakMap,Kc=new WeakMap,Ga=new WeakMap,Nr=new WeakMap,kr=new WeakMap,$a=new WeakMap,Sr=new WeakMap,Zc=new WeakMap,Er=new WeakMap,Tr=new WeakMap,un=new WeakSet,za=function(l){var r;We(this,Zc)!==l&&(zt(this,Zc,l),(r=We(this,bi))==null||r.call(this))},fp=async function(){if(We(this,xi))return;if(!We(this,Sr))try{zt(this,Sr,await av(this.session.token))}catch(c){$n(this,un,za).call(this,c instanceof Error?c.message:String(c)),$n(this,un,hp).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);zt(this,xi,r),r.addEventListener("open",()=>{$n(this,un,jr).call(this,{t:"client.hello",protocol:sv,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}$n(this,un,N_).call(this,o)}),r.addEventListener("close",()=>{var c;zt(this,xi,null),zt(this,kr,!1),zt(this,$a,!1),$n(this,un,za).call(this,"Нет связи с сервером"),(c=We(this,bi))==null||c.call(this),$n(this,un,hp).call(this)}),r.addEventListener("error",()=>r.close())},N_=function(l){var r,c,o,u,h,p,g;switch(l.t){case"client.ok":zt(this,Kc,500),$n(this,un,jr).call(this,{t:"client.attach",hostId:We(this,Sr)??"",...We(this,Er)>0?{sinceRseq:We(this,Er)}:{}});return;case"client.attached":zt(this,kr,!0),zt(this,$a,l.online),zt(this,Er,l.rseq),$n(this,un,za).call(this,l.online?"Хост на связи":"Компьютер не на связи"),$n(this,un,jr).call(this,{t:"client.frame",body:{type:"hello",protocol:__,clientName:"ccv-web-relay"}});const x=We(this,Tr);zt(this,Tr,[]);for(const v of x)$n(this,un,jr).call(this,{t:"client.frame",body:v});(r=We(this,Qc))==null||r.call(this),(c=We(this,bi))==null||c.call(this);return;case"host.frame":{l.rseq>0&&zt(this,Er,l.rseq);const v=l.body;for(const j of We(this,Xc))j(v);return}case"host.online":zt(this,$a,!0),$n(this,un,za).call(this,"Хост на связи"),(o=We(this,Qc))==null||o.call(this),(u=We(this,bi))==null||u.call(this);return;case"host.offline":zt(this,$a,!1),$n(this,un,za).call(this,"Компьютер не на связи"),(h=We(this,bi))==null||h.call(this);return;case"ping":$n(this,un,jr).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){w_(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Kd),$n(this,un,za).call(this,"Этот компьютер отвязан от аккаунта"),zt(this,Nr,!0),(p=We(this,xi))==null||p.close();return}l.code!=="offline"&&$n(this,un,za).call(this,l.message),(g=We(this,bi))==null||g.call(this);return}},jr=function(l){var r;((r=We(this,xi))==null?void 0:r.readyState)===WebSocket.OPEN&&We(this,xi).send(JSON.stringify(l))},hp=function(){if(We(this,Nr)||We(this,Ga)!==null)return;const l=We(this,Kc);zt(this,Kc,Math.min(l*2,1e4)),zt(this,Ga,window.setTimeout(()=>{zt(this,Ga,null),$n(this,un,fp).call(this)},l))};async function av(n){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Kd,l),l;const r=localStorage.getItem(Kd);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw w_(),location.href="/login",new Error("нужен вход");const u=(await c.json()).hosts??[];if(u.length===1&&u[0])return localStorage.setItem(Kd,u[0].id),u[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Zd(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const rv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function cv(){if(Zd()==="local")return new nv(rv);const n=lv();return n?new iv(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const k_="ccv:drafts",ov=40,uv=2e4,dv=500;let cu=null,ou=null;function Mp(){if(cu)return cu;const n=new Map;try{const l=localStorage.getItem(k_);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return cu=n,window.addEventListener("pagehide",E_),n}function Kh(n){return Mp().get(n)??""}function pp(n,l){const r=Mp(),c=l.slice(0,uv),o=r.has(n);if(o&&r.delete(n),c!=="")r.set(n,c);else if(!o)return;for(;r.size>ov;){const u=r.keys().next();if(u.done)break;r.delete(u.value)}pv(),hv()}function S_(){const n=new Set;for(const l of Mp().keys())n.add(l.startsWith("side:")?l.slice(5):l);return[...n].sort()}const mp=new Set;let Kx="";function fv(n){return mp.add(n),()=>mp.delete(n)}function hv(){const n=S_(),l=n.join(`
|
|
51
|
-
`);if(l!==Kx){Kx=l;for(const r of mp)r(n)}}function pv(){ou===null&&(ou=window.setTimeout(E_,dv))}function E_(){if(ou!==null&&window.clearTimeout(ou),ou=null,!!cu)try{localStorage.setItem(k_,JSON.stringify(Object.fromEntries(cu)))}catch{}}const ss={items:[],pending:[],lastSeq:0,contextTokens:null},Ya={entries:[],total:0,loading:!1};function Dp(n){var l;return((l=n.entries[0])==null?void 0:l.seq)??1}function gp(n){return n.total>0&&Dp(n)>1}function T_(n,l){const r=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,u)=>o.seq-u.seq),total:l.total,loading:!1}}function Op(n){return uu(ss,n).items.map(l=>({...l,id:`h:${l.id}`}))}function uu(n,l){let r=n;for(const c of l)c.seq<=r.lastSeq||(r={...mv(r,c.event,c.seq),lastSeq:c.seq});return r}function mv(n,l,r){var o,u;const c=n.items;switch(l.kind){case"user.message":return ui(n,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ui(n,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return Tc(n,h,{...p,text:p.text+l.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===l.blockId),p={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?ui(n,p):Tc(n,h,p)}case"thinking.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ui(n,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return Tc(n,h,{...p,text:p.text+l.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===l.blockId),p={id:l.blockId,kind:"thinking",text:l.text};return h===-1?ui(n,p):Tc(n,h,p)}case"tool.use":return ui(n,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===l.toolUseId);if(h===-1)return n;const p=c[h];return Tc(n,h,{...p,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(g=>g.requestId===l.requestId),p=n.pending.filter(g=>g.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return Tc({...n,pending:p},g,{...x,answers:l.answers})}}return l.decision==="allow"?{...n,pending:p}:ui({...n,pending:p},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=n.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),p=l.contextTokens??n.contextTokens;return ui({...n,items:h,contextTokens:p},{id:`r${r}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((u=l.usage)==null?void 0:u.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?n:ui(n,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ui(n,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return n;case"rewound":return n;default:return n}}function C_(n,l){let r=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(r===l)return n.slice(0,c);r++}return n}function A_(n,l,r){const c=l-r;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 ui(n,l){return{...n,items:[...n.items,l]}}function Tc(n,l,r){const c=n.items.slice();return c[l]=r,{...n,items:c}}const xp="ccv:theme",Zh=["system","light","dark"];function gv(){const[n,l]=b.useState(xv);b.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{var p;const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light",(p=document.querySelector('meta[name="theme-color"]'))==null||p.setAttribute("content",h?"#101115":"#f3f4f0")};return u(),o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[n]);const r=b.useCallback(o=>{try{localStorage.setItem(xp,o)}catch{}l(o)},[]),c=b.useCallback(()=>{l(o=>{const u=Zh[(Zh.indexOf(o)+1)%Zh.length];try{localStorage.setItem(xp,u)}catch{}return u})},[]);return[n,r,c]}function xv(){try{const n=localStorage.getItem(xp);if(n==="gpt")return"dark";if(n==="light"||n==="dark"||n==="system")return n}catch{}return"dark"}const R_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],bv=[{value:"default",hint:"чтение свободно, изменения и выход из песочницы — с разрешения"},{value:"acceptEdits",hint:"работа внутри проекта, выход за границы — с разрешения"},{value:"plan",hint:"песочница только для чтения; изменения требуют разрешения"},{value:"bypassPermissions",hint:"полный доступ без подтверждений"}],_v=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Cr={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:"второго разговора"}},bp=320,M_="ccv:panes";function yv(n){return`--${n}-w`}function D_(n,l){const r=Cr[n];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function vv(){const n={};for(const l of Object.keys(Cr))n[l]=Cr[l].width;try{const l=localStorage.getItem(M_);if(l){const r=JSON.parse(l);for(const c of Object.keys(Cr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=D_(c,o))}}}catch{}return n}function jv(){const[n,l]=b.useState(vv),r=b.useCallback(h=>{try{localStorage.setItem(M_,JSON.stringify(h))}catch{}},[]),c=b.useCallback((h,p)=>{l(g=>{const x=D_(h,p);if(g[h]===x)return g;const v={...g,[h]:x};return r(v),v})},[r]),o=b.useCallback(h=>{l(p=>{const g={...p,[h]:Cr[h].width};return r(g),g})},[r]),u={};for(const h of Object.keys(Cr))u[yv(h)]=`${n[h]}px`;return{widths:n,style:u,setWidth:c,reset:o}}const Fh=260,O_=120,wv=200,Zx="ccv:terminal-h";function Fx(n,l){return Math.round(Math.min(l,Math.max(O_,n)))}function Nv(){const[n,l]=b.useState(()=>{try{const u=localStorage.getItem(Zx);if(u){const h=Number(u);if(Number.isFinite(h))return Fx(h,1/0)}}catch{}return Fh}),r=b.useCallback(u=>{try{localStorage.setItem(Zx,String(u))}catch{}},[]),c=b.useCallback((u,h)=>{const p=Fx(u,h);l(g=>g===p?g:(r(p),p))},[r]),o=b.useCallback(()=>{l(Fh),r(Fh)},[r]);return{height:n,setHeight:c,reset:o}}function of(n){const[l,r]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return b.useEffect(()=>{const c=window.matchMedia(n),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),l}const kv=500,Sv=6;function L_({onLongPress:n,onClick:l,disabled:r=!1,thresholdMs:c=kv,moveCancelPx:o=Sv}){const u=b.useRef(null),[h,p]=b.useState(!1),g=b.useCallback(()=>{u.current&&window.clearTimeout(u.current.timer),u.current=null,p(!1)},[]),x=b.useCallback(E=>{if(r||E.button!==0)return;const A={timer:0,x:E.clientX,y:E.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,p(!1),n()},c),u.current=A,p(!0)},[r,c,n]),v=b.useCallback(E=>{const A=u.current;!A||A.fired||Math.hypot(E.clientX-A.x,E.clientY-A.y)>o&&g()},[o,g]),j=b.useCallback(()=>{u.current&&!u.current.fired?g():p(!1)},[g]),_=b.useCallback(E=>{var A;if((A=u.current)!=null&&A.fired){u.current=null,E.preventDefault();return}if(!r){if(E.shiftKey){n();return}l()}},[r,l,n]),S=b.useCallback(E=>{E.preventDefault()},[]),k=b.useCallback(E=>{r||E.shiftKey&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),n())},[r,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:v,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:_,onContextMenu:S,onKeyDown:k}}}const Ev={height:0,offsetTop:0,offsetLeft:0};function Jx(){if(typeof window>"u")return Ev;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Tv(n){const[l,r]=b.useState(Jx);return b.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const u=Jx();r(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]),l}function Lp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dr=Lp();function z_(n){Dr=n}var wr={exec:()=>null};function Cc(n){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=n(c),l[c]=o),o}}function Tt(n,l=""){let r=typeof n=="string"?n:n.source,c={replace:(o,u)=>{let h=typeof u=="string"?u:u.source;return h=h.replace(Ts.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var Cv=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),Ts={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:Cc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Cc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Cc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Cc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Cc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Cc(n=>new RegExp(`^ {0,${n}}>`))},Av=/^(?:[ \t]*(?:\n|$))+/,Rv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,I_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,U_=Tt(I_).replace(/bull/g,zp).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(),Ov=Tt(I_).replace(/bull/g,zp).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(),Ip=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Lv=/^[^\n]+/,Up=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,zv=Tt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Up).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Iv=Tt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zp).getRegex(),uf="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",Hp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Uv=Tt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Hp).replace("tag",uf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H_=n=>Tt(Ip).replace("hr",gu).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",uf).getRegex(),Hv=H_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Bv=H_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),qv=Tt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bv).getRegex(),Bp={blockquote:qv,code:Rv,def:zv,fences:Mv,heading:Dv,hr:gu,html:Uv,lheading:U_,list:Iv,newline:Av,paragraph:Hv,table:wr,text:Lv},Px=Tt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gu).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",uf).getRegex(),Gv={...Bp,lheading:Ov,table:Px,paragraph:Tt(Ip).replace("hr",gu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Px).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",uf).getRegex()},$v={...Bp,html:Tt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hp).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:wr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Tt(Ip).replace("hr",gu).replace("heading",` *#{1,6} *[^
|
|
52
|
-
]`).replace("lheading",U_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Yv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Vv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,B_=/^( {2,}|\\)\n(?!\s*$)/,Xv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jc=/[\p{P}\p{S}]/u,df=/[\s\p{P}\p{S}]/u,qp=/[^\s\p{P}\p{S}]/u,Qv=Tt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,df).getRegex(),q_=/(?!~)[\p{P}\p{S}]/u,Kv=/(?!~)[\s\p{P}\p{S}]/u,Zv=/(?:[^\s\p{P}\p{S}]|~)/u,Fv=Tt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Cv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),G_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Jv=Tt(G_,"u").replace(/punct/g,Jc).getRegex(),Pv=Tt(G_,"u").replace(/punct/g,q_).getRegex(),$_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Wv=Tt($_,"gu").replace(/notPunctSpace/g,qp).replace(/punctSpace/g,df).replace(/punct/g,Jc).getRegex(),ej=Tt($_,"gu").replace(/notPunctSpace/g,Zv).replace(/punctSpace/g,Kv).replace(/punct/g,q_).getRegex(),tj=Tt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qp).replace(/punctSpace/g,df).replace(/punct/g,Jc).getRegex(),nj=Tt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Jc).getRegex(),sj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lj=Tt(sj,"gu").replace(/notPunctSpace/g,qp).replace(/punctSpace/g,df).replace(/punct/g,Jc).getRegex(),ij=Tt(/\\(punct)/,"gu").replace(/punct/g,Jc).getRegex(),aj=Tt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),rj=Tt(Hp).replace("(?:-->|$)","-->").getRegex(),cj=Tt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",rj).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,oj=Tt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Pd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Y_=Tt(/^!?\[(label)\]\[(ref)\]/).replace("label",Pd).replace("ref",Up).getRegex(),V_=Tt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Up).getRegex(),uj=Tt("reflink|nolink(?!\\()","g").replace("reflink",Y_).replace("nolink",V_).getRegex(),Wx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gp={_backpedal:wr,anyPunctuation:ij,autolink:aj,blockSkip:Fv,br:B_,code:Vv,del:wr,delLDelim:wr,delRDelim:wr,emStrongLDelim:Jv,emStrongRDelimAst:Wv,emStrongRDelimUnd:tj,escape:Yv,link:oj,nolink:V_,punctuation:Qv,reflink:Y_,reflinkSearch:uj,tag:cj,text:Xv,url:wr},dj={...Gp,link:Tt(/^!?\[(label)\]\((.*?)\)/).replace("label",Pd).getRegex(),reflink:Tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pd).getRegex()},_p={...Gp,emStrongRDelimAst:ej,emStrongLDelim:Pv,delLDelim:nj,delRDelim:lj,url:Tt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Wx).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Tt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Wx).getRegex()},fj={..._p,br:Tt(B_).replace("{2,}","*").getRegex(),text:Tt(_p.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ed={normal:Bp,gfm:Gv,pedantic:$v},Po={normal:Gp,gfm:_p,breaks:fj,pedantic:dj},hj={"&":"&","<":"<",">":">",'"':""","'":"'"},eb=n=>hj[n];function pi(n,l){if(l){if(Ts.escapeTest.test(n))return n.replace(Ts.escapeReplace,eb)}else if(Ts.escapeTestNoEncode.test(n))return n.replace(Ts.escapeReplaceNoEncode,eb);return n}function tb(n){try{n=encodeURI(n).replace(Ts.percentDecode,"%")}catch{return null}return n}function nb(n,l){var u;let r=n.replace(Ts.findPipe,(h,p,g)=>{let x=!1,v=p;for(;--v>=0&&g[v]==="\\";)x=!x;return x?"|":" |"}),c=r.split(Ts.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((u=c.at(-1))!=null&&u.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(Ts.slashPipe,"|");return c}function Oa(n,l,r){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===l;)o++;return n.slice(0,c-o)}function sb(n){let l=n.split(`
|
|
53
|
-
`),r=l.length-1;for(;r>=0&&Ts.blankLine.test(l[r]);)r--;return l.length-r<=2?n:l.slice(0,r+1).join(`
|
|
54
|
-
`)}function pj(n,l){if(n.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===l[0])r++;else if(n[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function mj(n,l=0){let r=l,c="";for(let o of n)if(o===" "){let u=4-r%4;c+=" ".repeat(u),r+=u}else c+=o,r++;return c}function lb(n,l,r,c,o){let u=l.href,h=l.title||null,p=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,g}function gj(n,l,r){let c=n.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
55
|
-
`).map(u=>{let h=u.match(r.other.beginningSpace);if(h===null)return u;let[p]=h;return p.length>=o.length?u.slice(o.length):u}).join(`
|
|
56
|
-
`)}var Wd=class{constructor(n){Zt(this,"options");Zt(this,"rules");Zt(this,"lexer");this.options=n||Dr}space(n){let l=this.rules.block.newline.exec(n);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(n){let l=this.rules.block.code.exec(n);if(l){let r=this.options.pedantic?l[0]:sb(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(n){let l=this.rules.block.fences.exec(n);if(l){let r=l[0],c=gj(r,l[3]||"",this.rules);return{type:"code",raw:r,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(n){let l=this.rules.block.heading.exec(n);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=Oa(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Oa(l[0],`
|
|
57
|
-
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let l=this.rules.block.hr.exec(n);if(l)return{type:"hr",raw:Oa(l[0],`
|
|
58
|
-
`)}}blockquote(n){let l=this.rules.block.blockquote.exec(n);if(l){let r=Oa(l[0],`
|
|
59
|
-
`).split(`
|
|
60
|
-
`),c="",o="",u=[];for(;r.length>0;){let h=!1,p=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))p.push(r[g]),h=!0;else if(!h)p.push(r[g]);else break;r=r.slice(g);let x=p.join(`
|
|
61
|
-
`),v=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
-
${x}`:x,o=o?`${o}
|
|
64
|
-
${v}`:v;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,u,!0),this.lexer.state.top=j,r.length===0)break;let _=u.at(-1);if((_==null?void 0:_.type)==="code")break;if((_==null?void 0:_.type)==="blockquote"){let S=_,k=S.raw+`
|
|
65
|
-
`+r.join(`
|
|
66
|
-
`),E=this.blockquote(k);u[u.length-1]=E,c=c.substring(0,c.length-S.raw.length)+E.raw,o=o.substring(0,o.length-S.text.length)+E.text;break}else if((_==null?void 0:_.type)==="list"){let S=_,k=S.raw+`
|
|
67
|
-
`+r.join(`
|
|
68
|
-
`),E=this.list(k);u[u.length-1]=E,c=c.substring(0,c.length-_.raw.length)+E.raw,o=o.substring(0,o.length-S.raw.length)+E.raw,r=k.substring(u.at(-1).raw.length).split(`
|
|
69
|
-
`);continue}}return{type:"blockquote",raw:c,tokens:u,text:o}}}list(n){let l=this.rules.block.list.exec(n);if(l){let r=l[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let u=this.rules.other.listItemRegex(r),h=!1;for(;n;){let g=!1,x="",v="";if(!(l=u.exec(n))||this.rules.block.hr.test(n))break;x=l[0],n=n.substring(x.length);let j=mj(l[2].split(`
|
|
70
|
-
`,1)[0],l[1].length),_=n.split(`
|
|
71
|
-
`,1)[0],S=!j.trim(),k=0;if(this.options.pedantic?(k=2,v=j.trimStart()):S?k=l[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,v=j.slice(k),k+=l[1].length),S&&this.rules.other.blankLine.test(_)&&(x+=_+`
|
|
72
|
-
`,n=n.substring(_.length+1),g=!0),!g){let E=this.rules.other.nextBulletRegex(k),A=this.rules.other.hrRegex(k),D=this.rules.other.fencesBeginRegex(k),q=this.rules.other.headingBeginRegex(k),Q=this.rules.other.htmlBeginRegex(k),z=this.rules.other.blockquoteBeginRegex(k);for(;n;){let H=n.split(`
|
|
73
|
-
`,1)[0],L;if(_=H,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),L=_):L=_.replace(this.rules.other.tabCharGlobal," "),D.test(_)||q.test(_)||Q.test(_)||z.test(_)||E.test(_)||A.test(_))break;if(L.search(this.rules.other.nonSpaceChar)>=k||!_.trim())v+=`
|
|
74
|
-
`+L.slice(k);else{if(S||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(j)||q.test(j)||A.test(j))break;v+=`
|
|
75
|
-
`+_}S=!_.trim(),x+=H+`
|
|
76
|
-
`,n=n.substring(H.length+1),j=L.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(v),loose:!1,text:v,tokens:[]}),o.raw+=x}let p=o.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let v=this.rules.other.listTaskCheckbox.exec(g.raw);if(v){let j={type:"checkbox",raw:v[0]+" ",checked:v[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let v=g.tokens.filter(_=>_.type==="space"),j=v.length>0&&v.some(_=>this.rules.other.anyLine.test(_.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(n){let l=this.rules.block.html.exec(n);if(l){let r=sb(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(n){let l=this.rules.block.def.exec(n);if(l){let r=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:r,raw:Oa(l[0],`
|
|
77
|
-
`),href:c,title:o}}}table(n){var h;let l=this.rules.block.table.exec(n);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=nb(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
-
`):[],u={type:"table",raw:Oa(l[0],`
|
|
79
|
-
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let p of c)this.rules.other.tableAlignRight.test(p)?u.align.push("right"):this.rules.other.tableAlignCenter.test(p)?u.align.push("center"):this.rules.other.tableAlignLeft.test(p)?u.align.push("left"):u.align.push(null);for(let p=0;p<r.length;p++)u.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:u.align[p]});for(let p of o)u.rows.push(nb(p,u.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[x]})));return u}}lheading(n){let l=this.rules.block.lheading.exec(n);if(l){let r=l[1].trim();return{type:"heading",raw:Oa(l[0],`
|
|
80
|
-
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let l=this.rules.block.paragraph.exec(n);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
81
|
-
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let l=this.rules.block.text.exec(n);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(n){let l=this.rules.inline.escape.exec(n);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(n){let l=this.rules.inline.tag.exec(n);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(n){let l=this.rules.inline.link.exec(n);if(l){let r=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let u=Oa(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{let u=pj(l[2],"()");if(u===-2)return;if(u>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+u;l[2]=l[2].substring(0,u),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let u=this.rules.other.pedanticHrefTitle.exec(c);u&&(c=u[1],o=u[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),lb(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(n,l){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return lb(r,o,r[0],this.lexer,this.rules)}}emStrong(n,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(n);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,u,h,p=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*n.length+o);(c=x.exec(l))!==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]){p+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p+g);let v=[...c[0]][0].length,j=n.slice(0,o+c.index+v+h);if(Math.min(o,h)%2){let S=j.slice(1,-1);return{type:"em",raw:j,text:S,tokens:this.lexer.inlineTokens(S)}}let _=j.slice(2,-2);return{type:"strong",raw:j,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(n){let l=this.rules.inline.code.exec(n);if(l){let r=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:l[0],text:r}}}br(n){let l=this.rules.inline.br.exec(n);if(l)return{type:"br",raw:l[0]}}del(n,l,r=""){let c=this.rules.inline.delLDelim.exec(n);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,u,h,p=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,l=l.slice(-1*n.length+o);(c=g.exec(l))!==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]){p+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p);let x=[...c[0]][0].length,v=n.slice(0,o+c.index+x+h),j=v.slice(o,-o);return{type:"del",raw:v,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(n){let l=this.rules.inline.autolink.exec(n);if(l){let r,c;return l[2]==="@"?(r=l[1],c="mailto:"+r):(r=l[1],c=r),{type:"link",raw:l[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let l;if(l=this.rules.inline.url.exec(n)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let u;do u=l[0],l[0]=((r=this.rules.inline._backpedal.exec(l[0]))==null?void 0:r[0])??"";while(u!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let l=this.rules.inline.text.exec(n);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},$l=class yp{constructor(l){Zt(this,"tokens");Zt(this,"options");Zt(this,"state");Zt(this,"inlineQueue");Zt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Dr,this.options.tokenizer=this.options.tokenizer||new Wd,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 r={other:Ts,block:Ed.normal,inline:Po.normal};this.options.pedantic?(r.block=Ed.pedantic,r.inline=Po.pedantic):this.options.gfm&&(r.block=Ed.gfm,this.options.breaks?r.inline=Po.breaks:r.inline=Po.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ed,inline:Po}}static lex(l,r){return new yp(r).lex(l)}static lexInline(l,r){return new yp(r).inlineTokens(l)}lex(l){l=l.replace(Ts.carriageReturn,`
|
|
82
|
-
`),this.blockTokens(l,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,r=[],c=!1){var u,h,p;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(Ts.tabCharGlobal," ").replace(Ts.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let g;if((h=(u=this.options.extensions)==null?void 0:u.block)!=null&&h.some(v=>(g=v.call({lexer:this},l,r))?(l=l.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(l)){l=l.substring(g.raw.length);let v=r.at(-1);g.raw.length===1&&v!==void 0?v.raw+=`
|
|
83
|
-
`:r.push(g);continue}if(g=this.tokenizer.code(l)){l=l.substring(g.raw.length);let v=r.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|
84
|
-
`)?"":`
|
|
85
|
-
`)+g.raw,v.text+=`
|
|
86
|
-
`+g.text,this.inlineQueue.at(-1).src=v.text):r.push(g);continue}if(g=this.tokenizer.fences(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(l)){l=l.substring(g.raw.length);let v=r.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|
87
|
-
`)?"":`
|
|
88
|
-
`)+g.raw,v.text+=`
|
|
89
|
-
`+g.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},r.push(g));continue}if(g=this.tokenizer.table(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(l)){l=l.substring(g.raw.length),r.push(g);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let v=1/0,j=l.slice(1),_;this.options.extensions.startBlock.forEach(S=>{_=S.call({lexer:this},j),typeof _=="number"&&_>=0&&(v=Math.min(v,_))}),v<1/0&&v>=0&&(x=l.substring(0,v+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){let v=r.at(-1);c&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|
90
|
-
`)?"":`
|
|
91
|
-
`)+g.raw,v.text+=`
|
|
92
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):r.push(g),c=x.length!==l.length,l=l.substring(g.raw.length);continue}if(g=this.tokenizer.text(l)){l=l.substring(g.raw.length);let v=r.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|
93
|
-
`)?"":`
|
|
94
|
-
`)+g.raw,v.text+=`
|
|
95
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):r.push(g);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,r}inline(l,r=[]){return this.inlineQueue.push({src:l,tokens:r}),r}inlineTokens(l,r=[]){var p,g,x,v,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let _=Object.keys(this.tokens.links);_.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,S=>_.includes(S.slice(S.lastIndexOf("[")+1,-1))?"["+"a".repeat(S.length-2)+"]":S))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(_,S,k)=>{let E=k?k.length:0;return _.slice(0,E)+"["+"a".repeat(_.length-E-2)+"]"}),c=((g=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,u="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(u=""),o=!1;let _;if((v=(x=this.options.extensions)==null?void 0:x.inline)!=null&&v.some(k=>(_=k.call({lexer:this},l,r))?(l=l.substring(_.raw.length),r.push(_),!0):!1))continue;if(_=this.tokenizer.escape(l)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.tag(l)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.link(l)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(_.raw.length);let k=r.at(-1);_.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=_.raw,k.text+=_.text):r.push(_);continue}if(_=this.tokenizer.emStrong(l,c,u)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.codespan(l)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.br(l)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.del(l,c,u)){l=l.substring(_.raw.length),r.push(_);continue}if(_=this.tokenizer.autolink(l)){l=l.substring(_.raw.length),r.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(l))){l=l.substring(_.raw.length),r.push(_);continue}let S=l;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,E=l.slice(1),A;this.options.extensions.startInline.forEach(D=>{A=D.call({lexer:this},E),typeof A=="number"&&A>=0&&(k=Math.min(k,A))}),k<1/0&&k>=0&&(S=l.substring(0,k+1))}if(_=this.tokenizer.inlineText(S)){l=l.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(u=_.raw.slice(-1)),o=!0;let k=r.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=_.raw,k.text+=_.text):r.push(_);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return r}infiniteLoopError(l){let r="Infinite loop on byte: "+l;if(this.options.silent)console.error(r);else throw new Error(r)}},ef=class{constructor(n){Zt(this,"options");Zt(this,"parser");this.options=n||Dr}space(n){return""}code({text:n,lang:l,escaped:r}){var u;let c=(u=(l||"").match(Ts.notSpaceStart))==null?void 0:u[0],o=n.replace(Ts.endingNewline,"")+`
|
|
96
|
-
`;return c?'<pre><code class="language-'+pi(c)+'">'+(r?o:pi(o,!0))+`</code></pre>
|
|
97
|
-
`:"<pre><code>"+(r?o:pi(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:l}){return`<h${l}>${this.parser.parseInline(n)}</h${l}>
|
|
101
|
-
`}hr(n){return`<hr>
|
|
102
|
-
`}list(n){let l=n.ordered,r=n.start,c="";for(let h=0;h<n.items.length;h++){let p=n.items[h];c+=this.listitem(p)}let o=l?"ol":"ul",u=l&&r!==1?' start="'+r+'"':"";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 l="",r="";for(let o=0;o<n.header.length;o++)r+=this.tablecell(n.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<n.rows.length;o++){let u=n.rows[o];r="";for(let h=0;h<u.length;h++)r+=this.tablecell(u[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
-
<thead>
|
|
108
|
-
`+l+`</thead>
|
|
109
|
-
`+c+`</table>
|
|
110
|
-
`}tablerow({text:n}){return`<tr>
|
|
111
|
-
${n}</tr>
|
|
112
|
-
`}tablecell(n){let l=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+l+`</${r}>
|
|
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>${pi(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:l,tokens:r}){let c=this.parser.parseInline(r),o=tb(n);if(o===null)return c;n=o;let u='<a href="'+n+'"';return l&&(u+=' title="'+pi(l)+'"'),u+=">"+c+"</a>",u}image({href:n,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=tb(n);if(o===null)return pi(r);n=o;let u=`<img src="${n}" alt="${pi(r)}"`;return l&&(u+=` title="${pi(l)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:pi(n.text)}},$p=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}},Yl=class vp{constructor(l){Zt(this,"options");Zt(this,"renderer");Zt(this,"textRenderer");this.options=l||Dr,this.options.renderer=this.options.renderer||new ef,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $p}static parse(l,r){return new vp(r).parse(l)}static parseInline(l,r){return new vp(r).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let r="";for(let u=0;u<l.length;u++){let h=l[u];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=x||"";continue}}let p=h;switch(p.type){case"space":{r+=this.renderer.space(p);break}case"hr":{r+=this.renderer.hr(p);break}case"heading":{r+=this.renderer.heading(p);break}case"code":{r+=this.renderer.code(p);break}case"table":{r+=this.renderer.table(p);break}case"blockquote":{r+=this.renderer.blockquote(p);break}case"list":{r+=this.renderer.list(p);break}case"checkbox":{r+=this.renderer.checkbox(p);break}case"html":{r+=this.renderer.html(p);break}case"def":{r+=this.renderer.def(p);break}case"paragraph":{r+=this.renderer.paragraph(p);break}case"text":{r+=this.renderer.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 r}parseInline(l,r=this.renderer){var o,u;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let p=l[h];if((u=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&u[p.type]){let x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){c+=x||"";continue}}let g=p;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let x='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Qd,au=(Qd=class{constructor(n){Zt(this,"options");Zt(this,"block");this.options=n||Dr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?$l.lex:$l.lexInline}provideParser(n=this.block){return n?Yl.parse:Yl.parseInline}},Zt(Qd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Zt(Qd,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qd),xj=class{constructor(...n){Zt(this,"defaults",Lp());Zt(this,"options",this.setOptions);Zt(this,"parse",this.parseMarkdown(!0));Zt(this,"parseInline",this.parseMarkdown(!1));Zt(this,"Parser",Yl);Zt(this,"Renderer",ef);Zt(this,"TextRenderer",$p);Zt(this,"Lexer",$l);Zt(this,"Tokenizer",Wd);Zt(this,"Hooks",au);this.use(...n)}walkTokens(n,l){var c,o;let r=[];for(let u of n)switch(r=r.concat(l.call(this,u)),u.type){case"table":{let h=u;for(let p of h.header)r=r.concat(this.walkTokens(p.tokens,l));for(let p of h.rows)for(let g of p)r=r.concat(this.walkTokens(g.tokens,l));break}case"list":{let h=u;r=r.concat(this.walkTokens(h.items,l));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(p=>{let g=h[p].flat(1/0);r=r.concat(this.walkTokens(g,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...n){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=l.renderers[o.name];u?l.renderers[o.name]=function(...h){let p=o.renderer.apply(this,h);return p===!1&&(p=u.apply(this,h)),p}:l.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=l[o.level];u?u.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),r.renderer){let o=this.defaults.renderer||new ef(this.defaults);for(let u in r.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let h=u,p=r.renderer[h],g=o[h];o[h]=(...x)=>{let v=p.apply(o,x);return v===!1&&(v=g.apply(o,x)),v||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Wd(this.defaults);for(let u in r.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let h=u,p=r.tokenizer[h],g=o[h];o[h]=(...x)=>{let v=p.apply(o,x);return v===!1&&(v=g.apply(o,x)),v}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new au;for(let u in r.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let h=u,p=r.hooks[h],g=o[h];au.passThroughHooks.has(u)?o[h]=x=>{if(this.defaults.async&&au.passThroughHooksRespectAsync.has(u))return(async()=>{let j=await p.call(o,x);return g.call(o,j)})();let v=p.call(o,x);return g.call(o,v)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await p.apply(o,x);return j===!1&&(j=await g.apply(o,x)),j})();let v=p.apply(o,x);return v===!1&&(v=g.apply(o,x)),v}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,u=r.walkTokens;c.walkTokens=function(h){let p=[];return p.push(u.call(this,h)),o&&(p=p.concat(o.call(this,h))),p}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,l){return $l.lex(n,l??this.defaults)}parser(n,l){return Yl.parse(n,l??this.defaults)}parseMarkdown(n){return(l,r)=>{let c={...r},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 l>"u"||l===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", 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(l):l,p=await(o.hooks?await o.hooks.provideLexer(n):n?$l.lex:$l.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(n):n?Yl.parse:Yl.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(u);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(n):n?$l.lex:$l.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let p=(o.hooks?o.hooks.provideParser(n):n?Yl.parse:Yl.parseInline)(h,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(h){return u(h)}}}onError(n,l){return r=>{if(r.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+pi(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},Mr=new xj;function Ut(n,l){return Mr.parse(n,l)}Ut.options=Ut.setOptions=function(n){return Mr.setOptions(n),Ut.defaults=Mr.defaults,z_(Ut.defaults),Ut};Ut.getDefaults=Lp;Ut.defaults=Dr;Ut.use=function(...n){return Mr.use(...n),Ut.defaults=Mr.defaults,z_(Ut.defaults),Ut};Ut.walkTokens=function(n,l){return Mr.walkTokens(n,l)};Ut.parseInline=Mr.parseInline;Ut.Parser=Yl;Ut.parser=Yl.parse;Ut.Renderer=ef;Ut.TextRenderer=$p;Ut.Lexer=$l;Ut.lexer=$l.lex;Ut.Tokenizer=Wd;Ut.Hooks=au;Ut.parse=Ut;Ut.options;Ut.setOptions;Ut.use;Ut.walkTokens;Ut.parseInline;Yl.parse;$l.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 ib(n,l){(l==null||l>n.length)&&(l=n.length);for(var r=0,c=Array(l);r<l;r++)c[r]=n[r];return c}function bj(n){if(Array.isArray(n))return n}function _j(n,l){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var c,o,u,h,p=[],g=!0,x=!1;try{if(u=(r=r.call(n)).next,l!==0)for(;!(g=(c=u.call(r)).done)&&(p.push(c.value),p.length!==l);g=!0);}catch(v){x=!0,o=v}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function yj(){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 vj(n,l){return bj(n)||_j(n,l)||jj(n,l)||yj()}function jj(n,l){if(n){if(typeof n=="string")return ib(n,l);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ib(n,l):void 0}}const X_=Object.entries,ab=Object.setPrototypeOf,wj=Object.isFrozen,Nj=Object.getPrototypeOf,kj=Object.getOwnPropertyDescriptor;let ds=Object.freeze,fs=Object.seal,Lc=Object.create,Q_=typeof Reflect<"u"&&Reflect,jp=Q_.apply,wp=Q_.construct;ds||(ds=function(l){return l});fs||(fs=function(l){return l});jp||(jp=function(l,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),u=2;u<c;u++)o[u-2]=arguments[u];return l.apply(r,o)});wp||(wp=function(l){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new l(...c)});const Ac=Yn(Array.prototype.forEach),Sj=Yn(Array.prototype.lastIndexOf),rb=Yn(Array.prototype.pop),Rc=Yn(Array.prototype.push),Ej=Yn(Array.prototype.splice),Ba=Array.isArray,ru=Yn(String.prototype.toLowerCase),Jh=Yn(String.prototype.toString),cb=Yn(String.prototype.match),Wo=Yn(String.prototype.replace),ob=Yn(String.prototype.indexOf),Tj=Yn(String.prototype.trim),Cj=Yn(Number.prototype.toString),Aj=Yn(Boolean.prototype.toString),ub=typeof BigInt>"u"?null:Yn(BigInt.prototype.toString),db=typeof Symbol>"u"?null:Yn(Symbol.prototype.toString),ls=Yn(Object.prototype.hasOwnProperty),eu=Yn(Object.prototype.toString),ns=Yn(RegExp.prototype.test),_r=Rj(TypeError);function Yn(n){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return jp(n,l,c)}}function Rj(n){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return wp(n,r)}}function Et(n,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ru;if(ab&&ab(n,null),!Ba(l))return n;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const u=r(o);u!==o&&(wj(l)||(l[c]=u),o=u)}n[o]=!0}return n}function Mj(n){for(let l=0;l<n.length;l++)ls(n,l)||(n[l]=null);return n}function zs(n){const l=Lc(null);for(const c of X_(n)){var r=vj(c,2);const o=r[0],u=r[1];ls(n,o)&&(Ba(u)?l[o]=Mj(u):u&&typeof u=="object"&&u.constructor===Object?l[o]=zs(u):l[o]=u)}return l}function Dj(n){switch(typeof n){case"string":return n;case"number":return Cj(n);case"boolean":return Aj(n);case"bigint":return ub?ub(n):"0";case"symbol":return db?db(n):"Symbol()";case"undefined":return eu(n);case"function":case"object":{if(n===null)return eu(n);const l=n,r=mi(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:eu(c)}return eu(n)}default:return eu(n)}}function mi(n,l){for(;n!==null;){const c=kj(n,l);if(c){if(c.get)return Yn(c.get);if(typeof c.value=="function")return Yn(c.value)}n=Nj(n)}function r(){return null}return r}function Oj(n){try{return ns(n,""),!0}catch{return!1}}const fb=ds(["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"]),Ph=ds(["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"]),Wh=ds(["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"]),Lj=ds(["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"]),ep=ds(["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"]),zj=ds(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hb=ds(["#text"]),pb=ds(["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"]),tp=ds(["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"]),mb=ds(["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"]),Td=ds(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ij=fs(/{{[\w\W]*|^[\w\W]*}}/g),Uj=fs(/<%[\w\W]*|^[\w\W]*%>/g),Hj=fs(/\${[\w\W]*/g),Bj=fs(/^data-[\-\w.\u00B7-\uFFFF]+$/),qj=fs(/^aria-[\-\w]+$/),gb=fs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gj=fs(/^(?:\w+script|data):/i),$j=fs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yj=fs(/^html$/i),Vj=fs(/^[a-z][.\w]*(-[.\w]+)+$/i),xb=fs(/<[/\w!]/g),bb=fs(/<[/\w]/g),Xj=fs(/<\/no(script|embed|frames)/i),Qj=fs(/\/>/i),ul={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Kj=function(){return typeof window>"u"?null:window},Zj=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const u="dompurify"+(c?"#"+c:"");try{return l.createPolicy(u,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},_b=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},La=function(l,r,c,o){return ls(l,r)&&Ba(l[r])?Et(o.base?zs(o.base):{},l[r],o.transform):c};function K_(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kj();const l=ve=>K_(ve);if(l.version="3.4.12",l.removed=[],!n||!n.document||n.document.nodeType!==ul.document||!n.Element)return l.isSupported=!1,l;let r=n.document;const c=r,o=c.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,h=n.Node,p=n.Element,g=n.NodeFilter,x=n.NamedNodeMap;x===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const v=n.DOMParser,j=n.trustedTypes,_=p.prototype,S=mi(_,"cloneNode"),k=mi(_,"remove"),E=mi(_,"nextSibling"),A=mi(_,"childNodes"),D=mi(_,"parentNode"),q=mi(_,"shadowRoot"),Q=mi(_,"attributes"),z=h&&h.prototype?mi(h.prototype,"nodeType"):null,H=h&&h.prototype?mi(h.prototype,"nodeName"):null;if(typeof u=="function"){const ve=r.createElement("template");ve.content&&ve.content.ownerDocument&&(r=ve.content.ownerDocument)}let L,U="",V,R=!1,I=0;const G=function(){if(I>0)throw _r('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.')},se=function(C){G(),I++;try{return L.createHTML(C)}finally{I--}},je=function(C){G(),I++;try{return L.createScriptURL(C)}finally{I--}},we=function(){return R||(V=Zj(j,o),R=!0),V},Ne=r,Z=Ne.implementation,$=Ne.createNodeIterator,ne=Ne.createDocumentFragment,me=Ne.getElementsByTagName,ke=c.importNode;let T=_b();l.isSupported=typeof X_=="function"&&typeof D=="function"&&Z&&Z.createHTMLDocument!==void 0;const K=Ij,de=Uj,_e=Hj,Me=Bj,ze=qj,Ve=Gj,re=$j,Ye=Vj;let pe=gb,Ge=null;const dt=Et({},[...fb,...Ph,...Wh,...ep,...hb]);let nt=null;const bt=Et({},[...pb,...tp,...mb,...Td]);let Xe=Object.seal(Lc(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}})),Ct=null,ee=null;const Ze=Object.seal(Lc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let st=!0,Be=!0,Fe=!1,De=!0,ut=!1,Ce=!0,kt=!1,Ft=!1,Ht=null,nn=null,fn=!1,_n=!1,wn=!1,St=!1,ft=!0,$t=!1;const Cn="user-content-";let At=!0,hs=!1,ie={},ye=null;const He=Et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let lt=null;const Je=Et({},["audio","video","img","source","image","track"]);let sn=null;const F=Et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",Se="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let gt=Ie,ps=!1,Us=null;const Ws=Et({},[he,Se,Ie],Jh),As=ds(["mi","mo","mn","ms","mtext"]);let Rs=Et({},As);const Ms=ds(["annotation-xml"]);let Jn=Et({},Ms);const ji=Et({},["title","style","font","a","script"]);let ms=null;const gs=["application/xhtml+xml","text/html"],hn="text/html";let it=null,Nn=null;const el=r.createElement("form"),Nl=function(C){return C instanceof RegExp||C instanceof Function},tl=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Nn&&Nn===C)return;(!C||typeof C!="object")&&(C={}),C=zs(C),ms=gs.indexOf(C.PARSER_MEDIA_TYPE)===-1?hn:C.PARSER_MEDIA_TYPE,it=ms==="application/xhtml+xml"?Jh:ru,Ge=La(C,"ALLOWED_TAGS",dt,{transform:it}),nt=La(C,"ALLOWED_ATTR",bt,{transform:it}),Us=La(C,"ALLOWED_NAMESPACES",Ws,{transform:Jh}),sn=La(C,"ADD_URI_SAFE_ATTR",F,{transform:it,base:F}),lt=La(C,"ADD_DATA_URI_TAGS",Je,{transform:it,base:Je}),ye=La(C,"FORBID_CONTENTS",He,{transform:it}),Ct=La(C,"FORBID_TAGS",zs({}),{transform:it}),ee=La(C,"FORBID_ATTR",zs({}),{transform:it}),ie=ls(C,"USE_PROFILES")?C.USE_PROFILES&&typeof C.USE_PROFILES=="object"?zs(C.USE_PROFILES):C.USE_PROFILES:!1,st=C.ALLOW_ARIA_ATTR!==!1,Be=C.ALLOW_DATA_ATTR!==!1,Fe=C.ALLOW_UNKNOWN_PROTOCOLS||!1,De=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ut=C.SAFE_FOR_TEMPLATES||!1,Ce=C.SAFE_FOR_XML!==!1,kt=C.WHOLE_DOCUMENT||!1,_n=C.RETURN_DOM||!1,wn=C.RETURN_DOM_FRAGMENT||!1,St=C.RETURN_TRUSTED_TYPE||!1,fn=C.FORCE_BODY||!1,ft=C.SANITIZE_DOM!==!1,$t=C.SANITIZE_NAMED_PROPS||!1,At=C.KEEP_CONTENT!==!1,hs=C.IN_PLACE||!1,pe=Oj(C.ALLOWED_URI_REGEXP)?C.ALLOWED_URI_REGEXP:gb,gt=typeof C.NAMESPACE=="string"?C.NAMESPACE:Ie,Rs=ls(C,"MATHML_TEXT_INTEGRATION_POINTS")&&C.MATHML_TEXT_INTEGRATION_POINTS&&typeof C.MATHML_TEXT_INTEGRATION_POINTS=="object"?zs(C.MATHML_TEXT_INTEGRATION_POINTS):Et({},As),Jn=ls(C,"HTML_INTEGRATION_POINTS")&&C.HTML_INTEGRATION_POINTS&&typeof C.HTML_INTEGRATION_POINTS=="object"?zs(C.HTML_INTEGRATION_POINTS):Et({},Ms);const J=ls(C,"CUSTOM_ELEMENT_HANDLING")&&C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING=="object"?zs(C.CUSTOM_ELEMENT_HANDLING):Lc(null);if(Xe=Lc(null),ls(J,"tagNameCheck")&&Nl(J.tagNameCheck)&&(Xe.tagNameCheck=J.tagNameCheck),ls(J,"attributeNameCheck")&&Nl(J.attributeNameCheck)&&(Xe.attributeNameCheck=J.attributeNameCheck),ls(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(Xe.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),fs(Xe),ut&&(Be=!1),wn&&(_n=!0),ie&&(Ge=Et({},hb),nt=Lc(null),ie.html===!0&&(Et(Ge,fb),Et(nt,pb)),ie.svg===!0&&(Et(Ge,Ph),Et(nt,tp),Et(nt,Td)),ie.svgFilters===!0&&(Et(Ge,Wh),Et(nt,tp),Et(nt,Td)),ie.mathMl===!0&&(Et(Ge,ep),Et(nt,mb),Et(nt,Td))),Ze.tagCheck=null,Ze.attributeCheck=null,ls(C,"ADD_TAGS")&&(typeof C.ADD_TAGS=="function"?Ze.tagCheck=C.ADD_TAGS:Ba(C.ADD_TAGS)&&(Ge===dt&&(Ge=zs(Ge)),Et(Ge,C.ADD_TAGS,it))),ls(C,"ADD_ATTR")&&(typeof C.ADD_ATTR=="function"?Ze.attributeCheck=C.ADD_ATTR:Ba(C.ADD_ATTR)&&(nt===bt&&(nt=zs(nt)),Et(nt,C.ADD_ATTR,it))),ls(C,"ADD_URI_SAFE_ATTR")&&Ba(C.ADD_URI_SAFE_ATTR)&&Et(sn,C.ADD_URI_SAFE_ATTR,it),ls(C,"FORBID_CONTENTS")&&Ba(C.FORBID_CONTENTS)&&(ye===He&&(ye=zs(ye)),Et(ye,C.FORBID_CONTENTS,it)),ls(C,"ADD_FORBID_CONTENTS")&&Ba(C.ADD_FORBID_CONTENTS)&&(ye===He&&(ye=zs(ye)),Et(ye,C.ADD_FORBID_CONTENTS,it)),At&&(Ge["#text"]=!0),kt&&Et(Ge,["html","head","body"]),Ge.table&&(Et(Ge,["tbody"]),delete Ct.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw _r('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw _r('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const xe=L;L=C.TRUSTED_TYPES_POLICY;try{U=se("")}catch(Ee){throw L=xe,Ee}}else C.TRUSTED_TYPES_POLICY===null?(L=void 0,U=""):(L===void 0&&(L=we()),L&&typeof U=="string"&&(U=se("")));ds&&ds(C),Nn=C},Hs=Et({},[...Ph,...Wh,...Lj]),Ln=Et({},[...ep,...zj]),xs=function(C,J,xe){return J.namespaceURI===Ie?C==="svg":J.namespaceURI===he?C==="svg"&&(xe==="annotation-xml"||Rs[xe]):!!Hs[C]},Yt=function(C,J,xe){return J.namespaceURI===Ie?C==="math":J.namespaceURI===Se?C==="math"&&Jn[xe]:!!Ln[C]},Jt=function(C,J,xe){return J.namespaceURI===Se&&!Jn[xe]||J.namespaceURI===he&&!Rs[xe]?!1:!Ln[C]&&(ji[C]||!Hs[C])},ln=function(C){let J=D(C);(!J||!J.tagName)&&(J={namespaceURI:gt,tagName:"template"});const xe=ru(C.tagName),Ee=ru(J.tagName);return Us[C.namespaceURI]?C.namespaceURI===Se?xs(xe,J,Ee):C.namespaceURI===he?Yt(xe,J,Ee):C.namespaceURI===Ie?Jt(xe,J,Ee):!!(ms==="application/xhtml+xml"&&Us[C.namespaceURI]):!1},pn=function(C){Rc(l.removed,{element:C});try{D(C).removeChild(C)}catch{if(k(C),!D(C))throw _r("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},et=function(C){as(C);const J=A(C);if(J){const Ee=[];Ac(J,qe=>{Rc(Ee,qe)}),Ac(Ee,qe=>{try{k(qe)}catch{}})}const xe=Q(C);if(xe)for(let Ee=xe.length-1;Ee>=0;--Ee){const qe=xe[Ee],Qe=qe&&qe.name;if(typeof Qe=="string")try{C.removeAttribute(Qe)}catch{}}},Pn=function(C,J){try{Rc(l.removed,{attribute:J.getAttributeNode(C),from:J})}catch{Rc(l.removed,{attribute:null,from:J})}if(J.removeAttribute(C),C==="is")if(_n||wn)try{pn(J)}catch{}else try{J.setAttribute(C,"")}catch{}},is=function(C){const J=Q(C);if(J)for(let xe=J.length-1;xe>=0;--xe){const Ee=J[xe],qe=Ee&&Ee.name;if(!(typeof qe!="string"||nt[it(qe)]))try{C.removeAttribute(qe)}catch{}}},as=function(C){const J=[C];for(;J.length>0;){const xe=J.pop();(z?z(xe):xe.nodeType)===ul.element&&is(xe);const qe=A(xe);if(qe)for(let Qe=qe.length-1;Qe>=0;--Qe)J.push(qe[Qe])}},Dt=function(C){if(!Ce)return;const J=[C];for(;J.length>0;){const xe=J.pop(),Ee=z?z(xe):xe.nodeType;if(Ee===ul.processingInstruction||Ee===ul.comment&&ns(bb,xe.data)){try{k(xe)}catch{}continue}if(Ee===ul.element){const Qe=xe,Xt=it(H?H(xe):xe.nodeName);try{Qe.hasAttribute&&Qe.hasAttribute("patchsrc")&&Qe.removeAttribute("patchsrc"),Qe.hasAttribute&&Qe.hasAttribute("for")&&Xt!=="label"&&Xt!=="output"&&Qe.removeAttribute("for")}catch{}}const qe=A(xe);if(qe)for(let Qe=qe.length-1;Qe>=0;--Qe)J.push(qe[Qe])}},Xl=function(C){let J=null,xe=null;if(fn)C="<remove></remove>"+C;else{const Qe=cb(C,/^[\r\n\t ]+/);xe=Qe&&Qe[0]}ms==="application/xhtml+xml"&>===Ie&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Ee=L?se(C):C;if(gt===Ie)try{J=new v().parseFromString(Ee,ms)}catch{}if(!J||!J.documentElement){J=Z.createDocument(gt,"template",null);try{J.documentElement.innerHTML=ps?U:Ee}catch{}}const qe=J.body||J.documentElement;return C&&xe&&qe.insertBefore(r.createTextNode(xe),qe.childNodes[0]||null),gt===Ie?me.call(J,kt?"html":"body")[0]:kt?J.documentElement:qe},Vt=function(C){return $.call(C.ownerDocument||C,C,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},bs=function(C){return C=Wo(C,K," "),C=Wo(C,de," "),C=Wo(C,_e," "),C},Wn=function(C){var J;C.normalize();const xe=$.call(C.ownerDocument||C,C,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ee=xe.nextNode();for(;Ee;)Ee.data=bs(Ee.data),Ee=xe.nextNode();const qe=(J=C.querySelectorAll)===null||J===void 0?void 0:J.call(C,"template");qe&&Ac(qe,Qe=>{kn(Qe.content)&&Wn(Qe.content)})},an=function(C){const J=H?H(C):null;return typeof J!="string"||it(J)!=="form"?!1:typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||C.attributes!==Q(C)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function"||C.nodeType!==z(C)||C.childNodes!==A(C)},kn=function(C){if(!z||typeof C!="object"||C===null)return!1;try{return z(C)===ul.documentFragment}catch{return!1}},Vn=function(C){if(!z||typeof C!="object"||C===null)return!1;try{return typeof z(C)=="number"}catch{return!1}};function Pt(ve,C,J){ve.length!==0&&Ac(ve,xe=>{xe.call(l,C,J,Nn)})}const kl=function(C,J){return!!(Ce&&C.hasChildNodes()&&!Vn(C.firstElementChild)&&ns(xb,C.textContent)&&ns(xb,C.innerHTML)||Ce&&C.namespaceURI===Ie&&J==="style"&&Vn(C.firstElementChild)||C.nodeType===ul.processingInstruction||Ce&&C.nodeType===ul.comment&&ns(bb,C.data))},_s=function(C,J){if(!Ct[J]&&Ql(J)&&(Xe.tagNameCheck instanceof RegExp&&ns(Xe.tagNameCheck,J)||Xe.tagNameCheck instanceof Function&&Xe.tagNameCheck(J)))return!1;if(At&&!ye[J]){const xe=D(C),Ee=A(C);if(Ee&&xe){const qe=Ee.length;for(let Qe=qe-1;Qe>=0;--Qe){const Xt=hs?Ee[Qe]:S(Ee[Qe],!0);xe.insertBefore(Xt,E(C))}}}return pn(C),!0},rs=function(C,J){if(Pt(T.beforeSanitizeElements,C,null),C!==J&&D(C)===null)return!0;if(an(C))return pn(C),!0;const xe=it(H?H(C):C.nodeName);if(Pt(T.uponSanitizeElement,C,{tagName:xe,allowedTags:Ge}),C!==J&&D(C)===null)return!0;if(kl(C,xe))return pn(C),!0;if(Ct[xe]||!(Ze.tagCheck instanceof Function&&Ze.tagCheck(xe))&&!Ge[xe]){const qe=_s(C,xe);return qe===!1&&Pt(T.afterSanitizeElements,C,null),qe}if((z?z(C):C.nodeType)===ul.element&&!ln(C)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&ns(Xj,C.innerHTML))return pn(C),!0;if(ut&&C.nodeType===ul.text){const qe=bs(C.textContent);C.textContent!==qe&&(Rc(l.removed,{element:C.cloneNode()}),C.textContent=qe)}return Pt(T.afterSanitizeElements,C,null),!1},yn=function(C,J,xe){if(ee[J]||Ce&&J==="patchsrc"||Ce&&J==="for"&&C!=="label"&&C!=="output"||ft&&(J==="id"||J==="name")&&(xe in r||xe in el))return!1;const Ee=nt[J]||Ze.attributeCheck instanceof Function&&Ze.attributeCheck(J,C);if(!(Be&&ns(Me,J))){if(!(st&&ns(ze,J))){if(Ee){if(!sn[J]){if(!ns(pe,Wo(xe,re,""))){if(!((J==="src"||J==="xlink:href"||J==="href")&&C!=="script"&&ob(xe,"data:")===0&<[C])){if(!(Fe&&!ns(Ve,Wo(xe,re,"")))){if(xe)return!1}}}}}else if(!(Ql(C)&&(Xe.tagNameCheck instanceof RegExp&&ns(Xe.tagNameCheck,C)||Xe.tagNameCheck instanceof Function&&Xe.tagNameCheck(C))&&(Xe.attributeNameCheck instanceof RegExp&&ns(Xe.attributeNameCheck,J)||Xe.attributeNameCheck instanceof Function&&Xe.attributeNameCheck(J,C))||J==="is"&&Xe.allowCustomizedBuiltInElements&&(Xe.tagNameCheck instanceof RegExp&&ns(Xe.tagNameCheck,xe)||Xe.tagNameCheck instanceof Function&&Xe.tagNameCheck(xe))))return!1}}return!0},Sl=Et({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ql=function(C){return!Sl[ru(C)]&&ns(Ye,C)},An=function(C,J,xe,Ee){if(L&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!xe)switch(j.getAttributeType(C,J)){case"TrustedHTML":return se(Ee);case"TrustedScriptURL":return je(Ee)}return Ee},wi=function(C,J,xe,Ee){try{xe?C.setAttributeNS(xe,J,Ee):C.setAttribute(J,Ee),an(C)?pn(C):rb(l.removed)}catch{Pn(J,C)}},nl=function(C){Pt(T.beforeSanitizeAttributes,C,null);const J=C.attributes;if(!J||an(C))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:nt,forceKeepAttr:void 0};let Ee=J.length;const qe=it(C.nodeName);for(;Ee--;){const Qe=J[Ee],Xt=Qe.name,_t=Qe.namespaceURI,vn=Qe.value,ht=it(Xt),Rn=vn;let mn=Xt==="value"?Rn:Tj(Rn);if(xe.attrName=ht,xe.attrValue=mn,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Pt(T.uponSanitizeAttribute,C,xe),mn=xe.attrValue,$t&&(ht==="id"||ht==="name")&&ob(mn,Cn)!==0&&(Pn(Xt,C),mn=Cn+mn),Ce&&ns(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,mn)){Pn(Xt,C);continue}if(ht==="attributename"&&cb(mn,"href")){Pn(Xt,C);continue}if(!xe.forceKeepAttr){if(!xe.keepAttr){Pn(Xt,C);continue}if(!De&&ns(Qj,mn)){Pn(Xt,C);continue}if(ut&&(mn=bs(mn)),!yn(qe,ht,mn)){Pn(Xt,C);continue}mn=An(qe,ht,_t,mn),mn!==Rn&&wi(C,Xt,_t,mn)}}Pt(T.afterSanitizeAttributes,C,null)},ys=function(C){let J=null;const xe=Vt(C);for(Pt(T.beforeSanitizeShadowDOM,C,null);J=xe.nextNode();)if(Pt(T.uponSanitizeShadowNode,J,null),rs(J,C),nl(J),kn(J.content)&&ys(J.content),(z?z(J):J.nodeType)===ul.element){const qe=q(J);kn(qe)&&(rn(qe),ys(qe))}Pt(T.afterSanitizeShadowDOM,C,null)},rn=function(C){const J=[{node:C,shadow:null}];for(;J.length>0;){const xe=J.pop();if(xe.shadow){ys(xe.shadow);continue}const Ee=xe.node,Qe=(z?z(Ee):Ee.nodeType)===ul.element,Xt=A(Ee);if(Xt)for(let _t=Xt.length-1;_t>=0;--_t)J.push({node:Xt[_t],shadow:null});if(Qe){const _t=H?H(Ee):null;if(typeof _t=="string"&&it(_t)==="template"){const vn=Ee.content;kn(vn)&&J.push({node:vn,shadow:null})}}if(Qe){const _t=q(Ee);kn(_t)&&J.push({node:null,shadow:_t},{node:_t,shadow:null})}}};return l.sanitize=function(ve){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,xe=null,Ee=null,qe=null;if(ps=!ve,ps&&(ve="<!-->"),typeof ve!="string"&&!Vn(ve)&&(ve=Dj(ve),typeof ve!="string"))throw _r("dirty is not a string, aborting");if(!l.isSupported)return ve;Ft?(Ge=Ht,nt=nn):tl(C),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(Ge=zs(Ge)),T.uponSanitizeAttribute.length>0&&(nt=zs(nt)),l.removed=[];const Qe=hs&&typeof ve!="string"&&Vn(ve);if(Qe){Dt(ve);const ht=H?H(ve):ve.nodeName;if(typeof ht=="string"){const Rn=it(ht);if(!Ge[Rn]||Ct[Rn])throw et(ve),_r("root node is forbidden and cannot be sanitized in-place")}if(an(ve))throw et(ve),_r("root node is clobbered and cannot be sanitized in-place");try{rn(ve)}catch(Rn){throw et(ve),Rn}}else if(Vn(ve))J=Xl("<!---->"),xe=J.ownerDocument.importNode(ve,!0),xe.nodeType===ul.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?J=xe:J.appendChild(xe),rn(xe);else{if(!_n&&!ut&&!kt&&ve.indexOf("<")===-1)return L&&St?se(ve):ve;if(J=Xl(ve),!J)return _n?null:St?U:""}J&&fn&&pn(J.firstChild);const Xt=Qe?ve:J,_t=Vt(Xt);try{for(;Ee=_t.nextNode();)rs(Ee,Xt),nl(Ee),kn(Ee.content)&&ys(Ee.content)}catch(ht){throw Qe&&(et(ve),Ac(l.removed,Rn=>{Rn.element&&as(Rn.element)})),ht}if(Qe)return Ac(l.removed,ht=>{ht.element&&as(ht.element)}),ut&&Wn(ve),ve;if(_n){if(ut&&Wn(J),wn)for(qe=ne.call(J.ownerDocument);J.firstChild;)qe.appendChild(J.firstChild);else qe=J;return(nt.shadowroot||nt.shadowrootmode)&&(qe=ke.call(c,qe,!0)),qe}let vn=kt?J.outerHTML:J.innerHTML;return kt&&Ge["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&ns(Yj,J.ownerDocument.doctype.name)&&(vn="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
|
|
116
|
-
`+vn),ut&&(vn=bs(vn)),L&&St?se(vn):vn},l.setConfig=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tl(ve),Ft=!0,Ht=Ge,nn=nt},l.clearConfig=function(){Nn=null,Ft=!1,Ht=null,nn=null,L=V,U=""},l.isValidAttribute=function(ve,C,J){Nn||tl({});const xe=it(ve),Ee=it(C);return yn(xe,Ee,J)},l.addHook=function(ve,C){typeof C=="function"&&ls(T,ve)&&Rc(T[ve],C)},l.removeHook=function(ve,C){if(ls(T,ve)){if(C!==void 0){const J=Sj(T[ve],C);return J===-1?void 0:Ej(T[ve],J,1)[0]}return rb(T[ve])}},l.removeHooks=function(ve){ls(T,ve)&&(T[ve]=[])},l.removeAllHooks=function(){T=_b()},l}var Fj=K_();const Jj=1024;let Pj=0;class wl{constructor(l,r){this.from=l,this.to=r}}class dn{constructor(l={}){this.id=Pj++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Vl.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}dn.closedBy=new dn({deserialize:n=>n.split(" ")});dn.openedBy=new dn({deserialize:n=>n.split(" ")});dn.group=new dn({deserialize:n=>n.split(" ")});dn.isolate=new dn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});dn.contextHash=new dn({perNode:!0});dn.lookAhead=new dn({perNode:!0});dn.mounted=new dn({perNode:!0});class Hc{constructor(l,r,c,o=!1){this.tree=l,this.overlay=r,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[dn.mounted.id]}}const Wj=Object.create(null);class Vl{constructor(l,r,c,o=0){this.name=l,this.props=r,this.id=c,this.flags=o}static define(l){let r=l.props&&l.props.length?Object.create(null):Wj,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Vl(l.name||"",r,l.id,c);if(l.props){for(let u of l.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");r[u[0].id]=u[1]}}return o}prop(l){return this.props[l.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(l){if(typeof l=="string"){if(this.name==l)return!0;let r=this.prop(dn.group);return r?r.indexOf(l)>-1:!1}return this.id==l}static match(l){let r=Object.create(null);for(let c in l)for(let o of c.split(" "))r[o]=l[c];return c=>{for(let o=c.prop(dn.group),u=-1;u<(o?o.length:0);u++){let h=r[u<0?c.name:o[u]];if(h)return h}}}}Vl.none=new Vl("",Object.create(null),0,8);class Z_{constructor(l){this.types=l;for(let r=0;r<l.length;r++)if(l[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let r=[];for(let c of this.types){let o=null;for(let u of l){let h=u(c);if(h){o||(o=Object.assign({},c.props));let p=h[1],g=h[0];g.combine&&g.id in o&&(p=g.combine(o[g.id],p)),o[g.id]=p}}r.push(o?new Vl(c.name,o,c.id,c.flags):c)}return new Z_(r)}}const Cd=new WeakMap,yb=new WeakMap;var on;(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"})(on||(on={}));class Ps{constructor(l,r,c,o,u){if(this.type=l,this.children=r,this.positions=c,this.length=o,this.props=null,u&&u.length){this.props=Object.create(null);for(let[h,p]of u)this.props[typeof h=="number"?h:h.id]=p}}toString(){let l=Hc.get(this);if(l&&!l.overlay)return l.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(l=0){return new tf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=Cd.get(this)||this.topNode,u=new tf(o);return u.moveTo(l,r),Cd.set(this,u._tree),u}get topNode(){return new Cs(this,0,0,null)}resolve(l,r=0){let c=fu(Cd.get(this)||this.topNode,l,r,!1);return Cd.set(this,c),c}resolveInner(l,r=0){let c=fu(yb.get(this)||this.topNode,l,r,!0);return yb.set(this,c),c}resolveStack(l,r=0){return n1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:u=this.length}=l,h=l.mode||0,p=(h&on.IncludeAnonymous)>0;for(let g=this.cursor(h|on.IncludeAnonymous);;){let x=!1;if(g.from<=u&&g.to>=o&&(!p&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(p||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:Xp(Vl.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Ps(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new Ps(Vl.none,r,c,o)))}static build(l){return s1(l)}}Ps.empty=new Ps(Vl.none,[],[],0);class Yp{constructor(l,r){this.buffer=l,this.index=r}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 Yp(this.buffer,this.index)}}class Va{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return Vl.none}toString(){let l=[];for(let r=0;r<this.buffer.length;)l.push(this.childString(r)),r=this.buffer[r+3];return l.join(",")}childString(l){let r=this.buffer[l],c=this.buffer[l+3],o=this.set.types[r],u=o.name;if(/\W/.test(u)&&!o.isError&&(u=JSON.stringify(u)),l+=4,c==l)return u;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return u+"("+h.join(",")+")"}findChild(l,r,c,o,u){let{buffer:h}=this,p=-1;for(let g=l;g!=r&&!(F_(u,o,h[g+1],h[g+2])&&(p=g,c>0));g=h[g+3]);return p}slice(l,r,c){let o=this.buffer,u=new Uint16Array(r-l),h=0;for(let p=l,g=0;p<r;){u[g++]=o[p++],u[g++]=o[p++]-c;let x=u[g++]=o[p++]-c;u[g++]=o[p++]-l,h=Math.max(h,x)}return new Va(u,h,this.set)}}function F_(n,l,r,c){switch(n){case-2:return r<l;case-1:return c>=l&&r<l;case 0:return r<l&&c>l;case 1:return r<=l&&c>l;case 2:return c>l;case 4:return!0}}function fu(n,l,r,c){for(var o;n.from==n.to||(r<1?n.from>=l:n.from>l)||(r>-1?n.to<=l:n.to<l);){let h=!c&&n instanceof Cs&&n.index<0?null:n.parent;if(!h)return n;n=h}let u=c?0:on.IgnoreOverlays;if(c)for(let h=n,p=h.parent;p;h=p,p=h.parent)h instanceof Cs&&h.index<0&&((o=p.enter(l,r,u))===null||o===void 0?void 0:o.from)!=h.from&&(n=p);for(;;){let h=n.enter(l,r,u);if(!h)return n;n=h}}class J_{cursor(l=0){return new tf(this,l)}getChild(l,r=null,c=null){let o=vb(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return vb(this,l,r,c)}resolve(l,r=0){return fu(this,l,r,!1)}resolveInner(l,r=0){return fu(this,l,r,!0)}matchContext(l){return Np(this.parent,l)}enterUnfinishedNodesBefore(l){let r=this.childBefore(l),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class Cs extends J_{constructor(l,r,c,o){super(),this._tree=l,this.from=r,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(l,r,c,o,u=0){for(let h=this;;){for(let{children:p,positions:g}=h._tree,x=r>0?p.length:-1;l!=x;l+=r){let v=p[l],j=g[l]+h.from,_;if(!(!(u&on.EnterBracketed&&v instanceof Ps&&(_=Hc.get(v))&&!_.overlay&&_.bracketed&&c>=j&&c<=j+v.length)&&!F_(o,c,j,j+v.length))){if(v instanceof Va){if(u&on.ExcludeBuffers)continue;let S=v.findChild(0,v.buffer.length,r,c-j,o);if(S>-1)return new yi(new e1(h,v,l,j),null,S)}else if(u&on.IncludeAnonymous||!v.type.isAnonymous||Vp(v)){let S;if(!(u&on.IgnoreMounts)&&(S=Hc.get(v))&&!S.overlay)return new Cs(S.tree,j,l,h);let k=new Cs(v,j,l,h);return u&on.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?v.children.length-1:0,r,c,o,u)}}}if(u&on.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+r:l=r<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(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,r,c=0){let o;if(!(c&on.IgnoreOverlays)&&(o=Hc.get(this._tree))&&o.overlay){let u=l-this.from,h=c&on.EnterBracketed&&o.bracketed;for(let{from:p,to:g}of o.overlay)if((r>0||h?p<=u:p<u)&&(r<0||h?g>=u:g>u))return new Cs(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,r,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}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 vb(n,l,r,c){let o=n.cursor(),u=[];if(!o.firstChild())return u;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return u}for(;;){if(c!=null&&o.type.is(c))return u;if(o.type.is(l)&&u.push(o.node),!o.nextSibling())return c==null?u:[]}}function Np(n,l,r=l.length-1){for(let c=n;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[r]&&l[r]!=c.name)return!1;r--}}return!0}class e1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class yi extends J_{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(l,r,c){super(),this.context=l,this._parent=r,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,r,c){let{buffer:o}=this.context,u=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.context.start,c);return u<0?null:new yi(this.context,this,u)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,r,c=0){if(c&on.ExcludeBuffers)return null;let{buffer:o}=this.context,u=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,l-this.context.start,r);return u<0?null:new yi(this.context,this,u)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,r=l.buffer[this.index+3];return r<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new yi(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new yi(this.context,this._parent,l.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],r=[],{buffer:c}=this.context,o=this.index+4,u=c.buffer[this.index+3];if(u>o){let h=c.buffer[this.index+1];l.push(c.slice(o,u,h)),r.push(0)}return new Ps(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function P_(n){if(!n.length)return null;let l=0,r=n[0];for(let u=1;u<n.length;u++){let h=n[u];(h.from>r.from||h.to<r.to)&&(r=h,l=u)}let c=r instanceof Cs&&r.index<0?null:r.parent,o=n.slice();return c?o[l]=c:o.splice(l,1),new t1(o,r)}class t1{constructor(l,r){this.heads=l,this.node=r}get next(){return P_(this.heads)}}function n1(n,l,r){let c=n.resolveInner(l,r),o=null;for(let u=c instanceof Cs?c:c.context.parent;u;u=u.parent)if(u.index<0){let h=u.parent;(o||(o=[c])).push(h.resolve(l,r)),u=h}else{let h=Hc.get(u.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new Cs(h.tree,h.overlay[0].from+u.from,-1,u);(o||(o=[c])).push(fu(p,l,r,!1))}}return o?P_(o):c}class tf{get name(){return this.type.name}constructor(l,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~on.EnterBracketed,l instanceof Cs)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,r){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof Cs?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,r,c,this.mode));let{buffer:o}=this.buffer,u=o.findChild(this.index+4,o.buffer[this.index+3],l,r-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(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,r,c=this.mode){return this.buffer?c&on.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&on.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&on.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let r,c,{buffer:o}=this;if(o){if(l>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:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let u=r+l,h=l<0?-1:c._tree.children.length;u!=h;u+=l){let p=c._tree.children[u];if(this.mode&on.IncludeAnonymous||p instanceof Va||!p.type.isAnonymous||Vp(p))return!1}return!0}move(l,r){if(r&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,r=0){for(;(this.from==this.to||(r<1?this.from>=l:this.from>l)||(r>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,r););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,r=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,u=this.stack.length;u>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=u+1;break e}o=this.stack[--u]}for(let o=c;o<this.stack.length;o++)r=new yi(this.buffer,r,this.stack[o]);return this.bufferNode=new yi(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Np(this.node.parent,l);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=l.length-1,u=this.stack.length-1;o>=0;u--){if(u<0)return Np(this._tree,l,o);let h=c[r.buffer[this.stack[u]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Vp(n){return n.children.some(l=>l instanceof Va||!l.type.isAnonymous||Vp(l))}function s1(n){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=Jj,reused:u=[],minRepeatType:h=c.types.length}=n,p=Array.isArray(r)?new Yp(r,r.length):r,g=c.types,x=0,v=0;function j(H,L,U,V,R,I){let{id:G,start:se,end:je,size:we}=p,Ne=v,Z=x;if(we<0)if(p.next(),we==-1){let T=u[G];U.push(T),V.push(se-H);return}else if(we==-3){x=G;return}else if(we==-4){v=G;return}else throw new RangeError(`Unrecognized record size: ${we}`);let $=g[G],ne,me,ke=se-H;if(je-se<=o&&(me=A(p.pos-L,R))){let T=new Uint16Array(me.size-me.skip),K=p.pos-me.size,de=T.length;for(;p.pos>K;)de=D(me.start,T,de);ne=new Va(T,je-me.start,c),ke=me.start-H}else{let T=p.pos-we;p.next();let K=[],de=[],_e=G>=h?G:-1,Me=0,ze=je;for(;p.pos>T;)_e>=0&&p.id==_e&&p.size>=0?(p.end<=ze-o&&(k(K,de,se,Me,p.end,ze,_e,Ne,Z),Me=K.length,ze=p.end),p.next()):I>2500?_(se,T,K,de):j(se,T,K,de,_e,I+1);if(_e>=0&&Me>0&&Me<K.length&&k(K,de,se,Me,se,ze,_e,Ne,Z),K.reverse(),de.reverse(),_e>-1&&Me>0){let Ve=S($,Z);ne=Xp($,K,de,0,K.length,0,je-se,Ve,Ve)}else ne=E($,K,de,je-se,Ne-je,Z)}U.push(ne),V.push(ke)}function _(H,L,U,V){let R=[],I=0,G=-1;for(;p.pos>L;){let{id:se,start:je,end:we,size:Ne}=p;if(Ne>4)p.next();else{if(G>-1&&je<G)break;G<0&&(G=we-o),R.push(se,je,we),I++,p.next()}}if(I){let se=new Uint16Array(I*4),je=R[R.length-2];for(let we=R.length-3,Ne=0;we>=0;we-=3)se[Ne++]=R[we],se[Ne++]=R[we+1]-je,se[Ne++]=R[we+2]-je,se[Ne++]=Ne;U.push(new Va(se,R[2]-je,c)),V.push(je-H)}}function S(H,L){return(U,V,R)=>{let I=0,G=U.length-1,se,je;if(G>=0&&(se=U[G])instanceof Ps){if(!G&&se.type==H&&se.length==R)return se;(je=se.prop(dn.lookAhead))&&(I=V[G]+se.length+je)}return E(H,U,V,R,I,L)}}function k(H,L,U,V,R,I,G,se,je){let we=[],Ne=[];for(;H.length>V;)we.push(H.pop()),Ne.push(L.pop()+U-R);H.push(E(c.types[G],we,Ne,I-R,se-I,je)),L.push(R-U)}function E(H,L,U,V,R,I,G){if(I){let se=[dn.contextHash,I];G=G?[se].concat(G):[se]}if(R>25){let se=[dn.lookAhead,R];G=G?[se].concat(G):[se]}return new Ps(H,L,U,V,G)}function A(H,L){let U=p.fork(),V=0,R=0,I=0,G=U.end-o,se={size:0,start:0,skip:0};e:for(let je=U.pos-H;U.pos>je;){let we=U.size;if(U.id==L&&we>=0){se.size=V,se.start=R,se.skip=I,I+=4,V+=4,U.next();continue}let Ne=U.pos-we;if(we<0||Ne<je||U.start<G)break;let Z=U.id>=h?4:0,$=U.start;for(U.next();U.pos>Ne;){if(U.size<0)if(U.size==-3||U.size==-4)Z+=4;else break e;else U.id>=h&&(Z+=4);U.next()}R=$,V+=we,I+=Z}return(L<0||V==H)&&(se.size=V,se.start=R,se.skip=I),se.size>4?se:void 0}function D(H,L,U){let{id:V,start:R,end:I,size:G}=p;if(p.next(),G>=0&&V<h){let se=U;if(G>4){let je=p.pos-(G-4);for(;p.pos>je;)U=D(H,L,U)}L[--U]=se,L[--U]=I-H,L[--U]=R-H,L[--U]=V}else G==-3?x=V:G==-4&&(v=V);return U}let q=[],Q=[];for(;p.pos>0;)j(n.start||0,n.bufferStart||0,q,Q,-1,0);let z=(l=n.length)!==null&&l!==void 0?l:q.length?Q[0]+q[0].length:0;return new Ps(g[n.topID],q.reverse(),Q.reverse(),z)}const jb=new WeakMap;function Fd(n,l){if(!n.isAnonymous||l instanceof Va||l.type!=n)return 1;let r=jb.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=n||!(c instanceof Ps)){r=1;break}r+=Fd(n,c)}jb.set(l,r)}return r}function Xp(n,l,r,c,o,u,h,p,g){let x=0;for(let k=c;k<o;k++)x+=Fd(n,l[k]);let v=Math.ceil(x*1.5/8),j=[],_=[];function S(k,E,A,D,q){for(let Q=A;Q<D;){let z=Q,H=E[Q],L=Fd(n,k[Q]);for(Q++;Q<D;Q++){let U=Fd(n,k[Q]);if(L+U>=v)break;L+=U}if(Q==z+1){if(L>v){let U=k[z];S(U.children,U.positions,0,U.children.length,E[z]+q);continue}j.push(k[z])}else{let U=E[Q-1]+k[Q-1].length-H;j.push(Xp(n,k,E,z,Q,H,U,null,g))}_.push(H+q-u)}}return S(l,r,c,o,0),(p||g)(j,_,h)}class mE{constructor(){this.map=new WeakMap}setBuffer(l,r,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(r,c)}getBuffer(l,r){let c=this.map.get(l);return c&&c.get(r)}set(l,r){l instanceof yi?this.setBuffer(l.context.buffer,l.index,r):l instanceof Cs&&this.map.set(l.tree,r)}get(l){return l instanceof yi?this.getBuffer(l.context.buffer,l.index):l instanceof Cs?this.map.get(l.tree):void 0}cursorSet(l,r){l.buffer?this.setBuffer(l.buffer.buffer,l.index,r):this.map.set(l.tree,r)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class hu{constructor(l,r,c,o,u=!1,h=!1){this.from=l,this.to=r,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(l,r=[],c=!1){let o=[new hu(0,l.length,l,0,!1,c)];for(let u of r)u.to>l.length&&o.push(u);return o}static applyChanges(l,r,c=128){if(!r.length)return l;let o=[],u=1,h=l.length?l[0]:null;for(let p=0,g=0,x=0;;p++){let v=p<r.length?r[p]:null,j=v?v.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let _=h;if(g>=_.from||j<=_.to||x){let S=Math.max(_.from,g)-x,k=Math.min(_.to,j)-x;_=S>=k?null:new hu(S,k,_.tree,_.offset+x,p>0,!!v)}if(_&&o.push(_),h.to>j)break;h=u<l.length?l[u++]:null}if(!v)break;g=v.toA,x=v.toA-v.toB}return o}}class gE{startParse(l,r,c){return typeof l=="string"&&(l=new l1(l)),c=c?c.length?c.map(o=>new wl(o.from,o.to)):[new wl(0,0)]:[new wl(0,l.length)],this.createParse(l,r||[],c)}parse(l,r,c){let o=this.startParse(l,r,c);for(;;){let u=o.advance();if(u)return u}}}class l1{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,r){return this.string.slice(l,r)}}function xE(n){return(l,r,c,o)=>new a1(l,n,r,c,o)}class wb{constructor(l,r,c,o,u,h){this.parser=l,this.parse=r,this.overlay=c,this.bracketed=o,this.target=u,this.from=h}}function Nb(n){if(!n.length||n.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class i1{constructor(l,r,c,o,u,h,p,g){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=u,this.bracketed=h,this.target=p,this.prev=g,this.depth=0,this.ranges=[]}}const kp=new dn({perNode:!0});class a1{constructor(l,r,c,o,u){this.nest=r,this.input=c,this.fragments=o,this.ranges=u,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}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 Ps(c.type,c.children,c.positions,c.length,c.propValues.concat([[kp,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],r=l.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[dn.mounted.id]=new Hc(r,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<l&&(l=Math.min(l,this.inner[r].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(l)}startInner(){let l=new o1(this.fragments),r=null,c=null,o=new tf(new Cs(this.baseTree,this.ranges[0].from,0,null),on.IncludeAnonymous|on.IgnoreMounts);e:for(let u,h;;){let p=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)p=!1;else if(l.hasNode(o)){if(r){let x=r.mounts.find(v=>v.frag.from<=o.from&&v.frag.to>=o.to&&v.mount.overlay);if(x)for(let v of x.mount.overlay){let j=v.from+x.pos,_=v.to+x.pos;j>=o.from&&_<=o.to&&!r.ranges.some(S=>S.from<_&&S.to>j)&&r.ranges.push({from:j,to:_})}}p=!1}else if(c&&(h=r1(c.ranges,o.from,o.to)))p=h!=2;else if(!o.type.isAnonymous&&(u=this.nest(o,this.input))&&(o.from<o.to||!u.overlay)){o.tree||(c1(o),r&&r.depth++,c&&c.depth++);let x=l.findMounts(o.from,u.parser);if(typeof u.overlay=="function")r=new i1(u.parser,u.overlay,x,this.inner.length,o.from,!!u.bracketed,o.tree,r);else{let v=Eb(this.ranges,u.overlay||(o.from<o.to?[new wl(o.from,o.to)]:[]));v.length&&Nb(v),(v.length||!u.overlay)&&this.inner.push(new wb(u.parser,v.length?u.parser.startParse(this.input,Tb(x,v),v):u.parser.startParse(""),u.overlay?u.overlay.map(j=>new wl(j.from-o.from,j.to-o.from)):null,!!u.bracketed,o.tree,v.length?v[0].from:o.from)),u.overlay?v.length&&(c={ranges:v,depth:0,prev:c}):p=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new wl(o.from,o.to)),g.from<g.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==g.from?r.ranges[x]={from:r.ranges[x].from,to:g.to}:r.ranges.push(g)}if(p&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let x=Eb(this.ranges,r.ranges);x.length&&(Nb(x),this.inner.splice(r.index,0,new wb(r.parser,r.parser.startParse(this.input,Tb(r.mounts,x),x),r.ranges.map(v=>new wl(v.from-r.start,v.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function r1(n,l,r){for(let c of n){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function kb(n,l,r,c,o,u){if(l<r){let h=n.buffer[l+1];c.push(n.slice(l,r,h)),o.push(h-u)}}function c1(n){let{node:l}=n,r=[],c=l.context.buffer;do r.push(n.index),n.parent();while(!n.tree);let o=n.tree,u=o.children.indexOf(c),h=o.children[u],p=h.buffer,g=[u];function x(v,j,_,S,k,E){let A=r[E],D=[],q=[];kb(h,v,A,D,q,S);let Q=p[A+1],z=p[A+2];g.push(D.length);let H=E?x(A+4,p[A+3],h.set.types[p[A]],Q,z-Q,E-1):l.toTree();return D.push(H),q.push(Q-S),kb(h,p[A+3],j,D,q,S),new Ps(_,D,q,k)}o.children[u]=x(0,p.length,Vl.none,0,h.length,r.length-1);for(let v of g){let j=n.tree.children[v],_=n.tree.positions[v];n.yield(new Cs(j,_+n.from,v,n._tree))}}class Sb{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(on.IncludeAnonymous|on.IgnoreMounts)}moveTo(l){let{cursor:r}=this,c=l-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=l&&r.enter(c,1,on.IgnoreOverlays|on.ExcludeBuffers)))if(r.to<=l)r.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==l.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Ps)r=r.children[0];else break}return!1}}class o1{constructor(l){var r;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(r=c.tree.prop(kp))!==null&&r!==void 0?r:c.to,this.inner=new Sb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(l=r.tree.prop(kp))!==null&&l!==void 0?l:r.to,this.inner=new Sb(r.tree,-r.offset)}}findMounts(l,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,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(dn.mounted);if(h&&h.parser==r)for(let p=this.fragI;p<this.fragments.length;p++){let g=this.fragments[p];if(g.from>=u.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:u.from-g.offset,mount:h})}}}return o}}function Eb(n,l){let r=null,c=l;for(let o=1,u=0;o<n.length;o++){let h=n[o-1].to,p=n[o].from;for(;u<c.length;u++){let g=c[u];if(g.from>=p)break;g.to<=h||(r||(c=r=l.slice()),g.from<h?(r[u]=new wl(g.from,h),g.to>p&&r.splice(u+1,0,new wl(p,g.to))):g.to>p?r[u--]=new wl(p,g.to):r.splice(u--,1))}}return c}function u1(n,l,r,c){let o=0,u=0,h=!1,p=!1,g=-1e9,x=[];for(;;){let v=o==n.length?1e9:h?n[o].to:n[o].from,j=u==l.length?1e9:p?l[u].to:l[u].from;if(h!=p){let _=Math.max(g,r),S=Math.min(v,j,c);_<S&&x.push(new wl(_,S))}if(g=Math.min(v,j),g==1e9)break;v==g&&(h?(h=!1,o++):h=!0),j==g&&(p?(p=!1,u++):p=!0)}return x}function Tb(n,l){let r=[];for(let{pos:c,mount:o,frag:u}of n){let h=c+(o.overlay?o.overlay[0].from:0),p=h+o.tree.length,g=Math.max(u.from,h),x=Math.min(u.to,p);if(o.overlay){let v=o.overlay.map(_=>new wl(_.from+c,_.to+c)),j=u1(l,v,g,x);for(let _=0,S=g;;_++){let k=_==j.length,E=k?x:j[_].from;if(E>S&&r.push(new hu(S,E,o.tree,-h,u.from>=S||u.openStart,u.to<=E||u.openEnd)),k)break;S=j[_].to}}else r.push(new hu(g,x,o.tree,-h,u.from>=h||u.openStart,u.to<=p||u.openEnd))}return r}let d1=0;class vl{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=d1++}toString(){let{name:l}=this;for(let r of this.modified)r.name&&(l=`${r.name}(${l})`);return l}static define(l,r){let c=typeof l=="string"?l:"?";if(l instanceof vl&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new vl(c,[],null,[]);if(o.set.push(o),r)for(let u of r.set)o.set.push(u);return o}static defineModifier(l){let r=new nf(l);return c=>c.modified.indexOf(r)>-1?c:nf.get(c.base||c,c.modified.concat(r).sort((o,u)=>o.id-u.id))}}let f1=0;class nf{constructor(l){this.name=l,this.instances=[],this.id=f1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(p=>p.base==l&&h1(r,p.modified));if(c)return c;let o=[],u=new vl(l.name,o,l,r);for(let p of r)p.instances.push(u);let h=p1(r);for(let p of l.set)if(!p.modified.length)for(let g of h)o.push(nf.get(p,g));return u}}function h1(n,l){return n.length==l.length&&n.every((r,c)=>r==l[c])}function p1(n){let l=[[]];for(let r=0;r<n.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(n[r]));return l.sort((r,c)=>c.length-r.length)}function bE(n){let l=Object.create(null);for(let r in n){let c=n[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let u=[],h=2,p=o;for(let j=0;;){if(p=="..."&&j>0&&j+3==o.length){h=1;break}let _=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(p);if(!_)throw new RangeError("Invalid path: "+o);if(u.push(_[0]=="*"?"":_[0][0]=='"'?JSON.parse(_[0]):_[0]),j+=_[0].length,j==o.length)break;let S=o[j++];if(j==o.length&&S=="!"){h=0;break}if(S!="/")throw new RangeError("Invalid path: "+o);p=o.slice(j)}let g=u.length-1,x=u[g];if(!x)throw new RangeError("Invalid path: "+o);let v=new pu(c,h,g>0?u.slice(0,g):null);l[x]=v.sort(l[x])}}return W_.add(l)}const W_=new dn({combine(n,l){let r,c,o;for(;n||l;){if(!n||l&&n.depth>=l.depth?(o=l,l=l.next):(o=n,n=n.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let u=new pu(o.tags,o.mode,o.context);r?r.next=u:c=u,r=u}return c}});class pu{constructor(l,r,c,o){this.tags=l,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}pu.empty=new pu([],2,null);function ey(n,l){let r=Object.create(null);for(let u of n)if(!Array.isArray(u.tag))r[u.tag.id]=u.class;else for(let h of u.tag)r[h.id]=u.class;let{scope:c,all:o=null}=l||{};return{style:u=>{let h=o;for(let p of u)for(let g of p.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function m1(n,l){let r=null;for(let c of n){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function g1(n,l,r,c=0,o=n.length){let u=new b1(c,Array.isArray(l)?l:[l],r);u.highlightRange(n.cursor(),c,o,"",u.highlighters),u.flush(o)}function x1(n,l,r,c,o,u=0,h=n.length){let p=u;function g(x,v){if(!(x<=p)){for(let j=n.slice(p,x),_=0;;){let S=j.indexOf(`
|
|
117
|
-
`,_),k=S<0?j.length:S;if(k>_&&c(j.slice(_,k),v),S<0)break;o(),_=S+1}p=x}}g1(l,r,(x,v,j)=>{g(x,""),g(v,j)},u,h),g(h,"")}class b1{constructor(l,r,c){this.at=l,this.highlighters=r,this.span=c,this.class=""}startSpan(l,r){r!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=r)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,r,c,o,u){let{type:h,from:p,to:g}=l;if(p>=c||g<=r)return;h.isTop&&(u=this.highlighters.filter(S=>!S.scope||S.scope(h)));let x=o,v=_1(l)||pu.empty,j=m1(u,v.tags);if(j&&(x&&(x+=" "),x+=j,v.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,p),x),v.opaque)return;let _=l.tree&&l.tree.prop(dn.mounted);if(_&&_.overlay){let S=l.node.enter(_.overlay[0].from+p,1),k=this.highlighters.filter(A=>!A.scope||A.scope(_.tree.type)),E=l.firstChild();for(let A=0,D=p;;A++){let q=A<_.overlay.length?_.overlay[A]:null,Q=q?q.from+p:g,z=Math.max(r,D),H=Math.min(c,Q);if(z<H&&E)for(;l.from<H&&(this.highlightRange(l,z,H,o,u),this.startSpan(Math.min(H,l.to),x),!(l.to>=Q||!l.nextSibling())););if(!q||Q>c)break;D=q.to+p,D>r&&(this.highlightRange(S.cursor(),Math.max(r,q.from+p),Math.min(c,D),"",k),this.startSpan(Math.min(c,D),x))}E&&l.parent()}else if(l.firstChild()){_&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,u),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function _1(n){let l=n.type.prop(W_);for(;l&&l.context&&!n.matchContext(l.context);)l=l.next;return l||null}const Te=vl.define,Ad=Te(),Ua=Te(),Cb=Te(Ua),Ab=Te(Ua),Ha=Te(),Rd=Te(Ha),np=Te(Ha),gi=Te(),yr=Te(gi),di=Te(),fi=Te(),Sp=Te(),tu=Te(Sp),Md=Te(),Re={comment:Ad,lineComment:Te(Ad),blockComment:Te(Ad),docComment:Te(Ad),name:Ua,variableName:Te(Ua),typeName:Cb,tagName:Te(Cb),propertyName:Ab,attributeName:Te(Ab),className:Te(Ua),labelName:Te(Ua),namespace:Te(Ua),macroName:Te(Ua),literal:Ha,string:Rd,docString:Te(Rd),character:Te(Rd),attributeValue:Te(Rd),number:np,integer:Te(np),float:Te(np),bool:Te(Ha),regexp:Te(Ha),escape:Te(Ha),color:Te(Ha),url:Te(Ha),keyword:di,self:Te(di),null:Te(di),atom:Te(di),unit:Te(di),modifier:Te(di),operatorKeyword:Te(di),controlKeyword:Te(di),definitionKeyword:Te(di),moduleKeyword:Te(di),operator:fi,derefOperator:Te(fi),arithmeticOperator:Te(fi),logicOperator:Te(fi),bitwiseOperator:Te(fi),compareOperator:Te(fi),updateOperator:Te(fi),definitionOperator:Te(fi),typeOperator:Te(fi),controlOperator:Te(fi),punctuation:Sp,separator:Te(Sp),bracket:tu,angleBracket:Te(tu),squareBracket:Te(tu),paren:Te(tu),brace:Te(tu),content:gi,heading:yr,heading1:Te(yr),heading2:Te(yr),heading3:Te(yr),heading4:Te(yr),heading5:Te(yr),heading6:Te(yr),contentSeparator:Te(gi),list:Te(gi),quote:Te(gi),emphasis:Te(gi),strong:Te(gi),link:Te(gi),monospace:Te(gi),strikethrough:Te(gi),inserted:Te(),deleted:Te(),changed:Te(),invalid:Te(),meta:Md,documentMeta:Te(Md),annotation:Te(Md),processingInstruction:Te(Md),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 Re){let l=Re[n];l instanceof vl&&(l.name=n)}ey([{tag:Re.link,class:"tok-link"},{tag:Re.heading,class:"tok-heading"},{tag:Re.emphasis,class:"tok-emphasis"},{tag:Re.strong,class:"tok-strong"},{tag:Re.keyword,class:"tok-keyword"},{tag:Re.atom,class:"tok-atom"},{tag:Re.bool,class:"tok-bool"},{tag:Re.url,class:"tok-url"},{tag:Re.labelName,class:"tok-labelName"},{tag:Re.inserted,class:"tok-inserted"},{tag:Re.deleted,class:"tok-deleted"},{tag:Re.literal,class:"tok-literal"},{tag:Re.string,class:"tok-string"},{tag:Re.number,class:"tok-number"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],class:"tok-string2"},{tag:Re.variableName,class:"tok-variableName"},{tag:Re.local(Re.variableName),class:"tok-variableName tok-local"},{tag:Re.definition(Re.variableName),class:"tok-variableName tok-definition"},{tag:Re.special(Re.variableName),class:"tok-variableName2"},{tag:Re.definition(Re.propertyName),class:"tok-propertyName tok-definition"},{tag:Re.typeName,class:"tok-typeName"},{tag:Re.namespace,class:"tok-namespace"},{tag:Re.className,class:"tok-className"},{tag:Re.macroName,class:"tok-macroName"},{tag:Re.propertyName,class:"tok-propertyName"},{tag:Re.operator,class:"tok-operator"},{tag:Re.comment,class:"tok-comment"},{tag:Re.meta,class:"tok-meta"},{tag:Re.invalid,class:"tok-invalid"},{tag:Re.punctuation,class:"tok-punctuation"}]);const y1="modulepreload",v1=function(n,l){return new URL(n,l).href},Rb={},ot=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(v){return Promise.all(v.map(j=>Promise.resolve(j).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(v=>{if(v=v1(v,c),v in Rb)return;Rb[v]=!0;const j=v.endsWith(".css"),_=j?'[rel="stylesheet"]':"";if(!!c)for(let E=p.length-1;E>=0;E--){const A=p[E];if(A.href===v&&(!j||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${_}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":y1,j||(k.as="script"),k.crossOrigin="",k.href=v,x&&k.setAttribute("nonce",x),document.head.appendChild(k),j)return new Promise((E,A)=>{k.addEventListener("load",E),k.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${v}`)))})}))}function u(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return o.then(h=>{for(const p of h||[])p.status==="rejected"&&u(p.reason);return l().catch(u)})},ty={js:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await ot(async()=>{const{javascript:n}=await import("./index-qjyqA6zd.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await ot(async()=>{const{json:n}=await import("./index-BUfKKp57.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await ot(async()=>{const{json:n}=await import("./index-BUfKKp57.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await ot(async()=>{const{css:n}=await import("./index-Dru7wmxV.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await ot(async()=>{const{css:n}=await import("./index-Dru7wmxV.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await ot(async()=>{const{css:n}=await import("./index-Dru7wmxV.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await ot(async()=>{const{html:n}=await import("./index-iahStfDc.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await ot(async()=>{const{html:n}=await import("./index-iahStfDc.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await ot(async()=>{const{html:n}=await import("./index-iahStfDc.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await ot(async()=>{const{html:n}=await import("./index-iahStfDc.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await ot(async()=>{const{markdown:n}=await import("./index-DlcxNT3u.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await ot(async()=>{const{markdown:n}=await import("./index-DlcxNT3u.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await ot(async()=>{const{python:n}=await import("./index-B_iQhvb3.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await ot(async()=>{const{python:n}=await import("./index-B_iQhvb3.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await ot(async()=>{const{yaml:n}=await import("./index-hRb8ersw.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await ot(async()=>{const{yaml:n}=await import("./index-hRb8ersw.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await ot(async()=>{const{rust:n}=await import("./index-BnBusVyC.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-C01LPRKQ.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-C01LPRKQ.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-C01LPRKQ.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-C01LPRKQ.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await ot(async()=>{const{cpp:n}=await import("./index-C01LPRKQ.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await ot(async()=>{const{java:n}=await import("./index-D6qzdOs0.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await ot(async()=>{const{go:n}=await import("./index-DikEtRL5.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await ot(async()=>{const{php:n}=await import("./index-DP031YpP.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await ot(async()=>{const{sql:n}=await import("./index-ChI_MBJ6.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await ot(async()=>{const{xml:n}=await import("./index-QKzVwILH.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await ot(async()=>{const{xml:n}=await import("./index-QKzVwILH.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},j1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},w1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function N1(n){const l=w1[n.toLowerCase()]??n.toLowerCase(),r=ty[l];return r?r().catch(()=>null):null}async function k1(n){const l=(n.split("/").pop()??"").toLowerCase(),r=j1[l]??l.split(".").pop()??"",c=ty[r];return c?c().catch(()=>null):null}const S1=ey([{tag:[Re.keyword,Re.modifier,Re.controlKeyword,Re.moduleKeyword],class:"cmh-key"},{tag:[Re.propertyName],class:"cmh-prop"},{tag:[Re.function(Re.variableName),Re.labelName],class:"cmh-fn"},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name),Re.bool],class:"cmh-const"},{tag:[Re.typeName,Re.className,Re.changed,Re.annotation,Re.self,Re.namespace],class:"cmh-type"},{tag:[Re.number,Re.integer,Re.float],class:"cmh-num"},{tag:[Re.string,Re.special(Re.string),Re.regexp],class:"cmh-str"},{tag:[Re.operator,Re.operatorKeyword,Re.escape],class:"cmh-op"},{tag:[Re.meta,Re.comment],class:"cmh-comment"},{tag:Re.invalid,class:"cmh-invalid"}]);function Dd(n){return n.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function E1(n,l){const r=l?await N1(l):null;if(!r)return Dd(n);try{const c=r.language.parser.parse(n);let o="";return x1(n,c,S1,(u,h)=>{o+=h?`<span class="${h}">${Dd(u)}</span>`:Dd(u)},()=>{o+=`
|
|
118
|
-
`}),o}catch{return Dd(n)}}Ut.setOptions({gfm:!0,breaks:!1});function ny(n){var r;const l=(r=n.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function ff(n){const l=await Ut.parse(n,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await E1(c.text,c.lang??""),c.escaped=!0}});return Fj.sanitize(l)}function Mb(n,l){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:l,previewMode:ny(n.path)}}function Wi(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function T1(n){return n.split("/").pop()??n}function Ar(n){const l=n.lastIndexOf("/");return l===-1?"":n.slice(0,l)}function Jd(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}var sy=b_();function qa({x:n,y:l,items:r,note:c,onClose:o}){const u=b.useRef(null),[h,p]=b.useState({left:n,top:l}),[g,x]=b.useState(()=>{const _=r.findIndex(S=>!S.disabled);return _===-1?0:_});b.useLayoutEffect(()=>{const _=u.current;if(!_)return;const S=_.getBoundingClientRect(),k=8,E=Math.max(k,Math.min(n,window.innerWidth-S.width-k)),A=Math.max(k,Math.min(l,window.innerHeight-S.height-k));p({left:E,top:A})},[n,l]),b.useLayoutEffect(()=>{var _;(_=u.current)==null||_.focus()},[]),b.useLayoutEffect(()=>{function _(k){var E;(E=u.current)!=null&&E.contains(k.target)||o()}function S(){o()}return document.addEventListener("mousedown",_),document.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("scroll",S,!0)}},[o]);function v(_){_.disabled||(_.onSelect(),o())}function j(_){if(_.key==="Escape"){_.preventDefault(),_.stopPropagation(),o();return}const S=r.map((k,E)=>({item:k,index:E})).filter(k=>!k.item.disabled);if(S.length!==0){if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();const k=_.key==="ArrowDown"?1:-1,E=S.findIndex(D=>D.index===g),A=S[(((E===-1?0:E)+k)%S.length+S.length)%S.length];A&&x(A.index);return}if(_.key==="Enter"||_.key===" "){_.preventDefault();const k=r[g];k&&v(k)}}}return sy.createPortal(i.jsxs("div",{ref:u,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((_,S)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":_.disabled,className:"ctxmenu__item"+(S===g?" is-cursor":""),onMouseEnter:()=>x(S),onClick:()=>v(_),children:[i.jsx("span",{className:"ctxmenu__label",children:_.label}),_.hint&&i.jsx("span",{className:"ctxmenu__hint",children:_.hint})]},_.id))]}),document.body)}const C1=3500,A1=9e3,Db=220;function Or({result:n,onDismiss:l}){const[r,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 p=n.ok?C1:A1,g=setTimeout(()=>u(!0),p),x=setTimeout(()=>c(null),p+Db);return()=>{clearTimeout(g),clearTimeout(x)}},[n]),!r)return null;const h=()=>{u(!0),setTimeout(()=>{c(null),l==null||l()},Db)};return i.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&i.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function _i({value:n,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[u,h]=b.useState(n),p=b.useRef(null);b.useEffect(()=>{var x;(x=p.current)==null||x.select()},[]);function g(){const x=u.trim();if(!x||x===n)return o();c(x)}return i.jsx("input",{ref:p,className:l?`rename ${l}`:"rename",value:u,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:x=>h(x.target.value),onBlur:g,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Pc({active:n}){return n?i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 5h3V2"}),i.jsx("path",{d:"M14 5h-3V2"}),i.jsx("path",{d:"M2 11h3v3"}),i.jsx("path",{d:"M14 11h-3v3"})]}):i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 2H2v3"}),i.jsx("path",{d:"M11 2h3v3"}),i.jsx("path",{d:"M2 11v3h3"}),i.jsx("path",{d:"M14 11v3h-3"})]})}const R1=500,vr="application/x-ccv-fs-path",M1=200;function D1({open:n,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:u,result:h,searchResult:p,onSearch:g,onReveal:x,onToggle:v,onOpen:j,onCreate:_,onRename:S,onMove:k,onCopy:E,onDelete:A,onRefresh:D,onClose:q,zoomed:Q,onToggleZoom:z}){const[H,L]=b.useState(""),[U,V]=b.useState(null),[R,I]=b.useState(null),[G,se]=b.useState(null),[je,we]=b.useState(null),[Ne,Z]=b.useState(null),[$,ne]=b.useState(null),me=of("(hover: hover)"),ke=b.useRef(null),T=b.useMemo(()=>z1(u),[u]);function K(ie){return!(!G||ie===G.path||G.kind==="dir"&&ie.startsWith(`${G.path}/`)||ie===Ar(G.path))}function de(ie){return!(!Ne||ie===Ne.path||Ne.kind==="dir"&&ie.startsWith(`${Ne.path}/`)||Ne.mode==="cut"&&ie===Ar(Ne.path))}function _e(ie){Z({path:ie.path,kind:ie.kind,mode:"copy"})}function Me(ie){Z({path:ie.path,kind:ie.kind,mode:"cut"})}function ze(ie){!Ne||!de(ie)||(ie&&!r.has(ie)&&v(ie),Ne.mode==="cut"?(k(Ne.path,ie),Z(null)):E(Ne.path,ie))}function Ve(ie,ye){const He=ie.touches[0];if(!He)return;const lt={timer:0,x:He.clientX,y:He.clientY,el:ie.currentTarget,fired:!1};lt.timer=window.setTimeout(()=>{lt.fired=!0,ye(lt.x,lt.y,lt.el)},R1),ke.current=lt}function re(ie){const ye=ke.current,He=ie.touches[0];!ye||!He||Math.hypot(He.clientX-ye.x,He.clientY-ye.y)>10&&(window.clearTimeout(ye.timer),ke.current=null)}function Ye(ie){const ye=ke.current;ye&&(window.clearTimeout(ye.timer),ye.fired&&ie.preventDefault())}function pe(){var ie;return(ie=ke.current)!=null&&ie.fired?(ke.current=null,!0):!1}function Ge(ie,ye,He,lt){L((lt==null?void 0:lt.path)??""),ne({x:ie,y:ye,opener:He,entry:lt})}function dt(){const ie=$==null?void 0:$.opener;ne(null),ie!=null&&ie.isConnected&&ie.focus()}function nt(ie){return{onContextMenu:ye=>{ye.preventDefault(),Ge(ye.clientX,ye.clientY,ye.currentTarget,ie)},onTouchStart:ye=>Ve(ye,(He,lt,Je)=>Ge(He,lt,Je,ie)),onTouchMove:re,onTouchEnd:Ye,onTouchCancel:Ye}}function bt(ie){ie.target===ie.currentTarget&&(ie.preventDefault(),Ge(ie.clientX,ie.clientY,ie.currentTarget,null))}function Xe(ie){ie.target===ie.currentTarget&&Ve(ie,(ye,He,lt)=>Ge(ye,He,lt,null))}function Ct(ie){if(!(ie.ctrlKey||ie.metaKey)||ie.target instanceof HTMLInputElement)return;const ye=ie.key.toLowerCase();if(ye==="v"){ie.preventDefault(),ze(St());return}if(!H)return;const He=Ob(l,H);He&&(ye==="c"?(ie.preventDefault(),_e(He)):ye==="x"&&(ie.preventDefault(),Me(He)))}function ee(ie){return ye=>{ye.dataTransfer.effectAllowed="move",ye.dataTransfer.setData(vr,ie.path),se({path:ie.path,kind:ie.kind})}}function Ze(){se(null),we(null)}function st(ie){return ye=>{ye.dataTransfer.types.includes(vr)&&(ye.stopPropagation(),!(ie.kind!=="dir"||!K(ie.path))&&(ye.preventDefault(),we(ie.path)))}}function Be(ie){return ye=>{if(!ye.dataTransfer.types.includes(vr)||(ye.stopPropagation(),ie.kind!=="dir"||!K(ie.path)))return;ye.preventDefault();const He=ye.dataTransfer.getData(vr);we(null),He&&k(He,ie.path)}}function Fe(ie){!ie.dataTransfer.types.includes(vr)||!K("")||(ie.preventDefault(),we(""))}function De(ie){if(!ie.dataTransfer.types.includes(vr)||!K(""))return;ie.preventDefault();const ye=ie.dataTransfer.getData(vr);we(null),ye&&k(ye,"")}const[ut,Ce]=b.useState(""),kt=ut.trim(),Ft=kt.length>0,Ht=b.useRef(null),nn=b.useRef(g);nn.current=g;function fn(ie){Ce(ie),Ht.current&&clearTimeout(Ht.current);const ye=ie.trim();if(!ye){nn.current("");return}Ht.current=setTimeout(()=>nn.current(ye),M1)}function _n(ie){Ht.current&&clearTimeout(Ht.current),Ce(""),nn.current(""),L(ie.path),x(ie)}const wn=Ft&&(p==null?void 0:p.query)===kt?p:null;function St(){if(H==="")return"";const ie=Ob(l,H);if((ie==null?void 0:ie.kind)==="dir")return H;const ye=H.lastIndexOf("/");return ye===-1?"":H.slice(0,ye)}function ft(ie,ye){const He=ye??St();He&&!r.has(He)&&v(He),I({parent:He,kind:ie})}function $t(){if(!$)return[];const ie=lt=>me?lt:void 0;if(!$.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ie("Ctrl+V"),disabled:!de(""),onSelect:()=>ze("")},{id:"new-file",label:"Создать файл",onSelect:()=>ft("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>ft("dir","")}];const ye=$.entry,He=[ye.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ye.path)}:{id:"toggle",label:r.has(ye.path)?"Свернуть":"Развернуть",onSelect:()=>v(ye.path)},{id:"copy",label:"Копировать",hint:ie("Ctrl+C"),onSelect:()=>_e(ye)},{id:"cut",label:"Вырезать",hint:ie("Ctrl+X"),onSelect:()=>Me(ye)}];return ye.kind==="dir"&&(He.push({id:"paste",label:"Вставить",hint:ie("Ctrl+V"),disabled:!de(ye.path),onSelect:()=>ze(ye.path)}),He.push({id:"new-file",label:"Создать файл",onSelect:()=>ft("file",ye.path)}),He.push({id:"new-dir",label:"Создать каталог",onSelect:()=>ft("dir",ye.path)})),He.push({id:"rename",label:"Переименовать",onSelect:()=>V(ye.path)}),He.push({id:"delete",label:"Удалить",onSelect:()=>A(ye)}),He}const Cn=Ft?[]:At("",0);function At(ie,ye){const He=l[ie],lt=[];if(R&&R.parent===ie&<.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:ea(ye),children:[i.jsx("span",{className:"fsrow__icon",children:R.kind==="dir"?i.jsx(lf,{}):i.jsx(af,{})}),i.jsx(_i,{className:"rename--file",value:"",placeholder:R.kind==="dir"?"имя каталога":"имя файла",onCommit:Je=>{I(null),_(ie,R.kind,Je)},onCancel:()=>I(null)})]},`draft:${ie}`)),!He)return lt.push(i.jsx("p",{className:"fsrow__pending",style:ea(ye),children:"читаем…"},`wait:${ie}`)),lt;He.length===0&&!R&<.push(i.jsx("p",{className:"fsrow__pending",style:ea(ye),children:"пусто"},`empty:${ie}`));for(const Je of He){const sn=Je.kind==="dir"&&r.has(Je.path);lt.push(U===Je.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:ea(ye),children:[i.jsx("span",{className:"fsrow__icon",children:Je.kind==="dir"?i.jsx(lf,{open:sn}):i.jsx(af,{})}),i.jsx(_i,{className:"rename--file",value:Je.name,placeholder:"новое имя",onCommit:F=>{V(null),S(Je.path,F)},onCancel:()=>V(null)})]},Je.path):i.jsx(O1,{entry:Je,depth:ye,open:sn,active:Je.path===c,selected:Je.path===H,dirty:o.has(Je.path),gitStatus:T.get(Je.path),dragging:(G==null?void 0:G.path)===Je.path,dropTarget:je===Je.path,cut:(Ne==null?void 0:Ne.mode)==="cut"&&Ne.path===Je.path,onClick:()=>{pe()||(L(Je.path),Je.kind==="dir"?v(Je.path):j(Je.path))},onRename:()=>V(Je.path),onDelete:()=>A(Je),onDragStart:ee(Je),onDragEnd:Ze,onDragOver:st(Je),onDrop:Be(Je),...nt(Je)},Je.path)),sn&<.push(...At(Je.path,ye+1))}return lt}function hs(){if(!wn)return[i.jsx("p",{className:"fsrow__pending",style:ea(0),children:"ищем…"},"search:wait")];if(wn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:ea(0),children:"ничего не найдено"},"search:empty")];const ie=wn.entries.map(ye=>i.jsx(L1,{entry:ye,gitStatus:T.get(ye.path),onClick:()=>_n(ye)},ye.path));return wn.truncated&&ie.push(i.jsxs("p",{className:"fsrow__pending",style:ea(0),children:["показаны первые ",wn.entries.length," — уточните запрос"]},"search:truncated")),ie}return i.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Q?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:Ct,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:ie=>{z&&(ie.target.closest("button")||z())},children:[i.jsx(B1,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>ft("file"),children:i.jsx(U1,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>ft("dir"),children:i.jsx(H1,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:D,children:"↻"}),z&&i.jsx("button",{className:"sidepane__btn",title:Q?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Q?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Q,onClick:z,children:i.jsx(Pc,{active:Q})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:q,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(q1,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:ut,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:ie=>fn(ie.target.value),onKeyDown:ie=>{ie.stopPropagation(),ie.key==="Escape"&&(ie.preventDefault(),ut?fn(""):ie.currentTarget.blur())}}),ut&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>fn(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(je===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Fe,onDrop:De,onContextMenu:bt,onTouchStart:Xe,onTouchMove:re,onTouchEnd:Ye,onTouchCancel:Ye,children:Ft?hs():Cn}),i.jsx(Or,{result:h}),$&&i.jsx(qa,{x:$.x,y:$.y,items:$t(),onClose:dt})]})}function O1({entry:n,depth:l,open:r,active:c,selected:o,dirty:u,gitStatus:h,dragging:p,dropTarget:g,cut:x,onClick:v,onRename:j,onDelete:_,onDragStart:S,onDragEnd:k,onDragOver:E,onDrop:A,onContextMenu:D,onTouchStart:q,onTouchMove:Q,onTouchEnd:z,onTouchCancel:H}){const L="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return i.jsxs("div",{className:L,style:ea(l),draggable:!0,onDragStart:S,onDragEnd:k,onDragOver:E,onDrop:A,onContextMenu:D,onTouchStart:q,onTouchMove:Q,onTouchEnd:z,onTouchCancel:H,children:[i.jsxs("button",{className:"fsrow__main",onClick:v,title:ly(n),children:[i.jsx("span",{className:"fsrow__icon"+sf("fsrow__icon",h),children:n.kind==="dir"?i.jsx(lf,{open:r}):i.jsx(af,{})}),i.jsx("span",{className:"fsrow__name"+sf("fsrow__name",h),children:n.name}),n.ignored&&i.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),u&&i.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),i.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:j,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:_,children:"✕"})]})}function L1({entry:n,gitStatus:l,onClick:r}){const c=n.path.slice(0,n.path.length-n.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(n.ignored?" fsrow--ignored":""),style:ea(0),onClick:r,title:ly(n),children:[i.jsx("span",{className:"fsrow__icon"+sf("fsrow__icon",l),children:n.kind==="dir"?i.jsx(lf,{}):i.jsx(af,{})}),i.jsx("span",{className:"fsrow__name"+sf("fsrow__name",l),children:n.name}),n.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function ly(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function ea(n){return{"--depth":n}}function Ob(n,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=n[c])==null?void 0:o.find(u=>u.path===l))??null}function z1(n){const l=new Map,r={added:1,modified:2},c=(o,u)=>{const h=l.get(o);(!h||r[u]>r[h])&&l.set(o,u)};for(const o of n){const u=I1(o.status);if(!u)continue;c(o.path,u);let h=Ar(o.path);for(;c(h,u),!!h;)h=Ar(h)}return l}function I1(n){if(n==="??")return"added";const[l="",r=""]=n;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function sf(n,l){return l?` ${n}--git-${l}`:""}function lf({open:n=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:n?i.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"}):i.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 af(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]})}function U1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[i.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"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function H1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:i.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"})}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function B1(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.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"}),i.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 q1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const G1=200;function $1({open:n,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:u,onToggleZoom:h}){const[p,g]=b.useState(""),x=p.trim(),v=x.length>0,j=b.useRef(null),_=b.useRef(r);_.current=r;function S(A){g(A),j.current&&clearTimeout(j.current);const D=A.trim();if(!D){_.current("");return}j.current=setTimeout(()=>_.current(D),G1)}const k=v&&(l==null?void 0:l.query)===x?l:null;function E(){if(!k)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let D="";for(const q of k.matches)q.path!==D&&(D=q.path,A.push(i.jsx("p",{className:"searchgroup__path",title:q.path,children:q.path},`path:${q.path}`))),A.push(i.jsx(Y1,{match:q,onClick:()=>c(q)},`${q.path}:${q.line}:${q.column}`));return k.truncated&&A.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),A}return i.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(u?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:A=>{h&&(A.target.closest("button")||h())},children:[i.jsx(V1,{}),i.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&i.jsx("button",{className:"sidepane__btn",title:u?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":u?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":u,onClick:h,children:i.jsx(Pc,{active:u})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(X1,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>S(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),p?S(""):A.currentTarget.blur())}}),p&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>S(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:v?E():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Y1({match:n,onClick:l}){const r=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 i.jsxs("button",{className:"searchmatch",onClick:l,title:`${n.path}:${n.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:n.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function V1(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function X1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Od=null;function Q1(){return Od||(Od=Promise.all([ot(()=>import("./index-Ca9uYBli.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),ot(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),ot(()=>import("./index-BHot-lnj.js"),[],import.meta.url),ot(()=>import("./index-CwNolSfU.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),ot(()=>import("./codemirror-CDWDRYM6.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,l,r,c,o])=>({EditorView:l.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw Od=null,n})),Od}function K1({path:n,doc:l,revision:r,goto:c,onChange:o,onSave:u}){const h=b.useRef(null),p=b.useRef(null),g=b.useRef(null),x=b.useRef(new Map),v=b.useRef(new Map),j=b.useRef(new Set),_=b.useRef(null),S=b.useRef(o),k=b.useRef(u),E=b.useRef(n),A=b.useRef(r),D=b.useRef(l);S.current=o,k.current=u,E.current=n,A.current=r,D.current=l;const[q,Q]=b.useState("loading"),[z,H]=b.useState(!1);function L(V,R,I,G,se){const je=x.current.get(G),we=v.current.get(G)===se;if(je&&we)I.setState(je);else{const Z=V.EditorState.create({doc:D.current,extensions:[V.basicSetup,V.Prec.highest(V.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(E.current),!0)}])),V.keymap.of([V.indentWithTab]),R.of([]),V.editorTheme,V.editorHighlight,V.EditorView.updateListener.of($=>{$.docChanged&&S.current(E.current,$.state.doc.toString())})]});x.current.set(G,Z),v.current.set(G,se),I.setState(Z),j.current.delete(G)}if(j.current.has(G))return()=>{};let Ne=!1;return k1(G).then(Z=>{Ne||!Z||E.current!==G||(I.dispatch({effects:R.reconfigure(Z)}),x.current.set(G,I.state),j.current.add(G))}),()=>{Ne=!0}}b.useEffect(()=>{if(!h.current)return;let R=!1,I=null,G=null;Q("loading"),H(!1);const se=window.setTimeout(()=>{R||H(!0)},200);return(async()=>{let je;try{je=await Q1()}catch{window.clearTimeout(se),R||Q("error");return}if(R||!h.current)return;window.clearTimeout(se);const we=new je.Compartment;_.current=we,g.current=je,G=new je.EditorView({parent:h.current}),p.current=G,I=L(je,we,G,E.current,A.current),Q("ready")})(),()=>{R=!0,window.clearTimeout(se),I==null||I(),G==null||G.destroy(),p.current===G&&(p.current=null),g.current=null,_.current=null}},[]),b.useEffect(()=>{const V=g.current,R=p.current,I=_.current;if(!(!V||!R||!I))return L(V,I,R,n,r)},[n,r]);const U=b.useRef(0);return b.useEffect(()=>{const V=p.current,R=g.current;if(!V||!R||!c||c.token===U.current)return;U.current=c.token;const I=V.state.doc.lines,G=Math.min(Math.max(c.line,1),I),se=V.state.doc.line(G),je=Math.min(se.from+Math.max(c.column-1,0),se.to);V.dispatch({selection:R.EditorSelection.cursor(je),effects:R.EditorView.scrollIntoView(je,{y:"center"})}),V.focus()},[c]),b.useEffect(()=>()=>{const V=p.current;V&&x.current.set(n,V.state)},[n]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(q==="ready"?"":" is-hidden")}),q==="loading"&&z&&i.jsxs("div",{className:"editor__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),q==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function jl({value:n,options:l,onChange:r,className:c,title:o,ariaLabel:u,placeholder:h="—"}){const[p,g]=b.useState(!1),[x,v]=b.useState(0),j=b.useRef(null),_=b.useRef(null),S=l.find(A=>A.value===n)??null;b.useEffect(()=>{if(!p)return;const A=l.findIndex(D=>D.value===n);v(A===-1?0:A)},[p]),b.useEffect(()=>{if(!p)return;function A(D){var q;(q=j.current)!=null&&q.contains(D.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[p]),b.useEffect(()=>{var A,D;p&&((D=(A=_.current)==null?void 0:A.querySelector(".is-cursor"))==null||D.scrollIntoView({block:"nearest"}))},[p,x]),b.useEffect(()=>{if(!p)return;const A=_.current,D=Z1(j.current);if(!A||!D)return;const q=A.getBoundingClientRect().bottom-D.getBoundingClientRect().bottom;q>0&&(D.scrollTop+=Math.min(q+8,A.offsetHeight))},[p]);function k(A){g(!1),A.value!==n&&r(A.value)}function E(A){if(A.key==="Escape"){if(!p)return;A.preventDefault(),A.stopPropagation(),g(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!p)return g(!0);const D=A.key==="ArrowDown"?1:l.length-1;return v(q=>(q+D)%l.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!p)return g(!0);const D=l[x];D&&k(D)}}return i.jsxs("div",{ref:j,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":u??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>g(A=>!A),onKeyDown:E,children:[i.jsx("span",{className:"select__value",children:(S==null?void 0:S.label)??h}),i.jsx(F1,{})]}),p&&i.jsx("div",{ref:_,className:"select__menu",role:"listbox","aria-label":u??o,children:l.map((A,D)=>i.jsxs("button",{type:"button",role:"option","aria-selected":A.value===n,className:"select__option"+(D===x?" is-cursor":"")+(A.value===n?" is-on":""),onMouseEnter:()=>v(D),onClick:()=>k(A),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===n?"✓":""}),i.jsx("span",{className:"select__label",children:A.label}),A.hint&&i.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function Z1(n){let l=(n==null?void 0:n.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function F1(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function J1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function P1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M4.6 6.6h4"})]})}function W1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),i.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function ew({path:n,mime:l,base64:r,error:c,tooLarge:o,size:u,onRequestMedia:h}){b.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(n)},[]);const p=tw(r,l);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Jd(u),"). Лимит — 64 МБ."]})}):c?i.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[i.jsx("p",{className:"mediaview__error",children:c}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(n),children:"Повторить"})]}):p?l.startsWith("image/")?i.jsx(sw,{url:p}):l.startsWith("video/")?i.jsx(iw,{url:p}):null:i.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[i.jsx("div",{className:"mediaview__progress",children:i.jsx("div",{className:"mediaview__progress-fill"})}),i.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function tw(n,l){const[r,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 p=0;p<o.length;p++)u[p]=o.charCodeAt(p);const h=URL.createObjectURL(new Blob([u],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[n,l]),r}const Ia=1,iy=8,Ld=1.25;function nw(n){return Math.min(iy,Math.max(Ia,n))}function sw({url:n}){const[l,r]=b.useState({scale:Ia,x:0,y:0}),[c,o]=b.useState(!1),u=b.useRef(null),h=b.useRef(null);function p(S,k,E){r(A=>{const D=nw(A.scale*S);if(D===A.scale)return A;if(D<=Ia)return{scale:Ia,x:0,y:0};const q=(k-A.x)/A.scale,Q=(E-A.y)/A.scale;return{scale:D,x:k-D*q,y:E-D*Q}})}b.useEffect(()=>{const S=u.current;if(!S)return;function k(E){E.preventDefault();const A=S.getBoundingClientRect(),D=E.clientX-A.left-A.width/2,q=E.clientY-A.top-A.height/2;p(E.deltaY<0?Ld:1/Ld,D,q)}return S.addEventListener("wheel",k,{passive:!1}),()=>S.removeEventListener("wheel",k)},[]);function g(S){l.scale<=Ia||(S.currentTarget.setPointerCapture(S.pointerId),h.current={pointerId:S.pointerId,startX:S.clientX,startY:S.clientY,origX:l.x,origY:l.y},o(!0))}function x(S){const k=h.current;!k||k.pointerId!==S.pointerId||r(E=>({...E,x:k.origX+(S.clientX-k.startX),y:k.origY+(S.clientY-k.startY)}))}function v(){h.current=null,o(!1)}const j=l.scale>Ia,_=!j&&l.x===0&&l.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:u,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:x,onPointerUp:v,onPointerCancel:v,children:i.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:l.scale<=Ia,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>p(1/Ld,0,0),children:i.jsx(P1,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:l.scale>=iy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>p(Ld,0,0),children:i.jsx(J1,{})}),i.jsx("button",{className:"btn btn--sm",disabled:_,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Ia,x:0,y:0}),children:i.jsx(W1,{})})]})]})}const lw=[{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 iw({url:n}){const l=b.useRef(null),[r,c]=b.useState("1");return b.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:l,className:"mediaview__video",src:n,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(jl,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:lw})]})]})}function aw({file:n,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:u,onRequestMedia:h,onTogglePreview:p}){const g=Wi(n),x=ny(n.path)&&!n.binary&&!n.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:n.path,children:n.path}),i.jsxs("span",{className:"editor__meta",children:[Jd(n.size),n.eol==="crlf"&&" · CRLF"]}),x&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(n.previewMode?" is-on":""),role:"tab","aria-selected":n.previewMode,onClick:()=>!n.previewMode&&p(n.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&p(n.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:g?"Сохранить":"Сохранено"})]}),n.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),g&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>u(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?i.jsx(ew,{path:n.path,mime:n.mediaMime,base64:n.mediaBase64,error:n.mediaError,tooLarge:n.mediaTooLarge,size:n.size,onRequestMedia:h},n.path):n.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Jd(n.size)," на диске."]}):n.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Jd(n.size),"). Такие правит агент, а не браузер."]}):x&&n.previewMode?i.jsx(rw,{text:n.text}):i.jsx(K1,{path:n.path,doc:n.text,revision:n.revision,goto:l,onChange:r,onSave:c})]})}function rw({text:n}){const[l,r]=b.useState("");return b.useEffect(()=>{let c=!1;return ff(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function cw({files:n,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:u,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:p=>{h&&(p.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[i.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&i.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(p=>i.jsxs("div",{className:"worktab"+(p.path===l?" is-on":""),role:"tab","aria-selected":p.path===l,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:T1(p.path)}),Wi(p)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path),children:"✕"})]},p.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:u?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":u?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":u,onClick:h,children:i.jsx(Pc,{active:u})})]})}function yl(n){return n.claudeSessionId??n.id}function zd(n,l,r,c){if(!l||l.length===0)return n;const o=new Map(l.map((p,g)=>[p,g])),u=[],h=[];for(const p of n)(o.has(r(p))?u:h).push(p);return u.sort((p,g)=>o.get(r(p))-o.get(r(g))),c==="top"?[...h,...u]:[...u,...h]}function Lb(n){return n.state!=="closed"}function zb(n){return[...n.filter(Lb),...n.filter(l=>!Lb(l))]}function Id(n,l,r,c){if(l===r||!n.includes(l)||!n.includes(r))return null;const o=n.filter(p=>p!==l),u=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,u),l,...o.slice(u)];return h.every((p,g)=>p===n[g])?null:h}function Qp(n,l,r,c){const o=n%10,u=n%100;return o===1&&u!==11?l:o>=2&&o<=4&&(u<12||u>14)?r:c}function ay(n){return`${n} ${Qp(n,"агент","агента","агентов")}`}function ow(n){const l=n.filter(o=>o.kind==="agent").length,r=n.length-l,c=[];return l>0&&c.push(ay(l)),r>0&&c.push(`${r} ${Qp(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function uw(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function dw(n){const l=Math.max(0,Math.floor(n/1e3)),r=Math.floor(l/3600),c=Math.floor(l%3600/60),o=l%60,u=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${u}`:`${c}:${u}`}function fw(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function hw({tasks:n,onStop:l}){const[r,c]=b.useState(!1),[o,u]=b.useState(()=>Date.now()),[h,p]=b.useState(()=>new Set);b.useEffect(()=>{const x=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(x)},[]),b.useEffect(()=>{p(x=>{const v=new Set(n.map(_=>_.id)),j=new Set([...x].filter(_=>v.has(_)));return j.size===x.size?x:j})},[n]);const g=x=>{p(v=>new Set(v).add(x)),l(x),window.setTimeout(()=>{p(v=>{if(!v.has(x))return v;const j=new Set(v);return j.delete(x),j})},1e4)};return i.jsxs("div",{className:r?"tasks is-open":"tasks",children:[i.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(x=>!x),children:[i.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),i.jsx("span",{className:"tasks__summary",children:ow(n)}),i.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&i.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(x=>{const v=h.has(x.id);return i.jsxs("li",{className:v?"task is-stopping":"task",children:[i.jsxs("div",{className:"task__main",children:[i.jsxs("div",{className:"task__head",children:[i.jsx("span",{className:"task__kind",children:uw(x)}),x.background&&i.jsx("span",{className:"task__bg",children:"фон"}),i.jsx("span",{className:"task__time",children:dw(o-x.startedAt)})]}),i.jsx("div",{className:"task__desc",title:x.description,children:x.description}),(x.activity||x.lastTool)&&i.jsx("div",{className:"task__activity",title:x.activity??x.lastTool??void 0,children:x.activity??x.lastTool}),i.jsxs("div",{className:"task__stats",children:[fw(x.tokens)," · ",x.toolUses," ",Qp(x.toolUses,"вызов","вызова","вызовов")]})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:v,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:v?"Останавливается":"Стоп"})]},x.id)})})]})}const pw=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Kp({className:n}){return i.jsx("img",{src:pw,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const mw=450,gw=6,xw=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy · разговоры и инструменты"},{id:"codex",label:"Codex",hint:"OpenAI · сессии, инструменты и разрешения"}];function Ib({disabled:n,providers:l,onStart:r}){const c=[...new Set(l)].flatMap(R=>xw.filter(I=>I.id===R)),o=c.length>1,[u,h]=b.useState(!1),[p,g]=b.useState(0),[x,v]=b.useState({left:0,top:0}),j=b.useRef(null),_=b.useRef(null),S=b.useRef(null);function k(){S.current&&window.clearTimeout(S.current.timer),S.current=null}function E(R=!1){R||k(),g(0),h(!0)}function A(R){var I;h(!1),R&&((I=j.current)==null||I.focus())}function D(R){if(n||!o||R.button!==0)return;const I={timer:0,x:R.clientX,y:R.clientY,fired:!1};I.timer=window.setTimeout(()=>{I.fired=!0,E(!0)},mw),S.current=I}function q(R){const I=S.current;!I||I.fired||Math.hypot(R.clientX-I.x,R.clientY-I.y)>gw&&k()}function Q(){S.current&&!S.current.fired&&k()}function z(R){var G;if((G=S.current)!=null&&G.fired){S.current=null,R.preventDefault();return}if(n)return;const I=c[0];I&&r(I.id)}function H(R){o&&(R.preventDefault(),!n&&E())}function L(R){if(n||!o)return;(R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="Enter"&&R.shiftKey)&&(R.preventDefault(),E())}b.useLayoutEffect(()=>{if(!u)return;const R=j.current,I=_.current;if(!R||!I)return;const G=R.getBoundingClientRect(),se=I.getBoundingClientRect(),je=8,we=Math.max(je,Math.min(G.right-se.width,window.innerWidth-se.width-je));let Ne=G.top-se.height-8;Ne<je&&(Ne=Math.min(G.bottom+8,window.innerHeight-se.height-je)),v({left:we,top:Ne})},[u]),b.useLayoutEffect(()=>{var R;u&&((R=_.current)==null||R.focus())},[u]),b.useLayoutEffect(()=>{if(!u)return;function R(I){var se,je;const G=I.target;!((se=_.current)!=null&&se.contains(G))&&!((je=j.current)!=null&&je.contains(G))&&A(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[u]);function U(R){A(!1),r(R.id)}function V(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),A(!0);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();const I=R.key==="ArrowDown"?1:-1;g(G=>(G+I+c.length)%c.length);return}if(R.key==="Enter"||R.key===" "){R.preventDefault();const I=c[p];I&&U(I);return}R.key==="Tab"&&A(!1)}return i.jsxs("div",{className:"newsession",role:"group","aria-label":"Создать сессию",children:[i.jsx("button",{ref:j,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?u:void 0,onClick:z,onContextMenu:H,onPointerDown:D,onPointerMove:q,onPointerUp:Q,onPointerCancel:Q,onPointerLeave:Q,onKeyDown:L,children:"+ Сессия"}),o&&i.jsx("button",{type:"button",className:"btn btn--primary newsession__choose","aria-label":"Выбрать агента","aria-haspopup":"menu","aria-expanded":u,disabled:n,onClick:()=>u?A(!0):E(),children:i.jsx(bw,{})}),u&&o&&sy.createPortal(i.jsx("div",{ref:_,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:V,children:c.map((R,I)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(I===p?" is-cursor":""),onMouseEnter:()=>g(I),onClick:()=>U(R),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${R.id}`,"aria-hidden":"true",children:R.id==="codex"?i.jsx("span",{className:"codex-mark",children:"C"}):R.id==="antigravity"?i.jsx(Kp,{className:"newsession__mark-logo"}):i.jsx(_w,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:R.label}),i.jsx("span",{className:"newsession__hint",children:R.hint})]})]},R.id))}),document.body)]})}function bw(){return i.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function _w(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const ry="ccv:sidebar.collapsed",cy="ccv:sidebar.mode",oy="ccv:sidebar.foldersCollapsed",yw=500,sp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function vw({open:n,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:u,sessionFolders:h,pinnedFolders:p,sessions:g,archived:x,pinned:v,live:j,listOrder:_,liveSessionsFirst:S,onReorder:k,activeWorkspaceId:E,activeSessionId:A,onSelectWorkspace:D,onSelectSession:q,onRenameSession:Q,onStopSession:z,onPinSessions:H,onSelectPinned:L,onCloseWorkspaces:U,onRestoreWorkspaces:V,onArchiveSessions:R,onUnarchiveSessions:I,onCreateFolder:G,onRenameFolder:se,onSetFolderColor:je,onDeleteFolder:we,onAssignToFolder:Ne,onOpenWorkspace:Z,onNewSession:$,enabledProviders:ne,onOpenExtensions:me,account:ke,onOpenAccount:T,relay:K,onOpenRelay:de,onOpenSettings:_e,themeMode:Me,onCycleTheme:ze,navigation:Ve,dashboard:re=!1,onAllProjects:Ye,onCompareSession:pe}){var zn;const[Ge,dt]=b.useState(null),[nt,bt]=b.useState(null),[Xe,Ct]=b.useState(null);function ee(N){return(Xe==null?void 0:Xe.folderId)===N.id?Xe.color??void 0:N.color}function Ze(N){const ue=N&&ee(N);return ue?{"--folder-color":ue}:void 0}function st(N){return N?i.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const Be=b.useRef(void 0),[Fe,De]=b.useState(null),[ut,Ce]=b.useState(""),[kt,Ft]=b.useState(zw),[Ht,nn]=b.useState(Iw),[fn,_n]=b.useState(Uw);function wn(N){_n(N),Ce("");try{localStorage.setItem(cy,N)}catch{}}const St=ut.trim().toLowerCase(),ft=St!=="",$t=b.useMemo(()=>zd(c,_==null?void 0:_.workspaces,N=>N.id,"bottom"),[c,_]),Cn=b.useMemo(()=>{const N=zd(g,E?_==null?void 0:_.sessions[E]:void 0,yl,"top");return S?zb(N):N},[g,_,E,S]),At=b.useMemo(()=>{const N=zd(v,_==null?void 0:_.pinned,yl,"bottom");return S?zb(N):N},[v,_,S]),hs=b.useMemo(()=>zd(j,_==null?void 0:_.live,yl,"bottom"),[j,_]),ie=b.useMemo(()=>ft?$t.filter(N=>N.name.toLowerCase().includes(St)||N.path.toLowerCase().includes(St)):$t,[$t,St,ft]),ye=b.useMemo(()=>ft?o.filter(N=>N.name.toLowerCase().includes(St)||N.path.toLowerCase().includes(St)):o,[o,St,ft]),He=b.useMemo(()=>ft?Cn.filter(N=>(N.title??"").toLowerCase().includes(St)):Cn,[Cn,St,ft]),lt=b.useMemo(()=>ft?x.filter(N=>(N.title??"").toLowerCase().includes(St)):x,[x,St,ft]),Je=N=>{var ue;return((ue=c.find(Oe=>Oe.id===N))==null?void 0:ue.name)??"—"},sn=N=>{var ue;return(ue=c.find(Oe=>Oe.id===N))==null?void 0:ue.path},F=b.useMemo(()=>ft?At.filter(N=>(N.title??"").toLowerCase().includes(St)||Je(N.workspaceId).toLowerCase().includes(St)):At,[At,c,St,ft]),he=b.useMemo(()=>ft?hs.filter(N=>(N.title??"").toLowerCase().includes(St)||Je(N.workspaceId).toLowerCase().includes(St)):hs,[hs,c,St,ft]),Se=!ft;function Ie(N){Ft(ue=>{const Oe=ue.includes(N)?ue.filter(at=>at!==N):[...ue,N];try{localStorage.setItem(ry,JSON.stringify(Oe))}catch{}return Oe})}const gt=N=>!kt.includes(N);function ps(N){nn(ue=>{const Oe=ue.includes(N)?ue.filter(at=>at!==N):[...ue,N];try{localStorage.setItem(oy,JSON.stringify(Oe))}catch{}return Oe})}const Us=N=>!Ht.includes(N),Ws=b.useMemo(()=>nu(ie,u),[ie,u]),As=b.useMemo(()=>nu(ye,u),[ye,u]),Rs=b.useMemo(()=>nu(He,h),[He,h]),Ms=b.useMemo(()=>nu(lt,h),[lt,h]),Jn=b.useMemo(()=>nu(F,p,N=>N.pinnedFolderId),[F,p]),ji=b.useMemo(()=>({groups:[],ungrouped:he}),[he]),ms=((_==null?void 0:_.workspaces.length)??0)>0,gs=E?(((zn=_==null?void 0:_.sessions[E])==null?void 0:zn.length)??0)>0:!1,hn=((_==null?void 0:_.pinned.length)??0)>0,it=((_==null?void 0:_.live.length)??0)>0,Nn=Ud({enabled:Se,scope:"workspaces",itemKey:N=>N.id,groups:Ws.groups,ungrouped:Ws.ungrouped,onReorder:k}),el=Ud({enabled:Se,scope:"sessions",workspaceId:E??void 0,itemKey:yl,groups:Rs.groups,ungrouped:Rs.ungrouped,onReorder:k}),Nl=Ud({enabled:Se,scope:"pinned",itemKey:yl,groups:Jn.groups,ungrouped:Jn.ungrouped,onReorder:k}),tl=Ud({enabled:Se,scope:"live",itemKey:yl,groups:ji.groups,ungrouped:ji.ungrouped,onReorder:k});b.useEffect(()=>{var Oe;if(!Xe)return;const ue=(Oe=[...Jn.groups,...Ws.groups,...As.groups,...Rs.groups,...Ms.groups].find(at=>at.folder.id===Xe.folderId))==null?void 0:Oe.folder;ue&&ue.color===(Xe.color??void 0)&&Ct(null)},[Xe,Jn,Ws,As,Rs,Ms]),b.useEffect(()=>()=>window.clearTimeout(Be.current),[]);const Hs=ip(ie),Ln=ip(ye),xs=ip(He),[Yt,Jt]=b.useState(null),[ln,pn]=b.useState(null),[et,Pn]=b.useState(null),[is,as]=b.useState(null),[Dt,Xl]=b.useState(null),Vt=b.useRef(null);function bs(N,ue){const Oe=N.touches[0];if(!Oe)return;const at={timer:0,x:Oe.clientX,y:Oe.clientY,el:N.currentTarget,fired:!1};at.timer=window.setTimeout(()=>{at.fired=!0,ue(at.x,at.y,at.el)},yw),Vt.current=at}function Wn(N){const ue=Vt.current,Oe=N.touches[0];!ue||!Oe||Math.hypot(Oe.clientX-ue.x,Oe.clientY-ue.y)>10&&(window.clearTimeout(ue.timer),Vt.current=null)}function an(N){const ue=Vt.current;ue&&(window.clearTimeout(ue.timer),ue.fired&&N.preventDefault())}function kn(){var N;return(N=Vt.current)!=null&&N.fired?(Vt.current=null,!0):!1}function Vn(){const N=Yt==null?void 0:Yt.opener;Jt(null),N!=null&&N.isConnected&&N.focus()}function Pt(){const N=ln==null?void 0:ln.opener;pn(null),N!=null&&N.isConnected&&N.focus()}function kl(){const N=et==null?void 0:et.opener;Pn(null),N!=null&&N.isConnected&&N.focus()}function _s(){const N=is==null?void 0:is.opener;as(null),N!=null&&N.isConnected&&N.focus()}function rs(){const N=Dt==null?void 0:Dt.opener;Xl(null),N!=null&&N.isConnected&&N.focus()}function yn(N){return{onContextMenu:ue=>{ue.preventDefault(),Jt({x:ue.clientX,y:ue.clientY,opener:ue.currentTarget,ids:Hs.targetsFor(N)})},onTouchStart:ue=>bs(ue,(Oe,at,In)=>Jt({x:Oe,y:at,opener:In,ids:Hs.targetsFor(N)})),onTouchMove:Wn,onTouchEnd:an,onTouchCancel:an}}function Sl(N){return{onContextMenu:ue=>{ue.preventDefault(),pn({x:ue.clientX,y:ue.clientY,opener:ue.currentTarget,ids:Ln.targetsFor(N)})},onTouchStart:ue=>bs(ue,(Oe,at,In)=>pn({x:Oe,y:at,opener:In,ids:Ln.targetsFor(N)})),onTouchMove:Wn,onTouchEnd:an,onTouchCancel:an}}function Ql(N){return{onContextMenu:ue=>{ue.preventDefault(),Pn({x:ue.clientX,y:ue.clientY,opener:ue.currentTarget,ids:xs.targetsFor(N)})},onTouchStart:ue=>bs(ue,(Oe,at,In)=>Pn({x:Oe,y:at,opener:In,ids:xs.targetsFor(N)})),onTouchMove:Wn,onTouchEnd:an,onTouchCancel:an}}function An(N){return{onContextMenu:ue=>{ue.preventDefault(),as({x:ue.clientX,y:ue.clientY,opener:ue.currentTarget,ids:[N.id]})},onTouchStart:ue=>bs(ue,(Oe,at,In)=>as({x:Oe,y:at,opener:In,ids:[N.id]})),onTouchMove:Wn,onTouchEnd:an,onTouchCancel:an}}function wi(N){return{onContextMenu:ue=>{ue.preventDefault(),Xl({x:ue.clientX,y:ue.clientY,opener:ue.currentTarget,ids:[N.id]})},onTouchStart:ue=>bs(ue,(Oe,at,In)=>Xl({x:Oe,y:at,opener:In,ids:[N.id]})),onTouchMove:Wn,onTouchEnd:an,onTouchCancel:an}}const nl=g.filter(N=>N.state!=="closed").length,ys=Yt?ie.find(N=>N.id===Yt.ids[0]):void 0,rn=Yt?[{id:"close",label:Yt.ids.length>1?`Закрыть проекты (${Yt.ids.length})`:"Закрыть проект",onSelect:()=>{U(Yt.ids),Hs.clear()}},...su({folders:u,ids:Yt.ids,hasFolder:(ys==null?void 0:ys.folderId)!=null,assign:(N,ue)=>Ne("workspace",N,ue),onClear:()=>Hs.clear(),onNewFolder:()=>De("workspace")}),...Yt.ids.length===1&&Se?Nn.menuItems(Yt.ids[0],ms):[]]:[],ve=Yt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(E&&Yt.ids.includes(E)&&nl>0?` в нём сейчас незавершённых сессий: ${nl} — при закрытии они остановятся на хосте.`:""):void 0,C=ln?ye.find(N=>N.id===ln.ids[0]):void 0,J=ln?[{id:"restore",label:ln.ids.length>1?`Вернуть проекты (${ln.ids.length})`:"Вернуть проект",onSelect:()=>{V(ln.ids),Ln.clear()}},...su({folders:u,ids:ln.ids,hasFolder:(C==null?void 0:C.folderId)!=null,assign:(N,ue)=>Ne("workspace",N,ue),onClear:()=>Ln.clear(),onNewFolder:()=>De("workspace")})]:[],xe=ln?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Ee=et?He.find(N=>N.id===et.ids[0]):void 0,qe=(Ee==null?void 0:Ee.pinned)!==!0,Qe=et?[...et.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>dt(et.ids[0])}]:[],{id:"pin",label:qe?et.ids.length>1?`Закрепить (${et.ids.length})`:"Закрепить":et.ids.length>1?`Открепить (${et.ids.length})`:"Открепить",onSelect:()=>{Ee&&H(Ee.workspaceId,et.ids,qe),xs.clear()}},{id:"archive",label:et.ids.length>1?`Убрать в архив (${et.ids.length})`:"Убрать в архив",onSelect:()=>{R(E,et.ids),xs.clear()}},...su({folders:h,ids:et.ids,hasFolder:(Ee==null?void 0:Ee.folderId)!=null,assign:(N,ue)=>Ne("session",N,ue,E),onClear:()=>xs.clear(),onNewFolder:()=>De("session")}),...et.ids.length===1&&Se&&Ee?el.menuItems(yl(Ee),gs):[]]:[],Xt=et?sp:void 0,_t=is?F.find(N=>N.id===is.ids[0]):void 0,vn=is?[{id:"rename",label:"Переименовать",onSelect:()=>dt(is.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{_t&&H(_t.workspaceId,[_t.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{_t&&R(_t.workspaceId,[_t.id])}},..._t&&_t.workspaceId===E?su({folders:h,ids:[_t.id],hasFolder:_t.folderId!=null,assign:(N,ue)=>Ne("session",N,ue,_t.workspaceId),onClear:()=>{},onNewFolder:()=>De("session")}):[],...kw(_t?su({folders:p,ids:[_t.id],hasFolder:_t.pinnedFolderId!=null,assign:(N,ue)=>Ne("pinned",N,ue),onClear:()=>{},onNewFolder:()=>De("pinned")}):[]),...Se&&_t?Nl.menuItems(yl(_t),hn):[]]:[],ht=Dt?he.find(N=>N.id===Dt.ids[0]):void 0,Rn=Dt?[{id:"stop",label:"Остановить",onSelect:()=>{ht&&z(ht)}},{id:"rename",label:"Переименовать",onSelect:()=>dt(Dt.ids[0])},{id:"pin",label:(ht==null?void 0:ht.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{ht&&H(ht.workspaceId,[ht.id],ht.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ht&&R(ht.workspaceId,[ht.id])}},...Se&&ht?tl.menuItems(yl(ht),it):[]]:[];function mn(N,ue){return i.jsxs("div",{"data-row-key":N.id,className:Mc(N.id===E,Hs.selected.includes(N.id),!1,!!ue)+Nn.dropClass(N.id),style:Ze(ue),...yn(N),children:[st(ue),Se&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...Nn.gripHandlers(N.id),children:i.jsx(Hd,{})}),i.jsxs("button",{className:"row__main",onClick:Oe=>{kn()||Hs.click(Oe,N,()=>D(N.id))},onKeyDown:Oe=>Nn.onKeyDown(N.id,Oe),children:[i.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",title:N.path,children:N.path})]})]},N.id)}function Bs(N,ue){return i.jsxs("div",{className:Mc(N.id===E,Ln.selected.includes(N.id),!1,!!ue),style:Ze(ue),...Sl(N),children:[st(ue),i.jsxs("button",{className:"row__main",onClick:Oe=>{kn()||Ln.click(Oe,N,()=>D(N.id))},children:[i.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:Xw(N)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>V([N.id]),children:"Вернуть"})]},N.id)}function gn(N,ue){const Oe=yl(N);return i.jsxs("div",{"data-row-key":Oe,className:Mc(N.id===A,xs.selected.includes(N.id),N.provider==="antigravity",!!ue)+el.dropClass(Oe),style:Ze(ue),...Ge===N.id?{}:Ql(N),children:[st(ue),Ge===N.id?i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:N.title??"",onCommit:at=>{Q(N,at),dt(null)},onCancel:()=>dt(null)})}):i.jsxs(i.Fragment,{children:[Se&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...el.gripHandlers(Oe),children:i.jsx(Hd,{})}),i.jsxs("button",{className:"row__main",onClick:at=>{kn()||xs.click(at,N,()=>q(N))},onKeyDown:at=>el.onKeyDown(Oe,at),children:[i.jsx(Bd,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:Je(N.workspaceId),projectPath:sn(N.workspaceId)}),i.jsx(ap,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),re&&pe&&i.jsx("button",{className:"hub-icon-btn",title:"Открыть вторым разговором","aria-label":`Открыть рядом: ${N.title??"Без названия"}`,onClick:()=>pe(N),children:"◧"}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{kn()||dt(N.id)},children:"✎"})]})]},N.id)}function qs(N,ue){return i.jsxs("div",{className:Mc(N.id===A,!1,N.provider==="antigravity",!!ue),style:Ze(ue),children:[st(ue),i.jsxs("button",{className:"row__main",onClick:()=>q(N),children:[i.jsx(Bd,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:Je(N.workspaceId),projectPath:sn(N.workspaceId)}),i.jsx("span",{className:"row__meta",children:Vw(N)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>I([N.id]),children:"Вернуть"})]},N.id)}function Gs(N,ue){const Oe=yl(N);return i.jsxs("div",{"data-row-key":Oe,className:Mc(N.id===A,!1,N.provider==="antigravity",!!ue)+Nl.dropClass(Oe),style:Ze(ue),...Ge===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...An(N)},children:[st(ue),Ge===N.id?i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:N.title??"",onCommit:at=>{Q(N,at),dt(null)},onCancel:()=>dt(null)})}):i.jsxs(i.Fragment,{children:[Se&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Nl.gripHandlers(Oe),children:i.jsx(Hd,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{kn()||L(N)},onKeyDown:at=>Nl.onKeyDown(Oe,at),children:[i.jsx(Bd,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:Je(N.workspaceId),projectPath:sn(N.workspaceId)}),i.jsx(ap,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]})]})]},N.id)}function Kl(N){const ue=yl(N);return i.jsx("div",{"data-row-key":ue,className:Mc(N.id===A,!1,N.provider==="antigravity")+tl.dropClass(ue),...Ge===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...wi(N)},children:Ge===N.id?i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:N.title??"",onCommit:Oe=>{Q(N,Oe),dt(null)},onCancel:()=>dt(null)})}):i.jsxs(i.Fragment,{children:[Se&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...tl.gripHandlers(ue),children:i.jsx(Hd,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{kn()||L(N)},onKeyDown:Oe=>tl.onKeyDown(ue,Oe),children:[i.jsx(Bd,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:Je(N.workspaceId),projectPath:sn(N.workspaceId)}),i.jsx(ap,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Oe=>{Oe.stopPropagation(),!kn()&&z(N)},children:i.jsx(Mw,{})})]})},N.id)}function vs(N,ue){return i.jsx(Aw,{folder:N,count:ue,open:Us(N.id),renaming:nt===N.id,onToggle:()=>ps(N.id),onStartRename:()=>bt(N.id),onCommitRename:Oe=>{se(N.id,Oe),bt(null)},onCancelRename:()=>bt(null),onDelete:()=>we(N.id),color:ee(N),onPreviewColor:Oe=>{window.clearTimeout(Be.current),Ct({folderId:N.id,color:Oe})},onCommitColor:Oe=>{Ct({folderId:N.id,color:Oe}),je(N.id,Oe),window.clearTimeout(Be.current),Be.current=window.setTimeout(()=>Ct(null),4e3)},onResetColor:()=>{window.clearTimeout(Be.current),Ct(null),je(N.id,null)}},N.id)}const js=re?"section":"aside",Mn=c.find(N=>N.id===E)??o.find(N=>N.id===E);return i.jsxs(js,{className:re?"sidebar project-dashboard":n?"sidebar sidebar--open":"sidebar","aria-label":re?"Обзор проекта":"Навигация",children:[re?i.jsxs("header",{className:"project-dashboard__head",children:[i.jsx("button",{className:"project-dashboard__back",onClick:Ye,children:"← Все проекты"}),i.jsxs("div",{className:"project-dashboard__title",children:[i.jsxs("div",{children:[i.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),i.jsx("h1",{children:Mn==null?void 0:Mn.name})]}),i.jsx(Ib,{disabled:!l||!E,providers:ne,onStart:$})]}),i.jsx("p",{className:"project-dashboard__path",title:Mn==null?void 0:Mn.path,children:Mn==null?void 0:Mn.path}),i.jsx("p",{className:"hub-description",children:"Разговоры и история проекта. Выберите сессию, чтобы продолжить работу."}),i.jsxs("div",{className:"project-dashboard__stats",children:[i.jsxs("span",{children:[i.jsx("strong",{children:g.length})," сессий"]}),i.jsxs("span",{children:[i.jsx("strong",{children:g.filter(N=>N.state!=="closed").length})," запущено"]}),i.jsxs("span",{children:[i.jsx("strong",{children:g.filter(N=>N.state==="waiting_permission").length})," ждут ответа"]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:"brand__symbol","aria-hidden":"true"}),i.jsxs("span",{className:"brand",children:["ЭФИР",i.jsx("span",{className:"brand__caption",children:"пространство возможностей"})]}),i.jsx("button",{className:"theme-btn",title:`Тема: ${Hb[Me]}`,"aria-label":`Тема: ${Hb[Me]}. Переключить`,onClick:ze,children:i.jsx(Hw,{mode:Me})})]}),i.jsxs("div",{className:"sidebar__connection",role:"status",children:[i.jsx("span",{className:l?"dot dot--on":"dot"}),i.jsx("span",{children:l?"Пространство подключено":r})]}),Ve,i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":fn==="default",className:fn==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>wn("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":fn==="pinned",className:fn==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>wn("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":fn==="live",className:fn==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>wn("live"),children:[i.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&i.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(Ow,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:ut,spellCheck:!1,placeholder:re||fn!=="default"?"Найти сессию…":"Найти проект…","aria-label":re||fn!=="default"?"Поиск по сессиям":"Поиск по проектам",onChange:N=>Ce(N.target.value),onKeyDown:N=>{N.stopPropagation(),N.key==="Escape"&&(N.preventDefault(),ut?Ce(""):N.currentTarget.blur())}}),ut&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Ce(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:re?i.jsx(i.Fragment,{children:E&&i.jsxs(i.Fragment,{children:[i.jsx(Dc,{title:"Сессии",count:He.length,open:gt("sessions"),onToggle:()=>Ie("sessions"),action:{label:"Новая папка сессий",onClick:()=>{De("session"),gt("sessions")||Ie("sessions")}}}),gt("sessions")&&i.jsxs(i.Fragment,{children:[Fe==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:"",placeholder:"Название папки",onCommit:N=>{G("session",N,E),De(null)},onCancel:()=>De(null)})})}),He.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ft?"Ничего не найдено":"Пока ни одной"})}),Rs.groups.map(N=>i.jsxs(b.Fragment,{children:[vs(N.folder,N.items.length),Us(N.folder.id)&&N.items.map(ue=>gn(ue,N.folder))]},N.folder.id)),Rs.ungrouped.map(N=>gn(N))]}),x.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Dc,{title:"Архив",count:lt.length,open:gt("archive"),onToggle:()=>Ie("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),gt("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),lt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ft?"Ничего не найдено":"Пока пусто"})}),Ms.groups.map(N=>i.jsxs(b.Fragment,{children:[vs(N.folder,N.items.length),Us(N.folder.id)&&N.items.map(ue=>qs(ue,N.folder))]},N.folder.id)),Ms.ungrouped.map(N=>qs(N))]})]})]})}):fn==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(Dc,{title:"Закреплённые",count:F.length,open:gt("pinned"),onToggle:()=>Ie("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{De("pinned"),gt("pinned")||Ie("pinned")}}}),gt("pinned")&&i.jsxs(i.Fragment,{children:[Fe==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:"",placeholder:"Название папки",onCommit:N=>{G("pinned",N),De(null)},onCancel:()=>De(null)})})}),F.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ft?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Jn.groups.map(N=>i.jsxs(b.Fragment,{children:[vs(N.folder,N.items.length),Us(N.folder.id)&&N.items.map(ue=>Gs(ue,N.folder))]},N.folder.id)),Jn.ungrouped.map(N=>Gs(N))]})]}):fn==="live"?i.jsxs(i.Fragment,{children:[i.jsx(Dc,{title:"Запущенные",count:he.length,open:gt("live"),onToggle:()=>Ie("live")}),gt("live")&&i.jsxs(i.Fragment,{children:[he.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ft?"Ничего не найдено":"Нет запущенных сессий"})}),he.map(N=>Kl(N))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Dc,{title:"Проекты",count:ie.length,open:gt("workspaces"),onToggle:()=>Ie("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{De("workspace"),gt("workspaces")||Ie("workspaces")}}}),gt("workspaces")&&i.jsxs(i.Fragment,{children:[Fe==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:"",placeholder:"Название папки",onCommit:N=>{G("workspace",N),De(null)},onCancel:()=>De(null)})})}),ie.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ft?"Ничего не найдено":"Пока ни одного"})}),Ws.groups.map(N=>i.jsxs(b.Fragment,{children:[vs(N.folder,N.items.length),Us(N.folder.id)&&N.items.map(ue=>mn(ue,N.folder))]},N.folder.id)),Ws.ungrouped.map(N=>mn(N))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Dc,{title:"Архив проектов",count:ye.length,open:gt("workspacesArchive"),onToggle:()=>Ie("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),gt("workspacesArchive")&&i.jsxs(i.Fragment,{children:[ye.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ft?"Ничего не найдено":"Пока пусто"})}),As.groups.map(N=>i.jsxs(b.Fragment,{children:[vs(N.folder,N.items.length),Us(N.folder.id)&&N.items.map(ue=>Bs(ue,N.folder))]},N.folder.id)),As.ungrouped.map(N=>Bs(N))]})]})]})}),!re&&i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:T,children:[i.jsx("span",{className:ke!=null&&ke.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:ke===null?"Аккаунт":ke.loggedIn?ke.email||"Вход выполнен":"Войти в аккаунт"}),(ke==null?void 0:ke.plan)&&i.jsx("span",{className:"chip",children:ke.plan})]}),de&&i.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:de,children:[i.jsx("span",{className:K!=null&&K.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:K===null?"Удалённый доступ":K.paired?K.connected?K.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(K==null?void 0:K.connected)&&K.clients>0&&i.jsx("span",{className:"chip",children:K.clients})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",disabled:!me,title:"MCP-серверы и плагины",onClick:()=>me==null?void 0:me(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:_e,children:"Настройки"})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",onClick:Z,children:"+ Проект"}),i.jsx(Ib,{disabled:!l||!E,providers:ne,onStart:$})]})]}),Yt&&i.jsx(qa,{x:Yt.x,y:Yt.y,items:rn,note:ve,onClose:Vn}),ln&&i.jsx(qa,{x:ln.x,y:ln.y,items:J,note:xe,onClose:Pt}),et&&i.jsx(qa,{x:et.x,y:et.y,items:Qe,note:Xt,onClose:kl}),is&&i.jsx(qa,{x:is.x,y:is.y,items:vn,note:sp,onClose:_s}),Dt&&i.jsx(qa,{x:Dt.x,y:Dt.y,items:Rn,note:sp,onClose:rs})]})}function Mc(n,l,r,c){const o=["row"];return c&&o.push("row--foldered"),n&&o.push("row--active"),l&&o.push("row--selected"),r&&o.push("row--antigravity"),o.join(" ")}function nu(n,l,r=c=>c.folderId){const c=new Map(l.map(p=>[p.id,p])),o=new Map,u=[];for(const p of n){const g=r(p),x=g?c.get(g):void 0;if(!x){u.push(p);continue}const v=o.get(x.id);v?v.push(p):o.set(x.id,[p])}return{groups:[...o.entries()].map(([p,g])=>({folder:c.get(p),items:g})).sort((p,g)=>p.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:u}}function jw(n,l,r){return[...n.flatMap(c=>c.items.map(r)),...l.map(r)]}const ww="\0ungrouped";function Nw(n,l,r){const c=new Map;for(const o of n)for(const u of o.items)c.set(r(u),o.folder.id);for(const o of l)c.set(r(o),ww);return c}function lp(n,l,r,c,o){const u=[...l.map(p=>p.items),r].find(p=>p.some(g=>c(g)===n));if(!u)return null;const h=u.findIndex(p=>c(p)===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 Ud(n){const[l,r]=b.useState(null),[c,o]=b.useState(null),u=b.useMemo(()=>jw(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),h=b.useMemo(()=>Nw(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]);function p(){r(null),o(null)}function g(D,q){n.enabled&&(q.preventDefault(),q.currentTarget.setPointerCapture(q.pointerId),r(D),o(null))}function x(D,q){var U;if(!l)return;const Q=(U=document.elementFromPoint(D,q))==null?void 0:U.closest("[data-row-key]"),z=Q==null?void 0:Q.dataset.rowKey;if(!z||z===l||h.get(z)!==h.get(l)){o(null);return}const H=Q.getBoundingClientRect(),L=q-H.top<H.height/2?"before":"after";o(V=>(V==null?void 0:V.key)===z&&V.position===L?V:{key:z,position:L})}function v(D){x(D.clientX,D.clientY)}function j(){if(l&&c){const D=Id(u,l,c.key,c.position);D&&n.onReorder(n.scope,D,n.workspaceId)}p()}function _(D,q){if(!n.enabled)return;const Q=lp(D,n.groups,n.ungrouped,n.itemKey,q);if(!Q)return;const z=Id(u,D,Q.target,Q.position);z&&n.onReorder(n.scope,z,n.workspaceId)}function S(D,q){const Q=lp(D,n.groups,n.ungrouped,n.itemKey,"up"),z=lp(D,n.groups,n.ungrouped,n.itemKey,"down"),H=[{id:"move-up",label:"Переместить выше",disabled:!Q,onSelect:()=>{if(!Q)return;const L=Id(u,D,Q.target,Q.position);L&&n.onReorder(n.scope,L,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!z,onSelect:()=>{if(!z)return;const L=Id(u,D,z.target,z.position);L&&n.onReorder(n.scope,L,n.workspaceId)}}];return q&&H.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),H}function k(D){return l===D?" row--dragging":(c==null?void 0:c.key)===D?c.position==="before"?" row--drop-before":" row--drop-after":""}function E(D){return{onPointerDown:q=>g(D,q),onPointerMove:v,onPointerUp:j,onPointerCancel:p}}function A(D,q){!q.altKey||q.key!=="ArrowUp"&&q.key!=="ArrowDown"||(q.preventDefault(),_(D,q.key==="ArrowUp"?"up":"down"))}return{dragging:l!==null,dropClass:k,gripHandlers:E,onKeyDown:A,menuItems:S}}function su(n){return[...[...n.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,r.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(r=>n.assign(r,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function kw(n){return n.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function ip(n){const[l,r]=b.useState([]),c=b.useRef(null);function o(){r([]),c.current=null}function u(p,g,x){if(p.ctrlKey||p.metaKey){r(v=>v.includes(g.id)?v.filter(j=>j!==g.id):[...v,g.id]),c.current=g.id;return}if(p.shiftKey&&c.current){const v=n.findIndex(_=>_.id===c.current),j=n.findIndex(_=>_.id===g.id);if(v!==-1&&j!==-1){const[_,S]=v<j?[v,j]:[j,v];r(n.slice(_,S+1).map(k=>k.id));return}}o(),c.current=g.id,x()}function h(p){return l.includes(p.id)?l:(r([p.id]),c.current=p.id,[p.id])}return{selected:l,click:u,targetsFor:h,clear:o}}const Sw={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},Ew={width:22,height:22,borderRadius:6};function Dc({title:n,count:l,open:r,onToggle:c,hint:o,action:u}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:Sw,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(uy,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:n}),i.jsx("span",{className:"sidebar__count",children:l})]}),u&&i.jsx("button",{className:"theme-btn",style:Ew,title:u.label,"aria-label":u.label,onClick:u.onClick,children:i.jsx(Lw,{})})]})}const Ub={paddingLeft:22},Tw={display:"flex",alignItems:"center",gap:6,width:"100%"},Cw={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function Aw({folder:n,count:l,open:r,renaming:c,onToggle:o,onStartRename:u,onCommitRename:h,onCancelRename:p,onDelete:g,color:x,onPreviewColor:v,onCommitColor:j,onResetColor:_}){const S=b.useRef(null),k=b.useRef(j);return k.current=j,b.useEffect(()=>{const E=S.current;if(!E)return;const A=()=>k.current(E.value);return E.addEventListener("change",A),()=>E.removeEventListener("change",A)},[c]),c?i.jsx("div",{className:"row",style:Ub,children:i.jsx("div",{className:"row__main",children:i.jsx(_i,{value:n.name,placeholder:"Название папки",onCommit:h,onCancel:p})})}):i.jsxs("div",{className:"row",style:Ub,children:[i.jsxs("button",{className:"row__main",style:Tw,"aria-expanded":r,title:r?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:o,children:[i.jsx(uy,{open:r}),i.jsx("span",{style:Cw,children:n.name}),i.jsx("span",{className:"sidebar__count",children:l})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${n.name}»`,onClick:u,children:"✎"}),i.jsxs("label",{className:x?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[i.jsx("span",{className:"row__swatch-dot",style:x?{background:x}:void 0}),i.jsx("input",{ref:S,type:"color",value:x??Rw(),"aria-label":`Цвет папки «${n.name}»`,onChange:E=>v(E.target.value)})]}),n.color&&i.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${n.name}»`,onClick:_,children:"↺"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${n.name}»`,onClick:g,children:"✕"})]})}function Rw(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}function uy({open:n}){return i.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:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Hd(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function Mw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:i.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function Dw({className:n}){return i.jsxs("svg",{className:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),i.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),i.jsx("path",{d:"M8 12.2v1.4"})]})}function Ow(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Lw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function zw(){try{const n=localStorage.getItem(ry);if(n===null)return["archive","workspacesArchive"];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function Iw(){try{const n=localStorage.getItem(oy);if(n===null)return[];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function Uw(){try{const n=localStorage.getItem(cy);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Hb={system:"ритм системы",light:"свет",dark:"тьма"};function Hw({mode:n}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return n==="dark"?i.jsx("svg",{...l,children:i.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"?i.jsxs("svg",{...l,children:[i.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),i.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"})]}):i.jsxs("svg",{...l,children:[i.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),i.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Bw(n){const l=qw(n),r=(n.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${l} · ${ay(r)}`:l}function qw(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":Gw(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function Gw(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function $w(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":Yw(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function Yw(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function ap({session:n,tail:l}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${$w(n)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),Bw(n)]})," · ",l]})}function Bd({title:n,pinned:l,provider:r,projectName:c,projectPath:o}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[l&&i.jsx(Dw,{className:"row__pin"}),r==="codex"&&i.jsx("span",{className:"row__provider codex-mark",title:"Codex",children:"C"}),r==="antigravity"&&i.jsx(Kp,{className:"row__provider"}),n]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function Vw(n){const l=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${l}`:l}function Xw(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Bb=3,Qw=15e5;function dy(n,l){if(!l||typeof l!="object")return null;const r=l,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(n==="Write"){if(typeof r.content!="string")return null;const o=rp(r.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 r.old_string!="string"||typeof r.new_string!="string")return null;const o=Jw(Kw(rp(r.old_string),rp(r.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:r.replace_all===!0?"все вхождения":null}}return null}function rp(n){if(n==="")return[];const l=n.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function Kw(n,l){let r=0;for(;r<n.length&&r<l.length&&n[r]===l[r];)r++;let c=n.length,o=l.length;for(;c>r&&o>r&&n[c-1]===l[o-1];)c--,o--;const u=h=>({type:"ctx",text:h});return[...n.slice(0,r).map(u),...Zw(n.slice(r,c),l.slice(r,o)),...n.slice(c).map(u)]}function Zw(n,l){if(n.length===0&&l.length===0)return[];if(n.length===0)return l.map(v=>({type:"add",text:v}));if(l.length===0)return n.map(v=>({type:"del",text:v}));if((n.length+1)*(l.length+1)>Qw)return[...n.map(v=>({type:"del",text:v})),...l.map(v=>({type:"add",text:v}))];const r=n.length,c=l.length,o=c+1,u=new Uint32Array((r+1)*o),h=(v,j)=>u[v*o+j]??0;for(let v=r-1;v>=0;v--)for(let j=c-1;j>=0;j--)u[v*o+j]=n[v]===l[j]?h(v+1,j+1)+1:Math.max(h(v+1,j),h(v,j+1));const p=[];let g=0,x=0;for(;g<r&&x<c;){const v=n[g],j=l[x];v===j?(p.push({type:"ctx",text:v}),g++,x++):h(g+1,x)>=h(g,x+1)?(p.push({type:"del",text:v}),g++):(p.push({type:"add",text:j}),x++)}for(;g<r;)p.push({type:"del",text:n[g++]});for(;x<c;)p.push({type:"add",text:l[x++]});return Fw(p)}function Fw(n){const l=[];let r=[];function c(){l.push(...r.filter(o=>o.type==="del")),l.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of n)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function Jw(n){if(!n.some(u=>u.type!=="ctx"))return n;const l=n.map(()=>!1);n.forEach((u,h)=>{if(u.type!=="ctx")for(let p=Math.max(0,h-Bb);p<=Math.min(n.length-1,h+Bb);p++)l[p]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${Pw(c.length)} без изменений`}),c=[]}return n.forEach((u,h)=>{l[h]?(o(),r.push(u)):c.push(u)}),o(),r}function Pw(n){const l=n%100;if(l>=11&&l<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function vi(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const l=document.createElement("textarea");l.value=n,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function Ep(){try{return await navigator.clipboard.readText()}catch{return null}}const Zp=1600,Rr="Копировать",Bc="Скопировано";function Fc({text:n,hint:l,className:r}){const[c,o]=b.useState(!1);return b.useEffect(()=>{if(!c)return;const u=setTimeout(()=>o(!1),Zp);return()=>clearTimeout(u)},[c]),b.useEffect(()=>o(!1),[n]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?Bc:`${Rr} ${l}`,title:c?Bc:`${Rr} ${l}`,onClick:()=>{vi(n).then(u=>{u&&o(!0)})},children:c?Bc:Rr})}function Fp({diff:n}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:n.filePath,children:n.filePath}),i.jsxs("span",{className:"diff__stat",children:[n.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]})]}),n.note&&i.jsx("div",{className:"diff__note",children:n.note}),i.jsx("div",{className:"diff__body",children:n.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):n.rows.map((l,r)=>i.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function Jp(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 Ww({waiting:n,activity:l,responding:r=!1}){const[c]=b.useState(Date.now),[o,u]=b.useState(0);b.useEffect(()=>{const g=window.setInterval(()=>u(Math.floor((Date.now()-c)/1e3)),1e3);return()=>window.clearInterval(g)},[c]);const h=n?{title:"Нужен ваш ответ",detail:"Процесс приостановлен. Ответьте на вопрос или рассмотрите запрос разрешения, чтобы продолжить."}:l?Jp(l):r?{title:"Формирует ответ",detail:"Ответ появляется постепенно. Вы можете читать его уже сейчас."}:{title:"Работает над задачей",detail:"Обрабатывает ваш запрос. Новые действия и результаты появятся здесь."},p=o<60?`${o} с`:`${Math.floor(o/60)} мин ${o%60} с`;return i.jsxs("div",{className:n?"process process--waiting":"process","aria-busy":!n,children:[i.jsxs("div",{className:"process__visual","aria-hidden":"true",children:[i.jsx("span",{}),i.jsx("span",{}),i.jsx("i",{})]}),i.jsxs("div",{className:"process__content",children:[i.jsxs("div",{className:"process__heading",children:[i.jsx("span",{className:"process__eyebrow",children:n?"ОЖИДАНИЕ РЕШЕНИЯ":"ПРОЦЕСС В ДВИЖЕНИИ"}),i.jsx("span",{className:"process__time","aria-label":`С начала работы: ${p}`,children:p})]}),i.jsxs("div",{role:"status",className:"process__status",children:[i.jsx("strong",{children:h.title}),i.jsx("p",{children:h.detail})]}),l&&i.jsxs("span",{className:"process__activity",children:["Действие: ",l]}),i.jsxs("div",{className:"process__steps","aria-hidden":"true",children:[i.jsx("span",{className:"is-done",children:"Запрос принят"}),i.jsx("i",{}),i.jsx("span",{className:"is-current",children:n?"Ваше решение":"В работе"}),i.jsx("i",{}),i.jsx("span",{children:"Результат"})]})]})]})}function hf({items:n,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:u=!1,onLoadHistory:h,sessionId:p,onEditMessage:g,empty:x="Опишите задачу — ответы, действия и результаты появятся здесь.",welcome:v}){var L;const j=b.useRef(null),_=b.useRef(null),S=b.useRef(!1);S.current=!!v&&n.length===0&&c.length===0;const k=b.useRef(!0),E=b.useRef(null),A=b.useRef(null),D=b.useRef(!1);b.useEffect(()=>{k.current=!0,E.current=null,D.current=!1,A.current!==null&&(clearTimeout(A.current),A.current=null)},[p]),b.useEffect(()=>{const U=j.current,V=_.current;if(!U||!V)return;function R(se){!U||se===U.scrollTop||(D.current=!0,U.scrollTop=se)}function I(){if(!U)return;const se=E.current;if(se){const je=Gb(U,se.id);if(je){const we=je.getBoundingClientRect().top-U.getBoundingClientRect().top;R(U.scrollTop+(we-se.top))}A.current!==null&&clearTimeout(A.current),A.current=setTimeout(()=>{E.current=null},500);return}k.current&&R(S.current?0:U.scrollHeight)}const G=new ResizeObserver(I);return G.observe(V),()=>{G.disconnect(),A.current!==null&&clearTimeout(A.current)}},[]);function q(){const U=j.current;if(U){if(D.current){D.current=!1;return}k.current=U.scrollHeight-U.scrollTop-U.clientHeight<80}}function Q(){if(u)return;const U=j.current,V=c[0];if(U&&V){const R=Gb(U,V.id);R&&(E.current={id:V.id,top:R.getBoundingClientRect().top-U.getBoundingClientRect().top})}h==null||h()}let z=0;function H(U){return U.kind==="user"?z++:-1}return i.jsx("div",{className:"transcript",ref:j,onScroll:q,children:i.jsxs("div",{className:"stream",ref:_,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:Q,disabled:u,children:u?"Загружаем…":"Показать более раннее"}),c.map(U=>i.jsx(qb,{item:U,userIndex:H(U),onEditMessage:g},U.id)),c.length>0&&n.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&n.length===0&&(v??i.jsx("p",{className:"empty",children:x})),n.map(U=>i.jsx(qb,{item:U,userIndex:H(U),onEditMessage:g},U.id)),l&&i.jsx(Ww,{waiting:r,activity:(L=[...n].reverse().find(U=>U.kind==="tool"&&U.result===null))==null?void 0:L.name,responding:n.some(U=>U.kind==="assistant"&&U.streaming)},p)]})})}function qb({item:n,userIndex:l,onEditMessage:r}){switch(n.kind){case"user":return i.jsx(tN,{item:n,userIndex:l,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[i.jsx(nN,{text:n.text}),n.streaming&&i.jsx("span",{className:"caret"}),n.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(Fc,{text:n.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":n.id,children:n.text});case"tool":return i.jsx(lN,{item:n});case"result":return i.jsxs("div",{className:"result-line","data-item-id":n.id,children:[i.jsx("span",{children:n.isError?"✗ "+n.subtype:"✓ готово"}),i.jsxs("span",{children:[(n.durationMs/1e3).toFixed(1)," с"]}),n.costUsd!==null&&i.jsxs("span",{children:["$",n.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",Yb(n.inputTokens)," ↓",Yb(n.outputTokens)]})]});case"notice":return i.jsx("div",{className:n.tone==="error"?"notice notice--error":"notice","data-item-id":n.id,children:n.text})}}const eN=500;function tN({item:n,userIndex:l,onEditMessage:r}){const[c,o]=b.useState(null),[u,h]=b.useState(!1),[p,g]=b.useState(n.text),x=b.useRef(null),v=b.useRef(!1),j=of("(max-width: 860px)"),_=b.useRef(null);function S(V,R){o({x:V,y:R})}function k(V){V.preventDefault(),S(V.clientX,V.clientY)}function E(V){const R=V.touches[0];if(!R)return;const I={timer:0,x:R.clientX,y:R.clientY,fired:!1};I.timer=window.setTimeout(()=>{I.fired=!0,S(I.x,I.y)},eN),_.current=I}function A(V){const R=_.current,I=V.touches[0];!R||!I||Math.hypot(I.clientX-R.x,I.clientY-R.y)>10&&(window.clearTimeout(R.timer),_.current=null)}function D(V){const R=_.current;R&&(window.clearTimeout(R.timer),R.fired&&V.preventDefault())}function q(){g(n.text),h(!0)}function Q(){h(!1)}function z(){const V=p.trim();if(V===""&&!(n.images&&n.images.length>0))return;const R=r==null?void 0:r(l,V,n.images);if(R instanceof Promise){if(v.current)return;v.current=!0,R.then(I=>{v.current=!1,I&&h(!1)},()=>{v.current=!1});return}R!==!1&&h(!1)}b.useEffect(()=>{const V=x.current;!V||!u||(V.style.height="auto",V.style.height=`${V.scrollHeight}px`)},[p,u]),b.useEffect(()=>{if(!u)return;const V=x.current;V&&(V.focus(),V.setSelectionRange(V.value.length,V.value.length))},[u]);function H(V){if(V.key==="Escape"){V.preventDefault(),V.stopPropagation(),Q();return}V.key==="Enter"&&!V.shiftKey&&!j&&(V.preventDefault(),z())}const L=n.images&&n.images.length>0&&i.jsx("div",{className:"msg--user__images",children:n.images.map((V,R)=>i.jsx("img",{className:"msg--user__image",src:`data:${V.mediaType};base64,${V.data}`,alt:"Вложение"},R))});if(u){const V=p.trim()!==""||!!(n.images&&n.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[L,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:p,onChange:R=>g(R.target.value),onKeyDown:H,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:Q,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:z,disabled:!V,children:"Сохранить"})]})]})]})}const U=[{id:"copy",label:"Копировать",onSelect:()=>void vi(n.text)},...r?[{id:"edit",label:"Изменить",onSelect:q}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:E,onTouchMove:A,onTouchEnd:D,onTouchCancel:D,children:[L,n.text,c&&i.jsx(qa,{x:c.x,y:c.y,items:U,onClose:()=>o(null)})]})}function Gb(n,l){const r=n.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function nN({text:n}){const[l,r]=b.useState(""),c=b.useRef([]);b.useEffect(()=>{let u=!1;return ff(n).then(h=>{u||r(sN(h))}),()=>{u=!0}},[n]),b.useEffect(()=>{const u=c.current;return()=>u.forEach(h=>clearTimeout(h))},[]);function o(u){var g,x;const h=u.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const p=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";p!==""&&vi(p).then(v=>{if(!v)return;h.textContent=Bc,h.setAttribute("aria-label",Bc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Rr,h.setAttribute("aria-label",Tp),h.classList.remove("copybtn--done"))},Zp);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Tp=`${Rr} блок кода`;function sN(n){if(!n.includes("<pre"))return n;const l=new DOMParser().parseFromString(n,"text/html");for(const r of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Tp),o.title=Tp,o.textContent=Rr,c.append(o)}return l.body.innerHTML}function lN({item:n}){const[l,r]=b.useState(!1),c=n.result===null,o=dy(n.name,n.input),u=n.name==="AskUserQuestion"?rN(n.input):null;return i.jsxs("div",{className:"tool"+(c&&!n.awaitingPermission?" tool--running":"")+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[i.jsxs("button",{className:"tool__head","aria-expanded":l,onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__indicator","aria-hidden":"true",children:n.awaitingPermission?"Ⅱ":c?"◌":n.isError?"!":"✓"}),i.jsxs("span",{className:"tool__identity",children:[i.jsx("span",{className:"tool__name",children:Jp(n.name).title}),i.jsx("span",{className:"tool__technical",children:n.name})]}),i.jsx("span",{className:"tool__arg",children:u?aN(u):iN(n.input)}),i.jsx("span",{className:"tool__status",children:n.awaitingPermission?"Ваше решение":c?"Выполняется":n.isError?"Ошибка":"Готово"}),i.jsx("span",{className:"tool__chevron","aria-hidden":"true",children:l?"−":"+"})]}),l&&i.jsxs("div",{className:"tool__body",children:[u?i.jsx(cN,{questions:u,answers:n.answers}):o?i.jsx(Fp,{diff:o}):i.jsx($b,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!u||n.isError)&&i.jsx($b,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function $b({text:n,hint:l,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:n}),i.jsx(Fc,{text:n,hint:l,className:"codeblock__copy"})]})}function iN(n){if(!n||typeof n!="object")return"";const l=n;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=l[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function aN(n){var r;const l=n.map(c=>c.header).filter(c=>c.length>0);return l.length===n.length?l.join(" · "):((r=n[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function rN(n){if(typeof n!="object"||n===null)return null;const l=n.questions;if(!Array.isArray(l)||l.length===0)return null;const r=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:u,options:h,multiSelect:p}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:v,description:j,preview:_}=x;if(typeof v!="string"||typeof j!="string")return null;g.push({label:v,description:j,...typeof _=="string"?{preview:_}:{}})}r.push({question:o,header:typeof u=="string"?u:"",options:g,multiSelect:p===!0})}return r}function cN({questions:n,answers:l}){return i.jsx("div",{className:"tool__questions",children:n.map((r,c)=>i.jsxs("div",{className:"tool__question",children:[i.jsxs("div",{className:"tool__question-head",children:[r.header&&i.jsx("span",{className:"chip chip--accent",children:r.header}),i.jsx("span",{className:"tool__question-text",children:r.question})]}),i.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?i.jsx("span",{className:"tool__answer-value",children:l[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Yb(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}function oN({connected:n,workspaceName:l,hasSession:r,onOpenWorkspace:c,onNewSession:o,onOpenFiles:u,onOpenSettings:h}){return i.jsxs("section",{className:"welcome","aria-labelledby":"welcome-title",children:[i.jsxs("div",{className:"welcome__eyebrow",children:[i.jsx("span",{})," МЕСТО, ГДЕ ИДЕИ ОБРЕТАЮТ ФОРМУ"]}),i.jsxs("div",{className:"eclipse","aria-hidden":"true",children:[i.jsx("div",{className:"eclipse__halo"}),i.jsx("div",{className:"eclipse__orbit eclipse__orbit--outer",children:i.jsx("i",{})}),i.jsx("div",{className:"eclipse__orbit eclipse__orbit--inner",children:i.jsx("i",{})}),i.jsx("div",{className:"eclipse__body"}),i.jsx("span",{className:"eclipse__star eclipse__star--one"}),i.jsx("span",{className:"eclipse__star eclipse__star--two"}),i.jsx("span",{className:"eclipse__coordinate",children:"СВЕТ / ТЬМА"})]}),i.jsxs("h1",{id:"welcome-title",children:["От мысли",i.jsx("br",{}),"к ",i.jsx("span",{children:"возможностям."})]}),i.jsx("p",{className:"welcome__description",children:"Одно пространство для больших идей и повседневных задач. Исследуйте, создавайте, меняйте — в своём ритме."}),i.jsxs("div",{className:"welcome__context",children:[i.jsx("span",{className:n?"dot dot--on":"dot"}),l?i.jsxs(i.Fragment,{children:["Рабочее пространство ",i.jsx("strong",{children:l})]}):"Начните с пространства для вашей работы"]}),i.jsxs("div",{className:"welcome__actions",children:[i.jsxs("button",{type:"button",className:"welcome-card",disabled:!n,onClick:r?()=>{var p;return(p=document.querySelector(".main .composer textarea"))==null?void 0:p.focus()}:l?o:c,children:[i.jsxs("span",{className:"welcome-card__top",children:[i.jsx("span",{className:"welcome-card__number",children:"01 / СОЗДАВАЙТЕ"}),i.jsx("span",{"aria-hidden":"true",children:"↗"})]}),i.jsx("span",{className:"welcome-card__icon","aria-hidden":"true",children:"✧"}),i.jsx("strong",{children:r?"Начать с идеи":l?"Новый разговор":"Открыть пространство"}),i.jsx("span",{className:"welcome-card__description",children:r?"Опишите задачу своими словами. Ответы и действия появятся здесь.":l?"Создайте сессию с подключённым агентом и переходите к задаче.":"Выберите папку проекта: файлы, разговоры и результаты будут рядом."})]}),i.jsxs("button",{type:"button",className:"welcome-card",disabled:!n,onClick:l?u:c,children:[i.jsxs("span",{className:"welcome-card__top",children:[i.jsx("span",{className:"welcome-card__number",children:"02 / ИССЛЕДУЙТЕ"}),i.jsx("span",{"aria-hidden":"true",children:"↗"})]}),i.jsx("span",{className:"welcome-card__icon","aria-hidden":"true",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"27",height:"27",fill:"none",stroke:"currentColor",strokeWidth:"1.2",children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),i.jsx("path",{d:"M14 17.5h7m-3.5-3.5v7"})]})}),i.jsx("strong",{children:"Ближе к деталям"}),i.jsx("span",{className:"welcome-card__description",children:"Откройте файлы, изучите структуру и соберите контекст для следующего шага."})]}),i.jsxs("button",{type:"button",className:"welcome-card",onClick:h,children:[i.jsxs("span",{className:"welcome-card__top",children:[i.jsx("span",{className:"welcome-card__number",children:"03 / НАСТРАИВАЙТЕ"}),i.jsx("span",{"aria-hidden":"true",children:"↗"})]}),i.jsx("span",{className:"welcome-card__icon welcome-card__icon--circle","aria-hidden":"true",children:"◐"}),i.jsx("strong",{children:"На вашей стороне"}),i.jsx("span",{className:"welcome-card__description",children:"Выберите свет или тьму, подключите агентов и задайте правила работы."})]})]}),i.jsxs("p",{className:"welcome__footnote",children:[i.jsx("span",{"aria-hidden":"true",children:"↳"})," Ваши инструменты. Ваш подход. Единое пространство."]})]})}const tn=n=>n.claudeSessionId??n.id;function fy(n,l,r,c){const o=new Set([...l,...r].flatMap(h=>[h.id,tn(h)])),u=l.map(h=>{const p=n.find(g=>g.id===h.id||tn(g)===tn(h));return!p||p.lastSeq<=h.lastSeq&&p.updatedAt<=h.updatedAt?h:{...h,...p,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(tn(h))&&u.push(h);return u}const Is=n=>{var l;return((l=n.title)==null?void 0:l.trim())||"Новый разговор"},du=n=>["running","reconnecting"].includes(n.state)||n.backgroundWork;function xu(n){return 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 Vb(n,l){var o;const r=new Set;let c=n;for(;!r.has(c);){r.add(c);const u=(o=l.find(h=>h.sessionId===c))==null?void 0:o.parentId;if(!u)return c;c=u}return n}function uN(){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(([,l])=>typeof l=="number"&&Number.isFinite(l)))}catch{}return{}}function dN({connected:n,workspaces:l,send:r}){const[c,o]=b.useState(null),[u,h]=b.useState([]),p=b.useRef([]),[g,x]=b.useState({}),[v,j]=b.useState({}),[_,S]=b.useState({}),[k,E]=b.useState({}),[A,D]=b.useState({}),[q,Q]=b.useState(null),z=b.useRef(null),[H,L]=b.useState([]),[U,V]=b.useState(uN),[R,I]=b.useState({}),[G,se]=b.useState(null),[je,we]=b.useState(!0),[Ne,Z]=b.useState(!1),[$,ne]=b.useState(null),me=b.useRef(null),ke=b.useRef(new Map),T=b.useRef(new Set);T.current=new Set(l.map(ee=>ee.id));const K=b.useRef(null),de=b.useRef(G);de.current=G;const _e=b.useRef(g);_e.current=g;const Me=b.useRef(k);Me.current=k;const ze=b.useRef(_);ze.current=_;const Ve=l.map(ee=>ee.id).sort().join("|");b.useEffect(()=>{if(!n){ke.current.clear(),Z(!1),me.current=null;return}for(const ee of l)r({type:"session.list",workspaceId:ee.id});p.current.includes("session-links")&&r({type:"session.links.get"})},[n,Ve,r]);const re=b.useCallback(ee=>{var Ze,st;if(ee.type==="hello.ok"&&(p.current=ee.features??[],h(ee.features??[]),K.current&&K.current!==ee.hostId&&(S({}),E({}),I({}),ke.current.clear()),K.current=ee.hostId),ee.type==="session.list"){for(const Be of ee.sessions)Be.state!=="closed"&&!Be.parentSessionId&&!ke.current.has(Be.id)&&(ke.current.set(Be.id,0),r({type:"session.sync",sessionId:Be.id,sinceSeq:0}));j(Be=>({...Be,[ee.workspaceId]:!0})),x(Be=>{const Fe=Object.fromEntries(Object.entries(Be).filter(([,De])=>De.workspaceId!==ee.workspaceId));for(const De of[...fy(Object.values(Be),ee.sessions,ee.archived,ee.workspaceId),...ee.archived])De.parentSessionId||(Fe[De.id]=De);return Fe})}if(ee.type==="session.summary"||ee.type==="session.live"){const Be=ee.type==="session.live"?ee.sessions:[ee.session],Fe=de.current?_e.current[de.current]:null;if(!p.current.includes("session-routing")&&me.current&&ee.type==="session.summary"&&Fe&&ee.session.state!=="closed"&&(ee.session.id===Fe.id||ee.session.claudeSessionId===tn(Fe))&&(me.current=null,Z(!1),se(ee.session.id),r({type:"session.sync",sessionId:ee.session.id,sinceSeq:0}),r({type:"session.history",sessionId:ee.session.id})),x(De=>{const ut={...De};for(const Ce of Be)if(!(Ce.parentSessionId||!T.current.has(Ce.workspaceId))){for(const[kt,Ft]of Object.entries(ut))Ft.workspaceId===Ce.workspaceId&&kt!==Ce.id&&tn(Ft)===tn(Ce)&&delete ut[kt];ut[Ce.id]={...ut[Ce.id],...Ce,...Ce.state!=="closed"?{archivedAt:void 0}:{}}}return ut}),ee.type==="session.live")for(const De of Be)De.parentSessionId||!T.current.has(De.workspaceId)||ke.current.has(De.id)||(ke.current.set(De.id,0),r({type:"session.sync",sessionId:De.id,sinceSeq:0}))}if(ee.type==="session.events"){const Be=ee.entries.findLast(Ce=>Ce.event.kind==="result");Be&&I(Ce=>({...Ce,[ee.sessionId]:Be.ts}));const Fe=ee.entries.findLast(Ce=>{var kt;return Ce.event.kind==="rewound"&&Ce.seq>(((kt=ze.current[ee.sessionId])==null?void 0:kt.lastSeq)??0)}),De=(Fe==null?void 0:Fe.event.kind)==="rewound"?Fe.event.toUserIndex:null,ut=De===null?null:C_(((Ze=Me.current[ee.sessionId])==null?void 0:Ze.entries)??[],De);ut&&E(Ce=>({...Ce,[ee.sessionId]:{...Ce[ee.sessionId]??Ya,entries:ut}})),S(Ce=>{let kt=Ce[ee.sessionId]??ss;if(Fe&&Fe.seq>kt.lastSeq&&De!==null){const Ft=(ut==null?void 0:ut.filter(Ht=>Ht.event.kind==="user.message").length)??0;kt={...kt,items:A_(kt.items,De,Ft)}}return{...Ce,[ee.sessionId]:uu(kt,ee.entries)}})}if(ee.type==="session.history"&&E(Be=>({...Be,[ee.sessionId]:T_(Be[ee.sessionId]??Ya,ee)})),ee.type==="session.capabilities"&&D(Be=>({...Be,[ee.sessionId]:ee.capabilities})),ee.type==="fs.search"&&ee.scope==="comparison"&&ee.workspaceId===((st=z.current)==null?void 0:st.workspaceId)&&ee.query===z.current.query&&Q({query:ee.query,entries:ee.entries}),ee.type==="fs.dir"&&z.current&&ee.workspaceId===z.current.workspaceId&&ee.path===z.current.path){const Be=z.current.query,Fe=Be.slice(Be.lastIndexOf("/")+1).toLocaleLowerCase();Q({query:Be,entries:ee.entries.filter(De=>De.name.toLocaleLowerCase().includes(Fe))})}ee.type==="session.links"&&(L(ee.links),ne(null)),ee.type==="session.closed"&&x(Be=>{const Fe=Be[ee.sessionId];return Fe?{...Be,[ee.sessionId]:{...Fe,state:"closed",backgroundWork:!1}}:Be}),ee.type==="session.started"&&ee.requestId===me.current&&(me.current=null,Z(!1),se(ee.session.id),x(Be=>({...Be,[ee.session.id]:ee.session})),r({type:"session.sync",sessionId:ee.session.id,sinceSeq:0}),r({type:"session.history",sessionId:ee.session.id})),ee.type==="error"&&["session.start","session.link","session.history","session.sync","permission.respond","prompt.send"].includes(ee.context??"")&&(ne(ee.message),ee.context==="session.start"&&ee.requestId===me.current&&(me.current=null,Z(!1)))},[r]),Ye=b.useMemo(()=>Object.values(g).filter(ee=>T.current.has(ee.workspaceId)).sort((ee,Ze)=>Ze.updatedAt-ee.updatedAt),[g,Ve]),pe=ee=>ee.state==="error"?ee.updatedAt:R[ee.id]??ee.updatedAt,Ge=Ye.filter(ee=>{var Ze;return!ee.archivedAt&&(ee.state==="waiting_permission"||(((Ze=_[ee.id])==null?void 0:Ze.pending.length)??0)>0||!du(ee)&&(ee.state==="error"||ee.lastTurn==="failed"||ee.lastTurn==="completed")&&pe(ee)>(U[tn(ee)]??0))}),dt=Ge.filter(ee=>{var Ze;return ee.state==="waiting_permission"||(((Ze=_[ee.id])==null?void 0:Ze.pending.length)??0)>0}),nt=b.useCallback(ee=>V(Ze=>{const st=ee.state==="error"?ee.updatedAt:R[ee.id]??ee.updatedAt;if((Ze[tn(ee)]??0)>=st)return Ze;const Be={...Ze,[tn(ee)]:st};try{localStorage.setItem("ether:inbox.seen",JSON.stringify(Be))}catch{}return Be}),[R]),bt=b.useCallback(ee=>{z.current=null,Q(null),se(ee.id),we(!0),o(null),ne(null)},[]);b.useEffect(()=>{!G||!n||!g[G]||g[G].state==="closed"||(r({type:"session.sync",sessionId:G,sinceSeq:0}),E(ee=>({...ee,[G]:{...ee[G]??Ya,loading:!0}})),r({type:"session.history",sessionId:G}))},[G,n,r]);const Xe=b.useCallback(()=>{const ee=de.current?_e.current[de.current]:null;if(!ee||me.current)return;const Ze=crypto.randomUUID();me.current=Ze,Z(!0),ne(null),r({type:"session.start",requestId:Ze,workspaceId:ee.workspaceId,resume:tn(ee),provider:ee.provider})},[r]),Ct=b.useCallback(()=>{if(n){ne(null);for(const ee of l)r({type:"session.list",workspaceId:ee.id});for(const ee of Object.values(_e.current))ee.state!=="closed"&&!ee.archivedAt&&r({type:"session.sync",sessionId:ee.id,sinceSeq:0});p.current.includes("session-links")&&r({type:"session.links.get"})}},[n,l,r]);return{view:c,setView:o,sessions:g,allSessions:Ye,loaded:v,timelines:_,histories:k,links:H,attention:Ge,waiting:dt,markRead:nt,handleFrame:re,capabilities:A,comparisonContext:q,supportsLinks:u.includes("session-links"),compareId:G,compareVisible:je,setCompareVisible:we,compareLaunching:Ne,openComparison:bt,resumeComparison:Xe,closeComparison:()=>{se(null),we(!1)},send:r,error:$,clearError:()=>ne(null),refresh:Ct,searchComparison:ee=>{const Ze=de.current?_e.current[de.current]:null;if(Q(null),ee===null||!Ze){z.current=null;return}const st=ee.lastIndexOf("/"),Be=st>=0?ee.slice(0,st):"";z.current={workspaceId:Ze.workspaceId,query:ee,...st>=0||ee===""?{path:Be}:{}},st>=0||ee===""?r({type:"fs.list",workspaceId:Ze.workspaceId,path:Be}):r({type:"fs.search",workspaceId:Ze.workspaceId,query:ee,scope:"comparison"})},loadHistory:(ee,Ze)=>{E(st=>({...st,[ee]:{...st[ee]??Ya,loading:!0}})),r({type:"session.history",sessionId:ee,before:Ze})}}}function Pp(n){const l=n.findLast(o=>o.kind==="user"),r=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(p=>typeof p=="string");return`${Jp(o.name).title}${h?` · ${String(h).slice(0,180)}`:` · ${o.name}`}${o.isError?" · ошибка":o.result===null?" · выполняется":" · готово"}`});return{prompt:(l==null?void 0:l.kind)==="user"?l.text:"",answer:(r==null?void 0:r.kind)==="assistant"?r.text:"",actions:c}}function hy({session:n,items:l,pendingCount:r}){const[c,o]=b.useState(()=>Date.now()-n.createdAt>3e5),u=Pp(l);return!u.prompt&&!u.answer&&u.actions.length===0?null:i.jsxs("section",{className:"session-recap"+(c?" is-open":""),"aria-label":"Контекст сессии",children:[i.jsxs("button",{type:"button",className:"session-recap__toggle","aria-expanded":c,onClick:()=>o(!c),children:[i.jsx("span",{"aria-hidden":"true",children:"↳"}),i.jsx("strong",{children:"Вернуться в контекст"}),i.jsx("span",{className:"session-recap__preview",children:u.prompt.slice(0,130)||"Последние действия и результат"}),i.jsx("span",{"aria-hidden":"true",children:c?"−":"+"})]}),c&&i.jsxs("div",{className:"session-recap__body",children:[u.prompt&&i.jsxs("div",{children:[i.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНЯЯ ЗАДАЧА"}),i.jsx("p",{children:u.prompt.slice(0,700)})]}),u.actions.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНИЕ ДЕЙСТВИЯ"}),i.jsx("ul",{children:u.actions.map((h,p)=>i.jsx("li",{children:h},p))})]}),u.answer&&i.jsxs("div",{children:[i.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНИЙ ОТВЕТ"}),i.jsxs("p",{children:[u.answer.slice(0,700),u.answer.length>700?"…":""]})]}),r>0&&i.jsxs("p",{className:"hub-warning",children:["Ожидают вашего решения: ",r,". Рассмотрите запрос в разговоре или во «Входящих»."]}),["interrupted","stopped","failed"].includes(n.lastTurn??"")&&i.jsx("p",{className:"hub-warning",children:"Предыдущий ход не завершён. Можно уточнить задачу и продолжить разговор."})]})]})}function us({title:n,children:l,actions:r,className:c,sheet:o=!1,onClose:u}){const h=b.useRef(null);return b.useEffect(()=>{function p(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),u();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const v=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=v[0],_=v[v.length-1];!j||!_||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),_.focus()):!g.shiftKey&&document.activeElement===_&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[u]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&u()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":n,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:n}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:u,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:l}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function py(n,l){if(n!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function my({request:n,plan:l,queued:r,collapsed:c,onCollapse:o,onAccept:u,onDecline:h}){const[p,g]=b.useState(l),[x,v]=b.useState("preview");b.useEffect(()=>{g(l),v("preview")},[n.requestId,l]);const j=p.trim().length>0;function _(){j&&u(n.requestId,p)}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:c,children:i.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[i.jsxs("div",{className:"plansheet__head",children:[i.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:i.jsx(gy,{})}),i.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),i.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(x==="preview"?" is-on":""),role:"tab","aria-selected":x==="preview",onClick:()=>v("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(x==="source"?" is-on":""),role:"tab","aria-selected":x==="source",onClick:()=>v("source"),children:"Код"})]}),i.jsx(Wp,{onClick:o})]}),i.jsxs("div",{className:"plansheet__body",children:[n.reason&&i.jsx("p",{className:"plansheet__reason",children:n.reason}),i.jsx("div",{className:"plansheet__content",children:x==="preview"?i.jsx(fN,{text:p}):i.jsx("textarea",{className:"plansheet__source",value:p,onChange:S=>g(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>h(n.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function fN({text:n}){const[l,r]=b.useState("");return b.useEffect(()=>{let c=!1;return ff(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function gy(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),i.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function hN({kind:n,toolName:l,queued:r,onExpand:c}){const o=n==="question"?"Уточняющий вопрос":n==="plan"?"План на согласование":`Разрешить действие: ${l}`;return i.jsxs("button",{type:"button",className:`decision-bar decision-bar--${n}`,onClick:c,children:[i.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:n==="question"?"?":n==="plan"?i.jsx(gy,{}):"!"}),i.jsxs("span",{className:"decision-bar__text",children:[i.jsx("span",{className:"decision-bar__title",children:o}),i.jsxs("span",{className:"decision-bar__sub",children:["ждёт вашего решения",r>0&&` — ещё ${r} в очереди`]})]}),i.jsxs("span",{className:"decision-bar__action",children:["Развернуть",i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"m4 10 4-4 4 4"})})]})]})}function Wp({onClick:n}){return i.jsxs("button",{type:"button",className:"decision-collapse",onClick:n,title:"Свернуть — агент продолжит ждать","aria-label":"Свернуть",children:[i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"m4 6 4 4 4-4"})}),i.jsx("span",{className:"decision-collapse__label",children:"Свернуть"})]})}function xy({request:n,queued:l,collapsed:r,onCollapse:c,onDecide:o}){const u=dy(n.toolName,n.input);return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Запрос разрешения",children:[i.jsxs("div",{className:"sheet__head",children:[i.jsxs("span",{className:"sheet__head-text",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),i.jsx(Wp,{onClick:c})]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:n.toolName}),n.reason&&i.jsx("p",{className:"sheet__reason",children:n.reason}),u?i.jsx(Fp,{diff:u}):i.jsx("pre",{className:"code",children:JSON.stringify(n.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(n.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(n.requestId,"allow"),children:"Разрешить"})]})]})})}function by({request:n,queued:l,collapsed:r,onCollapse:c,onAnswer:o,onDecline:u}){const{questions:h}=n,[p,g]=b.useState(()=>h.map(()=>new Set)),[x,v]=b.useState(()=>h.map(()=>"")),[j,_]=b.useState(()=>Xb(h));b.useEffect(()=>{g(h.map(()=>new Set)),v(h.map(()=>"")),_(Xb(h))},[n.requestId]);const S=b.useMemo(()=>mN(h,p,x),[h,p,x]),k=S!==null;function E(H,L){var U,V;(V=(U=h[H])==null?void 0:U.options[L])!=null&&V.preview&&_(R=>{const I=R.slice();return I[H]=L,I})}function A(H,L,U){g(V=>{const R=V.slice(),I=new Set(R[H]);return U?I.has(L)?I.delete(L):I.add(L):I.has(L)||(I.clear(),I.add(L)),R[H]=I,R}),L!=="other"&&E(H,L)}function D(H,L){v(U=>{const V=U.slice();return V[H]=L,V})}function q(){S&&o(n.requestId,S)}function Q(H){H.key==="Enter"&&(H.target.closest("button")||k&&(H.preventDefault(),q()))}function z(H){var R;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(H.key))return;const L=Array.from(H.currentTarget.querySelectorAll("button.qsheet__option")),U=L.indexOf(document.activeElement);if(U===-1)return;H.preventDefault();const V=H.key==="ArrowDown"||H.key==="ArrowRight"?1:-1;(R=L[(U+V+L.length)%L.length])==null||R.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от агента",onKeyDown:Q,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,l>0&&` — ещё ${l} в очереди`]}),i.jsx(Wp,{onClick:c})]}),i.jsxs("div",{className:"qsheet__body",children:[n.reason&&i.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map((H,L)=>i.jsx(pN,{q:H,qi:L,selected:p[L]??new Set,otherText:x[L]??"",previewIndex:j[L]??null,onToggle:A,onFocusOption:E,onOtherText:D,onOptionsKeyDown:z},L))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>u(n.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:q,children:"Ответить"})]})]})})}function pN({q:n,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:u,onFocusOption:h,onOtherText:p,onOptionsKeyDown:g}){var S;const x=n.options.some(k=>k.preview),v=o!==null?(S=n.options[o])==null?void 0:S.preview:void 0,j=r.has("other"),_=n.multiSelect?"checkbox":"radio";return i.jsxs("div",{className:"qsheet__question",children:[i.jsxs("div",{className:"qsheet__qhead",children:[i.jsx("span",{className:"chip chip--accent",children:n.header}),i.jsx("span",{className:"qsheet__qtext",children:n.question})]}),i.jsxs("div",{className:"qsheet__options"+(n.multiSelect?"":" qsheet__options--radio"),role:n.multiSelect?"group":"radiogroup","aria-label":n.question,onKeyDown:g,children:[n.options.map((k,E)=>{const A=r.has(E);return i.jsxs("button",{type:"button",role:_,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>u(l,E,n.multiSelect),onFocus:()=>h(l,E),onMouseEnter:()=>h(l,E),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:k.label}),i.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},E)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:_,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>u(l,"other",n.multiSelect),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),i.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&i.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:k=>p(l,k.target.value),autoFocus:!0})]})]}),x&&i.jsx("pre",{className:"qsheet__preview",children:v??""})]})}function Xb(n){return n.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function mN(n,l,r){const c={};for(let o=0;o<n.length;o++){const u=n[o];if(!u)continue;const h=l[o]??new Set,p=[];for(let g=0;g<u.options.length;g++){const x=u.options[g];x&&h.has(g)&&p.push(x.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&p.push(g)}if(p.length===0)return null;c[u.question]=p.join(", ")}return c}function _y({hub:n,sessionId:l,onClose:r}){var v;const c=n.timelines[l],o=c==null?void 0:c.pending[0],u=b.useRef(null);if(b.useEffect(()=>{if(!o)return;const j=_=>{var A;if(_.key==="Escape"){_.preventDefault(),_.stopPropagation(),r();return}if(_.key!=="Tab")return;const S=(A=u.current)==null?void 0:A.querySelectorAll('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [tabindex="0"]'),k=S==null?void 0:S[0],E=S==null?void 0:S[S.length-1];_.shiftKey&&document.activeElement===k&&E?(_.preventDefault(),E.focus()):!_.shiftKey&&document.activeElement===E&&k&&(_.preventDefault(),k.focus())};return window.addEventListener("keydown",j,!0),()=>window.removeEventListener("keydown",j,!0)},[o==null?void 0:o.requestId,r]),!o)return null;const h=j=>n.send({type:"permission.respond",sessionId:l,requestId:j,decision:"deny"}),p={queued:((c==null?void 0:c.pending.length)??1)-1,collapsed:!1,onCollapse:r},g=py(o.toolName,o.input),x=(v=o.questions)!=null&&v.length?i.jsx(by,{...p,request:{...o,questions:o.questions},onDecline:h,onAnswer:(j,_)=>n.send({type:"permission.respond",sessionId:l,requestId:j,decision:"allow",answers:_})},o.requestId):g!==null?i.jsx(my,{...p,request:o,plan:g,onDecline:h,onAccept:(j,_)=>n.send({type:"permission.respond",sessionId:l,requestId:j,decision:"allow",plan:_})},o.requestId):i.jsx(xy,{...p,request:o,onDecide:(j,_)=>n.send({type:"permission.respond",sessionId:l,requestId:j,decision:_})},o.requestId);return i.jsx("div",{ref:u,className:"hub-decision",children:x})}const qd=[{value:"research",label:"Исследование"},{value:"implementation",label:"Реализация"},{value:"review",label:"Проверка"},{value:"other",label:"Другой этап"}];function gN({hub:n}){return i.jsxs("nav",{className:"hub-navigation","aria-label":"Управление пространством",children:[i.jsxs("button",{className:n.view==="projects"?"is-active":"",onClick:()=>n.setView("projects"),children:[i.jsx("span",{"aria-hidden":"true",children:"▦"}),"Обзор проектов",i.jsx("span",{children:Object.keys(n.loaded).length})]}),i.jsxs("button",{className:n.view==="inbox"?"is-active":"",onClick:()=>n.setView("inbox"),children:[i.jsx("span",{"aria-hidden":"true",children:"◫"}),"Входящие",n.attention.length>0&&i.jsx("span",{className:n.waiting.length?"has-attention":"",children:n.attention.length})]}),i.jsxs("button",{onClick:()=>n.setView("command"),children:[i.jsx("span",{"aria-hidden":"true",children:"⌕"}),"Найти и перейти",i.jsx("kbd",{children:"Ctrl K"})]})]})}function xN({hub:n,hasSession:l}){return i.jsxs("nav",{className:"hub-strip","aria-label":"Проекты и разговоры",children:[i.jsx("button",{className:"hub-strip__global",onClick:()=>n.setView("projects"),children:"▦ Проекты"}),i.jsxs("button",{className:"hub-strip__global",onClick:()=>n.setView("inbox"),children:["Входящие",n.attention.length>0&&i.jsx("span",{className:"hub-count",children:n.attention.length})]}),i.jsx("button",{onClick:()=>n.setView("tasks"),disabled:!l,children:"↳ Ветки задачи"}),i.jsxs("button",{onClick:()=>n.compareId?n.setCompareVisible(!n.compareVisible):n.setView("compare"),"aria-pressed":!!n.compareId&&n.compareVisible,children:["◧ ",n.compareId?"Второй разговор":"Два разговора"]}),i.jsx("button",{className:"hub-strip__global",onClick:()=>n.setView("command"),children:"⌕ Поиск"})]})}function bN(n){var p,g,x;const{hub:l}=n,[r,c]=b.useState(null),o=r?((p=l.timelines[r])==null?void 0:p.pending.length)??0:0;b.useEffect(()=>{r&&!o&&c(null)},[r,o]),b.useEffect(()=>{const v=j=>{(j.ctrlKey||j.metaKey)&&j.key.toLowerCase()==="k"&&!j.altKey&&!j.isComposing&&(j.preventDefault(),j.stopPropagation(),l.setView(l.view==="command"?null:"command"))};return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[l.view,l.setView]);const u={projects:"Обзор проектов",inbox:"Входящие",command:"Найти и перейти",tasks:"Ветки задачи",compare:"Второй разговор"},h=r?l.sessions[r]:null;return i.jsxs(i.Fragment,{children:[l.view&&!r&&i.jsxs(us,{title:u[l.view],className:l.view==="command"?"modal--palette":"modal--hub",onClose:()=>l.setView(null),children:[!n.connected&&i.jsx("p",{className:"hub-warning",role:"status",children:"Связь с хостом прервана. Данные ниже — последнее полученное состояние."}),l.error&&i.jsxs("div",{className:"hub-error",role:"alert",children:[l.error,i.jsx("button",{onClick:l.clearError,"aria-label":"Закрыть ошибку",children:"×"})]}),l.view==="projects"&&i.jsx(_N,{...n}),l.view==="inbox"&&i.jsx(yN,{...n,onReview:c}),l.view==="command"&&i.jsx(vN,{...n}),l.view==="tasks"&&i.jsx(wN,{...n},(g=n.activeSession)==null?void 0:g.id),l.view==="compare"&&i.jsx(jN,{...n})]}),r&&h&&o>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"hub-decision-context",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"hub-eyebrow",children:["ВХОДЯЩИЕ · ",(x=n.workspaces.find(v=>v.id===h.workspaceId))==null?void 0:x.name]}),i.jsx("strong",{children:Is(h)})]}),i.jsx("button",{className:"btn",onClick:()=>c(null),children:"← К входящим"})]}),i.jsx(_y,{hub:l,sessionId:r,onClose:()=>c(null)})]})]})}function yy({session:n,workspace:l,onOpen:r,onCompare:c,detail:o}){return i.jsxs("div",{className:"hub-session-row",children:[i.jsxs("button",{className:"hub-session-row__main",onClick:r,children:[i.jsx("span",{className:"hub-session-dot"+(n.state==="waiting_permission"?" is-waiting":du(n)?" is-running":"")}),i.jsxs("span",{children:[i.jsx("strong",{children:Is(n)}),i.jsxs("small",{children:[l&&`${l} · `,n.provider," · ",o??xu(n)]})]})]}),c&&i.jsx("button",{className:"hub-icon-btn",onClick:c,"aria-label":`Открыть рядом: ${Is(n)}`,title:"Открыть вторым разговором",children:"◧"})]})}function _N({hub:n,workspaces:l,connected:r,onSelectWorkspace:c,onSelectSession:o,onOpenWorkspace:u,onNewSession:h}){const[p,g]=b.useState(""),[x,v]=b.useState("all"),j=l.filter(_=>{if(!`${_.name} ${_.path}`.toLocaleLowerCase().includes(p.toLocaleLowerCase()))return!1;const S=n.allSessions.filter(k=>k.workspaceId===_.id&&!k.archivedAt);return x==="all"||(x==="working"?S.some(du):S.some(k=>k.state==="waiting_permission"))});return i.jsxs("div",{className:"projects-hub",children:[i.jsx("p",{className:"hub-description",children:"Все проекты в одном месте. Видно, где идёт работа, где нужен ваш ответ и к чему вы возвращались последним."}),i.jsxs("div",{className:"hub-stats",children:[i.jsxs("div",{children:[i.jsx("strong",{children:l.length}),i.jsx("span",{children:"проектов"})]}),i.jsxs("div",{children:[i.jsx("strong",{children:n.allSessions.filter(_=>!_.archivedAt&&du(_)).length}),i.jsx("span",{children:"сессий в работе"})]}),i.jsxs("div",{className:n.waiting.length?"has-attention":"",children:[i.jsx("strong",{children:n.waiting.length}),i.jsx("span",{children:"ждут решения"})]}),i.jsxs("div",{children:[i.jsx("strong",{children:n.attention.filter(_=>_.lastTurn==="completed"&&_.state!=="running").length}),i.jsx("span",{children:"новых результатов"})]})]}),i.jsxs("div",{className:"hub-controls",children:[i.jsx("input",{className:"hub-input","aria-label":"Найти проект",placeholder:"Название или путь проекта…",value:p,onChange:_=>g(_.target.value)}),i.jsx("button",{className:"btn btn--primary",disabled:!r,onClick:u,children:"+ Проект"}),i.jsx("button",{className:"hub-icon-btn",disabled:!r,onClick:n.refresh,"aria-label":"Обновить обзор",title:"Обновить обзор",children:"↻"})]}),i.jsx("div",{className:"hub-filters","aria-label":"Фильтр проектов",children:[["all","Все"],["working","В работе"],["waiting","Нужен ответ"]].map(([_,S])=>i.jsx("button",{"aria-pressed":x===_,onClick:()=>v(_),children:S},_))}),i.jsx("div",{className:"hub-project-grid",children:j.map(_=>{const S=n.allSessions.filter(A=>A.workspaceId===_.id&&!A.archivedAt),k=S.filter(A=>A.state==="waiting_permission").length,E=S.filter(du).length;return i.jsxs("article",{className:"hub-project"+(k?" hub-project--waiting":""),children:[i.jsxs("div",{className:"hub-project__head",children:[i.jsxs("button",{onClick:()=>c(_.id),children:[i.jsx("span",{className:"hub-eyebrow",children:"РАБОЧЕЕ ПРОСТРАНСТВО"}),i.jsx("h3",{children:_.name})]}),i.jsx("span",{"aria-hidden":"true",children:"↗"})]}),i.jsx("p",{className:"hub-project__path",title:_.path,children:_.path}),i.jsx("div",{className:"hub-project__counts",children:n.loaded[_.id]?i.jsxs(i.Fragment,{children:[i.jsxs("span",{children:[S.length," сессий"]}),i.jsxs("span",{children:[E," в работе"]}),k>0&&i.jsxs("span",{className:"hub-warning",children:[k," ждут ответа"]})]}):i.jsx("span",{children:"Загружаются сессии…"})}),i.jsxs("div",{className:"hub-project__recent",children:[S.slice(0,3).map(A=>i.jsx(yy,{session:A,onOpen:()=>o(A),onCompare:()=>n.openComparison(A)},A.id)),n.loaded[_.id]&&!S.length&&i.jsx("p",{className:"hub-muted",children:"Здесь начнётся следующий разговор."})]}),i.jsxs("button",{className:"hub-project__new",disabled:!r,onClick:()=>h(_.id),children:["+ Новый разговор ",i.jsx("span",{"aria-hidden":"true",children:"→"})]})]},_.id)})}),!j.length&&i.jsxs("div",{className:"hub-empty",children:[i.jsx("strong",{children:l.length?"Проекты не найдены":"Начните с проекта"}),i.jsx("p",{children:l.length?"Измените запрос или фильтр.":"Откройте папку, чтобы собрать файлы и разговоры в одном пространстве."})]})]})}function yN({hub:n,workspaces:l,connected:r,onSelectSession:c,onReview:o}){const[u,h]=b.useState("all"),p=x=>{var v;return x.state==="waiting_permission"||(v=n.timelines[x.id])!=null&&v.pending.length?"waiting":x.state==="error"||x.lastTurn==="failed"?"error":"result"},g=n.attention.filter(x=>u==="all"||p(x)===u).sort((x,v)=>(p(x)==="waiting"?0:p(x)==="error"?1:2)-(p(v)==="waiting"?0:p(v)==="error"?1:2)||v.updatedAt-x.updatedAt);return i.jsxs("div",{children:[i.jsx("p",{className:"hub-description",children:"Вопросы, разрешения, ошибки и новые результаты из всех проектов. Нерешённые запросы остаются здесь до вашего ответа."}),i.jsxs("div",{className:"hub-filters",children:[[["all","Всё"],["waiting","Требует решения"],["error","Ошибки"],["result","Результаты"]].map(([x,v])=>i.jsx("button",{"aria-pressed":u===x,onClick:()=>h(x),children:v},x)),i.jsx("button",{className:"hub-mark-all",onClick:()=>n.attention.filter(x=>p(x)!=="waiting").forEach(n.markRead),children:"Прочитать результаты"})]}),i.jsx("div",{className:"hub-inbox",children:g.map(x=>{var E,A,D,q;const v=n.timelines[x.id],j=v==null?void 0:v.pending[0],_=p(x),S=Pp((v==null?void 0:v.items)??[]),k=(A=(E=j==null?void 0:j.questions)==null?void 0:E[0])==null?void 0:A.question;return i.jsxs("article",{className:"hub-inbox-item hub-inbox-item--"+_,children:[i.jsxs("div",{className:"hub-inbox-item__meta",children:[i.jsx("span",{className:"hub-pill",children:_==="waiting"?(D=j==null?void 0:j.questions)!=null&&D.length?"Вопрос":"Нужно разрешение":_==="error"?"Ошибка":"Задача завершена"}),i.jsxs("span",{children:[(q=l.find(Q=>Q.id===x.workspaceId))==null?void 0:q.name," · ",x.provider]})]}),i.jsx("h3",{children:Is(x)}),i.jsx("p",{children:k??(j?`${j.toolName}${j.reason?` · ${j.reason}`:""}`:S.answer.slice(0,220)||S.prompt.slice(0,220)||xu(x))}),i.jsxs("div",{className:"hub-inbox-item__actions",children:[_==="waiting"&&j&&i.jsxs("button",{className:"btn btn--primary",disabled:!r,onClick:()=>o(x.id),children:["Рассмотреть",v.pending.length>1?` · ${v.pending.length}`:""]}),i.jsx("button",{className:"btn",onClick:()=>c(x),children:"Открыть разговор"}),i.jsx("button",{className:"btn btn--ghost",onClick:()=>n.openComparison(x),children:"Открыть рядом"}),_!=="waiting"&&i.jsx("button",{className:"hub-read",onClick:()=>n.markRead(x),children:"Прочитано ✓"})]})]},x.id)})}),!g.length&&i.jsxs("div",{className:"hub-empty",children:[i.jsx("span",{className:"hub-empty__orbit","aria-hidden":"true",children:"✓"}),i.jsx("strong",{children:"Всё под контролем"}),i.jsx("p",{children:"Здесь появятся новые события, требующие внимания."})]})]})}function vN({hub:n,workspaces:l,activeWorkspaceId:r,connected:c,onSelectSession:o,onSelectWorkspace:u,onOpenWorkspace:h,onOpenFiles:p,onOpenSettings:g,onNewSession:x}){const[v,j]=b.useState(""),[_,S]=b.useState(0),k=b.useRef(null);b.useEffect(()=>{const D=setTimeout(()=>{var q;return(q=k.current)==null?void 0:q.focus()},0);return()=>clearTimeout(D)},[]);const E=b.useMemo(()=>{const D=[{id:"projects",title:"Обзор проектов",hint:"Действие · все рабочие пространства",run:()=>n.setView("projects")},{id:"inbox",title:"Входящие",hint:"Действие · вопросы и результаты",run:()=>n.setView("inbox")},{id:"open",title:"Открыть проект",hint:"Действие · выбрать папку",run:h,disabled:!c},{id:"new",title:"Создать сессию",hint:"Действие · новый разговор в текущем проекте",run:()=>r&&x(r),disabled:!r||!c},{id:"files",title:"Открыть файлы проекта",hint:"Действие · дерево файлов и редактор",run:p,disabled:!r},{id:"settings",title:"Настройки пространства",hint:"Действие · темы и агенты",run:g},{id:"compare",title:"Открыть второй разговор",hint:"Действие · две сессии рядом",run:()=>n.setView("compare")}],q=l.map(H=>({id:"p:"+H.id,title:H.name,hint:"Проект · "+H.path,run:()=>u(H.id),disabled:!1})),Q=n.allSessions.map(H=>{var L;return{id:"s:"+H.id,title:Is(H),hint:`${H.archivedAt?"Архив · ":"Сессия · "}${((L=l.find(U=>U.id===H.workspaceId))==null?void 0:L.name)??""} · ${H.provider} · ${xu(H)}`,run:()=>o(H),disabled:!c&&H.state==="closed"}}),z=v.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);return[...D,...q,...Q].filter(H=>z.every(L=>`${H.title} ${H.hint}`.toLocaleLowerCase().includes(L))).sort((H,L)=>Number(L.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))-Number(H.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))).slice(0,60)},[v,n.allSessions,l,c,r]),A=D=>{const q=E[D];q&&!q.disabled&&(n.setView(null),q.run())};return b.useEffect(()=>{var D;(D=document.getElementById(`hub-option-${_}`))==null||D.scrollIntoView({block:"nearest"})},[_]),i.jsxs("div",{className:"command-palette",children:[i.jsx("input",{ref:k,className:"hub-input command-palette__input",role:"combobox","aria-expanded":"true","aria-controls":"hub-command-results","aria-autocomplete":"list","aria-activedescendant":E[_]?`hub-option-${_}`:void 0,"aria-label":"Поиск проектов, сессий и действий",placeholder:"Проект, разговор или действие…",value:v,onChange:D=>{j(D.target.value),S(0)},onKeyDown:D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),S(q=>E.length?(q+(D.key==="ArrowDown"?1:-1)+E.length)%E.length:0)),D.key==="Enter"&&(D.preventDefault(),A(_))}}),i.jsx("div",{className:"command-palette__results",role:"listbox",id:"hub-command-results","aria-label":"Результаты поиска",children:E.map((D,q)=>i.jsxs("button",{role:"option","aria-selected":_===q,"aria-disabled":D.disabled,disabled:D.disabled,id:`hub-option-${q}`,className:_===q?"is-selected":"",onMouseMove:()=>S(q),onClick:()=>A(q),children:[i.jsx("span",{className:"command-palette__kind","aria-hidden":"true",children:D.id.startsWith("p:")?"▦":D.id.startsWith("s:")?"◌":"↗"}),i.jsxs("span",{children:[i.jsx("strong",{children:D.title}),i.jsx("small",{children:D.hint})]}),i.jsx("span",{"aria-hidden":"true",children:"↵"})]},D.id))}),!E.length&&i.jsx("p",{className:"hub-empty",children:"Совпадений нет. Попробуйте название проекта или слово из заголовка сессии."}),i.jsxs("div",{className:"command-palette__foot",children:[i.jsx("span",{children:"↑ ↓ выбрать · Enter перейти"}),i.jsx("span",{children:"Esc закрыть"})]})]})}function jN({hub:n,activeSession:l,workspaces:r,onSelectSession:c}){const[o,u]=b.useState(""),h=n.allSessions.filter(p=>{var g;return p.id!==(l==null?void 0:l.id)&&!p.archivedAt&&`${Is(p)} ${(g=r.find(x=>x.id===p.workspaceId))==null?void 0:g.name} ${p.provider}`.toLocaleLowerCase().includes(o.toLocaleLowerCase())});return i.jsxs("div",{children:[i.jsx("p",{className:"hub-description",children:"Оставьте основной разговор на месте и откройте другой рядом. У каждого свой контекст, ввод и черновик. На телефоне между ними можно переключаться."}),i.jsx("input",{className:"hub-input",value:o,onChange:p=>u(p.target.value),"aria-label":"Найти второй разговор",placeholder:"Найти разговор в любом проекте…"}),i.jsx("div",{className:"hub-session-list",children:h.map(p=>{var g;return i.jsx(yy,{session:p,workspace:(g=r.find(x=>x.id===p.workspaceId))==null?void 0:g.name,onOpen:()=>n.openComparison(p)},p.id)})}),!h.length&&i.jsxs("div",{className:"hub-empty",children:[i.jsx("strong",{children:"Нужен ещё один разговор"}),i.jsx("p",{children:"Создайте вторую сессию в любом проекте, затем откройте её здесь."}),i.jsx("button",{className:"btn",onClick:()=>n.setView("projects"),children:"К проектам"})]}),!l&&n.compareId&&i.jsx("button",{className:"btn",onClick:()=>{const p=n.sessions[n.compareId];p&&c(p)},children:"Открыть выбранную сессию как основную"})]})}function wN({hub:n,activeSession:l,workspaces:r,providers:c,connected:o,onSelectSession:u,onStartStage:h}){var Z;const p=l==null?void 0:l.workspaceId,g=n.allSessions.filter($=>$.workspaceId===p),[x,v]=b.useState(l?tn(l):""),j=g.find($=>tn($)===x)??l,_=n.links.find($=>$.sessionId===x),[S,k]=b.useState((_==null?void 0:_.parentId)??""),[E,A]=b.useState((_==null?void 0:_.stage)??"other"),[D,q]=b.useState("implementation"),[Q,z]=b.useState(c.includes((l==null?void 0:l.provider)??"claude")?l.provider:c[0]??"claude"),[H,L]=b.useState(!1),U=j?Vb(tn(j),n.links):"",V=g.filter($=>Vb(tn($),n.links)===U).sort(($,ne)=>$.createdAt-ne.createdAt),R=[],I=new Set,G=($,ne)=>{var ke;const me=tn($);if(!I.has(me)){I.add(me),R.push({session:$,depth:ne});for(const T of V)((ke=n.links.find(K=>K.sessionId===tn(T)))==null?void 0:ke.parentId)===me&&G(T,ne+1)}},se=V.find($=>tn($)===U);se&&G(se,0);for(const $ of V)I.has(tn($))||G($,0);const je=$=>{v($);const ne=n.links.find(me=>me.sessionId===$);k((ne==null?void 0:ne.parentId)??""),A((ne==null?void 0:ne.stage)??"other")};if(!l||!j)return i.jsxs("div",{className:"hub-empty",children:[i.jsx("strong",{children:"Сначала откройте сессию"}),i.jsx("p",{children:"Её можно связать с другими разговорами и продолжить отдельным этапом."})]});if(!n.supportsLinks)return i.jsxs("div",{className:"hub-empty",children:[i.jsx("strong",{children:"Обновите хост для веток задач"}),i.jsx("p",{children:"На этом компьютере работает предыдущая версия CLI. Обновите пакет командой ниже и перезапустите ccv. Проекты, поиск, входящие и разговоры доступны уже сейчас."}),i.jsx("code",{children:"npm install -g @i14ks/ccv@latest"})]});const we=j.provider===Q&&Q!=="antigravity",Ne=g.filter($=>{var ke;let ne=tn($);const me=new Set;for(;ne&&!me.has(ne);){if(ne===x)return!1;me.add(ne),ne=((ke=n.links.find(T=>T.sessionId===ne))==null?void 0:ke.parentId)??null}return!0});return i.jsxs("div",{className:"task-hub",children:[i.jsx("p",{className:"hub-description",children:"Одна задача может пройти через несколько разговоров: исследование, реализацию и проверку. Связи сохраняются на хосте и доступны с других устройств."}),i.jsxs("p",{className:"hub-eyebrow",children:[(Z=r.find($=>$.id===p))==null?void 0:Z.name," · ЦЕПОЧКА ЗАДАЧИ"]}),i.jsx("div",{className:"task-chain",children:R.map(({session:$,depth:ne})=>{var T;const me=n.links.find(K=>K.sessionId===tn($)),ke=g.find(K=>tn(K)===(me==null?void 0:me.parentId));return i.jsxs("article",{className:"task-node"+($.id===j.id?" is-current":""),style:{marginLeft:Math.min(ne,4)*14},"data-depth":ne,children:[i.jsx("div",{className:"task-node__rail","aria-hidden":"true",children:(me==null?void 0:me.kind)==="fork"?"⑂":"○"}),i.jsxs("div",{children:[i.jsxs("span",{className:"hub-eyebrow",children:[((T=qd.find(K=>K.value===(me==null?void 0:me.stage)))==null?void 0:T.label)??"Начало задачи",$.archivedAt?" · архив":""]}),i.jsx("button",{className:"task-node__title",onClick:()=>u($),children:Is($)}),i.jsxs("p",{children:[ke?`Из «${Is(ke)}» · `:"",xu($)," · ",$.provider]})]}),i.jsx("button",{className:"hub-icon-btn",title:"Открыть рядом","aria-label":`Открыть рядом: ${Is($)}`,onClick:()=>n.openComparison($),children:"◧"})]},$.id)})}),i.jsxs("section",{className:"hub-form-section",children:[i.jsx("h3",{children:"Связать существующие разговоры"}),i.jsx("p",{className:"hub-muted",children:"Выберите разговор, его предыдущий этап и роль в задаче."}),i.jsxs("form",{className:"hub-link-form",onSubmit:$=>{$.preventDefault(),n.send({type:"session.link",workspaceId:p,sessionId:x,parentId:S||null,stage:E})},children:[i.jsxs("label",{children:["Разговор",i.jsx("select",{value:x,onChange:$=>je($.target.value),children:g.map($=>i.jsx("option",{value:tn($),children:Is($)},$.id))})]}),i.jsxs("label",{children:["Предыдущий этап",i.jsxs("select",{value:S,onChange:$=>k($.target.value),children:[i.jsx("option",{value:"",children:"Самостоятельная задача"}),Ne.map($=>i.jsx("option",{value:tn($),children:Is($)},$.id))]})]}),i.jsxs("label",{children:["Этап",i.jsx("select",{value:E,onChange:$=>A($.target.value),children:qd.map($=>i.jsx("option",{value:$.value,children:$.label},$.value))})]}),i.jsx("button",{className:"btn",disabled:!o,children:"Сохранить связь"})]})]}),i.jsxs("section",{className:"hub-form-section",children:[i.jsx("h3",{children:"Продолжить новым этапом"}),i.jsxs("p",{className:"hub-muted",children:["Новый разговор будет связан с «",Is(j),"». Доступный контекст появится в черновике — его можно проверить перед отправкой.",j.state==="closed"&&!n.histories[j.id]&&" История не открыта: в черновике будут название и этап. Для переноса всей истории выберите ответвление разговора."]}),i.jsxs("form",{className:"hub-stage-form",onSubmit:$=>{var T,K,de;$.preventDefault();const ne=Pp([...Op(((T=n.histories[j.id])==null?void 0:T.entries)??[]),...((K=n.timelines[j.id])==null?void 0:K.items)??[]]),ke=`Следующий этап: ${(de=qd.find(_e=>_e.value===D))==null?void 0:de.label}.
|
|
119
|
-
Продолжаем задачу «${Is(j)}».${ne.prompt?`
|
|
120
|
-
|
|
121
|
-
Последняя задача:
|
|
122
|
-
${ne.prompt.slice(0,3e3)}`:""}${ne.answer?`
|
|
123
|
-
|
|
124
|
-
Последний ответ:
|
|
125
|
-
${ne.answer.slice(0,5e3)}`:""}
|
|
126
|
-
|
|
127
|
-
`;h(j,Q,D,H&&we,ke)},children:[i.jsxs("label",{children:["Следующий этап",i.jsx("select",{value:D,onChange:$=>q($.target.value),children:qd.map($=>i.jsx("option",{value:$.value,children:$.label},$.value))})]}),i.jsxs("label",{children:["Агент",i.jsx("select",{value:Q,onChange:$=>{z($.target.value),L(!1)},children:c.map($=>i.jsx("option",{value:$,children:$==="claude"?"Claude":$==="codex"?"Codex":"Antigravity"},$))})]}),i.jsxs("label",{className:"hub-checkbox",children:[i.jsx("input",{type:"checkbox",checked:H&&we,disabled:!we,onChange:$=>L($.target.checked)}),i.jsxs("span",{children:["Ответвить полный разговор",!we&&i.jsx("small",{children:"Доступно с тем же агентом, если он поддерживает форки."})]})]}),i.jsx("button",{className:"btn btn--primary",disabled:!o||!c.length,children:"Создать этап →"})]})]})]})}const NN="ccv.dictation.lang",Qb="ru-RU";function kN(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function Kb(){const n=window,l=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(kN);return!r&&l.length>0&&Gl("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function vy(){var n;try{return((n=localStorage.getItem(NN))==null?void 0:n.trim())||Qb}catch{return Qb}}function Gl(n,l){l===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,l)}const SN=3,EN=400,TN=5,CN=250,AN=2e3,RN=2e4;async function MN(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const DN={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${vy()}`};function ON(n){const[l]=b.useState(()=>Kb()!==null),[r,c]=b.useState(!1),[o,u]=b.useState(null),h=b.useRef(null),p=b.useRef(!1),g=b.useRef(!1),x=b.useRef(n),v=b.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=b.useRef(null),_=b.useRef(!1),S=b.useRef(null),k=b.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=null},[]),E=b.useCallback(()=>{k();const z=async H=>{if(S.current=null,!(!p.current||_.current)){if(!H&&!await MN()){if(Gl("ждём ответа на запрос доступа к микрофону"),!p.current||_.current)return;S.current=setTimeout(()=>void z(!0),RN);return}Gl("движок не ответил на start()"),p.current=!1,c(!1),u("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};S.current=setTimeout(()=>void z(!1),AN)},[k]);b.useEffect(()=>{x.current=n}),b.useEffect(()=>{const z=Kb();if(!z)return;const H=new z;return H.lang=vy(),H.continuous=!0,H.interimResults=!0,H.onstart=()=>{Gl("сессия открыта"),_.current=!0,k(),c(!0)},H.onaudiostart=()=>{Gl("пошёл звук с микрофона"),v.current.audio=!0},H.onresult=L=>{var I;if(g.current)return;let U="",V="";for(let G=L.resultIndex;G<L.results.length;G++){const se=L.results[G];if(!se)continue;const je=((I=se[0])==null?void 0:I.transcript)??"";se.isFinal?U+=je:V+=je}const R=v.current;R.heard=!0,R.everHeard=!0,Gl("распознано",{final:U,interim:V}),x.current(U,V)},H.onerror=L=>{v.current.lastError=L.error,Gl("ошибка движка",L.error),!(L.error==="no-speech"||L.error==="aborted")&&(p.current=!1,c(!1),u(DN[L.error]??`Распознавание не работает: ${L.error}`))},H.onend=()=>{g.current=!1,_.current=!1;const L=v.current,U=Date.now()-L.openedAt;if(Gl("сессия закрыта",{мс:U,звук:L.audio,слова:L.heard,ошибка:L.lastError||null}),!p.current){c(!1);return}if(L.dead=!L.audio&&U<EN?L.dead+1:0,L.dead>=TN){p.current=!1,c(!1),u(L.lastError?`Распознавание не работает: ${L.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}L.silent=L.heard?0:L.silent+1,!L.everHeard&&!L.warned&&L.silent>=SN&&(L.warned=!0,u(L.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!p.current){L.openedAt=Date.now(),L.audio=!1,L.heard=!1,L.lastError="",E();try{H.start()}catch{}}},CN)},h.current=H,()=>{p.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),H.onend=null,H.onresult=null,H.onerror=null,H.onstart=null,H.onaudiostart=null,H.abort(),h.current=null}},[]);const A=b.useCallback(()=>{var z;if(p.current){if(p.current=!1,Gl("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!_.current){c(!1);return}(z=h.current)==null||z.stop()}},[]),D=b.useCallback(()=>{const z=h.current;if(z){if(!window.isSecureContext){u("Микрофон доступен только по https или с localhost");return}u(null),p.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,v.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Gl("включение микрофона",{язык:z.lang}),E();try{z.start()}catch(H){Gl("start() не прошёл",H)}}},[E]),q=b.useCallback(()=>{p.current?A():D()},[D,A]),Q=b.useCallback(()=>{var z;p.current&&_.current&&(g.current=!0,(z=h.current)==null||z.abort())},[]);return{supported:l,listening:r,error:o,toggle:q,stop:A,drop:Q}}const LN="(max-width: 860px)",Zb=/^\/(\S*)$/,zN=new Set(["model","permissions"]);function IN(n){return zN.has(n.name)||n.name.startsWith("__")}const UN=new Set(["clear","rename"]),Fb=/(?:^|\s)@([^\s@]*)$/,HN=200,BN=100,qN=190,GN=5,$N=20*1024*1024,YN=1568,VN=.85;let Jb=0;async function XN(n){var j,_;if(!n.type.startsWith("image/")||n.size>$N)return null;const l=await QN(n);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,YN/Math.max(r,c)),u=document.createElement("canvas");u.width=Math.max(1,Math.round(r*o)),u.height=Math.max(1,Math.round(c*o));const h=u.getContext("2d");if(!h)return null;h.drawImage(l.image,0,0,u.width,u.height),(_=(j=l.image).close)==null||_.call(j);const p=n.type==="image/png",g=p?"image/png":"image/jpeg",x=u.toDataURL(g,p?void 0:VN),v=x.slice(x.indexOf(",")+1);return v?(Jb+=1,{id:`att${Jb}`,mediaType:g,data:v,previewUrl:x}):null}async function QN(n){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(n);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),l(null)},c.src=r})}function em({disabled:n,busy:l,commands:r,sessionTitle:c,contextResult:o,className:u,placeholder:h,draftKey:p,sendLabel:g="Отправить",autoFocus:x=!1,attachmentsEnabled:v=!0,sendBlocked:j=!1,onContextSearch:_,onCommand:S,onSend:k,onInterrupt:E,onEscape:A}){var sn;const D=of(LN),[q,Q]=b.useState(()=>p?Kh(p):""),[z,H]=b.useState(!1),[L,U]=b.useState(0),V=b.useRef(null),R=b.useRef(null),I=b.useRef(!1),G=b.useRef(null),[se,je]=b.useState(()=>p?Kh(p).length:0),[we,Ne]=b.useState([]),Z=b.useRef(null),$=b.useCallback(F=>{!v||F.length===0||Promise.all(F.map(XN)).then(he=>{const Se=he.filter(Ie=>Ie!==null);Se.length!==0&&Ne(Ie=>[...Ie,...Se].slice(0,GN))})},[v]);function ne(F){Ne(he=>he.filter(Se=>Se.id!==F))}function me(F){var Ie;if(!v)return;const he=(Ie=F.clipboardData)==null?void 0:Ie.items;if(!he)return;const Se=[];for(const gt of he){if(!gt.type.startsWith("image/"))continue;const ps=gt.getAsFile();ps&&Se.push(ps)}Se.length!==0&&(F.preventDefault(),$(Se))}function ke(F){const he=F.target.files?Array.from(F.target.files):[];F.target.value="",$(he)}b.useEffect(()=>{v||Ne([])},[v]);const[T,K]=b.useState([]),[de,_e]=b.useState(-1),Me=b.useRef(""),[ze,Ve]=b.useState(""),re=ON(b.useCallback((F,he)=>{F&&Q(Se=>cp(Se,F)),Ve(he.trim())},[])),Ye=ze?cp(q,ze):q;b.useEffect(()=>{re.listening||ze===""||(Q(F=>cp(F,ze)),Ve(""))},[re.listening,ze]),b.useEffect(()=>{var F;x&&((F=V.current)==null||F.focus())},[x]);const pe=b.useRef(new Map),Ge=b.useRef(new Map),dt=b.useRef(p),nt=b.useRef({text:q,caret:se});nt.current={text:q,caret:se};const bt=b.useCallback((F,he,Se)=>{he===""?(pe.current.delete(F),Ge.current.delete(F)):(pe.current.set(F,he),Ge.current.set(F,Se)),pp(F,he)},[]),Xe=re.drop;b.useLayoutEffect(()=>{const F=dt.current;if(F===p)return;dt.current=p,F&&bt(F,nt.current.text,nt.current.caret);const he=p?pe.current.get(p)??Kh(p):"",Se=p?Ge.current.get(p):void 0,Ie=Math.min(Se??he.length,he.length);Q(he),je(Ie),G.current=[Ie,Ie],Ve(""),U(0),H(!1),_e(-1),Me.current="",Ne([]),Xe()},[p,bt,Xe]),b.useEffect(()=>{p&&bt(p,q,se)},[p,q,se,bt]);const Ct=n?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"С чего начнём? Опишите задачу…",ee=b.useRef(0),Ze=b.useCallback(F=>{const he=parseFloat(getComputedStyle(F).maxHeight),Se=Number.isFinite(he)&&he>0?he:qN;F.style.height="auto";const Ie=F.scrollHeight;F.style.height=`${Math.min(Ie,Se)}px`,F.style.overflowY=Ie>Se?"auto":"hidden"},[]);b.useEffect(()=>{const F=V.current;F&&Ze(F)},[Ye,Ct,n,Ze]),b.useLayoutEffect(()=>{const F=V.current,he=G.current;!F||!he||(G.current=null,F.setSelectionRange(he[0],he[1]))}),b.useEffect(()=>{const F=V.current;if(!F)return;const he=new ResizeObserver(([Se])=>{const Ie=Se==null?void 0:Se.contentRect.width;Ie===void 0||Math.abs(Ie-ee.current)<1||(ee.current=Ie,Ze(F))});return he.observe(F),()=>he.disconnect()},[Ze]);const st=re.stop;b.useEffect(()=>{n&&st()},[n,st]);const Be=b.useMemo(()=>re.error?{ok:!1,message:re.error}:null,[re.error]),Fe=b.useMemo(()=>{var Se;const F=(Se=Zb.exec(q))==null?void 0:Se[1];if(F===void 0)return[];const he=F.toLowerCase();return r.filter(Ie=>!IN(Ie)&&op(Ie,he)<jy).sort((Ie,gt)=>op(Ie,he)-op(gt,he))},[q,r]),De=!z&&Fe.length>0,ut=Math.min(L,Fe.length-1),Ce=z?null:((sn=Fb.exec(Ye.slice(0,se)))==null?void 0:sn[1])??null,kt=b.useRef(_);kt.current=_,b.useEffect(()=>{if(Ce===null||Ce===""||Ce.endsWith("/")){kt.current(Ce);return}const F=setTimeout(()=>kt.current(Ce),HN);return()=>clearTimeout(F)},[Ce]);const Ft=Ce!==null&&(o==null?void 0:o.query)===Ce,Ht=Ft?o.entries:[],nn=Ce!==null,fn=nn&&!Ft,_n=Math.min(L,Math.max(Ht.length-1,0));b.useEffect(()=>{var he,Se;if(!De&&!nn)return;const F=De?ut:_n;(Se=(he=R.current)==null?void 0:he.children[F])==null||Se.scrollIntoView({block:"nearest"})},[De,nn,ut,_n]);function wn(F,he){var Se;Q(F),je(he),G.current=[he,he],U(0),H(!1),ze!==""&&(Ve(""),re.drop()),(Se=V.current)==null||Se.focus()}function St(){Q(""),Ve(""),U(0),je(0),H(!1),_e(-1),Me.current="",Ne([]),re.drop(),p&&bt(p,"",0)}function ft(F){const he=F.trim();if(he===""&&we.length===0||n||j||I.current)return;const Se=k(he,we.length>0?we.map(Ie=>({mediaType:Ie.mediaType,data:Ie.data})):void 0);if(Se instanceof Promise){I.current=!0,Se.then(Ie=>{I.current=!1,Ie&&$t(he)},()=>{I.current=!1});return}Se!==!1&&$t(he)}function $t(F){F!==""&&K(he=>[F,...he.filter(Se=>Se!==F)].slice(0,BN)),St()}function Cn(F){if(F<-1||F>=T.length)return;de===-1&&(Me.current=q);const he=F===-1?Me.current:T[F]??"";_e(F),wn(he,he.length)}function At(){var Ie;const F=((Ie=V.current)==null?void 0:Ie.selectionStart)??Ye.length,Se=`${F>0&&!/\s$/.test(Ye.slice(0,F))?" ":""}@`;wn(Ye.slice(0,F)+Se+Ye.slice(F),F+Se.length)}function hs(F){var gt;const he=(gt=Fb.exec(Ye.slice(0,se)))==null?void 0:gt[1];if(he===void 0)return;const Se=se-he.length-1,Ie=F.kind==="dir"?`@${F.path}/`:`@${F.path} `;wn(Ye.slice(0,Se)+Ie+Ye.slice(se),Se+Ie.length)}function ie(){var he;if(j)return;const F=(he=Zb.exec(Ye.trim()))==null?void 0:he[1];if(F&&S(F)){St();return}ft(Ye)}function ye(F,he){Q(F),je(he),U(0),H(!1),_e(-1),ze!==""&&(Ve(""),re.drop())}function He(F){var Ie;const he=UN.has(F.name)?c:null,Se=`/${F.name} `;Q(Se+(he??"")),je(Se.length+((he==null?void 0:he.length)??0)),he&&(G.current=[Se.length,Se.length+he.length]),U(0),(Ie=V.current)==null||Ie.focus()}function lt(F){if(S(F.name)){Q(""),U(0),H(!1);return}F.argumentHint?He(F):ft(`/${F.name}`)}function Je(F){if(De){if(F.key==="ArrowDown")return F.preventDefault(),U(he=>(Math.min(he,Fe.length-1)+1)%Fe.length);if(F.key==="ArrowUp"){F.preventDefault();const he=Fe.length-1;return U(Se=>(Math.min(Se,he)+he)%Fe.length)}if(F.key==="Enter"&&!F.shiftKey){F.preventDefault();const he=Fe[ut];he&<(he);return}if(F.key==="Tab"){F.preventDefault();const he=Fe[ut];he&&He(he);return}if(F.key==="Escape"){F.preventDefault(),F.stopPropagation(),H(!0);return}}if(nn){if(F.key==="ArrowDown"&&Ht.length>0)return F.preventDefault(),U(he=>(Math.min(he,Ht.length-1)+1)%Ht.length);if(F.key==="ArrowUp"&&Ht.length>0){F.preventDefault();const he=Ht.length-1;return U(Se=>(Math.min(Se,he)+he)%Ht.length)}if(F.key==="Enter"&&!F.shiftKey||F.key==="Tab"){const he=Ht[_n];if(he){F.preventDefault(),hs(he);return}if(F.key==="Tab")return}if(F.key==="Escape"){F.preventDefault(),F.stopPropagation(),H(!0);return}}if((F.key==="ArrowUp"||F.key==="ArrowDown")&&!F.shiftKey){const he=F.currentTarget,Se=he.selectionStart;if(he.selectionEnd===Se){const gt=F.key==="ArrowUp"?de+1:de-1;gt>=-1&><T.length&&requestAnimationFrame(()=>{he.selectionStart===Se&&he.selectionEnd===Se&&Cn(gt)})}}if(F.key==="Escape"&&A){F.preventDefault(),F.stopPropagation(),A();return}F.key==="Enter"&&!F.shiftKey&&!D&&(F.preventDefault(),ie())}return i.jsx("div",{className:u?`composer ${u}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(Or,{result:Be}),nn&&!De&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:R,children:[Ht.map((F,he)=>i.jsxs("button",{role:"option","aria-selected":he===_n,className:he===_n?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>U(he),onMouseDown:Se=>{Se.preventDefault(),hs(F)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[F.name,F.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:F.path}),F.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},F.path)),Ht.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:fn?"ищем…":Ce?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),De&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:R,children:Fe.map((F,he)=>i.jsxs("button",{role:"option","aria-selected":he===ut,className:he===ut?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>U(he),onMouseDown:Se=>{Se.preventDefault(),lt(F)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",F.name]}),F.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:F.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:F.description})]},F.name))}),we.length>0&&i.jsx("div",{className:"composer__attachments",children:we.map(F=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:F.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>ne(F.id),children:i.jsx(WN,{})})]},F.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:At,children:i.jsx(FN,{})}),v&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Z,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:ke}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var F;return(F=Z.current)==null?void 0:F.click()},children:i.jsx(PN,{})})]}),i.jsx("textarea",{ref:V,value:Ye,"aria-label":"Сообщение агенту",disabled:n,placeholder:Ct,onChange:F=>ye(F.target.value,F.target.selectionStart),onSelect:F=>je(F.currentTarget.selectionStart),onKeyDown:Je,onPaste:me}),re.supported&&i.jsx("button",{type:"button",className:re.listening?"micbtn is-on":"micbtn",title:re.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":re.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":re.listening,disabled:n,onClick:re.toggle,children:i.jsx(ek,{on:re.listening})}),l?i.jsx("button",{className:"btn",onClick:E,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:ie,disabled:n||j||Ye.trim()===""&&we.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(JN,{})]})]}),i.jsxs("div",{className:"composer__help",children:[i.jsxs("span",{children:[i.jsx("kbd",{children:"@"})," файлы проекта ",i.jsx("span",{"aria-hidden":"true",children:"·"})," ",i.jsx("kbd",{children:"/"})," команды"]}),i.jsxs("span",{className:"composer__keyboard",children:[i.jsx("kbd",{children:"Enter"})," отправить ",i.jsx("span",{"aria-hidden":"true",children:"·"})," ",i.jsx("kbd",{children:"Shift + Enter"})," новая строка"]})]})]})})}function cp(n,l){const r=l.trim();if(r==="")return n;const c=Cp(r).slice(KN(n,r)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function KN(n,l){const r=Cp(n),c=Cp(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((u,h)=>ZN(u,c[h]??"")))return o;return 0}function Cp(n){return n.split(/\s+/).filter(l=>l!=="")}function ZN(n,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(n)===r(l)}function FN(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function JN(){return i.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:i.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function PN(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.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 WN(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function ek({on:n}){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:n?"currentColor":"none"}),i.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),i.jsx("path",{d:"M8 12.8v1.5"})]})}const jy=4;function op(n,l){const r=n.name.toLowerCase();return r===l?0:r.startsWith(l)?1:n.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:jy}function tk({hub:n,workspaces:l,primary:r,connected:c,networkBlocked:o,onFocusPrimary:u,onPromote:h}){var q;const[p,g]=b.useState(!1);if(!n.compareId)return null;const x=n.sessions[n.compareId];if(!x)return null;const v=n.timelines[x.id]??ss,j=n.histories[x.id]??Ya,_=Op(j.entries),S=["running","waiting_permission"].includes(x.state),k=v.pending.length>0,E=x.state==="closed",A=l.find(Q=>Q.id===x.workspaceId),D=(r==null?void 0:r.id)===x.id;return i.jsxs("aside",{className:"comparison"+(n.compareVisible?" comparison--visible":""),"aria-label":"Второй разговор",children:[i.jsxs("header",{className:"comparison__head",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"hub-eyebrow",children:["ВТОРОЙ РАЗГОВОР · ",(A==null?void 0:A.name)??"ПРОЕКТ"]}),i.jsx("strong",{title:Is(x),children:Is(x)})]}),i.jsx("button",{type:"button",className:"hub-icon-btn",title:"Выбрать другой разговор","aria-label":"Выбрать другой разговор",onClick:()=>n.setView("compare"),children:"⇄"}),i.jsx("button",{type:"button",className:"hub-icon-btn",title:"Открыть как основной","aria-label":"Открыть как основной",onClick:()=>h(x),children:"↗"}),i.jsx("button",{type:"button",className:"hub-icon-btn",title:"Закрыть второй разговор","aria-label":"Закрыть второй разговор",onClick:n.closeComparison,children:"×"})]}),i.jsxs("div",{className:"comparison__status",children:[i.jsx("span",{className:k?"hub-pill hub-pill--waiting":"hub-pill",children:xu(x)}),i.jsx("span",{children:x.provider}),i.jsx("button",{type:"button",className:"comparison__back",onClick:u,children:"← Основной разговор"})]}),i.jsx(hy,{session:x,items:[..._,...v.items],pendingCount:v.pending.length},x.id),n.error&&i.jsx("p",{className:"hub-error",role:"alert",children:n.error}),D?i.jsxs("div",{className:"hub-empty",children:[i.jsx("strong",{children:"Этот разговор уже открыт слева"}),i.jsx("p",{children:"Выберите другую сессию, чтобы работать с двумя разговорами."}),i.jsx("button",{className:"btn",onClick:()=>n.setView("compare"),children:"Выбрать сессию"})]}):i.jsxs(i.Fragment,{children:[i.jsx(hf,{items:v.items,busy:S,waiting:k,sessionId:x.id,history:_,historyHasMore:gp(j),historyLoading:j.loading,onLoadHistory:()=>n.loadHistory(x.id,Dp(j)),empty:E?"Сессия сохранена на диске. Продолжите её, чтобы загрузить историю и написать сообщение.":"Независимый разговор: сообщения и черновик относятся только к этой сессии."}),k&&i.jsxs("button",{className:"comparison__decision",onClick:()=>g(!0),children:["Нужен ваш ответ · запросов: ",v.pending.length," ",i.jsx("span",{children:"Рассмотреть →"})]}),E?i.jsxs("div",{className:"comparison__resume",children:[i.jsx("p",{children:"Разговор сохранён. Продолжение восстановит его контекст."}),i.jsx("button",{className:"btn btn--primary",disabled:!c||n.compareLaunching,onClick:n.resumeComparison,children:n.compareLaunching?"Восстанавливается…":"Продолжить разговор"})]}):i.jsx(em,{className:"composer--comparison",disabled:!c,busy:S,commands:((q=n.capabilities[x.id])==null?void 0:q.commands)??[],sessionTitle:x.title,contextResult:n.comparisonContext,draftKey:x.id,sendBlocked:o,placeholder:x.state==="reconnecting"?"Сообщение будет отправлено после восстановления связи":"Сообщение во второй разговор…",onContextSearch:n.searchComparison,onCommand:()=>!1,onEscape:()=>{S&&!k&&n.send({type:"control.interrupt",sessionId:x.id})},onSend:(Q,z)=>!c||o?!1:(n.send({type:"prompt.send",sessionId:x.id,text:Q,images:z}),!0),onInterrupt:()=>n.send({type:"control.interrupt",sessionId:x.id})})]}),p&&k&&i.jsx(_y,{hub:n,sessionId:x.id,onClose:()=>g(!1)})]})}function wy({path:n}){const[l,r]=b.useState(!1),[c,o]=b.useState(!1),u=b.useRef(null);b.useEffect(()=>{if(!l)return;function p(g){var x;(x=u.current)!=null&&x.contains(g.target)||r(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),b.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),Zp);return()=>clearTimeout(p)},[c]),b.useEffect(()=>r(!1),[n]);async function h(){await vi(n)&&o(!0)}return i.jsxs("div",{ref:u,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${n}`,onClick:()=>r(p=>!p),onKeyDown:p=>{p.key!=="Escape"||!l||(p.preventDefault(),p.stopPropagation(),r(!1))},children:[i.jsx(nk,{open:l}),i.jsx("span",{className:"cwd__short",children:n})]}),l&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:n}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?Bc:Rr})]})]})}function nk({open:n}){return i.jsx("svg",{className:n?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const sk=["low","medium","high"];function Ny({models:n,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:u,showSwitchOnFlag:h=!0,showUltracode:p=!0,showThinking:g=!0,className:x,onModel:v,onEffort:j,onUltracode:_,onThinking:S,onSwitchOnFlag:k}){const[E,A]=b.useState(!1),[D,q]=b.useState(0),Q=b.useRef(null),z=b.useRef(null),H=n.find(I=>I.value===l)??null,L=H&&H.supportsEffort?H.effortLevels.length>0?H.effortLevels:sk:[],U=L.includes("xhigh");b.useEffect(()=>{if(!E)return;const I=n.findIndex(G=>G.value===l);q(I===-1?0:I)},[E]),b.useEffect(()=>{if(!E)return;function I(G){var se;(se=Q.current)!=null&&se.contains(G.target)||A(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[E]),b.useEffect(()=>{var I,G;E&&((G=(I=z.current)==null?void 0:I.querySelector(".is-cursor"))==null||G.scrollIntoView({block:"nearest"}))},[E,D]);function V(I){A(!1),I.value!==l&&v(I.value)}function R(I){if(I.key==="Escape"){if(!E)return;I.preventDefault(),I.stopPropagation(),A(!1);return}if(I.key==="ArrowDown"||I.key==="ArrowUp"){if(I.preventDefault(),!E)return A(!0);if(n.length===0)return;const G=I.key==="ArrowDown"?1:n.length-1;return q(se=>(se+G)%n.length)}if(I.key==="Enter"||I.key===" "){if(I.preventDefault(),!E)return A(!0);const G=n[D];G&&V(G)}}return i.jsxs("div",{ref:Q,className:"select"+(E?" select--open":"")+(x?` ${x}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":E,onClick:()=>A(I=>!I),onKeyDown:R,children:[(H==null?void 0:H.displayName)??l?i.jsx("span",{className:"select__value",children:(H==null?void 0:H.displayName)??l}):i.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):L.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(lk,{})]}),E&&i.jsxs("div",{ref:z,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((I,G)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":I.value===l,className:"select__option"+(G===D?" is-cursor":"")+(I.value===l?" is-on":""),onMouseEnter:()=>q(G),onClick:()=>V(I),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:I.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:I.displayName}),I.description&&i.jsx("span",{className:"select__hint",children:I.description})]},I.value)),L.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"modelmenu__sep",role:"separator"}),i.jsxs("div",{className:"modelmenu__row",children:[i.jsxs("span",{className:"modelmenu__label",children:["Усилие",i.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),i.jsx("span",{className:"modelmenu__levels",children:L.map(I=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":I===r,className:I===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>j(I),children:I},I))})]}),U&&p&&i.jsx(up,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>_(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),g&&(H==null?void 0:H.supportsThinking)!==!1&&i.jsx(up,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>S(!o)}),h&&i.jsx(up,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:u,onToggle:()=>k(!u)})]})]})}function up({label:n,desc:l,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[i.jsxs("span",{className:"modelmenu__label",children:[n,i.jsx("span",{className:"modelmenu__desc",children:l})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function lk(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ik({candidates:n,searching:l,agentItems:r,agentBusy:c,error:o,roots:u,created:h,onSearch:p,onAskAgent:g,onInterrupt:x,onSubmit:v,onCreate:j,onClose:_}){const[S,k]=b.useState("open"),[E,A]=b.useState(""),[D,q]=b.useState(!1),[Q,z]=b.useState(""),[H,L]=b.useState(""),[U,V]=b.useState({git:!0,claudeMd:!0,agentsMd:!0,readme:!0}),R=E.trim(),I=R!=="",G=Q.trim(),se=H.trim(),je=G!==""&&se!=="";b.useEffect(()=>{Q===""&&u.length>0&&z(u[0])},[u]);const we=b.useRef(p);we.current=p,b.useEffect(()=>{if(S!=="open")return;const ne=E.trim(),me=setTimeout(()=>we.current(ne),200);return()=>clearTimeout(me)},[E,S]);function Ne(){I&&v(R)}function Z(){je&&j(G,se,U)}function $(){I&&(q(!0),g(R))}return h?i.jsxs(us,{title:"Новый проект",onClose:_,actions:i.jsx("button",{className:"btn btn--primary",onClick:_,autoFocus:!0,children:"Понятно"}),children:[i.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),i.jsx("p",{className:"newproj__preview",children:h.path}),i.jsx("div",{className:"modal__error",children:i.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(ne=>i.jsx("li",{children:ne},ne))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(us,{title:"Новый проект",className:D&&S==="open"?"modal--wide":void 0,onClose:_,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:_,children:"Отмена"}),S==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!I,onClick:$,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!I,onClick:Ne,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!je,onClick:Z,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Pb,{label:"Открыть",on:S==="open",onClick:()=>k("open")}),i.jsx(Pb,{label:"Создать",on:S==="create",onClick:()=>k("create")})]}),S==="open"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),i.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),i.jsx("input",{id:"workspace-path",className:"input input--mono",value:E,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:ne=>A(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),Ne())}}),o&&i.jsx("p",{className:"modal__error",children:o}),n.length>0&&i.jsx("ul",{className:"finds",children:n.map(ne=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:ne.open,title:ne.open?"Этот проект уже открыт":ne.path,onClick:()=>A(ne.path),onDoubleClick:()=>v(ne.path),children:[i.jsx("span",{className:"find__name",children:ne.name}),i.jsx("span",{className:"find__path",children:ne.path}),i.jsx("span",{className:"find__note",children:ck(ne)})]})},ne.path))}),n.length===0&&I&&!l&&!D&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),D&&i.jsx("div",{className:"finds__agent",children:i.jsx(hf,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),i.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),i.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Q,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:ne=>z(ne.target.value)}),u.length>0&&i.jsx("div",{className:"newproj__roots",children:u.map(ne=>i.jsx("button",{type:"button",className:ne===G?"newproj__root is-on":"newproj__root",title:ne,onClick:()=>z(ne),children:rk(ne)},ne))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:H,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:ne=>L(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),Z())}}),i.jsx("p",{className:"newproj__preview",children:je?ak(G,se):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Gd,{label:"AGENTS.md",desc:"инструкции проекта для Codex",on:U.agentsMd??!1,onToggle:()=>V(ne=>({...ne,agentsMd:!ne.agentsMd}))}),i.jsx(Gd,{label:"git init",desc:"панель истории работает сразу",on:U.git,onToggle:()=>V(ne=>({...ne,git:!ne.git}))}),i.jsx(Gd,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:U.claudeMd,onToggle:()=>V(ne=>({...ne,claudeMd:!ne.claudeMd}))}),i.jsx(Gd,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:U.readme,onToggle:()=>V(ne=>({...ne,readme:!ne.readme}))})]})]})]})}function Pb({label:n,on:l,onClick:r}){return i.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:n})}function Gd({label:n,desc:l,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[i.jsxs("span",{className:"newproj__optlabel",children:[n,i.jsx("span",{className:"newproj__optdesc",children:l})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function ak(n,l){const r=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+r+l}function rk(n){const l=n.includes("\\")?"\\":"/",r=n.split(/[\\/]/).filter(Boolean);return r.length<=2?n:`…${l}${r.slice(-2).join(l)}`}function ck(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${ok(n.sessions)}${uk(n.lastUsedAt)}`}function ok(n){const l=n%10,r=n%100;return r>=11&&r<=14?`${n} сессий`:l===1?`${n} сессия`:l>=2&&l<=4?`${n} сессии`:`${n} сессий`}function uk(n){if(!n)return"";const l=Math.floor((Date.now()-n)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const tm=7;function dk(n){const l=[],r=[];let c=1;for(const o of n){const u=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=Wb(l),l[h]=o.hash);const[p,...g]=o.parents;l[h]=p??null;const x=[];p!==void 0&&x.push({from:h,to:h});for(const _ of g){let S=l.indexOf(_);S===-1&&(S=Wb(l),l[S]=_),x.push({from:h,to:S})}const v=[];for(let _=0;_<u.length;_++)u[_]===o.hash&&(v.push({from:_,to:h}),_!==h&&(l[_]=null));const j=[];for(let _=0;_<u.length;_++){const S=u[_];!S||S===o.hash||_===h||l[_]===S&&j.push(_)}fk(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:v,down:x,through:j})}return{rows:r,columns:Math.min(c,tm)}}function Wb(n){const l=n.indexOf(null);return l!==-1?l:(n.push(null),n.length-1)}function fk(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const ky=1500;function hk(n){const l=[];let r=!1;for(const c of n.patch.split(`
|
|
128
|
-
`)){if(l.length>=ky){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:pk(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:l,added:n.added,removed:n.removed,note:mk(n,r)}}function pk(n){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!l)return n;const r=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),u=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${u} · ${o}`:`⋯ ${u}`}function mk(n,l){const r=[];return n.status==="added"&&r.push("новый файл"),n.status==="deleted"&&r.push("файл удалён"),n.status==="renamed"&&r.push(`переименован из ${n.oldPath}`),n.binary?r.push("двоичный файл"):n.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${ky} строк`),r.length>0?r.join(" · "):null}function gk({open:n,state:l,result:r,selected:c,busy:o,onRefresh:u,onShow:h,onCheckout:p,onPush:g,onPull:x,onPublish:v,onConnectRemote:j,onDismissResult:_,onClose:S,zoomed:k,onToggleZoom:E}){const A=dk((l==null?void 0:l.commits)??[]),D=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(q=>({value:q.name,label:q.name,hint:q.hash.slice(0,8)}))];return i.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:q=>{E&&(q.target.closest("button")||E())},children:[i.jsx(jk,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:u,children:"↻"}),E&&i.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:E,children:i.jsx(Pc,{active:k})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:S,children:"✕"})]}),l===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"gitbar",children:[i.jsx(jl,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:D,onChange:q=>{q&&p(q,`ветку ${q}`)}}),i.jsx(Fc,{text:l.detached?l.head:l.branch,hint:l.detached?"хеш HEAD":"имя ветки"})]}),l.detached&&i.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),i.jsx("div",{className:"gitbar__actions",children:o?i.jsxs("p",{className:"gitbar__busy",children:[i.jsx(Sk,{}),o]}):l.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(wk,{}),"Отправить",l.ahead>0&&i.jsx("span",{className:"gitbar__count",children:l.ahead})]}),i.jsxs("div",{className:"gitbar__group",children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[i.jsx(Nk,{}),"Забрать",l.behind>0&&i.jsx("span",{className:"gitbar__count",children:l.behind})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:i.jsx(kk,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:v,children:[i.jsx(t_,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${Ak(l.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(q=>Ck(q.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(q=>i.jsx(bk,{row:q,columns:A.columns,head:q.commit.hash===l.head,local:l.hasRemote&&!q.commit.pushed,active:c===q.commit.hash,onOpen:()=>h(q.commit.hash)},q.commit.hash)),A.rows.length===0&&i.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):i.jsxs("div",{className:"gitempty",children:[i.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:v,children:[i.jsx(t_,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(Or,{result:r,onDismiss:_})]})}const lu=50,e_=13,xk=500;function bk({row:n,columns:l,head:r,local:c,active:o,onOpen:u}){const{commit:h}=n,p=h.refs.map(Ek).filter(Boolean),[g,x]=b.useState(null),v=b.useRef(null);function j(E){const A=E.touches[0];if(!A)return;const D={timer:0,x:A.clientX,y:A.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,x({x:D.x,y:D.y})},xk),v.current=D}function _(E){const A=v.current,D=E.touches[0];!A||!D||Math.hypot(D.clientX-A.x,D.clientY-A.y)>10&&(window.clearTimeout(A.timer),v.current=null)}function S(E){const A=v.current;A&&(window.clearTimeout(A.timer),A.fired&&E.preventDefault())}function k(){const E=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void vi(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void vi(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void vi(h.subject)}],A=new Set;for(const D of h.refs){const q=D.startsWith("tag: "),Q=Tk(D);!Q||A.has(Q)||(A.add(Q),E.push({id:`ref:${Q}`,label:q?"Копировать тег":"Копировать ветку",hint:Q,onSelect:()=>void vi(Q)}))}return E}return i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var E;if((E=v.current)!=null&&E.fired){v.current=null;return}u()},onContextMenu:E=>{E.preventDefault(),x({x:E.clientX,y:E.clientY})},onTouchStart:j,onTouchMove:_,onTouchEnd:S,onTouchCancel:S,children:[i.jsx(_k,{row:n,columns:l,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[p.map(E=>i.jsx("span",{className:"gitrow__ref",children:E},E)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Rk(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&i.jsx(qa,{x:g.x,y:g.y,items:k(),onClose:()=>x(null)})]})}function _k({row:n,columns:l,head:r,local:c}){const o=l*e_+6,u=lu/2,h=x=>8+Math.min(x,tm-1)*e_,p=c?"3.5 2.5":void 0,g=$d(n.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:lu,viewBox:`0 0 ${o} ${lu}`,"aria-hidden":"true",children:[n.through.map(x=>i.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:lu,style:{stroke:$d(x)}},`t${x}`)),n.up.map((x,v)=>i.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${u-12} L${h(x.to)} ${u}`,fill:"none",style:{stroke:$d(x.from),strokeDasharray:p}},`u${v}`)),n.down.map((x,v)=>i.jsx("path",{d:`M${h(x.from)} ${u} L${h(x.to)} ${u+12} L${h(x.to)} ${lu}`,fill:"none",style:{stroke:$d(x.to),strokeDasharray:p}},`d${v}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:u,r:n.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:u,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function $d(n){return`var(--lane-${n%tm})`}function yk({detail:n,local:l,onCheckout:r,onClose:c}){const o=n.hash==="";return i.jsxs(us,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(n.hash,`коммит ${n.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),i.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&i.jsxs("div",{className:"commit__head",children:[i.jsxs("div",{className:"commit__line",children:[i.jsx("p",{className:"commit__subject",children:n.subject}),i.jsx(Fc,{text:n.subject,hint:"сообщение коммита"})]}),i.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",Mk(n.date)]}),i.jsxs("div",{className:"commit__line commit__line--hash",children:[i.jsx("span",{className:"commit__hash",children:n.hash}),i.jsx(Fc,{text:n.hash,hint:"хеш коммита"})]}),l&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),n.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[n.parents.length>1?"слияние: ":"родитель: ",n.parents.map(u=>u.slice(0,8)).join(", ")]}),n.body&&i.jsx("pre",{className:"commit__body",children:n.body})]}),n.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),n.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):n.files.map(u=>i.jsx(vk,{file:u,defaultOpen:n.files.length<=3},u.path+u.oldPath))]})}function vk({file:n,defaultOpen:l}){const[r,c]=b.useState(l);return i.jsxs("div",{className:"commit__file",children:[i.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"commit__filepath",children:n.path||n.oldPath}),i.jsxs("span",{className:"diff__stat",children:[n.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(Fp,{diff:hk(n)})]})}function jk(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function wk(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function Nk(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function kk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"m13 13-2.6-2.6"})]})}function t_(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:i.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 Sk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Ek(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Tk(n){const l=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return l==="HEAD"?"":l}function Ck(n){const l=n.split("/");return l[l.length-1]??n}function Ak(n){const l=n%100;if(l>=11&&l<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Rk(n){const l=Date.parse(n);if(Number.isNaN(l))return n;const r=Math.round((Date.now()-l)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Mk(n){const l=Date.parse(n);return Number.isNaN(l)?n:new Date(l).toLocaleString()}function n_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Dk({status:n,owners:l,files:r,defaultName:c,hasCommits:o,busy:u,result:h,onRefreshStatus:p,onSaveToken:g,onPublish:x,onDismissResult:v,onClose:j}){var ne;const[_,S]=b.useState(()=>n_(c)),[k,E]=b.useState(""),[A,D]=b.useState(""),[q,Q]=b.useState(!0),[z,H]=b.useState("Первый коммит"),[L,U]=b.useState(null),[V,R]=b.useState("");b.useEffect(()=>{!k&&l.length>0&&E(l[0].login)},[k,l]),b.useEffect(()=>{r&&L===null&&U(new Set(r.files))},[r,L]);const I=(n==null?void 0:n.connected)===!0,G=l.map(me=>({value:me.login,label:me.login,hint:me.kind==="org"?"организация":void 0})),se=b.useMemo(()=>{if(!r)return[];const me=V.trim().toLowerCase();return me?r.files.filter(ke=>ke.toLowerCase().includes(me)):r.files},[r,V]),je=(L==null?void 0:L.size)??0,we=I&&_.trim()!==""&&k!==""&&u===""&&(o||je>0);function Ne(me){U(ke=>{const T=new Set(ke??[]);return T.has(me)?T.delete(me):T.add(me),T})}function Z(me){U(ke=>{const T=new Set(ke??[]);for(const K of se)me?T.add(K):T.delete(K);return T})}function $(){if(!we)return;const me=(r==null?void 0:r.files)??[];x({owner:k,name:_.trim(),description:A.trim(),private:q,include:o?[]:me.filter(ke=>L==null?void 0:L.has(ke)),ignore:o?[]:me.filter(ke=>!(L!=null&&L.has(ke))),message:o?"":z.trim()||"Первый коммит"})}return i.jsxs(us,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!we,onClick:$,children:u||"Опубликовать"})]}),children:[i.jsx(Ok,{status:n,onRefreshStatus:p,onSaveToken:g}),i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Имя"}),i.jsx("input",{className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",onChange:me=>S(n_(me.target.value))})]}),_.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),l.length>1?i.jsx(jl,{className:"settings__select",value:k,options:G,onChange:E,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((ne=l[0])==null?void 0:ne.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:me=>D(me.target.value)})]}),i.jsxs("div",{className:"field publish__field",children:[i.jsx("span",{children:"Видимость"}),i.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[i.jsx(s_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:q,onClick:()=>Q(!0)}),i.jsx(s_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!q,onClick:()=>Q(!1)})]})]})]}),!o&&i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?i.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"publish__filehead",children:[i.jsxs("span",{className:"publish__filecount",children:[je," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>Z(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>Z(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:V,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:me=>R(me.target.value)}),i.jsx("div",{className:"publish__filelist",children:se.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):se.map(me=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(L==null?void 0:L.has(me))===!0,className:"publish__file",onClick:()=>Ne(me),children:[i.jsx("span",{className:"publish__box"+(L!=null&&L.has(me)?" is-on":""),"aria-hidden":"true",children:(L==null?void 0:L.has(me))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:me})]},me))}),r.truncated&&i.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Сообщение коммита"}),i.jsx("input",{className:"input",value:z,onChange:me=>H(me.target.value)})]})]})]}),i.jsx(Or,{result:h,onDismiss:v})]})}function s_({title:n,desc:l,on:r,risky:c,onClick:o}){return i.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[n,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:l})]})]})}function Ok({status:n,onRefreshStatus:l,onSaveToken:r}){const[c,o]=b.useState(""),[u,h]=b.useState(!1);return i.jsxs("div",{className:"publish__section publish__section--first",children:[i.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),n===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):n.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:n.login}),i.jsx("span",{className:"publish__accountvia",children:n.source==="gh"?"через GitHub CLI":"по личному токену"}),n.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[n.ghInstalled&&i.jsxs("p",{className:"modal__text",children:["В системе установлен ",i.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",i.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Личный токен GitHub"}),i.jsx(Lk,{value:c,onChange:o,visible:u,onToggleVisible:()=>h(p=>!p),placeholder:"ghp_…"})]}),i.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",i.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",i.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),n.message&&i.jsx("p",{className:"modal__error",children:n.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Lk({value:n,onChange:l,visible:r,onToggleVisible:c,placeholder:o,autoFocus:u}){return i.jsxs("div",{className:"pwfield",children:[i.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:u,onChange:h=>l(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(Ik,{}):i.jsx(zk,{})})]})}function zk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function Ik(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),i.jsx("path",{d:"M2 14 14 2"})]})}function Uk({busy:n,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[u,h]=b.useState(""),p=/^(https?|ssh|git):\/\/\S+/i.test(u.trim())||/^[\w.-]+@[\w.-]+:.+/.test(u.trim());return i.jsxs(us,{title:"Подключить существующий репозиторий",onClose:o,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!p||n!=="",onClick:()=>r(u.trim()),children:n||"Подключить"})]}),children:[i.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",i.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Адрес репозитория"}),i.jsx("input",{className:"input input--mono",value:u,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&p&&n===""&&r(u.trim())}})]}),i.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",i.jsx("code",{children:"https://…"}),", ",i.jsx("code",{children:"ssh://…"}),", ",i.jsx("code",{children:"git://…"})," и"," ",i.jsx("code",{children:"git@host:path"}),"."]}),i.jsx(Or,{result:l,onDismiss:c})]})}function Hk({open:n,items:l,busy:r,ready:c,sendBlocked:o,commands:u,contextResult:h,draftKey:p,models:g,model:x,effort:v,ultracode:j,thinking:_,switchOnFlag:S,onContextSearch:k,onCommand:E,onModel:A,onEffort:D,onUltracode:q,onThinking:Q,onSwitchOnFlag:z,onAsk:H,onInterrupt:L,onReset:U,onClose:V,zoomed:R,onToggleZoom:I}){return i.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(R?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:G=>{I&&(G.target.closest("button")||I())},children:[i.jsx(Bk,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:U,children:"↻"}),I&&i.jsx("button",{className:"sidepane__btn",title:R?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":R?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":R,onClick:I,children:i.jsx(Pc,{active:R})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:V,children:"✕"})]}),g.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Ny,{className:"select--compact",models:g,value:x,effort:v,ultracode:j,thinking:_,switchOnFlag:S,onModel:A,onEffort:D,onUltracode:q,onThinking:Q,onSwitchOnFlag:z}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(hf,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(em,{className:"composer--side",disabled:!c,busy:r,commands:u,sessionTitle:null,contextResult:h,draftKey:p?`side:${p}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:E,onSend:H,onInterrupt:L,onEscape:r?L:V})]})}function Bk(){return i.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:[i.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"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const qk=75,Gk=90;function Sy({usage:n}){if(!(n!=null&&n.available))return null;const l=n.buckets??[],r=l.length>0?l.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(r.length===0)return null;const c=l.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return i.jsx("div",{className:"usage",title:Vk(n,l),"aria-label":c,children:r.map(o=>i.jsx($k,{label:o.label,window:o.window},o.key))})}function $k({label:n,window:l}){const r=Math.round(l.utilization),c=Qk(l.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:n}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":n,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${Yk(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:nm(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Yk(n){return n>=Gk?" usage__fill--over":n>=qk?" usage__fill--warn":""}function Vk(n,l){if(l.length>0)return Xk(l);const r=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,u)=>{if(!u)return;const h=nm(u.resetsAt);r.push(`${o}: ${Math.round(u.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),r.join(`
|
|
129
|
-
`)}function Xk(n){const l=["Квота Antigravity"];for(const r of n){const c=nm(r.window.resetsAt),o=Math.round(r.window.utilization);l.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&l.push(r.description)}return l.join(`
|
|
130
|
-
`)}function Ey(n){if(!n)return null;const l=new Date(n);return Number.isNaN(l.getTime())?null:l}function Ty(n){return n.getTime()-Date.now()<1440*60*1e3}function Qk(n){const l=Ey(n);return l?Ty(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function nm(n){const l=Ey(n);return l?`обнулится ${Ty(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function Cy(){const[n,l]=b.useState(()=>new Date);return b.useEffect(()=>{let r=0;const c=()=>{const u=new Date;l(u),r=window.setTimeout(c,6e4-(u.getSeconds()*1e3+u.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),i.jsxs("time",{className:"clock",dateTime:n.toISOString(),title:Kk(n),children:[i.jsx("span",{className:"clock__time",children:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:n.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function Kk(n){return n.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Zk({onClose:n,permission:l,model:r,usage:c,cwd:o,costLabel:u,onRefresh:h,refreshing:p,metersFetchedAt:g,onRename:x,onHandoff:v,onFreshSession:j,handoffWriting:_,onStop:S}){const k=L_({onLongPress:()=>j==null?void 0:j(),onClick:()=>v==null?void 0:v(),disabled:_});return i.jsx(us,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:n,children:i.jsxs("div",{className:"sessionmenu",children:[l&&i.jsx(Oc,{label:"Режим прав",children:l}),i.jsx(Oc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&i.jsx(Oc,{label:"Лимиты плана",children:i.jsx(Sy,{usage:c})}),i.jsxs("button",{type:"button",className:p?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":p,disabled:p,onClick:h,children:[i.jsx(Fk,{}),i.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",g&&i.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsx(Oc,{label:"Время",children:i.jsx(Cy,{})}),u&&i.jsx(Oc,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:u})}),o&&i.jsx(Oc,{label:"Каталог проекта",children:i.jsx(wy,{path:o})}),x&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"}),v&&i.jsxs("button",{type:"button",className:_?"sessionmenu__handoff is-busy":k.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${k.thresholdMs}ms`},"aria-busy":_,disabled:_,...k.handlers,children:[i.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),i.jsxs("span",{className:"sessionmenu__handoff-text",children:[_?"Пишется хэндофф…":"Хэндофф и новая сессия",!_&&i.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),S&&i.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:S,children:"Остановить сессию"})]})})}function Oc({label:n,children:l}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:n}),l]})}function Fk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Jk({tab:n,servers:l,plugins:r,marketplaces:c,catalog:o,result:u,auth:h,remote:p,actions:g,onTab:x,onClose:v}){const j=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(us,{title:"Расширения",className:"modal--wide",onClose:v,children:[i.jsx("div",{className:"tabs",role:"tablist",children:j.map(_=>i.jsxs("button",{role:"tab","aria-selected":n===_.id,className:n===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>x(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),n==="mcp"&&i.jsx(Pk,{servers:l,auth:h,remote:p,actions:g}),n==="plugins"&&i.jsx(lS,{plugins:r,marketplaces:c,actions:g}),n==="catalog"&&i.jsx(iS,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),i.jsx(Or,{result:u})]})}function Pk({servers:n,auth:l,remote:r,actions:c}){const[o,u]=b.useState(!1);return i.jsxs(i.Fragment,{children:[n.length===0&&!o&&i.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",i.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",i.jsx("code",{children:"claude mcp list"}),"."]}),i.jsx("ul",{className:"extlist",children:n.map(h=>{const p=(l==null?void 0:l.name)===h.name?l:null,g=p!==null&&p.active&&p.url==="",x=p!==null&&p.active&&p.url!=="";return i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:h.name}),i.jsx("span",{className:`chip chip--${tS(h.status)}`,children:eS[h.status]}),h.scope&&i.jsx("span",{className:"chip",children:h.scope}),h.transport&&i.jsx("span",{className:"chip",children:h.transport})]}),h.target&&i.jsx("div",{className:"extlist__meta",title:h.target,children:h.target}),h.error&&i.jsx("div",{className:"extlist__error",children:h.error}),h.tools.length>0&&i.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",h.tools.length," · ",h.tools.slice(0,6).join(", "),h.tools.length>6&&"…"]}),i.jsxs("div",{className:"extlist__actions",children:[h.status==="needs-auth"&&i.jsx("button",{className:x?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":x?"Начать заново":"Авторизовать"}),i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"reconnect"),children:"Переподключить"}),h.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"disable"),children:"Выключить"}),h.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>c.mcpRemove(h.name),children:"Удалить"})]}),p&&i.jsx(Wk,{auth:p,remote:r,actions:c})]},h.name)})}),o?i.jsx(nS,{onCancel:()=>u(!1),onSubmit:(h,p)=>{c.mcpAdd(h,p),u(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>u(!0),children:"+ Сервер"})})]})}function Wk({auth:n,remote:l,actions:r}){const[c,o]=b.useState("");function u(){const g=c.trim();g!==""&&(r.mcpAuthCallback(n.name,g),o(""))}if(!n.active)return n.error?i.jsx("div",{className:"extlist__error",children:n.error}):n.done?i.jsxs("div",{className:"extauth extauth--done",role:"status",children:[i.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=i.jsxs("div",{className:"extauth__paste",children:[l&&i.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${n.name}`,children:"Адрес из строки браузера после входа"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:`mcp-cb-${n.name}`,"aria-label":"Адрес из строки браузера после входа",className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off",placeholder:"http://localhost:…/callback?code=…",onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),u())}}),i.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:u,children:"Отправить"})]}),i.jsx("p",{className:"extauth__hint",children:l?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),p=n.callbackExpected&&(l?h:i.jsxs("details",{className:"extauth__more",children:[i.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return i.jsxs("div",{className:"extauth",role:"status",children:[n.url&&i.jsxs(i.Fragment,{children:[i.jsx("a",{className:"btn btn--primary extauth__go",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!l&&i.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),p,n.error&&i.jsx("div",{className:"extlist__error",children:n.error}),i.jsxs("div",{className:"extauth__wait",children:[i.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const eS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function tS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function nS({onSubmit:n,onCancel:l}){const[r,c]=b.useState(""),[o,u]=b.useState("stdio"),[h,p]=b.useState(""),[g,x]=b.useState(""),[v,j]=b.useState(""),_=o==="stdio",S=r.trim()!==""&&(_?h.trim()!=="":g.trim()!=="");function k(){if(S)if(_){const[E,...A]=sS(h);n(r.trim(),{transport:"stdio",command:E??"",args:A,env:l_(v)})}else n(r.trim(),{transport:o,url:g.trim(),headers:l_(v)})}return i.jsxs("div",{className:"extform extform--card",children:[i.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),i.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:E=>c(E.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(jl,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:E=>u(E)}),_?i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),i.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:E=>p(E.target.value)})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),i.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:E=>x(E.target.value)})]}),i.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[_?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),i.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:v,spellCheck:!1,placeholder:_?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:E=>j(E.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:k,children:"Подключить"})]})]})}function l_(n){const l={};for(const r of n.split(`
|
|
131
|
-
`)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),u=c.indexOf(":"),h=o===-1?u:u===-1?o:Math.min(o,u);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function sS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function lS({plugins:n,marketplaces:l,actions:r}){const[c,o]=b.useState("");return i.jsxs(i.Fragment,{children:[n.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:n.map(u=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:u.name}),i.jsx("span",{className:u.enabled?"chip chip--ok":"chip chip--mute",children:u.enabled?"включён":"выключен"}),u.version&&u.version!=="unknown"&&i.jsx("span",{className:"chip",children:u.version}),u.scope&&i.jsx("span",{className:"chip",children:u.scope})]}),u.marketplace&&i.jsx("div",{className:"extlist__meta",children:u.marketplace}),u.mcpServers.length>0&&i.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",u.mcpServers.join(", ")]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(u.id,!u.enabled),children:u.enabled?"Выключить":"Включить"}),i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(u.id),children:"Удалить"})]})]},u.id))}),i.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),i.jsx("ul",{className:"extlist",children:l.map(u=>i.jsxs("li",{className:"extlist__row",children:[i.jsx("div",{className:"extlist__head",children:i.jsx("span",{className:"extlist__name",children:u.name})}),u.source&&i.jsx("div",{className:"extlist__meta",children:u.source}),i.jsx("div",{className:"extlist__actions",children:i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(u.name),children:"Отключить"})})]},u.name))}),i.jsxs("div",{className:"extform__row",children:[i.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(),r.marketplaceAdd(c.trim()),o(""))}}),i.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const iu=30;function iS({catalog:n,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,u]=b.useState(""),[h,p]=b.useState(""),[g,x]=b.useState(iu),[v,j]=b.useState(""),_=b.useMemo(()=>[...new Set(n.map(E=>E.category).filter(Boolean))].sort(),[n]),S=b.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(E=>h&&E.category!==h?!1:k?`${E.name} ${E.displayName} ${E.description} ${E.author}`.toLowerCase().includes(k):!0)},[n,o,h]);return n.length===0?i.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",i.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"catalog__filters",children:[i.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{u(k.target.value),x(iu)}}),i.jsx(jl,{title:"Категория",value:h,options:[{value:"",label:"все категории"},..._.map(k=>({value:k,label:k}))],onChange:k=>{p(k),x(iu)}})]}),S.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:S.slice(0,g).map(k=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&i.jsx("span",{className:"chip",children:k.version}),k.category&&i.jsx("span",{className:"chip",children:k.category})]}),k.description&&i.jsx("div",{className:"catalog__desc",children:k.description}),i.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>r.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),S.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>x(k=>k+iu),children:["Ещё ",Math.min(iu,S.length-g)," из ",S.length-g]})}),i.jsxs("div",{className:"extform",children:[i.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:"plugin-spec",className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||v.trim()===""||(k.preventDefault(),r.pluginInstall(v.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:v.trim()==="",onClick:()=>{r.pluginInstall(v.trim()),j("")},children:"Установить"})]})]})]})}function aS({status:n,login:l,actions:r,remote:c,runningSessions:o,onReconnect:u,reconnectBlocked:h,reconnectHint:p,onClose:g}){const[x,v]=b.useState(""),[j,_]=b.useState(!1),[S,k]=b.useState(!1),E=u!==null&&(n==null?void 0:n.loggedIn)===!0&&!S&&!j,A=b.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const Q=l.output.trim();return Q===""?null:{ok:!0,message:Q}},[l.error,l.output]);function D(Q=x){const z=Q.trim();z!==""&&(r.submitCode(z),v(""))}function q(){if(o>0){_(!1),k(!0);return}r.login("claudeai",!0)}return i.jsxs(us,{title:"Аккаунт",onClose:g,children:[n===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):n.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:n.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:oS[n.method]??n.method}),n.plan&&i.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&i.jsx("div",{className:"extlist__meta",children:n.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?i.jsx(uS,{login:l,remote:c,code:x,onCode:v,onSubmit:D,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(Or,{result:A}),S&&i.jsx("p",{className:"account__warn",role:"alert",children:rS(o)}),E&&h&&i.jsx("p",{className:"account__note",children:p}),i.jsx("div",{className:`extbar${n!=null&&n.loggedIn?" account__bar":""}`,children:n!=null&&n.loggedIn?i.jsxs(i.Fragment,{children:[E&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
132
|
-
${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:u,children:[i.jsx(cS,{}),"Переподключить"]}),S?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:q,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{_(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{k(!1),_(!0)},children:"Выйти"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function rS(n){const l=n%10,r=n%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function cS(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const oS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function uS({login:n,remote:l,code:r,onCode:c,onSubmit:o,onCancel:u}){var k;const[h,p]=b.useState(null),g=b.useRef(""),x=b.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const v=b.useCallback(async E=>{const{code:A,onCode:D,onSubmit:q}=x.current;if(E&&A.trim()!=="")return;const Q=await Ep();if(Q===null){E||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const z=Q.trim();if(!i_(z)){E||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(E){if(g.current===z)return;g.current=z}p(null),D(z),q(z)},[]);b.useEffect(()=>{if(!n.awaitingCode)return;const E=()=>{document.visibilityState==="visible"&&v(!0)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[n.awaitingCode,v]);const j=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",_=r.trim()!==""&&!i_(r),S=h??(_?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[n.url?l?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:n.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),i.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),i.jsxs("div",{className:"account__raw",children:[i.jsx("span",{className:"account__rawurl",children:n.url}),i.jsx(Fc,{text:n.url,hint:"ссылку входа"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),i.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),i.jsxs("details",{className:"account__fallback",children:[i.jsx("summary",{children:"Браузер не открылся"}),i.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),i.jsx("a",{className:"account__link",href:n.url,target:"_blank",rel:"noreferrer",children:n.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),n.awaitingCode&&i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),i.jsxs("div",{className:"extform__row account__coderow",children:[i.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:E=>{p(null),c(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void v(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),S&&i.jsx("p",{className:"account__note account__note--code",children:S})]}),n.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:n.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:u,children:"Отменить вход"})})]})}function i_(n){const l=n.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}function dS({state:n,onPair:l,onUnpair:r,onClose:c}){const[o,u]=b.useState(""),[h,p]=b.useState(""),[g,x]=b.useState(!1),v=b.useRef(null),j=(n==null?void 0:n.paired)===!0;b.useEffect(()=>{var S;j||(S=v.current)==null||S.focus()},[j]),b.useEffect(()=>{x(!1),j&&u("")},[j,n==null?void 0:n.error]);const _=(n==null?void 0:n.url)??"https://claudevisual.com";return i.jsx(us,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:a_(_)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(n==null?void 0:n.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:n!=null&&n.connected?"dot dot--on":"dot"})," ",n!=null&&n.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(n==null?void 0:n.clients)??0," вкладок"]})]})]}),(n==null?void 0:n.error)&&i.jsx("p",{className:"relay__error",children:n.error}),i.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),i.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),i.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):i.jsxs("div",{className:"relay",children:[i.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),i.jsxs("ol",{className:"relay__steps",children:[i.jsxs("li",{children:["Откройте ",i.jsx("b",{children:a_(_)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:S=>{S.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:v,className:"input relay__code",value:o,onChange:S=>u(S.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Как назвать этот компьютер"}),i.jsx("input",{className:"input",value:h,onChange:S=>p(S.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(n==null?void 0:n.error)&&i.jsx("p",{className:"relay__error",children:n.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function a_(n){try{return new URL(n).host}catch{return n}}const r_=[{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"}],dp="",fS=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],hS=R_.map(n=>({value:n.value,label:n.value,hint:n.hint})),Yd=3600*1e3,pS=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],zc={"6h":6*Yd,"24h":24*Yd,"48h":48*Yd,"168h":168*Yd,never:0};function mS(n){return zc[n]??zc["48h"]}const gS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Vd=60*1e3,Ic={"5m":5*Vd,"10m":10*Vd,"30m":30*Vd,"60m":60*Vd,never:0};function xS(n){return Ic[n]??Ic["10m"]}function bS(n){const l=Object.entries(Ic).find(([,r])=>r===n);return l?l[0]:Object.keys(Ic).reduce((r,c)=>Math.abs(Ic[c]-n)<Math.abs(Ic[r]-n)?c:r)}function _S(n){const l=Object.entries(zc).find(([,r])=>r===n);return l?l[0]:Object.keys(zc).reduce((r,c)=>Math.abs(zc[c]-n)<Math.abs(zc[r]-n)?c:r)}const yS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Uc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function vS(n){return Uc[n]??Uc.off}function c_(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function jS(n){const l=Object.entries(Uc).find(([,r])=>r===n);return l?l[0]:Object.keys(Uc).reduce((r,c)=>Math.abs(Uc[c]-n)<Math.abs(Uc[r]-n)?c:r)}const wS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function NS({themeMode:n,onThemeChange:l,settings:r,models:c,relayState:o,networkState:u,local:h,onChange:p,onEnableShell:g,onDisableShell:x,onOpenRelay:v,onClose:j}){const _=r===null,[S,k]=b.useState(""),[E,A]=b.useState(null),D=!_&&r.networkGuardEnabled,q=(r==null?void 0:r.networkGuardBlockedCountries)??[];function Q(){const R=S.trim().toUpperCase();if(R!==""){if(!/^[A-Z]{2}$/.test(R)){A("Нужен код из двух латинских букв, например RU или CN.");return}if(q.includes(R)){A(`Код ${R} уже в списке.`);return}A(null),k(""),p({networkGuardBlockedCountries:[...q,R]})}}const z=!_&&r.terminalEnabled===!0,H=!_&&r.liveSessionsFirst===!0,L=!z,U=b.useMemo(()=>{const R=[{value:dp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...c.length>0?c.map(I=>({value:I.value,label:I.displayName,hint:I.description})):fS];return r&&r.startModel!==null&&!R.some(I=>I.value===r.startModel)&&R.push({value:r.startModel,label:r.startModel}),R},[c,r]);function V(){var R,I;return(o==null?void 0:o.paired)!==!0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),i.jsx("button",{type:"button",className:"btn",disabled:L,onClick:v,children:"Связать компьютер"})]}):(R=o.shell)!=null&&R.enabled?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",o.shell.confirmedAt&&` Включено ${new Date(o.shell.confirmedAt).toLocaleString()}.`]}),i.jsx("button",{type:"button",className:"btn btn--danger",disabled:L,onClick:x,children:"Запретить"})]}):(I=o.shell)!=null&&I.pending?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",i.jsx("b",{children:o.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),i.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),i.jsx("button",{type:"button",className:"btn",disabled:L,onClick:g,children:"Отправить письмо ещё раз"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),h?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),i.jsx("button",{type:"button",className:"btn",disabled:L,onClick:g,children:"Разрешить с телефона"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),i.jsx("button",{type:"button",className:"btn",disabled:L,onClick:g,children:"Прислать письмо"})]})]})}return i.jsx(us,{title:"Настройки",onClose:j,children:i.jsxs("div",{className:"settings",children:[i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Тема оформления"}),i.jsx("p",{className:"settings__hint",children:"Свет и тьма — два состояния одного пространства. Оформление одинаково для всех подключённых агентов."}),i.jsx(jl,{title:"Тема оформления",value:n,options:[{value:"system",label:"Ритм системы",hint:"следовать настройке вашего устройства"},{value:"light",label:"Свет",hint:"молочные поверхности и мягкие тени"},{value:"dark",label:"Тьма",hint:"графит, светящиеся орбиты и глубокие тени"}],onChange:R=>l(R)})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),i.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(jl,{className:"settings__select",value:_S(r.autoArchiveAfterMs),options:pS,onChange:R=>p({autoArchiveAfterMs:mS(R)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(jl,{className:"settings__select",value:bS(r.autoStopAfterMs),options:gS,onChange:R=>p({autoStopAfterMs:xS(R)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),i.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:r.limitStopFiveHourPct,onChange:R=>p({limitStopFiveHourPct:c_(R.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:r.limitStopSevenDayPct,onChange:R=>p({limitStopSevenDayPct:c_(R.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),i.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),_?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":D,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:D?"switch is-on":"switch",onClick:()=>p({networkGuardEnabled:!D}),children:i.jsx("span",{className:"switch__knob"})})]}),D&&u&&i.jsx("p",{className:u.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:u.status==="blocked"?u.reason??"Маршрут не прошёл проверку.":u.country?`Сейчас: ${u.country} — всё в порядке.`:"Сейчас всё в порядке."}),i.jsxs("div",{className:D?"settings__field":"settings__field settings__nested is-disabled",children:[i.jsx("span",{className:"settings__field-label",children:"Запрещённые страны"}),i.jsxs("ul",{className:"countries","aria-label":"Запрещённые страны",children:[q.map(R=>i.jsxs("li",{className:"countries__chip",children:[i.jsx("span",{children:R}),i.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${R} из списка`,disabled:!D,onClick:()=>p({networkGuardBlockedCountries:q.filter(I=>I!==R)}),children:"×"})]},R)),q.length===0&&i.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),i.jsxs("form",{className:"countries__add",onSubmit:R=>{R.preventDefault(),Q()},children:[i.jsx("input",{type:"text",className:"input countries__input",value:S,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!D,"aria-label":"Код страны, две буквы","aria-invalid":E!==null,onChange:R=>{k(R.target.value.toUpperCase()),A(null)}}),i.jsx("button",{type:"submit",className:"btn",disabled:!D||S.trim()==="",children:"Добавить"})]}),E&&i.jsx("p",{className:"settings__hint countries__error",role:"alert",children:E})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(jl,{className:"settings__select",value:jS(r.autoSaveAfterPauseMs),options:yS,onChange:R=>p({autoSaveAfterPauseMs:vS(R)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Агенты"}),i.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),r_.map(R=>{const I=(r==null?void 0:r.enabledProviders)??["claude","antigravity","codex"],G=!_&&I.includes(R.id),se=G&&I.length<=1;return i.jsxs("div",{className:"settings__switch-row settings__agent",children:[i.jsx("span",{className:`newsession__mark newsession__mark--${R.id}`,"aria-hidden":"true",children:R.id==="codex"?i.jsx("span",{className:"codex-mark",children:"C"}):R.id==="antigravity"?i.jsx(Kp,{className:"newsession__mark-logo"}):i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),i.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[i.jsx("span",{className:"settings__field-label",children:R.label}),i.jsx("span",{className:"settings__hint",children:se?"Хотя бы один агент должен остаться включённым":R.hint})]}),_?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":G,"aria-label":R.label,disabled:se,title:se?"Хотя бы один агент должен остаться включённым":void 0,className:G?"switch is-on":"switch",onClick:()=>{const je=r_.map(we=>we.id).filter(we=>we===R.id?!G:I.includes(we));p({enabledProviders:je})},children:i.jsx("span",{className:"switch__knob"})})]},R.id)})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),i.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Модель"}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(jl,{className:"settings__select",value:r.startModel??dp,options:U,onChange:R=>p({startModel:R===dp?null:R}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),_?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(jl,{className:"settings__select",value:r.startPermissionMode,options:hS,onChange:R=>p({startPermissionMode:R}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsx("section",{className:"settings__section",children:i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),i.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),_?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":H,"aria-label":"Запущенные сессии сверху",className:H?"switch is-on":"switch",onClick:()=>p({liveSessionsFirst:!H}),children:i.jsx("span",{className:"switch__knob"})})]})}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),i.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),i.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:wS.map(R=>{const I=!_&&r.folderAccess===R.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":I,disabled:_,className:"access__card"+(I?" is-on":"")+(R.risky?" access__card--risky":""),onClick:()=>p({folderAccess:R.value}),children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[R.title,R.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:R.description})]})]},R.value)})})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Терминал"}),i.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),_?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":z,"aria-label":"Терминал",className:z?"switch is-on":"switch",onClick:()=>p({terminalEnabled:!z}),children:i.jsx("span",{className:"switch__knob"})})]}),i.jsxs("div",{className:"settings__nested"+(L?" is-disabled":""),children:[i.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),_?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[L&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),V()]})]})]})]})})}const o_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function kS(n){if(!n)return"срок неизвестен";const l=new Date(n);return Number.isNaN(l.getTime())?"срок неизвестен":l.toLocaleString()}function SS({handoff:n,onContinue:l,onShow:r,onDismiss:c}){if(n.continuedAt!==void 0){const o=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${o_[n.limit]} (${Math.round(n.utilization)} %) — работа прервана ${new Date(n.stoppedAt).toLocaleString()}`;return i.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[i.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(n.continuedAt).toLocaleString(),"."]})," ",o,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:l,children:"Продолжить ещё раз"})]})]})}return i.jsxs("div",{className:"handoff",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[n.limit===null?i.jsxs(i.Fragment,{children:["Хэндофф записан вручную ",new Date(n.stoppedAt).toLocaleString()," — сессия остановлена."]}):i.jsxs(i.Fragment,{children:[o_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",kS(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:l,children:"Продолжить в новой сессии"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function ES({handoff:n,onClose:l}){const[r,c]=b.useState("");return b.useEffect(()=>{let o=!1;return ff(n.text).then(u=>{o||c(u)}),()=>{o=!0}},[n.text]),i.jsx(us,{title:"Хэндофф",className:"modal--wide",onClose:l,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function TS({state:n}){return i.jsxs("div",{className:"netguard",role:"alert",children:[i.jsxs("svg",{className:"netguard__icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[i.jsx("path",{d:"M8 1.8 14.2 13H1.8L8 1.8Z",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round"}),i.jsx("path",{d:"M8 6.4v3",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),i.jsx("circle",{cx:"8",cy:"11.2",r:"0.8",fill:"currentColor"})]}),i.jsxs("div",{className:"netguard__copy",children:[i.jsx("strong",{className:"netguard__reason",children:n.reason??"Не удалось убедиться, что запросы идут через VPN"}),i.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const rf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},CS=12e3;function AS(n){const l=n%10,r=n%100;return l===1&&r!==11?"сессии":"сессиях"}function RS({notices:n,onDismiss:l}){return n.length===0?null:i.jsx("div",{className:"limittoasts",children:n.map(r=>i.jsx(MS,{notice:r,onDismiss:()=>l(r.id)},r.id))})}function MS({notice:n,onDismiss:l}){return b.useEffect(()=>{const r=window.setTimeout(l,CS);return()=>window.clearTimeout(r)},[l]),i.jsxs("div",{className:"limittoast",role:"status",children:[i.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),i.jsx("span",{className:"limittoast__body",children:n.stopped>0?i.jsxs(i.Fragment,{children:["Достигнут ",rf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",AS(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):i.jsxs(i.Fragment,{children:["Достигнут ",rf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:l,children:"✕"})]})}function DS(n,l,r=Date.now()){if(!n||!n.available||!l)return null;const c=[["fiveHour",n.fiveHour,l.limitStopFiveHourPct],["sevenDay",n.sevenDay,l.limitStopSevenDayPct]];for(const[o,u,h]of c){if(!u||h<=0||u.utilization<h)continue;const p=Date.parse(u.resetsAt);if(!(!Number.isFinite(p)||p<=r))return{limit:o,utilization:u.utilization,resetsAt:p}}return null}function OS(n,l=Date.now()){const r=new Date(n),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(l).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const LS=16;function zS({pane:n,width:l,onResize:r,onReset:c}){const o=Cr[n],u=b.useRef(null);b.useEffect(()=>()=>{u.current&&document.body.classList.remove("is-resizing")},[]);function h(j){var A;const _=j.closest(".app"),S=_==null?void 0:_.querySelector(n==="sidebar"?":scope > .sidebar":n==="comparison"?".comparison":`.sidepane--${n}`),k=(S==null?void 0:S.getBoundingClientRect().width)??l,E=((A=_==null?void 0:_.querySelector(".main"))==null?void 0:A.getBoundingClientRect().width)??bp;return{width:k,max:Math.max(o.min,Math.min(o.max,k+E-bp))}}function p(j){j.button===0&&(u.current={x:j.clientX,...h(j.currentTarget)},j.currentTarget.setPointerCapture(j.pointerId),document.body.classList.add("is-resizing"),j.preventDefault())}function g(j){const _=u.current;if(!_)return;const S=o.side==="left"?j.clientX-_.x:_.x-j.clientX;r(Math.min(_.max,_.width+S))}function x(j){u.current&&(u.current=null,j.currentTarget.hasPointerCapture(j.pointerId)&&j.currentTarget.releasePointerCapture(j.pointerId),document.body.classList.remove("is-resizing"))}function v(j){const _=j.key==="ArrowRight"?1:j.key==="ArrowLeft"?-1:0;if(_===0)return;j.preventDefault();const S=h(j.currentTarget);r(Math.min(S.max,S.width+_*LS*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${n} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:p,onPointerMove:g,onPointerUp:x,onPointerCancel:x,onLostPointerCapture:x,onDoubleClick:c,onKeyDown:v,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const IS=16;function US({height:n,onResize:l,onReset:r}){const c=b.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const v=x.getBoundingClientRect().height-wv;return Math.round(n+Math.max(0,v))}function u(x){x.button===0&&(c.current={y:x.clientY,height:n,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const v=c.current;if(!v)return;const j=v.y-x.clientY;l(v.height+j,v.max)}function p(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const v=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;v!==0&&(x.preventDefault(),l(n+v*IS,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":O_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:u,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:r,onKeyDown:g,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function u_(){const n=document.documentElement,l=getComputedStyle(n),r=q=>l.getPropertyValue(q).trim(),c=r("--surface"),o=r("--text"),u=r("--text-2"),h=r("--muted"),p=r("--accent"),g=r("--accent-fg"),x=r("--select"),v=r("--danger"),j=r("--ok"),_=r("--warn"),S=r("--cm-fn"),k=r("--cm-key"),E=r("--cm-type"),A=d_(o,c,55),D=q=>d_(q,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:g,selectionBackground:x,black:A,brightBlack:h,red:v,brightRed:D(v),green:j,brightGreen:D(j),yellow:_,brightYellow:D(_),blue:S,brightBlue:D(S),magenta:k,brightMagenta:D(k),cyan:E,brightCyan:D(E),white:u,brightWhite:o}}function HS(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let hi=null;function BS(n){return hi||(hi=document.createElement("span"),hi.style.position="fixed",hi.style.width="0",hi.style.height="0",hi.style.opacity="0",hi.style.pointerEvents="none",document.body.appendChild(hi)),hi.style.color=n,getComputedStyle(hi).color}function d_(n,l,r){return BS(`color-mix(in srgb, ${n} ${100-r}%, ${l} ${r}%)`)}let Xd=null;function qS(){return Xd||(Xd=Promise.all([ot(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),ot(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),ot(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),ot(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,l,r])=>({Terminal:n.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(n=>{throw Xd=null,n})),Xd}function GS({terminals:n,activeId:l,blocked:r,error:c,onDismissError:o,height:u,offset:h,mobile:p=!1,zoomed:g,onToggleZoom:x,onSelect:v,onOpen:j,onClose:_,onInput:S,onResize:k,onAttach:E,onHide:A,registerSink:D}){const[q,Q]=b.useState(()=>u_());return b.useEffect(()=>{const z=new MutationObserver(()=>Q(u_()));return z.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>z.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(p?" termpanel--mobile":"")+(!p&&g?" termpanel--zoomed":""),style:p?{height:u,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:u},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:z=>{x&&(z.target.closest("button")||x())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(z=>i.jsxs("div",{role:"tab","aria-selected":z.id===l,className:"termtab"+(z.id===l?" is-on":"")+(z.exitCode!==null?" termtab--exited":""),onDoubleClick:H=>{x&&(H.target.closest(".termtab__close")||x())},children:[i.jsx("button",{className:"termtab__name",title:z.cwd,onClick:()=>v(z.id),children:z.title}),z.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${z.exitCode}`,children:z.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${z.title}»`,onClick:()=>_(z.id),children:"✕"})]},z.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),x&&i.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:x,children:i.jsx(Pc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&n.length>0&&i.jsx(f_,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?i.jsx(f_,{message:c,onRetry:r?null:j,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):n.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),n.map(z=>i.jsx(YS,{id:z.id,exitCode:z.exitCode,active:z.id===l,theme:q,mobile:p,onInput:S,onResize:k,onAttach:E,registerSink:D},z.id))]})]})}function f_({message:n,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:u,details:h}=$S(n);return i.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),u&&i.jsx("p",{className:"termfail__hint",children:u}),h&&i.jsxs("details",{className:"termfail__details",children:[i.jsx("summary",{children:"Подробности"}),i.jsx("pre",{children:h})]})]}),i.jsxs("div",{className:"termfail__bar",children:[r&&i.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),i.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function $S(n){const[l="",...r]=n.trim().split(`
|
|
133
|
-
|
|
134
|
-
`),c=l.split(`
|
|
135
|
-
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
136
|
-
|
|
137
|
-
`).trim()}}function YS({id:n,exitCode:l,active:r,theme:c,mobile:o,onInput:u,onResize:h,onAttach:p,registerSink:g}){const x=b.useRef(null),v=b.useRef(null),j=b.useRef(!1),_=b.useRef(o);_.current=o;const S=b.useRef(c),k=b.useRef(l),[E,A]=b.useState("loading"),[D,q]=b.useState(!1);return b.useEffect(()=>{if(!x.current)return;let z=!1,H=null;A("loading"),q(!1);const L=window.setTimeout(()=>{z||q(!0)},200);return(async()=>{var ke;let U;try{U=await qS()}catch{window.clearTimeout(L),z||A("error");return}if(z||!x.current)return;window.clearTimeout(L);const{Terminal:V,FitAddon:R,WebLinksAddon:I}=U,G=new V({fontFamily:HS()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:S.current}),se=new R;G.loadAddon(se),G.loadAddon(new I),G.open(x.current),v.current=G,G.attachCustomKeyEventHandler(T=>{if(T.type!=="keydown"||!(T.ctrlKey||T.metaKey))return!0;if(T.key==="`")return T.preventDefault(),!1;if(T.key==="c"||T.key==="C"){const de=G.getSelection();return de?(T.preventDefault(),vi(de),!1):!T.shiftKey}return T.key==="v"||T.key==="V"?(T.preventDefault(),Ep().then(de=>{de&&G.paste(de)}),!1):!0});const je=T=>{T.preventDefault();const K=G.getSelection();if(K){vi(K),G.clearSelection();return}Ep().then(de=>{de&&G.paste(de)})};(ke=G.element)==null||ke.addEventListener("contextmenu",je);const we=G.onData(T=>u(n,T));let Ne={cols:G.cols,rows:G.rows},Z=null;const $=G.onResize(({cols:T,rows:K})=>{Z!==null&&window.clearTimeout(Z),Z=window.setTimeout(()=>{Z=null,!(T===Ne.cols&&K===Ne.rows)&&(Ne={cols:T,rows:K},h(n,T,K))},100)}),ne=new ResizeObserver(()=>{try{se.fit()}catch{return}_.current&&G.scrollToBottom()});ne.observe(x.current);const me=g(n,T=>{T.kind==="buffer"&&G.reset(),G.write(T.data)});p(n),k.current!==null&&!j.current&&(j.current=!0,G.write(`\r
|
|
138
|
-
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
139
|
-
`)),r&&G.focus(),H=()=>{var T;Z!==null&&window.clearTimeout(Z),ne.disconnect(),(T=G.element)==null||T.removeEventListener("contextmenu",je),we.dispose(),$.dispose(),me(),G.dispose(),v.current=null},A("ready")})(),()=>{z=!0,window.clearTimeout(L),H==null||H(),H=null}},[n]),b.useEffect(()=>{if(!o)return;const Q=x.current;if(!Q)return;let z=null,H=0,L=!1;const U=G=>{G.pointerType==="mouse"||z!==null||(z=G.pointerId,H=G.clientY,L=!1)},V=G=>{if(G.pointerId!==z)return;const se=H-G.clientY;if(!L){if(Math.abs(se)<4)return;L=!0,Q.setPointerCapture(G.pointerId)}H=G.clientY;const je=Q.querySelector(".xterm-viewport");je&&(je.scrollTop+=se)},R=G=>{G.pointerId===z&&(Q.hasPointerCapture(G.pointerId)&&Q.releasePointerCapture(G.pointerId),z=null,L=!1)},I=G=>G.stopPropagation();return Q.addEventListener("pointerdown",U),Q.addEventListener("pointermove",V),Q.addEventListener("pointerup",R),Q.addEventListener("pointercancel",R),Q.addEventListener("touchmove",I,{capture:!0}),()=>{Q.removeEventListener("pointerdown",U),Q.removeEventListener("pointermove",V),Q.removeEventListener("pointerup",R),Q.removeEventListener("pointercancel",R),Q.removeEventListener("touchmove",I,{capture:!0}),z!==null&&Q.hasPointerCapture(z)&&Q.releasePointerCapture(z)}},[o]),b.useEffect(()=>{S.current=c,v.current&&(v.current.options.theme=c)},[c]),b.useEffect(()=>{var Q;r&&((Q=v.current)==null||Q.focus())},[r]),b.useEffect(()=>{if(k.current=l,l===null){j.current=!1;return}if(j.current)return;const Q=v.current;Q&&(j.current=!0,Q.write(`\r
|
|
140
|
-
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
141
|
-
`))},[l]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:x,className:"termview__surface"+(E==="ready"?"":" is-hidden")}),E==="loading"&&D&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),E==="error"&&i.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[i.jsx("p",{children:"Не удалось загрузить терминал"}),i.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),i.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const VS=2e5,XS=75,QS=90;function KS({tokens:n,maxTokens:l,fetchedAt:r}){if(n===null)return null;const c=l??VS,o=Math.min(100,Math.round(n/c*100)),u=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
142
|
-
обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return i.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:u,children:[i.jsx("span",{className:"contextbar__label",children:"контекст"}),i.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`contextbar__fill${ZS(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function ZS(n){return n>=QS?" contextbar__fill--over":n>=XS?" contextbar__fill--warn":""}const Ap="ccv:last-session",FS=300*1e3,JS=1e4;function PS(){try{const n=localStorage.getItem(Ap);if(!n)return null;const l=JSON.parse(n);if(typeof l!="object"||l===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=l;return typeof r!="string"||c!==null&&typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function WS(n,l){const r=n.find(o=>o.id===l);if(r)return r;const c=n.filter(o=>ev(o.path).includes(l));return c.length===1?c[0]:void 0}function eE(n,l){return n.id===l.sessionId?!0:l.claudeSessionId?n.id===l.claudeSessionId||n.claudeSessionId===l.claudeSessionId:!1}const tE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},h_=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],nE={active:!1,url:"",awaitingCode:!1,output:"",error:null};function p_(n,l,r){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return l;const o=r[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,p)=>m_(h.name,u)-m_(p.name,u))}}function m_(n,l){return n.toLowerCase().startsWith(l)?0:1}function g_(n,l){const r=n.find(o=>o.value===l)??n.find(o=>o.resolvedModel===l),c=l&&!r?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(r==null?void 0:r.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function sE(){var So,qi;const n=b.useRef(null),l=b.useRef(null),r=b.useRef(!1),c=b.useRef(new Set),o=b.useCallback(m=>{var O;return(O=n.current)==null?void 0:O.send(m)},[]),u=b.useCallback(m=>{var O,ce,Ae;if(m.type==="session.start"){const rt=crypto.randomUUID();l.current={requestId:rt,workspaceId:m.workspaceId,provider:m.provider,resume:m.resume,known:new Set(c.current),draft:(O=l.current)==null?void 0:O.draft},(ce=n.current)==null||ce.send({...m,requestId:rt})}else(Ae=n.current)==null||Ae.send(m)},[]),[h,p]=b.useState(!1),[g,x]=b.useState("Нет связи с хостом"),[v,j]=b.useState(null),[_,S]=b.useState(null),k=(_==null?void 0:_.status)==="blocked",[E,A]=b.useState(!1),D=b.useMemo(()=>Zd()==="relay",[]),[q,Q]=b.useState([]),z=dN({connected:h,workspaces:q,send:o}),H=b.useRef(z.handleFrame);H.current=z.handleFrame;const[L,U]=b.useState([]),[V,R]=b.useState([]),[I,G]=b.useState([]),[se,je]=b.useState([]),[we,Ne]=b.useState([]),[Z,$]=b.useState([]),[ne,me]=b.useState([]),[ke,T]=b.useState([]),[K,de]=b.useState(null),[_e,Me]=b.useState(null),[ze,Ve]=b.useState(null),[re,Ye]=b.useState(null),[pe,Ge]=b.useState(null),[dt,nt]=b.useState(null),[bt,Xe]=b.useState(ss),[Ct,ee]=b.useState(Ya),[Ze,st]=b.useState(!1),[Be,Fe]=b.useState(!1),De=of("(max-width: 860px)"),[ut,Ce]=b.useState(!1);b.useEffect(()=>{De||Ce(!1)},[De]);const[kt,Ft]=b.useState(!1),[Ht,nn]=b.useState([]),[fn,_n]=b.useState(!1),[wn,St]=b.useState(ss),[ft,$t]=b.useState(null),[Cn,At]=b.useState(null),[hs,ie]=b.useState([]),[ye,He]=b.useState(null),[lt,Je]=b.useState(null),[sn,F]=b.useState([]),[he,Se]=b.useState([]),[Ie,gt]=b.useState([]),[ps,Us]=b.useState([]),[Ws,As]=b.useState(null),[Rs,Ms]=b.useState(null),[Jn,ji]=b.useState({}),[ms,gs]=b.useState(null),[hn,it]=b.useState({}),[Nn,el]=b.useState(null),[Nl,tl]=b.useState([]),[Hs,Ln]=b.useState(!1),[xs,Yt]=b.useState(null),[Jt,ln]=b.useState(null),pn=(Jt==null?void 0:Jt.enabledProviders)??["claude","antigravity","codex"],[et,Pn]=b.useState(!1),[is,as]=b.useState(nE),[Dt,Xl]=b.useState(null),[Vt,bs]=b.useState(null),[Wn,an]=b.useState(!1),[kn,Vn,Pt]=gv(),kl=jv(),[_s,rs]=b.useState(!1),[yn,Sl]=b.useState(null),[Ql,An]=b.useState(null),[wi,nl]=b.useState(null),[ys,rn]=b.useState(null),[ve,C]=b.useState(null),[J,xe]=b.useState(""),[Ee,qe]=b.useState(null),[Qe,Xt]=b.useState([]),[_t,vn]=b.useState(!1),[ht,Rn]=b.useState(null),[mn,Bs]=b.useState(!1),[gn,qs]=b.useState(!1),[Gs,Kl]=b.useState({}),[vs,js]=b.useState([""]),[Mn,zn]=b.useState([]),[N,ue]=b.useState(null),[Oe,at]=b.useState(null),[In,Ni]=b.useState(null),[na,Xn]=b.useState(null),[ki,sa]=b.useState(null),[Zl,bu]=b.useState({}),[la,Lr]=b.useState({}),[$s,sl]=b.useState(!1),[_u,Wc]=b.useState(null),[zr,eo]=b.useState(null),Ir=b.useRef(0),Ur=b.useRef(null),[ia,to]=b.useState(!1),[Hr,Xa]=b.useState([]),[yu,Br]=b.useState(null),[pf,qr]=b.useState(null),Gr=Nv(),Qa=Tv(De&&ia),Ka=b.useRef(new Map),Si=(Jt==null?void 0:Jt.terminalEnabled)===!0,$r=Zd()==="relay"&&((So=v==null?void 0:v.shell)==null?void 0:So.enabled)!==!0,Yr=b.useRef(!1),mf=b.useCallback((m,O)=>(Ka.current.set(m,O),()=>{Ka.current.get(m)===O&&Ka.current.delete(m)}),[]),[Fl,Za]=b.useState(!1),[vu,Vr]=b.useState(null),[ju,Xr]=b.useState(ss),[El,Qr]=b.useState(null),[Ei,ll]=b.useState({}),Fa=b.useRef([]),[Bt,Kr]=b.useState(null);function wu(m){Kr(O=>O===m?null:m)}b.useEffect(()=>{(De||Bt==="terminal"&&!ia||Bt==="files"&&!gn||Bt==="search"&&!$s||Bt==="git"&&!_s||Bt==="ask"&&!Fl||Bt==="main"&&Mn.length===0)&&Kr(null)},[Bt,De,ia,gn,$s,_s,Fl,Mn.length]);const[Nu]=b.useState(PS),Ja=b.useRef(Nu),il=b.useRef(!1),Un=b.useRef(null),Pa=b.useRef(null),Zr=b.useRef(null),no=b.useRef(0),Dn=b.useRef(null),aa=b.useRef(0);Un.current=pe,Dn.current=re,aa.current=bt.lastSeq;const ra=b.useRef(Ct);ra.current=Ct;const Tl=b.useRef(null),Wa=b.useRef(0);Wa.current=ju.lastSeq;const er=b.useRef(null),tr=b.useRef(""),Ti=b.useRef(null),Cl=b.useRef([]),so=b.useRef([""]);Cl.current=Mn,so.current=vs;const ca=b.useRef(new Map),nr=b.useRef(new Set),sr=b.useRef(null),lr=b.useRef(null),ku=b.useRef(0),ir=b.useRef(new Set);b.useEffect(()=>{const m=cv();if(!m)return;n.current=m;const O=()=>{p(m.connected),x(m.statusText)};m.onStatus(O),m.onReconnect(()=>{O(),it({});const rt=Un.current;rt&&m.send({type:"session.sync",sessionId:rt,sinceSeq:aa.current});const It=Tl.current;It&&m.send({type:"session.sync",sessionId:It,sinceSeq:Wa.current})});const ce=m.on(rt=>{H.current(rt),gf(rt)});m.connect();const Ae=window.setInterval(()=>{O(),m.connected&&m.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(Ae),m.close()}},[]);const gf=b.useCallback(m=>{var ce,Ae,rt,It,Bn,Gi,Eo,Hl,Ss,xn,pr,xl,tt;const O=ae=>{var Ke,pt,xt;const be=(Ke=l.current)==null?void 0:Ke.draft;l.current=null,be&&pp(ae.id,be),((pt=Zr.current)==null?void 0:pt.workspaceId)===ae.workspaceId&&(pp(ae.id,Zr.current.text),Zr.current=null),Un.current=ae.id,Ye(ae.workspaceId),Ge(ae.id),(xt=n.current)==null||xt.send({type:"session.sync",sessionId:ae.id,sinceSeq:0})};switch(m.type){case"hello.ok":r.current=((ce=m.features)==null?void 0:ce.includes("session-routing"))??!1,p(!0);break;case"workspace.list":{Q(m.workspaces),U(m.archived),Ye(Ke=>{var Xs;if(Ke)return Ke;const pt=Ja.current,xt=pt&&WS(m.workspaces,pt.workspaceId);return pt&&xt&&xt.id!==pt.workspaceId&&(Ja.current={...pt,workspaceId:xt.id}),(xt==null?void 0:xt.id)??((Xs=m.workspaces[0])==null?void 0:Xs.id)??null});const ae=Ti.current;if(!ae)break;const be=m.workspaces.find(Ke=>oE(Ke.path,ae));if(!be)break;Ti.current=null,Ft(!1),Ye(be.id);break}case"workspace.candidates":if(m.query.trim()!==tr.current)break;nn(m.candidates),m.source==="host"&&_n(!1);break;case"finder.opened":er.current=m.sessionId;break;case"workspace.roots":ie(m.roots);break;case"workspace.created":if(Ye(m.workspace.id),m.warnings.length===0){Ft(!1),At(null);break}He({path:m.workspace.path,warnings:m.warnings});break;case"session.list":if(m.workspaceId!==Dn.current)break;Ne(ae=>fy(ae,m.sessions,m.archived,m.workspaceId)),$(m.archived);break;case"folder.list":R(m.workspaceFolders),G(m.sessionFolders),je(m.pinnedFolders??[]);break;case"session.pinned":me(m.sessions);break;case"session.live":for(const ae of m.sessions)c.current.add(ae.id);T(m.sessions);break;case"order.state":Ve(m.order);break;case"session.summary":if(!r.current&&l.current){const ae=l.current,be=m.session;!be.parentSessionId&&be.workspaceId===ae.workspaceId&&be.state!=="closed"&&(!ae.provider||ae.provider===be.provider)&&(!((Ae=ae.known)!=null&&Ae.has(be.id))||ae.resume===be.id||ae.resume===be.claudeSessionId)&&O(be)}if(c.current.add(m.session.id),m.session.id===er.current){$t(m.session);break}if(m.session.parentSessionId){m.session.id===Tl.current&&Qr(m.session);break}if(T(ae=>{const be=ae.findIndex(pt=>pt.id===m.session.id);if(m.session.state==="closed")return be===-1?ae:ae.filter(pt=>pt.id!==m.session.id);if(be===-1)return[...ae,m.session];const Ke=ae.slice();return Ke[be]=m.session,Ke}),Ne(ae=>{const be=ae.findIndex(pt=>pt.id===m.session.id);if(be===-1)return[m.session,...ae];const Ke=ae.slice();return Ke[be]=m.session,Ke}),me(ae=>{const be=ae.findIndex(pt=>pt.id===m.session.id);if(be===-1)return ae;const Ke=ae.slice();return Ke[be]={...m.session,pinned:!0,...ae[be].pinnedAt?{pinnedAt:ae[be].pinnedAt}:{}},Ke}),((rt=Pa.current)==null?void 0:rt.sessionId)===m.session.id){const ae=Pa.current;m.session.state==="error"?Pa.current=null:m.session.state!=="closed"&&(Pa.current=null,(It=n.current)==null||It.send({type:"prompt.send",sessionId:ae.sessionId,text:ae.text,images:ae.images}))}break;case"session.started":{if(m.requestId!==((Bn=l.current)==null?void 0:Bn.requestId))break;O(m.session);break}case"usage.state":m.sessionId===Un.current&&(Xl(m.usage),an(!1));break;case"context.state":m.sessionId===Un.current&&(bs(m.context),an(!1));break;case"session.capabilities":m.sessionId===Un.current&&nt(m.capabilities);break;case"session.events":if(m.sessionId===Tl.current){Xr(ae=>uu(ae,m.entries));break}if(m.sessionId===er.current){St(ae=>uu(ae,m.entries));break}if(m.sessionId!==Un.current)break;for(const ae of m.entries){if(ae.event.kind!=="rewound")continue;const be=ae.event.toUserIndex,Ke=C_(ra.current.entries,be),pt=Ke.reduce((xt,Xs)=>Xs.event.kind==="user.message"?xt+1:xt,0);ee(xt=>({...xt,entries:Ke})),Xe(xt=>({...xt,items:A_(xt.items,be,pt)}))}Xe(ae=>uu(ae,m.entries));break;case"session.history":if(m.sessionId!==Un.current)break;ee(ae=>T_(ae,m));break;case"side.opened":{if(m.parentSessionId!==Un.current)break;Tl.current=m.sessionId,Vr(m.sessionId);const ae=Fa.current;Fa.current=[];for(const be of ae)be(m.sessionId);break}case"side.closed":if(m.parentSessionId!==Un.current)break;Tl.current=null,Vr(null),Xr(ss),Qr(null);break;case"git.state":if(m.workspaceId!==Dn.current)break;Sl(m.state);break;case"git.commit":if(m.workspaceId!==Dn.current)break;An(m.detail);break;case"git.result":if(m.workspaceId!==Dn.current)break;rn({ok:m.ok,message:m.message,url:m.url}),m.ok&&(An(null),nl(null),vn(!1),Bs(!1));break;case"git.busy":if(m.workspaceId!==Dn.current)break;xe(m.label);break;case"git.files":if(m.workspaceId!==Dn.current)break;Rn({files:m.files,truncated:m.truncated});break;case"github.status":qe(m.status);break;case"github.owners":Xt(m.owners);break;case"fs.dir":if(m.workspaceId!==Dn.current)break;Kl(ae=>({...ae,[m.path]:m.entries}));break;case"fs.search":if(m.workspaceId!==Dn.current)break;if(m.scope!=="tree"){const ae=m.scope;Lr(be=>({...be,[ae]:{query:m.query,entries:m.entries}}));break}sa({query:m.query,entries:m.entries,truncated:m.truncated});break;case"fs.grep":if(m.workspaceId!==Dn.current)break;Wc({query:m.query,matches:m.matches,truncated:m.truncated});break;case"fs.file":{if(m.workspaceId!==Dn.current)break;const ae=nr.current.delete(m.file.path);zn(Ke=>{const pt=Ke.findIndex(mr=>mr.path===m.file.path);if(pt===-1)return[...Ke,Mb(m.file,++ku.current)];const xt=Ke[pt],Xs=Ke.slice();return Xs[pt]=xt.saved===m.file.content&&!Wi(xt)?{...xt,mtime:m.file.mtime,size:m.file.size,stale:!1}:Mb(m.file,++ku.current),Xs}),ae&&ue(m.file.path);const be=Ur.current;be&&be.path===m.file.path&&(Ur.current=null,eo({...be,token:++Ir.current}));break}case"fs.media":{if(m.workspaceId!==Dn.current)break;ir.current.delete(m.path),zn(ae=>ae.map(be=>be.path===m.path?{...be,mediaBase64:m.base64,mediaError:void 0}:be));break}case"fs.mediaFailed":{if(m.workspaceId!==Dn.current)break;ir.current.delete(m.path),zn(ae=>ae.map(be=>be.path===m.path?{...be,mediaError:m.message}:be));break}case"fs.saved":{if(m.workspaceId!==Dn.current)break;const ae=ca.current.get(m.path);ca.current.delete(m.path);const be=ae!==void 0;zn(pt=>pt.map(xt=>xt.path!==m.path?xt:be?{...xt,saved:ae,mtime:m.mtime,size:m.size,stale:!1}:{...xt,stale:!0}));const Ke=Cl.current.find(pt=>pt.path===m.path);!be&&Ke&&!Wi(Ke)&&((Gi=n.current)==null||Gi.send({type:"fs.read",workspaceId:m.workspaceId,path:m.path})),(Eo=n.current)==null||Eo.send({type:"git.state",workspaceId:m.workspaceId});break}case"fs.result":{if(m.workspaceId!==Dn.current)break;if(at({ok:m.ok,message:m.message}),m.ok||ca.current.delete(m.path),m.conflict&&zn(be=>be.map(Ke=>Ke.path===m.path?{...Ke,stale:!0}:Ke)),lr.current===m.path){const be=lr.current;lr.current=null,m.ok&&(nr.current.add(be),(Hl=n.current)==null||Hl.send({type:"fs.read",workspaceId:m.workspaceId,path:be}))}const ae=sr.current;if(m.ok&&ae&&ae.to===m.path){sr.current=null;const be=Ke=>Ke===ae.from?ae.to:Ke.startsWith(`${ae.from}/`)?ae.to+Ke.slice(ae.from.length):Ke;zn(Ke=>Ke.map(pt=>({...pt,path:be(pt.path)}))),ue(Ke=>Ke===null?null:be(Ke)),js(Ke=>Ke.map(be)),Kl(Ke=>{const pt={};for(const[xt,Xs]of Object.entries(Ke))xt===ae.from||xt.startsWith(`${ae.from}/`)||(pt[xt]=Xs);return pt})}m.ok&&((Ss=n.current)==null||Ss.send({type:"git.state",workspaceId:m.workspaceId}));break}case"term.list":if(m.workspaceId!==Dn.current)break;Xa(m.terminals);break;case"term.opened":if(m.terminal.workspaceId!==Dn.current)break;qr(null),Xa(ae=>{const be=ae.findIndex(pt=>pt.id===m.terminal.id);if(be===-1)return[...ae,m.terminal];const Ke=ae.slice();return Ke[be]=m.terminal,Ke}),Yr.current&&(Yr.current=!1,Br(m.terminal.id));break;case"term.buffer":(xn=Ka.current.get(m.id))==null||xn({kind:"buffer",data:m.data});break;case"term.data":(pr=Ka.current.get(m.id))==null||pr({kind:"data",data:m.data});break;case"term.exit":Xa(ae=>ae.map(be=>be.id===m.id?{...be,exitCode:m.exitCode}:be));break;case"term.closed":Xa(ae=>ae.filter(be=>be.id!==m.id));break;case"mcp.list":m.sessionId===Un.current&&F(m.servers);break;case"mcp.auth":m.sessionId===Un.current&&Ms(m.state);break;case"plugin.list":if(m.sessionId!==Un.current)break;Se(m.plugins),gt(m.marketplaces),Us(m.catalog);break;case"operation.result":m.sessionId===Un.current&&As(m.result);break;case"auth.status":Yt(m.status);break;case"relay.state":j(m.state);break;case"network.state":S(m.state);break;case"settings.state":ln(m.settings);break;case"handoff.state":ji(ae=>{if(!m.handoff){if(!(m.sessionId in ae))return ae;const be={...ae};return delete be[m.sessionId],be}return{...ae,[m.sessionId]:m.handoff}});break;case"handoff.written":it(ae=>{if(!(m.sessionId in ae))return ae;const be={...ae};return delete be[m.sessionId],be}),m.handoff&&Un.current===m.sessionId?el(m.handoff):m.handoff||console.warn("[handoff] хост не смог записать хэндофф",m.sessionId);break;case"limit.stopped":no.current+=1,tl(ae=>[...ae,{id:no.current,limit:m.limit,utilization:m.utilization,stopped:m.stopped,handoffs:m.handoffs}]);break;case"auth.login":as(m.state),m.state.active&&Ln(!0);break;case"session.closed":T(ae=>ae.filter(be=>be.id!==m.sessionId)),Ne(ae=>ae.map(be=>be.id===m.sessionId?{...be,state:"closed"}:be));break;case"error":m.context==="session.start"&&m.requestId===((xl=l.current)==null?void 0:xl.requestId)&&(l.current=null,Xe(ae=>({...ae,items:[...ae.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")&&(Ti.current=null,At(m.message)),(tt=m.context)!=null&&tt.startsWith("term.")&&qr(m.message);break}},[]);b.useEffect(()=>{!z.compareId||!z.compareVisible||(qs(!1),sl(!1),rs(!1),Za(!1),st(!1))},[z.compareId,z.compareVisible]),b.useEffect(()=>{re&&u({type:"session.list",workspaceId:re})},[re,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:S_()}),fv(m=>u({type:"session.drafts",sessionIds:m}))},[h,u]),b.useEffect(()=>{if(il.current)return;const m=Ja.current;if(!m||!re)return;if(m.sessionId===null){il.current=!0;return}if(re!==m.workspaceId){il.current=!0;return}if(pe){il.current=!0;return}if(we.length===0)return;const O=we.find(ce=>eE(ce,m));il.current=!0,O&&O.state!=="closed"&&Wr(O)},[we,re,pe]),b.useEffect(()=>{!re||$r||!Si||u({type:"term.list",workspaceId:re})},[re,$r,Si,u]),b.useEffect(()=>{Br(m=>{var O;return m&&Hr.some(ce=>ce.id===m)?m:((O=Hr[0])==null?void 0:O.id)??null})},[Hr]),b.useEffect(()=>{kt&&u({type:"workspace.roots"})},[kt,u]);const Hn=b.useCallback(()=>{const m=Un.current;m&&(an(!0),u({type:"usage.get",sessionId:m}),u({type:"context.get",sessionId:m}))},[u]);b.useEffect(()=>{if(!Wn)return;const m=window.setTimeout(()=>an(!1),JS);return()=>window.clearTimeout(m)},[Wn]);const Ci=b.useMemo(()=>{const m=Math.max((Dt==null?void 0:Dt.fetchedAt)??0,(Vt==null?void 0:Vt.fetchedAt)??0);return m>0?m:null},[Dt==null?void 0:Dt.fetchedAt,Vt==null?void 0:Vt.fetchedAt]);b.useEffect(()=>{if(bs(null),!pe)return;Hn();const m=()=>{document.hidden||Hn()},O=window.setInterval(m,FS),ce=()=>{document.hidden||Hn()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(O),document.removeEventListener("visibilitychange",ce)}},[pe,Hn]),b.useEffect(()=>{if(!pe){ee(Ya);return}ee({...Ya,loading:!0}),u({type:"session.history",sessionId:pe})},[pe,u]);const Su=b.useCallback(()=>{!pe||Ct.loading||!gp(Ct)||(ee(m=>({...m,loading:!0})),u({type:"session.history",sessionId:pe,before:Dp(Ct)}))},[pe,Ct,u]),lo=b.useMemo(()=>Op(Ct.entries),[Ct.entries]),Y=b.useMemo(()=>we.find(m=>m.id===pe)??null,[we,pe]),oa=pe?(Y==null?void 0:Y.claudeSessionId)??pe:null,Ai=oa?Jn[oa]??null:null;b.useEffect(()=>{oa&&u({type:"handoff.get",sessionId:oa})},[oa,u]),b.useEffect(()=>{ms&&!(ms.sessionId in Jn)&&gs(null)},[Jn,ms]);const Eu=b.useMemo(()=>{var ce;if(!Dt)return null;const m=(((ce=Dt.buckets)==null?void 0:ce.length)??0)>0,O=(Y==null?void 0:Y.provider)!=="claude";return m===O?Dt:null},[Dt,Y==null?void 0:Y.provider]),Ri="Обновить лимиты и контекст",io=Ri+(Ci?`
|
|
143
|
-
обновлено в ${new Date(Ci).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");b.useEffect(()=>{document.documentElement.dataset.provider=(Y==null?void 0:Y.provider)??"claude"},[Y==null?void 0:Y.provider]),b.useEffect(()=>{(Y==null?void 0:Y.provider)!=="claude"&&Za(!1)},[Y==null?void 0:Y.provider]);const es=q.find(m=>m.id===re)??L.find(m=>m.id===re)??null;b.useEffect(()=>{if(!re||!pe)return;const m={workspaceId:re,sessionId:pe,claudeSessionId:(Y==null?void 0:Y.claudeSessionId)??null};try{localStorage.setItem(Ap,JSON.stringify(m))}catch{}},[re,pe,Y==null?void 0:Y.claudeSessionId]);function ao(m){Ti.current=m,At(null),u({type:"workspace.open",path:m})}function Tu(m,O,ce){At(null),u({type:"workspace.create",parent:m,name:O,init:ce})}function Mi(m){if(tr.current=m,!m){nn([]),_n(!1);return}_n(!0),u({type:"workspace.find",query:m})}function ua(m){tr.current=m,St(ss),u({type:"workspace.find.agent",query:m})}function ro(){Ft(!1),At(null),He(null),nn([]),St(ss),$t(null),tr.current="",Ti.current=null}function Di(){const m=Un.current;m&&Tl.current&&u({type:"side.reset",sessionId:m}),Tl.current=null,Vr(null),Xr(ss),Qr(null),ll({}),Fa.current=[]}function Oi(m){u({type:"workspace.close",workspaceIds:m}),!(!re||!m.includes(re))&&(Di(),Ye(null),Ge(null),Ne([]),$([]),Xe(ss),nt(null),Fe(!1))}function Cu(m,O){u({type:"session.archive",workspaceId:m,sessionIds:O}),pe&&(O.includes(pe)||Y!=null&&Y.claudeSessionId&&O.includes(Y.claudeSessionId))&&(Di(),Ge(null),Xe(ss),nt(null),Fe(!1))}function Au(m){u({type:"workspace.restore",workspaceIds:m})}function Ru(m,O,ce){u({type:"folder.create",scope:m,name:O,workspaceId:ce})}function xf(m,O){u({type:"folder.rename",folderId:m,name:O})}function bf(m,O){u({type:"folder.setColor",folderId:m,color:O})}function _f(m){u({type:"folder.delete",folderId:m})}function Mu(m,O,ce,Ae){u({type:"folder.assign",scope:m,itemId:O,folderId:ce,workspaceId:Ae})}function co(m=pn[0]??"claude"){re&&(Di(),Ge(null),nt(null),Xe(ss),Fe(!1),u({type:"session.start",workspaceId:re,provider:m}),st(!1))}function Fr(m){z.setView(null),z.markRead(m),Al(m),z.setCompareVisible(!1)}function al(m,O=pn[0]??"claude"){z.setView(null),dl(m),l.current=null,u({type:"session.start",workspaceId:m,provider:O}),st(!1)}function Jr(m,O,ce,Ae,rt){z.setView(null),dl(m.workspaceId),l.current={requestId:"",draft:rt},u({type:"session.start",workspaceId:m.workspaceId,provider:O,taskParent:tn(m),taskStage:ce,...Ae?{resume:tn(m),fork:!0}:{}}),st(!1)}function ws(m){il.current=!0;const O={workspaceId:m,sessionId:null,claudeSessionId:null};Ja.current=O;try{localStorage.setItem(Ap,JSON.stringify(O))}catch{}z.setView(null),z.setCompareVisible(!1),dl(m),st(!1)}function dl(m){Di(),Ii(),Ye(m),Ge(null),Xe(ss),nt(null),Fe(!1),Sl(null),An(null),nl(null),rn(null),xe(""),vn(!1),Rn(null),Bs(!1),Xa([]),Br(null)}function oo(m,O,ce){u({type:"session.pin",workspaceId:m,sessionIds:O,pinned:ce})}function Pr(m){return m.state==="running"||m.state==="waiting_permission"||m.state==="reconnecting"||m.backgroundWork}function da(m){if(Pr(m)){de(m);return}u({type:"session.close",sessionId:m.id})}function uo(m,O,ce){Ve(Ae=>{const rt=Ae??{workspaces:[],sessions:{},pinned:[],live:[]};if(m==="sessions"){if(!ce)return Ae;const It={...rt.sessions};return O&&O.length>0?It[ce]=O:delete It[ce],{...rt,sessions:It}}return{...rt,[m]:O??[]}}),u({type:"order.set",scope:m,ids:O,...ce?{workspaceId:ce}:{}})}function Al(m){m.workspaceId!==re&&dl(m.workspaceId),Wr(m)}function Wr(m){if(st(!1),Di(),Xe(ss),nt(null),Fe(!1),m.state==="closed"){Ge(null),u({type:"session.start",workspaceId:m.workspaceId,resume:m.id,provider:m.provider});return}Ge(m.id),u({type:"session.sync",sessionId:m.id,sinceSeq:0})}function ec(m,O){if(!pe||k)return!1;const ce=pe,Ae=Y;return Li(()=>{if((Ae==null?void 0:Ae.state)==="closed"){Pa.current={sessionId:Ae.id,text:m,images:O},Wr(Ae);return}u({type:"prompt.send",sessionId:ce,text:m,images:O})})}function Li(m){const O=(Y==null?void 0:Y.provider)!=="claude"?null:DS(Dt,Jt);return O?new Promise(ce=>{Me(Ae=>(Ae==null||Ae.resolve(!1),{warning:O,resolve:ce}))}).then(ce=>(ce&&m(),ce)):(m(),!0)}function fo(m){_e&&(_e.resolve(m),Me(null))}function Ns(m){const O=ke.find(ce=>(ce.claudeSessionId??ce.id)===m.sessionId&&ce.state!=="closed");fl(m.workspaceId,m.sessionId,m.text),O&&u({type:"session.close",sessionId:O.id})}function tc(m){fl(m.workspaceId,m.claudeSessionId??m.id,null)}function fl(m,O,ce){Zr.current=ce===null?null:{workspaceId:m,text:ce},m!==re?dl(m):(Di(),Ge(null),nt(null),Xe(ss),Fe(!1)),u({type:"session.start",workspaceId:m,provider:"claude",continuesFrom:O,...ce===null?{}:{fromHandoff:!0}}),st(!1)}b.useEffect(()=>{Nn&&(el(null),Ns(Nn))},[Nn]);function ho(m){hn[m.id]||(it(O=>({...O,[m.id]:!0})),u({type:"session.handoff",sessionId:m.id}))}function nc(m){u({type:"handoff.dismiss",sessionId:m})}function Jl(m,O){u({type:"session.rename",sessionId:m.id,title:O,workspaceId:m.workspaceId}),Ne(ce=>ce.map(Ae=>Ae.id===m.id?{...Ae,title:O}:Ae))}function sc(m){pe&&(st(!1),As(null),Ms(null),Je(m),u({type:"mcp.list",sessionId:pe}),u({type:"plugin.list",sessionId:pe}))}const Du={mcpAction:(m,O)=>{pe&&(As(null),u({type:"mcp.action",sessionId:pe,name:m,action:O}))},mcpAuth:m=>{pe&&(As(null),Ms({name:m,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),u({type:"mcp.auth",sessionId:pe,name:m}))},mcpAuthCallback:(m,O)=>{pe&&u({type:"mcp.auth_callback",sessionId:pe,name:m,callbackUrl:O})},mcpAdd:(m,O)=>{pe&&u({type:"mcp.add",sessionId:pe,name:m,draft:O})},mcpRemove:m=>{pe&&u({type:"mcp.remove",sessionId:pe,name:m})},pluginInstall:m=>{pe&&u({type:"plugin.install",sessionId:pe,spec:m})},pluginUninstall:m=>{pe&&u({type:"plugin.uninstall",sessionId:pe,id:m})},pluginToggle:(m,O)=>{pe&&u({type:"plugin.toggle",sessionId:pe,id:m,enabled:O})},marketplaceAdd:m=>{pe&&u({type:"marketplace.add",sessionId:pe,source:m})},marketplaceRemove:m=>{pe&&u({type:"marketplace.remove",sessionId:pe,name:m})}};function lc(){st(!1),Ln(!0),u({type:"auth.status"})}const ic={login:(m,O)=>u({type:"auth.login",mode:m,switchAccount:O}),submitCode:m=>u({type:"auth.code",code:m}),cancel:()=>u({type:"auth.cancel"}),logout:()=>u({type:"auth.logout"})};function ks(){st(!1),Pn(!0),u({type:"settings.get"})}function fa(m){ln(O=>O&&{...O,...m}),u({type:"settings.update",settings:m})}function ha(m){!pe||k||u({type:"side.ask",sessionId:pe,text:m})}function ac(){pe&&(u({type:"side.reset",sessionId:pe}),Tl.current=null,Vr(null),Xr(ss),Qr(null),ll({}),Fa.current=[])}function Rl(m){const O=Tl.current;if(O){m(O);return}const ce=Un.current;ce&&(Fa.current.push(m),u({type:"side.open",sessionId:ce}))}function Ds(){re&&u({type:"git.state",workspaceId:re})}function Ys(m){re&&(nl(m),u({type:"git.show",workspaceId:re,ref:m}))}function Ml(m,O){rn(null),C({target:m,label:O})}function hl(){!re||!ve||(u({type:"git.checkout",workspaceId:re,target:ve.target}),C(null))}function pl(){re&&(rn(null),u({type:"git.push",workspaceId:re}))}function Dl(m){re&&(rn(null),u({type:"git.pull",workspaceId:re,merge:m}))}function Ou(){re&&(rn(null),Rn(null),vn(!0),u({type:"github.status"}),u({type:"github.owners"}),u({type:"git.files",workspaceId:re}))}function po(m){re&&(rn(null),u({type:"git.publish",workspaceId:re,...m}))}function mo(m){re&&(rn(null),u({type:"git.remote",workspaceId:re,url:m}))}function Lu(){rn(null),Bs(!0)}function Qn(m){u({type:"github.token",token:m}),u({type:"github.owners"})}function Wt(){u({type:"github.status"}),u({type:"github.owners"})}b.useEffect(()=>{if(!(!gn||!re))for(const m of vs)m in Gs||u({type:"fs.list",workspaceId:re,path:m})},[gn,vs,Gs,re,u]);function yt(m){js(O=>O.includes(m)?O.filter(ce=>ce!==m):[...O,m])}function Pl(m){if(!m){sa(null);return}re&&u({type:"fs.search",workspaceId:re,query:m})}function Vs(m){if(!m){Wc(null);return}re&&u({type:"fs.grep",workspaceId:re,query:m})}const rc=b.useCallback((m,O)=>{bu(rt=>({...rt,[m]:O}));const ce=Dn.current;if(O===null||!ce)return;const Ae=O.lastIndexOf("/");if(Ae!==-1){u({type:"fs.list",workspaceId:ce,path:O.slice(0,Ae)});return}if(O===""){u({type:"fs.list",workspaceId:ce,path:""});return}u({type:"fs.search",workspaceId:ce,query:O,scope:m})},[u]),Wl=b.useMemo(()=>p_(Zl.mention??null,la.mention??null,Gs),[Zl.mention,la.mention,Gs]),zu=b.useMemo(()=>p_(Zl.side??null,la.side??null,Gs),[Zl.side,la.side,Gs]);function Iu(m){Ol(m.path,{line:m.line,column:m.column})}function pa(m){const O=[];let ce=Ar(m.path);for(;O.push(ce),!!ce;)ce=Ar(ce);js(Ae=>{const rt=new Set(Ae);for(const It of O)rt.add(It);return m.kind==="dir"&&rt.add(m.path),[...rt]}),m.kind==="file"&&Ol(m.path)}function Ol(m,O){if(Cl.current.find(Ae=>Ae.path===m)){ue(m),O&&eo({path:m,...O,token:++Ir.current});return}re&&(O&&(Ur.current={path:m,...O}),nr.current.add(m),u({type:"fs.read",workspaceId:re,path:m}))}function ar(m,O=!1){const ce=Cl.current,Ae=ce.find(Bn=>Bn.path===m);if(Ae&&Wi(Ae)&&!O){Xn(m);return}Xn(null);const rt=ce.findIndex(Bn=>Bn.path===m),It=ce.filter(Bn=>Bn.path!==m);zn(It),ue(Bn=>{var Gi;return Bn===m?((Gi=It[Math.min(rt,It.length-1)])==null?void 0:Gi.path)??null:Bn})}function ei(m,O=!1){const ce=Cl.current.find(Ae=>Ae.path===m);!ce||!re||!O&&!Wi(ce)||(ca.current.set(m,ce.text),u({type:"fs.write",workspaceId:re,path:m,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...O?{force:!0}:{}}))}function go(m){re&&u({type:"fs.read",workspaceId:re,path:m})}function zi(m){re&&(ir.current.has(m)||(ir.current.add(m),u({type:"fs.readMedia",workspaceId:re,path:m})))}const Ll=b.useRef(new Map);function ti(m){const O=Ll.current,ce=O.get(m);ce&&clearTimeout(ce);const Ae=(Jt==null?void 0:Jt.autoSaveAfterPauseMs)??0;Ae<=0||O.set(m,setTimeout(()=>{O.delete(m);const rt=Cl.current.find(It=>It.path===m);rt&&Wi(rt)&&!rt.stale&&ei(m)},Ae))}function zl(m,O,ce){if(!re)return;const Ae=m?`${m}/${ce}`:ce;at(null),O==="file"&&(lr.current=Ae),u({type:"fs.create",workspaceId:re,path:Ae,kind:O})}function xo(m,O){if(!re)return;const ce=Ar(m),Ae=ce?`${ce}/${O}`:O;at(null),sr.current={from:m,to:Ae},u({type:"fs.rename",workspaceId:re,path:m,to:Ae})}function bo(m,O){if(!re)return;const ce=m.slice(m.lastIndexOf("/")+1),Ae=O?`${O}/${ce}`:ce;Ae!==m&&(at(null),sr.current={from:m,to:Ae},u({type:"fs.rename",workspaceId:re,path:m,to:Ae}))}function ma(m,O){re&&(at(null),u({type:"fs.copy",workspaceId:re,path:m,toDir:O}))}function cc(m){re&&(at(null),Ni(null),u({type:"fs.delete",workspaceId:re,path:m.path}),zn(O=>O.filter(ce=>ce.path!==m.path&&!ce.path.startsWith(`${m.path}/`))),ue(O=>O&&(O===m.path||O.startsWith(`${m.path}/`))?null:O))}function Ii(){Kl({}),js([""]),zn([]),ue(null),at(null),sa(null),Wc(null),bu({}),Lr({}),eo(null),nr.current.clear(),ca.current.clear(),ir.current.clear(),Ur.current=null,sr.current=null,lr.current=null}function Kn(){!re||$r||!Si||(qr(null),Yr.current=!0,u({type:"term.open",workspaceId:re,cols:80,rows:24}))}function oc(m){u({type:"term.close",id:m})}function Uu(m,O){pe&&u({type:"permission.respond",sessionId:pe,requestId:m,decision:O})}function yf(m,O){pe&&u({type:"permission.respond",sessionId:pe,requestId:m,decision:"allow",answers:O})}function vf(m){pe&&u({type:"permission.respond",sessionId:pe,requestId:m,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function jf(m,O){pe&&u({type:"permission.respond",sessionId:pe,requestId:m,decision:"allow",plan:O})}function Sn(m){pe&&u({type:"permission.respond",sessionId:pe,requestId:m,decision:"deny",reason:"Пользователь просит продолжить планирование"})}b.useEffect(()=>{function m(O){if(O.key!=="Escape")return;if(Bt!==null){const Ae=O.target;if(!(Ae instanceof HTMLElement&&Ae.closest(".termview, .editor, .sidepane"))){Kr(null);return}}if(!pe||bt.pending.length>0)return;const ce=O.target;ce instanceof HTMLElement&&ce.closest('.sidepane, .editor, .comparison, [role="dialog"]')||u({type:"control.interrupt",sessionId:pe})}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[pe,bt.pending.length,u,Bt]),b.useEffect(()=>{function m(O){O.key!=="`"||!(O.ctrlKey||O.metaKey)||Si&&(O.preventDefault(),to(ce=>!ce))}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[Si]);const uc=b.useMemo(()=>{const m=(dt==null?void 0:dt.commands)??[];return m.length===0||(Y==null?void 0:Y.provider)!=="claude"?m:[...m,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...h_]},[dt,Y==null?void 0:Y.provider]);function ga(m){if(m==="fork"&&(Y==null?void 0:Y.provider)==="codex"&&pe&&!Zn){const ce=Y;return Ge(null),nt(null),Xe(ss),u({type:"session.start",workspaceId:ce.workspaceId,provider:"codex",resume:ce.id,fork:!0}),!0}const O=tE[m];return O&&(Y==null?void 0:Y.provider)==="claude"?(sc(O),!0):(Y==null?void 0:Y.provider)!=="claude"||!h_.some(ce=>ce.name===m)?!1:(lc(),m==="logout"&&ic.logout(),m==="switch-account"&&ic.login("claudeai",!0),!0)}const ni=(Y==null?void 0:Y.state)==="waiting_permission",Os=(Y==null?void 0:Y.state)==="reconnecting",Zn=(Y==null?void 0:Y.state)==="running"||Os||ni,Ot=bt.pending[0]??null,_o=Ot?py(Ot.toolName,Ot.input):null,[Hu,wf]=b.useState(()=>new Set),rr=Ot?Hu.has(Ot.requestId):!1,si=Ot?Ot.questions&&Ot.questions.length>0?"question":_o!==null?"plan":"permission":null;function xa(m,O){wf(ce=>{if(ce.has(m)===O)return ce;const Ae=new Set(ce);return O?Ae.add(m):Ae.delete(m),Ae})}b.useEffect(()=>{!_s&&!gn||!re||Zn||u({type:"git.state",workspaceId:re})},[_s,gn,re,Zn,u]),b.useEffect(()=>{if(!(Zn||!re)){gn&&Kl(m=>{const O={};for(const[ce,Ae]of Object.entries(m))so.current.includes(ce)||(O[ce]=Ae);return O});for(const m of Cl.current)Wi(m)||u({type:"fs.read",workspaceId:re,path:m.path})}},[Zn,re,gn,u]);const ba=(Y==null?void 0:Y.cwd)??(dt==null?void 0:dt.cwd)??null,yo=(dt==null?void 0:dt.models)??[],Il=(Y==null?void 0:Y.model)??(dt==null?void 0:dt.model)??null,{rows:dc,selected:fc}=g_(yo,Il),li=El?{model:El.model,effort:El.effort,ultracode:El.ultracode,thinking:El.thinking,switchOnFlag:El.switchModelsOnFlag}:{model:Ei.model??Il,effort:Ei.effort??(Y==null?void 0:Y.effort)??null,ultracode:Ei.ultracode??(Y==null?void 0:Y.ultracode)??!1,thinking:Ei.thinking??(Y==null?void 0:Y.thinking)??!0,switchOnFlag:Ei.switchOnFlag??(Y==null?void 0:Y.switchModelsOnFlag)??!0},vo=g_(yo,li.model),Bu=(El==null?void 0:El.state)==="running",ml=N?Mn.find(m=>m.path===N)??null:null,Ui=new Set(Mn.filter(Wi).map(m=>m.path)),Hi=m=>i.jsx(zS,{pane:m,width:kl.widths[m],onResize:O=>kl.setWidth(m,O),onReset:()=>kl.reset(m)}),Bi=m=>De?null:()=>wu(m),_a=(Y==null?void 0:Y.provider)==="codex"?bv:(Y==null?void 0:Y.provider)==="antigravity"?_v:R_,ya=dt&&i.jsx(jl,{title:"Режим прав",value:(Y==null?void 0:Y.permissionMode)??"default",options:_a.map(m=>({value:m.value,label:m.value,hint:m.hint})),onChange:m=>{pe&&u({type:"control.set_mode",sessionId:pe,mode:m})}}),cr=dc.length>0?i.jsx(Ny,{models:dc,value:fc,effort:(Y==null?void 0:Y.effort)??null,ultracode:(Y==null?void 0:Y.ultracode)??!1,thinking:(Y==null?void 0:Y.thinking)??!0,switchOnFlag:(Y==null?void 0:Y.switchModelsOnFlag)??!0,showSwitchOnFlag:(Y==null?void 0:Y.provider)==="claude",showUltracode:(Y==null?void 0:Y.provider)==="claude",showThinking:(Y==null?void 0:Y.provider)==="claude",onModel:m=>{!pe||!m||u({type:"control.set_model",sessionId:pe,model:m})},onEffort:m=>{pe&&u({type:"control.set_effort",sessionId:pe,effort:m})},onUltracode:m=>{pe&&u({type:"control.set_ultracode",sessionId:pe,enabled:m})},onThinking:m=>{pe&&u({type:"control.set_thinking",sessionId:pe,enabled:m})},onSwitchOnFlag:m=>{pe&&u({type:"control.set_flag_switch",sessionId:pe,enabled:m})}}):Il&&i.jsx("span",{className:"badge",children:Il}),or=Zn&&i.jsx("span",{className:ni?"badge badge--wait":"badge badge--live",children:ni?"ждёт":Os?"переподключается":"работает"}),hc=(Y==null?void 0:Y.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),jo=or||hc,ii=()=>{pe&&u({type:"session.reconnect",sessionId:pe})},qu=Os?"Сессия уже поднимает новый процесс":Zn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",ai=pe&&(Os||(Y==null?void 0:Y.state)==="error")?i.jsxs("div",{className:Os?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),Os?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:Os?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ii,children:Os?"Переподключить сейчас":"Переподключить"})]}):null,wo=Ai?i.jsx(SS,{handoff:Ai,onContinue:()=>Ns(Ai),onShow:()=>gs(Ai),onDismiss:()=>nc(Ai.sessionId)}):null,ur=Y&&Y.totalCostUsd>0?`$${Y.totalCostUsd.toFixed(3)}`:null,Ul=(Y==null?void 0:Y.provider)==="claude"&&i.jsx("button",{className:Fl?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Fl,onClick:()=>Za(m=>!m),children:i.jsx(dE,{})}),ri=Y&&Y.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>da(Y),children:i.jsx(rE,{})}),gl=Y?hn[Y.id]===!0:!1,dr=L_({onLongPress:()=>{Y&&tc(Y)},onClick:()=>{Y&&ho(Y)},disabled:gl}),No=Y&&Y.state!=="closed"&&Y.provider==="claude"&&i.jsxs("button",{type:"button",className:gl?"pane-btn pane-btn--handoff is-busy":dr.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${dr.thresholdMs}ms`},title:gl?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":gl,disabled:gl,...dr.handlers,children:[i.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),i.jsx(cE,{})]}),fr=["var(--sidebar-w)",`${bp}px`,gn&&Bt!=="files"?"var(--files-w)":"0px",$s&&Bt!=="search"?"var(--search-w)":"0px",_s&&Bt!=="git"?"var(--git-w)":"0px",Fl&&Bt!=="ask"?"var(--ask-w)":"0px"],hr={...kl.style,"--comparison-max-w":`calc(100vw - ${fr.join(" - ")})`},ko=(m=!1)=>i.jsx(vw,{dashboard:m,onAllProjects:()=>z.setView("projects"),onCompareSession:z.openComparison,open:m||Ze,connected:h,status:g,workspaces:q,archivedWorkspaces:L,workspaceFolders:V,sessionFolders:I.filter(O=>O.workspaceId===re),pinnedFolders:se,sessions:we.filter(O=>O.workspaceId===re),archived:Z.filter(O=>O.workspaceId===re),pinned:ne,live:ke,listOrder:ze,liveSessionsFirst:(Jt==null?void 0:Jt.liveSessionsFirst)===!0,onReorder:uo,activeWorkspaceId:re,activeSessionId:pe,onPinSessions:oo,onSelectPinned:Al,onCloseWorkspaces:Oi,onRestoreWorkspaces:Au,onArchiveSessions:Cu,onUnarchiveSessions:O=>{re&&u({type:"session.unarchive",workspaceId:re,sessionIds:O})},onCreateFolder:Ru,onRenameFolder:xf,onSetFolderColor:bf,onDeleteFolder:_f,onAssignToFolder:Mu,onSelectWorkspace:ws,onSelectSession:Fr,onRenameSession:Jl,onStopSession:da,onOpenWorkspace:()=>Ft(!0),onNewSession:co,enabledProviders:pn,onOpenExtensions:pe&&(Y==null?void 0:Y.provider)==="claude"?()=>sc("mcp"):null,account:xs,onOpenAccount:lc,relay:v,onOpenRelay:D?null:()=>A(!0),onOpenSettings:ks,themeMode:kn,onCycleTheme:Pt,navigation:i.jsx(gN,{hub:z})},m?re:"navigation");return i.jsxs("div",{className:"app",style:hr,children:[ko(),Hi("sidebar"),Ze&&i.jsx("div",{className:"scrim",onClick:()=>st(!1)}),i.jsx(D1,{open:gn,tree:Gs,expanded:new Set(vs),activePath:N,dirty:Ui,gitChanges:(yn==null?void 0:yn.changed)??[],result:Oe,searchResult:ki,onSearch:Pl,onReveal:pa,onToggle:yt,onOpen:Ol,onCreate:zl,onRename:xo,onMove:bo,onCopy:ma,onDelete:Ni,onRefresh:()=>{at(null),Kl({}),Ds()},onClose:()=>qs(!1),zoomed:Bt==="files",onToggleZoom:Bi("files")}),gn&&Bt!=="files"&&Hi("files"),i.jsx($1,{open:$s,result:_u,onSearch:Vs,onOpenMatch:Iu,onClose:()=>sl(!1),zoomed:Bt==="search",onToggleZoom:Bi("search")}),$s&&Bt!=="search"&&Hi("search"),i.jsx(gk,{open:_s,state:yn,result:ys,selected:wi,busy:J,onRefresh:Ds,onShow:Ys,onCheckout:Ml,onPush:pl,onPull:Dl,onPublish:Ou,onConnectRemote:Lu,onDismissResult:()=>rn(null),onClose:()=>rs(!1),zoomed:Bt==="git",onToggleZoom:Bi("git")}),_s&&Bt!=="git"&&Hi("git"),i.jsxs("main",{className:Bt==="main"||Bt==="terminal"?"main main--zoomed":"main",children:[_&&k&&i.jsx(TS,{state:_}),i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>st(!0),children:"☰"}),i.jsx("button",{className:gn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","data-label":"Файлы","aria-label":"Файлы проекта","aria-pressed":gn,onClick:()=>{qs(m=>!m),rs(!1),sl(!1)},children:i.jsx(lE,{})}),i.jsx("button",{className:$s?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","data-label":"Поиск","aria-label":"Поиск по тексту в проекте","aria-pressed":$s,onClick:()=>{sl(m=>!m),qs(!1),rs(!1)},children:i.jsx(iE,{})}),i.jsx("button",{className:_s?"pane-btn is-on":"pane-btn",title:"История git","data-label":"История","aria-label":"История git","aria-pressed":_s,onClick:()=>{rs(m=>!m),qs(!1),sl(!1)},children:i.jsx(aE,{})}),Si&&i.jsx("button",{className:ia?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ia,onClick:()=>to(m=>!m),children:i.jsx(uE,{})}),De&&Ul,De&&i.jsx("button",{className:ut?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":ut,onClick:()=>Ce(!0),children:i.jsx(fE,{})}),i.jsxs("div",{className:"topbar__id",children:[Be&&Y?i.jsx(_i,{className:"rename--title",value:Y.title??"",onCommit:m=>{Jl(Y,m),Fe(!1)},onCancel:()=>Fe(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!Y||De,title:Y&&!De?"Переименовать сессию":void 0,onClick:()=>Fe(!0),children:(Y==null?void 0:Y.title)??(es==null?void 0:es.name)??"Ваше пространство"}),es&&pe&&i.jsx("button",{className:"topbar__project",title:"Обзор проекта",onClick:()=>ws(es.id),children:es.name})]}),De?jo:ba&&i.jsx(wy,{path:ba})]}),!De&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:Wn?"meters-refresh is-busy":"meters-refresh",title:io,"aria-label":Ri,"aria-busy":Wn,disabled:!pe||Wn,onClick:Hn,children:i.jsx(hE,{})}),i.jsx(Sy,{usage:Eu}),i.jsx(Cy,{}),ya,cr,jo,ur&&i.jsx("span",{className:"badge badge--cost",children:ur}),No,ri,Ul]})]}),i.jsx(xN,{hub:z,hasSession:!!pe}),!ml&&Y&&i.jsx(hy,{session:Y,items:[...lo,...bt.items],pendingCount:bt.pending.length},Y.id),i.jsx(KS,{tokens:(Vt==null?void 0:Vt.tokens)??bt.contextTokens,maxTokens:(Vt==null?void 0:Vt.maxTokens)??null,fetchedAt:(Vt==null?void 0:Vt.fetchedAt)??null}),De&&ut&&i.jsx(Zk,{onClose:()=>Ce(!1),permission:ya,model:cr,usage:Eu,cwd:ba,costLabel:ur,onRefresh:Hn,refreshing:Wn,metersFetchedAt:Ci,onRename:Y?()=>{Fe(!0),Ce(!1)}:null,onHandoff:Y&&Y.state!=="closed"&&Y.provider==="claude"?()=>{ho(Y),Ce(!1)}:null,onFreshSession:Y&&Y.state!=="closed"&&Y.provider==="claude"?()=>{tc(Y),Ce(!1)}:null,handoffWriting:gl,onStop:Y&&Y.state!=="closed"?()=>{da(Y),Ce(!1)}:null}),Mn.length>0&&i.jsx(cw,{files:Mn,activePath:N,busy:Zn,onSelect:ue,onClose:m=>ar(m),zoomed:Bt==="main",onToggleZoom:Bi("main")}),ml?i.jsx(aw,{file:ml,goto:(zr==null?void 0:zr.path)===ml.path?zr:null,onChange:(m,O)=>{zn(ce=>ce.map(Ae=>Ae.path===m?{...Ae,text:O}:Ae)),ti(m)},onSave:m=>ei(m),onReload:go,onOverwrite:m=>ei(m,!0),onRequestMedia:zi,onTogglePreview:m=>zn(O=>O.map(ce=>ce.path===m?{...ce,previewMode:!ce.previewMode}:ce))}):!pe&&re?ko(!0):i.jsxs(i.Fragment,{children:[i.jsx(hf,{items:bt.items,welcome:i.jsx(oN,{connected:h,workspaceName:es==null?void 0:es.name,hasSession:!!pe,onOpenWorkspace:()=>Ft(!0),onNewSession:()=>co(),onOpenFiles:()=>{qs(!0),sl(!1),rs(!1)},onOpenSettings:ks}),busy:Zn&&!Os,waiting:ni,history:lo,historyHasMore:gp(Ct),historyLoading:Ct.loading,onLoadHistory:Su,sessionId:pe??void 0,onEditMessage:(Y==null?void 0:Y.provider)==="antigravity"?void 0:(m,O,ce)=>{if(!pe||k)return!1;const Ae=pe;return Li(()=>u({type:"prompt.edit",sessionId:Ae,userIndex:m,text:O,images:ce}))}}),ai,wo,pe&&((qi=Y==null?void 0:Y.tasks)!=null&&qi.length)?i.jsx(hw,{tasks:Y.tasks,onStop:m=>u({type:"task.stop",sessionId:pe,taskId:m})}):null,Ot&&si&&rr&&i.jsx(hN,{kind:si,toolName:Ot.toolName,queued:bt.pending.length-1,onExpand:()=>xa(Ot.requestId,!1)}),i.jsx(em,{disabled:!pe,busy:Zn&&!Os,sendBlocked:k,placeholder:Os?"Промпт уйдёт, как только связь вернётся":(Y==null?void 0:Y.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:uc,sessionTitle:(Y==null?void 0:Y.title)??null,contextResult:Wl,draftKey:pe,onContextSearch:m=>rc("mention",m),onCommand:ga,onSend:ec,onInterrupt:()=>{pe&&u({type:"control.interrupt",sessionId:pe})}})]}),ia&&Si&&i.jsxs(i.Fragment,{children:[!De&&Bt!=="terminal"&&i.jsx(US,{height:Gr.height,onResize:Gr.setHeight,onReset:Gr.reset}),i.jsx(GS,{mobile:De,zoomed:Bt==="terminal",onToggleZoom:Bi("terminal"),terminals:Hr,activeId:yu,blocked:$r,error:pf,onDismissError:()=>qr(null),height:De?Qa.height:Gr.height,offset:De?{top:Qa.offsetTop,left:Qa.offsetLeft}:void 0,onSelect:Br,onOpen:Kn,onClose:oc,onInput:(m,O)=>u({type:"term.input",id:m,data:O}),onResize:(m,O,ce)=>u({type:"term.resize",id:m,cols:O,rows:ce}),onAttach:m=>u({type:"term.attach",id:m}),onHide:()=>to(!1),registerSink:mf})]})]}),i.jsx(Hk,{open:Fl,items:ju.items,busy:Bu,ready:pe!==null,sendBlocked:k,commands:uc,contextResult:zu,draftKey:pe,models:vo.rows,model:vo.selected,effort:li.effort,ultracode:li.ultracode,thinking:li.thinking,switchOnFlag:li.switchOnFlag,onContextSearch:m=>rc("side",m),onCommand:ga,onModel:m=>{m&&(ll(O=>({...O,model:m})),Rl(O=>u({type:"control.set_model",sessionId:O,model:m})))},onEffort:m=>{ll(O=>({...O,effort:m,ultracode:!1})),Rl(O=>u({type:"control.set_effort",sessionId:O,effort:m}))},onUltracode:m=>{ll(O=>({...O,ultracode:m,...m?{effort:"xhigh"}:{}})),Rl(O=>u({type:"control.set_ultracode",sessionId:O,enabled:m}))},onThinking:m=>{ll(O=>({...O,thinking:m})),Rl(O=>u({type:"control.set_thinking",sessionId:O,enabled:m}))},onSwitchOnFlag:m=>{ll(O=>({...O,switchOnFlag:m})),Rl(O=>u({type:"control.set_flag_switch",sessionId:O,enabled:m}))},onAsk:ha,onInterrupt:()=>{vu&&u({type:"control.interrupt",sessionId:vu})},onReset:ac,onClose:()=>Za(!1),zoomed:Bt==="ask",onToggleZoom:Bi("ask")}),Fl&&Bt!=="ask"&&Hi("ask"),(_s||Fl||gn||$s)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{rs(!1),Za(!1),qs(!1),sl(!1)}}),Ql&&i.jsx(yk,{detail:Ql,local:((yn==null?void 0:yn.hasRemote)??!1)&&(yn==null?void 0:yn.commits.some(m=>m.hash===Ql.hash&&!m.pushed))===!0,onCheckout:Ml,onClose:()=>{An(null),nl(null)}}),_e&&i.jsxs(us,{title:"Лимит плана почти исчерпан",onClose:()=>fo(!1),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>fo(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>fo(!0),children:"Отправить всё равно"})]}),children:[i.jsxs("p",{className:"modal__text",children:[rf[_e.warning.limit][0].toUpperCase(),rf[_e.warning.limit].slice(1)," использован на"," ",Math.round(_e.warning.utilization)," %, сброс в"," ",OS(_e.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),i.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),K&&i.jsx(us,{title:"Остановить сессию?",onClose:()=>de(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>de(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{u({type:"session.close",sessionId:K.id}),de(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),ve&&i.jsxs(us,{title:"Переключить рабочее дерево?",onClose:()=>C(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>C(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:hl,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",ve.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Zn&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),yn&&yn.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",yn.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),_t&&i.jsx(Dk,{status:Ee,owners:Qe,files:ht,defaultName:(es==null?void 0:es.name)??"",hasCommits:yn===null||yn.head!=="",busy:J,result:ys,onRefreshStatus:Wt,onSaveToken:Qn,onPublish:po,onDismissResult:()=>rn(null),onClose:()=>vn(!1)}),mn&&i.jsx(Uk,{busy:J,result:ys,onSubmit:mo,onDismissResult:()=>rn(null),onClose:()=>Bs(!1)}),In&&i.jsx(us,{title:In.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Ni(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Ni(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>cc(In),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[In.path," будет удалён с диска",In.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),na&&i.jsx(us,{title:"Закрыть без сохранения?",onClose:()=>Xn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Xn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>ar(na,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{ei(na),ar(na,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",na," есть несохранённые правки."]})}),lt&&i.jsx(Jk,{tab:lt,servers:sn,plugins:he,marketplaces:Ie,catalog:ps,result:Ws,auth:Rs,remote:D,actions:Du,onTab:Je,onClose:()=>Je(null)}),Hs&&i.jsx(aS,{status:xs,login:is,actions:ic,remote:D,runningSessions:we.filter(m=>m.state==="running"||m.state==="waiting_permission").length,onReconnect:pe?()=>{ii(),Ln(!1)}:null,reconnectBlocked:Zn,reconnectHint:qu,onClose:()=>Ln(!1)}),E&&i.jsx(dS,{state:v,onPair:(m,O)=>u({type:"relay.pair",code:m,...O?{name:O}:{}}),onUnpair:()=>u({type:"relay.unpair"}),onClose:()=>A(!1)}),et&&i.jsx(NS,{themeMode:kn,onThemeChange:Vn,settings:Jt,models:(Y==null?void 0:Y.provider)==="claude"?(dt==null?void 0:dt.models)??[]:[],relayState:v,networkState:_,local:Zd()==="local",onChange:fa,onEnableShell:()=>u({type:"relay.shell.enable"}),onDisableShell:()=>u({type:"relay.shell.disable"}),onOpenRelay:()=>{Pn(!1),A(!0)},onClose:()=>Pn(!1)}),kt&&i.jsx(ik,{candidates:Ht,searching:fn,agentItems:wn.items,agentBusy:(ft==null?void 0:ft.state)==="running",error:Cn,roots:hs,created:ye,onSearch:Mi,onAskAgent:ua,onInterrupt:()=>{const m=er.current;m&&u({type:"control.interrupt",sessionId:m})},onSubmit:ao,onCreate:Tu,onClose:ro}),Ot!=null&&Ot.questions&&Ot.questions.length>0?i.jsx(by,{request:{...Ot,questions:Ot.questions},queued:bt.pending.length-1,collapsed:rr||z.view!==null,onCollapse:()=>xa(Ot.requestId,!0),onAnswer:yf,onDecline:vf}):Ot&&_o!==null?i.jsx(my,{request:Ot,plan:_o,queued:bt.pending.length-1,collapsed:rr||z.view!==null,onCollapse:()=>xa(Ot.requestId,!0),onAccept:jf,onDecline:Sn}):Ot&&i.jsx(xy,{request:Ot,queued:bt.pending.length-1,collapsed:rr||z.view!==null,onCollapse:()=>xa(Ot.requestId,!0),onDecide:Uu}),ms&&i.jsx(ES,{handoff:ms,onClose:()=>gs(null)}),z.compareId&&z.compareVisible&&z.sessions[z.compareId]&&Hi("comparison"),i.jsx(tk,{hub:z,workspaces:q,primary:Y,connected:h,networkBlocked:k,onFocusPrimary:()=>z.setCompareVisible(!1),onPromote:m=>{const O=Y;Al(m),O&&O.id!==m.id?z.openComparison(O):z.closeComparison()}}),i.jsx(bN,{hub:z,connected:h,workspaces:q,activeWorkspaceId:re,activeSession:Y,providers:pn,onSelectSession:Fr,onSelectWorkspace:ws,onOpenWorkspace:()=>{z.setView(null),Ft(!0)},onOpenSettings:()=>{z.setView(null),ks()},onOpenFiles:()=>{z.setView(null),qs(!0),sl(!1),rs(!1),z.setCompareVisible(!1)},onNewSession:al,onStartStage:Jr}),i.jsx(RS,{notices:Nl,onDismiss:m=>tl(O=>O.filter(ce=>ce.id!==m))})]})}function lE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.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 iE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function aE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function rE(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:i.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function cE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),i.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),i.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function oE(n,l){return x_(n)===x_(l)}function x_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function uE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),i.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),i.jsx("path",{d:"M8.2 10h3.1"})]})}function dE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function fE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function hE(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Ay=document.getElementById("root");if(!Ay)throw new Error("#root not found");P0.createRoot(Ay).render(i.jsx(b.StrictMode,{children:i.jsx(sE,{})}));export{Jj as D,on as I,dn as N,gE as P,vl as T,Vl as a,Z_ as b,Ps as c,mE as d,ey as e,hu as f,g1 as h,xE as p,bE as s,Re as t};
|