@i14ks/ccv 0.16.3 → 0.17.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 +43 -6
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-CkgU8c7a.js → codemirror-DcwBBoHv.js} +1 -1
  4. package/web/assets/{index-CQqNgFvZ.js → index--smhGK8Y.js} +1 -1
  5. package/web/assets/{index-B0NcQgiZ.js → index-B0Ss0xRi.js} +1 -1
  6. package/web/assets/{index-GT_NZ0qK.js → index-B9bs4QFR.js} +1 -1
  7. package/web/assets/{index--DhZrg25.js → index-Bee9erGK.js} +1 -1
  8. package/web/assets/{index-gmvISUqO.js → index-BpL4NCNb.js} +1 -1
  9. package/web/assets/{index-DvhOZOas.js → index-BrAmkvn2.js} +1 -1
  10. package/web/assets/{index-Bhx7H3mC.js → index-CLScHnZN.js} +1 -1
  11. package/web/assets/{index-CstcrxY-.js → index-CO3xirid.js} +1 -1
  12. package/web/assets/{index-OuSuAczZ.js → index-CQ0-WYgR.js} +1 -1
  13. package/web/assets/index-ChuReHk_.css +1 -0
  14. package/web/assets/{index-BC7TmL8M.js → index-CjxzVwrV.js} +1 -1
  15. package/web/assets/{index-BFwSwibX.js → index-CnCCNUTy.js} +1 -1
  16. package/web/assets/{index-s7Wcfj5F.js → index-Cu4PsUGS.js} +1 -1
  17. package/web/assets/{index-DfGVckBo.js → index-D51RIwGp.js} +1 -1
  18. package/web/assets/{index-DaRnRpPz.js → index-D9qvIR3L.js} +1 -1
  19. package/web/assets/{index-Dv0cw76Z.js → index-DB25Lbd8.js} +1 -1
  20. package/web/assets/{index-P6m4z84O.js → index-DwamecDE.js} +1 -1
  21. package/web/assets/{index-DoqmNDN4.js → index-DzgVil07.js} +1 -1
  22. package/web/assets/index-RifJd-I8.js +134 -0
  23. package/web/assets/{index-DHVISfG-.js → index-TIzoSl17.js} +1 -1
  24. package/web/assets/{index-CNQ0551W.js → index-VZG_Pg4O.js} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-DlOju0OY.js +0 -134
  27. package/web/assets/index-tvzk50nQ.css +0 -1
@@ -0,0 +1,134 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BpL4NCNb.js","./index-CjxzVwrV.js","./index-TIzoSl17.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index--smhGK8Y.js","./index-Cu4PsUGS.js","./index-B0Ss0xRi.js","./index-DB25Lbd8.js","./index-BrAmkvn2.js","./index-D9qvIR3L.js","./index-D51RIwGp.js","./index-CQ0-WYgR.js","./index-Bee9erGK.js","./index-DwamecDE.js","./index-CO3xirid.js","./index-CLScHnZN.js","./index-CnCCNUTy.js","./index-B9bs4QFR.js","./index-DzgVil07.js","./index-VZG_Pg4O.js","./codemirror-DcwBBoHv.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 m0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var g0=(l,s,r)=>s in l?m0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Lt=(l,s,r)=>g0(l,typeof s!="symbol"?s+"":s,r),Eh=(l,s,r)=>s.has(l)||vb("Cannot "+r);var Ge=(l,s,r)=>(Eh(l,s,"read from private field"),r?r.call(l):s.get(l)),hn=(l,s,r)=>s.has(l)?vb("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),St=(l,s,r,c)=>(Eh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),qn=(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:{}},No={};/**
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 jb;function b0(){if(jb)return No;jb=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 No.Fragment=s,No.jsx=r,No.jsxs=r,No}var Sb;function x0(){return Sb||(Sb=1,Ch.exports=b0()),Ch.exports}var i=x0(),Ah={exports:{}},Ve={};/**
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 wb;function y0(){if(wb)return Ve;wb=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"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,L={};function $(k,V,ce){this.props=k,this.context=V,this.refs=L,this.updater=ce||T}$.prototype.isReactComponent={},$.prototype.setState=function(k,V){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,V,"setState")},$.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function J(){}J.prototype=$.prototype;function G(k,V,ce){this.props=k,this.context=V,this.refs=L,this.updater=ce||T}var O=G.prototype=new J;O.constructor=G,E(O,$.prototype),O.isPureReactComponent=!0;var Z=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function ne(k,V,ce){var ge=ce.ref;return{$$typeof:l,type:k,key:V,ref:ge!==void 0?ge:null,props:ce}}function he(k,V){return ne(k.type,V,k.props)}function P(k){return typeof k=="object"&&k!==null&&k.$$typeof===l}function ue(k){var V={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ce){return V[ce]})}var _e=/\/+/g;function De(k,V){return typeof k=="object"&&k!==null&&k.key!=null?ue(""+k.key):V.toString(36)}function Ne(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(M,M):(k.status="pending",k.then(function(V){k.status==="pending"&&(k.status="fulfilled",k.value=V)},function(V){k.status==="pending"&&(k.status="rejected",k.reason=V)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function A(k,V,ce,ge,Ae){var Se=typeof k;(Se==="undefined"||Se==="boolean")&&(k=null);var Te=!1;if(k===null)Te=!0;else switch(Se){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(k.$$typeof){case l:case s:Te=!0;break;case _:return Te=k._init,A(Te(k._payload),V,ce,ge,Ae)}}if(Te)return Ae=Ae(k),Te=ge===""?"."+De(k,0):ge,Z(Ae)?(ce="",Te!=null&&(ce=Te.replace(_e,"$&/")+"/"),A(Ae,V,ce,"",function(et){return et})):Ae!=null&&(P(Ae)&&(Ae=he(Ae,ce+(Ae.key==null||k&&k.key===Ae.key?"":(""+Ae.key).replace(_e,"$&/")+"/")+Te)),V.push(Ae)),1;Te=0;var Tt=ge===""?".":ge+":";if(Z(k))for(var Ye=0;Ye<k.length;Ye++)ge=k[Ye],Se=Tt+De(ge,Ye),Te+=A(ge,V,ce,Se,Ae);else if(Ye=C(k),typeof Ye=="function")for(k=Ye.call(k),Ye=0;!(ge=k.next()).done;)ge=ge.value,Se=Tt+De(ge,Ye++),Te+=A(ge,V,ce,Se,Ae);else if(Se==="object"){if(typeof k.then=="function")return A(Ne(k),V,ce,ge,Ae);throw V=String(k),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Te}function fe(k,V,ce){if(k==null)return k;var ge=[],Ae=0;return A(k,ge,"","",function(Se){return V.call(ce,Se,Ae++)}),ge}function z(k){if(k._status===-1){var V=k._result;V=V(),V.then(function(ce){(k._status===0||k._status===-1)&&(k._status=1,k._result=ce)},function(ce){(k._status===0||k._status===-1)&&(k._status=2,k._result=ce)}),k._status===-1&&(k._status=0,k._result=V)}if(k._status===1)return k._result.default;throw k._result}var pe=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ke={map:fe,forEach:function(k,V,ce){fe(k,function(){V.apply(this,arguments)},ce)},count:function(k){var V=0;return fe(k,function(){V++}),V},toArray:function(k){return fe(k,function(V){return V})||[]},only:function(k){if(!P(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ve.Activity=j,Ve.Children=ke,Ve.Component=$,Ve.Fragment=r,Ve.Profiler=o,Ve.PureComponent=G,Ve.StrictMode=c,Ve.Suspense=g,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Ve.cache=function(k){return function(){return k.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(k,V,ce){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ge=E({},k.props),Ae=k.key;if(V!=null)for(Se in V.key!==void 0&&(Ae=""+V.key),V)!B.call(V,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&V.ref===void 0||(ge[Se]=V[Se]);var Se=arguments.length-2;if(Se===1)ge.children=ce;else if(1<Se){for(var Te=Array(Se),Tt=0;Tt<Se;Tt++)Te[Tt]=arguments[Tt+2];ge.children=Te}return ne(k.type,Ae,ge)},Ve.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Ve.createElement=function(k,V,ce){var ge,Ae={},Se=null;if(V!=null)for(ge in V.key!==void 0&&(Se=""+V.key),V)B.call(V,ge)&&ge!=="key"&&ge!=="__self"&&ge!=="__source"&&(Ae[ge]=V[ge]);var Te=arguments.length-2;if(Te===1)Ae.children=ce;else if(1<Te){for(var Tt=Array(Te),Ye=0;Ye<Te;Ye++)Tt[Ye]=arguments[Ye+2];Ae.children=Tt}if(k&&k.defaultProps)for(ge in Te=k.defaultProps,Te)Ae[ge]===void 0&&(Ae[ge]=Te[ge]);return ne(k,Se,Ae)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(k){return{$$typeof:m,render:k}},Ve.isValidElement=P,Ve.lazy=function(k){return{$$typeof:_,_payload:{_status:-1,_result:k},_init:z}},Ve.memo=function(k,V){return{$$typeof:b,type:k,compare:V===void 0?null:V}},Ve.startTransition=function(k){var V=D.T,ce={};D.T=ce;try{var ge=k(),Ae=D.S;Ae!==null&&Ae(ce,ge),typeof ge=="object"&&ge!==null&&typeof ge.then=="function"&&ge.then(M,pe)}catch(Se){pe(Se)}finally{V!==null&&ce.types!==null&&(V.types=ce.types),D.T=V}},Ve.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ve.use=function(k){return D.H.use(k)},Ve.useActionState=function(k,V,ce){return D.H.useActionState(k,V,ce)},Ve.useCallback=function(k,V){return D.H.useCallback(k,V)},Ve.useContext=function(k){return D.H.useContext(k)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(k,V){return D.H.useDeferredValue(k,V)},Ve.useEffect=function(k,V){return D.H.useEffect(k,V)},Ve.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Ve.useId=function(){return D.H.useId()},Ve.useImperativeHandle=function(k,V,ce){return D.H.useImperativeHandle(k,V,ce)},Ve.useInsertionEffect=function(k,V){return D.H.useInsertionEffect(k,V)},Ve.useLayoutEffect=function(k,V){return D.H.useLayoutEffect(k,V)},Ve.useMemo=function(k,V){return D.H.useMemo(k,V)},Ve.useOptimistic=function(k,V){return D.H.useOptimistic(k,V)},Ve.useReducer=function(k,V,ce){return D.H.useReducer(k,V,ce)},Ve.useRef=function(k){return D.H.useRef(k)},Ve.useState=function(k){return D.H.useState(k)},Ve.useSyncExternalStore=function(k,V,ce){return D.H.useSyncExternalStore(k,V,ce)},Ve.useTransition=function(){return D.H.useTransition()},Ve.version="19.2.8",Ve}var kb;function gp(){return kb||(kb=1,Ah.exports=y0()),Ah.exports}var y=gp(),Mh={exports:{}},To={},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 Nb;function _0(){return Nb||(Nb=1,(function(l){function s(A,fe){var z=A.length;A.push(fe);e:for(;0<z;){var pe=z-1>>>1,ke=A[pe];if(0<o(ke,fe))A[pe]=fe,A[z]=ke,z=pe;else break e}}function r(A){return A.length===0?null:A[0]}function c(A){if(A.length===0)return null;var fe=A[0],z=A.pop();if(z!==fe){A[0]=z;e:for(var pe=0,ke=A.length,k=ke>>>1;pe<k;){var V=2*(pe+1)-1,ce=A[V],ge=V+1,Ae=A[ge];if(0>o(ce,z))ge<ke&&0>o(Ae,ce)?(A[pe]=Ae,A[ge]=z,pe=ge):(A[pe]=ce,A[V]=z,pe=V);else if(ge<ke&&0>o(Ae,z))A[pe]=Ae,A[ge]=z,pe=ge;else break e}}return fe}function o(A,fe){var z=A.sortIndex-fe.sortIndex;return z!==0?z:A.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=[],b=[],_=1,j=null,v=3,C=!1,T=!1,E=!1,L=!1,$=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function O(A){for(var fe=r(b);fe!==null;){if(fe.callback===null)c(b);else if(fe.startTime<=A)c(b),fe.sortIndex=fe.expirationTime,s(g,fe);else break;fe=r(b)}}function Z(A){if(E=!1,O(A),!T)if(r(g)!==null)T=!0,M||(M=!0,ue());else{var fe=r(b);fe!==null&&Ne(Z,fe.startTime-A)}}var M=!1,D=-1,B=5,ne=-1;function he(){return L?!0:!(l.unstable_now()-ne<B)}function P(){if(L=!1,M){var A=l.unstable_now();ne=A;var fe=!0;try{e:{T=!1,E&&(E=!1,J(D),D=-1),C=!0;var z=v;try{t:{for(O(A),j=r(g);j!==null&&!(j.expirationTime>A&&he());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var ke=pe(j.expirationTime<=A);if(A=l.unstable_now(),typeof ke=="function"){j.callback=ke,O(A),fe=!0;break t}j===r(g)&&c(g),O(A)}else c(g);j=r(g)}if(j!==null)fe=!0;else{var k=r(b);k!==null&&Ne(Z,k.startTime-A),fe=!1}}break e}finally{j=null,v=z,C=!1}fe=void 0}}finally{fe?ue():M=!1}}}var ue;if(typeof G=="function")ue=function(){G(P)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,De=_e.port2;_e.port1.onmessage=P,ue=function(){De.postMessage(null)}}else ue=function(){$(P,0)};function Ne(A,fe){D=$(function(){A(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(A){A.callback=null},l.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<A?Math.floor(1e3/A):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(A){switch(v){case 1:case 2:case 3:var fe=3;break;default:fe=v}var z=v;v=fe;try{return A()}finally{v=z}},l.unstable_requestPaint=function(){L=!0},l.unstable_runWithPriority=function(A,fe){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var z=v;v=A;try{return fe()}finally{v=z}},l.unstable_scheduleCallback=function(A,fe,z){var pe=l.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?pe+z:pe):z=pe,A){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=z+ke,A={id:_++,callback:fe,priorityLevel:A,startTime:z,expirationTime:ke,sortIndex:-1},z>pe?(A.sortIndex=z,s(b,A),r(g)===null&&A===r(b)&&(E?(J(D),D=-1):E=!0,Ne(Z,z-pe))):(A.sortIndex=ke,s(g,A),T||C||(T=!0,M||(M=!0,ue()))),A},l.unstable_shouldYield=he,l.unstable_wrapCallback=function(A){var fe=v;return function(){var z=v;v=fe;try{return A.apply(this,arguments)}finally{v=z}}}})(Dh)),Dh}var Tb;function v0(){return Tb||(Tb=1,Rh.exports=_0()),Rh.exports}var Oh={exports:{}},hl={};/**
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 Eb;function j0(){if(Eb)return hl;Eb=1;var l=gp();function s(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)b+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+b+" 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,b,_){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:b,implementation:_}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return hl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,hl.createPortal=function(g,b){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(s(299));return d(g,b,null,_)},hl.flushSync=function(g){var b=h.T,_=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=_,c.d.f()}},hl.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(g,b))},hl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},hl.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var _=b.as,j=m(_,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,C=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;_==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):_==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},hl.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var _=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(g)},hl.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var _=b.as,j=m(_,b.crossOrigin);c.d.L(g,_,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},hl.preloadModule=function(g,b){if(typeof g=="string")if(b){var _=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},hl.requestFormReset=function(g){c.d.r(g)},hl.unstable_batchedUpdates=function(g,b){return g(b)},hl.useFormState=function(g,b,_){return h.H.useFormState(g,b,_)},hl.useFormStatus=function(){return h.H.useHostTransitionStatus()},hl.version="19.2.8",hl}var Cb;function S0(){if(Cb)return Oh.exports;Cb=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=j0(),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 Ab;function w0(){if(Ab)return To;Ab=1;var l=v0(),s=gp(),r=S0();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 b(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 x=!1,S=u.child;S;){if(S===n){x=!0,n=u,a=f;break}if(S===a){x=!0,a=u,n=f;break}S=S.sibling}if(!x){for(S=f.child;S;){if(S===n){x=!0,n=f,a=u;break}if(S===a){x=!0,a=f,n=u;break}S=S.sibling}if(!x)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 _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),G=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var _e=Symbol.for("react.client.reference");function De(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_e?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case $:return"Profiler";case L:return"StrictMode";case Z:return"Suspense";case M:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case G:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:De(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return De(e(t))}catch{}}return null}var Ne=Array.isArray,A=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,z={pending:!1,data:null,method:null,action:null},pe=[],ke=-1;function k(e){return{current:e}}function V(e){0>ke||(e.current=pe[ke],pe[ke]=null,ke--)}function ce(e,t){ke++,pe[ke]=e.current,e.current=t}var ge=k(null),Ae=k(null),Se=k(null),Te=k(null);function Tt(e,t){switch(ce(Se,t),ce(Ae,e),ce(ge,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}}V(ge),ce(ge,e)}function Ye(){V(ge),V(Ae),V(Se)}function et(e){e.memoizedState!==null&&ce(Te,e);var t=ge.current,n=Xg(t,e.type);t!==n&&(ce(Ae,e),ce(ge,n))}function Xe(e){Ae.current===e&&(V(ge),V(Ae)),Te.current===e&&(V(Te),jo._currentValue=z)}var Qt,tt;function Yt(e){if(Qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qt=t&&t[1]||"",tt=-1<n.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Qt+e+tt}var nt=!1;function en(e,t){if(!e||nt)return"";nt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(te){var F=te}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(te){F=te}e.call(oe.prototype)}}else{try{throw Error()}catch(te){F=te}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(te){if(te&&F&&typeof te.stack=="string")return[te.stack,F.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(),x=f[0],S=f[1];if(x&&S){var R=x.split(`
45
+ `),K=S.split(`
46
+ `);for(u=a=0;a<R.length&&!R[a].includes("DetermineComponentFrameRoot");)a++;for(;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;if(a===R.length||u===K.length)for(a=R.length-1,u=K.length-1;1<=a&&0<=u&&R[a]!==K[u];)u--;for(;1<=a&&0<=u;a--,u--)if(R[a]!==K[u]){if(a!==1||u!==1)do if(a--,u--,0>u||R[a]!==K[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{nt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Yt(n):""}function $t(e,t){switch(e.tag){case 26:case 27:case 5:return Yt(e.type);case 16:return Yt("Lazy");case 13:return e.child!==t&&t!==null?Yt("Suspense Fallback"):Yt("Suspense");case 19:return Yt("SuspenseList");case 0:case 15:return en(e.type,!1);case 11:return en(e.type.render,!1);case 1:return en(e.type,!0);case 31:return Yt("Activity");default:return""}}function tn(e){try{var t="",n=null;do t+=$t(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
48
+ Error generating stack: `+a.message+`
49
+ `+a.stack}}var nn=Object.prototype.hasOwnProperty,pn=l.unstable_scheduleCallback,Sn=l.unstable_cancelCallback,mn=l.unstable_shouldYield,cn=l.unstable_requestPaint,Ke=l.unstable_now,zt=l.unstable_getCurrentPriorityLevel,gn=l.unstable_ImmediatePriority,ut=l.unstable_UserBlockingPriority,Je=l.unstable_NormalPriority,An=l.unstable_LowPriority,on=l.unstable_IdlePriority,wn=l.log,Pn=l.unstable_setDisableYieldValue,Xt=null,wt=null;function Kt(e){if(typeof wn=="function"&&Pn(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Xt,e)}catch{}}var Et=Math.clz32?Math.clz32:be,Yn=Math.log,le=Math.LN2;function be(e){return e>>>=0,e===0?32:31-(Yn(e)/le|0)|0}var Le=256,H=262144,W=4194304;function xe(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 Be(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=a&134217727;return S!==0?(a=S&~f,a!==0?u=xe(a):(x&=S,x!==0?u=xe(x):n||(n=S&~e,n!==0&&(u=xe(n))))):(S=a&~f,S!==0?u=xe(S):x!==0?u=xe(x):n||(n=a&~e,n!==0&&(u=xe(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 pt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Mn(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 bn(){var e=W;return W<<=1,(W&62914560)===0&&(W=4194304),e}function Rn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ul(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 x=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,K=e.hiddenUpdates;for(n=x&~n;0<n;){var se=31-Et(n),oe=1<<se;S[se]=0,R[se]=-1;var F=K[se];if(F!==null)for(K[se]=null,se=0;se<F.length;se++){var te=F[se];te!==null&&(te.lane&=-536870913)}n&=~oe}a!==0&&ra(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function ra(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Et(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Ql(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Et(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:Rs(n),(n&(e.suspendedLanes|t))!==0?0:n}function Rs(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 Dn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kl(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:pb(e.type))}function bl(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var $n=Math.random().toString(36).slice(2),Vt="__reactFiber$"+$n,$e="__reactProps$"+$n,_t="__reactContainer$"+$n,xl="__reactEvents$"+$n,lt="__reactListeners$"+$n,Zl="__reactHandles$"+$n,Ut="__reactResources$"+$n,el="__reactMarker$"+$n;function kt(e){delete e[Vt],delete e[$e],delete e[xl],delete e[lt],delete e[Zl]}function Tl(e){var t=e[Vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[Vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wg(e);e!==null;){if(n=e[Vt])return n;e=Wg(e)}return t}e=n,n=e.parentNode}return null}function ln(e){if(e=e[Vt]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function mt(e){var t=e[Ut];return t||(t=e[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ze(e){e[el]=!0}var On=new Set,El={};function xn(e,t){Nn(e,t),Nn(e+"Capture",t)}function Nn(e,t){for(El[e]=t,e=0;e<t.length;e++)On.add(t[e])}var tl=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]*$"),gs={},yn={};function Fl(e){return nn.call(yn,e)?!0:nn.call(gs,e)?!1:tl.test(e)?yn[e]=!0:(gs[e]=!0,!1)}function fl(e,t,n){if(Fl(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 nl(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 Ln(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 Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ia(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hi(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(x){n=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ds(e){if(!e._valueTracker){var t=Ia(e)?"checked":"value";e._valueTracker=Hi(e,t,""+e[t])}}function Os(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Ia(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function yl(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 qa=/[\n"\\]/g;function zn(e){return e.replace(qa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bs(e,t,n,a,u,f,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?sn(e,x,Ht(t)):n!=null?sn(e,x,Ht(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=""+Ht(S):e.removeAttribute("name")}function Jl(e,t,n,a,u,f,x,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)){Ds(e);return}n=n!=null?""+Ht(n):"",t=t!=null?""+Ht(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,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Ds(e)}function sn(e,t,n){t==="number"&&yl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Bt(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=""+Ht(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 me(e,t,n){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ht(n):""}function N(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(Ne(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Ht(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Ds(e)}function Y(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ae=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 we(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||ae.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ve(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&&we(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&we(e,f,t[f])}function ze(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 ot=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"]]),un=/^[\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 Mt(e){return un.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ht(){}var fn=null;function It(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ll=null,xs=null;function w(e){var t=ln(e);if(t&&(e=t.stateNode)){var n=e[$e]||null;e:switch(e=t.stateNode,t.type){case"input":if(bs(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="'+zn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[$e]||null;if(!u)throw Error(c(90));bs(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&&Os(a)}break e;case"textarea":me(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var ie=!1;function Me(e,t,n){if(ie)return e(t,n);ie=!0;try{var a=e(t);return a}finally{if(ie=!1,(ll!==null||xs!==null)&&(qu(),ll&&(t=ll,e=xs,xs=ll=null,w(t),e)))for(t=0;t<e.length;t++)w(e[t])}}function Fe(e,t){var n=e.stateNode;if(n===null)return null;var a=n[$e]||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 _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ys=!1;if(_n)try{var _s={};Object.defineProperty(_s,"passive",{get:function(){ys=!0}}),window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{ys=!1}var Ls=null,Bi=null,ca=null;function vr(){if(ca)return ca;var e,t=Bi,n=t.length,a,u="value"in Ls?Ls.value:Ls.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var x=n-e;for(a=1;a<=x&&t[n-a]===u[f-a];a++);return ca=u.slice(e,1<a?1-a:void 0)}function Ii(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 oa(){return!0}function ua(){return!1}function Zn(e){function t(n,a,u,f,x){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=x,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)?oa:ua,this.isPropagationStopped=ua,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=oa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=oa)},persist:function(){},isPersistent:oa}),t}var Wl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zs=Zn(Wl),qi=j({},Wl,{view:0,detail:0}),jr=Zn(qi),Nc,Ga,Us,Ya=j({},qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pa,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!==Us&&(Us&&e.type==="mousemove"?(Nc=e.screenX-Us.screenX,Ga=e.screenY-Us.screenY):Ga=Nc=0,Us=e),Nc)},movementY:function(e){return"movementY"in e?e.movementY:Ga}}),$a=Zn(Ya),fa=j({},Ya,{dataTransfer:0}),Sr=Zn(fa),Tc=j({},qi,{relatedTarget:0}),Ec=Zn(Tc),da=j({},Wl,{animationName:0,elapsedTime:0,pseudoElement:0}),wr=Zn(da),Xo=j({},Wl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kr=Zn(Xo),Vo=j({},Wl,{data:0}),Gi=Zn(Vo),vs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nr={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"},Yi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ha(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yi[e])?!!t[e]:!1}function pa(){return ha}var an=j({},qi,{key:function(e){if(e.key){var t=vs[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pa,charCode:function(e){return e.type==="keypress"?Ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cc=Zn(an),Kf=j({},Ya,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qo=Zn(Kf),Ko=j({},qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pa}),Tr=Zn(Ko),Xn=j({},Wl,{propertyName:0,elapsedTime:0,pseudoElement:0}),$i=Zn(Xn),Xi=j({},Ya,{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}),Zo=Zn(Xi),Un=j({},Wl,{newState:0,oldState:0}),Fo=Zn(Un),Jo=[9,13,27,32],Il=_n&&"CompositionEvent"in window,Xa=null;_n&&"documentMode"in document&&(Xa=document.documentMode);var Er=_n&&"TextEvent"in window&&!Xa,Vi=_n&&(!Il||Xa&&8<Xa&&11>=Xa),Va=" ",Hs=!1;function Ac(e,t){switch(e){case"keyup":return Jo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var js=!1;function Qi(e,t){switch(e){case"compositionend":return Qa(t);case"keypress":return t.which!==32?null:(Hs=!0,Va);case"textInput":return e=t.data,e===Va&&Hs?null:e;default:return null}}function Ki(e,t){if(js)return e==="compositionend"||!Il&&Ac(e,t)?(e=vr(),ca=Bi=Ls=null,js=!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 Vi&&t.locale!=="ko"?null:t.data;default:return null}}var Wo={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 Ka(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wo[e.type]:t==="textarea"}function Po(e,t,n,a){ll?xs?xs.push(a):xs=[a]:ll=a,t=Ku(t,"onChange"),0<t.length&&(n=new zs("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ee=null,Pl=null;function Mc(e){Hg(e,0)}function Cr(e){var t=kn(e);if(Os(t))return e}function eu(e,t){if(e==="change")return t}var X=!1;if(_n){var ma;if(_n){var ga="oninput"in document;if(!ga){var Rc=document.createElement("div");Rc.setAttribute("oninput","return;"),ga=typeof Rc.oninput=="function"}ma=ga}else ma=!1;X=ma&&(!document.documentMode||9<document.documentMode)}function Dc(){ee&&(ee.detachEvent("onpropertychange",tu),Pl=ee=null)}function tu(e){if(e.propertyName==="value"&&Cr(Pl)){var t=[];Po(t,Pl,e,It(e)),Me(Mc,t)}}function Za(e,t,n){e==="focusin"?(Dc(),ee=t,Pl=n,ee.attachEvent("onpropertychange",tu)):e==="focusout"&&Dc()}function Zf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cr(Pl)}function Ff(e,t){if(e==="click")return Cr(t)}function Jf(e,t){if(e==="input"||e==="change")return Cr(t)}function Wf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _l=typeof Object.is=="function"?Object.is:Wf;function es(e,t){if(_l(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(!nn.call(t,u)||!_l(e[u],t[u]))return!1}return!0}function nu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lu(e,t){var n=nu(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=nu(n)}}function su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function au(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=yl(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=yl(e.document)}return t}function Oc(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 Pf=_n&&"documentMode"in document&&11>=document.documentMode,Fa=null,Lc=null,Zi=null,Fi=!1;function iu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fi||Fa==null||Fa!==yl(a)||(a=Fa,"selectionStart"in a&&Oc(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}),Zi&&es(Zi,a)||(Zi=a,a=Ku(Lc,"onSelect"),0<a.length&&(t=new zs("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Fa)))}function ba(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Bs={animationend:ba("Animation","AnimationEnd"),animationiteration:ba("Animation","AnimationIteration"),animationstart:ba("Animation","AnimationStart"),transitionrun:ba("Transition","TransitionRun"),transitionstart:ba("Transition","TransitionStart"),transitioncancel:ba("Transition","TransitionCancel"),transitionend:ba("Transition","TransitionEnd")},zc={},ru={};_n&&(ru=document.createElement("div").style,"AnimationEvent"in window||(delete Bs.animationend.animation,delete Bs.animationiteration.animation,delete Bs.animationstart.animation),"TransitionEvent"in window||delete Bs.transitionend.transition);function ts(e){if(zc[e])return zc[e];if(!Bs[e])return e;var t=Bs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ru)return zc[e]=t[n];return e}var cu=ts("animationend"),Uc=ts("animationiteration"),Hc=ts("animationstart"),ou=ts("transitionrun"),uu=ts("transitionstart"),ed=ts("transitioncancel"),Bc=ts("transitionend"),Ic=new Map,qc="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(" ");qc.push("scrollEnd");function Cl(e,t){Ic.set(e,t),xn(t,[e])}var Ja=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)},Al=[],Wa=0,Gc=0;function Ar(){for(var e=Wa,t=Gc=Wa=0;t<e;){var n=Al[t];Al[t++]=null;var a=Al[t];Al[t++]=null;var u=Al[t];Al[t++]=null;var f=Al[t];if(Al[t++]=null,a!==null&&u!==null){var x=a.pending;x===null?u.next=u:(u.next=x.next,x.next=u),a.pending=u}f!==0&&Yc(n,u,f)}}function Is(e,t,n,a){Al[Wa++]=e,Al[Wa++]=t,Al[Wa++]=n,Al[Wa++]=a,Gc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Mr(e,t,n,a){return Is(e,t,n,a),Rr(e)}function xa(e,t){return Is(e,null,null,t),Rr(e)}function Yc(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-Et(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function Rr(e){if(50<mo)throw mo=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 Pa={};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 $c(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 fu(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 Dr(e,t,n,a,u,f){var x=0;if(a=e,typeof e=="function")$c(e)&&(x=1);else if(typeof e=="string")x=l0(e,n,ge.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=vl(31,n,t,u),e.elementType=ne,e.lanes=f,e;case E:return ya(n.children,u,f,t);case L:x=8,u|=24;break;case $:return e=vl(12,n,t,u|2),e.elementType=$,e.lanes=f,e;case Z:return e=vl(13,n,t,u),e.elementType=Z,e.lanes=f,e;case M:return e=vl(19,n,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:x=10;break e;case J:x=9;break e;case O:x=11;break e;case D:x=14;break e;case B:x=16,a=null;break e}x=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=vl(x,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function ya(e,t,n,a){return e=vl(7,e,a,t),e.lanes=n,e}function Xc(e,t,n){return e=vl(6,e,null,t),e.lanes=n,e}function du(e){var t=vl(18,null,null,0);return t.stateNode=e,t}function Vc(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 Qc=new WeakMap;function Ml(e,t){if(typeof e=="object"&&e!==null){var n=Qc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:tn(t)},Qc.set(e,t),t)}return{value:e,source:t,stack:tn(t)}}var ei=[],ti=0,Or=null,_a=0,dl=[],sl=0,qs=null,ns=1,ls="";function ws(e,t){ei[ti++]=_a,ei[ti++]=Or,Or=e,_a=t}function hu(e,t,n){dl[sl++]=ns,dl[sl++]=ls,dl[sl++]=qs,qs=e;var a=ns;e=ls;var u=32-Et(a)-1;a&=~(1<<u),n+=1;var f=32-Et(t)+u;if(30<f){var x=u-u%5;f=(a&(1<<x)-1).toString(32),a>>=x,u-=x,ns=1<<32-Et(t)+u|n<<u|a,ls=f+e}else ns=1<<f|n<<u|a,ls=e}function Kc(e){e.return!==null&&(ws(e,1),hu(e,1,0))}function Zc(e){for(;e===Or;)Or=ei[--ti],ei[ti]=null,_a=ei[--ti],ei[ti]=null;for(;e===qs;)qs=dl[--sl],dl[sl]=null,ls=dl[--sl],dl[sl]=null,ns=dl[--sl],dl[sl]=null}function pu(e,t){dl[sl++]=ns,dl[sl++]=ls,dl[sl++]=qs,ns=t.id,ls=t.overflow,qs=e}var Vn=null,qt=null,st=!1,Gs=null,Rl=!1,Fc=Error(c(519));function Ys(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw al(Ml(t,e)),Fc}function mu(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Vt]=e,t[$e]=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<bo.length;n++)it(bo[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),Jl(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),N(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=ht),t=!0):t=!1,t||Ys(e,!0)}function gu(e){for(Vn=e.return;Vn;)switch(Vn.tag){case 5:case 31:case 13:Rl=!1;return;case 27:case 3:Rl=!0;return;default:Vn=Vn.return}}function va(e){if(e!==Vn)return!1;if(!st)return gu(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&&qt&&Ys(e),gu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));qt=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));qt=Jg(e)}else t===27?(t=qt,ji(e.type)?(e=xh,xh=null,qt=e):qt=t):qt=Vn?us(e.stateNode.nextSibling):null;return!0}function $s(){qt=Vn=null,st=!1}function ni(){var e=Gs;return e!==null&&(Ul===null?Ul=e:Ul.push.apply(Ul,e),Gs=null),e}function al(e){Gs===null?Gs=[e]:Gs.push(e)}var jl=k(null),Tn=null,ss=null;function as(e,t,n){ce(jl,t._currentValue),t._currentValue=n}function is(e){e._currentValue=jl.current,V(jl)}function li(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 Lr(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=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),li(f.return,n,e),a||(x=null);break e}f=S.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(c(341));x.lanes|=n,f=x.alternate,f!==null&&(f.lanes|=n),li(x,n,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function si(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 x=u.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var S=u.type;_l(u.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(u===Te.current){if(x=u.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(jo):e=[jo])}u=u.return}e!==null&&Lr(t,e,n,a),t.flags|=262144}function Xs(e){for(e=e.firstContext;e!==null;){if(!_l(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vs(e){Tn=e,ss=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qn(e){return bu(Tn,e)}function ai(e,t){return Tn===null&&Vs(e),bu(e,t)}function bu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ss===null){if(e===null)throw Error(c(308));ss=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ss=ss.next=t;return n}var Ji=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()})}},ii=l.unstable_scheduleCallback,nd=l.unstable_NormalPriority,dn={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zr(){return{controller:new Ji,data:new Map,refCount:0}}function Wi(e){e.refCount--,e.refCount===0&&ii(nd,function(){e.controller.abort()})}var Pi=null,Ur=0,ja=0,ri=null;function ld(e,t){if(Pi===null){var n=Pi=[];Ur=0,ja=sh(),ri={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Ur++,t.then(xu,xu),t}function xu(){if(--Ur===0&&Pi!==null){ri!==null&&(ri.status="fulfilled");var e=Pi;Pi=null,ja=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jc(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 Wc=A.S;A.S=function(e,t){dg=Ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ld(e,t),Wc!==null&&Wc(e,t)};var Sa=k(null);function Qs(){var e=Sa.current;return e!==null?e:Gt.pooledCache}function ci(e,t){t===null?ce(Sa,Sa.current):ce(Sa,t.pool)}function yu(){var e=Qs();return e===null?null:{parent:dn._currentValue,pool:e}}var wa=Error(c(460)),Hr=Error(c(474)),p=Error(c(542)),I={then:function(){}};function de(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ie(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ht,ht),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oi(e),e;default:if(typeof t.status=="string")t.then(ht,ht);else{if(e=Gt,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,oi(e),e}throw Zt=t,wa}}function gt(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zt=n,wa):n}}var Zt=null;function Dl(){if(Zt===null)throw Error(c(459));var e=Zt;return Zt=null,e}function oi(e){if(e===wa||e===p)throw Error(c(483))}var ka=null,ui=0;function ye(e){var t=ui;return ui+=1,ka===null&&(ka=[]),Ie(ka,e,t)}function Ee(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qe(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 vt(e){function t(q,U){if(e){var Q=q.deletions;Q===null?(q.deletions=[U],q.flags|=16):Q.push(U)}}function n(q,U){if(!e)return null;for(;U!==null;)t(q,U),U=U.sibling;return null}function a(q){for(var U=new Map;q!==null;)q.key!==null?U.set(q.key,q):U.set(q.index,q),q=q.sibling;return U}function u(q,U){return q=Ss(q,U),q.index=0,q.sibling=null,q}function f(q,U,Q){return q.index=Q,e?(Q=q.alternate,Q!==null?(Q=Q.index,Q<U?(q.flags|=67108866,U):Q):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function x(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function S(q,U,Q,re){return U===null||U.tag!==6?(U=Xc(Q,q.mode,re),U.return=q,U):(U=u(U,Q),U.return=q,U)}function R(q,U,Q,re){var Ue=Q.type;return Ue===E?se(q,U,Q.props.children,re,Q.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===B&&gt(Ue)===U.type)?(U=u(U,Q.props),Ee(U,Q),U.return=q,U):(U=Dr(Q.type,Q.key,Q.props,null,q.mode,re),Ee(U,Q),U.return=q,U)}function K(q,U,Q,re){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Vc(Q,q.mode,re),U.return=q,U):(U=u(U,Q.children||[]),U.return=q,U)}function se(q,U,Q,re,Ue){return U===null||U.tag!==7?(U=ya(Q,q.mode,re,Ue),U.return=q,U):(U=u(U,Q),U.return=q,U)}function oe(q,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Xc(""+U,q.mode,Q),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case C:return Q=Dr(U.type,U.key,U.props,null,q.mode,Q),Ee(Q,U),Q.return=q,Q;case T:return U=Vc(U,q.mode,Q),U.return=q,U;case B:return U=gt(U),oe(q,U,Q)}if(Ne(U)||ue(U))return U=ya(U,q.mode,Q,null),U.return=q,U;if(typeof U.then=="function")return oe(q,ye(U),Q);if(U.$$typeof===G)return oe(q,ai(q,U),Q);qe(q,U)}return null}function F(q,U,Q,re){var Ue=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:S(q,U,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:return Q.key===Ue?R(q,U,Q,re):null;case T:return Q.key===Ue?K(q,U,Q,re):null;case B:return Q=gt(Q),F(q,U,Q,re)}if(Ne(Q)||ue(Q))return Ue!==null?null:se(q,U,Q,re,null);if(typeof Q.then=="function")return F(q,U,ye(Q),re);if(Q.$$typeof===G)return F(q,U,ai(q,Q),re);qe(q,Q)}return null}function te(q,U,Q,re,Ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return q=q.get(Q)||null,S(U,q,""+re,Ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case C:return q=q.get(re.key===null?Q:re.key)||null,R(U,q,re,Ue);case T:return q=q.get(re.key===null?Q:re.key)||null,K(U,q,re,Ue);case B:return re=gt(re),te(q,U,Q,re,Ue)}if(Ne(re)||ue(re))return q=q.get(Q)||null,se(U,q,re,Ue,null);if(typeof re.then=="function")return te(q,U,Q,ye(re),Ue);if(re.$$typeof===G)return te(q,U,Q,ai(U,re),Ue);qe(U,re)}return null}function Re(q,U,Q,re){for(var Ue=null,xt=null,Oe=U,Pe=U=0,ct=null;Oe!==null&&Pe<Q.length;Pe++){Oe.index>Pe?(ct=Oe,Oe=null):ct=Oe.sibling;var yt=F(q,Oe,Q[Pe],re);if(yt===null){Oe===null&&(Oe=ct);break}e&&Oe&&yt.alternate===null&&t(q,Oe),U=f(yt,U,Pe),xt===null?Ue=yt:xt.sibling=yt,xt=yt,Oe=ct}if(Pe===Q.length)return n(q,Oe),st&&ws(q,Pe),Ue;if(Oe===null){for(;Pe<Q.length;Pe++)Oe=oe(q,Q[Pe],re),Oe!==null&&(U=f(Oe,U,Pe),xt===null?Ue=Oe:xt.sibling=Oe,xt=Oe);return st&&ws(q,Pe),Ue}for(Oe=a(Oe);Pe<Q.length;Pe++)ct=te(Oe,q,Pe,Q[Pe],re),ct!==null&&(e&&ct.alternate!==null&&Oe.delete(ct.key===null?Pe:ct.key),U=f(ct,U,Pe),xt===null?Ue=ct:xt.sibling=ct,xt=ct);return e&&Oe.forEach(function(Ti){return t(q,Ti)}),st&&ws(q,Pe),Ue}function He(q,U,Q,re){if(Q==null)throw Error(c(151));for(var Ue=null,xt=null,Oe=U,Pe=U=0,ct=null,yt=Q.next();Oe!==null&&!yt.done;Pe++,yt=Q.next()){Oe.index>Pe?(ct=Oe,Oe=null):ct=Oe.sibling;var Ti=F(q,Oe,yt.value,re);if(Ti===null){Oe===null&&(Oe=ct);break}e&&Oe&&Ti.alternate===null&&t(q,Oe),U=f(Ti,U,Pe),xt===null?Ue=Ti:xt.sibling=Ti,xt=Ti,Oe=ct}if(yt.done)return n(q,Oe),st&&ws(q,Pe),Ue;if(Oe===null){for(;!yt.done;Pe++,yt=Q.next())yt=oe(q,yt.value,re),yt!==null&&(U=f(yt,U,Pe),xt===null?Ue=yt:xt.sibling=yt,xt=yt);return st&&ws(q,Pe),Ue}for(Oe=a(Oe);!yt.done;Pe++,yt=Q.next())yt=te(Oe,q,Pe,yt.value,re),yt!==null&&(e&&yt.alternate!==null&&Oe.delete(yt.key===null?Pe:yt.key),U=f(yt,U,Pe),xt===null?Ue=yt:xt.sibling=yt,xt=yt);return e&&Oe.forEach(function(p0){return t(q,p0)}),st&&ws(q,Pe),Ue}function Ot(q,U,Q,re){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:e:{for(var Ue=Q.key;U!==null;){if(U.key===Ue){if(Ue=Q.type,Ue===E){if(U.tag===7){n(q,U.sibling),re=u(U,Q.props.children),re.return=q,q=re;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===B&&gt(Ue)===U.type){n(q,U.sibling),re=u(U,Q.props),Ee(re,Q),re.return=q,q=re;break e}n(q,U);break}else t(q,U);U=U.sibling}Q.type===E?(re=ya(Q.props.children,q.mode,re,Q.key),re.return=q,q=re):(re=Dr(Q.type,Q.key,Q.props,null,q.mode,re),Ee(re,Q),re.return=q,q=re)}return x(q);case T:e:{for(Ue=Q.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){n(q,U.sibling),re=u(U,Q.children||[]),re.return=q,q=re;break e}else{n(q,U);break}else t(q,U);U=U.sibling}re=Vc(Q,q.mode,re),re.return=q,q=re}return x(q);case B:return Q=gt(Q),Ot(q,U,Q,re)}if(Ne(Q))return Re(q,U,Q,re);if(ue(Q)){if(Ue=ue(Q),typeof Ue!="function")throw Error(c(150));return Q=Ue.call(Q),He(q,U,Q,re)}if(typeof Q.then=="function")return Ot(q,U,ye(Q),re);if(Q.$$typeof===G)return Ot(q,U,ai(q,Q),re);qe(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(n(q,U.sibling),re=u(U,Q),re.return=q,q=re):(n(q,U),re=Xc(Q,q.mode,re),re.return=q,q=re),x(q)):n(q,U)}return function(q,U,Q,re){try{ui=0;var Ue=Ot(q,U,Q,re);return ka=null,Ue}catch(Oe){if(Oe===wa||Oe===p)throw Oe;var xt=vl(29,Oe,null,q.mode);return xt.lanes=re,xt.return=q,xt}finally{}}}var bt=vt(!0),rs=vt(!1),cs=!1;function sd(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 fi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function di(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(jt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Rr(e),Yc(e,null,n),t}return Is(e,a,t,n),Rr(e)}function Pc(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,Ql(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 x={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,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 eo(){if(rd){var e=ri;if(e!==null)throw e}}function to(e,t,n,a){rd=!1;var u=e.updateQueue;cs=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,K=R.next;R.next=null,x===null?f=K:x.next=K,x=R;var se=e.alternate;se!==null&&(se=se.updateQueue,S=se.lastBaseUpdate,S!==x&&(S===null?se.firstBaseUpdate=K:S.next=K,se.lastBaseUpdate=R))}if(f!==null){var oe=u.baseState;x=0,se=K=R=null,S=f;do{var F=S.lane&-536870913,te=F!==S.lane;if(te?(rt&F)===F:(a&F)===F){F!==0&&F===ja&&(rd=!0),se!==null&&(se=se.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Re=e,He=S;F=t;var Ot=n;switch(He.tag){case 1:if(Re=He.payload,typeof Re=="function"){oe=Re.call(Ot,oe,F);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=He.payload,F=typeof Re=="function"?Re.call(Ot,oe,F):Re,F==null)break e;oe=j({},oe,F);break e;case 2:cs=!0}}F=S.callback,F!==null&&(e.flags|=64,te&&(e.flags|=8192),te=u.callbacks,te===null?u.callbacks=[F]:te.push(F))}else te={lane:F,tag:S.tag,payload:S.payload,callback:S.callback,next:null},se===null?(K=se=te,R=oe):se=se.next=te,x|=F;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;te=S,S=te.next,te.next=null,u.lastBaseUpdate=te,u.shared.pending=null}}while(!0);se===null&&(R=oe),u.baseState=R,u.firstBaseUpdate=K,u.lastBaseUpdate=se,f===null&&(u.shared.lanes=0),bi|=x,e.lanes=x,e.memoizedState=oe}}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 Br=k(null),_u=k(0);function Bp(e,t){e=Oa,ce(_u,e),ce(Br,t),Oa=e|t.baseLanes}function cd(){ce(_u,Oa),ce(Br,Br.current)}function od(){Oa=_u.current,V(Br),V(_u)}var ql=k(null),os=null;function hi(e){var t=e.alternate;ce(En,En.current&1),ce(ql,e),os===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(os=e)}function ud(e){ce(En,En.current),ce(ql,e),os===null&&(os=e)}function Ip(e){e.tag===22?(ce(En,En.current),ce(ql,e),os===null&&(os=e)):pi()}function pi(){ce(En,En.current),ce(ql,ql.current)}function Gl(e){V(ql),os===e&&(os=null),V(En)}var En=k(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)||bh(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 Na=0,We=null,Rt=null,Hn=null,ju=!1,Ir=!1,er=!1,Su=0,no=0,qr=null,s_=0;function vn(){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(!_l(e[n],t[n]))return!1;return!0}function dd(e,t,n,a,u,f){return Na=f,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Sm:Td,er=!1,f=n(a,u),er=!1,Ir&&(f=Gp(t,n,a,u)),qp(e),f}function qp(e){A.H=ao;var t=Rt!==null&&Rt.next!==null;if(Na=0,Hn=Rt=We=null,ju=!1,no=0,qr=null,t)throw Error(c(300));e===null||Bn||(e=e.dependencies,e!==null&&Xs(e)&&(Bn=!0))}function Gp(e,t,n,a){We=e;var u=0;do{if(Ir&&(qr=null),no=0,Ir=!1,25<=u)throw Error(c(301));if(u+=1,Hn=Rt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=wm,f=t(n,a)}while(Ir);return f}function a_(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?lo(t):t,e=e.useState()[0],(Rt!==null?Rt.memoizedState:null)!==e&&(We.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}Na=0,Hn=Rt=We=null,Ir=!1,no=Su=0,qr=null}function Sl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e,Hn}function Cn(){if(Rt===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Rt.next;var t=Hn===null?We.memoizedState:Hn.next;if(t!==null)Hn=t,Rt=e;else{if(e===null)throw We.alternate===null?Error(c(467)):Error(c(310));Rt=e,e={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e}return Hn}function wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(e){var t=no;return no+=1,qr===null&&(qr=[]),e=Ie(qr,e,t),t=We,(Hn===null?t.memoizedState:Hn.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Sm:Td),e}function ku(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return lo(e);if(e.$$typeof===G)return Qn(e)}throw Error(c(438,String(e)))}function gd(e){var t=null,n=We.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=We.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(),We.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]=he;return t.index++,n}function Ta(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=Cn();return bd(t,Rt,e)}function bd(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 x=u.next;u.next=f.next,f.next=x}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=x=null,R=null,K=t,se=!1;do{var oe=K.lane&-536870913;if(oe!==K.lane?(rt&oe)===oe:(Na&oe)===oe){var F=K.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),oe===ja&&(se=!0);else if((Na&F)===F){K=K.next,F===ja&&(se=!0);continue}else oe={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(S=R=oe,x=f):R=R.next=oe,We.lanes|=F,bi|=F;oe=K.action,er&&n(f,oe),f=K.hasEagerState?K.eagerState:n(f,oe)}else F={lane:oe,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(S=R=F,x=f):R=R.next=F,We.lanes|=oe,bi|=oe;K=K.next}while(K!==null&&K!==t);if(R===null?x=f:R.next=S,!_l(f,e.memoizedState)&&(Bn=!0,se&&(n=ri,n!==null)))throw n;e.memoizedState=f,e.baseState=x,e.baseQueue=R,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function xd(e){var t=Cn(),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 x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);_l(f,t.memoizedState)||(Bn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Yp(e,t,n){var a=We,u=Cn(),f=st;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var x=!_l((Rt||u).memoizedState,n);if(x&&(u.memoizedState=n,Bn=!0),u=u.queue,vd(Vp.bind(null,a,u,e),[e]),u.getSnapshot!==t||x||Hn!==null&&Hn.memoizedState.tag&1){if(a.flags|=2048,Gr(9,{destroy:void 0},Xp.bind(null,a,u,n,t),null),Gt===null)throw Error(c(349));f||(Na&127)!==0||$p(a,t,n)}return n}function $p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t=wu(),We.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!_l(e,n)}catch{return!0}}function Kp(e){var t=xa(e,2);t!==null&&Hl(t,e,2)}function yd(e){var t=Sl();if(typeof e=="function"){var n=e;if(e=n(),er){Kt(!0);try{n()}finally{Kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:e},t}function Zp(e,t,n,a){return e.baseState=n,bd(e,Rt,typeof a=="function"?a:Ta)}function i_(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(x){f.listeners.push(x)}};A.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=A.T,x={};A.T=x;try{var S=n(u,a),R=A.S;R!==null&&R(x,S),Jp(e,t,S)}catch(K){_d(e,t,K)}finally{f!==null&&x.types!==null&&(f.types=x.types),A.T=f}}else try{f=n(u,a),Jp(e,t,f)}catch(K){_d(e,t,K)}}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 _d(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 _d(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=Gt.formState;if(n!==null){e:{var a=We;if(st){if(qt){t:{for(var u=qt,f=Rl;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){qt=us(u.nextSibling),a=u.data==="F!";break e}}Ys(a)}a=!1}a&&(t=n[0])}}return n=Sl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:t},n.queue=a,n=_m.bind(null,We,a),a.dispatch=n,a=yd(!1),f=Nd.bind(null,We,!1,a.queue),a=Sl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=i_.bind(null,We,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function nm(e){var t=Cn();return lm(t,Rt,e)}function lm(e,t,n){if(t=bd(e,t,em)[0],e=Nu(Ta)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=lo(t)}catch(x){throw x===wa?p:x}else a=t;t=Cn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(We.flags|=2048,Gr(9,{destroy:void 0},r_.bind(null,u,n),null)),[a,f,e]}function r_(e,t){e.action=t}function sm(e){var t=Cn(),n=Rt;if(n!==null)return lm(t,n,e);Cn(),t=t.memoizedState,n=Cn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Gr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=We.updateQueue,t===null&&(t=wu(),We.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 Cn().memoizedState}function Tu(e,t,n,a){var u=Sl();We.flags|=e,u.memoizedState=Gr(1|t,{destroy:void 0},n,a===void 0?null:a)}function Eu(e,t,n,a){var u=Cn();a=a===void 0?null:a;var f=u.memoizedState.inst;Rt!==null&&a!==null&&fd(a,Rt.memoizedState.deps)?u.memoizedState=Gr(t,f,n,a):(We.flags|=e,u.memoizedState=Gr(1|t,f,n,a))}function im(e,t){Tu(8390656,8,e,t)}function vd(e,t){Eu(2048,8,e,t)}function c_(e){We.flags|=4;var t=We.updateQueue;if(t===null)t=wu(),We.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function rm(e){var t=Cn().memoizedState;return c_({ref:t,nextImpl:e}),function(){if((jt&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=Cn();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=Cn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&fd(t,a[1]))return a[0];if(a=e(),er){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[a,t],a}function Sd(e,t,n){return n===void 0||(Na&1073741824)!==0&&(rt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=pg(),We.lanes|=e,bi|=e,n)}function pm(e,t,n,a){return _l(n,t)?n:Br.current!==null?(e=Sd(e,n,a),_l(e,t)||(Bn=!0),e):(Na&42)===0||(Na&1073741824)!==0&&(rt&261930)===0?(Bn=!0,e.memoizedState=n):(e=pg(),We.lanes|=e,bi|=e,t)}function mm(e,t,n,a,u){var f=fe.p;fe.p=f!==0&&8>f?f:8;var x=A.T,S={};A.T=S,Nd(e,!1,t,n);try{var R=u(),K=A.S;if(K!==null&&K(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var se=Jc(R,a);so(e,t,se,Xl(e))}else so(e,t,a,Xl(e))}catch(oe){so(e,t,{then:function(){},status:"rejected",reason:oe},Xl())}finally{fe.p=f,x!==null&&S.types!==null&&(x.types=S.types),A.T=x}}function o_(){}function wd(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=gm(e).queue;mm(e,u,t,z,n===null?o_:function(){return bm(e),n(a)})}function gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:z},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bm(e){var t=gm(e);t.next===null&&(t=e.alternate.memoizedState),so(e,t.next.queue,{},Xl())}function kd(){return Qn(jo)}function xm(){return Cn().memoizedState}function ym(){return Cn().memoizedState}function u_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Xl();e=fi(n);var a=di(t,e,n);a!==null&&(Hl(a,t,n),Pc(a,t,n)),t={cache:zr()},e.payload=t;return}t=t.return}}function f_(e,t,n){var a=Xl();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cu(e)?vm(t,n):(n=Mr(e,t,n,a),n!==null&&(Hl(n,e,a),jm(n,t,a)))}function _m(e,t,n){var a=Xl();so(e,t,n,a)}function so(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 x=t.lastRenderedState,S=f(x,n);if(u.hasEagerState=!0,u.eagerState=S,_l(S,x))return Is(e,t,u,0),Gt===null&&Ar(),!1}catch{}finally{}if(n=Mr(e,t,u,a),n!==null)return Hl(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=Mr(e,n,a,2),t!==null&&Hl(t,e,2)}function Cu(e){var t=e.alternate;return e===We||t!==null&&t===We}function vm(e,t){Ir=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,Ql(e,n)}}var ao={readContext:Qn,use:ku,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};ao.useEffectEvent=vn;var Sm={readContext:Qn,use:ku,useCallback:function(e,t){return Sl().memoizedState=[e,t===void 0?null:t],e},useContext:Qn,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=Sl();t=t===void 0?null:t;var a=e();if(er){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Sl();if(n!==void 0){var u=n(t);if(er){Kt(!0);try{n(t)}finally{Kt(!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=f_.bind(null,We,e),[a.memoizedState,e]},useRef:function(e){var t=Sl();return e={current:e},t.memoizedState=e},useState:function(e){e=yd(e);var t=e.queue,n=_m.bind(null,We,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:jd,useDeferredValue:function(e,t){var n=Sl();return Sd(n,e,t)},useTransition:function(){var e=yd(!1);return e=mm.bind(null,We,e.queue,!0,!1),Sl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=We,u=Sl();if(st){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Gt===null)throw Error(c(349));(rt&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,Gr(9,{destroy:void 0},Xp.bind(null,a,f,n,t),null),n},useId:function(){var e=Sl(),t=Gt.identifierPrefix;if(st){var n=ls,a=ns;n=(a&~(1<<32-Et(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Su++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=s_++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kd,useFormState:tm,useActionState:tm,useOptimistic:function(e){var t=Sl();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,We,!0,n),n.dispatch=t,[e,t]},useMemoCache:gd,useCacheRefresh:function(){return Sl().memoizedState=u_.bind(null,We)},useEffectEvent:function(e){var t=Sl(),n={impl:e};return t.memoizedState=n,function(){if((jt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Td={readContext:Qn,use:ku,useCallback:dm,useContext:Qn,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:Nu,useRef:am,useState:function(){return Nu(Ta)},useDebugValue:jd,useDeferredValue:function(e,t){var n=Cn();return pm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=Nu(Ta)[0],t=Cn().memoizedState;return[typeof e=="boolean"?e:lo(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:kd,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=Cn();return Zp(n,Rt,e,t)},useMemoCache:gd,useCacheRefresh:ym};Td.useEffectEvent=rm;var wm={readContext:Qn,use:ku,useCallback:dm,useContext:Qn,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:xd,useRef:am,useState:function(){return xd(Ta)},useDebugValue:jd,useDeferredValue:function(e,t){var n=Cn();return Rt===null?Sd(n,e,t):pm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=xd(Ta)[0],t=Cn().memoizedState;return[typeof e=="boolean"?e:lo(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:kd,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=Cn();return Rt!==null?Zp(n,Rt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:gd,useCacheRefresh:ym};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=Xl(),u=fi(a);u.payload=t,n!=null&&(u.callback=n),t=di(e,u,a),t!==null&&(Hl(t,e,a),Pc(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Xl(),u=fi(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=di(e,u,a),t!==null&&(Hl(t,e,a),Pc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),a=fi(n);a.tag=2,t!=null&&(a.callback=t),t=di(e,a,n),t!==null&&(Hl(t,e,n),Pc(t,e,n))}};function km(e,t,n,a,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,x):t.prototype&&t.prototype.isPureReactComponent?!es(n,a)||!es(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 tr(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){Ja(e)}function Em(e){console.error(e)}function Cm(e){Ja(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=fi(n),n.tag=3,n.payload={element:null},n.callback=function(){Au(e,t)},n}function Mm(e){return e=fi(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 x=n.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Am(t,n,a),typeof u!="function"&&(xi===null?xi=new Set([this]):xi.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})})}function d_(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&si(t,n,u,!0),n=ql.current,n!==null){switch(n.tag){case 31:case 13:return os===null?Gu():n.alternate===null&&jn===0&&(jn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===I?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===I?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=ql.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==Fc&&(e=Error(c(422),{cause:a}),al(Ml(e,n)))):(a!==Fc&&(t=Error(c(423),{cause:a}),al(Ml(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Ml(a,n),u=Ad(e.stateNode,a,u),id(e,u),jn!==4&&(jn=2)),!1;var f=Error(c(520),{cause:a});if(f=Ml(f,n),po===null?po=[f]:po.push(f),jn!==4&&(jn=2),t===null)return!0;a=Ml(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"&&(xi===null||!xi.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)),Bn=!1;function il(e,t,n,a){t.child=e===null?rs(t,null,n,a):bt(t,e.child,n,a)}function Dm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var x={};for(var S in a)S!=="ref"&&(x[S]=a[S])}else x=a;return Vs(t),a=dd(e,t,n,x,f,u),S=hd(),e!==null&&!Bn?(pd(e,t,u),Ea(e,t,u)):(st&&S&&Kc(t),t.flags|=1,il(e,t,a,u),t.child)}function Om(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!$c(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Lm(e,t,f,a,u)):(e=Dr(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 x=f.memoizedProps;if(n=n.compare,n=n!==null?n:es,n(x,a)&&e.ref===t.ref)return Ea(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(es(f,a)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=a=f,Bd(e,u))(e.flags&131072)!==0&&(Bn=!0);else return t.lanes=e.lanes,Ea(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&&ci(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?(ci(t,f.cachePool),Bp(t,f),pi(),t.memoizedState=null):(e!==null&&ci(t,null),cd(),pi());return il(e,t,u,n),t.child}function io(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=Qs();return f=f===null?null:{parent:dn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&ci(t,null),cd(),Ip(t),e!==null&&si(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 bt(t,e.child,null,n),e=Mu(t,t.pendingProps),e.flags|=2,Gl(t),t.memoizedState=null,e}function h_(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,io(null,e);if(ud(t),(e=qt)?(e=Fg(e,Rl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qs!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=du(e),n.return=t,t.child=n,Vn=t,qt=null)):e=null,e===null)throw Ys(t);return t.lanes=536870912,null}return Mu(t,a)}var f=e.memoizedState;if(f!==null){var x=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(Bn||si(e,t,n,!1),u=(n&e.childLanes)!==0,Bn||u){if(a=Gt,a!==null&&(x=ms(a,n),x!==0&&x!==f.retryLane))throw f.retryLane=x,xa(e,x),Hl(a,e,x),Md;Gu(),t=Hm(e,t,n)}else e=f.treeContext,qt=us(x.nextSibling),Vn=t,st=!0,Gs=null,Rl=!1,e!==null&&pu(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 Vs(t),n=dd(e,t,n,a,void 0,u),a=hd(),e!==null&&!Bn?(pd(e,t,u),Ea(e,t,u)):(st&&a&&Kc(t),t.flags|=1,il(e,t,n,u),t.child)}function Bm(e,t,n,a,u,f){return Vs(t),t.updateQueue=null,n=Gp(t,a,n,u),qp(e),a=hd(),e!==null&&!Bn?(pd(e,t,f),Ea(e,t,f)):(st&&a&&Kc(t),t.flags|=1,il(e,t,n,f),t.child)}function Im(e,t,n,a,u){if(Vs(t),t.stateNode===null){var f=Pa,x=n.contextType;typeof x=="object"&&x!==null&&(f=Qn(x)),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={},sd(t),x=n.contextType,f.context=typeof x=="object"&&x!==null?Qn(x):Pa,f.state=t.memoizedState,x=n.getDerivedStateFromProps,typeof x=="function"&&(Ed(t,n,x,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Cd.enqueueReplaceState(f,f.state,null),to(t,a,f,u),eo(),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=tr(n,S);f.props=R;var K=f.context,se=n.contextType;x=Pa,typeof se=="object"&&se!==null&&(x=Qn(se));var oe=n.getDerivedStateFromProps;se=typeof oe=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,se||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||K!==x)&&Nm(t,f,a,x),cs=!1;var F=t.memoizedState;f.state=F,to(t,a,f,u),eo(),K=t.memoizedState,S||F!==K||cs?(typeof oe=="function"&&(Ed(t,n,oe,a),K=t.memoizedState),(R=cs||km(t,n,R,a,F,K,x))?(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=K),f.props=a,f.state=K,f.context=x,a=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,ad(e,t),x=t.memoizedProps,se=tr(n,x),f.props=se,oe=t.pendingProps,F=f.context,K=n.contextType,R=Pa,typeof K=="object"&&K!==null&&(R=Qn(K)),S=n.getDerivedStateFromProps,(K=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==oe||F!==R)&&Nm(t,f,a,R),cs=!1,F=t.memoizedState,f.state=F,to(t,a,f,u),eo();var te=t.memoizedState;x!==oe||F!==te||cs||e!==null&&e.dependencies!==null&&Xs(e.dependencies)?(typeof S=="function"&&(Ed(t,n,S,a),te=t.memoizedState),(se=cs||km(t,n,se,a,F,te,R)||e!==null&&e.dependencies!==null&&Xs(e.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,te,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,te,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=te),f.props=a,f.state=te,f.context=R,a=se):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===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=bt(t,e.child,null,u),t.child=bt(t,null,n,u)):il(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ea(e,t,u),e}function qm(e,t,n,a){return $s(),t.flags|=256,il(e,t,n,a),t.child}var Dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Od(e){return{baseLanes:e,cachePool:yu()}}function Ld(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$l),e}function Gm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(En.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(u?hi(t):pi(),(e=qt)?(e=Fg(e,Rl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qs!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=du(e),n.return=t,t.child=n,Vn=t,qt=null)):e=null,e===null)throw Ys(t);return bh(e)?t.lanes=32:t.lanes=536870912,null}var S=a.children;return a=a.fallback,u?(pi(),u=t.mode,S=Du({mode:"hidden",children:S},u),a=ya(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,x,n),t.memoizedState=Dd,io(null,a)):(hi(t),zd(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(f)t.flags&256?(hi(t),t.flags&=-257,t=Ud(e,t,n)):t.memoizedState!==null?(pi(),t.child=e.child,t.flags|=128,t=null):(pi(),S=a.fallback,u=t.mode,a=Du({mode:"visible",children:a.children},u),S=ya(S,u,n,null),S.flags|=2,a.return=t,S.return=t,a.sibling=S,t.child=a,bt(t,e.child,null,n),a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,x,n),t.memoizedState=Dd,t=io(null,a));else if(hi(t),bh(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var K=x.dgst;x=K,a=Error(c(419)),a.stack="",a.digest=x,al({value:a,source:null,stack:null}),t=Ud(e,t,n)}else if(Bn||si(e,t,n,!1),x=(n&e.childLanes)!==0,Bn||x){if(x=Gt,x!==null&&(a=ms(x,n),a!==0&&a!==R.retryLane))throw R.retryLane=a,xa(e,a),Hl(x,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,qt=us(S.nextSibling),Vn=t,st=!0,Gs=null,Rl=!1,e!==null&&pu(t,e),t=zd(t,a.children),t.flags|=4096);return t}return u?(pi(),S=a.fallback,u=t.mode,R=e.child,K=R.sibling,a=Ss(R,{mode:"hidden",children:a.children}),a.subtreeFlags=R.subtreeFlags&65011712,K!==null?S=Ss(K,S):(S=ya(S,u,n,null),S.flags|=2),S.return=t,a.return=t,a.sibling=S,t.child=a,io(null,a),a=t.child,S=e.child.memoizedState,S===null?S=Od(n):(u=S.cachePool,u!==null?(R=dn._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=yu(),S={baseLanes:S.baseLanes|n,cachePool:u}),a.memoizedState=S,a.childLanes=Ld(e,x,n),t.memoizedState=Dd,io(e.child,a)):(hi(t),n=e.child,e=n.sibling,n=Ss(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.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 bt(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),li(e.return,t,n)}function Hd(e,t,n,a,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=a,x.tail=n,x.tailMode=u,x.treeForkCount=f)}function $m(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var x=En.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,ce(En,x),il(e,t,a,n),a=st?_a: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 Ea(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(si(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&&Xs(e)))}function p_(e,t,n){switch(t.tag){case 3:Tt(t,t.stateNode.containerInfo),as(t,dn,e.memoizedState.cache),$s();break;case 27:case 5:et(t);break;case 4:Tt(t,t.stateNode.containerInfo);break;case 10:as(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?(hi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Gm(e,t,n):(hi(t),e=Ea(e,t,n),e!==null?e.sibling:null);hi(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(si(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),ce(En,En.current),a)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:as(t,dn,e.memoizedState.cache)}return Ea(e,t,n)}function Xm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Bn=!0;else{if(!Bd(e,n)&&(t.flags&128)===0)return Bn=!1,p_(e,t,n);Bn=(e.flags&131072)!==0}else Bn=!1,st&&(t.flags&1048576)!==0&&hu(t,_a,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=gt(t.elementType),t.type=e,typeof e=="function")$c(e)?(a=tr(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===O){t.tag=11,t=Dm(null,t,e,a,n);break e}else if(u===D){t.tag=14,t=Om(null,t,e,a,n);break e}}throw t=De(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=tr(a,t.pendingProps),Im(e,t,a,u,n);case 3:e:{if(Tt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,ad(e,t),to(t,a,null,n);var x=t.memoizedState;if(a=x.cache,as(t,dn,a),a!==f.cache&&Lr(t,[dn],n,!0),eo(),a=x.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=qm(e,t,a,n);break e}else if(a!==u){u=Ml(Error(c(424)),t),al(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(qt=us(e.firstChild),Vn=t,st=!0,Gs=null,Rl=!0,n=rs(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if($s(),a===u){t=Ea(e,t,n);break e}il(e,t,a,n)}t=t.child}return t;case 26:return Ru(e,t),e===null?(n=nb(t.type,null,t.pendingProps,null))?t.memoizedState=n:st||(n=t.type,e=t.pendingProps,a=Zu(Se.current).createElement(n),a[Vt]=t,a[$e]=e,rl(a,n,e),Ze(a),t.stateNode=a):t.memoizedState=nb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return et(t),e===null&&st&&(a=t.stateNode=Pg(t.type,t.pendingProps,Se.current),Vn=t,Rl=!0,u=qt,ji(t.type)?(xh=u,qt=us(a.firstChild)):qt=u),il(e,t,t.pendingProps.children,n),Ru(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((u=a=qt)&&(a=$_(a,t.type,t.pendingProps,Rl),a!==null?(t.stateNode=a,Vn=t,qt=us(a.firstChild),Rl=!1,u=!0):u=!1),u||Ys(t)),et(t),u=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,a=f.children,hh(u,f)?a=null:x!==null&&hh(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=dd(e,t,a_,null,null,n),jo._currentValue=u),Ru(e,t),il(e,t,a,n),t.child;case 6:return e===null&&st&&((e=n=qt)&&(n=X_(n,t.pendingProps,Rl),n!==null?(t.stateNode=n,Vn=t,qt=null,e=!0):e=!1),e||Ys(t)),null;case 13:return Gm(e,t,n);case 4:return Tt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=bt(t,null,a,n):il(e,t,a,n),t.child;case 11:return Dm(e,t,t.type,t.pendingProps,n);case 7:return il(e,t,t.pendingProps,n),t.child;case 8:return il(e,t,t.pendingProps.children,n),t.child;case 12:return il(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,as(t,t.type,a.value),il(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,Vs(t),u=Qn(u),a=a(u),t.flags|=1,il(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 h_(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return Vs(t),a=Qn(dn),e===null?(u=Qs(),u===null&&(u=Gt,f=zr(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},sd(t),as(t,dn,u)):((e.lanes&n)!==0&&(ad(e,t),to(t,null,null,n),eo()),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),as(t,dn,a)):(a=f.cache,as(t,dn,a),a!==u.cache&&Lr(t,[dn],n,!0))),il(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ca(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(xg())e.flags|=8192;else throw Zt=I,Hr}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,!rb(t))if(xg())e.flags|=8192;else throw Zt=I,Hr}function Ou(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bn():536870912,e.lanes|=t,Vr|=t)}function ro(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 m_(e,t,n){var a=t.pendingProps;switch(Zc(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),is(dn),Ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(va(t)?Ca(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ni())),Ft(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ca(t),f!==null?(Ft(t),Vm(t,f)):(Ft(t),Id(t,u,null,a,n))):f?f!==e.memoizedState?(Ca(t),Ft(t),Vm(t,f)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ca(t),Ft(t),Id(t,u,e,a,n)),null;case 27:if(Xe(t),n=Se.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ca(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}e=ge.current,va(t)?mu(t):(e=Pg(u,a,n),t.stateNode=e,Ca(t))}return Ft(t),null;case 5:if(Xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ca(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}if(f=ge.current,va(t))mu(t);else{var x=Zu(Se.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?x.createElement("select",{is:a.is}):x.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?x.createElement(u,{is:a.is}):x.createElement(u)}}f[Vt]=t,f[$e]=a;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=f;e:switch(rl(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&&Ca(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&&Ca(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=Se.current,va(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Vn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Vt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Gg(e.nodeValue,n)),e||Ys(t,!0)}else e=Zu(e).createTextNode(a),e[Vt]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=va(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[Vt]=t}else $s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(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=va(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[Vt]=t}else $s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),u=!1}else u=ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(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 Ye(),e===null&&ch(t.stateNode.containerInfo),Ft(t),null;case 10:return is(t.type),Ft(t),null;case 19:if(V(En),a=t.memoizedState,a===null)return Ft(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)ro(a,!1);else{if(jn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=vu(e),f!==null){for(t.flags|=128,ro(a,!1),e=f.updateQueue,t.updateQueue=e,Ou(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fu(n,e),n=n.sibling;return ce(En,En.current&1|2),st&&ws(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ke()>Bu&&(t.flags|=128,u=!0,ro(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),ro(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!st)return Ft(t),null}else 2*Ke()-a.renderingStartTime>Bu&&n!==536870912&&(t.flags|=128,u=!0,ro(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=Ke(),e.sibling=null,n=En.current,ce(En,u?n&1|2:n&1),st&&ws(t,a.treeForkCount),e):(Ft(t),null);case 22:case 23:return Gl(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&&V(Sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),is(dn),Ft(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function g_(e,t){switch(Zc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return is(dn),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Xe(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(c(340));$s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));$s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(En),null;case 4:return Ye(),null;case 10:return is(t.type),null;case 22:case 23:return Gl(t),od(),e!==null&&V(Sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return is(dn),null;case 25:return null;default:return null}}function Qm(e,t){switch(Zc(t),t.tag){case 3:is(dn),Ye();break;case 26:case 27:case 5:Xe(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:V(En);break;case 10:is(t.type);break;case 22:case 23:Gl(t),od(),e!==null&&V(Sa);break;case 24:is(dn)}}function co(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,x=n.inst;a=f(),x.destroy=a}n=n.next}while(n!==u)}}catch(S){At(t,t.return,S)}}function mi(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 x=a.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,u=t;var R=n,K=S;try{K()}catch(se){At(u,R,se)}}}a=a.next}while(a!==f)}}catch(se){At(t,t.return,se)}}function Km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hp(t,n)}catch(a){At(e,e.return,a)}}}function Zm(e,t,n){n.props=tr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){At(e,t,a)}}function oo(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){At(e,t,u)}}function Ks(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){At(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){At(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){At(e,e.return,u)}}function qd(e,t,n){try{var a=e.stateNode;H_(a,e.type,n,t),a[$e]=t}catch(u){At(e,e.return,u)}}function Jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ji(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&&ji(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=ht));else if(a!==4&&(a===27&&ji(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&&ji(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]);rl(t,a,n),t[Vt]=e,t[$e]=n}catch(f){At(e,e.return,f)}}var Aa=!1,In=!1,$d=!1,Pm=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function b_(e,t){if(e=e.containerInfo,fh=nf,e=au(e),Oc(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 x=0,S=-1,R=-1,K=0,se=0,oe=e,F=null;t:for(;;){for(var te;oe!==n||u!==0&&oe.nodeType!==3||(S=x+u),oe!==f||a!==0&&oe.nodeType!==3||(R=x+a),oe.nodeType===3&&(x+=oe.nodeValue.length),(te=oe.firstChild)!==null;)F=oe,oe=te;for(;;){if(oe===e)break t;if(F===n&&++K===u&&(S=x),F===f&&++se===a&&(R=x),(te=oe.nextSibling)!==null)break;oe=F,F=oe.parentNode}oe=te}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=tr(n.type,u);e=a.getSnapshotBeforeUpdate(Re,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(He){At(n,n.return,He)}}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:Ra(e,n),a&4&&co(5,n);break;case 1:if(Ra(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(x){At(n,n.return,x)}else{var u=tr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){At(n,n.return,x)}}a&64&&Km(n),a&512&&oo(n,n.return);break;case 3:if(Ra(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(x){At(n,n.return,x)}}break;case 27:t===null&&a&4&&Wm(n);case 26:case 5:Ra(e,n),t===null&&a&4&&Fm(n),a&512&&oo(n,n.return);break;case 12:Ra(e,n);break;case 31:Ra(e,n),a&4&&lg(e,n);break;case 13:Ra(e,n),a&4&&sg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=N_.bind(null,n),V_(e,n))));break;case 22:if(a=n.memoizedState!==null||Aa,!a){t=t!==null&&t.memoizedState!==null||In,u=Aa;var f=In;Aa=a,(In=t)&&!f?Da(e,n,(n.subtreeFlags&8772)!==0):Ra(e,n),Aa=u,In=f}break;case 30:break;default:Ra(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&&kt(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 rn=null,Ol=!1;function Ma(e,t,n){for(n=n.child;n!==null;)ng(e,t,n),n=n.sibling}function ng(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:In||Ks(n,t),Ma(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:In||Ks(n,t);var a=rn,u=Ol;ji(n.type)&&(rn=n.stateNode,Ol=!1),Ma(e,t,n),yo(n.stateNode),rn=a,Ol=u;break;case 5:In||Ks(n,t);case 6:if(a=rn,u=Ol,rn=null,Ma(e,t,n),rn=a,Ol=u,rn!==null)if(Ol)try{(rn.nodeType===9?rn.body:rn.nodeName==="HTML"?rn.ownerDocument.body:rn).removeChild(n.stateNode)}catch(f){At(n,t,f)}else try{rn.removeChild(n.stateNode)}catch(f){At(n,t,f)}break;case 18:rn!==null&&(Ol?(e=rn,Kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ec(e)):Kg(rn,n.stateNode));break;case 4:a=rn,u=Ol,rn=n.stateNode.containerInfo,Ol=!0,Ma(e,t,n),rn=a,Ol=u;break;case 0:case 11:case 14:case 15:mi(2,n,t),In||mi(4,n,t),Ma(e,t,n);break;case 1:In||(Ks(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Zm(n,t,a)),Ma(e,t,n);break;case 21:Ma(e,t,n);break;case 22:In=(a=In)||n.memoizedState!==null,Ma(e,t,n),In=a;break;default:Ma(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{ec(e)}catch(n){At(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{ec(e)}catch(n){At(t,t.return,n)}}function x_(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=x_(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=T_.bind(null,e,a);a.then(u,u)}})}function Ll(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(ji(S.type)){rn=S.stateNode,Ol=!1;break e}break;case 5:rn=S.stateNode,Ol=!1;break e;case 3:case 4:rn=S.stateNode.containerInfo,Ol=!0;break e}S=S.return}if(rn===null)throw Error(c(160));ng(f,x,u),rn=null,Ol=!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 ks=null;function ag(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ll(t,e),zl(e),a&4&&(mi(3,e,e.return),co(3,e),mi(5,e,e.return));break;case 1:Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),a&64&&Aa&&(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=ks;if(Ll(t,e),zl(e),a&512&&(In||n===null||Ks(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[el]||f[Vt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),rl(f,a,n),f[Vt]=e,Ze(f),a=f;break e;case"link":var x=ab("link","href",u).get(a+(n.href||""));if(x){for(var S=0;S<x.length;S++)if(f=x[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)){x.splice(S,1);break t}}f=u.createElement(a),rl(f,a,n),u.head.appendChild(f);break;case"meta":if(x=ab("meta","content",u).get(a+(n.content||""))){for(S=0;S<x.length;S++)if(f=x[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)){x.splice(S,1);break t}}f=u.createElement(a),rl(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Vt]=e,Ze(f),a=f}e.stateNode=a}else ib(u,e.type,e.stateNode);else e.stateNode=sb(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?ib(u,e.type,e.stateNode):sb(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&qd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),n!==null&&a&4&&qd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),e.flags&32){u=e.stateNode;try{Y(u,"")}catch(Re){At(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(Ll(t,e),zl(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Re){At(e,e.return,Re)}}break;case 3:if(Wu=null,u=ks,ks=Fu(t.containerInfo),Ll(t,e),ks=u,zl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ec(t.containerInfo)}catch(Re){At(e,e.return,Re)}$d&&($d=!1,ig(e));break;case 4:a=ks,ks=Fu(e.stateNode.containerInfo),Ll(t,e),zl(e),ks=a;break;case 12:Ll(t,e),zl(e);break;case 31:Ll(t,e),zl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 13:Ll(t,e),zl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Hu=Ke()),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,K=Aa,se=In;if(Aa=K||u,In=se||R,Ll(t,e),In=se,Aa=K,zl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||Aa||In||nr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=R.stateNode;var oe=R.memoizedProps.style,F=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;S.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(Re){At(R,R.return,Re)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(Re){At(R,R.return,Re)}}}else if(t.tag===18){if(n===null){R=t;try{var te=R.stateNode;u?Zg(te,!0):Zg(R.stateNode,!1)}catch(Re){At(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:Ll(t,e),zl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 30:break;case 21:break;default:Ll(t,e),zl(e)}}function zl(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 x=n.stateNode;n.flags&32&&(Y(x,""),n.flags&=-33);var S=Gd(e);Lu(e,S,x);break;case 3:case 4:var R=n.stateNode.containerInfo,K=Gd(e);Yd(e,K,R);break;default:throw Error(c(161))}}catch(se){At(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 Ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)eg(e,t.alternate,t),t=t.sibling}function nr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:mi(4,t,t.return),nr(t);break;case 1:Ks(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zm(t,t.return,n),nr(t);break;case 27:yo(t.stateNode);case 26:case 5:Ks(t,t.return),nr(t);break;case 22:t.memoizedState===null&&nr(t);break;case 30:nr(t);break;default:nr(t)}e=e.sibling}}function Da(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:Da(u,f,n),co(4,f);break;case 1:if(Da(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(K){At(a,a.return,K)}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(K){At(a,a.return,K)}}n&&x&64&&Km(f),oo(f,f.return);break;case 27:Wm(f);case 26:case 5:Da(u,f,n),n&&a===null&&x&4&&Fm(f),oo(f,f.return);break;case 12:Da(u,f,n);break;case 31:Da(u,f,n),n&&x&4&&lg(u,f);break;case 13:Da(u,f,n),n&&x&4&&sg(u,f);break;case 22:f.memoizedState===null&&Da(u,f,n),oo(f,f.return);break;case 30:break;default:Da(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&&Wi(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&&Wi(e))}function Ns(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:Ns(e,t,n,a),u&2048&&co(9,t);break;case 1:Ns(e,t,n,a);break;case 3:Ns(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&&Wi(e)));break;case 12:if(u&2048){Ns(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,S=f.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){At(t,t.return,R)}}else Ns(e,t,n,a);break;case 31:Ns(e,t,n,a);break;case 13:Ns(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?Ns(e,t,n,a):uo(e,t):f._visibility&2?Ns(e,t,n,a):(f._visibility|=2,Yr(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Xd(x,t);break;case 24:Ns(e,t,n,a),u&2048&&Vd(t.alternate,t);break;default:Ns(e,t,n,a)}}function Yr(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,x=t,S=n,R=a,K=x.flags;switch(x.tag){case 0:case 11:case 15:Yr(f,x,S,R,u),co(8,x);break;case 23:break;case 22:var se=x.stateNode;x.memoizedState!==null?se._visibility&2?Yr(f,x,S,R,u):uo(f,x):(se._visibility|=2,Yr(f,x,S,R,u)),u&&K&2048&&Xd(x.alternate,x);break;case 24:Yr(f,x,S,R,u),u&&K&2048&&Vd(x.alternate,x);break;default:Yr(f,x,S,R,u)}t=t.sibling}}function uo(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:uo(n,a),u&2048&&Xd(a.alternate,a);break;case 24:uo(n,a),u&2048&&Vd(a.alternate,a);break;default:uo(n,a)}t=t.sibling}}var fo=8192;function $r(e,t,n){if(e.subtreeFlags&fo)for(e=e.child;e!==null;)cg(e,t,n),e=e.sibling}function cg(e,t,n){switch(e.tag){case 26:$r(e,t,n),e.flags&fo&&e.memoizedState!==null&&s0(n,ks,e.memoizedState,e.memoizedProps);break;case 5:$r(e,t,n);break;case 3:case 4:var a=ks;ks=Fu(e.stateNode.containerInfo),$r(e,t,n),ks=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fo,fo=16777216,$r(e,t,n),fo=a):$r(e,t,n));break;default:$r(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 ho(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:ho(e),e.flags&2048&&mi(9,e,e.return);break;case 3:ho(e);break;case 12:ho(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)):ho(e);break;default:ho(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:mi(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:mi(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:Wi(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 y_={getCacheForType:function(e){var t=Qn(dn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qn(dn).controller.signal}},__=typeof WeakMap=="function"?WeakMap:Map,jt=0,Gt=null,at=null,rt=0,Ct=0,Yl=null,gi=!1,Xr=!1,Qd=!1,Oa=0,jn=0,bi=0,lr=0,Kd=0,$l=0,Vr=0,po=null,Ul=null,Zd=!1,Hu=0,dg=0,Bu=1/0,Iu=null,xi=null,Kn=0,yi=null,Qr=null,La=0,Fd=0,Jd=null,hg=null,mo=0,Wd=null;function Xl(){return(jt&2)!==0&&rt!==0?rt&-rt:A.T!==null?sh():Kl()}function pg(){if($l===0)if((rt&536870912)===0||st){var e=H;H<<=1,(H&3932160)===0&&(H=262144),$l=e}else $l=536870912;return e=ql.current,e!==null&&(e.flags|=32),$l}function Hl(e,t,n){(e===Gt&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)&&(Kr(e,0),_i(e,rt,$l,!1)),ul(e,n),((jt&2)===0||e!==Gt)&&(e===Gt&&((jt&2)===0&&(lr|=n),jn===4&&_i(e,rt,$l,!1)),Zs(e))}function mg(e,t,n){if((jt&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||pt(e,t),u=a?S_(e,t):eh(e,t,!0),f=a;do{if(u===0){Xr&&!a&&_i(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!v_(n)){u=eh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;u=po;var R=S.current.memoizedState.isDehydrated;if(R&&(Kr(S,x).flags|=256),x=eh(S,x,!1),x!==2){if(Qd&&!R){S.errorRecoveryDisabledLanes|=f,lr|=f,u=4;break e}f=Ul,Ul=u,f!==null&&(Ul===null?Ul=f:Ul.push.apply(Ul,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){Kr(e,0),_i(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:_i(a,t,$l,!gi);break e;case 2:Ul=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Hu+300-Ke(),10<u)){if(_i(a,t,$l,!gi),Be(a,0,!0)!==0)break e;La=t,a.timeoutHandle=Vg(gg.bind(null,a,n,Ul,Iu,Zd,t,$l,lr,Vr,gi,f,"Throttled",-0,0),u);break e}gg(a,n,Ul,Iu,Zd,t,$l,lr,Vr,gi,f,null,-0,0)}}break}while(!0);Zs(e)}function gg(e,t,n,a,u,f,x,S,R,K,se,oe,F,te){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ht},cg(t,f,oe);var Re=(f&62914560)===f?Hu-Ke():(f&4194048)===f?dg-Ke():0;if(Re=a0(oe,Re),Re!==null){La=f,e.cancelPendingCommit=Re(wg.bind(null,e,t,f,n,a,u,x,S,R,se,oe,null,F,te)),_i(e,f,x,!K);return}}wg(e,t,f,n,a,u,x,S,R)}function v_(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(!_l(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 _i(e,t,n,a){t&=~Kd,t&=~lr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-Et(u),x=1<<f;a[f]=-1,u&=~x}n!==0&&ra(e,n,t)}function qu(){return(jt&6)===0?(go(0),!1):!0}function Pd(){if(at!==null){if(Ct===0)var e=at.return;else e=at,ss=Tn=null,md(e),ka=null,ui=0,e=at;for(;e!==null;)Qm(e.alternate,e),e=e.return;at=null}}function Kr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,q_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),La=0,Pd(),Gt=e,at=n=Ss(e.current,null),rt=t,Ct=0,Yl=null,gi=!1,Xr=pt(e,t),Qd=!1,Vr=$l=Kd=lr=bi=jn=0,Ul=po=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-Et(a),f=1<<u;t|=e[u],a&=~f}return Oa=t,Ar(),n}function bg(e,t){We=null,A.H=ao,t===wa||t===p?(t=Dl(),Ct=3):t===Hr?(t=Dl(),Ct=4):Ct=t===Md?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yl=t,at===null&&(jn=1,Au(e,Ml(t,e.current)))}function xg(){var e=ql.current;return e===null?!0:(rt&4194048)===rt?os===null:(rt&62914560)===rt||(rt&536870912)!==0?e===os:!1}function yg(){var e=A.H;return A.H=ao,e===null?ao:e}function _g(){var e=A.A;return A.A=y_,e}function Gu(){jn=4,gi||(rt&4194048)!==rt&&ql.current!==null||(Xr=!0),(bi&134217727)===0&&(lr&134217727)===0||Gt===null||_i(Gt,rt,$l,!1)}function eh(e,t,n){var a=jt;jt|=2;var u=yg(),f=_g();(Gt!==e||rt!==t)&&(Iu=null,Kr(e,t)),t=!1;var x=jn;e:do try{if(Ct!==0&&at!==null){var S=at,R=Yl;switch(Ct){case 8:Pd(),x=6;break e;case 3:case 2:case 9:case 6:ql.current===null&&(t=!0);var K=Ct;if(Ct=0,Yl=null,Zr(e,S,R,K),n&&Xr){x=0;break e}break;default:K=Ct,Ct=0,Yl=null,Zr(e,S,R,K)}}j_(),x=jn;break}catch(se){bg(e,se)}while(!0);return t&&e.shellSuspendCounter++,ss=Tn=null,jt=a,A.H=u,A.A=f,at===null&&(Gt=null,rt=0,Ar()),x}function j_(){for(;at!==null;)vg(at)}function S_(e,t){var n=jt;jt|=2;var a=yg(),u=_g();Gt!==e||rt!==t?(Iu=null,Bu=Ke()+500,Kr(e,t)):Xr=pt(e,t);e:do try{if(Ct!==0&&at!==null){t=at;var f=Yl;t:switch(Ct){case 1:Ct=0,Yl=null,Zr(e,t,f,1);break;case 2:case 9:if(de(f)){Ct=0,Yl=null,jg(t);break}t=function(){Ct!==2&&Ct!==9||Gt!==e||(Ct=7),Zs(e)},f.then(t,t);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:de(f)?(Ct=0,Yl=null,jg(t)):(Ct=0,Yl=null,Zr(e,t,f,7));break;case 5:var x=null;switch(at.tag){case 26:x=at.memoizedState;case 5:case 27:var S=at;if(x?rb(x):S.stateNode.complete){Ct=0,Yl=null;var R=S.sibling;if(R!==null)at=R;else{var K=S.return;K!==null?(at=K,Yu(K)):at=null}break t}}Ct=0,Yl=null,Zr(e,t,f,5);break;case 6:Ct=0,Yl=null,Zr(e,t,f,6);break;case 8:Pd(),jn=6;break e;default:throw Error(c(462))}}w_();break}catch(se){bg(e,se)}while(!0);return ss=Tn=null,A.H=a,A.A=u,jt=n,at!==null?0:(Gt=null,rt=0,Ar(),jn)}function w_(){for(;at!==null&&!mn();)vg(at)}function vg(e){var t=Xm(e.alternate,e,Oa);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,rt);break;case 11:t=Bm(n,t,t.pendingProps,t.type.render,t.ref,rt);break;case 5:md(t);default:Qm(n,t),t=at=fu(t,Oa),t=Xm(n,t,Oa)}e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function Zr(e,t,n,a){ss=Tn=null,md(t),ka=null,ui=0;var u=t.return;try{if(d_(e,u,t,n,rt)){jn=1,Au(e,Ml(n,e.current)),at=null;return}}catch(f){if(u!==null)throw at=u,f;jn=1,Au(e,Ml(n,e.current)),at=null;return}t.flags&32768?(st||a===1?e=!0:Xr||(rt&536870912)!==0?e=!1:(gi=e=!0,(a===2||a===9||a===3||a===6)&&(a=ql.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,gi);return}e=t.return;var n=m_(t.alternate,t,Oa);if(n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);jn===0&&(jn=5)}function Sg(e,t){do{var n=g_(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);jn=6,at=null}function wg(e,t,n,a,u,f,x,S,R){e.cancelPendingCommit=null;do $u();while(Kn!==0);if((jt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Gc,gl(e,n,f,x,S,R),e===Gt&&(at=Gt=null,rt=0),Qr=t,yi=e,La=n,Fd=f,Jd=u,hg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E_(Je,function(){return Cg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null,u=fe.p,fe.p=2,x=jt,jt|=4;try{b_(e,t,n)}finally{jt=x,fe.p=u,A.T=a}}Kn=1,kg(),Ng(),Tg()}}function kg(){if(Kn===1){Kn=0;var e=yi,t=Qr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var a=fe.p;fe.p=2;var u=jt;jt|=4;try{ag(t,e);var f=dh,x=au(e.containerInfo),S=f.focusedElem,R=f.selectionRange;if(x!==S&&S&&S.ownerDocument&&su(S.ownerDocument.documentElement,S)){if(R!==null&&Oc(S)){var K=R.start,se=R.end;if(se===void 0&&(se=K),"selectionStart"in S)S.selectionStart=K,S.selectionEnd=Math.min(se,S.value.length);else{var oe=S.ownerDocument||document,F=oe&&oe.defaultView||window;if(F.getSelection){var te=F.getSelection(),Re=S.textContent.length,He=Math.min(R.start,Re),Ot=R.end===void 0?He:Math.min(R.end,Re);!te.extend&&He>Ot&&(x=Ot,Ot=He,He=x);var q=lu(S,He),U=lu(S,Ot);if(q&&U&&(te.rangeCount!==1||te.anchorNode!==q.node||te.anchorOffset!==q.offset||te.focusNode!==U.node||te.focusOffset!==U.offset)){var Q=oe.createRange();Q.setStart(q.node,q.offset),te.removeAllRanges(),He>Ot?(te.addRange(Q),te.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),te.addRange(Q))}}}}for(oe=[],te=S;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<oe.length;S++){var re=oe[S];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}nf=!!fh,dh=fh=null}finally{jt=u,fe.p=a,A.T=n}}e.current=t,Kn=2}}function Ng(){if(Kn===2){Kn=0;var e=yi,t=Qr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var a=fe.p;fe.p=2;var u=jt;jt|=4;try{eg(e,t.alternate,t)}finally{jt=u,fe.p=a,A.T=n}}Kn=3}}function Tg(){if(Kn===4||Kn===3){Kn=0,cn();var e=yi,t=Qr,n=La,a=hg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Kn=5:(Kn=0,Qr=yi=null,Eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(xi=null),Dn(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=A.T,u=fe.p,fe.p=2,A.T=null;try{for(var f=e.onRecoverableError,x=0;x<a.length;x++){var S=a[x];f(S.value,{componentStack:S.stack})}}finally{A.T=t,fe.p=u}}(La&3)!==0&&$u(),Zs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Wd?mo++:(mo=0,Wd=e):mo=0,go(0)}}function Eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wi(t)))}function $u(){return kg(),Ng(),Tg(),Cg()}function Cg(){if(Kn!==5)return!1;var e=yi,t=Fd;Fd=0;var n=Dn(La),a=A.T,u=fe.p;try{fe.p=32>n?32:n,A.T=null,n=Jd,Jd=null;var f=yi,x=La;if(Kn=0,Qr=yi=null,La=0,(jt&6)!==0)throw Error(c(331));var S=jt;if(jt|=4,ug(f.current),rg(f,f.current,x,n),jt=S,go(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Xt,f)}catch{}return!0}finally{fe.p=u,A.T=a,Eg(e,t)}}function Ag(e,t,n){t=Ml(n,t),t=Ad(e.stateNode,t,2),e=di(e,t,2),e!==null&&(ul(e,2),Zs(e))}function At(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"&&(xi===null||!xi.has(a))){e=Ml(n,e),n=Mm(2),a=di(t,n,2),a!==null&&(Rm(n,a,t,e),ul(a,2),Zs(a));break}}t=t.return}}function th(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new __;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=k_.bind(null,e,t,n),t.then(e,e))}function k_(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gt===e&&(rt&n)===n&&(jn===4||jn===3&&(rt&62914560)===rt&&300>Ke()-Hu?(jt&2)===0&&Kr(e,0):Kd|=n,Vr===rt&&(Vr=0)),Zs(e)}function Mg(e,t){t===0&&(t=bn()),e=xa(e,t),e!==null&&(ul(e,t),Zs(e))}function N_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mg(e,n)}function T_(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 E_(e,t){return pn(e,t)}var Xu=null,Fr=null,nh=!1,Vu=!1,lh=!1,vi=0;function Zs(e){e!==Fr&&e.next===null&&(Fr===null?Xu=Fr=e:Fr=Fr.next=e),Vu=!0,nh||(nh=!0,A_())}function go(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 x=a.suspendedLanes,S=a.pingedLanes;f=(1<<31-Et(42|e)+1)-1,f&=u&~(x&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Lg(a,f))}else f=rt,f=Be(a,a===Gt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||pt(a,f)||(n=!0,Lg(a,f));a=a.next}while(n);lh=!1}}function C_(){Rg()}function Rg(){Vu=nh=!1;var e=0;vi!==0&&I_()&&(e=vi);for(var t=Ke(),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&&(Fr=n)):(n=a,(e!==0||(f&3)!==0)&&(Vu=!0)),a=u}Kn!==0&&Kn!==5||go(e),vi!==0&&(vi=0)}function Dg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Et(f),S=1<<x,R=u[x];R===-1?((S&n)===0||(S&a)!==0)&&(u[x]=Mn(S,t)):R<=t&&(e.expiredLanes|=S),f&=~S}if(t=Gt,n=rt,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Sn(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||pt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Sn(a),Dn(n)){case 2:case 8:n=ut;break;case 32:n=Je;break;case 268435456:n=on;break;default:n=Je}return a=Og.bind(null,e),n=pn(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Sn(a),e.callbackPriority=2,e.callbackNode=null,2}function Og(e,t){if(Kn!==0&&Kn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var a=rt;return a=Be(e,e===Gt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(mg(e,a,t),Dg(e,Ke()),e.callbackNode!=null&&e.callbackNode===n?Og.bind(null,e):null)}function Lg(e,t){if($u())return null;mg(e,t,!0)}function A_(){G_(function(){(jt&6)!==0?pn(gn,C_):Rg()})}function sh(){if(vi===0){var e=ja;e===0&&(e=Le,Le<<=1,(Le&261888)===0&&(Le=256)),vi=e}return vi}function zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Mt(""+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 M_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=zg((u[$e]||null).action),x=a.submitter;x&&(t=(t=x[$e]||null)?zg(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var S=new zs("action","action",null,a,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(vi!==0){var R=x?Ug(u,x):new FormData(u);wd(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(S.preventDefault(),R=x?Ug(u,x):new FormData(u),wd(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var ah=0;ah<qc.length;ah++){var ih=qc[ah],R_=ih.toLowerCase(),D_=ih[0].toUpperCase()+ih.slice(1);Cl(R_,"on"+D_)}Cl(cu,"onAnimationEnd"),Cl(Uc,"onAnimationIteration"),Cl(Hc,"onAnimationStart"),Cl("dblclick","onDoubleClick"),Cl("focusin","onFocus"),Cl("focusout","onBlur"),Cl(ou,"onTransitionRun"),Cl(uu,"onTransitionStart"),Cl(ed,"onTransitionCancel"),Cl(Bc,"onTransitionEnd"),Nn("onMouseEnter",["mouseout","mouseover"]),Nn("onMouseLeave",["mouseout","mouseover"]),Nn("onPointerEnter",["pointerout","pointerover"]),Nn("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),O_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bo));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 x=a.length-1;0<=x;x--){var S=a[x],R=S.instance,K=S.currentTarget;if(S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=K;try{f(u)}catch(se){Ja(se)}u.currentTarget=null,f=R}else for(x=0;x<a.length;x++){if(S=a[x],R=S.instance,K=S.currentTarget,S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=K;try{f(u)}catch(se){Ja(se)}u.currentTarget=null,f=R}}}}function it(e,t){var n=t[xl];n===void 0&&(n=t[xl]=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,On.forEach(function(n){n!=="selectionchange"&&(O_.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(pb(t)){case 2:var u=c0;break;case 8:u=o0;break;default:u=Sh}n=u.bind(null,t,n,e),u=void 0,!ys||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 x=a.tag;if(x===3||x===4){var S=a.stateNode.containerInfo;if(S===u)break;if(x===4)for(x=a.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;S!==null;){if(x=Tl(S),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){a=f=x;continue e}S=S.parentNode}}a=a.return}Me(function(){var K=f,se=It(n),oe=[];e:{var F=Ic.get(e);if(F!==void 0){var te=zs,Re=e;switch(e){case"keypress":if(Ii(n)===0)break e;case"keydown":case"keyup":te=Cc;break;case"focusin":Re="focus",te=Ec;break;case"focusout":Re="blur",te=Ec;break;case"beforeblur":case"afterblur":te=Ec;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":te=$a;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Sr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Tr;break;case cu:case Uc:case Hc:te=wr;break;case Bc:te=$i;break;case"scroll":case"scrollend":te=jr;break;case"wheel":te=Zo;break;case"copy":case"cut":case"paste":te=kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Qo;break;case"toggle":case"beforetoggle":te=Fo}var He=(t&4)!==0,Ot=!He&&(e==="scroll"||e==="scrollend"),q=He?F!==null?F+"Capture":null:F;He=[];for(var U=K,Q;U!==null;){var re=U;if(Q=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Q===null||q===null||(re=Fe(U,q),re!=null&&He.push(xo(U,re,Q))),Ot)break;U=U.return}0<He.length&&(F=new te(F,Re,null,n,se),oe.push({event:F,listeners:He}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",F&&n!==fn&&(Re=n.relatedTarget||n.fromElement)&&(Tl(Re)||Re[_t]))break e;if((te||F)&&(F=se.window===se?se:(F=se.ownerDocument)?F.defaultView||F.parentWindow:window,te?(Re=n.relatedTarget||n.toElement,te=K,Re=Re?Tl(Re):null,Re!==null&&(Ot=d(Re),He=Re.tag,Re!==Ot||He!==5&&He!==27&&He!==6)&&(Re=null)):(te=null,Re=K),te!==Re)){if(He=$a,re="onMouseLeave",q="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(He=Qo,re="onPointerLeave",q="onPointerEnter",U="pointer"),Ot=te==null?F:kn(te),Q=Re==null?F:kn(Re),F=new He(re,U+"leave",te,n,se),F.target=Ot,F.relatedTarget=Q,re=null,Tl(se)===K&&(He=new He(q,U+"enter",Re,n,se),He.target=Q,He.relatedTarget=Ot,re=He),Ot=re,te&&Re)t:{for(He=L_,q=te,U=Re,Q=0,re=q;re;re=He(re))Q++;re=0;for(var Ue=U;Ue;Ue=He(Ue))re++;for(;0<Q-re;)q=He(q),Q--;for(;0<re-Q;)U=He(U),re--;for(;Q--;){if(q===U||U!==null&&q===U.alternate){He=q;break t}q=He(q),U=He(U)}He=null}else He=null;te!==null&&Ig(oe,F,te,He,!1),Re!==null&&Ot!==null&&Ig(oe,Ot,Re,He,!0)}}e:{if(F=K?kn(K):window,te=F.nodeName&&F.nodeName.toLowerCase(),te==="select"||te==="input"&&F.type==="file")var xt=eu;else if(Ka(F))if(X)xt=Jf;else{xt=Zf;var Oe=Za}else te=F.nodeName,!te||te.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?K&&ze(K.elementType)&&(xt=eu):xt=Ff;if(xt&&(xt=xt(e,K))){Po(oe,xt,n,se);break e}Oe&&Oe(e,F,K),e==="focusout"&&K&&F.type==="number"&&K.memoizedProps.value!=null&&sn(F,"number",F.value)}switch(Oe=K?kn(K):window,e){case"focusin":(Ka(Oe)||Oe.contentEditable==="true")&&(Fa=Oe,Lc=K,Zi=null);break;case"focusout":Zi=Lc=Fa=null;break;case"mousedown":Fi=!0;break;case"contextmenu":case"mouseup":case"dragend":Fi=!1,iu(oe,n,se);break;case"selectionchange":if(Pf)break;case"keydown":case"keyup":iu(oe,n,se)}var Pe;if(Il)e:{switch(e){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else js?Ac(e,n)&&(ct="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ct="onCompositionStart");ct&&(Vi&&n.locale!=="ko"&&(js||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&js&&(Pe=vr()):(Ls=se,Bi="value"in Ls?Ls.value:Ls.textContent,js=!0)),Oe=Ku(K,ct),0<Oe.length&&(ct=new Gi(ct,e,null,n,se),oe.push({event:ct,listeners:Oe}),Pe?ct.data=Pe:(Pe=Qa(n),Pe!==null&&(ct.data=Pe)))),(Pe=Er?Qi(e,n):Ki(e,n))&&(ct=Ku(K,"onBeforeInput"),0<ct.length&&(Oe=new Gi("onBeforeInput","beforeinput",null,n,se),oe.push({event:Oe,listeners:ct}),Oe.data=Pe)),M_(oe,e,K,n,se)}Hg(oe,t)})}function xo(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=Fe(e,n),u!=null&&a.unshift(xo(e,u,f)),u=Fe(e,t),u!=null&&a.push(xo(e,u,f))),e.tag===3)return a;e=e.return}return[]}function L_(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,x=[];n!==null&&n!==a;){var S=n,R=S.alternate,K=S.stateNode;if(S=S.tag,R!==null&&R===a)break;S!==5&&S!==26&&S!==27||K===null||(R=K,u?(K=Fe(n,f),K!=null&&x.unshift(xo(n,K,R))):u||(K=Fe(n,f),K!=null&&x.push(xo(n,K,R)))),n=n.return}x.length!==0&&e.push({event:t,listeners:x})}var z_=/\r\n?/g,U_=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(z_,`
50
+ `).replace(U_,"")}function Gg(e,t){return t=qg(t),qg(e)===t}function Dt(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Y(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Y(e,""+a);break;case"className":nl(e,"class",a);break;case"tabIndex":nl(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":nl(e,n,a);break;case"style":ve(e,a,f);break;case"data":if(t!=="object"){nl(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=Mt(""+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"&&Dt(e,t,"name",u.name,u,null),Dt(e,t,"formEncType",u.formEncType,u,null),Dt(e,t,"formMethod",u.formMethod,u,null),Dt(e,t,"formTarget",u.formTarget,u,null)):(Dt(e,t,"encType",u.encType,u,null),Dt(e,t,"method",u.method,u,null),Dt(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Mt(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ht);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=Mt(""+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),fl(e,"popover",a);break;case"xlinkActuate":Ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ln(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ln(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ln(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ln(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":fl(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=ot.get(n)||n,fl(e,n,a))}}function uh(e,t,n,a,u,f){switch(n){case"style":ve(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"?Y(e,a):(typeof a=="number"||typeof a=="bigint")&&Y(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=ht);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!El.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[$e]||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,""):fl(e,n,a)}}}function rl(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 x=n[f];if(x!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Dt(e,t,f,x,n,null)}}u&&Dt(e,t,"srcSet",n.srcSet,n,null),a&&Dt(e,t,"src",n.src,n,null);return;case"input":it("invalid",e);var S=f=x=u=null,R=null,K=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":x=se;break;case"checked":R=se;break;case"defaultChecked":K=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:Dt(e,t,a,se,n,null)}}Jl(e,f,S,R,K,x,u,!1);return;case"select":it("invalid",e),a=x=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":x=S;break;case"multiple":a=S;default:Dt(e,t,u,S,n,null)}t=f,n=x,e.multiple=!!a,t!=null?Bt(e,!!a,t,!1):n!=null&&Bt(e,!!a,n,!0);return;case"textarea":it("invalid",e),f=u=a=null;for(x in n)if(n.hasOwnProperty(x)&&(S=n[x],S!=null))switch(x){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:Dt(e,t,x,S,n,null)}N(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:Dt(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<bo.length;a++)it(bo[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(K in n)if(n.hasOwnProperty(K)&&(a=n[K],a!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Dt(e,t,K,a,n,null)}return;default:if(ze(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&&Dt(e,t,S,a,n,null))}function H_(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,x=null,S=null,R=null,K=null,se=null;for(te in n){var oe=n[te];if(n.hasOwnProperty(te)&&oe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":R=oe;default:a.hasOwnProperty(te)||Dt(e,t,te,null,a,oe)}}for(var F in a){var te=a[F];if(oe=n[F],a.hasOwnProperty(F)&&(te!=null||oe!=null))switch(F){case"type":f=te;break;case"name":u=te;break;case"checked":K=te;break;case"defaultChecked":se=te;break;case"value":x=te;break;case"defaultValue":S=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(c(137,t));break;default:te!==oe&&Dt(e,t,F,te,a,oe)}}bs(e,x,S,R,K,se,f,u);return;case"select":te=x=S=F=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":te=R;default:a.hasOwnProperty(f)||Dt(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":F=f;break;case"defaultValue":S=f;break;case"multiple":x=f;default:f!==R&&Dt(e,t,u,f,a,R)}t=S,n=x,a=te,F!=null?Bt(e,!!n,F,!1):!!a!=!!n&&(t!=null?Bt(e,!!n,t,!0):Bt(e,!!n,n?[]:"",!1));return;case"textarea":te=F=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:Dt(e,t,S,null,a,u)}for(x in a)if(u=a[x],f=n[x],a.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":F=u;break;case"defaultValue":te=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Dt(e,t,x,u,a,f)}me(e,F,te);return;case"option":for(var Re in n)if(F=n[Re],n.hasOwnProperty(Re)&&F!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Dt(e,t,Re,null,a,F)}for(R in a)if(F=a[R],te=n[R],a.hasOwnProperty(R)&&F!==te&&(F!=null||te!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Dt(e,t,R,F,a,te)}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 He in n)F=n[He],n.hasOwnProperty(He)&&F!=null&&!a.hasOwnProperty(He)&&Dt(e,t,He,null,a,F);for(K in a)if(F=a[K],te=n[K],a.hasOwnProperty(K)&&F!==te&&(F!=null||te!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(c(137,t));break;default:Dt(e,t,K,F,a,te)}return;default:if(ze(t)){for(var Ot in n)F=n[Ot],n.hasOwnProperty(Ot)&&F!==void 0&&!a.hasOwnProperty(Ot)&&uh(e,t,Ot,void 0,a,F);for(se in a)F=a[se],te=n[se],!a.hasOwnProperty(se)||F===te||F===void 0&&te===void 0||uh(e,t,se,F,a,te);return}}for(var q in n)F=n[q],n.hasOwnProperty(q)&&F!=null&&!a.hasOwnProperty(q)&&Dt(e,t,q,null,a,F);for(oe in a)F=a[oe],te=n[oe],!a.hasOwnProperty(oe)||F===te||F==null&&te==null||Dt(e,t,oe,F,a,te)}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 B_(){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,x=u.initiatorType,S=u.duration;if(f&&S&&Yg(x)){for(x=0,S=u.responseEnd,a+=1;a<n.length;a++){var R=n[a],K=R.startTime;if(K>S)break;var se=R.transferSize,oe=R.initiatorType;se&&Yg(oe)&&(R=R.responseEnd,x+=se*(R<S?1:(S-K)/(R-K)))}if(--a,t+=8*(f+x)/(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 I_(){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,q_=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,G_=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 ji(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),ec(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")yo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,yo(n);for(var f=n.firstChild;f;){var x=f.nextSibling,S=f.nodeName;f[el]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=x}}else n==="body"&&yo(e.ownerDocument.body);n=u}while(n);ec(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),kt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function $_(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[el])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 X_(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 bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function V_(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 xh=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 yo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var fs=new Map,eb=new Set;function Fu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var za=fe.d;fe.d={f:Q_,r:K_,D:Z_,C:F_,L:J_,m:W_,X:e0,S:P_,M:t0};function Q_(){var e=za.f(),t=qu();return e||t}function K_(e){var t=ln(e);t!==null&&t.tag===5&&t.type==="form"?bm(t):za.r(e)}var Jr=typeof document>"u"?null:document;function tb(e,t,n){var a=Jr;if(a&&typeof t=="string"&&t){var u=zn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),eb.has(u)||(eb.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),rl(t,"link",e),Ze(t),a.head.appendChild(t)))}}function Z_(e){za.D(e),tb("dns-prefetch",e,null)}function F_(e,t){za.C(e,t),tb("preconnect",e,t)}function J_(e,t,n){za.L(e,t,n);var a=Jr;if(a&&e&&t){var u='link[rel="preload"][as="'+zn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+zn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+zn(n.imageSizes)+'"]')):u+='[href="'+zn(e)+'"]';var f=u;switch(t){case"style":f=Wr(e);break;case"script":f=Pr(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(_o(f))||t==="script"&&a.querySelector(vo(f))||(t=a.createElement("link"),rl(t,"link",e),Ze(t),a.head.appendChild(t)))}}function W_(e,t){za.m(e,t);var n=Jr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+zn(a)+'"][href="'+zn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Pr(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(vo(f)))return}a=n.createElement("link"),rl(a,"link",e),Ze(a),n.head.appendChild(a)}}}function P_(e,t,n){za.S(e,t,n);var a=Jr;if(a&&e){var u=mt(a).hoistableStyles,f=Wr(e);t=t||"default";var x=u.get(f);if(!x){var S={loading:0,preload:null};if(x=a.querySelector(_o(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=fs.get(f))&&yh(e,n);var R=x=a.createElement("link");Ze(R),rl(R,"link",e),R._p=new Promise(function(K,se){R.onload=K,R.onerror=se}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ju(x,t,a)}x={type:"stylesheet",instance:x,count:1,state:S},u.set(f,x)}}}function e0(e,t){za.X(e,t);var n=Jr;if(n&&e){var a=mt(n).hoistableScripts,u=Pr(e),f=a.get(u);f||(f=n.querySelector(vo(u)),f||(e=j({src:e,async:!0},t),(t=fs.get(u))&&_h(e,t),f=n.createElement("script"),Ze(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function t0(e,t){za.M(e,t);var n=Jr;if(n&&e){var a=mt(n).hoistableScripts,u=Pr(e),f=a.get(u);f||(f=n.querySelector(vo(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=fs.get(u))&&_h(e,t),f=n.createElement("script"),Ze(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function nb(e,t,n,a){var u=(u=Se.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=Wr(n.href),n=mt(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=Wr(n.href);var f=mt(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(_o(e)))&&!f._p&&(x.instance=f,x.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||n0(u,e,n,x.state))),t&&a===null)throw Error(c(528,""));return x}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=Pr(n),n=mt(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 Wr(e){return'href="'+zn(e)+'"'}function _o(e){return'link[rel="stylesheet"]['+e+"]"}function lb(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function n0(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}),rl(t,"link",n),Ze(t),e.head.appendChild(t))}function Pr(e){return'[src="'+zn(e)+'"]'}function vo(e){return"script[async]"+e}function sb(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+zn(n.href)+'"]');if(a)return t.instance=a,Ze(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"),Ze(a),rl(a,"style",u),Ju(a,n.precedence,e),t.instance=a;case"stylesheet":u=Wr(n.href);var f=e.querySelector(_o(u));if(f)return t.state.loading|=4,t.instance=f,Ze(f),f;a=lb(n),(u=fs.get(u))&&yh(a,u),f=(e.ownerDocument||e).createElement("link"),Ze(f);var x=f;return x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),rl(f,"link",a),t.state.loading|=4,Ju(f,n.precedence,e),t.instance=f;case"script":return f=Pr(n.src),(u=e.querySelector(vo(f)))?(t.instance=u,Ze(u),u):(a=n,(u=fs.get(f))&&(a=j({},n),_h(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ze(u),rl(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,x=0;x<a.length;x++){var S=a[x];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 yh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _h(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 ab(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[el]||f[Vt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var S=a.get(x);S?S.push(f):a.set(x,[f])}}return a}function ib(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function l0(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 rb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function s0(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=Wr(a.href),f=t.querySelector(_o(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,Ze(f);return}f=t.ownerDocument||t,a=lb(a),(u=fs.get(u))&&yh(a,u),f=f.createElement("link"),Ze(f);var x=f;x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),rl(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 a0(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*B_());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(i0,e),ef=null,Pu.call(e))}function i0(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 x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(n.set(x.dataset.precedence,x),a=x)}a&&n.set(null,a)}u=t.instance,x=u.getAttribute("data-precedence"),f=n.get(x)||a,f===a&&n.set(null,u),n.set(x,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 jo={$$typeof:G,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function r0(e,t,n,a,u,f,x,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=Rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rn(0),this.hiddenUpdates=Rn(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function cb(e,t,n,a,u,f,x,S,R,K,se,oe){return e=new r0(e,t,n,x,R,K,se,oe,S),t=1,f===!0&&(t|=24),f=vl(3,null,null,t),e.current=f,f.stateNode=e,t=zr(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},sd(f),e}function ob(e){return e?(e=Pa,e):Pa}function ub(e,t,n,a,u,f){u=ob(u),a.context===null?a.context=u:a.pendingContext=u,a=fi(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=di(e,a,t),n!==null&&(Hl(n,e,t),Pc(n,e,t))}function fb(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){fb(e,t),(e=e.alternate)&&fb(e,t)}function db(e){if(e.tag===13||e.tag===31){var t=xa(e,67108864);t!==null&&Hl(t,e,67108864),jh(e,67108864)}}function hb(e){if(e.tag===13||e.tag===31){var t=Xl();t=Rs(t);var n=xa(e,t);n!==null&&Hl(n,e,t),jh(e,t)}}var nf=!0;function c0(e,t,n,a){var u=A.T;A.T=null;var f=fe.p;try{fe.p=2,Sh(e,t,n,a)}finally{fe.p=f,A.T=u}}function o0(e,t,n,a){var u=A.T;A.T=null;var f=fe.p;try{fe.p=8,Sh(e,t,n,a)}finally{fe.p=f,A.T=u}}function Sh(e,t,n,a){if(nf){var u=wh(a);if(u===null)oh(e,t,a,lf,n),mb(e,a);else if(f0(u,e,t,n,a))a.stopPropagation();else if(mb(e,a),t&4&&-1<u0.indexOf(e)){for(;u!==null;){var f=ln(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=xe(f.pendingLanes);if(x!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var R=1<<31-Et(x);S.entanglements[1]|=R,x&=~R}Zs(f),(jt&6)===0&&(Bu=Ke()+500,go(0))}}break;case 31:case 13:S=xa(f,2),S!==null&&Hl(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=It(e),kh(e)}var lf=null;function kh(e){if(lf=null,e=Tl(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 pb(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(zt()){case gn:return 2;case ut:return 8;case Je:case An:return 32;case on:return 268435456;default:return 32}default:return 32}}var Nh=!1,Si=null,wi=null,ki=null,So=new Map,wo=new Map,Ni=[],u0="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 mb(e,t){switch(e){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":So.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wo.delete(t.pointerId)}}function ko(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=ln(t),t!==null&&db(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function f0(e,t,n,a,u){switch(t){case"focusin":return Si=ko(Si,e,t,n,a,u),!0;case"dragenter":return wi=ko(wi,e,t,n,a,u),!0;case"mouseover":return ki=ko(ki,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return So.set(f,ko(So.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,wo.set(f,ko(wo.get(f)||null,e,t,n,a,u)),!0}return!1}function gb(e){var t=Tl(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,bl(e.priority,function(){hb(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,bl(e.priority,function(){hb(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);fn=a,n.target.dispatchEvent(a),fn=null}else return t=ln(n),t!==null&&db(t),e.blockedOn=n,!1;t.shift()}return!0}function bb(e,t,n){sf(e)&&n.delete(t)}function d0(){Nh=!1,Si!==null&&sf(Si)&&(Si=null),wi!==null&&sf(wi)&&(wi=null),ki!==null&&sf(ki)&&(ki=null),So.forEach(bb),wo.forEach(bb)}function af(e,t){e.blockedOn===t&&(e.blockedOn=null,Nh||(Nh=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,d0)))}var rf=null;function xb(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=ln(n);f!==null&&(e.splice(t,3),t-=3,wd(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function ec(e){function t(R){return af(R,e)}Si!==null&&af(Si,e),wi!==null&&af(wi,e),ki!==null&&af(ki,e),So.forEach(t),wo.forEach(t);for(var n=0;n<Ni.length;n++){var a=Ni[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ni.length&&(n=Ni[0],n.blockedOn===null);)gb(n),n.blockedOn===null&&Ni.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],x=u[$e]||null;if(typeof f=="function")x||xb(n);else if(x){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[$e]||null)S=x.formAction;else if(kh(u)!==null)continue}else S=x.action;typeof S=="function"?n[a+1]=S:(n.splice(a,3),a-=3),xb(n)}}}function yb(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},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=Xl();ub(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;ub(e.current,2,null,e,null,null),qu(),t[_t]=null}};function cf(e){this._internalRoot=e}cf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ni.length&&t!==0&&t<Ni[n].priority;n++);Ni.splice(n,0,e),n===0&&gb(e)}};var _b=s.version;if(_b!=="19.2.8")throw Error(c(527,_b,"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=b(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var h0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!of.isDisabled&&of.supportsFiber)try{Xt=of.inject(h0),wt=of}catch{}}return To.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Tm,f=Em,x=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&&(x=t.onRecoverableError)),t=cb(e,1,!1,null,null,n,a,null,u,f,x,yb),e[_t]=t.current,ch(e),new Th(t)},To.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Tm,x=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&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=cb(e,1,!0,t,n??null,a,u,R,f,x,S,yb),t.context=ob(null),n=t.current,a=Xl(),a=Rs(a),u=fi(a),u.callback=null,di(n,u,a),n=a,t.current.lanes=n,ul(t,n),Zs(t),e[_t]=t.current,ch(e),new cf(t)},To.version="19.2.8",To}var Mb;function k0(){if(Mb)return Mh.exports;Mb=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=w0(),Mh.exports}var N0=k0();const ty=1;var Ba,pc,mc,gc,bc,Yo,xc,Yf,ny;class T0{constructor(s){hn(this,Yf);hn(this,Ba,null);hn(this,pc,new Set);hn(this,mc,500);hn(this,gc,null);hn(this,bc,!1);hn(this,Yo,null);hn(this,xc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){St(this,xc,s)}connect(){if(Ge(this,bc))return;const s=new WebSocket(this.url);St(this,Ba,s),s.addEventListener("open",()=>{var r,c;St(this,mc,500),this.send({type:"hello",protocol:ty,clientName:"ccv-web"}),(r=Ge(this,Yo))==null||r.call(this),(c=Ge(this,xc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ge(this,pc))o(c)}),s.addEventListener("close",()=>{var r;St(this,Ba,null),(r=Ge(this,xc))==null||r.call(this),qn(this,Yf,ny).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){St(this,Yo,s)}on(s){return Ge(this,pc).add(s),()=>Ge(this,pc).delete(s)}send(s){var r;((r=Ge(this,Ba))==null?void 0:r.readyState)===WebSocket.OPEN&&Ge(this,Ba).send(JSON.stringify(s))}get connected(){var s;return((s=Ge(this,Ba))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;St(this,bc,!0),(s=Ge(this,Ba))==null||s.close()}}Ba=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,bc=new WeakMap,Yo=new WeakMap,xc=new WeakMap,Yf=new WeakSet,ny=function(){if(Ge(this,bc)||Ge(this,gc)!==null)return;const s=Ge(this,mc);St(this,mc,Math.min(s*2,1e4)),St(this,gc,window.setTimeout(()=>{St(this,gc,null),this.connect()},s))};const E0=1,ly="ccv:relay",Af="ccv:relay.host";function C0(){try{const l=localStorage.getItem(ly);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 sy(){localStorage.removeItem(ly)}var la,yc,sa,_c,vc,Li,ur,fr,zi,dr,jc,hr,pr,Wt,Ai,tp,ay,rr,np;class A0{constructor(s){hn(this,Wt);hn(this,la,null);hn(this,yc,new Set);hn(this,sa,null);hn(this,_c,null);hn(this,vc,500);hn(this,Li,null);hn(this,ur,!1);hn(this,fr,!1);hn(this,zi,!1);hn(this,dr,null);hn(this,jc,"Подключаемся…");hn(this,hr,0);hn(this,pr,[]);this.session=s}get connected(){return Ge(this,fr)&&Ge(this,zi)}get statusText(){return Ge(this,jc)}get hostId(){return Ge(this,dr)}on(s){return Ge(this,yc).add(s),()=>Ge(this,yc).delete(s)}onReconnect(s){St(this,_c,s)}onStatus(s){St(this,sa,s)}connect(){Ge(this,ur)||qn(this,Wt,tp).call(this)}send(s){if(!Ge(this,fr)){Ge(this,pr).length<64&&Ge(this,pr).push(s);return}qn(this,Wt,rr).call(this,{t:"client.frame",body:s})}close(){var s;St(this,ur,!0),Ge(this,Li)!==null&&window.clearTimeout(Ge(this,Li)),(s=Ge(this,la))==null||s.close()}}la=new WeakMap,yc=new WeakMap,sa=new WeakMap,_c=new WeakMap,vc=new WeakMap,Li=new WeakMap,ur=new WeakMap,fr=new WeakMap,zi=new WeakMap,dr=new WeakMap,jc=new WeakMap,hr=new WeakMap,pr=new WeakMap,Wt=new WeakSet,Ai=function(s){var r;Ge(this,jc)!==s&&(St(this,jc,s),(r=Ge(this,sa))==null||r.call(this))},tp=async function(){if(Ge(this,la))return;if(!Ge(this,dr))try{St(this,dr,await M0(this.session.token))}catch(c){qn(this,Wt,Ai).call(this,c instanceof Error?c.message:String(c)),qn(this,Wt,np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);St(this,la,r),r.addEventListener("open",()=>{qn(this,Wt,rr).call(this,{t:"client.hello",protocol:E0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}qn(this,Wt,ay).call(this,o)}),r.addEventListener("close",()=>{var c;St(this,la,null),St(this,fr,!1),St(this,zi,!1),qn(this,Wt,Ai).call(this,"Нет связи с сервером"),(c=Ge(this,sa))==null||c.call(this),qn(this,Wt,np).call(this)}),r.addEventListener("error",()=>r.close())},ay=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":St(this,vc,500),qn(this,Wt,rr).call(this,{t:"client.attach",hostId:Ge(this,dr)??"",...Ge(this,hr)>0?{sinceRseq:Ge(this,hr)}:{}});return;case"client.attached":St(this,fr,!0),St(this,zi,s.online),St(this,hr,s.rseq),qn(this,Wt,Ai).call(this,s.online?"Хост на связи":"Компьютер не на связи"),qn(this,Wt,rr).call(this,{t:"client.frame",body:{type:"hello",protocol:ty,clientName:"ccv-web-relay"}});const b=Ge(this,pr);St(this,pr,[]);for(const _ of b)qn(this,Wt,rr).call(this,{t:"client.frame",body:_});(r=Ge(this,_c))==null||r.call(this),(c=Ge(this,sa))==null||c.call(this);return;case"host.frame":{s.rseq>0&&St(this,hr,s.rseq);const _=s.body;for(const j of Ge(this,yc))j(_);return}case"host.online":St(this,zi,!0),qn(this,Wt,Ai).call(this,"Хост на связи"),(o=Ge(this,_c))==null||o.call(this),(d=Ge(this,sa))==null||d.call(this);return;case"host.offline":St(this,zi,!1),qn(this,Wt,Ai).call(this,"Компьютер не на связи"),(h=Ge(this,sa))==null||h.call(this);return;case"ping":qn(this,Wt,rr).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){sy(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Af),qn(this,Wt,Ai).call(this,"Этот компьютер отвязан от аккаунта"),St(this,ur,!0),(m=Ge(this,la))==null||m.close();return}s.code!=="offline"&&qn(this,Wt,Ai).call(this,s.message),(g=Ge(this,sa))==null||g.call(this);return}},rr=function(s){var r;((r=Ge(this,la))==null?void 0:r.readyState)===WebSocket.OPEN&&Ge(this,la).send(JSON.stringify(s))},np=function(){if(Ge(this,ur)||Ge(this,Li)!==null)return;const s=Ge(this,vc);St(this,vc,Math.min(s*2,1e4)),St(this,Li,window.setTimeout(()=>{St(this,Li,null),qn(this,Wt,tp).call(this)},s))};async function M0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Af,s),s;const r=localStorage.getItem(Af);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw sy(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Af,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Mf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const R0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function D0(){if(Mf()==="local")return new T0(R0);const l=C0();return l?new A0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const iy="ccv:drafts",O0=40,L0=2e4,z0=500;let Ho=null,Bo=null;function bp(){if(Ho)return Ho;const l=new Map;try{const s=localStorage.getItem(iy);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 Ho=l,window.addEventListener("pagehide",oy),l}function Lh(l){return bp().get(l)??""}function ry(l,s){const r=bp(),c=s.slice(0,L0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>O0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}B0(),H0()}function cy(){const l=new Set;for(const s of bp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const lp=new Set;let Rb="";function U0(l){return lp.add(l),()=>lp.delete(l)}function H0(){const l=cy(),s=l.join(`
51
+ `);if(s!==Rb){Rb=s;for(const r of lp)r(l)}}function B0(){Bo===null&&(Bo=window.setTimeout(oy,z0))}function oy(){if(Bo!==null&&window.clearTimeout(Bo),Bo=null,!!Ho)try{localStorage.setItem(iy,JSON.stringify(Object.fromEntries(Ho)))}catch{}}const wl={items:[],pending:[],lastSeq:0,contextTokens:null},zh={entries:[],total:0,loading:!1};function uy(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Db(l){return l.total>0&&uy(l)>1}function I0(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 q0(l){return Rf(wl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Rf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...G0(r,c.event,c.seq),lastSeq:c.seq});return r}function G0(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return Fs(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 Fs(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return tc(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?Fs(l,m):tc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Fs(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return tc(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?Fs(l,m):tc(l,h,m)}case"tool.use":return Fs(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 tc(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(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(g!==-1){const b=c[g];return tc({...l,pending:m},g,{...b,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:Fs({...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 Fs({...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:Fs(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Fs(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Y0(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 $0(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 Fs(l,s){return{...l,items:[...l.items,s]}}function tc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const sp="ccv:theme",Uh=["system","light","dark"];function X0(){const[l,s]=y.useState(V0);y.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=y.useCallback(o=>{try{localStorage.setItem(sp,o)}catch{}s(o)},[]),c=y.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 V0(){try{const l=localStorage.getItem(sp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const fy=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Q0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],mr={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:"вопроса"}},K0=320,dy="ccv:panes";function Z0(l){return`--${l}-w`}function hy(l,s){const r=mr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function F0(){const l={};for(const s of Object.keys(mr))l[s]=mr[s].width;try{const s=localStorage.getItem(dy);if(s){const r=JSON.parse(s);for(const c of Object.keys(mr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=hy(c,o))}}}catch{}return l}function J0(){const[l,s]=y.useState(F0),r=y.useCallback(h=>{try{localStorage.setItem(dy,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,m)=>{s(g=>{const b=hy(h,m);if(g[h]===b)return g;const _={...g,[h]:b};return r(_),_})},[r]),o=y.useCallback(h=>{s(m=>{const g={...m,[h]:mr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(mr))d[Z0(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Hh=260,py=120,W0=200,Ob="ccv:terminal-h";function Lb(l,s){return Math.round(Math.min(s,Math.max(py,l)))}function P0(){const[l,s]=y.useState(()=>{try{const d=localStorage.getItem(Ob);if(d){const h=Number(d);if(Number.isFinite(h))return Lb(h,1/0)}}catch{}return Hh}),r=y.useCallback(d=>{try{localStorage.setItem(Ob,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const m=Lb(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=y.useCallback(()=>{s(Hh),r(Hh)},[r]);return{height:l,setHeight:c,reset:o}}function $f(l){const[s,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return y.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const ev=500,tv=6;function my({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=ev,moveCancelPx:o=tv}){const d=y.useRef(null),[h,m]=y.useState(!1),g=y.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=y.useCallback(E=>{if(r||E.button!==0)return;const L={timer:0,x:E.clientX,y:E.clientY,fired:!1};L.timer=window.setTimeout(()=>{L.fired=!0,m(!1),l()},c),d.current=L,m(!0)},[r,c,l]),_=y.useCallback(E=>{const L=d.current;!L||L.fired||Math.hypot(E.clientX-L.x,E.clientY-L.y)>o&&g()},[o,g]),j=y.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=y.useCallback(E=>{var L;if((L=d.current)!=null&&L.fired){d.current=null,E.preventDefault();return}if(!r){if(E.shiftKey){l();return}s()}},[r,s,l]),C=y.useCallback(E=>{E.preventDefault()},[]),T=y.useCallback(E=>{r||E.shiftKey&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:_,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:C,onKeyDown:T}}}const nv={height:0,offsetTop:0,offsetLeft:0};function zb(){if(typeof window>"u")return nv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function lv(l){const[s,r]=y.useState(zb);return y.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=zb();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 xp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yr=xp();function gy(l){yr=l}var cr={exec:()=>null};function nc(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 dt(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(pl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var sv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),pl={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:nc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:nc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:nc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:nc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:nc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:nc(l=>new RegExp(`^ {0,${l}}>`))},av=/^(?:[ \t]*(?:\n|$))+/,iv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,by=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xy=dt(by).replace(/bull/g,yp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ov=dt(by).replace(/bull/g,yp).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(),_p=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,uv=/^[^\n]+/,vp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fv=dt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dv=dt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,yp).getRegex(),Xf="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]*?(?:-->|$))/,hv=dt("^ {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",Xf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yy=l=>dt(_p).replace("hr",$o).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",Xf).getRegex(),pv=yy(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),mv=yy(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),gv=dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mv).getRegex(),Sp={blockquote:gv,code:iv,def:fv,fences:rv,heading:cv,hr:$o,html:hv,lheading:xy,list:dv,newline:av,paragraph:pv,table:cr,text:uv},Ub=dt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$o).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",Xf).getRegex(),bv={...Sp,lheading:ov,table:Ub,paragraph:dt(_p).replace("hr",$o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ub).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex()},xv={...Sp,html:dt(`^ *(?: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:cr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:dt(_p).replace("hr",$o).replace("heading",` *#{1,6} *[^
52
+ ]`).replace("lheading",xy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},yv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_v=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_y=/^( {2,}|\\)\n(?!\s*$)/,vv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wc=/[\p{P}\p{S}]/u,Vf=/[\s\p{P}\p{S}]/u,wp=/[^\s\p{P}\p{S}]/u,jv=dt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vf).getRegex(),vy=/(?!~)[\p{P}\p{S}]/u,Sv=/(?!~)[\s\p{P}\p{S}]/u,wv=/(?:[^\s\p{P}\p{S}]|~)/u,kv=dt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Nv=dt(jy,"u").replace(/punct/g,wc).getRegex(),Tv=dt(jy,"u").replace(/punct/g,vy).getRegex(),Sy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ev=dt(Sy,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,wc).getRegex(),Cv=dt(Sy,"gu").replace(/notPunctSpace/g,wv).replace(/punctSpace/g,Sv).replace(/punct/g,vy).getRegex(),Av=dt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,wc).getRegex(),Mv=dt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,wc).getRegex(),Rv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Dv=dt(Rv,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,wc).getRegex(),Ov=dt(/\\(punct)/,"gu").replace(/punct/g,wc).getRegex(),Lv=dt(/^<(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(),zv=dt(jp).replace("(?:-->|$)","-->").getRegex(),Uv=dt("^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",zv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Hv=dt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Lf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wy=dt(/^!?\[(label)\]\[(ref)\]/).replace("label",Lf).replace("ref",vp).getRegex(),ky=dt(/^!?\[(ref)\](?:\[\])?/).replace("ref",vp).getRegex(),Bv=dt("reflink|nolink(?!\\()","g").replace("reflink",wy).replace("nolink",ky).getRegex(),Hb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kp={_backpedal:cr,anyPunctuation:Ov,autolink:Lv,blockSkip:kv,br:_y,code:_v,del:cr,delLDelim:cr,delRDelim:cr,emStrongLDelim:Nv,emStrongRDelimAst:Ev,emStrongRDelimUnd:Av,escape:yv,link:Hv,nolink:ky,punctuation:jv,reflink:wy,reflinkSearch:Bv,tag:Uv,text:vv,url:cr},Iv={...kp,link:dt(/^!?\[(label)\]\((.*?)\)/).replace("label",Lf).getRegex(),reflink:dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lf).getRegex()},ap={...kp,emStrongRDelimAst:Cv,emStrongLDelim:Tv,delLDelim:Mv,delRDelim:Dv,url:dt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hb).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:dt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Hb).getRegex()},qv={...ap,br:dt(_y).replace("{2,}","*").getRegex(),text:dt(ap.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uf={normal:Sp,gfm:bv,pedantic:xv},Eo={normal:kp,gfm:ap,breaks:qv,pedantic:Iv},Gv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Bb=l=>Gv[l];function ea(l,s){if(s){if(pl.escapeTest.test(l))return l.replace(pl.escapeReplace,Bb)}else if(pl.escapeTestNoEncode.test(l))return l.replace(pl.escapeReplaceNoEncode,Bb);return l}function Ib(l){try{l=encodeURI(l).replace(pl.percentDecode,"%")}catch{return null}return l}function qb(l,s){var d;let r=l.replace(pl.findPipe,(h,m,g)=>{let b=!1,_=m;for(;--_>=0&&g[_]==="\\";)b=!b;return b?"|":" |"}),c=r.split(pl.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(pl.slashPipe,"|");return c}function Ei(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 Gb(l){let s=l.split(`
53
+ `),r=s.length-1;for(;r>=0&&pl.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
+ `)}function Yv(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 $v(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 Yb(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 Xv(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 zf=class{constructor(l){Lt(this,"options");Lt(this,"rules");Lt(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]:Gb(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=Xv(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=Ei(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Ei(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:Ei(s[0],`
58
+ `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Ei(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 b=m.join(`
61
+ `),_=b.replace(this.rules.other.blockquoteSetextReplace,`
62
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
63
+ ${b}`:b,o=o?`${o}
64
+ ${_}`:_;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,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,T=C.raw+`
65
+ `+r.join(`
66
+ `),E=this.blockquote(T);d[d.length-1]=E,c=c.substring(0,c.length-C.raw.length)+E.raw,o=o.substring(0,o.length-C.text.length)+E.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,T=C.raw+`
67
+ `+r.join(`
68
+ `),E=this.list(T);d[d.length-1]=E,c=c.substring(0,c.length-v.raw.length)+E.raw,o=o.substring(0,o.length-C.raw.length)+E.raw,r=T.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,b="",_="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;b=s[0],l=l.substring(b.length);let j=$v(s[2].split(`
70
+ `,1)[0],s[1].length),v=l.split(`
71
+ `,1)[0],C=!j.trim(),T=0;if(this.options.pedantic?(T=2,_=j.trimStart()):C?T=s[1].length+1:(T=j.search(this.rules.other.nonSpaceChar),T=T>4?1:T,_=j.slice(T),T+=s[1].length),C&&this.rules.other.blankLine.test(v)&&(b+=v+`
72
+ `,l=l.substring(v.length+1),g=!0),!g){let E=this.rules.other.nextBulletRegex(T),L=this.rules.other.hrRegex(T),$=this.rules.other.fencesBeginRegex(T),J=this.rules.other.headingBeginRegex(T),G=this.rules.other.htmlBeginRegex(T),O=this.rules.other.blockquoteBeginRegex(T);for(;l;){let Z=l.split(`
73
+ `,1)[0],M;if(v=Z,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),$.test(v)||J.test(v)||G.test(v)||O.test(v)||E.test(v)||L.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=T||!v.trim())_+=`
74
+ `+M.slice(T);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(j)||J.test(j)||L.test(j))break;_+=`
75
+ `+v}C=!v.trim(),b+=Z+`
76
+ `,l=l.substring(Z.length+1),j=M.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=b}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 b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.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 _=this.rules.other.listTaskCheckbox.exec(g.raw);if(_){let j={type:"checkbox",raw:_[0]+" ",checked:_[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 _=g.tokens.filter(v=>v.type==="space"),j=_.length>0&&_.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 b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=Gb(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:Ei(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=qb(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:Ei(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(qb(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Ei(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=Ei(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Yv(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)),Yb(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 Yb(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,b=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,s=s.slice(-1*l.length+o);(c=b.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 _=[...c[0]][0].length,j=l.slice(0,o+c.index+_+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 b=[...c[0]][0].length,_=l.slice(0,o+c.index+b+h),j=_.slice(o,-o);return{type:"del",raw:_,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}}}},Es=class ip{constructor(s){Lt(this,"tokens");Lt(this,"options");Lt(this,"state");Lt(this,"inlineQueue");Lt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||yr,this.options.tokenizer=this.options.tokenizer||new zf,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:pl,block:uf.normal,inline:Eo.normal};this.options.pedantic?(r.block=uf.pedantic,r.inline=Eo.pedantic):this.options.gfm&&(r.block=uf.gfm,this.options.breaks?r.inline=Eo.breaks:r.inline=Eo.gfm),this.tokenizer.rules=r}static get rules(){return{block:uf,inline:Eo}}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(pl.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(pl.tabCharGlobal," ").replace(pl.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(_=>(g=_.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 _=r.at(-1);g.raw.length===1&&_!==void 0?_.raw+=`
83
+ `:r.push(g);continue}if(g=this.tokenizer.code(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
84
+ `)?"":`
85
+ `)+g.raw,_.text+=`
86
+ `+g.text,this.inlineQueue.at(-1).src=_.text):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 _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
87
+ `)?"":`
88
+ `)+g.raw,_.text+=`
89
+ `+g.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},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 b=s;if((m=this.options.extensions)!=null&&m.startBlock){let _=1/0,j=s.slice(1),v;this.options.extensions.startBlock.forEach(C=>{v=C.call({lexer:this},j),typeof v=="number"&&v>=0&&(_=Math.min(_,v))}),_<1/0&&_>=0&&(b=s.substring(0,_+1))}if(this.state.top&&(g=this.tokenizer.paragraph(b))){let _=r.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
90
+ `)?"":`
91
+ `)+g.raw,_.text+=`
92
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(g),c=b.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
93
+ `)?"":`
94
+ `)+g.raw,_.text+=`
95
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):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,b,_,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,T)=>{let E=T?T.length:0;return v.slice(0,E)+"["+"a".repeat(v.length-E-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((_=(b=this.options.extensions)==null?void 0:b.inline)!=null&&_.some(T=>(v=T.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 T=r.at(-1);v.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.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 T=1/0,E=s.slice(1),L;this.options.extensions.startInline.forEach($=>{L=$.call({lexer:this},E),typeof L=="number"&&L>=0&&(T=Math.min(T,L))}),T<1/0&&T>=0&&(C=s.substring(0,T+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 T=r.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.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)}},Uf=class{constructor(l){Lt(this,"options");Lt(this,"parser");this.options=l||yr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(pl.notSpaceStart))==null?void 0:d[0],o=l.replace(pl.endingNewline,"")+`
96
+ `;return c?'<pre><code class="language-'+ea(c)+'">'+(r?o:ea(o,!0))+`</code></pre>
97
+ `:"<pre><code>"+(r?o:ea(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>${ea(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=Ib(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+ea(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=Ib(l);if(o===null)return ea(r);l=o;let d=`<img src="${l}" alt="${ea(r)}"`;return s&&(d+=` title="${ea(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:ea(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}},Cs=class rp{constructor(s){Lt(this,"options");Lt(this,"renderer");Lt(this,"textRenderer");this.options=s||yr,this.options.renderer=this.options.renderer||new Uf,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,b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=b||"";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 b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=b||"";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 b='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return c}},Cf,zo=(Cf=class{constructor(l){Lt(this,"options");Lt(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?Es.lex:Es.lexInline}provideParser(l=this.block){return l?Cs.parse:Cs.parseInline}},Lt(Cf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Lt(Cf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Cf),Vv=class{constructor(...l){Lt(this,"defaults",xp());Lt(this,"options",this.setOptions);Lt(this,"parse",this.parseMarkdown(!0));Lt(this,"parseInline",this.parseMarkdown(!1));Lt(this,"Parser",Cs);Lt(this,"Renderer",Uf);Lt(this,"TextRenderer",Np);Lt(this,"Lexer",Es);Lt(this,"Tokenizer",zf);Lt(this,"Hooks",zo);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 Uf(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]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new zf(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]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new zo;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];zo.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&zo.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,b);return g.call(o,j)})();let _=m.call(o,b);return g.call(o,_)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,b);return j===!1&&(j=await g.apply(o,b)),j})();let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}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 Es.lex(l,s??this.defaults)}parser(l,s){return Cs.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?Es.lex:Es.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(l):l?Cs.parse:Cs.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?Es.lex:Es.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?Cs.parse:Cs.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>"+ea(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},xr=new Vv;function Nt(l,s){return xr.parse(l,s)}Nt.options=Nt.setOptions=function(l){return xr.setOptions(l),Nt.defaults=xr.defaults,gy(Nt.defaults),Nt};Nt.getDefaults=xp;Nt.defaults=yr;Nt.use=function(...l){return xr.use(...l),Nt.defaults=xr.defaults,gy(Nt.defaults),Nt};Nt.walkTokens=function(l,s){return xr.walkTokens(l,s)};Nt.parseInline=xr.parseInline;Nt.Parser=Cs;Nt.parser=Cs.parse;Nt.Renderer=Uf;Nt.TextRenderer=Np;Nt.Lexer=Es;Nt.lexer=Es.lex;Nt.Tokenizer=zf;Nt.Hooks=zo;Nt.parse=Nt;Nt.options;Nt.setOptions;Nt.use;Nt.walkTokens;Nt.parseInline;Cs.parse;Es.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 $b(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 Qv(l){if(Array.isArray(l))return l}function Kv(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,b=!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(_){b=!0,o=_}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function Zv(){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 Fv(l,s){return Qv(l)||Kv(l,s)||Jv(l,s)||Zv()}function Jv(l,s){if(l){if(typeof l=="string")return $b(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)?$b(l,s):void 0}}const Ny=Object.entries,Xb=Object.setPrototypeOf,Wv=Object.isFrozen,Pv=Object.getPrototypeOf,e1=Object.getOwnPropertyDescriptor;let cl=Object.freeze,ol=Object.seal,cc=Object.create,Ty=typeof Reflect<"u"&&Reflect,cp=Ty.apply,op=Ty.construct;cl||(cl=function(s){return s});ol||(ol=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 lc=Gn(Array.prototype.forEach),t1=Gn(Array.prototype.lastIndexOf),Vb=Gn(Array.prototype.pop),sc=Gn(Array.prototype.push),n1=Gn(Array.prototype.splice),Oi=Array.isArray,Uo=Gn(String.prototype.toLowerCase),Bh=Gn(String.prototype.toString),Qb=Gn(String.prototype.match),Co=Gn(String.prototype.replace),Kb=Gn(String.prototype.indexOf),l1=Gn(String.prototype.trim),s1=Gn(Number.prototype.toString),a1=Gn(Boolean.prototype.toString),Zb=typeof BigInt>"u"?null:Gn(BigInt.prototype.toString),Fb=typeof Symbol>"u"?null:Gn(Symbol.prototype.toString),Wn=Gn(Object.prototype.hasOwnProperty),Ao=Gn(Object.prototype.toString),Jn=Gn(RegExp.prototype.test),sr=i1(TypeError);function Gn(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 i1(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 ft(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uo;if(Xb&&Xb(l,null),!Oi(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(Wv(s)||(s[c]=d),o=d)}l[o]=!0}return l}function r1(l){for(let s=0;s<l.length;s++)Wn(l,s)||(l[s]=null);return l}function kl(l){const s=cc(null);for(const c of Ny(l)){var r=Fv(c,2);const o=r[0],d=r[1];Wn(l,o)&&(Oi(d)?s[o]=r1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=kl(d):s[o]=d)}return s}function c1(l){switch(typeof l){case"string":return l;case"number":return s1(l);case"boolean":return a1(l);case"bigint":return Zb?Zb(l):"0";case"symbol":return Fb?Fb(l):"Symbol()";case"undefined":return Ao(l);case"function":case"object":{if(l===null)return Ao(l);const s=l,r=ta(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Ao(c)}return Ao(l)}default:return Ao(l)}}function ta(l,s){for(;l!==null;){const c=e1(l,s);if(c){if(c.get)return Gn(c.get);if(typeof c.value=="function")return Gn(c.value)}l=Pv(l)}function r(){return null}return r}function o1(l){try{return Jn(l,""),!0}catch{return!1}}const Jb=cl(["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=cl(["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=cl(["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"]),u1=cl(["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=cl(["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"]),f1=cl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wb=cl(["#text"]),Pb=cl(["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=cl(["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"]),ex=cl(["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=cl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),d1=ol(/{{[\w\W]*|^[\w\W]*}}/g),h1=ol(/<%[\w\W]*|^[\w\W]*%>/g),p1=ol(/\${[\w\W]*/g),m1=ol(/^data-[\-\w.\u00B7-\uFFFF]+$/),g1=ol(/^aria-[\-\w]+$/),tx=ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),b1=ol(/^(?:\w+script|data):/i),x1=ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y1=ol(/^html$/i),_1=ol(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=ol(/<[/\w!]/g),lx=ol(/<[/\w]/g),v1=ol(/<\/no(script|embed|frames)/i),j1=ol(/\/>/i),Vl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},S1=function(){return typeof window>"u"?null:window},w1=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}},sx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ci=function(s,r,c,o){return Wn(s,r)&&Oi(s[r])?ft(o.base?kl(o.base):{},s[r],o.transform):c};function Ey(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S1();const s=me=>Ey(me);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==Vl.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,b=l.NamedNodeMap;b===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const _=l.DOMParser,j=l.trustedTypes,v=m.prototype,C=ta(v,"cloneNode"),T=ta(v,"remove"),E=ta(v,"nextSibling"),L=ta(v,"childNodes"),$=ta(v,"parentNode"),J=ta(v,"shadowRoot"),G=ta(v,"attributes"),O=h&&h.prototype?ta(h.prototype,"nodeType"):null,Z=h&&h.prototype?ta(h.prototype,"nodeName"):null;if(typeof d=="function"){const me=r.createElement("template");me.content&&me.content.ownerDocument&&(r=me.content.ownerDocument)}let M,D="",B,ne=!1,he=0;const P=function(){if(he>0)throw sr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ue=function(N){P(),he++;try{return M.createHTML(N)}finally{he--}},_e=function(N){P(),he++;try{return M.createScriptURL(N)}finally{he--}},De=function(){return ne||(B=w1(j,o),ne=!0),B},Ne=r,A=Ne.implementation,fe=Ne.createNodeIterator,z=Ne.createDocumentFragment,pe=Ne.getElementsByTagName,ke=c.importNode;let k=sx();s.isSupported=typeof Ny=="function"&&typeof $=="function"&&A&&A.createHTMLDocument!==void 0;const V=d1,ce=h1,ge=p1,Ae=m1,Se=g1,Te=b1,Tt=x1,Ye=_1;let et=tx,Xe=null;const Qt=ft({},[...Jb,...Ih,...qh,...Gh,...Wb]);let tt=null;const Yt=ft({},[...Pb,...Yh,...ex,...ff]);let nt=Object.seal(cc(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}})),en=null,$t=null;const tn=Object.seal(cc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,pn=!0,Sn=!1,mn=!0,cn=!1,Ke=!0,zt=!1,gn=!1,ut=null,Je=null,An=!1,on=!1,wn=!1,Pn=!1,Xt=!0,wt=!1;const Kt="user-content-";let Et=!0,Yn=!1,le={},be=null;const Le=ft({},["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 H=null;const W=ft({},["audio","video","img","source","image","track"]);let xe=null;const Be=ft({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",bn="http://www.w3.org/1999/xhtml";let Rn=bn,ul=!1,gl=null;const ra=ft({},[pt,Mn,bn],Bh),Ql=cl(["mi","mo","mn","ms","mtext"]);let ms=ft({},Ql);const Rs=cl(["annotation-xml"]);let Dn=ft({},Rs);const Kl=ft({},["title","style","font","a","script"]);let bl=null;const $n=["application/xhtml+xml","text/html"],Vt="text/html";let $e=null,_t=null;const xl=r.createElement("form"),lt=function(N){return N instanceof RegExp||N instanceof Function},Zl=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_t&&_t===N)return;(!N||typeof N!="object")&&(N={}),N=kl(N),bl=$n.indexOf(N.PARSER_MEDIA_TYPE)===-1?Vt:N.PARSER_MEDIA_TYPE,$e=bl==="application/xhtml+xml"?Bh:Uo,Xe=Ci(N,"ALLOWED_TAGS",Qt,{transform:$e}),tt=Ci(N,"ALLOWED_ATTR",Yt,{transform:$e}),gl=Ci(N,"ALLOWED_NAMESPACES",ra,{transform:Bh}),xe=Ci(N,"ADD_URI_SAFE_ATTR",Be,{transform:$e,base:Be}),H=Ci(N,"ADD_DATA_URI_TAGS",W,{transform:$e,base:W}),be=Ci(N,"FORBID_CONTENTS",Le,{transform:$e}),en=Ci(N,"FORBID_TAGS",kl({}),{transform:$e}),$t=Ci(N,"FORBID_ATTR",kl({}),{transform:$e}),le=Wn(N,"USE_PROFILES")?N.USE_PROFILES&&typeof N.USE_PROFILES=="object"?kl(N.USE_PROFILES):N.USE_PROFILES:!1,nn=N.ALLOW_ARIA_ATTR!==!1,pn=N.ALLOW_DATA_ATTR!==!1,Sn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,mn=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,cn=N.SAFE_FOR_TEMPLATES||!1,Ke=N.SAFE_FOR_XML!==!1,zt=N.WHOLE_DOCUMENT||!1,on=N.RETURN_DOM||!1,wn=N.RETURN_DOM_FRAGMENT||!1,Pn=N.RETURN_TRUSTED_TYPE||!1,An=N.FORCE_BODY||!1,Xt=N.SANITIZE_DOM!==!1,wt=N.SANITIZE_NAMED_PROPS||!1,Et=N.KEEP_CONTENT!==!1,Yn=N.IN_PLACE||!1,et=o1(N.ALLOWED_URI_REGEXP)?N.ALLOWED_URI_REGEXP:tx,Rn=typeof N.NAMESPACE=="string"?N.NAMESPACE:bn,ms=Wn(N,"MATHML_TEXT_INTEGRATION_POINTS")&&N.MATHML_TEXT_INTEGRATION_POINTS&&typeof N.MATHML_TEXT_INTEGRATION_POINTS=="object"?kl(N.MATHML_TEXT_INTEGRATION_POINTS):ft({},Ql),Dn=Wn(N,"HTML_INTEGRATION_POINTS")&&N.HTML_INTEGRATION_POINTS&&typeof N.HTML_INTEGRATION_POINTS=="object"?kl(N.HTML_INTEGRATION_POINTS):ft({},Rs);const Y=Wn(N,"CUSTOM_ELEMENT_HANDLING")&&N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING=="object"?kl(N.CUSTOM_ELEMENT_HANDLING):cc(null);if(nt=cc(null),Wn(Y,"tagNameCheck")&&lt(Y.tagNameCheck)&&(nt.tagNameCheck=Y.tagNameCheck),Wn(Y,"attributeNameCheck")&&lt(Y.attributeNameCheck)&&(nt.attributeNameCheck=Y.attributeNameCheck),Wn(Y,"allowCustomizedBuiltInElements")&&typeof Y.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=Y.allowCustomizedBuiltInElements),ol(nt),cn&&(pn=!1),wn&&(on=!0),le&&(Xe=ft({},Wb),tt=cc(null),le.html===!0&&(ft(Xe,Jb),ft(tt,Pb)),le.svg===!0&&(ft(Xe,Ih),ft(tt,Yh),ft(tt,ff)),le.svgFilters===!0&&(ft(Xe,qh),ft(tt,Yh),ft(tt,ff)),le.mathMl===!0&&(ft(Xe,Gh),ft(tt,ex),ft(tt,ff))),tn.tagCheck=null,tn.attributeCheck=null,Wn(N,"ADD_TAGS")&&(typeof N.ADD_TAGS=="function"?tn.tagCheck=N.ADD_TAGS:Oi(N.ADD_TAGS)&&(Xe===Qt&&(Xe=kl(Xe)),ft(Xe,N.ADD_TAGS,$e))),Wn(N,"ADD_ATTR")&&(typeof N.ADD_ATTR=="function"?tn.attributeCheck=N.ADD_ATTR:Oi(N.ADD_ATTR)&&(tt===Yt&&(tt=kl(tt)),ft(tt,N.ADD_ATTR,$e))),Wn(N,"ADD_URI_SAFE_ATTR")&&Oi(N.ADD_URI_SAFE_ATTR)&&ft(xe,N.ADD_URI_SAFE_ATTR,$e),Wn(N,"FORBID_CONTENTS")&&Oi(N.FORBID_CONTENTS)&&(be===Le&&(be=kl(be)),ft(be,N.FORBID_CONTENTS,$e)),Wn(N,"ADD_FORBID_CONTENTS")&&Oi(N.ADD_FORBID_CONTENTS)&&(be===Le&&(be=kl(be)),ft(be,N.ADD_FORBID_CONTENTS,$e)),Et&&(Xe["#text"]=!0),zt&&ft(Xe,["html","head","body"]),Xe.table&&(ft(Xe,["tbody"]),delete en.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw sr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ae=M;M=N.TRUSTED_TYPES_POLICY;try{D=ue("")}catch(we){throw M=ae,we}}else N.TRUSTED_TYPES_POLICY===null?(M=void 0,D=""):(M===void 0&&(M=De()),M&&typeof D=="string"&&(D=ue("")));cl&&cl(N),_t=N},Ut=ft({},[...Ih,...qh,...u1]),el=ft({},[...Gh,...f1]),kt=function(N,Y,ae){return Y.namespaceURI===bn?N==="svg":Y.namespaceURI===pt?N==="svg"&&(ae==="annotation-xml"||ms[ae]):!!Ut[N]},Tl=function(N,Y,ae){return Y.namespaceURI===bn?N==="math":Y.namespaceURI===Mn?N==="math"&&Dn[ae]:!!el[N]},ln=function(N,Y,ae){return Y.namespaceURI===Mn&&!Dn[ae]||Y.namespaceURI===pt&&!ms[ae]?!1:!el[N]&&(Kl[N]||!Ut[N])},kn=function(N){let Y=$(N);(!Y||!Y.tagName)&&(Y={namespaceURI:Rn,tagName:"template"});const ae=Uo(N.tagName),we=Uo(Y.tagName);return gl[N.namespaceURI]?N.namespaceURI===Mn?kt(ae,Y,we):N.namespaceURI===pt?Tl(ae,Y,we):N.namespaceURI===bn?ln(ae,Y,we):!!(bl==="application/xhtml+xml"&&gl[N.namespaceURI]):!1},mt=function(N){sc(s.removed,{element:N});try{$(N).removeChild(N)}catch{if(T(N),!$(N))throw sr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ze=function(N){xn(N);const Y=L(N);if(Y){const we=[];lc(Y,ve=>{sc(we,ve)}),lc(we,ve=>{try{T(ve)}catch{}})}const ae=G(N);if(ae)for(let we=ae.length-1;we>=0;--we){const ve=ae[we],ze=ve&&ve.name;if(typeof ze=="string")try{N.removeAttribute(ze)}catch{}}},On=function(N,Y){try{sc(s.removed,{attribute:Y.getAttributeNode(N),from:Y})}catch{sc(s.removed,{attribute:null,from:Y})}if(Y.removeAttribute(N),N==="is")if(on||wn)try{mt(Y)}catch{}else try{Y.setAttribute(N,"")}catch{}},El=function(N){const Y=G(N);if(Y)for(let ae=Y.length-1;ae>=0;--ae){const we=Y[ae],ve=we&&we.name;if(!(typeof ve!="string"||tt[$e(ve)]))try{N.removeAttribute(ve)}catch{}}},xn=function(N){const Y=[N];for(;Y.length>0;){const ae=Y.pop();(O?O(ae):ae.nodeType)===Vl.element&&El(ae);const ve=L(ae);if(ve)for(let ze=ve.length-1;ze>=0;--ze)Y.push(ve[ze])}},Nn=function(N){if(!Ke)return;const Y=[N];for(;Y.length>0;){const ae=Y.pop(),we=O?O(ae):ae.nodeType;if(we===Vl.processingInstruction||we===Vl.comment&&Jn(lx,ae.data)){try{T(ae)}catch{}continue}if(we===Vl.element){const ze=ae,ot=$e(Z?Z(ae):ae.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&ot!=="label"&&ot!=="output"&&ze.removeAttribute("for")}catch{}}const ve=L(ae);if(ve)for(let ze=ve.length-1;ze>=0;--ze)Y.push(ve[ze])}},tl=function(N){let Y=null,ae=null;if(An)N="<remove></remove>"+N;else{const ze=Qb(N,/^[\r\n\t ]+/);ae=ze&&ze[0]}bl==="application/xhtml+xml"&&Rn===bn&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const we=M?ue(N):N;if(Rn===bn)try{Y=new _().parseFromString(we,bl)}catch{}if(!Y||!Y.documentElement){Y=A.createDocument(Rn,"template",null);try{Y.documentElement.innerHTML=ul?D:we}catch{}}const ve=Y.body||Y.documentElement;return N&&ae&&ve.insertBefore(r.createTextNode(ae),ve.childNodes[0]||null),Rn===bn?pe.call(Y,zt?"html":"body")[0]:zt?Y.documentElement:ve},gs=function(N){return fe.call(N.ownerDocument||N,N,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},yn=function(N){return N=Co(N,V," "),N=Co(N,ce," "),N=Co(N,ge," "),N},Fl=function(N){var Y;N.normalize();const ae=fe.call(N.ownerDocument||N,N,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let we=ae.nextNode();for(;we;)we.data=yn(we.data),we=ae.nextNode();const ve=(Y=N.querySelectorAll)===null||Y===void 0?void 0:Y.call(N,"template");ve&&lc(ve,ze=>{nl(ze.content)&&Fl(ze.content)})},fl=function(N){const Y=Z?Z(N):null;return typeof Y!="string"||$e(Y)!=="form"?!1:typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||N.attributes!==G(N)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function"||N.nodeType!==O(N)||N.childNodes!==L(N)},nl=function(N){if(!O||typeof N!="object"||N===null)return!1;try{return O(N)===Vl.documentFragment}catch{return!1}},Ln=function(N){if(!O||typeof N!="object"||N===null)return!1;try{return typeof O(N)=="number"}catch{return!1}};function Ht(me,N,Y){me.length!==0&&lc(me,ae=>{ae.call(s,N,Y,_t)})}const Ia=function(N,Y){return!!(Ke&&N.hasChildNodes()&&!Ln(N.firstElementChild)&&Jn(nx,N.textContent)&&Jn(nx,N.innerHTML)||Ke&&N.namespaceURI===bn&&Y==="style"&&Ln(N.firstElementChild)||N.nodeType===Vl.processingInstruction||Ke&&N.nodeType===Vl.comment&&Jn(lx,N.data))},Hi=function(N,Y){if(!en[Y]&&qa(Y)&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,Y)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(Y)))return!1;if(Et&&!be[Y]){const ae=$(N),we=L(N);if(we&&ae){const ve=we.length;for(let ze=ve-1;ze>=0;--ze){const ot=Yn?we[ze]:C(we[ze],!0);ae.insertBefore(ot,E(N))}}}return mt(N),!0},Ds=function(N,Y){if(Ht(k.beforeSanitizeElements,N,null),N!==Y&&$(N)===null)return!0;if(fl(N))return mt(N),!0;const ae=$e(Z?Z(N):N.nodeName);if(Ht(k.uponSanitizeElement,N,{tagName:ae,allowedTags:Xe}),N!==Y&&$(N)===null)return!0;if(Ia(N,ae))return mt(N),!0;if(en[ae]||!(tn.tagCheck instanceof Function&&tn.tagCheck(ae))&&!Xe[ae]){const ve=Hi(N,ae);return ve===!1&&Ht(k.afterSanitizeElements,N,null),ve}if((O?O(N):N.nodeType)===Vl.element&&!kn(N)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&Jn(v1,N.innerHTML))return mt(N),!0;if(cn&&N.nodeType===Vl.text){const ve=yn(N.textContent);N.textContent!==ve&&(sc(s.removed,{element:N.cloneNode()}),N.textContent=ve)}return Ht(k.afterSanitizeElements,N,null),!1},Os=function(N,Y,ae){if($t[Y]||Ke&&Y==="patchsrc"||Ke&&Y==="for"&&N!=="label"&&N!=="output"||Xt&&(Y==="id"||Y==="name")&&(ae in r||ae in xl))return!1;const we=tt[Y]||tn.attributeCheck instanceof Function&&tn.attributeCheck(Y,N);if(!(pn&&Jn(Ae,Y))){if(!(nn&&Jn(Se,Y))){if(we){if(!xe[Y]){if(!Jn(et,Co(ae,Tt,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&N!=="script"&&Kb(ae,"data:")===0&&H[N])){if(!(Sn&&!Jn(Te,Co(ae,Tt,"")))){if(ae)return!1}}}}}else if(!(qa(N)&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,N)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(N))&&(nt.attributeNameCheck instanceof RegExp&&Jn(nt.attributeNameCheck,Y)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(Y,N))||Y==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,ae)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(ae))))return!1}}return!0},yl=ft({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),qa=function(N){return!yl[Uo(N)]&&Jn(Ye,N)},zn=function(N,Y,ae,we){if(M&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ae)switch(j.getAttributeType(N,Y)){case"TrustedHTML":return ue(we);case"TrustedScriptURL":return _e(we)}return we},bs=function(N,Y,ae,we){try{ae?N.setAttributeNS(ae,Y,we):N.setAttribute(Y,we),fl(N)?mt(N):Vb(s.removed)}catch{On(Y,N)}},Jl=function(N){Ht(k.beforeSanitizeAttributes,N,null);const Y=N.attributes;if(!Y||fl(N))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:tt,forceKeepAttr:void 0};let we=Y.length;const ve=$e(N.nodeName);for(;we--;){const ze=Y[we],ot=ze.name,un=ze.namespaceURI,Mt=ze.value,ht=$e(ot),fn=Mt;let It=ot==="value"?fn:l1(fn);if(ae.attrName=ht,ae.attrValue=It,ae.keepAttr=!0,ae.forceKeepAttr=void 0,Ht(k.uponSanitizeAttribute,N,ae),It=ae.attrValue,wt&&(ht==="id"||ht==="name")&&Kb(It,Kt)!==0&&(On(ot,N),It=Kt+It),Ke&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){On(ot,N);continue}if(ht==="attributename"&&Qb(It,"href")){On(ot,N);continue}if(!ae.forceKeepAttr){if(!ae.keepAttr){On(ot,N);continue}if(!mn&&Jn(j1,It)){On(ot,N);continue}if(cn&&(It=yn(It)),!Os(ve,ht,It)){On(ot,N);continue}It=zn(ve,ht,un,It),It!==fn&&bs(N,ot,un,It)}}Ht(k.afterSanitizeAttributes,N,null)},sn=function(N){let Y=null;const ae=gs(N);for(Ht(k.beforeSanitizeShadowDOM,N,null);Y=ae.nextNode();)if(Ht(k.uponSanitizeShadowNode,Y,null),Ds(Y,N),Jl(Y),nl(Y.content)&&sn(Y.content),(O?O(Y):Y.nodeType)===Vl.element){const ve=J(Y);nl(ve)&&(Bt(ve),sn(ve))}Ht(k.afterSanitizeShadowDOM,N,null)},Bt=function(N){const Y=[{node:N,shadow:null}];for(;Y.length>0;){const ae=Y.pop();if(ae.shadow){sn(ae.shadow);continue}const we=ae.node,ze=(O?O(we):we.nodeType)===Vl.element,ot=L(we);if(ot)for(let un=ot.length-1;un>=0;--un)Y.push({node:ot[un],shadow:null});if(ze){const un=Z?Z(we):null;if(typeof un=="string"&&$e(un)==="template"){const Mt=we.content;nl(Mt)&&Y.push({node:Mt,shadow:null})}}if(ze){const un=J(we);nl(un)&&Y.push({node:null,shadow:un},{node:un,shadow:null})}}};return s.sanitize=function(me){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,ae=null,we=null,ve=null;if(ul=!me,ul&&(me="<!-->"),typeof me!="string"&&!Ln(me)&&(me=c1(me),typeof me!="string"))throw sr("dirty is not a string, aborting");if(!s.isSupported)return me;gn?(Xe=ut,tt=Je):Zl(N),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(Xe=kl(Xe)),k.uponSanitizeAttribute.length>0&&(tt=kl(tt)),s.removed=[];const ze=Yn&&typeof me!="string"&&Ln(me);if(ze){Nn(me);const ht=Z?Z(me):me.nodeName;if(typeof ht=="string"){const fn=$e(ht);if(!Xe[fn]||en[fn])throw Ze(me),sr("root node is forbidden and cannot be sanitized in-place")}if(fl(me))throw Ze(me),sr("root node is clobbered and cannot be sanitized in-place");try{Bt(me)}catch(fn){throw Ze(me),fn}}else if(Ln(me))Y=tl("<!---->"),ae=Y.ownerDocument.importNode(me,!0),ae.nodeType===Vl.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?Y=ae:Y.appendChild(ae),Bt(ae);else{if(!on&&!cn&&!zt&&me.indexOf("<")===-1)return M&&Pn?ue(me):me;if(Y=tl(me),!Y)return on?null:Pn?D:""}Y&&An&&mt(Y.firstChild);const ot=ze?me:Y,un=gs(ot);try{for(;we=un.nextNode();)Ds(we,ot),Jl(we),nl(we.content)&&sn(we.content)}catch(ht){throw ze&&(Ze(me),lc(s.removed,fn=>{fn.element&&xn(fn.element)})),ht}if(ze)return lc(s.removed,ht=>{ht.element&&xn(ht.element)}),cn&&Fl(me),me;if(on){if(cn&&Fl(Y),wn)for(ve=z.call(Y.ownerDocument);Y.firstChild;)ve.appendChild(Y.firstChild);else ve=Y;return(tt.shadowroot||tt.shadowrootmode)&&(ve=ke.call(c,ve,!0)),ve}let Mt=zt?Y.outerHTML:Y.innerHTML;return zt&&Xe["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Jn(y1,Y.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
116
+ `+Mt),cn&&(Mt=yn(Mt)),M&&Pn?ue(Mt):Mt},s.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zl(me),gn=!0,ut=Xe,Je=tt},s.clearConfig=function(){_t=null,gn=!1,ut=null,Je=null,M=B,D=""},s.isValidAttribute=function(me,N,Y){_t||Zl({});const ae=$e(me),we=$e(N);return Os(ae,we,Y)},s.addHook=function(me,N){typeof N=="function"&&Wn(k,me)&&sc(k[me],N)},s.removeHook=function(me,N){if(Wn(k,me)){if(N!==void 0){const Y=t1(k[me],N);return Y===-1?void 0:n1(k[me],Y,1)[0]}return Vb(k[me])}},s.removeHooks=function(me){Wn(k,me)&&(k[me]=[])},s.removeAllHooks=function(){k=sx()},s}var k1=Ey();const N1=1024;let T1=0;class ps{constructor(s,r){this.from=s,this.to=r}}class Pt{constructor(s={}){this.id=T1++,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=Ms.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 dc{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 E1=Object.create(null);class Ms{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):E1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Ms(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}}}}Ms.none=new Ms("",Object.create(null),0,8);class Cy{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 Ms(c.name,o,c.id,c.flags):c)}return new Cy(r)}}const df=new WeakMap,ax=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 Bl{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=dc.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 Hf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=df.get(this)||this.topNode,d=new Hf(o);return d.moveTo(s,r),df.set(this,d._tree),d}get topNode(){return new ml(this,0,0,null)}resolve(s,r=0){let c=Io(df.get(this)||this.topNode,s,r,!1);return df.set(this,c),c}resolveInner(s,r=0){let c=Io(ax.get(this)||this.topNode,s,r,!0);return ax.set(this,c),c}resolveStack(s,r=0){return M1(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 b=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;b=!0}for(;b&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;b=!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(Ms.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Bl(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Bl(Ms.none,r,c,o)))}static build(s){return R1(s)}}Bl.empty=new Bl(Ms.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 Ui{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return Ms.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&&!(Ay(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 b=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,b)}return new Ui(d,h,this.set)}}function Ay(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 Io(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 ml&&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 ml&&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 My{cursor(s=0){return new Hf(this,s)}getChild(s,r=null,c=null){let o=ix(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return ix(this,s,r,c)}resolve(s,r=0){return Io(this,s,r,!1)}resolveInner(s,r=0){return Io(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 ml extends My{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,b=r>0?m.length:-1;s!=b;s+=r){let _=m[s],j=g[s]+h.from,v;if(!(!(d&Jt.EnterBracketed&&_ instanceof Bl&&(v=dc.get(_))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+_.length)&&!Ay(o,c,j,j+_.length))){if(_ instanceof Ui){if(d&Jt.ExcludeBuffers)continue;let C=_.findChild(0,_.buffer.length,r,c-j,o);if(C>-1)return new ia(new C1(h,_,s,j),null,C)}else if(d&Jt.IncludeAnonymous||!_.type.isAnonymous||Ep(_)){let C;if(!(d&Jt.IgnoreMounts)&&(C=dc.get(_))&&!C.overlay)return new ml(C.tree,j,s,h);let T=new ml(_,j,s,h);return d&Jt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?_.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=dc.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 ml(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 ix(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 C1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class ia extends My{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 ia(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 ia(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 ia(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 ia(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 Bl(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ry(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 ml&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new A1(o,r)}class A1{constructor(s,r){this.heads=s,this.node=r}get next(){return Ry(this.heads)}}function M1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof ml?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=dc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new ml(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Io(m,s,r,!1))}}return o?Ry(o):c}class Hf{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 ml)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 ml?(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 Ui||!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 ia(this.buffer,r,this.stack[o]);return this.bufferNode=new ia(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 Ui||!s.type.isAnonymous||Ep(s))}function R1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=N1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Tp(r,r.length):r,g=c.types,b=0,_=0;function j(Z,M,D,B,ne,he){let{id:P,start:ue,end:_e,size:De}=m,Ne=_,A=b;if(De<0)if(m.next(),De==-1){let k=d[P];D.push(k),B.push(ue-Z);return}else if(De==-3){b=P;return}else if(De==-4){_=P;return}else throw new RangeError(`Unrecognized record size: ${De}`);let fe=g[P],z,pe,ke=ue-Z;if(_e-ue<=o&&(pe=L(m.pos-M,ne))){let k=new Uint16Array(pe.size-pe.skip),V=m.pos-pe.size,ce=k.length;for(;m.pos>V;)ce=$(pe.start,k,ce);z=new Ui(k,_e-pe.start,c),ke=pe.start-Z}else{let k=m.pos-De;m.next();let V=[],ce=[],ge=P>=h?P:-1,Ae=0,Se=_e;for(;m.pos>k;)ge>=0&&m.id==ge&&m.size>=0?(m.end<=Se-o&&(T(V,ce,ue,Ae,m.end,Se,ge,Ne,A),Ae=V.length,Se=m.end),m.next()):he>2500?v(ue,k,V,ce):j(ue,k,V,ce,ge,he+1);if(ge>=0&&Ae>0&&Ae<V.length&&T(V,ce,ue,Ae,ue,Se,ge,Ne,A),V.reverse(),ce.reverse(),ge>-1&&Ae>0){let Te=C(fe,A);z=Cp(fe,V,ce,0,V.length,0,_e-ue,Te,Te)}else z=E(fe,V,ce,_e-ue,Ne-_e,A)}D.push(z),B.push(ke)}function v(Z,M,D,B){let ne=[],he=0,P=-1;for(;m.pos>M;){let{id:ue,start:_e,end:De,size:Ne}=m;if(Ne>4)m.next();else{if(P>-1&&_e<P)break;P<0&&(P=De-o),ne.push(ue,_e,De),he++,m.next()}}if(he){let ue=new Uint16Array(he*4),_e=ne[ne.length-2];for(let De=ne.length-3,Ne=0;De>=0;De-=3)ue[Ne++]=ne[De],ue[Ne++]=ne[De+1]-_e,ue[Ne++]=ne[De+2]-_e,ue[Ne++]=Ne;D.push(new Ui(ue,ne[2]-_e,c)),B.push(_e-Z)}}function C(Z,M){return(D,B,ne)=>{let he=0,P=D.length-1,ue,_e;if(P>=0&&(ue=D[P])instanceof Bl){if(!P&&ue.type==Z&&ue.length==ne)return ue;(_e=ue.prop(Pt.lookAhead))&&(he=B[P]+ue.length+_e)}return E(Z,D,B,ne,he,M)}}function T(Z,M,D,B,ne,he,P,ue,_e){let De=[],Ne=[];for(;Z.length>B;)De.push(Z.pop()),Ne.push(M.pop()+D-ne);Z.push(E(c.types[P],De,Ne,he-ne,ue-he,_e)),M.push(ne-D)}function E(Z,M,D,B,ne,he,P){if(he){let ue=[Pt.contextHash,he];P=P?[ue].concat(P):[ue]}if(ne>25){let ue=[Pt.lookAhead,ne];P=P?[ue].concat(P):[ue]}return new Bl(Z,M,D,B,P)}function L(Z,M){let D=m.fork(),B=0,ne=0,he=0,P=D.end-o,ue={size:0,start:0,skip:0};e:for(let _e=D.pos-Z;D.pos>_e;){let De=D.size;if(D.id==M&&De>=0){ue.size=B,ue.start=ne,ue.skip=he,he+=4,B+=4,D.next();continue}let Ne=D.pos-De;if(De<0||Ne<_e||D.start<P)break;let A=D.id>=h?4:0,fe=D.start;for(D.next();D.pos>Ne;){if(D.size<0)if(D.size==-3||D.size==-4)A+=4;else break e;else D.id>=h&&(A+=4);D.next()}ne=fe,B+=De,he+=A}return(M<0||B==Z)&&(ue.size=B,ue.start=ne,ue.skip=he),ue.size>4?ue:void 0}function $(Z,M,D){let{id:B,start:ne,end:he,size:P}=m;if(m.next(),P>=0&&B<h){let ue=D;if(P>4){let _e=m.pos-(P-4);for(;m.pos>_e;)D=$(Z,M,D)}M[--D]=ue,M[--D]=he-Z,M[--D]=ne-Z,M[--D]=B}else P==-3?b=B:P==-4&&(_=B);return D}let J=[],G=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,J,G,-1,0);let O=(s=l.length)!==null&&s!==void 0?s:J.length?G[0]+J[0].length:0;return new Bl(g[l.topID],J.reverse(),G.reverse(),O)}const rx=new WeakMap;function Df(l,s){if(!l.isAnonymous||s instanceof Ui||s.type!=l)return 1;let r=rx.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof Bl)){r=1;break}r+=Df(l,c)}rx.set(s,r)}return r}function Cp(l,s,r,c,o,d,h,m,g){let b=0;for(let T=c;T<o;T++)b+=Df(l,s[T]);let _=Math.ceil(b*1.5/8),j=[],v=[];function C(T,E,L,$,J){for(let G=L;G<$;){let O=G,Z=E[G],M=Df(l,T[G]);for(G++;G<$;G++){let D=Df(l,T[G]);if(M+D>=_)break;M+=D}if(G==O+1){if(M>_){let D=T[O];C(D.children,D.positions,0,D.children.length,E[O]+J);continue}j.push(T[O])}else{let D=E[G-1]+T[G-1].length-Z;j.push(Cp(l,T,E,O,G,Z,D,null,g))}v.push(Z+J-d)}}return C(s,r,c,o,0),(m||g)(j,v,h)}class CN{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 ia?this.setBuffer(s.context.buffer,s.index,r):s instanceof ml&&this.map.set(s.tree,r)}get(s){return s instanceof ia?this.getBuffer(s.context.buffer,s.index):s instanceof ml?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 qo{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 qo(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,b=0;;m++){let _=m<r.length?r[m]:null,j=_?_.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||b){let C=Math.max(v.from,g)-b,T=Math.min(v.to,j)-b;v=C>=T?null:new qo(C,T,v.tree,v.offset+b,m>0,!!_)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!_)break;g=_.toA,b=_.toA-_.toB}return o}}class AN{startParse(s,r,c){return typeof s=="string"&&(s=new D1(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 D1{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 MN(l){return(s,r,c,o)=>new L1(s,l,r,c,o)}class cx{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 ox(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class O1{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 L1{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 Bl(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 dc(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 H1(this.fragments),r=null,c=null,o=new Hf(new ml(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 b=r.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(b)for(let _ of b.mount.overlay){let j=_.from+b.pos,v=_.to+b.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=z1(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||(U1(o),r&&r.depth++,c&&c.depth++);let b=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new O1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=dx(this.ranges,d.overlay||(o.from<o.to?[new ps(o.from,o.to)]:[]));_.length&&ox(_),(_.length||!d.overlay)&&this.inner.push(new cx(d.parser,_.length?d.parser.startParse(this.input,hx(b,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new ps(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,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 b=r.ranges.length-1;b>=0&&r.ranges[b].to==g.from?r.ranges[b]={from:r.ranges[b].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 b=dx(this.ranges,r.ranges);b.length&&(ox(b),this.inner.splice(r.index,0,new cx(r.parser,r.parser.startParse(this.input,hx(r.mounts,b),b),r.ranges.map(_=>new ps(_.from-r.start,_.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function z1(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 ux(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 U1(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 b(_,j,v,C,T,E){let L=r[E],$=[],J=[];ux(h,_,L,$,J,C);let G=m[L+1],O=m[L+2];g.push($.length);let Z=E?b(L+4,m[L+3],h.set.types[m[L]],G,O-G,E-1):s.toTree();return $.push(Z),J.push(G-C),ux(h,m[L+3],j,$,J,C),new Bl(v,$,J,T)}o.children[d]=b(0,m.length,Ms.none,0,h.length,r.length-1);for(let _ of g){let j=l.tree.children[_],v=l.tree.positions[_];l.yield(new ml(j,v+l.from,_,l._tree))}}class fx{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 Bl)r=r.children[0];else break}return!1}}class H1{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 fx(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 fx(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 dx(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 B1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let _=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(_,j,c);v<C&&b.push(new ps(v,C))}if(g=Math.min(_,j),g==1e9)break;_==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return b}function hx(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),b=Math.min(d.to,m);if(o.overlay){let _=o.overlay.map(v=>new ps(v.from+c,v.to+c)),j=B1(s,_,g,b);for(let v=0,C=g;;v++){let T=v==j.length,E=T?b:j[v].from;if(E>C&&r.push(new qo(C,E,o.tree,-h,d.from>=C||d.openStart,d.to<=E||d.openEnd)),T)break;C=j[v].to}}else r.push(new qo(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let I1=0;class hs{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=I1++}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 Bf(s);return c=>c.modified.indexOf(r)>-1?c:Bf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let q1=0;class Bf{constructor(s){this.name=s,this.instances=[],this.id=q1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&G1(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=Y1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Bf.get(m,g));return d}}function G1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Y1(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 RN(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,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let _=new Go(c,h,g>0?d.slice(0,g):null);s[b]=_.sort(s[b])}}return Dy.add(s)}const Dy=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 Go(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Go{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}}Go.empty=new Go([],2,null);function Oy(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 b=r[g.id];if(b){h=h?h+" "+b:b;break}}return h},scope:c}}function $1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function X1(l,s,r,c=0,o=l.length){let d=new Q1(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function V1(l,s,r,c,o,d=0,h=l.length){let m=d;function g(b,_){if(!(b<=m)){for(let j=l.slice(m,b),v=0;;){let C=j.indexOf(`
117
+ `,v),T=C<0?j.length:C;if(T>v&&c(j.slice(v,T),_),C<0)break;o(),v=C+1}m=b}}X1(s,r,(b,_,j)=>{g(b,""),g(_,j)},d,h),g(h,"")}class Q1{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 b=o,_=K1(s)||Go.empty,j=$1(d,_.tags);if(j&&(b&&(b+=" "),b+=j,_.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),b),_.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),T=this.highlighters.filter(L=>!L.scope||L.scope(v.tree.type)),E=s.firstChild();for(let L=0,$=m;;L++){let J=L<v.overlay.length?v.overlay[L]:null,G=J?J.from+m:g,O=Math.max(r,$),Z=Math.min(c,G);if(O<Z&&E)for(;s.from<Z&&(this.highlightRange(s,O,Z,o,d),this.startSpan(Math.min(Z,s.to),b),!(s.to>=G||!s.nextSibling())););if(!J||G>c)break;$=J.to+m,$>r&&(this.highlightRange(C.cursor(),Math.max(r,J.from+m),Math.min(c,$),"",T),this.startSpan(Math.min(c,$),b))}E&&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),b)}while(s.nextSibling());s.parent()}}}function K1(l){let s=l.type.prop(Dy);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const je=hs.define,hf=je(),Ri=je(),px=je(Ri),mx=je(Ri),Di=je(),pf=je(Di),$h=je(Di),na=je(),ar=je(na),Js=je(),Ws=je(),dp=je(),Mo=je(dp),mf=je(),Ce={comment:hf,lineComment:je(hf),blockComment:je(hf),docComment:je(hf),name:Ri,variableName:je(Ri),typeName:px,tagName:je(px),propertyName:mx,attributeName:je(mx),className:je(Ri),labelName:je(Ri),namespace:je(Ri),macroName:je(Ri),literal:Di,string:pf,docString:je(pf),character:je(pf),attributeValue:je(pf),number:$h,integer:je($h),float:je($h),bool:je(Di),regexp:je(Di),escape:je(Di),color:je(Di),url:je(Di),keyword:Js,self:je(Js),null:je(Js),atom:je(Js),unit:je(Js),modifier:je(Js),operatorKeyword:je(Js),controlKeyword:je(Js),definitionKeyword:je(Js),moduleKeyword:je(Js),operator:Ws,derefOperator:je(Ws),arithmeticOperator:je(Ws),logicOperator:je(Ws),bitwiseOperator:je(Ws),compareOperator:je(Ws),updateOperator:je(Ws),definitionOperator:je(Ws),typeOperator:je(Ws),controlOperator:je(Ws),punctuation:dp,separator:je(dp),bracket:Mo,angleBracket:je(Mo),squareBracket:je(Mo),paren:je(Mo),brace:je(Mo),content:na,heading:ar,heading1:je(ar),heading2:je(ar),heading3:je(ar),heading4:je(ar),heading5:je(ar),heading6:je(ar),contentSeparator:je(na),list:je(na),quote:je(na),emphasis:je(na),strong:je(na),link:je(na),monospace:je(na),strikethrough:je(na),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:mf,documentMeta:je(mf),annotation:je(mf),processingInstruction:je(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 Ce){let s=Ce[l];s instanceof hs&&(s.name=l)}Oy([{tag:Ce.link,class:"tok-link"},{tag:Ce.heading,class:"tok-heading"},{tag:Ce.emphasis,class:"tok-emphasis"},{tag:Ce.strong,class:"tok-strong"},{tag:Ce.keyword,class:"tok-keyword"},{tag:Ce.atom,class:"tok-atom"},{tag:Ce.bool,class:"tok-bool"},{tag:Ce.url,class:"tok-url"},{tag:Ce.labelName,class:"tok-labelName"},{tag:Ce.inserted,class:"tok-inserted"},{tag:Ce.deleted,class:"tok-deleted"},{tag:Ce.literal,class:"tok-literal"},{tag:Ce.string,class:"tok-string"},{tag:Ce.number,class:"tok-number"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],class:"tok-string2"},{tag:Ce.variableName,class:"tok-variableName"},{tag:Ce.local(Ce.variableName),class:"tok-variableName tok-local"},{tag:Ce.definition(Ce.variableName),class:"tok-variableName tok-definition"},{tag:Ce.special(Ce.variableName),class:"tok-variableName2"},{tag:Ce.definition(Ce.propertyName),class:"tok-propertyName tok-definition"},{tag:Ce.typeName,class:"tok-typeName"},{tag:Ce.namespace,class:"tok-namespace"},{tag:Ce.className,class:"tok-className"},{tag:Ce.macroName,class:"tok-macroName"},{tag:Ce.propertyName,class:"tok-propertyName"},{tag:Ce.operator,class:"tok-operator"},{tag:Ce.comment,class:"tok-comment"},{tag:Ce.meta,class:"tok-meta"},{tag:Ce.invalid,class:"tok-invalid"},{tag:Ce.punctuation,class:"tok-punctuation"}]);const Z1="modulepreload",F1=function(l,s){return new URL(l,s).href},gx={},Qe=function(s,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.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]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(_=>{if(_=F1(_,c),_ in gx)return;gx[_]=!0;const j=_.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let E=m.length-1;E>=0;E--){const L=m[E];if(L.href===_&&(!j||L.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":Z1,j||(T.as="script"),T.crossOrigin="",T.href=_,b&&T.setAttribute("nonce",b),document.head.appendChild(T),j)return new Promise((E,L)=>{T.addEventListener("load",E),T.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${_}`)))})}))}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)})},Ly={js:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-BpL4NCNb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Qe(async()=>{const{json:l}=await import("./index-Cu4PsUGS.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Qe(async()=>{const{json:l}=await import("./index-Cu4PsUGS.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Qe(async()=>{const{css:l}=await import("./index-B0Ss0xRi.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Qe(async()=>{const{css:l}=await import("./index-B0Ss0xRi.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Qe(async()=>{const{css:l}=await import("./index-B0Ss0xRi.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Qe(async()=>{const{html:l}=await import("./index-DB25Lbd8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Qe(async()=>{const{html:l}=await import("./index-DB25Lbd8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Qe(async()=>{const{html:l}=await import("./index-DB25Lbd8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Qe(async()=>{const{html:l}=await import("./index-DB25Lbd8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Qe(async()=>{const{markdown:l}=await import("./index-BrAmkvn2.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Qe(async()=>{const{markdown:l}=await import("./index-BrAmkvn2.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Qe(async()=>{const{python:l}=await import("./index-D9qvIR3L.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Qe(async()=>{const{python:l}=await import("./index-D9qvIR3L.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Qe(async()=>{const{yaml:l}=await import("./index-D51RIwGp.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Qe(async()=>{const{yaml:l}=await import("./index-D51RIwGp.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Qe(async()=>{const{rust:l}=await import("./index-CQ0-WYgR.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bee9erGK.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bee9erGK.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bee9erGK.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bee9erGK.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bee9erGK.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Qe(async()=>{const{java:l}=await import("./index-DwamecDE.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Qe(async()=>{const{go:l}=await import("./index-CO3xirid.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Qe(async()=>{const{php:l}=await import("./index-CLScHnZN.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Qe(async()=>{const{sql:l}=await import("./index-CnCCNUTy.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Qe(async()=>{const{xml:l}=await import("./index-B9bs4QFR.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Qe(async()=>{const{xml:l}=await import("./index-B9bs4QFR.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},J1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},W1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function P1(l){const s=W1[l.toLowerCase()]??l.toLowerCase(),r=Ly[s];return r?r().catch(()=>null):null}async function ej(l){const s=(l.split("/").pop()??"").toLowerCase(),r=J1[s]??s.split(".").pop()??"",c=Ly[r];return c?c().catch(()=>null):null}const tj=Oy([{tag:[Ce.keyword,Ce.modifier,Ce.controlKeyword,Ce.moduleKeyword],class:"cmh-key"},{tag:[Ce.propertyName],class:"cmh-prop"},{tag:[Ce.function(Ce.variableName),Ce.labelName],class:"cmh-fn"},{tag:[Ce.color,Ce.constant(Ce.name),Ce.standard(Ce.name),Ce.bool],class:"cmh-const"},{tag:[Ce.typeName,Ce.className,Ce.changed,Ce.annotation,Ce.self,Ce.namespace],class:"cmh-type"},{tag:[Ce.number,Ce.integer,Ce.float],class:"cmh-num"},{tag:[Ce.string,Ce.special(Ce.string),Ce.regexp],class:"cmh-str"},{tag:[Ce.operator,Ce.operatorKeyword,Ce.escape],class:"cmh-op"},{tag:[Ce.meta,Ce.comment],class:"cmh-comment"},{tag:Ce.invalid,class:"cmh-invalid"}]);function gf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function nj(l,s){const r=s?await P1(s):null;if(!r)return gf(l);try{const c=r.language.parser.parse(l);let o="";return V1(l,c,tj,(d,h)=>{o+=h?`<span class="${h}">${gf(d)}</span>`:gf(d)},()=>{o+=`
118
+ `}),o}catch{return gf(l)}}Nt.setOptions({gfm:!0,breaks:!1});function zy(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function Qf(l){const s=await Nt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await nj(c.text,c.lang??""),c.escaped=!0}});return k1.sanitize(s)}function bx(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:zy(l.path)}}function Ua(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function lj(l){return l.split("/").pop()??l}function gr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Of(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function or({x:l,y:s,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,m]=y.useState({left:l,top:s}),[g,b]=y.useState(()=>{const v=r.findIndex(C=>!C.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),T=8,E=Math.max(T,Math.min(l,window.innerWidth-C.width-T)),L=Math.max(T,Math.min(s,window.innerHeight-C.height-T));m({left:E,top:L})},[l,s]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(T){var E;(E=d.current)!=null&&E.contains(T.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 _(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=r.map((T,E)=>({item:T,index:E})).filter(T=>!T.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,E=C.findIndex($=>$.index===g),L=C[(((E===-1?0:E)+T)%C.length+C.length)%C.length];L&&b(L.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=r[g];T&&_(T)}}}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:()=>b(C),onClick:()=>_(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 sj=3500,aj=9e3,xx=220;function _r({result:l,onDismiss:s}){const[r,c]=y.useState(l),[o,d]=y.useState(!1);if(y.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?sj:aj,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+xx);return()=>{clearTimeout(g),clearTimeout(b)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},xx)};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 aa({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=y.useState(l),m=y.useRef(null);y.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===l)return o();c(b)}return i.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:b=>h(b.target.value),onBlur:g,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),o())}})}function kc({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 ij=500,ir="application/x-ccv-fs-path",rj=200;function cj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:_,onOpen:j,onCreate:v,onRename:C,onMove:T,onCopy:E,onDelete:L,onRefresh:$,onClose:J,zoomed:G,onToggleZoom:O}){const[Z,M]=y.useState(""),[D,B]=y.useState(null),[ne,he]=y.useState(null),[P,ue]=y.useState(null),[_e,De]=y.useState(null),[Ne,A]=y.useState(null),[fe,z]=y.useState(null),pe=$f("(hover: hover)"),ke=y.useRef(null),k=y.useMemo(()=>fj(d),[d]);function V(le){return!(!P||le===P.path||P.kind==="dir"&&le.startsWith(`${P.path}/`)||le===gr(P.path))}function ce(le){return!(!Ne||le===Ne.path||Ne.kind==="dir"&&le.startsWith(`${Ne.path}/`)||Ne.mode==="cut"&&le===gr(Ne.path))}function ge(le){A({path:le.path,kind:le.kind,mode:"copy"})}function Ae(le){A({path:le.path,kind:le.kind,mode:"cut"})}function Se(le){!Ne||!ce(le)||(le&&!r.has(le)&&_(le),Ne.mode==="cut"?(T(Ne.path,le),A(null)):E(Ne.path,le))}function Te(le,be){const Le=le.touches[0];if(!Le)return;const H={timer:0,x:Le.clientX,y:Le.clientY,el:le.currentTarget,fired:!1};H.timer=window.setTimeout(()=>{H.fired=!0,be(H.x,H.y,H.el)},ij),ke.current=H}function Tt(le){const be=ke.current,Le=le.touches[0];!be||!Le||Math.hypot(Le.clientX-be.x,Le.clientY-be.y)>10&&(window.clearTimeout(be.timer),ke.current=null)}function Ye(le){const be=ke.current;be&&(window.clearTimeout(be.timer),be.fired&&le.preventDefault())}function et(){var le;return(le=ke.current)!=null&&le.fired?(ke.current=null,!0):!1}function Xe(le,be,Le,H){M((H==null?void 0:H.path)??""),z({x:le,y:be,opener:Le,entry:H})}function Qt(){const le=fe==null?void 0:fe.opener;z(null),le!=null&&le.isConnected&&le.focus()}function tt(le){return{onContextMenu:be=>{be.preventDefault(),Xe(be.clientX,be.clientY,be.currentTarget,le)},onTouchStart:be=>Te(be,(Le,H,W)=>Xe(Le,H,W,le)),onTouchMove:Tt,onTouchEnd:Ye,onTouchCancel:Ye}}function Yt(le){le.target===le.currentTarget&&(le.preventDefault(),Xe(le.clientX,le.clientY,le.currentTarget,null))}function nt(le){le.target===le.currentTarget&&Te(le,(be,Le,H)=>Xe(be,Le,H,null))}function en(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const be=le.key.toLowerCase();if(be==="v"){le.preventDefault(),Se(Pn());return}if(!Z)return;const Le=yx(s,Z);Le&&(be==="c"?(le.preventDefault(),ge(Le)):be==="x"&&(le.preventDefault(),Ae(Le)))}function $t(le){return be=>{be.dataTransfer.effectAllowed="move",be.dataTransfer.setData(ir,le.path),ue({path:le.path,kind:le.kind})}}function tn(){ue(null),De(null)}function nn(le){return be=>{be.dataTransfer.types.includes(ir)&&(be.stopPropagation(),!(le.kind!=="dir"||!V(le.path))&&(be.preventDefault(),De(le.path)))}}function pn(le){return be=>{if(!be.dataTransfer.types.includes(ir)||(be.stopPropagation(),le.kind!=="dir"||!V(le.path)))return;be.preventDefault();const Le=be.dataTransfer.getData(ir);De(null),Le&&T(Le,le.path)}}function Sn(le){!le.dataTransfer.types.includes(ir)||!V("")||(le.preventDefault(),De(""))}function mn(le){if(!le.dataTransfer.types.includes(ir)||!V(""))return;le.preventDefault();const be=le.dataTransfer.getData(ir);De(null),be&&T(be,"")}const[cn,Ke]=y.useState(""),zt=cn.trim(),gn=zt.length>0,ut=y.useRef(null),Je=y.useRef(g);Je.current=g;function An(le){Ke(le),ut.current&&clearTimeout(ut.current);const be=le.trim();if(!be){Je.current("");return}ut.current=setTimeout(()=>Je.current(be),rj)}function on(le){ut.current&&clearTimeout(ut.current),Ke(""),Je.current(""),M(le.path),b(le)}const wn=gn&&(m==null?void 0:m.query)===zt?m:null;function Pn(){if(Z==="")return"";const le=yx(s,Z);if((le==null?void 0:le.kind)==="dir")return Z;const be=Z.lastIndexOf("/");return be===-1?"":Z.slice(0,be)}function Xt(le,be){const Le=be??Pn();Le&&!r.has(Le)&&_(Le),he({parent:Le,kind:le})}function wt(){if(!fe)return[];const le=H=>pe?H:void 0;if(!fe.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:le("Ctrl+V"),disabled:!ce(""),onSelect:()=>Se("")},{id:"new-file",label:"Создать файл",onSelect:()=>Xt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Xt("dir","")}];const be=fe.entry,Le=[be.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(be.path)}:{id:"toggle",label:r.has(be.path)?"Свернуть":"Развернуть",onSelect:()=>_(be.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>ge(be)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>Ae(be)}];return be.kind==="dir"&&(Le.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!ce(be.path),onSelect:()=>Se(be.path)}),Le.push({id:"new-file",label:"Создать файл",onSelect:()=>Xt("file",be.path)}),Le.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Xt("dir",be.path)})),Le.push({id:"rename",label:"Переименовать",onSelect:()=>B(be.path)}),Le.push({id:"delete",label:"Удалить",onSelect:()=>L(be)}),Le}const Kt=gn?[]:Et("",0);function Et(le,be){const Le=s[le],H=[];if(ne&&ne.parent===le&&H.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:Ha(be),children:[i.jsx("span",{className:"fsrow__icon",children:ne.kind==="dir"?i.jsx(qf,{}):i.jsx(Gf,{})}),i.jsx(aa,{className:"rename--file",value:"",placeholder:ne.kind==="dir"?"имя каталога":"имя файла",onCommit:W=>{he(null),v(le,ne.kind,W)},onCancel:()=>he(null)})]},`draft:${le}`)),!Le)return H.push(i.jsx("p",{className:"fsrow__pending",style:Ha(be),children:"читаем…"},`wait:${le}`)),H;Le.length===0&&!ne&&H.push(i.jsx("p",{className:"fsrow__pending",style:Ha(be),children:"пусто"},`empty:${le}`));for(const W of Le){const xe=W.kind==="dir"&&r.has(W.path);H.push(D===W.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:Ha(be),children:[i.jsx("span",{className:"fsrow__icon",children:W.kind==="dir"?i.jsx(qf,{open:xe}):i.jsx(Gf,{})}),i.jsx(aa,{className:"rename--file",value:W.name,placeholder:"новое имя",onCommit:Be=>{B(null),C(W.path,Be)},onCancel:()=>B(null)})]},W.path):i.jsx(oj,{entry:W,depth:be,open:xe,active:W.path===c,selected:W.path===Z,dirty:o.has(W.path),gitStatus:k.get(W.path),dragging:(P==null?void 0:P.path)===W.path,dropTarget:_e===W.path,cut:(Ne==null?void 0:Ne.mode)==="cut"&&Ne.path===W.path,onClick:()=>{et()||(M(W.path),W.kind==="dir"?_(W.path):j(W.path))},onRename:()=>B(W.path),onDelete:()=>L(W),onDragStart:$t(W),onDragEnd:tn,onDragOver:nn(W),onDrop:pn(W),...tt(W)},W.path)),xe&&H.push(...Et(W.path,be+1))}return H}function Yn(){if(!wn)return[i.jsx("p",{className:"fsrow__pending",style:Ha(0),children:"ищем…"},"search:wait")];if(wn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:Ha(0),children:"ничего не найдено"},"search:empty")];const le=wn.entries.map(be=>i.jsx(uj,{entry:be,gitStatus:k.get(be.path),onClick:()=>on(be)},be.path));return wn.truncated&&le.push(i.jsxs("p",{className:"fsrow__pending",style:Ha(0),children:["показаны первые ",wn.entries.length," — уточните запрос"]},"search:truncated")),le}return i.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(G?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:en,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{O&&(le.target.closest("button")||O())},children:[i.jsx(mj,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Xt("file"),children:i.jsx(hj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Xt("dir"),children:i.jsx(pj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:$,children:"↻"}),O&&i.jsx("button",{className:"sidepane__btn",title:G?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":G?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":G,onClick:O,children:i.jsx(kc,{active:G})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:J,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(gj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:cn,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>An(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),cn?An(""):le.currentTarget.blur())}}),cn&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>An(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(_e===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Sn,onDrop:mn,onContextMenu:Yt,onTouchStart:nt,onTouchMove:Tt,onTouchEnd:Ye,onTouchCancel:Ye,children:gn?Yn():Kt}),i.jsx(_r,{result:h}),fe&&i.jsx(or,{x:fe.x,y:fe.y,items:wt(),onClose:Qt})]})}function oj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:_,onRename:j,onDelete:v,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:L,onContextMenu:$,onTouchStart:J,onTouchMove:G,onTouchEnd:O,onTouchCancel:Z}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return i.jsxs("div",{className:M,style:Ha(s),draggable:!0,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:L,onContextMenu:$,onTouchStart:J,onTouchMove:G,onTouchEnd:O,onTouchCancel:Z,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:Uy(l),children:[i.jsx("span",{className:"fsrow__icon"+If("fsrow__icon",h),children:l.kind==="dir"?i.jsx(qf,{open:r}):i.jsx(Gf,{})}),i.jsx("span",{className:"fsrow__name"+If("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 uj({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:Ha(0),onClick:r,title:Uy(l),children:[i.jsx("span",{className:"fsrow__icon"+If("fsrow__icon",s),children:l.kind==="dir"?i.jsx(qf,{}):i.jsx(Gf,{})}),i.jsx("span",{className:"fsrow__name"+If("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 Uy(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Ha(l){return{"--depth":l}}function yx(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 fj(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=dj(o.status);if(!d)continue;c(o.path,d);let h=gr(o.path);for(;c(h,d),!!h;)h=gr(h)}return s}function dj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function If(l,s){return s?` ${l}--git-${s}`:""}function qf({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 Gf(){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 hj(){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 pj(){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 mj(){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 gj(){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 bj=200;function xj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=y.useState(""),b=m.trim(),_=b.length>0,j=y.useRef(null),v=y.useRef(r);v.current=r;function C(L){g(L),j.current&&clearTimeout(j.current);const $=L.trim();if(!$){v.current("");return}j.current=setTimeout(()=>v.current($),bj)}const T=_&&(s==null?void 0:s.query)===b?s:null;function E(){if(!T)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(T.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const L=[];let $="";for(const J of T.matches)J.path!==$&&($=J.path,L.push(i.jsx("p",{className:"searchgroup__path",title:J.path,children:J.path},`path:${J.path}`))),L.push(i.jsx(yj,{match:J,onClick:()=>c(J)},`${J.path}:${J.line}:${J.column}`));return T.truncated&&L.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),L}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:L=>{h&&(L.target.closest("button")||h())},children:[i.jsx(_j,{}),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(kc,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(vj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:L=>C(L.target.value),onKeyDown:L=>{L.stopPropagation(),L.key==="Escape"&&(L.preventDefault(),m?C(""):L.currentTarget.blur())}}),m&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?E():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function yj({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 _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("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function vj(){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 bf=null;function jj(){return bf||(bf=Promise.all([Qe(()=>import("./index-DzgVil07.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Qe(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Qe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Qe(()=>import("./index-VZG_Pg4O.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Qe(()=>import("./codemirror-DcwBBoHv.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 bf=null,l})),bf}function Sj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),m=y.useRef(null),g=y.useRef(null),b=y.useRef(new Map),_=y.useRef(new Map),j=y.useRef(new Set),v=y.useRef(null),C=y.useRef(o),T=y.useRef(d),E=y.useRef(l),L=y.useRef(r),$=y.useRef(s);C.current=o,T.current=d,E.current=l,L.current=r,$.current=s;const[J,G]=y.useState("loading"),[O,Z]=y.useState(!1);function M(B,ne,he,P,ue){const _e=b.current.get(P),De=_.current.get(P)===ue;if(_e&&De)he.setState(_e);else{const A=B.EditorState.create({doc:$.current,extensions:[B.basicSetup,B.Prec.highest(B.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(E.current),!0)}])),B.keymap.of([B.indentWithTab]),ne.of([]),B.editorTheme,B.editorHighlight,B.EditorView.updateListener.of(fe=>{fe.docChanged&&C.current(E.current,fe.state.doc.toString())})]});b.current.set(P,A),_.current.set(P,ue),he.setState(A),j.current.delete(P)}if(j.current.has(P))return()=>{};let Ne=!1;return ej(P).then(A=>{Ne||!A||E.current!==P||(he.dispatch({effects:ne.reconfigure(A)}),b.current.set(P,he.state),j.current.add(P))}),()=>{Ne=!0}}y.useEffect(()=>{if(!h.current)return;let ne=!1,he=null,P=null;G("loading"),Z(!1);const ue=window.setTimeout(()=>{ne||Z(!0)},200);return(async()=>{let _e;try{_e=await jj()}catch{window.clearTimeout(ue),ne||G("error");return}if(ne||!h.current)return;window.clearTimeout(ue);const De=new _e.Compartment;v.current=De,g.current=_e,P=new _e.EditorView({parent:h.current}),m.current=P,he=M(_e,De,P,E.current,L.current),G("ready")})(),()=>{ne=!0,window.clearTimeout(ue),he==null||he(),P==null||P.destroy(),m.current===P&&(m.current=null),g.current=null,v.current=null}},[]),y.useEffect(()=>{const B=g.current,ne=m.current,he=v.current;if(!(!B||!ne||!he))return M(B,he,ne,l,r)},[l,r]);const D=y.useRef(0);return y.useEffect(()=>{const B=m.current,ne=g.current;if(!B||!ne||!c||c.token===D.current)return;D.current=c.token;const he=B.state.doc.lines,P=Math.min(Math.max(c.line,1),he),ue=B.state.doc.line(P),_e=Math.min(ue.from+Math.max(c.column-1,0),ue.to);B.dispatch({selection:ne.EditorSelection.cursor(_e),effects:ne.EditorView.scrollIntoView(_e,{y:"center"})}),B.focus()},[c]),y.useEffect(()=>()=>{const B=m.current;B&&b.current.set(l,B.state)},[l]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(J==="ready"?"":" is-hidden")}),J==="loading"&&O&&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:"Загружается редактор…"})]}),J==="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 As({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=y.useState(!1),[b,_]=y.useState(0),j=y.useRef(null),v=y.useRef(null),C=s.find(L=>L.value===l)??null;y.useEffect(()=>{if(!m)return;const L=s.findIndex($=>$.value===l);_(L===-1?0:L)},[m]),y.useEffect(()=>{if(!m)return;function L($){var J;(J=j.current)!=null&&J.contains($.target)||g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[m]),y.useEffect(()=>{var L,$;m&&(($=(L=v.current)==null?void 0:L.querySelector(".is-cursor"))==null||$.scrollIntoView({block:"nearest"}))},[m,b]),y.useEffect(()=>{if(!m)return;const L=v.current,$=wj(j.current);if(!L||!$)return;const J=L.getBoundingClientRect().bottom-$.getBoundingClientRect().bottom;J>0&&($.scrollTop+=Math.min(J+8,L.offsetHeight))},[m]);function T(L){g(!1),L.value!==l&&r(L.value)}function E(L){if(L.key==="Escape"){if(!m)return;L.preventDefault(),L.stopPropagation(),g(!1);return}if(L.key==="ArrowDown"||L.key==="ArrowUp"){if(L.preventDefault(),!m)return g(!0);const $=L.key==="ArrowDown"?1:s.length-1;return _(J=>(J+$)%s.length)}if(L.key==="Enter"||L.key===" "){if(L.preventDefault(),!m)return g(!0);const $=s[b];$&&T($)}}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(L=>!L),onKeyDown:E,children:[i.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),i.jsx(kj,{})]}),m&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((L,$)=>i.jsxs("button",{type:"button",role:"option","aria-selected":L.value===l,className:"select__option"+($===b?" is-cursor":"")+(L.value===l?" is-on":""),onMouseEnter:()=>_($),onClick:()=>T(L),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:L.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:L.label}),L.hint&&i.jsx("span",{className:"select__hint",children:L.hint})]},L.value))})]})}function wj(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 kj(){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 Nj(){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 Tj(){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 Ej(){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 Cj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){y.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=Aj(r,s);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Of(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(Rj,{url:m}):s.startsWith("video/")?i.jsx(Oj,{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 Aj(l,s){const[r,c]=y.useState(null);return y.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 Mi=1,Hy=8,xf=1.25;function Mj(l){return Math.min(Hy,Math.max(Mi,l))}function Rj({url:l}){const[s,r]=y.useState({scale:Mi,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function m(C,T,E){r(L=>{const $=Mj(L.scale*C);if($===L.scale)return L;if($<=Mi)return{scale:Mi,x:0,y:0};const J=(T-L.x)/L.scale,G=(E-L.y)/L.scale;return{scale:$,x:T-$*J,y:E-$*G}})}y.useEffect(()=>{const C=d.current;if(!C)return;function T(E){E.preventDefault();const L=C.getBoundingClientRect(),$=E.clientX-L.left-L.width/2,J=E.clientY-L.top-L.height/2;m(E.deltaY<0?xf:1/xf,$,J)}return C.addEventListener("wheel",T,{passive:!1}),()=>C.removeEventListener("wheel",T)},[]);function g(C){s.scale<=Mi||(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 b(C){const T=h.current;!T||T.pointerId!==C.pointerId||r(E=>({...E,x:T.origX+(C.clientX-T.startX),y:T.origY+(C.clientY-T.startY)}))}function _(){h.current=null,o(!1)}const j=s.scale>Mi,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:b,onPointerUp:_,onPointerCancel:_,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<=Mi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/xf,0,0),children:i.jsx(Tj,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:s.scale>=Hy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(xf,0,0),children:i.jsx(Nj,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Mi,x:0,y:0}),children:i.jsx(Ej,{})})]})]})}const Dj=[{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 Oj({url:l}){const s=y.useRef(null),[r,c]=y.useState("1");return y.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(As,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Dj})]})]})}function Lj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=Ua(l),b=zy(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:[Of(l.size),l.eol==="crlf"&&" · CRLF"]}),b&&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(Cj,{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:["Это не текстовый файл — редактировать его здесь нечем. ",Of(l.size)," на диске."]}):l.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Of(l.size),"). Такие правит агент, а не браузер."]}):b&&l.previewMode?i.jsx(zj,{text:l.text}):i.jsx(Sj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function zj({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Qf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function Uj({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:lj(m.path)}),Ua(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(kc,{active:d})})]})}function ds(l){return l.claudeSessionId??l.id}function yf(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 _x(l){return l.state!=="closed"}function vx(l){return[...l.filter(_x),...l.filter(s=>!_x(s))]}function _f(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 By(l){return`${l} ${Ap(l,"агент","агента","агентов")}`}function Hj(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(By(s)),r>0&&c.push(`${r} ${Ap(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Bj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function Ij(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 qj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Gj({tasks:l,onStop:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(()=>Date.now()),[h,m]=y.useState(()=>new Set);y.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),y.useEffect(()=>{m(b=>{const _=new Set(l.map(v=>v.id)),j=new Set([...b].filter(v=>_.has(v)));return j.size===b.size?b:j})},[l]);const g=b=>{m(_=>new Set(_).add(b)),s(b),window.setTimeout(()=>{m(_=>{if(!_.has(b))return _;const j=new Set(_);return j.delete(b),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(b=>!b),children:[i.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),i.jsx("span",{className:"tasks__summary",children:Hj(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(b=>{const _=h.has(b.id);return i.jsxs("li",{className:_?"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:Bj(b)}),b.background&&i.jsx("span",{className:"task__bg",children:"фон"}),i.jsx("span",{className:"task__time",children:Ij(o-b.startedAt)})]}),i.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&i.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),i.jsxs("div",{className:"task__stats",children:[qj(b.tokens)," · ",b.toolUses," ",Ap(b.toolUses,"вызов","вызова","вызовов")]})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:_?"Останавливается":"Стоп"})]},b.id)})})]})}const Yj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Iy({className:l}){return i.jsx("img",{src:Yj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const $j=450,Xj=6,vf=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Vj({disabled:l,onStart:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(0),[h,m]=y.useState({left:0,top:0}),g=y.useRef(null),b=y.useRef(null),_=y.useRef(null);function j(){_.current&&window.clearTimeout(_.current.timer),_.current=null}function v(){j(),d(0),c(!0)}function C(M){var D;c(!1),M&&((D=g.current)==null||D.focus())}function T(M){if(l||M.button!==0)return;const D={timer:0,x:M.clientX,y:M.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,v()},$j),_.current=D}function E(M){const D=_.current;!D||D.fired||Math.hypot(M.clientX-D.x,M.clientY-D.y)>Xj&&j()}function L(){_.current&&!_.current.fired&&j()}function $(M){var D;if((D=_.current)!=null&&D.fired){_.current=null,M.preventDefault();return}l||s("claude")}function J(M){M.preventDefault(),!l&&v()}function G(M){if(l)return;(M.key==="ArrowDown"||M.key==="ArrowUp"||M.key==="Enter"&&M.shiftKey)&&(M.preventDefault(),v())}y.useLayoutEffect(()=>{if(!r)return;const M=g.current,D=b.current;if(!M||!D)return;const B=M.getBoundingClientRect(),ne=D.getBoundingClientRect(),he=8,P=Math.max(he,Math.min(B.right-ne.width,window.innerWidth-ne.width-he));let ue=B.top-ne.height-8;ue<he&&(ue=Math.min(B.bottom+8,window.innerHeight-ne.height-he)),m({left:P,top:ue})},[r]),y.useLayoutEffect(()=>{var M;r&&((M=b.current)==null||M.focus())},[r]),y.useLayoutEffect(()=>{if(!r)return;function M(D){var ne,he;const B=D.target;!((ne=b.current)!=null&&ne.contains(B))&&!((he=g.current)!=null&&he.contains(B))&&C(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[r]);function O(M){C(!1),s(M.id)}function Z(M){if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),C(!0);return}if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const D=M.key==="ArrowDown"?1:-1;d(B=>(B+D+vf.length)%vf.length);return}if(M.key==="Enter"||M.key===" "){M.preventDefault();const D=vf[o];D&&O(D);return}M.key==="Tab"&&C(!1)}return i.jsxs("div",{className:"newsession",children:[i.jsxs("button",{ref:g,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:"Удерживайте, чтобы выбрать агента","aria-haspopup":"menu","aria-expanded":r,onClick:$,onContextMenu:J,onPointerDown:T,onPointerMove:E,onPointerUp:L,onPointerCancel:L,onPointerLeave:L,onKeyDown:G,children:["+ Сессия",i.jsx(Qj,{})]}),r&&i.jsx("div",{ref:b,className:"newsession__menu",style:{left:h.left,top:h.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Z,children:vf.map((M,D)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(D===o?" is-cursor":""),onMouseEnter:()=>d(D),onClick:()=>O(M),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${M.id}`,"aria-hidden":"true",children:M.id==="antigravity"?i.jsx(Iy,{className:"newsession__mark-logo"}):i.jsx(Kj,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:M.label}),i.jsx("span",{className:"newsession__hint",children:M.hint})]})]},M.id))})]})}function Qj(){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 Kj(){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 qy="ccv:sidebar.collapsed",Gy="ccv:sidebar.mode",Yy="ccv:sidebar.foldersCollapsed",Zj=500,Xh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function Fj({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,sessions:g,archived:b,pinned:_,live:j,listOrder:v,liveSessionsFirst:C,onReorder:T,activeWorkspaceId:E,activeSessionId:L,onSelectWorkspace:$,onSelectSession:J,onRenameSession:G,onStopSession:O,onPinSessions:Z,onSelectPinned:M,onCloseWorkspaces:D,onRestoreWorkspaces:B,onArchiveSessions:ne,onUnarchiveSessions:he,onCreateFolder:P,onRenameFolder:ue,onSetFolderColor:_e,onDeleteFolder:De,onAssignToFolder:Ne,onOpenWorkspace:A,onNewSession:fe,onOpenExtensions:z,account:pe,onOpenAccount:ke,relay:k,onOpenRelay:V,onOpenSettings:ce,themeMode:ge,onCycleTheme:Ae}){var xs;const[Se,Te]=y.useState(null),[Tt,Ye]=y.useState(null),[et,Xe]=y.useState(null);function Qt(w){return(et==null?void 0:et.folderId)===w.id?et.color??void 0:w.color}function tt(w){const ie=w&&Qt(w);return ie?{"--folder-color":ie}:void 0}function Yt(w){return w?i.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const nt=y.useRef(void 0),[en,$t]=y.useState(null),[tn,nn]=y.useState(""),[pn,Sn]=y.useState(fS),[mn,cn]=y.useState(dS),[Ke,zt]=y.useState(hS);function gn(w){zt(w);try{localStorage.setItem(Gy,w)}catch{}}const ut=tn.trim().toLowerCase(),Je=ut!=="",An=y.useMemo(()=>yf(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),on=y.useMemo(()=>{const w=yf(g,E?v==null?void 0:v.sessions[E]:void 0,ds,"top");return C?vx(w):w},[g,v,E,C]),wn=y.useMemo(()=>{const w=yf(_,v==null?void 0:v.pinned,ds,"bottom");return C?vx(w):w},[_,v,C]),Pn=y.useMemo(()=>yf(j,v==null?void 0:v.live,ds,"bottom"),[j,v]),Xt=y.useMemo(()=>Je?An.filter(w=>w.name.toLowerCase().includes(ut)||w.path.toLowerCase().includes(ut)):An,[An,ut,Je]),wt=y.useMemo(()=>Je?o.filter(w=>w.name.toLowerCase().includes(ut)||w.path.toLowerCase().includes(ut)):o,[o,ut,Je]),Kt=y.useMemo(()=>Je?on.filter(w=>(w.title??"").toLowerCase().includes(ut)):on,[on,ut,Je]),Et=y.useMemo(()=>Je?b.filter(w=>(w.title??"").toLowerCase().includes(ut)):b,[b,ut,Je]),Yn=w=>{var ie;return((ie=c.find(Me=>Me.id===w))==null?void 0:ie.name)??"—"},le=w=>{var ie;return(ie=c.find(Me=>Me.id===w))==null?void 0:ie.path},be=y.useMemo(()=>Je?wn.filter(w=>(w.title??"").toLowerCase().includes(ut)||Yn(w.workspaceId).toLowerCase().includes(ut)):wn,[wn,c,ut,Je]),Le=y.useMemo(()=>Je?Pn.filter(w=>(w.title??"").toLowerCase().includes(ut)||Yn(w.workspaceId).toLowerCase().includes(ut)):Pn,[Pn,c,ut,Je]),H=!Je;function W(w){Sn(ie=>{const Me=ie.includes(w)?ie.filter(Fe=>Fe!==w):[...ie,w];try{localStorage.setItem(qy,JSON.stringify(Me))}catch{}return Me})}const xe=w=>!pn.includes(w);function Be(w){cn(ie=>{const Me=ie.includes(w)?ie.filter(Fe=>Fe!==w):[...ie,w];try{localStorage.setItem(Yy,JSON.stringify(Me))}catch{}return Me})}const pt=w=>!mn.includes(w),Mn=y.useMemo(()=>Ro(Xt,d),[Xt,d]),bn=y.useMemo(()=>Ro(wt,d),[wt,d]),Rn=y.useMemo(()=>Ro(Kt,h),[Kt,h]),ul=y.useMemo(()=>Ro(Et,h),[Et,h]),gl=y.useMemo(()=>Ro(be,m,w=>w.pinnedFolderId),[be,m]),ra=y.useMemo(()=>({groups:[],ungrouped:Le}),[Le]),Ql=((v==null?void 0:v.workspaces.length)??0)>0,ms=E?(((xs=v==null?void 0:v.sessions[E])==null?void 0:xs.length)??0)>0:!1,Rs=((v==null?void 0:v.pinned.length)??0)>0,Dn=((v==null?void 0:v.live.length)??0)>0,Kl=jf({enabled:H,scope:"workspaces",itemKey:w=>w.id,groups:Mn.groups,ungrouped:Mn.ungrouped,onReorder:T}),bl=jf({enabled:H,scope:"sessions",workspaceId:E??void 0,itemKey:ds,groups:Rn.groups,ungrouped:Rn.ungrouped,onReorder:T}),$n=jf({enabled:H,scope:"pinned",itemKey:ds,groups:gl.groups,ungrouped:gl.ungrouped,onReorder:T}),Vt=jf({enabled:H,scope:"live",itemKey:ds,groups:ra.groups,ungrouped:ra.ungrouped,onReorder:T});y.useEffect(()=>{var Me;if(!et)return;const ie=(Me=[...gl.groups,...Mn.groups,...bn.groups,...Rn.groups,...ul.groups].find(Fe=>Fe.folder.id===et.folderId))==null?void 0:Me.folder;ie&&ie.color===(et.color??void 0)&&Xe(null)},[et,gl,Mn,bn,Rn,ul]),y.useEffect(()=>()=>window.clearTimeout(nt.current),[]);const $e=Qh(Xt),_t=Qh(wt),xl=Qh(Kt),[lt,Zl]=y.useState(null),[Ut,el]=y.useState(null),[kt,Tl]=y.useState(null),[ln,kn]=y.useState(null),[mt,Ze]=y.useState(null),On=y.useRef(null);function El(w,ie){const Me=w.touches[0];if(!Me)return;const Fe={timer:0,x:Me.clientX,y:Me.clientY,el:w.currentTarget,fired:!1};Fe.timer=window.setTimeout(()=>{Fe.fired=!0,ie(Fe.x,Fe.y,Fe.el)},Zj),On.current=Fe}function xn(w){const ie=On.current,Me=w.touches[0];!ie||!Me||Math.hypot(Me.clientX-ie.x,Me.clientY-ie.y)>10&&(window.clearTimeout(ie.timer),On.current=null)}function Nn(w){const ie=On.current;ie&&(window.clearTimeout(ie.timer),ie.fired&&w.preventDefault())}function tl(){var w;return(w=On.current)!=null&&w.fired?(On.current=null,!0):!1}function gs(){const w=lt==null?void 0:lt.opener;Zl(null),w!=null&&w.isConnected&&w.focus()}function yn(){const w=Ut==null?void 0:Ut.opener;el(null),w!=null&&w.isConnected&&w.focus()}function Fl(){const w=kt==null?void 0:kt.opener;Tl(null),w!=null&&w.isConnected&&w.focus()}function fl(){const w=ln==null?void 0:ln.opener;kn(null),w!=null&&w.isConnected&&w.focus()}function nl(){const w=mt==null?void 0:mt.opener;Ze(null),w!=null&&w.isConnected&&w.focus()}function Ln(w){return{onContextMenu:ie=>{ie.preventDefault(),Zl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:$e.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Zl({x:Me,y:Fe,opener:_n,ids:$e.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ht(w){return{onContextMenu:ie=>{ie.preventDefault(),el({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:_t.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>el({x:Me,y:Fe,opener:_n,ids:_t.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ia(w){return{onContextMenu:ie=>{ie.preventDefault(),Tl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:xl.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Tl({x:Me,y:Fe,opener:_n,ids:xl.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Hi(w){return{onContextMenu:ie=>{ie.preventDefault(),kn({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>kn({x:Me,y:Fe,opener:_n,ids:[w.id]})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ds(w){return{onContextMenu:ie=>{ie.preventDefault(),Ze({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Ze({x:Me,y:Fe,opener:_n,ids:[w.id]})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}const Os=g.filter(w=>w.state!=="closed").length,yl=lt?Xt.find(w=>w.id===lt.ids[0]):void 0,qa=lt?[{id:"close",label:lt.ids.length>1?`Закрыть проекты (${lt.ids.length})`:"Закрыть проект",onSelect:()=>{D(lt.ids),$e.clear()}},...Do({folders:d,ids:lt.ids,hasFolder:(yl==null?void 0:yl.folderId)!=null,assign:(w,ie)=>Ne("workspace",w,ie),onClear:()=>$e.clear(),onNewFolder:()=>$t("workspace")}),...lt.ids.length===1&&H?Kl.menuItems(lt.ids[0],Ql):[]]:[],zn=lt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(E&&lt.ids.includes(E)&&Os>0?` в нём сейчас незавершённых сессий: ${Os} — при закрытии они остановятся на хосте.`:""):void 0,bs=Ut?wt.find(w=>w.id===Ut.ids[0]):void 0,Jl=Ut?[{id:"restore",label:Ut.ids.length>1?`Вернуть проекты (${Ut.ids.length})`:"Вернуть проект",onSelect:()=>{B(Ut.ids),_t.clear()}},...Do({folders:d,ids:Ut.ids,hasFolder:(bs==null?void 0:bs.folderId)!=null,assign:(w,ie)=>Ne("workspace",w,ie),onClear:()=>_t.clear(),onNewFolder:()=>$t("workspace")})]:[],sn=Ut?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Bt=kt?Kt.find(w=>w.id===kt.ids[0]):void 0,me=(Bt==null?void 0:Bt.pinned)!==!0,N=kt?[...kt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Te(kt.ids[0])}]:[],{id:"pin",label:me?kt.ids.length>1?`Закрепить (${kt.ids.length})`:"Закрепить":kt.ids.length>1?`Открепить (${kt.ids.length})`:"Открепить",onSelect:()=>{Bt&&Z(Bt.workspaceId,kt.ids,me),xl.clear()}},{id:"archive",label:kt.ids.length>1?`Убрать в архив (${kt.ids.length})`:"Убрать в архив",onSelect:()=>{ne(E,kt.ids),xl.clear()}},...Do({folders:h,ids:kt.ids,hasFolder:(Bt==null?void 0:Bt.folderId)!=null,assign:(w,ie)=>Ne("session",w,ie,E),onClear:()=>xl.clear(),onNewFolder:()=>$t("session")}),...kt.ids.length===1&&H&&Bt?bl.menuItems(ds(Bt),ms):[]]:[],Y=kt?Xh:void 0,ae=ln?be.find(w=>w.id===ln.ids[0]):void 0,we=ln?[{id:"rename",label:"Переименовать",onSelect:()=>Te(ln.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ae&&Z(ae.workspaceId,[ae.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ae&&ne(ae.workspaceId,[ae.id])}},...ae&&ae.workspaceId===E?Do({folders:h,ids:[ae.id],hasFolder:ae.folderId!=null,assign:(w,ie)=>Ne("session",w,ie,ae.workspaceId),onClear:()=>{},onNewFolder:()=>$t("session")}):[],...eS(ae?Do({folders:m,ids:[ae.id],hasFolder:ae.pinnedFolderId!=null,assign:(w,ie)=>Ne("pinned",w,ie),onClear:()=>{},onNewFolder:()=>$t("pinned")}):[]),...H&&ae?$n.menuItems(ds(ae),Rs):[]]:[],ve=mt?Le.find(w=>w.id===mt.ids[0]):void 0,ze=mt?[{id:"stop",label:"Остановить",onSelect:()=>{ve&&O(ve)}},{id:"rename",label:"Переименовать",onSelect:()=>Te(mt.ids[0])},{id:"pin",label:(ve==null?void 0:ve.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{ve&&Z(ve.workspaceId,[ve.id],ve.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ve&&ne(ve.workspaceId,[ve.id])}},...H&&ve?Vt.menuItems(ds(ve),Dn):[]]:[];function ot(w,ie){return i.jsxs("div",{"data-row-key":w.id,className:ac(w.id===E,$e.selected.includes(w.id),!1,!!ie)+Kl.dropClass(w.id),style:tt(ie),...Ln(w),children:[Yt(ie),H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...Kl.gripHandlers(w.id),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:Me=>{tl()||$e.click(Me,w,()=>$(w.id))},onKeyDown:Me=>Kl.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 un(w,ie){return i.jsxs("div",{className:ac(w.id===E,_t.selected.includes(w.id),!1,!!ie),style:tt(ie),...Ht(w),children:[Yt(ie),i.jsxs("button",{className:"row__main",onClick:Me=>{tl()||_t.click(Me,w,()=>$(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:vS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>B([w.id]),children:"Вернуть"})]},w.id)}function Mt(w,ie){const Me=ds(w);return i.jsxs("div",{"data-row-key":Me,className:ac(w.id===L,xl.selected.includes(w.id),w.provider==="antigravity",!!ie)+bl.dropClass(Me),style:tt(ie),...Se===w.id?{}:Ia(w),children:[Yt(ie),Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Fe=>{G(w,Fe),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...bl.gripHandlers(Me),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:Fe=>{tl()||xl.click(Fe,w,()=>J(w))},onKeyDown:Fe=>bl.onKeyDown(Me,Fe),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{tl()||Te(w.id)},children:"✎"})]})]},w.id)}function ht(w,ie){return i.jsxs("div",{className:ac(w.id===L,!1,w.provider==="antigravity",!!ie),style:tt(ie),children:[Yt(ie),i.jsxs("button",{className:"row__main",onClick:()=>J(w),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:_S(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>he([w.id]),children:"Вернуть"})]},w.id)}function fn(w,ie){const Me=ds(w);return i.jsxs("div",{"data-row-key":Me,className:ac(w.id===L,!1,w.provider==="antigravity",!!ie)+$n.dropClass(Me),style:tt(ie),...Se===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Hi(w)},children:[Yt(ie),Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Fe=>{G(w,Fe),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...$n.gripHandlers(Me),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{tl()||M(w)},onKeyDown:Fe=>$n.onKeyDown(Me,Fe),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})]},w.id)}function It(w){const ie=ds(w);return i.jsx("div",{"data-row-key":ie,className:ac(w.id===L,!1,w.provider==="antigravity")+Vt.dropClass(ie),...Se===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ds(w)},children:Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Me=>{G(w,Me),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Vt.gripHandlers(ie),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{tl()||M(w)},onKeyDown:Me=>Vt.onKeyDown(ie,Me),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(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(),!tl()&&O(w)},children:i.jsx(rS,{})})]})},w.id)}function ll(w,ie){return i.jsx(aS,{folder:w,count:ie,open:pt(w.id),renaming:Tt===w.id,onToggle:()=>Be(w.id),onStartRename:()=>Ye(w.id),onCommitRename:Me=>{ue(w.id,Me),Ye(null)},onCancelRename:()=>Ye(null),onDelete:()=>De(w.id),color:Qt(w),onPreviewColor:Me=>{window.clearTimeout(nt.current),Xe({folderId:w.id,color:Me})},onCommitColor:Me=>{Xe({folderId:w.id,color:Me}),_e(w.id,Me),window.clearTimeout(nt.current),nt.current=window.setTimeout(()=>Xe(null),4e3)},onResetColor:()=>{window.clearTimeout(nt.current),Xe(null),_e(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:`Тема: ${Sx[ge]}`,"aria-label":`Тема: ${Sx[ge]}. Переключить`,onClick:Ae,children:i.jsx(pS,{mode:ge})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":Ke==="default",className:Ke==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":Ke==="pinned",className:Ke==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":Ke==="live",className:Ke==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("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(oS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:tn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>nn(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),tn?nn(""):w.currentTarget.blur())}}),tn&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>nn(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:Ke==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Закреплённые",count:be.length,open:xe("pinned"),onToggle:()=>W("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{$t("pinned"),xe("pinned")||W("pinned")}}}),xe("pinned")&&i.jsxs(i.Fragment,{children:[en==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("pinned",w),$t(null)},onCancel:()=>$t(null)})})}),be.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),gl.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),pt(w.folder.id)&&w.items.map(ie=>fn(ie,w.folder))]},w.folder.id)),gl.ungrouped.map(w=>fn(w))]})]}):Ke==="live"?i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Запущенные",count:Le.length,open:xe("live"),onToggle:()=>W("live")}),xe("live")&&i.jsxs(i.Fragment,{children:[Le.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Нет запущенных сессий"})}),Le.map(w=>It(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Проекты",count:Xt.length,open:xe("workspaces"),onToggle:()=>W("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{$t("workspace"),xe("workspaces")||W("workspaces")}}}),xe("workspaces")&&i.jsxs(i.Fragment,{children:[en==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("workspace",w),$t(null)},onCancel:()=>$t(null)})})}),Xt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока ни одного"})}),Mn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),pt(w.folder.id)&&w.items.map(ie=>ot(ie,w.folder))]},w.folder.id)),Mn.ungrouped.map(w=>ot(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Архив проектов",count:wt.length,open:xe("workspacesArchive"),onToggle:()=>W("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),xe("workspacesArchive")&&i.jsxs(i.Fragment,{children:[wt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока пусто"})}),bn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),pt(w.folder.id)&&w.items.map(ie=>un(ie,w.folder))]},w.folder.id)),bn.ungrouped.map(w=>un(w))]})]}),E&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Сессии",count:Kt.length,open:xe("sessions"),onToggle:()=>W("sessions"),action:{label:"Новая папка сессий",onClick:()=>{$t("session"),xe("sessions")||W("sessions")}}}),xe("sessions")&&i.jsxs(i.Fragment,{children:[en==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("session",w,E),$t(null)},onCancel:()=>$t(null)})})}),Kt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока ни одной"})}),Rn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),pt(w.folder.id)&&w.items.map(ie=>Mt(ie,w.folder))]},w.folder.id)),Rn.ungrouped.map(w=>Mt(w))]}),b.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Архив",count:Et.length,open:xe("archive"),onToggle:()=>W("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),xe("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),Et.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока пусто"})}),ul.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),pt(w.folder.id)&&w.items.map(ie=>ht(ie,w.folder))]},w.folder.id)),ul.ungrouped.map(w=>ht(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:ke,children:[i.jsx("span",{className:pe!=null&&pe.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:pe===null?"Аккаунт":pe.loggedIn?pe.email||"Вход выполнен":"Войти в аккаунт"}),(pe==null?void 0:pe.plan)&&i.jsx("span",{className:"chip",children:pe.plan})]}),V&&i.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:V,children:[i.jsx("span",{className:k!=null&&k.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:k===null?"Удалённый доступ":k.paired?k.connected?k.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(k==null?void 0:k.connected)&&k.clients>0&&i.jsx("span",{className:"chip",children:k.clients})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",disabled:!z,title:"MCP-серверы и плагины",onClick:()=>z==null?void 0:z(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:ce,children:"Настройки"})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",onClick:A,children:"+ Проект"}),i.jsx(Vj,{disabled:!E,onStart:fe})]})]}),lt&&i.jsx(or,{x:lt.x,y:lt.y,items:qa,note:zn,onClose:gs}),Ut&&i.jsx(or,{x:Ut.x,y:Ut.y,items:Jl,note:sn,onClose:yn}),kt&&i.jsx(or,{x:kt.x,y:kt.y,items:N,note:Y,onClose:Fl}),ln&&i.jsx(or,{x:ln.x,y:ln.y,items:we,note:Xh,onClose:fl}),mt&&i.jsx(or,{x:mt.x,y:mt.y,items:ze,note:Xh,onClose:nl})]})}function ac(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 Ro(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),b=g?c.get(g):void 0;if(!b){d.push(m);continue}const _=o.get(b.id);_?_.push(m):o.set(b.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 Jj(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const Wj="\0ungrouped";function Pj(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),Wj);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 jf(l){const[s,r]=y.useState(null),[c,o]=y.useState(null),d=y.useMemo(()=>Jj(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=y.useMemo(()=>Pj(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g($,J){l.enabled&&(J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId),r($),o(null))}function b($,J){var D;if(!s)return;const G=(D=document.elementFromPoint($,J))==null?void 0:D.closest("[data-row-key]"),O=G==null?void 0:G.dataset.rowKey;if(!O||O===s||h.get(O)!==h.get(s)){o(null);return}const Z=G.getBoundingClientRect(),M=J-Z.top<Z.height/2?"before":"after";o(B=>(B==null?void 0:B.key)===O&&B.position===M?B:{key:O,position:M})}function _($){b($.clientX,$.clientY)}function j(){if(s&&c){const $=_f(d,s,c.key,c.position);$&&l.onReorder(l.scope,$,l.workspaceId)}m()}function v($,J){if(!l.enabled)return;const G=Vh($,l.groups,l.ungrouped,l.itemKey,J);if(!G)return;const O=_f(d,$,G.target,G.position);O&&l.onReorder(l.scope,O,l.workspaceId)}function C($,J){const G=Vh($,l.groups,l.ungrouped,l.itemKey,"up"),O=Vh($,l.groups,l.ungrouped,l.itemKey,"down"),Z=[{id:"move-up",label:"Переместить выше",disabled:!G,onSelect:()=>{if(!G)return;const M=_f(d,$,G.target,G.position);M&&l.onReorder(l.scope,M,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!O,onSelect:()=>{if(!O)return;const M=_f(d,$,O.target,O.position);M&&l.onReorder(l.scope,M,l.workspaceId)}}];return J&&Z.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),Z}function T($){return s===$?" row--dragging":(c==null?void 0:c.key)===$?c.position==="before"?" row--drop-before":" row--drop-after":""}function E($){return{onPointerDown:J=>g($,J),onPointerMove:_,onPointerUp:j,onPointerCancel:m}}function L($,J){!J.altKey||J.key!=="ArrowUp"&&J.key!=="ArrowDown"||(J.preventDefault(),v($,J.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:T,gripHandlers:E,onKeyDown:L,menuItems:C}}function Do(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 eS(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]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(_=>_.includes(g.id)?_.filter(j=>j!==g.id):[..._,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const _=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(_!==-1&&j!==-1){const[v,C]=_<j?[_,j]:[j,_];r(l.slice(v,C+1).map(T=>T.id));return}}o(),c.current=g.id,b()}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 tS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},nS={width:22,height:22,borderRadius:6};function ic({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:tS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx($y,{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:nS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(uS,{})})]})}const jx={paddingLeft:22},lS={display:"flex",alignItems:"center",gap:6,width:"100%"},sS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function aS({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g,color:b,onPreviewColor:_,onCommitColor:j,onResetColor:v}){const C=y.useRef(null),T=y.useRef(j);return T.current=j,y.useEffect(()=>{const E=C.current;if(!E)return;const L=()=>T.current(E.value);return E.addEventListener("change",L),()=>E.removeEventListener("change",L)},[c]),c?i.jsx("div",{className:"row",style:jx,children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):i.jsxs("div",{className:"row",style:jx,children:[i.jsxs("button",{className:"row__main",style:lS,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[i.jsx($y,{open:r}),i.jsx("span",{style:sS,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:b?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[i.jsx("span",{className:"row__swatch-dot",style:b?{background:b}:void 0}),i.jsx("input",{ref:C,type:"color",value:b??iS(),"aria-label":`Цвет папки «${l.name}»`,onChange:E=>_(E.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 iS(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function $y({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 Sf(){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 rS(){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 cS({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 oS(){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 uS(){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 fS(){try{const l=localStorage.getItem(qy);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 dS(){try{const l=localStorage.getItem(Yy);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function hS(){try{const l=localStorage.getItem(Gy);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Sx={system:"как в системе",light:"светлая",dark:"тёмная"};function pS({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 mS(l){const s=gS(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${By(r)}`:s}function gS(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":bS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function bS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function xS(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":yS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function yS(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--${xS(l)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),mS(l)]})," · ",s]})}function wf({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(cS,{className:"row__pin"}),r==="antigravity"&&i.jsx(Iy,{className:"row__provider"}),l]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function _S(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function vS(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const wx=3,jS=15e5;function Xy(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=NS(SS(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 SS(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),...wS(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function wS(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(_=>({type:"add",text:_}));if(s.length===0)return l.map(_=>({type:"del",text:_}));if((l.length+1)*(s.length+1)>jS)return[...l.map(_=>({type:"del",text:_})),...s.map(_=>({type:"add",text:_}))];const r=l.length,c=s.length,o=c+1,d=new Uint32Array((r+1)*o),h=(_,j)=>d[_*o+j]??0;for(let _=r-1;_>=0;_--)for(let j=c-1;j>=0;j--)d[_*o+j]=l[_]===s[j]?h(_+1,j+1)+1:Math.max(h(_+1,j),h(_,j+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const _=l[g],j=s[b];_===j?(m.push({type:"ctx",text:_}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:_}),g++):(m.push({type:"add",text:j}),b++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;b<c;)m.push({type:"add",text:s[b++]});return kS(m)}function kS(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 NS(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-wx);m<=Math.min(l.length-1,h+wx);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} ${TS(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function TS(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 Sc(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 Mp=1600,br="Копировать",hc="Скопировано";function Rp({text:l,hint:s,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Mp);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[l]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?hc:`${br} ${s}`,title:c?hc:`${br} ${s}`,onClick:()=>{Sc(l).then(d=>{d&&o(!0)})},children:c?hc: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 ES({waiting:l}){const[s,r]=y.useState(0);return y.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:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),j=y.useRef(null),v=y.useRef(!0),C=y.useRef(null),T=y.useRef(null),E=y.useRef(!1);y.useEffect(()=>{v.current=!0,C.current=null,E.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[m]),y.useEffect(()=>{const O=_.current,Z=j.current;if(!O||!Z)return;function M(ne){!O||ne===O.scrollTop||(E.current=!0,O.scrollTop=ne)}function D(){if(!O)return;const ne=C.current;if(ne){const he=Nx(O,ne.id);if(he){const P=he.getBoundingClientRect().top-O.getBoundingClientRect().top;M(O.scrollTop+(P-ne.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{C.current=null},500);return}v.current&&M(O.scrollHeight)}const B=new ResizeObserver(D);return B.observe(Z),()=>{B.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function L(){const O=_.current;if(O){if(E.current){E.current=!1;return}v.current=O.scrollHeight-O.scrollTop-O.clientHeight<80}}function $(){if(d)return;const O=_.current,Z=c[0];if(O&&Z){const M=Nx(O,Z.id);M&&(C.current={id:Z.id,top:M.getBoundingClientRect().top-O.getBoundingClientRect().top})}h==null||h()}let J=0;function G(O){return O.kind==="user"?J++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:L,children:i.jsxs("div",{className:"stream",ref:j,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:$,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(O=>i.jsx(kx,{item:O,userIndex:G(O),onEditMessage:g},O.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:b}),l.map(O=>i.jsx(kx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),s&&i.jsx(ES,{waiting:r})]})})}function kx({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return i.jsx(AS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[i.jsx(MS,{text:l.text}),l.streaming&&i.jsx("span",{className:"caret"}),l.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(Rp,{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(DS,{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:["↑",Ex(l.inputTokens)," ↓",Ex(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 CS=500;function AS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[m,g]=y.useState(l.text),b=y.useRef(null),_=$f("(max-width: 860px)"),j=y.useRef(null);function v(D,B){o({x:D,y:B})}function C(D){D.preventDefault(),v(D.clientX,D.clientY)}function T(D){const B=D.touches[0];if(!B)return;const ne={timer:0,x:B.clientX,y:B.clientY,fired:!1};ne.timer=window.setTimeout(()=>{ne.fired=!0,v(ne.x,ne.y)},CS),j.current=ne}function E(D){const B=j.current,ne=D.touches[0];!B||!ne||Math.hypot(ne.clientX-B.x,ne.clientY-B.y)>10&&(window.clearTimeout(B.timer),j.current=null)}function L(D){const B=j.current;B&&(window.clearTimeout(B.timer),B.fired&&D.preventDefault())}function $(){g(l.text),h(!0)}function J(){h(!1)}function G(){const D=m.trim();D===""&&!(l.images&&l.images.length>0)||(r==null||r(s,D,l.images),h(!1))}y.useEffect(()=>{const D=b.current;!D||!d||(D.style.height="auto",D.style.height=`${D.scrollHeight}px`)},[m,d]),y.useEffect(()=>{if(!d)return;const D=b.current;D&&(D.focus(),D.setSelectionRange(D.value.length,D.value.length))},[d]);function O(D){if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),J();return}D.key==="Enter"&&!D.shiftKey&&!_&&(D.preventDefault(),G())}const Z=l.images&&l.images.length>0&&i.jsx("div",{className:"msg--user__images",children:l.images.map((D,B)=>i.jsx("img",{className:"msg--user__image",src:`data:${D.mediaType};base64,${D.data}`,alt:"Вложение"},B))});if(d){const D=m.trim()!==""||!!(l.images&&l.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[Z,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:B=>g(B.target.value),onKeyDown:O,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:J,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:G,disabled:!D,children:"Сохранить"})]})]})]})}const M=[{id:"copy",label:"Копировать",onSelect:()=>void Sc(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:$}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:C,onTouchStart:T,onTouchMove:E,onTouchEnd:L,onTouchCancel:L,children:[Z,l.text,c&&i.jsx(or,{x:c.x,y:c.y,items:M,onClose:()=>o(null)})]})}function Nx(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function MS({text:l}){const[s,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return Qf(l).then(h=>{d||r(RS(h))}),()=>{d=!0}},[l]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((b=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:b.textContent)??"";m!==""&&Sc(m).then(_=>{if(!_)return;h.textContent=hc,h.setAttribute("aria-label",hc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=br,h.setAttribute("aria-label",pp),h.classList.remove("copybtn--done"))},Mp);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const pp=`${br} блок кода`;function RS(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 DS({item:l}){const[s,r]=y.useState(!1),c=l.result===null,o=Xy(l.name,l.input),d=l.name==="AskUserQuestion"?zS(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?LS(d):OS(l.input)}),i.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(US,{questions:d,answers:l.answers}):o?i.jsx(Dp,{diff:o}):i.jsx(Tx,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&i.jsx(Tx,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Tx({text:l,hint:s,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:l}),i.jsx(Rp,{text:l,hint:s,className:"codeblock__copy"})]})}function OS(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 LS(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 zS(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 b of h){if(typeof b!="object"||b===null)return null;const{label:_,description:j,preview:v}=b;if(typeof _!="string"||typeof j!="string")return null;g.push({label:_,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function US({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 Ex(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const HS="ccv.dictation.lang",Cx="ru-RU";function BS(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Ax(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(BS);return!r&&s.length>0&&Ts("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function Vy(){var l;try{return((l=localStorage.getItem(HS))==null?void 0:l.trim())||Cx}catch{return Cx}}function Ts(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const IS=3,qS=400,GS=5,YS=250,$S=2e3,XS=2e4;async function VS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const QS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Vy()}`};function KS(l){const[s]=y.useState(()=>Ax()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),m=y.useRef(!1),g=y.useRef(!1),b=y.useRef(l),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=y.useRef(null),v=y.useRef(!1),C=y.useRef(null),T=y.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),E=y.useCallback(()=>{T();const O=async Z=>{if(C.current=null,!(!m.current||v.current)){if(!Z&&!await VS()){if(Ts("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void O(!0),XS);return}Ts("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void O(!1),$S)},[T]);y.useEffect(()=>{b.current=l}),y.useEffect(()=>{const O=Ax();if(!O)return;const Z=new O;return Z.lang=Vy(),Z.continuous=!0,Z.interimResults=!0,Z.onstart=()=>{Ts("сессия открыта"),v.current=!0,T(),c(!0)},Z.onaudiostart=()=>{Ts("пошёл звук с микрофона"),_.current.audio=!0},Z.onresult=M=>{var he;if(g.current)return;let D="",B="";for(let P=M.resultIndex;P<M.results.length;P++){const ue=M.results[P];if(!ue)continue;const _e=((he=ue[0])==null?void 0:he.transcript)??"";ue.isFinal?D+=_e:B+=_e}const ne=_.current;ne.heard=!0,ne.everHeard=!0,Ts("распознано",{final:D,interim:B}),b.current(D,B)},Z.onerror=M=>{_.current.lastError=M.error,Ts("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(QS[M.error]??`Распознавание не работает: ${M.error}`))},Z.onend=()=>{g.current=!1,v.current=!1;const M=_.current,D=Date.now()-M.openedAt;if(Ts("сессия закрыта",{мс:D,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&D<qS?M.dead+1:0,M.dead>=GS){m.current=!1,c(!1),d(M.lastError?`Распознавание не работает: ${M.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}M.silent=M.heard?0:M.silent+1,!M.everHeard&&!M.warned&&M.silent>=IS&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",E();try{Z.start()}catch{}}},YS)},h.current=Z,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,T(),Z.onend=null,Z.onresult=null,Z.onerror=null,Z.onstart=null,Z.onaudiostart=null,Z.abort(),h.current=null}},[]);const L=y.useCallback(()=>{var O;if(m.current){if(m.current=!1,Ts("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,T(),!v.current){c(!1);return}(O=h.current)==null||O.stop()}},[]),$=y.useCallback(()=>{const O=h.current;if(O){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Ts("включение микрофона",{язык:O.lang}),E();try{O.start()}catch(Z){Ts("start() не прошёл",Z)}}},[E]),J=y.useCallback(()=>{m.current?L():$()},[$,L]),G=y.useCallback(()=>{var O;m.current&&v.current&&(g.current=!0,(O=h.current)==null||O.abort())},[]);return{supported:s,listening:r,error:o,toggle:J,stop:L,drop:G}}const ZS="(max-width: 860px)",Mx=/^\/(\S*)$/,FS=new Set(["model","permissions"]);function JS(l){return FS.has(l.name)||l.name.startsWith("__")}const WS=new Set(["clear","rename"]),Rx=/(?:^|\s)@([^\s@]*)$/,PS=200,ew=100,tw=190,nw=5,lw=20*1024*1024,sw=1568,aw=.85;let Dx=0;async function iw(l){var j,v;if(!l.type.startsWith("image/")||l.size>lw)return null;const s=await rw(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,sw/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",b=d.toDataURL(g,m?void 0:aw),_=b.slice(b.indexOf(",")+1);return _?(Dx+=1,{id:`att${Dx}`,mediaType:g,data:_,previewUrl:b}):null}async function rw(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 Qy({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:_=!0,onContextSearch:j,onCommand:v,onSend:C,onInterrupt:T,onEscape:E}){var Le;const L=$f(ZS),[$,J]=y.useState(()=>m?Lh(m):""),[G,O]=y.useState(!1),[Z,M]=y.useState(0),D=y.useRef(null),B=y.useRef(null),ne=y.useRef(null),[he,P]=y.useState(()=>m?Lh(m).length:0),[ue,_e]=y.useState([]),De=y.useRef(null),Ne=y.useCallback(H=>{!_||H.length===0||Promise.all(H.map(iw)).then(W=>{const xe=W.filter(Be=>Be!==null);xe.length!==0&&_e(Be=>[...Be,...xe].slice(0,nw))})},[_]);function A(H){_e(W=>W.filter(xe=>xe.id!==H))}function fe(H){var Be;if(!_)return;const W=(Be=H.clipboardData)==null?void 0:Be.items;if(!W)return;const xe=[];for(const pt of W){if(!pt.type.startsWith("image/"))continue;const Mn=pt.getAsFile();Mn&&xe.push(Mn)}xe.length!==0&&(H.preventDefault(),Ne(xe))}function z(H){const W=H.target.files?Array.from(H.target.files):[];H.target.value="",Ne(W)}y.useEffect(()=>{_||_e([])},[_]);const[pe,ke]=y.useState([]),[k,V]=y.useState(-1),ce=y.useRef(""),[ge,Ae]=y.useState(""),Se=KS(y.useCallback((H,W)=>{H&&J(xe=>Fh(xe,H)),Ae(W.trim())},[])),Te=ge?Fh($,ge):$;y.useEffect(()=>{Se.listening||ge===""||(J(H=>Fh(H,ge)),Ae(""))},[Se.listening,ge]),y.useEffect(()=>{var H;b&&((H=D.current)==null||H.focus())},[b]);const Tt=y.useRef(new Map),Ye=y.useRef(new Map),et=y.useRef(m),Xe=y.useRef({text:$,caret:he});Xe.current={text:$,caret:he};const Qt=y.useCallback((H,W,xe)=>{W===""?(Tt.current.delete(H),Ye.current.delete(H)):(Tt.current.set(H,W),Ye.current.set(H,xe)),ry(H,W)},[]),tt=Se.drop;y.useLayoutEffect(()=>{const H=et.current;if(H===m)return;et.current=m,H&&Qt(H,Xe.current.text,Xe.current.caret);const W=m?Tt.current.get(m)??Lh(m):"",xe=m?Ye.current.get(m):void 0,Be=Math.min(xe??W.length,W.length);J(W),P(Be),ne.current=[Be,Be],Ae(""),M(0),O(!1),V(-1),ce.current="",_e([]),tt()},[m,Qt,tt]),y.useEffect(()=>{m&&Qt(m,$,he)},[m,$,he,Qt]);const Yt=l?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",nt=y.useRef(0),en=y.useCallback(H=>{const W=parseFloat(getComputedStyle(H).maxHeight),xe=Number.isFinite(W)&&W>0?W:tw;H.style.height="auto";const Be=H.scrollHeight;H.style.height=`${Math.min(Be,xe)}px`,H.style.overflowY=Be>xe?"auto":"hidden"},[]);y.useEffect(()=>{const H=D.current;H&&en(H)},[Te,Yt,l,en]),y.useLayoutEffect(()=>{const H=D.current,W=ne.current;!H||!W||(ne.current=null,H.setSelectionRange(W[0],W[1]))}),y.useEffect(()=>{const H=D.current;if(!H)return;const W=new ResizeObserver(([xe])=>{const Be=xe==null?void 0:xe.contentRect.width;Be===void 0||Math.abs(Be-nt.current)<1||(nt.current=Be,en(H))});return W.observe(H),()=>W.disconnect()},[en]);const $t=Se.stop;y.useEffect(()=>{l&&$t()},[l,$t]);const tn=y.useMemo(()=>Se.error?{ok:!1,message:Se.error}:null,[Se.error]),nn=y.useMemo(()=>{var xe;const H=(xe=Mx.exec($))==null?void 0:xe[1];if(H===void 0)return[];const W=H.toLowerCase();return r.filter(Be=>!JS(Be)&&Jh(Be,W)<Ky).sort((Be,pt)=>Jh(Be,W)-Jh(pt,W))},[$,r]),pn=!G&&nn.length>0,Sn=Math.min(Z,nn.length-1),mn=G?null:((Le=Rx.exec(Te.slice(0,he)))==null?void 0:Le[1])??null,cn=y.useRef(j);cn.current=j,y.useEffect(()=>{if(mn===null||mn===""||mn.endsWith("/")){cn.current(mn);return}const H=setTimeout(()=>cn.current(mn),PS);return()=>clearTimeout(H)},[mn]);const Ke=mn!==null&&(o==null?void 0:o.query)===mn,zt=Ke?o.entries:[],gn=mn!==null,ut=gn&&!Ke,Je=Math.min(Z,Math.max(zt.length-1,0));y.useEffect(()=>{var W,xe;if(!pn&&!gn)return;const H=pn?Sn:Je;(xe=(W=B.current)==null?void 0:W.children[H])==null||xe.scrollIntoView({block:"nearest"})},[pn,gn,Sn,Je]);function An(H,W){var xe;J(H),P(W),ne.current=[W,W],M(0),O(!1),ge!==""&&(Ae(""),Se.drop()),(xe=D.current)==null||xe.focus()}function on(){J(""),Ae(""),M(0),P(0),O(!1),V(-1),ce.current="",_e([]),Se.drop(),m&&Qt(m,"",0)}function wn(H){const W=H.trim();W===""&&ue.length===0||l||(C(W,ue.length>0?ue.map(xe=>({mediaType:xe.mediaType,data:xe.data})):void 0),W!==""&&ke(xe=>[W,...xe.filter(Be=>Be!==W)].slice(0,ew)),on())}function Pn(H){if(H<-1||H>=pe.length)return;k===-1&&(ce.current=$);const W=H===-1?ce.current:pe[H]??"";V(H),An(W,W.length)}function Xt(){var Be;const H=((Be=D.current)==null?void 0:Be.selectionStart)??Te.length,xe=`${H>0&&!/\s$/.test(Te.slice(0,H))?" ":""}@`;An(Te.slice(0,H)+xe+Te.slice(H),H+xe.length)}function wt(H){var pt;const W=(pt=Rx.exec(Te.slice(0,he)))==null?void 0:pt[1];if(W===void 0)return;const xe=he-W.length-1,Be=H.kind==="dir"?`@${H.path}/`:`@${H.path} `;An(Te.slice(0,xe)+Be+Te.slice(he),xe+Be.length)}function Kt(){var W;const H=(W=Mx.exec(Te.trim()))==null?void 0:W[1];if(H&&v(H)){on();return}wn(Te)}function Et(H,W){J(H),P(W),M(0),O(!1),V(-1),ge!==""&&(Ae(""),Se.drop())}function Yn(H){var Be;const W=WS.has(H.name)?c:null,xe=`/${H.name} `;J(xe+(W??"")),P(xe.length+((W==null?void 0:W.length)??0)),W&&(ne.current=[xe.length,xe.length+W.length]),M(0),(Be=D.current)==null||Be.focus()}function le(H){if(v(H.name)){J(""),M(0),O(!1);return}H.argumentHint?Yn(H):wn(`/${H.name}`)}function be(H){if(pn){if(H.key==="ArrowDown")return H.preventDefault(),M(W=>(Math.min(W,nn.length-1)+1)%nn.length);if(H.key==="ArrowUp"){H.preventDefault();const W=nn.length-1;return M(xe=>(Math.min(xe,W)+W)%nn.length)}if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const W=nn[Sn];W&&le(W);return}if(H.key==="Tab"){H.preventDefault();const W=nn[Sn];W&&Yn(W);return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),O(!0);return}}if(gn){if(H.key==="ArrowDown"&&zt.length>0)return H.preventDefault(),M(W=>(Math.min(W,zt.length-1)+1)%zt.length);if(H.key==="ArrowUp"&&zt.length>0){H.preventDefault();const W=zt.length-1;return M(xe=>(Math.min(xe,W)+W)%zt.length)}if(H.key==="Enter"&&!H.shiftKey||H.key==="Tab"){const W=zt[Je];if(W){H.preventDefault(),wt(W);return}if(H.key==="Tab")return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),O(!0);return}}if((H.key==="ArrowUp"||H.key==="ArrowDown")&&!H.shiftKey){const W=H.currentTarget,xe=W.selectionStart;if(W.selectionEnd===xe){const pt=H.key==="ArrowUp"?k+1:k-1;pt>=-1&&pt<pe.length&&requestAnimationFrame(()=>{W.selectionStart===xe&&W.selectionEnd===xe&&Pn(pt)})}}if(H.key==="Escape"&&E){H.preventDefault(),H.stopPropagation(),E();return}H.key==="Enter"&&!H.shiftKey&&!L&&(H.preventDefault(),Kt())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(_r,{result:tn}),gn&&!pn&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:B,children:[zt.map((H,W)=>i.jsxs("button",{role:"option","aria-selected":W===Je,className:W===Je?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(W),onMouseDown:xe=>{xe.preventDefault(),wt(H)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[H.name,H.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:H.path}),H.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},H.path)),zt.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:ut?"ищем…":mn?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),pn&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:B,children:nn.map((H,W)=>i.jsxs("button",{role:"option","aria-selected":W===Sn,className:W===Sn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(W),onMouseDown:xe=>{xe.preventDefault(),le(H)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",H.name]}),H.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:H.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:H.description})]},H.name))}),ue.length>0&&i.jsx("div",{className:"composer__attachments",children:ue.map(H=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:H.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>A(H.id),children:i.jsx(hw,{})})]},H.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Xt,children:i.jsx(uw,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:De,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:z}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var H;return(H=De.current)==null?void 0:H.click()},children:i.jsx(dw,{})})]}),i.jsx("textarea",{ref:D,value:Te,disabled:l,placeholder:Yt,onChange:H=>Et(H.target.value,H.target.selectionStart),onSelect:H=>P(H.currentTarget.selectionStart),onKeyDown:be,onPaste:fe}),Se.supported&&i.jsx("button",{type:"button",className:Se.listening?"micbtn is-on":"micbtn",title:Se.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Se.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Se.listening,disabled:l,onClick:Se.toggle,children:i.jsx(pw,{on:Se.listening})}),s?i.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Kt,disabled:l||Te.trim()===""&&ue.length===0,"aria-label":g,title:g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(fw,{})]})]})]})})}function Fh(l,s){const r=s.trim();if(r==="")return l;const c=mp(r).slice(cw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function cw(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)=>ow(d,c[h]??"")))return o;return 0}function mp(l){return l.split(/\s+/).filter(s=>s!=="")}function ow(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function uw(){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 fw(){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 dw(){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 hw(){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 pw({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 Ky=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:Ky}function mw({request:l,queued:s,onDecide:r}){const c=Xy(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 gw({request:l,queued:s,onAnswer:r,onDecline:c}){const{questions:o}=l,[d,h]=y.useState(()=>o.map(()=>new Set)),[m,g]=y.useState(()=>o.map(()=>"")),[b,_]=y.useState(()=>Ox(o));y.useEffect(()=>{h(o.map(()=>new Set)),g(o.map(()=>"")),_(Ox(o))},[l.requestId]);const j=y.useMemo(()=>xw(o,d,m),[o,d,m]),v=j!==null;function C(G,O){var Z,M;(M=(Z=o[G])==null?void 0:Z.options[O])!=null&&M.preview&&_(D=>{const B=D.slice();return B[G]=O,B})}function T(G,O,Z){h(M=>{const D=M.slice(),B=new Set(D[G]);return Z?B.has(O)?B.delete(O):B.add(O):B.has(O)||(B.clear(),B.add(O)),D[G]=B,D}),O!=="other"&&C(G,O)}function E(G,O){g(Z=>{const M=Z.slice();return M[G]=O,M})}function L(){j&&r(l.requestId,j)}function $(G){G.key==="Enter"&&(G.target.closest("button")||v&&(G.preventDefault(),L()))}function J(G){var D;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(G.key))return;const O=Array.from(G.currentTarget.querySelectorAll("button.qsheet__option")),Z=O.indexOf(document.activeElement);if(Z===-1)return;G.preventDefault();const M=G.key==="ArrowDown"||G.key==="ArrowRight"?1:-1;(D=O[(Z+M+O.length)%O.length])==null||D.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:$,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((G,O)=>i.jsx(bw,{q:G,qi:O,selected:d[O]??new Set,otherText:m[O]??"",previewIndex:b[O]??null,onToggle:T,onFocusOption:C,onOtherText:E,onOptionsKeyDown:J},O))]}),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:L,children:"Ответить"})]})]})})}function bw({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var C;const b=l.options.some(T=>T.preview),_=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((T,E)=>{const L=r.has(E);return i.jsxs("button",{type:"button",role:v,"aria-checked":L,className:"qsheet__option"+(L?" is-selected":""),onClick:()=>d(s,E,l.multiSelect),onFocus:()=>h(s,E),onMouseEnter:()=>h(s,E),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:T.label}),i.jsx("span",{className:"qsheet__opt-desc",children:T.description})]})]},E)}),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:T=>m(s,T.target.value),autoFocus:!0})]})]}),b&&i.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Ox(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function xw(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 b=d.options[g];b&&h.has(g)&&m.push(b.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 yw({request:l,plan:s,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(s),[m,g]=y.useState("preview");y.useEffect(()=>{h(s),g("preview")},[l.requestId,s]);const b=d.trim().length>0;function _(){b&&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(vw,{})}),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(_w,{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:!b,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function _w({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Qf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function vw(){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 jw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function Zy({path:l}){const[s,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!s)return;function m(g){var b;(b=d.current)!=null&&b.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),y.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Mp);return()=>clearTimeout(m)},[c]),y.useEffect(()=>r(!1),[l]);async function h(){await Sc(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(Sw,{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?hc:br})]})]})}function Sw({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 ww=["low","medium","high"];function Fy({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:_,onThinking:j,onSwitchOnFlag:v}){const[C,T]=y.useState(!1),[E,L]=y.useState(0),$=y.useRef(null),J=y.useRef(null),G=l.find(B=>B.value===s)??null,O=G&&G.supportsEffort?G.effortLevels.length>0?G.effortLevels:ww:[],Z=O.includes("xhigh");y.useEffect(()=>{if(!C)return;const B=l.findIndex(ne=>ne.value===s);L(B===-1?0:B)},[C]),y.useEffect(()=>{if(!C)return;function B(ne){var he;(he=$.current)!=null&&he.contains(ne.target)||T(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[C]),y.useEffect(()=>{var B,ne;C&&((ne=(B=J.current)==null?void 0:B.querySelector(".is-cursor"))==null||ne.scrollIntoView({block:"nearest"}))},[C,E]);function M(B){T(!1),B.value!==s&&g(B.value)}function D(B){if(B.key==="Escape"){if(!C)return;B.preventDefault(),B.stopPropagation(),T(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!C)return T(!0);if(l.length===0)return;const ne=B.key==="ArrowDown"?1:l.length-1;return L(he=>(he+ne)%l.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!C)return T(!0);const ne=l[E];ne&&M(ne)}}return i.jsxs("div",{ref:$,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:()=>T(B=>!B),onKeyDown:D,children:[(G==null?void 0:G.displayName)??s?i.jsx("span",{className:"select__value",children:(G==null?void 0:G.displayName)??s}):i.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):O.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(kw,{})]}),C&&i.jsxs("div",{ref:J,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((B,ne)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":B.value===s,className:"select__option"+(ne===E?" is-cursor":"")+(B.value===s?" is-on":""),onMouseEnter:()=>L(ne),onClick:()=>M(B),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:B.displayName}),B.description&&i.jsx("span",{className:"select__hint",children:B.description})]},B.value)),O.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:O.map(B=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":B===r,className:B===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(B),children:B},B))})]}),Z&&i.jsx(Wh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>_(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(G==null?void 0:G.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 kw(){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 Nl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const b=h.current;if(!b)return;const _=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=_[0],v=_[_.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 Nw({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:b,onSubmit:_,onCreate:j,onClose:v}){const[C,T]=y.useState("open"),[E,L]=y.useState(""),[$,J]=y.useState(!1),[G,O]=y.useState(""),[Z,M]=y.useState(""),[D,B]=y.useState({git:!0,claudeMd:!0,readme:!0}),ne=E.trim(),he=ne!=="",P=G.trim(),ue=Z.trim(),_e=P!==""&&ue!=="";y.useEffect(()=>{G===""&&d.length>0&&O(d[0])},[d]);const De=y.useRef(m);De.current=m,y.useEffect(()=>{if(C!=="open")return;const z=E.trim(),pe=setTimeout(()=>De.current(z),200);return()=>clearTimeout(pe)},[E,C]);function Ne(){he&&_(ne)}function A(){_e&&j(P,ue,D)}function fe(){he&&(J(!0),g(ne))}return h?i.jsxs(Nl,{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(z=>i.jsx("li",{children:z},z))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Nl,{title:"Новый проект",className:$&&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:b,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!he,onClick:fe,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!he,onClick:Ne,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!_e,onClick:A,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Lx,{label:"Открыть",on:C==="open",onClick:()=>T("open")}),i.jsx(Lx,{label:"Создать",on:C==="create",onClick:()=>T("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:E,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:z=>L(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),Ne())}}),o&&i.jsx("p",{className:"modal__error",children:o}),l.length>0&&i.jsx("ul",{className:"finds",children:l.map(z=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:z.open,title:z.open?"Этот проект уже открыт":z.path,onClick:()=>L(z.path),onDoubleClick:()=>_(z.path),children:[i.jsx("span",{className:"find__name",children:z.name}),i.jsx("span",{className:"find__path",children:z.path}),i.jsx("span",{className:"find__note",children:Cw(z)})]})},z.path))}),l.length===0&&he&&!s&&!$&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),$&&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:G,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:z=>O(z.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(z=>i.jsx("button",{type:"button",className:z===P?"newproj__root is-on":"newproj__root",title:z,onClick:()=>O(z),children:Ew(z)},z))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:Z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:z=>M(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),A())}}),i.jsx("p",{className:"newproj__preview",children:_e?Tw(P,ue):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Ph,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>B(z=>({...z,git:!z.git}))}),i.jsx(Ph,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>B(z=>({...z,claudeMd:!z.claudeMd}))}),i.jsx(Ph,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>B(z=>({...z,readme:!z.readme}))})]})]})]})}function Lx({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 Tw(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Ew(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function Cw(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Aw(l.sessions)}${Mw(l.lastUsedAt)}`}function Aw(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function Mw(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 Rw(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=zx(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let C=s.indexOf(v);C===-1&&(C=zx(s),s[C]=v),b.push({from:h,to:C})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.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)}Dw(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:_,down:b,through:j})}return{rows:r,columns:Math.min(c,Lp)}}function zx(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Dw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const Jy=1500;function Ow(l){const s=[];let r=!1;for(const c of l.patch.split(`
119
+ `)){if(s.length>=Jy){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:Lw(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:zw(l,r)}}function Lw(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 zw(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(`показаны первые ${Jy} строк`),r.length>0?r.join(" · "):null}function Uw({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:_,onConnectRemote:j,onDismissResult:v,onClose:C,zoomed:T,onToggleZoom:E}){const L=Rw((s==null?void 0:s.commits)??[]),$=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(J=>({value:J.name,label:J.name,hint:J.hash.slice(0,8)}))];return i.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:J=>{E&&(J.target.closest("button")||E())},children:[i.jsx(Gw,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),E&&i.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:E,children:i.jsx(kc,{active:T})}),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.jsx("div",{className:"gitbar",children:i.jsx(As,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:$,onChange:J=>{J&&m(J,`ветку ${J}`)}})}),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(Vw,{}),o]}):s.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(Yw,{}),"Отправить",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:()=>b(!0),children:[i.jsx($w,{}),"Забрать",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:()=>b(!1),children:i.jsx(Xw,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на 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} ${Zw(s.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(J=>Kw(J.path)).join(", "):"незакоммиченных изменений нет"})]})}),L.rows.map(J=>i.jsx(Hw,{row:J,columns:L.columns,head:J.commit.hash===s.head,local:s.hasRemote&&!J.commit.pushed,active:c===J.commit.hash,onOpen:()=>h(J.commit.hash)},J.commit.hash)),L.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:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(_r,{result:r,onDismiss:v})]})}const Oo=50,Ux=13;function Hw({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(Qw).filter(Boolean);return i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[i.jsx(Bw,{row:l,columns:s,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[m.map(g=>i.jsx("span",{className:"gitrow__ref",children:g},g)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Fw(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function Bw({row:l,columns:s,head:r,local:c}){const o=s*Ux+6,d=Oo/2,h=b=>8+Math.min(b,Lp-1)*Ux,m=c?"3.5 2.5":void 0,g=kf(l.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:Oo,viewBox:`0 0 ${o} ${Oo}`,"aria-hidden":"true",children:[l.through.map(b=>i.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:Oo,style:{stroke:kf(b)}},`t${b}`)),l.up.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:kf(b.from),strokeDasharray:m}},`u${_}`)),l.down.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${Oo}`,fill:"none",style:{stroke:kf(b.to),strokeDasharray:m}},`d${_}`)),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 kf(l){return`var(--lane-${l%Lp})`}function Iw({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return i.jsxs(Nl,{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.jsx("p",{className:"commit__subject",children:l.subject}),i.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",Jw(l.date)," ·"," ",i.jsx("span",{className:"commit__hash",children:l.hash})]}),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]=y.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:Ow(l)})]})}function Gw(){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 Yw(){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 $w(){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 Xw(){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 Hx(){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 Vw(){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 Qw(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Kw(l){const s=l.split("/");return s[s.length-1]??l}function Zw(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 Fw(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 Jw(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function Bx(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Ww({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:_,onClose:j}){var z;const[v,C]=y.useState(()=>Bx(c)),[T,E]=y.useState(""),[L,$]=y.useState(""),[J,G]=y.useState(!0),[O,Z]=y.useState("Первый коммит"),[M,D]=y.useState(null),[B,ne]=y.useState("");y.useEffect(()=>{!T&&s.length>0&&E(s[0].login)},[T,s]),y.useEffect(()=>{r&&M===null&&D(new Set(r.files))},[r,M]);const he=(l==null?void 0:l.connected)===!0,P=s.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),ue=y.useMemo(()=>{if(!r)return[];const pe=B.trim().toLowerCase();return pe?r.files.filter(ke=>ke.toLowerCase().includes(pe)):r.files},[r,B]),_e=(M==null?void 0:M.size)??0,De=he&&v.trim()!==""&&T!==""&&d===""&&(o||_e>0);function Ne(pe){D(ke=>{const k=new Set(ke??[]);return k.has(pe)?k.delete(pe):k.add(pe),k})}function A(pe){D(ke=>{const k=new Set(ke??[]);for(const V of ue)pe?k.add(V):k.delete(V);return k})}function fe(){if(!De)return;const pe=(r==null?void 0:r.files)??[];b({owner:T,name:v.trim(),description:L.trim(),private:J,include:o?[]:pe.filter(ke=>M==null?void 0:M.has(ke)),ignore:o?[]:pe.filter(ke=>!(M!=null&&M.has(ke))),message:o?"":O.trim()||"Первый коммит"})}return i.jsxs(Nl,{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:!De,onClick:fe,children:d||"Опубликовать"})]}),children:[i.jsx(Pw,{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:pe=>C(Bx(pe.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(As,{className:"settings__select",value:T,options:P,onChange:E,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((z=s[0])==null?void 0:z.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:L,placeholder:"о чём проект — одной строкой",onChange:pe=>$(pe.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(Ix,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:J,onClick:()=>G(!0)}),i.jsx(Ix,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!J,onClick:()=>G(!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:[_e," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:B,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>ne(pe.target.value)}),i.jsx("div",{className:"publish__filelist",children:ue.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ue.map(pe=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(pe))===!0,className:"publish__file",onClick:()=>Ne(pe),children:[i.jsx("span",{className:"publish__box"+(M!=null&&M.has(pe)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(pe))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),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:O,onChange:pe=>Z(pe.target.value)})]})]})]}),i.jsx(_r,{result:h,onDismiss:_})]})}function Ix({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 Pw({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=y.useState(""),[d,h]=y.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(ek,{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 ek({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(nk,{}):i.jsx(tk,{})})]})}function tk(){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 nk(){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 lk({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=y.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(Nl,{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(_r,{result:s,onDismiss:c})]})}function sk({open:l,items:s,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:g,effort:b,ultracode:_,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:T,onModel:E,onEffort:L,onUltracode:$,onThinking:J,onSwitchOnFlag:G,onAsk:O,onInterrupt:Z,onReset:M,onClose:D,zoomed:B,onToggleZoom:ne}){return i.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(B?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:he=>{ne&&(he.target.closest("button")||ne())},children:[i.jsx(ak,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:M,children:"↻"}),ne&&i.jsx("button",{className:"sidepane__btn",title:B?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":B?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":B,onClick:ne,children:i.jsx(kc,{active:B})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),m.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Fy,{className:"select--compact",models:m,value:g,effort:b,ultracode:_,thinking:j,switchOnFlag:v,onModel:E,onEffort:L,onUltracode:$,onThinking:J,onSwitchOnFlag:G}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(Op,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(Qy,{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:T,onSend:O,onInterrupt:Z,onEscape:r?Z:D})]})}function ak(){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 ik=75,rk=90;function Wy({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:uk(l,s),"aria-label":c,children:r.map(o=>i.jsx(ck,{label:o.label,window:o.window},o.key))})}function ck({label:l,window:s}){const r=Math.round(s.utilization),c=dk(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${ok(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 ok(l){return l>=rk?" usage__fill--over":l>=ik?" usage__fill--warn":""}function uk(l,s){if(s.length>0)return fk(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 fk(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 Py(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function e_(l){return l.getTime()-Date.now()<1440*60*1e3}function dk(l){const s=Py(l);return s?e_(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function zp(l){const s=Py(l);return s?`обнулится ${e_(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function t_(){const[l,s]=y.useState(()=>new Date);return y.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:hk(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 hk(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function pk({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:b,onHandoff:_,onFreshSession:j,handoffWriting:v,onStop:C}){const T=my({onLongPress:()=>j==null?void 0:j(),onClick:()=>_==null?void 0:_(),disabled:v});return i.jsx(Nl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:i.jsxs("div",{className:"sessionmenu",children:[s&&i.jsx(rc,{label:"Режим прав",children:s}),i.jsx(rc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&i.jsx(rc,{label:"Лимиты плана",children:i.jsx(Wy,{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(mk,{}),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(rc,{label:"Время",children:i.jsx(t_,{})}),d&&i.jsx(rc,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(rc,{label:"Каталог проекта",children:i.jsx(Zy,{path:o})}),b&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:b,children:"Переименовать сессию"}),_&&i.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":T.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${T.thresholdMs}ms`},"aria-busy":v,disabled:v,...T.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 rc({label:l,children:s}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function mk(){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 gk({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:m,onClose:g}){const b=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Nl,{title:"Расширения",className:"modal--wide",onClose:g,children:[i.jsx("div",{className:"tabs",role:"tablist",children:b.map(_=>i.jsxs("button",{role:"tab","aria-selected":l===_.id,className:l===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>m(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),l==="mcp"&&i.jsx(bk,{servers:s,actions:h}),l==="plugins"&&i.jsx(jk,{plugins:r,marketplaces:c,actions:h}),l==="catalog"&&i.jsx(Sk,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>m("plugins")}),i.jsx(_r,{result:d})]})}function bk({servers:l,actions:s}){const[r,c]=y.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--${yk(o.status)}`,children:xk[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(_k,{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 xk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function yk(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function _k({onSubmit:l,onCancel:s}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,m]=y.useState(""),[g,b]=y.useState(""),[_,j]=y.useState(""),v=o==="stdio",C=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function T(){if(C)if(v){const[E,...L]=vk(h);l(r.trim(),{transport:"stdio",command:E??"",args:L,env:qx(_)})}else l(r.trim(),{transport:o,url:g.trim(),headers:qx(_)})}return i.jsxs("div",{className:"extform extform--card",children:[i.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),i.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:E=>c(E.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(As,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:E=>d(E)}),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:E=>m(E.target.value)})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),i.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:E=>b(E.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:_,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:E=>j(E.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:T,children:"Подключить"})]})]})}function qx(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 vk(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function jk({plugins:l,marketplaces:s,actions:r}){const[c,o]=y.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 Lo=30;function Sk({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(Lo),[_,j]=y.useState(""),v=y.useMemo(()=>[...new Set(l.map(E=>E.category).filter(Boolean))].sort(),[l]),C=y.useMemo(()=>{const T=o.trim().toLowerCase();return l.filter(E=>h&&E.category!==h?!1:T?`${E.name} ${E.displayName} ${E.description} ${E.author}`.toLowerCase().includes(T):!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:T=>{d(T.target.value),b(Lo)}}),i.jsx(As,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{m(T),b(Lo)}})]}),C.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:C.slice(0,g).map(T=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&i.jsx("span",{className:"chip",children:T.version}),T.category&&i.jsx("span",{className:"chip",children:T.category})]}),T.description&&i.jsx("div",{className:"catalog__desc",children:T.description}),i.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>r.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),C.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>b(T=>T+Lo),children:["Ещё ",Math.min(Lo,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:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>j(T.target.value),onKeyDown:T=>{T.key!=="Enter"||_.trim()===""||(T.preventDefault(),r.pluginInstall(_.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),j("")},children:"Установить"})]})]})]})}function wk({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[b,_]=y.useState(""),[j,v]=y.useState(!1),[C,T]=y.useState(!1),E=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!C&&!j,L=y.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const G=s.output.trim();return G===""?null:{ok:!0,message:G}},[s.error,s.output]);function $(G=b){const O=G.trim();O!==""&&(r.submitCode(O),_(""))}function J(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return i.jsxs(Nl,{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:Tk[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(Ek,{login:s,remote:c,code:b,onCode:_,onSubmit:$,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(_r,{result:L}),C&&i.jsx("p",{className:"account__warn",role:"alert",children:kk(o)}),E&&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:[E&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
+ ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(Nk,{}),"Переподключить"]}),C?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>T(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{T(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:J,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{T(!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 kk(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 Nk(){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 Tk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Ek({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,m]=y.useState(null),g=y.useRef(""),b=y.useRef({code:r,onCode:c,onSubmit:o});b.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async E=>{const{code:L,onCode:$,onSubmit:J}=b.current;if(E&&L.trim()!=="")return;const G=await hp();if(G===null){E||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const O=G.trim();if(!Gx(O)){E||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(E){if(g.current===O)return;g.current=O}m(null),$(O),J(O)},[]);y.useEffect(()=>{if(!l.awaitingCode)return;const E=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[l.awaitingCode,_]);const j=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!Gx(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(Rp,{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:E=>{m(null),c(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!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 Gx(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 Ck({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(!1),_=y.useRef(null),j=(l==null?void 0:l.paired)===!0;y.useEffect(()=>{var C;j||(C=_.current)==null||C.focus()},[j]),y.useEffect(()=>{b(!1),j&&d("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return i.jsx(Nl,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Yx(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:Yx(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()&&(b(!0),s(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:_,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 Yx(l){try{return new URL(l).host}catch{return l}}const ep="",Ak=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Mk=fy.map(l=>({value:l.value,label:l.value,hint:l.hint})),Nf=3600*1e3,Rk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],oc={"6h":6*Nf,"24h":24*Nf,"48h":48*Nf,"168h":168*Nf,never:0};function Dk(l){return oc[l]??oc["48h"]}const Ok=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Tf=60*1e3,uc={"5m":5*Tf,"10m":10*Tf,"30m":30*Tf,"60m":60*Tf,never:0};function Lk(l){return uc[l]??uc["10m"]}function zk(l){const s=Object.entries(uc).find(([,r])=>r===l);return s?s[0]:Object.keys(uc).reduce((r,c)=>Math.abs(uc[c]-l)<Math.abs(uc[r]-l)?c:r)}function Uk(l){const s=Object.entries(oc).find(([,r])=>r===l);return s?s[0]:Object.keys(oc).reduce((r,c)=>Math.abs(oc[c]-l)<Math.abs(oc[r]-l)?c:r)}const Hk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],fc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Bk(l){return fc[l]??fc.off}function $x(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function Ik(l){const s=Object.entries(fc).find(([,r])=>r===l);return s?s[0]:Object.keys(fc).reduce((r,c)=>Math.abs(fc[c]-l)<Math.abs(fc[r]-l)?c:r)}const qk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Gk({settings:l,models:s,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:g}){const b=l===null,_=!b&&l.terminalEnabled===!0,j=!b&&l.liveSessionsFirst===!0,v=!_,C=y.useMemo(()=>{const E=[{value:ep,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(L=>({value:L.value,label:L.displayName,hint:L.description})):Ak];return l&&l.startModel!==null&&!E.some(L=>L.value===l.startModel)&&E.push({value:l.startModel,label:l.startModel}),E},[s,l]);function T(){var E,L;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:"Связать компьютер"})]}):(E=r.shell)!=null&&E.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:"Запретить"})]}):(L=r.shell)!=null&&L.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(Nl,{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:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(As,{className:"settings__select",value:Uk(l.autoArchiveAfterMs),options:Rk,onChange:E=>o({autoArchiveAfterMs:Dk(E)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(As,{className:"settings__select",value:zk(l.autoStopAfterMs),options:Ok,onChange:E=>o({autoStopAfterMs:Lk(E)}),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-часового лимита, %"}),b?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:E=>o({limitStopFiveHourPct:$x(E.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:"Остановка у недельного лимита, %"}),b?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:E=>o({limitStopSevenDayPct:$x(E.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, при этом всегда работает как обычно, независимо от этой настройки."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(As,{className:"settings__select",value:Ik(l.autoSaveAfterPauseMs),options:Hk,onChange:E=>o({autoSaveAfterPauseMs:Bk(E)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),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:"Модель"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(As,{className:"settings__select",value:l.startModel??ep,options:C,onChange:E=>o({startModel:E===ep?null:E}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(As,{className:"settings__select",value:l.startPermissionMode,options:Mk,onChange:E=>o({startPermissionMode:E}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),b?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:qk.map(E=>{const L=!b&&l.folderAccess===E.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:b,className:"access__card"+(L?" is-on":"")+(E.risky?" access__card--risky":""),onClick:()=>o({folderAccess:E.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:[E.title,E.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:E.description})]})]},E.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-label":"Терминал",className:_?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!_}),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:"Удалённый доступ к терминалу"}),b?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[v&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),T()]})]})]})]})})}const Xx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Yk(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function $k({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${Xx[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:[Xx[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",Yk(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 Xk({handoff:l,onClose:s}){const[r,c]=y.useState("");return y.useEffect(()=>{let o=!1;return Qf(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),i.jsx(Nl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Vx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Vk=12e3;function Qk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function Kk({notices:l,onDismiss:s}){return l.length===0?null:i.jsx("div",{className:"limittoasts",children:l.map(r=>i.jsx(Zk,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function Zk({notice:l,onDismiss:s}){return y.useEffect(()=>{const r=window.setTimeout(s,Vk);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:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",Qk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}const Fk=16;function Jk({pane:l,width:s,onResize:r,onReset:c}){const o=mr[l],d=y.useRef(null);function h(_){if(_.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-K0):0;d.current={x:_.clientX,width:s,max:Math.min(o.max,s+v)},_.currentTarget.setPointerCapture(_.pointerId),document.body.classList.add("is-resizing"),_.preventDefault()}function m(_){const j=d.current;if(!j)return;const v=o.side==="left"?_.clientX-j.x:j.x-_.clientX;r(Math.min(j.max,j.width+v))}function g(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function b(_){const j=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;j!==0&&(_.preventDefault(),r(s+j*Fk*(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:b,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Wk=16;function Pk({height:l,onResize:s,onReset:r}){const c=y.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const _=b.getBoundingClientRect().height-W0;return Math.round(l+Math.max(0,_))}function d(b){b.button===0&&(c.current={y:b.clientY,height:l,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const _=c.current;if(!_)return;const j=_.y-b.clientY;s(_.height+j,_.max)}function m(b){c.current&&(c.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function g(b){const _=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;_!==0&&(b.preventDefault(),s(l+_*Wk,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":py,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 Qx(){const l=document.documentElement,s=getComputedStyle(l),r=J=>s.getPropertyValue(J).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),_=r("--danger"),j=r("--ok"),v=r("--warn"),C=r("--cm-fn"),T=r("--cm-key"),E=r("--cm-type"),L=Kx(o,c,55),$=J=>Kx(J,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:L,brightBlack:h,red:_,brightRed:$(_),green:j,brightGreen:$(j),yellow:v,brightYellow:$(v),blue:C,brightBlue:$(C),magenta:T,brightMagenta:$(T),cyan:E,brightCyan:$(E),white:d,brightWhite:o}}function eN(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Ps=null;function tN(l){return Ps||(Ps=document.createElement("span"),Ps.style.position="fixed",Ps.style.width="0",Ps.style.height="0",Ps.style.opacity="0",Ps.style.pointerEvents="none",document.body.appendChild(Ps)),Ps.style.color=l,getComputedStyle(Ps).color}function Kx(l,s,r){return tN(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Ef=null;function nN(){return Ef||(Ef=Promise.all([Qe(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Qe(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Qe(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Qe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Ef=null,l})),Ef}function lN({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:_,onOpen:j,onClose:v,onInput:C,onResize:T,onAttach:E,onHide:L,registerSink:$}){const[J,G]=y.useState(()=>Qx());return y.useEffect(()=>{const O=new MutationObserver(()=>G(Qx()));return O.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>O.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:O=>{b&&(O.target.closest("button")||b())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(O=>i.jsxs("div",{role:"tab","aria-selected":O.id===s,className:"termtab"+(O.id===s?" is-on":"")+(O.exitCode!==null?" termtab--exited":""),onDoubleClick:Z=>{b&&(Z.target.closest(".termtab__close")||b())},children:[i.jsx("button",{className:"termtab__name",title:O.cwd,onClick:()=>_(O.id),children:O.title}),O.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${O.exitCode}`,children:O.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${O.title}»`,onClick:()=>v(O.id),children:"✕"})]},O.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),b&&i.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:i.jsx(kc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:L,children:"✕"})]}),c&&l.length>0&&i.jsx(Zx,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?i.jsx(Zx,{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(O=>i.jsx(aN,{id:O.id,exitCode:O.exitCode,active:O.id===s,theme:J,mobile:m,onInput:C,onResize:T,onAttach:E,registerSink:$},O.id))]})]})}function Zx({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=sN(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 sN(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 aN({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=y.useRef(null),_=y.useRef(null),j=y.useRef(!1),v=y.useRef(o);v.current=o;const C=y.useRef(c),T=y.useRef(s),[E,L]=y.useState("loading"),[$,J]=y.useState(!1);return y.useEffect(()=>{if(!b.current)return;let O=!1,Z=null;L("loading"),J(!1);const M=window.setTimeout(()=>{O||J(!0)},200);return(async()=>{var ke;let D;try{D=await nN()}catch{window.clearTimeout(M),O||L("error");return}if(O||!b.current)return;window.clearTimeout(M);const{Terminal:B,FitAddon:ne,WebLinksAddon:he}=D,P=new B({fontFamily:eN()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ue=new ne;P.loadAddon(ue),P.loadAddon(new he),P.open(b.current),_.current=P,P.attachCustomKeyEventHandler(k=>{if(k.type!=="keydown"||!(k.ctrlKey||k.metaKey))return!0;if(k.key==="`")return k.preventDefault(),!1;if(k.key==="c"||k.key==="C"){const ce=P.getSelection();return ce?(k.preventDefault(),Sc(ce),!1):!k.shiftKey}return k.key==="v"||k.key==="V"?(k.preventDefault(),hp().then(ce=>{ce&&P.paste(ce)}),!1):!0});const _e=k=>{k.preventDefault();const V=P.getSelection();if(V){Sc(V),P.clearSelection();return}hp().then(ce=>{ce&&P.paste(ce)})};(ke=P.element)==null||ke.addEventListener("contextmenu",_e);const De=P.onData(k=>d(l,k));let Ne={cols:P.cols,rows:P.rows},A=null;const fe=P.onResize(({cols:k,rows:V})=>{A!==null&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,!(k===Ne.cols&&V===Ne.rows)&&(Ne={cols:k,rows:V},h(l,k,V))},100)}),z=new ResizeObserver(()=>{try{ue.fit()}catch{return}v.current&&P.scrollToBottom()});z.observe(b.current);const pe=g(l,k=>{k.kind==="buffer"&&P.reset(),P.write(k.data)});m(l),T.current!==null&&!j.current&&(j.current=!0,P.write(`\r
129
+ \x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
130
+ `)),r&&P.focus(),Z=()=>{var k;A!==null&&window.clearTimeout(A),z.disconnect(),(k=P.element)==null||k.removeEventListener("contextmenu",_e),De.dispose(),fe.dispose(),pe(),P.dispose(),_.current=null},L("ready")})(),()=>{O=!0,window.clearTimeout(M),Z==null||Z(),Z=null}},[l]),y.useEffect(()=>{if(!o)return;const G=b.current;if(!G)return;let O=null,Z=0,M=!1;const D=P=>{P.pointerType==="mouse"||O!==null||(O=P.pointerId,Z=P.clientY,M=!1)},B=P=>{if(P.pointerId!==O)return;const ue=Z-P.clientY;if(!M){if(Math.abs(ue)<4)return;M=!0,G.setPointerCapture(P.pointerId)}Z=P.clientY;const _e=G.querySelector(".xterm-viewport");_e&&(_e.scrollTop+=ue)},ne=P=>{P.pointerId===O&&(G.hasPointerCapture(P.pointerId)&&G.releasePointerCapture(P.pointerId),O=null,M=!1)},he=P=>P.stopPropagation();return G.addEventListener("pointerdown",D),G.addEventListener("pointermove",B),G.addEventListener("pointerup",ne),G.addEventListener("pointercancel",ne),G.addEventListener("touchmove",he,{capture:!0}),()=>{G.removeEventListener("pointerdown",D),G.removeEventListener("pointermove",B),G.removeEventListener("pointerup",ne),G.removeEventListener("pointercancel",ne),G.removeEventListener("touchmove",he,{capture:!0}),O!==null&&G.hasPointerCapture(O)&&G.releasePointerCapture(O)}},[o]),y.useEffect(()=>{C.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var G;r&&((G=_.current)==null||G.focus())},[r]),y.useEffect(()=>{if(T.current=s,s===null){j.current=!1;return}if(j.current)return;const G=_.current;G&&(j.current=!0,G.write(`\r
131
+ \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
132
+ `))},[s]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:b,className:"termview__surface"+(E==="ready"?"":" is-hidden")}),E==="loading"&&$&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),E==="error"&&i.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[i.jsx("p",{children:"Не удалось загрузить терминал"}),i.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),i.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const iN=2e5,rN=75,cN=90;function oN({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??iN,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${uN(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function uN(l){return l>=cN?" contextbar__fill--over":l>=rN?" contextbar__fill--warn":""}const n_="ccv:last-session",fN=300*1e3,dN=1e4;function hN(){try{const l=localStorage.getItem(n_);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 pN(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const mN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Fx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],gN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Jx(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)=>Wx(h.name,d)-Wx(m.name,d))}}function Wx(l,s){return l.toLowerCase().startsWith(s)?0:1}function Px(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 bN(){var wa,Hr;const l=y.useRef(null),[s,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[m,g]=y.useState(!1),b=y.useMemo(()=>Mf()==="relay",[]),[_,j]=y.useState([]),[v,C]=y.useState([]),[T,E]=y.useState([]),[L,$]=y.useState([]),[J,G]=y.useState([]),[O,Z]=y.useState([]),[M,D]=y.useState([]),[B,ne]=y.useState([]),[he,P]=y.useState([]),[ue,_e]=y.useState(null),[De,Ne]=y.useState(null),[A,fe]=y.useState(null),[z,pe]=y.useState(null),[ke,k]=y.useState(null),[V,ce]=y.useState(wl),[ge,Ae]=y.useState(zh),[Se,Te]=y.useState(!1),[Tt,Ye]=y.useState(!1),et=$f("(max-width: 860px)"),[Xe,Qt]=y.useState(!1);y.useEffect(()=>{et||Qt(!1)},[et]);const[tt,Yt]=y.useState(!1),[nt,en]=y.useState([]),[$t,tn]=y.useState(!1),[nn,pn]=y.useState(wl),[Sn,mn]=y.useState(null),[cn,Ke]=y.useState(null),[zt,gn]=y.useState([]),[ut,Je]=y.useState(null),[An,on]=y.useState(null),[wn,Pn]=y.useState([]),[Xt,wt]=y.useState([]),[Kt,Et]=y.useState([]),[Yn,le]=y.useState([]),[be,Le]=y.useState(null),[H,W]=y.useState({}),[xe,Be]=y.useState(null),[pt,Mn]=y.useState({}),[bn,Rn]=y.useState(null),[ul,gl]=y.useState([]),[ra,Ql]=y.useState(!1),[ms,Rs]=y.useState(null),[Dn,Kl]=y.useState(null),[bl,$n]=y.useState(!1),[Vt,$e]=y.useState(gN),[_t,xl]=y.useState(null),[lt,Zl]=y.useState(null),[Ut,el]=y.useState(!1),[kt,,Tl]=X0(),ln=J0(),[kn,mt]=y.useState(!1),[Ze,On]=y.useState(null),[El,xn]=y.useState(null),[Nn,tl]=y.useState(null),[gs,yn]=y.useState(null),[Fl,fl]=y.useState(null),[nl,Ln]=y.useState(""),[Ht,Ia]=y.useState(null),[Hi,Ds]=y.useState([]),[Os,yl]=y.useState(!1),[qa,zn]=y.useState(null),[bs,Jl]=y.useState(!1),[sn,Bt]=y.useState(!1),[me,N]=y.useState({}),[Y,ae]=y.useState([""]),[we,ve]=y.useState([]),[ze,ot]=y.useState(null),[un,Mt]=y.useState(null),[ht,fn]=y.useState(null),[It,ll]=y.useState(null),[xs,w]=y.useState(null),[ie,Me]=y.useState({}),[Fe,_n]=y.useState({}),[ys,_s]=y.useState(!1),[Ls,Bi]=y.useState(null),[ca,vr]=y.useState(null),Ii=y.useRef(0),oa=y.useRef(null),[ua,Zn]=y.useState(!1),[Wl,zs]=y.useState([]),[qi,jr]=y.useState(null),[Nc,Ga]=y.useState(null),Us=P0(),Ya=lv(et&&ua),$a=y.useRef(new Map),fa=(Dn==null?void 0:Dn.terminalEnabled)===!0,Sr=Mf()==="relay"&&((wa=d==null?void 0:d.shell)==null?void 0:wa.enabled)!==!0,Tc=y.useRef(!1),Ec=y.useCallback((p,I)=>($a.current.set(p,I),()=>{$a.current.get(p)===I&&$a.current.delete(p)}),[]),[da,wr]=y.useState(!1),[Xo,kr]=y.useState(null),[Vo,Gi]=y.useState(wl),[vs,Nr]=y.useState(null),[Yi,ha]=y.useState({}),pa=y.useRef([]),[an,Cc]=y.useState(null);function Kf(p){Cc(I=>I===p?null:p)}y.useEffect(()=>{(et||an==="terminal"&&!ua||an==="files"&&!sn||an==="search"&&!ys||an==="git"&&!kn||an==="ask"&&!da||an==="main"&&we.length===0)&&Cc(null)},[an,et,ua,sn,ys,kn,da,we.length]);const[Qo]=y.useState(hN),Ko=y.useRef(Qo),Tr=y.useRef(!1),Xn=y.useRef(null),$i=y.useRef(null),Xi=y.useRef(null),Zo=y.useRef(0),Un=y.useRef(null),Fo=y.useRef(0);Xn.current=z,Un.current=A,Fo.current=V.lastSeq;const Jo=y.useRef(ge);Jo.current=ge;const Il=y.useRef(null),Xa=y.useRef(0);Xa.current=Vo.lastSeq;const Er=y.useRef(null),Vi=y.useRef(""),Va=y.useRef(null),Hs=y.useRef([]),Ac=y.useRef([""]);Hs.current=we,Ac.current=Y;const Qa=y.useRef(new Map),js=y.useRef(new Set),Qi=y.useRef(null),Ki=y.useRef(null),Wo=y.useRef(0),Ka=y.useRef(new Set);y.useEffect(()=>{const p=D0();if(!p)return;l.current=p;const I=()=>{r(p.connected),o(p.statusText)};p.onStatus(I),p.onReconnect(()=>{I(),Mn({});const gt=Xn.current;gt&&p.send({type:"session.sync",sessionId:gt,sinceSeq:Fo.current});const Zt=Il.current;Zt&&p.send({type:"session.sync",sessionId:Zt,sinceSeq:Xa.current})});const de=p.on(gt=>Po(gt));p.connect();const Ie=window.setInterval(()=>{I(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{de(),window.clearInterval(Ie),p.close()}},[]);const Po=y.useCallback(p=>{var I,de,Ie,gt,Zt,Dl,oi,ka,ui;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{j(p.workspaces),C(p.archived),fe(qe=>{var rs;if(qe)return qe;const vt=Ko.current,bt=vt&&p.workspaces.find(cs=>cs.id===vt.workspaceId);return(bt==null?void 0:bt.id)??((rs=p.workspaces[0])==null?void 0:rs.id)??null});const ye=Va.current;if(!ye)break;const Ee=p.workspaces.find(qe=>SN(qe.path,ye));if(!Ee)break;Va.current=null,Yt(!1),fe(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==Vi.current)break;en(p.candidates),p.source==="host"&&tn(!1);break;case"finder.opened":Er.current=p.sessionId;break;case"workspace.roots":gn(p.roots);break;case"workspace.created":if(fe(p.workspace.id),p.warnings.length===0){Yt(!1),Ke(null);break}Je({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Un.current)break;Z(p.sessions),D(p.archived);break;case"folder.list":E(p.workspaceFolders),$(p.sessionFolders),G(p.pinnedFolders??[]);break;case"session.pinned":ne(p.sessions);break;case"session.live":P(p.sessions);break;case"order.state":Ne(p.order);break;case"session.summary":if(p.session.id===Er.current){mn(p.session);break}if(p.session.parentSessionId){p.session.id===Il.current&&Nr(p.session);break}if(P(ye=>{const Ee=ye.findIndex(vt=>vt.id===p.session.id);if(p.session.state==="closed")return Ee===-1?ye:ye.filter(vt=>vt.id!==p.session.id);if(Ee===-1)return[...ye,p.session];const qe=ye.slice();return qe[Ee]=p.session,qe}),Z(ye=>{const Ee=ye.findIndex(vt=>vt.id===p.session.id);if(Ee===-1)return[p.session,...ye];const qe=ye.slice();return qe[Ee]=p.session,qe}),ne(ye=>{const Ee=ye.findIndex(vt=>vt.id===p.session.id);if(Ee===-1)return ye;const qe=ye.slice();return qe[Ee]={...p.session,pinned:!0,...ye[Ee].pinnedAt?{pinnedAt:ye[Ee].pinnedAt}:{}},qe}),Xn.current===null&&Xi.current&&Xi.current.workspaceId===p.session.workspaceId&&(ry(p.session.id,Xi.current.text),Xi.current=null),pe(ye=>ye??p.session.id),((I=$i.current)==null?void 0:I.sessionId)===p.session.id){const ye=$i.current;p.session.state==="error"?$i.current=null:p.session.state!=="closed"&&($i.current=null,(de=l.current)==null||de.send({type:"prompt.send",sessionId:ye.sessionId,text:ye.text,images:ye.images}))}break;case"usage.state":p.sessionId===Xn.current&&(xl(p.usage),el(!1));break;case"context.state":p.sessionId===Xn.current&&(Zl(p.context),el(!1));break;case"session.capabilities":p.sessionId===Xn.current&&k(p.capabilities);break;case"session.events":if(p.sessionId===Il.current){Gi(ye=>Rf(ye,p.entries));break}if(p.sessionId===Er.current){pn(ye=>Rf(ye,p.entries));break}if(p.sessionId!==Xn.current)break;for(const ye of p.entries){if(ye.event.kind!=="rewound")continue;const Ee=ye.event.toUserIndex,qe=Y0(Jo.current.entries,Ee),vt=qe.reduce((bt,rs)=>rs.event.kind==="user.message"?bt+1:bt,0);Ae(bt=>({...bt,entries:qe})),ce(bt=>({...bt,items:$0(bt.items,Ee,vt)}))}ce(ye=>Rf(ye,p.entries));break;case"session.history":if(p.sessionId!==Xn.current)break;Ae(ye=>I0(ye,p));break;case"side.opened":{if(p.parentSessionId!==Xn.current)break;Il.current=p.sessionId,kr(p.sessionId);const ye=pa.current;pa.current=[];for(const Ee of ye)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Xn.current)break;Il.current=null,kr(null),Gi(wl),Nr(null);break;case"git.state":if(p.workspaceId!==Un.current)break;On(p.state);break;case"git.commit":if(p.workspaceId!==Un.current)break;xn(p.detail);break;case"git.result":if(p.workspaceId!==Un.current)break;yn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(xn(null),tl(null),yl(!1),Jl(!1));break;case"git.busy":if(p.workspaceId!==Un.current)break;Ln(p.label);break;case"git.files":if(p.workspaceId!==Un.current)break;zn({files:p.files,truncated:p.truncated});break;case"github.status":Ia(p.status);break;case"github.owners":Ds(p.owners);break;case"fs.dir":if(p.workspaceId!==Un.current)break;N(ye=>({...ye,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Un.current)break;if(p.scope!=="tree"){const ye=p.scope;_n(Ee=>({...Ee,[ye]:{query:p.query,entries:p.entries}}));break}w({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Un.current)break;Bi({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Un.current)break;const ye=js.current.delete(p.file.path);ve(qe=>{const vt=qe.findIndex(cs=>cs.path===p.file.path);if(vt===-1)return[...qe,bx(p.file,++Wo.current)];const bt=qe[vt],rs=qe.slice();return rs[vt]=bt.saved===p.file.content&&!Ua(bt)?{...bt,mtime:p.file.mtime,size:p.file.size,stale:!1}:bx(p.file,++Wo.current),rs}),ye&&ot(p.file.path);const Ee=oa.current;Ee&&Ee.path===p.file.path&&(oa.current=null,vr({...Ee,token:++Ii.current}));break}case"fs.media":{if(p.workspaceId!==Un.current)break;Ka.current.delete(p.path),ve(ye=>ye.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==Un.current)break;Ka.current.delete(p.path),ve(ye=>ye.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==Un.current)break;const ye=Qa.current.get(p.path);Qa.current.delete(p.path);const Ee=ye!==void 0;ve(vt=>vt.map(bt=>bt.path!==p.path?bt:Ee?{...bt,saved:ye,mtime:p.mtime,size:p.size,stale:!1}:{...bt,stale:!0}));const qe=Hs.current.find(vt=>vt.path===p.path);!Ee&&qe&&!Ua(qe)&&((Ie=l.current)==null||Ie.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(gt=l.current)==null||gt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Un.current)break;if(Mt({ok:p.ok,message:p.message}),p.ok||Qa.current.delete(p.path),p.conflict&&ve(Ee=>Ee.map(qe=>qe.path===p.path?{...qe,stale:!0}:qe)),Ki.current===p.path){const Ee=Ki.current;Ki.current=null,p.ok&&(js.current.add(Ee),(Zt=l.current)==null||Zt.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const ye=Qi.current;if(p.ok&&ye&&ye.to===p.path){Qi.current=null;const Ee=qe=>qe===ye.from?ye.to:qe.startsWith(`${ye.from}/`)?ye.to+qe.slice(ye.from.length):qe;ve(qe=>qe.map(vt=>({...vt,path:Ee(vt.path)}))),ot(qe=>qe===null?null:Ee(qe)),ae(qe=>qe.map(Ee)),N(qe=>{const vt={};for(const[bt,rs]of Object.entries(qe))bt===ye.from||bt.startsWith(`${ye.from}/`)||(vt[bt]=rs);return vt})}p.ok&&((Dl=l.current)==null||Dl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Un.current)break;zs(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Un.current)break;Ga(null),zs(ye=>{const Ee=ye.findIndex(vt=>vt.id===p.terminal.id);if(Ee===-1)return[...ye,p.terminal];const qe=ye.slice();return qe[Ee]=p.terminal,qe}),Tc.current&&(Tc.current=!1,jr(p.terminal.id));break;case"term.buffer":(oi=$a.current.get(p.id))==null||oi({kind:"buffer",data:p.data});break;case"term.data":(ka=$a.current.get(p.id))==null||ka({kind:"data",data:p.data});break;case"term.exit":zs(ye=>ye.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":zs(ye=>ye.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===Xn.current&&Pn(p.servers);break;case"plugin.list":if(p.sessionId!==Xn.current)break;wt(p.plugins),Et(p.marketplaces),le(p.catalog);break;case"operation.result":p.sessionId===Xn.current&&Le(p.result);break;case"auth.status":Rs(p.status);break;case"relay.state":h(p.state);break;case"settings.state":Kl(p.settings);break;case"handoff.state":W(ye=>{if(!p.handoff){if(!(p.sessionId in ye))return ye;const Ee={...ye};return delete Ee[p.sessionId],Ee}return{...ye,[p.sessionId]:p.handoff}});break;case"handoff.written":Mn(ye=>{if(!(p.sessionId in ye))return ye;const Ee={...ye};return delete Ee[p.sessionId],Ee}),p.handoff&&Xn.current===p.sessionId?Rn(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Zo.current+=1,gl(ye=>[...ye,{id:Zo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":$e(p.state),p.state.active&&Ql(!0);break;case"session.closed":P(ye=>ye.filter(Ee=>Ee.id!==p.sessionId)),Z(ye=>ye.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Va.current=null,Ke(p.message)),(ui=p.context)!=null&&ui.startsWith("term.")&&Ga(p.message);break}},[]),ee=y.useCallback(p=>{var I;(I=l.current)==null||I.send(p)},[]);y.useEffect(()=>{A&&ee({type:"session.list",workspaceId:A})},[A,ee]),y.useEffect(()=>{s&&ee({type:"session.pins"})},[s,ee]),y.useEffect(()=>{s&&ee({type:"settings.get"})},[s,ee]),y.useEffect(()=>{if(s)return ee({type:"session.drafts",sessionIds:cy()}),U0(p=>ee({type:"session.drafts",sessionIds:p}))},[s,ee]),y.useEffect(()=>{if(Tr.current)return;const p=Ko.current;if(!p||!A)return;if(A!==p.workspaceId){Tr.current=!0;return}if(z){Tr.current=!0;return}if(O.length===0)return;const I=O.find(de=>pN(de,p));Tr.current=!0,I&&I.state!=="closed"&&ts(I)},[O,A,z]),y.useEffect(()=>{!A||Sr||!fa||ee({type:"term.list",workspaceId:A})},[A,Sr,fa,ee]),y.useEffect(()=>{jr(p=>{var I;return p&&Wl.some(de=>de.id===p)?p:((I=Wl[0])==null?void 0:I.id)??null})},[Wl]),y.useEffect(()=>{tt&&ee({type:"workspace.roots"})},[tt,ee]);const Pl=y.useCallback(()=>{const p=Xn.current;p&&(el(!0),ee({type:"usage.get",sessionId:p}),ee({type:"context.get",sessionId:p}))},[ee]);y.useEffect(()=>{if(!Ut)return;const p=window.setTimeout(()=>el(!1),dN);return()=>window.clearTimeout(p)},[Ut]);const Mc=y.useMemo(()=>{const p=Math.max((_t==null?void 0:_t.fetchedAt)??0,(lt==null?void 0:lt.fetchedAt)??0);return p>0?p:null},[_t==null?void 0:_t.fetchedAt,lt==null?void 0:lt.fetchedAt]);y.useEffect(()=>{if(Zl(null),!z)return;Pl();const p=()=>{document.hidden||Pl()},I=window.setInterval(p,fN),de=()=>{document.hidden||Pl()};return document.addEventListener("visibilitychange",de),()=>{window.clearInterval(I),document.removeEventListener("visibilitychange",de)}},[z,Pl]),y.useEffect(()=>{if(!z){Ae(zh);return}Ae({...zh,loading:!0}),ee({type:"session.history",sessionId:z})},[z,ee]);const Cr=y.useCallback(()=>{!z||ge.loading||!Db(ge)||(Ae(p=>({...p,loading:!0})),ee({type:"session.history",sessionId:z,before:uy(ge)}))},[z,ge,ee]),eu=y.useMemo(()=>q0(ge.entries),[ge.entries]),X=y.useMemo(()=>O.find(p=>p.id===z)??null,[O,z]),ma=z?(X==null?void 0:X.claudeSessionId)??z:null,ga=ma?H[ma]??null:null;y.useEffect(()=>{ma&&ee({type:"handoff.get",sessionId:ma})},[ma,ee]),y.useEffect(()=>{xe&&!(xe.sessionId in H)&&Be(null)},[H,xe]);const Rc=y.useMemo(()=>{var de;if(!_t)return null;const p=(((de=_t.buckets)==null?void 0:de.length)??0)>0,I=(X==null?void 0:X.provider)==="antigravity";return p===I?_t:null},[_t,X==null?void 0:X.provider]),Dc="Обновить лимиты и контекст",tu=Dc+(Mc?`
134
+ обновлено в ${new Date(Mc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{document.documentElement.dataset.provider=(X==null?void 0:X.provider)??"claude"},[X==null?void 0:X.provider]),y.useEffect(()=>{(X==null?void 0:X.provider)==="antigravity"&&wr(!1)},[X==null?void 0:X.provider]);const Za=_.find(p=>p.id===A)??v.find(p=>p.id===A)??null;y.useEffect(()=>{if(!A||!z)return;const p={workspaceId:A,sessionId:z,claudeSessionId:(X==null?void 0:X.claudeSessionId)??null};try{localStorage.setItem(n_,JSON.stringify(p))}catch{}},[A,z,X==null?void 0:X.claudeSessionId]);function Zf(p){Va.current=p,Ke(null),ee({type:"workspace.open",path:p})}function Ff(p,I,de){Ke(null),ee({type:"workspace.create",parent:p,name:I,init:de})}function Jf(p){if(Vi.current=p,!p){en([]),tn(!1);return}tn(!0),ee({type:"workspace.find",query:p})}function Wf(p){Vi.current=p,pn(wl),ee({type:"workspace.find.agent",query:p})}function _l(){Yt(!1),Ke(null),Je(null),en([]),pn(wl),mn(null),Vi.current="",Va.current=null}function es(){const p=Xn.current;p&&Il.current&&ee({type:"side.reset",sessionId:p}),Il.current=null,kr(null),Gi(wl),Nr(null),ha({}),pa.current=[]}function nu(p){ee({type:"workspace.close",workspaceIds:p}),!(!A||!p.includes(A))&&(es(),fe(null),pe(null),Z([]),D([]),ce(wl),k(null),Ye(!1))}function lu(p,I){ee({type:"session.archive",workspaceId:p,sessionIds:I}),z&&(I.includes(z)||X!=null&&X.claudeSessionId&&I.includes(X.claudeSessionId))&&(es(),pe(null),ce(wl),k(null),Ye(!1))}function su(p){ee({type:"workspace.restore",workspaceIds:p})}function au(p,I,de){ee({type:"folder.create",scope:p,name:I,workspaceId:de})}function Oc(p,I){ee({type:"folder.rename",folderId:p,name:I})}function Pf(p,I){ee({type:"folder.setColor",folderId:p,color:I})}function Fa(p){ee({type:"folder.delete",folderId:p})}function Lc(p,I,de,Ie){ee({type:"folder.assign",scope:p,itemId:I,folderId:de,workspaceId:Ie})}function Zi(p="claude"){A&&(es(),pe(null),k(null),ce(wl),Ye(!1),ee({type:"session.start",workspaceId:A,provider:p}),Te(!1))}function Fi(p){es(),qt(),fe(p),pe(null),ce(wl),k(null),Ye(!1),On(null),xn(null),tl(null),yn(null),Ln(""),yl(!1),zn(null),Jl(!1),zs([]),jr(null)}function iu(p,I,de){ee({type:"session.pin",workspaceId:p,sessionIds:I,pinned:de})}function ba(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Bs(p){if(ba(p)){_e(p);return}ee({type:"session.close",sessionId:p.id})}function zc(p,I,de){Ne(Ie=>{const gt=Ie??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!de)return Ie;const Zt={...gt.sessions};return I&&I.length>0?Zt[de]=I:delete Zt[de],{...gt,sessions:Zt}}return{...gt,[p]:I??[]}}),ee({type:"order.set",scope:p,ids:I,...de?{workspaceId:de}:{}})}function ru(p){p.workspaceId!==A&&Fi(p.workspaceId),ts(p)}function ts(p){if(Te(!1),es(),ce(wl),k(null),Ye(!1),p.state==="closed"){pe(null),ee({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}pe(p.id),ee({type:"session.sync",sessionId:p.id,sinceSeq:0})}function cu(p,I){if(z){if((X==null?void 0:X.state)==="closed"){$i.current={sessionId:X.id,text:p,images:I},ts(X);return}ee({type:"prompt.send",sessionId:z,text:p,images:I})}}function Uc(p){const I=he.find(de=>(de.claudeSessionId??de.id)===p.sessionId&&de.state!=="closed");ou(p.workspaceId,p.sessionId,p.text),I&&ee({type:"session.close",sessionId:I.id})}function Hc(p){ou(p.workspaceId,p.claudeSessionId??p.id,null)}function ou(p,I,de){Xi.current=de===null?null:{workspaceId:p,text:de},p!==A?Fi(p):(es(),pe(null),k(null),ce(wl),Ye(!1)),ee({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:I,...de===null?{}:{fromHandoff:!0}}),Te(!1)}y.useEffect(()=>{bn&&(Rn(null),Uc(bn))},[bn]);function uu(p){pt[p.id]||(Mn(I=>({...I,[p.id]:!0})),ee({type:"session.handoff",sessionId:p.id}))}function ed(p){ee({type:"handoff.dismiss",sessionId:p})}function Bc(p,I){ee({type:"session.rename",sessionId:p.id,title:I,workspaceId:p.workspaceId}),Z(de=>de.map(Ie=>Ie.id===p.id?{...Ie,title:I}:Ie))}function Ic(p){z&&(Te(!1),Le(null),on(p),ee({type:"mcp.list",sessionId:z}),ee({type:"plugin.list",sessionId:z}))}const qc={mcpAction:(p,I)=>{z&&(ee({type:"mcp.action",sessionId:z,name:p,action:I}),on(null))},mcpAdd:(p,I)=>{z&&ee({type:"mcp.add",sessionId:z,name:p,draft:I})},mcpRemove:p=>{z&&ee({type:"mcp.remove",sessionId:z,name:p})},pluginInstall:p=>{z&&ee({type:"plugin.install",sessionId:z,spec:p})},pluginUninstall:p=>{z&&ee({type:"plugin.uninstall",sessionId:z,id:p})},pluginToggle:(p,I)=>{z&&ee({type:"plugin.toggle",sessionId:z,id:p,enabled:I})},marketplaceAdd:p=>{z&&ee({type:"marketplace.add",sessionId:z,source:p})},marketplaceRemove:p=>{z&&ee({type:"marketplace.remove",sessionId:z,name:p})}};function Cl(){Te(!1),Ql(!0),ee({type:"auth.status"})}const Ja={login:(p,I)=>ee({type:"auth.login",mode:p,switchAccount:I}),submitCode:p=>ee({type:"auth.code",code:p}),cancel:()=>ee({type:"auth.cancel"}),logout:()=>ee({type:"auth.logout"})};function Al(){Te(!1),$n(!0),ee({type:"settings.get"})}function Wa(p){Kl(I=>I&&{...I,...p}),ee({type:"settings.update",settings:p})}function Gc(p){z&&ee({type:"side.ask",sessionId:z,text:p})}function Ar(){z&&(ee({type:"side.reset",sessionId:z}),Il.current=null,kr(null),Gi(wl),Nr(null),ha({}),pa.current=[])}function Is(p){const I=Il.current;if(I){p(I);return}const de=Xn.current;de&&(pa.current.push(p),ee({type:"side.open",sessionId:de}))}function Mr(){A&&ee({type:"git.state",workspaceId:A})}function xa(p){A&&(tl(p),ee({type:"git.show",workspaceId:A,ref:p}))}function Yc(p,I){yn(null),fl({target:p,label:I})}function Rr(){!A||!Fl||(ee({type:"git.checkout",workspaceId:A,target:Fl.target}),fl(null))}function Pa(){A&&(yn(null),ee({type:"git.push",workspaceId:A}))}function td(p){A&&(yn(null),ee({type:"git.pull",workspaceId:A,merge:p}))}function vl(){A&&(yn(null),zn(null),yl(!0),ee({type:"github.status"}),ee({type:"github.owners"}),ee({type:"git.files",workspaceId:A}))}function $c(p){A&&(yn(null),ee({type:"git.publish",workspaceId:A,...p}))}function Ss(p){A&&(yn(null),ee({type:"git.remote",workspaceId:A,url:p}))}function fu(){yn(null),Jl(!0)}function Dr(p){ee({type:"github.token",token:p}),ee({type:"github.owners"})}function ya(){ee({type:"github.status"}),ee({type:"github.owners"})}y.useEffect(()=>{if(!(!sn||!A))for(const p of Y)p in me||ee({type:"fs.list",workspaceId:A,path:p})},[sn,Y,me,A,ee]);function Xc(p){ae(I=>I.includes(p)?I.filter(de=>de!==p):[...I,p])}function du(p){if(!p){w(null);return}A&&ee({type:"fs.search",workspaceId:A,query:p})}function Vc(p){if(!p){Bi(null);return}A&&ee({type:"fs.grep",workspaceId:A,query:p})}const Qc=y.useCallback((p,I)=>{Me(gt=>({...gt,[p]:I}));const de=Un.current;if(I===null||!de)return;const Ie=I.lastIndexOf("/");if(Ie!==-1){ee({type:"fs.list",workspaceId:de,path:I.slice(0,Ie)});return}if(I===""){ee({type:"fs.list",workspaceId:de,path:""});return}ee({type:"fs.search",workspaceId:de,query:I,scope:p})},[ee]),Ml=y.useMemo(()=>Jx(ie.mention??null,Fe.mention??null,me),[ie.mention,Fe.mention,me]),ei=y.useMemo(()=>Jx(ie.side??null,Fe.side??null,me),[ie.side,Fe.side,me]);function ti(p){_a(p.path,{line:p.line,column:p.column})}function Or(p){const I=[];let de=gr(p.path);for(;I.push(de),!!de;)de=gr(de);ae(Ie=>{const gt=new Set(Ie);for(const Zt of I)gt.add(Zt);return p.kind==="dir"&&gt.add(p.path),[...gt]}),p.kind==="file"&&_a(p.path)}function _a(p,I){if(Hs.current.find(Ie=>Ie.path===p)){ot(p),I&&vr({path:p,...I,token:++Ii.current});return}A&&(I&&(oa.current={path:p,...I}),js.current.add(p),ee({type:"fs.read",workspaceId:A,path:p}))}function dl(p,I=!1){const de=Hs.current,Ie=de.find(Dl=>Dl.path===p);if(Ie&&Ua(Ie)&&!I){ll(p);return}ll(null);const gt=de.findIndex(Dl=>Dl.path===p),Zt=de.filter(Dl=>Dl.path!==p);ve(Zt),ot(Dl=>{var oi;return Dl===p?((oi=Zt[Math.min(gt,Zt.length-1)])==null?void 0:oi.path)??null:Dl})}function sl(p,I=!1){const de=Hs.current.find(Ie=>Ie.path===p);!de||!A||!I&&!Ua(de)||(Qa.current.set(p,de.text),ee({type:"fs.write",workspaceId:A,path:p,content:de.text,eol:de.eol,encoding:de.encoding,baseMtime:de.mtime,...I?{force:!0}:{}}))}function qs(p){A&&ee({type:"fs.read",workspaceId:A,path:p})}function ns(p){A&&(Ka.current.has(p)||(Ka.current.add(p),ee({type:"fs.readMedia",workspaceId:A,path:p})))}const ls=y.useRef(new Map);function ws(p){const I=ls.current,de=I.get(p);de&&clearTimeout(de);const Ie=(Dn==null?void 0:Dn.autoSaveAfterPauseMs)??0;Ie<=0||I.set(p,setTimeout(()=>{I.delete(p);const gt=Hs.current.find(Zt=>Zt.path===p);gt&&Ua(gt)&&!gt.stale&&sl(p)},Ie))}function hu(p,I,de){if(!A)return;const Ie=p?`${p}/${de}`:de;Mt(null),I==="file"&&(Ki.current=Ie),ee({type:"fs.create",workspaceId:A,path:Ie,kind:I})}function Kc(p,I){if(!A)return;const de=gr(p),Ie=de?`${de}/${I}`:I;Mt(null),Qi.current={from:p,to:Ie},ee({type:"fs.rename",workspaceId:A,path:p,to:Ie})}function Zc(p,I){if(!A)return;const de=p.slice(p.lastIndexOf("/")+1),Ie=I?`${I}/${de}`:de;Ie!==p&&(Mt(null),Qi.current={from:p,to:Ie},ee({type:"fs.rename",workspaceId:A,path:p,to:Ie}))}function pu(p,I){A&&(Mt(null),ee({type:"fs.copy",workspaceId:A,path:p,toDir:I}))}function Vn(p){A&&(Mt(null),fn(null),ee({type:"fs.delete",workspaceId:A,path:p.path}),ve(I=>I.filter(de=>de.path!==p.path&&!de.path.startsWith(`${p.path}/`))),ot(I=>I&&(I===p.path||I.startsWith(`${p.path}/`))?null:I))}function qt(){N({}),ae([""]),ve([]),ot(null),Mt(null),w(null),Bi(null),Me({}),_n({}),vr(null),js.current.clear(),Qa.current.clear(),Ka.current.clear(),oa.current=null,Qi.current=null,Ki.current=null}function st(){!A||Sr||!fa||(Ga(null),Tc.current=!0,ee({type:"term.open",workspaceId:A,cols:80,rows:24}))}function Gs(p){ee({type:"term.close",id:p})}function Rl(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:I})}function Fc(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",answers:I})}function Ys(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function mu(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",plan:I})}function gu(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function p(I){if(I.key!=="Escape")return;if(an!==null){const Ie=I.target;if(!(Ie instanceof HTMLElement&&Ie.closest(".termview, .editor, .sidepane"))){Cc(null);return}}if(!z||V.pending.length>0)return;const de=I.target;de instanceof HTMLElement&&de.closest(".sidepane, .editor")||ee({type:"control.interrupt",sessionId:z})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[z,V.pending.length,ee,an]),y.useEffect(()=>{function p(I){I.key!=="`"||!(I.ctrlKey||I.metaKey)||fa&&(I.preventDefault(),Zn(de=>!de))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[fa]);const va=y.useMemo(()=>{const p=(ke==null?void 0:ke.commands)??[];return p.length===0||(X==null?void 0:X.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Fx]},[ke,X==null?void 0:X.provider]);function $s(p){const I=mN[p];return I&&(X==null?void 0:X.provider)!=="antigravity"?(Ic(I),!0):(X==null?void 0:X.provider)==="antigravity"||!Fx.some(de=>de.name===p)?!1:(Cl(),p==="logout"&&Ja.logout(),p==="switch-account"&&Ja.login("claudeai",!0),!0)}const ni=(X==null?void 0:X.state)==="waiting_permission",al=(X==null?void 0:X.state)==="reconnecting",jl=(X==null?void 0:X.state)==="running"||al||ni,Tn=V.pending[0]??null,ss=Tn?jw(Tn.toolName,Tn.input):null;y.useEffect(()=>{!kn&&!sn||!A||jl||ee({type:"git.state",workspaceId:A})},[kn,sn,A,jl,ee]),y.useEffect(()=>{if(!(jl||!A)){sn&&N(p=>{const I={};for(const[de,Ie]of Object.entries(p))Ac.current.includes(de)||(I[de]=Ie);return I});for(const p of Hs.current)Ua(p)||ee({type:"fs.read",workspaceId:A,path:p.path})}},[jl,A,sn,ee]);const as=(X==null?void 0:X.cwd)??(ke==null?void 0:ke.cwd)??null,is=(ke==null?void 0:ke.models)??[],li=(X==null?void 0:X.model)??(ke==null?void 0:ke.model)??null,{rows:Lr,selected:si}=Px(is,li),Xs=vs?{model:vs.model,effort:vs.effort,ultracode:vs.ultracode,thinking:vs.thinking,switchOnFlag:vs.switchModelsOnFlag}:{model:Yi.model??li,effort:Yi.effort??(X==null?void 0:X.effort)??null,ultracode:Yi.ultracode??(X==null?void 0:X.ultracode)??!1,thinking:Yi.thinking??(X==null?void 0:X.thinking)??!0,switchOnFlag:Yi.switchOnFlag??(X==null?void 0:X.switchModelsOnFlag)??!0},Vs=Px(is,Xs.model),Qn=(vs==null?void 0:vs.state)==="running",ai=ze?we.find(p=>p.path===ze)??null:null,bu=new Set(we.filter(Ua).map(p=>p.path)),Ji=p=>i.jsx(Jk,{pane:p,width:ln.widths[p],onResize:I=>ln.setWidth(p,I),onReset:()=>ln.reset(p)}),ii=p=>et?null:()=>Kf(p),nd=(X==null?void 0:X.provider)==="antigravity"?Q0:fy,dn=ke&&i.jsx(As,{title:"Режим прав",value:(X==null?void 0:X.permissionMode)??"default",options:nd.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{z&&ee({type:"control.set_mode",sessionId:z,mode:p})}}),zr=Lr.length>0?i.jsx(Fy,{models:Lr,value:si,effort:(X==null?void 0:X.effort)??null,ultracode:(X==null?void 0:X.ultracode)??!1,thinking:(X==null?void 0:X.thinking)??!0,switchOnFlag:(X==null?void 0:X.switchModelsOnFlag)??!0,showSwitchOnFlag:(X==null?void 0:X.provider)!=="antigravity",onModel:p=>{!z||!p||ee({type:"control.set_model",sessionId:z,model:p})},onEffort:p=>{z&&ee({type:"control.set_effort",sessionId:z,effort:p})},onUltracode:p=>{z&&ee({type:"control.set_ultracode",sessionId:z,enabled:p})},onThinking:p=>{z&&ee({type:"control.set_thinking",sessionId:z,enabled:p})},onSwitchOnFlag:p=>{z&&ee({type:"control.set_flag_switch",sessionId:z,enabled:p})}}):li&&i.jsx("span",{className:"badge",children:li}),Wi=jl&&i.jsx("span",{className:ni?"badge badge--wait":"badge badge--live",children:ni?"ждёт":al?"переподключается":"работает"}),Pi=(X==null?void 0:X.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Ur=Wi||Pi,ja=()=>{z&&ee({type:"session.reconnect",sessionId:z})},ri=al?"Сессия уже поднимает новый процесс":jl?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",ld=z&&(al||(X==null?void 0:X.state)==="error")?i.jsxs("div",{className:al?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),al?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:al?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ja,children:al?"Переподключить сейчас":"Переподключить"})]}):null,xu=ga?i.jsx($k,{handoff:ga,onContinue:()=>Uc(ga),onShow:()=>Be(ga),onDismiss:()=>ed(ga.sessionId)}):null,Jc=X&&X.totalCostUsd>0?`$${X.totalCostUsd.toFixed(3)}`:null,Wc=(X==null?void 0:X.provider)!=="antigravity"&&i.jsx("button",{className:da?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":da,onClick:()=>wr(p=>!p),children:i.jsx(kN,{})}),Sa=X&&X.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Bs(X),children:i.jsx(vN,{})}),Qs=X?pt[X.id]===!0:!1,ci=my({onLongPress:()=>{X&&Hc(X)},onClick:()=>{X&&uu(X)},disabled:Qs}),yu=X&&X.state!=="closed"&&X.provider!=="antigravity"&&i.jsxs("button",{type:"button",className:Qs?"pane-btn pane-btn--handoff is-busy":ci.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${ci.thresholdMs}ms`},title:Qs?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Qs,disabled:Qs,...ci.handlers,children:[i.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),i.jsx(jN,{})]});return i.jsxs("div",{className:"app",style:ln.style,children:[i.jsx(Fj,{open:Se,connected:s,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:T,sessionFolders:L.filter(p=>p.workspaceId===A),pinnedFolders:J,sessions:O.filter(p=>p.workspaceId===A),archived:M.filter(p=>p.workspaceId===A),pinned:B,live:he,listOrder:De,liveSessionsFirst:(Dn==null?void 0:Dn.liveSessionsFirst)===!0,onReorder:zc,activeWorkspaceId:A,activeSessionId:z,onPinSessions:iu,onSelectPinned:ru,onCloseWorkspaces:nu,onRestoreWorkspaces:su,onArchiveSessions:lu,onUnarchiveSessions:p=>{A&&ee({type:"session.unarchive",workspaceId:A,sessionIds:p})},onCreateFolder:au,onRenameFolder:Oc,onSetFolderColor:Pf,onDeleteFolder:Fa,onAssignToFolder:Lc,onSelectWorkspace:Fi,onSelectSession:ts,onRenameSession:Bc,onStopSession:Bs,onOpenWorkspace:()=>Yt(!0),onNewSession:Zi,onOpenExtensions:z&&(X==null?void 0:X.provider)!=="antigravity"?()=>Ic("mcp"):null,account:ms,onOpenAccount:Cl,relay:d,onOpenRelay:b?null:()=>g(!0),onOpenSettings:Al,themeMode:kt,onCycleTheme:Tl}),Ji("sidebar"),Se&&i.jsx("div",{className:"scrim",onClick:()=>Te(!1)}),i.jsx(cj,{open:sn,tree:me,expanded:new Set(Y),activePath:ze,dirty:bu,gitChanges:(Ze==null?void 0:Ze.changed)??[],result:un,searchResult:xs,onSearch:du,onReveal:Or,onToggle:Xc,onOpen:_a,onCreate:hu,onRename:Kc,onMove:Zc,onCopy:pu,onDelete:fn,onRefresh:()=>{Mt(null),N({}),Mr()},onClose:()=>Bt(!1),zoomed:an==="files",onToggleZoom:ii("files")}),sn&&an!=="files"&&Ji("files"),i.jsx(xj,{open:ys,result:Ls,onSearch:Vc,onOpenMatch:ti,onClose:()=>_s(!1),zoomed:an==="search",onToggleZoom:ii("search")}),ys&&an!=="search"&&Ji("search"),i.jsx(Uw,{open:kn,state:Ze,result:gs,selected:Nn,busy:nl,onRefresh:Mr,onShow:xa,onCheckout:Yc,onPush:Pa,onPull:td,onPublish:vl,onConnectRemote:fu,onDismissResult:()=>yn(null),onClose:()=>mt(!1),zoomed:an==="git",onToggleZoom:ii("git")}),kn&&an!=="git"&&Ji("git"),i.jsxs("main",{className:an==="main"||an==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Te(!0),children:"☰"}),i.jsx("button",{className:sn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":sn,onClick:()=>{Bt(p=>!p),mt(!1),_s(!1)},children:i.jsx(xN,{})}),i.jsx("button",{className:ys?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":ys,onClick:()=>{_s(p=>!p),Bt(!1),mt(!1)},children:i.jsx(yN,{})}),i.jsx("button",{className:kn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":kn,onClick:()=>{mt(p=>!p),Bt(!1),_s(!1)},children:i.jsx(_N,{})}),fa&&i.jsx("button",{className:ua?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ua,onClick:()=>Zn(p=>!p),children:i.jsx(wN,{})}),et&&Wc,et&&i.jsx("button",{className:Xe?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Xe,onClick:()=>Qt(!0),children:i.jsx(NN,{})}),i.jsxs("div",{className:"topbar__id",children:[Tt&&X?i.jsx(aa,{className:"rename--title",value:X.title??"",onCommit:p=>{Bc(X,p),Ye(!1)},onCancel:()=>Ye(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!X||et,title:X&&!et?"Переименовать сессию":void 0,onClick:()=>Ye(!0),children:(X==null?void 0:X.title)??"Claude Code Visual"}),Za&&i.jsx("span",{className:"topbar__project",title:Za.path,children:Za.name})]}),et?Ur:as&&i.jsx(Zy,{path:as})]}),!et&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:Ut?"meters-refresh is-busy":"meters-refresh",title:tu,"aria-label":Dc,"aria-busy":Ut,disabled:!z||Ut,onClick:Pl,children:i.jsx(TN,{})}),i.jsx(Wy,{usage:Rc}),i.jsx(t_,{}),dn,zr,Ur,Jc&&i.jsx("span",{className:"badge badge--cost",children:Jc}),yu,Sa,Wc]})]}),i.jsx(oN,{tokens:(lt==null?void 0:lt.tokens)??V.contextTokens,maxTokens:(lt==null?void 0:lt.maxTokens)??null,fetchedAt:(lt==null?void 0:lt.fetchedAt)??null}),et&&Xe&&i.jsx(pk,{onClose:()=>Qt(!1),permission:dn,model:zr,usage:Rc,cwd:as,costLabel:Jc,onRefresh:Pl,refreshing:Ut,metersFetchedAt:Mc,onRename:X?()=>{Ye(!0),Qt(!1)}:null,onHandoff:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{uu(X),Qt(!1)}:null,onFreshSession:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{Hc(X),Qt(!1)}:null,handoffWriting:Qs,onStop:X&&X.state!=="closed"?()=>{Bs(X),Qt(!1)}:null}),we.length>0&&i.jsx(Uj,{files:we,activePath:ze,busy:jl,onSelect:ot,onClose:p=>dl(p),zoomed:an==="main",onToggleZoom:ii("main")}),ai?i.jsx(Lj,{file:ai,goto:(ca==null?void 0:ca.path)===ai.path?ca:null,onChange:(p,I)=>{ve(de=>de.map(Ie=>Ie.path===p?{...Ie,text:I}:Ie)),ws(p)},onSave:p=>sl(p),onReload:qs,onOverwrite:p=>sl(p,!0),onRequestMedia:ns,onTogglePreview:p=>ve(I=>I.map(de=>de.path===p?{...de,previewMode:!de.previewMode}:de))}):i.jsxs(i.Fragment,{children:[i.jsx(Op,{items:V.items,busy:jl&&!al,waiting:ni,empty:(X==null?void 0:X.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:eu,historyHasMore:Db(ge),historyLoading:ge.loading,onLoadHistory:Cr,sessionId:z??void 0,onEditMessage:(X==null?void 0:X.provider)==="antigravity"?void 0:(p,I,de)=>{z&&ee({type:"prompt.edit",sessionId:z,userIndex:p,text:I,images:de})}}),ld,xu,z&&((Hr=X==null?void 0:X.tasks)!=null&&Hr.length)?i.jsx(Gj,{tasks:X.tasks,onStop:p=>ee({type:"task.stop",sessionId:z,taskId:p})}):null,i.jsx(Qy,{disabled:!z,busy:jl&&!al,placeholder:al?"Промпт уйдёт, как только связь вернётся":(X==null?void 0:X.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:va,sessionTitle:(X==null?void 0:X.title)??null,contextResult:Ml,draftKey:z,onContextSearch:p=>Qc("mention",p),onCommand:$s,onSend:cu,onInterrupt:()=>{z&&ee({type:"control.interrupt",sessionId:z})}})]}),ua&&fa&&i.jsxs(i.Fragment,{children:[!et&&an!=="terminal"&&i.jsx(Pk,{height:Us.height,onResize:Us.setHeight,onReset:Us.reset}),i.jsx(lN,{mobile:et,zoomed:an==="terminal",onToggleZoom:ii("terminal"),terminals:Wl,activeId:qi,blocked:Sr,error:Nc,onDismissError:()=>Ga(null),height:et?Ya.height:Us.height,offset:et?{top:Ya.offsetTop,left:Ya.offsetLeft}:void 0,onSelect:jr,onOpen:st,onClose:Gs,onInput:(p,I)=>ee({type:"term.input",id:p,data:I}),onResize:(p,I,de)=>ee({type:"term.resize",id:p,cols:I,rows:de}),onAttach:p=>ee({type:"term.attach",id:p}),onHide:()=>Zn(!1),registerSink:Ec})]})]}),i.jsx(sk,{open:da,items:Vo.items,busy:Qn,ready:z!==null,commands:va,contextResult:ei,draftKey:z,models:Vs.rows,model:Vs.selected,effort:Xs.effort,ultracode:Xs.ultracode,thinking:Xs.thinking,switchOnFlag:Xs.switchOnFlag,onContextSearch:p=>Qc("side",p),onCommand:$s,onModel:p=>{p&&(ha(I=>({...I,model:p})),Is(I=>ee({type:"control.set_model",sessionId:I,model:p})))},onEffort:p=>{ha(I=>({...I,effort:p,ultracode:!1})),Is(I=>ee({type:"control.set_effort",sessionId:I,effort:p}))},onUltracode:p=>{ha(I=>({...I,ultracode:p,...p?{effort:"xhigh"}:{}})),Is(I=>ee({type:"control.set_ultracode",sessionId:I,enabled:p}))},onThinking:p=>{ha(I=>({...I,thinking:p})),Is(I=>ee({type:"control.set_thinking",sessionId:I,enabled:p}))},onSwitchOnFlag:p=>{ha(I=>({...I,switchOnFlag:p})),Is(I=>ee({type:"control.set_flag_switch",sessionId:I,enabled:p}))},onAsk:Gc,onInterrupt:()=>{Xo&&ee({type:"control.interrupt",sessionId:Xo})},onReset:Ar,onClose:()=>wr(!1),zoomed:an==="ask",onToggleZoom:ii("ask")}),da&&an!=="ask"&&Ji("ask"),(kn||da||sn||ys)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{mt(!1),wr(!1),Bt(!1),_s(!1)}}),El&&i.jsx(Iw,{detail:El,local:((Ze==null?void 0:Ze.hasRemote)??!1)&&(Ze==null?void 0:Ze.commits.some(p=>p.hash===El.hash&&!p.pushed))===!0,onCheckout:Yc,onClose:()=>{xn(null),tl(null)}}),ue&&i.jsx(Nl,{title:"Остановить сессию?",onClose:()=>_e(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>_e(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{ee({type:"session.close",sessionId:ue.id}),_e(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Fl&&i.jsxs(Nl,{title:"Переключить рабочее дерево?",onClose:()=>fl(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>fl(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:Rr,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",Fl.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),jl&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Ze&&Ze.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Ze.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Os&&i.jsx(Ww,{status:Ht,owners:Hi,files:qa,defaultName:(Za==null?void 0:Za.name)??"",hasCommits:Ze===null||Ze.head!=="",busy:nl,result:gs,onRefreshStatus:ya,onSaveToken:Dr,onPublish:$c,onDismissResult:()=>yn(null),onClose:()=>yl(!1)}),bs&&i.jsx(lk,{busy:nl,result:gs,onSubmit:Ss,onDismissResult:()=>yn(null),onClose:()=>Jl(!1)}),ht&&i.jsx(Nl,{title:ht.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>fn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>fn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Vn(ht),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[ht.path," будет удалён с диска",ht.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),It&&i.jsx(Nl,{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:()=>dl(It,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{sl(It),dl(It,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",It," есть несохранённые правки."]})}),An&&i.jsx(gk,{tab:An,servers:wn,plugins:Xt,marketplaces:Kt,catalog:Yn,result:be,actions:qc,onTab:on,onClose:()=>on(null)}),ra&&i.jsx(wk,{status:ms,login:Vt,actions:Ja,remote:b,runningSessions:O.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:z?()=>{ja(),Ql(!1)}:null,reconnectBlocked:jl,reconnectHint:ri,onClose:()=>Ql(!1)}),m&&i.jsx(Ck,{state:d,onPair:(p,I)=>ee({type:"relay.pair",code:p,...I?{name:I}:{}}),onUnpair:()=>ee({type:"relay.unpair"}),onClose:()=>g(!1)}),bl&&i.jsx(Gk,{settings:Dn,models:(ke==null?void 0:ke.models)??[],relayState:d,local:Mf()==="local",onChange:Wa,onEnableShell:()=>ee({type:"relay.shell.enable"}),onDisableShell:()=>ee({type:"relay.shell.disable"}),onOpenRelay:()=>{$n(!1),g(!0)},onClose:()=>$n(!1)}),tt&&i.jsx(Nw,{candidates:nt,searching:$t,agentItems:nn.items,agentBusy:(Sn==null?void 0:Sn.state)==="running",error:cn,roots:zt,created:ut,onSearch:Jf,onAskAgent:Wf,onInterrupt:()=>{const p=Er.current;p&&ee({type:"control.interrupt",sessionId:p})},onSubmit:Zf,onCreate:Ff,onClose:_l}),Tn!=null&&Tn.questions&&Tn.questions.length>0?i.jsx(gw,{request:{...Tn,questions:Tn.questions},queued:V.pending.length-1,onAnswer:Fc,onDecline:Ys}):Tn&&ss!==null?i.jsx(yw,{request:Tn,plan:ss,queued:V.pending.length-1,onAccept:mu,onDecline:gu}):Tn&&i.jsx(mw,{request:Tn,queued:V.pending.length-1,onDecide:Rl}),xe&&i.jsx(Xk,{handoff:xe,onClose:()=>Be(null)}),i.jsx(Kk,{notices:ul,onDismiss:p=>gl(I=>I.filter(de=>de.id!==p))})]})}function xN(){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 yN(){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 _N(){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 vN(){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 jN(){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 SN(l,s){return ey(l)===ey(s)}function ey(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function wN(){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 kN(){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 NN(){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 TN(){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 l_=document.getElementById("root");if(!l_)throw new Error("#root not found");N0.createRoot(l_).render(i.jsx(y.StrictMode,{children:i.jsx(bN,{})}));export{N1 as D,Jt as I,Pt as N,AN as P,hs as T,Ms as a,Cy as b,Bl as c,CN as d,Oy as e,qo as f,X1 as h,MN as p,RN as s,Ce as t};