@i14ks/ccv 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/bundle/ccv.mjs +54 -2
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-Xlc7emp4.js → codemirror-BrLcp4sb.js} +1 -1
  4. package/web/assets/{index-Bfg1ojRW.js → index-2eTZZkmV.js} +1 -1
  5. package/web/assets/{index-CmWfuvMB.js → index-6AoeJwuj.js} +1 -1
  6. package/web/assets/{index-CATqSzDf.js → index-7LSjuWYp.js} +1 -1
  7. package/web/assets/{index-DPFqYXoR.js → index-B308Zs-7.js} +1 -1
  8. package/web/assets/{index-C9wRY7OB.js → index-BB8C49mo.js} +1 -1
  9. package/web/assets/{index-CgJ8kt13.js → index-BLgzE6_-.js} +1 -1
  10. package/web/assets/index-BUb95YHi.js +134 -0
  11. package/web/assets/{index-B-bp9mCT.js → index-BW6uFCoV.js} +1 -1
  12. package/web/assets/{index-CcRfA6wX.js → index-BeHb7RMj.js} +1 -1
  13. package/web/assets/index-CDFIyBFM.css +1 -0
  14. package/web/assets/{index-BiADfWp_.js → index-CKsgdAOW.js} +1 -1
  15. package/web/assets/{index-COjrz9O3.js → index-Cw-SkQ7f.js} +1 -1
  16. package/web/assets/{index-DGIVHKoZ.js → index-DMdUw04H.js} +1 -1
  17. package/web/assets/{index-DD9jOM3u.js → index-DQz01d1h.js} +1 -1
  18. package/web/assets/{index-DriANGJp.js → index-DT-n8jho.js} +1 -1
  19. package/web/assets/{index-CyvkCV_I.js → index-DXY0QGeO.js} +1 -1
  20. package/web/assets/{index-GPJsAXZm.js → index-DrsxSUf0.js} +1 -1
  21. package/web/assets/{index-Rdr8VKHz.js → index-XrDqYi4a.js} +1 -1
  22. package/web/assets/{index-BHPUdhIS.js → index-ZCACtBsD.js} +1 -1
  23. package/web/assets/{index-B59yN5CT.js → index-cXMV_yZe.js} +1 -1
  24. package/web/assets/{index-Bn6m7y1f.js → index-heoNU_6a.js} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-BRCAbil3.css +0 -1
  27. package/web/assets/index-CRr2Y5uA.js +0 -134
@@ -0,0 +1,134 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DQz01d1h.js","./index-7LSjuWYp.js","./index-BB8C49mo.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-Cw-SkQ7f.js","./index-BLgzE6_-.js","./index-DrsxSUf0.js","./index-6AoeJwuj.js","./index-BeHb7RMj.js","./index-DXY0QGeO.js","./index-cXMV_yZe.js","./index-DT-n8jho.js","./index-2eTZZkmV.js","./index-XrDqYi4a.js","./index-CKsgdAOW.js","./index-heoNU_6a.js","./index-ZCACtBsD.js","./index-B308Zs-7.js","./index-DMdUw04H.js","./index-BW6uFCoV.js","./codemirror-BrLcp4sb.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 vx=l=>{throw TypeError(l)};var x0=(l,s,r)=>s in l?g0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var It=(l,s,r)=>x0(l,typeof s!="symbol"?s+"":s,r),Eh=(l,s,r)=>s.has(l)||vx("Cannot "+r);var qe=(l,s,r)=>(Eh(l,s,"read from private field"),r?r.call(l):s.get(l)),dn=(l,s,r)=>s.has(l)?vx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),wt=(l,s,r,c)=>(Eh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),Un=(l,s,r)=>(Eh(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Ch={exports:{}},Ao={};/**
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 jx;function b0(){if(jx)return Ao;jx=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:l,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Ao.Fragment=s,Ao.jsx=r,Ao.jsxs=r,Ao}var Sx;function _0(){return Sx||(Sx=1,Ch.exports=b0()),Ch.exports}var i=_0(),Ah={exports:{}},Qe={};/**
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 wx;function y0(){if(wx)return Qe;wx=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function G(E,X,oe){this.props=E,this.context=X,this.refs=A,this.updater=oe||N}G.prototype.isReactComponent={},G.prototype.setState=function(E,X){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,X,"setState")},G.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function F(){}F.prototype=G.prototype;function B(E,X,oe){this.props=E,this.context=X,this.refs=A,this.updater=oe||N}var D=B.prototype=new F;D.constructor=B,T(D,G.prototype),D.isPureReactComponent=!0;var J=Array.isArray;function H(){}var z={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function Y(E,X,oe){var me=oe.ref;return{$$typeof:l,type:E,key:X,ref:me!==void 0?me:null,props:oe}}function ae(E,X){return Y(E.type,X,E.props)}function W(E){return typeof E=="object"&&E!==null&&E.$$typeof===l}function ce(E){var X={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(oe){return X[oe]})}var ye=/\/+/g;function Oe(E,X){return typeof E=="object"&&E!==null&&E.key!=null?ce(""+E.key):X.toString(36)}function we(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(H,H):(E.status="pending",E.then(function(X){E.status==="pending"&&(E.status="fulfilled",E.value=X)},function(X){E.status==="pending"&&(E.status="rejected",E.reason=X)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function M(E,X,oe,me,Te){var Ee=typeof E;(Ee==="undefined"||Ee==="boolean")&&(E=null);var Ae=!1;if(E===null)Ae=!0;else switch(Ee){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(E.$$typeof){case l:case s:Ae=!0;break;case y:return Ae=E._init,M(Ae(E._payload),X,oe,me,Te)}}if(Ae)return Te=Te(E),Ae=me===""?"."+Oe(E,0):me,J(Te)?(oe="",Ae!=null&&(oe=Ae.replace(ye,"$&/")+"/"),M(Te,X,oe,"",function(dt){return dt})):Te!=null&&(W(Te)&&(Te=ae(Te,oe+(Te.key==null||E&&E.key===Te.key?"":(""+Te.key).replace(ye,"$&/")+"/")+Ae)),X.push(Te)),1;Ae=0;var nt=me===""?".":me+":";if(J(E))for(var Xe=0;Xe<E.length;Xe++)me=E[Xe],Ee=nt+Oe(me,Xe),Ae+=M(me,X,oe,Ee,Te);else if(Xe=C(E),typeof Xe=="function")for(E=Xe.call(E),Xe=0;!(me=E.next()).done;)me=me.value,Ee=nt+Oe(me,Xe++),Ae+=M(me,X,oe,Ee,Te);else if(Ee==="object"){if(typeof E.then=="function")return M(we(E),X,oe,me,Te);throw X=String(E),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function fe(E,X,oe){if(E==null)return E;var me=[],Te=0;return M(E,me,"","",function(Ee){return X.call(oe,Ee,Te++)}),me}function L(E){if(E._status===-1){var X=E._result;X=X(),X.then(function(oe){(E._status===0||E._status===-1)&&(E._status=1,E._result=oe)},function(oe){(E._status===0||E._status===-1)&&(E._status=2,E._result=oe)}),E._status===-1&&(E._status=0,E._result=X)}if(E._status===1)return E._result.default;throw E._result}var xe=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=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(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},je={map:fe,forEach:function(E,X,oe){fe(E,function(){X.apply(this,arguments)},oe)},count:function(E){var X=0;return fe(E,function(){X++}),X},toArray:function(E){return fe(E,function(X){return X})||[]},only:function(E){if(!W(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Qe.Activity=j,Qe.Children=je,Qe.Component=G,Qe.Fragment=r,Qe.Profiler=o,Qe.PureComponent=B,Qe.StrictMode=c,Qe.Suspense=g,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(E){return z.H.useMemoCache(E)}},Qe.cache=function(E){return function(){return E.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(E,X,oe){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var me=T({},E.props),Te=E.key;if(X!=null)for(Ee in X.key!==void 0&&(Te=""+X.key),X)!I.call(X,Ee)||Ee==="key"||Ee==="__self"||Ee==="__source"||Ee==="ref"&&X.ref===void 0||(me[Ee]=X[Ee]);var Ee=arguments.length-2;if(Ee===1)me.children=oe;else if(1<Ee){for(var Ae=Array(Ee),nt=0;nt<Ee;nt++)Ae[nt]=arguments[nt+2];me.children=Ae}return Y(E.type,Te,me)},Qe.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},Qe.createElement=function(E,X,oe){var me,Te={},Ee=null;if(X!=null)for(me in X.key!==void 0&&(Ee=""+X.key),X)I.call(X,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(Te[me]=X[me]);var Ae=arguments.length-2;if(Ae===1)Te.children=oe;else if(1<Ae){for(var nt=Array(Ae),Xe=0;Xe<Ae;Xe++)nt[Xe]=arguments[Xe+2];Te.children=nt}if(E&&E.defaultProps)for(me in Ae=E.defaultProps,Ae)Te[me]===void 0&&(Te[me]=Ae[me]);return Y(E,Ee,Te)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(E){return{$$typeof:m,render:E}},Qe.isValidElement=W,Qe.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:L}},Qe.memo=function(E,X){return{$$typeof:x,type:E,compare:X===void 0?null:X}},Qe.startTransition=function(E){var X=z.T,oe={};z.T=oe;try{var me=E(),Te=z.S;Te!==null&&Te(oe,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(H,xe)}catch(Ee){xe(Ee)}finally{X!==null&&oe.types!==null&&(X.types=oe.types),z.T=X}},Qe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Qe.use=function(E){return z.H.use(E)},Qe.useActionState=function(E,X,oe){return z.H.useActionState(E,X,oe)},Qe.useCallback=function(E,X){return z.H.useCallback(E,X)},Qe.useContext=function(E){return z.H.useContext(E)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(E,X){return z.H.useDeferredValue(E,X)},Qe.useEffect=function(E,X){return z.H.useEffect(E,X)},Qe.useEffectEvent=function(E){return z.H.useEffectEvent(E)},Qe.useId=function(){return z.H.useId()},Qe.useImperativeHandle=function(E,X,oe){return z.H.useImperativeHandle(E,X,oe)},Qe.useInsertionEffect=function(E,X){return z.H.useInsertionEffect(E,X)},Qe.useLayoutEffect=function(E,X){return z.H.useLayoutEffect(E,X)},Qe.useMemo=function(E,X){return z.H.useMemo(E,X)},Qe.useOptimistic=function(E,X){return z.H.useOptimistic(E,X)},Qe.useReducer=function(E,X,oe){return z.H.useReducer(E,X,oe)},Qe.useRef=function(E){return z.H.useRef(E)},Qe.useState=function(E){return z.H.useState(E)},Qe.useSyncExternalStore=function(E,X,oe){return z.H.useSyncExternalStore(E,X,oe)},Qe.useTransition=function(){return z.H.useTransition()},Qe.version="19.2.8",Qe}var kx;function gp(){return kx||(kx=1,Ah.exports=y0()),Ah.exports}var _=gp(),Mh={exports:{}},Mo={},Rh={exports:{}},Dh={};/**
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 Nx;function v0(){return Nx||(Nx=1,(function(l){function s(M,fe){var L=M.length;M.push(fe);e:for(;0<L;){var xe=L-1>>>1,je=M[xe];if(0<o(je,fe))M[xe]=fe,M[L]=je,L=xe;else break e}}function r(M){return M.length===0?null:M[0]}function c(M){if(M.length===0)return null;var fe=M[0],L=M.pop();if(L!==fe){M[0]=L;e:for(var xe=0,je=M.length,E=je>>>1;xe<E;){var X=2*(xe+1)-1,oe=M[X],me=X+1,Te=M[me];if(0>o(oe,L))me<je&&0>o(Te,oe)?(M[xe]=Te,M[me]=L,xe=me):(M[xe]=oe,M[X]=L,xe=X);else if(me<je&&0>o(Te,L))M[xe]=Te,M[me]=L,xe=me;else break e}}return fe}function o(M,fe){var L=M.sortIndex-fe.sortIndex;return L!==0?L:M.id-fe.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],x=[],y=1,j=null,v=3,C=!1,N=!1,T=!1,A=!1,G=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function D(M){for(var fe=r(x);fe!==null;){if(fe.callback===null)c(x);else if(fe.startTime<=M)c(x),fe.sortIndex=fe.expirationTime,s(g,fe);else break;fe=r(x)}}function J(M){if(T=!1,D(M),!N)if(r(g)!==null)N=!0,H||(H=!0,ce());else{var fe=r(x);fe!==null&&we(J,fe.startTime-M)}}var H=!1,z=-1,I=5,Y=-1;function ae(){return A?!0:!(l.unstable_now()-Y<I)}function W(){if(A=!1,H){var M=l.unstable_now();Y=M;var fe=!0;try{e:{N=!1,T&&(T=!1,F(z),z=-1),C=!0;var L=v;try{t:{for(D(M),j=r(g);j!==null&&!(j.expirationTime>M&&ae());){var xe=j.callback;if(typeof xe=="function"){j.callback=null,v=j.priorityLevel;var je=xe(j.expirationTime<=M);if(M=l.unstable_now(),typeof je=="function"){j.callback=je,D(M),fe=!0;break t}j===r(g)&&c(g),D(M)}else c(g);j=r(g)}if(j!==null)fe=!0;else{var E=r(x);E!==null&&we(J,E.startTime-M),fe=!1}}break e}finally{j=null,v=L,C=!1}fe=void 0}}finally{fe?ce():H=!1}}}var ce;if(typeof B=="function")ce=function(){B(W)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,Oe=ye.port2;ye.port1.onmessage=W,ce=function(){Oe.postMessage(null)}}else ce=function(){G(W,0)};function we(M,fe){z=G(function(){M(l.unstable_now())},fe)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(M){M.callback=null},l.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<M?Math.floor(1e3/M):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(M){switch(v){case 1:case 2:case 3:var fe=3;break;default:fe=v}var L=v;v=fe;try{return M()}finally{v=L}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(M,fe){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var L=v;v=M;try{return fe()}finally{v=L}},l.unstable_scheduleCallback=function(M,fe,L){var xe=l.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?xe+L:xe):L=xe,M){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=L+je,M={id:y++,callback:fe,priorityLevel:M,startTime:L,expirationTime:je,sortIndex:-1},L>xe?(M.sortIndex=L,s(x,M),r(g)===null&&M===r(x)&&(T?(F(z),z=-1):T=!0,we(J,L-xe))):(M.sortIndex=je,s(g,M),N||C||(N=!0,H||(H=!0,ce()))),M},l.unstable_shouldYield=ae,l.unstable_wrapCallback=function(M){var fe=v;return function(){var L=v;v=fe;try{return M.apply(this,arguments)}finally{v=L}}}})(Dh)),Dh}var Tx;function j0(){return Tx||(Tx=1,Rh.exports=v0()),Rh.exports}var Oh={exports:{}},pl={};/**
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 Ex;function S0(){if(Ex)return pl;Ex=1;var l=gp();function s(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)x+="&args[]="+encodeURIComponent(arguments[y])}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(s(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 d(g,x,y){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:y}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return pl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,pl.createPortal=function(g,x){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(s(299));return d(g,x,null,y)},pl.flushSync=function(g){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=y,c.d.f()}},pl.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))},pl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},pl.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,C=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},pl.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=m(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:y,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)},pl.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin);c.d.L(g,y,{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})}},pl.preloadModule=function(g,x){if(typeof g=="string")if(x){var y=m(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},pl.requestFormReset=function(g){c.d.r(g)},pl.unstable_batchedUpdates=function(g,x){return g(x)},pl.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},pl.useFormStatus=function(){return h.H.useHostTransitionStatus()},pl.version="19.2.8",pl}var Cx;function w0(){if(Cx)return Oh.exports;Cx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Oh.exports=S0(),Oh.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 Ax;function k0(){if(Ax)return Mo;Ax=1;var l=j0(),s=gp(),r=w0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===a)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var b=!1,S=u.child;S;){if(S===n){b=!0,n=u,a=f;break}if(S===a){b=!0,a=u,n=f;break}S=S.sibling}if(!b){for(S=f.child;S;){if(S===n){b=!0,n=f,a=u;break}if(S===a){b=!0,a=f,n=u;break}S=S.sibling}if(!b)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),B=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function Oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case G:return"Profiler";case A:return"StrictMode";case J:return"Suspense";case H:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case B:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:Oe(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return Oe(e(t))}catch{}}return null}var we=Array.isArray,M=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},xe=[],je=-1;function E(e){return{current:e}}function X(e){0>je||(e.current=xe[je],xe[je]=null,je--)}function oe(e,t){je++,xe[je]=e.current,e.current=t}var me=E(null),Te=E(null),Ee=E(null),Ae=E(null);function nt(e,t){switch(oe(Ee,t),oe(Te,e),oe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$g(t),e=Xg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(me),oe(me,e)}function Xe(){X(me),X(Te),X(Ee)}function dt(e){e.memoizedState!==null&&oe(Ae,e);var t=me.current,n=Xg(t,e.type);t!==n&&(oe(Te,e),oe(me,n))}function Ge(e){Te.current===e&&(X(me),X(Te)),Ae.current===e&&(X(Ae),No._currentValue=L)}var Ot,lt;function Xt(e){if(Ot===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ot=t&&t[1]||"",lt=-1<n.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Ot+e+lt}var Pe=!1;function Vt(e,t){if(!e||Pe)return"";Pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ne){var ee=ne}Reflect.construct(e,[],ue)}else{try{ue.call()}catch(ne){ee=ne}e.call(ue.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(ue=e())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),b=f[0],S=f[1];if(b&&S){var R=b.split(`
45
+ `),Z=S.split(`
46
+ `);for(u=a=0;a<R.length&&!R[a].includes("DetermineComponentFrameRoot");)a++;for(;u<Z.length&&!Z[u].includes("DetermineComponentFrameRoot");)u++;if(a===R.length||u===Z.length)for(a=R.length-1,u=Z.length-1;1<=a&&0<=u&&R[a]!==Z[u];)u--;for(;1<=a&&0<=u;a--,u--)if(R[a]!==Z[u]){if(a!==1||u!==1)do if(a--,u--,0>u||R[a]!==Z[u]){var se=`
47
+ `+R[a].replace(" at new "," at ");return e.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",e.displayName)),se}while(1<=a&&0<=u);break}}}finally{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Xt(n):""}function xl(e,t){switch(e.tag){case 26:case 27:case 5:return Xt(e.type);case 16:return Xt("Lazy");case 13:return e.child!==t&&t!==null?Xt("Suspense Fallback"):Xt("Suspense");case 19:return Xt("SuspenseList");case 0:case 15:return Vt(e.type,!1);case 11:return Vt(e.type.render,!1);case 1:return Vt(e.type,!0);case 31:return Xt("Activity");default:return""}}function ht(e){try{var t="",n=null;do t+=xl(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
48
+ Error generating stack: `+a.message+`
49
+ `+a.stack}}var Kt=Object.prototype.hasOwnProperty,en=l.unstable_scheduleCallback,_n=l.unstable_cancelCallback,hn=l.unstable_shouldYield,an=l.unstable_requestPaint,rt=l.unstable_now,pt=l.unstable_getCurrentPriorityLevel,Tn=l.unstable_ImmediatePriority,En=l.unstable_UserBlockingPriority,Je=l.unstable_NormalPriority,ct=l.unstable_LowPriority,pn=l.unstable_IdlePriority,yn=l.log,Pn=l.unstable_setDisableYieldValue,rn=null,kt=null;function Zt(e){if(typeof yn=="function"&&Pn(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(rn,e)}catch{}}var vt=Math.clz32?Math.clz32:ge,el=Math.log,le=Math.LN2;function ge(e){return e>>>=0,e===0?32:31-(el(e)/le|0)|0}var Ue=256,U=262144,P=4194304;function be(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 De(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=a&134217727;return S!==0?(a=S&~f,a!==0?u=be(a):(b&=S,b!==0?u=be(b):n||(n=S&~e,n!==0&&(u=be(n))))):(S=a&~f,S!==0?u=be(S):b!==0?u=be(b):n||(n=a&~e,n!==0&&(u=be(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function qt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Cn(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 tn(){var e=P;return P<<=1,(P&62914560)===0&&(P=4194304),e}function $n(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Gl(e,t,n,a,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,Z=e.hiddenUpdates;for(n=b&~n;0<n;){var se=31-vt(n),ue=1<<se;S[se]=0,R[se]=-1;var ee=Z[se];if(ee!==null)for(Z[se]=null,se=0;se<ee.length;se++){var ne=ee[se];ne!==null&&(ne.lane&=-536870913)}n&=~ue}a!==0&&Yl(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function Yl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-vt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function $l(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-vt(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function ms(e,t){var n=t&-t;return n=(n&42)!==0?1:Os(n),(n&(e.suspendedLanes|t))!==0?0:n}function Os(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 cn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function sa(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:px(e.type))}function cl(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var tl=Math.random().toString(36).slice(2),Lt="__reactFiber$"+tl,Ve="__reactProps$"+tl,mn="__reactContainer$"+tl,on="__reactEvents$"+tl,El="__reactListeners$"+tl,et="__reactHandles$"+tl,ss="__reactResources$"+tl,Nt="__reactMarker$"+tl;function Cl(e){delete e[Lt],delete e[Ve],delete e[on],delete e[El],delete e[et]}function xt(e){var t=e[Lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mn]||n[Lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wg(e);e!==null;){if(n=e[Lt])return n;e=Wg(e)}return t}e=n,n=e.parentNode}return null}function Al(e){if(e=e[Lt]||e[mn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function un(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function At(e){var t=e[ss];return t||(t=e[ss]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[Nt]=!0}var Tt=new Set,Ml={};function vn(e,t){Bn(e,t),Bn(e+"Capture",t)}function Bn(e,t){for(Ml[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var nl=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]*$"),Vn={},Xl={};function An(e){return Kt.call(Xl,e)?!0:Kt.call(Vn,e)?!1:nl.test(e)?Xl[e]=!0:(Vn[e]=!0,!1)}function ol(e,t,n){if(An(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Qn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function jn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Da(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ci(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ls(e){if(!e._valueTracker){var t=Da(e)?"checked":"value";e._valueTracker=Ci(e,t,""+e[t])}}function aa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Da(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function gs(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 Vl=/[\n"\\]/g;function Kn(e){return e.replace(Vl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xs(e,t,n,a,u,f,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?bl(e,b,zt(t)):n!=null?bl(e,b,zt(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+zt(S):e.removeAttribute("name")}function bs(e,t,n,a,u,f,b,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Ls(e);return}n=n!=null?""+zt(n):"",t=t!=null?""+zt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=S?e.checked:!!a,e.defaultChecked=!!a,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Ls(e)}function bl(e,t,n){t==="number"&&gs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Qt(e,t,n,a){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&a&&(e[n].defaultSelected=!0)}else{for(n=""+zt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function pe(e,t,n){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+zt(n):""}function k(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(we(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=zt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Ls(e)}function V(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var de=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 ve(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||de.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Le(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&ve(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&ve(e,f,t[f])}function ke(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 jt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Mt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Sn(e){return Mt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ot(){}var nn=null;function Gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rl=null,ll=null;function Ai(e){var t=Al(e);if(t&&(e=t.stateNode)){var n=e[Ve]||null;e:switch(e=t.stateNode,t.type){case"input":if(xs(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Kn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[Ve]||null;if(!u)throw Error(c(90));xs(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&aa(a)}break e;case"textarea":pe(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Qt(e,!!n.multiple,t,!1)}}}var w=!1;function ie(e,t,n){if(w)return e(t,n);w=!0;try{var a=e(t);return a}finally{if(w=!1,(Rl!==null||ll!==null)&&(qu(),Rl&&(t=Rl,e=ll,ll=Rl=null,Ai(t),e)))for(t=0;t<e.length;t++)Ai(e[t])}}function Me(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Ve]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var $e=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ul=!1;if($e)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){ul=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{ul=!1}var Dl=null,Dc=null,Oa=null;function Mi(){if(Oa)return Oa;var e,t=Dc,n=t.length,a,u="value"in Dl?Dl.value:Dl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var b=n-e;for(a=1;a<=b&&t[n-a]===u[f-a];a++);return Oa=u.slice(e,1<a?1-a:void 0)}function La(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 Ri(){return!0}function Di(){return!1}function wn(e){function t(n,a,u,f,b){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ri:Di,this.isPropagationStopped=Di,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ri)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ri)},persist:function(){},isPersistent:Ri}),t}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ia=wn(_s),ys=j({},_s,{view:0,detail:0}),Qf=wn(ys),za,Oc,zs,ra=j({},ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:js,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!==zs&&(zs&&e.type==="mousemove"?(za=e.screenX-zs.screenX,Oc=e.screenY-zs.screenY):Oc=za=0,zs=e),za)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),jr=wn(ra),Oi=j({},ra,{dataTransfer:0}),ca=wn(Oi),Sr=j({},ys,{relatedTarget:0}),Li=wn(Sr),Kf=j({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),oa=wn(Kf),wr=j({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zo=wn(wr),kr=j({},_s,{data:0}),Lc=wn(kr),Nr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vs={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"},Tr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zi(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tr[e])?!!t[e]:!1}function js(){return zi}var Ui=j({},ys,{key:function(e){if(e.key){var t=Nr[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=La(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:js,charCode:function(e){return e.type==="keypress"?La(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?La(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ln=wn(Ui),zc=j({},ra,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fo=wn(zc),Zf=j({},ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:js}),Uc=wn(Zf),Er=j({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),In=wn(Er),Hi=j({},ra,{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}),Bi=wn(Hi),Jo=j({},_s,{newState:0,oldState:0}),Mn=wn(Jo),Wo=[9,13,27,32],Cr=$e&&"CompositionEvent"in window,_l=null;$e&&"documentMode"in document&&(_l=document.documentMode);var Po=$e&&"TextEvent"in window&&!_l,Ii=$e&&(!Cr||_l&&8<_l&&11>=_l),qi=" ",Ua=!1;function Us(e,t){switch(e){case"keyup":return Wo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var as=!1;function Ar(e,t){switch(e){case"compositionend":return Hc(t);case"keypress":return t.which!==32?null:(Ua=!0,qi);case"textInput":return e=t.data,e===qi&&Ua?null:e;default:return null}}function Gi(e,t){if(as)return e==="compositionend"||!Cr&&Us(e,t)?(e=Mi(),Oa=Dc=Dl=null,as=!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 Ii&&t.locale!=="ko"?null:t.data;default:return null}}var Yi={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 Bc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yi[e.type]:t==="textarea"}function Ha(e,t,n,a){Rl?ll?ll.push(a):ll=[a]:Rl=a,t=Ku(t,"onChange"),0<t.length&&(n=new ia("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var $i=null,te=null;function Ba(e){Hg(e,0)}function Ia(e){var t=un(e);if(aa(t))return e}function eu(e,t){if(e==="change")return t}var tu=!1;if($e){var Q;if($e){var ua="oninput"in document;if(!ua){var qa=document.createElement("div");qa.setAttribute("oninput","return;"),ua=typeof qa.oninput=="function"}Q=ua}else Q=!1;tu=Q&&(!document.documentMode||9<document.documentMode)}function Ic(){$i&&($i.detachEvent("onpropertychange",qc),te=$i=null)}function qc(e){if(e.propertyName==="value"&&Ia(te)){var t=[];Ha(t,te,e,Gt(e)),ie(Ba,t)}}function Ff(e,t,n){e==="focusin"?(Ic(),$i=t,te=n,$i.attachEvent("onpropertychange",qc)):e==="focusout"&&Ic()}function Ga(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ia(te)}function Jf(e,t){if(e==="click")return Ia(t)}function Wf(e,t){if(e==="input"||e==="change")return Ia(t)}function Pf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yl=typeof Object.is=="function"?Object.is:Pf;function Xi(e,t){if(yl(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!Kt.call(t,u)||!yl(e[u],t[u]))return!1}return!0}function fa(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nu(e,t){var n=fa(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fa(n)}}function lu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function su(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gs(e.document)}return t}function Gc(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 ed=$e&&"documentMode"in document&&11>=document.documentMode,Ya=null,Yc=null,Vi=null,$c=!1;function Mr(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$c||Ya==null||Ya!==gs(a)||(a=Ya,"selectionStart"in a&&Gc(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}),Vi&&Xi(Vi,a)||(Vi=a,a=Ku(Yc,"onSelect"),0<a.length&&(t=new ia("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ya)))}function da(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $a={animationend:da("Animation","AnimationEnd"),animationiteration:da("Animation","AnimationIteration"),animationstart:da("Animation","AnimationStart"),transitionrun:da("Transition","TransitionRun"),transitionstart:da("Transition","TransitionStart"),transitioncancel:da("Transition","TransitionCancel"),transitionend:da("Transition","TransitionEnd")},Qi={},au={};$e&&(au=document.createElement("div").style,"AnimationEvent"in window||(delete $a.animationend.animation,delete $a.animationiteration.animation,delete $a.animationstart.animation),"TransitionEvent"in window||delete $a.transitionend.transition);function ha(e){if(Qi[e])return Qi[e];if(!$a[e])return e;var t=$a[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in au)return Qi[e]=t[n];return e}var Ki=ha("animationend"),iu=ha("animationiteration"),Xc=ha("animationstart"),ru=ha("transitionrun"),cu=ha("transitionstart"),ou=ha("transitioncancel"),uu=ha("transitionend"),Vc=new Map,Rr="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(" ");Rr.push("scrollEnd");function Kl(e,t){Vc.set(e,t),vn(t,[e])}var Zi=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)},fl=[],Xa=0,Qc=0;function Dr(){for(var e=Xa,t=Qc=Xa=0;t<e;){var n=fl[t];fl[t++]=null;var a=fl[t];fl[t++]=null;var u=fl[t];fl[t++]=null;var f=fl[t];if(fl[t++]=null,a!==null&&u!==null){var b=a.pending;b===null?u.next=u:(u.next=b.next,b.next=u),a.pending=u}f!==0&&fu(n,u,f)}}function Or(e,t,n,a){fl[Xa++]=e,fl[Xa++]=t,fl[Xa++]=n,fl[Xa++]=a,Qc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function pa(e,t,n,a){return Or(e,t,n,a),Fi(e)}function Hs(e,t){return Or(e,null,null,t),Fi(e)}function fu(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,a=f.alternate,a!==null&&(a.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-vt(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function Fi(e){if(50<_o)throw _o=0,Wd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Va={};function td(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vl(e,t,n,a){return new td(e,t,n,a)}function Kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ss(e,t){var n=e.alternate;return n===null?(n=vl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function du(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Lr(e,t,n,a,u,f){var b=0;if(a=e,typeof e=="function")Kc(e)&&(b=1);else if(typeof e=="string")b=s0(e,n,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=vl(31,n,t,u),e.elementType=Y,e.lanes=f,e;case T:return ma(n.children,u,f,t);case A:b=8,u|=24;break;case G:return e=vl(12,n,t,u|2),e.elementType=G,e.lanes=f,e;case J:return e=vl(13,n,t,u),e.elementType=J,e.lanes=f,e;case H:return e=vl(19,n,t,u),e.elementType=H,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B:b=10;break e;case F:b=9;break e;case D:b=11;break e;case z:b=14;break e;case I:b=16,a=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=vl(b,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function ma(e,t,n,a){return e=vl(7,e,a,t),e.lanes=n,e}function Zc(e,t,n){return e=vl(6,e,null,t),e.lanes=n,e}function hu(e){var t=vl(18,null,null,0);return t.stateNode=e,t}function Fc(e,t,n){return t=vl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pu=new WeakMap;function jl(e,t){if(typeof e=="object"&&e!==null){var n=pu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ht(t)},pu.set(e,t),t)}return{value:e,source:t,stack:ht(t)}}var Qa=[],Ka=0,zr=null,Ji=0,dl=[],hl=0,Zl=null,is=1,rs="";function ws(e,t){Qa[Ka++]=Ji,Qa[Ka++]=zr,zr=e,Ji=t}function mu(e,t,n){dl[hl++]=is,dl[hl++]=rs,dl[hl++]=Zl,Zl=e;var a=is;e=rs;var u=32-vt(a)-1;a&=~(1<<u),n+=1;var f=32-vt(t)+u;if(30<f){var b=u-u%5;f=(a&(1<<b)-1).toString(32),a>>=b,u-=b,is=1<<32-vt(t)+u|n<<u|a,rs=f+e}else is=1<<f|n<<u|a,rs=e}function Jc(e){e.return!==null&&(ws(e,1),mu(e,1,0))}function Wc(e){for(;e===zr;)zr=Qa[--Ka],Qa[Ka]=null,Ji=Qa[--Ka],Qa[Ka]=null;for(;e===Zl;)Zl=dl[--hl],dl[hl]=null,rs=dl[--hl],dl[hl]=null,is=dl[--hl],dl[hl]=null}function gu(e,t){dl[hl++]=is,dl[hl++]=rs,dl[hl++]=Zl,is=t.id,rs=t.overflow,Zl=e}var qn=null,Yt=null,st=!1,Bs=null,Ol=!1,Pc=Error(c(519));function Is(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gs(jl(t,e)),Pc}function xu(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Lt]=e,t[Ve]=a,n){case"dialog":it("cancel",t),it("close",t);break;case"iframe":case"object":case"embed":it("load",t);break;case"video":case"audio":for(n=0;n<vo.length;n++)it(vo[n],t);break;case"source":it("error",t);break;case"img":case"image":case"link":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"input":it("invalid",t),bs(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":it("invalid",t);break;case"textarea":it("invalid",t),k(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Gg(t.textContent,n)?(a.popover!=null&&(it("beforetoggle",t),it("toggle",t)),a.onScroll!=null&&it("scroll",t),a.onScrollEnd!=null&&it("scrollend",t),a.onClick!=null&&(t.onclick=ot),t=!0):t=!1,t||Is(e,!0)}function bu(e){for(qn=e.return;qn;)switch(qn.tag){case 5:case 31:case 13:Ol=!1;return;case 27:case 3:Ol=!0;return;default:qn=qn.return}}function Za(e){if(e!==qn)return!1;if(!st)return bu(e),st=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||hh(e.type,e.memoizedProps)),n=!n),n&&Yt&&Is(e),bu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Yt=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Yt=Jg(e)}else t===27?(t=Yt,di(e.type)?(e=bh,bh=null,Yt=e):Yt=t):Yt=qn?us(e.stateNode.nextSibling):null;return!0}function qs(){Yt=qn=null,st=!1}function Ur(){var e=Bs;return e!==null&&(Bl===null?Bl=e:Bl.push.apply(Bl,e),Bs=null),e}function Gs(e){Bs===null?Bs=[e]:Bs.push(e)}var Sl=E(null),Gn=null,fn=null;function ks(e,t,n){oe(Sl,t._currentValue),t._currentValue=n}function Fl(e){e._currentValue=Sl.current,X(Sl)}function Hr(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Fa(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var R=0;R<t.length;R++)if(S.context===t[R]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),Hr(f.return,n,e),a||(b=null);break e}f=S.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(c(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),Hr(b,n,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function ga(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(c(387));if(b=b.memoizedProps,b!==null){var S=u.type;yl(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(u===Ae.current){if(b=u.alternate,b===null)throw Error(c(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(No):e=[No])}u=u.return}e!==null&&Fa(t,e,n,a),t.flags|=262144}function Br(e){for(e=e.firstContext;e!==null;){if(!yl(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jl(e){Gn=e,fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rn(e){return qr(Gn,e)}function Ir(e,t){return Gn===null&&Jl(e),qr(e,t)}function qr(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fn===null){if(e===null)throw Error(c(308));fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fn=fn.next=t;return n}var nd=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Wi=l.unstable_scheduleCallback,Ja=l.unstable_NormalPriority,gn={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gr(){return{controller:new nd,data:new Map,refCount:0}}function Wa(e){e.refCount--,e.refCount===0&&Wi(Ja,function(){e.controller.abort()})}var Pi=null,eo=0,xa=0,ba=null;function ld(e,t){if(Pi===null){var n=Pi=[];eo=0,xa=sh(),ba={status:"pending",value:void 0,then:function(a){n.push(a)}}}return eo++,t.then(_u,_u),t}function _u(){if(--eo===0&&Pi!==null){ba!==null&&(ba.status="fulfilled");var e=Pi;Pi=null,xa=0,ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sd(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),a}var Yr=M.S;M.S=function(e,t){dg=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ld(e,t),Yr!==null&&Yr(e,t)};var Ys=E(null);function to(){var e=Ys.current;return e!==null?e:$t.pooledCache}function Ns(e,t){t===null?oe(Ys,Ys.current):oe(Ys,t.pool)}function $r(){var e=to();return e===null?null:{parent:gn._currentValue,pool:e}}var Pa=Error(c(460)),Xr=Error(c(474)),er=Error(c(542)),p={then:function(){}};function q(e){return e=e.status,e==="fulfilled"||e==="rejected"}function he(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ot,ot),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ll(e),e;default:if(typeof t.status=="string")t.then(ot,ot);else{if(e=$t,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ll(e),e}throw bt=t,Pa}}function He(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(bt=n,Pa):n}}var bt=null;function Dn(){if(bt===null)throw Error(c(459));var e=bt;return bt=null,e}function Ll(e){if(e===Pa||e===er)throw Error(c(483))}var cs=null,ei=0;function tr(e){var t=ei;return ei+=1,cs===null&&(cs=[]),he(cs,e,t)}function _e(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ce(e,t){throw t.$$typeof===v?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ye(e){function t($,O){if(e){var K=$.deletions;K===null?($.deletions=[O],$.flags|=16):K.push(O)}}function n($,O){if(!e)return null;for(;O!==null;)t($,O),O=O.sibling;return null}function a($){for(var O=new Map;$!==null;)$.key!==null?O.set($.key,$):O.set($.index,$),$=$.sibling;return O}function u($,O){return $=Ss($,O),$.index=0,$.sibling=null,$}function f($,O,K){return $.index=K,e?(K=$.alternate,K!==null?(K=K.index,K<O?($.flags|=67108866,O):K):($.flags|=67108866,O)):($.flags|=1048576,O)}function b($){return e&&$.alternate===null&&($.flags|=67108866),$}function S($,O,K,re){return O===null||O.tag!==6?(O=Zc(K,$.mode,re),O.return=$,O):(O=u(O,K),O.return=$,O)}function R($,O,K,re){var Be=K.type;return Be===T?se($,O,K.props.children,re,K.key):O!==null&&(O.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===I&&He(Be)===O.type)?(O=u(O,K.props),_e(O,K),O.return=$,O):(O=Lr(K.type,K.key,K.props,null,$.mode,re),_e(O,K),O.return=$,O)}function Z($,O,K,re){return O===null||O.tag!==4||O.stateNode.containerInfo!==K.containerInfo||O.stateNode.implementation!==K.implementation?(O=Fc(K,$.mode,re),O.return=$,O):(O=u(O,K.children||[]),O.return=$,O)}function se($,O,K,re,Be){return O===null||O.tag!==7?(O=ma(K,$.mode,re,Be),O.return=$,O):(O=u(O,K),O.return=$,O)}function ue($,O,K){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=Zc(""+O,$.mode,K),O.return=$,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case C:return K=Lr(O.type,O.key,O.props,null,$.mode,K),_e(K,O),K.return=$,K;case N:return O=Fc(O,$.mode,K),O.return=$,O;case I:return O=He(O),ue($,O,K)}if(we(O)||ce(O))return O=ma(O,$.mode,K,null),O.return=$,O;if(typeof O.then=="function")return ue($,tr(O),K);if(O.$$typeof===B)return ue($,Ir($,O),K);Ce($,O)}return null}function ee($,O,K,re){var Be=O!==null?O.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Be!==null?null:S($,O,""+K,re);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case C:return K.key===Be?R($,O,K,re):null;case N:return K.key===Be?Z($,O,K,re):null;case I:return K=He(K),ee($,O,K,re)}if(we(K)||ce(K))return Be!==null?null:se($,O,K,re,null);if(typeof K.then=="function")return ee($,O,tr(K),re);if(K.$$typeof===B)return ee($,O,Ir($,K),re);Ce($,K)}return null}function ne($,O,K,re,Be){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return $=$.get(K)||null,S(O,$,""+re,Be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case C:return $=$.get(re.key===null?K:re.key)||null,R(O,$,re,Be);case N:return $=$.get(re.key===null?K:re.key)||null,Z(O,$,re,Be);case I:return re=He(re),ne($,O,K,re,Be)}if(we(re)||ce(re))return $=$.get(K)||null,se(O,$,re,Be,null);if(typeof re.then=="function")return ne($,O,K,tr(re),Be);if(re.$$typeof===B)return ne($,O,K,Ir(O,re),Be);Ce(O,re)}return null}function Re($,O,K,re){for(var Be=null,_t=null,ze=O,Fe=O=0,ft=null;ze!==null&&Fe<K.length;Fe++){ze.index>Fe?(ft=ze,ze=null):ft=ze.sibling;var yt=ee($,ze,K[Fe],re);if(yt===null){ze===null&&(ze=ft);break}e&&ze&&yt.alternate===null&&t($,ze),O=f(yt,O,Fe),_t===null?Be=yt:_t.sibling=yt,_t=yt,ze=ft}if(Fe===K.length)return n($,ze),st&&ws($,Fe),Be;if(ze===null){for(;Fe<K.length;Fe++)ze=ue($,K[Fe],re),ze!==null&&(O=f(ze,O,Fe),_t===null?Be=ze:_t.sibling=ze,_t=ze);return st&&ws($,Fe),Be}for(ze=a(ze);Fe<K.length;Fe++)ft=ne(ze,$,Fe,K[Fe],re),ft!==null&&(e&&ft.alternate!==null&&ze.delete(ft.key===null?Fe:ft.key),O=f(ft,O,Fe),_t===null?Be=ft:_t.sibling=ft,_t=ft);return e&&ze.forEach(function(xi){return t($,xi)}),st&&ws($,Fe),Be}function Ie($,O,K,re){if(K==null)throw Error(c(151));for(var Be=null,_t=null,ze=O,Fe=O=0,ft=null,yt=K.next();ze!==null&&!yt.done;Fe++,yt=K.next()){ze.index>Fe?(ft=ze,ze=null):ft=ze.sibling;var xi=ee($,ze,yt.value,re);if(xi===null){ze===null&&(ze=ft);break}e&&ze&&xi.alternate===null&&t($,ze),O=f(xi,O,Fe),_t===null?Be=xi:_t.sibling=xi,_t=xi,ze=ft}if(yt.done)return n($,ze),st&&ws($,Fe),Be;if(ze===null){for(;!yt.done;Fe++,yt=K.next())yt=ue($,yt.value,re),yt!==null&&(O=f(yt,O,Fe),_t===null?Be=yt:_t.sibling=yt,_t=yt);return st&&ws($,Fe),Be}for(ze=a(ze);!yt.done;Fe++,yt=K.next())yt=ne(ze,$,Fe,yt.value,re),yt!==null&&(e&&yt.alternate!==null&&ze.delete(yt.key===null?Fe:yt.key),O=f(yt,O,Fe),_t===null?Be=yt:_t.sibling=yt,_t=yt);return e&&ze.forEach(function(m0){return t($,m0)}),st&&ws($,Fe),Be}function Bt($,O,K,re){if(typeof K=="object"&&K!==null&&K.type===T&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case C:e:{for(var Be=K.key;O!==null;){if(O.key===Be){if(Be=K.type,Be===T){if(O.tag===7){n($,O.sibling),re=u(O,K.props.children),re.return=$,$=re;break e}}else if(O.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===I&&He(Be)===O.type){n($,O.sibling),re=u(O,K.props),_e(re,K),re.return=$,$=re;break e}n($,O);break}else t($,O);O=O.sibling}K.type===T?(re=ma(K.props.children,$.mode,re,K.key),re.return=$,$=re):(re=Lr(K.type,K.key,K.props,null,$.mode,re),_e(re,K),re.return=$,$=re)}return b($);case N:e:{for(Be=K.key;O!==null;){if(O.key===Be)if(O.tag===4&&O.stateNode.containerInfo===K.containerInfo&&O.stateNode.implementation===K.implementation){n($,O.sibling),re=u(O,K.children||[]),re.return=$,$=re;break e}else{n($,O);break}else t($,O);O=O.sibling}re=Fc(K,$.mode,re),re.return=$,$=re}return b($);case I:return K=He(K),Bt($,O,K,re)}if(we(K))return Re($,O,K,re);if(ce(K)){if(Be=ce(K),typeof Be!="function")throw Error(c(150));return K=Be.call(K),Ie($,O,K,re)}if(typeof K.then=="function")return Bt($,O,tr(K),re);if(K.$$typeof===B)return Bt($,O,Ir($,K),re);Ce($,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,O!==null&&O.tag===6?(n($,O.sibling),re=u(O,K),re.return=$,$=re):(n($,O),re=Zc(K,$.mode,re),re.return=$,$=re),b($)):n($,O)}return function($,O,K,re){try{ei=0;var Be=Bt($,O,K,re);return cs=null,Be}catch(ze){if(ze===Pa||ze===er)throw ze;var _t=vl(29,ze,null,$.mode);return _t.lanes=re,_t.return=$,_t}finally{}}}var tt=Ye(!0),Et=Ye(!1),Zn=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ad(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 ti(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ni(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(St&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Fi(e),fu(e,null,n),t}return Or(e,a,t,n),Fi(e)}function lo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,$l(e,n)}}function id(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var rd=!1;function so(){if(rd){var e=ba;if(e!==null)throw e}}function ao(e,t,n,a){rd=!1;var u=e.updateQueue;Zn=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,Z=R.next;R.next=null,b===null?f=Z:b.next=Z,b=R;var se=e.alternate;se!==null&&(se=se.updateQueue,S=se.lastBaseUpdate,S!==b&&(S===null?se.firstBaseUpdate=Z:S.next=Z,se.lastBaseUpdate=R))}if(f!==null){var ue=u.baseState;b=0,se=Z=R=null,S=f;do{var ee=S.lane&-536870913,ne=ee!==S.lane;if(ne?(ut&ee)===ee:(a&ee)===ee){ee!==0&&ee===xa&&(rd=!0),se!==null&&(se=se.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Re=e,Ie=S;ee=t;var Bt=n;switch(Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){ue=Re.call(Bt,ue,ee);break e}ue=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,ee=typeof Re=="function"?Re.call(Bt,ue,ee):Re,ee==null)break e;ue=j({},ue,ee);break e;case 2:Zn=!0}}ee=S.callback,ee!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=u.callbacks,ne===null?u.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:S.tag,payload:S.payload,callback:S.callback,next:null},se===null?(Z=se=ne,R=ue):se=se.next=ne,b|=ee;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;ne=S,S=ne.next,ne.next=null,u.lastBaseUpdate=ne,u.shared.pending=null}}while(!0);se===null&&(R=ue),u.baseState=R,u.firstBaseUpdate=Z,u.lastBaseUpdate=se,f===null&&(u.shared.lanes=0),ri|=b,e.lanes=b,e.memoizedState=ue}}function Up(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Hp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Up(n[e],t)}var Vr=E(null),yu=E(0);function Bp(e,t){e=Ta,oe(yu,e),oe(Vr,t),Ta=e|t.baseLanes}function cd(){oe(yu,Ta),oe(Vr,Vr.current)}function od(){Ta=yu.current,X(Vr),X(yu)}var Wl=E(null),os=null;function li(e){var t=e.alternate;oe(kn,kn.current&1),oe(Wl,e),os===null&&(t===null||Vr.current!==null||t.memoizedState!==null)&&(os=e)}function ud(e){oe(kn,kn.current),oe(Wl,e),os===null&&(os=e)}function Ip(e){e.tag===22?(oe(kn,kn.current),oe(Wl,e),os===null&&(os=e)):si()}function si(){oe(kn,kn.current),oe(Wl,Wl.current)}function Pl(e){X(Wl),os===e&&(os=null),X(kn)}var kn=E(0);function vu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gh(n)||xh(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _a=0,Ze=null,Ut=null,On=null,ju=!1,Qr=!1,nr=!1,Su=0,io=0,Kr=null,ay=0;function xn(){throw Error(c(321))}function fd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yl(e[n],t[n]))return!1;return!0}function dd(e,t,n,a,u,f){return _a=f,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Sm:Td,nr=!1,f=n(a,u),nr=!1,Qr&&(f=Gp(t,n,a,u)),qp(e),f}function qp(e){M.H=oo;var t=Ut!==null&&Ut.next!==null;if(_a=0,On=Ut=Ze=null,ju=!1,io=0,Kr=null,t)throw Error(c(300));e===null||Ln||(e=e.dependencies,e!==null&&Br(e)&&(Ln=!0))}function Gp(e,t,n,a){Ze=e;var u=0;do{if(Qr&&(Kr=null),io=0,Qr=!1,25<=u)throw Error(c(301));if(u+=1,On=Ut=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}M.H=wm,f=t(n,a)}while(Qr);return f}function iy(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?ro(t):t,e=e.useState()[0],(Ut!==null?Ut.memoizedState:null)!==e&&(Ze.flags|=1024),t}function hd(){var e=Su!==0;return Su=0,e}function pd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function md(e){if(ju){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ju=!1}_a=0,On=Ut=Ze=null,Qr=!1,io=Su=0,Kr=null}function wl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return On===null?Ze.memoizedState=On=e:On=On.next=e,On}function Nn(){if(Ut===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=On===null?Ze.memoizedState:On.next;if(t!==null)On=t,Ut=e;else{if(e===null)throw Ze.alternate===null?Error(c(467)):Error(c(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},On===null?Ze.memoizedState=On=e:On=On.next=e}return On}function wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ro(e){var t=io;return io+=1,Kr===null&&(Kr=[]),e=he(Kr,e,t),t=Ze,(On===null?t.memoizedState:On.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Sm:Td),e}function ku(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ro(e);if(e.$$typeof===B)return Rn(e)}throw Error(c(438,String(e)))}function gd(e){var t=null,n=Ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Ze.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=wu(),Ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=ae;return t.index++,n}function ya(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=Nn();return xd(t,Ut,e)}function xd(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,R=null,Z=t,se=!1;do{var ue=Z.lane&-536870913;if(ue!==Z.lane?(ut&ue)===ue:(_a&ue)===ue){var ee=Z.revertLane;if(ee===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),ue===xa&&(se=!0);else if((_a&ee)===ee){Z=Z.next,ee===xa&&(se=!0);continue}else ue={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},R===null?(S=R=ue,b=f):R=R.next=ue,Ze.lanes|=ee,ri|=ee;ue=Z.action,nr&&n(f,ue),f=Z.hasEagerState?Z.eagerState:n(f,ue)}else ee={lane:ue,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},R===null?(S=R=ee,b=f):R=R.next=ee,Ze.lanes|=ue,ri|=ue;Z=Z.next}while(Z!==null&&Z!==t);if(R===null?b=f:R.next=S,!yl(f,e.memoizedState)&&(Ln=!0,se&&(n=ba,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=R,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function bd(e){var t=Nn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var b=u=u.next;do f=e(f,b.action),b=b.next;while(b!==u);yl(f,t.memoizedState)||(Ln=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Yp(e,t,n){var a=Ze,u=Nn(),f=st;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!yl((Ut||u).memoizedState,n);if(b&&(u.memoizedState=n,Ln=!0),u=u.queue,vd(Vp.bind(null,a,u,e),[e]),u.getSnapshot!==t||b||On!==null&&On.memoizedState.tag&1){if(a.flags|=2048,Zr(9,{destroy:void 0},Xp.bind(null,a,u,n,t),null),$t===null)throw Error(c(349));f||(_a&127)!==0||$p(a,t,n)}return n}function $p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t=wu(),Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xp(e,t,n,a){t.value=n,t.getSnapshot=a,Qp(t)&&Kp(e)}function Vp(e,t,n){return n(function(){Qp(t)&&Kp(e)})}function Qp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yl(e,n)}catch{return!0}}function Kp(e){var t=Hs(e,2);t!==null&&Il(t,e,2)}function _d(e){var t=wl();if(typeof e=="function"){var n=e;if(e=n(),nr){Zt(!0);try{n()}finally{Zt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:e},t}function Zp(e,t,n,a){return e.baseState=n,xd(e,Ut,typeof a=="function"?a:ya)}function ry(e,t,n,a,u){if(Cu(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};M.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Fp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Fp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=M.T,b={};M.T=b;try{var S=n(u,a),R=M.S;R!==null&&R(b,S),Jp(e,t,S)}catch(Z){yd(e,t,Z)}finally{f!==null&&b.types!==null&&(f.types=b.types),M.T=f}}else try{f=n(u,a),Jp(e,t,f)}catch(Z){yd(e,t,Z)}}function Jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Wp(e,t,a)},function(a){return yd(e,t,a)}):Wp(e,t,n)}function Wp(e,t,n){t.status="fulfilled",t.value=n,Pp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Fp(e,n)))}function yd(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Pp(t),t=t.next;while(t!==a)}e.action=null}function Pp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function em(e,t){return t}function tm(e,t){if(st){var n=$t.formState;if(n!==null){e:{var a=Ze;if(st){if(Yt){t:{for(var u=Yt,f=Ol;u.nodeType!==8;){if(!f){u=null;break t}if(u=us(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Yt=us(u.nextSibling),a=u.data==="F!";break e}}Is(a)}a=!1}a&&(t=n[0])}}return n=wl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:t},n.queue=a,n=ym.bind(null,Ze,a),a.dispatch=n,a=_d(!1),f=Nd.bind(null,Ze,!1,a.queue),a=wl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=ry.bind(null,Ze,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function nm(e){var t=Nn();return lm(t,Ut,e)}function lm(e,t,n){if(t=xd(e,t,em)[0],e=Nu(ya)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=ro(t)}catch(b){throw b===Pa?er:b}else a=t;t=Nn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Ze.flags|=2048,Zr(9,{destroy:void 0},cy.bind(null,u,n),null)),[a,f,e]}function cy(e,t){e.action=t}function sm(e){var t=Nn(),n=Ut;if(n!==null)return lm(t,n,e);Nn(),t=t.memoizedState,n=Nn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Zr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=wu(),Ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function am(){return Nn().memoizedState}function Tu(e,t,n,a){var u=wl();Ze.flags|=e,u.memoizedState=Zr(1|t,{destroy:void 0},n,a===void 0?null:a)}function Eu(e,t,n,a){var u=Nn();a=a===void 0?null:a;var f=u.memoizedState.inst;Ut!==null&&a!==null&&fd(a,Ut.memoizedState.deps)?u.memoizedState=Zr(t,f,n,a):(Ze.flags|=e,u.memoizedState=Zr(1|t,f,n,a))}function im(e,t){Tu(8390656,8,e,t)}function vd(e,t){Eu(2048,8,e,t)}function oy(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=wu(),Ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function rm(e){var t=Nn().memoizedState;return oy({ref:t,nextImpl:e}),function(){if((St&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function cm(e,t){return Eu(4,2,e,t)}function om(e,t){return Eu(4,4,e,t)}function um(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fm(e,t,n){n=n!=null?n.concat([e]):null,Eu(4,4,um.bind(null,t,e),n)}function jd(){}function dm(e,t){var n=Nn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&fd(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function hm(e,t){var n=Nn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&fd(t,a[1]))return a[0];if(a=e(),nr){Zt(!0);try{e()}finally{Zt(!1)}}return n.memoizedState=[a,t],a}function Sd(e,t,n){return n===void 0||(_a&1073741824)!==0&&(ut&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=pg(),Ze.lanes|=e,ri|=e,n)}function pm(e,t,n,a){return yl(n,t)?n:Vr.current!==null?(e=Sd(e,n,a),yl(e,t)||(Ln=!0),e):(_a&42)===0||(_a&1073741824)!==0&&(ut&261930)===0?(Ln=!0,e.memoizedState=n):(e=pg(),Ze.lanes|=e,ri|=e,t)}function mm(e,t,n,a,u){var f=fe.p;fe.p=f!==0&&8>f?f:8;var b=M.T,S={};M.T=S,Nd(e,!1,t,n);try{var R=u(),Z=M.S;if(Z!==null&&Z(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var se=sd(R,a);co(e,t,se,ns(e))}else co(e,t,a,ns(e))}catch(ue){co(e,t,{then:function(){},status:"rejected",reason:ue},ns())}finally{fe.p=f,b!==null&&S.types!==null&&(b.types=S.types),M.T=b}}function uy(){}function wd(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=gm(e).queue;mm(e,u,t,L,n===null?uy:function(){return xm(e),n(a)})}function gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:L},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xm(e){var t=gm(e);t.next===null&&(t=e.alternate.memoizedState),co(e,t.next.queue,{},ns())}function kd(){return Rn(No)}function bm(){return Nn().memoizedState}function _m(){return Nn().memoizedState}function fy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ns();e=ti(n);var a=ni(t,e,n);a!==null&&(Il(a,t,n),lo(a,t,n)),t={cache:Gr()},e.payload=t;return}t=t.return}}function dy(e,t,n){var a=ns();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cu(e)?vm(t,n):(n=pa(e,t,n,a),n!==null&&(Il(n,e,a),jm(n,t,a)))}function ym(e,t,n){var a=ns();co(e,t,n,a)}function co(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))vm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,S=f(b,n);if(u.hasEagerState=!0,u.eagerState=S,yl(S,b))return Or(e,t,u,0),$t===null&&Dr(),!1}catch{}finally{}if(n=pa(e,t,u,a),n!==null)return Il(n,e,a),jm(n,t,a),!0}return!1}function Nd(e,t,n,a){if(a={lane:2,revertLane:sh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(t)throw Error(c(479))}else t=pa(e,n,a,2),t!==null&&Il(t,e,2)}function Cu(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function vm(e,t){Qr=ju=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,$l(e,n)}}var oo={readContext:Rn,use:ku,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};oo.useEffectEvent=xn;var Sm={readContext:Rn,use:ku,useCallback:function(e,t){return wl().memoizedState=[e,t===void 0?null:t],e},useContext:Rn,useEffect:im,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Tu(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tu(4194308,4,e,t)},useInsertionEffect:function(e,t){Tu(4,2,e,t)},useMemo:function(e,t){var n=wl();t=t===void 0?null:t;var a=e();if(nr){Zt(!0);try{e()}finally{Zt(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=wl();if(n!==void 0){var u=n(t);if(nr){Zt(!0);try{n(t)}finally{Zt(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=dy.bind(null,Ze,e),[a.memoizedState,e]},useRef:function(e){var t=wl();return e={current:e},t.memoizedState=e},useState:function(e){e=_d(e);var t=e.queue,n=ym.bind(null,Ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:jd,useDeferredValue:function(e,t){var n=wl();return Sd(n,e,t)},useTransition:function(){var e=_d(!1);return e=mm.bind(null,Ze,e.queue,!0,!1),wl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Ze,u=wl();if(st){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),$t===null)throw Error(c(349));(ut&127)!==0||$p(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,im(Vp.bind(null,a,f,e),[e]),a.flags|=2048,Zr(9,{destroy:void 0},Xp.bind(null,a,f,n,t),null),n},useId:function(){var e=wl(),t=$t.identifierPrefix;if(st){var n=rs,a=is;n=(a&~(1<<32-vt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Su++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ay++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kd,useFormState:tm,useActionState:tm,useOptimistic:function(e){var t=wl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Nd.bind(null,Ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:gd,useCacheRefresh:function(){return wl().memoizedState=fy.bind(null,Ze)},useEffectEvent:function(e){var t=wl(),n={impl:e};return t.memoizedState=n,function(){if((St&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Td={readContext:Rn,use:ku,useCallback:dm,useContext:Rn,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:Nu,useRef:am,useState:function(){return Nu(ya)},useDebugValue:jd,useDeferredValue:function(e,t){var n=Nn();return pm(n,Ut.memoizedState,e,t)},useTransition:function(){var e=Nu(ya)[0],t=Nn().memoizedState;return[typeof e=="boolean"?e:ro(e),t]},useSyncExternalStore:Yp,useId:bm,useHostTransitionStatus:kd,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=Nn();return Zp(n,Ut,e,t)},useMemoCache:gd,useCacheRefresh:_m};Td.useEffectEvent=rm;var wm={readContext:Rn,use:ku,useCallback:dm,useContext:Rn,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:bd,useRef:am,useState:function(){return bd(ya)},useDebugValue:jd,useDeferredValue:function(e,t){var n=Nn();return Ut===null?Sd(n,e,t):pm(n,Ut.memoizedState,e,t)},useTransition:function(){var e=bd(ya)[0],t=Nn().memoizedState;return[typeof e=="boolean"?e:ro(e),t]},useSyncExternalStore:Yp,useId:bm,useHostTransitionStatus:kd,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=Nn();return Ut!==null?Zp(n,Ut,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:gd,useCacheRefresh:_m};wm.useEffectEvent=rm;function Ed(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cd={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=ns(),u=ti(a);u.payload=t,n!=null&&(u.callback=n),t=ni(e,u,a),t!==null&&(Il(t,e,a),lo(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=ns(),u=ti(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ni(e,u,a),t!==null&&(Il(t,e,a),lo(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ns(),a=ti(n);a.tag=2,t!=null&&(a.callback=t),t=ni(e,a,n),t!==null&&(Il(t,e,n),lo(t,e,n))}};function km(e,t,n,a,u,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,b):t.prototype&&t.prototype.isPureReactComponent?!Xi(n,a)||!Xi(u,f):!0}function Nm(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Cd.enqueueReplaceState(t,t.state,null)}function lr(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Tm(e){Zi(e)}function Em(e){console.error(e)}function Cm(e){Zi(e)}function Au(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Am(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ad(e,t,n){return n=ti(n),n.tag=3,n.payload={element:null},n.callback=function(){Au(e,t)},n}function Mm(e){return e=ti(e),e.tag=3,e}function Rm(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){Am(t,n,a)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Am(t,n,a),typeof u!="function"&&(ci===null?ci=new Set([this]):ci.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})})}function hy(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&ga(t,n,u,!0),n=Wl.current,n!==null){switch(n.tag){case 31:case 13:return os===null?Gu():n.alternate===null&&bn===0&&(bn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===p?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),th(e,a,u)),!1;case 22:return n.flags|=65536,a===p?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),th(e,a,u)),!1}throw Error(c(435,n.tag))}return th(e,a,u),Gu(),!1}if(st)return t=Wl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==Pc&&(e=Error(c(422),{cause:a}),Gs(jl(e,n)))):(a!==Pc&&(t=Error(c(423),{cause:a}),Gs(jl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=jl(a,n),u=Ad(e.stateNode,a,u),id(e,u),bn!==4&&(bn=2)),!1;var f=Error(c(520),{cause:a});if(f=jl(f,n),bo===null?bo=[f]:bo.push(f),bn!==4&&(bn=2),t===null)return!0;a=jl(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Ad(n.stateNode,a,e),id(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ci===null||!ci.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Mm(u),Rm(u,e,n,a),id(n,u),!1}n=n.return}while(n!==null);return!1}var Md=Error(c(461)),Ln=!1;function sl(e,t,n,a){t.child=e===null?Et(t,null,n,a):tt(t,e.child,n,a)}function Dm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var b={};for(var S in a)S!=="ref"&&(b[S]=a[S])}else b=a;return Jl(t),a=dd(e,t,n,b,f,u),S=hd(),e!==null&&!Ln?(pd(e,t,u),va(e,t,u)):(st&&S&&Jc(t),t.flags|=1,sl(e,t,a,u),t.child)}function Om(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!Kc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Lm(e,t,f,a,u)):(e=Lr(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Bd(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:Xi,n(b,a)&&e.ref===t.ref)return va(e,t,u)}return t.flags|=1,e=Ss(f,a),e.ref=t.ref,e.return=t,t.child=e}function Lm(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(Xi(f,a)&&e.ref===t.ref)if(Ln=!1,t.pendingProps=a=f,Bd(e,u))(e.flags&131072)!==0&&(Ln=!0);else return t.lanes=e.lanes,va(e,t,u)}return Rd(e,t,n,a,u)}function zm(e,t,n,a){var u=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|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~f}else a=0,t.child=null;return Um(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ns(t,f!==null?f.cachePool:null),f!==null?Bp(t,f):cd(),Ip(t);else return a=t.lanes=536870912,Um(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(Ns(t,f.cachePool),Bp(t,f),si(),t.memoizedState=null):(e!==null&&Ns(t,null),cd(),si());return sl(e,t,u,n),t.child}function uo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Um(e,t,n,a,u){var f=to();return f=f===null?null:{parent:gn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Ns(t,null),cd(),Ip(t),e!==null&&ga(e,t,a,!0),t.childLanes=u,null}function Mu(e,t){return t=Du({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hm(e,t,n){return tt(t,e.child,null,n),e=Mu(t,t.pendingProps),e.flags|=2,Pl(t),t.memoizedState=null,e}function py(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(st){if(a.mode==="hidden")return e=Mu(t,a),t.lanes=536870912,uo(null,e);if(ud(t),(e=Yt)?(e=Fg(e,Ol),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zl!==null?{id:is,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},n=hu(e),n.return=t,t.child=n,qn=t,Yt=null)):e=null,e===null)throw Is(t);return t.lanes=536870912,null}return Mu(t,a)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(ud(t),u)if(t.flags&256)t.flags&=-257,t=Hm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ln||ga(e,t,n,!1),u=(n&e.childLanes)!==0,Ln||u){if(a=$t,a!==null&&(b=ms(a,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Hs(e,b),Il(a,e,b),Md;Gu(),t=Hm(e,t,n)}else e=f.treeContext,Yt=us(b.nextSibling),qn=t,st=!0,Bs=null,Ol=!1,e!==null&&gu(t,e),t=Mu(t,a),t.flags|=4096;return t}return e=Ss(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ru(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rd(e,t,n,a,u){return Jl(t),n=dd(e,t,n,a,void 0,u),a=hd(),e!==null&&!Ln?(pd(e,t,u),va(e,t,u)):(st&&a&&Jc(t),t.flags|=1,sl(e,t,n,u),t.child)}function Bm(e,t,n,a,u,f){return Jl(t),t.updateQueue=null,n=Gp(t,a,n,u),qp(e),a=hd(),e!==null&&!Ln?(pd(e,t,f),va(e,t,f)):(st&&a&&Jc(t),t.flags|=1,sl(e,t,n,f),t.child)}function Im(e,t,n,a,u){if(Jl(t),t.stateNode===null){var f=Va,b=n.contextType;typeof b=="object"&&b!==null&&(f=Rn(b)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Cd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},no(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?Rn(b):Va,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(Ed(t,n,b,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&Cd.enqueueReplaceState(f,f.state,null),ao(t,a,f,u),so(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,R=lr(n,S);f.props=R;var Z=f.context,se=n.contextType;b=Va,typeof se=="object"&&se!==null&&(b=Rn(se));var ue=n.getDerivedStateFromProps;se=typeof ue=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,se||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||Z!==b)&&Nm(t,f,a,b),Zn=!1;var ee=t.memoizedState;f.state=ee,ao(t,a,f,u),so(),Z=t.memoizedState,S||ee!==Z||Zn?(typeof ue=="function"&&(Ed(t,n,ue,a),Z=t.memoizedState),(R=Zn||km(t,n,R,a,ee,Z,b))?(se||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=Z),f.props=a,f.state=Z,f.context=b,a=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,ad(e,t),b=t.memoizedProps,se=lr(n,b),f.props=se,ue=t.pendingProps,ee=f.context,Z=n.contextType,R=Va,typeof Z=="object"&&Z!==null&&(R=Rn(Z)),S=n.getDerivedStateFromProps,(Z=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==ue||ee!==R)&&Nm(t,f,a,R),Zn=!1,ee=t.memoizedState,f.state=ee,ao(t,a,f,u),so();var ne=t.memoizedState;b!==ue||ee!==ne||Zn||e!==null&&e.dependencies!==null&&Br(e.dependencies)?(typeof S=="function"&&(Ed(t,n,S,a),ne=t.memoizedState),(se=Zn||km(t,n,se,a,ee,ne,R)||e!==null&&e.dependencies!==null&&Br(e.dependencies))?(Z||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,ne,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,ne,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ne),f.props=a,f.state=ne,f.context=R,a=se):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,Ru(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=tt(t,e.child,null,u),t.child=tt(t,null,n,u)):sl(e,t,n,u),t.memoizedState=f.state,e=t.child):e=va(e,t,u),e}function qm(e,t,n,a){return qs(),t.flags|=256,sl(e,t,n,a),t.child}var Dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Od(e){return{baseLanes:e,cachePool:$r()}}function Ld(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ts),e}function Gm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(kn.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(u?li(t):si(),(e=Yt)?(e=Fg(e,Ol),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zl!==null?{id:is,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},n=hu(e),n.return=t,t.child=n,qn=t,Yt=null)):e=null,e===null)throw Is(t);return xh(e)?t.lanes=32:t.lanes=536870912,null}var S=a.children;return a=a.fallback,u?(si(),u=t.mode,S=Du({mode:"hidden",children:S},u),a=ma(a,u,n,null),S.return=t,a.return=t,S.sibling=a,t.child=S,a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,b,n),t.memoizedState=Dd,uo(null,a)):(li(t),zd(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(f)t.flags&256?(li(t),t.flags&=-257,t=Ud(e,t,n)):t.memoizedState!==null?(si(),t.child=e.child,t.flags|=128,t=null):(si(),S=a.fallback,u=t.mode,a=Du({mode:"visible",children:a.children},u),S=ma(S,u,n,null),S.flags|=2,a.return=t,S.return=t,a.sibling=S,t.child=a,tt(t,e.child,null,n),a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,b,n),t.memoizedState=Dd,t=uo(null,a));else if(li(t),xh(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var Z=b.dgst;b=Z,a=Error(c(419)),a.stack="",a.digest=b,Gs({value:a,source:null,stack:null}),t=Ud(e,t,n)}else if(Ln||ga(e,t,n,!1),b=(n&e.childLanes)!==0,Ln||b){if(b=$t,b!==null&&(a=ms(b,n),a!==0&&a!==R.retryLane))throw R.retryLane=a,Hs(e,a),Il(b,e,a),Md;gh(S)||Gu(),t=Ud(e,t,n)}else gh(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,Yt=us(S.nextSibling),qn=t,st=!0,Bs=null,Ol=!1,e!==null&&gu(t,e),t=zd(t,a.children),t.flags|=4096);return t}return u?(si(),S=a.fallback,u=t.mode,R=e.child,Z=R.sibling,a=Ss(R,{mode:"hidden",children:a.children}),a.subtreeFlags=R.subtreeFlags&65011712,Z!==null?S=Ss(Z,S):(S=ma(S,u,n,null),S.flags|=2),S.return=t,a.return=t,a.sibling=S,t.child=a,uo(null,a),a=t.child,S=e.child.memoizedState,S===null?S=Od(n):(u=S.cachePool,u!==null?(R=gn._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=$r(),S={baseLanes:S.baseLanes|n,cachePool:u}),a.memoizedState=S,a.childLanes=Ld(e,b,n),t.memoizedState=Dd,uo(e.child,a)):(li(t),n=e.child,e=n.sibling,n=Ss(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function zd(e,t){return t=Du({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Du(e,t){return e=vl(22,e,null,t),e.lanes=0,e}function Ud(e,t,n){return tt(t,e.child,null,n),e=zd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ym(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Hr(e.return,t,n)}function Hd(e,t,n,a,u,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=a,b.tail=n,b.tailMode=u,b.treeForkCount=f)}function $m(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var b=kn.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,oe(kn,b),sl(e,t,a,n),a=st?Ji:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ym(e,n,t);else if(e.tag===19)Ym(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&vu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Hd(t,!1,u,n,f,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&vu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Hd(t,!0,n,null,f,a);break;case"together":Hd(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function va(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ri|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ga(e,t,n,!1),(n&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,n=Ss(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ss(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Bd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Br(e)))}function my(e,t,n){switch(t.tag){case 3:nt(t,t.stateNode.containerInfo),ks(t,gn,e.memoizedState.cache),qs();break;case 27:case 5:dt(t);break;case 4:nt(t,t.stateNode.containerInfo);break;case 10:ks(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ud(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(li(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Gm(e,t,n):(li(t),e=va(e,t,n),e!==null?e.sibling:null);li(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(ga(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return $m(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),oe(kn,kn.current),a)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:ks(t,gn,e.memoizedState.cache)}return va(e,t,n)}function Xm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ln=!0;else{if(!Bd(e,n)&&(t.flags&128)===0)return Ln=!1,my(e,t,n);Ln=(e.flags&131072)!==0}else Ln=!1,st&&(t.flags&1048576)!==0&&mu(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=He(t.elementType),t.type=e,typeof e=="function")Kc(e)?(a=lr(e,a),t.tag=1,t=Im(null,t,e,a,n)):(t.tag=0,t=Rd(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=Dm(null,t,e,a,n);break e}else if(u===z){t.tag=14,t=Om(null,t,e,a,n);break e}}throw t=Oe(e)||e,Error(c(306,t,""))}}return t;case 0:return Rd(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=lr(a,t.pendingProps),Im(e,t,a,u,n);case 3:e:{if(nt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,ad(e,t),ao(t,a,null,n);var b=t.memoizedState;if(a=b.cache,ks(t,gn,a),a!==f.cache&&Fa(t,[gn],n,!0),so(),a=b.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=qm(e,t,a,n);break e}else if(a!==u){u=jl(Error(c(424)),t),Gs(u),t=qm(e,t,a,n);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(Yt=us(e.firstChild),qn=t,st=!0,Bs=null,Ol=!0,n=Et(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(qs(),a===u){t=va(e,t,n);break e}sl(e,t,a,n)}t=t.child}return t;case 26:return Ru(e,t),e===null?(n=nx(t.type,null,t.pendingProps,null))?t.memoizedState=n:st||(n=t.type,e=t.pendingProps,a=Zu(Ee.current).createElement(n),a[Lt]=t,a[Ve]=e,al(a,n,e),We(a),t.stateNode=a):t.memoizedState=nx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return dt(t),e===null&&st&&(a=t.stateNode=Pg(t.type,t.pendingProps,Ee.current),qn=t,Ol=!0,u=Yt,di(t.type)?(bh=u,Yt=us(a.firstChild)):Yt=u),sl(e,t,t.pendingProps.children,n),Ru(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((u=a=Yt)&&(a=Xy(a,t.type,t.pendingProps,Ol),a!==null?(t.stateNode=a,qn=t,Yt=us(a.firstChild),Ol=!1,u=!0):u=!1),u||Is(t)),dt(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,a=f.children,hh(u,f)?a=null:b!==null&&hh(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=dd(e,t,iy,null,null,n),No._currentValue=u),Ru(e,t),sl(e,t,a,n),t.child;case 6:return e===null&&st&&((e=n=Yt)&&(n=Vy(n,t.pendingProps,Ol),n!==null?(t.stateNode=n,qn=t,Yt=null,e=!0):e=!1),e||Is(t)),null;case 13:return Gm(e,t,n);case 4:return nt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=tt(t,null,a,n):sl(e,t,a,n),t.child;case 11:return Dm(e,t,t.type,t.pendingProps,n);case 7:return sl(e,t,t.pendingProps,n),t.child;case 8:return sl(e,t,t.pendingProps.children,n),t.child;case 12:return sl(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,ks(t,t.type,a.value),sl(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,Jl(t),u=Rn(u),a=a(u),t.flags|=1,sl(e,t,a,n),t.child;case 14:return Om(e,t,t.type,t.pendingProps,n);case 15:return Lm(e,t,t.type,t.pendingProps,n);case 19:return $m(e,t,n);case 31:return py(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return Jl(t),a=Rn(gn),e===null?(u=to(),u===null&&(u=$t,f=Gr(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},no(t),ks(t,gn,u)):((e.lanes&n)!==0&&(ad(e,t),ao(t,null,null,n),so()),u=e.memoizedState,f=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ks(t,gn,a)):(a=f.cache,ks(t,gn,a),a!==u.cache&&Fa(t,[gn],n,!0))),sl(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ja(e){e.flags|=4}function Id(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(bg())e.flags|=8192;else throw bt=p,Xr}else e.flags&=-16777217}function Vm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rx(t))if(bg())e.flags|=8192;else throw bt=p,Xr}function Ou(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?tn():536870912,e.lanes|=t,Pr|=t)}function fo(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function gy(e,t,n){var a=t.pendingProps;switch(Wc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return Ft(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Fl(gn),Xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Za(t)?ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ur())),Ft(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(ja(t),f!==null?(Ft(t),Vm(t,f)):(Ft(t),Id(t,u,null,a,n))):f?f!==e.memoizedState?(ja(t),Ft(t),Vm(t,f)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ja(t),Ft(t),Id(t,u,e,a,n)),null;case 27:if(Ge(t),n=Ee.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ja(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}e=me.current,Za(t)?xu(t):(e=Pg(u,a,n),t.stateNode=e,ja(t))}return Ft(t),null;case 5:if(Ge(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ja(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}if(f=me.current,Za(t))xu(t);else{var b=Zu(Ee.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?b.createElement("select",{is:a.is}):b.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?b.createElement(u,{is:a.is}):b.createElement(u)}}f[Lt]=t,f[Ve]=a;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(al(f,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ja(t)}}return Ft(t),Id(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ja(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ee.current,Za(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=qn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Gg(e.nodeValue,n)),e||Is(t,!0)}else e=Zu(e).createTextNode(a),e[Lt]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Za(t),n!==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[Lt]=t}else qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=Ur(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Pl(t),t):(Pl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ft(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Za(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[Lt]=t}else qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),u=!1}else u=Ur(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Pl(t),t):(Pl(t),null)}return Pl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ou(t,t.updateQueue),Ft(t),null);case 4:return Xe(),e===null&&ch(t.stateNode.containerInfo),Ft(t),null;case 10:return Fl(t.type),Ft(t),null;case 19:if(X(kn),a=t.memoizedState,a===null)return Ft(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)fo(a,!1);else{if(bn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=vu(e),f!==null){for(t.flags|=128,fo(a,!1),e=f.updateQueue,t.updateQueue=e,Ou(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)du(n,e),n=n.sibling;return oe(kn,kn.current&1|2),st&&ws(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&rt()>Bu&&(t.flags|=128,u=!0,fo(a,!1),t.lanes=4194304)}else{if(!u)if(e=vu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ou(t,e),fo(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!st)return Ft(t),null}else 2*rt()-a.renderingStartTime>Bu&&n!==536870912&&(t.flags|=128,u=!0,fo(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=rt(),e.sibling=null,n=kn.current,oe(kn,u?n&1|2:n&1),st&&ws(t,a.treeForkCount),e):(Ft(t),null);case 22:case 23:return Pl(t),od(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),n=t.updateQueue,n!==null&&Ou(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&X(Ys),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fl(gn),Ft(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function xy(e,t){switch(Wc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fl(gn),Xe(),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(Pl(t),t.alternate===null)throw Error(c(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(kn),null;case 4:return Xe(),null;case 10:return Fl(t.type),null;case 22:case 23:return Pl(t),od(),e!==null&&X(Ys),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fl(gn),null;case 25:return null;default:return null}}function Qm(e,t){switch(Wc(t),t.tag){case 3:Fl(gn),Xe();break;case 26:case 27:case 5:Ge(t);break;case 4:Xe();break;case 31:t.memoizedState!==null&&Pl(t);break;case 13:Pl(t);break;case 19:X(kn);break;case 10:Fl(t.type);break;case 22:case 23:Pl(t),od(),e!==null&&X(Ys);break;case 24:Fl(gn)}}function ho(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,b=n.inst;a=f(),b.destroy=a}n=n.next}while(n!==u)}}catch(S){Dt(t,t.return,S)}}function ai(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var b=a.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var R=n,Z=S;try{Z()}catch(se){Dt(u,R,se)}}}a=a.next}while(a!==f)}}catch(se){Dt(t,t.return,se)}}function Km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hp(t,n)}catch(a){Dt(e,e.return,a)}}}function Zm(e,t,n){n.props=lr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Dt(e,t,a)}}function po(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){Dt(e,t,u)}}function $s(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){Dt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){Dt(e,t,u)}else n.current=null}function Fm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){Dt(e,e.return,u)}}function qd(e,t,n){try{var a=e.stateNode;By(a,e.type,n,t),a[Ve]=t}catch(u){Dt(e,e.return,u)}}function Jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&di(e.type)||e.tag===4}function Gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jm(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&&di(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 Yd(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ot));else if(a!==4&&(a===27&&di(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yd(e,t,n),e=e.sibling;e!==null;)Yd(e,t,n),e=e.sibling}function Lu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&di(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Wm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);al(t,a,n),t[Lt]=e,t[Ve]=n}catch(f){Dt(e,e.return,f)}}var Sa=!1,zn=!1,$d=!1,Pm=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function by(e,t){if(e=e.containerInfo,fh=nf,e=su(e),Gc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,S=-1,R=-1,Z=0,se=0,ue=e,ee=null;t:for(;;){for(var ne;ue!==n||u!==0&&ue.nodeType!==3||(S=b+u),ue!==f||a!==0&&ue.nodeType!==3||(R=b+a),ue.nodeType===3&&(b+=ue.nodeValue.length),(ne=ue.firstChild)!==null;)ee=ue,ue=ne;for(;;){if(ue===e)break t;if(ee===n&&++Z===u&&(S=b),ee===f&&++se===a&&(R=b),(ne=ue.nextSibling)!==null)break;ue=ee,ee=ue.parentNode}ue=ne}n=S===-1||R===-1?null:{start:S,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(dh={focusedElem:e,selectionRange:n},nf=!1,Fn=t;Fn!==null;)if(t=Fn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fn=e;else for(;Fn!==null;){switch(t=Fn,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(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,a=n.stateNode;try{var Re=lr(n.type,u);e=a.getSnapshotBeforeUpdate(Re,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(Ie){Dt(n,n.return,Ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mh(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,Fn=e;break}Fn=t.return}}function eg(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ka(e,n),a&4&&ho(5,n);break;case 1:if(ka(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){Dt(n,n.return,b)}else{var u=lr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Dt(n,n.return,b)}}a&64&&Km(n),a&512&&po(n,n.return);break;case 3:if(ka(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Hp(e,t)}catch(b){Dt(n,n.return,b)}}break;case 27:t===null&&a&4&&Wm(n);case 26:case 5:ka(e,n),t===null&&a&4&&Fm(n),a&512&&po(n,n.return);break;case 12:ka(e,n);break;case 31:ka(e,n),a&4&&lg(e,n);break;case 13:ka(e,n),a&4&&sg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ty.bind(null,n),Qy(e,n))));break;case 22:if(a=n.memoizedState!==null||Sa,!a){t=t!==null&&t.memoizedState!==null||zn,u=Sa;var f=zn;Sa=a,(zn=t)&&!f?Na(e,n,(n.subtreeFlags&8772)!==0):ka(e,n),Sa=u,zn=f}break;case 30:break;default:ka(e,n)}}function tg(e){var t=e.alternate;t!==null&&(e.alternate=null,tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Cl(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sn=null,zl=!1;function wa(e,t,n){for(n=n.child;n!==null;)ng(e,t,n),n=n.sibling}function ng(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(rn,n)}catch{}switch(n.tag){case 26:zn||$s(n,t),wa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:zn||$s(n,t);var a=sn,u=zl;di(n.type)&&(sn=n.stateNode,zl=!1),wa(e,t,n),So(n.stateNode),sn=a,zl=u;break;case 5:zn||$s(n,t);case 6:if(a=sn,u=zl,sn=null,wa(e,t,n),sn=a,zl=u,sn!==null)if(zl)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(n.stateNode)}catch(f){Dt(n,t,f)}else try{sn.removeChild(n.stateNode)}catch(f){Dt(n,t,f)}break;case 18:sn!==null&&(zl?(e=sn,Kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),rc(e)):Kg(sn,n.stateNode));break;case 4:a=sn,u=zl,sn=n.stateNode.containerInfo,zl=!0,wa(e,t,n),sn=a,zl=u;break;case 0:case 11:case 14:case 15:ai(2,n,t),zn||ai(4,n,t),wa(e,t,n);break;case 1:zn||($s(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Zm(n,t,a)),wa(e,t,n);break;case 21:wa(e,t,n);break;case 22:zn=(a=zn)||n.memoizedState!==null,wa(e,t,n),zn=a;break;default:wa(e,t,n)}}function lg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rc(e)}catch(n){Dt(t,t.return,n)}}}function sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rc(e)}catch(n){Dt(t,t.return,n)}}function _y(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Pm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pm),t;default:throw Error(c(435,e.tag))}}function zu(e,t){var n=_y(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=Ey.bind(null,e,a);a.then(u,u)}})}function Ul(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,b=t,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(di(S.type)){sn=S.stateNode,zl=!1;break e}break;case 5:sn=S.stateNode,zl=!1;break e;case 3:case 4:sn=S.stateNode.containerInfo,zl=!0;break e}S=S.return}if(sn===null)throw Error(c(160));ng(f,b,u),sn=null,zl=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ag(t,e),t=t.sibling}var Ts=null;function ag(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ul(t,e),Hl(e),a&4&&(ai(3,e,e.return),ho(3,e),ai(5,e,e.return));break;case 1:Ul(t,e),Hl(e),a&512&&(zn||n===null||$s(n,n.return)),a&64&&Sa&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var u=Ts;if(Ul(t,e),Hl(e),a&512&&(zn||n===null||$s(n,n.return)),a&4){var f=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(a){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Nt]||f[Lt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),al(f,a,n),f[Lt]=e,We(f),a=f;break e;case"link":var b=ax("link","href",u).get(a+(n.href||""));if(b){for(var S=0;S<b.length;S++)if(f=b[S],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(S,1);break t}}f=u.createElement(a),al(f,a,n),u.head.appendChild(f);break;case"meta":if(b=ax("meta","content",u).get(a+(n.content||""))){for(S=0;S<b.length;S++)if(f=b[S],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(S,1);break t}}f=u.createElement(a),al(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Lt]=e,We(f),a=f}e.stateNode=a}else ix(u,e.type,e.stateNode);else e.stateNode=sx(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?ix(u,e.type,e.stateNode):sx(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&qd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ul(t,e),Hl(e),a&512&&(zn||n===null||$s(n,n.return)),n!==null&&a&4&&qd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ul(t,e),Hl(e),a&512&&(zn||n===null||$s(n,n.return)),e.flags&32){u=e.stateNode;try{V(u,"")}catch(Re){Dt(e,e.return,Re)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,qd(e,u,n!==null?n.memoizedProps:u)),a&1024&&($d=!0);break;case 6:if(Ul(t,e),Hl(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Re){Dt(e,e.return,Re)}}break;case 3:if(Wu=null,u=Ts,Ts=Fu(t.containerInfo),Ul(t,e),Ts=u,Hl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{rc(t.containerInfo)}catch(Re){Dt(e,e.return,Re)}$d&&($d=!1,ig(e));break;case 4:a=Ts,Ts=Fu(e.stateNode.containerInfo),Ul(t,e),Hl(e),Ts=a;break;case 12:Ul(t,e),Hl(e);break;case 31:Ul(t,e),Hl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 13:Ul(t,e),Hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Hu=rt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 22:u=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,Z=Sa,se=zn;if(Sa=Z||u,zn=se||R,Ul(t,e),zn=se,Sa=Z,Hl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||Sa||zn||sr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=R.stateNode;var ue=R.memoizedProps.style,ee=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;S.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Re){Dt(R,R.return,Re)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(Re){Dt(R,R.return,Re)}}}else if(t.tag===18){if(n===null){R=t;try{var ne=R.stateNode;u?Zg(ne,!0):Zg(R.stateNode,!1)}catch(Re){Dt(R,R.return,Re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,zu(e,n))));break;case 19:Ul(t,e),Hl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 30:break;case 21:break;default:Ul(t,e),Hl(e)}}function Hl(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Jm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Gd(e);Lu(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(V(b,""),n.flags&=-33);var S=Gd(e);Lu(e,S,b);break;case 3:case 4:var R=n.stateNode.containerInfo,Z=Gd(e);Yd(e,Z,R);break;default:throw Error(c(161))}}catch(se){Dt(e,e.return,se)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ig(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ig(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ka(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)eg(e,t.alternate,t),t=t.sibling}function sr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ai(4,t,t.return),sr(t);break;case 1:$s(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zm(t,t.return,n),sr(t);break;case 27:So(t.stateNode);case 26:case 5:$s(t,t.return),sr(t);break;case 22:t.memoizedState===null&&sr(t);break;case 30:sr(t);break;default:sr(t)}e=e.sibling}}function Na(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:Na(u,f,n),ho(4,f);break;case 1:if(Na(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(Z){Dt(a,a.return,Z)}if(a=f,u=a.updateQueue,u!==null){var S=a.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Up(R[u],S)}catch(Z){Dt(a,a.return,Z)}}n&&b&64&&Km(f),po(f,f.return);break;case 27:Wm(f);case 26:case 5:Na(u,f,n),n&&a===null&&b&4&&Fm(f),po(f,f.return);break;case 12:Na(u,f,n);break;case 31:Na(u,f,n),n&&b&4&&lg(u,f);break;case 13:Na(u,f,n),n&&b&4&&sg(u,f);break;case 22:f.memoizedState===null&&Na(u,f,n),po(f,f.return);break;case 30:break;default:Na(u,f,n)}t=t.sibling}}function Xd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Wa(n))}function Vd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wa(e))}function Es(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rg(e,t,n,a),t=t.sibling}function rg(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Es(e,t,n,a),u&2048&&ho(9,t);break;case 1:Es(e,t,n,a);break;case 3:Es(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wa(e)));break;case 12:if(u&2048){Es(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Dt(t,t.return,R)}}else Es(e,t,n,a);break;case 31:Es(e,t,n,a);break;case 13:Es(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?Es(e,t,n,a):mo(e,t):f._visibility&2?Es(e,t,n,a):(f._visibility|=2,Fr(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Xd(b,t);break;case 24:Es(e,t,n,a),u&2048&&Vd(t.alternate,t);break;default:Es(e,t,n,a)}}function Fr(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=n,R=a,Z=b.flags;switch(b.tag){case 0:case 11:case 15:Fr(f,b,S,R,u),ho(8,b);break;case 23:break;case 22:var se=b.stateNode;b.memoizedState!==null?se._visibility&2?Fr(f,b,S,R,u):mo(f,b):(se._visibility|=2,Fr(f,b,S,R,u)),u&&Z&2048&&Xd(b.alternate,b);break;case 24:Fr(f,b,S,R,u),u&&Z&2048&&Vd(b.alternate,b);break;default:Fr(f,b,S,R,u)}t=t.sibling}}function mo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:mo(n,a),u&2048&&Xd(a.alternate,a);break;case 24:mo(n,a),u&2048&&Vd(a.alternate,a);break;default:mo(n,a)}t=t.sibling}}var go=8192;function Jr(e,t,n){if(e.subtreeFlags&go)for(e=e.child;e!==null;)cg(e,t,n),e=e.sibling}function cg(e,t,n){switch(e.tag){case 26:Jr(e,t,n),e.flags&go&&e.memoizedState!==null&&a0(n,Ts,e.memoizedState,e.memoizedProps);break;case 5:Jr(e,t,n);break;case 3:case 4:var a=Ts;Ts=Fu(e.stateNode.containerInfo),Jr(e,t,n),Ts=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=go,go=16777216,Jr(e,t,n),go=a):Jr(e,t,n));break;default:Jr(e,t,n)}}function og(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 xo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fn=a,fg(a,e)}og(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ug(e),e=e.sibling}function ug(e){switch(e.tag){case 0:case 11:case 15:xo(e),e.flags&2048&&ai(9,e,e.return);break;case 3:xo(e);break;case 12:xo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uu(e)):xo(e);break;default:xo(e)}}function Uu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fn=a,fg(a,e)}og(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ai(8,t,t.return),Uu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Uu(t));break;default:Uu(t)}e=e.sibling}}function fg(e,t){for(;Fn!==null;){var n=Fn;switch(n.tag){case 0:case 11:case 15:ai(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Wa(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Fn=a;else e:for(n=e;Fn!==null;){a=Fn;var u=a.sibling,f=a.return;if(tg(a),a===n){Fn=null;break e}if(u!==null){u.return=f,Fn=u;break e}Fn=f}}}var yy={getCacheForType:function(e){var t=Rn(gn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Rn(gn).controller.signal}},vy=typeof WeakMap=="function"?WeakMap:Map,St=0,$t=null,at=null,ut=0,Rt=0,es=null,ii=!1,Wr=!1,Qd=!1,Ta=0,bn=0,ri=0,ar=0,Kd=0,ts=0,Pr=0,bo=null,Bl=null,Zd=!1,Hu=0,dg=0,Bu=1/0,Iu=null,ci=null,Yn=0,oi=null,ec=null,Ea=0,Fd=0,Jd=null,hg=null,_o=0,Wd=null;function ns(){return(St&2)!==0&&ut!==0?ut&-ut:M.T!==null?sh():sa()}function pg(){if(ts===0)if((ut&536870912)===0||st){var e=U;U<<=1,(U&3932160)===0&&(U=262144),ts=e}else ts=536870912;return e=Wl.current,e!==null&&(e.flags|=32),ts}function Il(e,t,n){(e===$t&&(Rt===2||Rt===9)||e.cancelPendingCommit!==null)&&(tc(e,0),ui(e,ut,ts,!1)),Xn(e,n),((St&2)===0||e!==$t)&&(e===$t&&((St&2)===0&&(ar|=n),bn===4&&ui(e,ut,ts,!1)),Xs(e))}function mg(e,t,n){if((St&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||qt(e,t),u=a?wy(e,t):eh(e,t,!0),f=a;do{if(u===0){Wr&&!a&&ui(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!jy(n)){u=eh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var S=e;u=bo;var R=S.current.memoizedState.isDehydrated;if(R&&(tc(S,b).flags|=256),b=eh(S,b,!1),b!==2){if(Qd&&!R){S.errorRecoveryDisabledLanes|=f,ar|=f,u=4;break e}f=Bl,Bl=u,f!==null&&(Bl===null?Bl=f:Bl.push.apply(Bl,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){tc(e,0),ui(e,t,0,!0);break}e:{switch(a=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:ui(a,t,ts,!ii);break e;case 2:Bl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Hu+300-rt(),10<u)){if(ui(a,t,ts,!ii),De(a,0,!0)!==0)break e;Ea=t,a.timeoutHandle=Vg(gg.bind(null,a,n,Bl,Iu,Zd,t,ts,ar,Pr,ii,f,"Throttled",-0,0),u);break e}gg(a,n,Bl,Iu,Zd,t,ts,ar,Pr,ii,f,null,-0,0)}}break}while(!0);Xs(e)}function gg(e,t,n,a,u,f,b,S,R,Z,se,ue,ee,ne){if(e.timeoutHandle=-1,ue=t.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ot},cg(t,f,ue);var Re=(f&62914560)===f?Hu-rt():(f&4194048)===f?dg-rt():0;if(Re=i0(ue,Re),Re!==null){Ea=f,e.cancelPendingCommit=Re(wg.bind(null,e,t,f,n,a,u,b,S,R,se,ue,null,ee,ne)),ui(e,f,b,!Z);return}}wg(e,t,f,n,a,u,b,S,R)}function jy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],f=u.getSnapshot;u=u.value;try{if(!yl(f(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ui(e,t,n,a){t&=~Kd,t&=~ar,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-vt(u),b=1<<f;a[f]=-1,u&=~b}n!==0&&Yl(e,n,t)}function qu(){return(St&6)===0?(yo(0),!1):!0}function Pd(){if(at!==null){if(Rt===0)var e=at.return;else e=at,fn=Gn=null,md(e),cs=null,ei=0,e=at;for(;e!==null;)Qm(e.alternate,e),e=e.return;at=null}}function tc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Gy(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ea=0,Pd(),$t=e,at=n=Ss(e.current,null),ut=t,Rt=0,es=null,ii=!1,Wr=qt(e,t),Qd=!1,Pr=ts=Kd=ar=ri=bn=0,Bl=bo=null,Zd=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-vt(a),f=1<<u;t|=e[u],a&=~f}return Ta=t,Dr(),n}function xg(e,t){Ze=null,M.H=oo,t===Pa||t===er?(t=Dn(),Rt=3):t===Xr?(t=Dn(),Rt=4):Rt=t===Md?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,es=t,at===null&&(bn=1,Au(e,jl(t,e.current)))}function bg(){var e=Wl.current;return e===null?!0:(ut&4194048)===ut?os===null:(ut&62914560)===ut||(ut&536870912)!==0?e===os:!1}function _g(){var e=M.H;return M.H=oo,e===null?oo:e}function yg(){var e=M.A;return M.A=yy,e}function Gu(){bn=4,ii||(ut&4194048)!==ut&&Wl.current!==null||(Wr=!0),(ri&134217727)===0&&(ar&134217727)===0||$t===null||ui($t,ut,ts,!1)}function eh(e,t,n){var a=St;St|=2;var u=_g(),f=yg();($t!==e||ut!==t)&&(Iu=null,tc(e,t)),t=!1;var b=bn;e:do try{if(Rt!==0&&at!==null){var S=at,R=es;switch(Rt){case 8:Pd(),b=6;break e;case 3:case 2:case 9:case 6:Wl.current===null&&(t=!0);var Z=Rt;if(Rt=0,es=null,nc(e,S,R,Z),n&&Wr){b=0;break e}break;default:Z=Rt,Rt=0,es=null,nc(e,S,R,Z)}}Sy(),b=bn;break}catch(se){xg(e,se)}while(!0);return t&&e.shellSuspendCounter++,fn=Gn=null,St=a,M.H=u,M.A=f,at===null&&($t=null,ut=0,Dr()),b}function Sy(){for(;at!==null;)vg(at)}function wy(e,t){var n=St;St|=2;var a=_g(),u=yg();$t!==e||ut!==t?(Iu=null,Bu=rt()+500,tc(e,t)):Wr=qt(e,t);e:do try{if(Rt!==0&&at!==null){t=at;var f=es;t:switch(Rt){case 1:Rt=0,es=null,nc(e,t,f,1);break;case 2:case 9:if(q(f)){Rt=0,es=null,jg(t);break}t=function(){Rt!==2&&Rt!==9||$t!==e||(Rt=7),Xs(e)},f.then(t,t);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:q(f)?(Rt=0,es=null,jg(t)):(Rt=0,es=null,nc(e,t,f,7));break;case 5:var b=null;switch(at.tag){case 26:b=at.memoizedState;case 5:case 27:var S=at;if(b?rx(b):S.stateNode.complete){Rt=0,es=null;var R=S.sibling;if(R!==null)at=R;else{var Z=S.return;Z!==null?(at=Z,Yu(Z)):at=null}break t}}Rt=0,es=null,nc(e,t,f,5);break;case 6:Rt=0,es=null,nc(e,t,f,6);break;case 8:Pd(),bn=6;break e;default:throw Error(c(462))}}ky();break}catch(se){xg(e,se)}while(!0);return fn=Gn=null,M.H=a,M.A=u,St=n,at!==null?0:($t=null,ut=0,Dr(),bn)}function ky(){for(;at!==null&&!hn();)vg(at)}function vg(e){var t=Xm(e.alternate,e,Ta);e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function jg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bm(n,t,t.pendingProps,t.type,void 0,ut);break;case 11:t=Bm(n,t,t.pendingProps,t.type.render,t.ref,ut);break;case 5:md(t);default:Qm(n,t),t=at=du(t,Ta),t=Xm(n,t,Ta)}e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function nc(e,t,n,a){fn=Gn=null,md(t),cs=null,ei=0;var u=t.return;try{if(hy(e,u,t,n,ut)){bn=1,Au(e,jl(n,e.current)),at=null;return}}catch(f){if(u!==null)throw at=u,f;bn=1,Au(e,jl(n,e.current)),at=null;return}t.flags&32768?(st||a===1?e=!0:Wr||(ut&536870912)!==0?e=!1:(ii=e=!0,(a===2||a===9||a===3||a===6)&&(a=Wl.current,a!==null&&a.tag===13&&(a.flags|=16384))),Sg(t,e)):Yu(t)}function Yu(e){var t=e;do{if((t.flags&32768)!==0){Sg(t,ii);return}e=t.return;var n=gy(t.alternate,t,Ta);if(n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);bn===0&&(bn=5)}function Sg(e,t){do{var n=xy(e.alternate,e);if(n!==null){n.flags&=32767,at=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){at=e;return}at=e=n}while(e!==null);bn=6,at=null}function wg(e,t,n,a,u,f,b,S,R){e.cancelPendingCommit=null;do $u();while(Yn!==0);if((St&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Qc,Gl(e,n,f,b,S,R),e===$t&&(at=$t=null,ut=0),ec=t,oi=e,Ea=n,Fd=f,Jd=u,hg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cy(Je,function(){return Cg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null,u=fe.p,fe.p=2,b=St,St|=4;try{by(e,t,n)}finally{St=b,fe.p=u,M.T=a}}Yn=1,kg(),Ng(),Tg()}}function kg(){if(Yn===1){Yn=0;var e=oi,t=ec,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var a=fe.p;fe.p=2;var u=St;St|=4;try{ag(t,e);var f=dh,b=su(e.containerInfo),S=f.focusedElem,R=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&lu(S.ownerDocument.documentElement,S)){if(R!==null&&Gc(S)){var Z=R.start,se=R.end;if(se===void 0&&(se=Z),"selectionStart"in S)S.selectionStart=Z,S.selectionEnd=Math.min(se,S.value.length);else{var ue=S.ownerDocument||document,ee=ue&&ue.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Re=S.textContent.length,Ie=Math.min(R.start,Re),Bt=R.end===void 0?Ie:Math.min(R.end,Re);!ne.extend&&Ie>Bt&&(b=Bt,Bt=Ie,Ie=b);var $=nu(S,Ie),O=nu(S,Bt);if($&&O&&(ne.rangeCount!==1||ne.anchorNode!==$.node||ne.anchorOffset!==$.offset||ne.focusNode!==O.node||ne.focusOffset!==O.offset)){var K=ue.createRange();K.setStart($.node,$.offset),ne.removeAllRanges(),Ie>Bt?(ne.addRange(K),ne.extend(O.node,O.offset)):(K.setEnd(O.node,O.offset),ne.addRange(K))}}}}for(ue=[],ne=S;ne=ne.parentNode;)ne.nodeType===1&&ue.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ue.length;S++){var re=ue[S];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}nf=!!fh,dh=fh=null}finally{St=u,fe.p=a,M.T=n}}e.current=t,Yn=2}}function Ng(){if(Yn===2){Yn=0;var e=oi,t=ec,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var a=fe.p;fe.p=2;var u=St;St|=4;try{eg(e,t.alternate,t)}finally{St=u,fe.p=a,M.T=n}}Yn=3}}function Tg(){if(Yn===4||Yn===3){Yn=0,an();var e=oi,t=ec,n=Ea,a=hg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yn=5:(Yn=0,ec=oi=null,Eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ci=null),cn(n),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(rn,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=M.T,u=fe.p,fe.p=2,M.T=null;try{for(var f=e.onRecoverableError,b=0;b<a.length;b++){var S=a[b];f(S.value,{componentStack:S.stack})}}finally{M.T=t,fe.p=u}}(Ea&3)!==0&&$u(),Xs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Wd?_o++:(_o=0,Wd=e):_o=0,yo(0)}}function Eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wa(t)))}function $u(){return kg(),Ng(),Tg(),Cg()}function Cg(){if(Yn!==5)return!1;var e=oi,t=Fd;Fd=0;var n=cn(Ea),a=M.T,u=fe.p;try{fe.p=32>n?32:n,M.T=null,n=Jd,Jd=null;var f=oi,b=Ea;if(Yn=0,ec=oi=null,Ea=0,(St&6)!==0)throw Error(c(331));var S=St;if(St|=4,ug(f.current),rg(f,f.current,b,n),St=S,yo(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(rn,f)}catch{}return!0}finally{fe.p=u,M.T=a,Eg(e,t)}}function Ag(e,t,n){t=jl(n,t),t=Ad(e.stateNode,t,2),e=ni(e,t,2),e!==null&&(Xn(e,2),Xs(e))}function Dt(e,t,n){if(e.tag===3)Ag(e,e,n);else for(;t!==null;){if(t.tag===3){Ag(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ci===null||!ci.has(a))){e=jl(n,e),n=Mm(2),a=ni(t,n,2),a!==null&&(Rm(n,a,t,e),Xn(a,2),Xs(a));break}}t=t.return}}function th(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new vy;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(Qd=!0,u.add(n),e=Ny.bind(null,e,t,n),t.then(e,e))}function Ny(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$t===e&&(ut&n)===n&&(bn===4||bn===3&&(ut&62914560)===ut&&300>rt()-Hu?(St&2)===0&&tc(e,0):Kd|=n,Pr===ut&&(Pr=0)),Xs(e)}function Mg(e,t){t===0&&(t=tn()),e=Hs(e,t),e!==null&&(Xn(e,t),Xs(e))}function Ty(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mg(e,n)}function Ey(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.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),Mg(e,n)}function Cy(e,t){return en(e,t)}var Xu=null,lc=null,nh=!1,Vu=!1,lh=!1,fi=0;function Xs(e){e!==lc&&e.next===null&&(lc===null?Xu=lc=e:lc=lc.next=e),Vu=!0,nh||(nh=!0,My())}function yo(e,t){if(!lh&&Vu){lh=!0;do for(var n=!1,a=Xu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var b=a.suspendedLanes,S=a.pingedLanes;f=(1<<31-vt(42|e)+1)-1,f&=u&~(b&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Lg(a,f))}else f=ut,f=De(a,a===$t?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||qt(a,f)||(n=!0,Lg(a,f));a=a.next}while(n);lh=!1}}function Ay(){Rg()}function Rg(){Vu=nh=!1;var e=0;fi!==0&&qy()&&(e=fi);for(var t=rt(),n=null,a=Xu;a!==null;){var u=a.next,f=Dg(a,t);f===0?(a.next=null,n===null?Xu=u:n.next=u,u===null&&(lc=n)):(n=a,(e!==0||(f&3)!==0)&&(Vu=!0)),a=u}Yn!==0&&Yn!==5||yo(e),fi!==0&&(fi=0)}function Dg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-vt(f),S=1<<b,R=u[b];R===-1?((S&n)===0||(S&a)!==0)&&(u[b]=Cn(S,t)):R<=t&&(e.expiredLanes|=S),f&=~S}if(t=$t,n=ut,n=De(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Rt===2||Rt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&_n(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||qt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&_n(a),cn(n)){case 2:case 8:n=En;break;case 32:n=Je;break;case 268435456:n=pn;break;default:n=Je}return a=Og.bind(null,e),n=en(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&_n(a),e.callbackPriority=2,e.callbackNode=null,2}function Og(e,t){if(Yn!==0&&Yn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var a=ut;return a=De(e,e===$t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(mg(e,a,t),Dg(e,rt()),e.callbackNode!=null&&e.callbackNode===n?Og.bind(null,e):null)}function Lg(e,t){if($u())return null;mg(e,t,!0)}function My(){Yy(function(){(St&6)!==0?en(Tn,Ay):Rg()})}function sh(){if(fi===0){var e=xa;e===0&&(e=Ue,Ue<<=1,(Ue&261888)===0&&(Ue=256)),fi=e}return fi}function zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Sn(""+e)}function Ug(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ry(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=zg((u[Ve]||null).action),b=a.submitter;b&&(t=(t=b[Ve]||null)?zg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new ia("action","action",null,a,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(fi!==0){var R=b?Ug(u,b):new FormData(u);wd(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(S.preventDefault(),R=b?Ug(u,b):new FormData(u),wd(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var ah=0;ah<Rr.length;ah++){var ih=Rr[ah],Dy=ih.toLowerCase(),Oy=ih[0].toUpperCase()+ih.slice(1);Kl(Dy,"on"+Oy)}Kl(Ki,"onAnimationEnd"),Kl(iu,"onAnimationIteration"),Kl(Xc,"onAnimationStart"),Kl("dblclick","onDoubleClick"),Kl("focusin","onFocus"),Kl("focusout","onBlur"),Kl(ru,"onTransitionRun"),Kl(cu,"onTransitionStart"),Kl(ou,"onTransitionCancel"),Kl(uu,"onTransitionEnd"),Bn("onMouseEnter",["mouseout","mouseover"]),Bn("onMouseLeave",["mouseout","mouseover"]),Bn("onPointerEnter",["pointerout","pointerover"]),Bn("onPointerLeave",["pointerout","pointerover"]),vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vn("onBeforeInput",["compositionend","keypress","textInput","paste"]),vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),Ly=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function Hg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var b=a.length-1;0<=b;b--){var S=a[b],R=S.instance,Z=S.currentTarget;if(S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=Z;try{f(u)}catch(se){Zi(se)}u.currentTarget=null,f=R}else for(b=0;b<a.length;b++){if(S=a[b],R=S.instance,Z=S.currentTarget,S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=Z;try{f(u)}catch(se){Zi(se)}u.currentTarget=null,f=R}}}}function it(e,t){var n=t[on];n===void 0&&(n=t[on]=new Set);var a=e+"__bubble";n.has(a)||(Bg(t,e,2,!1),n.add(a))}function rh(e,t,n){var a=0;t&&(a|=4),Bg(n,e,a,t)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function ch(e){if(!e[Qu]){e[Qu]=!0,Tt.forEach(function(n){n!=="selectionchange"&&(Ly.has(n)||rh(n,!1,e),rh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qu]||(t[Qu]=!0,rh("selectionchange",!1,t))}}function Bg(e,t,n,a){switch(px(t)){case 2:var u=o0;break;case 8:u=u0;break;default:u=Sh}n=u.bind(null,t,n,e),u=void 0,!ul||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function oh(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var b=a.tag;if(b===3||b===4){var S=a.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=a.return;b!==null;){var R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=xt(S),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){a=f=b;continue e}S=S.parentNode}}a=a.return}ie(function(){var Z=f,se=Gt(n),ue=[];e:{var ee=Vc.get(e);if(ee!==void 0){var ne=ia,Re=e;switch(e){case"keypress":if(La(n)===0)break e;case"keydown":case"keyup":ne=ln;break;case"focusin":Re="focus",ne=Li;break;case"focusout":Re="blur",ne=Li;break;case"beforeblur":case"afterblur":ne=Li;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=jr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=ca;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Uc;break;case Ki:case iu:case Xc:ne=oa;break;case uu:ne=In;break;case"scroll":case"scrollend":ne=Qf;break;case"wheel":ne=Bi;break;case"copy":case"cut":case"paste":ne=Zo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Fo;break;case"toggle":case"beforetoggle":ne=Mn}var Ie=(t&4)!==0,Bt=!Ie&&(e==="scroll"||e==="scrollend"),$=Ie?ee!==null?ee+"Capture":null:ee;Ie=[];for(var O=Z,K;O!==null;){var re=O;if(K=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||K===null||$===null||(re=Me(O,$),re!=null&&Ie.push(jo(O,re,K))),Bt)break;O=O.return}0<Ie.length&&(ee=new ne(ee,Re,null,n,se),ue.push({event:ee,listeners:Ie}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ee&&n!==nn&&(Re=n.relatedTarget||n.fromElement)&&(xt(Re)||Re[mn]))break e;if((ne||ee)&&(ee=se.window===se?se:(ee=se.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Re=n.relatedTarget||n.toElement,ne=Z,Re=Re?xt(Re):null,Re!==null&&(Bt=d(Re),Ie=Re.tag,Re!==Bt||Ie!==5&&Ie!==27&&Ie!==6)&&(Re=null)):(ne=null,Re=Z),ne!==Re)){if(Ie=jr,re="onMouseLeave",$="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Ie=Fo,re="onPointerLeave",$="onPointerEnter",O="pointer"),Bt=ne==null?ee:un(ne),K=Re==null?ee:un(Re),ee=new Ie(re,O+"leave",ne,n,se),ee.target=Bt,ee.relatedTarget=K,re=null,xt(se)===Z&&(Ie=new Ie($,O+"enter",Re,n,se),Ie.target=K,Ie.relatedTarget=Bt,re=Ie),Bt=re,ne&&Re)t:{for(Ie=zy,$=ne,O=Re,K=0,re=$;re;re=Ie(re))K++;re=0;for(var Be=O;Be;Be=Ie(Be))re++;for(;0<K-re;)$=Ie($),K--;for(;0<re-K;)O=Ie(O),re--;for(;K--;){if($===O||O!==null&&$===O.alternate){Ie=$;break t}$=Ie($),O=Ie(O)}Ie=null}else Ie=null;ne!==null&&Ig(ue,ee,ne,Ie,!1),Re!==null&&Bt!==null&&Ig(ue,Bt,Re,Ie,!0)}}e:{if(ee=Z?un(Z):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var _t=eu;else if(Bc(ee))if(tu)_t=Wf;else{_t=Ga;var ze=Ff}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?Z&&ke(Z.elementType)&&(_t=eu):_t=Jf;if(_t&&(_t=_t(e,Z))){Ha(ue,_t,n,se);break e}ze&&ze(e,ee,Z),e==="focusout"&&Z&&ee.type==="number"&&Z.memoizedProps.value!=null&&bl(ee,"number",ee.value)}switch(ze=Z?un(Z):window,e){case"focusin":(Bc(ze)||ze.contentEditable==="true")&&(Ya=ze,Yc=Z,Vi=null);break;case"focusout":Vi=Yc=Ya=null;break;case"mousedown":$c=!0;break;case"contextmenu":case"mouseup":case"dragend":$c=!1,Mr(ue,n,se);break;case"selectionchange":if(ed)break;case"keydown":case"keyup":Mr(ue,n,se)}var Fe;if(Cr)e:{switch(e){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}else as?Us(e,n)&&(ft="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ft="onCompositionStart");ft&&(Ii&&n.locale!=="ko"&&(as||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&as&&(Fe=Mi()):(Dl=se,Dc="value"in Dl?Dl.value:Dl.textContent,as=!0)),ze=Ku(Z,ft),0<ze.length&&(ft=new Lc(ft,e,null,n,se),ue.push({event:ft,listeners:ze}),Fe?ft.data=Fe:(Fe=Hc(n),Fe!==null&&(ft.data=Fe)))),(Fe=Po?Ar(e,n):Gi(e,n))&&(ft=Ku(Z,"onBeforeInput"),0<ft.length&&(ze=new Lc("onBeforeInput","beforeinput",null,n,se),ue.push({event:ze,listeners:ft}),ze.data=Fe)),Ry(ue,e,Z,n,se)}Hg(ue,t)})}function jo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ku(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Me(e,n),u!=null&&a.unshift(jo(e,u,f)),u=Me(e,t),u!=null&&a.push(jo(e,u,f))),e.tag===3)return a;e=e.return}return[]}function zy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ig(e,t,n,a,u){for(var f=t._reactName,b=[];n!==null&&n!==a;){var S=n,R=S.alternate,Z=S.stateNode;if(S=S.tag,R!==null&&R===a)break;S!==5&&S!==26&&S!==27||Z===null||(R=Z,u?(Z=Me(n,f),Z!=null&&b.unshift(jo(n,Z,R))):u||(Z=Me(n,f),Z!=null&&b.push(jo(n,Z,R)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var Uy=/\r\n?/g,Hy=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(Uy,`
50
+ `).replace(Hy,"")}function Gg(e,t){return t=qg(t),qg(e)===t}function Ht(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||V(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&V(e,""+a);break;case"className":Qn(e,"class",a);break;case"tabIndex":Qn(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Qn(e,n,a);break;case"style":Le(e,a,f);break;case"data":if(t!=="object"){Qn(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Sn(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Ht(e,t,"name",u.name,u,null),Ht(e,t,"formEncType",u.formEncType,u,null),Ht(e,t,"formMethod",u.formMethod,u,null),Ht(e,t,"formTarget",u.formTarget,u,null)):(Ht(e,t,"encType",u.encType,u,null),Ht(e,t,"method",u.method,u,null),Ht(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Sn(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ot);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Sn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":it("beforetoggle",e),it("toggle",e),ol(e,"popover",a);break;case"xlinkActuate":jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":jn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":jn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":jn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":jn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ol(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=jt.get(n)||n,ol(e,n,a))}}function uh(e,t,n,a,u,f){switch(n){case"style":Le(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?V(e,a):(typeof a=="number"||typeof a=="bigint")&&V(e,""+a);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ot);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ml.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),f=e[Ve]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof a=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,u);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):ol(e,n,a)}}}function al(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ht(e,t,f,b,n,null)}}u&&Ht(e,t,"srcSet",n.srcSet,n,null),a&&Ht(e,t,"src",n.src,n,null);return;case"input":it("invalid",e);var S=f=b=u=null,R=null,Z=null;for(a in n)if(n.hasOwnProperty(a)){var se=n[a];if(se!=null)switch(a){case"name":u=se;break;case"type":b=se;break;case"checked":R=se;break;case"defaultChecked":Z=se;break;case"value":f=se;break;case"defaultValue":S=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Ht(e,t,a,se,n,null)}}bs(e,f,S,R,Z,b,u,!1);return;case"select":it("invalid",e),a=b=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":a=S;default:Ht(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!a,t!=null?Qt(e,!!a,t,!1):n!=null&&Qt(e,!!a,n,!0);return;case"textarea":it("invalid",e),f=u=a=null;for(b in n)if(n.hasOwnProperty(b)&&(S=n[b],S!=null))switch(b){case"value":a=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Ht(e,t,b,S,n,null)}k(e,a,u,f);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(a=n[R],a!=null))switch(R){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ht(e,t,R,a,n,null)}return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(a=0;a<vo.length;a++)it(vo[a],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("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(Z in n)if(n.hasOwnProperty(Z)&&(a=n[Z],a!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ht(e,t,Z,a,n,null)}return;default:if(ke(t)){for(se in n)n.hasOwnProperty(se)&&(a=n[se],a!==void 0&&uh(e,t,se,a,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(a=n[S],a!=null&&Ht(e,t,S,a,n,null))}function By(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,R=null,Z=null,se=null;for(ne in n){var ue=n[ne];if(n.hasOwnProperty(ne)&&ue!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":R=ue;default:a.hasOwnProperty(ne)||Ht(e,t,ne,null,a,ue)}}for(var ee in a){var ne=a[ee];if(ue=n[ee],a.hasOwnProperty(ee)&&(ne!=null||ue!=null))switch(ee){case"type":f=ne;break;case"name":u=ne;break;case"checked":Z=ne;break;case"defaultChecked":se=ne;break;case"value":b=ne;break;case"defaultValue":S=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(c(137,t));break;default:ne!==ue&&Ht(e,t,ee,ne,a,ue)}}xs(e,b,S,R,Z,se,f,u);return;case"select":ne=b=S=ee=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":ne=R;default:a.hasOwnProperty(f)||Ht(e,t,f,null,a,R)}for(u in a)if(f=a[u],R=n[u],a.hasOwnProperty(u)&&(f!=null||R!=null))switch(u){case"value":ee=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==R&&Ht(e,t,u,f,a,R)}t=S,n=b,a=ne,ee!=null?Qt(e,!!n,ee,!1):!!a!=!!n&&(t!=null?Qt(e,!!n,t,!0):Qt(e,!!n,n?[]:"",!1));return;case"textarea":ne=ee=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!a.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ht(e,t,S,null,a,u)}for(b in a)if(u=a[b],f=n[b],a.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":ee=u;break;case"defaultValue":ne=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Ht(e,t,b,u,a,f)}pe(e,ee,ne);return;case"option":for(var Re in n)if(ee=n[Re],n.hasOwnProperty(Re)&&ee!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Ht(e,t,Re,null,a,ee)}for(R in a)if(ee=a[R],ne=n[R],a.hasOwnProperty(R)&&ee!==ne&&(ee!=null||ne!=null))switch(R){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:Ht(e,t,R,ee,a,ne)}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 Ie in n)ee=n[Ie],n.hasOwnProperty(Ie)&&ee!=null&&!a.hasOwnProperty(Ie)&&Ht(e,t,Ie,null,a,ee);for(Z in a)if(ee=a[Z],ne=n[Z],a.hasOwnProperty(Z)&&ee!==ne&&(ee!=null||ne!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:Ht(e,t,Z,ee,a,ne)}return;default:if(ke(t)){for(var Bt in n)ee=n[Bt],n.hasOwnProperty(Bt)&&ee!==void 0&&!a.hasOwnProperty(Bt)&&uh(e,t,Bt,void 0,a,ee);for(se in a)ee=a[se],ne=n[se],!a.hasOwnProperty(se)||ee===ne||ee===void 0&&ne===void 0||uh(e,t,se,ee,a,ne);return}}for(var $ in n)ee=n[$],n.hasOwnProperty($)&&ee!=null&&!a.hasOwnProperty($)&&Ht(e,t,$,null,a,ee);for(ue in a)ee=a[ue],ne=n[ue],!a.hasOwnProperty(ue)||ee===ne||ee==null&&ne==null||Ht(e,t,ue,ee,a,ne)}function Yg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&Yg(b)){for(b=0,S=u.responseEnd,a+=1;a<n.length;a++){var R=n[a],Z=R.startTime;if(Z>S)break;var se=R.transferSize,ue=R.initiatorType;se&&Yg(ue)&&(R=R.responseEnd,b+=se*(R<S?1:(S-Z)/(R-Z)))}if(--a,t+=8*(f+b)/(u.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 fh=null,dh=null;function Zu(e){return e.nodeType===9?e:e.ownerDocument}function $g(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 Xg(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 hh(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 ph=null;function qy(){var e=window.event;return e&&e.type==="popstate"?e===ph?!1:(ph=e,!0):(ph=null,!1)}var Vg=typeof setTimeout=="function"?setTimeout:void 0,Gy=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,Yy=typeof queueMicrotask=="function"?queueMicrotask:typeof Qg<"u"?function(e){return Qg.resolve(null).then(e).catch($y)}:Vg;function $y(e){setTimeout(function(){throw e})}function di(e){return e==="head"}function Kg(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),rc(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")So(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,So(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[Nt]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&So(e.ownerDocument.body);n=u}while(n);rc(t)}function Zg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function mh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":mh(n),Cl(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Xy(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Nt])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!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=us(e.nextSibling),e===null)break}return null}function Vy(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=us(e.nextSibling),e===null))return null;return e}function Fg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=us(e.nextSibling),e===null))return null;return e}function gh(e){return e.data==="$?"||e.data==="$~"}function xh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Qy(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function us(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 bh=null;function Jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return us(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Wg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Pg(e,t,n){switch(t=Zu(n),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 So(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Cl(e)}var fs=new Map,ex=new Set;function Fu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ca=fe.d;fe.d={f:Ky,r:Zy,D:Fy,C:Jy,L:Wy,m:Py,X:t0,S:e0,M:n0};function Ky(){var e=Ca.f(),t=qu();return e||t}function Zy(e){var t=Al(e);t!==null&&t.tag===5&&t.type==="form"?xm(t):Ca.r(e)}var sc=typeof document>"u"?null:document;function tx(e,t,n){var a=sc;if(a&&typeof t=="string"&&t){var u=Kn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),ex.has(u)||(ex.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),al(t,"link",e),We(t),a.head.appendChild(t)))}}function Fy(e){Ca.D(e),tx("dns-prefetch",e,null)}function Jy(e,t){Ca.C(e,t),tx("preconnect",e,t)}function Wy(e,t,n){Ca.L(e,t,n);var a=sc;if(a&&e&&t){var u='link[rel="preload"][as="'+Kn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Kn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Kn(n.imageSizes)+'"]')):u+='[href="'+Kn(e)+'"]';var f=u;switch(t){case"style":f=ac(e);break;case"script":f=ic(e)}fs.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),fs.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(wo(f))||t==="script"&&a.querySelector(ko(f))||(t=a.createElement("link"),al(t,"link",e),We(t),a.head.appendChild(t)))}}function Py(e,t){Ca.m(e,t);var n=sc;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Kn(a)+'"][href="'+Kn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=ic(e)}if(!fs.has(f)&&(e=j({rel:"modulepreload",href:e},t),fs.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ko(f)))return}a=n.createElement("link"),al(a,"link",e),We(a),n.head.appendChild(a)}}}function e0(e,t,n){Ca.S(e,t,n);var a=sc;if(a&&e){var u=At(a).hoistableStyles,f=ac(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=a.querySelector(wo(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=fs.get(f))&&_h(e,n);var R=b=a.createElement("link");We(R),al(R,"link",e),R._p=new Promise(function(Z,se){R.onload=Z,R.onerror=se}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ju(b,t,a)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function t0(e,t){Ca.X(e,t);var n=sc;if(n&&e){var a=At(n).hoistableScripts,u=ic(e),f=a.get(u);f||(f=n.querySelector(ko(u)),f||(e=j({src:e,async:!0},t),(t=fs.get(u))&&yh(e,t),f=n.createElement("script"),We(f),al(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function n0(e,t){Ca.M(e,t);var n=sc;if(n&&e){var a=At(n).hoistableScripts,u=ic(e),f=a.get(u);f||(f=n.querySelector(ko(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=fs.get(u))&&yh(e,t),f=n.createElement("script"),We(f),al(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function nx(e,t,n,a){var u=(u=Ee.current)?Fu(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ac(n.href),n=At(u).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ac(n.href);var f=At(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(wo(e)))&&!f._p&&(b.instance=f,b.state.loading=5),fs.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},fs.set(e,n),f||l0(u,e,n,b.state))),t&&a===null)throw Error(c(528,""));return b}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ic(n),n=At(u).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function ac(e){return'href="'+Kn(e)+'"'}function wo(e){return'link[rel="stylesheet"]['+e+"]"}function lx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function l0(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),al(t,"link",n),We(t),e.head.appendChild(t))}function ic(e){return'[src="'+Kn(e)+'"]'}function ko(e){return"script[async]"+e}function sx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Kn(n.href)+'"]');if(a)return t.instance=a,We(a),a;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),We(a),al(a,"style",u),Ju(a,n.precedence,e),t.instance=a;case"stylesheet":u=ac(n.href);var f=e.querySelector(wo(u));if(f)return t.state.loading|=4,t.instance=f,We(f),f;a=lx(n),(u=fs.get(u))&&_h(a,u),f=(e.ownerDocument||e).createElement("link"),We(f);var b=f;return b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),al(f,"link",a),t.state.loading|=4,Ju(f,n.precedence,e),t.instance=f;case"script":return f=ic(n.src),(u=e.querySelector(ko(f)))?(t.instance=u,We(u),u):(a=n,(u=fs.get(f))&&(a=j({},n),yh(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),We(u),al(u,"link",a),e.head.appendChild(u),t.instance=u);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,Ju(a,n.precedence,e));return t.instance}function Ju(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,b=0;b<a.length;b++){var S=a[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function _h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wu=null;function ax(e,t,n){if(Wu===null){var a=new Map,u=Wu=new Map;u.set(n,a)}else u=Wu,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Nt]||f[Lt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=a.get(b);S?S.push(f):a.set(b,[f])}}return a}function ix(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function s0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;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 rx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a0(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=ac(a.href),f=t.querySelector(wo(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,We(f);return}f=t.ownerDocument||t,a=lx(a),(u=fs.get(u))&&_h(a,u),f=f.createElement("link"),We(f);var b=f;b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),al(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Pu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var vh=0;function i0(e,t){return e.stylesheets&&e.count===0&&tf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&tf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&vh===0&&(vh=62500*Iy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>vh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ef=null;function tf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ef=new Map,t.forEach(r0,e),ef=null,Pu.call(e))}function r0(e,t){if(!(t.state.loading&4)){var n=ef.get(e);if(n)var a=n.get(null);else{n=new Map,ef.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),a=b)}a&&n.set(null,a)}u=t.instance,b=u.getAttribute("data-precedence"),f=n.get(b)||a,f===a&&n.set(null,u),n.set(b,u),this.count++,a=Pu.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var No={$$typeof:B,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function c0(e,t,n,a,u,f,b,S,R){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=$n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$n(0),this.hiddenUpdates=$n(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function cx(e,t,n,a,u,f,b,S,R,Z,se,ue){return e=new c0(e,t,n,b,R,Z,se,ue,S),t=1,f===!0&&(t|=24),f=vl(3,null,null,t),e.current=f,f.stateNode=e,t=Gr(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},no(f),e}function ox(e){return e?(e=Va,e):Va}function ux(e,t,n,a,u,f){u=ox(u),a.context===null?a.context=u:a.pendingContext=u,a=ti(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=ni(e,a,t),n!==null&&(Il(n,e,t),lo(n,e,t))}function fx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jh(e,t){fx(e,t),(e=e.alternate)&&fx(e,t)}function dx(e){if(e.tag===13||e.tag===31){var t=Hs(e,67108864);t!==null&&Il(t,e,67108864),jh(e,67108864)}}function hx(e){if(e.tag===13||e.tag===31){var t=ns();t=Os(t);var n=Hs(e,t);n!==null&&Il(n,e,t),jh(e,t)}}var nf=!0;function o0(e,t,n,a){var u=M.T;M.T=null;var f=fe.p;try{fe.p=2,Sh(e,t,n,a)}finally{fe.p=f,M.T=u}}function u0(e,t,n,a){var u=M.T;M.T=null;var f=fe.p;try{fe.p=8,Sh(e,t,n,a)}finally{fe.p=f,M.T=u}}function Sh(e,t,n,a){if(nf){var u=wh(a);if(u===null)oh(e,t,a,lf,n),mx(e,a);else if(d0(u,e,t,n,a))a.stopPropagation();else if(mx(e,a),t&4&&-1<f0.indexOf(e)){for(;u!==null;){var f=Al(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=be(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var R=1<<31-vt(b);S.entanglements[1]|=R,b&=~R}Xs(f),(St&6)===0&&(Bu=rt()+500,yo(0))}}break;case 31:case 13:S=Hs(f,2),S!==null&&Il(S,f,2),qu(),jh(f,2)}if(f=wh(a),f===null&&oh(e,t,a,lf,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else oh(e,t,a,null,n)}}function wh(e){return e=Gt(e),kh(e)}var lf=null;function kh(e){if(lf=null,e=xt(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return lf=e,null}function px(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(pt()){case Tn:return 2;case En:return 8;case Je:case ct:return 32;case pn:return 268435456;default:return 32}default:return 32}}var Nh=!1,hi=null,pi=null,mi=null,To=new Map,Eo=new Map,gi=[],f0="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 mx(e,t){switch(e){case"focusin":case"focusout":hi=null;break;case"dragenter":case"dragleave":pi=null;break;case"mouseover":case"mouseout":mi=null;break;case"pointerover":case"pointerout":To.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eo.delete(t.pointerId)}}function Co(e,t,n,a,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Al(t),t!==null&&dx(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function d0(e,t,n,a,u){switch(t){case"focusin":return hi=Co(hi,e,t,n,a,u),!0;case"dragenter":return pi=Co(pi,e,t,n,a,u),!0;case"mouseover":return mi=Co(mi,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return To.set(f,Co(To.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,Eo.set(f,Co(Eo.get(f)||null,e,t,n,a,u)),!0}return!1}function gx(e){var t=xt(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,cl(e.priority,function(){hx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,cl(e.priority,function(){hx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);nn=a,n.target.dispatchEvent(a),nn=null}else return t=Al(n),t!==null&&dx(t),e.blockedOn=n,!1;t.shift()}return!0}function xx(e,t,n){sf(e)&&n.delete(t)}function h0(){Nh=!1,hi!==null&&sf(hi)&&(hi=null),pi!==null&&sf(pi)&&(pi=null),mi!==null&&sf(mi)&&(mi=null),To.forEach(xx),Eo.forEach(xx)}function af(e,t){e.blockedOn===t&&(e.blockedOn=null,Nh||(Nh=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,h0)))}var rf=null;function bx(e){rf!==e&&(rf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){rf===e&&(rf=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(kh(a||n)===null)continue;break}var f=Al(n);f!==null&&(e.splice(t,3),t-=3,wd(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function rc(e){function t(R){return af(R,e)}hi!==null&&af(hi,e),pi!==null&&af(pi,e),mi!==null&&af(mi,e),To.forEach(t),Eo.forEach(t);for(var n=0;n<gi.length;n++){var a=gi[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<gi.length&&(n=gi[0],n.blockedOn===null);)gx(n),n.blockedOn===null&&gi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],b=u[Ve]||null;if(typeof f=="function")b||bx(n);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Ve]||null)S=b.formAction;else if(kh(u)!==null)continue}else S=b.action;typeof S=="function"?n[a+1]=S:(n.splice(a,3),a-=3),bx(n)}}}function _x(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){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,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Th(e){this._internalRoot=e}cf.prototype.render=Th.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=ns();ux(n,a,e,t,null,null)},cf.prototype.unmount=Th.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ux(e.current,2,null,e,null,null),qu(),t[mn]=null}};function cf(e){this._internalRoot=e}cf.prototype.unstable_scheduleHydration=function(e){if(e){var t=sa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gi.length&&t!==0&&t<gi[n].priority;n++);gi.splice(n,0,e),n===0&&gx(e)}};var yx=s.version;if(yx!=="19.2.8")throw Error(c(527,yx,"19.2.8"));fe.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?y(e):null,e=e===null?null:e.stateNode,e};var p0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!of.isDisabled&&of.supportsFiber)try{rn=of.inject(p0),kt=of}catch{}}return Mo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Tm,f=Em,b=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=cx(e,1,!1,null,null,n,a,null,u,f,b,_x),e[mn]=t.current,ch(e),new Th(t)},Mo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Tm,b=Em,S=Cm,R=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=cx(e,1,!0,t,n??null,a,u,R,f,b,S,_x),t.context=ox(null),n=t.current,a=ns(),a=Os(a),u=ti(a),u.callback=null,ni(n,u,a),n=a,t.current.lanes=n,Xn(t,n),Xs(t),e[mn]=t.current,ch(e),new cf(t)},Mo.version="19.2.8",Mo}var Mx;function N0(){if(Mx)return Mh.exports;Mx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Mh.exports=k0(),Mh.exports}var T0=N0();const n_=1;function E0(l){return`${l.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${l_(l)}`}function C0(l){const s=l.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${s.replace(/^-+|-+$/g,"")||"project"}-${l_(l)}`,c=E0(l);return[s,r].filter(o=>o!==c)}function l_(l){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(l);return A0(s?l.toLowerCase():l)}function A0(l){let s=3735928559,r=1103547991;for(let c=0;c<l.length;c++){const o=l.charCodeAt(c);s=Math.imul(s^o,2654435761),r=Math.imul(r^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&r)+(s>>>0)).toString(36)}var Ra,vc,jc,Sc,wc,Qo,kc,Gf,s_;class M0{constructor(s){dn(this,Gf);dn(this,Ra,null);dn(this,vc,new Set);dn(this,jc,500);dn(this,Sc,null);dn(this,wc,!1);dn(this,Qo,null);dn(this,kc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){wt(this,kc,s)}connect(){if(qe(this,wc))return;const s=new WebSocket(this.url);wt(this,Ra,s),s.addEventListener("open",()=>{var r,c;wt(this,jc,500),this.send({type:"hello",protocol:n_,clientName:"ccv-web"}),(r=qe(this,Qo))==null||r.call(this),(c=qe(this,kc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of qe(this,vc))o(c)}),s.addEventListener("close",()=>{var r;wt(this,Ra,null),(r=qe(this,kc))==null||r.call(this),Un(this,Gf,s_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){wt(this,Qo,s)}on(s){return qe(this,vc).add(s),()=>qe(this,vc).delete(s)}send(s){var r;((r=qe(this,Ra))==null?void 0:r.readyState)===WebSocket.OPEN&&qe(this,Ra).send(JSON.stringify(s))}get connected(){var s;return((s=qe(this,Ra))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;wt(this,wc,!0),(s=qe(this,Ra))==null||s.close()}}Ra=new WeakMap,vc=new WeakMap,jc=new WeakMap,Sc=new WeakMap,wc=new WeakMap,Qo=new WeakMap,kc=new WeakMap,Gf=new WeakSet,s_=function(){if(qe(this,wc)||qe(this,Sc)!==null)return;const s=qe(this,jc);wt(this,jc,Math.min(s*2,1e4)),wt(this,Sc,window.setTimeout(()=>{wt(this,Sc,null),this.connect()},s))};const R0=1,a_="ccv:relay",Cf="ccv:relay.host";function D0(){try{const l=localStorage.getItem(a_);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function i_(){localStorage.removeItem(a_)}var Ps,Nc,ea,Tc,Ec,Ni,fr,dr,Ti,hr,Cc,pr,mr,Wt,yi,tp,r_,or,np;class O0{constructor(s){dn(this,Wt);dn(this,Ps,null);dn(this,Nc,new Set);dn(this,ea,null);dn(this,Tc,null);dn(this,Ec,500);dn(this,Ni,null);dn(this,fr,!1);dn(this,dr,!1);dn(this,Ti,!1);dn(this,hr,null);dn(this,Cc,"Подключаемся…");dn(this,pr,0);dn(this,mr,[]);this.session=s}get connected(){return qe(this,dr)&&qe(this,Ti)}get statusText(){return qe(this,Cc)}get hostId(){return qe(this,hr)}on(s){return qe(this,Nc).add(s),()=>qe(this,Nc).delete(s)}onReconnect(s){wt(this,Tc,s)}onStatus(s){wt(this,ea,s)}connect(){qe(this,fr)||Un(this,Wt,tp).call(this)}send(s){if(!qe(this,dr)){qe(this,mr).length<64&&qe(this,mr).push(s);return}Un(this,Wt,or).call(this,{t:"client.frame",body:s})}close(){var s;wt(this,fr,!0),qe(this,Ni)!==null&&window.clearTimeout(qe(this,Ni)),(s=qe(this,Ps))==null||s.close()}}Ps=new WeakMap,Nc=new WeakMap,ea=new WeakMap,Tc=new WeakMap,Ec=new WeakMap,Ni=new WeakMap,fr=new WeakMap,dr=new WeakMap,Ti=new WeakMap,hr=new WeakMap,Cc=new WeakMap,pr=new WeakMap,mr=new WeakMap,Wt=new WeakSet,yi=function(s){var r;qe(this,Cc)!==s&&(wt(this,Cc,s),(r=qe(this,ea))==null||r.call(this))},tp=async function(){if(qe(this,Ps))return;if(!qe(this,hr))try{wt(this,hr,await L0(this.session.token))}catch(c){Un(this,Wt,yi).call(this,c instanceof Error?c.message:String(c)),Un(this,Wt,np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);wt(this,Ps,r),r.addEventListener("open",()=>{Un(this,Wt,or).call(this,{t:"client.hello",protocol:R0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Un(this,Wt,r_).call(this,o)}),r.addEventListener("close",()=>{var c;wt(this,Ps,null),wt(this,dr,!1),wt(this,Ti,!1),Un(this,Wt,yi).call(this,"Нет связи с сервером"),(c=qe(this,ea))==null||c.call(this),Un(this,Wt,np).call(this)}),r.addEventListener("error",()=>r.close())},r_=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":wt(this,Ec,500),Un(this,Wt,or).call(this,{t:"client.attach",hostId:qe(this,hr)??"",...qe(this,pr)>0?{sinceRseq:qe(this,pr)}:{}});return;case"client.attached":wt(this,dr,!0),wt(this,Ti,s.online),wt(this,pr,s.rseq),Un(this,Wt,yi).call(this,s.online?"Хост на связи":"Компьютер не на связи"),Un(this,Wt,or).call(this,{t:"client.frame",body:{type:"hello",protocol:n_,clientName:"ccv-web-relay"}});const x=qe(this,mr);wt(this,mr,[]);for(const y of x)Un(this,Wt,or).call(this,{t:"client.frame",body:y});(r=qe(this,Tc))==null||r.call(this),(c=qe(this,ea))==null||c.call(this);return;case"host.frame":{s.rseq>0&&wt(this,pr,s.rseq);const y=s.body;for(const j of qe(this,Nc))j(y);return}case"host.online":wt(this,Ti,!0),Un(this,Wt,yi).call(this,"Хост на связи"),(o=qe(this,Tc))==null||o.call(this),(d=qe(this,ea))==null||d.call(this);return;case"host.offline":wt(this,Ti,!1),Un(this,Wt,yi).call(this,"Компьютер не на связи"),(h=qe(this,ea))==null||h.call(this);return;case"ping":Un(this,Wt,or).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){i_(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Cf),Un(this,Wt,yi).call(this,"Этот компьютер отвязан от аккаунта"),wt(this,fr,!0),(m=qe(this,Ps))==null||m.close();return}s.code!=="offline"&&Un(this,Wt,yi).call(this,s.message),(g=qe(this,ea))==null||g.call(this);return}},or=function(s){var r;((r=qe(this,Ps))==null?void 0:r.readyState)===WebSocket.OPEN&&qe(this,Ps).send(JSON.stringify(s))},np=function(){if(qe(this,fr)||qe(this,Ni)!==null)return;const s=qe(this,Ec);wt(this,Ec,Math.min(s*2,1e4)),wt(this,Ni,window.setTimeout(()=>{wt(this,Ni,null),Un(this,Wt,tp).call(this)},s))};async function L0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Cf,s),s;const r=localStorage.getItem(Cf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw i_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Cf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Af(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const z0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function U0(){if(Af()==="local")return new M0(z0);const l=D0();return l?new O0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const c_="ccv:drafts",H0=40,B0=2e4,I0=500;let Go=null,Yo=null;function xp(){if(Go)return Go;const l=new Map;try{const s=localStorage.getItem(c_);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return Go=l,window.addEventListener("pagehide",f_),l}function Lh(l){return xp().get(l)??""}function o_(l,s){const r=xp(),c=s.slice(0,B0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>H0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Y0(),G0()}function u_(){const l=new Set;for(const s of xp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const lp=new Set;let Rx="";function q0(l){return lp.add(l),()=>lp.delete(l)}function G0(){const l=u_(),s=l.join(`
51
+ `);if(s!==Rx){Rx=s;for(const r of lp)r(l)}}function Y0(){Yo===null&&(Yo=window.setTimeout(f_,I0))}function f_(){if(Yo!==null&&window.clearTimeout(Yo),Yo=null,!!Go)try{localStorage.setItem(c_,JSON.stringify(Object.fromEntries(Go)))}catch{}}const kl={items:[],pending:[],lastSeq:0,contextTokens:null},zh={entries:[],total:0,loading:!1};function d_(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Dx(l){return l.total>0&&d_(l)>1}function $0(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:s.total,loading:!1}}function X0(l){return Mf(kl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Mf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...V0(r,c.event,c.seq),lastSeq:c.seq});return r}function V0(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return Vs(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Vs(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return cc(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?Vs(l,m):cc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Vs(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return cc(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?Vs(l,m):cc(l,h,m)}case"tool.use":return Vs(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return cc(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return cc({...l,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:Vs({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return Vs({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=s.usage)==null?void 0:d.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:Vs(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Vs(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Q0(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function K0(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let d=0;d<l.length;d++)if(l[d].kind==="user"){if(o===c)return l.slice(0,d);o++}return l}function Vs(l,s){return{...l,items:[...l.items,s]}}function cc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const sp="ccv:theme",Uh=["system","light","dark"];function Z0(){const[l,s]=_.useState(F0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=_.useCallback(o=>{try{localStorage.setItem(sp,o)}catch{}s(o)},[]),c=_.useCallback(()=>{s(o=>{const d=Uh[(Uh.indexOf(o)+1)%Uh.length];try{localStorage.setItem(sp,d)}catch{}return d})},[]);return[l,r,c]}function F0(){try{const l=localStorage.getItem(sp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const h_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],J0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],gr={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:"вопроса"}},W0=320,p_="ccv:panes";function P0(l){return`--${l}-w`}function m_(l,s){const r=gr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function ev(){const l={};for(const s of Object.keys(gr))l[s]=gr[s].width;try{const s=localStorage.getItem(p_);if(s){const r=JSON.parse(s);for(const c of Object.keys(gr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=m_(c,o))}}}catch{}return l}function tv(){const[l,s]=_.useState(ev),r=_.useCallback(h=>{try{localStorage.setItem(p_,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,m)=>{s(g=>{const x=m_(h,m);if(g[h]===x)return g;const y={...g,[h]:x};return r(y),y})},[r]),o=_.useCallback(h=>{s(m=>{const g={...m,[h]:gr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(gr))d[P0(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Hh=260,g_=120,nv=200,Ox="ccv:terminal-h";function Lx(l,s){return Math.round(Math.min(s,Math.max(g_,l)))}function lv(){const[l,s]=_.useState(()=>{try{const d=localStorage.getItem(Ox);if(d){const h=Number(d);if(Number.isFinite(h))return Lx(h,1/0)}}catch{}return Hh}),r=_.useCallback(d=>{try{localStorage.setItem(Ox,String(d))}catch{}},[]),c=_.useCallback((d,h)=>{const m=Lx(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=_.useCallback(()=>{s(Hh),r(Hh)},[r]);return{height:l,setHeight:c,reset:o}}function Yf(l){const[s,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return _.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const sv=500,av=6;function x_({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=sv,moveCancelPx:o=av}){const d=_.useRef(null),[h,m]=_.useState(!1),g=_.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),x=_.useCallback(T=>{if(r||T.button!==0)return;const A={timer:0,x:T.clientX,y:T.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,m(!1),l()},c),d.current=A,m(!0)},[r,c,l]),y=_.useCallback(T=>{const A=d.current;!A||A.fired||Math.hypot(T.clientX-A.x,T.clientY-A.y)>o&&g()},[o,g]),j=_.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=_.useCallback(T=>{var A;if((A=d.current)!=null&&A.fired){d.current=null,T.preventDefault();return}if(!r){if(T.shiftKey){l();return}s()}},[r,s,l]),C=_.useCallback(T=>{T.preventDefault()},[]),N=_.useCallback(T=>{r||T.shiftKey&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:C,onKeyDown:N}}}const iv={height:0,offsetTop:0,offsetLeft:0};function zx(){if(typeof window>"u")return iv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function rv(l){const[s,r]=_.useState(zx);return _.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=zx();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};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))},[l]),s}function bp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yr=bp();function b_(l){yr=l}var ur={exec:()=>null};function oc(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function gt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(ml.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var cv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),ml={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:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:oc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:oc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:oc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:oc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:oc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:oc(l=>new RegExp(`^ {0,${l}}>`))},ov=/^(?:[ \t]*(?:\n|$))+/,uv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ko=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,__=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,y_=gt(__).replace(/bull/g,_p).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(),hv=gt(__).replace(/bull/g,_p).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(),yp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,pv=/^[^\n]+/,vp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mv=gt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gv=gt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_p).getRegex(),$f="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",jp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xv=gt("^ {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",jp).replace("tag",$f).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v_=l=>gt(yp).replace("hr",Ko).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",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$f).getRegex(),bv=v_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),_v=v_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),yv=gt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_v).getRegex(),Sp={blockquote:yv,code:uv,def:mv,fences:fv,heading:dv,hr:Ko,html:xv,lheading:y_,list:gv,newline:ov,paragraph:bv,table:ur,text:pv},Ux=gt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ko).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$f).getRegex(),vv={...Sp,lheading:hv,table:Ux,paragraph:gt(yp).replace("hr",Ko).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ux).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$f).getRegex()},jv={...Sp,html:gt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jp).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:ur,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:gt(yp).replace("hr",Ko).replace("heading",` *#{1,6} *[^
52
+ ]`).replace("lheading",y_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,j_=/^( {2,}|\\)\n(?!\s*$)/,kv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Mc=/[\p{P}\p{S}]/u,Xf=/[\s\p{P}\p{S}]/u,wp=/[^\s\p{P}\p{S}]/u,Nv=gt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xf).getRegex(),S_=/(?!~)[\p{P}\p{S}]/u,Tv=/(?!~)[\s\p{P}\p{S}]/u,Ev=/(?:[^\s\p{P}\p{S}]|~)/u,Cv=gt(/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(),w_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Av=gt(w_,"u").replace(/punct/g,Mc).getRegex(),Mv=gt(w_,"u").replace(/punct/g,S_).getRegex(),k_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rv=gt(k_,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Xf).replace(/punct/g,Mc).getRegex(),Dv=gt(k_,"gu").replace(/notPunctSpace/g,Ev).replace(/punctSpace/g,Tv).replace(/punct/g,S_).getRegex(),Ov=gt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Xf).replace(/punct/g,Mc).getRegex(),Lv=gt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Mc).getRegex(),zv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Uv=gt(zv,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Xf).replace(/punct/g,Mc).getRegex(),Hv=gt(/\\(punct)/,"gu").replace(/punct/g,Mc).getRegex(),Bv=gt(/^<(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(),Iv=gt(jp).replace("(?:-->|$)","-->").getRegex(),qv=gt("^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",Iv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Of=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Gv=gt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Of).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),N_=gt(/^!?\[(label)\]\[(ref)\]/).replace("label",Of).replace("ref",vp).getRegex(),T_=gt(/^!?\[(ref)\](?:\[\])?/).replace("ref",vp).getRegex(),Yv=gt("reflink|nolink(?!\\()","g").replace("reflink",N_).replace("nolink",T_).getRegex(),Hx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kp={_backpedal:ur,anyPunctuation:Hv,autolink:Bv,blockSkip:Cv,br:j_,code:wv,del:ur,delLDelim:ur,delRDelim:ur,emStrongLDelim:Av,emStrongRDelimAst:Rv,emStrongRDelimUnd:Ov,escape:Sv,link:Gv,nolink:T_,punctuation:Nv,reflink:N_,reflinkSearch:Yv,tag:qv,text:kv,url:ur},$v={...kp,link:gt(/^!?\[(label)\]\((.*?)\)/).replace("label",Of).getRegex(),reflink:gt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Of).getRegex()},ap={...kp,emStrongRDelimAst:Dv,emStrongLDelim:Mv,delLDelim:Lv,delRDelim:Uv,url:gt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hx).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:gt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Hx).getRegex()},Xv={...ap,br:gt(j_).replace("{2,}","*").getRegex(),text:gt(ap.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uf={normal:Sp,gfm:vv,pedantic:jv},Ro={normal:kp,gfm:ap,breaks:Xv,pedantic:$v},Vv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Bx=l=>Vv[l];function Fs(l,s){if(s){if(ml.escapeTest.test(l))return l.replace(ml.escapeReplace,Bx)}else if(ml.escapeTestNoEncode.test(l))return l.replace(ml.escapeReplaceNoEncode,Bx);return l}function Ix(l){try{l=encodeURI(l).replace(ml.percentDecode,"%")}catch{return null}return l}function qx(l,s){var d;let r=l.replace(ml.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(ml.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(ml.slashPipe,"|");return c}function bi(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function Gx(l){let s=l.split(`
53
+ `),r=s.length-1;for(;r>=0&&ml.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
+ `)}function Qv(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function Kv(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Yx(l,s,r,c,o){let d=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Zv(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
55
+ `).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
56
+ `)}var Lf=class{constructor(l){It(this,"options");It(this,"rules");It(this,"lexer");this.options=l||yr}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:Gx(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=Zv(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=bi(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:bi(s[0],`
57
+ `),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:bi(s[0],`
58
+ `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=bi(s[0],`
59
+ `).split(`
60
+ `),c="",o="",d=[];for(;r.length>0;){let h=!1,m=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))m.push(r[g]),h=!0;else if(!h)m.push(r[g]);else break;r=r.slice(g);let x=m.join(`
61
+ `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
62
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
63
+ ${x}`:x,o=o?`${o}
64
+ ${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,d,!0),this.lexer.state.top=j,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let C=v,N=C.raw+`
65
+ `+r.join(`
66
+ `),T=this.blockquote(N);d[d.length-1]=T,c=c.substring(0,c.length-C.raw.length)+T.raw,o=o.substring(0,o.length-C.text.length)+T.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,N=C.raw+`
67
+ `+r.join(`
68
+ `),T=this.list(N);d[d.length-1]=T,c=c.substring(0,c.length-v.raw.length)+T.raw,o=o.substring(0,o.length-C.raw.length)+T.raw,r=N.substring(d.at(-1).raw.length).split(`
69
+ `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[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 d=this.rules.other.listItemRegex(r),h=!1;for(;l;){let g=!1,x="",y="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;x=s[0],l=l.substring(x.length);let j=Kv(s[2].split(`
70
+ `,1)[0],s[1].length),v=l.split(`
71
+ `,1)[0],C=!j.trim(),N=0;if(this.options.pedantic?(N=2,y=j.trimStart()):C?N=s[1].length+1:(N=j.search(this.rules.other.nonSpaceChar),N=N>4?1:N,y=j.slice(N),N+=s[1].length),C&&this.rules.other.blankLine.test(v)&&(x+=v+`
72
+ `,l=l.substring(v.length+1),g=!0),!g){let T=this.rules.other.nextBulletRegex(N),A=this.rules.other.hrRegex(N),G=this.rules.other.fencesBeginRegex(N),F=this.rules.other.headingBeginRegex(N),B=this.rules.other.htmlBeginRegex(N),D=this.rules.other.blockquoteBeginRegex(N);for(;l;){let J=l.split(`
73
+ `,1)[0],H;if(v=J,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),H=v):H=v.replace(this.rules.other.tabCharGlobal," "),G.test(v)||F.test(v)||B.test(v)||D.test(v)||T.test(v)||A.test(v))break;if(H.search(this.rules.other.nonSpaceChar)>=N||!v.trim())y+=`
74
+ `+H.slice(N);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(j)||F.test(j)||A.test(j))break;y+=`
75
+ `+v}C=!v.trim(),x+=J+`
76
+ `,l=l.substring(J.length+1),j=H.slice(N)}}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(y),loose:!1,text:y,tokens:[]}),o.raw+=x}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let 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 y=this.rules.other.listTaskCheckbox.exec(g.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[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 y=g.tokens.filter(v=>v.type==="space"),j=y.length>0&&y.some(v=>this.rules.other.anyLine.test(v.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(l){let s=this.rules.block.html.exec(l);if(s){let r=Gx(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:bi(s[0],`
77
+ `),href:c,title:o}}}table(l){var h;let s=this.rules.block.table.exec(l);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let r=qx(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
78
+ `):[],d={type:"table",raw:bi(s[0],`
79
+ `),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(qx(m,d.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[x]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:bi(s[0],`
80
+ `),depth:s[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(l){let s=this.rules.block.paragraph.exec(l);if(s){let r=s[1].charAt(s[1].length-1)===`
81
+ `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=bi(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Qv(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Yx(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Yx(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);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,d,h,m=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*l.length+o);(c=x.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let y=[...c[0]][0].length,j=l.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let C=j.slice(1,-1);return{type:"em",raw:j,text:C,tokens:this.lexer.inlineTokens(C)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[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:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,s=s.slice(-1*l.length+o);(c=g.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let x=[...c[0]][0].length,y=l.slice(0,o+c.index+x+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let d;do d=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(d!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},As=class ip{constructor(s){It(this,"tokens");It(this,"options");It(this,"state");It(this,"inlineQueue");It(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||yr,this.options.tokenizer=this.options.tokenizer||new Lf,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:ml,block:uf.normal,inline:Ro.normal};this.options.pedantic?(r.block=uf.pedantic,r.inline=Ro.pedantic):this.options.gfm&&(r.block=uf.gfm,this.options.breaks?r.inline=Ro.breaks:r.inline=Ro.gfm),this.tokenizer.rules=r}static get rules(){return{block:uf,inline:Ro}}static lex(s,r){return new ip(r).lex(s)}static lexInline(s,r){return new ip(r).inlineTokens(s)}lex(s){s=s.replace(ml.carriageReturn,`
82
+ `),this.blockTokens(s,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(s,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(ml.tabCharGlobal," ").replace(ml.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(g=y.call({lexer:this},s,r))?(s=s.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.substring(g.raw.length);let y=r.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
83
+ `:r.push(g);continue}if(g=this.tokenizer.code(s)){s=s.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
84
+ `)?"":`
85
+ `)+g.raw,y.text+=`
86
+ `+g.text,this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(g=this.tokenizer.fences(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(s)){s=s.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
87
+ `)?"":`
88
+ `)+g.raw,y.text+=`
89
+ `+g.raw,this.inlineQueue.at(-1).src=y.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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),r.push(g);continue}let x=s;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=s.slice(1),v;this.options.extensions.startBlock.forEach(C=>{v=C.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=s.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){let y=r.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
90
+ `)?"":`
91
+ `)+g.raw,y.text+=`
92
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g),c=x.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
93
+ `)?"":`
94
+ `)+g.raw,y.text+=`
95
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,x,y,j;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,C=>v.includes(C.slice(C.lastIndexOf("[")+1,-1))?"["+"a".repeat(C.length-2)+"]":C))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,C,N)=>{let T=N?N.length:0;return v.slice(0,T)+"["+"a".repeat(v.length-T-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(N=>(v=N.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let N=r.at(-1);v.type==="text"&&(N==null?void 0:N.type)==="text"?(N.raw+=v.raw,N.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let C=s;if((j=this.options.extensions)!=null&&j.startInline){let N=1/0,T=s.slice(1),A;this.options.extensions.startInline.forEach(G=>{A=G.call({lexer:this},T),typeof A=="number"&&A>=0&&(N=Math.min(N,A))}),N<1/0&&N>=0&&(C=s.substring(0,N+1))}if(v=this.tokenizer.inlineText(C)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let N=r.at(-1);(N==null?void 0:N.type)==="text"?(N.raw+=v.raw,N.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},zf=class{constructor(l){It(this,"options");It(this,"parser");this.options=l||yr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(ml.notSpaceStart))==null?void 0:d[0],o=l.replace(ml.endingNewline,"")+`
96
+ `;return c?'<pre><code class="language-'+Fs(c)+'">'+(r?o:Fs(o,!0))+`</code></pre>
97
+ `:"<pre><code>"+(r?o:Fs(o,!0))+`</code></pre>
98
+ `}blockquote({tokens:l}){return`<blockquote>
99
+ ${this.parser.parse(l)}</blockquote>
100
+ `}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:s}){return`<h${s}>${this.parser.parseInline(l)}</h${s}>
101
+ `}hr(l){return`<hr>
102
+ `}list(l){let s=l.ordered,r=l.start,c="";for(let h=0;h<l.items.length;h++){let m=l.items[h];c+=this.listitem(m)}let o=s?"ol":"ul",d=s&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
103
+ `+c+"</"+o+`>
104
+ `}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
105
+ `}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
106
+ `}table(l){let s="",r="";for(let o=0;o<l.header.length;o++)r+=this.tablecell(l.header[o]);s+=this.tablerow({text:r});let c="";for(let o=0;o<l.rows.length;o++){let d=l.rows[o];r="";for(let h=0;h<d.length;h++)r+=this.tablecell(d[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
107
+ <thead>
108
+ `+s+`</thead>
109
+ `+c+`</table>
110
+ `}tablerow({text:l}){return`<tr>
111
+ ${l}</tr>
112
+ `}tablecell(l){let s=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+s+`</${r}>
113
+ `}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Fs(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=Ix(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+Fs(s)+'"'),d+=">"+c+"</a>",d}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Ix(l);if(o===null)return Fs(r);l=o;let d=`<img src="${l}" alt="${Fs(r)}"`;return s&&(d+=` title="${Fs(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Fs(l.text)}},Np=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Ms=class rp{constructor(s){It(this,"options");It(this,"renderer");It(this,"textRenderer");this.options=s||yr,this.options.renderer=this.options.renderer||new zf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Np}static parse(s,r){return new rp(r).parse(s)}static parseInline(s,r){return new rp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[d];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 m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(s,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=x||"";continue}}let g=m;switch(g.type){case"escape":{c+=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}},Ef,Io=(Ef=class{constructor(l){It(this,"options");It(this,"block");this.options=l||yr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?As.lex:As.lexInline}provideParser(l=this.block){return l?Ms.parse:Ms.parseInline}},It(Ef,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),It(Ef,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ef),Fv=class{constructor(...l){It(this,"defaults",bp());It(this,"options",this.setOptions);It(this,"parse",this.parseMarkdown(!0));It(this,"parseInline",this.parseMarkdown(!1));It(this,"Parser",Ms);It(this,"Renderer",zf);It(this,"TextRenderer",Np);It(this,"Lexer",As);It(this,"Tokenizer",Lf);It(this,"Hooks",Io);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let d of l)switch(r=r.concat(s.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,s));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.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 d=s.renderers[o.name];d?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=s[o.level];d?d.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new zf(this.defaults);for(let d in r.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=r.renderer[h],g=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Lf(this.defaults);for(let d in r.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=r.tokenizer[h],g=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Io;for(let d in r.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=r.hooks[h],g=o[h];Io.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Io.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,x);return g.call(o,j)})();let y=m.call(o,x);return g.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,x);return j===!1&&(j=await g.apply(o,x)),j})();let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return As.lex(l,s??this.defaults)}parser(l,s){return Ms.parse(l,s??this.defaults)}parseMarkdown(l){return(s,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?As.lex:As.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(l):l?Ms.parse:Ms.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?As.lex:As.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Ms.parse:Ms.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(l,s){return r=>{if(r.message+=`
114
+ Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+Fs(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},_r=new Fv;function Ct(l,s){return _r.parse(l,s)}Ct.options=Ct.setOptions=function(l){return _r.setOptions(l),Ct.defaults=_r.defaults,b_(Ct.defaults),Ct};Ct.getDefaults=bp;Ct.defaults=yr;Ct.use=function(...l){return _r.use(...l),Ct.defaults=_r.defaults,b_(Ct.defaults),Ct};Ct.walkTokens=function(l,s){return _r.walkTokens(l,s)};Ct.parseInline=_r.parseInline;Ct.Parser=Ms;Ct.parser=Ms.parse;Ct.Renderer=zf;Ct.TextRenderer=Np;Ct.Lexer=As;Ct.lexer=As.lex;Ct.Tokenizer=Lf;Ct.Hooks=Io;Ct.parse=Ct;Ct.options;Ct.setOptions;Ct.use;Ct.walkTokens;Ct.parseInline;Ms.parse;As.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 $x(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function Jv(l){if(Array.isArray(l))return l}function Wv(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,x=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(y){x=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function Pv(){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 e1(l,s){return Jv(l)||Wv(l,s)||t1(l,s)||Pv()}function t1(l,s){if(l){if(typeof l=="string")return $x(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$x(l,s):void 0}}const E_=Object.entries,Xx=Object.setPrototypeOf,n1=Object.isFrozen,l1=Object.getPrototypeOf,s1=Object.getOwnPropertyDescriptor;let il=Object.freeze,rl=Object.seal,mc=Object.create,C_=typeof Reflect<"u"&&Reflect,cp=C_.apply,op=C_.construct;il||(il=function(s){return s});rl||(rl=function(s){return s});cp||(cp=function(s,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return s.apply(r,o)});op||(op=function(s){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 s(...c)});const uc=Hn(Array.prototype.forEach),a1=Hn(Array.prototype.lastIndexOf),Vx=Hn(Array.prototype.pop),fc=Hn(Array.prototype.push),i1=Hn(Array.prototype.splice),wi=Array.isArray,qo=Hn(String.prototype.toLowerCase),Bh=Hn(String.prototype.toString),Qx=Hn(String.prototype.match),Do=Hn(String.prototype.replace),Kx=Hn(String.prototype.indexOf),r1=Hn(String.prototype.trim),c1=Hn(Number.prototype.toString),o1=Hn(Boolean.prototype.toString),Zx=typeof BigInt>"u"?null:Hn(BigInt.prototype.toString),Fx=typeof Symbol>"u"?null:Hn(Symbol.prototype.toString),Wn=Hn(Object.prototype.hasOwnProperty),Oo=Hn(Object.prototype.toString),Jn=Hn(RegExp.prototype.test),ir=u1(TypeError);function Hn(l){return function(s){s instanceof RegExp&&(s.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 cp(l,s,c)}}function u1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return op(l,r)}}function mt(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qo;if(Xx&&Xx(l,null),!wi(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(n1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function f1(l){for(let s=0;s<l.length;s++)Wn(l,s)||(l[s]=null);return l}function Nl(l){const s=mc(null);for(const c of E_(l)){var r=e1(c,2);const o=r[0],d=r[1];Wn(l,o)&&(wi(d)?s[o]=f1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=Nl(d):s[o]=d)}return s}function d1(l){switch(typeof l){case"string":return l;case"number":return c1(l);case"boolean":return o1(l);case"bigint":return Zx?Zx(l):"0";case"symbol":return Fx?Fx(l):"Symbol()";case"undefined":return Oo(l);case"function":case"object":{if(l===null)return Oo(l);const s=l,r=Js(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Oo(c)}return Oo(l)}default:return Oo(l)}}function Js(l,s){for(;l!==null;){const c=s1(l,s);if(c){if(c.get)return Hn(c.get);if(typeof c.value=="function")return Hn(c.value)}l=l1(l)}function r(){return null}return r}function h1(l){try{return Jn(l,""),!0}catch{return!1}}const Jx=il(["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"]),Ih=il(["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"]),qh=il(["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"]),p1=il(["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"]),Gh=il(["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"]),m1=il(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wx=il(["#text"]),Px=il(["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"]),Yh=il(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),eb=il(["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"]),ff=il(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g1=rl(/{{[\w\W]*|^[\w\W]*}}/g),x1=rl(/<%[\w\W]*|^[\w\W]*%>/g),b1=rl(/\${[\w\W]*/g),_1=rl(/^data-[\-\w.\u00B7-\uFFFF]+$/),y1=rl(/^aria-[\-\w]+$/),tb=rl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),v1=rl(/^(?:\w+script|data):/i),j1=rl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),S1=rl(/^html$/i),w1=rl(/^[a-z][.\w]*(-[.\w]+)+$/i),nb=rl(/<[/\w!]/g),lb=rl(/<[/\w]/g),k1=rl(/<\/no(script|embed|frames)/i),N1=rl(/\/>/i),ls={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},T1=function(){return typeof window>"u"?null:window},E1=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},sb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_i=function(s,r,c,o){return Wn(s,r)&&wi(s[r])?mt(o.base?Nl(o.base):{},s[r],o.transform):c};function A_(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T1();const s=pe=>A_(pe);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==ls.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const d=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,x=l.NamedNodeMap;x===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const y=l.DOMParser,j=l.trustedTypes,v=m.prototype,C=Js(v,"cloneNode"),N=Js(v,"remove"),T=Js(v,"nextSibling"),A=Js(v,"childNodes"),G=Js(v,"parentNode"),F=Js(v,"shadowRoot"),B=Js(v,"attributes"),D=h&&h.prototype?Js(h.prototype,"nodeType"):null,J=h&&h.prototype?Js(h.prototype,"nodeName"):null;if(typeof d=="function"){const pe=r.createElement("template");pe.content&&pe.content.ownerDocument&&(r=pe.content.ownerDocument)}let H,z="",I,Y=!1,ae=0;const W=function(){if(ae>0)throw ir('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.')},ce=function(k){W(),ae++;try{return H.createHTML(k)}finally{ae--}},ye=function(k){W(),ae++;try{return H.createScriptURL(k)}finally{ae--}},Oe=function(){return Y||(I=E1(j,o),Y=!0),I},we=r,M=we.implementation,fe=we.createNodeIterator,L=we.createDocumentFragment,xe=we.getElementsByTagName,je=c.importNode;let E=sb();s.isSupported=typeof E_=="function"&&typeof G=="function"&&M&&M.createHTMLDocument!==void 0;const X=g1,oe=x1,me=b1,Te=_1,Ee=y1,Ae=v1,nt=j1,Xe=w1;let dt=tb,Ge=null;const Ot=mt({},[...Jx,...Ih,...qh,...Gh,...Wx]);let lt=null;const Xt=mt({},[...Px,...Yh,...eb,...ff]);let Pe=Object.seal(mc(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}})),Vt=null,xl=null;const ht=Object.seal(mc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Kt=!0,en=!0,_n=!1,hn=!0,an=!1,rt=!0,pt=!1,Tn=!1,En=null,Je=null,ct=!1,pn=!1,yn=!1,Pn=!1,rn=!0,kt=!1;const Zt="user-content-";let vt=!0,el=!1,le={},ge=null;const Ue=mt({},["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 U=null;const P=mt({},["audio","video","img","source","image","track"]);let be=null;const De=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qt="http://www.w3.org/1998/Math/MathML",Cn="http://www.w3.org/2000/svg",tn="http://www.w3.org/1999/xhtml";let $n=tn,Xn=!1,Gl=null;const Yl=mt({},[qt,Cn,tn],Bh),$l=il(["mi","mo","mn","ms","mtext"]);let ms=mt({},$l);const Os=il(["annotation-xml"]);let cn=mt({},Os);const sa=mt({},["title","style","font","a","script"]);let cl=null;const tl=["application/xhtml+xml","text/html"],Lt="text/html";let Ve=null,mn=null;const on=r.createElement("form"),El=function(k){return k instanceof RegExp||k instanceof Function},et=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mn&&mn===k)return;(!k||typeof k!="object")&&(k={}),k=Nl(k),cl=tl.indexOf(k.PARSER_MEDIA_TYPE)===-1?Lt:k.PARSER_MEDIA_TYPE,Ve=cl==="application/xhtml+xml"?Bh:qo,Ge=_i(k,"ALLOWED_TAGS",Ot,{transform:Ve}),lt=_i(k,"ALLOWED_ATTR",Xt,{transform:Ve}),Gl=_i(k,"ALLOWED_NAMESPACES",Yl,{transform:Bh}),be=_i(k,"ADD_URI_SAFE_ATTR",De,{transform:Ve,base:De}),U=_i(k,"ADD_DATA_URI_TAGS",P,{transform:Ve,base:P}),ge=_i(k,"FORBID_CONTENTS",Ue,{transform:Ve}),Vt=_i(k,"FORBID_TAGS",Nl({}),{transform:Ve}),xl=_i(k,"FORBID_ATTR",Nl({}),{transform:Ve}),le=Wn(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?Nl(k.USE_PROFILES):k.USE_PROFILES:!1,Kt=k.ALLOW_ARIA_ATTR!==!1,en=k.ALLOW_DATA_ATTR!==!1,_n=k.ALLOW_UNKNOWN_PROTOCOLS||!1,hn=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,an=k.SAFE_FOR_TEMPLATES||!1,rt=k.SAFE_FOR_XML!==!1,pt=k.WHOLE_DOCUMENT||!1,pn=k.RETURN_DOM||!1,yn=k.RETURN_DOM_FRAGMENT||!1,Pn=k.RETURN_TRUSTED_TYPE||!1,ct=k.FORCE_BODY||!1,rn=k.SANITIZE_DOM!==!1,kt=k.SANITIZE_NAMED_PROPS||!1,vt=k.KEEP_CONTENT!==!1,el=k.IN_PLACE||!1,dt=h1(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:tb,$n=typeof k.NAMESPACE=="string"?k.NAMESPACE:tn,ms=Wn(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?Nl(k.MATHML_TEXT_INTEGRATION_POINTS):mt({},$l),cn=Wn(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?Nl(k.HTML_INTEGRATION_POINTS):mt({},Os);const V=Wn(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?Nl(k.CUSTOM_ELEMENT_HANDLING):mc(null);if(Pe=mc(null),Wn(V,"tagNameCheck")&&El(V.tagNameCheck)&&(Pe.tagNameCheck=V.tagNameCheck),Wn(V,"attributeNameCheck")&&El(V.attributeNameCheck)&&(Pe.attributeNameCheck=V.attributeNameCheck),Wn(V,"allowCustomizedBuiltInElements")&&typeof V.allowCustomizedBuiltInElements=="boolean"&&(Pe.allowCustomizedBuiltInElements=V.allowCustomizedBuiltInElements),rl(Pe),an&&(en=!1),yn&&(pn=!0),le&&(Ge=mt({},Wx),lt=mc(null),le.html===!0&&(mt(Ge,Jx),mt(lt,Px)),le.svg===!0&&(mt(Ge,Ih),mt(lt,Yh),mt(lt,ff)),le.svgFilters===!0&&(mt(Ge,qh),mt(lt,Yh),mt(lt,ff)),le.mathMl===!0&&(mt(Ge,Gh),mt(lt,eb),mt(lt,ff))),ht.tagCheck=null,ht.attributeCheck=null,Wn(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?ht.tagCheck=k.ADD_TAGS:wi(k.ADD_TAGS)&&(Ge===Ot&&(Ge=Nl(Ge)),mt(Ge,k.ADD_TAGS,Ve))),Wn(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?ht.attributeCheck=k.ADD_ATTR:wi(k.ADD_ATTR)&&(lt===Xt&&(lt=Nl(lt)),mt(lt,k.ADD_ATTR,Ve))),Wn(k,"ADD_URI_SAFE_ATTR")&&wi(k.ADD_URI_SAFE_ATTR)&&mt(be,k.ADD_URI_SAFE_ATTR,Ve),Wn(k,"FORBID_CONTENTS")&&wi(k.FORBID_CONTENTS)&&(ge===Ue&&(ge=Nl(ge)),mt(ge,k.FORBID_CONTENTS,Ve)),Wn(k,"ADD_FORBID_CONTENTS")&&wi(k.ADD_FORBID_CONTENTS)&&(ge===Ue&&(ge=Nl(ge)),mt(ge,k.ADD_FORBID_CONTENTS,Ve)),vt&&(Ge["#text"]=!0),pt&&mt(Ge,["html","head","body"]),Ge.table&&(mt(Ge,["tbody"]),delete Vt.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw ir('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ir('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const de=H;H=k.TRUSTED_TYPES_POLICY;try{z=ce("")}catch(ve){throw H=de,ve}}else k.TRUSTED_TYPES_POLICY===null?(H=void 0,z=""):(H===void 0&&(H=Oe()),H&&typeof z=="string"&&(z=ce("")));il&&il(k),mn=k},ss=mt({},[...Ih,...qh,...p1]),Nt=mt({},[...Gh,...m1]),Cl=function(k,V,de){return V.namespaceURI===tn?k==="svg":V.namespaceURI===qt?k==="svg"&&(de==="annotation-xml"||ms[de]):!!ss[k]},xt=function(k,V,de){return V.namespaceURI===tn?k==="math":V.namespaceURI===Cn?k==="math"&&cn[de]:!!Nt[k]},Al=function(k,V,de){return V.namespaceURI===Cn&&!cn[de]||V.namespaceURI===qt&&!ms[de]?!1:!Nt[k]&&(sa[k]||!ss[k])},un=function(k){let V=G(k);(!V||!V.tagName)&&(V={namespaceURI:$n,tagName:"template"});const de=qo(k.tagName),ve=qo(V.tagName);return Gl[k.namespaceURI]?k.namespaceURI===Cn?Cl(de,V,ve):k.namespaceURI===qt?xt(de,V,ve):k.namespaceURI===tn?Al(de,V,ve):!!(cl==="application/xhtml+xml"&&Gl[k.namespaceURI]):!1},At=function(k){fc(s.removed,{element:k});try{G(k).removeChild(k)}catch{if(N(k),!G(k))throw ir("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},We=function(k){vn(k);const V=A(k);if(V){const ve=[];uc(V,Le=>{fc(ve,Le)}),uc(ve,Le=>{try{N(Le)}catch{}})}const de=B(k);if(de)for(let ve=de.length-1;ve>=0;--ve){const Le=de[ve],ke=Le&&Le.name;if(typeof ke=="string")try{k.removeAttribute(ke)}catch{}}},Tt=function(k,V){try{fc(s.removed,{attribute:V.getAttributeNode(k),from:V})}catch{fc(s.removed,{attribute:null,from:V})}if(V.removeAttribute(k),k==="is")if(pn||yn)try{At(V)}catch{}else try{V.setAttribute(k,"")}catch{}},Ml=function(k){const V=B(k);if(V)for(let de=V.length-1;de>=0;--de){const ve=V[de],Le=ve&&ve.name;if(!(typeof Le!="string"||lt[Ve(Le)]))try{k.removeAttribute(Le)}catch{}}},vn=function(k){const V=[k];for(;V.length>0;){const de=V.pop();(D?D(de):de.nodeType)===ls.element&&Ml(de);const Le=A(de);if(Le)for(let ke=Le.length-1;ke>=0;--ke)V.push(Le[ke])}},Bn=function(k){if(!rt)return;const V=[k];for(;V.length>0;){const de=V.pop(),ve=D?D(de):de.nodeType;if(ve===ls.processingInstruction||ve===ls.comment&&Jn(lb,de.data)){try{N(de)}catch{}continue}if(ve===ls.element){const ke=de,jt=Ve(J?J(de):de.nodeName);try{ke.hasAttribute&&ke.hasAttribute("patchsrc")&&ke.removeAttribute("patchsrc"),ke.hasAttribute&&ke.hasAttribute("for")&&jt!=="label"&&jt!=="output"&&ke.removeAttribute("for")}catch{}}const Le=A(de);if(Le)for(let ke=Le.length-1;ke>=0;--ke)V.push(Le[ke])}},nl=function(k){let V=null,de=null;if(ct)k="<remove></remove>"+k;else{const ke=Qx(k,/^[\r\n\t ]+/);de=ke&&ke[0]}cl==="application/xhtml+xml"&&$n===tn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const ve=H?ce(k):k;if($n===tn)try{V=new y().parseFromString(ve,cl)}catch{}if(!V||!V.documentElement){V=M.createDocument($n,"template",null);try{V.documentElement.innerHTML=Xn?z:ve}catch{}}const Le=V.body||V.documentElement;return k&&de&&Le.insertBefore(r.createTextNode(de),Le.childNodes[0]||null),$n===tn?xe.call(V,pt?"html":"body")[0]:pt?V.documentElement:Le},Vn=function(k){return fe.call(k.ownerDocument||k,k,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Xl=function(k){return k=Do(k,X," "),k=Do(k,oe," "),k=Do(k,me," "),k},An=function(k){var V;k.normalize();const de=fe.call(k.ownerDocument||k,k,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let ve=de.nextNode();for(;ve;)ve.data=Xl(ve.data),ve=de.nextNode();const Le=(V=k.querySelectorAll)===null||V===void 0?void 0:V.call(k,"template");Le&&uc(Le,ke=>{Qn(ke.content)&&An(ke.content)})},ol=function(k){const V=J?J(k):null;return typeof V!="string"||Ve(V)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==B(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==D(k)||k.childNodes!==A(k)},Qn=function(k){if(!D||typeof k!="object"||k===null)return!1;try{return D(k)===ls.documentFragment}catch{return!1}},jn=function(k){if(!D||typeof k!="object"||k===null)return!1;try{return typeof D(k)=="number"}catch{return!1}};function zt(pe,k,V){pe.length!==0&&uc(pe,de=>{de.call(s,k,V,mn)})}const Da=function(k,V){return!!(rt&&k.hasChildNodes()&&!jn(k.firstElementChild)&&Jn(nb,k.textContent)&&Jn(nb,k.innerHTML)||rt&&k.namespaceURI===tn&&V==="style"&&jn(k.firstElementChild)||k.nodeType===ls.processingInstruction||rt&&k.nodeType===ls.comment&&Jn(lb,k.data))},Ci=function(k,V){if(!Vt[V]&&Vl(V)&&(Pe.tagNameCheck instanceof RegExp&&Jn(Pe.tagNameCheck,V)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(V)))return!1;if(vt&&!ge[V]){const de=G(k),ve=A(k);if(ve&&de){const Le=ve.length;for(let ke=Le-1;ke>=0;--ke){const jt=el?ve[ke]:C(ve[ke],!0);de.insertBefore(jt,T(k))}}}return At(k),!0},Ls=function(k,V){if(zt(E.beforeSanitizeElements,k,null),k!==V&&G(k)===null)return!0;if(ol(k))return At(k),!0;const de=Ve(J?J(k):k.nodeName);if(zt(E.uponSanitizeElement,k,{tagName:de,allowedTags:Ge}),k!==V&&G(k)===null)return!0;if(Da(k,de))return At(k),!0;if(Vt[de]||!(ht.tagCheck instanceof Function&&ht.tagCheck(de))&&!Ge[de]){const Le=Ci(k,de);return Le===!1&&zt(E.afterSanitizeElements,k,null),Le}if((D?D(k):k.nodeType)===ls.element&&!un(k)||(de==="noscript"||de==="noembed"||de==="noframes")&&Jn(k1,k.innerHTML))return At(k),!0;if(an&&k.nodeType===ls.text){const Le=Xl(k.textContent);k.textContent!==Le&&(fc(s.removed,{element:k.cloneNode()}),k.textContent=Le)}return zt(E.afterSanitizeElements,k,null),!1},aa=function(k,V,de){if(xl[V]||rt&&V==="patchsrc"||rt&&V==="for"&&k!=="label"&&k!=="output"||rn&&(V==="id"||V==="name")&&(de in r||de in on))return!1;const ve=lt[V]||ht.attributeCheck instanceof Function&&ht.attributeCheck(V,k);if(!(en&&Jn(Te,V))){if(!(Kt&&Jn(Ee,V))){if(ve){if(!be[V]){if(!Jn(dt,Do(de,nt,""))){if(!((V==="src"||V==="xlink:href"||V==="href")&&k!=="script"&&Kx(de,"data:")===0&&U[k])){if(!(_n&&!Jn(Ae,Do(de,nt,"")))){if(de)return!1}}}}}else if(!(Vl(k)&&(Pe.tagNameCheck instanceof RegExp&&Jn(Pe.tagNameCheck,k)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(k))&&(Pe.attributeNameCheck instanceof RegExp&&Jn(Pe.attributeNameCheck,V)||Pe.attributeNameCheck instanceof Function&&Pe.attributeNameCheck(V,k))||V==="is"&&Pe.allowCustomizedBuiltInElements&&(Pe.tagNameCheck instanceof RegExp&&Jn(Pe.tagNameCheck,de)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(de))))return!1}}return!0},gs=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vl=function(k){return!gs[qo(k)]&&Jn(Xe,k)},Kn=function(k,V,de,ve){if(H&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!de)switch(j.getAttributeType(k,V)){case"TrustedHTML":return ce(ve);case"TrustedScriptURL":return ye(ve)}return ve},xs=function(k,V,de,ve){try{de?k.setAttributeNS(de,V,ve):k.setAttribute(V,ve),ol(k)?At(k):Vx(s.removed)}catch{Tt(V,k)}},bs=function(k){zt(E.beforeSanitizeAttributes,k,null);const V=k.attributes;if(!V||ol(k))return;const de={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:lt,forceKeepAttr:void 0};let ve=V.length;const Le=Ve(k.nodeName);for(;ve--;){const ke=V[ve],jt=ke.name,Mt=ke.namespaceURI,Sn=ke.value,ot=Ve(jt),nn=Sn;let Gt=jt==="value"?nn:r1(nn);if(de.attrName=ot,de.attrValue=Gt,de.keepAttr=!0,de.forceKeepAttr=void 0,zt(E.uponSanitizeAttribute,k,de),Gt=de.attrValue,kt&&(ot==="id"||ot==="name")&&Kx(Gt,Zt)!==0&&(Tt(jt,k),Gt=Zt+Gt),rt&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Gt)){Tt(jt,k);continue}if(ot==="attributename"&&Qx(Gt,"href")){Tt(jt,k);continue}if(!de.forceKeepAttr){if(!de.keepAttr){Tt(jt,k);continue}if(!hn&&Jn(N1,Gt)){Tt(jt,k);continue}if(an&&(Gt=Xl(Gt)),!aa(Le,ot,Gt)){Tt(jt,k);continue}Gt=Kn(Le,ot,Mt,Gt),Gt!==nn&&xs(k,jt,Mt,Gt)}}zt(E.afterSanitizeAttributes,k,null)},bl=function(k){let V=null;const de=Vn(k);for(zt(E.beforeSanitizeShadowDOM,k,null);V=de.nextNode();)if(zt(E.uponSanitizeShadowNode,V,null),Ls(V,k),bs(V),Qn(V.content)&&bl(V.content),(D?D(V):V.nodeType)===ls.element){const Le=F(V);Qn(Le)&&(Qt(Le),bl(Le))}zt(E.afterSanitizeShadowDOM,k,null)},Qt=function(k){const V=[{node:k,shadow:null}];for(;V.length>0;){const de=V.pop();if(de.shadow){bl(de.shadow);continue}const ve=de.node,ke=(D?D(ve):ve.nodeType)===ls.element,jt=A(ve);if(jt)for(let Mt=jt.length-1;Mt>=0;--Mt)V.push({node:jt[Mt],shadow:null});if(ke){const Mt=J?J(ve):null;if(typeof Mt=="string"&&Ve(Mt)==="template"){const Sn=ve.content;Qn(Sn)&&V.push({node:Sn,shadow:null})}}if(ke){const Mt=F(ve);Qn(Mt)&&V.push({node:null,shadow:Mt},{node:Mt,shadow:null})}}};return s.sanitize=function(pe){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=null,de=null,ve=null,Le=null;if(Xn=!pe,Xn&&(pe="<!-->"),typeof pe!="string"&&!jn(pe)&&(pe=d1(pe),typeof pe!="string"))throw ir("dirty is not a string, aborting");if(!s.isSupported)return pe;Tn?(Ge=En,lt=Je):et(k),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(Ge=Nl(Ge)),E.uponSanitizeAttribute.length>0&&(lt=Nl(lt)),s.removed=[];const ke=el&&typeof pe!="string"&&jn(pe);if(ke){Bn(pe);const ot=J?J(pe):pe.nodeName;if(typeof ot=="string"){const nn=Ve(ot);if(!Ge[nn]||Vt[nn])throw We(pe),ir("root node is forbidden and cannot be sanitized in-place")}if(ol(pe))throw We(pe),ir("root node is clobbered and cannot be sanitized in-place");try{Qt(pe)}catch(nn){throw We(pe),nn}}else if(jn(pe))V=nl("<!---->"),de=V.ownerDocument.importNode(pe,!0),de.nodeType===ls.element&&de.nodeName==="BODY"||de.nodeName==="HTML"?V=de:V.appendChild(de),Qt(de);else{if(!pn&&!an&&!pt&&pe.indexOf("<")===-1)return H&&Pn?ce(pe):pe;if(V=nl(pe),!V)return pn?null:Pn?z:""}V&&ct&&At(V.firstChild);const jt=ke?pe:V,Mt=Vn(jt);try{for(;ve=Mt.nextNode();)Ls(ve,jt),bs(ve),Qn(ve.content)&&bl(ve.content)}catch(ot){throw ke&&(We(pe),uc(s.removed,nn=>{nn.element&&vn(nn.element)})),ot}if(ke)return uc(s.removed,ot=>{ot.element&&vn(ot.element)}),an&&An(pe),pe;if(pn){if(an&&An(V),yn)for(Le=L.call(V.ownerDocument);V.firstChild;)Le.appendChild(V.firstChild);else Le=V;return(lt.shadowroot||lt.shadowrootmode)&&(Le=je.call(c,Le,!0)),Le}let Sn=pt?V.outerHTML:V.innerHTML;return pt&&Ge["!doctype"]&&V.ownerDocument&&V.ownerDocument.doctype&&V.ownerDocument.doctype.name&&Jn(S1,V.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+V.ownerDocument.doctype.name+`>
116
+ `+Sn),an&&(Sn=Xl(Sn)),H&&Pn?ce(Sn):Sn},s.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};et(pe),Tn=!0,En=Ge,Je=lt},s.clearConfig=function(){mn=null,Tn=!1,En=null,Je=null,H=I,z=""},s.isValidAttribute=function(pe,k,V){mn||et({});const de=Ve(pe),ve=Ve(k);return aa(de,ve,V)},s.addHook=function(pe,k){typeof k=="function"&&Wn(E,pe)&&fc(E[pe],k)},s.removeHook=function(pe,k){if(Wn(E,pe)){if(k!==void 0){const V=a1(E[pe],k);return V===-1?void 0:i1(E[pe],V,1)[0]}return Vx(E[pe])}},s.removeHooks=function(pe){Wn(E,pe)&&(E[pe]=[])},s.removeAllHooks=function(){E=sb()},s}var C1=A_();const A1=1024;let M1=0;class ps{constructor(s,r){this.from=s,this.to=r}}class Pt{constructor(s={}){this.id=M1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=Ds.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}Pt.closedBy=new Pt({deserialize:l=>l.split(" ")});Pt.openedBy=new Pt({deserialize:l=>l.split(" ")});Pt.group=new Pt({deserialize:l=>l.split(" ")});Pt.isolate=new Pt({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});Pt.contextHash=new Pt({perNode:!0});Pt.lookAhead=new Pt({perNode:!0});Pt.mounted=new Pt({perNode:!0});class _c{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[Pt.mounted.id]}}const R1=Object.create(null);class Ds{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):R1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Ds(s.name||"",r,s.id,c);if(s.props){for(let d of s.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(Pt.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(Pt.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}Ds.none=new Ds("",Object.create(null),0,8);class M_{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let d of s){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new Ds(c.name,o,c.id,c.flags):c)}return new M_(r)}}const df=new WeakMap,ab=new WeakMap;var Jt;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(Jt||(Jt={}));class ql{constructor(s,r,c,o,d){if(this.type=s,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let s=_c.get(this);if(s&&!s.overlay)return s.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(s=0){return new Uf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=df.get(this)||this.topNode,d=new Uf(o);return d.moveTo(s,r),df.set(this,d._tree),d}get topNode(){return new gl(this,0,0,null)}resolve(s,r=0){let c=$o(df.get(this)||this.topNode,s,r,!1);return df.set(this,c),c}resolveInner(s,r=0){let c=$o(ab.get(this)||this.topNode,s,r,!0);return ab.set(this,c),c}resolveStack(s,r=0){return L1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&Jt.IncludeAnonymous)>0;for(let g=this.cursor(h|Jt.IncludeAnonymous);;){let x=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Cp(Ds.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new ql(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new ql(Ds.none,r,c,o)))}static build(s){return z1(s)}}ql.empty=new ql(Ds.none,[],[],0);class Tp{constructor(s,r){this.buffer=s,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 Tp(this.buffer,this.index)}}class Ei{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return Ds.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),s+=4,c==s)return d;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return d+"("+h.join(",")+")"}findChild(s,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(R_(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,d=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let x=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,x)}return new Ei(d,h,this.set)}}function R_(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function $o(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof gl&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:Jt.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof gl&&h.index<0&&((o=m.enter(s,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,d);if(!h)return l;l=h}}class D_{cursor(s=0){return new Uf(this,s)}getChild(s,r=null,c=null){let o=ib(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return ib(this,s,r,c)}resolve(s,r=0){return $o(this,s,r,!1)}resolveInner(s,r=0){return $o(this,s,r,!0)}matchContext(s){return up(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),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 gl extends D_{constructor(s,r,c,o){super(),this._tree=s,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(s,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,x=r>0?m.length:-1;s!=x;s+=r){let y=m[s],j=g[s]+h.from,v;if(!(!(d&Jt.EnterBracketed&&y instanceof ql&&(v=_c.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!R_(o,c,j,j+y.length))){if(y instanceof Ei){if(d&Jt.ExcludeBuffers)continue;let C=y.findChild(0,y.buffer.length,r,c-j,o);if(C>-1)return new na(new D1(h,y,s,j),null,C)}else if(d&Jt.IncludeAnonymous||!y.type.isAnonymous||Ep(y)){let C;if(!(d&Jt.IgnoreMounts)&&(C=_c.get(y))&&!C.overlay)return new gl(C.tree,j,s,h);let N=new gl(y,j,s,h);return d&Jt.IncludeAnonymous||!N.type.isAnonymous?N:N.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&Jt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=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(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&Jt.IgnoreOverlays)&&(o=_c.get(this._tree))&&o.overlay){let d=s-this.from,h=c&Jt.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=d:m<d)&&(r<0||h?g>=d:g>d))return new gl(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ib(l,s,r,c){let o=l.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(s)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function up(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class D1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class na extends D_{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return d<0?null:new na(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&Jt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return d<0?null:new na(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new na(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new na(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];s.push(c.slice(o,d,h)),r.push(0)}return new ql(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function O_(l){if(!l.length)return null;let s=0,r=l[0];for(let d=1;d<l.length;d++){let h=l[d];(h.from>r.from||h.to<r.to)&&(r=h,s=d)}let c=r instanceof gl&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new O1(o,r)}class O1{constructor(s,r){this.heads=s,this.node=r}get next(){return O_(this.heads)}}function L1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof gl?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(s,r)),d=h}else{let h=_c.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new gl(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push($o(m,s,r,!1))}}return o?O_(o):c}class Uf{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Jt.EnterBracketed,s instanceof gl)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof gl?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&Jt.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&Jt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(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+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+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 d=r+s,h=s<0?-1:c._tree.children.length;d!=h;d+=s){let m=c._tree.children[d];if(this.mode&Jt.IncludeAnonymous||m instanceof Ei||!m.type.isAnonymous||Ep(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new na(this.buffer,r,this.stack[o]);return this.bufferNode=new na(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return up(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return up(this._tree,s,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Ep(l){return l.children.some(s=>s instanceof Ei||!s.type.isAnonymous||Ep(s))}function z1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=A1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Tp(r,r.length):r,g=c.types,x=0,y=0;function j(J,H,z,I,Y,ae){let{id:W,start:ce,end:ye,size:Oe}=m,we=y,M=x;if(Oe<0)if(m.next(),Oe==-1){let E=d[W];z.push(E),I.push(ce-J);return}else if(Oe==-3){x=W;return}else if(Oe==-4){y=W;return}else throw new RangeError(`Unrecognized record size: ${Oe}`);let fe=g[W],L,xe,je=ce-J;if(ye-ce<=o&&(xe=A(m.pos-H,Y))){let E=new Uint16Array(xe.size-xe.skip),X=m.pos-xe.size,oe=E.length;for(;m.pos>X;)oe=G(xe.start,E,oe);L=new Ei(E,ye-xe.start,c),je=xe.start-J}else{let E=m.pos-Oe;m.next();let X=[],oe=[],me=W>=h?W:-1,Te=0,Ee=ye;for(;m.pos>E;)me>=0&&m.id==me&&m.size>=0?(m.end<=Ee-o&&(N(X,oe,ce,Te,m.end,Ee,me,we,M),Te=X.length,Ee=m.end),m.next()):ae>2500?v(ce,E,X,oe):j(ce,E,X,oe,me,ae+1);if(me>=0&&Te>0&&Te<X.length&&N(X,oe,ce,Te,ce,Ee,me,we,M),X.reverse(),oe.reverse(),me>-1&&Te>0){let Ae=C(fe,M);L=Cp(fe,X,oe,0,X.length,0,ye-ce,Ae,Ae)}else L=T(fe,X,oe,ye-ce,we-ye,M)}z.push(L),I.push(je)}function v(J,H,z,I){let Y=[],ae=0,W=-1;for(;m.pos>H;){let{id:ce,start:ye,end:Oe,size:we}=m;if(we>4)m.next();else{if(W>-1&&ye<W)break;W<0&&(W=Oe-o),Y.push(ce,ye,Oe),ae++,m.next()}}if(ae){let ce=new Uint16Array(ae*4),ye=Y[Y.length-2];for(let Oe=Y.length-3,we=0;Oe>=0;Oe-=3)ce[we++]=Y[Oe],ce[we++]=Y[Oe+1]-ye,ce[we++]=Y[Oe+2]-ye,ce[we++]=we;z.push(new Ei(ce,Y[2]-ye,c)),I.push(ye-J)}}function C(J,H){return(z,I,Y)=>{let ae=0,W=z.length-1,ce,ye;if(W>=0&&(ce=z[W])instanceof ql){if(!W&&ce.type==J&&ce.length==Y)return ce;(ye=ce.prop(Pt.lookAhead))&&(ae=I[W]+ce.length+ye)}return T(J,z,I,Y,ae,H)}}function N(J,H,z,I,Y,ae,W,ce,ye){let Oe=[],we=[];for(;J.length>I;)Oe.push(J.pop()),we.push(H.pop()+z-Y);J.push(T(c.types[W],Oe,we,ae-Y,ce-ae,ye)),H.push(Y-z)}function T(J,H,z,I,Y,ae,W){if(ae){let ce=[Pt.contextHash,ae];W=W?[ce].concat(W):[ce]}if(Y>25){let ce=[Pt.lookAhead,Y];W=W?[ce].concat(W):[ce]}return new ql(J,H,z,I,W)}function A(J,H){let z=m.fork(),I=0,Y=0,ae=0,W=z.end-o,ce={size:0,start:0,skip:0};e:for(let ye=z.pos-J;z.pos>ye;){let Oe=z.size;if(z.id==H&&Oe>=0){ce.size=I,ce.start=Y,ce.skip=ae,ae+=4,I+=4,z.next();continue}let we=z.pos-Oe;if(Oe<0||we<ye||z.start<W)break;let M=z.id>=h?4:0,fe=z.start;for(z.next();z.pos>we;){if(z.size<0)if(z.size==-3||z.size==-4)M+=4;else break e;else z.id>=h&&(M+=4);z.next()}Y=fe,I+=Oe,ae+=M}return(H<0||I==J)&&(ce.size=I,ce.start=Y,ce.skip=ae),ce.size>4?ce:void 0}function G(J,H,z){let{id:I,start:Y,end:ae,size:W}=m;if(m.next(),W>=0&&I<h){let ce=z;if(W>4){let ye=m.pos-(W-4);for(;m.pos>ye;)z=G(J,H,z)}H[--z]=ce,H[--z]=ae-J,H[--z]=Y-J,H[--z]=I}else W==-3?x=I:W==-4&&(y=I);return z}let F=[],B=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,F,B,-1,0);let D=(s=l.length)!==null&&s!==void 0?s:F.length?B[0]+F[0].length:0;return new ql(g[l.topID],F.reverse(),B.reverse(),D)}const rb=new WeakMap;function Rf(l,s){if(!l.isAnonymous||s instanceof Ei||s.type!=l)return 1;let r=rb.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof ql)){r=1;break}r+=Rf(l,c)}rb.set(s,r)}return r}function Cp(l,s,r,c,o,d,h,m,g){let x=0;for(let N=c;N<o;N++)x+=Rf(l,s[N]);let y=Math.ceil(x*1.5/8),j=[],v=[];function C(N,T,A,G,F){for(let B=A;B<G;){let D=B,J=T[B],H=Rf(l,N[B]);for(B++;B<G;B++){let z=Rf(l,N[B]);if(H+z>=y)break;H+=z}if(B==D+1){if(H>y){let z=N[D];C(z.children,z.positions,0,z.children.length,T[D]+F);continue}j.push(N[D])}else{let z=T[B-1]+N[B-1].length-J;j.push(Cp(l,N,T,D,B,J,z,null,g))}v.push(J+F-d)}}return C(s,r,c,o,0),(m||g)(j,v,h)}class UN{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof na?this.setBuffer(s.context.buffer,s.index,r):s instanceof gl&&this.map.set(s.tree,r)}get(s){return s instanceof na?this.getBuffer(s.context.buffer,s.index):s instanceof gl?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class Xo{constructor(s,r,c,o,d=!1,h=!1){this.from=s,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,r=[],c=!1){let o=[new Xo(0,s.length,s,0,!1,c)];for(let d of r)d.to>s.length&&o.push(d);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],d=1,h=s.length?s[0]:null;for(let m=0,g=0,x=0;;m++){let y=m<r.length?r[m]:null,j=y?y.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||x){let C=Math.max(v.from,g)-x,N=Math.min(v.to,j)-x;v=C>=N?null:new Xo(C,N,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!y)break;g=y.toA,x=y.toA-y.toB}return o}}class HN{startParse(s,r,c){return typeof s=="string"&&(s=new U1(s)),c=c?c.length?c.map(o=>new ps(o.from,o.to)):[new ps(0,0)]:[new ps(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class U1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function BN(l){return(s,r,c,o)=>new B1(s,l,r,c,o)}class cb{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function ob(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class H1{constructor(s,r,c,o,d,h,m,g){this.parser=s,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const fp=new Pt({perNode:!0});class B1{constructor(s,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new ql(c.type,c.children,c.positions,c.length,c.propValues.concat([[fp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[Pt.mounted.id]=new _c(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new G1(this.fragments),r=null,c=null,o=new Uf(new gl(this.baseTree,this.ranges[0].from,0,null),Jt.IncludeAnonymous|Jt.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(r){let x=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(x)for(let y of x.mount.overlay){let j=y.from+x.pos,v=y.to+x.pos;j>=o.from&&v<=o.to&&!r.ranges.some(C=>C.from<v&&C.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=I1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(q1(o),r&&r.depth++,c&&c.depth++);let x=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new H1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=db(this.ranges,d.overlay||(o.from<o.to?[new ps(o.from,o.to)]:[]));y.length&&ob(y),(y.length||!d.overlay)&&this.inner.push(new cb(d.parser,y.length?d.parser.startParse(this.input,hb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new ps(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,y.length?y[0].from:o.from)),d.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new ps(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(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let x=db(this.ranges,r.ranges);x.length&&(ob(x),this.inner.splice(r.index,0,new cb(r.parser,r.parser.startParse(this.input,hb(r.mounts,x),x),r.ranges.map(y=>new ps(y.from-r.start,y.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function I1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function ub(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function q1(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function x(y,j,v,C,N,T){let A=r[T],G=[],F=[];ub(h,y,A,G,F,C);let B=m[A+1],D=m[A+2];g.push(G.length);let J=T?x(A+4,m[A+3],h.set.types[m[A]],B,D-B,T-1):s.toTree();return G.push(J),F.push(B-C),ub(h,m[A+3],j,G,F,C),new ql(v,G,F,N)}o.children[d]=x(0,m.length,Ds.none,0,h.length,r.length-1);for(let y of g){let j=l.tree.children[y],v=l.tree.positions[y];l.yield(new gl(j,v+l.from,y,l._tree))}}class fb{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(Jt.IncludeAnonymous|Jt.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,Jt.IgnoreOverlays|Jt.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof ql)r=r.children[0];else break}return!1}}class G1{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(fp))!==null&&r!==void 0?r:c.to,this.inner=new fb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(fp))!==null&&s!==void 0?s:r.to,this.inner=new fb(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Pt.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=d.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:d.from-g.offset,mount:h})}}}return o}}function db(l,s){let r=null,c=s;for(let o=1,d=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[d]=new ps(g.from,h),g.to>m&&r.splice(d+1,0,new ps(m,g.to))):g.to>m?r[d--]=new ps(m,g.to):r.splice(d--,1))}}return c}function Y1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let y=o==l.length?1e9:h?l[o].to:l[o].from,j=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),C=Math.min(y,j,c);v<C&&x.push(new ps(v,C))}if(g=Math.min(y,j),g==1e9)break;y==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return x}function hb(l,s){let r=[];for(let{pos:c,mount:o,frag:d}of l){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),x=Math.min(d.to,m);if(o.overlay){let y=o.overlay.map(v=>new ps(v.from+c,v.to+c)),j=Y1(s,y,g,x);for(let v=0,C=g;;v++){let N=v==j.length,T=N?x:j[v].from;if(T>C&&r.push(new Xo(C,T,o.tree,-h,d.from>=C||d.openStart,d.to<=T||d.openEnd)),N)break;C=j[v].to}}else r.push(new Xo(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let $1=0;class hs{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=$1++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof hs&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new hs(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(s){let r=new Hf(s);return c=>c.modified.indexOf(r)>-1?c:Hf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let X1=0;class Hf{constructor(s){this.name=s,this.instances=[],this.id=X1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&V1(r,m.modified));if(c)return c;let o=[],d=new hs(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=Q1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Hf.get(m,g));return d}}function V1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Q1(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function IN(l){let s=Object.create(null);for(let r in l){let c=l[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,x=d[g];if(!x)throw new RangeError("Invalid path: "+o);let y=new Vo(c,h,g>0?d.slice(0,g):null);s[x]=y.sort(s[x])}}return L_.add(s)}const L_=new Pt({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new Vo(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Vo{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}Vo.empty=new Vo([],2,null);function z_(l,s){let r=Object.create(null);for(let d of l)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=s||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function K1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function Z1(l,s,r,c=0,o=l.length){let d=new J1(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function F1(l,s,r,c,o,d=0,h=l.length){let m=d;function g(x,y){if(!(x<=m)){for(let j=l.slice(m,x),v=0;;){let C=j.indexOf(`
117
+ `,v),N=C<0?j.length:C;if(N>v&&c(j.slice(v,N),y),C<0)break;o(),v=C+1}m=x}}Z1(s,r,(x,y,j)=>{g(x,""),g(y,j)},d,h),g(h,"")}class J1{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,d){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(C=>!C.scope||C.scope(h)));let x=o,y=W1(s)||Vo.empty,j=K1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),x),y.opaque)return;let v=s.tree&&s.tree.prop(Pt.mounted);if(v&&v.overlay){let C=s.node.enter(v.overlay[0].from+m,1),N=this.highlighters.filter(A=>!A.scope||A.scope(v.tree.type)),T=s.firstChild();for(let A=0,G=m;;A++){let F=A<v.overlay.length?v.overlay[A]:null,B=F?F.from+m:g,D=Math.max(r,G),J=Math.min(c,B);if(D<J&&T)for(;s.from<J&&(this.highlightRange(s,D,J,o,d),this.startSpan(Math.min(J,s.to),x),!(s.to>=B||!s.nextSibling())););if(!F||B>c)break;G=F.to+m,G>r&&(this.highlightRange(C.cursor(),Math.max(r,F.from+m),Math.min(c,G),"",N),this.startSpan(Math.min(c,G),x))}T&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function W1(l){let s=l.type.prop(L_);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const Se=hs.define,hf=Se(),ji=Se(),pb=Se(ji),mb=Se(ji),Si=Se(),pf=Se(Si),$h=Se(Si),Ws=Se(),rr=Se(Ws),Qs=Se(),Ks=Se(),dp=Se(),Lo=Se(dp),mf=Se(),Ne={comment:hf,lineComment:Se(hf),blockComment:Se(hf),docComment:Se(hf),name:ji,variableName:Se(ji),typeName:pb,tagName:Se(pb),propertyName:mb,attributeName:Se(mb),className:Se(ji),labelName:Se(ji),namespace:Se(ji),macroName:Se(ji),literal:Si,string:pf,docString:Se(pf),character:Se(pf),attributeValue:Se(pf),number:$h,integer:Se($h),float:Se($h),bool:Se(Si),regexp:Se(Si),escape:Se(Si),color:Se(Si),url:Se(Si),keyword:Qs,self:Se(Qs),null:Se(Qs),atom:Se(Qs),unit:Se(Qs),modifier:Se(Qs),operatorKeyword:Se(Qs),controlKeyword:Se(Qs),definitionKeyword:Se(Qs),moduleKeyword:Se(Qs),operator:Ks,derefOperator:Se(Ks),arithmeticOperator:Se(Ks),logicOperator:Se(Ks),bitwiseOperator:Se(Ks),compareOperator:Se(Ks),updateOperator:Se(Ks),definitionOperator:Se(Ks),typeOperator:Se(Ks),controlOperator:Se(Ks),punctuation:dp,separator:Se(dp),bracket:Lo,angleBracket:Se(Lo),squareBracket:Se(Lo),paren:Se(Lo),brace:Se(Lo),content:Ws,heading:rr,heading1:Se(rr),heading2:Se(rr),heading3:Se(rr),heading4:Se(rr),heading5:Se(rr),heading6:Se(rr),contentSeparator:Se(Ws),list:Se(Ws),quote:Se(Ws),emphasis:Se(Ws),strong:Se(Ws),link:Se(Ws),monospace:Se(Ws),strikethrough:Se(Ws),inserted:Se(),deleted:Se(),changed:Se(),invalid:Se(),meta:mf,documentMeta:Se(mf),annotation:Se(mf),processingInstruction:Se(mf),definition:hs.defineModifier("definition"),constant:hs.defineModifier("constant"),function:hs.defineModifier("function"),standard:hs.defineModifier("standard"),local:hs.defineModifier("local"),special:hs.defineModifier("special")};for(let l in Ne){let s=Ne[l];s instanceof hs&&(s.name=l)}z_([{tag:Ne.link,class:"tok-link"},{tag:Ne.heading,class:"tok-heading"},{tag:Ne.emphasis,class:"tok-emphasis"},{tag:Ne.strong,class:"tok-strong"},{tag:Ne.keyword,class:"tok-keyword"},{tag:Ne.atom,class:"tok-atom"},{tag:Ne.bool,class:"tok-bool"},{tag:Ne.url,class:"tok-url"},{tag:Ne.labelName,class:"tok-labelName"},{tag:Ne.inserted,class:"tok-inserted"},{tag:Ne.deleted,class:"tok-deleted"},{tag:Ne.literal,class:"tok-literal"},{tag:Ne.string,class:"tok-string"},{tag:Ne.number,class:"tok-number"},{tag:[Ne.regexp,Ne.escape,Ne.special(Ne.string)],class:"tok-string2"},{tag:Ne.variableName,class:"tok-variableName"},{tag:Ne.local(Ne.variableName),class:"tok-variableName tok-local"},{tag:Ne.definition(Ne.variableName),class:"tok-variableName tok-definition"},{tag:Ne.special(Ne.variableName),class:"tok-variableName2"},{tag:Ne.definition(Ne.propertyName),class:"tok-propertyName tok-definition"},{tag:Ne.typeName,class:"tok-typeName"},{tag:Ne.namespace,class:"tok-namespace"},{tag:Ne.className,class:"tok-className"},{tag:Ne.macroName,class:"tok-macroName"},{tag:Ne.propertyName,class:"tok-propertyName"},{tag:Ne.operator,class:"tok-operator"},{tag:Ne.comment,class:"tok-comment"},{tag:Ne.meta,class:"tok-meta"},{tag:Ne.invalid,class:"tok-invalid"},{tag:Ne.punctuation,class:"tok-punctuation"}]);const P1="modulepreload",ej=function(l,s){return new URL(l,s).href},gb={},Ke=function(s,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=ej(y,c),y in gb)return;gb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let T=m.length-1;T>=0;T--){const A=m[T];if(A.href===y&&(!j||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const N=document.createElement("link");if(N.rel=j?"stylesheet":P1,j||(N.as="script"),N.crossOrigin="",N.href=y,x&&N.setAttribute("nonce",x),document.head.appendChild(N),j)return new Promise((T,A)=>{N.addEventListener("load",T),N.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return s().catch(d)})},U_={js:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-DQz01d1h.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Ke(async()=>{const{json:l}=await import("./index-BLgzE6_-.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Ke(async()=>{const{json:l}=await import("./index-BLgzE6_-.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Ke(async()=>{const{css:l}=await import("./index-DrsxSUf0.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Ke(async()=>{const{css:l}=await import("./index-DrsxSUf0.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Ke(async()=>{const{css:l}=await import("./index-DrsxSUf0.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Ke(async()=>{const{html:l}=await import("./index-6AoeJwuj.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Ke(async()=>{const{html:l}=await import("./index-6AoeJwuj.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Ke(async()=>{const{html:l}=await import("./index-6AoeJwuj.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Ke(async()=>{const{html:l}=await import("./index-6AoeJwuj.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Ke(async()=>{const{markdown:l}=await import("./index-BeHb7RMj.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Ke(async()=>{const{markdown:l}=await import("./index-BeHb7RMj.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Ke(async()=>{const{python:l}=await import("./index-DXY0QGeO.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Ke(async()=>{const{python:l}=await import("./index-DXY0QGeO.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Ke(async()=>{const{yaml:l}=await import("./index-cXMV_yZe.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Ke(async()=>{const{yaml:l}=await import("./index-cXMV_yZe.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Ke(async()=>{const{rust:l}=await import("./index-DT-n8jho.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index-2eTZZkmV.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index-2eTZZkmV.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index-2eTZZkmV.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index-2eTZZkmV.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index-2eTZZkmV.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Ke(async()=>{const{java:l}=await import("./index-XrDqYi4a.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Ke(async()=>{const{go:l}=await import("./index-CKsgdAOW.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Ke(async()=>{const{php:l}=await import("./index-heoNU_6a.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Ke(async()=>{const{sql:l}=await import("./index-ZCACtBsD.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Ke(async()=>{const{xml:l}=await import("./index-B308Zs-7.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Ke(async()=>{const{xml:l}=await import("./index-B308Zs-7.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},tj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},nj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function lj(l){const s=nj[l.toLowerCase()]??l.toLowerCase(),r=U_[s];return r?r().catch(()=>null):null}async function sj(l){const s=(l.split("/").pop()??"").toLowerCase(),r=tj[s]??s.split(".").pop()??"",c=U_[r];return c?c().catch(()=>null):null}const aj=z_([{tag:[Ne.keyword,Ne.modifier,Ne.controlKeyword,Ne.moduleKeyword],class:"cmh-key"},{tag:[Ne.propertyName],class:"cmh-prop"},{tag:[Ne.function(Ne.variableName),Ne.labelName],class:"cmh-fn"},{tag:[Ne.color,Ne.constant(Ne.name),Ne.standard(Ne.name),Ne.bool],class:"cmh-const"},{tag:[Ne.typeName,Ne.className,Ne.changed,Ne.annotation,Ne.self,Ne.namespace],class:"cmh-type"},{tag:[Ne.number,Ne.integer,Ne.float],class:"cmh-num"},{tag:[Ne.string,Ne.special(Ne.string),Ne.regexp],class:"cmh-str"},{tag:[Ne.operator,Ne.operatorKeyword,Ne.escape],class:"cmh-op"},{tag:[Ne.meta,Ne.comment],class:"cmh-comment"},{tag:Ne.invalid,class:"cmh-invalid"}]);function gf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function ij(l,s){const r=s?await lj(s):null;if(!r)return gf(l);try{const c=r.language.parser.parse(l);let o="";return F1(l,c,aj,(d,h)=>{o+=h?`<span class="${h}">${gf(d)}</span>`:gf(d)},()=>{o+=`
118
+ `}),o}catch{return gf(l)}}Ct.setOptions({gfm:!0,breaks:!1});function H_(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function Vf(l){const s=await Ct.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await ij(c.text,c.lang??""),c.escaped=!0}});return C1.sanitize(s)}function xb(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:H_(l.path)}}function Aa(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function rj(l){return l.split("/").pop()??l}function xr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Df(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function ki({x:l,y:s,items:r,note:c,onClose:o}){const d=_.useRef(null),[h,m]=_.useState({left:l,top:s}),[g,x]=_.useState(()=>{const v=r.findIndex(C=>!C.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),N=8,T=Math.max(N,Math.min(l,window.innerWidth-C.width-N)),A=Math.max(N,Math.min(s,window.innerHeight-C.height-N));m({left:T,top:A})},[l,s]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(N){var T;(T=d.current)!=null&&T.contains(N.target)||o()}function C(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",C,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=r.map((N,T)=>({item:N,index:T})).filter(N=>!N.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const N=v.key==="ArrowDown"?1:-1,T=C.findIndex(G=>G.index===g),A=C[(((T===-1?0:T)+N)%C.length+C.length)%C.length];A&&x(A.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const N=r[g];N&&y(N)}}}return i.jsxs("div",{ref:d,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((v,C)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===g?" is-cursor":""),onMouseEnter:()=>x(C),onClick:()=>y(v),children:[i.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&i.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const cj=3500,oj=9e3,bb=220;function vr({result:l,onDismiss:s}){const[r,c]=_.useState(l),[o,d]=_.useState(!1);if(_.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?cj:oj,g=setTimeout(()=>d(!0),m),x=setTimeout(()=>c(null),m+bb);return()=>{clearTimeout(g),clearTimeout(x)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},bb)};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:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&s&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ta({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=_.useState(l),m=_.useRef(null);_.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function g(){const x=d.trim();if(!x||x===l)return o();c(x)}return i.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:d,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 Rc({active:l}){return l?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 uj=500,cr="application/x-ccv-fs-path",fj=200;function dj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:C,onMove:N,onCopy:T,onDelete:A,onRefresh:G,onClose:F,zoomed:B,onToggleZoom:D}){const[J,H]=_.useState(""),[z,I]=_.useState(null),[Y,ae]=_.useState(null),[W,ce]=_.useState(null),[ye,Oe]=_.useState(null),[we,M]=_.useState(null),[fe,L]=_.useState(null),xe=Yf("(hover: hover)"),je=_.useRef(null),E=_.useMemo(()=>mj(d),[d]);function X(le){return!(!W||le===W.path||W.kind==="dir"&&le.startsWith(`${W.path}/`)||le===xr(W.path))}function oe(le){return!(!we||le===we.path||we.kind==="dir"&&le.startsWith(`${we.path}/`)||we.mode==="cut"&&le===xr(we.path))}function me(le){M({path:le.path,kind:le.kind,mode:"copy"})}function Te(le){M({path:le.path,kind:le.kind,mode:"cut"})}function Ee(le){!we||!oe(le)||(le&&!r.has(le)&&y(le),we.mode==="cut"?(N(we.path,le),M(null)):T(we.path,le))}function Ae(le,ge){const Ue=le.touches[0];if(!Ue)return;const U={timer:0,x:Ue.clientX,y:Ue.clientY,el:le.currentTarget,fired:!1};U.timer=window.setTimeout(()=>{U.fired=!0,ge(U.x,U.y,U.el)},uj),je.current=U}function nt(le){const ge=je.current,Ue=le.touches[0];!ge||!Ue||Math.hypot(Ue.clientX-ge.x,Ue.clientY-ge.y)>10&&(window.clearTimeout(ge.timer),je.current=null)}function Xe(le){const ge=je.current;ge&&(window.clearTimeout(ge.timer),ge.fired&&le.preventDefault())}function dt(){var le;return(le=je.current)!=null&&le.fired?(je.current=null,!0):!1}function Ge(le,ge,Ue,U){H((U==null?void 0:U.path)??""),L({x:le,y:ge,opener:Ue,entry:U})}function Ot(){const le=fe==null?void 0:fe.opener;L(null),le!=null&&le.isConnected&&le.focus()}function lt(le){return{onContextMenu:ge=>{ge.preventDefault(),Ge(ge.clientX,ge.clientY,ge.currentTarget,le)},onTouchStart:ge=>Ae(ge,(Ue,U,P)=>Ge(Ue,U,P,le)),onTouchMove:nt,onTouchEnd:Xe,onTouchCancel:Xe}}function Xt(le){le.target===le.currentTarget&&(le.preventDefault(),Ge(le.clientX,le.clientY,le.currentTarget,null))}function Pe(le){le.target===le.currentTarget&&Ae(le,(ge,Ue,U)=>Ge(ge,Ue,U,null))}function Vt(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const ge=le.key.toLowerCase();if(ge==="v"){le.preventDefault(),Ee(Pn());return}if(!J)return;const Ue=_b(s,J);Ue&&(ge==="c"?(le.preventDefault(),me(Ue)):ge==="x"&&(le.preventDefault(),Te(Ue)))}function xl(le){return ge=>{ge.dataTransfer.effectAllowed="move",ge.dataTransfer.setData(cr,le.path),ce({path:le.path,kind:le.kind})}}function ht(){ce(null),Oe(null)}function Kt(le){return ge=>{ge.dataTransfer.types.includes(cr)&&(ge.stopPropagation(),!(le.kind!=="dir"||!X(le.path))&&(ge.preventDefault(),Oe(le.path)))}}function en(le){return ge=>{if(!ge.dataTransfer.types.includes(cr)||(ge.stopPropagation(),le.kind!=="dir"||!X(le.path)))return;ge.preventDefault();const Ue=ge.dataTransfer.getData(cr);Oe(null),Ue&&N(Ue,le.path)}}function _n(le){!le.dataTransfer.types.includes(cr)||!X("")||(le.preventDefault(),Oe(""))}function hn(le){if(!le.dataTransfer.types.includes(cr)||!X(""))return;le.preventDefault();const ge=le.dataTransfer.getData(cr);Oe(null),ge&&N(ge,"")}const[an,rt]=_.useState(""),pt=an.trim(),Tn=pt.length>0,En=_.useRef(null),Je=_.useRef(g);Je.current=g;function ct(le){rt(le),En.current&&clearTimeout(En.current);const ge=le.trim();if(!ge){Je.current("");return}En.current=setTimeout(()=>Je.current(ge),fj)}function pn(le){En.current&&clearTimeout(En.current),rt(""),Je.current(""),H(le.path),x(le)}const yn=Tn&&(m==null?void 0:m.query)===pt?m:null;function Pn(){if(J==="")return"";const le=_b(s,J);if((le==null?void 0:le.kind)==="dir")return J;const ge=J.lastIndexOf("/");return ge===-1?"":J.slice(0,ge)}function rn(le,ge){const Ue=ge??Pn();Ue&&!r.has(Ue)&&y(Ue),ae({parent:Ue,kind:le})}function kt(){if(!fe)return[];const le=U=>xe?U:void 0;if(!fe.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:le("Ctrl+V"),disabled:!oe(""),onSelect:()=>Ee("")},{id:"new-file",label:"Создать файл",onSelect:()=>rn("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>rn("dir","")}];const ge=fe.entry,Ue=[ge.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ge.path)}:{id:"toggle",label:r.has(ge.path)?"Свернуть":"Развернуть",onSelect:()=>y(ge.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>me(ge)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>Te(ge)}];return ge.kind==="dir"&&(Ue.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!oe(ge.path),onSelect:()=>Ee(ge.path)}),Ue.push({id:"new-file",label:"Создать файл",onSelect:()=>rn("file",ge.path)}),Ue.push({id:"new-dir",label:"Создать каталог",onSelect:()=>rn("dir",ge.path)})),Ue.push({id:"rename",label:"Переименовать",onSelect:()=>I(ge.path)}),Ue.push({id:"delete",label:"Удалить",onSelect:()=>A(ge)}),Ue}const Zt=Tn?[]:vt("",0);function vt(le,ge){const Ue=s[le],U=[];if(Y&&Y.parent===le&&U.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:Ma(ge),children:[i.jsx("span",{className:"fsrow__icon",children:Y.kind==="dir"?i.jsx(If,{}):i.jsx(qf,{})}),i.jsx(ta,{className:"rename--file",value:"",placeholder:Y.kind==="dir"?"имя каталога":"имя файла",onCommit:P=>{ae(null),v(le,Y.kind,P)},onCancel:()=>ae(null)})]},`draft:${le}`)),!Ue)return U.push(i.jsx("p",{className:"fsrow__pending",style:Ma(ge),children:"читаем…"},`wait:${le}`)),U;Ue.length===0&&!Y&&U.push(i.jsx("p",{className:"fsrow__pending",style:Ma(ge),children:"пусто"},`empty:${le}`));for(const P of Ue){const be=P.kind==="dir"&&r.has(P.path);U.push(z===P.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:Ma(ge),children:[i.jsx("span",{className:"fsrow__icon",children:P.kind==="dir"?i.jsx(If,{open:be}):i.jsx(qf,{})}),i.jsx(ta,{className:"rename--file",value:P.name,placeholder:"новое имя",onCommit:De=>{I(null),C(P.path,De)},onCancel:()=>I(null)})]},P.path):i.jsx(hj,{entry:P,depth:ge,open:be,active:P.path===c,selected:P.path===J,dirty:o.has(P.path),gitStatus:E.get(P.path),dragging:(W==null?void 0:W.path)===P.path,dropTarget:ye===P.path,cut:(we==null?void 0:we.mode)==="cut"&&we.path===P.path,onClick:()=>{dt()||(H(P.path),P.kind==="dir"?y(P.path):j(P.path))},onRename:()=>I(P.path),onDelete:()=>A(P),onDragStart:xl(P),onDragEnd:ht,onDragOver:Kt(P),onDrop:en(P),...lt(P)},P.path)),be&&U.push(...vt(P.path,ge+1))}return U}function el(){if(!yn)return[i.jsx("p",{className:"fsrow__pending",style:Ma(0),children:"ищем…"},"search:wait")];if(yn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:Ma(0),children:"ничего не найдено"},"search:empty")];const le=yn.entries.map(ge=>i.jsx(pj,{entry:ge,gitStatus:E.get(ge.path),onClick:()=>pn(ge)},ge.path));return yn.truncated&&le.push(i.jsxs("p",{className:"fsrow__pending",style:Ma(0),children:["показаны первые ",yn.entries.length," — уточните запрос"]},"search:truncated")),le}return i.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(B?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:Vt,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{D&&(le.target.closest("button")||D())},children:[i.jsx(_j,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>rn("file"),children:i.jsx(xj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>rn("dir"),children:i.jsx(bj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:G,children:"↻"}),D&&i.jsx("button",{className:"sidepane__btn",title:B?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":B?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":B,onClick:D,children:i.jsx(Rc,{active:B})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:F,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(yj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:an,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>ct(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),an?ct(""):le.currentTarget.blur())}}),an&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>ct(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(ye===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:_n,onDrop:hn,onContextMenu:Xt,onTouchStart:Pe,onTouchMove:nt,onTouchEnd:Xe,onTouchCancel:Xe,children:Tn?el():Zt}),i.jsx(vr,{result:h}),fe&&i.jsx(ki,{x:fe.x,y:fe.y,items:kt(),onClose:Ot})]})}function hj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:C,onDragEnd:N,onDragOver:T,onDrop:A,onContextMenu:G,onTouchStart:F,onTouchMove:B,onTouchEnd:D,onTouchCancel:J}){const H="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return i.jsxs("div",{className:H,style:Ma(s),draggable:!0,onDragStart:C,onDragEnd:N,onDragOver:T,onDrop:A,onContextMenu:G,onTouchStart:F,onTouchMove:B,onTouchEnd:D,onTouchCancel:J,children:[i.jsxs("button",{className:"fsrow__main",onClick:y,title:B_(l),children:[i.jsx("span",{className:"fsrow__icon"+Bf("fsrow__icon",h),children:l.kind==="dir"?i.jsx(If,{open:r}):i.jsx(qf,{})}),i.jsx("span",{className:"fsrow__name"+Bf("fsrow__name",h),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&i.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),i.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${l.name}`,onClick:j,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function pj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Ma(0),onClick:r,title:B_(l),children:[i.jsx("span",{className:"fsrow__icon"+Bf("fsrow__icon",s),children:l.kind==="dir"?i.jsx(If,{}):i.jsx(qf,{})}),i.jsx("span",{className:"fsrow__name"+Bf("fsrow__name",s),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function B_(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Ma(l){return{"--depth":l}}function _b(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function mj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=gj(o.status);if(!d)continue;c(o.path,d);let h=xr(o.path);for(;c(h,d),!!h;)h=xr(h)}return s}function gj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function Bf(l,s){return s?` ${l}--git-${s}`:""}function If({open:l=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?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 qf(){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 xj(){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 bj(){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 _j(){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 yj(){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 vj=200;function jj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=_.useState(""),x=m.trim(),y=x.length>0,j=_.useRef(null),v=_.useRef(r);v.current=r;function C(A){g(A),j.current&&clearTimeout(j.current);const G=A.trim();if(!G){v.current("");return}j.current=setTimeout(()=>v.current(G),vj)}const N=y&&(s==null?void 0:s.query)===x?s:null;function T(){if(!N)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(N.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let G="";for(const F of N.matches)F.path!==G&&(G=F.path,A.push(i.jsx("p",{className:"searchgroup__path",title:F.path,children:F.path},`path:${F.path}`))),A.push(i.jsx(Sj,{match:F,onClick:()=>c(F)},`${F.path}:${F.line}:${F.column}`));return N.truncated&&A.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",N.matches.length," — уточните запрос"]},"grep:truncated")),A}return i.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:A=>{h&&(A.target.closest("button")||h())},children:[i.jsx(wj,{}),i.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&i.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Rc,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(kj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>C(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),m?C(""):A.currentTarget.blur())}}),m&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:y?T():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Sj({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return i.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:l.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function wj(){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 kj(){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 xf=null;function Nj(){return xf||(xf=Promise.all([Ke(()=>import("./index-DMdUw04H.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Ke(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Ke(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Ke(()=>import("./index-BW6uFCoV.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ke(()=>import("./codemirror-BrLcp4sb.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw xf=null,l})),xf}function Tj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),m=_.useRef(null),g=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),C=_.useRef(o),N=_.useRef(d),T=_.useRef(l),A=_.useRef(r),G=_.useRef(s);C.current=o,N.current=d,T.current=l,A.current=r,G.current=s;const[F,B]=_.useState("loading"),[D,J]=_.useState(!1);function H(I,Y,ae,W,ce){const ye=x.current.get(W),Oe=y.current.get(W)===ce;if(ye&&Oe)ae.setState(ye);else{const M=I.EditorState.create({doc:G.current,extensions:[I.basicSetup,I.Prec.highest(I.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(N.current(T.current),!0)}])),I.keymap.of([I.indentWithTab]),Y.of([]),I.editorTheme,I.editorHighlight,I.EditorView.updateListener.of(fe=>{fe.docChanged&&C.current(T.current,fe.state.doc.toString())})]});x.current.set(W,M),y.current.set(W,ce),ae.setState(M),j.current.delete(W)}if(j.current.has(W))return()=>{};let we=!1;return sj(W).then(M=>{we||!M||T.current!==W||(ae.dispatch({effects:Y.reconfigure(M)}),x.current.set(W,ae.state),j.current.add(W))}),()=>{we=!0}}_.useEffect(()=>{if(!h.current)return;let Y=!1,ae=null,W=null;B("loading"),J(!1);const ce=window.setTimeout(()=>{Y||J(!0)},200);return(async()=>{let ye;try{ye=await Nj()}catch{window.clearTimeout(ce),Y||B("error");return}if(Y||!h.current)return;window.clearTimeout(ce);const Oe=new ye.Compartment;v.current=Oe,g.current=ye,W=new ye.EditorView({parent:h.current}),m.current=W,ae=H(ye,Oe,W,T.current,A.current),B("ready")})(),()=>{Y=!0,window.clearTimeout(ce),ae==null||ae(),W==null||W.destroy(),m.current===W&&(m.current=null),g.current=null,v.current=null}},[]),_.useEffect(()=>{const I=g.current,Y=m.current,ae=v.current;if(!(!I||!Y||!ae))return H(I,ae,Y,l,r)},[l,r]);const z=_.useRef(0);return _.useEffect(()=>{const I=m.current,Y=g.current;if(!I||!Y||!c||c.token===z.current)return;z.current=c.token;const ae=I.state.doc.lines,W=Math.min(Math.max(c.line,1),ae),ce=I.state.doc.line(W),ye=Math.min(ce.from+Math.max(c.column-1,0),ce.to);I.dispatch({selection:Y.EditorSelection.cursor(ye),effects:Y.EditorView.scrollIntoView(ye,{y:"center"})}),I.focus()},[c]),_.useEffect(()=>()=>{const I=m.current;I&&x.current.set(l,I.state)},[l]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(F==="ready"?"":" is-hidden")}),F==="loading"&&D&&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:"Загружается редактор…"})]}),F==="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:s})]})]})}function Rs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=_.useState(!1),[x,y]=_.useState(0),j=_.useRef(null),v=_.useRef(null),C=s.find(A=>A.value===l)??null;_.useEffect(()=>{if(!m)return;const A=s.findIndex(G=>G.value===l);y(A===-1?0:A)},[m]),_.useEffect(()=>{if(!m)return;function A(G){var F;(F=j.current)!=null&&F.contains(G.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),_.useEffect(()=>{var A,G;m&&((G=(A=v.current)==null?void 0:A.querySelector(".is-cursor"))==null||G.scrollIntoView({block:"nearest"}))},[m,x]),_.useEffect(()=>{if(!m)return;const A=v.current,G=Ej(j.current);if(!A||!G)return;const F=A.getBoundingClientRect().bottom-G.getBoundingClientRect().bottom;F>0&&(G.scrollTop+=Math.min(F+8,A.offsetHeight))},[m]);function N(A){g(!1),A.value!==l&&r(A.value)}function T(A){if(A.key==="Escape"){if(!m)return;A.preventDefault(),A.stopPropagation(),g(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!m)return g(!0);const G=A.key==="ArrowDown"?1:s.length-1;return y(F=>(F+G)%s.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!m)return g(!0);const G=s[x];G&&N(G)}}return i.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(A=>!A),onKeyDown:T,children:[i.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),i.jsx(Cj,{})]}),m&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((A,G)=>i.jsxs("button",{type:"button",role:"option","aria-selected":A.value===l,className:"select__option"+(G===x?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>y(G),onClick:()=>N(A),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:A.label}),A.hint&&i.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function Ej(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function Cj(){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 Aj(){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 Mj(){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 Rj(){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 Dj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){_.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=Oj(r,s);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Df(d),"). Лимит — 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(l),children:"Повторить"})]}):m?s.startsWith("image/")?i.jsx(zj,{url:m}):s.startsWith("video/")?i.jsx(Hj,{url:m}):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 Oj(l,s){const[r,c]=_.useState(null);return _.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const vi=1,I_=8,bf=1.25;function Lj(l){return Math.min(I_,Math.max(vi,l))}function zj({url:l}){const[s,r]=_.useState({scale:vi,x:0,y:0}),[c,o]=_.useState(!1),d=_.useRef(null),h=_.useRef(null);function m(C,N,T){r(A=>{const G=Lj(A.scale*C);if(G===A.scale)return A;if(G<=vi)return{scale:vi,x:0,y:0};const F=(N-A.x)/A.scale,B=(T-A.y)/A.scale;return{scale:G,x:N-G*F,y:T-G*B}})}_.useEffect(()=>{const C=d.current;if(!C)return;function N(T){T.preventDefault();const A=C.getBoundingClientRect(),G=T.clientX-A.left-A.width/2,F=T.clientY-A.top-A.height/2;m(T.deltaY<0?bf:1/bf,G,F)}return C.addEventListener("wheel",N,{passive:!1}),()=>C.removeEventListener("wheel",N)},[]);function g(C){s.scale<=vi||(C.currentTarget.setPointerCapture(C.pointerId),h.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,origX:s.x,origY:s.y},o(!0))}function x(C){const N=h.current;!N||N.pointerId!==C.pointerId||r(T=>({...T,x:N.origX+(C.clientX-N.startX),y:N.origY+(C.clientY-N.startY)}))}function y(){h.current=null,o(!1)}const j=s.scale>vi,v=!j&&s.x===0&&s.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:x,onPointerUp:y,onPointerCancel:y,children:i.jsx("img",{src:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:s.scale<=vi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/bf,0,0),children:i.jsx(Mj,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:s.scale>=I_,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(bf,0,0),children:i.jsx(Aj,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:vi,x:0,y:0}),children:i.jsx(Rj,{})})]})]})}const Uj=[{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 Hj({url:l}){const s=_.useRef(null),[r,c]=_.useState("1");return _.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(Rs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Uj})]})]})}function Bj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=Aa(l),x=H_(l.path)&&!l.binary&&!l.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:l.path,children:l.path}),i.jsxs("span",{className:"editor__meta",children:[Df(l.size),l.eol==="crlf"&&" · CRLF"]}),x&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?i.jsx(Dj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Df(l.size)," на диске."]}):l.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Df(l.size),"). Такие правит агент, а не браузер."]}):x&&l.previewMode?i.jsx(Ij,{text:l.text}):i.jsx(Tj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Ij({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return Vf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function qj({files:l,activePath:s,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===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:"Агент работает"})]}),l.map(m=>i.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:rj(m.path)}),Aa(m)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Rc,{active:d})})]})}function ds(l){return l.claudeSessionId??l.id}function _f(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),d=[],h=[];for(const m of l)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function yb(l){return l.state!=="closed"}function vb(l){return[...l.filter(yb),...l.filter(s=>!yb(s))]}function yf(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),s,...o.slice(d)];return h.every((m,g)=>m===l[g])?null:h}function Ap(l,s,r,c){const o=l%10,d=l%100;return o===1&&d!==11?s:o>=2&&o<=4&&(d<12||d>14)?r:c}function q_(l){return`${l} ${Ap(l,"агент","агента","агентов")}`}function Gj(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(q_(s)),r>0&&c.push(`${r} ${Ap(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Yj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function $j(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function Xj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Vj({tasks:l,onStop:s}){const[r,c]=_.useState(!1),[o,d]=_.useState(()=>Date.now()),[h,m]=_.useState(()=>new Set);_.useEffect(()=>{const x=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(x)},[]),_.useEffect(()=>{m(x=>{const y=new Set(l.map(v=>v.id)),j=new Set([...x].filter(v=>y.has(v)));return j.size===x.size?x:j})},[l]);const g=x=>{m(y=>new Set(y).add(x)),s(x),window.setTimeout(()=>{m(y=>{if(!y.has(x))return y;const j=new Set(y);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:Gj(l)}),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:l.map(x=>{const y=h.has(x.id);return i.jsxs("li",{className:y?"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:Yj(x)}),x.background&&i.jsx("span",{className:"task__bg",children:"фон"}),i.jsx("span",{className:"task__time",children:$j(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:[Xj(x.tokens)," · ",x.toolUses," ",Ap(x.toolUses,"вызов","вызова","вызовов")]})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:y?"Останавливается":"Стоп"})]},x.id)})})]})}const Qj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Mp({className:l}){return i.jsx("img",{src:Qj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Kj=450,Zj=6,Fj=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Jj({disabled:l,providers:s,onStart:r}){const c=Fj.filter(Y=>s.includes(Y.id)),o=c.length>1,[d,h]=_.useState(!1),[m,g]=_.useState(0),[x,y]=_.useState({left:0,top:0}),j=_.useRef(null),v=_.useRef(null),C=_.useRef(null);function N(){C.current&&window.clearTimeout(C.current.timer),C.current=null}function T(){N(),g(0),h(!0)}function A(Y){var ae;h(!1),Y&&((ae=j.current)==null||ae.focus())}function G(Y){if(l||!o||Y.button!==0)return;const ae={timer:0,x:Y.clientX,y:Y.clientY,fired:!1};ae.timer=window.setTimeout(()=>{ae.fired=!0,T()},Kj),C.current=ae}function F(Y){const ae=C.current;!ae||ae.fired||Math.hypot(Y.clientX-ae.x,Y.clientY-ae.y)>Zj&&N()}function B(){C.current&&!C.current.fired&&N()}function D(Y){var W;if((W=C.current)!=null&&W.fired){C.current=null,Y.preventDefault();return}if(l)return;const ae=c[0];ae&&r(ae.id)}function J(Y){o&&(Y.preventDefault(),!l&&T())}function H(Y){if(l||!o)return;(Y.key==="ArrowDown"||Y.key==="ArrowUp"||Y.key==="Enter"&&Y.shiftKey)&&(Y.preventDefault(),T())}_.useLayoutEffect(()=>{if(!d)return;const Y=j.current,ae=v.current;if(!Y||!ae)return;const W=Y.getBoundingClientRect(),ce=ae.getBoundingClientRect(),ye=8,Oe=Math.max(ye,Math.min(W.right-ce.width,window.innerWidth-ce.width-ye));let we=W.top-ce.height-8;we<ye&&(we=Math.min(W.bottom+8,window.innerHeight-ce.height-ye)),y({left:Oe,top:we})},[d]),_.useLayoutEffect(()=>{var Y;d&&((Y=v.current)==null||Y.focus())},[d]),_.useLayoutEffect(()=>{if(!d)return;function Y(ae){var ce,ye;const W=ae.target;!((ce=v.current)!=null&&ce.contains(W))&&!((ye=j.current)!=null&&ye.contains(W))&&A(!1)}return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[d]);function z(Y){A(!1),r(Y.id)}function I(Y){if(Y.key==="Escape"){Y.preventDefault(),Y.stopPropagation(),A(!0);return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault();const ae=Y.key==="ArrowDown"?1:-1;g(W=>(W+ae+c.length)%c.length);return}if(Y.key==="Enter"||Y.key===" "){Y.preventDefault();const ae=c[m];ae&&z(ae);return}Y.key==="Tab"&&A(!1)}return i.jsxs("div",{className:"newsession",children:[i.jsxs("button",{ref:j,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?d:void 0,onClick:D,onContextMenu:J,onPointerDown:G,onPointerMove:F,onPointerUp:B,onPointerCancel:B,onPointerLeave:B,onKeyDown:H,children:["+ Сессия",o&&i.jsx(Wj,{})]}),d&&o&&i.jsx("div",{ref:v,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:I,children:c.map((Y,ae)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(ae===m?" is-cursor":""),onMouseEnter:()=>g(ae),onClick:()=>z(Y),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${Y.id}`,"aria-hidden":"true",children:Y.id==="antigravity"?i.jsx(Mp,{className:"newsession__mark-logo"}):i.jsx(Pj,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:Y.label}),i.jsx("span",{className:"newsession__hint",children:Y.hint})]})]},Y.id))})]})}function Wj(){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 Pj(){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 G_="ccv:sidebar.collapsed",Y_="ccv:sidebar.mode",$_="ccv:sidebar.foldersCollapsed",eS=500,Xh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function tS({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,sessions:g,archived:x,pinned:y,live:j,listOrder:v,liveSessionsFirst:C,onReorder:N,activeWorkspaceId:T,activeSessionId:A,onSelectWorkspace:G,onSelectSession:F,onRenameSession:B,onStopSession:D,onPinSessions:J,onSelectPinned:H,onCloseWorkspaces:z,onRestoreWorkspaces:I,onArchiveSessions:Y,onUnarchiveSessions:ae,onCreateFolder:W,onRenameFolder:ce,onSetFolderColor:ye,onDeleteFolder:Oe,onAssignToFolder:we,onOpenWorkspace:M,onNewSession:fe,enabledProviders:L,onOpenExtensions:xe,account:je,onOpenAccount:E,relay:X,onOpenRelay:oe,onOpenSettings:me,themeMode:Te,onCycleTheme:Ee}){var Ai;const[Ae,nt]=_.useState(null),[Xe,dt]=_.useState(null),[Ge,Ot]=_.useState(null);function lt(w){return(Ge==null?void 0:Ge.folderId)===w.id?Ge.color??void 0:w.color}function Xt(w){const ie=w&&lt(w);return ie?{"--folder-color":ie}:void 0}function Pe(w){return w?i.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const Vt=_.useRef(void 0),[xl,ht]=_.useState(null),[Kt,en]=_.useState(""),[_n,hn]=_.useState(gS),[an,rt]=_.useState(xS),[pt,Tn]=_.useState(bS);function En(w){Tn(w);try{localStorage.setItem(Y_,w)}catch{}}const Je=Kt.trim().toLowerCase(),ct=Je!=="",pn=_.useMemo(()=>_f(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),yn=_.useMemo(()=>{const w=_f(g,T?v==null?void 0:v.sessions[T]:void 0,ds,"top");return C?vb(w):w},[g,v,T,C]),Pn=_.useMemo(()=>{const w=_f(y,v==null?void 0:v.pinned,ds,"bottom");return C?vb(w):w},[y,v,C]),rn=_.useMemo(()=>_f(j,v==null?void 0:v.live,ds,"bottom"),[j,v]),kt=_.useMemo(()=>ct?pn.filter(w=>w.name.toLowerCase().includes(Je)||w.path.toLowerCase().includes(Je)):pn,[pn,Je,ct]),Zt=_.useMemo(()=>ct?o.filter(w=>w.name.toLowerCase().includes(Je)||w.path.toLowerCase().includes(Je)):o,[o,Je,ct]),vt=_.useMemo(()=>ct?yn.filter(w=>(w.title??"").toLowerCase().includes(Je)):yn,[yn,Je,ct]),el=_.useMemo(()=>ct?x.filter(w=>(w.title??"").toLowerCase().includes(Je)):x,[x,Je,ct]),le=w=>{var ie;return((ie=c.find(Me=>Me.id===w))==null?void 0:ie.name)??"—"},ge=w=>{var ie;return(ie=c.find(Me=>Me.id===w))==null?void 0:ie.path},Ue=_.useMemo(()=>ct?Pn.filter(w=>(w.title??"").toLowerCase().includes(Je)||le(w.workspaceId).toLowerCase().includes(Je)):Pn,[Pn,c,Je,ct]),U=_.useMemo(()=>ct?rn.filter(w=>(w.title??"").toLowerCase().includes(Je)||le(w.workspaceId).toLowerCase().includes(Je)):rn,[rn,c,Je,ct]),P=!ct;function be(w){hn(ie=>{const Me=ie.includes(w)?ie.filter($e=>$e!==w):[...ie,w];try{localStorage.setItem(G_,JSON.stringify(Me))}catch{}return Me})}const De=w=>!_n.includes(w);function qt(w){rt(ie=>{const Me=ie.includes(w)?ie.filter($e=>$e!==w):[...ie,w];try{localStorage.setItem($_,JSON.stringify(Me))}catch{}return Me})}const Cn=w=>!an.includes(w),tn=_.useMemo(()=>zo(kt,d),[kt,d]),$n=_.useMemo(()=>zo(Zt,d),[Zt,d]),Xn=_.useMemo(()=>zo(vt,h),[vt,h]),Gl=_.useMemo(()=>zo(el,h),[el,h]),Yl=_.useMemo(()=>zo(Ue,m,w=>w.pinnedFolderId),[Ue,m]),$l=_.useMemo(()=>({groups:[],ungrouped:U}),[U]),ms=((v==null?void 0:v.workspaces.length)??0)>0,Os=T?(((Ai=v==null?void 0:v.sessions[T])==null?void 0:Ai.length)??0)>0:!1,cn=((v==null?void 0:v.pinned.length)??0)>0,sa=((v==null?void 0:v.live.length)??0)>0,cl=vf({enabled:P,scope:"workspaces",itemKey:w=>w.id,groups:tn.groups,ungrouped:tn.ungrouped,onReorder:N}),tl=vf({enabled:P,scope:"sessions",workspaceId:T??void 0,itemKey:ds,groups:Xn.groups,ungrouped:Xn.ungrouped,onReorder:N}),Lt=vf({enabled:P,scope:"pinned",itemKey:ds,groups:Yl.groups,ungrouped:Yl.ungrouped,onReorder:N}),Ve=vf({enabled:P,scope:"live",itemKey:ds,groups:$l.groups,ungrouped:$l.ungrouped,onReorder:N});_.useEffect(()=>{var Me;if(!Ge)return;const ie=(Me=[...Yl.groups,...tn.groups,...$n.groups,...Xn.groups,...Gl.groups].find($e=>$e.folder.id===Ge.folderId))==null?void 0:Me.folder;ie&&ie.color===(Ge.color??void 0)&&Ot(null)},[Ge,Yl,tn,$n,Xn,Gl]),_.useEffect(()=>()=>window.clearTimeout(Vt.current),[]);const mn=Qh(kt),on=Qh(Zt),El=Qh(vt),[et,ss]=_.useState(null),[Nt,Cl]=_.useState(null),[xt,Al]=_.useState(null),[un,At]=_.useState(null),[We,Tt]=_.useState(null),Ml=_.useRef(null);function vn(w,ie){const Me=w.touches[0];if(!Me)return;const $e={timer:0,x:Me.clientX,y:Me.clientY,el:w.currentTarget,fired:!1};$e.timer=window.setTimeout(()=>{$e.fired=!0,ie($e.x,$e.y,$e.el)},eS),Ml.current=$e}function Bn(w){const ie=Ml.current,Me=w.touches[0];!ie||!Me||Math.hypot(Me.clientX-ie.x,Me.clientY-ie.y)>10&&(window.clearTimeout(ie.timer),Ml.current=null)}function nl(w){const ie=Ml.current;ie&&(window.clearTimeout(ie.timer),ie.fired&&w.preventDefault())}function Vn(){var w;return(w=Ml.current)!=null&&w.fired?(Ml.current=null,!0):!1}function Xl(){const w=et==null?void 0:et.opener;ss(null),w!=null&&w.isConnected&&w.focus()}function An(){const w=Nt==null?void 0:Nt.opener;Cl(null),w!=null&&w.isConnected&&w.focus()}function ol(){const w=xt==null?void 0:xt.opener;Al(null),w!=null&&w.isConnected&&w.focus()}function Qn(){const w=un==null?void 0:un.opener;At(null),w!=null&&w.isConnected&&w.focus()}function jn(){const w=We==null?void 0:We.opener;Tt(null),w!=null&&w.isConnected&&w.focus()}function zt(w){return{onContextMenu:ie=>{ie.preventDefault(),ss({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:mn.targetsFor(w)})},onTouchStart:ie=>vn(ie,(Me,$e,ul)=>ss({x:Me,y:$e,opener:ul,ids:mn.targetsFor(w)})),onTouchMove:Bn,onTouchEnd:nl,onTouchCancel:nl}}function Da(w){return{onContextMenu:ie=>{ie.preventDefault(),Cl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:on.targetsFor(w)})},onTouchStart:ie=>vn(ie,(Me,$e,ul)=>Cl({x:Me,y:$e,opener:ul,ids:on.targetsFor(w)})),onTouchMove:Bn,onTouchEnd:nl,onTouchCancel:nl}}function Ci(w){return{onContextMenu:ie=>{ie.preventDefault(),Al({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:El.targetsFor(w)})},onTouchStart:ie=>vn(ie,(Me,$e,ul)=>Al({x:Me,y:$e,opener:ul,ids:El.targetsFor(w)})),onTouchMove:Bn,onTouchEnd:nl,onTouchCancel:nl}}function Ls(w){return{onContextMenu:ie=>{ie.preventDefault(),At({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>vn(ie,(Me,$e,ul)=>At({x:Me,y:$e,opener:ul,ids:[w.id]})),onTouchMove:Bn,onTouchEnd:nl,onTouchCancel:nl}}function aa(w){return{onContextMenu:ie=>{ie.preventDefault(),Tt({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>vn(ie,(Me,$e,ul)=>Tt({x:Me,y:$e,opener:ul,ids:[w.id]})),onTouchMove:Bn,onTouchEnd:nl,onTouchCancel:nl}}const gs=g.filter(w=>w.state!=="closed").length,Vl=et?kt.find(w=>w.id===et.ids[0]):void 0,Kn=et?[{id:"close",label:et.ids.length>1?`Закрыть проекты (${et.ids.length})`:"Закрыть проект",onSelect:()=>{z(et.ids),mn.clear()}},...Uo({folders:d,ids:et.ids,hasFolder:(Vl==null?void 0:Vl.folderId)!=null,assign:(w,ie)=>we("workspace",w,ie),onClear:()=>mn.clear(),onNewFolder:()=>ht("workspace")}),...et.ids.length===1&&P?cl.menuItems(et.ids[0],ms):[]]:[],xs=et?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(T&&et.ids.includes(T)&&gs>0?` в нём сейчас незавершённых сессий: ${gs} — при закрытии они остановятся на хосте.`:""):void 0,bs=Nt?Zt.find(w=>w.id===Nt.ids[0]):void 0,bl=Nt?[{id:"restore",label:Nt.ids.length>1?`Вернуть проекты (${Nt.ids.length})`:"Вернуть проект",onSelect:()=>{I(Nt.ids),on.clear()}},...Uo({folders:d,ids:Nt.ids,hasFolder:(bs==null?void 0:bs.folderId)!=null,assign:(w,ie)=>we("workspace",w,ie),onClear:()=>on.clear(),onNewFolder:()=>ht("workspace")})]:[],Qt=Nt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,pe=xt?vt.find(w=>w.id===xt.ids[0]):void 0,k=(pe==null?void 0:pe.pinned)!==!0,V=xt?[...xt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>nt(xt.ids[0])}]:[],{id:"pin",label:k?xt.ids.length>1?`Закрепить (${xt.ids.length})`:"Закрепить":xt.ids.length>1?`Открепить (${xt.ids.length})`:"Открепить",onSelect:()=>{pe&&J(pe.workspaceId,xt.ids,k),El.clear()}},{id:"archive",label:xt.ids.length>1?`Убрать в архив (${xt.ids.length})`:"Убрать в архив",onSelect:()=>{Y(T,xt.ids),El.clear()}},...Uo({folders:h,ids:xt.ids,hasFolder:(pe==null?void 0:pe.folderId)!=null,assign:(w,ie)=>we("session",w,ie,T),onClear:()=>El.clear(),onNewFolder:()=>ht("session")}),...xt.ids.length===1&&P&&pe?tl.menuItems(ds(pe),Os):[]]:[],de=xt?Xh:void 0,ve=un?Ue.find(w=>w.id===un.ids[0]):void 0,Le=un?[{id:"rename",label:"Переименовать",onSelect:()=>nt(un.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ve&&J(ve.workspaceId,[ve.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ve&&Y(ve.workspaceId,[ve.id])}},...ve&&ve.workspaceId===T?Uo({folders:h,ids:[ve.id],hasFolder:ve.folderId!=null,assign:(w,ie)=>we("session",w,ie,ve.workspaceId),onClear:()=>{},onNewFolder:()=>ht("session")}):[],...aS(ve?Uo({folders:m,ids:[ve.id],hasFolder:ve.pinnedFolderId!=null,assign:(w,ie)=>we("pinned",w,ie),onClear:()=>{},onNewFolder:()=>ht("pinned")}):[]),...P&&ve?Lt.menuItems(ds(ve),cn):[]]:[],ke=We?U.find(w=>w.id===We.ids[0]):void 0,jt=We?[{id:"stop",label:"Остановить",onSelect:()=>{ke&&D(ke)}},{id:"rename",label:"Переименовать",onSelect:()=>nt(We.ids[0])},{id:"pin",label:(ke==null?void 0:ke.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{ke&&J(ke.workspaceId,[ke.id],ke.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ke&&Y(ke.workspaceId,[ke.id])}},...P&&ke?Ve.menuItems(ds(ke),sa):[]]:[];function Mt(w,ie){return i.jsxs("div",{"data-row-key":w.id,className:dc(w.id===T,mn.selected.includes(w.id),!1,!!ie)+cl.dropClass(w.id),style:Xt(ie),...zt(w),children:[Pe(ie),P&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...cl.gripHandlers(w.id),children:i.jsx(jf,{})}),i.jsxs("button",{className:"row__main",onClick:Me=>{Vn()||mn.click(Me,w,()=>G(w.id))},onKeyDown:Me=>cl.onKeyDown(w.id,Me),children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",title:w.path,children:w.path})]})]},w.id)}function Sn(w,ie){return i.jsxs("div",{className:dc(w.id===T,on.selected.includes(w.id),!1,!!ie),style:Xt(ie),...Da(w),children:[Pe(ie),i.jsxs("button",{className:"row__main",onClick:Me=>{Vn()||on.click(Me,w,()=>G(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:NS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>I([w.id]),children:"Вернуть"})]},w.id)}function ot(w,ie){const Me=ds(w);return i.jsxs("div",{"data-row-key":Me,className:dc(w.id===A,El.selected.includes(w.id),w.provider==="antigravity",!!ie)+tl.dropClass(Me),style:Xt(ie),...Ae===w.id?{}:Ci(w),children:[Pe(ie),Ae===w.id?i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:w.title??"",onCommit:$e=>{B(w,$e),nt(null)},onCancel:()=>nt(null)})}):i.jsxs(i.Fragment,{children:[P&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...tl.gripHandlers(Me),children:i.jsx(jf,{})}),i.jsxs("button",{className:"row__main",onClick:$e=>{Vn()||El.click($e,w,()=>F(w))},onKeyDown:$e=>tl.onKeyDown(Me,$e),children:[i.jsx(Sf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:le(w.workspaceId),projectPath:ge(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Vn()||nt(w.id)},children:"✎"})]})]},w.id)}function nn(w,ie){return i.jsxs("div",{className:dc(w.id===A,!1,w.provider==="antigravity",!!ie),style:Xt(ie),children:[Pe(ie),i.jsxs("button",{className:"row__main",onClick:()=>F(w),children:[i.jsx(Sf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:le(w.workspaceId),projectPath:ge(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:kS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>ae([w.id]),children:"Вернуть"})]},w.id)}function Gt(w,ie){const Me=ds(w);return i.jsxs("div",{"data-row-key":Me,className:dc(w.id===A,!1,w.provider==="antigravity",!!ie)+Lt.dropClass(Me),style:Xt(ie),...Ae===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ls(w)},children:[Pe(ie),Ae===w.id?i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:w.title??"",onCommit:$e=>{B(w,$e),nt(null)},onCancel:()=>nt(null)})}):i.jsxs(i.Fragment,{children:[P&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Lt.gripHandlers(Me),children:i.jsx(jf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{Vn()||H(w)},onKeyDown:$e=>Lt.onKeyDown(Me,$e),children:[i.jsx(Sf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:le(w.workspaceId),projectPath:ge(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})]},w.id)}function Rl(w){const ie=ds(w);return i.jsx("div",{"data-row-key":ie,className:dc(w.id===A,!1,w.provider==="antigravity")+Ve.dropClass(ie),...Ae===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...aa(w)},children:Ae===w.id?i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:w.title??"",onCommit:Me=>{B(w,Me),nt(null)},onCancel:()=>nt(null)})}):i.jsxs(i.Fragment,{children:[P&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ve.gripHandlers(ie),children:i.jsx(jf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{Vn()||H(w)},onKeyDown:Me=>Ve.onKeyDown(ie,Me),children:[i.jsx(Sf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:le(w.workspaceId),projectPath:ge(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Me=>{Me.stopPropagation(),!Vn()&&D(w)},children:i.jsx(dS,{})})]})},w.id)}function ll(w,ie){return i.jsx(uS,{folder:w,count:ie,open:Cn(w.id),renaming:Xe===w.id,onToggle:()=>qt(w.id),onStartRename:()=>dt(w.id),onCommitRename:Me=>{ce(w.id,Me),dt(null)},onCancelRename:()=>dt(null),onDelete:()=>Oe(w.id),color:lt(w),onPreviewColor:Me=>{window.clearTimeout(Vt.current),Ot({folderId:w.id,color:Me})},onCommitColor:Me=>{Ot({folderId:w.id,color:Me}),ye(w.id,Me),window.clearTimeout(Vt.current),Vt.current=window.setTimeout(()=>Ot(null),4e3)},onResetColor:()=>{window.clearTimeout(Vt.current),Ot(null),ye(w.id,null)}},w.id)}return i.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:s?"dot dot--on":"dot",title:r}),i.jsx("span",{className:"brand",children:"Claude Code Visual"}),i.jsx("button",{className:"theme-btn",title:`Тема: ${Sb[Te]}`,"aria-label":`Тема: ${Sb[Te]}. Переключить`,onClick:Ee,children:i.jsx(_S,{mode:Te})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":pt==="default",className:pt==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>En("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":pt==="pinned",className:pt==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>En("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":pt==="live",className:pt==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>En("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(pS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:Kt,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>en(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),Kt?en(""):w.currentTarget.blur())}}),Kt&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>en(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:pt==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(hc,{title:"Закреплённые",count:Ue.length,open:De("pinned"),onToggle:()=>be("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{ht("pinned"),De("pinned")||be("pinned")}}}),De("pinned")&&i.jsxs(i.Fragment,{children:[xl==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:"",placeholder:"Название папки",onCommit:w=>{W("pinned",w),ht(null)},onCancel:()=>ht(null)})})}),Ue.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ct?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Yl.groups.map(w=>i.jsxs(_.Fragment,{children:[ll(w.folder,w.items.length),Cn(w.folder.id)&&w.items.map(ie=>Gt(ie,w.folder))]},w.folder.id)),Yl.ungrouped.map(w=>Gt(w))]})]}):pt==="live"?i.jsxs(i.Fragment,{children:[i.jsx(hc,{title:"Запущенные",count:U.length,open:De("live"),onToggle:()=>be("live")}),De("live")&&i.jsxs(i.Fragment,{children:[U.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ct?"Ничего не найдено":"Нет запущенных сессий"})}),U.map(w=>Rl(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(hc,{title:"Проекты",count:kt.length,open:De("workspaces"),onToggle:()=>be("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{ht("workspace"),De("workspaces")||be("workspaces")}}}),De("workspaces")&&i.jsxs(i.Fragment,{children:[xl==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:"",placeholder:"Название папки",onCommit:w=>{W("workspace",w),ht(null)},onCancel:()=>ht(null)})})}),kt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ct?"Ничего не найдено":"Пока ни одного"})}),tn.groups.map(w=>i.jsxs(_.Fragment,{children:[ll(w.folder,w.items.length),Cn(w.folder.id)&&w.items.map(ie=>Mt(ie,w.folder))]},w.folder.id)),tn.ungrouped.map(w=>Mt(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(hc,{title:"Архив проектов",count:Zt.length,open:De("workspacesArchive"),onToggle:()=>be("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),De("workspacesArchive")&&i.jsxs(i.Fragment,{children:[Zt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ct?"Ничего не найдено":"Пока пусто"})}),$n.groups.map(w=>i.jsxs(_.Fragment,{children:[ll(w.folder,w.items.length),Cn(w.folder.id)&&w.items.map(ie=>Sn(ie,w.folder))]},w.folder.id)),$n.ungrouped.map(w=>Sn(w))]})]}),T&&i.jsxs(i.Fragment,{children:[i.jsx(hc,{title:"Сессии",count:vt.length,open:De("sessions"),onToggle:()=>be("sessions"),action:{label:"Новая папка сессий",onClick:()=>{ht("session"),De("sessions")||be("sessions")}}}),De("sessions")&&i.jsxs(i.Fragment,{children:[xl==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:"",placeholder:"Название папки",onCommit:w=>{W("session",w,T),ht(null)},onCancel:()=>ht(null)})})}),vt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ct?"Ничего не найдено":"Пока ни одной"})}),Xn.groups.map(w=>i.jsxs(_.Fragment,{children:[ll(w.folder,w.items.length),Cn(w.folder.id)&&w.items.map(ie=>ot(ie,w.folder))]},w.folder.id)),Xn.ungrouped.map(w=>ot(w))]}),x.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(hc,{title:"Архив",count:el.length,open:De("archive"),onToggle:()=>be("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),De("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),el.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:ct?"Ничего не найдено":"Пока пусто"})}),Gl.groups.map(w=>i.jsxs(_.Fragment,{children:[ll(w.folder,w.items.length),Cn(w.folder.id)&&w.items.map(ie=>nn(ie,w.folder))]},w.folder.id)),Gl.ungrouped.map(w=>nn(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:E,children:[i.jsx("span",{className:je!=null&&je.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:je===null?"Аккаунт":je.loggedIn?je.email||"Вход выполнен":"Войти в аккаунт"}),(je==null?void 0:je.plan)&&i.jsx("span",{className:"chip",children:je.plan})]}),oe&&i.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:oe,children:[i.jsx("span",{className:X!=null&&X.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:X===null?"Удалённый доступ":X.paired?X.connected?X.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(X==null?void 0:X.connected)&&X.clients>0&&i.jsx("span",{className:"chip",children:X.clients})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",disabled:!xe,title:"MCP-серверы и плагины",onClick:()=>xe==null?void 0:xe(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:me,children:"Настройки"})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",onClick:M,children:"+ Проект"}),i.jsx(Jj,{disabled:!T,providers:L,onStart:fe})]})]}),et&&i.jsx(ki,{x:et.x,y:et.y,items:Kn,note:xs,onClose:Xl}),Nt&&i.jsx(ki,{x:Nt.x,y:Nt.y,items:bl,note:Qt,onClose:An}),xt&&i.jsx(ki,{x:xt.x,y:xt.y,items:V,note:de,onClose:ol}),un&&i.jsx(ki,{x:un.x,y:un.y,items:Le,note:Xh,onClose:Qn}),We&&i.jsx(ki,{x:We.x,y:We.y,items:jt,note:Xh,onClose:jn})]})}function dc(l,s,r,c){const o=["row"];return c&&o.push("row--foldered"),l&&o.push("row--active"),s&&o.push("row--selected"),r&&o.push("row--antigravity"),o.join(" ")}function zo(l,s,r=c=>c.folderId){const c=new Map(s.map(m=>[m.id,m])),o=new Map,d=[];for(const m of l){const g=r(m),x=g?c.get(g):void 0;if(!x){d.push(m);continue}const y=o.get(x.id);y?y.push(m):o.set(x.id,[m])}return{groups:[...o.entries()].map(([m,g])=>({folder:c.get(m),items:g})).sort((m,g)=>m.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:d}}function nS(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const lS="\0ungrouped";function sS(l,s,r){const c=new Map;for(const o of l)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of s)c.set(r(o),lS);return c}function Vh(l,s,r,c,o){const d=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!d)return null;const h=d.findIndex(m=>c(m)===l);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function vf(l){const[s,r]=_.useState(null),[c,o]=_.useState(null),d=_.useMemo(()=>nS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=_.useMemo(()=>sS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g(G,F){l.enabled&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),r(G),o(null))}function x(G,F){var z;if(!s)return;const B=(z=document.elementFromPoint(G,F))==null?void 0:z.closest("[data-row-key]"),D=B==null?void 0:B.dataset.rowKey;if(!D||D===s||h.get(D)!==h.get(s)){o(null);return}const J=B.getBoundingClientRect(),H=F-J.top<J.height/2?"before":"after";o(I=>(I==null?void 0:I.key)===D&&I.position===H?I:{key:D,position:H})}function y(G){x(G.clientX,G.clientY)}function j(){if(s&&c){const G=yf(d,s,c.key,c.position);G&&l.onReorder(l.scope,G,l.workspaceId)}m()}function v(G,F){if(!l.enabled)return;const B=Vh(G,l.groups,l.ungrouped,l.itemKey,F);if(!B)return;const D=yf(d,G,B.target,B.position);D&&l.onReorder(l.scope,D,l.workspaceId)}function C(G,F){const B=Vh(G,l.groups,l.ungrouped,l.itemKey,"up"),D=Vh(G,l.groups,l.ungrouped,l.itemKey,"down"),J=[{id:"move-up",label:"Переместить выше",disabled:!B,onSelect:()=>{if(!B)return;const H=yf(d,G,B.target,B.position);H&&l.onReorder(l.scope,H,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!D,onSelect:()=>{if(!D)return;const H=yf(d,G,D.target,D.position);H&&l.onReorder(l.scope,H,l.workspaceId)}}];return F&&J.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),J}function N(G){return s===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function T(G){return{onPointerDown:F=>g(G,F),onPointerMove:y,onPointerUp:j,onPointerCancel:m}}function A(G,F){!F.altKey||F.key!=="ArrowUp"&&F.key!=="ArrowDown"||(F.preventDefault(),v(G,F.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:N,gripHandlers:T,onKeyDown:A,menuItems:C}}function Uo(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function aS(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Qh(l){const[s,r]=_.useState([]),c=_.useRef(null);function o(){r([]),c.current=null}function d(m,g,x){if(m.ctrlKey||m.metaKey){r(y=>y.includes(g.id)?y.filter(j=>j!==g.id):[...y,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const y=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,C]=y<j?[y,j]:[j,y];r(l.slice(v,C+1).map(N=>N.id));return}}o(),c.current=g.id,x()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const iS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},rS={width:22,height:22,borderRadius:6};function hc({title:l,count:s,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:iS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(X_,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:l}),i.jsx("span",{className:"sidebar__count",children:s})]}),d&&i.jsx("button",{className:"theme-btn",style:rS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(mS,{})})]})}const jb={paddingLeft:22},cS={display:"flex",alignItems:"center",gap:6,width:"100%"},oS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function uS({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g,color:x,onPreviewColor:y,onCommitColor:j,onResetColor:v}){const C=_.useRef(null),N=_.useRef(j);return N.current=j,_.useEffect(()=>{const T=C.current;if(!T)return;const A=()=>N.current(T.value);return T.addEventListener("change",A),()=>T.removeEventListener("change",A)},[c]),c?i.jsx("div",{className:"row",style:jb,children:i.jsx("div",{className:"row__main",children:i.jsx(ta,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):i.jsxs("div",{className:"row",style:jb,children:[i.jsxs("button",{className:"row__main",style:cS,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[i.jsx(X_,{open:r}),i.jsx("span",{style:oS,children:l.name}),i.jsx("span",{className:"sidebar__count",children:s})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:d,children:"✎"}),i.jsxs("label",{className:x?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[i.jsx("span",{className:"row__swatch-dot",style:x?{background:x}:void 0}),i.jsx("input",{ref:C,type:"color",value:x??fS(),"aria-label":`Цвет папки «${l.name}»`,onChange:T=>y(T.target.value)})]}),l.color&&i.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${l.name}»`,onClick:v,children:"↺"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:g,children:"✕"})]})}function fS(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function X_({open:l}){return i.jsx("svg",{className:l?"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 jf(){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 dS(){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 hS({className:l}){return i.jsxs("svg",{className:l,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 pS(){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 mS(){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 gS(){try{const l=localStorage.getItem(G_);if(l===null)return["archive","workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function xS(){try{const l=localStorage.getItem($_);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function bS(){try{const l=localStorage.getItem(Y_);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Sb={system:"как в системе",light:"светлая",dark:"тёмная"};function _S({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?i.jsx("svg",{...s,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"})}):l==="light"?i.jsxs("svg",{...s,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",{...s,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 yS(l){const s=vS(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${q_(r)}`:s}function vS(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":jS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function jS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function SS(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":wS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function wS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Kh({session:l,tail:s}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${SS(l)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),yS(l)]})," · ",s]})}function Sf({title:l,pinned:s,provider:r,projectName:c,projectPath:o}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[s&&i.jsx(hS,{className:"row__pin"}),r==="antigravity"&&i.jsx(Mp,{className:"row__provider"}),l]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function kS(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function NS(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const wb=3,TS=15e5;function V_(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=Zh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=MS(ES(Zh(r.old_string),Zh(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function Zh(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function ES(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(d),...CS(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function CS(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(y=>({type:"add",text:y}));if(s.length===0)return l.map(y=>({type:"del",text:y}));if((l.length+1)*(s.length+1)>TS)return[...l.map(y=>({type:"del",text:y})),...s.map(y=>({type:"add",text:y}))];const r=l.length,c=s.length,o=c+1,d=new Uint32Array((r+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=r-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=l[y]===s[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,x=0;for(;g<r&&x<c;){const y=l[g],j=s[x];y===j?(m.push({type:"ctx",text:y}),g++,x++):h(g+1,x)>=h(g,x+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),x++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;x<c;)m.push({type:"add",text:s[x++]});return AS(m)}function AS(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function MS(l){if(!l.some(d=>d.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-wb);m<=Math.min(l.length-1,h+wb);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${RS(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function RS(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function la(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function hp(){try{return await navigator.clipboard.readText()}catch{return null}}const Rp=1600,br="Копировать",yc="Скопировано";function Ac({text:l,hint:s,className:r}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Rp);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[l]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?yc:`${br} ${s}`,title:c?yc:`${br} ${s}`,onClick:()=>{la(l).then(d=>{d&&o(!0)})},children:c?yc:br})}function Dp({diff:l}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&i.jsx("div",{className:"diff__note",children:l.note}),i.jsx("div",{className:"diff__body",children:l.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>i.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function DS({waiting:l}){const[s,r]=_.useState(0);return _.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),i.jsxs("div",{className:l?"work work--wait":"work",children:[i.jsxs("span",{className:"work__dots","aria-hidden":"true",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:l?"ждёт разрешения":"думает"}),!l&&i.jsxs("span",{className:"work__time",children:[s," с"]})]})}function Op({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=_.useRef(null),j=_.useRef(null),v=_.useRef(!0),C=_.useRef(null),N=_.useRef(null),T=_.useRef(!1);_.useEffect(()=>{v.current=!0,C.current=null,T.current=!1,N.current!==null&&(clearTimeout(N.current),N.current=null)},[m]),_.useEffect(()=>{const D=y.current,J=j.current;if(!D||!J)return;function H(Y){!D||Y===D.scrollTop||(T.current=!0,D.scrollTop=Y)}function z(){if(!D)return;const Y=C.current;if(Y){const ae=Nb(D,Y.id);if(ae){const W=ae.getBoundingClientRect().top-D.getBoundingClientRect().top;H(D.scrollTop+(W-Y.top))}N.current!==null&&clearTimeout(N.current),N.current=setTimeout(()=>{C.current=null},500);return}v.current&&H(D.scrollHeight)}const I=new ResizeObserver(z);return I.observe(J),()=>{I.disconnect(),N.current!==null&&clearTimeout(N.current)}},[]);function A(){const D=y.current;if(D){if(T.current){T.current=!1;return}v.current=D.scrollHeight-D.scrollTop-D.clientHeight<80}}function G(){if(d)return;const D=y.current,J=c[0];if(D&&J){const H=Nb(D,J.id);H&&(C.current={id:J.id,top:H.getBoundingClientRect().top-D.getBoundingClientRect().top})}h==null||h()}let F=0;function B(D){return D.kind==="user"?F++:-1}return i.jsx("div",{className:"transcript",ref:y,onScroll:A,children:i.jsxs("div",{className:"stream",ref:j,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:G,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(D=>i.jsx(kb,{item:D,userIndex:B(D),onEditMessage:g},D.id)),c.length>0&&l.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&i.jsx("p",{className:"empty",children:x}),l.map(D=>i.jsx(kb,{item:D,userIndex:B(D),onEditMessage:g},D.id)),s&&i.jsx(DS,{waiting:r})]})})}function kb({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return i.jsx(LS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[i.jsx(zS,{text:l.text}),l.streaming&&i.jsx("span",{className:"caret"}),l.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(Ac,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return i.jsx(HS,{item:l});case"result":return i.jsxs("div",{className:"result-line","data-item-id":l.id,children:[i.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),i.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&i.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",Eb(l.inputTokens)," ↓",Eb(l.outputTokens)]})]});case"notice":return i.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const OS=500;function LS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=_.useState(null),[d,h]=_.useState(!1),[m,g]=_.useState(l.text),x=_.useRef(null),y=Yf("(max-width: 860px)"),j=_.useRef(null);function v(z,I){o({x:z,y:I})}function C(z){z.preventDefault(),v(z.clientX,z.clientY)}function N(z){const I=z.touches[0];if(!I)return;const Y={timer:0,x:I.clientX,y:I.clientY,fired:!1};Y.timer=window.setTimeout(()=>{Y.fired=!0,v(Y.x,Y.y)},OS),j.current=Y}function T(z){const I=j.current,Y=z.touches[0];!I||!Y||Math.hypot(Y.clientX-I.x,Y.clientY-I.y)>10&&(window.clearTimeout(I.timer),j.current=null)}function A(z){const I=j.current;I&&(window.clearTimeout(I.timer),I.fired&&z.preventDefault())}function G(){g(l.text),h(!0)}function F(){h(!1)}function B(){const z=m.trim();z===""&&!(l.images&&l.images.length>0)||(r==null||r(s,z,l.images),h(!1))}_.useEffect(()=>{const z=x.current;!z||!d||(z.style.height="auto",z.style.height=`${z.scrollHeight}px`)},[m,d]),_.useEffect(()=>{if(!d)return;const z=x.current;z&&(z.focus(),z.setSelectionRange(z.value.length,z.value.length))},[d]);function D(z){if(z.key==="Escape"){z.preventDefault(),z.stopPropagation(),F();return}z.key==="Enter"&&!z.shiftKey&&!y&&(z.preventDefault(),B())}const J=l.images&&l.images.length>0&&i.jsx("div",{className:"msg--user__images",children:l.images.map((z,I)=>i.jsx("img",{className:"msg--user__image",src:`data:${z.mediaType};base64,${z.data}`,alt:"Вложение"},I))});if(d){const z=m.trim()!==""||!!(l.images&&l.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[J,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:I=>g(I.target.value),onKeyDown:D,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:F,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:B,disabled:!z,children:"Сохранить"})]})]})]})}const H=[{id:"copy",label:"Копировать",onSelect:()=>void la(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:G}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:C,onTouchStart:N,onTouchMove:T,onTouchEnd:A,onTouchCancel:A,children:[J,l.text,c&&i.jsx(ki,{x:c.x,y:c.y,items:H,onClose:()=>o(null)})]})}function Nb(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function zS({text:l}){const[s,r]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return Vf(l).then(h=>{d||r(US(h))}),()=>{d=!0}},[l]),_.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";m!==""&&la(m).then(y=>{if(!y)return;h.textContent=yc,h.setAttribute("aria-label",yc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=br,h.setAttribute("aria-label",pp),h.classList.remove("copybtn--done"))},Rp);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const pp=`${br} блок кода`;function US(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",pp),o.title=pp,o.textContent=br,c.append(o)}return s.body.innerHTML}function HS({item:l}){const[s,r]=_.useState(!1),c=l.result===null,o=V_(l.name,l.input),d=l.name==="AskUserQuestion"?qS(l.input):null;return i.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[i.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__name",children:l.name}),i.jsx("span",{className:"tool__arg",children:d?IS(d):BS(l.input)}),i.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(GS,{questions:d,answers:l.answers}):o?i.jsx(Dp,{diff:o}):i.jsx(Tb,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&i.jsx(Tb,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Tb({text:l,hint:s,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:l}),i.jsx(Ac,{text:l,hint:s,className:"codeblock__copy"})]})}function BS(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function IS(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function qS(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:y,description:j,preview:v}=x;if(typeof y!="string"||typeof j!="string")return null;g.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function GS({questions:l,answers:s}){return i.jsx("div",{className:"tool__questions",children:l.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:s!=null&&s[r.question]?i.jsx("span",{className:"tool__answer-value",children:s[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Eb(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const YS="ccv.dictation.lang",Cb="ru-RU";function $S(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Ab(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find($S);return!r&&s.length>0&&Cs("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function Q_(){var l;try{return((l=localStorage.getItem(YS))==null?void 0:l.trim())||Cb}catch{return Cb}}function Cs(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const XS=3,VS=400,QS=5,KS=250,ZS=2e3,FS=2e4;async function JS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const WS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Q_()}`};function PS(l){const[s]=_.useState(()=>Ab()!==null),[r,c]=_.useState(!1),[o,d]=_.useState(null),h=_.useRef(null),m=_.useRef(!1),g=_.useRef(!1),x=_.useRef(l),y=_.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=_.useRef(null),v=_.useRef(!1),C=_.useRef(null),N=_.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),T=_.useCallback(()=>{N();const D=async J=>{if(C.current=null,!(!m.current||v.current)){if(!J&&!await JS()){if(Cs("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void D(!0),FS);return}Cs("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void D(!1),ZS)},[N]);_.useEffect(()=>{x.current=l}),_.useEffect(()=>{const D=Ab();if(!D)return;const J=new D;return J.lang=Q_(),J.continuous=!0,J.interimResults=!0,J.onstart=()=>{Cs("сессия открыта"),v.current=!0,N(),c(!0)},J.onaudiostart=()=>{Cs("пошёл звук с микрофона"),y.current.audio=!0},J.onresult=H=>{var ae;if(g.current)return;let z="",I="";for(let W=H.resultIndex;W<H.results.length;W++){const ce=H.results[W];if(!ce)continue;const ye=((ae=ce[0])==null?void 0:ae.transcript)??"";ce.isFinal?z+=ye:I+=ye}const Y=y.current;Y.heard=!0,Y.everHeard=!0,Cs("распознано",{final:z,interim:I}),x.current(z,I)},J.onerror=H=>{y.current.lastError=H.error,Cs("ошибка движка",H.error),!(H.error==="no-speech"||H.error==="aborted")&&(m.current=!1,c(!1),d(WS[H.error]??`Распознавание не работает: ${H.error}`))},J.onend=()=>{g.current=!1,v.current=!1;const H=y.current,z=Date.now()-H.openedAt;if(Cs("сессия закрыта",{мс:z,звук:H.audio,слова:H.heard,ошибка:H.lastError||null}),!m.current){c(!1);return}if(H.dead=!H.audio&&z<VS?H.dead+1:0,H.dead>=QS){m.current=!1,c(!1),d(H.lastError?`Распознавание не работает: ${H.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}H.silent=H.heard?0:H.silent+1,!H.everHeard&&!H.warned&&H.silent>=XS&&(H.warned=!0,d(H.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){H.openedAt=Date.now(),H.audio=!1,H.heard=!1,H.lastError="",T();try{J.start()}catch{}}},KS)},h.current=J,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,N(),J.onend=null,J.onresult=null,J.onerror=null,J.onstart=null,J.onaudiostart=null,J.abort(),h.current=null}},[]);const A=_.useCallback(()=>{var D;if(m.current){if(m.current=!1,Cs("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,N(),!v.current){c(!1);return}(D=h.current)==null||D.stop()}},[]),G=_.useCallback(()=>{const D=h.current;if(D){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,y.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Cs("включение микрофона",{язык:D.lang}),T();try{D.start()}catch(J){Cs("start() не прошёл",J)}}},[T]),F=_.useCallback(()=>{m.current?A():G()},[G,A]),B=_.useCallback(()=>{var D;m.current&&v.current&&(g.current=!0,(D=h.current)==null||D.abort())},[]);return{supported:s,listening:r,error:o,toggle:F,stop:A,drop:B}}const ew="(max-width: 860px)",Mb=/^\/(\S*)$/,tw=new Set(["model","permissions"]);function nw(l){return tw.has(l.name)||l.name.startsWith("__")}const lw=new Set(["clear","rename"]),Rb=/(?:^|\s)@([^\s@]*)$/,sw=200,aw=100,iw=190,rw=5,cw=20*1024*1024,ow=1568,uw=.85;let Db=0;async function fw(l){var j,v;if(!l.type.startsWith("image/")||l.size>cw)return null;const s=await dw(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,ow/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,d.width,d.height),(v=(j=s.image).close)==null||v.call(j);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",x=d.toDataURL(g,m?void 0:uw),y=x.slice(x.indexOf(",")+1);return y?(Db+=1,{id:`att${Db}`,mediaType:g,data:y,previewUrl:x}):null}async function dw(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function K_({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:x=!1,attachmentsEnabled:y=!0,onContextSearch:j,onCommand:v,onSend:C,onInterrupt:N,onEscape:T}){var Ue;const A=Yf(ew),[G,F]=_.useState(()=>m?Lh(m):""),[B,D]=_.useState(!1),[J,H]=_.useState(0),z=_.useRef(null),I=_.useRef(null),Y=_.useRef(null),[ae,W]=_.useState(()=>m?Lh(m).length:0),[ce,ye]=_.useState([]),Oe=_.useRef(null),we=_.useCallback(U=>{!y||U.length===0||Promise.all(U.map(fw)).then(P=>{const be=P.filter(De=>De!==null);be.length!==0&&ye(De=>[...De,...be].slice(0,rw))})},[y]);function M(U){ye(P=>P.filter(be=>be.id!==U))}function fe(U){var De;if(!y)return;const P=(De=U.clipboardData)==null?void 0:De.items;if(!P)return;const be=[];for(const qt of P){if(!qt.type.startsWith("image/"))continue;const Cn=qt.getAsFile();Cn&&be.push(Cn)}be.length!==0&&(U.preventDefault(),we(be))}function L(U){const P=U.target.files?Array.from(U.target.files):[];U.target.value="",we(P)}_.useEffect(()=>{y||ye([])},[y]);const[xe,je]=_.useState([]),[E,X]=_.useState(-1),oe=_.useRef(""),[me,Te]=_.useState(""),Ee=PS(_.useCallback((U,P)=>{U&&F(be=>Fh(be,U)),Te(P.trim())},[])),Ae=me?Fh(G,me):G;_.useEffect(()=>{Ee.listening||me===""||(F(U=>Fh(U,me)),Te(""))},[Ee.listening,me]),_.useEffect(()=>{var U;x&&((U=z.current)==null||U.focus())},[x]);const nt=_.useRef(new Map),Xe=_.useRef(new Map),dt=_.useRef(m),Ge=_.useRef({text:G,caret:ae});Ge.current={text:G,caret:ae};const Ot=_.useCallback((U,P,be)=>{P===""?(nt.current.delete(U),Xe.current.delete(U)):(nt.current.set(U,P),Xe.current.set(U,be)),o_(U,P)},[]),lt=Ee.drop;_.useLayoutEffect(()=>{const U=dt.current;if(U===m)return;dt.current=m,U&&Ot(U,Ge.current.text,Ge.current.caret);const P=m?nt.current.get(m)??Lh(m):"",be=m?Xe.current.get(m):void 0,De=Math.min(be??P.length,P.length);F(P),W(De),Y.current=[De,De],Te(""),H(0),D(!1),X(-1),oe.current="",ye([]),lt()},[m,Ot,lt]),_.useEffect(()=>{m&&Ot(m,G,ae)},[m,G,ae,Ot]);const Xt=l?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",Pe=_.useRef(0),Vt=_.useCallback(U=>{const P=parseFloat(getComputedStyle(U).maxHeight),be=Number.isFinite(P)&&P>0?P:iw;U.style.height="auto";const De=U.scrollHeight;U.style.height=`${Math.min(De,be)}px`,U.style.overflowY=De>be?"auto":"hidden"},[]);_.useEffect(()=>{const U=z.current;U&&Vt(U)},[Ae,Xt,l,Vt]),_.useLayoutEffect(()=>{const U=z.current,P=Y.current;!U||!P||(Y.current=null,U.setSelectionRange(P[0],P[1]))}),_.useEffect(()=>{const U=z.current;if(!U)return;const P=new ResizeObserver(([be])=>{const De=be==null?void 0:be.contentRect.width;De===void 0||Math.abs(De-Pe.current)<1||(Pe.current=De,Vt(U))});return P.observe(U),()=>P.disconnect()},[Vt]);const xl=Ee.stop;_.useEffect(()=>{l&&xl()},[l,xl]);const ht=_.useMemo(()=>Ee.error?{ok:!1,message:Ee.error}:null,[Ee.error]),Kt=_.useMemo(()=>{var be;const U=(be=Mb.exec(G))==null?void 0:be[1];if(U===void 0)return[];const P=U.toLowerCase();return r.filter(De=>!nw(De)&&Jh(De,P)<Z_).sort((De,qt)=>Jh(De,P)-Jh(qt,P))},[G,r]),en=!B&&Kt.length>0,_n=Math.min(J,Kt.length-1),hn=B?null:((Ue=Rb.exec(Ae.slice(0,ae)))==null?void 0:Ue[1])??null,an=_.useRef(j);an.current=j,_.useEffect(()=>{if(hn===null||hn===""||hn.endsWith("/")){an.current(hn);return}const U=setTimeout(()=>an.current(hn),sw);return()=>clearTimeout(U)},[hn]);const rt=hn!==null&&(o==null?void 0:o.query)===hn,pt=rt?o.entries:[],Tn=hn!==null,En=Tn&&!rt,Je=Math.min(J,Math.max(pt.length-1,0));_.useEffect(()=>{var P,be;if(!en&&!Tn)return;const U=en?_n:Je;(be=(P=I.current)==null?void 0:P.children[U])==null||be.scrollIntoView({block:"nearest"})},[en,Tn,_n,Je]);function ct(U,P){var be;F(U),W(P),Y.current=[P,P],H(0),D(!1),me!==""&&(Te(""),Ee.drop()),(be=z.current)==null||be.focus()}function pn(){F(""),Te(""),H(0),W(0),D(!1),X(-1),oe.current="",ye([]),Ee.drop(),m&&Ot(m,"",0)}function yn(U){const P=U.trim();P===""&&ce.length===0||l||(C(P,ce.length>0?ce.map(be=>({mediaType:be.mediaType,data:be.data})):void 0),P!==""&&je(be=>[P,...be.filter(De=>De!==P)].slice(0,aw)),pn())}function Pn(U){if(U<-1||U>=xe.length)return;E===-1&&(oe.current=G);const P=U===-1?oe.current:xe[U]??"";X(U),ct(P,P.length)}function rn(){var De;const U=((De=z.current)==null?void 0:De.selectionStart)??Ae.length,be=`${U>0&&!/\s$/.test(Ae.slice(0,U))?" ":""}@`;ct(Ae.slice(0,U)+be+Ae.slice(U),U+be.length)}function kt(U){var qt;const P=(qt=Rb.exec(Ae.slice(0,ae)))==null?void 0:qt[1];if(P===void 0)return;const be=ae-P.length-1,De=U.kind==="dir"?`@${U.path}/`:`@${U.path} `;ct(Ae.slice(0,be)+De+Ae.slice(ae),be+De.length)}function Zt(){var P;const U=(P=Mb.exec(Ae.trim()))==null?void 0:P[1];if(U&&v(U)){pn();return}yn(Ae)}function vt(U,P){F(U),W(P),H(0),D(!1),X(-1),me!==""&&(Te(""),Ee.drop())}function el(U){var De;const P=lw.has(U.name)?c:null,be=`/${U.name} `;F(be+(P??"")),W(be.length+((P==null?void 0:P.length)??0)),P&&(Y.current=[be.length,be.length+P.length]),H(0),(De=z.current)==null||De.focus()}function le(U){if(v(U.name)){F(""),H(0),D(!1);return}U.argumentHint?el(U):yn(`/${U.name}`)}function ge(U){if(en){if(U.key==="ArrowDown")return U.preventDefault(),H(P=>(Math.min(P,Kt.length-1)+1)%Kt.length);if(U.key==="ArrowUp"){U.preventDefault();const P=Kt.length-1;return H(be=>(Math.min(be,P)+P)%Kt.length)}if(U.key==="Enter"&&!U.shiftKey){U.preventDefault();const P=Kt[_n];P&&le(P);return}if(U.key==="Tab"){U.preventDefault();const P=Kt[_n];P&&el(P);return}if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),D(!0);return}}if(Tn){if(U.key==="ArrowDown"&&pt.length>0)return U.preventDefault(),H(P=>(Math.min(P,pt.length-1)+1)%pt.length);if(U.key==="ArrowUp"&&pt.length>0){U.preventDefault();const P=pt.length-1;return H(be=>(Math.min(be,P)+P)%pt.length)}if(U.key==="Enter"&&!U.shiftKey||U.key==="Tab"){const P=pt[Je];if(P){U.preventDefault(),kt(P);return}if(U.key==="Tab")return}if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),D(!0);return}}if((U.key==="ArrowUp"||U.key==="ArrowDown")&&!U.shiftKey){const P=U.currentTarget,be=P.selectionStart;if(P.selectionEnd===be){const qt=U.key==="ArrowUp"?E+1:E-1;qt>=-1&&qt<xe.length&&requestAnimationFrame(()=>{P.selectionStart===be&&P.selectionEnd===be&&Pn(qt)})}}if(U.key==="Escape"&&T){U.preventDefault(),U.stopPropagation(),T();return}U.key==="Enter"&&!U.shiftKey&&!A&&(U.preventDefault(),Zt())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(vr,{result:ht}),Tn&&!en&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:I,children:[pt.map((U,P)=>i.jsxs("button",{role:"option","aria-selected":P===Je,className:P===Je?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(P),onMouseDown:be=>{be.preventDefault(),kt(U)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[U.name,U.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:U.path}),U.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},U.path)),pt.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:En?"ищем…":hn?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),en&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:I,children:Kt.map((U,P)=>i.jsxs("button",{role:"option","aria-selected":P===_n,className:P===_n?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(P),onMouseDown:be=>{be.preventDefault(),le(U)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",U.name]}),U.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:U.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:U.description})]},U.name))}),ce.length>0&&i.jsx("div",{className:"composer__attachments",children:ce.map(U=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:U.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>M(U.id),children:i.jsx(bw,{})})]},U.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:rn,children:i.jsx(mw,{})}),y&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Oe,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:L}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var U;return(U=Oe.current)==null?void 0:U.click()},children:i.jsx(xw,{})})]}),i.jsx("textarea",{ref:z,value:Ae,disabled:l,placeholder:Xt,onChange:U=>vt(U.target.value,U.target.selectionStart),onSelect:U=>W(U.currentTarget.selectionStart),onKeyDown:ge,onPaste:fe}),Ee.supported&&i.jsx("button",{type:"button",className:Ee.listening?"micbtn is-on":"micbtn",title:Ee.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Ee.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Ee.listening,disabled:l,onClick:Ee.toggle,children:i.jsx(_w,{on:Ee.listening})}),s?i.jsx("button",{className:"btn",onClick:N,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Zt,disabled:l||Ae.trim()===""&&ce.length===0,"aria-label":g,title:g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(gw,{})]})]})]})})}function Fh(l,s){const r=s.trim();if(r==="")return l;const c=mp(r).slice(hw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function hw(l,s){const r=mp(l),c=mp(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>pw(d,c[h]??"")))return o;return 0}function mp(l){return l.split(/\s+/).filter(s=>s!=="")}function pw(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function mw(){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 gw(){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 xw(){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 bw(){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 _w({on:l}){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:l?"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 Z_=4;function Jh(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:Z_}function yw({request:l,queued:s,onDecide:r}){const c=V_(l.toolName,l.input);return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[i.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&i.jsx("p",{className:"sheet__reason",children:l.reason}),c?i.jsx(Dp,{diff:c}):i.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>r(l.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>r(l.requestId,"allow"),children:"Разрешить"})]})]})})}function vw({request:l,queued:s,onAnswer:r,onDecline:c}){const{questions:o}=l,[d,h]=_.useState(()=>o.map(()=>new Set)),[m,g]=_.useState(()=>o.map(()=>"")),[x,y]=_.useState(()=>Ob(o));_.useEffect(()=>{h(o.map(()=>new Set)),g(o.map(()=>"")),y(Ob(o))},[l.requestId]);const j=_.useMemo(()=>Sw(o,d,m),[o,d,m]),v=j!==null;function C(B,D){var J,H;(H=(J=o[B])==null?void 0:J.options[D])!=null&&H.preview&&y(z=>{const I=z.slice();return I[B]=D,I})}function N(B,D,J){h(H=>{const z=H.slice(),I=new Set(z[B]);return J?I.has(D)?I.delete(D):I.add(D):I.has(D)||(I.clear(),I.add(D)),z[B]=I,z}),D!=="other"&&C(B,D)}function T(B,D){g(J=>{const H=J.slice();return H[B]=D,H})}function A(){j&&r(l.requestId,j)}function G(B){B.key==="Enter"&&(B.target.closest("button")||v&&(B.preventDefault(),A()))}function F(B){var z;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(B.key))return;const D=Array.from(B.currentTarget.querySelectorAll("button.qsheet__option")),J=D.indexOf(document.activeElement);if(J===-1)return;B.preventDefault();const H=B.key==="ArrowDown"||B.key==="ArrowRight"?1:-1;(z=D[(J+H+D.length)%D.length])==null||z.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:G,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,s>0&&` — ещё ${s} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[l.reason&&i.jsx("p",{className:"qsheet__reason",children:l.reason}),o.map((B,D)=>i.jsx(jw,{q:B,qi:D,selected:d[D]??new Set,otherText:m[D]??"",previewIndex:x[D]??null,onToggle:N,onFocusOption:C,onOtherText:T,onOptionsKeyDown:F},D))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>c(l.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:A,children:"Ответить"})]})]})})}function jw({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var C;const x=l.options.some(N=>N.preview),y=o!==null?(C=l.options[o])==null?void 0:C.preview:void 0,j=r.has("other"),v=l.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:l.header}),i.jsx("span",{className:"qsheet__qtext",children:l.question})]}),i.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((N,T)=>{const A=r.has(T);return i.jsxs("button",{type:"button",role:v,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>d(s,T,l.multiSelect),onFocus:()=>h(s,T),onMouseEnter:()=>h(s,T),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:N.label}),i.jsx("span",{className:"qsheet__opt-desc",children:N.description})]})]},T)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(s,"other",l.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":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:N=>m(s,N.target.value),autoFocus:!0})]})]}),x&&i.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function Ob(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function Sw(l,s,r){const c={};for(let o=0;o<l.length;o++){const d=l[o];if(!d)continue;const h=s[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const x=d.options[g];x&&h.has(g)&&m.push(x.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function ww({request:l,plan:s,queued:r,onAccept:c,onDecline:o}){const[d,h]=_.useState(s),[m,g]=_.useState("preview");_.useEffect(()=>{h(s),g("preview")},[l.requestId,s]);const x=d.trim().length>0;function y(){x&&c(l.requestId,d)}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",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(Nw,{})}),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"+(m==="preview"?" is-on":""),role:"tab","aria-selected":m==="preview",onClick:()=>g("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(m==="source"?" is-on":""),role:"tab","aria-selected":m==="source",onClick:()=>g("source"),children:"Код"})]})]}),i.jsxs("div",{className:"plansheet__body",children:[l.reason&&i.jsx("p",{className:"plansheet__reason",children:l.reason}),i.jsx("div",{className:"plansheet__content",children:m==="preview"?i.jsx(kw,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(l.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!x,autoFocus:!0,onClick:y,children:"Одобрить план"})]})]})})}function kw({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return Vf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function Nw(){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 Tw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function F_({path:l}){const[s,r]=_.useState(!1),[c,o]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{if(!s)return;function m(g){var x;(x=d.current)!=null&&x.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),_.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Rp);return()=>clearTimeout(m)},[c]),_.useEffect(()=>r(!1),[l]);async function h(){await la(l)&&o(!0)}return i.jsxs("div",{ref:d,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[i.jsx(Ew,{open:s}),i.jsx("span",{className:"cwd__short",children:l})]}),s&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:l}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?yc:br})]})]})}function Ew({open:l}){return i.jsx("svg",{className:l?"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 Cw=["low","medium","high"];function J_({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:x,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[C,N]=_.useState(!1),[T,A]=_.useState(0),G=_.useRef(null),F=_.useRef(null),B=l.find(I=>I.value===s)??null,D=B&&B.supportsEffort?B.effortLevels.length>0?B.effortLevels:Cw:[],J=D.includes("xhigh");_.useEffect(()=>{if(!C)return;const I=l.findIndex(Y=>Y.value===s);A(I===-1?0:I)},[C]),_.useEffect(()=>{if(!C)return;function I(Y){var ae;(ae=G.current)!=null&&ae.contains(Y.target)||N(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[C]),_.useEffect(()=>{var I,Y;C&&((Y=(I=F.current)==null?void 0:I.querySelector(".is-cursor"))==null||Y.scrollIntoView({block:"nearest"}))},[C,T]);function H(I){N(!1),I.value!==s&&g(I.value)}function z(I){if(I.key==="Escape"){if(!C)return;I.preventDefault(),I.stopPropagation(),N(!1);return}if(I.key==="ArrowDown"||I.key==="ArrowUp"){if(I.preventDefault(),!C)return N(!0);if(l.length===0)return;const Y=I.key==="ArrowDown"?1:l.length-1;return A(ae=>(ae+Y)%l.length)}if(I.key==="Enter"||I.key===" "){if(I.preventDefault(),!C)return N(!0);const Y=l[T];Y&&H(Y)}}return i.jsxs("div",{ref:G,className:"select"+(C?" select--open":"")+(m?` ${m}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":C,onClick:()=>N(I=>!I),onKeyDown:z,children:[(B==null?void 0:B.displayName)??s?i.jsx("span",{className:"select__value",children:(B==null?void 0:B.displayName)??s}):i.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):D.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(Aw,{})]}),C&&i.jsxs("div",{ref:F,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((I,Y)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":I.value===s,className:"select__option"+(Y===T?" is-cursor":"")+(I.value===s?" is-on":""),onMouseEnter:()=>A(Y),onClick:()=>H(I),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:I.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:I.displayName}),I.description&&i.jsx("span",{className:"select__hint",children:I.description})]},I.value)),D.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:D.map(I=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":I===r,className:I===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(I),children:I},I))})]}),J&&i.jsx(Wh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(B==null?void 0:B.supportsThinking)!==!1&&i.jsx(Wh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&i.jsx(Wh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function Wh({label:l,desc:s,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:[l,i.jsx("span",{className:"modelmenu__desc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Aw(){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 Tl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=_.useRef(null);return _.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const y=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":l,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:l}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:s}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function Mw({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[C,N]=_.useState("open"),[T,A]=_.useState(""),[G,F]=_.useState(!1),[B,D]=_.useState(""),[J,H]=_.useState(""),[z,I]=_.useState({git:!0,claudeMd:!0,readme:!0}),Y=T.trim(),ae=Y!=="",W=B.trim(),ce=J.trim(),ye=W!==""&&ce!=="";_.useEffect(()=>{B===""&&d.length>0&&D(d[0])},[d]);const Oe=_.useRef(m);Oe.current=m,_.useEffect(()=>{if(C!=="open")return;const L=T.trim(),xe=setTimeout(()=>Oe.current(L),200);return()=>clearTimeout(xe)},[T,C]);function we(){ae&&y(Y)}function M(){ye&&j(W,ce,z)}function fe(){ae&&(F(!0),g(Y))}return h?i.jsxs(Tl,{title:"Новый проект",onClose:v,actions:i.jsx("button",{className:"btn btn--primary",onClick:v,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(L=>i.jsx("li",{children:L},L))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Tl,{title:"Новый проект",className:G&&C==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!ae,onClick:fe,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!ae,onClick:we,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!ye,onClick:M,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Lb,{label:"Открыть",on:C==="open",onClick:()=>N("open")}),i.jsx(Lb,{label:"Создать",on:C==="create",onClick:()=>N("create")})]}),C==="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:T,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:L=>A(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),we())}}),o&&i.jsx("p",{className:"modal__error",children:o}),l.length>0&&i.jsx("ul",{className:"finds",children:l.map(L=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:L.open,title:L.open?"Этот проект уже открыт":L.path,onClick:()=>A(L.path),onDoubleClick:()=>y(L.path),children:[i.jsx("span",{className:"find__name",children:L.name}),i.jsx("span",{className:"find__path",children:L.path}),i.jsx("span",{className:"find__note",children:Ow(L)})]})},L.path))}),l.length===0&&ae&&!s&&!G&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),G&&i.jsx("div",{className:"finds__agent",children:i.jsx(Op,{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:B,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:L=>D(L.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(L=>i.jsx("button",{type:"button",className:L===W?"newproj__root is-on":"newproj__root",title:L,onClick:()=>D(L),children:Dw(L)},L))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:J,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:L=>H(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),M())}}),i.jsx("p",{className:"newproj__preview",children:ye?Rw(W,ce):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Ph,{label:"git init",desc:"панель истории работает сразу",on:z.git,onToggle:()=>I(L=>({...L,git:!L.git}))}),i.jsx(Ph,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:z.claudeMd,onToggle:()=>I(L=>({...L,claudeMd:!L.claudeMd}))}),i.jsx(Ph,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:z.readme,onToggle:()=>I(L=>({...L,readme:!L.readme}))})]})]})]})}function Lb({label:l,on:s,onClick:r}){return i.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function Ph({label:l,desc:s,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:[l,i.jsx("span",{className:"newproj__optdesc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Rw(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Dw(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function Ow(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Lw(l.sessions)}${zw(l.lastUsedAt)}`}function Lw(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function zw(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Lp=7;function Uw(l){const s=[],r=[];let c=1;for(const o of l){const d=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=zb(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const v of g){let C=s.indexOf(v);C===-1&&(C=zb(s),s[C]=v),x.push({from:h,to:C})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(s[v]=null));const j=[];for(let v=0;v<d.length;v++){const C=d[v];!C||C===o.hash||v===h||s[v]===C&&j.push(v)}Hw(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:r,columns:Math.min(c,Lp)}}function zb(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Hw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const W_=1500;function Bw(l){const s=[];let r=!1;for(const c of l.patch.split(`
119
+ `)){if(s.length>=W_){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:Iw(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:qw(l,r)}}function Iw(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function qw(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${W_} строк`),r.length>0?r.join(" · "):null}function Gw({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:C,zoomed:N,onToggleZoom:T}){const A=Uw((s==null?void 0:s.commits)??[]),G=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(F=>({value:F.name,label:F.name,hint:F.hash.slice(0,8)}))];return i.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(N?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:F=>{T&&(F.target.closest("button")||T())},children:[i.jsx(Kw,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),T&&i.jsx("button",{className:"sidepane__btn",title:N?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":N?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":N,onClick:T,children:i.jsx(Rc,{active:N})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:C,children:"✕"})]}),s===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"gitbar",children:[i.jsx(Rs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:G,onChange:F=>{F&&m(F,`ветку ${F}`)}}),i.jsx(Ac,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.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(Ww,{}),o]}):s.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(Zw,{}),"Отправить",s.ahead>0&&i.jsx("span",{className:"gitbar__count",children:s.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(Fw,{}),"Забрать",s.behind>0&&i.jsx("span",{className:"gitbar__count",children:s.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(Jw,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[i.jsx(Hb,{}),"Опубликовать на 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:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${nk(s.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(F=>tk(F.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(F=>i.jsx($w,{row:F,columns:A.columns,head:F.commit.hash===s.head,local:s.hasRemote&&!F.commit.pushed,active:c===F.commit.hash,onOpen:()=>h(F.commit.hash)},F.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:s.message||"Это не git-репозиторий"}),s.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[i.jsx(Hb,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(vr,{result:r,onDismiss:v})]})}const Ho=50,Ub=13,Yw=500;function $w({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(Pw).filter(Boolean),[g,x]=_.useState(null),y=_.useRef(null);function j(T){const A=T.touches[0];if(!A)return;const G={timer:0,x:A.clientX,y:A.clientY,fired:!1};G.timer=window.setTimeout(()=>{G.fired=!0,x({x:G.x,y:G.y})},Yw),y.current=G}function v(T){const A=y.current,G=T.touches[0];!A||!G||Math.hypot(G.clientX-A.x,G.clientY-A.y)>10&&(window.clearTimeout(A.timer),y.current=null)}function C(T){const A=y.current;A&&(window.clearTimeout(A.timer),A.fired&&T.preventDefault())}function N(){const T=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void la(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void la(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void la(h.subject)}],A=new Set;for(const G of h.refs){const F=G.startsWith("tag: "),B=ek(G);!B||A.has(B)||(A.add(B),T.push({id:`ref:${B}`,label:F?"Копировать тег":"Копировать ветку",hint:B,onSelect:()=>void la(B)}))}return T}return i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var T;if((T=y.current)!=null&&T.fired){y.current=null;return}d()},onContextMenu:T=>{T.preventDefault(),x({x:T.clientX,y:T.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:C,onTouchCancel:C,children:[i.jsx(Xw,{row:l,columns:s,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[m.map(T=>i.jsx("span",{className:"gitrow__ref",children:T},T)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",lk(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&i.jsx(ki,{x:g.x,y:g.y,items:N(),onClose:()=>x(null)})]})}function Xw({row:l,columns:s,head:r,local:c}){const o=s*Ub+6,d=Ho/2,h=x=>8+Math.min(x,Lp-1)*Ub,m=c?"3.5 2.5":void 0,g=wf(l.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:Ho,viewBox:`0 0 ${o} ${Ho}`,"aria-hidden":"true",children:[l.through.map(x=>i.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Ho,style:{stroke:wf(x)}},`t${x}`)),l.up.map((x,y)=>i.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:wf(x.from),strokeDasharray:m}},`u${y}`)),l.down.map((x,y)=>i.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Ho}`,fill:"none",style:{stroke:wf(x.to),strokeDasharray:m}},`d${y}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:d,r:l.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:d,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function wf(l){return`var(--lane-${l%Lp})`}function Vw({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return i.jsxs(Tl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.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:l.subject}),i.jsx(Ac,{text:l.subject,hint:"сообщение коммита"})]}),i.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",sk(l.date)]}),i.jsxs("div",{className:"commit__line commit__line--hash",children:[i.jsx("span",{className:"commit__hash",children:l.hash}),i.jsx(Ac,{text:l.hash,hint:"хеш коммита"})]}),s&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(d=>d.slice(0,8)).join(", ")]}),l.body&&i.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(d=>i.jsx(Qw,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function Qw({file:l,defaultOpen:s}){const[r,c]=_.useState(s);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:l.path||l.oldPath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(Dp,{diff:Bw(l)})]})}function Kw(){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 Zw(){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 Fw(){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 Jw(){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 Hb(){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 Ww(){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 Pw(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function ek(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function tk(l){const s=l.split("/");return s[s.length-1]??l}function nk(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function lk(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/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(s).toLocaleDateString()}function sk(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function Bb(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function ak({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:x,onDismissResult:y,onClose:j}){var L;const[v,C]=_.useState(()=>Bb(c)),[N,T]=_.useState(""),[A,G]=_.useState(""),[F,B]=_.useState(!0),[D,J]=_.useState("Первый коммит"),[H,z]=_.useState(null),[I,Y]=_.useState("");_.useEffect(()=>{!N&&s.length>0&&T(s[0].login)},[N,s]),_.useEffect(()=>{r&&H===null&&z(new Set(r.files))},[r,H]);const ae=(l==null?void 0:l.connected)===!0,W=s.map(xe=>({value:xe.login,label:xe.login,hint:xe.kind==="org"?"организация":void 0})),ce=_.useMemo(()=>{if(!r)return[];const xe=I.trim().toLowerCase();return xe?r.files.filter(je=>je.toLowerCase().includes(xe)):r.files},[r,I]),ye=(H==null?void 0:H.size)??0,Oe=ae&&v.trim()!==""&&N!==""&&d===""&&(o||ye>0);function we(xe){z(je=>{const E=new Set(je??[]);return E.has(xe)?E.delete(xe):E.add(xe),E})}function M(xe){z(je=>{const E=new Set(je??[]);for(const X of ce)xe?E.add(X):E.delete(X);return E})}function fe(){if(!Oe)return;const xe=(r==null?void 0:r.files)??[];x({owner:N,name:v.trim(),description:A.trim(),private:F,include:o?[]:xe.filter(je=>H==null?void 0:H.has(je)),ignore:o?[]:xe.filter(je=>!(H!=null&&H.has(je))),message:o?"":D.trim()||"Первый коммит"})}return i.jsxs(Tl,{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:!Oe,onClick:fe,children:d||"Опубликовать"})]}),children:[i.jsx(ik,{status:l,onRefreshStatus:m,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:v,spellCheck:!1,autoComplete:"off",onChange:xe=>C(Bb(xe.target.value))})]}),v.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),s.length>1?i.jsx(Rs,{className:"settings__select",value:N,options:W,onChange:T,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((L=s[0])==null?void 0:L.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:xe=>G(xe.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(Ib,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:F,onClick:()=>B(!0)}),i.jsx(Ib,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!F,onClick:()=>B(!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:[ye," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>M(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>M(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:I,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:xe=>Y(xe.target.value)}),i.jsx("div",{className:"publish__filelist",children:ce.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ce.map(xe=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(H==null?void 0:H.has(xe))===!0,className:"publish__file",onClick:()=>we(xe),children:[i.jsx("span",{className:"publish__box"+(H!=null&&H.has(xe)?" is-on":""),"aria-hidden":"true",children:(H==null?void 0:H.has(xe))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:xe})]},xe))}),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:D,onChange:xe=>J(xe.target.value)})]})]})]}),i.jsx(vr,{result:h,onDismiss:y})]})}function Ib({title:l,desc:s,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:[l,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:s})]})]})}function ik({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=_.useState(""),[d,h]=_.useState(!1);return i.jsxs("div",{className:"publish__section publish__section--first",children:[i.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:l.login}),i.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[l.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(rk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),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 ↗"})]}),l.message&&i.jsx("p",{className:"modal__error",children:l.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function rk({value:l,onChange:s,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return i.jsxs("div",{className:"pwfield",children:[i.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>s(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(ok,{}):i.jsx(ck,{})})]})}function ck(){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 ok(){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:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=_.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(Tl,{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:!m||l!=="",onClick:()=>r(d.trim()),children:l||"Подключить"})]}),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:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&l===""&&r(d.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(vr,{result:s,onDismiss:c})]})}function fk({open:l,items:s,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:g,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:N,onModel:T,onEffort:A,onUltracode:G,onThinking:F,onSwitchOnFlag:B,onAsk:D,onInterrupt:J,onReset:H,onClose:z,zoomed:I,onToggleZoom:Y}){return i.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(I?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:ae=>{Y&&(ae.target.closest("button")||Y())},children:[i.jsx(dk,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:H,children:"↻"}),Y&&i.jsx("button",{className:"sidepane__btn",title:I?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":I?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":I,onClick:Y,children:i.jsx(Rc,{active:I})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:z,children:"✕"})]}),m.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(J_,{className:"select--compact",models:m,value:g,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onModel:T,onEffort:A,onUltracode:G,onThinking:F,onSwitchOnFlag:B}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(Op,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(K_,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,onContextSearch:C,onCommand:N,onSend:D,onInterrupt:J,onEscape:r?J:z})]})}function dk(){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 hk=75,pk=90;function P_({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return i.jsx("div",{className:"usage",title:xk(l,s),"aria-label":c,children:r.map(o=>i.jsx(mk,{label:o.label,window:o.window},o.key))})}function mk({label:l,window:s}){const r=Math.round(s.utilization),c=_k(s.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:l}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${gk(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:zp(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function gk(l){return l>=pk?" usage__fill--over":l>=hk?" usage__fill--warn":""}function xk(l,s){if(s.length>0)return bk(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=zp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
120
+ `)}function bk(l){const s=["Квота Antigravity"];for(const r of l){const c=zp(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
121
+ `)}function ey(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function ty(l){return l.getTime()-Date.now()<1440*60*1e3}function _k(l){const s=ey(l);return s?ty(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function zp(l){const s=ey(l);return s?`обнулится ${ty(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function ny(){const[l,s]=_.useState(()=>new Date);return _.useEffect(()=>{let r=0;const c=()=>{const d=new Date;s(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.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:l.toISOString(),title:yk(l),children:[i.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function yk(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function vk({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:x,onHandoff:y,onFreshSession:j,handoffWriting:v,onStop:C}){const N=x_({onLongPress:()=>j==null?void 0:j(),onClick:()=>y==null?void 0:y(),disabled:v});return i.jsx(Tl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:i.jsxs("div",{className:"sessionmenu",children:[s&&i.jsx(pc,{label:"Режим прав",children:s}),i.jsx(pc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&i.jsx(pc,{label:"Лимиты плана",children:i.jsx(P_,{usage:c})}),i.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[i.jsx(jk,{}),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(pc,{label:"Время",children:i.jsx(ny,{})}),d&&i.jsx(pc,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(pc,{label:"Каталог проекта",children:i.jsx(F_,{path:o})}),x&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"}),y&&i.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":N.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${N.thresholdMs}ms`},"aria-busy":v,disabled:v,...N.handlers,children:[i.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),i.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&i.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),C&&i.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function pc({label:l,children:s}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function jk(){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 Sk({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:m,onClose:g}){const x=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Tl,{title:"Расширения",className:"modal--wide",onClose:g,children:[i.jsx("div",{className:"tabs",role:"tablist",children:x.map(y=>i.jsxs("button",{role:"tab","aria-selected":l===y.id,className:l===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>m(y.id),children:[y.label,i.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),l==="mcp"&&i.jsx(wk,{servers:s,actions:h}),l==="plugins"&&i.jsx(Ck,{plugins:r,marketplaces:c,actions:h}),l==="catalog"&&i.jsx(Ak,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>m("plugins")}),i.jsx(vr,{result:d})]})}function wk({servers:l,actions:s}){const[r,c]=_.useState(!1);return i.jsxs(i.Fragment,{children:[l.length===0&&!r&&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:l.map(o=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:o.name}),i.jsx("span",{className:`chip chip--${Nk(o.status)}`,children:kk[o.status]}),o.scope&&i.jsx("span",{className:"chip",children:o.scope}),o.transport&&i.jsx("span",{className:"chip",children:o.transport})]}),o.target&&i.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&i.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&i.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>s.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),r?i.jsx(Tk,{onCancel:()=>c(!1),onSubmit:(o,d)=>{s.mcpAdd(o,d),c(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const kk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Nk(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function Tk({onSubmit:l,onCancel:s}){const[r,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,m]=_.useState(""),[g,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",C=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function N(){if(C)if(v){const[T,...A]=Ek(h);l(r.trim(),{transport:"stdio",command:T??"",args:A,env:qb(y)})}else l(r.trim(),{transport:o,url:g.trim(),headers:qb(y)})}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:T=>c(T.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Rs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:T=>d(T)}),v?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:T=>m(T.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:T=>x(T.target.value)})]}),i.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),i.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:T=>j(T.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:N,children:"Подключить"})]})]})}function qb(l){const s={};for(const r of l.split(`
122
+ `)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function Ek(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function Ck({plugins:l,marketplaces:s,actions:r}){const[c,o]=_.useState("");return i.jsxs(i.Fragment,{children:[l.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:l.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:d.name}),i.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&i.jsx("span",{className:"chip",children:d.version}),d.scope&&i.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&i.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&i.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),i.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),i.jsx("ul",{className:"extlist",children:s.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsx("div",{className:"extlist__head",children:i.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&i.jsx("div",{className:"extlist__meta",children:d.source}),i.jsx("div",{className:"extlist__actions",children:i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.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:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),i.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const Bo=30;function Ak({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[g,x]=_.useState(Bo),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(l.map(T=>T.category).filter(Boolean))].sort(),[l]),C=_.useMemo(()=>{const N=o.trim().toLowerCase();return l.filter(T=>h&&T.category!==h?!1:N?`${T.name} ${T.displayName} ${T.description} ${T.author}`.toLowerCase().includes(N):!0)},[l,o,h]);return l.length===0?i.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",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:N=>{d(N.target.value),x(Bo)}}),i.jsx(Rs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(N=>({value:N,label:N}))],onChange:N=>{m(N),x(Bo)}})]}),C.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:C.slice(0,g).map(N=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:N.name}),N.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),N.version&&i.jsx("span",{className:"chip",children:N.version}),N.category&&i.jsx("span",{className:"chip",children:N.category})]}),N.description&&i.jsx("div",{className:"catalog__desc",children:N.description}),i.jsxs("div",{className:"extlist__meta",children:[N.author&&`${N.author} · `,N.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:N.installed,onClick:()=>r.pluginInstall(N.id),children:N.installed?"Уже стоит":"Установить"}),N.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:N.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},N.id))}),C.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>x(N=>N+Bo),children:["Ещё ",Math.min(Bo,C.length-g)," из ",C.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:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:N=>j(N.target.value),onKeyDown:N=>{N.key!=="Enter"||y.trim()===""||(N.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function Mk({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[x,y]=_.useState(""),[j,v]=_.useState(!1),[C,N]=_.useState(!1),T=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!C&&!j,A=_.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const B=s.output.trim();return B===""?null:{ok:!0,message:B}},[s.error,s.output]);function G(B=x){const D=B.trim();D!==""&&(r.submitCode(D),y(""))}function F(){if(o>0){v(!1),N(!0);return}r.login("claudeai",!0)}return i.jsxs(Tl,{title:"Аккаунт",onClose:g,children:[l===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):l.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:l.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:Ok[l.method]??l.method}),l.plan&&i.jsx("span",{className:"chip",children:l.plan})]}),l.organization&&i.jsx("div",{className:"extlist__meta",children:l.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?i.jsx(Lk,{login:s,remote:c,code:x,onCode:y,onSubmit:G,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(vr,{result:A}),C&&i.jsx("p",{className:"account__warn",role:"alert",children:Rk(o)}),T&&h&&i.jsx("p",{className:"account__note",children:m}),i.jsx("div",{className:`extbar${l!=null&&l.loggedIn?" account__bar":""}`,children:l!=null&&l.loggedIn?i.jsxs(i.Fragment,{children:[T&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
+ ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(Dk,{}),"Переподключить"]}),C?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>N(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{N(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:F,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{N(!1),v(!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 Rk(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function Dk(){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 Ok={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Lk({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var N;const[h,m]=_.useState(null),g=_.useRef(""),x=_.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const y=_.useCallback(async T=>{const{code:A,onCode:G,onSubmit:F}=x.current;if(T&&A.trim()!=="")return;const B=await hp();if(B===null){T||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const D=B.trim();if(!Gb(D)){T||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(T){if(g.current===D)return;g.current=D}m(null),G(D),F(D)},[]);_.useEffect(()=>{if(!l.awaitingCode)return;const T=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[l.awaitingCode,y]);const j=typeof((N=navigator.clipboard)==null?void 0:N.readText)=="function",v=r.trim()!==""&&!Gb(r),C=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[l.url?s?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:l.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:l.url}),i.jsx(Ac,{text:l.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:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.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:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:T=>{m(null),c(T.target.value)},onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),C&&i.jsx("p",{className:"account__note account__note--code",children:C})]}),l.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:l.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function Gb(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function zk({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[g,x]=_.useState(!1),y=_.useRef(null),j=(l==null?void 0:l.paired)===!0;_.useEffect(()=>{var C;j||(C=y.current)==null||C.focus()},[j]),_.useEffect(()=>{x(!1),j&&d("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return i.jsx(Tl,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Yb(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.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:Yb(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:C=>{C.preventDefault(),o.trim()&&(x(!0),s(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:C=>d(C.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:C=>m(C.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function Yb(l){try{return new URL(l).host}catch{return l}}const $b=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],ep="",Uk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Hk=h_.map(l=>({value:l.value,label:l.value,hint:l.hint})),kf=3600*1e3,Bk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],gc={"6h":6*kf,"24h":24*kf,"48h":48*kf,"168h":168*kf,never:0};function Ik(l){return gc[l]??gc["48h"]}const qk=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Nf=60*1e3,xc={"5m":5*Nf,"10m":10*Nf,"30m":30*Nf,"60m":60*Nf,never:0};function Gk(l){return xc[l]??xc["10m"]}function Yk(l){const s=Object.entries(xc).find(([,r])=>r===l);return s?s[0]:Object.keys(xc).reduce((r,c)=>Math.abs(xc[c]-l)<Math.abs(xc[r]-l)?c:r)}function $k(l){const s=Object.entries(gc).find(([,r])=>r===l);return s?s[0]:Object.keys(gc).reduce((r,c)=>Math.abs(gc[c]-l)<Math.abs(gc[r]-l)?c:r)}const Xk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],bc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Vk(l){return bc[l]??bc.off}function Xb(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function Qk(l){const s=Object.entries(bc).find(([,r])=>r===l);return s?s[0]:Object.keys(bc).reduce((r,c)=>Math.abs(bc[c]-l)<Math.abs(bc[r]-l)?c:r)}const Kk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Zk({settings:l,models:s,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:g}){const x=l===null,y=!x&&l.terminalEnabled===!0,j=!x&&l.liveSessionsFirst===!0,v=!y,C=_.useMemo(()=>{const T=[{value:ep,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(A=>({value:A.value,label:A.displayName,hint:A.description})):Uk];return l&&l.startModel!==null&&!T.some(A=>A.value===l.startModel)&&T.push({value:l.startModel,label:l.startModel}),T},[s,l]);function N(){var T,A;return(r==null?void 0:r.paired)!==!0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:m,children:"Связать компьютер"})]}):(T=r.shell)!=null&&T.enabled?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),i.jsx("button",{type:"button",className:"btn btn--danger",disabled:v,onClick:h,children:"Запретить"})]}):(A=r.shell)!=null&&A.pending?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",i.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),i.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Отправить письмо ещё раз"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Разрешить с телефона"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Прислать письмо"})]})]})}return i.jsx(Tl,{title:"Настройки",onClose:g,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:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Rs,{className:"settings__select",value:$k(l.autoArchiveAfterMs),options:Bk,onChange:T=>o({autoArchiveAfterMs:Ik(T)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Rs,{className:"settings__select",value:Yk(l.autoStopAfterMs),options:qk,onChange:T=>o({autoStopAfterMs:Gk(T)}),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-часового лимита, %"}),x?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:l.limitStopFiveHourPct,onChange:T=>o({limitStopFiveHourPct:Xb(T.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:"Остановка у недельного лимита, %"}),x?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:l.limitStopSevenDayPct,onChange:T=>o({limitStopSevenDayPct:Xb(T.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.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Rs,{className:"settings__select",value:Qk(l.autoSaveAfterPauseMs),options:Xk,onChange:T=>o({autoSaveAfterPauseMs:Vk(T)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Агенты"}),i.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),$b.map(T=>{const A=(l==null?void 0:l.enabledProviders)??["claude","antigravity"],G=!x&&A.includes(T.id),F=G&&A.length<=1;return i.jsxs("div",{className:"settings__switch-row settings__agent",children:[i.jsx("span",{className:`newsession__mark newsession__mark--${T.id}`,"aria-hidden":"true",children:T.id==="antigravity"?i.jsx(Mp,{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:T.label}),i.jsx("span",{className:"settings__hint",children:F?"Хотя бы один агент должен остаться включённым":T.hint})]}),x?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":G,"aria-label":T.label,disabled:F,title:F?"Хотя бы один агент должен остаться включённым":void 0,className:G?"switch is-on":"switch",onClick:()=>{const B=$b.map(D=>D.id).filter(D=>D===T.id?!G:A.includes(D));o({enabledProviders:B})},children:i.jsx("span",{className:"switch__knob"})})]},T.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:"Модель"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Rs,{className:"settings__select",value:l.startModel??ep,options:C,onChange:T=>o({startModel:T===ep?null:T}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Rs,{className:"settings__select",value:l.startPermissionMode,options:Hk,onChange:T=>o({startPermissionMode:T}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),x?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":j,"aria-label":"Запущенные сессии сверху",className:j?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!j}),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:Kk.map(T=>{const A=!x&&l.folderAccess===T.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":A,disabled:x,className:"access__card"+(A?" is-on":"")+(T.risky?" access__card--risky":""),onClick:()=>o({folderAccess:T.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:[T.title,T.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:T.description})]})]},T.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-label":"Терминал",className:y?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!y}),children:i.jsx("span",{className:"switch__knob"})})]}),i.jsxs("div",{className:"settings__nested"+(v?" is-disabled":""),children:[i.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[v&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),N()]})]})]})]})})}const Vb={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Fk(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function Jk({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${Vb[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.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(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.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:s,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:[l.limit===null?i.jsxs(i.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):i.jsxs(i.Fragment,{children:[Vb[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",Fk(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,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 Wk({handoff:l,onClose:s}){const[r,c]=_.useState("");return _.useEffect(()=>{let o=!1;return Vf(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),i.jsx(Tl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Qb={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Pk=12e3;function eN(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function tN({notices:l,onDismiss:s}){return l.length===0?null:i.jsx("div",{className:"limittoasts",children:l.map(r=>i.jsx(nN,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function nN({notice:l,onDismiss:s}){return _.useEffect(()=>{const r=window.setTimeout(s,Pk);return()=>window.clearTimeout(r)},[s]),i.jsxs("div",{className:"limittoast",role:"status",children:[i.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),i.jsx("span",{className:"limittoast__body",children:l.stopped>0?i.jsxs(i.Fragment,{children:["Достигнут ",Qb[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",eN(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):i.jsxs(i.Fragment,{children:["Достигнут ",Qb[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}const lN=16;function sN({pane:l,width:s,onResize:r,onReset:c}){const o=gr[l],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-W0):0;d.current={x:y.clientX,width:s,max:Math.min(o.max,s+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;r(Math.min(j.max,j.width+v))}function g(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function x(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(s+j*lN*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:x,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const aN=16;function iN({height:l,onResize:s,onReset:r}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-nv;return Math.round(l+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:l,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const y=c.current;if(!y)return;const j=y.y-x.clientY;s(y.height+j,y.max)}function m(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),s(l+y*aN,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":g_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function Kb(){const l=document.documentElement,s=getComputedStyle(l),r=F=>s.getPropertyValue(F).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),x=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),C=r("--cm-fn"),N=r("--cm-key"),T=r("--cm-type"),A=Zb(o,c,55),G=F=>Zb(F,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:A,brightBlack:h,red:y,brightRed:G(y),green:j,brightGreen:G(j),yellow:v,brightYellow:G(v),blue:C,brightBlue:G(C),magenta:N,brightMagenta:G(N),cyan:T,brightCyan:G(T),white:d,brightWhite:o}}function rN(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Zs=null;function cN(l){return Zs||(Zs=document.createElement("span"),Zs.style.position="fixed",Zs.style.width="0",Zs.style.height="0",Zs.style.opacity="0",Zs.style.pointerEvents="none",document.body.appendChild(Zs)),Zs.style.color=l,getComputedStyle(Zs).color}function Zb(l,s,r){return cN(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Tf=null;function oN(){return Tf||(Tf=Promise.all([Ke(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Ke(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Ke(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Ke(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Tf=null,l})),Tf}function uN({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:C,onResize:N,onAttach:T,onHide:A,registerSink:G}){const[F,B]=_.useState(()=>Kb());return _.useEffect(()=>{const D=new MutationObserver(()=>B(Kb()));return D.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>D.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:d},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:D=>{x&&(D.target.closest("button")||x())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(D=>i.jsxs("div",{role:"tab","aria-selected":D.id===s,className:"termtab"+(D.id===s?" is-on":"")+(D.exitCode!==null?" termtab--exited":""),onDoubleClick:J=>{x&&(J.target.closest(".termtab__close")||x())},children:[i.jsx("button",{className:"termtab__name",title:D.cwd,onClick:()=>y(D.id),children:D.title}),D.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${D.exitCode}`,children:D.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${D.title}»`,onClick:()=>v(D.id),children:"✕"})]},D.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(Rc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&l.length>0&&i.jsx(Fb,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?i.jsx(Fb,{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:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(D=>i.jsx(dN,{id:D.id,exitCode:D.exitCode,active:D.id===s,theme:F,mobile:m,onInput:C,onResize:N,onAttach:T,registerSink:G},D.id))]})]})}function Fb({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=fN(l);return i.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),d&&i.jsx("p",{className:"termfail__hint",children:d}),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 fN(l){const[s="",...r]=l.trim().split(`
124
+
125
+ `),c=s.split(`
126
+ `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??l.trim(),hint:c.slice(1).join(" "),details:r.join(`
127
+
128
+ `).trim()}}function dN({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!1),v=_.useRef(o);v.current=o;const C=_.useRef(c),N=_.useRef(s),[T,A]=_.useState("loading"),[G,F]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let D=!1,J=null;A("loading"),F(!1);const H=window.setTimeout(()=>{D||F(!0)},200);return(async()=>{var je;let z;try{z=await oN()}catch{window.clearTimeout(H),D||A("error");return}if(D||!x.current)return;window.clearTimeout(H);const{Terminal:I,FitAddon:Y,WebLinksAddon:ae}=z,W=new I({fontFamily:rN()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ce=new Y;W.loadAddon(ce),W.loadAddon(new ae),W.open(x.current),y.current=W,W.attachCustomKeyEventHandler(E=>{if(E.type!=="keydown"||!(E.ctrlKey||E.metaKey))return!0;if(E.key==="`")return E.preventDefault(),!1;if(E.key==="c"||E.key==="C"){const oe=W.getSelection();return oe?(E.preventDefault(),la(oe),!1):!E.shiftKey}return E.key==="v"||E.key==="V"?(E.preventDefault(),hp().then(oe=>{oe&&W.paste(oe)}),!1):!0});const ye=E=>{E.preventDefault();const X=W.getSelection();if(X){la(X),W.clearSelection();return}hp().then(oe=>{oe&&W.paste(oe)})};(je=W.element)==null||je.addEventListener("contextmenu",ye);const Oe=W.onData(E=>d(l,E));let we={cols:W.cols,rows:W.rows},M=null;const fe=W.onResize(({cols:E,rows:X})=>{M!==null&&window.clearTimeout(M),M=window.setTimeout(()=>{M=null,!(E===we.cols&&X===we.rows)&&(we={cols:E,rows:X},h(l,E,X))},100)}),L=new ResizeObserver(()=>{try{ce.fit()}catch{return}v.current&&W.scrollToBottom()});L.observe(x.current);const xe=g(l,E=>{E.kind==="buffer"&&W.reset(),W.write(E.data)});m(l),N.current!==null&&!j.current&&(j.current=!0,W.write(`\r
129
+ \x1B[2m— Процесс завершён (код ${N.current}) —\x1B[0m\r
130
+ `)),r&&W.focus(),J=()=>{var E;M!==null&&window.clearTimeout(M),L.disconnect(),(E=W.element)==null||E.removeEventListener("contextmenu",ye),Oe.dispose(),fe.dispose(),xe(),W.dispose(),y.current=null},A("ready")})(),()=>{D=!0,window.clearTimeout(H),J==null||J(),J=null}},[l]),_.useEffect(()=>{if(!o)return;const B=x.current;if(!B)return;let D=null,J=0,H=!1;const z=W=>{W.pointerType==="mouse"||D!==null||(D=W.pointerId,J=W.clientY,H=!1)},I=W=>{if(W.pointerId!==D)return;const ce=J-W.clientY;if(!H){if(Math.abs(ce)<4)return;H=!0,B.setPointerCapture(W.pointerId)}J=W.clientY;const ye=B.querySelector(".xterm-viewport");ye&&(ye.scrollTop+=ce)},Y=W=>{W.pointerId===D&&(B.hasPointerCapture(W.pointerId)&&B.releasePointerCapture(W.pointerId),D=null,H=!1)},ae=W=>W.stopPropagation();return B.addEventListener("pointerdown",z),B.addEventListener("pointermove",I),B.addEventListener("pointerup",Y),B.addEventListener("pointercancel",Y),B.addEventListener("touchmove",ae,{capture:!0}),()=>{B.removeEventListener("pointerdown",z),B.removeEventListener("pointermove",I),B.removeEventListener("pointerup",Y),B.removeEventListener("pointercancel",Y),B.removeEventListener("touchmove",ae,{capture:!0}),D!==null&&B.hasPointerCapture(D)&&B.releasePointerCapture(D)}},[o]),_.useEffect(()=>{C.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var B;r&&((B=y.current)==null||B.focus())},[r]),_.useEffect(()=>{if(N.current=s,s===null){j.current=!1;return}if(j.current)return;const B=y.current;B&&(j.current=!0,B.write(`\r
131
+ \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
132
+ `))},[s]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:x,className:"termview__surface"+(T==="ready"?"":" is-hidden")}),T==="loading"&&G&&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:"Загружается терминал…"})]}),T==="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 hN=2e5,pN=75,mN=90;function gN({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??hN,o=Math.min(100,Math.round(l/c*100)),d=`${l.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
133
+ обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return i.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,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${xN(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function xN(l){return l>=mN?" contextbar__fill--over":l>=pN?" contextbar__fill--warn":""}const ly="ccv:last-session",bN=300*1e3,_N=1e4;function yN(){try{const l=localStorage.getItem(ly);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function vN(l,s){const r=l.find(o=>o.id===s);if(r)return r;const c=l.filter(o=>C0(o.path).includes(s));return c.length===1?c[0]:void 0}function jN(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const SN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Jb=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],wN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Wb(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const d=l.slice(c+1).toLowerCase();return d===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>Pb(h.name,d)-Pb(m.name,d))}}function Pb(l,s){return l.toLowerCase().startsWith(s)?0:1}function e_(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function kN(){var Xr,er;const l=_.useRef(null),[s,r]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[m,g]=_.useState(!1),x=_.useMemo(()=>Af()==="relay",[]),[y,j]=_.useState([]),[v,C]=_.useState([]),[N,T]=_.useState([]),[A,G]=_.useState([]),[F,B]=_.useState([]),[D,J]=_.useState([]),[H,z]=_.useState([]),[I,Y]=_.useState([]),[ae,W]=_.useState([]),[ce,ye]=_.useState(null),[Oe,we]=_.useState(null),[M,fe]=_.useState(null),[L,xe]=_.useState(null),[je,E]=_.useState(null),[X,oe]=_.useState(kl),[me,Te]=_.useState(zh),[Ee,Ae]=_.useState(!1),[nt,Xe]=_.useState(!1),dt=Yf("(max-width: 860px)"),[Ge,Ot]=_.useState(!1);_.useEffect(()=>{dt||Ot(!1)},[dt]);const[lt,Xt]=_.useState(!1),[Pe,Vt]=_.useState([]),[xl,ht]=_.useState(!1),[Kt,en]=_.useState(kl),[_n,hn]=_.useState(null),[an,rt]=_.useState(null),[pt,Tn]=_.useState([]),[En,Je]=_.useState(null),[ct,pn]=_.useState(null),[yn,Pn]=_.useState([]),[rn,kt]=_.useState([]),[Zt,vt]=_.useState([]),[el,le]=_.useState([]),[ge,Ue]=_.useState(null),[U,P]=_.useState({}),[be,De]=_.useState(null),[qt,Cn]=_.useState({}),[tn,$n]=_.useState(null),[Xn,Gl]=_.useState([]),[Yl,$l]=_.useState(!1),[ms,Os]=_.useState(null),[cn,sa]=_.useState(null),cl=(cn==null?void 0:cn.enabledProviders)??["claude","antigravity"],[tl,Lt]=_.useState(!1),[Ve,mn]=_.useState(wN),[on,El]=_.useState(null),[et,ss]=_.useState(null),[Nt,Cl]=_.useState(!1),[xt,,Al]=Z0(),un=tv(),[At,We]=_.useState(!1),[Tt,Ml]=_.useState(null),[vn,Bn]=_.useState(null),[nl,Vn]=_.useState(null),[Xl,An]=_.useState(null),[ol,Qn]=_.useState(null),[jn,zt]=_.useState(""),[Da,Ci]=_.useState(null),[Ls,aa]=_.useState([]),[gs,Vl]=_.useState(!1),[Kn,xs]=_.useState(null),[bs,bl]=_.useState(!1),[Qt,pe]=_.useState(!1),[k,V]=_.useState({}),[de,ve]=_.useState([""]),[Le,ke]=_.useState([]),[jt,Mt]=_.useState(null),[Sn,ot]=_.useState(null),[nn,Gt]=_.useState(null),[Rl,ll]=_.useState(null),[Ai,w]=_.useState(null),[ie,Me]=_.useState({}),[$e,ul]=_.useState({}),[Ql,Dl]=_.useState(!1),[Dc,Oa]=_.useState(null),[Mi,La]=_.useState(null),Ri=_.useRef(0),Di=_.useRef(null),[wn,_s]=_.useState(!1),[ia,ys]=_.useState([]),[Qf,za]=_.useState(null),[Oc,zs]=_.useState(null),ra=lv(),jr=rv(dt&&wn),Oi=_.useRef(new Map),ca=(cn==null?void 0:cn.terminalEnabled)===!0,Sr=Af()==="relay"&&((Xr=d==null?void 0:d.shell)==null?void 0:Xr.enabled)!==!0,Li=_.useRef(!1),Kf=_.useCallback((p,q)=>(Oi.current.set(p,q),()=>{Oi.current.get(p)===q&&Oi.current.delete(p)}),[]),[oa,wr]=_.useState(!1),[Zo,kr]=_.useState(null),[Lc,Nr]=_.useState(kl),[vs,Tr]=_.useState(null),[zi,js]=_.useState({}),Ui=_.useRef([]),[ln,zc]=_.useState(null);function Fo(p){zc(q=>q===p?null:p)}_.useEffect(()=>{(dt||ln==="terminal"&&!wn||ln==="files"&&!Qt||ln==="search"&&!Ql||ln==="git"&&!At||ln==="ask"&&!oa||ln==="main"&&Le.length===0)&&zc(null)},[ln,dt,wn,Qt,Ql,At,oa,Le.length]);const[Zf]=_.useState(yN),Uc=_.useRef(Zf),Er=_.useRef(!1),In=_.useRef(null),Hi=_.useRef(null),Bi=_.useRef(null),Jo=_.useRef(0),Mn=_.useRef(null),Wo=_.useRef(0);In.current=L,Mn.current=M,Wo.current=X.lastSeq;const Cr=_.useRef(me);Cr.current=me;const _l=_.useRef(null),Po=_.useRef(0);Po.current=Lc.lastSeq;const Ii=_.useRef(null),qi=_.useRef(""),Ua=_.useRef(null),Us=_.useRef([]),Hc=_.useRef([""]);Us.current=Le,Hc.current=de;const as=_.useRef(new Map),Ar=_.useRef(new Set),Gi=_.useRef(null),Yi=_.useRef(null),Bc=_.useRef(0),Ha=_.useRef(new Set);_.useEffect(()=>{const p=U0();if(!p)return;l.current=p;const q=()=>{r(p.connected),o(p.statusText)};p.onStatus(q),p.onReconnect(()=>{q(),Cn({});const bt=In.current;bt&&p.send({type:"session.sync",sessionId:bt,sinceSeq:Wo.current});const Dn=_l.current;Dn&&p.send({type:"session.sync",sessionId:Dn,sinceSeq:Po.current})});const he=p.on(bt=>$i(bt));p.connect();const He=window.setInterval(()=>{q(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{he(),window.clearInterval(He),p.close()}},[]);const $i=_.useCallback(p=>{var q,he,He,bt,Dn,Ll,cs,ei,tr;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{j(p.workspaces),C(p.archived),fe(Ye=>{var Zn;if(Ye)return Ye;const tt=Uc.current,Et=tt&&vN(p.workspaces,tt.workspaceId);return tt&&Et&&Et.id!==tt.workspaceId&&(Uc.current={...tt,workspaceId:Et.id}),(Et==null?void 0:Et.id)??((Zn=p.workspaces[0])==null?void 0:Zn.id)??null});const _e=Ua.current;if(!_e)break;const Ce=p.workspaces.find(Ye=>MN(Ye.path,_e));if(!Ce)break;Ua.current=null,Xt(!1),fe(Ce.id);break}case"workspace.candidates":if(p.query.trim()!==qi.current)break;Vt(p.candidates),p.source==="host"&&ht(!1);break;case"finder.opened":Ii.current=p.sessionId;break;case"workspace.roots":Tn(p.roots);break;case"workspace.created":if(fe(p.workspace.id),p.warnings.length===0){Xt(!1),rt(null);break}Je({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Mn.current)break;J(p.sessions),z(p.archived);break;case"folder.list":T(p.workspaceFolders),G(p.sessionFolders),B(p.pinnedFolders??[]);break;case"session.pinned":Y(p.sessions);break;case"session.live":W(p.sessions);break;case"order.state":we(p.order);break;case"session.summary":if(p.session.id===Ii.current){hn(p.session);break}if(p.session.parentSessionId){p.session.id===_l.current&&Tr(p.session);break}if(W(_e=>{const Ce=_e.findIndex(tt=>tt.id===p.session.id);if(p.session.state==="closed")return Ce===-1?_e:_e.filter(tt=>tt.id!==p.session.id);if(Ce===-1)return[..._e,p.session];const Ye=_e.slice();return Ye[Ce]=p.session,Ye}),J(_e=>{const Ce=_e.findIndex(tt=>tt.id===p.session.id);if(Ce===-1)return[p.session,..._e];const Ye=_e.slice();return Ye[Ce]=p.session,Ye}),Y(_e=>{const Ce=_e.findIndex(tt=>tt.id===p.session.id);if(Ce===-1)return _e;const Ye=_e.slice();return Ye[Ce]={...p.session,pinned:!0,..._e[Ce].pinnedAt?{pinnedAt:_e[Ce].pinnedAt}:{}},Ye}),In.current===null&&Bi.current&&Bi.current.workspaceId===p.session.workspaceId&&(o_(p.session.id,Bi.current.text),Bi.current=null),xe(_e=>_e??p.session.id),((q=Hi.current)==null?void 0:q.sessionId)===p.session.id){const _e=Hi.current;p.session.state==="error"?Hi.current=null:p.session.state!=="closed"&&(Hi.current=null,(he=l.current)==null||he.send({type:"prompt.send",sessionId:_e.sessionId,text:_e.text,images:_e.images}))}break;case"usage.state":p.sessionId===In.current&&(El(p.usage),Cl(!1));break;case"context.state":p.sessionId===In.current&&(ss(p.context),Cl(!1));break;case"session.capabilities":p.sessionId===In.current&&E(p.capabilities);break;case"session.events":if(p.sessionId===_l.current){Nr(_e=>Mf(_e,p.entries));break}if(p.sessionId===Ii.current){en(_e=>Mf(_e,p.entries));break}if(p.sessionId!==In.current)break;for(const _e of p.entries){if(_e.event.kind!=="rewound")continue;const Ce=_e.event.toUserIndex,Ye=Q0(Cr.current.entries,Ce),tt=Ye.reduce((Et,Zn)=>Zn.event.kind==="user.message"?Et+1:Et,0);Te(Et=>({...Et,entries:Ye})),oe(Et=>({...Et,items:K0(Et.items,Ce,tt)}))}oe(_e=>Mf(_e,p.entries));break;case"session.history":if(p.sessionId!==In.current)break;Te(_e=>$0(_e,p));break;case"side.opened":{if(p.parentSessionId!==In.current)break;_l.current=p.sessionId,kr(p.sessionId);const _e=Ui.current;Ui.current=[];for(const Ce of _e)Ce(p.sessionId);break}case"side.closed":if(p.parentSessionId!==In.current)break;_l.current=null,kr(null),Nr(kl),Tr(null);break;case"git.state":if(p.workspaceId!==Mn.current)break;Ml(p.state);break;case"git.commit":if(p.workspaceId!==Mn.current)break;Bn(p.detail);break;case"git.result":if(p.workspaceId!==Mn.current)break;An({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Bn(null),Vn(null),Vl(!1),bl(!1));break;case"git.busy":if(p.workspaceId!==Mn.current)break;zt(p.label);break;case"git.files":if(p.workspaceId!==Mn.current)break;xs({files:p.files,truncated:p.truncated});break;case"github.status":Ci(p.status);break;case"github.owners":aa(p.owners);break;case"fs.dir":if(p.workspaceId!==Mn.current)break;V(_e=>({..._e,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Mn.current)break;if(p.scope!=="tree"){const _e=p.scope;ul(Ce=>({...Ce,[_e]:{query:p.query,entries:p.entries}}));break}w({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Mn.current)break;Oa({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Mn.current)break;const _e=Ar.current.delete(p.file.path);ke(Ye=>{const tt=Ye.findIndex(no=>no.path===p.file.path);if(tt===-1)return[...Ye,xb(p.file,++Bc.current)];const Et=Ye[tt],Zn=Ye.slice();return Zn[tt]=Et.saved===p.file.content&&!Aa(Et)?{...Et,mtime:p.file.mtime,size:p.file.size,stale:!1}:xb(p.file,++Bc.current),Zn}),_e&&Mt(p.file.path);const Ce=Di.current;Ce&&Ce.path===p.file.path&&(Di.current=null,La({...Ce,token:++Ri.current}));break}case"fs.media":{if(p.workspaceId!==Mn.current)break;Ha.current.delete(p.path),ke(_e=>_e.map(Ce=>Ce.path===p.path?{...Ce,mediaBase64:p.base64,mediaError:void 0}:Ce));break}case"fs.mediaFailed":{if(p.workspaceId!==Mn.current)break;Ha.current.delete(p.path),ke(_e=>_e.map(Ce=>Ce.path===p.path?{...Ce,mediaError:p.message}:Ce));break}case"fs.saved":{if(p.workspaceId!==Mn.current)break;const _e=as.current.get(p.path);as.current.delete(p.path);const Ce=_e!==void 0;ke(tt=>tt.map(Et=>Et.path!==p.path?Et:Ce?{...Et,saved:_e,mtime:p.mtime,size:p.size,stale:!1}:{...Et,stale:!0}));const Ye=Us.current.find(tt=>tt.path===p.path);!Ce&&Ye&&!Aa(Ye)&&((He=l.current)==null||He.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(bt=l.current)==null||bt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Mn.current)break;if(ot({ok:p.ok,message:p.message}),p.ok||as.current.delete(p.path),p.conflict&&ke(Ce=>Ce.map(Ye=>Ye.path===p.path?{...Ye,stale:!0}:Ye)),Yi.current===p.path){const Ce=Yi.current;Yi.current=null,p.ok&&(Ar.current.add(Ce),(Dn=l.current)==null||Dn.send({type:"fs.read",workspaceId:p.workspaceId,path:Ce}))}const _e=Gi.current;if(p.ok&&_e&&_e.to===p.path){Gi.current=null;const Ce=Ye=>Ye===_e.from?_e.to:Ye.startsWith(`${_e.from}/`)?_e.to+Ye.slice(_e.from.length):Ye;ke(Ye=>Ye.map(tt=>({...tt,path:Ce(tt.path)}))),Mt(Ye=>Ye===null?null:Ce(Ye)),ve(Ye=>Ye.map(Ce)),V(Ye=>{const tt={};for(const[Et,Zn]of Object.entries(Ye))Et===_e.from||Et.startsWith(`${_e.from}/`)||(tt[Et]=Zn);return tt})}p.ok&&((Ll=l.current)==null||Ll.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Mn.current)break;ys(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Mn.current)break;zs(null),ys(_e=>{const Ce=_e.findIndex(tt=>tt.id===p.terminal.id);if(Ce===-1)return[..._e,p.terminal];const Ye=_e.slice();return Ye[Ce]=p.terminal,Ye}),Li.current&&(Li.current=!1,za(p.terminal.id));break;case"term.buffer":(cs=Oi.current.get(p.id))==null||cs({kind:"buffer",data:p.data});break;case"term.data":(ei=Oi.current.get(p.id))==null||ei({kind:"data",data:p.data});break;case"term.exit":ys(_e=>_e.map(Ce=>Ce.id===p.id?{...Ce,exitCode:p.exitCode}:Ce));break;case"term.closed":ys(_e=>_e.filter(Ce=>Ce.id!==p.id));break;case"mcp.list":p.sessionId===In.current&&Pn(p.servers);break;case"plugin.list":if(p.sessionId!==In.current)break;kt(p.plugins),vt(p.marketplaces),le(p.catalog);break;case"operation.result":p.sessionId===In.current&&Ue(p.result);break;case"auth.status":Os(p.status);break;case"relay.state":h(p.state);break;case"settings.state":sa(p.settings);break;case"handoff.state":P(_e=>{if(!p.handoff){if(!(p.sessionId in _e))return _e;const Ce={..._e};return delete Ce[p.sessionId],Ce}return{..._e,[p.sessionId]:p.handoff}});break;case"handoff.written":Cn(_e=>{if(!(p.sessionId in _e))return _e;const Ce={..._e};return delete Ce[p.sessionId],Ce}),p.handoff&&In.current===p.sessionId?$n(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Jo.current+=1,Gl(_e=>[..._e,{id:Jo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":mn(p.state),p.state.active&&$l(!0);break;case"session.closed":W(_e=>_e.filter(Ce=>Ce.id!==p.sessionId)),J(_e=>_e.map(Ce=>Ce.id===p.sessionId?{...Ce,state:"closed"}:Ce));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Ua.current=null,rt(p.message)),(tr=p.context)!=null&&tr.startsWith("term.")&&zs(p.message);break}},[]),te=_.useCallback(p=>{var q;(q=l.current)==null||q.send(p)},[]);_.useEffect(()=>{M&&te({type:"session.list",workspaceId:M})},[M,te]),_.useEffect(()=>{s&&te({type:"session.pins"})},[s,te]),_.useEffect(()=>{s&&te({type:"settings.get"})},[s,te]),_.useEffect(()=>{if(s)return te({type:"session.drafts",sessionIds:u_()}),q0(p=>te({type:"session.drafts",sessionIds:p}))},[s,te]),_.useEffect(()=>{if(Er.current)return;const p=Uc.current;if(!p||!M)return;if(M!==p.workspaceId){Er.current=!0;return}if(L){Er.current=!0;return}if(D.length===0)return;const q=D.find(he=>jN(he,p));Er.current=!0,q&&q.state!=="closed"&&Ki(q)},[D,M,L]),_.useEffect(()=>{!M||Sr||!ca||te({type:"term.list",workspaceId:M})},[M,Sr,ca,te]),_.useEffect(()=>{za(p=>{var q;return p&&ia.some(he=>he.id===p)?p:((q=ia[0])==null?void 0:q.id)??null})},[ia]),_.useEffect(()=>{lt&&te({type:"workspace.roots"})},[lt,te]);const Ba=_.useCallback(()=>{const p=In.current;p&&(Cl(!0),te({type:"usage.get",sessionId:p}),te({type:"context.get",sessionId:p}))},[te]);_.useEffect(()=>{if(!Nt)return;const p=window.setTimeout(()=>Cl(!1),_N);return()=>window.clearTimeout(p)},[Nt]);const Ia=_.useMemo(()=>{const p=Math.max((on==null?void 0:on.fetchedAt)??0,(et==null?void 0:et.fetchedAt)??0);return p>0?p:null},[on==null?void 0:on.fetchedAt,et==null?void 0:et.fetchedAt]);_.useEffect(()=>{if(ss(null),!L)return;Ba();const p=()=>{document.hidden||Ba()},q=window.setInterval(p,bN),he=()=>{document.hidden||Ba()};return document.addEventListener("visibilitychange",he),()=>{window.clearInterval(q),document.removeEventListener("visibilitychange",he)}},[L,Ba]),_.useEffect(()=>{if(!L){Te(zh);return}Te({...zh,loading:!0}),te({type:"session.history",sessionId:L})},[L,te]);const eu=_.useCallback(()=>{!L||me.loading||!Dx(me)||(Te(p=>({...p,loading:!0})),te({type:"session.history",sessionId:L,before:d_(me)}))},[L,me,te]),tu=_.useMemo(()=>X0(me.entries),[me.entries]),Q=_.useMemo(()=>D.find(p=>p.id===L)??null,[D,L]),ua=L?(Q==null?void 0:Q.claudeSessionId)??L:null,qa=ua?U[ua]??null:null;_.useEffect(()=>{ua&&te({type:"handoff.get",sessionId:ua})},[ua,te]),_.useEffect(()=>{be&&!(be.sessionId in U)&&De(null)},[U,be]);const Ic=_.useMemo(()=>{var he;if(!on)return null;const p=(((he=on.buckets)==null?void 0:he.length)??0)>0,q=(Q==null?void 0:Q.provider)==="antigravity";return p===q?on:null},[on,Q==null?void 0:Q.provider]),qc="Обновить лимиты и контекст",Ff=qc+(Ia?`
134
+ обновлено в ${new Date(Ia).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{document.documentElement.dataset.provider=(Q==null?void 0:Q.provider)??"claude"},[Q==null?void 0:Q.provider]),_.useEffect(()=>{(Q==null?void 0:Q.provider)==="antigravity"&&wr(!1)},[Q==null?void 0:Q.provider]);const Ga=y.find(p=>p.id===M)??v.find(p=>p.id===M)??null;_.useEffect(()=>{if(!M||!L)return;const p={workspaceId:M,sessionId:L,claudeSessionId:(Q==null?void 0:Q.claudeSessionId)??null};try{localStorage.setItem(ly,JSON.stringify(p))}catch{}},[M,L,Q==null?void 0:Q.claudeSessionId]);function Jf(p){Ua.current=p,rt(null),te({type:"workspace.open",path:p})}function Wf(p,q,he){rt(null),te({type:"workspace.create",parent:p,name:q,init:he})}function Pf(p){if(qi.current=p,!p){Vt([]),ht(!1);return}ht(!0),te({type:"workspace.find",query:p})}function yl(p){qi.current=p,en(kl),te({type:"workspace.find.agent",query:p})}function Xi(){Xt(!1),rt(null),Je(null),Vt([]),en(kl),hn(null),qi.current="",Ua.current=null}function fa(){const p=In.current;p&&_l.current&&te({type:"side.reset",sessionId:p}),_l.current=null,kr(null),Nr(kl),Tr(null),js({}),Ui.current=[]}function nu(p){te({type:"workspace.close",workspaceIds:p}),!(!M||!p.includes(M))&&(fa(),fe(null),xe(null),J([]),z([]),oe(kl),E(null),Xe(!1))}function lu(p,q){te({type:"session.archive",workspaceId:p,sessionIds:q}),L&&(q.includes(L)||Q!=null&&Q.claudeSessionId&&q.includes(Q.claudeSessionId))&&(fa(),xe(null),oe(kl),E(null),Xe(!1))}function su(p){te({type:"workspace.restore",workspaceIds:p})}function Gc(p,q,he){te({type:"folder.create",scope:p,name:q,workspaceId:he})}function ed(p,q){te({type:"folder.rename",folderId:p,name:q})}function Ya(p,q){te({type:"folder.setColor",folderId:p,color:q})}function Yc(p){te({type:"folder.delete",folderId:p})}function Vi(p,q,he,He){te({type:"folder.assign",scope:p,itemId:q,folderId:he,workspaceId:He})}function $c(p=cl[0]??"claude"){M&&(fa(),xe(null),E(null),oe(kl),Xe(!1),te({type:"session.start",workspaceId:M,provider:p}),Ae(!1))}function Mr(p){fa(),st(),fe(p),xe(null),oe(kl),E(null),Xe(!1),Ml(null),Bn(null),Vn(null),An(null),zt(""),Vl(!1),xs(null),bl(!1),ys([]),za(null)}function da(p,q,he){te({type:"session.pin",workspaceId:p,sessionIds:q,pinned:he})}function $a(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Qi(p){if($a(p)){ye(p);return}te({type:"session.close",sessionId:p.id})}function au(p,q,he){we(He=>{const bt=He??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!he)return He;const Dn={...bt.sessions};return q&&q.length>0?Dn[he]=q:delete Dn[he],{...bt,sessions:Dn}}return{...bt,[p]:q??[]}}),te({type:"order.set",scope:p,ids:q,...he?{workspaceId:he}:{}})}function ha(p){p.workspaceId!==M&&Mr(p.workspaceId),Ki(p)}function Ki(p){if(Ae(!1),fa(),oe(kl),E(null),Xe(!1),p.state==="closed"){xe(null),te({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}xe(p.id),te({type:"session.sync",sessionId:p.id,sinceSeq:0})}function iu(p,q){if(L){if((Q==null?void 0:Q.state)==="closed"){Hi.current={sessionId:Q.id,text:p,images:q},Ki(Q);return}te({type:"prompt.send",sessionId:L,text:p,images:q})}}function Xc(p){const q=ae.find(he=>(he.claudeSessionId??he.id)===p.sessionId&&he.state!=="closed");cu(p.workspaceId,p.sessionId,p.text),q&&te({type:"session.close",sessionId:q.id})}function ru(p){cu(p.workspaceId,p.claudeSessionId??p.id,null)}function cu(p,q,he){Bi.current=he===null?null:{workspaceId:p,text:he},p!==M?Mr(p):(fa(),xe(null),E(null),oe(kl),Xe(!1)),te({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:q,...he===null?{}:{fromHandoff:!0}}),Ae(!1)}_.useEffect(()=>{tn&&($n(null),Xc(tn))},[tn]);function ou(p){qt[p.id]||(Cn(q=>({...q,[p.id]:!0})),te({type:"session.handoff",sessionId:p.id}))}function uu(p){te({type:"handoff.dismiss",sessionId:p})}function Vc(p,q){te({type:"session.rename",sessionId:p.id,title:q,workspaceId:p.workspaceId}),J(he=>he.map(He=>He.id===p.id?{...He,title:q}:He))}function Rr(p){L&&(Ae(!1),Ue(null),pn(p),te({type:"mcp.list",sessionId:L}),te({type:"plugin.list",sessionId:L}))}const Kl={mcpAction:(p,q)=>{L&&(Ue(null),te({type:"mcp.action",sessionId:L,name:p,action:q}))},mcpAdd:(p,q)=>{L&&te({type:"mcp.add",sessionId:L,name:p,draft:q})},mcpRemove:p=>{L&&te({type:"mcp.remove",sessionId:L,name:p})},pluginInstall:p=>{L&&te({type:"plugin.install",sessionId:L,spec:p})},pluginUninstall:p=>{L&&te({type:"plugin.uninstall",sessionId:L,id:p})},pluginToggle:(p,q)=>{L&&te({type:"plugin.toggle",sessionId:L,id:p,enabled:q})},marketplaceAdd:p=>{L&&te({type:"marketplace.add",sessionId:L,source:p})},marketplaceRemove:p=>{L&&te({type:"marketplace.remove",sessionId:L,name:p})}};function Zi(){Ae(!1),$l(!0),te({type:"auth.status"})}const fl={login:(p,q)=>te({type:"auth.login",mode:p,switchAccount:q}),submitCode:p=>te({type:"auth.code",code:p}),cancel:()=>te({type:"auth.cancel"}),logout:()=>te({type:"auth.logout"})};function Xa(){Ae(!1),Lt(!0),te({type:"settings.get"})}function Qc(p){sa(q=>q&&{...q,...p}),te({type:"settings.update",settings:p})}function Dr(p){L&&te({type:"side.ask",sessionId:L,text:p})}function Or(){L&&(te({type:"side.reset",sessionId:L}),_l.current=null,kr(null),Nr(kl),Tr(null),js({}),Ui.current=[])}function pa(p){const q=_l.current;if(q){p(q);return}const he=In.current;he&&(Ui.current.push(p),te({type:"side.open",sessionId:he}))}function Hs(){M&&te({type:"git.state",workspaceId:M})}function fu(p){M&&(Vn(p),te({type:"git.show",workspaceId:M,ref:p}))}function Fi(p,q){An(null),Qn({target:p,label:q})}function Va(){!M||!ol||(te({type:"git.checkout",workspaceId:M,target:ol.target}),Qn(null))}function td(){M&&(An(null),te({type:"git.push",workspaceId:M}))}function vl(p){M&&(An(null),te({type:"git.pull",workspaceId:M,merge:p}))}function Kc(){M&&(An(null),xs(null),Vl(!0),te({type:"github.status"}),te({type:"github.owners"}),te({type:"git.files",workspaceId:M}))}function Ss(p){M&&(An(null),te({type:"git.publish",workspaceId:M,...p}))}function du(p){M&&(An(null),te({type:"git.remote",workspaceId:M,url:p}))}function Lr(){An(null),bl(!0)}function ma(p){te({type:"github.token",token:p}),te({type:"github.owners"})}function Zc(){te({type:"github.status"}),te({type:"github.owners"})}_.useEffect(()=>{if(!(!Qt||!M))for(const p of de)p in k||te({type:"fs.list",workspaceId:M,path:p})},[Qt,de,k,M,te]);function hu(p){ve(q=>q.includes(p)?q.filter(he=>he!==p):[...q,p])}function Fc(p){if(!p){w(null);return}M&&te({type:"fs.search",workspaceId:M,query:p})}function pu(p){if(!p){Oa(null);return}M&&te({type:"fs.grep",workspaceId:M,query:p})}const jl=_.useCallback((p,q)=>{Me(bt=>({...bt,[p]:q}));const he=Mn.current;if(q===null||!he)return;const He=q.lastIndexOf("/");if(He!==-1){te({type:"fs.list",workspaceId:he,path:q.slice(0,He)});return}if(q===""){te({type:"fs.list",workspaceId:he,path:""});return}te({type:"fs.search",workspaceId:he,query:q,scope:p})},[te]),Qa=_.useMemo(()=>Wb(ie.mention??null,$e.mention??null,k),[ie.mention,$e.mention,k]),Ka=_.useMemo(()=>Wb(ie.side??null,$e.side??null,k),[ie.side,$e.side,k]);function zr(p){dl(p.path,{line:p.line,column:p.column})}function Ji(p){const q=[];let he=xr(p.path);for(;q.push(he),!!he;)he=xr(he);ve(He=>{const bt=new Set(He);for(const Dn of q)bt.add(Dn);return p.kind==="dir"&&bt.add(p.path),[...bt]}),p.kind==="file"&&dl(p.path)}function dl(p,q){if(Us.current.find(He=>He.path===p)){Mt(p),q&&La({path:p,...q,token:++Ri.current});return}M&&(q&&(Di.current={path:p,...q}),Ar.current.add(p),te({type:"fs.read",workspaceId:M,path:p}))}function hl(p,q=!1){const he=Us.current,He=he.find(Ll=>Ll.path===p);if(He&&Aa(He)&&!q){ll(p);return}ll(null);const bt=he.findIndex(Ll=>Ll.path===p),Dn=he.filter(Ll=>Ll.path!==p);ke(Dn),Mt(Ll=>{var cs;return Ll===p?((cs=Dn[Math.min(bt,Dn.length-1)])==null?void 0:cs.path)??null:Ll})}function Zl(p,q=!1){const he=Us.current.find(He=>He.path===p);!he||!M||!q&&!Aa(he)||(as.current.set(p,he.text),te({type:"fs.write",workspaceId:M,path:p,content:he.text,eol:he.eol,encoding:he.encoding,baseMtime:he.mtime,...q?{force:!0}:{}}))}function is(p){M&&te({type:"fs.read",workspaceId:M,path:p})}function rs(p){M&&(Ha.current.has(p)||(Ha.current.add(p),te({type:"fs.readMedia",workspaceId:M,path:p})))}const ws=_.useRef(new Map);function mu(p){const q=ws.current,he=q.get(p);he&&clearTimeout(he);const He=(cn==null?void 0:cn.autoSaveAfterPauseMs)??0;He<=0||q.set(p,setTimeout(()=>{q.delete(p);const bt=Us.current.find(Dn=>Dn.path===p);bt&&Aa(bt)&&!bt.stale&&Zl(p)},He))}function Jc(p,q,he){if(!M)return;const He=p?`${p}/${he}`:he;ot(null),q==="file"&&(Yi.current=He),te({type:"fs.create",workspaceId:M,path:He,kind:q})}function Wc(p,q){if(!M)return;const he=xr(p),He=he?`${he}/${q}`:q;ot(null),Gi.current={from:p,to:He},te({type:"fs.rename",workspaceId:M,path:p,to:He})}function gu(p,q){if(!M)return;const he=p.slice(p.lastIndexOf("/")+1),He=q?`${q}/${he}`:he;He!==p&&(ot(null),Gi.current={from:p,to:He},te({type:"fs.rename",workspaceId:M,path:p,to:He}))}function qn(p,q){M&&(ot(null),te({type:"fs.copy",workspaceId:M,path:p,toDir:q}))}function Yt(p){M&&(ot(null),Gt(null),te({type:"fs.delete",workspaceId:M,path:p.path}),ke(q=>q.filter(he=>he.path!==p.path&&!he.path.startsWith(`${p.path}/`))),Mt(q=>q&&(q===p.path||q.startsWith(`${p.path}/`))?null:q))}function st(){V({}),ve([""]),ke([]),Mt(null),ot(null),w(null),Oa(null),Me({}),ul({}),La(null),Ar.current.clear(),as.current.clear(),Ha.current.clear(),Di.current=null,Gi.current=null,Yi.current=null}function Bs(){!M||Sr||!ca||(zs(null),Li.current=!0,te({type:"term.open",workspaceId:M,cols:80,rows:24}))}function Ol(p){te({type:"term.close",id:p})}function Pc(p,q){L&&te({type:"permission.respond",sessionId:L,requestId:p,decision:q})}function Is(p,q){L&&te({type:"permission.respond",sessionId:L,requestId:p,decision:"allow",answers:q})}function xu(p){L&&te({type:"permission.respond",sessionId:L,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function bu(p,q){L&&te({type:"permission.respond",sessionId:L,requestId:p,decision:"allow",plan:q})}function Za(p){L&&te({type:"permission.respond",sessionId:L,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}_.useEffect(()=>{function p(q){if(q.key!=="Escape")return;if(ln!==null){const He=q.target;if(!(He instanceof HTMLElement&&He.closest(".termview, .editor, .sidepane"))){zc(null);return}}if(!L||X.pending.length>0)return;const he=q.target;he instanceof HTMLElement&&he.closest(".sidepane, .editor")||te({type:"control.interrupt",sessionId:L})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[L,X.pending.length,te,ln]),_.useEffect(()=>{function p(q){q.key!=="`"||!(q.ctrlKey||q.metaKey)||ca&&(q.preventDefault(),_s(he=>!he))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[ca]);const qs=_.useMemo(()=>{const p=(je==null?void 0:je.commands)??[];return p.length===0||(Q==null?void 0:Q.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Jb]},[je,Q==null?void 0:Q.provider]);function Ur(p){const q=SN[p];return q&&(Q==null?void 0:Q.provider)!=="antigravity"?(Rr(q),!0):(Q==null?void 0:Q.provider)==="antigravity"||!Jb.some(he=>he.name===p)?!1:(Zi(),p==="logout"&&fl.logout(),p==="switch-account"&&fl.login("claudeai",!0),!0)}const Gs=(Q==null?void 0:Q.state)==="waiting_permission",Sl=(Q==null?void 0:Q.state)==="reconnecting",Gn=(Q==null?void 0:Q.state)==="running"||Sl||Gs,fn=X.pending[0]??null,ks=fn?Tw(fn.toolName,fn.input):null;_.useEffect(()=>{!At&&!Qt||!M||Gn||te({type:"git.state",workspaceId:M})},[At,Qt,M,Gn,te]),_.useEffect(()=>{if(!(Gn||!M)){Qt&&V(p=>{const q={};for(const[he,He]of Object.entries(p))Hc.current.includes(he)||(q[he]=He);return q});for(const p of Us.current)Aa(p)||te({type:"fs.read",workspaceId:M,path:p.path})}},[Gn,M,Qt,te]);const Fl=(Q==null?void 0:Q.cwd)??(je==null?void 0:je.cwd)??null,Hr=(je==null?void 0:je.models)??[],Fa=(Q==null?void 0:Q.model)??(je==null?void 0:je.model)??null,{rows:ga,selected:Br}=e_(Hr,Fa),Jl=vs?{model:vs.model,effort:vs.effort,ultracode:vs.ultracode,thinking:vs.thinking,switchOnFlag:vs.switchModelsOnFlag}:{model:zi.model??Fa,effort:zi.effort??(Q==null?void 0:Q.effort)??null,ultracode:zi.ultracode??(Q==null?void 0:Q.ultracode)??!1,thinking:zi.thinking??(Q==null?void 0:Q.thinking)??!0,switchOnFlag:zi.switchOnFlag??(Q==null?void 0:Q.switchModelsOnFlag)??!0},Rn=e_(Hr,Jl.model),Ir=(vs==null?void 0:vs.state)==="running",qr=jt?Le.find(p=>p.path===jt)??null:null,nd=new Set(Le.filter(Aa).map(p=>p.path)),Wi=p=>i.jsx(sN,{pane:p,width:un.widths[p],onResize:q=>un.setWidth(p,q),onReset:()=>un.reset(p)}),Ja=p=>dt?null:()=>Fo(p),gn=(Q==null?void 0:Q.provider)==="antigravity"?J0:h_,Gr=je&&i.jsx(Rs,{title:"Режим прав",value:(Q==null?void 0:Q.permissionMode)??"default",options:gn.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{L&&te({type:"control.set_mode",sessionId:L,mode:p})}}),Wa=ga.length>0?i.jsx(J_,{models:ga,value:Br,effort:(Q==null?void 0:Q.effort)??null,ultracode:(Q==null?void 0:Q.ultracode)??!1,thinking:(Q==null?void 0:Q.thinking)??!0,switchOnFlag:(Q==null?void 0:Q.switchModelsOnFlag)??!0,showSwitchOnFlag:(Q==null?void 0:Q.provider)!=="antigravity",onModel:p=>{!L||!p||te({type:"control.set_model",sessionId:L,model:p})},onEffort:p=>{L&&te({type:"control.set_effort",sessionId:L,effort:p})},onUltracode:p=>{L&&te({type:"control.set_ultracode",sessionId:L,enabled:p})},onThinking:p=>{L&&te({type:"control.set_thinking",sessionId:L,enabled:p})},onSwitchOnFlag:p=>{L&&te({type:"control.set_flag_switch",sessionId:L,enabled:p})}}):Fa&&i.jsx("span",{className:"badge",children:Fa}),Pi=Gn&&i.jsx("span",{className:Gs?"badge badge--wait":"badge badge--live",children:Gs?"ждёт":Sl?"переподключается":"работает"}),eo=(Q==null?void 0:Q.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),xa=Pi||eo,ba=()=>{L&&te({type:"session.reconnect",sessionId:L})},ld=Sl?"Сессия уже поднимает новый процесс":Gn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",_u=L&&(Sl||(Q==null?void 0:Q.state)==="error")?i.jsxs("div",{className:Sl?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),Sl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:Sl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ba,children:Sl?"Переподключить сейчас":"Переподключить"})]}):null,sd=qa?i.jsx(Jk,{handoff:qa,onContinue:()=>Xc(qa),onShow:()=>De(qa),onDismiss:()=>uu(qa.sessionId)}):null,Yr=Q&&Q.totalCostUsd>0?`$${Q.totalCostUsd.toFixed(3)}`:null,Ys=(Q==null?void 0:Q.provider)!=="antigravity"&&i.jsx("button",{className:oa?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":oa,onClick:()=>wr(p=>!p),children:i.jsx(DN,{})}),to=Q&&Q.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Qi(Q),children:i.jsx(CN,{})}),Ns=Q?qt[Q.id]===!0:!1,$r=x_({onLongPress:()=>{Q&&ru(Q)},onClick:()=>{Q&&ou(Q)},disabled:Ns}),Pa=Q&&Q.state!=="closed"&&Q.provider!=="antigravity"&&i.jsxs("button",{type:"button",className:Ns?"pane-btn pane-btn--handoff is-busy":$r.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${$r.thresholdMs}ms`},title:Ns?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Ns,disabled:Ns,...$r.handlers,children:[i.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),i.jsx(AN,{})]});return i.jsxs("div",{className:"app",style:un.style,children:[i.jsx(tS,{open:Ee,connected:s,status:c,workspaces:y,archivedWorkspaces:v,workspaceFolders:N,sessionFolders:A.filter(p=>p.workspaceId===M),pinnedFolders:F,sessions:D.filter(p=>p.workspaceId===M),archived:H.filter(p=>p.workspaceId===M),pinned:I,live:ae,listOrder:Oe,liveSessionsFirst:(cn==null?void 0:cn.liveSessionsFirst)===!0,onReorder:au,activeWorkspaceId:M,activeSessionId:L,onPinSessions:da,onSelectPinned:ha,onCloseWorkspaces:nu,onRestoreWorkspaces:su,onArchiveSessions:lu,onUnarchiveSessions:p=>{M&&te({type:"session.unarchive",workspaceId:M,sessionIds:p})},onCreateFolder:Gc,onRenameFolder:ed,onSetFolderColor:Ya,onDeleteFolder:Yc,onAssignToFolder:Vi,onSelectWorkspace:Mr,onSelectSession:Ki,onRenameSession:Vc,onStopSession:Qi,onOpenWorkspace:()=>Xt(!0),onNewSession:$c,enabledProviders:cl,onOpenExtensions:L&&(Q==null?void 0:Q.provider)!=="antigravity"?()=>Rr("mcp"):null,account:ms,onOpenAccount:Zi,relay:d,onOpenRelay:x?null:()=>g(!0),onOpenSettings:Xa,themeMode:xt,onCycleTheme:Al}),Wi("sidebar"),Ee&&i.jsx("div",{className:"scrim",onClick:()=>Ae(!1)}),i.jsx(dj,{open:Qt,tree:k,expanded:new Set(de),activePath:jt,dirty:nd,gitChanges:(Tt==null?void 0:Tt.changed)??[],result:Sn,searchResult:Ai,onSearch:Fc,onReveal:Ji,onToggle:hu,onOpen:dl,onCreate:Jc,onRename:Wc,onMove:gu,onCopy:qn,onDelete:Gt,onRefresh:()=>{ot(null),V({}),Hs()},onClose:()=>pe(!1),zoomed:ln==="files",onToggleZoom:Ja("files")}),Qt&&ln!=="files"&&Wi("files"),i.jsx(jj,{open:Ql,result:Dc,onSearch:pu,onOpenMatch:zr,onClose:()=>Dl(!1),zoomed:ln==="search",onToggleZoom:Ja("search")}),Ql&&ln!=="search"&&Wi("search"),i.jsx(Gw,{open:At,state:Tt,result:Xl,selected:nl,busy:jn,onRefresh:Hs,onShow:fu,onCheckout:Fi,onPush:td,onPull:vl,onPublish:Kc,onConnectRemote:Lr,onDismissResult:()=>An(null),onClose:()=>We(!1),zoomed:ln==="git",onToggleZoom:Ja("git")}),At&&ln!=="git"&&Wi("git"),i.jsxs("main",{className:ln==="main"||ln==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Ae(!0),children:"☰"}),i.jsx("button",{className:Qt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Qt,onClick:()=>{pe(p=>!p),We(!1),Dl(!1)},children:i.jsx(NN,{})}),i.jsx("button",{className:Ql?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Ql,onClick:()=>{Dl(p=>!p),pe(!1),We(!1)},children:i.jsx(TN,{})}),i.jsx("button",{className:At?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":At,onClick:()=>{We(p=>!p),pe(!1),Dl(!1)},children:i.jsx(EN,{})}),ca&&i.jsx("button",{className:wn?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":wn,onClick:()=>_s(p=>!p),children:i.jsx(RN,{})}),dt&&Ys,dt&&i.jsx("button",{className:Ge?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Ge,onClick:()=>Ot(!0),children:i.jsx(ON,{})}),i.jsxs("div",{className:"topbar__id",children:[nt&&Q?i.jsx(ta,{className:"rename--title",value:Q.title??"",onCommit:p=>{Vc(Q,p),Xe(!1)},onCancel:()=>Xe(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!Q||dt,title:Q&&!dt?"Переименовать сессию":void 0,onClick:()=>Xe(!0),children:(Q==null?void 0:Q.title)??"Claude Code Visual"}),Ga&&i.jsx("span",{className:"topbar__project",title:Ga.path,children:Ga.name})]}),dt?xa:Fl&&i.jsx(F_,{path:Fl})]}),!dt&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:Nt?"meters-refresh is-busy":"meters-refresh",title:Ff,"aria-label":qc,"aria-busy":Nt,disabled:!L||Nt,onClick:Ba,children:i.jsx(LN,{})}),i.jsx(P_,{usage:Ic}),i.jsx(ny,{}),Gr,Wa,xa,Yr&&i.jsx("span",{className:"badge badge--cost",children:Yr}),Pa,to,Ys]})]}),i.jsx(gN,{tokens:(et==null?void 0:et.tokens)??X.contextTokens,maxTokens:(et==null?void 0:et.maxTokens)??null,fetchedAt:(et==null?void 0:et.fetchedAt)??null}),dt&&Ge&&i.jsx(vk,{onClose:()=>Ot(!1),permission:Gr,model:Wa,usage:Ic,cwd:Fl,costLabel:Yr,onRefresh:Ba,refreshing:Nt,metersFetchedAt:Ia,onRename:Q?()=>{Xe(!0),Ot(!1)}:null,onHandoff:Q&&Q.state!=="closed"&&Q.provider!=="antigravity"?()=>{ou(Q),Ot(!1)}:null,onFreshSession:Q&&Q.state!=="closed"&&Q.provider!=="antigravity"?()=>{ru(Q),Ot(!1)}:null,handoffWriting:Ns,onStop:Q&&Q.state!=="closed"?()=>{Qi(Q),Ot(!1)}:null}),Le.length>0&&i.jsx(qj,{files:Le,activePath:jt,busy:Gn,onSelect:Mt,onClose:p=>hl(p),zoomed:ln==="main",onToggleZoom:Ja("main")}),qr?i.jsx(Bj,{file:qr,goto:(Mi==null?void 0:Mi.path)===qr.path?Mi:null,onChange:(p,q)=>{ke(he=>he.map(He=>He.path===p?{...He,text:q}:He)),mu(p)},onSave:p=>Zl(p),onReload:is,onOverwrite:p=>Zl(p,!0),onRequestMedia:rs,onTogglePreview:p=>ke(q=>q.map(he=>he.path===p?{...he,previewMode:!he.previewMode}:he))}):i.jsxs(i.Fragment,{children:[i.jsx(Op,{items:X.items,busy:Gn&&!Sl,waiting:Gs,empty:(Q==null?void 0:Q.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:tu,historyHasMore:Dx(me),historyLoading:me.loading,onLoadHistory:eu,sessionId:L??void 0,onEditMessage:(Q==null?void 0:Q.provider)==="antigravity"?void 0:(p,q,he)=>{L&&te({type:"prompt.edit",sessionId:L,userIndex:p,text:q,images:he})}}),_u,sd,L&&((er=Q==null?void 0:Q.tasks)!=null&&er.length)?i.jsx(Vj,{tasks:Q.tasks,onStop:p=>te({type:"task.stop",sessionId:L,taskId:p})}):null,i.jsx(K_,{disabled:!L,busy:Gn&&!Sl,placeholder:Sl?"Промпт уйдёт, как только связь вернётся":(Q==null?void 0:Q.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:qs,sessionTitle:(Q==null?void 0:Q.title)??null,contextResult:Qa,draftKey:L,onContextSearch:p=>jl("mention",p),onCommand:Ur,onSend:iu,onInterrupt:()=>{L&&te({type:"control.interrupt",sessionId:L})}})]}),wn&&ca&&i.jsxs(i.Fragment,{children:[!dt&&ln!=="terminal"&&i.jsx(iN,{height:ra.height,onResize:ra.setHeight,onReset:ra.reset}),i.jsx(uN,{mobile:dt,zoomed:ln==="terminal",onToggleZoom:Ja("terminal"),terminals:ia,activeId:Qf,blocked:Sr,error:Oc,onDismissError:()=>zs(null),height:dt?jr.height:ra.height,offset:dt?{top:jr.offsetTop,left:jr.offsetLeft}:void 0,onSelect:za,onOpen:Bs,onClose:Ol,onInput:(p,q)=>te({type:"term.input",id:p,data:q}),onResize:(p,q,he)=>te({type:"term.resize",id:p,cols:q,rows:he}),onAttach:p=>te({type:"term.attach",id:p}),onHide:()=>_s(!1),registerSink:Kf})]})]}),i.jsx(fk,{open:oa,items:Lc.items,busy:Ir,ready:L!==null,commands:qs,contextResult:Ka,draftKey:L,models:Rn.rows,model:Rn.selected,effort:Jl.effort,ultracode:Jl.ultracode,thinking:Jl.thinking,switchOnFlag:Jl.switchOnFlag,onContextSearch:p=>jl("side",p),onCommand:Ur,onModel:p=>{p&&(js(q=>({...q,model:p})),pa(q=>te({type:"control.set_model",sessionId:q,model:p})))},onEffort:p=>{js(q=>({...q,effort:p,ultracode:!1})),pa(q=>te({type:"control.set_effort",sessionId:q,effort:p}))},onUltracode:p=>{js(q=>({...q,ultracode:p,...p?{effort:"xhigh"}:{}})),pa(q=>te({type:"control.set_ultracode",sessionId:q,enabled:p}))},onThinking:p=>{js(q=>({...q,thinking:p})),pa(q=>te({type:"control.set_thinking",sessionId:q,enabled:p}))},onSwitchOnFlag:p=>{js(q=>({...q,switchOnFlag:p})),pa(q=>te({type:"control.set_flag_switch",sessionId:q,enabled:p}))},onAsk:Dr,onInterrupt:()=>{Zo&&te({type:"control.interrupt",sessionId:Zo})},onReset:Or,onClose:()=>wr(!1),zoomed:ln==="ask",onToggleZoom:Ja("ask")}),oa&&ln!=="ask"&&Wi("ask"),(At||oa||Qt||Ql)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{We(!1),wr(!1),pe(!1),Dl(!1)}}),vn&&i.jsx(Vw,{detail:vn,local:((Tt==null?void 0:Tt.hasRemote)??!1)&&(Tt==null?void 0:Tt.commits.some(p=>p.hash===vn.hash&&!p.pushed))===!0,onCheckout:Fi,onClose:()=>{Bn(null),Vn(null)}}),ce&&i.jsx(Tl,{title:"Остановить сессию?",onClose:()=>ye(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>ye(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{te({type:"session.close",sessionId:ce.id}),ye(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),ol&&i.jsxs(Tl,{title:"Переключить рабочее дерево?",onClose:()=>Qn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Qn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:Va,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",ol.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Gn&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Tt&&Tt.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Tt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),gs&&i.jsx(ak,{status:Da,owners:Ls,files:Kn,defaultName:(Ga==null?void 0:Ga.name)??"",hasCommits:Tt===null||Tt.head!=="",busy:jn,result:Xl,onRefreshStatus:Zc,onSaveToken:ma,onPublish:Ss,onDismissResult:()=>An(null),onClose:()=>Vl(!1)}),bs&&i.jsx(uk,{busy:jn,result:Xl,onSubmit:du,onDismissResult:()=>An(null),onClose:()=>bl(!1)}),nn&&i.jsx(Tl,{title:nn.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Gt(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Gt(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Yt(nn),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[nn.path," будет удалён с диска",nn.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Rl&&i.jsx(Tl,{title:"Закрыть без сохранения?",onClose:()=>ll(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>ll(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>hl(Rl,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{Zl(Rl),hl(Rl,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",Rl," есть несохранённые правки."]})}),ct&&i.jsx(Sk,{tab:ct,servers:yn,plugins:rn,marketplaces:Zt,catalog:el,result:ge,actions:Kl,onTab:pn,onClose:()=>pn(null)}),Yl&&i.jsx(Mk,{status:ms,login:Ve,actions:fl,remote:x,runningSessions:D.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:L?()=>{ba(),$l(!1)}:null,reconnectBlocked:Gn,reconnectHint:ld,onClose:()=>$l(!1)}),m&&i.jsx(zk,{state:d,onPair:(p,q)=>te({type:"relay.pair",code:p,...q?{name:q}:{}}),onUnpair:()=>te({type:"relay.unpair"}),onClose:()=>g(!1)}),tl&&i.jsx(Zk,{settings:cn,models:(je==null?void 0:je.models)??[],relayState:d,local:Af()==="local",onChange:Qc,onEnableShell:()=>te({type:"relay.shell.enable"}),onDisableShell:()=>te({type:"relay.shell.disable"}),onOpenRelay:()=>{Lt(!1),g(!0)},onClose:()=>Lt(!1)}),lt&&i.jsx(Mw,{candidates:Pe,searching:xl,agentItems:Kt.items,agentBusy:(_n==null?void 0:_n.state)==="running",error:an,roots:pt,created:En,onSearch:Pf,onAskAgent:yl,onInterrupt:()=>{const p=Ii.current;p&&te({type:"control.interrupt",sessionId:p})},onSubmit:Jf,onCreate:Wf,onClose:Xi}),fn!=null&&fn.questions&&fn.questions.length>0?i.jsx(vw,{request:{...fn,questions:fn.questions},queued:X.pending.length-1,onAnswer:Is,onDecline:xu}):fn&&ks!==null?i.jsx(ww,{request:fn,plan:ks,queued:X.pending.length-1,onAccept:bu,onDecline:Za}):fn&&i.jsx(yw,{request:fn,queued:X.pending.length-1,onDecide:Pc}),be&&i.jsx(Wk,{handoff:be,onClose:()=>De(null)}),i.jsx(tN,{notices:Xn,onDismiss:p=>Gl(q=>q.filter(he=>he.id!==p))})]})}function NN(){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 TN(){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 EN(){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 CN(){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 AN(){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 MN(l,s){return t_(l)===t_(s)}function t_(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function RN(){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 DN(){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 ON(){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 LN(){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 sy=document.getElementById("root");if(!sy)throw new Error("#root not found");T0.createRoot(sy).render(i.jsx(_.StrictMode,{children:i.jsx(kN,{})}));export{A1 as D,Jt as I,Pt as N,HN as P,hs as T,Ds as a,M_ as b,ql as c,UN as d,z_ as e,Xo as f,Z1 as h,BN as p,IN as s,Ne as t};