@i14ks/ccv 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +1734 -194
- package/package.json +1 -1
- package/web/assets/antigravity-logo-DRKQga2U.png +0 -0
- package/web/assets/{codemirror-DfnUEAQ1.js → codemirror-wcb7BToF.js} +1 -1
- package/web/assets/{index-UUIF3jgc.js → index-B1iGktMS.js} +1 -1
- package/web/assets/{index-C_0hLH-6.js → index-B7uOCyzk.js} +1 -1
- package/web/assets/{index-BrhFysJH.js → index-B8ioctog.js} +1 -1
- package/web/assets/index-BKeYZb3W.css +1 -0
- package/web/assets/{index-C33PhVuR.js → index-BebgK8qS.js} +1 -1
- package/web/assets/{index-DdCEnSCp.js → index-BgYZP6B5.js} +1 -1
- package/web/assets/{index-BFyhFly9.js → index-BoWGjyq1.js} +1 -1
- package/web/assets/{index-Aa3M3Mcp.js → index-Bug5lJuD.js} +1 -1
- package/web/assets/{index-6WrTm4Cl.js → index-CKo4-duU.js} +1 -1
- package/web/assets/{index-CE-6gz9W.js → index-CLUF7ja0.js} +1 -1
- package/web/assets/{index-BUVVNNln.js → index-D8i-20tT.js} +1 -1
- package/web/assets/{index-DdWyOJPD.js → index-DaeBIEG7.js} +1 -1
- package/web/assets/index-DfzFdzpd.js +134 -0
- package/web/assets/{index-DNvUBsh8.js → index-DzuxHBqN.js} +1 -1
- package/web/assets/{index-B4QS6XYB.js → index-H1KO3hWw.js} +1 -1
- package/web/assets/{index-DLoVg97c.js → index-ZyET8YfL.js} +1 -1
- package/web/assets/{index-Cu9yVjDd.js → index-ggJz6TAQ.js} +1 -1
- package/web/assets/{index-CReKaug6.js → index-jRANpi-W.js} +1 -1
- package/web/assets/{index-BSHub4Y3.js → index-qJpQucwj.js} +1 -1
- package/web/assets/{index-BBJ7uyxo.js → index-s31Rk-Wi.js} +1 -1
- package/web/assets/{index-1NZdgXKt.js → index-tW3KsNuy.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-i3oOZBX4.js +0 -133
- package/web/assets/index-ihyDKGfF.css +0 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-ggJz6TAQ.js","./index-tW3KsNuy.js","./index-B1iGktMS.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-H1KO3hWw.js","./index-ZyET8YfL.js","./index-CKo4-duU.js","./index-BgYZP6B5.js","./index-B8ioctog.js","./index-s31Rk-Wi.js","./index-jRANpi-W.js","./index-Bug5lJuD.js","./index-BoWGjyq1.js","./index-qJpQucwj.js","./index-B7uOCyzk.js","./index-BebgK8qS.js","./index-D8i-20tT.js","./index-DzuxHBqN.js","./index-DaeBIEG7.js","./index-CLUF7ja0.js","./codemirror-wcb7BToF.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 u0=Object.defineProperty;var _b=s=>{throw TypeError(s)};var f0=(s,l,r)=>l in s?u0(s,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[l]=r;var Ot=(s,l,r)=>f0(s,typeof l!="symbol"?l+"":l,r),wh=(s,l,r)=>l.has(s)||_b("Cannot "+r);var Ye=(s,l,r)=>(wh(s,l,"read from private field"),r?r.call(s):l.get(s)),on=(s,l,r)=>l.has(s)?_b("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(s):l.set(s,r),_t=(s,l,r,c)=>(wh(s,l,"write to private field"),c?c.call(s,r):l.set(s,r),r),Dn=(s,l,r)=>(wh(s,l,"access private method"),r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const 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 kh={exports:{}},_o={};/**
|
|
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 vb;function d0(){if(vb)return _o;vb=1;var s=Symbol.for("react.transitional.element"),l=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 p in o)p!=="key"&&(d[p]=o[p])}else d=o;return o=d.ref,{$$typeof:s,type:c,key:h,ref:o!==void 0?o:null,props:d}}return _o.Fragment=l,_o.jsx=r,_o.jsxs=r,_o}var jb;function h0(){return jb||(jb=1,kh.exports=d0()),kh.exports}var i=h0(),Nh={exports:{}},Qe={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Sb;function p0(){if(Sb)return Qe;Sb=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),v=Symbol.iterator;function E(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,z={};function X(N,V,re){this.props=N,this.context=V,this.refs=z,this.updater=re||T}X.prototype.isReactComponent={},X.prototype.setState=function(N,V){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,V,"setState")},X.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function F(){}F.prototype=X.prototype;function G(N,V,re){this.props=N,this.context=V,this.refs=z,this.updater=re||T}var O=G.prototype=new F;O.constructor=G,R(O,X.prototype),O.isPureReactComponent=!0;var K=Array.isArray;function C(){}var D={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function te(N,V,re){var me=re.ref;return{$$typeof:s,type:N,key:V,ref:me!==void 0?me:null,props:re}}function de(N,V){return te(N.type,V,N.props)}function J(N){return typeof N=="object"&&N!==null&&N.$$typeof===s}function ue(N){var V={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(re){return V[re]})}var je=/\/+/g;function Ce(N,V){return typeof N=="object"&&N!==null&&N.key!=null?ue(""+N.key):V.toString(36)}function Ee(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(C,C):(N.status="pending",N.then(function(V){N.status==="pending"&&(N.status="fulfilled",N.value=V)},function(V){N.status==="pending"&&(N.status="rejected",N.reason=V)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function A(N,V,re,me,we){var ve=typeof N;(ve==="undefined"||ve==="boolean")&&(N=null);var De=!1;if(N===null)De=!0;else switch(ve){case"bigint":case"string":case"number":De=!0;break;case"object":switch(N.$$typeof){case s:case l:De=!0;break;case _:return De=N._init,A(De(N._payload),V,re,me,we)}}if(De)return we=we(N),De=me===""?"."+Ce(N,0):me,K(we)?(re="",De!=null&&(re=De.replace(je,"$&/")+"/"),A(we,V,re,"",function(Ve){return Ve})):we!=null&&(J(we)&&(we=de(we,re+(we.key==null||N&&N.key===we.key?"":(""+we.key).replace(je,"$&/")+"/")+De)),V.push(we)),1;De=0;var xt=me===""?".":me+":";if(K(N))for(var Xe=0;Xe<N.length;Xe++)me=N[Xe],ve=xt+Ce(me,Xe),De+=A(me,V,re,ve,we);else if(Xe=E(N),typeof Xe=="function")for(N=Xe.call(N),Xe=0;!(me=N.next()).done;)me=me.value,ve=xt+Ce(me,Xe++),De+=A(me,V,re,ve,we);else if(ve==="object"){if(typeof N.then=="function")return A(Ee(N),V,re,me,we);throw V=String(N),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return De}function ce(N,V,re){if(N==null)return N;var me=[],we=0;return A(N,me,"","",function(ve){return V.call(re,ve,we++)}),me}function L(N){if(N._status===-1){var V=N._result;V=V(),V.then(function(re){(N._status===0||N._status===-1)&&(N._status=1,N._result=re)},function(re){(N._status===0||N._status===-1)&&(N._status=2,N._result=re)}),N._status===-1&&(N._status=0,N._result=V)}if(N._status===1)return N._result.default;throw N._result}var be=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},ye={map:ce,forEach:function(N,V,re){ce(N,function(){V.apply(this,arguments)},re)},count:function(N){var V=0;return ce(N,function(){V++}),V},toArray:function(N){return ce(N,function(V){return V})||[]},only:function(N){if(!J(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Qe.Activity=S,Qe.Children=ye,Qe.Component=X,Qe.Fragment=r,Qe.Profiler=o,Qe.PureComponent=G,Qe.StrictMode=c,Qe.Suspense=g,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},Qe.cache=function(N){return function(){return N.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(N,V,re){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var me=R({},N.props),we=N.key;if(V!=null)for(ve in V.key!==void 0&&(we=""+V.key),V)!H.call(V,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&V.ref===void 0||(me[ve]=V[ve]);var ve=arguments.length-2;if(ve===1)me.children=re;else if(1<ve){for(var De=Array(ve),xt=0;xt<ve;xt++)De[xt]=arguments[xt+2];me.children=De}return te(N.type,we,me)},Qe.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:d,_context:N},N},Qe.createElement=function(N,V,re){var me,we={},ve=null;if(V!=null)for(me in V.key!==void 0&&(ve=""+V.key),V)H.call(V,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(we[me]=V[me]);var De=arguments.length-2;if(De===1)we.children=re;else if(1<De){for(var xt=Array(De),Xe=0;Xe<De;Xe++)xt[Xe]=arguments[Xe+2];we.children=xt}if(N&&N.defaultProps)for(me in De=N.defaultProps,De)we[me]===void 0&&(we[me]=De[me]);return te(N,ve,we)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(N){return{$$typeof:p,render:N}},Qe.isValidElement=J,Qe.lazy=function(N){return{$$typeof:_,_payload:{_status:-1,_result:N},_init:L}},Qe.memo=function(N,V){return{$$typeof:x,type:N,compare:V===void 0?null:V}},Qe.startTransition=function(N){var V=D.T,re={};D.T=re;try{var me=N(),we=D.S;we!==null&&we(re,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(C,be)}catch(ve){be(ve)}finally{V!==null&&re.types!==null&&(V.types=re.types),D.T=V}},Qe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Qe.use=function(N){return D.H.use(N)},Qe.useActionState=function(N,V,re){return D.H.useActionState(N,V,re)},Qe.useCallback=function(N,V){return D.H.useCallback(N,V)},Qe.useContext=function(N){return D.H.useContext(N)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(N,V){return D.H.useDeferredValue(N,V)},Qe.useEffect=function(N,V){return D.H.useEffect(N,V)},Qe.useEffectEvent=function(N){return D.H.useEffectEvent(N)},Qe.useId=function(){return D.H.useId()},Qe.useImperativeHandle=function(N,V,re){return D.H.useImperativeHandle(N,V,re)},Qe.useInsertionEffect=function(N,V){return D.H.useInsertionEffect(N,V)},Qe.useLayoutEffect=function(N,V){return D.H.useLayoutEffect(N,V)},Qe.useMemo=function(N,V){return D.H.useMemo(N,V)},Qe.useOptimistic=function(N,V){return D.H.useOptimistic(N,V)},Qe.useReducer=function(N,V,re){return D.H.useReducer(N,V,re)},Qe.useRef=function(N){return D.H.useRef(N)},Qe.useState=function(N){return D.H.useState(N)},Qe.useSyncExternalStore=function(N,V,re){return D.H.useSyncExternalStore(N,V,re)},Qe.useTransition=function(){return D.H.useTransition()},Qe.version="19.2.8",Qe}var wb;function dp(){return wb||(wb=1,Nh.exports=p0()),Nh.exports}var y=dp(),Th={exports:{}},vo={},Eh={exports:{}},Ah={};/**
|
|
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 kb;function m0(){return kb||(kb=1,(function(s){function l(A,ce){var L=A.length;A.push(ce);e:for(;0<L;){var be=L-1>>>1,ye=A[be];if(0<o(ye,ce))A[be]=ce,A[L]=ye,L=be;else break e}}function r(A){return A.length===0?null:A[0]}function c(A){if(A.length===0)return null;var ce=A[0],L=A.pop();if(L!==ce){A[0]=L;e:for(var be=0,ye=A.length,N=ye>>>1;be<N;){var V=2*(be+1)-1,re=A[V],me=V+1,we=A[me];if(0>o(re,L))me<ye&&0>o(we,re)?(A[be]=we,A[me]=L,be=me):(A[be]=re,A[V]=L,be=V);else if(me<ye&&0>o(we,L))A[be]=we,A[me]=L,be=me;else break e}}return ce}function o(A,ce){var L=A.sortIndex-ce.sortIndex;return L!==0?L:A.id-ce.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();s.unstable_now=function(){return h.now()-p}}var g=[],x=[],_=1,S=null,v=3,E=!1,T=!1,R=!1,z=!1,X=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function O(A){for(var ce=r(x);ce!==null;){if(ce.callback===null)c(x);else if(ce.startTime<=A)c(x),ce.sortIndex=ce.expirationTime,l(g,ce);else break;ce=r(x)}}function K(A){if(R=!1,O(A),!T)if(r(g)!==null)T=!0,C||(C=!0,ue());else{var ce=r(x);ce!==null&&Ee(K,ce.startTime-A)}}var C=!1,D=-1,H=5,te=-1;function de(){return z?!0:!(s.unstable_now()-te<H)}function J(){if(z=!1,C){var A=s.unstable_now();te=A;var ce=!0;try{e:{T=!1,R&&(R=!1,F(D),D=-1),E=!0;var L=v;try{t:{for(O(A),S=r(g);S!==null&&!(S.expirationTime>A&&de());){var be=S.callback;if(typeof be=="function"){S.callback=null,v=S.priorityLevel;var ye=be(S.expirationTime<=A);if(A=s.unstable_now(),typeof ye=="function"){S.callback=ye,O(A),ce=!0;break t}S===r(g)&&c(g),O(A)}else c(g);S=r(g)}if(S!==null)ce=!0;else{var N=r(x);N!==null&&Ee(K,N.startTime-A),ce=!1}}break e}finally{S=null,v=L,E=!1}ce=void 0}}finally{ce?ue():C=!1}}}var ue;if(typeof G=="function")ue=function(){G(J)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Ce=je.port2;je.port1.onmessage=J,ue=function(){Ce.postMessage(null)}}else ue=function(){X(J,0)};function Ee(A,ce){D=X(function(){A(s.unstable_now())},ce)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(A){A.callback=null},s.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"):H=0<A?Math.floor(1e3/A):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(A){switch(v){case 1:case 2:case 3:var ce=3;break;default:ce=v}var L=v;v=ce;try{return A()}finally{v=L}},s.unstable_requestPaint=function(){z=!0},s.unstable_runWithPriority=function(A,ce){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var L=v;v=A;try{return ce()}finally{v=L}},s.unstable_scheduleCallback=function(A,ce,L){var be=s.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?be+L:be):L=be,A){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=L+ye,A={id:_++,callback:ce,priorityLevel:A,startTime:L,expirationTime:ye,sortIndex:-1},L>be?(A.sortIndex=L,l(x,A),r(g)===null&&A===r(x)&&(R?(F(D),D=-1):R=!0,Ee(K,L-be))):(A.sortIndex=ye,l(g,A),T||E||(T=!0,C||(C=!0,ue()))),A},s.unstable_shouldYield=de,s.unstable_wrapCallback=function(A){var ce=v;return function(){var L=v;v=ce;try{return A.apply(this,arguments)}finally{v=L}}}})(Ah)),Ah}var Nb;function g0(){return Nb||(Nb=1,Eh.exports=m0()),Eh.exports}var Ch={exports:{}},cl={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var Tb;function b0(){if(Tb)return cl;Tb=1;var s=dp();function l(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,x,_){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:g,containerInfo:x,implementation:_}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return cl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,cl.createPortal=function(g,x){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(l(299));return d(g,x,null,_)},cl.flushSync=function(g){var x=h.T,_=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=_,c.d.f()}},cl.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(g,x))},cl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},cl.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var _=x.as,S=p(_,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,E=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:S,integrity:v,fetchPriority:E}):_==="script"&&c.d.X(g,{crossOrigin:S,integrity:v,fetchPriority:E,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},cl.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=p(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(g)},cl.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,S=p(_,x.crossOrigin);c.d.L(g,_,{crossOrigin:S,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},cl.preloadModule=function(g,x){if(typeof g=="string")if(x){var _=p(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},cl.requestFormReset=function(g){c.d.r(g)},cl.unstable_batchedUpdates=function(g,x){return g(x)},cl.useFormState=function(g,x,_){return h.H.useFormState(g,x,_)},cl.useFormStatus=function(){return h.H.useHostTransitionStatus()},cl.version="19.2.8",cl}var Eb;function x0(){if(Eb)return Ch.exports;Eb=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Ch.exports=b0(),Ch.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 y0(){if(Ab)return vo;Ab=1;var s=g0(),l=dp(),r=x0();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 p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===a)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var b=!1,j=u.child;j;){if(j===n){b=!0,n=u,a=f;break}if(j===a){b=!0,a=u,n=f;break}j=j.sibling}if(!b){for(j=f.child;j;){if(j===n){b=!0,n=f,a=u;break}if(j===a){b=!0,a=f,n=u;break}j=j.sibling}if(!b)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function _(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 S=Object.assign,v=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),G=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var je=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case X:return"Profiler";case z:return"StrictMode";case K:return"Suspense";case C:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case G:return e.displayName||"Context";case F: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:Ce(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var Ee=Array.isArray,A=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},be=[],ye=-1;function N(e){return{current:e}}function V(e){0>ye||(e.current=be[ye],be[ye]=null,ye--)}function re(e,t){ye++,be[ye]=e.current,e.current=t}var me=N(null),we=N(null),ve=N(null),De=N(null);function xt(e,t){switch(re(ve,t),re(we,e),re(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yg(t),e=Xg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(me),re(me,e)}function Xe(){V(me),V(we),V(ve)}function Ve(e){e.memoizedState!==null&&re(De,e);var t=me.current,n=Xg(t,e.type);t!==n&&(re(we,e),re(me,n))}function $e(e){we.current===e&&(V(me),V(we)),De.current===e&&(V(De),go._currentValue=L)}var Wt,it;function un(e){if(Wt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Wt=t&&t[1]||"",it=-1<n.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Wt+e+it}var ut=!1;function fn(e,t){if(!e||ut)return"";ut=!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(ee){var Z=ee}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(ee){Z=ee}e.call(oe.prototype)}}else{try{throw Error()}catch(ee){Z=ee}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(ee){if(ee&&Z&&typeof ee.stack=="string")return[ee.stack,Z.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),b=f[0],j=f[1];if(b&&j){var M=b.split(`
|
|
45
|
+
`),Q=j.split(`
|
|
46
|
+
`);for(u=a=0;a<M.length&&!M[a].includes("DetermineComponentFrameRoot");)a++;for(;u<Q.length&&!Q[u].includes("DetermineComponentFrameRoot");)u++;if(a===M.length||u===Q.length)for(a=M.length-1,u=Q.length-1;1<=a&&0<=u&&M[a]!==Q[u];)u--;for(;1<=a&&0<=u;a--,u--)if(M[a]!==Q[u]){if(a!==1||u!==1)do if(a--,u--,0>u||M[a]!==Q[u]){var se=`
|
|
47
|
+
`+M[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{ut=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?un(n):""}function kn(e,t){switch(e.tag){case 26:case 27:case 5:return un(e.type);case 16:return un("Lazy");case 13:return e.child!==t&&t!==null?un("Suspense Fallback"):un("Suspense");case 19:return un("SuspenseList");case 0:case 15:return fn(e.type,!1);case 11:return fn(e.type.render,!1);case 1:return fn(e.type,!0);case 31:return un("Activity");default:return""}}function _n(e){try{var t="",n=null;do t+=kn(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
48
|
+
Error generating stack: `+a.message+`
|
|
49
|
+
`+a.stack}}var Pt=Object.prototype.hasOwnProperty,tt=s.unstable_scheduleCallback,Pe=s.unstable_cancelCallback,en=s.unstable_shouldYield,Vt=s.unstable_requestPaint,nt=s.unstable_now,wt=s.unstable_getCurrentPriorityLevel,$t=s.unstable_ImmediatePriority,rn=s.unstable_UserBlockingPriority,kt=s.unstable_NormalPriority,vn=s.unstable_LowPriority,It=s.unstable_IdlePriority,dn=s.log,Ln=s.unstable_setDisableYieldValue,qt=null,rt=null;function Et(e){if(typeof dn=="function"&&Ln(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(qt,e)}catch{}}var Je=Math.clz32?Math.clz32:ge,_l=Math.log,ne=Math.LN2;function ge(e){return e>>>=0,e===0?32:31-(_l(e)/ne|0)|0}var He=256,B=262144,P=4194304;function _e(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,b=e.pingedLanes;e=e.warmLanes;var j=a&134217727;return j!==0?(a=j&~f,a!==0?u=_e(a):(b&=j,b!==0?u=_e(b):n||(n=j&~e,n!==0&&(u=_e(n))))):(j=a&~f,j!==0?u=_e(j):b!==0?u=_e(b):n||(n=a&~e,n!==0&&(u=_e(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 Gt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vl(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 Zn(){var e=P;return P<<=1,(P&62914560)===0&&(P=4194304),e}function Fn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Kl(e,t,n,a,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,M=e.expirationTimes,Q=e.hiddenUpdates;for(n=b&~n;0<n;){var se=31-Je(n),oe=1<<se;j[se]=0,M[se]=-1;var Z=Q[se];if(Z!==null)for(Q[se]=null,se=0;se<Z.length;se++){var ee=Z[se];ee!==null&&(ee.lane&=-536870913)}n&=~oe}a!==0&&Nn(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function Nn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Je(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Ll(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Je(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function fl(e,t){var n=t&-t;return n=(n&42)!==0?1:Wn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Wn(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 Pn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function tn(){var e=ce.p;return e!==0?e:(e=window.event,e===void 0?32:hb(e.type))}function cn(e,t){var n=ce.p;try{return ce.p=e,t()}finally{ce.p=n}}var Lt=Math.random().toString(36).slice(2),et="__reactFiber$"+Lt,Me="__reactProps$"+Lt,nn="__reactContainer$"+Lt,jn="__reactEvents$"+Lt,Cs="__reactListeners$"+Lt,Yn="__reactHandles$"+Lt,jl="__reactResources$"+Lt,Qt="__reactMarker$"+Lt;function el(e){delete e[et],delete e[Me],delete e[jn],delete e[Cs],delete e[Yn]}function vt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nn]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jg(e);e!==null;){if(n=e[et])return n;e=Jg(e)}return t}e=n,n=e.parentNode}return null}function hn(e){if(e=e[et]||e[nn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function pn(e){var t=e[jl];return t||(t=e[jl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function zt(e){e[Qt]=!0}var tl=new Set,Rs={};function Yt(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for(Rs[e]=t,e=0;e<t.length;e++)tl.add(t[e])}var os=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),us={},Zl={};function na(e){return Pt.call(Zl,e)?!0:Pt.call(us,e)?!1:os.test(e)?Zl[e]=!0:(us[e]=!0,!1)}function Sl(e,t,n){if(na(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 Un(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 Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ti(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fl(e){if(!e._valueTracker){var t=zl(e)?"checked":"value";e._valueTracker=Ti(e,t,""+e[t])}}function Xn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=zl(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function wl(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 Tn=/[\n"\\]/g;function mn(e){return e.replace(Tn,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function jt(e,t,n,a,u,f,b,j){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?At(e,b,Ut(t)):n!=null?At(e,b,Ut(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Ut(j):e.removeAttribute("name")}function Ul(e,t,n,a,u,f,b,j){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)){Fl(e);return}n=n!=null?""+Ut(n):"",t=t!=null?""+Ut(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=j?e.checked:!!a,e.defaultChecked=!!a,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Fl(e)}function At(e,t,n){t==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ll(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=""+Ut(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 he(e,t,n){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ut(n):""}function k(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(Ee(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Ut(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Fl(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 fe=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Te(e,t,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||fe.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Oe(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&&Te(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&Te(e,f,t[f])}function Le(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 mt=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"]]),w=/^[\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 ae(e){return w.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ke(){}var We=null;function ft(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var la=null,fs=null;function Nc(e){var t=hn(e);if(t&&(e=t.stateNode)){var n=e[Me]||null;e:switch(e=t.stateNode,t.type){case"input":if(jt(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="'+mn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[Me]||null;if(!u)throw Error(c(90));jt(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&&Xn(a)}break e;case"textarea":he(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ll(e,!!n.multiple,t,!1)}}}var ds=!1;function Ma(e,t,n){if(ds)return e(t,n);ds=!0;try{var a=e(t);return a}finally{if(ds=!1,(la!==null||fs!==null)&&(Ou(),la&&(t=la,e=fs,fs=la=null,Nc(t),e)))for(t=0;t<e.length;t++)Nc(e[t])}}function Ei(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Me]||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 Hl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Da=!1;if(Hl)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Da=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Da=!1}var hs=null,Oa=null,ps=null;function br(){if(ps)return ps;var e,t=Oa,n=t.length,a,u="value"in hs?hs.value:hs.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var b=n-e;for(a=1;a<=b&&t[n-a]===u[f-a];a++);return ps=u.slice(e,1<a?1-a:void 0)}function aa(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 Ms(){return!0}function Bo(){return!1}function Hn(e){function t(n,a,u,f,b){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(f):f[j]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ms:Bo,this.isPropagationStopped=Bo,this}return S(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=Ms)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ms)},persist:function(){},isPersistent:Ms}),t}var ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ra=Hn(ia),Ds=S({},ia,{view:0,detail:0}),Tc=Hn(Ds),ca,ms,Os,La=S({},Ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ac,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!==Os&&(Os&&e.type==="mousemove"?(ca=e.screenX-Os.screenX,ms=e.screenY-Os.screenY):ms=ca=0,Os=e),ca)},movementY:function(e){return"movementY"in e?e.movementY:ms}}),Io=Hn(La),oa=S({},La,{dataTransfer:0}),xr=Hn(oa),qo=S({},Ds,{relatedTarget:0}),za=Hn(qo),Go=S({},ia,{animationName:0,elapsedTime:0,pseudoElement:0}),yr=Hn(Go),gs=S({},ia,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_r=Hn(gs),Ai=S({},ia,{data:0}),Ls=Hn(Ai),Ci={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ln={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"},Ec={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ec[e])?!!t[e]:!1}function Ac(){return qf}var Yo=S({},Ds,{key:function(e){if(e.key){var t=Ci[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=aa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ln[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ac,charCode:function(e){return e.type==="keypress"?aa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?aa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vr=Hn(Yo),Vn=S({},La,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ua=Hn(Vn),Ri=S({},Ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ac}),Xo=Hn(Ri),En=S({},ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vo=Hn(En),$o=S({},La,{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}),bs=Hn($o),Qo=S({},ia,{newState:0,oldState:0}),jr=Hn(Qo),Sr=[9,13,27,32],ua=Hl&&"CompositionEvent"in window,Bl=null;Hl&&"documentMode"in document&&(Bl=document.documentMode);var Ko=Hl&&"TextEvent"in window&&!Bl,Ha=Hl&&(!ua||Bl&&8<Bl&&11>=Bl),Mi=" ",Ba=!1;function Ia(e,t){switch(e){case"keyup":return Sr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function Gf(e,t){switch(e){case"compositionend":return Cc(t);case"keypress":return t.which!==32?null:(Ba=!0,Mi);case"textInput":return e=t.data,e===Mi&&Ba?null:e;default:return null}}function le(e,t){if(Jl)return e==="compositionend"||!ua&&Ia(e,t)?(e=br(),ps=Oa=hs=null,Jl=!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 Ha&&t.locale!=="ko"?null:t.data;default:return null}}var qa={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qa[e.type]:t==="textarea"}function Zo(e,t,n,a){la?fs?fs.push(a):fs=[a]:la=a,t=qu(t,"onChange"),0<t.length&&(n=new ra("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Di=null,W=null;function Oi(e){Ug(e,0)}function zs(e){var t=zn(e);if(Xn(t))return e}function Rc(e,t){if(e==="change")return t}var Mc=!1;if(Hl){var Dc;if(Hl){var Us="oninput"in document;if(!Us){var Fo=document.createElement("div");Fo.setAttribute("oninput","return;"),Us=typeof Fo.oninput=="function"}Dc=Us}else Dc=!1;Mc=Dc&&(!document.documentMode||9<document.documentMode)}function Jo(){Di&&(Di.detachEvent("onpropertychange",Wo),W=Di=null)}function Wo(e){if(e.propertyName==="value"&&zs(W)){var t=[];Zo(t,W,e,ft(e)),Ma(Oi,t)}}function Yf(e,t,n){e==="focusin"?(Jo(),Di=t,W=n,Di.attachEvent("onpropertychange",Wo)):e==="focusout"&&Jo()}function Xf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zs(W)}function Ga(e,t){if(e==="click")return zs(t)}function Vf(e,t){if(e==="input"||e==="change")return zs(t)}function $f(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hl=typeof Object.is=="function"?Object.is:$f;function Li(e,t){if(hl(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(!Pt.call(t,u)||!hl(e[u],t[u]))return!1}return!0}function Po(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eu(e,t){var n=Po(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=Po(n)}}function tu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wl(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=wl(e.document)}return t}function zi(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 Qf=Hl&&"documentMode"in document&&11>=document.documentMode,Ya=null,Ui=null,Hi=null,Oc=!1;function Bi(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Oc||Ya==null||Ya!==wl(a)||(a=Ya,"selectionStart"in a&&zi(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}),Hi&&Li(Hi,a)||(Hi=a,a=qu(Ui,"onSelect"),0<a.length&&(t=new ra("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ya)))}function fa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xa={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},Lc={},zc={};Hl&&(zc=document.createElement("div").style,"AnimationEvent"in window||(delete Xa.animationend.animation,delete Xa.animationiteration.animation,delete Xa.animationstart.animation),"TransitionEvent"in window||delete Xa.transitionend.transition);function Hs(e){if(Lc[e])return Lc[e];if(!Xa[e])return e;var t=Xa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zc)return Lc[e]=t[n];return e}var lu=Hs("animationend"),Uc=Hs("animationiteration"),kr=Hs("animationstart"),Kf=Hs("transitionrun"),Zf=Hs("transitionstart"),Ff=Hs("transitioncancel"),su=Hs("transitionend"),Va=new Map,Nr="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(" ");Nr.push("scrollEnd");function Il(e,t){Va.set(e,t),Yt(t,[e])}var Ii=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)},kl=[],$a=0,Hc=0;function Tr(){for(var e=$a,t=Hc=$a=0;t<e;){var n=kl[t];kl[t++]=null;var a=kl[t];kl[t++]=null;var u=kl[t];kl[t++]=null;var f=kl[t];if(kl[t++]=null,a!==null&&u!==null){var b=a.pending;b===null?u.next=u:(u.next=b.next,b.next=u),a.pending=u}f!==0&&au(n,u,f)}}function Er(e,t,n,a){kl[$a++]=e,kl[$a++]=t,kl[$a++]=n,kl[$a++]=a,Hc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Bc(e,t,n,a){return Er(e,t,n,a),Ar(e)}function da(e,t){return Er(e,null,null,t),Ar(e)}function au(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-Je(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function Ar(e){if(50<co)throw co=0,Kd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qa={};function Jf(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 pl(e,t,n,a){return new Jf(e,t,n,a)}function Cr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xs(e,t){var n=e.alternate;return n===null?(n=pl(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 iu(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 Rr(e,t,n,a,u,f){var b=0;if(a=e,typeof e=="function")Cr(e)&&(b=1);else if(typeof e=="string")b=W_(e,n,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=pl(31,n,t,u),e.elementType=te,e.lanes=f,e;case R:return ha(n.children,u,f,t);case z:b=8,u|=24;break;case X:return e=pl(12,n,t,u|2),e.elementType=X,e.lanes=f,e;case K:return e=pl(13,n,t,u),e.elementType=K,e.lanes=f,e;case C:return e=pl(19,n,t,u),e.elementType=C,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:b=10;break e;case F:b=9;break e;case O:b=11;break e;case D:b=14;break e;case H:b=16,a=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=pl(b,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function ha(e,t,n,a){return e=pl(7,e,a,t),e.lanes=n,e}function qi(e,t,n){return e=pl(6,e,null,t),e.lanes=n,e}function Mr(e){var t=pl(18,null,null,0);return t.stateNode=e,t}function Ka(e,t,n){return t=pl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ru=new WeakMap;function Nl(e,t){if(typeof e=="object"&&e!==null){var n=ru.get(e);return n!==void 0?n:(t={value:e,source:t,stack:_n(t)},ru.set(e,t),t)}return{value:e,source:t,stack:_n(t)}}var Za=[],Fa=0,Dr=null,Gi=0,Tl=[],El=0,Bs=null,Wl=1,Pl="";function ys(e,t){Za[Fa++]=Gi,Za[Fa++]=Dr,Dr=e,Gi=t}function cu(e,t,n){Tl[El++]=Wl,Tl[El++]=Pl,Tl[El++]=Bs,Bs=e;var a=Wl;e=Pl;var u=32-Je(a)-1;a&=~(1<<u),n+=1;var f=32-Je(t)+u;if(30<f){var b=u-u%5;f=(a&(1<<b)-1).toString(32),a>>=b,u-=b,Wl=1<<32-Je(t)+u|n<<u|a,Pl=f+e}else Wl=1<<f|n<<u|a,Pl=e}function Ic(e){e.return!==null&&(ys(e,1),cu(e,1,0))}function qc(e){for(;e===Dr;)Dr=Za[--Fa],Za[Fa]=null,Gi=Za[--Fa],Za[Fa]=null;for(;e===Bs;)Bs=Tl[--El],Tl[El]=null,Pl=Tl[--El],Tl[El]=null,Wl=Tl[--El],Tl[El]=null}function ou(e,t){Tl[El++]=Wl,Tl[El++]=Pl,Tl[El++]=Bs,Wl=t.id,Pl=t.overflow,Bs=e}var Bn=null,Ct=null,lt=!1,ql=null,sn=!1,ml=Error(c(519));function gn(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yi(Nl(t,e)),ml}function Gc(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[et]=e,t[Me]=a,n){case"dialog":at("cancel",t),at("close",t);break;case"iframe":case"object":case"embed":at("load",t);break;case"video":case"audio":for(n=0;n<uo.length;n++)at(uo[n],t);break;case"source":at("error",t);break;case"img":case"image":case"link":at("error",t),at("load",t);break;case"details":at("toggle",t);break;case"input":at("invalid",t),Ul(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":at("invalid",t);break;case"textarea":at("invalid",t),k(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||qg(t.textContent,n)?(a.popover!=null&&(at("beforetoggle",t),at("toggle",t)),a.onScroll!=null&&at("scroll",t),a.onScrollEnd!=null&&at("scrollend",t),a.onClick!=null&&(t.onclick=ke),t=!0):t=!1,t||gn(e,!0)}function Or(e){for(Bn=e.return;Bn;)switch(Bn.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:Bn=Bn.return}}function pa(e){if(e!==Bn)return!1;if(!lt)return Or(e),lt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||oh(e.type,e.memoizedProps)),n=!n),n&&Ct&&gn(e),Or(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ct=Fg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ct=Fg(e)}else t===27?(t=Ct,fi(e.type)?(e=ph,ph=null,Ct=e):Ct=t):Ct=Bn?ss(e.stateNode.nextSibling):null;return!0}function es(){Ct=Bn=null,lt=!1}function Lr(){var e=ql;return e!==null&&(Ml===null?Ml=e:Ml.push.apply(Ml,e),ql=null),e}function Yi(e){ql===null?ql=[e]:ql.push(e)}var ma=N(null),Is=null,_s=null;function ts(e,t,n){re(ma,t._currentValue),t._currentValue=n}function vs(e){e._currentValue=ma.current,V(ma)}function ga(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 qs(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var j=f;f=u;for(var M=0;M<t.length;M++)if(j.context===t[M]){f.lanes|=n,j=f.alternate,j!==null&&(j.lanes|=n),ga(f.return,n,e),a||(b=null);break e}f=j.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(c(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),ga(b,n,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function Ja(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(c(387));if(b=b.memoizedProps,b!==null){var j=u.type;hl(u.pendingProps.value,b.value)||(e!==null?e.push(j):e=[j])}}else if(u===De.current){if(b=u.alternate,b===null)throw Error(c(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(go):e=[go])}u=u.return}e!==null&&qs(t,e,n,a),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!hl(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gs(e){Is=e,_s=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function In(e){return Yc(Is,e)}function zr(e,t){return Is===null&&Gs(e),Yc(e,t)}function Yc(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_s===null){if(e===null)throw Error(c(308));_s=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _s=_s.next=t;return n}var uu=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()})}},Wf=s.unstable_scheduleCallback,Pf=s.unstable_NormalPriority,bn={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vi(){return{controller:new uu,data:new Map,refCount:0}}function Wa(e){e.refCount--,e.refCount===0&&Wf(Pf,function(){e.controller.abort()})}var $i=null,Ur=0,m=0,I=null;function pe(e,t){if($i===null){var n=$i=[];Ur=0,m=eh(),I={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Ur++,t.then(qe,qe),t}function qe(){if(--Ur===0&&$i!==null){I!==null&&(I.status="fulfilled");var e=$i;$i=null,m=0,I=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Xt(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 An=A.S;A.S=function(e,t){fg=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&pe(e,t),An!==null&&An(e,t)};var qn=N(null);function ba(){var e=qn.current;return e!==null?e:Bt.pooledCache}function Qi(e,t){t===null?re(qn,qn.current):re(qn,t.pool)}function Xc(){var e=ba();return e===null?null:{parent:bn._currentValue,pool:e}}var xe=Error(c(460)),Ae=Error(c(474)),Ge=Error(c(542)),pt={then:function(){}};function Ht(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ns(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ke,ke),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dp(e),e;default:if(typeof t.status=="string")t.then(ke,ke);else{if(e=Bt,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,Dp(e),e}throw Ki=t,xe}}function js(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ki=n,xe):n}}var Ki=null;function Mp(){if(Ki===null)throw Error(c(459));var e=Ki;return Ki=null,e}function Dp(e){if(e===xe||e===Ge)throw Error(c(483))}var Hr=null,Vc=0;function fu(e){var t=Vc;return Vc+=1,Hr===null&&(Hr=[]),ns(Hr,e,t)}function $c(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function du(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 Op(e){function t(q,U){if(e){var $=q.deletions;$===null?(q.deletions=[U],q.flags|=16):$.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=xs(q,U),q.index=0,q.sibling=null,q}function f(q,U,$){return q.index=$,e?($=q.alternate,$!==null?($=$.index,$<U?(q.flags|=67108866,U):$):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function b(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function j(q,U,$,ie){return U===null||U.tag!==6?(U=qi($,q.mode,ie),U.return=q,U):(U=u(U,$),U.return=q,U)}function M(q,U,$,ie){var Ue=$.type;return Ue===R?se(q,U,$.props.children,ie,$.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===H&&js(Ue)===U.type)?(U=u(U,$.props),$c(U,$),U.return=q,U):(U=Rr($.type,$.key,$.props,null,q.mode,ie),$c(U,$),U.return=q,U)}function Q(q,U,$,ie){return U===null||U.tag!==4||U.stateNode.containerInfo!==$.containerInfo||U.stateNode.implementation!==$.implementation?(U=Ka($,q.mode,ie),U.return=q,U):(U=u(U,$.children||[]),U.return=q,U)}function se(q,U,$,ie,Ue){return U===null||U.tag!==7?(U=ha($,q.mode,ie,Ue),U.return=q,U):(U=u(U,$),U.return=q,U)}function oe(q,U,$){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=qi(""+U,q.mode,$),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case E:return $=Rr(U.type,U.key,U.props,null,q.mode,$),$c($,U),$.return=q,$;case T:return U=Ka(U,q.mode,$),U.return=q,U;case H:return U=js(U),oe(q,U,$)}if(Ee(U)||ue(U))return U=ha(U,q.mode,$,null),U.return=q,U;if(typeof U.then=="function")return oe(q,fu(U),$);if(U.$$typeof===G)return oe(q,zr(q,U),$);du(q,U)}return null}function Z(q,U,$,ie){var Ue=U!==null?U.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return Ue!==null?null:j(q,U,""+$,ie);if(typeof $=="object"&&$!==null){switch($.$$typeof){case E:return $.key===Ue?M(q,U,$,ie):null;case T:return $.key===Ue?Q(q,U,$,ie):null;case H:return $=js($),Z(q,U,$,ie)}if(Ee($)||ue($))return Ue!==null?null:se(q,U,$,ie,null);if(typeof $.then=="function")return Z(q,U,fu($),ie);if($.$$typeof===G)return Z(q,U,zr(q,$),ie);du(q,$)}return null}function ee(q,U,$,ie,Ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return q=q.get($)||null,j(U,q,""+ie,Ue);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return q=q.get(ie.key===null?$:ie.key)||null,M(U,q,ie,Ue);case T:return q=q.get(ie.key===null?$:ie.key)||null,Q(U,q,ie,Ue);case H:return ie=js(ie),ee(q,U,$,ie,Ue)}if(Ee(ie)||ue(ie))return q=q.get($)||null,se(U,q,ie,Ue,null);if(typeof ie.then=="function")return ee(q,U,$,fu(ie),Ue);if(ie.$$typeof===G)return ee(q,U,$,zr(U,ie),Ue);du(U,ie)}return null}function Re(q,U,$,ie){for(var Ue=null,gt=null,ze=U,Fe=U=0,ot=null;ze!==null&&Fe<$.length;Fe++){ze.index>Fe?(ot=ze,ze=null):ot=ze.sibling;var bt=Z(q,ze,$[Fe],ie);if(bt===null){ze===null&&(ze=ot);break}e&&ze&&bt.alternate===null&&t(q,ze),U=f(bt,U,Fe),gt===null?Ue=bt:gt.sibling=bt,gt=bt,ze=ot}if(Fe===$.length)return n(q,ze),lt&&ys(q,Fe),Ue;if(ze===null){for(;Fe<$.length;Fe++)ze=oe(q,$[Fe],ie),ze!==null&&(U=f(ze,U,Fe),gt===null?Ue=ze:gt.sibling=ze,gt=ze);return lt&&ys(q,Fe),Ue}for(ze=a(ze);Fe<$.length;Fe++)ot=ee(ze,q,Fe,$[Fe],ie),ot!==null&&(e&&ot.alternate!==null&&ze.delete(ot.key===null?Fe:ot.key),U=f(ot,U,Fe),gt===null?Ue=ot:gt.sibling=ot,gt=ot);return e&&ze.forEach(function(gi){return t(q,gi)}),lt&&ys(q,Fe),Ue}function Ie(q,U,$,ie){if($==null)throw Error(c(151));for(var Ue=null,gt=null,ze=U,Fe=U=0,ot=null,bt=$.next();ze!==null&&!bt.done;Fe++,bt=$.next()){ze.index>Fe?(ot=ze,ze=null):ot=ze.sibling;var gi=Z(q,ze,bt.value,ie);if(gi===null){ze===null&&(ze=ot);break}e&&ze&&gi.alternate===null&&t(q,ze),U=f(gi,U,Fe),gt===null?Ue=gi:gt.sibling=gi,gt=gi,ze=ot}if(bt.done)return n(q,ze),lt&&ys(q,Fe),Ue;if(ze===null){for(;!bt.done;Fe++,bt=$.next())bt=oe(q,bt.value,ie),bt!==null&&(U=f(bt,U,Fe),gt===null?Ue=bt:gt.sibling=bt,gt=bt);return lt&&ys(q,Fe),Ue}for(ze=a(ze);!bt.done;Fe++,bt=$.next())bt=ee(ze,q,Fe,bt.value,ie),bt!==null&&(e&&bt.alternate!==null&&ze.delete(bt.key===null?Fe:bt.key),U=f(bt,U,Fe),gt===null?Ue=bt:gt.sibling=bt,gt=bt);return e&&ze.forEach(function(o0){return t(q,o0)}),lt&&ys(q,Fe),Ue}function Dt(q,U,$,ie){if(typeof $=="object"&&$!==null&&$.type===R&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case E:e:{for(var Ue=$.key;U!==null;){if(U.key===Ue){if(Ue=$.type,Ue===R){if(U.tag===7){n(q,U.sibling),ie=u(U,$.props.children),ie.return=q,q=ie;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===H&&js(Ue)===U.type){n(q,U.sibling),ie=u(U,$.props),$c(ie,$),ie.return=q,q=ie;break e}n(q,U);break}else t(q,U);U=U.sibling}$.type===R?(ie=ha($.props.children,q.mode,ie,$.key),ie.return=q,q=ie):(ie=Rr($.type,$.key,$.props,null,q.mode,ie),$c(ie,$),ie.return=q,q=ie)}return b(q);case T:e:{for(Ue=$.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===$.containerInfo&&U.stateNode.implementation===$.implementation){n(q,U.sibling),ie=u(U,$.children||[]),ie.return=q,q=ie;break e}else{n(q,U);break}else t(q,U);U=U.sibling}ie=Ka($,q.mode,ie),ie.return=q,q=ie}return b(q);case H:return $=js($),Dt(q,U,$,ie)}if(Ee($))return Re(q,U,$,ie);if(ue($)){if(Ue=ue($),typeof Ue!="function")throw Error(c(150));return $=Ue.call($),Ie(q,U,$,ie)}if(typeof $.then=="function")return Dt(q,U,fu($),ie);if($.$$typeof===G)return Dt(q,U,zr(q,$),ie);du(q,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,U!==null&&U.tag===6?(n(q,U.sibling),ie=u(U,$),ie.return=q,q=ie):(n(q,U),ie=qi($,q.mode,ie),ie.return=q,q=ie),b(q)):n(q,U)}return function(q,U,$,ie){try{Vc=0;var Ue=Dt(q,U,$,ie);return Hr=null,Ue}catch(ze){if(ze===xe||ze===Ge)throw ze;var gt=pl(29,ze,null,q.mode);return gt.lanes=ie,gt.return=q,gt}finally{}}}var Zi=Op(!0),Lp=Op(!1),Pa=!1;function ed(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(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 ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(yt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Ar(e),au(e,null,n),t}return Er(e,a,t,n),Ar(e)}function Qc(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,Ll(e,n)}}function nd(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ld=!1;function Kc(){if(ld){var e=I;if(e!==null)throw e}}function Zc(e,t,n,a){ld=!1;var u=e.updateQueue;Pa=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,j=u.shared.pending;if(j!==null){u.shared.pending=null;var M=j,Q=M.next;M.next=null,b===null?f=Q:b.next=Q,b=M;var se=e.alternate;se!==null&&(se=se.updateQueue,j=se.lastBaseUpdate,j!==b&&(j===null?se.firstBaseUpdate=Q:j.next=Q,se.lastBaseUpdate=M))}if(f!==null){var oe=u.baseState;b=0,se=Q=M=null,j=f;do{var Z=j.lane&-536870913,ee=Z!==j.lane;if(ee?(ct&Z)===Z:(a&Z)===Z){Z!==0&&Z===m&&(ld=!0),se!==null&&(se=se.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Re=e,Ie=j;Z=t;var Dt=n;switch(Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){oe=Re.call(Dt,oe,Z);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,Z=typeof Re=="function"?Re.call(Dt,oe,Z):Re,Z==null)break e;oe=S({},oe,Z);break e;case 2:Pa=!0}}Z=j.callback,Z!==null&&(e.flags|=64,ee&&(e.flags|=8192),ee=u.callbacks,ee===null?u.callbacks=[Z]:ee.push(Z))}else ee={lane:Z,tag:j.tag,payload:j.payload,callback:j.callback,next:null},se===null?(Q=se=ee,M=oe):se=se.next=ee,b|=Z;if(j=j.next,j===null){if(j=u.shared.pending,j===null)break;ee=j,j=ee.next,ee.next=null,u.lastBaseUpdate=ee,u.shared.pending=null}}while(!0);se===null&&(M=oe),u.baseState=M,u.firstBaseUpdate=Q,u.lastBaseUpdate=se,f===null&&(u.shared.lanes=0),ii|=b,e.lanes=b,e.memoizedState=oe}}function zp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Up(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)zp(n[e],t)}var Br=N(null),hu=N(0);function Hp(e,t){e=Na,re(hu,e),re(Br,t),Na=e|t.baseLanes}function sd(){re(hu,Na),re(Br,Br.current)}function ad(){Na=hu.current,V(Br),V(hu)}var Gl=N(null),ls=null;function ni(e){var t=e.alternate;re(Sn,Sn.current&1),re(Gl,e),ls===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(ls=e)}function id(e){re(Sn,Sn.current),re(Gl,e),ls===null&&(ls=e)}function Bp(e){e.tag===22?(re(Sn,Sn.current),re(Gl,e),ls===null&&(ls=e)):li()}function li(){re(Sn,Sn.current),re(Gl,Gl.current)}function Yl(e){V(Gl),ls===e&&(ls=null),V(Sn)}var Sn=N(0);function pu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||dh(n)||hh(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 xa=0,Ze=null,Rt=null,Cn=null,mu=!1,Ir=!1,Fi=!1,gu=0,Fc=0,qr=null,Py=0;function xn(){throw Error(c(321))}function rd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hl(e[n],t[n]))return!1;return!0}function cd(e,t,n,a,u,f){return xa=f,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?jm:Sd,Fi=!1,f=n(a,u),Fi=!1,Ir&&(f=qp(t,n,a,u)),Ip(e),f}function Ip(e){A.H=Pc;var t=Rt!==null&&Rt.next!==null;if(xa=0,Cn=Rt=Ze=null,mu=!1,Fc=0,qr=null,t)throw Error(c(300));e===null||Rn||(e=e.dependencies,e!==null&&Xi(e)&&(Rn=!0))}function qp(e,t,n,a){Ze=e;var u=0;do{if(Ir&&(qr=null),Fc=0,Ir=!1,25<=u)throw Error(c(301));if(u+=1,Cn=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=Sm,f=t(n,a)}while(Ir);return f}function e_(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?Jc(t):t,e=e.useState()[0],(Rt!==null?Rt.memoizedState:null)!==e&&(Ze.flags|=1024),t}function od(){var e=gu!==0;return gu=0,e}function ud(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function fd(e){if(mu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mu=!1}xa=0,Cn=Rt=Ze=null,Ir=!1,Fc=gu=0,qr=null}function gl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Ze.memoizedState=Cn=e:Cn=Cn.next=e,Cn}function wn(){if(Rt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=Rt.next;var t=Cn===null?Ze.memoizedState:Cn.next;if(t!==null)Cn=t,Rt=e;else{if(e===null)throw Ze.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},Cn===null?Ze.memoizedState=Cn=e:Cn=Cn.next=e}return Cn}function bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jc(e){var t=Fc;return Fc+=1,qr===null&&(qr=[]),e=ns(qr,e,t),t=Ze,(Cn===null?t.memoizedState:Cn.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?jm:Sd),e}function xu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jc(e);if(e.$$typeof===G)return In(e)}throw Error(c(438,String(e)))}function dd(e){var t=null,n=Ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Ze.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=bu(),Ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=de;return t.index++,n}function ya(e,t){return typeof t=="function"?t(e):t}function yu(e){var t=wn();return hd(t,Rt,e)}function hd(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var j=b=null,M=null,Q=t,se=!1;do{var oe=Q.lane&-536870913;if(oe!==Q.lane?(ct&oe)===oe:(xa&oe)===oe){var Z=Q.revertLane;if(Z===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),oe===m&&(se=!0);else if((xa&Z)===Z){Q=Q.next,Z===m&&(se=!0);continue}else oe={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},M===null?(j=M=oe,b=f):M=M.next=oe,Ze.lanes|=Z,ii|=Z;oe=Q.action,Fi&&n(f,oe),f=Q.hasEagerState?Q.eagerState:n(f,oe)}else Z={lane:oe,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},M===null?(j=M=Z,b=f):M=M.next=Z,Ze.lanes|=oe,ii|=oe;Q=Q.next}while(Q!==null&&Q!==t);if(M===null?b=f:M.next=j,!hl(f,e.memoizedState)&&(Rn=!0,se&&(n=I,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=M,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function pd(e){var t=wn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var b=u=u.next;do f=e(f,b.action),b=b.next;while(b!==u);hl(f,t.memoizedState)||(Rn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Gp(e,t,n){var a=Ze,u=wn(),f=lt;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!hl((Rt||u).memoizedState,n);if(b&&(u.memoizedState=n,Rn=!0),u=u.queue,bd(Vp.bind(null,a,u,e),[e]),u.getSnapshot!==t||b||Cn!==null&&Cn.memoizedState.tag&1){if(a.flags|=2048,Gr(9,{destroy:void 0},Xp.bind(null,a,u,n,t),null),Bt===null)throw Error(c(349));f||(xa&127)!==0||Yp(a,t,n)}return n}function Yp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t=bu(),Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xp(e,t,n,a){t.value=n,t.getSnapshot=a,$p(t)&&Qp(e)}function Vp(e,t,n){return n(function(){$p(t)&&Qp(e)})}function $p(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hl(e,n)}catch{return!0}}function Qp(e){var t=da(e,2);t!==null&&Dl(t,e,2)}function md(e){var t=gl();if(typeof e=="function"){var n=e;if(e=n(),Fi){Et(!0);try{n()}finally{Et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:e},t}function Kp(e,t,n,a){return e.baseState=n,hd(e,Rt,typeof a=="function"?a:ya)}function t_(e,t,n,a,u){if(ju(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};A.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Zp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Zp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=A.T,b={};A.T=b;try{var j=n(u,a),M=A.S;M!==null&&M(b,j),Fp(e,t,j)}catch(Q){gd(e,t,Q)}finally{f!==null&&b.types!==null&&(f.types=b.types),A.T=f}}else try{f=n(u,a),Fp(e,t,f)}catch(Q){gd(e,t,Q)}}function Fp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Jp(e,t,a)},function(a){return gd(e,t,a)}):Jp(e,t,n)}function Jp(e,t,n){t.status="fulfilled",t.value=n,Wp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zp(e,n)))}function gd(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Wp(t),t=t.next;while(t!==a)}e.action=null}function Wp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Pp(e,t){return t}function em(e,t){if(lt){var n=Bt.formState;if(n!==null){e:{var a=Ze;if(lt){if(Ct){t:{for(var u=Ct,f=sn;u.nodeType!==8;){if(!f){u=null;break t}if(u=ss(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Ct=ss(u.nextSibling),a=u.data==="F!";break e}}gn(a)}a=!1}a&&(t=n[0])}}return n=gl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pp,lastRenderedState:t},n.queue=a,n=ym.bind(null,Ze,a),a.dispatch=n,a=md(!1),f=jd.bind(null,Ze,!1,a.queue),a=gl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=t_.bind(null,Ze,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function tm(e){var t=wn();return nm(t,Rt,e)}function nm(e,t,n){if(t=hd(e,t,Pp)[0],e=yu(ya)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Jc(t)}catch(b){throw b===xe?Ge:b}else a=t;t=wn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Ze.flags|=2048,Gr(9,{destroy:void 0},n_.bind(null,u,n),null)),[a,f,e]}function n_(e,t){e.action=t}function lm(e){var t=wn(),n=Rt;if(n!==null)return nm(t,n,e);wn(),t=t.memoizedState,n=wn();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=Ze.updateQueue,t===null&&(t=bu(),Ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function sm(){return wn().memoizedState}function _u(e,t,n,a){var u=gl();Ze.flags|=e,u.memoizedState=Gr(1|t,{destroy:void 0},n,a===void 0?null:a)}function vu(e,t,n,a){var u=wn();a=a===void 0?null:a;var f=u.memoizedState.inst;Rt!==null&&a!==null&&rd(a,Rt.memoizedState.deps)?u.memoizedState=Gr(t,f,n,a):(Ze.flags|=e,u.memoizedState=Gr(1|t,f,n,a))}function am(e,t){_u(8390656,8,e,t)}function bd(e,t){vu(2048,8,e,t)}function l_(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=bu(),Ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function im(e){var t=wn().memoizedState;return l_({ref:t,nextImpl:e}),function(){if((yt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function rm(e,t){return vu(4,2,e,t)}function cm(e,t){return vu(4,4,e,t)}function om(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 um(e,t,n){n=n!=null?n.concat([e]):null,vu(4,4,om.bind(null,t,e),n)}function xd(){}function fm(e,t){var n=wn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&rd(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function dm(e,t){var n=wn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&rd(t,a[1]))return a[0];if(a=e(),Fi){Et(!0);try{e()}finally{Et(!1)}}return n.memoizedState=[a,t],a}function yd(e,t,n){return n===void 0||(xa&1073741824)!==0&&(ct&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=hg(),Ze.lanes|=e,ii|=e,n)}function hm(e,t,n,a){return hl(n,t)?n:Br.current!==null?(e=yd(e,n,a),hl(e,t)||(Rn=!0),e):(xa&42)===0||(xa&1073741824)!==0&&(ct&261930)===0?(Rn=!0,e.memoizedState=n):(e=hg(),Ze.lanes|=e,ii|=e,t)}function pm(e,t,n,a,u){var f=ce.p;ce.p=f!==0&&8>f?f:8;var b=A.T,j={};A.T=j,jd(e,!1,t,n);try{var M=u(),Q=A.S;if(Q!==null&&Q(j,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var se=Xt(M,a);Wc(e,t,se,$l(e))}else Wc(e,t,a,$l(e))}catch(oe){Wc(e,t,{then:function(){},status:"rejected",reason:oe},$l())}finally{ce.p=f,b!==null&&j.types!==null&&(b.types=j.types),A.T=b}}function s_(){}function _d(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=mm(e).queue;pm(e,u,t,L,n===null?s_:function(){return gm(e),n(a)})}function mm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:L},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gm(e){var t=mm(e);t.next===null&&(t=e.alternate.memoizedState),Wc(e,t.next.queue,{},$l())}function vd(){return In(go)}function bm(){return wn().memoizedState}function xm(){return wn().memoizedState}function a_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$l();e=ei(n);var a=ti(t,e,n);a!==null&&(Dl(a,t,n),Qc(a,t,n)),t={cache:Vi()},e.payload=t;return}t=t.return}}function i_(e,t,n){var a=$l();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ju(e)?_m(t,n):(n=Bc(e,t,n,a),n!==null&&(Dl(n,e,a),vm(n,t,a)))}function ym(e,t,n){var a=$l();Wc(e,t,n,a)}function Wc(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ju(e))_m(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,j=f(b,n);if(u.hasEagerState=!0,u.eagerState=j,hl(j,b))return Er(e,t,u,0),Bt===null&&Tr(),!1}catch{}finally{}if(n=Bc(e,t,u,a),n!==null)return Dl(n,e,a),vm(n,t,a),!0}return!1}function jd(e,t,n,a){if(a={lane:2,revertLane:eh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ju(e)){if(t)throw Error(c(479))}else t=Bc(e,n,a,2),t!==null&&Dl(t,e,2)}function ju(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function _m(e,t){Ir=mu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ll(e,n)}}var Pc={readContext:In,use:xu,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Pc.useEffectEvent=xn;var jm={readContext:In,use:xu,useCallback:function(e,t){return gl().memoizedState=[e,t===void 0?null:t],e},useContext:In,useEffect:am,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,_u(4194308,4,om.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _u(4194308,4,e,t)},useInsertionEffect:function(e,t){_u(4,2,e,t)},useMemo:function(e,t){var n=gl();t=t===void 0?null:t;var a=e();if(Fi){Et(!0);try{e()}finally{Et(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=gl();if(n!==void 0){var u=n(t);if(Fi){Et(!0);try{n(t)}finally{Et(!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=i_.bind(null,Ze,e),[a.memoizedState,e]},useRef:function(e){var t=gl();return e={current:e},t.memoizedState=e},useState:function(e){e=md(e);var t=e.queue,n=ym.bind(null,Ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xd,useDeferredValue:function(e,t){var n=gl();return yd(n,e,t)},useTransition:function(){var e=md(!1);return e=pm.bind(null,Ze,e.queue,!0,!1),gl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Ze,u=gl();if(lt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Bt===null)throw Error(c(349));(ct&127)!==0||Yp(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,am(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=gl(),t=Bt.identifierPrefix;if(lt){var n=Pl,a=Wl;n=(a&~(1<<32-Je(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=gu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Py++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vd,useFormState:em,useActionState:em,useOptimistic:function(e){var t=gl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=jd.bind(null,Ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:dd,useCacheRefresh:function(){return gl().memoizedState=a_.bind(null,Ze)},useEffectEvent:function(e){var t=gl(),n={impl:e};return t.memoizedState=n,function(){if((yt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Sd={readContext:In,use:xu,useCallback:fm,useContext:In,useEffect:bd,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:cm,useMemo:dm,useReducer:yu,useRef:sm,useState:function(){return yu(ya)},useDebugValue:xd,useDeferredValue:function(e,t){var n=wn();return hm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=yu(ya)[0],t=wn().memoizedState;return[typeof e=="boolean"?e:Jc(e),t]},useSyncExternalStore:Gp,useId:bm,useHostTransitionStatus:vd,useFormState:tm,useActionState:tm,useOptimistic:function(e,t){var n=wn();return Kp(n,Rt,e,t)},useMemoCache:dd,useCacheRefresh:xm};Sd.useEffectEvent=im;var Sm={readContext:In,use:xu,useCallback:fm,useContext:In,useEffect:bd,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:cm,useMemo:dm,useReducer:pd,useRef:sm,useState:function(){return pd(ya)},useDebugValue:xd,useDeferredValue:function(e,t){var n=wn();return Rt===null?yd(n,e,t):hm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=pd(ya)[0],t=wn().memoizedState;return[typeof e=="boolean"?e:Jc(e),t]},useSyncExternalStore:Gp,useId:bm,useHostTransitionStatus:vd,useFormState:lm,useActionState:lm,useOptimistic:function(e,t){var n=wn();return Rt!==null?Kp(n,Rt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:dd,useCacheRefresh:xm};Sm.useEffectEvent=im;function wd(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var kd={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=$l(),u=ei(a);u.payload=t,n!=null&&(u.callback=n),t=ti(e,u,a),t!==null&&(Dl(t,e,a),Qc(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=$l(),u=ei(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ti(e,u,a),t!==null&&(Dl(t,e,a),Qc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$l(),a=ei(n);a.tag=2,t!=null&&(a.callback=t),t=ti(e,a,n),t!==null&&(Dl(t,e,n),Qc(t,e,n))}};function wm(e,t,n,a,u,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,b):t.prototype&&t.prototype.isPureReactComponent?!Li(n,a)||!Li(u,f):!0}function km(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&&kd.enqueueReplaceState(t,t.state,null)}function Ji(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=S({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Nm(e){Ii(e)}function Tm(e){console.error(e)}function Em(e){Ii(e)}function Su(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 Nd(e,t,n){return n=ei(n),n.tag=3,n.payload={element:null},n.callback=function(){Su(e,t)},n}function Cm(e){return e=ei(e),e.tag=3,e}function Rm(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){Am(t,n,a)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Am(t,n,a),typeof u!="function"&&(ri===null?ri=new Set([this]):ri.add(this));var j=a.stack;this.componentDidCatch(a.value,{componentStack:j!==null?j:""})})}function r_(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Ja(t,n,u,!0),n=Gl.current,n!==null){switch(n.tag){case 31:case 13:return ls===null?Lu():n.alternate===null&&yn===0&&(yn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===pt?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Jd(e,a,u)),!1;case 22:return n.flags|=65536,a===pt?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)),Jd(e,a,u)),!1}throw Error(c(435,n.tag))}return Jd(e,a,u),Lu(),!1}if(lt)return t=Gl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==ml&&(e=Error(c(422),{cause:a}),Yi(Nl(e,n)))):(a!==ml&&(t=Error(c(423),{cause:a}),Yi(Nl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Nl(a,n),u=Nd(e.stateNode,a,u),nd(e,u),yn!==4&&(yn=2)),!1;var f=Error(c(520),{cause:a});if(f=Nl(f,n),ro===null?ro=[f]:ro.push(f),yn!==4&&(yn=2),t===null)return!0;a=Nl(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Nd(n.stateNode,a,e),nd(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"&&(ri===null||!ri.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Cm(u),Rm(u,e,n,a),nd(n,u),!1}n=n.return}while(n!==null);return!1}var Td=Error(c(461)),Rn=!1;function sl(e,t,n,a){t.child=e===null?Lp(t,null,n,a):Zi(t,e.child,n,a)}function Mm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var b={};for(var j in a)j!=="ref"&&(b[j]=a[j])}else b=a;return Gs(t),a=cd(e,t,n,b,f,u),j=od(),e!==null&&!Rn?(ud(e,t,u),_a(e,t,u)):(lt&&j&&Ic(t),t.flags|=1,sl(e,t,a,u),t.child)}function Dm(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!Cr(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Om(e,t,f,a,u)):(e=Rr(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Ld(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:Li,n(b,a)&&e.ref===t.ref)return _a(e,t,u)}return t.flags|=1,e=xs(f,a),e.ref=t.ref,e.return=t,t.child=e}function Om(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(Li(f,a)&&e.ref===t.ref)if(Rn=!1,t.pendingProps=a=f,Ld(e,u))(e.flags&131072)!==0&&(Rn=!0);else return t.lanes=e.lanes,_a(e,t,u)}return Ed(e,t,n,a,u)}function Lm(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 zm(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qi(t,f!==null?f.cachePool:null),f!==null?Hp(t,f):sd(),Bp(t);else return a=t.lanes=536870912,zm(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(Qi(t,f.cachePool),Hp(t,f),li(),t.memoizedState=null):(e!==null&&Qi(t,null),sd(),li());return sl(e,t,u,n),t.child}function eo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zm(e,t,n,a,u){var f=ba();return f=f===null?null:{parent:bn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Qi(t,null),sd(),Bp(t),e!==null&&Ja(e,t,a,!0),t.childLanes=u,null}function wu(e,t){return t=Nu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Um(e,t,n){return Zi(t,e.child,null,n),e=wu(t,t.pendingProps),e.flags|=2,Yl(t),t.memoizedState=null,e}function c_(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(lt){if(a.mode==="hidden")return e=wu(t,a),t.lanes=536870912,eo(null,e);if(id(t),(e=Ct)?(e=Zg(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bs!==null?{id:Wl,overflow:Pl}:null,retryLane:536870912,hydrationErrors:null},n=Mr(e),n.return=t,t.child=n,Bn=t,Ct=null)):e=null,e===null)throw gn(t);return t.lanes=536870912,null}return wu(t,a)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(id(t),u)if(t.flags&256)t.flags&=-257,t=Um(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Rn||Ja(e,t,n,!1),u=(n&e.childLanes)!==0,Rn||u){if(a=Bt,a!==null&&(b=fl(a,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,da(e,b),Dl(a,e,b),Td;Lu(),t=Um(e,t,n)}else e=f.treeContext,Ct=ss(b.nextSibling),Bn=t,lt=!0,ql=null,sn=!1,e!==null&&ou(t,e),t=wu(t,a),t.flags|=4096;return t}return e=xs(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ku(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 Ed(e,t,n,a,u){return Gs(t),n=cd(e,t,n,a,void 0,u),a=od(),e!==null&&!Rn?(ud(e,t,u),_a(e,t,u)):(lt&&a&&Ic(t),t.flags|=1,sl(e,t,n,u),t.child)}function Hm(e,t,n,a,u,f){return Gs(t),t.updateQueue=null,n=qp(t,a,n,u),Ip(e),a=od(),e!==null&&!Rn?(ud(e,t,f),_a(e,t,f)):(lt&&a&&Ic(t),t.flags|=1,sl(e,t,n,f),t.child)}function Bm(e,t,n,a,u){if(Gs(t),t.stateNode===null){var f=Qa,b=n.contextType;typeof b=="object"&&b!==null&&(f=In(b)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=kd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},ed(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?In(b):Qa,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(wd(t,n,b,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&kd.enqueueReplaceState(f,f.state,null),Zc(t,a,f,u),Kc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var j=t.memoizedProps,M=Ji(n,j);f.props=M;var Q=f.context,se=n.contextType;b=Qa,typeof se=="object"&&se!==null&&(b=In(se));var oe=n.getDerivedStateFromProps;se=typeof oe=="function"||typeof f.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,se||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(j||Q!==b)&&km(t,f,a,b),Pa=!1;var Z=t.memoizedState;f.state=Z,Zc(t,a,f,u),Kc(),Q=t.memoizedState,j||Z!==Q||Pa?(typeof oe=="function"&&(wd(t,n,oe,a),Q=t.memoizedState),(M=Pa||wm(t,n,M,a,Z,Q,b))?(se||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=Q),f.props=a,f.state=Q,f.context=b,a=M):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,td(e,t),b=t.memoizedProps,se=Ji(n,b),f.props=se,oe=t.pendingProps,Z=f.context,Q=n.contextType,M=Qa,typeof Q=="object"&&Q!==null&&(M=In(Q)),j=n.getDerivedStateFromProps,(Q=typeof j=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==oe||Z!==M)&&km(t,f,a,M),Pa=!1,Z=t.memoizedState,f.state=Z,Zc(t,a,f,u),Kc();var ee=t.memoizedState;b!==oe||Z!==ee||Pa||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof j=="function"&&(wd(t,n,j,a),ee=t.memoizedState),(se=Pa||wm(t,n,se,a,Z,ee,M)||e!==null&&e.dependencies!==null&&Xi(e.dependencies))?(Q||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,ee,M),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,ee,M)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ee),f.props=a,f.state=ee,f.context=M,a=se):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,ku(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=Zi(t,e.child,null,u),t.child=Zi(t,null,n,u)):sl(e,t,n,u),t.memoizedState=f.state,e=t.child):e=_a(e,t,u),e}function Im(e,t,n,a){return es(),t.flags|=256,sl(e,t,n,a),t.child}var Ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cd(e){return{baseLanes:e,cachePool:Xc()}}function Rd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Vl),e}function qm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(Sn.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(lt){if(u?ni(t):li(),(e=Ct)?(e=Zg(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bs!==null?{id:Wl,overflow:Pl}:null,retryLane:536870912,hydrationErrors:null},n=Mr(e),n.return=t,t.child=n,Bn=t,Ct=null)):e=null,e===null)throw gn(t);return hh(e)?t.lanes=32:t.lanes=536870912,null}var j=a.children;return a=a.fallback,u?(li(),u=t.mode,j=Nu({mode:"hidden",children:j},u),a=ha(a,u,n,null),j.return=t,a.return=t,j.sibling=a,t.child=j,a=t.child,a.memoizedState=Cd(n),a.childLanes=Rd(e,b,n),t.memoizedState=Ad,eo(null,a)):(ni(t),Md(t,j))}var M=e.memoizedState;if(M!==null&&(j=M.dehydrated,j!==null)){if(f)t.flags&256?(ni(t),t.flags&=-257,t=Dd(e,t,n)):t.memoizedState!==null?(li(),t.child=e.child,t.flags|=128,t=null):(li(),j=a.fallback,u=t.mode,a=Nu({mode:"visible",children:a.children},u),j=ha(j,u,n,null),j.flags|=2,a.return=t,j.return=t,a.sibling=j,t.child=a,Zi(t,e.child,null,n),a=t.child,a.memoizedState=Cd(n),a.childLanes=Rd(e,b,n),t.memoizedState=Ad,t=eo(null,a));else if(ni(t),hh(j)){if(b=j.nextSibling&&j.nextSibling.dataset,b)var Q=b.dgst;b=Q,a=Error(c(419)),a.stack="",a.digest=b,Yi({value:a,source:null,stack:null}),t=Dd(e,t,n)}else if(Rn||Ja(e,t,n,!1),b=(n&e.childLanes)!==0,Rn||b){if(b=Bt,b!==null&&(a=fl(b,n),a!==0&&a!==M.retryLane))throw M.retryLane=a,da(e,a),Dl(b,e,a),Td;dh(j)||Lu(),t=Dd(e,t,n)}else dh(j)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Ct=ss(j.nextSibling),Bn=t,lt=!0,ql=null,sn=!1,e!==null&&ou(t,e),t=Md(t,a.children),t.flags|=4096);return t}return u?(li(),j=a.fallback,u=t.mode,M=e.child,Q=M.sibling,a=xs(M,{mode:"hidden",children:a.children}),a.subtreeFlags=M.subtreeFlags&65011712,Q!==null?j=xs(Q,j):(j=ha(j,u,n,null),j.flags|=2),j.return=t,a.return=t,a.sibling=j,t.child=a,eo(null,a),a=t.child,j=e.child.memoizedState,j===null?j=Cd(n):(u=j.cachePool,u!==null?(M=bn._currentValue,u=u.parent!==M?{parent:M,pool:M}:u):u=Xc(),j={baseLanes:j.baseLanes|n,cachePool:u}),a.memoizedState=j,a.childLanes=Rd(e,b,n),t.memoizedState=Ad,eo(e.child,a)):(ni(t),n=e.child,e=n.sibling,n=xs(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function Md(e,t){return t=Nu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Nu(e,t){return e=pl(22,e,null,t),e.lanes=0,e}function Dd(e,t,n){return Zi(t,e.child,null,n),e=Md(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ga(e.return,t,n)}function Od(e,t,n,a,u,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=a,b.tail=n,b.tailMode=u,b.treeForkCount=f)}function Ym(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var b=Sn.current,j=(b&2)!==0;if(j?(b=b&1|2,t.flags|=128):b&=1,re(Sn,b),sl(e,t,a,n),a=lt?Gi:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gm(e,n,t);else if(e.tag===19)Gm(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&&pu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Od(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&&pu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Od(t,!0,n,null,f,a);break;case"together":Od(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function _a(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ii|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ja(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=xs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ld(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Xi(e)))}function o_(e,t,n){switch(t.tag){case 3:xt(t,t.stateNode.containerInfo),ts(t,bn,e.memoizedState.cache),es();break;case 27:case 5:Ve(t);break;case 4:xt(t,t.stateNode.containerInfo);break;case 10:ts(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,id(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ni(t),t.flags|=128,null):(n&t.child.childLanes)!==0?qm(e,t,n):(ni(t),e=_a(e,t,n),e!==null?e.sibling:null);ni(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ja(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return Ym(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),re(Sn,Sn.current),a)break;return null;case 22:return t.lanes=0,Lm(e,t,n,t.pendingProps);case 24:ts(t,bn,e.memoizedState.cache)}return _a(e,t,n)}function Xm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rn=!0;else{if(!Ld(e,n)&&(t.flags&128)===0)return Rn=!1,o_(e,t,n);Rn=(e.flags&131072)!==0}else Rn=!1,lt&&(t.flags&1048576)!==0&&cu(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=js(t.elementType),t.type=e,typeof e=="function")Cr(e)?(a=Ji(e,a),t.tag=1,t=Bm(null,t,e,a,n)):(t.tag=0,t=Ed(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===O){t.tag=11,t=Mm(null,t,e,a,n);break e}else if(u===D){t.tag=14,t=Dm(null,t,e,a,n);break e}}throw t=Ce(e)||e,Error(c(306,t,""))}}return t;case 0:return Ed(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=Ji(a,t.pendingProps),Bm(e,t,a,u,n);case 3:e:{if(xt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,td(e,t),Zc(t,a,null,n);var b=t.memoizedState;if(a=b.cache,ts(t,bn,a),a!==f.cache&&qs(t,[bn],n,!0),Kc(),a=b.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Im(e,t,a,n);break e}else if(a!==u){u=Nl(Error(c(424)),t),Yi(u),t=Im(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(Ct=ss(e.firstChild),Bn=t,lt=!0,ql=null,sn=!0,n=Lp(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(es(),a===u){t=_a(e,t,n);break e}sl(e,t,a,n)}t=t.child}return t;case 26:return ku(e,t),e===null?(n=tb(t.type,null,t.pendingProps,null))?t.memoizedState=n:lt||(n=t.type,e=t.pendingProps,a=Gu(ve.current).createElement(n),a[et]=t,a[Me]=e,al(a,n,e),zt(a),t.stateNode=a):t.memoizedState=tb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ve(t),e===null&<&&(a=t.stateNode=Wg(t.type,t.pendingProps,ve.current),Bn=t,sn=!0,u=Ct,fi(t.type)?(ph=u,Ct=ss(a.firstChild)):Ct=u),sl(e,t,t.pendingProps.children,n),ku(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&<&&((u=a=Ct)&&(a=B_(a,t.type,t.pendingProps,sn),a!==null?(t.stateNode=a,Bn=t,Ct=ss(a.firstChild),sn=!1,u=!0):u=!1),u||gn(t)),Ve(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,a=f.children,oh(u,f)?a=null:b!==null&&oh(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=cd(e,t,e_,null,null,n),go._currentValue=u),ku(e,t),sl(e,t,a,n),t.child;case 6:return e===null&<&&((e=n=Ct)&&(n=I_(n,t.pendingProps,sn),n!==null?(t.stateNode=n,Bn=t,Ct=null,e=!0):e=!1),e||gn(t)),null;case 13:return qm(e,t,n);case 4:return xt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Zi(t,null,a,n):sl(e,t,a,n),t.child;case 11:return Mm(e,t,t.type,t.pendingProps,n);case 7:return sl(e,t,t.pendingProps,n),t.child;case 8:return sl(e,t,t.pendingProps.children,n),t.child;case 12:return sl(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,ts(t,t.type,a.value),sl(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,Gs(t),u=In(u),a=a(u),t.flags|=1,sl(e,t,a,n),t.child;case 14:return Dm(e,t,t.type,t.pendingProps,n);case 15:return Om(e,t,t.type,t.pendingProps,n);case 19:return Ym(e,t,n);case 31:return c_(e,t,n);case 22:return Lm(e,t,n,t.pendingProps);case 24:return Gs(t),a=In(bn),e===null?(u=ba(),u===null&&(u=Bt,f=Vi(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},ed(t),ts(t,bn,u)):((e.lanes&n)!==0&&(td(e,t),Zc(t,null,null,n),Kc()),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),ts(t,bn,a)):(a=f.cache,ts(t,bn,a),a!==u.cache&&qs(t,[bn],n,!0))),sl(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function va(e){e.flags|=4}function zd(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(bg())e.flags|=8192;else throw Ki=pt,Ae}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,!ib(t))if(bg())e.flags|=8192;else throw Ki=pt,Ae}function Tu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zn():536870912,e.lanes|=t,$r|=t)}function to(e,t){if(!lt)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 Kt(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 u_(e,t,n){var a=t.pendingProps;switch(qc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(t),null;case 1:return Kt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),vs(bn),Xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?va(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lr())),Kt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(va(t),f!==null?(Kt(t),Vm(t,f)):(Kt(t),zd(t,u,null,a,n))):f?f!==e.memoizedState?(va(t),Kt(t),Vm(t,f)):(Kt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&va(t),Kt(t),zd(t,u,e,a,n)),null;case 27:if($e(t),n=ve.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&va(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Kt(t),null}e=me.current,pa(t)?Gc(t):(e=Wg(u,a,n),t.stateNode=e,va(t))}return Kt(t),null;case 5:if($e(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&va(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Kt(t),null}if(f=me.current,pa(t))Gc(t);else{var b=Gu(ve.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?b.createElement("select",{is:a.is}):b.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?b.createElement(u,{is:a.is}):b.createElement(u)}}f[et]=t,f[Me]=a;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(al(f,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&va(t)}}return Kt(t),zd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&va(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=ve.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Bn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||qg(e.nodeValue,n)),e||gn(t,!0)}else e=Gu(e).createTextNode(a),e[et]=t,t.stateNode=e}return Kt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=pa(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[et]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Kt(t),e=!1}else n=Lr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Yl(t),t):(Yl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Kt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=pa(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[et]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Kt(t),u=!1}else u=Lr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Yl(t),t):(Yl(t),null)}return Yl(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),Tu(t,t.updateQueue),Kt(t),null);case 4:return Xe(),e===null&&sh(t.stateNode.containerInfo),Kt(t),null;case 10:return vs(t.type),Kt(t),null;case 19:if(V(Sn),a=t.memoizedState,a===null)return Kt(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)to(a,!1);else{if(yn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=pu(e),f!==null){for(t.flags|=128,to(a,!1),e=f.updateQueue,t.updateQueue=e,Tu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)iu(n,e),n=n.sibling;return re(Sn,Sn.current&1|2),lt&&ys(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&nt()>Mu&&(t.flags|=128,u=!0,to(a,!1),t.lanes=4194304)}else{if(!u)if(e=pu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Tu(t,e),to(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!lt)return Kt(t),null}else 2*nt()-a.renderingStartTime>Mu&&n!==536870912&&(t.flags|=128,u=!0,to(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=nt(),e.sibling=null,n=Sn.current,re(Sn,u?n&1|2:n&1),lt&&ys(t,a.treeForkCount),e):(Kt(t),null);case 22:case 23:return Yl(t),ad(),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&&(Kt(t),t.subtreeFlags&6&&(t.flags|=8192)):Kt(t),n=t.updateQueue,n!==null&&Tu(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(qn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),vs(bn),Kt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function f_(e,t){switch(qc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(bn),Xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return $e(t),null;case 31:if(t.memoizedState!==null){if(Yl(t),t.alternate===null)throw Error(c(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Yl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(Sn),null;case 4:return Xe(),null;case 10:return vs(t.type),null;case 22:case 23:return Yl(t),ad(),e!==null&&V(qn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return vs(bn),null;case 25:return null;default:return null}}function $m(e,t){switch(qc(t),t.tag){case 3:vs(bn),Xe();break;case 26:case 27:case 5:$e(t);break;case 4:Xe();break;case 31:t.memoizedState!==null&&Yl(t);break;case 13:Yl(t);break;case 19:V(Sn);break;case 10:vs(t.type);break;case 22:case 23:Yl(t),ad(),e!==null&&V(qn);break;case 24:vs(bn)}}function no(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,b=n.inst;a=f(),b.destroy=a}n=n.next}while(n!==u)}}catch(j){Tt(t,t.return,j)}}function si(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var b=a.inst,j=b.destroy;if(j!==void 0){b.destroy=void 0,u=t;var M=n,Q=j;try{Q()}catch(se){Tt(u,M,se)}}}a=a.next}while(a!==f)}}catch(se){Tt(t,t.return,se)}}function Qm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Up(t,n)}catch(a){Tt(e,e.return,a)}}}function Km(e,t,n){n.props=Ji(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Tt(e,t,a)}}function lo(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){Tt(e,t,u)}}function Ys(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){Tt(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){Tt(e,t,u)}else n.current=null}function Zm(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){Tt(e,e.return,u)}}function Ud(e,t,n){try{var a=e.stateNode;D_(a,e.type,n,t),a[Me]=t}catch(u){Tt(e,e.return,u)}}function Fm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fi(e.type)||e.tag===4}function Hd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fm(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&&fi(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 Bd(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=ke));else if(a!==4&&(a===27&&fi(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Bd(e,t,n),e=e.sibling;e!==null;)Bd(e,t,n),e=e.sibling}function Eu(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&&fi(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Eu(e,t,n),e=e.sibling;e!==null;)Eu(e,t,n),e=e.sibling}function Jm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);al(t,a,n),t[et]=e,t[Me]=n}catch(f){Tt(e,e.return,f)}}var ja=!1,Mn=!1,Id=!1,Wm=typeof WeakSet=="function"?WeakSet:Set,$n=null;function d_(e,t){if(e=e.containerInfo,rh=Zu,e=nu(e),zi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,j=-1,M=-1,Q=0,se=0,oe=e,Z=null;t:for(;;){for(var ee;oe!==n||u!==0&&oe.nodeType!==3||(j=b+u),oe!==f||a!==0&&oe.nodeType!==3||(M=b+a),oe.nodeType===3&&(b+=oe.nodeValue.length),(ee=oe.firstChild)!==null;)Z=oe,oe=ee;for(;;){if(oe===e)break t;if(Z===n&&++Q===u&&(j=b),Z===f&&++se===a&&(M=b),(ee=oe.nextSibling)!==null)break;oe=Z,Z=oe.parentNode}oe=ee}n=j===-1||M===-1?null:{start:j,end:M}}else n=null}n=n||{start:0,end:0}}else n=null;for(ch={focusedElem:e,selectionRange:n},Zu=!1,$n=t;$n!==null;)if(t=$n,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$n=e;else for(;$n!==null;){switch(t=$n,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=Ji(n.type,u);e=a.getSnapshotBeforeUpdate(Re,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(Ie){Tt(n,n.return,Ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)fh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fh(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,$n=e;break}$n=t.return}}function Pm(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:wa(e,n),a&4&&no(5,n);break;case 1:if(wa(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){Tt(n,n.return,b)}else{var u=Ji(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Tt(n,n.return,b)}}a&64&&Qm(n),a&512&&lo(n,n.return);break;case 3:if(wa(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{Up(e,t)}catch(b){Tt(n,n.return,b)}}break;case 27:t===null&&a&4&&Jm(n);case 26:case 5:wa(e,n),t===null&&a&4&&Zm(n),a&512&&lo(n,n.return);break;case 12:wa(e,n);break;case 31:wa(e,n),a&4&&ng(e,n);break;case 13:wa(e,n),a&4&&lg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=v_.bind(null,n),q_(e,n))));break;case 22:if(a=n.memoizedState!==null||ja,!a){t=t!==null&&t.memoizedState!==null||Mn,u=ja;var f=Mn;ja=a,(Mn=t)&&!f?ka(e,n,(n.subtreeFlags&8772)!==0):wa(e,n),ja=u,Mn=f}break;case 30:break;default:wa(e,n)}}function eg(e){var t=e.alternate;t!==null&&(e.alternate=null,eg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&el(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 an=null,Al=!1;function Sa(e,t,n){for(n=n.child;n!==null;)tg(e,t,n),n=n.sibling}function tg(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(qt,n)}catch{}switch(n.tag){case 26:Mn||Ys(n,t),Sa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Mn||Ys(n,t);var a=an,u=Al;fi(n.type)&&(an=n.stateNode,Al=!1),Sa(e,t,n),ho(n.stateNode),an=a,Al=u;break;case 5:Mn||Ys(n,t);case 6:if(a=an,u=Al,an=null,Sa(e,t,n),an=a,Al=u,an!==null)if(Al)try{(an.nodeType===9?an.body:an.nodeName==="HTML"?an.ownerDocument.body:an).removeChild(n.stateNode)}catch(f){Tt(n,t,f)}else try{an.removeChild(n.stateNode)}catch(f){Tt(n,t,f)}break;case 18:an!==null&&(Al?(e=an,Qg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ec(e)):Qg(an,n.stateNode));break;case 4:a=an,u=Al,an=n.stateNode.containerInfo,Al=!0,Sa(e,t,n),an=a,Al=u;break;case 0:case 11:case 14:case 15:si(2,n,t),Mn||si(4,n,t),Sa(e,t,n);break;case 1:Mn||(Ys(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Km(n,t,a)),Sa(e,t,n);break;case 21:Sa(e,t,n);break;case 22:Mn=(a=Mn)||n.memoizedState!==null,Sa(e,t,n),Mn=a;break;default:Sa(e,t,n)}}function ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ec(e)}catch(n){Tt(t,t.return,n)}}}function lg(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){Tt(t,t.return,n)}}function h_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Wm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Wm),t;default:throw Error(c(435,e.tag))}}function Au(e,t){var n=h_(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=j_.bind(null,e,a);a.then(u,u)}})}function Cl(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,b=t,j=b;e:for(;j!==null;){switch(j.tag){case 27:if(fi(j.type)){an=j.stateNode,Al=!1;break e}break;case 5:an=j.stateNode,Al=!1;break e;case 3:case 4:an=j.stateNode.containerInfo,Al=!0;break e}j=j.return}if(an===null)throw Error(c(160));tg(f,b,u),an=null,Al=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)sg(t,e),t=t.sibling}var Ss=null;function sg(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cl(t,e),Rl(e),a&4&&(si(3,e,e.return),no(3,e),si(5,e,e.return));break;case 1:Cl(t,e),Rl(e),a&512&&(Mn||n===null||Ys(n,n.return)),a&64&&ja&&(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=Ss;if(Cl(t,e),Rl(e),a&512&&(Mn||n===null||Ys(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[Qt]||f[et]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),al(f,a,n),f[et]=e,zt(f),a=f;break e;case"link":var b=sb("link","href",u).get(a+(n.href||""));if(b){for(var j=0;j<b.length;j++)if(f=b[j],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(j,1);break t}}f=u.createElement(a),al(f,a,n),u.head.appendChild(f);break;case"meta":if(b=sb("meta","content",u).get(a+(n.content||""))){for(j=0;j<b.length;j++)if(f=b[j],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(j,1);break t}}f=u.createElement(a),al(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[et]=e,zt(f),a=f}e.stateNode=a}else ab(u,e.type,e.stateNode);else e.stateNode=lb(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?ab(u,e.type,e.stateNode):lb(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ud(e,e.memoizedProps,n.memoizedProps)}break;case 27:Cl(t,e),Rl(e),a&512&&(Mn||n===null||Ys(n,n.return)),n!==null&&a&4&&Ud(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cl(t,e),Rl(e),a&512&&(Mn||n===null||Ys(n,n.return)),e.flags&32){u=e.stateNode;try{Y(u,"")}catch(Re){Tt(e,e.return,Re)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Ud(e,u,n!==null?n.memoizedProps:u)),a&1024&&(Id=!0);break;case 6:if(Cl(t,e),Rl(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Re){Tt(e,e.return,Re)}}break;case 3:if(Vu=null,u=Ss,Ss=Yu(t.containerInfo),Cl(t,e),Ss=u,Rl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ec(t.containerInfo)}catch(Re){Tt(e,e.return,Re)}Id&&(Id=!1,ag(e));break;case 4:a=Ss,Ss=Yu(e.stateNode.containerInfo),Cl(t,e),Rl(e),Ss=a;break;case 12:Cl(t,e),Rl(e);break;case 31:Cl(t,e),Rl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Au(e,a)));break;case 13:Cl(t,e),Rl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ru=nt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Au(e,a)));break;case 22:u=e.memoizedState!==null;var M=n!==null&&n.memoizedState!==null,Q=ja,se=Mn;if(ja=Q||u,Mn=se||M,Cl(t,e),Mn=se,ja=Q,Rl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||M||ja||Mn||Wi(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){M=n=t;try{if(f=M.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{j=M.stateNode;var oe=M.memoizedProps.style,Z=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;j.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(Re){Tt(M,M.return,Re)}}}else if(t.tag===6){if(n===null){M=t;try{M.stateNode.nodeValue=u?"":M.memoizedProps}catch(Re){Tt(M,M.return,Re)}}}else if(t.tag===18){if(n===null){M=t;try{var ee=M.stateNode;u?Kg(ee,!0):Kg(M.stateNode,!1)}catch(Re){Tt(M,M.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,Au(e,n))));break;case 19:Cl(t,e),Rl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Au(e,a)));break;case 30:break;case 21:break;default:Cl(t,e),Rl(e)}}function Rl(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Fm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Hd(e);Eu(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(Y(b,""),n.flags&=-33);var j=Hd(e);Eu(e,j,b);break;case 3:case 4:var M=n.stateNode.containerInfo,Q=Hd(e);Bd(e,Q,M);break;default:throw Error(c(161))}}catch(se){Tt(e,e.return,se)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ag(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ag(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Pm(e,t.alternate,t),t=t.sibling}function Wi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:si(4,t,t.return),Wi(t);break;case 1:Ys(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Km(t,t.return,n),Wi(t);break;case 27:ho(t.stateNode);case 26:case 5:Ys(t,t.return),Wi(t);break;case 22:t.memoizedState===null&&Wi(t);break;case 30:Wi(t);break;default:Wi(t)}e=e.sibling}}function ka(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:ka(u,f,n),no(4,f);break;case 1:if(ka(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(Q){Tt(a,a.return,Q)}if(a=f,u=a.updateQueue,u!==null){var j=a.stateNode;try{var M=u.shared.hiddenCallbacks;if(M!==null)for(u.shared.hiddenCallbacks=null,u=0;u<M.length;u++)zp(M[u],j)}catch(Q){Tt(a,a.return,Q)}}n&&b&64&&Qm(f),lo(f,f.return);break;case 27:Jm(f);case 26:case 5:ka(u,f,n),n&&a===null&&b&4&&Zm(f),lo(f,f.return);break;case 12:ka(u,f,n);break;case 31:ka(u,f,n),n&&b&4&&ng(u,f);break;case 13:ka(u,f,n),n&&b&4&&lg(u,f);break;case 22:f.memoizedState===null&&ka(u,f,n),lo(f,f.return);break;case 30:break;default:ka(u,f,n)}t=t.sibling}}function qd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Wa(n))}function Gd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wa(e))}function ws(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ig(e,t,n,a),t=t.sibling}function ig(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ws(e,t,n,a),u&2048&&no(9,t);break;case 1:ws(e,t,n,a);break;case 3:ws(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wa(e)));break;case 12:if(u&2048){ws(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,j=f.onPostCommit;typeof j=="function"&&j(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Tt(t,t.return,M)}}else ws(e,t,n,a);break;case 31:ws(e,t,n,a);break;case 13:ws(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?ws(e,t,n,a):so(e,t):f._visibility&2?ws(e,t,n,a):(f._visibility|=2,Yr(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&qd(b,t);break;case 24:ws(e,t,n,a),u&2048&&Gd(t.alternate,t);break;default:ws(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,b=t,j=n,M=a,Q=b.flags;switch(b.tag){case 0:case 11:case 15:Yr(f,b,j,M,u),no(8,b);break;case 23:break;case 22:var se=b.stateNode;b.memoizedState!==null?se._visibility&2?Yr(f,b,j,M,u):so(f,b):(se._visibility|=2,Yr(f,b,j,M,u)),u&&Q&2048&&qd(b.alternate,b);break;case 24:Yr(f,b,j,M,u),u&&Q&2048&&Gd(b.alternate,b);break;default:Yr(f,b,j,M,u)}t=t.sibling}}function so(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:so(n,a),u&2048&&qd(a.alternate,a);break;case 24:so(n,a),u&2048&&Gd(a.alternate,a);break;default:so(n,a)}t=t.sibling}}var ao=8192;function Xr(e,t,n){if(e.subtreeFlags&ao)for(e=e.child;e!==null;)rg(e,t,n),e=e.sibling}function rg(e,t,n){switch(e.tag){case 26:Xr(e,t,n),e.flags&ao&&e.memoizedState!==null&&P_(n,Ss,e.memoizedState,e.memoizedProps);break;case 5:Xr(e,t,n);break;case 3:case 4:var a=Ss;Ss=Yu(e.stateNode.containerInfo),Xr(e,t,n),Ss=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ao,ao=16777216,Xr(e,t,n),ao=a):Xr(e,t,n));break;default:Xr(e,t,n)}}function cg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function io(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];$n=a,ug(a,e)}cg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)og(e),e=e.sibling}function og(e){switch(e.tag){case 0:case 11:case 15:io(e),e.flags&2048&&si(9,e,e.return);break;case 3:io(e);break;case 12:io(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cu(e)):io(e);break;default:io(e)}}function Cu(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];$n=a,ug(a,e)}cg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:si(8,t,t.return),Cu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Cu(t));break;default:Cu(t)}e=e.sibling}}function ug(e,t){for(;$n!==null;){var n=$n;switch(n.tag){case 0:case 11:case 15:si(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Wa(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,$n=a;else e:for(n=e;$n!==null;){a=$n;var u=a.sibling,f=a.return;if(eg(a),a===n){$n=null;break e}if(u!==null){u.return=f,$n=u;break e}$n=f}}}var p_={getCacheForType:function(e){var t=In(bn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return In(bn).controller.signal}},m_=typeof WeakMap=="function"?WeakMap:Map,yt=0,Bt=null,st=null,ct=0,Nt=0,Xl=null,ai=!1,Vr=!1,Yd=!1,Na=0,yn=0,ii=0,Pi=0,Xd=0,Vl=0,$r=0,ro=null,Ml=null,Vd=!1,Ru=0,fg=0,Mu=1/0,Du=null,ri=null,Gn=0,ci=null,Qr=null,Ta=0,$d=0,Qd=null,dg=null,co=0,Kd=null;function $l(){return(yt&2)!==0&&ct!==0?ct&-ct:A.T!==null?eh():tn()}function hg(){if(Vl===0)if((ct&536870912)===0||lt){var e=B;B<<=1,(B&3932160)===0&&(B=262144),Vl=e}else Vl=536870912;return e=Gl.current,e!==null&&(e.flags|=32),Vl}function Dl(e,t,n){(e===Bt&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)&&(Kr(e,0),oi(e,ct,Vl,!1)),Jn(e,n),((yt&2)===0||e!==Bt)&&(e===Bt&&((yt&2)===0&&(Pi|=n),yn===4&&oi(e,ct,Vl,!1)),Xs(e))}function pg(e,t,n){if((yt&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Gt(e,t),u=a?x_(e,t):Fd(e,t,!0),f=a;do{if(u===0){Vr&&!a&&oi(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!g_(n)){u=Fd(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var j=e;u=ro;var M=j.current.memoizedState.isDehydrated;if(M&&(Kr(j,b).flags|=256),b=Fd(j,b,!1),b!==2){if(Yd&&!M){j.errorRecoveryDisabledLanes|=f,Pi|=f,u=4;break e}f=Ml,Ml=u,f!==null&&(Ml===null?Ml=f:Ml.push.apply(Ml,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){Kr(e,0),oi(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:oi(a,t,Vl,!ai);break e;case 2:Ml=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Ru+300-nt(),10<u)){if(oi(a,t,Vl,!ai),Be(a,0,!0)!==0)break e;Ta=t,a.timeoutHandle=Vg(mg.bind(null,a,n,Ml,Du,Vd,t,Vl,Pi,$r,ai,f,"Throttled",-0,0),u);break e}mg(a,n,Ml,Du,Vd,t,Vl,Pi,$r,ai,f,null,-0,0)}}break}while(!0);Xs(e)}function mg(e,t,n,a,u,f,b,j,M,Q,se,oe,Z,ee){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:ke},rg(t,f,oe);var Re=(f&62914560)===f?Ru-nt():(f&4194048)===f?fg-nt():0;if(Re=e0(oe,Re),Re!==null){Ta=f,e.cancelPendingCommit=Re(Sg.bind(null,e,t,f,n,a,u,b,j,M,se,oe,null,Z,ee)),oi(e,f,b,!Q);return}}Sg(e,t,f,n,a,u,b,j,M)}function g_(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(!hl(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 oi(e,t,n,a){t&=~Xd,t&=~Pi,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-Je(u),b=1<<f;a[f]=-1,u&=~b}n!==0&&Nn(e,n,t)}function Ou(){return(yt&6)===0?(oo(0),!1):!0}function Zd(){if(st!==null){if(Nt===0)var e=st.return;else e=st,_s=Is=null,fd(e),Hr=null,Vc=0,e=st;for(;e!==null;)$m(e.alternate,e),e=e.return;st=null}}function Kr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,z_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ta=0,Zd(),Bt=e,st=n=xs(e.current,null),ct=t,Nt=0,Xl=null,ai=!1,Vr=Gt(e,t),Yd=!1,$r=Vl=Xd=Pi=ii=yn=0,Ml=ro=null,Vd=!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-Je(a),f=1<<u;t|=e[u],a&=~f}return Na=t,Tr(),n}function gg(e,t){Ze=null,A.H=Pc,t===xe||t===Ge?(t=Mp(),Nt=3):t===Ae?(t=Mp(),Nt=4):Nt=t===Td?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Xl=t,st===null&&(yn=1,Su(e,Nl(t,e.current)))}function bg(){var e=Gl.current;return e===null?!0:(ct&4194048)===ct?ls===null:(ct&62914560)===ct||(ct&536870912)!==0?e===ls:!1}function xg(){var e=A.H;return A.H=Pc,e===null?Pc:e}function yg(){var e=A.A;return A.A=p_,e}function Lu(){yn=4,ai||(ct&4194048)!==ct&&Gl.current!==null||(Vr=!0),(ii&134217727)===0&&(Pi&134217727)===0||Bt===null||oi(Bt,ct,Vl,!1)}function Fd(e,t,n){var a=yt;yt|=2;var u=xg(),f=yg();(Bt!==e||ct!==t)&&(Du=null,Kr(e,t)),t=!1;var b=yn;e:do try{if(Nt!==0&&st!==null){var j=st,M=Xl;switch(Nt){case 8:Zd(),b=6;break e;case 3:case 2:case 9:case 6:Gl.current===null&&(t=!0);var Q=Nt;if(Nt=0,Xl=null,Zr(e,j,M,Q),n&&Vr){b=0;break e}break;default:Q=Nt,Nt=0,Xl=null,Zr(e,j,M,Q)}}b_(),b=yn;break}catch(se){gg(e,se)}while(!0);return t&&e.shellSuspendCounter++,_s=Is=null,yt=a,A.H=u,A.A=f,st===null&&(Bt=null,ct=0,Tr()),b}function b_(){for(;st!==null;)_g(st)}function x_(e,t){var n=yt;yt|=2;var a=xg(),u=yg();Bt!==e||ct!==t?(Du=null,Mu=nt()+500,Kr(e,t)):Vr=Gt(e,t);e:do try{if(Nt!==0&&st!==null){t=st;var f=Xl;t:switch(Nt){case 1:Nt=0,Xl=null,Zr(e,t,f,1);break;case 2:case 9:if(Ht(f)){Nt=0,Xl=null,vg(t);break}t=function(){Nt!==2&&Nt!==9||Bt!==e||(Nt=7),Xs(e)},f.then(t,t);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:Ht(f)?(Nt=0,Xl=null,vg(t)):(Nt=0,Xl=null,Zr(e,t,f,7));break;case 5:var b=null;switch(st.tag){case 26:b=st.memoizedState;case 5:case 27:var j=st;if(b?ib(b):j.stateNode.complete){Nt=0,Xl=null;var M=j.sibling;if(M!==null)st=M;else{var Q=j.return;Q!==null?(st=Q,zu(Q)):st=null}break t}}Nt=0,Xl=null,Zr(e,t,f,5);break;case 6:Nt=0,Xl=null,Zr(e,t,f,6);break;case 8:Zd(),yn=6;break e;default:throw Error(c(462))}}y_();break}catch(se){gg(e,se)}while(!0);return _s=Is=null,A.H=a,A.A=u,yt=n,st!==null?0:(Bt=null,ct=0,Tr(),yn)}function y_(){for(;st!==null&&!en();)_g(st)}function _g(e){var t=Xm(e.alternate,e,Na);e.memoizedProps=e.pendingProps,t===null?zu(e):st=t}function vg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hm(n,t,t.pendingProps,t.type,void 0,ct);break;case 11:t=Hm(n,t,t.pendingProps,t.type.render,t.ref,ct);break;case 5:fd(t);default:$m(n,t),t=st=iu(t,Na),t=Xm(n,t,Na)}e.memoizedProps=e.pendingProps,t===null?zu(e):st=t}function Zr(e,t,n,a){_s=Is=null,fd(t),Hr=null,Vc=0;var u=t.return;try{if(r_(e,u,t,n,ct)){yn=1,Su(e,Nl(n,e.current)),st=null;return}}catch(f){if(u!==null)throw st=u,f;yn=1,Su(e,Nl(n,e.current)),st=null;return}t.flags&32768?(lt||a===1?e=!0:Vr||(ct&536870912)!==0?e=!1:(ai=e=!0,(a===2||a===9||a===3||a===6)&&(a=Gl.current,a!==null&&a.tag===13&&(a.flags|=16384))),jg(t,e)):zu(t)}function zu(e){var t=e;do{if((t.flags&32768)!==0){jg(t,ai);return}e=t.return;var n=u_(t.alternate,t,Na);if(n!==null){st=n;return}if(t=t.sibling,t!==null){st=t;return}st=t=e}while(t!==null);yn===0&&(yn=5)}function jg(e,t){do{var n=f_(e.alternate,e);if(n!==null){n.flags&=32767,st=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){st=e;return}st=e=n}while(e!==null);yn=6,st=null}function Sg(e,t,n,a,u,f,b,j,M){e.cancelPendingCommit=null;do Uu();while(Gn!==0);if((yt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Hc,Kl(e,n,f,b,j,M),e===Bt&&(st=Bt=null,ct=0),Qr=t,ci=e,Ta=n,$d=f,Qd=u,dg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,S_(kt,function(){return Eg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null,u=ce.p,ce.p=2,b=yt,yt|=4;try{d_(e,t,n)}finally{yt=b,ce.p=u,A.T=a}}Gn=1,wg(),kg(),Ng()}}function wg(){if(Gn===1){Gn=0;var e=ci,t=Qr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var a=ce.p;ce.p=2;var u=yt;yt|=4;try{sg(t,e);var f=ch,b=nu(e.containerInfo),j=f.focusedElem,M=f.selectionRange;if(b!==j&&j&&j.ownerDocument&&tu(j.ownerDocument.documentElement,j)){if(M!==null&&zi(j)){var Q=M.start,se=M.end;if(se===void 0&&(se=Q),"selectionStart"in j)j.selectionStart=Q,j.selectionEnd=Math.min(se,j.value.length);else{var oe=j.ownerDocument||document,Z=oe&&oe.defaultView||window;if(Z.getSelection){var ee=Z.getSelection(),Re=j.textContent.length,Ie=Math.min(M.start,Re),Dt=M.end===void 0?Ie:Math.min(M.end,Re);!ee.extend&&Ie>Dt&&(b=Dt,Dt=Ie,Ie=b);var q=eu(j,Ie),U=eu(j,Dt);if(q&&U&&(ee.rangeCount!==1||ee.anchorNode!==q.node||ee.anchorOffset!==q.offset||ee.focusNode!==U.node||ee.focusOffset!==U.offset)){var $=oe.createRange();$.setStart(q.node,q.offset),ee.removeAllRanges(),Ie>Dt?(ee.addRange($),ee.extend(U.node,U.offset)):($.setEnd(U.node,U.offset),ee.addRange($))}}}}for(oe=[],ee=j;ee=ee.parentNode;)ee.nodeType===1&&oe.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<oe.length;j++){var ie=oe[j];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Zu=!!rh,ch=rh=null}finally{yt=u,ce.p=a,A.T=n}}e.current=t,Gn=2}}function kg(){if(Gn===2){Gn=0;var e=ci,t=Qr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var a=ce.p;ce.p=2;var u=yt;yt|=4;try{Pm(e,t.alternate,t)}finally{yt=u,ce.p=a,A.T=n}}Gn=3}}function Ng(){if(Gn===4||Gn===3){Gn=0,Vt();var e=ci,t=Qr,n=Ta,a=dg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gn=5:(Gn=0,Qr=ci=null,Tg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ri=null),Pn(n),t=t.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(qt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=A.T,u=ce.p,ce.p=2,A.T=null;try{for(var f=e.onRecoverableError,b=0;b<a.length;b++){var j=a[b];f(j.value,{componentStack:j.stack})}}finally{A.T=t,ce.p=u}}(Ta&3)!==0&&Uu(),Xs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Kd?co++:(co=0,Kd=e):co=0,oo(0)}}function Tg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wa(t)))}function Uu(){return wg(),kg(),Ng(),Eg()}function Eg(){if(Gn!==5)return!1;var e=ci,t=$d;$d=0;var n=Pn(Ta),a=A.T,u=ce.p;try{ce.p=32>n?32:n,A.T=null,n=Qd,Qd=null;var f=ci,b=Ta;if(Gn=0,Qr=ci=null,Ta=0,(yt&6)!==0)throw Error(c(331));var j=yt;if(yt|=4,og(f.current),ig(f,f.current,b,n),yt=j,oo(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(qt,f)}catch{}return!0}finally{ce.p=u,A.T=a,Tg(e,t)}}function Ag(e,t,n){t=Nl(n,t),t=Nd(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Jn(e,2),Xs(e))}function Tt(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"&&(ri===null||!ri.has(a))){e=Nl(n,e),n=Cm(2),a=ti(t,n,2),a!==null&&(Rm(n,a,t,e),Jn(a,2),Xs(a));break}}t=t.return}}function Jd(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new m_;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)||(Yd=!0,u.add(n),e=__.bind(null,e,t,n),t.then(e,e))}function __(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bt===e&&(ct&n)===n&&(yn===4||yn===3&&(ct&62914560)===ct&&300>nt()-Ru?(yt&2)===0&&Kr(e,0):Xd|=n,$r===ct&&($r=0)),Xs(e)}function Cg(e,t){t===0&&(t=Zn()),e=da(e,t),e!==null&&(Jn(e,t),Xs(e))}function v_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cg(e,n)}function j_(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),Cg(e,n)}function S_(e,t){return tt(e,t)}var Hu=null,Fr=null,Wd=!1,Bu=!1,Pd=!1,ui=0;function Xs(e){e!==Fr&&e.next===null&&(Fr===null?Hu=Fr=e:Fr=Fr.next=e),Bu=!0,Wd||(Wd=!0,k_())}function oo(e,t){if(!Pd&&Bu){Pd=!0;do for(var n=!1,a=Hu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var b=a.suspendedLanes,j=a.pingedLanes;f=(1<<31-Je(42|e)+1)-1,f&=u&~(b&~j),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Og(a,f))}else f=ct,f=Be(a,a===Bt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||Gt(a,f)||(n=!0,Og(a,f));a=a.next}while(n);Pd=!1}}function w_(){Rg()}function Rg(){Bu=Wd=!1;var e=0;ui!==0&&L_()&&(e=ui);for(var t=nt(),n=null,a=Hu;a!==null;){var u=a.next,f=Mg(a,t);f===0?(a.next=null,n===null?Hu=u:n.next=u,u===null&&(Fr=n)):(n=a,(e!==0||(f&3)!==0)&&(Bu=!0)),a=u}Gn!==0&&Gn!==5||oo(e),ui!==0&&(ui=0)}function Mg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-Je(f),j=1<<b,M=u[b];M===-1?((j&n)===0||(j&a)!==0)&&(u[b]=vl(j,t)):M<=t&&(e.expiredLanes|=j),f&=~j}if(t=Bt,n=ct,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Pe(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Gt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Pe(a),Pn(n)){case 2:case 8:n=rn;break;case 32:n=kt;break;case 268435456:n=It;break;default:n=kt}return a=Dg.bind(null,e),n=tt(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Pe(a),e.callbackPriority=2,e.callbackNode=null,2}function Dg(e,t){if(Gn!==0&&Gn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var a=ct;return a=Be(e,e===Bt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(pg(e,a,t),Mg(e,nt()),e.callbackNode!=null&&e.callbackNode===n?Dg.bind(null,e):null)}function Og(e,t){if(Uu())return null;pg(e,t,!0)}function k_(){U_(function(){(yt&6)!==0?tt($t,w_):Rg()})}function eh(){if(ui===0){var e=m;e===0&&(e=He,He<<=1,(He&261888)===0&&(He=256)),ui=e}return ui}function Lg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ae(""+e)}function zg(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 N_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=Lg((u[Me]||null).action),b=a.submitter;b&&(t=(t=b[Me]||null)?Lg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var j=new ra("action","action",null,a,u);e.push({event:j,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ui!==0){var M=b?zg(u,b):new FormData(u);_d(n,{pending:!0,data:M,method:u.method,action:f},null,M)}}else typeof f=="function"&&(j.preventDefault(),M=b?zg(u,b):new FormData(u),_d(n,{pending:!0,data:M,method:u.method,action:f},f,M))},currentTarget:u}]})}}for(var th=0;th<Nr.length;th++){var nh=Nr[th],T_=nh.toLowerCase(),E_=nh[0].toUpperCase()+nh.slice(1);Il(T_,"on"+E_)}Il(lu,"onAnimationEnd"),Il(Uc,"onAnimationIteration"),Il(kr,"onAnimationStart"),Il("dblclick","onDoubleClick"),Il("focusin","onFocus"),Il("focusout","onBlur"),Il(Kf,"onTransitionRun"),Il(Zf,"onTransitionStart"),Il(Ff,"onTransitionCancel"),Il(su,"onTransitionEnd"),dl("onMouseEnter",["mouseout","mouseover"]),dl("onMouseLeave",["mouseout","mouseover"]),dl("onPointerEnter",["pointerout","pointerover"]),dl("onPointerLeave",["pointerout","pointerover"]),Yt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uo="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(" "),A_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uo));function Ug(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var b=a.length-1;0<=b;b--){var j=a[b],M=j.instance,Q=j.currentTarget;if(j=j.listener,M!==f&&u.isPropagationStopped())break e;f=j,u.currentTarget=Q;try{f(u)}catch(se){Ii(se)}u.currentTarget=null,f=M}else for(b=0;b<a.length;b++){if(j=a[b],M=j.instance,Q=j.currentTarget,j=j.listener,M!==f&&u.isPropagationStopped())break e;f=j,u.currentTarget=Q;try{f(u)}catch(se){Ii(se)}u.currentTarget=null,f=M}}}}function at(e,t){var n=t[jn];n===void 0&&(n=t[jn]=new Set);var a=e+"__bubble";n.has(a)||(Hg(t,e,2,!1),n.add(a))}function lh(e,t,n){var a=0;t&&(a|=4),Hg(n,e,a,t)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function sh(e){if(!e[Iu]){e[Iu]=!0,tl.forEach(function(n){n!=="selectionchange"&&(A_.has(n)||lh(n,!1,e),lh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Iu]||(t[Iu]=!0,lh("selectionchange",!1,t))}}function Hg(e,t,n,a){switch(hb(t)){case 2:var u=l0;break;case 8:u=s0;break;default:u=yh}n=u.bind(null,t,n,e),u=void 0,!Da||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 ah(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var b=a.tag;if(b===3||b===4){var j=a.stateNode.containerInfo;if(j===u)break;if(b===4)for(b=a.return;b!==null;){var M=b.tag;if((M===3||M===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;j!==null;){if(b=vt(j),b===null)return;if(M=b.tag,M===5||M===6||M===26||M===27){a=f=b;continue e}j=j.parentNode}}a=a.return}Ma(function(){var Q=f,se=ft(n),oe=[];e:{var Z=Va.get(e);if(Z!==void 0){var ee=ra,Re=e;switch(e){case"keypress":if(aa(n)===0)break e;case"keydown":case"keyup":ee=vr;break;case"focusin":Re="focus",ee=za;break;case"focusout":Re="blur",ee=za;break;case"beforeblur":case"afterblur":ee=za;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":ee=Io;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=xr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Xo;break;case lu:case Uc:case kr:ee=yr;break;case su:ee=Vo;break;case"scroll":case"scrollend":ee=Tc;break;case"wheel":ee=bs;break;case"copy":case"cut":case"paste":ee=_r;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Ua;break;case"toggle":case"beforetoggle":ee=jr}var Ie=(t&4)!==0,Dt=!Ie&&(e==="scroll"||e==="scrollend"),q=Ie?Z!==null?Z+"Capture":null:Z;Ie=[];for(var U=Q,$;U!==null;){var ie=U;if($=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||$===null||q===null||(ie=Ei(U,q),ie!=null&&Ie.push(fo(U,ie,$))),Dt)break;U=U.return}0<Ie.length&&(Z=new ee(Z,Re,null,n,se),oe.push({event:Z,listeners:Ie}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",ee=e==="mouseout"||e==="pointerout",Z&&n!==We&&(Re=n.relatedTarget||n.fromElement)&&(vt(Re)||Re[nn]))break e;if((ee||Z)&&(Z=se.window===se?se:(Z=se.ownerDocument)?Z.defaultView||Z.parentWindow:window,ee?(Re=n.relatedTarget||n.toElement,ee=Q,Re=Re?vt(Re):null,Re!==null&&(Dt=d(Re),Ie=Re.tag,Re!==Dt||Ie!==5&&Ie!==27&&Ie!==6)&&(Re=null)):(ee=null,Re=Q),ee!==Re)){if(Ie=Io,ie="onMouseLeave",q="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(Ie=Ua,ie="onPointerLeave",q="onPointerEnter",U="pointer"),Dt=ee==null?Z:zn(ee),$=Re==null?Z:zn(Re),Z=new Ie(ie,U+"leave",ee,n,se),Z.target=Dt,Z.relatedTarget=$,ie=null,vt(se)===Q&&(Ie=new Ie(q,U+"enter",Re,n,se),Ie.target=$,Ie.relatedTarget=Dt,ie=Ie),Dt=ie,ee&&Re)t:{for(Ie=C_,q=ee,U=Re,$=0,ie=q;ie;ie=Ie(ie))$++;ie=0;for(var Ue=U;Ue;Ue=Ie(Ue))ie++;for(;0<$-ie;)q=Ie(q),$--;for(;0<ie-$;)U=Ie(U),ie--;for(;$--;){if(q===U||U!==null&&q===U.alternate){Ie=q;break t}q=Ie(q),U=Ie(U)}Ie=null}else Ie=null;ee!==null&&Bg(oe,Z,ee,Ie,!1),Re!==null&&Dt!==null&&Bg(oe,Dt,Re,Ie,!0)}}e:{if(Z=Q?zn(Q):window,ee=Z.nodeName&&Z.nodeName.toLowerCase(),ee==="select"||ee==="input"&&Z.type==="file")var gt=Rc;else if(wr(Z))if(Mc)gt=Vf;else{gt=Xf;var ze=Yf}else ee=Z.nodeName,!ee||ee.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?Q&&Le(Q.elementType)&&(gt=Rc):gt=Ga;if(gt&&(gt=gt(e,Q))){Zo(oe,gt,n,se);break e}ze&&ze(e,Z,Q),e==="focusout"&&Q&&Z.type==="number"&&Q.memoizedProps.value!=null&&At(Z,"number",Z.value)}switch(ze=Q?zn(Q):window,e){case"focusin":(wr(ze)||ze.contentEditable==="true")&&(Ya=ze,Ui=Q,Hi=null);break;case"focusout":Hi=Ui=Ya=null;break;case"mousedown":Oc=!0;break;case"contextmenu":case"mouseup":case"dragend":Oc=!1,Bi(oe,n,se);break;case"selectionchange":if(Qf)break;case"keydown":case"keyup":Bi(oe,n,se)}var Fe;if(ua)e:{switch(e){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Jl?Ia(e,n)&&(ot="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ot="onCompositionStart");ot&&(Ha&&n.locale!=="ko"&&(Jl||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Jl&&(Fe=br()):(hs=se,Oa="value"in hs?hs.value:hs.textContent,Jl=!0)),ze=qu(Q,ot),0<ze.length&&(ot=new Ls(ot,e,null,n,se),oe.push({event:ot,listeners:ze}),Fe?ot.data=Fe:(Fe=Cc(n),Fe!==null&&(ot.data=Fe)))),(Fe=Ko?Gf(e,n):le(e,n))&&(ot=qu(Q,"onBeforeInput"),0<ot.length&&(ze=new Ls("onBeforeInput","beforeinput",null,n,se),oe.push({event:ze,listeners:ot}),ze.data=Fe)),N_(oe,e,Q,n,se)}Ug(oe,t)})}function fo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qu(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=Ei(e,n),u!=null&&a.unshift(fo(e,u,f)),u=Ei(e,t),u!=null&&a.push(fo(e,u,f))),e.tag===3)return a;e=e.return}return[]}function C_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bg(e,t,n,a,u){for(var f=t._reactName,b=[];n!==null&&n!==a;){var j=n,M=j.alternate,Q=j.stateNode;if(j=j.tag,M!==null&&M===a)break;j!==5&&j!==26&&j!==27||Q===null||(M=Q,u?(Q=Ei(n,f),Q!=null&&b.unshift(fo(n,Q,M))):u||(Q=Ei(n,f),Q!=null&&b.push(fo(n,Q,M)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var R_=/\r\n?/g,M_=/\u0000|\uFFFD/g;function Ig(e){return(typeof e=="string"?e:""+e).replace(R_,`
|
|
50
|
+
`).replace(M_,"")}function qg(e,t){return t=Ig(t),Ig(e)===t}function Mt(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":Oe(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=ae(""+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"&&Mt(e,t,"name",u.name,u,null),Mt(e,t,"formEncType",u.formEncType,u,null),Mt(e,t,"formMethod",u.formMethod,u,null),Mt(e,t,"formTarget",u.formTarget,u,null)):(Mt(e,t,"encType",u.encType,u,null),Mt(e,t,"method",u.method,u,null),Mt(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=ae(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ke);break;case"onScroll":a!=null&&at("scroll",e);break;case"onScrollEnd":a!=null&&at("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=ae(""+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":at("beforetoggle",e),at("toggle",e),Sl(e,"popover",a);break;case"xlinkActuate":Un(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Un(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Un(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Un(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Un(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Un(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Un(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Sl(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=mt.get(n)||n,Sl(e,n,a))}}function ih(e,t,n,a,u,f){switch(n){case"style":Oe(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&&at("scroll",e);break;case"onScrollEnd":a!=null&&at("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ke);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rs.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[Me]||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,""):Sl(e,n,a)}}}function al(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",e),at("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Mt(e,t,f,b,n,null)}}u&&Mt(e,t,"srcSet",n.srcSet,n,null),a&&Mt(e,t,"src",n.src,n,null);return;case"input":at("invalid",e);var j=f=b=u=null,M=null,Q=null;for(a in n)if(n.hasOwnProperty(a)){var se=n[a];if(se!=null)switch(a){case"name":u=se;break;case"type":b=se;break;case"checked":M=se;break;case"defaultChecked":Q=se;break;case"value":f=se;break;case"defaultValue":j=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Mt(e,t,a,se,n,null)}}Ul(e,f,j,M,Q,b,u,!1);return;case"select":at("invalid",e),a=b=f=null;for(u in n)if(n.hasOwnProperty(u)&&(j=n[u],j!=null))switch(u){case"value":f=j;break;case"defaultValue":b=j;break;case"multiple":a=j;default:Mt(e,t,u,j,n,null)}t=f,n=b,e.multiple=!!a,t!=null?ll(e,!!a,t,!1):n!=null&&ll(e,!!a,n,!0);return;case"textarea":at("invalid",e),f=u=a=null;for(b in n)if(n.hasOwnProperty(b)&&(j=n[b],j!=null))switch(b){case"value":a=j;break;case"defaultValue":u=j;break;case"children":f=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(91));break;default:Mt(e,t,b,j,n,null)}k(e,a,u,f);return;case"option":for(M in n)if(n.hasOwnProperty(M)&&(a=n[M],a!=null))switch(M){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Mt(e,t,M,a,n,null)}return;case"dialog":at("beforetoggle",e),at("toggle",e),at("cancel",e),at("close",e);break;case"iframe":case"object":at("load",e);break;case"video":case"audio":for(a=0;a<uo.length;a++)at(uo[a],e);break;case"image":at("error",e),at("load",e);break;case"details":at("toggle",e);break;case"embed":case"source":case"link":at("error",e),at("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(Q in n)if(n.hasOwnProperty(Q)&&(a=n[Q],a!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Mt(e,t,Q,a,n,null)}return;default:if(Le(t)){for(se in n)n.hasOwnProperty(se)&&(a=n[se],a!==void 0&&ih(e,t,se,a,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(a=n[j],a!=null&&Mt(e,t,j,a,n,null))}function D_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,j=null,M=null,Q=null,se=null;for(ee in n){var oe=n[ee];if(n.hasOwnProperty(ee)&&oe!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":M=oe;default:a.hasOwnProperty(ee)||Mt(e,t,ee,null,a,oe)}}for(var Z in a){var ee=a[Z];if(oe=n[Z],a.hasOwnProperty(Z)&&(ee!=null||oe!=null))switch(Z){case"type":f=ee;break;case"name":u=ee;break;case"checked":Q=ee;break;case"defaultChecked":se=ee;break;case"value":b=ee;break;case"defaultValue":j=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:ee!==oe&&Mt(e,t,Z,ee,a,oe)}}jt(e,b,j,M,Q,se,f,u);return;case"select":ee=b=j=Z=null;for(f in n)if(M=n[f],n.hasOwnProperty(f)&&M!=null)switch(f){case"value":break;case"multiple":ee=M;default:a.hasOwnProperty(f)||Mt(e,t,f,null,a,M)}for(u in a)if(f=a[u],M=n[u],a.hasOwnProperty(u)&&(f!=null||M!=null))switch(u){case"value":Z=f;break;case"defaultValue":j=f;break;case"multiple":b=f;default:f!==M&&Mt(e,t,u,f,a,M)}t=j,n=b,a=ee,Z!=null?ll(e,!!n,Z,!1):!!a!=!!n&&(t!=null?ll(e,!!n,t,!0):ll(e,!!n,n?[]:"",!1));return;case"textarea":ee=Z=null;for(j in n)if(u=n[j],n.hasOwnProperty(j)&&u!=null&&!a.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Mt(e,t,j,null,a,u)}for(b in a)if(u=a[b],f=n[b],a.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":Z=u;break;case"defaultValue":ee=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Mt(e,t,b,u,a,f)}he(e,Z,ee);return;case"option":for(var Re in n)if(Z=n[Re],n.hasOwnProperty(Re)&&Z!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Mt(e,t,Re,null,a,Z)}for(M in a)if(Z=a[M],ee=n[M],a.hasOwnProperty(M)&&Z!==ee&&(Z!=null||ee!=null))switch(M){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:Mt(e,t,M,Z,a,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in n)Z=n[Ie],n.hasOwnProperty(Ie)&&Z!=null&&!a.hasOwnProperty(Ie)&&Mt(e,t,Ie,null,a,Z);for(Q in a)if(Z=a[Q],ee=n[Q],a.hasOwnProperty(Q)&&Z!==ee&&(Z!=null||ee!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:Mt(e,t,Q,Z,a,ee)}return;default:if(Le(t)){for(var Dt in n)Z=n[Dt],n.hasOwnProperty(Dt)&&Z!==void 0&&!a.hasOwnProperty(Dt)&&ih(e,t,Dt,void 0,a,Z);for(se in a)Z=a[se],ee=n[se],!a.hasOwnProperty(se)||Z===ee||Z===void 0&&ee===void 0||ih(e,t,se,Z,a,ee);return}}for(var q in n)Z=n[q],n.hasOwnProperty(q)&&Z!=null&&!a.hasOwnProperty(q)&&Mt(e,t,q,null,a,Z);for(oe in a)Z=a[oe],ee=n[oe],!a.hasOwnProperty(oe)||Z===ee||Z==null&&ee==null||Mt(e,t,oe,Z,a,ee)}function Gg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,b=u.initiatorType,j=u.duration;if(f&&j&&Gg(b)){for(b=0,j=u.responseEnd,a+=1;a<n.length;a++){var M=n[a],Q=M.startTime;if(Q>j)break;var se=M.transferSize,oe=M.initiatorType;se&&Gg(oe)&&(M=M.responseEnd,b+=se*(M<j?1:(j-Q)/(M-Q)))}if(--a,t+=8*(f+b)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var rh=null,ch=null;function Gu(e){return e.nodeType===9?e:e.ownerDocument}function Yg(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 oh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var uh=null;function L_(){var e=window.event;return e&&e.type==="popstate"?e===uh?!1:(uh=e,!0):(uh=null,!1)}var Vg=typeof setTimeout=="function"?setTimeout:void 0,z_=typeof clearTimeout=="function"?clearTimeout:void 0,$g=typeof Promise=="function"?Promise:void 0,U_=typeof queueMicrotask=="function"?queueMicrotask:typeof $g<"u"?function(e){return $g.resolve(null).then(e).catch(H_)}:Vg;function H_(e){setTimeout(function(){throw e})}function fi(e){return e==="head"}function Qg(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")ho(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ho(n);for(var f=n.firstChild;f;){var b=f.nextSibling,j=f.nodeName;f[Qt]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&ho(e.ownerDocument.body);n=u}while(n);ec(t)}function Kg(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 fh(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":fh(n),el(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function B_(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[Qt])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=ss(e.nextSibling),e===null)break}return null}function I_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ss(e.nextSibling),e===null))return null;return e}function Zg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ss(e.nextSibling),e===null))return null;return e}function dh(e){return e.data==="$?"||e.data==="$~"}function hh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function q_(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 ss(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 ph=null;function Fg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ss(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Jg(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 Wg(e,t,n){switch(t=Gu(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 ho(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);el(e)}var as=new Map,Pg=new Set;function Yu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ea=ce.d;ce.d={f:G_,r:Y_,D:X_,C:V_,L:$_,m:Q_,X:Z_,S:K_,M:F_};function G_(){var e=Ea.f(),t=Ou();return e||t}function Y_(e){var t=hn(e);t!==null&&t.tag===5&&t.type==="form"?gm(t):Ea.r(e)}var Jr=typeof document>"u"?null:document;function eb(e,t,n){var a=Jr;if(a&&typeof t=="string"&&t){var u=mn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Pg.has(u)||(Pg.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),al(t,"link",e),zt(t),a.head.appendChild(t)))}}function X_(e){Ea.D(e),eb("dns-prefetch",e,null)}function V_(e,t){Ea.C(e,t),eb("preconnect",e,t)}function $_(e,t,n){Ea.L(e,t,n);var a=Jr;if(a&&e&&t){var u='link[rel="preload"][as="'+mn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+mn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+mn(n.imageSizes)+'"]')):u+='[href="'+mn(e)+'"]';var f=u;switch(t){case"style":f=Wr(e);break;case"script":f=Pr(e)}as.has(f)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),as.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(po(f))||t==="script"&&a.querySelector(mo(f))||(t=a.createElement("link"),al(t,"link",e),zt(t),a.head.appendChild(t)))}}function Q_(e,t){Ea.m(e,t);var n=Jr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+mn(a)+'"][href="'+mn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Pr(e)}if(!as.has(f)&&(e=S({rel:"modulepreload",href:e},t),as.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(mo(f)))return}a=n.createElement("link"),al(a,"link",e),zt(a),n.head.appendChild(a)}}}function K_(e,t,n){Ea.S(e,t,n);var a=Jr;if(a&&e){var u=pn(a).hoistableStyles,f=Wr(e);t=t||"default";var b=u.get(f);if(!b){var j={loading:0,preload:null};if(b=a.querySelector(po(f)))j.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=as.get(f))&&mh(e,n);var M=b=a.createElement("link");zt(M),al(M,"link",e),M._p=new Promise(function(Q,se){M.onload=Q,M.onerror=se}),M.addEventListener("load",function(){j.loading|=1}),M.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Xu(b,t,a)}b={type:"stylesheet",instance:b,count:1,state:j},u.set(f,b)}}}function Z_(e,t){Ea.X(e,t);var n=Jr;if(n&&e){var a=pn(n).hoistableScripts,u=Pr(e),f=a.get(u);f||(f=n.querySelector(mo(u)),f||(e=S({src:e,async:!0},t),(t=as.get(u))&&gh(e,t),f=n.createElement("script"),zt(f),al(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function F_(e,t){Ea.M(e,t);var n=Jr;if(n&&e){var a=pn(n).hoistableScripts,u=Pr(e),f=a.get(u);f||(f=n.querySelector(mo(u)),f||(e=S({src:e,async:!0,type:"module"},t),(t=as.get(u))&&gh(e,t),f=n.createElement("script"),zt(f),al(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function tb(e,t,n,a){var u=(u=ve.current)?Yu(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=pn(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=pn(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(po(e)))&&!f._p&&(b.instance=f,b.state.loading=5),as.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},as.set(e,n),f||J_(u,e,n,b.state))),t&&a===null)throw Error(c(528,""));return b}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pr(n),n=pn(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="'+mn(e)+'"'}function po(e){return'link[rel="stylesheet"]['+e+"]"}function nb(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function J_(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),al(t,"link",n),zt(t),e.head.appendChild(t))}function Pr(e){return'[src="'+mn(e)+'"]'}function mo(e){return"script[async]"+e}function lb(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+mn(n.href)+'"]');if(a)return t.instance=a,zt(a),a;var u=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),zt(a),al(a,"style",u),Xu(a,n.precedence,e),t.instance=a;case"stylesheet":u=Wr(n.href);var f=e.querySelector(po(u));if(f)return t.state.loading|=4,t.instance=f,zt(f),f;a=nb(n),(u=as.get(u))&&mh(a,u),f=(e.ownerDocument||e).createElement("link"),zt(f);var b=f;return b._p=new Promise(function(j,M){b.onload=j,b.onerror=M}),al(f,"link",a),t.state.loading|=4,Xu(f,n.precedence,e),t.instance=f;case"script":return f=Pr(n.src),(u=e.querySelector(mo(f)))?(t.instance=u,zt(u),u):(a=n,(u=as.get(f))&&(a=S({},n),gh(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),zt(u),al(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Xu(a,n.precedence,e));return t.instance}function Xu(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,b=0;b<a.length;b++){var j=a[b];if(j.dataset.precedence===t)f=j;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 mh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function gh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vu=null;function sb(e,t,n){if(Vu===null){var a=new Map,u=Vu=new Map;u.set(n,a)}else u=Vu,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[Qt]||f[et]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var j=a.get(b);j?j.push(f):a.set(b,[f])}}return a}function ab(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function W_(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 ib(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function P_(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(po(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=$u.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,zt(f);return}f=t.ownerDocument||t,a=nb(a),(u=as.get(u))&&mh(a,u),f=f.createElement("link"),zt(f);var b=f;b._p=new Promise(function(j,M){b.onload=j,b.onerror=M}),al(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=$u.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var bh=0;function e0(e,t){return e.stylesheets&&e.count===0&&Ku(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&bh===0&&(bh=62500*O_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>bh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function $u(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qu=null;function Ku(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qu=new Map,t.forEach(t0,e),Qu=null,$u.call(e))}function t0(e,t){if(!(t.state.loading&4)){var n=Qu.get(e);if(n)var a=n.get(null);else{n=new Map,Qu.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),a=b)}a&&n.set(null,a)}u=t.instance,b=u.getAttribute("data-precedence"),f=n.get(b)||a,f===a&&n.set(null,u),n.set(b,u),this.count++,a=$u.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 go={$$typeof:G,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function n0(e,t,n,a,u,f,b,j,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function rb(e,t,n,a,u,f,b,j,M,Q,se,oe){return e=new n0(e,t,n,b,M,Q,se,oe,j),t=1,f===!0&&(t|=24),f=pl(3,null,null,t),e.current=f,f.stateNode=e,t=Vi(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},ed(f),e}function cb(e){return e?(e=Qa,e):Qa}function ob(e,t,n,a,u,f){u=cb(u),a.context===null?a.context=u:a.pendingContext=u,a=ei(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=ti(e,a,t),n!==null&&(Dl(n,e,t),Qc(n,e,t))}function ub(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xh(e,t){ub(e,t),(e=e.alternate)&&ub(e,t)}function fb(e){if(e.tag===13||e.tag===31){var t=da(e,67108864);t!==null&&Dl(t,e,67108864),xh(e,67108864)}}function db(e){if(e.tag===13||e.tag===31){var t=$l();t=Wn(t);var n=da(e,t);n!==null&&Dl(n,e,t),xh(e,t)}}var Zu=!0;function l0(e,t,n,a){var u=A.T;A.T=null;var f=ce.p;try{ce.p=2,yh(e,t,n,a)}finally{ce.p=f,A.T=u}}function s0(e,t,n,a){var u=A.T;A.T=null;var f=ce.p;try{ce.p=8,yh(e,t,n,a)}finally{ce.p=f,A.T=u}}function yh(e,t,n,a){if(Zu){var u=_h(a);if(u===null)ah(e,t,a,Fu,n),pb(e,a);else if(i0(u,e,t,n,a))a.stopPropagation();else if(pb(e,a),t&4&&-1<a0.indexOf(e)){for(;u!==null;){var f=hn(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=_e(f.pendingLanes);if(b!==0){var j=f;for(j.pendingLanes|=2,j.entangledLanes|=2;b;){var M=1<<31-Je(b);j.entanglements[1]|=M,b&=~M}Xs(f),(yt&6)===0&&(Mu=nt()+500,oo(0))}}break;case 31:case 13:j=da(f,2),j!==null&&Dl(j,f,2),Ou(),xh(f,2)}if(f=_h(a),f===null&&ah(e,t,a,Fu,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else ah(e,t,a,null,n)}}function _h(e){return e=ft(e),vh(e)}var Fu=null;function vh(e){if(Fu=null,e=vt(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=p(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 Fu=e,null}function hb(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(wt()){case $t:return 2;case rn:return 8;case kt:case vn:return 32;case It:return 268435456;default:return 32}default:return 32}}var jh=!1,di=null,hi=null,pi=null,bo=new Map,xo=new Map,mi=[],a0="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 pb(e,t){switch(e){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":bo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xo.delete(t.pointerId)}}function yo(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=hn(t),t!==null&&fb(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function i0(e,t,n,a,u){switch(t){case"focusin":return di=yo(di,e,t,n,a,u),!0;case"dragenter":return hi=yo(hi,e,t,n,a,u),!0;case"mouseover":return pi=yo(pi,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return bo.set(f,yo(bo.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,xo.set(f,yo(xo.get(f)||null,e,t,n,a,u)),!0}return!1}function mb(e){var t=vt(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,cn(e.priority,function(){db(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,cn(e.priority,function(){db(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 Ju(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_h(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);We=a,n.target.dispatchEvent(a),We=null}else return t=hn(n),t!==null&&fb(t),e.blockedOn=n,!1;t.shift()}return!0}function gb(e,t,n){Ju(e)&&n.delete(t)}function r0(){jh=!1,di!==null&&Ju(di)&&(di=null),hi!==null&&Ju(hi)&&(hi=null),pi!==null&&Ju(pi)&&(pi=null),bo.forEach(gb),xo.forEach(gb)}function Wu(e,t){e.blockedOn===t&&(e.blockedOn=null,jh||(jh=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,r0)))}var Pu=null;function bb(e){Pu!==e&&(Pu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Pu===e&&(Pu=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(vh(a||n)===null)continue;break}var f=hn(n);f!==null&&(e.splice(t,3),t-=3,_d(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function ec(e){function t(M){return Wu(M,e)}di!==null&&Wu(di,e),hi!==null&&Wu(hi,e),pi!==null&&Wu(pi,e),bo.forEach(t),xo.forEach(t);for(var n=0;n<mi.length;n++){var a=mi[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<mi.length&&(n=mi[0],n.blockedOn===null);)mb(n),n.blockedOn===null&&mi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],b=u[Me]||null;if(typeof f=="function")b||bb(n);else if(b){var j=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Me]||null)j=b.formAction;else if(vh(u)!==null)continue}else j=b.action;typeof j=="function"?n[a+1]=j:(n.splice(a,3),a-=3),bb(n)}}}function xb(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Sh(e){this._internalRoot=e}ef.prototype.render=Sh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=$l();ob(n,a,e,t,null,null)},ef.prototype.unmount=Sh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ob(e.current,2,null,e,null,null),Ou(),t[nn]=null}};function ef(e){this._internalRoot=e}ef.prototype.unstable_scheduleHydration=function(e){if(e){var t=tn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<mi.length&&t!==0&&t<mi[n].priority;n++);mi.splice(n,0,e),n===0&&mb(e)}};var yb=l.version;if(yb!=="19.2.8")throw Error(c(527,yb,"19.2.8"));ce.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var c0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tf.isDisabled&&tf.supportsFiber)try{qt=tf.inject(c0),rt=tf}catch{}}return vo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Nm,f=Tm,b=Em;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=rb(e,1,!1,null,null,n,a,null,u,f,b,xb),e[nn]=t.current,sh(e),new Sh(t)},vo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Nm,b=Tm,j=Em,M=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(M=n.formState)),t=rb(e,1,!0,t,n??null,a,u,M,f,b,j,xb),t.context=cb(null),n=t.current,a=$l(),a=Wn(a),u=ei(a),u.callback=null,ti(n,u,a),n=a,t.current.lanes=n,Jn(t,n),Xs(t),e[nn]=t.current,sh(e),new ef(t)},vo.version="19.2.8",vo}var Cb;function _0(){if(Cb)return Th.exports;Cb=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Th.exports=y0(),Th.exports}var v0=_0();const Wx=1;var Ra,pc,mc,gc,bc,Uo,xc,zf,Px;class j0{constructor(l){on(this,zf);on(this,Ra,null);on(this,pc,new Set);on(this,mc,500);on(this,gc,null);on(this,bc,!1);on(this,Uo,null);on(this,xc,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){_t(this,xc,l)}connect(){if(Ye(this,bc))return;const l=new WebSocket(this.url);_t(this,Ra,l),l.addEventListener("open",()=>{var r,c;_t(this,mc,500),this.send({type:"hello",protocol:Wx,clientName:"ccv-web"}),(r=Ye(this,Uo))==null||r.call(this),(c=Ye(this,xc))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ye(this,pc))o(c)}),l.addEventListener("close",()=>{var r;_t(this,Ra,null),(r=Ye(this,xc))==null||r.call(this),Dn(this,zf,Px).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){_t(this,Uo,l)}on(l){return Ye(this,pc).add(l),()=>Ye(this,pc).delete(l)}send(l){var r;((r=Ye(this,Ra))==null?void 0:r.readyState)===WebSocket.OPEN&&Ye(this,Ra).send(JSON.stringify(l))}get connected(){var l;return((l=Ye(this,Ra))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;_t(this,bc,!0),(l=Ye(this,Ra))==null||l.close()}}Ra=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,bc=new WeakMap,Uo=new WeakMap,xc=new WeakMap,zf=new WeakSet,Px=function(){if(Ye(this,bc)||Ye(this,gc)!==null)return;const l=Ye(this,mc);_t(this,mc,Math.min(l*2,1e4)),_t(this,gc,window.setTimeout(()=>{_t(this,gc,null),this.connect()},l))};const S0=1,ey="ccv:relay",Sf="ccv:relay.host";function w0(){try{const s=localStorage.getItem(ey);if(!s)return null;const l=JSON.parse(s);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function ty(){localStorage.removeItem(ey)}var Ws,yc,Ps,_c,vc,wi,ir,rr,ki,cr,jc,or,ur,Ft,yi,Jh,ny,lr,Wh;class k0{constructor(l){on(this,Ft);on(this,Ws,null);on(this,yc,new Set);on(this,Ps,null);on(this,_c,null);on(this,vc,500);on(this,wi,null);on(this,ir,!1);on(this,rr,!1);on(this,ki,!1);on(this,cr,null);on(this,jc,"Подключаемся…");on(this,or,0);on(this,ur,[]);this.session=l}get connected(){return Ye(this,rr)&&Ye(this,ki)}get statusText(){return Ye(this,jc)}get hostId(){return Ye(this,cr)}on(l){return Ye(this,yc).add(l),()=>Ye(this,yc).delete(l)}onReconnect(l){_t(this,_c,l)}onStatus(l){_t(this,Ps,l)}connect(){Ye(this,ir)||Dn(this,Ft,Jh).call(this)}send(l){if(!Ye(this,rr)){Ye(this,ur).length<64&&Ye(this,ur).push(l);return}Dn(this,Ft,lr).call(this,{t:"client.frame",body:l})}close(){var l;_t(this,ir,!0),Ye(this,wi)!==null&&window.clearTimeout(Ye(this,wi)),(l=Ye(this,Ws))==null||l.close()}}Ws=new WeakMap,yc=new WeakMap,Ps=new WeakMap,_c=new WeakMap,vc=new WeakMap,wi=new WeakMap,ir=new WeakMap,rr=new WeakMap,ki=new WeakMap,cr=new WeakMap,jc=new WeakMap,or=new WeakMap,ur=new WeakMap,Ft=new WeakSet,yi=function(l){var r;Ye(this,jc)!==l&&(_t(this,jc,l),(r=Ye(this,Ps))==null||r.call(this))},Jh=async function(){if(Ye(this,Ws))return;if(!Ye(this,cr))try{_t(this,cr,await N0(this.session.token))}catch(c){Dn(this,Ft,yi).call(this,c instanceof Error?c.message:String(c)),Dn(this,Ft,Wh).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);_t(this,Ws,r),r.addEventListener("open",()=>{Dn(this,Ft,lr).call(this,{t:"client.hello",protocol:S0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Dn(this,Ft,ny).call(this,o)}),r.addEventListener("close",()=>{var c;_t(this,Ws,null),_t(this,rr,!1),_t(this,ki,!1),Dn(this,Ft,yi).call(this,"Нет связи с сервером"),(c=Ye(this,Ps))==null||c.call(this),Dn(this,Ft,Wh).call(this)}),r.addEventListener("error",()=>r.close())},ny=function(l){var r,c,o,d,h,p,g;switch(l.t){case"client.ok":_t(this,vc,500),Dn(this,Ft,lr).call(this,{t:"client.attach",hostId:Ye(this,cr)??"",...Ye(this,or)>0?{sinceRseq:Ye(this,or)}:{}});return;case"client.attached":_t(this,rr,!0),_t(this,ki,l.online),_t(this,or,l.rseq),Dn(this,Ft,yi).call(this,l.online?"Хост на связи":"Компьютер не на связи"),Dn(this,Ft,lr).call(this,{t:"client.frame",body:{type:"hello",protocol:Wx,clientName:"ccv-web-relay"}});const x=Ye(this,ur);_t(this,ur,[]);for(const _ of x)Dn(this,Ft,lr).call(this,{t:"client.frame",body:_});(r=Ye(this,_c))==null||r.call(this),(c=Ye(this,Ps))==null||c.call(this);return;case"host.frame":{l.rseq>0&&_t(this,or,l.rseq);const _=l.body;for(const S of Ye(this,yc))S(_);return}case"host.online":_t(this,ki,!0),Dn(this,Ft,yi).call(this,"Хост на связи"),(o=Ye(this,_c))==null||o.call(this),(d=Ye(this,Ps))==null||d.call(this);return;case"host.offline":_t(this,ki,!1),Dn(this,Ft,yi).call(this,"Компьютер не на связи"),(h=Ye(this,Ps))==null||h.call(this);return;case"ping":Dn(this,Ft,lr).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){ty(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Sf),Dn(this,Ft,yi).call(this,"Этот компьютер отвязан от аккаунта"),_t(this,ir,!0),(p=Ye(this,Ws))==null||p.close();return}l.code!=="offline"&&Dn(this,Ft,yi).call(this,l.message),(g=Ye(this,Ps))==null||g.call(this);return}},lr=function(l){var r;((r=Ye(this,Ws))==null?void 0:r.readyState)===WebSocket.OPEN&&Ye(this,Ws).send(JSON.stringify(l))},Wh=function(){if(Ye(this,ir)||Ye(this,wi)!==null)return;const l=Ye(this,vc);_t(this,vc,Math.min(l*2,1e4)),_t(this,wi,window.setTimeout(()=>{_t(this,wi,null),Dn(this,Ft,Jh).call(this)},l))};async function N0(s){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Sf,l),l;const r=localStorage.getItem(Sf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${s}`}});if(c.status===401)throw ty(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Sf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function wf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const T0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function E0(){if(wf()==="local")return new j0(T0);const s=w0();return s?new k0(s):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const ly="ccv:drafts",A0=40,C0=2e4,R0=500;let Mo=null,Do=null;function hp(){if(Mo)return Mo;const s=new Map;try{const l=localStorage.getItem(ly);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&s.set(c,o)}}catch{}return Mo=s,window.addEventListener("pagehide",iy),s}function Rh(s){return hp().get(s)??""}function sy(s,l){const r=hp(),c=l.slice(0,C0),o=r.has(s);if(o&&r.delete(s),c!=="")r.set(s,c);else if(!o)return;for(;r.size>A0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}O0(),D0()}function ay(){const s=new Set;for(const l of hp().keys())s.add(l.startsWith("side:")?l.slice(5):l);return[...s].sort()}const Ph=new Set;let Rb="";function M0(s){return Ph.add(s),()=>Ph.delete(s)}function D0(){const s=ay(),l=s.join(`
|
|
51
|
+
`);if(l!==Rb){Rb=l;for(const r of Ph)r(s)}}function O0(){Do===null&&(Do=window.setTimeout(iy,R0))}function iy(){if(Do!==null&&window.clearTimeout(Do),Do=null,!!Mo)try{localStorage.setItem(ly,JSON.stringify(Object.fromEntries(Mo)))}catch{}}const bl={items:[],pending:[],lastSeq:0,contextTokens:null},Mh={entries:[],total:0,loading:!1};function ry(s){var l;return((l=s.entries[0])==null?void 0:l.seq)??1}function Mb(s){return s.total>0&&ry(s)>1}function L0(s,l){const r=new Set(s.entries.map(o=>o.seq));return{entries:[...s.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function z0(s){return kf(bl,s).items.map(l=>({...l,id:`h:${l.id}`}))}function kf(s,l){let r=s;for(const c of l)c.seq<=r.lastSeq||(r={...U0(r,c.event,c.seq),lastSeq:c.seq});return r}function U0(s,l,r){var o,d;const c=s.items;switch(l.kind){case"user.message":return Vs(s,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return Vs(s,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return tc(s,h,{...p,text:p.text+l.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===l.blockId),p={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?Vs(s,p):tc(s,h,p)}case"thinking.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return Vs(s,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return tc(s,h,{...p,text:p.text+l.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===l.blockId),p={id:l.blockId,kind:"thinking",text:l.text};return h===-1?Vs(s,p):tc(s,h,p)}case"tool.use":return Vs(s,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===l.toolUseId);if(h===-1)return s;const p=c[h];return tc(s,h,{...p,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...s,pending:[...s.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=s.pending.find(g=>g.requestId===l.requestId),p=s.pending.filter(g=>g.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return tc({...s,pending:p},g,{...x,answers:l.answers})}}return l.decision==="allow"?{...s,pending:p}:Vs({...s,pending:p},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=s.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),p=l.contextTokens??s.contextTokens;return Vs({...s,items:h,contextTokens:p},{id:`r${r}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?s:Vs(s,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Vs(s,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return s;case"rewound":return s;default:return s}}function H0(s,l){let r=0;for(let c=0;c<s.length;c++)if(s[c].event.kind==="user.message"){if(r===l)return s.slice(0,c);r++}return s}function B0(s,l,r){const c=l-r;if(c<=0)return[];let o=0;for(let d=0;d<s.length;d++)if(s[d].kind==="user"){if(o===c)return s.slice(0,d);o++}return s}function Vs(s,l){return{...s,items:[...s.items,l]}}function tc(s,l,r){const c=s.items.slice();return c[l]=r,{...s,items:c}}const ep="ccv:theme",Dh=["system","light","dark"];function I0(){const[s,l]=y.useState(q0);y.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=s==="dark"||s==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[s]);const r=y.useCallback(o=>{try{localStorage.setItem(ep,o)}catch{}l(o)},[]),c=y.useCallback(()=>{l(o=>{const d=Dh[(Dh.indexOf(o)+1)%Dh.length];try{localStorage.setItem(ep,d)}catch{}return d})},[]);return[s,r,c]}function q0(){try{const s=localStorage.getItem(ep);if(s==="light"||s==="dark"||s==="system")return s}catch{}return"system"}const cy=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],G0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],fr={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:"вопроса"}},Y0=320,oy="ccv:panes";function X0(s){return`--${s}-w`}function uy(s,l){const r=fr[s];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function V0(){const s={};for(const l of Object.keys(fr))s[l]=fr[l].width;try{const l=localStorage.getItem(oy);if(l){const r=JSON.parse(l);for(const c of Object.keys(fr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(s[c]=uy(c,o))}}}catch{}return s}function $0(){const[s,l]=y.useState(V0),r=y.useCallback(h=>{try{localStorage.setItem(oy,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,p)=>{l(g=>{const x=uy(h,p);if(g[h]===x)return g;const _={...g,[h]:x};return r(_),_})},[r]),o=y.useCallback(h=>{l(p=>{const g={...p,[h]:fr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(fr))d[X0(h)]=`${s[h]}px`;return{widths:s,style:d,setWidth:c,reset:o}}const Oh=260,fy=120,Q0=200,Db="ccv:terminal-h";function Ob(s,l){return Math.round(Math.min(l,Math.max(fy,s)))}function K0(){const[s,l]=y.useState(()=>{try{const d=localStorage.getItem(Db);if(d){const h=Number(d);if(Number.isFinite(h))return Ob(h,1/0)}}catch{}return Oh}),r=y.useCallback(d=>{try{localStorage.setItem(Db,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const p=Ob(d,h);l(g=>g===p?g:(r(p),p))},[r]),o=y.useCallback(()=>{l(Oh),r(Oh)},[r]);return{height:s,setHeight:c,reset:o}}function Uf(s){const[l,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(s).matches);return y.useEffect(()=>{const c=window.matchMedia(s),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[s]),l}const Z0={height:0,offsetTop:0,offsetLeft:0};function Lb(){if(typeof window>"u")return Z0;const s=window.visualViewport;return s?{height:s.height,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function F0(s){const[l,r]=y.useState(Lb);return y.useEffect(()=>{if(!s)return;const c=window.visualViewport,o=()=>{const d=Lb();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))},[s]),l}function pp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mr=pp();function dy(s){mr=s}var sr={exec:()=>null};function nc(s){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=s(c),l[c]=o),o}}function ht(s,l=""){let r=typeof s=="string"?s:s.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(ol.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var J0=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}catch{return!1}})(),ol={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:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:nc(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:nc(s=>new RegExp(`^ {0,${s}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:nc(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:nc(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:nc(s=>new RegExp(`^ {0,${s}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:nc(s=>new RegExp(`^ {0,${s}}>`))},W0=/^(?:[ \t]*(?:\n|$))+/,P0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ev=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ho=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,hy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,py=ht(hy).replace(/bull/g,mp).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(),nv=ht(hy).replace(/bull/g,mp).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(),gp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,lv=/^[^\n]+/,bp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sv=ht(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),av=ht(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,mp).getRegex(),Hf="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",xp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,iv=ht("^ {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",xp).replace("tag",Hf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),my=s=>ht(gp).replace("hr",Ho).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",s).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hf).getRegex(),rv=my(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),cv=my(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ov=ht(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cv).getRegex(),yp={blockquote:ov,code:P0,def:sv,fences:ev,heading:tv,hr:Ho,html:iv,lheading:py,list:av,newline:W0,paragraph:rv,table:sr,text:lv},zb=ht("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ho).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",Hf).getRegex(),uv={...yp,lheading:nv,table:zb,paragraph:ht(gp).replace("hr",Ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",zb).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",Hf).getRegex()},fv={...yp,html:ht(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xp).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:sr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ht(gp).replace("hr",Ho).replace("heading",` *#{1,6} *[^
|
|
52
|
+
]`).replace("lheading",py).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gy=/^( {2,}|\\)\n(?!\s*$)/,pv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wc=/[\p{P}\p{S}]/u,Bf=/[\s\p{P}\p{S}]/u,_p=/[^\s\p{P}\p{S}]/u,mv=ht(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bf).getRegex(),by=/(?!~)[\p{P}\p{S}]/u,gv=/(?!~)[\s\p{P}\p{S}]/u,bv=/(?:[^\s\p{P}\p{S}]|~)/u,xv=ht(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",J0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,yv=ht(xy,"u").replace(/punct/g,wc).getRegex(),_v=ht(xy,"u").replace(/punct/g,by).getRegex(),yy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vv=ht(yy,"gu").replace(/notPunctSpace/g,_p).replace(/punctSpace/g,Bf).replace(/punct/g,wc).getRegex(),jv=ht(yy,"gu").replace(/notPunctSpace/g,bv).replace(/punctSpace/g,gv).replace(/punct/g,by).getRegex(),Sv=ht("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_p).replace(/punctSpace/g,Bf).replace(/punct/g,wc).getRegex(),wv=ht(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,wc).getRegex(),kv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Nv=ht(kv,"gu").replace(/notPunctSpace/g,_p).replace(/punctSpace/g,Bf).replace(/punct/g,wc).getRegex(),Tv=ht(/\\(punct)/,"gu").replace(/punct/g,wc).getRegex(),Ev=ht(/^<(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(),Av=ht(xp).replace("(?:-->|$)","-->").getRegex(),Cv=ht("^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",Av).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ef=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Rv=ht(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ef).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_y=ht(/^!?\[(label)\]\[(ref)\]/).replace("label",Ef).replace("ref",bp).getRegex(),vy=ht(/^!?\[(ref)\](?:\[\])?/).replace("ref",bp).getRegex(),Mv=ht("reflink|nolink(?!\\()","g").replace("reflink",_y).replace("nolink",vy).getRegex(),Ub=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vp={_backpedal:sr,anyPunctuation:Tv,autolink:Ev,blockSkip:xv,br:gy,code:hv,del:sr,delLDelim:sr,delRDelim:sr,emStrongLDelim:yv,emStrongRDelimAst:vv,emStrongRDelimUnd:Sv,escape:dv,link:Rv,nolink:vy,punctuation:mv,reflink:_y,reflinkSearch:Mv,tag:Cv,text:pv,url:sr},Dv={...vp,link:ht(/^!?\[(label)\]\((.*?)\)/).replace("label",Ef).getRegex(),reflink:ht(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ef).getRegex()},tp={...vp,emStrongRDelimAst:jv,emStrongLDelim:_v,delLDelim:wv,delRDelim:Nv,url:ht(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ub).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:ht(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ub).getRegex()},Ov={...tp,br:ht(gy).replace("{2,}","*").getRegex(),text:ht(tp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},nf={normal:yp,gfm:uv,pedantic:fv},jo={normal:vp,gfm:tp,breaks:Ov,pedantic:Dv},Lv={"&":"&","<":"<",">":">",'"':""","'":"'"},Hb=s=>Lv[s];function Zs(s,l){if(l){if(ol.escapeTest.test(s))return s.replace(ol.escapeReplace,Hb)}else if(ol.escapeTestNoEncode.test(s))return s.replace(ol.escapeReplaceNoEncode,Hb);return s}function Bb(s){try{s=encodeURI(s).replace(ol.percentDecode,"%")}catch{return null}return s}function Ib(s,l){var d;let r=s.replace(ol.findPipe,(h,p,g)=>{let x=!1,_=p;for(;--_>=0&&g[_]==="\\";)x=!x;return x?"|":" |"}),c=r.split(ol.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(ol.slashPipe,"|");return c}function bi(s,l,r){let c=s.length;if(c===0)return"";let o=0;for(;o<c&&s.charAt(c-o-1)===l;)o++;return s.slice(0,c-o)}function qb(s){let l=s.split(`
|
|
53
|
+
`),r=l.length-1;for(;r>=0&&ol.blankLine.test(l[r]);)r--;return l.length-r<=2?s:l.slice(0,r+1).join(`
|
|
54
|
+
`)}function zv(s,l){if(s.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<s.length;c++)if(s[c]==="\\")c++;else if(s[c]===l[0])r++;else if(s[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function Uv(s,l=0){let r=l,c="";for(let o of s)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Gb(s,l,r,c,o){let d=l.href,h=l.title||null,p=s[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:s[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,g}function Hv(s,l,r){let c=s.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
55
|
+
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[p]=h;return p.length>=o.length?d.slice(o.length):d}).join(`
|
|
56
|
+
`)}var Af=class{constructor(s){Ot(this,"options");Ot(this,"rules");Ot(this,"lexer");this.options=s||mr}space(s){let l=this.rules.block.newline.exec(s);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(s){let l=this.rules.block.code.exec(s);if(l){let r=this.options.pedantic?l[0]:qb(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(s){let l=this.rules.block.fences.exec(s);if(l){let r=l[0],c=Hv(r,l[3]||"",this.rules);return{type:"code",raw:r,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(s){let l=this.rules.block.heading.exec(s);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=bi(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:bi(l[0],`
|
|
57
|
+
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(s){let l=this.rules.block.hr.exec(s);if(l)return{type:"hr",raw:bi(l[0],`
|
|
58
|
+
`)}}blockquote(s){let l=this.rules.block.blockquote.exec(s);if(l){let r=bi(l[0],`
|
|
59
|
+
`).split(`
|
|
60
|
+
`),c="",o="",d=[];for(;r.length>0;){let h=!1,p=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))p.push(r[g]),h=!0;else if(!h)p.push(r[g]);else break;r=r.slice(g);let x=p.join(`
|
|
61
|
+
`),_=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
+
${x}`:x,o=o?`${o}
|
|
64
|
+
${_}`:_;let S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,d,!0),this.lexer.state.top=S,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 E=v,T=E.raw+`
|
|
65
|
+
`+r.join(`
|
|
66
|
+
`),R=this.blockquote(T);d[d.length-1]=R,c=c.substring(0,c.length-E.raw.length)+R.raw,o=o.substring(0,o.length-E.text.length)+R.text;break}else if((v==null?void 0:v.type)==="list"){let E=v,T=E.raw+`
|
|
67
|
+
`+r.join(`
|
|
68
|
+
`),R=this.list(T);d[d.length-1]=R,c=c.substring(0,c.length-v.raw.length)+R.raw,o=o.substring(0,o.length-E.raw.length)+R.raw,r=T.substring(d.at(-1).raw.length).split(`
|
|
69
|
+
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(s){let l=this.rules.block.list.exec(s);if(l){let r=l[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;s;){let g=!1,x="",_="";if(!(l=d.exec(s))||this.rules.block.hr.test(s))break;x=l[0],s=s.substring(x.length);let S=Uv(l[2].split(`
|
|
70
|
+
`,1)[0],l[1].length),v=s.split(`
|
|
71
|
+
`,1)[0],E=!S.trim(),T=0;if(this.options.pedantic?(T=2,_=S.trimStart()):E?T=l[1].length+1:(T=S.search(this.rules.other.nonSpaceChar),T=T>4?1:T,_=S.slice(T),T+=l[1].length),E&&this.rules.other.blankLine.test(v)&&(x+=v+`
|
|
72
|
+
`,s=s.substring(v.length+1),g=!0),!g){let R=this.rules.other.nextBulletRegex(T),z=this.rules.other.hrRegex(T),X=this.rules.other.fencesBeginRegex(T),F=this.rules.other.headingBeginRegex(T),G=this.rules.other.htmlBeginRegex(T),O=this.rules.other.blockquoteBeginRegex(T);for(;s;){let K=s.split(`
|
|
73
|
+
`,1)[0],C;if(v=K,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),C=v):C=v.replace(this.rules.other.tabCharGlobal," "),X.test(v)||F.test(v)||G.test(v)||O.test(v)||R.test(v)||z.test(v))break;if(C.search(this.rules.other.nonSpaceChar)>=T||!v.trim())_+=`
|
|
74
|
+
`+C.slice(T);else{if(E||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||X.test(S)||F.test(S)||z.test(S))break;_+=`
|
|
75
|
+
`+v}E=!v.trim(),x+=K+`
|
|
76
|
+
`,s=s.substring(K.length+1),S=C.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=x}let p=o.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let S=this.lexer.inlineQueue.length-1;S>=0;S--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[S].src)){this.lexer.inlineQueue[S].src=this.lexer.inlineQueue[S].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(g.raw);if(_){let S={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};g.checked=S.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=S.raw+g.tokens[0].raw,g.tokens[0].text=S.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(S)):g.tokens.unshift({type:"paragraph",raw:S.raw,text:S.raw,tokens:[S]}):g.tokens.unshift(S)}}else g.task&&(g.task=!1);if(!o.loose){let _=g.tokens.filter(v=>v.type==="space"),S=_.length>0&&_.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=S}}if(o.loose)for(let g of o.items){g.loose=!0;for(let x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(s){let l=this.rules.block.html.exec(s);if(l){let r=qb(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(s){let l=this.rules.block.def.exec(s);if(l){let r=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:r,raw:bi(l[0],`
|
|
77
|
+
`),href:c,title:o}}}table(s){var h;let l=this.rules.block.table.exec(s);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=Ib(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
+
`):[],d={type:"table",raw:bi(l[0],`
|
|
79
|
+
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let p of c)this.rules.other.tableAlignRight.test(p)?d.align.push("right"):this.rules.other.tableAlignCenter.test(p)?d.align.push("center"):this.rules.other.tableAlignLeft.test(p)?d.align.push("left"):d.align.push(null);for(let p=0;p<r.length;p++)d.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:d.align[p]});for(let p of o)d.rows.push(Ib(p,d.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[x]})));return d}}lheading(s){let l=this.rules.block.lheading.exec(s);if(l){let r=l[1].trim();return{type:"heading",raw:bi(l[0],`
|
|
80
|
+
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(s){let l=this.rules.block.paragraph.exec(s);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
81
|
+
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(s){let l=this.rules.block.text.exec(s);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(s){let l=this.rules.inline.escape.exec(s);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(s){let l=this.rules.inline.tag.exec(s);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(s){let l=this.rules.inline.link.exec(s);if(l){let r=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=bi(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=zv(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Gb(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(s,l){let r;if((r=this.rules.inline.reflink.exec(s))||(r=this.rules.inline.nolink.exec(s))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Gb(r,o,r[0],this.lexer,this.rules)}}emStrong(s,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(s);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,p=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*s.length+o);(c=x.exec(l))!==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]){p+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p+g);let _=[...c[0]][0].length,S=s.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let E=S.slice(1,-1);return{type:"em",raw:S,text:E,tokens:this.lexer.inlineTokens(E)}}let v=S.slice(2,-2);return{type:"strong",raw:S,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(s){let l=this.rules.inline.code.exec(s);if(l){let r=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:l[0],text:r}}}br(s){let l=this.rules.inline.br.exec(s);if(l)return{type:"br",raw:l[0]}}del(s,l,r=""){let c=this.rules.inline.delLDelim.exec(s);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,p=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,l=l.slice(-1*s.length+o);(c=g.exec(l))!==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]){p+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p);let x=[...c[0]][0].length,_=s.slice(0,o+c.index+x+h),S=_.slice(o,-o);return{type:"del",raw:_,text:S,tokens:this.lexer.inlineTokens(S)}}}}autolink(s){let l=this.rules.inline.autolink.exec(s);if(l){let r,c;return l[2]==="@"?(r=l[1],c="mailto:"+r):(r=l[1],c=r),{type:"link",raw:l[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(s){var r;let l;if(l=this.rules.inline.url.exec(s)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((r=this.rules.inline._backpedal.exec(l[0]))==null?void 0:r[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(s){let l=this.rules.inline.text.exec(s);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},Ns=class np{constructor(l){Ot(this,"tokens");Ot(this,"options");Ot(this,"state");Ot(this,"inlineQueue");Ot(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||mr,this.options.tokenizer=this.options.tokenizer||new Af,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ol,block:nf.normal,inline:jo.normal};this.options.pedantic?(r.block=nf.pedantic,r.inline=jo.pedantic):this.options.gfm&&(r.block=nf.gfm,this.options.breaks?r.inline=jo.breaks:r.inline=jo.gfm),this.tokenizer.rules=r}static get rules(){return{block:nf,inline:jo}}static lex(l,r){return new np(r).lex(l)}static lexInline(l,r){return new np(r).inlineTokens(l)}lex(l){l=l.replace(ol.carriageReturn,`
|
|
82
|
+
`),this.blockTokens(l,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,r=[],c=!1){var d,h,p;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(ol.tabCharGlobal," ").replace(ol.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(_=>(g=_.call({lexer:this},l,r))?(l=l.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(l)){l=l.substring(g.raw.length);let _=r.at(-1);g.raw.length===1&&_!==void 0?_.raw+=`
|
|
83
|
+
`:r.push(g);continue}if(g=this.tokenizer.code(l)){l=l.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(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(l)){l=l.substring(g.raw.length);let _=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(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(l)){l=l.substring(g.raw.length),r.push(g);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let _=1/0,S=l.slice(1),v;this.options.extensions.startBlock.forEach(E=>{v=E.call({lexer:this},S),typeof v=="number"&&v>=0&&(_=Math.min(_,v))}),_<1/0&&_>=0&&(x=l.substring(0,_+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){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=x.length!==l.length,l=l.substring(g.raw.length);continue}if(g=this.tokenizer.text(l)){l=l.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(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,r}inline(l,r=[]){return this.inlineQueue.push({src:l,tokens:r}),r}inlineTokens(l,r=[]){var p,g,x,_,S;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,E=>v.includes(E.slice(E.lastIndexOf("[")+1,-1))?"["+"a".repeat(E.length-2)+"]":E))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,E,T)=>{let R=T?T.length:0;return v.slice(0,R)+"["+"a".repeat(v.length-R-2)+"]"}),c=((g=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((_=(x=this.options.extensions)==null?void 0:x.inline)!=null&&_.some(T=>(v=T.call({lexer:this},l,r))?(l=l.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.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(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),r.push(v);continue}let E=l;if((S=this.options.extensions)!=null&&S.startInline){let T=1/0,R=l.slice(1),z;this.options.extensions.startInline.forEach(X=>{z=X.call({lexer:this},R),typeof z=="number"&&z>=0&&(T=Math.min(T,z))}),T<1/0&&T>=0&&(E=l.substring(0,T+1))}if(v=this.tokenizer.inlineText(E)){l=l.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(l){this.infiniteLoopError(l.charCodeAt(0));break}}return r}infiniteLoopError(l){let r="Infinite loop on byte: "+l;if(this.options.silent)console.error(r);else throw new Error(r)}},Cf=class{constructor(s){Ot(this,"options");Ot(this,"parser");this.options=s||mr}space(s){return""}code({text:s,lang:l,escaped:r}){var d;let c=(d=(l||"").match(ol.notSpaceStart))==null?void 0:d[0],o=s.replace(ol.endingNewline,"")+`
|
|
96
|
+
`;return c?'<pre><code class="language-'+Zs(c)+'">'+(r?o:Zs(o,!0))+`</code></pre>
|
|
97
|
+
`:"<pre><code>"+(r?o:Zs(o,!0))+`</code></pre>
|
|
98
|
+
`}blockquote({tokens:s}){return`<blockquote>
|
|
99
|
+
${this.parser.parse(s)}</blockquote>
|
|
100
|
+
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:l}){return`<h${l}>${this.parser.parseInline(s)}</h${l}>
|
|
101
|
+
`}hr(s){return`<hr>
|
|
102
|
+
`}list(s){let l=s.ordered,r=s.start,c="";for(let h=0;h<s.items.length;h++){let p=s.items[h];c+=this.listitem(p)}let o=l?"ol":"ul",d=l&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
103
|
+
`+c+"</"+o+`>
|
|
104
|
+
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
105
|
+
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
106
|
+
`}table(s){let l="",r="";for(let o=0;o<s.header.length;o++)r+=this.tablecell(s.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<s.rows.length;o++){let d=s.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
|
+
`+l+`</thead>
|
|
109
|
+
`+c+`</table>
|
|
110
|
+
`}tablerow({text:s}){return`<tr>
|
|
111
|
+
${s}</tr>
|
|
112
|
+
`}tablecell(s){let l=this.parser.parseInline(s.tokens),r=s.header?"th":"td";return(s.align?`<${r} align="${s.align}">`:`<${r}>`)+l+`</${r}>
|
|
113
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Zs(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:l,tokens:r}){let c=this.parser.parseInline(r),o=Bb(s);if(o===null)return c;s=o;let d='<a href="'+s+'"';return l&&(d+=' title="'+Zs(l)+'"'),d+=">"+c+"</a>",d}image({href:s,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Bb(s);if(o===null)return Zs(r);s=o;let d=`<img src="${s}" alt="${Zs(r)}"`;return l&&(d+=` title="${Zs(l)}"`),d+=">",d}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Zs(s.text)}},jp=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},Ts=class lp{constructor(l){Ot(this,"options");Ot(this,"renderer");Ot(this,"textRenderer");this.options=l||mr,this.options.renderer=this.options.renderer||new Cf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jp}static parse(l,r){return new lp(r).parse(l)}static parseInline(l,r){return new lp(r).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=x||"";continue}}let p=h;switch(p.type){case"space":{r+=this.renderer.space(p);break}case"hr":{r+=this.renderer.hr(p);break}case"heading":{r+=this.renderer.heading(p);break}case"code":{r+=this.renderer.code(p);break}case"table":{r+=this.renderer.table(p);break}case"blockquote":{r+=this.renderer.blockquote(p);break}case"list":{r+=this.renderer.list(p);break}case"checkbox":{r+=this.renderer.checkbox(p);break}case"html":{r+=this.renderer.html(p);break}case"def":{r+=this.renderer.def(p);break}case"paragraph":{r+=this.renderer.paragraph(p);break}case"text":{r+=this.renderer.text(p);break}default:{let g='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(l,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let p=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[p.type]){let x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){c+=x||"";continue}}let g=p;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let x='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},jf,Co=(jf=class{constructor(s){Ot(this,"options");Ot(this,"block");this.options=s||mr}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?Ns.lex:Ns.lexInline}provideParser(s=this.block){return s?Ts.parse:Ts.parseInline}},Ot(jf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ot(jf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),jf),Bv=class{constructor(...s){Ot(this,"defaults",pp());Ot(this,"options",this.setOptions);Ot(this,"parse",this.parseMarkdown(!0));Ot(this,"parseInline",this.parseMarkdown(!1));Ot(this,"Parser",Ts);Ot(this,"Renderer",Cf);Ot(this,"TextRenderer",jp);Ot(this,"Lexer",Ns);Ot(this,"Tokenizer",Af);Ot(this,"Hooks",Co);this.use(...s)}walkTokens(s,l){var c,o;let r=[];for(let d of s)switch(r=r.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let p of h.header)r=r.concat(this.walkTokens(p.tokens,l));for(let p of h.rows)for(let g of p)r=r.concat(this.walkTokens(g.tokens,l));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,l));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(p=>{let g=h[p].flat(1/0);r=r.concat(this.walkTokens(g,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...s){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return s.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=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let p=o.renderer.apply(this,h);return p===!1&&(p=d.apply(this,h)),p}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),r.renderer){let o=this.defaults.renderer||new Cf(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,p=r.renderer[h],g=o[h];o[h]=(...x)=>{let _=p.apply(o,x);return _===!1&&(_=g.apply(o,x)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Af(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,p=r.tokenizer[h],g=o[h];o[h]=(...x)=>{let _=p.apply(o,x);return _===!1&&(_=g.apply(o,x)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Co;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,p=r.hooks[h],g=o[h];Co.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Co.passThroughHooksRespectAsync.has(d))return(async()=>{let S=await p.call(o,x);return g.call(o,S)})();let _=p.call(o,x);return g.call(o,_)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let S=await p.apply(o,x);return S===!1&&(S=await g.apply(o,x)),S})();let _=p.apply(o,x);return _===!1&&(_=g.apply(o,x)),_}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let p=[];return p.push(d.call(this,h)),o&&(p=p.concat(o.call(this,h))),p}}this.defaults={...this.defaults,...c}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,l){return Ns.lex(s,l??this.defaults)}parser(s,l){return Ts.parse(s,l??this.defaults)}parseMarkdown(s){return(l,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 l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=s),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,p=await(o.hooks?await o.hooks.provideLexer(s):s?Ns.lex:Ns.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(s):s?Ts.parse:Ts.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(s):s?Ns.lex:Ns.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let p=(o.hooks?o.hooks.provideParser(s):s?Ts.parse:Ts.parseInline)(h,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(h){return d(h)}}}onError(s,l){return r=>{if(r.message+=`
|
|
114
|
+
Please report this to https://github.com/markedjs/marked.`,s){let c="<p>An error occurred:</p><pre>"+Zs(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},pr=new Bv;function St(s,l){return pr.parse(s,l)}St.options=St.setOptions=function(s){return pr.setOptions(s),St.defaults=pr.defaults,dy(St.defaults),St};St.getDefaults=pp;St.defaults=mr;St.use=function(...s){return pr.use(...s),St.defaults=pr.defaults,dy(St.defaults),St};St.walkTokens=function(s,l){return pr.walkTokens(s,l)};St.parseInline=pr.parseInline;St.Parser=Ts;St.parser=Ts.parse;St.Renderer=Cf;St.TextRenderer=jp;St.Lexer=Ns;St.lexer=Ns.lex;St.Tokenizer=Af;St.Hooks=Co;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;Ts.parse;Ns.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 Yb(s,l){(l==null||l>s.length)&&(l=s.length);for(var r=0,c=Array(l);r<l;r++)c[r]=s[r];return c}function Iv(s){if(Array.isArray(s))return s}function qv(s,l){var r=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(r!=null){var c,o,d,h,p=[],g=!0,x=!1;try{if(d=(r=r.call(s)).next,l!==0)for(;!(g=(c=d.call(r)).done)&&(p.push(c.value),p.length!==l);g=!0);}catch(_){x=!0,o=_}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function Gv(){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 Yv(s,l){return Iv(s)||qv(s,l)||Xv(s,l)||Gv()}function Xv(s,l){if(s){if(typeof s=="string")return Yb(s,l);var r={}.toString.call(s).slice(8,-1);return r==="Object"&&s.constructor&&(r=s.constructor.name),r==="Map"||r==="Set"?Array.from(s):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yb(s,l):void 0}}const jy=Object.entries,Xb=Object.setPrototypeOf,Vv=Object.isFrozen,$v=Object.getPrototypeOf,Qv=Object.getOwnPropertyDescriptor;let il=Object.freeze,rl=Object.seal,cc=Object.create,Sy=typeof Reflect<"u"&&Reflect,sp=Sy.apply,ap=Sy.construct;il||(il=function(l){return l});rl||(rl=function(l){return l});sp||(sp=function(l,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 l.apply(r,o)});ap||(ap=function(l){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new l(...c)});const lc=On(Array.prototype.forEach),Kv=On(Array.prototype.lastIndexOf),Vb=On(Array.prototype.pop),sc=On(Array.prototype.push),Zv=On(Array.prototype.splice),Si=Array.isArray,Ro=On(String.prototype.toLowerCase),Lh=On(String.prototype.toString),$b=On(String.prototype.match),So=On(String.prototype.replace),Qb=On(String.prototype.indexOf),Fv=On(String.prototype.trim),Jv=On(Number.prototype.toString),Wv=On(Boolean.prototype.toString),Kb=typeof BigInt>"u"?null:On(BigInt.prototype.toString),Zb=typeof Symbol>"u"?null:On(Symbol.prototype.toString),Kn=On(Object.prototype.hasOwnProperty),wo=On(Object.prototype.toString),Qn=On(RegExp.prototype.test),er=Pv(TypeError);function On(s){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return sp(s,l,c)}}function Pv(s){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return ap(s,r)}}function dt(s,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ro;if(Xb&&Xb(s,null),!Si(l))return s;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&(Vv(l)||(l[c]=d),o=d)}s[o]=!0}return s}function e1(s){for(let l=0;l<s.length;l++)Kn(s,l)||(s[l]=null);return s}function xl(s){const l=cc(null);for(const c of jy(s)){var r=Yv(c,2);const o=r[0],d=r[1];Kn(s,o)&&(Si(d)?l[o]=e1(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=xl(d):l[o]=d)}return l}function t1(s){switch(typeof s){case"string":return s;case"number":return Jv(s);case"boolean":return Wv(s);case"bigint":return Kb?Kb(s):"0";case"symbol":return Zb?Zb(s):"Symbol()";case"undefined":return wo(s);case"function":case"object":{if(s===null)return wo(s);const l=s,r=Fs(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:wo(c)}return wo(s)}default:return wo(s)}}function Fs(s,l){for(;s!==null;){const c=Qv(s,l);if(c){if(c.get)return On(c.get);if(typeof c.value=="function")return On(c.value)}s=$v(s)}function r(){return null}return r}function n1(s){try{return Qn(s,""),!0}catch{return!1}}const Fb=il(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),zh=il(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Uh=il(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),l1=il(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hh=il(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),s1=il(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Jb=il(["#text"]),Wb=il(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Bh=il(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pb=il(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lf=il(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a1=rl(/{{[\w\W]*|^[\w\W]*}}/g),i1=rl(/<%[\w\W]*|^[\w\W]*%>/g),r1=rl(/\${[\w\W]*/g),c1=rl(/^data-[\-\w.\u00B7-\uFFFF]+$/),o1=rl(/^aria-[\-\w]+$/),ex=rl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),u1=rl(/^(?:\w+script|data):/i),f1=rl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),d1=rl(/^html$/i),h1=rl(/^[a-z][.\w]*(-[.\w]+)+$/i),tx=rl(/<[/\w!]/g),nx=rl(/<[/\w]/g),p1=rl(/<\/no(script|embed|frames)/i),m1=rl(/\/>/i),Ql={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},g1=function(){return typeof window>"u"?null:window},b1=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},lx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},xi=function(l,r,c,o){return Kn(l,r)&&Si(l[r])?dt(o.base?xl(o.base):{},l[r],o.transform):c};function wy(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g1();const l=he=>wy(he);if(l.version="3.4.12",l.removed=[],!s||!s.document||s.document.nodeType!==Ql.document||!s.Element)return l.isSupported=!1,l;let r=s.document;const c=r,o=c.currentScript;s.DocumentFragment;const d=s.HTMLTemplateElement,h=s.Node,p=s.Element,g=s.NodeFilter,x=s.NamedNodeMap;x===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const _=s.DOMParser,S=s.trustedTypes,v=p.prototype,E=Fs(v,"cloneNode"),T=Fs(v,"remove"),R=Fs(v,"nextSibling"),z=Fs(v,"childNodes"),X=Fs(v,"parentNode"),F=Fs(v,"shadowRoot"),G=Fs(v,"attributes"),O=h&&h.prototype?Fs(h.prototype,"nodeType"):null,K=h&&h.prototype?Fs(h.prototype,"nodeName"):null;if(typeof d=="function"){const he=r.createElement("template");he.content&&he.content.ownerDocument&&(r=he.content.ownerDocument)}let C,D="",H,te=!1,de=0;const J=function(){if(de>0)throw er('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(k){J(),de++;try{return C.createHTML(k)}finally{de--}},je=function(k){J(),de++;try{return C.createScriptURL(k)}finally{de--}},Ce=function(){return te||(H=b1(S,o),te=!0),H},Ee=r,A=Ee.implementation,ce=Ee.createNodeIterator,L=Ee.createDocumentFragment,be=Ee.getElementsByTagName,ye=c.importNode;let N=lx();l.isSupported=typeof jy=="function"&&typeof X=="function"&&A&&A.createHTMLDocument!==void 0;const V=a1,re=i1,me=r1,we=c1,ve=o1,De=u1,xt=f1,Xe=h1;let Ve=ex,$e=null;const Wt=dt({},[...Fb,...zh,...Uh,...Hh,...Jb]);let it=null;const un=dt({},[...Wb,...Bh,...Pb,...lf]);let ut=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}})),fn=null,kn=null;const _n=Object.seal(cc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Pt=!0,tt=!0,Pe=!1,en=!0,Vt=!1,nt=!0,wt=!1,$t=!1,rn=null,kt=null,vn=!1,It=!1,dn=!1,Ln=!1,qt=!0,rt=!1;const Et="user-content-";let Je=!0,_l=!1,ne={},ge=null;const He=dt({},["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 B=null;const P=dt({},["audio","video","img","source","image","track"]);let _e=null;const Be=dt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gt="http://www.w3.org/1998/Math/MathML",vl="http://www.w3.org/2000/svg",Zn="http://www.w3.org/1999/xhtml";let Fn=Zn,Jn=!1,Kl=null;const Nn=dt({},[Gt,vl,Zn],Lh),Ll=il(["mi","mo","mn","ms","mtext"]);let fl=dt({},Ll);const Wn=il(["annotation-xml"]);let Pn=dt({},Wn);const tn=dt({},["title","style","font","a","script"]);let cn=null;const Lt=["application/xhtml+xml","text/html"],et="text/html";let Me=null,nn=null;const jn=r.createElement("form"),Cs=function(k){return k instanceof RegExp||k instanceof Function},Yn=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nn&&nn===k)return;(!k||typeof k!="object")&&(k={}),k=xl(k),cn=Lt.indexOf(k.PARSER_MEDIA_TYPE)===-1?et:k.PARSER_MEDIA_TYPE,Me=cn==="application/xhtml+xml"?Lh:Ro,$e=xi(k,"ALLOWED_TAGS",Wt,{transform:Me}),it=xi(k,"ALLOWED_ATTR",un,{transform:Me}),Kl=xi(k,"ALLOWED_NAMESPACES",Nn,{transform:Lh}),_e=xi(k,"ADD_URI_SAFE_ATTR",Be,{transform:Me,base:Be}),B=xi(k,"ADD_DATA_URI_TAGS",P,{transform:Me,base:P}),ge=xi(k,"FORBID_CONTENTS",He,{transform:Me}),fn=xi(k,"FORBID_TAGS",xl({}),{transform:Me}),kn=xi(k,"FORBID_ATTR",xl({}),{transform:Me}),ne=Kn(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?xl(k.USE_PROFILES):k.USE_PROFILES:!1,Pt=k.ALLOW_ARIA_ATTR!==!1,tt=k.ALLOW_DATA_ATTR!==!1,Pe=k.ALLOW_UNKNOWN_PROTOCOLS||!1,en=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Vt=k.SAFE_FOR_TEMPLATES||!1,nt=k.SAFE_FOR_XML!==!1,wt=k.WHOLE_DOCUMENT||!1,It=k.RETURN_DOM||!1,dn=k.RETURN_DOM_FRAGMENT||!1,Ln=k.RETURN_TRUSTED_TYPE||!1,vn=k.FORCE_BODY||!1,qt=k.SANITIZE_DOM!==!1,rt=k.SANITIZE_NAMED_PROPS||!1,Je=k.KEEP_CONTENT!==!1,_l=k.IN_PLACE||!1,Ve=n1(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:ex,Fn=typeof k.NAMESPACE=="string"?k.NAMESPACE:Zn,fl=Kn(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?xl(k.MATHML_TEXT_INTEGRATION_POINTS):dt({},Ll),Pn=Kn(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?xl(k.HTML_INTEGRATION_POINTS):dt({},Wn);const Y=Kn(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?xl(k.CUSTOM_ELEMENT_HANDLING):cc(null);if(ut=cc(null),Kn(Y,"tagNameCheck")&&Cs(Y.tagNameCheck)&&(ut.tagNameCheck=Y.tagNameCheck),Kn(Y,"attributeNameCheck")&&Cs(Y.attributeNameCheck)&&(ut.attributeNameCheck=Y.attributeNameCheck),Kn(Y,"allowCustomizedBuiltInElements")&&typeof Y.allowCustomizedBuiltInElements=="boolean"&&(ut.allowCustomizedBuiltInElements=Y.allowCustomizedBuiltInElements),rl(ut),Vt&&(tt=!1),dn&&(It=!0),ne&&($e=dt({},Jb),it=cc(null),ne.html===!0&&(dt($e,Fb),dt(it,Wb)),ne.svg===!0&&(dt($e,zh),dt(it,Bh),dt(it,lf)),ne.svgFilters===!0&&(dt($e,Uh),dt(it,Bh),dt(it,lf)),ne.mathMl===!0&&(dt($e,Hh),dt(it,Pb),dt(it,lf))),_n.tagCheck=null,_n.attributeCheck=null,Kn(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?_n.tagCheck=k.ADD_TAGS:Si(k.ADD_TAGS)&&($e===Wt&&($e=xl($e)),dt($e,k.ADD_TAGS,Me))),Kn(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?_n.attributeCheck=k.ADD_ATTR:Si(k.ADD_ATTR)&&(it===un&&(it=xl(it)),dt(it,k.ADD_ATTR,Me))),Kn(k,"ADD_URI_SAFE_ATTR")&&Si(k.ADD_URI_SAFE_ATTR)&&dt(_e,k.ADD_URI_SAFE_ATTR,Me),Kn(k,"FORBID_CONTENTS")&&Si(k.FORBID_CONTENTS)&&(ge===He&&(ge=xl(ge)),dt(ge,k.FORBID_CONTENTS,Me)),Kn(k,"ADD_FORBID_CONTENTS")&&Si(k.ADD_FORBID_CONTENTS)&&(ge===He&&(ge=xl(ge)),dt(ge,k.ADD_FORBID_CONTENTS,Me)),Je&&($e["#text"]=!0),wt&&dt($e,["html","head","body"]),$e.table&&(dt($e,["tbody"]),delete fn.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw er('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw er('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const fe=C;C=k.TRUSTED_TYPES_POLICY;try{D=ue("")}catch(Te){throw C=fe,Te}}else k.TRUSTED_TYPES_POLICY===null?(C=void 0,D=""):(C===void 0&&(C=Ce()),C&&typeof D=="string"&&(D=ue("")));il&&il(k),nn=k},jl=dt({},[...zh,...Uh,...l1]),Qt=dt({},[...Hh,...s1]),el=function(k,Y,fe){return Y.namespaceURI===Zn?k==="svg":Y.namespaceURI===Gt?k==="svg"&&(fe==="annotation-xml"||fl[fe]):!!jl[k]},vt=function(k,Y,fe){return Y.namespaceURI===Zn?k==="math":Y.namespaceURI===vl?k==="math"&&Pn[fe]:!!Qt[k]},hn=function(k,Y,fe){return Y.namespaceURI===vl&&!Pn[fe]||Y.namespaceURI===Gt&&!fl[fe]?!1:!Qt[k]&&(tn[k]||!jl[k])},zn=function(k){let Y=X(k);(!Y||!Y.tagName)&&(Y={namespaceURI:Fn,tagName:"template"});const fe=Ro(k.tagName),Te=Ro(Y.tagName);return Kl[k.namespaceURI]?k.namespaceURI===vl?el(fe,Y,Te):k.namespaceURI===Gt?vt(fe,Y,Te):k.namespaceURI===Zn?hn(fe,Y,Te):!!(cn==="application/xhtml+xml"&&Kl[k.namespaceURI]):!1},pn=function(k){sc(l.removed,{element:k});try{X(k).removeChild(k)}catch{if(T(k),!X(k))throw er("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},zt=function(k){Yt(k);const Y=z(k);if(Y){const Te=[];lc(Y,Oe=>{sc(Te,Oe)}),lc(Te,Oe=>{try{T(Oe)}catch{}})}const fe=G(k);if(fe)for(let Te=fe.length-1;Te>=0;--Te){const Oe=fe[Te],Le=Oe&&Oe.name;if(typeof Le=="string")try{k.removeAttribute(Le)}catch{}}},tl=function(k,Y){try{sc(l.removed,{attribute:Y.getAttributeNode(k),from:Y})}catch{sc(l.removed,{attribute:null,from:Y})}if(Y.removeAttribute(k),k==="is")if(It||dn)try{pn(Y)}catch{}else try{Y.setAttribute(k,"")}catch{}},Rs=function(k){const Y=G(k);if(Y)for(let fe=Y.length-1;fe>=0;--fe){const Te=Y[fe],Oe=Te&&Te.name;if(!(typeof Oe!="string"||it[Me(Oe)]))try{k.removeAttribute(Oe)}catch{}}},Yt=function(k){const Y=[k];for(;Y.length>0;){const fe=Y.pop();(O?O(fe):fe.nodeType)===Ql.element&&Rs(fe);const Oe=z(fe);if(Oe)for(let Le=Oe.length-1;Le>=0;--Le)Y.push(Oe[Le])}},dl=function(k){if(!nt)return;const Y=[k];for(;Y.length>0;){const fe=Y.pop(),Te=O?O(fe):fe.nodeType;if(Te===Ql.processingInstruction||Te===Ql.comment&&Qn(nx,fe.data)){try{T(fe)}catch{}continue}if(Te===Ql.element){const Le=fe,mt=Me(K?K(fe):fe.nodeName);try{Le.hasAttribute&&Le.hasAttribute("patchsrc")&&Le.removeAttribute("patchsrc"),Le.hasAttribute&&Le.hasAttribute("for")&&mt!=="label"&&mt!=="output"&&Le.removeAttribute("for")}catch{}}const Oe=z(fe);if(Oe)for(let Le=Oe.length-1;Le>=0;--Le)Y.push(Oe[Le])}},os=function(k){let Y=null,fe=null;if(vn)k="<remove></remove>"+k;else{const Le=$b(k,/^[\r\n\t ]+/);fe=Le&&Le[0]}cn==="application/xhtml+xml"&&Fn===Zn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Te=C?ue(k):k;if(Fn===Zn)try{Y=new _().parseFromString(Te,cn)}catch{}if(!Y||!Y.documentElement){Y=A.createDocument(Fn,"template",null);try{Y.documentElement.innerHTML=Jn?D:Te}catch{}}const Oe=Y.body||Y.documentElement;return k&&fe&&Oe.insertBefore(r.createTextNode(fe),Oe.childNodes[0]||null),Fn===Zn?be.call(Y,wt?"html":"body")[0]:wt?Y.documentElement:Oe},us=function(k){return ce.call(k.ownerDocument||k,k,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Zl=function(k){return k=So(k,V," "),k=So(k,re," "),k=So(k,me," "),k},na=function(k){var Y;k.normalize();const fe=ce.call(k.ownerDocument||k,k,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Te=fe.nextNode();for(;Te;)Te.data=Zl(Te.data),Te=fe.nextNode();const Oe=(Y=k.querySelectorAll)===null||Y===void 0?void 0:Y.call(k,"template");Oe&&lc(Oe,Le=>{nl(Le.content)&&na(Le.content)})},Sl=function(k){const Y=K?K(k):null;return typeof Y!="string"||Me(Y)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==G(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==O(k)||k.childNodes!==z(k)},nl=function(k){if(!O||typeof k!="object"||k===null)return!1;try{return O(k)===Ql.documentFragment}catch{return!1}},Un=function(k){if(!O||typeof k!="object"||k===null)return!1;try{return typeof O(k)=="number"}catch{return!1}};function Ut(he,k,Y){he.length!==0&&lc(he,fe=>{fe.call(l,k,Y,nn)})}const zl=function(k,Y){return!!(nt&&k.hasChildNodes()&&!Un(k.firstElementChild)&&Qn(tx,k.textContent)&&Qn(tx,k.innerHTML)||nt&&k.namespaceURI===Zn&&Y==="style"&&Un(k.firstElementChild)||k.nodeType===Ql.processingInstruction||nt&&k.nodeType===Ql.comment&&Qn(nx,k.data))},Ti=function(k,Y){if(!fn[Y]&&Tn(Y)&&(ut.tagNameCheck instanceof RegExp&&Qn(ut.tagNameCheck,Y)||ut.tagNameCheck instanceof Function&&ut.tagNameCheck(Y)))return!1;if(Je&&!ge[Y]){const fe=X(k),Te=z(k);if(Te&&fe){const Oe=Te.length;for(let Le=Oe-1;Le>=0;--Le){const mt=_l?Te[Le]:E(Te[Le],!0);fe.insertBefore(mt,R(k))}}}return pn(k),!0},Fl=function(k,Y){if(Ut(N.beforeSanitizeElements,k,null),k!==Y&&X(k)===null)return!0;if(Sl(k))return pn(k),!0;const fe=Me(K?K(k):k.nodeName);if(Ut(N.uponSanitizeElement,k,{tagName:fe,allowedTags:$e}),k!==Y&&X(k)===null)return!0;if(zl(k,fe))return pn(k),!0;if(fn[fe]||!(_n.tagCheck instanceof Function&&_n.tagCheck(fe))&&!$e[fe]){const Oe=Ti(k,fe);return Oe===!1&&Ut(N.afterSanitizeElements,k,null),Oe}if((O?O(k):k.nodeType)===Ql.element&&!zn(k)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&Qn(p1,k.innerHTML))return pn(k),!0;if(Vt&&k.nodeType===Ql.text){const Oe=Zl(k.textContent);k.textContent!==Oe&&(sc(l.removed,{element:k.cloneNode()}),k.textContent=Oe)}return Ut(N.afterSanitizeElements,k,null),!1},Xn=function(k,Y,fe){if(kn[Y]||nt&&Y==="patchsrc"||nt&&Y==="for"&&k!=="label"&&k!=="output"||qt&&(Y==="id"||Y==="name")&&(fe in r||fe in jn))return!1;const Te=it[Y]||_n.attributeCheck instanceof Function&&_n.attributeCheck(Y,k);if(!(tt&&Qn(we,Y))){if(!(Pt&&Qn(ve,Y))){if(Te){if(!_e[Y]){if(!Qn(Ve,So(fe,xt,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&k!=="script"&&Qb(fe,"data:")===0&&B[k])){if(!(Pe&&!Qn(De,So(fe,xt,"")))){if(fe)return!1}}}}}else if(!(Tn(k)&&(ut.tagNameCheck instanceof RegExp&&Qn(ut.tagNameCheck,k)||ut.tagNameCheck instanceof Function&&ut.tagNameCheck(k))&&(ut.attributeNameCheck instanceof RegExp&&Qn(ut.attributeNameCheck,Y)||ut.attributeNameCheck instanceof Function&&ut.attributeNameCheck(Y,k))||Y==="is"&&ut.allowCustomizedBuiltInElements&&(ut.tagNameCheck instanceof RegExp&&Qn(ut.tagNameCheck,fe)||ut.tagNameCheck instanceof Function&&ut.tagNameCheck(fe))))return!1}}return!0},wl=dt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Tn=function(k){return!wl[Ro(k)]&&Qn(Xe,k)},mn=function(k,Y,fe,Te){if(C&&typeof S=="object"&&typeof S.getAttributeType=="function"&&!fe)switch(S.getAttributeType(k,Y)){case"TrustedHTML":return ue(Te);case"TrustedScriptURL":return je(Te)}return Te},jt=function(k,Y,fe,Te){try{fe?k.setAttributeNS(fe,Y,Te):k.setAttribute(Y,Te),Sl(k)?pn(k):Vb(l.removed)}catch{tl(Y,k)}},Ul=function(k){Ut(N.beforeSanitizeAttributes,k,null);const Y=k.attributes;if(!Y||Sl(k))return;const fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:it,forceKeepAttr:void 0};let Te=Y.length;const Oe=Me(k.nodeName);for(;Te--;){const Le=Y[Te],mt=Le.name,w=Le.namespaceURI,ae=Le.value,ke=Me(mt),We=ae;let ft=mt==="value"?We:Fv(We);if(fe.attrName=ke,fe.attrValue=ft,fe.keepAttr=!0,fe.forceKeepAttr=void 0,Ut(N.uponSanitizeAttribute,k,fe),ft=fe.attrValue,rt&&(ke==="id"||ke==="name")&&Qb(ft,Et)!==0&&(tl(mt,k),ft=Et+ft),nt&&Qn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ft)){tl(mt,k);continue}if(ke==="attributename"&&$b(ft,"href")){tl(mt,k);continue}if(!fe.forceKeepAttr){if(!fe.keepAttr){tl(mt,k);continue}if(!en&&Qn(m1,ft)){tl(mt,k);continue}if(Vt&&(ft=Zl(ft)),!Xn(Oe,ke,ft)){tl(mt,k);continue}ft=mn(Oe,ke,w,ft),ft!==We&&jt(k,mt,w,ft)}}Ut(N.afterSanitizeAttributes,k,null)},At=function(k){let Y=null;const fe=us(k);for(Ut(N.beforeSanitizeShadowDOM,k,null);Y=fe.nextNode();)if(Ut(N.uponSanitizeShadowNode,Y,null),Fl(Y,k),Ul(Y),nl(Y.content)&&At(Y.content),(O?O(Y):Y.nodeType)===Ql.element){const Oe=F(Y);nl(Oe)&&(ll(Oe),At(Oe))}Ut(N.afterSanitizeShadowDOM,k,null)},ll=function(k){const Y=[{node:k,shadow:null}];for(;Y.length>0;){const fe=Y.pop();if(fe.shadow){At(fe.shadow);continue}const Te=fe.node,Le=(O?O(Te):Te.nodeType)===Ql.element,mt=z(Te);if(mt)for(let w=mt.length-1;w>=0;--w)Y.push({node:mt[w],shadow:null});if(Le){const w=K?K(Te):null;if(typeof w=="string"&&Me(w)==="template"){const ae=Te.content;nl(ae)&&Y.push({node:ae,shadow:null})}}if(Le){const w=F(Te);nl(w)&&Y.push({node:null,shadow:w},{node:w,shadow:null})}}};return l.sanitize=function(he){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,fe=null,Te=null,Oe=null;if(Jn=!he,Jn&&(he="<!-->"),typeof he!="string"&&!Un(he)&&(he=t1(he),typeof he!="string"))throw er("dirty is not a string, aborting");if(!l.isSupported)return he;$t?($e=rn,it=kt):Yn(k),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&($e=xl($e)),N.uponSanitizeAttribute.length>0&&(it=xl(it)),l.removed=[];const Le=_l&&typeof he!="string"&&Un(he);if(Le){dl(he);const ke=K?K(he):he.nodeName;if(typeof ke=="string"){const We=Me(ke);if(!$e[We]||fn[We])throw zt(he),er("root node is forbidden and cannot be sanitized in-place")}if(Sl(he))throw zt(he),er("root node is clobbered and cannot be sanitized in-place");try{ll(he)}catch(We){throw zt(he),We}}else if(Un(he))Y=os("<!---->"),fe=Y.ownerDocument.importNode(he,!0),fe.nodeType===Ql.element&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?Y=fe:Y.appendChild(fe),ll(fe);else{if(!It&&!Vt&&!wt&&he.indexOf("<")===-1)return C&&Ln?ue(he):he;if(Y=os(he),!Y)return It?null:Ln?D:""}Y&&vn&&pn(Y.firstChild);const mt=Le?he:Y,w=us(mt);try{for(;Te=w.nextNode();)Fl(Te,mt),Ul(Te),nl(Te.content)&&At(Te.content)}catch(ke){throw Le&&(zt(he),lc(l.removed,We=>{We.element&&Yt(We.element)})),ke}if(Le)return lc(l.removed,ke=>{ke.element&&Yt(ke.element)}),Vt&&na(he),he;if(It){if(Vt&&na(Y),dn)for(Oe=L.call(Y.ownerDocument);Y.firstChild;)Oe.appendChild(Y.firstChild);else Oe=Y;return(it.shadowroot||it.shadowrootmode)&&(Oe=ye.call(c,Oe,!0)),Oe}let ae=wt?Y.outerHTML:Y.innerHTML;return wt&&$e["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Qn(d1,Y.ownerDocument.doctype.name)&&(ae="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
|
|
116
|
+
`+ae),Vt&&(ae=Zl(ae)),C&&Ln?ue(ae):ae},l.setConfig=function(){let he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(he),$t=!0,rn=$e,kt=it},l.clearConfig=function(){nn=null,$t=!1,rn=null,kt=null,C=H,D=""},l.isValidAttribute=function(he,k,Y){nn||Yn({});const fe=Me(he),Te=Me(k);return Xn(fe,Te,Y)},l.addHook=function(he,k){typeof k=="function"&&Kn(N,he)&&sc(N[he],k)},l.removeHook=function(he,k){if(Kn(N,he)){if(k!==void 0){const Y=Kv(N[he],k);return Y===-1?void 0:Zv(N[he],Y,1)[0]}return Vb(N[he])}},l.removeHooks=function(he){Kn(N,he)&&(N[he]=[])},l.removeAllHooks=function(){N=lx()},l}var x1=wy();const y1=1024;let _1=0;class cs{constructor(l,r){this.from=l,this.to=r}}class Jt{constructor(l={}){this.id=_1++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=As.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}Jt.closedBy=new Jt({deserialize:s=>s.split(" ")});Jt.openedBy=new Jt({deserialize:s=>s.split(" ")});Jt.group=new Jt({deserialize:s=>s.split(" ")});Jt.isolate=new Jt({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});Jt.contextHash=new Jt({perNode:!0});Jt.lookAhead=new Jt({perNode:!0});Jt.mounted=new Jt({perNode:!0});class dc{constructor(l,r,c,o=!1){this.tree=l,this.overlay=r,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[Jt.mounted.id]}}const v1=Object.create(null);class As{constructor(l,r,c,o=0){this.name=l,this.props=r,this.id=c,this.flags=o}static define(l){let r=l.props&&l.props.length?Object.create(null):v1,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new As(l.name||"",r,l.id,c);if(l.props){for(let d of l.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(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let r=this.prop(Jt.group);return r?r.indexOf(l)>-1:!1}return this.id==l}static match(l){let r=Object.create(null);for(let c in l)for(let o of c.split(" "))r[o]=l[c];return c=>{for(let o=c.prop(Jt.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}As.none=new As("",Object.create(null),0,8);class ky{constructor(l){this.types=l;for(let r=0;r<l.length;r++)if(l[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let r=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let p=h[1],g=h[0];g.combine&&g.id in o&&(p=g.combine(o[g.id],p)),o[g.id]=p}}r.push(o?new As(c.name,o,c.id,c.flags):c)}return new ky(r)}}const sf=new WeakMap,sx=new WeakMap;var Zt;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays",s[s.EnterBracketed=16]="EnterBracketed"})(Zt||(Zt={}));class Ol{constructor(l,r,c,o,d){if(this.type=l,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,p]of d)this.props[typeof h=="number"?h:h.id]=p}}toString(){let l=dc.get(this);if(l&&!l.overlay)return l.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(l=0){return new Rf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=sf.get(this)||this.topNode,d=new Rf(o);return d.moveTo(l,r),sf.set(this,d._tree),d}get topNode(){return new ul(this,0,0,null)}resolve(l,r=0){let c=Oo(sf.get(this)||this.topNode,l,r,!1);return sf.set(this,c),c}resolveInner(l,r=0){let c=Oo(sx.get(this)||this.topNode,l,r,!0);return sx.set(this,c),c}resolveStack(l,r=0){return w1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,p=(h&Zt.IncludeAnonymous)>0;for(let g=this.cursor(h|Zt.IncludeAnonymous);;){let x=!1;if(g.from<=d&&g.to>=o&&(!p&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(p||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:kp(As.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Ol(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new Ol(As.none,r,c,o)))}static build(l){return k1(l)}}Ol.empty=new Ol(As.none,[],[],0);class Sp{constructor(l,r){this.buffer=l,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Sp(this.buffer,this.index)}}class Ni{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return As.none}toString(){let l=[];for(let r=0;r<this.buffer.length;)l.push(this.childString(r)),r=this.buffer[r+3];return l.join(",")}childString(l){let r=this.buffer[l],c=this.buffer[l+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,r,c,o,d){let{buffer:h}=this,p=-1;for(let g=l;g!=r&&!(Ny(d,o,h[g+1],h[g+2])&&(p=g,c>0));g=h[g+3]);return p}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let p=l,g=0;p<r;){d[g++]=o[p++],d[g++]=o[p++]-c;let x=d[g++]=o[p++]-c;d[g++]=o[p++]-l,h=Math.max(h,x)}return new Ni(d,h,this.set)}}function Ny(s,l,r,c){switch(s){case-2:return r<l;case-1:return c>=l&&r<l;case 0:return r<l&&c>l;case 1:return r<=l&&c>l;case 2:return c>l;case 4:return!0}}function Oo(s,l,r,c){for(var o;s.from==s.to||(r<1?s.from>=l:s.from>l)||(r>-1?s.to<=l:s.to<l);){let h=!c&&s instanceof ul&&s.index<0?null:s.parent;if(!h)return s;s=h}let d=c?0:Zt.IgnoreOverlays;if(c)for(let h=s,p=h.parent;p;h=p,p=h.parent)h instanceof ul&&h.index<0&&((o=p.enter(l,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(s=p);for(;;){let h=s.enter(l,r,d);if(!h)return s;s=h}}class Ty{cursor(l=0){return new Rf(this,l)}getChild(l,r=null,c=null){let o=ax(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return ax(this,l,r,c)}resolve(l,r=0){return Oo(this,l,r,!1)}resolveInner(l,r=0){return Oo(this,l,r,!0)}matchContext(l){return ip(this.parent,l)}enterUnfinishedNodesBefore(l){let r=this.childBefore(l),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class ul extends Ty{constructor(l,r,c,o){super(),this._tree=l,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,r,c,o,d=0){for(let h=this;;){for(let{children:p,positions:g}=h._tree,x=r>0?p.length:-1;l!=x;l+=r){let _=p[l],S=g[l]+h.from,v;if(!(!(d&Zt.EnterBracketed&&_ instanceof Ol&&(v=dc.get(_))&&!v.overlay&&v.bracketed&&c>=S&&c<=S+_.length)&&!Ny(o,c,S,S+_.length))){if(_ instanceof Ni){if(d&Zt.ExcludeBuffers)continue;let E=_.findChild(0,_.buffer.length,r,c-S,o);if(E>-1)return new ta(new j1(h,_,l,S),null,E)}else if(d&Zt.IncludeAnonymous||!_.type.isAnonymous||wp(_)){let E;if(!(d&Zt.IgnoreMounts)&&(E=dc.get(_))&&!E.overlay)return new ul(E.tree,S,l,h);let T=new ul(_,S,l,h);return d&Zt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?_.children.length-1:0,r,c,o,d)}}}if(d&Zt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+r:l=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,r,c=0){let o;if(!(c&Zt.IgnoreOverlays)&&(o=dc.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Zt.EnterBracketed&&o.bracketed;for(let{from:p,to:g}of o.overlay)if((r>0||h?p<=d:p<d)&&(r<0||h?g>=d:g>d))return new ul(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,r,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ax(s,l,r,c){let o=s.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(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function ip(s,l,r=l.length-1){for(let c=s;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[r]&&l[r]!=c.name)return!1;r--}}return!0}class j1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class ta extends Ty{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,r,c){super(),this.context=l,this._parent=r,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.context.start,c);return d<0?null:new ta(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,r,c=0){if(c&Zt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,l-this.context.start,r);return d<0?null:new ta(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,r=l.buffer[this.index+3];return r<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new ta(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new ta(this.context,this._parent,l.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),r.push(0)}return new Ol(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ey(s){if(!s.length)return null;let l=0,r=s[0];for(let d=1;d<s.length;d++){let h=s[d];(h.from>r.from||h.to<r.to)&&(r=h,l=d)}let c=r instanceof ul&&r.index<0?null:r.parent,o=s.slice();return c?o[l]=c:o.splice(l,1),new S1(o,r)}class S1{constructor(l,r){this.heads=l,this.node=r}get next(){return Ey(this.heads)}}function w1(s,l,r){let c=s.resolveInner(l,r),o=null;for(let d=c instanceof ul?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,r)),d=h}else{let h=dc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new ul(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Oo(p,l,r,!1))}}return o?Ey(o):c}class Rf{get name(){return this.type.name}constructor(l,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Zt.EnterBracketed,l instanceof ul)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,r){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof ul?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,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(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,r,c=this.mode){return this.buffer?c&Zt.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Zt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let r,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let 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+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let p=c._tree.children[d];if(this.mode&Zt.IncludeAnonymous||p instanceof Ni||!p.type.isAnonymous||wp(p))return!1}return!0}move(l,r){if(r&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,r=0){for(;(this.from==this.to||(r<1?this.from>=l:this.from>l)||(r>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,r););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,r=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;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 ta(this.buffer,r,this.stack[o]);return this.bufferNode=new ta(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return ip(this.node.parent,l);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return ip(this._tree,l,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function wp(s){return s.children.some(l=>l instanceof Ni||!l.type.isAnonymous||wp(l))}function k1(s){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=y1,reused:d=[],minRepeatType:h=c.types.length}=s,p=Array.isArray(r)?new Sp(r,r.length):r,g=c.types,x=0,_=0;function S(K,C,D,H,te,de){let{id:J,start:ue,end:je,size:Ce}=p,Ee=_,A=x;if(Ce<0)if(p.next(),Ce==-1){let N=d[J];D.push(N),H.push(ue-K);return}else if(Ce==-3){x=J;return}else if(Ce==-4){_=J;return}else throw new RangeError(`Unrecognized record size: ${Ce}`);let ce=g[J],L,be,ye=ue-K;if(je-ue<=o&&(be=z(p.pos-C,te))){let N=new Uint16Array(be.size-be.skip),V=p.pos-be.size,re=N.length;for(;p.pos>V;)re=X(be.start,N,re);L=new Ni(N,je-be.start,c),ye=be.start-K}else{let N=p.pos-Ce;p.next();let V=[],re=[],me=J>=h?J:-1,we=0,ve=je;for(;p.pos>N;)me>=0&&p.id==me&&p.size>=0?(p.end<=ve-o&&(T(V,re,ue,we,p.end,ve,me,Ee,A),we=V.length,ve=p.end),p.next()):de>2500?v(ue,N,V,re):S(ue,N,V,re,me,de+1);if(me>=0&&we>0&&we<V.length&&T(V,re,ue,we,ue,ve,me,Ee,A),V.reverse(),re.reverse(),me>-1&&we>0){let De=E(ce,A);L=kp(ce,V,re,0,V.length,0,je-ue,De,De)}else L=R(ce,V,re,je-ue,Ee-je,A)}D.push(L),H.push(ye)}function v(K,C,D,H){let te=[],de=0,J=-1;for(;p.pos>C;){let{id:ue,start:je,end:Ce,size:Ee}=p;if(Ee>4)p.next();else{if(J>-1&&je<J)break;J<0&&(J=Ce-o),te.push(ue,je,Ce),de++,p.next()}}if(de){let ue=new Uint16Array(de*4),je=te[te.length-2];for(let Ce=te.length-3,Ee=0;Ce>=0;Ce-=3)ue[Ee++]=te[Ce],ue[Ee++]=te[Ce+1]-je,ue[Ee++]=te[Ce+2]-je,ue[Ee++]=Ee;D.push(new Ni(ue,te[2]-je,c)),H.push(je-K)}}function E(K,C){return(D,H,te)=>{let de=0,J=D.length-1,ue,je;if(J>=0&&(ue=D[J])instanceof Ol){if(!J&&ue.type==K&&ue.length==te)return ue;(je=ue.prop(Jt.lookAhead))&&(de=H[J]+ue.length+je)}return R(K,D,H,te,de,C)}}function T(K,C,D,H,te,de,J,ue,je){let Ce=[],Ee=[];for(;K.length>H;)Ce.push(K.pop()),Ee.push(C.pop()+D-te);K.push(R(c.types[J],Ce,Ee,de-te,ue-de,je)),C.push(te-D)}function R(K,C,D,H,te,de,J){if(de){let ue=[Jt.contextHash,de];J=J?[ue].concat(J):[ue]}if(te>25){let ue=[Jt.lookAhead,te];J=J?[ue].concat(J):[ue]}return new Ol(K,C,D,H,J)}function z(K,C){let D=p.fork(),H=0,te=0,de=0,J=D.end-o,ue={size:0,start:0,skip:0};e:for(let je=D.pos-K;D.pos>je;){let Ce=D.size;if(D.id==C&&Ce>=0){ue.size=H,ue.start=te,ue.skip=de,de+=4,H+=4,D.next();continue}let Ee=D.pos-Ce;if(Ce<0||Ee<je||D.start<J)break;let A=D.id>=h?4:0,ce=D.start;for(D.next();D.pos>Ee;){if(D.size<0)if(D.size==-3||D.size==-4)A+=4;else break e;else D.id>=h&&(A+=4);D.next()}te=ce,H+=Ce,de+=A}return(C<0||H==K)&&(ue.size=H,ue.start=te,ue.skip=de),ue.size>4?ue:void 0}function X(K,C,D){let{id:H,start:te,end:de,size:J}=p;if(p.next(),J>=0&&H<h){let ue=D;if(J>4){let je=p.pos-(J-4);for(;p.pos>je;)D=X(K,C,D)}C[--D]=ue,C[--D]=de-K,C[--D]=te-K,C[--D]=H}else J==-3?x=H:J==-4&&(_=H);return D}let F=[],G=[];for(;p.pos>0;)S(s.start||0,s.bufferStart||0,F,G,-1,0);let O=(l=s.length)!==null&&l!==void 0?l:F.length?G[0]+F[0].length:0;return new Ol(g[s.topID],F.reverse(),G.reverse(),O)}const ix=new WeakMap;function Nf(s,l){if(!s.isAnonymous||l instanceof Ni||l.type!=s)return 1;let r=ix.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=s||!(c instanceof Ol)){r=1;break}r+=Nf(s,c)}ix.set(l,r)}return r}function kp(s,l,r,c,o,d,h,p,g){let x=0;for(let T=c;T<o;T++)x+=Nf(s,l[T]);let _=Math.ceil(x*1.5/8),S=[],v=[];function E(T,R,z,X,F){for(let G=z;G<X;){let O=G,K=R[G],C=Nf(s,T[G]);for(G++;G<X;G++){let D=Nf(s,T[G]);if(C+D>=_)break;C+=D}if(G==O+1){if(C>_){let D=T[O];E(D.children,D.positions,0,D.children.length,R[O]+F);continue}S.push(T[O])}else{let D=R[G-1]+T[G-1].length-K;S.push(kp(s,T,R,O,G,K,D,null,g))}v.push(K+F-d)}}return E(l,r,c,o,0),(p||g)(S,v,h)}class gN{constructor(){this.map=new WeakMap}setBuffer(l,r,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(r,c)}getBuffer(l,r){let c=this.map.get(l);return c&&c.get(r)}set(l,r){l instanceof ta?this.setBuffer(l.context.buffer,l.index,r):l instanceof ul&&this.map.set(l.tree,r)}get(l){return l instanceof ta?this.getBuffer(l.context.buffer,l.index):l instanceof ul?this.map.get(l.tree):void 0}cursorSet(l,r){l.buffer?this.setBuffer(l.buffer.buffer,l.index,r):this.map.set(l.tree,r)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Lo{constructor(l,r,c,o,d=!1,h=!1){this.from=l,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(l,r=[],c=!1){let o=[new Lo(0,l.length,l,0,!1,c)];for(let d of r)d.to>l.length&&o.push(d);return o}static applyChanges(l,r,c=128){if(!r.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let p=0,g=0,x=0;;p++){let _=p<r.length?r[p]:null,S=_?_.fromA:1e9;if(S-g>=c)for(;h&&h.from<S;){let v=h;if(g>=v.from||S<=v.to||x){let E=Math.max(v.from,g)-x,T=Math.min(v.to,S)-x;v=E>=T?null:new Lo(E,T,v.tree,v.offset+x,p>0,!!_)}if(v&&o.push(v),h.to>S)break;h=d<l.length?l[d++]:null}if(!_)break;g=_.toA,x=_.toA-_.toB}return o}}class bN{startParse(l,r,c){return typeof l=="string"&&(l=new N1(l)),c=c?c.length?c.map(o=>new cs(o.from,o.to)):[new cs(0,0)]:[new cs(0,l.length)],this.createParse(l,r||[],c)}parse(l,r,c){let o=this.startParse(l,r,c);for(;;){let d=o.advance();if(d)return d}}}class N1{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,r){return this.string.slice(l,r)}}function xN(s){return(l,r,c,o)=>new E1(l,s,r,c,o)}class rx{constructor(l,r,c,o,d,h){this.parser=l,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function cx(s){if(!s.length||s.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class T1{constructor(l,r,c,o,d,h,p,g){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=p,this.prev=g,this.depth=0,this.ranges=[]}}const rp=new Jt({perNode:!0});class E1{constructor(l,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=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Ol(c.type,c.children,c.positions,c.length,c.propValues.concat([[rp,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],r=l.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[Jt.mounted.id]=new dc(r,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<l&&(l=Math.min(l,this.inner[r].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(l)}startInner(){let l=new R1(this.fragments),r=null,c=null,o=new Rf(new ul(this.baseTree,this.ranges[0].from,0,null),Zt.IncludeAnonymous|Zt.IgnoreMounts);e:for(let d,h;;){let p=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)p=!1;else if(l.hasNode(o)){if(r){let x=r.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(x)for(let _ of x.mount.overlay){let S=_.from+x.pos,v=_.to+x.pos;S>=o.from&&v<=o.to&&!r.ranges.some(E=>E.from<v&&E.to>S)&&r.ranges.push({from:S,to:v})}}p=!1}else if(c&&(h=A1(c.ranges,o.from,o.to)))p=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(C1(o),r&&r.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new T1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=fx(this.ranges,d.overlay||(o.from<o.to?[new cs(o.from,o.to)]:[]));_.length&&cx(_),(_.length||!d.overlay)&&this.inner.push(new rx(d.parser,_.length?d.parser.startParse(this.input,dx(x,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(S=>new cs(S.from-o.from,S.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):p=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new cs(o.from,o.to)),g.from<g.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==g.from?r.ranges[x]={from:r.ranges[x].from,to:g.to}:r.ranges.push(g)}if(p&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let x=fx(this.ranges,r.ranges);x.length&&(cx(x),this.inner.splice(r.index,0,new rx(r.parser,r.parser.startParse(this.input,dx(r.mounts,x),x),r.ranges.map(_=>new cs(_.from-r.start,_.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function A1(s,l,r){for(let c of s){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function ox(s,l,r,c,o,d){if(l<r){let h=s.buffer[l+1];c.push(s.slice(l,r,h)),o.push(h-d)}}function C1(s){let{node:l}=s,r=[],c=l.context.buffer;do r.push(s.index),s.parent();while(!s.tree);let o=s.tree,d=o.children.indexOf(c),h=o.children[d],p=h.buffer,g=[d];function x(_,S,v,E,T,R){let z=r[R],X=[],F=[];ox(h,_,z,X,F,E);let G=p[z+1],O=p[z+2];g.push(X.length);let K=R?x(z+4,p[z+3],h.set.types[p[z]],G,O-G,R-1):l.toTree();return X.push(K),F.push(G-E),ox(h,p[z+3],S,X,F,E),new Ol(v,X,F,T)}o.children[d]=x(0,p.length,As.none,0,h.length,r.length-1);for(let _ of g){let S=s.tree.children[_],v=s.tree.positions[_];s.yield(new ul(S,v+s.from,_,s._tree))}}class ux{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(Zt.IncludeAnonymous|Zt.IgnoreMounts)}moveTo(l){let{cursor:r}=this,c=l-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=l&&r.enter(c,1,Zt.IgnoreOverlays|Zt.ExcludeBuffers)))if(r.to<=l)r.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==l.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Ol)r=r.children[0];else break}return!1}}class R1{constructor(l){var r;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(r=c.tree.prop(rp))!==null&&r!==void 0?r:c.to,this.inner=new ux(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(l=r.tree.prop(rp))!==null&&l!==void 0?l:r.to,this.inner=new ux(r.tree,-r.offset)}}findMounts(l,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,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(Jt.mounted);if(h&&h.parser==r)for(let p=this.fragI;p<this.fragments.length;p++){let g=this.fragments[p];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 fx(s,l){let r=null,c=l;for(let o=1,d=0;o<s.length;o++){let h=s[o-1].to,p=s[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=p)break;g.to<=h||(r||(c=r=l.slice()),g.from<h?(r[d]=new cs(g.from,h),g.to>p&&r.splice(d+1,0,new cs(p,g.to))):g.to>p?r[d--]=new cs(p,g.to):r.splice(d--,1))}}return c}function M1(s,l,r,c){let o=0,d=0,h=!1,p=!1,g=-1e9,x=[];for(;;){let _=o==s.length?1e9:h?s[o].to:s[o].from,S=d==l.length?1e9:p?l[d].to:l[d].from;if(h!=p){let v=Math.max(g,r),E=Math.min(_,S,c);v<E&&x.push(new cs(v,E))}if(g=Math.min(_,S),g==1e9)break;_==g&&(h?(h=!1,o++):h=!0),S==g&&(p?(p=!1,d++):p=!0)}return x}function dx(s,l){let r=[];for(let{pos:c,mount:o,frag:d}of s){let h=c+(o.overlay?o.overlay[0].from:0),p=h+o.tree.length,g=Math.max(d.from,h),x=Math.min(d.to,p);if(o.overlay){let _=o.overlay.map(v=>new cs(v.from+c,v.to+c)),S=M1(l,_,g,x);for(let v=0,E=g;;v++){let T=v==S.length,R=T?x:S[v].from;if(R>E&&r.push(new Lo(E,R,o.tree,-h,d.from>=E||d.openStart,d.to<=R||d.openEnd)),T)break;E=S[v].to}}else r.push(new Lo(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=p||d.openEnd))}return r}let D1=0;class rs{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=D1++}toString(){let{name:l}=this;for(let r of this.modified)r.name&&(l=`${r.name}(${l})`);return l}static define(l,r){let c=typeof l=="string"?l:"?";if(l instanceof rs&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new rs(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(l){let r=new Mf(l);return c=>c.modified.indexOf(r)>-1?c:Mf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let O1=0;class Mf{constructor(l){this.name=l,this.instances=[],this.id=O1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(p=>p.base==l&&L1(r,p.modified));if(c)return c;let o=[],d=new rs(l.name,o,l,r);for(let p of r)p.instances.push(d);let h=z1(r);for(let p of l.set)if(!p.modified.length)for(let g of h)o.push(Mf.get(p,g));return d}}function L1(s,l){return s.length==l.length&&s.every((r,c)=>r==l[c])}function z1(s){let l=[[]];for(let r=0;r<s.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(s[r]));return l.sort((r,c)=>c.length-r.length)}function yN(s){let l=Object.create(null);for(let r in s){let c=s[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,p=o;for(let S=0;;){if(p=="..."&&S>0&&S+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(p);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),S+=v[0].length,S==o.length)break;let E=o[S++];if(S==o.length&&E=="!"){h=0;break}if(E!="/")throw new RangeError("Invalid path: "+o);p=o.slice(S)}let g=d.length-1,x=d[g];if(!x)throw new RangeError("Invalid path: "+o);let _=new zo(c,h,g>0?d.slice(0,g):null);l[x]=_.sort(l[x])}}return Ay.add(l)}const Ay=new Jt({combine(s,l){let r,c,o;for(;s||l;){if(!s||l&&s.depth>=l.depth?(o=l,l=l.next):(o=s,s=s.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new zo(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class zo{constructor(l,r,c,o){this.tags=l,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}zo.empty=new zo([],2,null);function Cy(s,l){let r=Object.create(null);for(let d of s)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}=l||{};return{style:d=>{let h=o;for(let p of d)for(let g of p.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function U1(s,l){let r=null;for(let c of s){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function H1(s,l,r,c=0,o=s.length){let d=new I1(c,Array.isArray(l)?l:[l],r);d.highlightRange(s.cursor(),c,o,"",d.highlighters),d.flush(o)}function B1(s,l,r,c,o,d=0,h=s.length){let p=d;function g(x,_){if(!(x<=p)){for(let S=s.slice(p,x),v=0;;){let E=S.indexOf(`
|
|
117
|
+
`,v),T=E<0?S.length:E;if(T>v&&c(S.slice(v,T),_),E<0)break;o(),v=E+1}p=x}}H1(l,r,(x,_,S)=>{g(x,""),g(_,S)},d,h),g(h,"")}class I1{constructor(l,r,c){this.at=l,this.highlighters=r,this.span=c,this.class=""}startSpan(l,r){r!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=r)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,r,c,o,d){let{type:h,from:p,to:g}=l;if(p>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(E=>!E.scope||E.scope(h)));let x=o,_=q1(l)||zo.empty,S=U1(d,_.tags);if(S&&(x&&(x+=" "),x+=S,_.mode==1&&(o+=(o?" ":"")+S)),this.startSpan(Math.max(r,p),x),_.opaque)return;let v=l.tree&&l.tree.prop(Jt.mounted);if(v&&v.overlay){let E=l.node.enter(v.overlay[0].from+p,1),T=this.highlighters.filter(z=>!z.scope||z.scope(v.tree.type)),R=l.firstChild();for(let z=0,X=p;;z++){let F=z<v.overlay.length?v.overlay[z]:null,G=F?F.from+p:g,O=Math.max(r,X),K=Math.min(c,G);if(O<K&&R)for(;l.from<K&&(this.highlightRange(l,O,K,o,d),this.startSpan(Math.min(K,l.to),x),!(l.to>=G||!l.nextSibling())););if(!F||G>c)break;X=F.to+p,X>r&&(this.highlightRange(E.cursor(),Math.max(r,F.from+p),Math.min(c,X),"",T),this.startSpan(Math.min(c,X),x))}R&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function q1(s){let l=s.type.prop(Ay);for(;l&&l.context&&!s.matchContext(l.context);)l=l.next;return l||null}const Se=rs.define,af=Se(),vi=Se(),hx=Se(vi),px=Se(vi),ji=Se(),rf=Se(ji),Ih=Se(ji),Js=Se(),tr=Se(Js),$s=Se(),Qs=Se(),cp=Se(),ko=Se(cp),cf=Se(),Ne={comment:af,lineComment:Se(af),blockComment:Se(af),docComment:Se(af),name:vi,variableName:Se(vi),typeName:hx,tagName:Se(hx),propertyName:px,attributeName:Se(px),className:Se(vi),labelName:Se(vi),namespace:Se(vi),macroName:Se(vi),literal:ji,string:rf,docString:Se(rf),character:Se(rf),attributeValue:Se(rf),number:Ih,integer:Se(Ih),float:Se(Ih),bool:Se(ji),regexp:Se(ji),escape:Se(ji),color:Se(ji),url:Se(ji),keyword:$s,self:Se($s),null:Se($s),atom:Se($s),unit:Se($s),modifier:Se($s),operatorKeyword:Se($s),controlKeyword:Se($s),definitionKeyword:Se($s),moduleKeyword:Se($s),operator:Qs,derefOperator:Se(Qs),arithmeticOperator:Se(Qs),logicOperator:Se(Qs),bitwiseOperator:Se(Qs),compareOperator:Se(Qs),updateOperator:Se(Qs),definitionOperator:Se(Qs),typeOperator:Se(Qs),controlOperator:Se(Qs),punctuation:cp,separator:Se(cp),bracket:ko,angleBracket:Se(ko),squareBracket:Se(ko),paren:Se(ko),brace:Se(ko),content:Js,heading:tr,heading1:Se(tr),heading2:Se(tr),heading3:Se(tr),heading4:Se(tr),heading5:Se(tr),heading6:Se(tr),contentSeparator:Se(Js),list:Se(Js),quote:Se(Js),emphasis:Se(Js),strong:Se(Js),link:Se(Js),monospace:Se(Js),strikethrough:Se(Js),inserted:Se(),deleted:Se(),changed:Se(),invalid:Se(),meta:cf,documentMeta:Se(cf),annotation:Se(cf),processingInstruction:Se(cf),definition:rs.defineModifier("definition"),constant:rs.defineModifier("constant"),function:rs.defineModifier("function"),standard:rs.defineModifier("standard"),local:rs.defineModifier("local"),special:rs.defineModifier("special")};for(let s in Ne){let l=Ne[s];l instanceof rs&&(l.name=s)}Cy([{tag:Ne.link,class:"tok-link"},{tag:Ne.heading,class:"tok-heading"},{tag:Ne.emphasis,class:"tok-emphasis"},{tag:Ne.strong,class:"tok-strong"},{tag:Ne.keyword,class:"tok-keyword"},{tag:Ne.atom,class:"tok-atom"},{tag:Ne.bool,class:"tok-bool"},{tag:Ne.url,class:"tok-url"},{tag:Ne.labelName,class:"tok-labelName"},{tag:Ne.inserted,class:"tok-inserted"},{tag:Ne.deleted,class:"tok-deleted"},{tag:Ne.literal,class:"tok-literal"},{tag:Ne.string,class:"tok-string"},{tag:Ne.number,class:"tok-number"},{tag:[Ne.regexp,Ne.escape,Ne.special(Ne.string)],class:"tok-string2"},{tag:Ne.variableName,class:"tok-variableName"},{tag:Ne.local(Ne.variableName),class:"tok-variableName tok-local"},{tag:Ne.definition(Ne.variableName),class:"tok-variableName tok-definition"},{tag:Ne.special(Ne.variableName),class:"tok-variableName2"},{tag:Ne.definition(Ne.propertyName),class:"tok-propertyName tok-definition"},{tag:Ne.typeName,class:"tok-typeName"},{tag:Ne.namespace,class:"tok-namespace"},{tag:Ne.className,class:"tok-className"},{tag:Ne.macroName,class:"tok-macroName"},{tag:Ne.propertyName,class:"tok-propertyName"},{tag:Ne.operator,class:"tok-operator"},{tag:Ne.comment,class:"tok-comment"},{tag:Ne.meta,class:"tok-meta"},{tag:Ne.invalid,class:"tok-invalid"},{tag:Ne.punctuation,class:"tok-punctuation"}]);const G1="modulepreload",Y1=function(s,l){return new URL(s,l).href},mx={},Ke=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.map(S=>Promise.resolve(S).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(_=>{if(_=Y1(_,c),_ in mx)return;mx[_]=!0;const S=_.endsWith(".css"),v=S?'[rel="stylesheet"]':"";if(!!c)for(let R=p.length-1;R>=0;R--){const z=p[R];if(z.href===_&&(!S||z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const T=document.createElement("link");if(T.rel=S?"stylesheet":G1,S||(T.as="script"),T.crossOrigin="",T.href=_,x&&T.setAttribute("nonce",x),document.head.appendChild(T),S)return new Promise((R,z)=>{T.addEventListener("load",R),T.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${_}`)))})}))}function d(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return o.then(h=>{for(const p of h||[])p.status==="rejected"&&d(p.reason);return l().catch(d)})},Ry={js:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-ggJz6TAQ.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Ke(async()=>{const{json:s}=await import("./index-ZyET8YfL.js");return{json:s}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Ke(async()=>{const{json:s}=await import("./index-ZyET8YfL.js");return{json:s}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Ke(async()=>{const{css:s}=await import("./index-CKo4-duU.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Ke(async()=>{const{css:s}=await import("./index-CKo4-duU.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Ke(async()=>{const{css:s}=await import("./index-CKo4-duU.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Ke(async()=>{const{html:s}=await import("./index-BgYZP6B5.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Ke(async()=>{const{html:s}=await import("./index-BgYZP6B5.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Ke(async()=>{const{html:s}=await import("./index-BgYZP6B5.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Ke(async()=>{const{html:s}=await import("./index-BgYZP6B5.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Ke(async()=>{const{markdown:s}=await import("./index-B8ioctog.js");return{markdown:s}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Ke(async()=>{const{markdown:s}=await import("./index-B8ioctog.js");return{markdown:s}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Ke(async()=>{const{python:s}=await import("./index-s31Rk-Wi.js");return{python:s}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Ke(async()=>{const{python:s}=await import("./index-s31Rk-Wi.js");return{python:s}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Ke(async()=>{const{yaml:s}=await import("./index-jRANpi-W.js");return{yaml:s}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Ke(async()=>{const{yaml:s}=await import("./index-jRANpi-W.js");return{yaml:s}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Ke(async()=>{const{rust:s}=await import("./index-Bug5lJuD.js");return{rust:s}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Ke(async()=>{const{cpp:s}=await import("./index-BoWGjyq1.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Ke(async()=>{const{cpp:s}=await import("./index-BoWGjyq1.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Ke(async()=>{const{cpp:s}=await import("./index-BoWGjyq1.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Ke(async()=>{const{cpp:s}=await import("./index-BoWGjyq1.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Ke(async()=>{const{cpp:s}=await import("./index-BoWGjyq1.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Ke(async()=>{const{java:s}=await import("./index-qJpQucwj.js");return{java:s}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Ke(async()=>{const{go:s}=await import("./index-B7uOCyzk.js");return{go:s}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Ke(async()=>{const{php:s}=await import("./index-BebgK8qS.js");return{php:s}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Ke(async()=>{const{sql:s}=await import("./index-D8i-20tT.js");return{sql:s}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Ke(async()=>{const{xml:s}=await import("./index-DzuxHBqN.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Ke(async()=>{const{xml:s}=await import("./index-DzuxHBqN.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},X1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},V1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function $1(s){const l=V1[s.toLowerCase()]??s.toLowerCase(),r=Ry[l];return r?r().catch(()=>null):null}async function Q1(s){const l=(s.split("/").pop()??"").toLowerCase(),r=X1[l]??l.split(".").pop()??"",c=Ry[r];return c?c().catch(()=>null):null}const K1=Cy([{tag:[Ne.keyword,Ne.modifier,Ne.controlKeyword,Ne.moduleKeyword],class:"cmh-key"},{tag:[Ne.propertyName],class:"cmh-prop"},{tag:[Ne.function(Ne.variableName),Ne.labelName],class:"cmh-fn"},{tag:[Ne.color,Ne.constant(Ne.name),Ne.standard(Ne.name),Ne.bool],class:"cmh-const"},{tag:[Ne.typeName,Ne.className,Ne.changed,Ne.annotation,Ne.self,Ne.namespace],class:"cmh-type"},{tag:[Ne.number,Ne.integer,Ne.float],class:"cmh-num"},{tag:[Ne.string,Ne.special(Ne.string),Ne.regexp],class:"cmh-str"},{tag:[Ne.operator,Ne.operatorKeyword,Ne.escape],class:"cmh-op"},{tag:[Ne.meta,Ne.comment],class:"cmh-comment"},{tag:Ne.invalid,class:"cmh-invalid"}]);function of(s){return s.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function Z1(s,l){const r=l?await $1(l):null;if(!r)return of(s);try{const c=r.language.parser.parse(s);let o="";return B1(s,c,K1,(d,h)=>{o+=h?`<span class="${h}">${of(d)}</span>`:of(d)},()=>{o+=`
|
|
118
|
+
`}),o}catch{return of(s)}}St.setOptions({gfm:!0,breaks:!1});function My(s){var r;const l=(r=s.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function If(s){const l=await St.parse(s,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await Z1(c.text,c.lang??""),c.escaped=!0}});return x1.sanitize(l)}function gx(s,l){return{path:s.path,text:s.content,saved:s.content,eol:s.eol,encoding:s.encoding,mtime:s.mtime,size:s.size,binary:s.binary,tooLarge:s.tooLarge,mediaMime:s.mediaMime,mediaTooLarge:s.mediaTooLarge,stale:!1,revision:l,previewMode:My(s.path)}}function Aa(s){return!s.binary&&!s.tooLarge&&s.text!==s.saved}function F1(s){return s.split("/").pop()??s}function dr(s){const l=s.lastIndexOf("/");return l===-1?"":s.slice(0,l)}function Tf(s){return s<1024?`${s} Б`:s<1024*1024?`${(s/1024).toFixed(1)} КБ`:`${(s/1024/1024).toFixed(1)} МБ`}function ar({x:s,y:l,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,p]=y.useState({left:s,top:l}),[g,x]=y.useState(()=>{const v=r.findIndex(E=>!E.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const E=v.getBoundingClientRect(),T=8,R=Math.max(T,Math.min(s,window.innerWidth-E.width-T)),z=Math.max(T,Math.min(l,window.innerHeight-E.height-T));p({left:R,top:z})},[s,l]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(T){var R;(R=d.current)!=null&&R.contains(T.target)||o()}function E(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",E,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",E,!0)}},[o]);function _(v){v.disabled||(v.onSelect(),o())}function S(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const E=r.map((T,R)=>({item:T,index:R})).filter(T=>!T.item.disabled);if(E.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,R=E.findIndex(X=>X.index===g),z=E[(((R===-1?0:R)+T)%E.length+E.length)%E.length];z&&x(z.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:S,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,E)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(E===g?" is-cursor":""),onMouseEnter:()=>x(E),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 J1=3500,W1=9e3,bx=220;function gr({result:s,onDismiss:l}){const[r,c]=y.useState(s),[o,d]=y.useState(!1);if(y.useEffect(()=>{if(!s){c(null),d(!1);return}if(c(s),d(!1),s.url)return;const p=s.ok?J1:W1,g=setTimeout(()=>d(!0),p),x=setTimeout(()=>c(null),p+bx);return()=>{clearTimeout(g),clearTimeout(x)}},[s]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},bx)};return i.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&i.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ea({value:s,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=y.useState(s),p=y.useRef(null);y.useEffect(()=>{var x;(x=p.current)==null||x.select()},[]);function g(){const x=d.trim();if(!x||x===s)return o();c(x)}return i.jsx("input",{ref:p,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:x=>h(x.target.value),onBlur:g,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&(x.preventDefault(),o())}})}function kc({active:s}){return s?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 P1=500,nr="application/x-ccv-fs-path",ej=200;function tj({open:s,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:p,onSearch:g,onReveal:x,onToggle:_,onOpen:S,onCreate:v,onRename:E,onMove:T,onCopy:R,onDelete:z,onRefresh:X,onClose:F,zoomed:G,onToggleZoom:O}){const[K,C]=y.useState(""),[D,H]=y.useState(null),[te,de]=y.useState(null),[J,ue]=y.useState(null),[je,Ce]=y.useState(null),[Ee,A]=y.useState(null),[ce,L]=y.useState(null),be=Uf("(hover: hover)"),ye=y.useRef(null),N=y.useMemo(()=>sj(d),[d]);function V(ne){return!(!J||ne===J.path||J.kind==="dir"&&ne.startsWith(`${J.path}/`)||ne===dr(J.path))}function re(ne){return!(!Ee||ne===Ee.path||Ee.kind==="dir"&&ne.startsWith(`${Ee.path}/`)||Ee.mode==="cut"&&ne===dr(Ee.path))}function me(ne){A({path:ne.path,kind:ne.kind,mode:"copy"})}function we(ne){A({path:ne.path,kind:ne.kind,mode:"cut"})}function ve(ne){!Ee||!re(ne)||(ne&&!r.has(ne)&&_(ne),Ee.mode==="cut"?(T(Ee.path,ne),A(null)):R(Ee.path,ne))}function De(ne,ge){const He=ne.touches[0];if(!He)return;const B={timer:0,x:He.clientX,y:He.clientY,el:ne.currentTarget,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,ge(B.x,B.y,B.el)},P1),ye.current=B}function xt(ne){const ge=ye.current,He=ne.touches[0];!ge||!He||Math.hypot(He.clientX-ge.x,He.clientY-ge.y)>10&&(window.clearTimeout(ge.timer),ye.current=null)}function Xe(ne){const ge=ye.current;ge&&(window.clearTimeout(ge.timer),ge.fired&&ne.preventDefault())}function Ve(){var ne;return(ne=ye.current)!=null&&ne.fired?(ye.current=null,!0):!1}function $e(ne,ge,He,B){C((B==null?void 0:B.path)??""),L({x:ne,y:ge,opener:He,entry:B})}function Wt(){const ne=ce==null?void 0:ce.opener;L(null),ne!=null&&ne.isConnected&&ne.focus()}function it(ne){return{onContextMenu:ge=>{ge.preventDefault(),$e(ge.clientX,ge.clientY,ge.currentTarget,ne)},onTouchStart:ge=>De(ge,(He,B,P)=>$e(He,B,P,ne)),onTouchMove:xt,onTouchEnd:Xe,onTouchCancel:Xe}}function un(ne){ne.target===ne.currentTarget&&(ne.preventDefault(),$e(ne.clientX,ne.clientY,ne.currentTarget,null))}function ut(ne){ne.target===ne.currentTarget&&De(ne,(ge,He,B)=>$e(ge,He,B,null))}function fn(ne){if(!(ne.ctrlKey||ne.metaKey)||ne.target instanceof HTMLInputElement)return;const ge=ne.key.toLowerCase();if(ge==="v"){ne.preventDefault(),ve(Ln());return}if(!K)return;const He=xx(l,K);He&&(ge==="c"?(ne.preventDefault(),me(He)):ge==="x"&&(ne.preventDefault(),we(He)))}function kn(ne){return ge=>{ge.dataTransfer.effectAllowed="move",ge.dataTransfer.setData(nr,ne.path),ue({path:ne.path,kind:ne.kind})}}function _n(){ue(null),Ce(null)}function Pt(ne){return ge=>{ge.dataTransfer.types.includes(nr)&&(ge.stopPropagation(),!(ne.kind!=="dir"||!V(ne.path))&&(ge.preventDefault(),Ce(ne.path)))}}function tt(ne){return ge=>{if(!ge.dataTransfer.types.includes(nr)||(ge.stopPropagation(),ne.kind!=="dir"||!V(ne.path)))return;ge.preventDefault();const He=ge.dataTransfer.getData(nr);Ce(null),He&&T(He,ne.path)}}function Pe(ne){!ne.dataTransfer.types.includes(nr)||!V("")||(ne.preventDefault(),Ce(""))}function en(ne){if(!ne.dataTransfer.types.includes(nr)||!V(""))return;ne.preventDefault();const ge=ne.dataTransfer.getData(nr);Ce(null),ge&&T(ge,"")}const[Vt,nt]=y.useState(""),wt=Vt.trim(),$t=wt.length>0,rn=y.useRef(null),kt=y.useRef(g);kt.current=g;function vn(ne){nt(ne),rn.current&&clearTimeout(rn.current);const ge=ne.trim();if(!ge){kt.current("");return}rn.current=setTimeout(()=>kt.current(ge),ej)}function It(ne){rn.current&&clearTimeout(rn.current),nt(""),kt.current(""),C(ne.path),x(ne)}const dn=$t&&(p==null?void 0:p.query)===wt?p:null;function Ln(){if(K==="")return"";const ne=xx(l,K);if((ne==null?void 0:ne.kind)==="dir")return K;const ge=K.lastIndexOf("/");return ge===-1?"":K.slice(0,ge)}function qt(ne,ge){const He=ge??Ln();He&&!r.has(He)&&_(He),de({parent:He,kind:ne})}function rt(){if(!ce)return[];const ne=B=>be?B:void 0;if(!ce.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ne("Ctrl+V"),disabled:!re(""),onSelect:()=>ve("")},{id:"new-file",label:"Создать файл",onSelect:()=>qt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>qt("dir","")}];const ge=ce.entry,He=[ge.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>S(ge.path)}:{id:"toggle",label:r.has(ge.path)?"Свернуть":"Развернуть",onSelect:()=>_(ge.path)},{id:"copy",label:"Копировать",hint:ne("Ctrl+C"),onSelect:()=>me(ge)},{id:"cut",label:"Вырезать",hint:ne("Ctrl+X"),onSelect:()=>we(ge)}];return ge.kind==="dir"&&(He.push({id:"paste",label:"Вставить",hint:ne("Ctrl+V"),disabled:!re(ge.path),onSelect:()=>ve(ge.path)}),He.push({id:"new-file",label:"Создать файл",onSelect:()=>qt("file",ge.path)}),He.push({id:"new-dir",label:"Создать каталог",onSelect:()=>qt("dir",ge.path)})),He.push({id:"rename",label:"Переименовать",onSelect:()=>H(ge.path)}),He.push({id:"delete",label:"Удалить",onSelect:()=>z(ge)}),He}const Et=$t?[]:Je("",0);function Je(ne,ge){const He=l[ne],B=[];if(te&&te.parent===ne&&B.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:Ca(ge),children:[i.jsx("span",{className:"fsrow__icon",children:te.kind==="dir"?i.jsx(Of,{}):i.jsx(Lf,{})}),i.jsx(ea,{className:"rename--file",value:"",placeholder:te.kind==="dir"?"имя каталога":"имя файла",onCommit:P=>{de(null),v(ne,te.kind,P)},onCancel:()=>de(null)})]},`draft:${ne}`)),!He)return B.push(i.jsx("p",{className:"fsrow__pending",style:Ca(ge),children:"читаем…"},`wait:${ne}`)),B;He.length===0&&!te&&B.push(i.jsx("p",{className:"fsrow__pending",style:Ca(ge),children:"пусто"},`empty:${ne}`));for(const P of He){const _e=P.kind==="dir"&&r.has(P.path);B.push(D===P.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:Ca(ge),children:[i.jsx("span",{className:"fsrow__icon",children:P.kind==="dir"?i.jsx(Of,{open:_e}):i.jsx(Lf,{})}),i.jsx(ea,{className:"rename--file",value:P.name,placeholder:"новое имя",onCommit:Be=>{H(null),E(P.path,Be)},onCancel:()=>H(null)})]},P.path):i.jsx(nj,{entry:P,depth:ge,open:_e,active:P.path===c,selected:P.path===K,dirty:o.has(P.path),gitStatus:N.get(P.path),dragging:(J==null?void 0:J.path)===P.path,dropTarget:je===P.path,cut:(Ee==null?void 0:Ee.mode)==="cut"&&Ee.path===P.path,onClick:()=>{Ve()||(C(P.path),P.kind==="dir"?_(P.path):S(P.path))},onRename:()=>H(P.path),onDelete:()=>z(P),onDragStart:kn(P),onDragEnd:_n,onDragOver:Pt(P),onDrop:tt(P),...it(P)},P.path)),_e&&B.push(...Je(P.path,ge+1))}return B}function _l(){if(!dn)return[i.jsx("p",{className:"fsrow__pending",style:Ca(0),children:"ищем…"},"search:wait")];if(dn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:Ca(0),children:"ничего не найдено"},"search:empty")];const ne=dn.entries.map(ge=>i.jsx(lj,{entry:ge,gitStatus:N.get(ge.path),onClick:()=>It(ge)},ge.path));return dn.truncated&&ne.push(i.jsxs("p",{className:"fsrow__pending",style:Ca(0),children:["показаны первые ",dn.entries.length," — уточните запрос"]},"search:truncated")),ne}return i.jsxs("aside",{className:(s?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(G?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:fn,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:ne=>{O&&(ne.target.closest("button")||O())},children:[i.jsx(cj,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>qt("file"),children:i.jsx(ij,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>qt("dir"),children:i.jsx(rj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:X,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:F,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(oj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:Vt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:ne=>vn(ne.target.value),onKeyDown:ne=>{ne.stopPropagation(),ne.key==="Escape"&&(ne.preventDefault(),Vt?vn(""):ne.currentTarget.blur())}}),Vt&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>vn(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(je===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Pe,onDrop:en,onContextMenu:un,onTouchStart:ut,onTouchMove:xt,onTouchEnd:Xe,onTouchCancel:Xe,children:$t?_l():Et}),i.jsx(gr,{result:h}),ce&&i.jsx(ar,{x:ce.x,y:ce.y,items:rt(),onClose:Wt})]})}function nj({entry:s,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:p,dropTarget:g,cut:x,onClick:_,onRename:S,onDelete:v,onDragStart:E,onDragEnd:T,onDragOver:R,onDrop:z,onContextMenu:X,onTouchStart:F,onTouchMove:G,onTouchEnd:O,onTouchCancel:K}){const C="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(s.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return i.jsxs("div",{className:C,style:Ca(l),draggable:!0,onDragStart:E,onDragEnd:T,onDragOver:R,onDrop:z,onContextMenu:X,onTouchStart:F,onTouchMove:G,onTouchEnd:O,onTouchCancel:K,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:Dy(s),children:[i.jsx("span",{className:"fsrow__icon"+Df("fsrow__icon",h),children:s.kind==="dir"?i.jsx(Of,{open:r}):i.jsx(Lf,{})}),i.jsx("span",{className:"fsrow__name"+Df("fsrow__name",h),children:s.name}),s.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":`Переименовать ${s.name}`,onClick:S,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${s.name}`,onClick:v,children:"✕"})]})}function lj({entry:s,gitStatus:l,onClick:r}){const c=s.path.slice(0,s.path.length-s.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(s.ignored?" fsrow--ignored":""),style:Ca(0),onClick:r,title:Dy(s),children:[i.jsx("span",{className:"fsrow__icon"+Df("fsrow__icon",l),children:s.kind==="dir"?i.jsx(Of,{}):i.jsx(Lf,{})}),i.jsx("span",{className:"fsrow__name"+Df("fsrow__name",l),children:s.name}),s.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function Dy(s){return s.ignored?`${s.path} — игнорируется git (.gitignore)`:s.path}function Ca(s){return{"--depth":s}}function xx(s,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=s[c])==null?void 0:o.find(d=>d.path===l))??null}function sj(s){const l=new Map,r={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||r[d]>r[h])&&l.set(o,d)};for(const o of s){const d=aj(o.status);if(!d)continue;c(o.path,d);let h=dr(o.path);for(;c(h,d),!!h;)h=dr(h)}return l}function aj(s){if(s==="??")return"added";const[l="",r=""]=s;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function Df(s,l){return l?` ${s}--git-${l}`:""}function Of({open:s=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:s?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 Lf(){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 ij(){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 rj(){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 cj(){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 oj(){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 uj=200;function fj({open:s,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[p,g]=y.useState(""),x=p.trim(),_=x.length>0,S=y.useRef(null),v=y.useRef(r);v.current=r;function E(z){g(z),S.current&&clearTimeout(S.current);const X=z.trim();if(!X){v.current("");return}S.current=setTimeout(()=>v.current(X),uj)}const T=_&&(l==null?void 0:l.query)===x?l:null;function R(){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 z=[];let X="";for(const F of T.matches)F.path!==X&&(X=F.path,z.push(i.jsx("p",{className:"searchgroup__path",title:F.path,children:F.path},`path:${F.path}`))),z.push(i.jsx(dj,{match:F,onClick:()=>c(F)},`${F.path}:${F.line}:${F.column}`));return T.truncated&&z.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),z}return i.jsxs("aside",{className:(s?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:z=>{h&&(z.target.closest("button")||h())},children:[i.jsx(hj,{}),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(pj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:z=>E(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Escape"&&(z.preventDefault(),p?E(""):z.currentTarget.blur())}}),p&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>E(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?R():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function dj({match:s,onClick:l}){const r=s.lineText.slice(0,s.column-1),c=s.lineText.slice(s.column-1,s.column-1+s.matchLength),o=s.lineText.slice(s.column-1+s.matchLength);return i.jsxs("button",{className:"searchmatch",onClick:l,title:`${s.path}:${s.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:s.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function hj(){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 pj(){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 uf=null;function mj(){return uf||(uf=Promise.all([Ke(()=>import("./index-DaeBIEG7.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Ke(()=>import("./index-891wE-Rj.js").then(s=>s.v),__vite__mapDeps([4,3]),import.meta.url),Ke(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Ke(()=>import("./index-CLUF7ja0.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ke(()=>import("./codemirror-wcb7BToF.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([s,l,r,c,o])=>({EditorView:l.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:s.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(s=>{throw uf=null,s})),uf}function gj({path:s,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),p=y.useRef(null),g=y.useRef(null),x=y.useRef(new Map),_=y.useRef(new Map),S=y.useRef(new Set),v=y.useRef(null),E=y.useRef(o),T=y.useRef(d),R=y.useRef(s),z=y.useRef(r),X=y.useRef(l);E.current=o,T.current=d,R.current=s,z.current=r,X.current=l;const[F,G]=y.useState("loading"),[O,K]=y.useState(!1);function C(H,te,de,J,ue){const je=x.current.get(J),Ce=_.current.get(J)===ue;if(je&&Ce)de.setState(je);else{const A=H.EditorState.create({doc:X.current,extensions:[H.basicSetup,H.Prec.highest(H.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(R.current),!0)}])),H.keymap.of([H.indentWithTab]),te.of([]),H.editorTheme,H.editorHighlight,H.EditorView.updateListener.of(ce=>{ce.docChanged&&E.current(R.current,ce.state.doc.toString())})]});x.current.set(J,A),_.current.set(J,ue),de.setState(A),S.current.delete(J)}if(S.current.has(J))return()=>{};let Ee=!1;return Q1(J).then(A=>{Ee||!A||R.current!==J||(de.dispatch({effects:te.reconfigure(A)}),x.current.set(J,de.state),S.current.add(J))}),()=>{Ee=!0}}y.useEffect(()=>{if(!h.current)return;let te=!1,de=null,J=null;G("loading"),K(!1);const ue=window.setTimeout(()=>{te||K(!0)},200);return(async()=>{let je;try{je=await mj()}catch{window.clearTimeout(ue),te||G("error");return}if(te||!h.current)return;window.clearTimeout(ue);const Ce=new je.Compartment;v.current=Ce,g.current=je,J=new je.EditorView({parent:h.current}),p.current=J,de=C(je,Ce,J,R.current,z.current),G("ready")})(),()=>{te=!0,window.clearTimeout(ue),de==null||de(),J==null||J.destroy(),p.current===J&&(p.current=null),g.current=null,v.current=null}},[]),y.useEffect(()=>{const H=g.current,te=p.current,de=v.current;if(!(!H||!te||!de))return C(H,de,te,s,r)},[s,r]);const D=y.useRef(0);return y.useEffect(()=>{const H=p.current,te=g.current;if(!H||!te||!c||c.token===D.current)return;D.current=c.token;const de=H.state.doc.lines,J=Math.min(Math.max(c.line,1),de),ue=H.state.doc.line(J),je=Math.min(ue.from+Math.max(c.column-1,0),ue.to);H.dispatch({selection:te.EditorSelection.cursor(je),effects:te.EditorView.scrollIntoView(je,{y:"center"})}),H.focus()},[c]),y.useEffect(()=>()=>{const H=p.current;H&&x.current.set(s,H.state)},[s]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(F==="ready"?"":" is-hidden")}),F==="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:"Загружается редактор…"})]}),F==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function Es({value:s,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[p,g]=y.useState(!1),[x,_]=y.useState(0),S=y.useRef(null),v=y.useRef(null),E=l.find(z=>z.value===s)??null;y.useEffect(()=>{if(!p)return;const z=l.findIndex(X=>X.value===s);_(z===-1?0:z)},[p]),y.useEffect(()=>{if(!p)return;function z(X){var F;(F=S.current)!=null&&F.contains(X.target)||g(!1)}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[p]),y.useEffect(()=>{var z,X;p&&((X=(z=v.current)==null?void 0:z.querySelector(".is-cursor"))==null||X.scrollIntoView({block:"nearest"}))},[p,x]),y.useEffect(()=>{if(!p)return;const z=v.current,X=bj(S.current);if(!z||!X)return;const F=z.getBoundingClientRect().bottom-X.getBoundingClientRect().bottom;F>0&&(X.scrollTop+=Math.min(F+8,z.offsetHeight))},[p]);function T(z){g(!1),z.value!==s&&r(z.value)}function R(z){if(z.key==="Escape"){if(!p)return;z.preventDefault(),z.stopPropagation(),g(!1);return}if(z.key==="ArrowDown"||z.key==="ArrowUp"){if(z.preventDefault(),!p)return g(!0);const X=z.key==="ArrowDown"?1:l.length-1;return _(F=>(F+X)%l.length)}if(z.key==="Enter"||z.key===" "){if(z.preventDefault(),!p)return g(!0);const X=l[x];X&&T(X)}}return i.jsxs("div",{ref:S,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>g(z=>!z),onKeyDown:R,children:[i.jsx("span",{className:"select__value",children:(E==null?void 0:E.label)??h}),i.jsx(xj,{})]}),p&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((z,X)=>i.jsxs("button",{type:"button",role:"option","aria-selected":z.value===s,className:"select__option"+(X===x?" is-cursor":"")+(z.value===s?" is-on":""),onMouseEnter:()=>_(X),onClick:()=>T(z),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:z.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:z.label}),z.hint&&i.jsx("span",{className:"select__hint",children:z.hint})]},z.value))})]})}function bj(s){let l=(s==null?void 0:s.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function xj(){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 yj(){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 _j(){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 vj(){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 jj({path:s,mime:l,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){y.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(s)},[]);const p=Sj(r,l);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Tf(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(s),children:"Повторить"})]}):p?l.startsWith("image/")?i.jsx(kj,{url:p}):l.startsWith("video/")?i.jsx(Tj,{url:p}):null:i.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[i.jsx("div",{className:"mediaview__progress",children:i.jsx("div",{className:"mediaview__progress-fill"})}),i.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function Sj(s,l){const[r,c]=y.useState(null);return y.useEffect(()=>{if(s===void 0){c(null);return}const o=atob(s),d=new Uint8Array(o.length);for(let p=0;p<o.length;p++)d[p]=o.charCodeAt(p);const h=URL.createObjectURL(new Blob([d],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[s,l]),r}const _i=1,Oy=8,ff=1.25;function wj(s){return Math.min(Oy,Math.max(_i,s))}function kj({url:s}){const[l,r]=y.useState({scale:_i,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function p(E,T,R){r(z=>{const X=wj(z.scale*E);if(X===z.scale)return z;if(X<=_i)return{scale:_i,x:0,y:0};const F=(T-z.x)/z.scale,G=(R-z.y)/z.scale;return{scale:X,x:T-X*F,y:R-X*G}})}y.useEffect(()=>{const E=d.current;if(!E)return;function T(R){R.preventDefault();const z=E.getBoundingClientRect(),X=R.clientX-z.left-z.width/2,F=R.clientY-z.top-z.height/2;p(R.deltaY<0?ff:1/ff,X,F)}return E.addEventListener("wheel",T,{passive:!1}),()=>E.removeEventListener("wheel",T)},[]);function g(E){l.scale<=_i||(E.currentTarget.setPointerCapture(E.pointerId),h.current={pointerId:E.pointerId,startX:E.clientX,startY:E.clientY,origX:l.x,origY:l.y},o(!0))}function x(E){const T=h.current;!T||T.pointerId!==E.pointerId||r(R=>({...R,x:T.origX+(E.clientX-T.startX),y:T.origY+(E.clientY-T.startY)}))}function _(){h.current=null,o(!1)}const S=l.scale>_i,v=!S&&l.x===0&&l.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(S?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:x,onPointerUp:_,onPointerCancel:_,children:i.jsx("img",{src:s,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:l.scale<=_i,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>p(1/ff,0,0),children:i.jsx(_j,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:l.scale>=Oy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>p(ff,0,0),children:i.jsx(yj,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:_i,x:0,y:0}),children:i.jsx(vj,{})})]})]})}const Nj=[{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 Tj({url:s}){const l=y.useRef(null),[r,c]=y.useState("1");return y.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:l,className:"mediaview__video",src:s,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(Es,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Nj})]})]})}function Ej({file:s,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:p}){const g=Aa(s),x=My(s.path)&&!s.binary&&!s.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:s.path,children:s.path}),i.jsxs("span",{className:"editor__meta",children:[Tf(s.size),s.eol==="crlf"&&" · CRLF"]}),x&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(s.previewMode?" is-on":""),role:"tab","aria-selected":s.previewMode,onClick:()=>!s.previewMode&&p(s.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(s.previewMode?"":" is-on"),role:"tab","aria-selected":!s.previewMode,onClick:()=>s.previewMode&&p(s.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(s.path),children:g?"Сохранить":"Сохранено"})]}),s.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(s.path),children:"Взять с диска"}),g&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(s.path),children:"Сохранить поверх"})]}),s.binary&&s.mediaMime?i.jsx(jj,{path:s.path,mime:s.mediaMime,base64:s.mediaBase64,error:s.mediaError,tooLarge:s.mediaTooLarge,size:s.size,onRequestMedia:h},s.path):s.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Tf(s.size)," на диске."]}):s.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Tf(s.size),"). Такие правит агент, а не браузер."]}):x&&s.previewMode?i.jsx(Aj,{text:s.text}):i.jsx(gj,{path:s.path,doc:s.text,revision:s.revision,goto:l,onChange:r,onSave:c})]})}function Aj({text:s}){const[l,r]=y.useState("");return y.useEffect(()=>{let c=!1;return If(s).then(o=>{c||r(o)}),()=>{c=!0}},[s]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function Cj({files:s,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:p=>{h&&(p.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[i.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&i.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),s.map(p=>i.jsxs("div",{className:"worktab"+(p.path===l?" is-on":""),role:"tab","aria-selected":p.path===l,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:F1(p.path)}),Aa(p)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path),children:"✕"})]},p.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:i.jsx(kc,{active:d})})]})}function is(s){return s.claudeSessionId??s.id}function df(s,l,r,c){if(!l||l.length===0)return s;const o=new Map(l.map((p,g)=>[p,g])),d=[],h=[];for(const p of s)(o.has(r(p))?d:h).push(p);return d.sort((p,g)=>o.get(r(p))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function yx(s){return s.state!=="closed"}function _x(s){return[...s.filter(yx),...s.filter(l=>!yx(l))]}function hf(s,l,r,c){if(l===r||!s.includes(l)||!s.includes(r))return null;const o=s.filter(p=>p!==l),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),l,...o.slice(d)];return h.every((p,g)=>p===s[g])?null:h}const Rj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Ly({className:s}){return i.jsx("img",{src:Rj,alt:"","aria-hidden":"true",className:s,style:{aspectRatio:"200 / 184"}})}const Mj=450,Dj=6,pf=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Oj({disabled:s,onStart:l}){const[r,c]=y.useState(!1),[o,d]=y.useState(0),[h,p]=y.useState({left:0,top:0}),g=y.useRef(null),x=y.useRef(null),_=y.useRef(null);function S(){_.current&&window.clearTimeout(_.current.timer),_.current=null}function v(){S(),d(0),c(!0)}function E(C){var D;c(!1),C&&((D=g.current)==null||D.focus())}function T(C){if(s||C.button!==0)return;const D={timer:0,x:C.clientX,y:C.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,v()},Mj),_.current=D}function R(C){const D=_.current;!D||D.fired||Math.hypot(C.clientX-D.x,C.clientY-D.y)>Dj&&S()}function z(){_.current&&!_.current.fired&&S()}function X(C){var D;if((D=_.current)!=null&&D.fired){_.current=null,C.preventDefault();return}s||l("claude")}function F(C){C.preventDefault(),!s&&v()}function G(C){if(s)return;(C.key==="ArrowDown"||C.key==="ArrowUp"||C.key==="Enter"&&C.shiftKey)&&(C.preventDefault(),v())}y.useLayoutEffect(()=>{if(!r)return;const C=g.current,D=x.current;if(!C||!D)return;const H=C.getBoundingClientRect(),te=D.getBoundingClientRect(),de=8,J=Math.max(de,Math.min(H.right-te.width,window.innerWidth-te.width-de));let ue=H.top-te.height-8;ue<de&&(ue=Math.min(H.bottom+8,window.innerHeight-te.height-de)),p({left:J,top:ue})},[r]),y.useLayoutEffect(()=>{var C;r&&((C=x.current)==null||C.focus())},[r]),y.useLayoutEffect(()=>{if(!r)return;function C(D){var te,de;const H=D.target;!((te=x.current)!=null&&te.contains(H))&&!((de=g.current)!=null&&de.contains(H))&&E(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[r]);function O(C){E(!1),l(C.id)}function K(C){if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),E(!0);return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){C.preventDefault();const D=C.key==="ArrowDown"?1:-1;d(H=>(H+D+pf.length)%pf.length);return}if(C.key==="Enter"||C.key===" "){C.preventDefault();const D=pf[o];D&&O(D);return}C.key==="Tab"&&E(!1)}return i.jsxs("div",{className:"newsession",children:[i.jsxs("button",{ref:g,type:"button",className:"btn btn--primary newsession__btn",disabled:s,title:"Удерживайте, чтобы выбрать агента","aria-haspopup":"menu","aria-expanded":r,onClick:X,onContextMenu:F,onPointerDown:T,onPointerMove:R,onPointerUp:z,onPointerCancel:z,onPointerLeave:z,onKeyDown:G,children:["+ Сессия",i.jsx(Lj,{})]}),r&&i.jsx("div",{ref:x,className:"newsession__menu",style:{left:h.left,top:h.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:K,children:pf.map((C,D)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(D===o?" is-cursor":""),onMouseEnter:()=>d(D),onClick:()=>O(C),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${C.id}`,"aria-hidden":"true",children:C.id==="antigravity"?i.jsx(Ly,{className:"newsession__mark-logo"}):i.jsx(zj,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:C.label}),i.jsx("span",{className:"newsession__hint",children:C.hint})]})]},C.id))})]})}function Lj(){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 zj(){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 zy="ccv:sidebar.collapsed",Uy="ccv:sidebar.mode",Hy="ccv:sidebar.foldersCollapsed",Uj=500,qh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function Hj({open:s,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:p,sessions:g,archived:x,pinned:_,live:S,listOrder:v,liveSessionsFirst:E,onReorder:T,activeWorkspaceId:R,activeSessionId:z,onSelectWorkspace:X,onSelectSession:F,onRenameSession:G,onStopSession:O,onPinSessions:K,onSelectPinned:C,onCloseWorkspaces:D,onRestoreWorkspaces:H,onArchiveSessions:te,onUnarchiveSessions:de,onCreateFolder:J,onRenameFolder:ue,onDeleteFolder:je,onAssignToFolder:Ce,onOpenWorkspace:Ee,onNewSession:A,onOpenExtensions:ce,account:L,onOpenAccount:be,relay:ye,onOpenRelay:N,onOpenSettings:V,themeMode:re,onCycleTheme:me}){var mt;const[we,ve]=y.useState(null),[De,xt]=y.useState(null),[Xe,Ve]=y.useState(null),[$e,Wt]=y.useState(""),[it,un]=y.useState(Wj),[ut,fn]=y.useState(Pj),[kn,_n]=y.useState(eS);function Pt(w){_n(w);try{localStorage.setItem(Uy,w)}catch{}}const tt=$e.trim().toLowerCase(),Pe=tt!=="",en=y.useMemo(()=>df(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),Vt=y.useMemo(()=>{const w=df(g,R?v==null?void 0:v.sessions[R]:void 0,is,"top");return E?_x(w):w},[g,v,R,E]),nt=y.useMemo(()=>{const w=df(_,v==null?void 0:v.pinned,is,"bottom");return E?_x(w):w},[_,v,E]),wt=y.useMemo(()=>df(S,v==null?void 0:v.live,is,"bottom"),[S,v]),$t=y.useMemo(()=>Pe?en.filter(w=>w.name.toLowerCase().includes(tt)||w.path.toLowerCase().includes(tt)):en,[en,tt,Pe]),rn=y.useMemo(()=>Pe?o.filter(w=>w.name.toLowerCase().includes(tt)||w.path.toLowerCase().includes(tt)):o,[o,tt,Pe]),kt=y.useMemo(()=>Pe?Vt.filter(w=>(w.title??"").toLowerCase().includes(tt)):Vt,[Vt,tt,Pe]),vn=y.useMemo(()=>Pe?x.filter(w=>(w.title??"").toLowerCase().includes(tt)):x,[x,tt,Pe]),It=w=>{var ae;return((ae=c.find(ke=>ke.id===w))==null?void 0:ae.name)??"—"},dn=w=>{var ae;return(ae=c.find(ke=>ke.id===w))==null?void 0:ae.path},Ln=y.useMemo(()=>Pe?nt.filter(w=>(w.title??"").toLowerCase().includes(tt)||It(w.workspaceId).toLowerCase().includes(tt)):nt,[nt,c,tt,Pe]),qt=y.useMemo(()=>Pe?wt.filter(w=>(w.title??"").toLowerCase().includes(tt)||It(w.workspaceId).toLowerCase().includes(tt)):wt,[wt,c,tt,Pe]),rt=!Pe;function Et(w){un(ae=>{const ke=ae.includes(w)?ae.filter(We=>We!==w):[...ae,w];try{localStorage.setItem(zy,JSON.stringify(ke))}catch{}return ke})}const Je=w=>!it.includes(w);function _l(w){fn(ae=>{const ke=ae.includes(w)?ae.filter(We=>We!==w):[...ae,w];try{localStorage.setItem(Hy,JSON.stringify(ke))}catch{}return ke})}const ne=w=>!ut.includes(w),ge=y.useMemo(()=>No($t,d),[$t,d]),He=y.useMemo(()=>No(rn,d),[rn,d]),B=y.useMemo(()=>No(kt,h),[kt,h]),P=y.useMemo(()=>No(vn,h),[vn,h]),_e=y.useMemo(()=>No(Ln,p,w=>w.pinnedFolderId),[Ln,p]),Be=y.useMemo(()=>({groups:[],ungrouped:qt}),[qt]),Gt=((v==null?void 0:v.workspaces.length)??0)>0,vl=R?(((mt=v==null?void 0:v.sessions[R])==null?void 0:mt.length)??0)>0:!1,Zn=((v==null?void 0:v.pinned.length)??0)>0,Fn=((v==null?void 0:v.live.length)??0)>0,Jn=mf({enabled:rt,scope:"workspaces",itemKey:w=>w.id,groups:ge.groups,ungrouped:ge.ungrouped,onReorder:T}),Kl=mf({enabled:rt,scope:"sessions",workspaceId:R??void 0,itemKey:is,groups:B.groups,ungrouped:B.ungrouped,onReorder:T}),Nn=mf({enabled:rt,scope:"pinned",itemKey:is,groups:_e.groups,ungrouped:_e.ungrouped,onReorder:T}),Ll=mf({enabled:rt,scope:"live",itemKey:is,groups:Be.groups,ungrouped:Be.ungrouped,onReorder:T}),fl=Yh($t),Wn=Yh(rn),Pn=Yh(kt),[tn,cn]=y.useState(null),[Lt,et]=y.useState(null),[Me,nn]=y.useState(null),[jn,Cs]=y.useState(null),[Yn,jl]=y.useState(null),Qt=y.useRef(null);function el(w,ae){const ke=w.touches[0];if(!ke)return;const We={timer:0,x:ke.clientX,y:ke.clientY,el:w.currentTarget,fired:!1};We.timer=window.setTimeout(()=>{We.fired=!0,ae(We.x,We.y,We.el)},Uj),Qt.current=We}function vt(w){const ae=Qt.current,ke=w.touches[0];!ae||!ke||Math.hypot(ke.clientX-ae.x,ke.clientY-ae.y)>10&&(window.clearTimeout(ae.timer),Qt.current=null)}function hn(w){const ae=Qt.current;ae&&(window.clearTimeout(ae.timer),ae.fired&&w.preventDefault())}function zn(){var w;return(w=Qt.current)!=null&&w.fired?(Qt.current=null,!0):!1}function pn(){const w=tn==null?void 0:tn.opener;cn(null),w!=null&&w.isConnected&&w.focus()}function zt(){const w=Lt==null?void 0:Lt.opener;et(null),w!=null&&w.isConnected&&w.focus()}function tl(){const w=Me==null?void 0:Me.opener;nn(null),w!=null&&w.isConnected&&w.focus()}function Rs(){const w=jn==null?void 0:jn.opener;Cs(null),w!=null&&w.isConnected&&w.focus()}function Yt(){const w=Yn==null?void 0:Yn.opener;jl(null),w!=null&&w.isConnected&&w.focus()}function dl(w){return{onContextMenu:ae=>{ae.preventDefault(),cn({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:fl.targetsFor(w)})},onTouchStart:ae=>el(ae,(ke,We,ft)=>cn({x:ke,y:We,opener:ft,ids:fl.targetsFor(w)})),onTouchMove:vt,onTouchEnd:hn,onTouchCancel:hn}}function os(w){return{onContextMenu:ae=>{ae.preventDefault(),et({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:Wn.targetsFor(w)})},onTouchStart:ae=>el(ae,(ke,We,ft)=>et({x:ke,y:We,opener:ft,ids:Wn.targetsFor(w)})),onTouchMove:vt,onTouchEnd:hn,onTouchCancel:hn}}function us(w){return{onContextMenu:ae=>{ae.preventDefault(),nn({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:Pn.targetsFor(w)})},onTouchStart:ae=>el(ae,(ke,We,ft)=>nn({x:ke,y:We,opener:ft,ids:Pn.targetsFor(w)})),onTouchMove:vt,onTouchEnd:hn,onTouchCancel:hn}}function Zl(w){return{onContextMenu:ae=>{ae.preventDefault(),Cs({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:[w.id]})},onTouchStart:ae=>el(ae,(ke,We,ft)=>Cs({x:ke,y:We,opener:ft,ids:[w.id]})),onTouchMove:vt,onTouchEnd:hn,onTouchCancel:hn}}function na(w){return{onContextMenu:ae=>{ae.preventDefault(),jl({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:[w.id]})},onTouchStart:ae=>el(ae,(ke,We,ft)=>jl({x:ke,y:We,opener:ft,ids:[w.id]})),onTouchMove:vt,onTouchEnd:hn,onTouchCancel:hn}}const Sl=g.filter(w=>w.state!=="closed").length,nl=tn?$t.find(w=>w.id===tn.ids[0]):void 0,Un=tn?[{id:"close",label:tn.ids.length>1?`Закрыть проекты (${tn.ids.length})`:"Закрыть проект",onSelect:()=>{D(tn.ids),fl.clear()}},...To({folders:d,ids:tn.ids,hasFolder:(nl==null?void 0:nl.folderId)!=null,assign:(w,ae)=>Ce("workspace",w,ae),onClear:()=>fl.clear(),onNewFolder:()=>Ve("workspace")}),...tn.ids.length===1&&rt?Jn.menuItems(tn.ids[0],Gt):[]]:[],Ut=tn?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(R&&tn.ids.includes(R)&&Sl>0?` в нём сейчас незавершённых сессий: ${Sl} — при закрытии они остановятся на хосте.`:""):void 0,zl=Lt?rn.find(w=>w.id===Lt.ids[0]):void 0,Ti=Lt?[{id:"restore",label:Lt.ids.length>1?`Вернуть проекты (${Lt.ids.length})`:"Вернуть проект",onSelect:()=>{H(Lt.ids),Wn.clear()}},...To({folders:d,ids:Lt.ids,hasFolder:(zl==null?void 0:zl.folderId)!=null,assign:(w,ae)=>Ce("workspace",w,ae),onClear:()=>Wn.clear(),onNewFolder:()=>Ve("workspace")})]:[],Fl=Lt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Xn=Me?kt.find(w=>w.id===Me.ids[0]):void 0,wl=(Xn==null?void 0:Xn.pinned)!==!0,Tn=Me?[...Me.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>ve(Me.ids[0])}]:[],{id:"pin",label:wl?Me.ids.length>1?`Закрепить (${Me.ids.length})`:"Закрепить":Me.ids.length>1?`Открепить (${Me.ids.length})`:"Открепить",onSelect:()=>{Xn&&K(Xn.workspaceId,Me.ids,wl),Pn.clear()}},{id:"archive",label:Me.ids.length>1?`Убрать в архив (${Me.ids.length})`:"Убрать в архив",onSelect:()=>{te(R,Me.ids),Pn.clear()}},...To({folders:h,ids:Me.ids,hasFolder:(Xn==null?void 0:Xn.folderId)!=null,assign:(w,ae)=>Ce("session",w,ae,R),onClear:()=>Pn.clear(),onNewFolder:()=>Ve("session")}),...Me.ids.length===1&&rt&&Xn?Kl.menuItems(is(Xn),vl):[]]:[],mn=Me?qh:void 0,jt=jn?Ln.find(w=>w.id===jn.ids[0]):void 0,Ul=jn?[{id:"rename",label:"Переименовать",onSelect:()=>ve(jn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{jt&&K(jt.workspaceId,[jt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{jt&&te(jt.workspaceId,[jt.id])}},...jt&&jt.workspaceId===R?To({folders:h,ids:[jt.id],hasFolder:jt.folderId!=null,assign:(w,ae)=>Ce("session",w,ae,jt.workspaceId),onClear:()=>{},onNewFolder:()=>Ve("session")}):[],...Gj(jt?To({folders:p,ids:[jt.id],hasFolder:jt.pinnedFolderId!=null,assign:(w,ae)=>Ce("pinned",w,ae),onClear:()=>{},onNewFolder:()=>Ve("pinned")}):[]),...rt&&jt?Nn.menuItems(is(jt),Zn):[]]:[],At=Yn?qt.find(w=>w.id===Yn.ids[0]):void 0,ll=Yn?[{id:"stop",label:"Остановить",onSelect:()=>{At&&O(At)}},{id:"rename",label:"Переименовать",onSelect:()=>ve(Yn.ids[0])},{id:"pin",label:(At==null?void 0:At.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{At&&K(At.workspaceId,[At.id],At.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{At&&te(At.workspaceId,[At.id])}},...rt&&At?Ll.menuItems(is(At),Fn):[]]:[];function he(w){return i.jsxs("div",{"data-row-key":w.id,className:ac(w.id===R,fl.selected.includes(w.id))+Jn.dropClass(w.id),...dl(w),children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...Jn.gripHandlers(w.id),children:i.jsx(gf,{})}),i.jsxs("button",{className:"row__main",onClick:ae=>{zn()||fl.click(ae,w,()=>X(w.id))},onKeyDown:ae=>Jn.onKeyDown(w.id,ae),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 k(w){return i.jsxs("div",{className:ac(w.id===R,Wn.selected.includes(w.id)),...os(w),children:[i.jsxs("button",{className:"row__main",onClick:ae=>{zn()||Wn.click(ae,w,()=>X(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:rS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>H([w.id]),children:"Вернуть"})]},w.id)}function Y(w){const ae=is(w);return i.jsx("div",{"data-row-key":ae,className:ac(w.id===z,Pn.selected.includes(w.id),w.provider==="antigravity")+Kl.dropClass(ae),...we===w.id?{}:us(w),children:we===w.id?i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:w.title??"",onCommit:ke=>{G(w,ke),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Kl.gripHandlers(ae),children:i.jsx(gf,{})}),i.jsxs("button",{className:"row__main",onClick:ke=>{zn()||Pn.click(ke,w,()=>F(w))},onKeyDown:ke=>Kl.onKeyDown(ae,ke),children:[i.jsx(bf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:It(w.workspaceId),projectPath:dn(w.workspaceId)}),i.jsx(Xh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{zn()||ve(w.id)},children:"✎"})]})},w.id)}function fe(w){return i.jsxs("div",{className:ac(w.id===z,!1,w.provider==="antigravity"),children:[i.jsxs("button",{className:"row__main",onClick:()=>F(w),children:[i.jsx(bf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:It(w.workspaceId),projectPath:dn(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:iS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>de([w.id]),children:"Вернуть"})]},w.id)}function Te(w){const ae=is(w);return i.jsx("div",{"data-row-key":ae,className:ac(w.id===z,!1,w.provider==="antigravity")+Nn.dropClass(ae),...we===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Zl(w)},children:we===w.id?i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:w.title??"",onCommit:ke=>{G(w,ke),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Nn.gripHandlers(ae),children:i.jsx(gf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{zn()||C(w)},onKeyDown:ke=>Nn.onKeyDown(ae,ke),children:[i.jsx(bf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:It(w.workspaceId),projectPath:dn(w.workspaceId)}),i.jsx(Xh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})},w.id)}function Oe(w){const ae=is(w);return i.jsx("div",{"data-row-key":ae,className:ac(w.id===z,!1,w.provider==="antigravity")+Ll.dropClass(ae),...we===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...na(w)},children:we===w.id?i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:w.title??"",onCommit:ke=>{G(w,ke),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ll.gripHandlers(ae),children:i.jsx(gf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{zn()||C(w)},onKeyDown:ke=>Ll.onKeyDown(ae,ke),children:[i.jsx(bf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:It(w.workspaceId),projectPath:dn(w.workspaceId)}),i.jsx(Xh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:ke=>{ke.stopPropagation(),!zn()&&O(w)},children:i.jsx(Kj,{})})]})},w.id)}function Le(w,ae){return i.jsx(Qj,{folder:w,count:ae,open:ne(w.id),renaming:De===w.id,onToggle:()=>_l(w.id),onStartRename:()=>xt(w.id),onCommitRename:ke=>{ue(w.id,ke),xt(null)},onCancelRename:()=>xt(null),onDelete:()=>je(w.id)},w.id)}return i.jsxs("aside",{className:s?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:l?"dot dot--on":"dot",title:r}),i.jsx("span",{className:"brand",children:"Claude Code Visual"}),i.jsx("button",{className:"theme-btn",title:`Тема: ${jx[re]}`,"aria-label":`Тема: ${jx[re]}. Переключить`,onClick:me,children:i.jsx(tS,{mode:re})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":kn==="default",className:kn==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Pt("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":kn==="pinned",className:kn==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Pt("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":kn==="live",className:kn==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Pt("live"),children:[i.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),S.length>0&&i.jsx("span",{className:"sidebar__tab-count",children:S.length})]})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(Fj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:$e,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>Wt(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),$e?Wt(""):w.currentTarget.blur())}}),$e&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Wt(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:kn==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Закреплённые",count:Ln.length,open:Je("pinned"),onToggle:()=>Et("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{Ve("pinned"),Je("pinned")||Et("pinned")}}}),Je("pinned")&&i.jsxs(i.Fragment,{children:[Xe==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:"",placeholder:"Название папки",onCommit:w=>{J("pinned",w),Ve(null)},onCancel:()=>Ve(null)})})}),Ln.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),_e.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ne(w.folder.id)&&w.items.map(ae=>Te(ae))]},w.folder.id)),_e.ungrouped.map(w=>Te(w))]})]}):kn==="live"?i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Запущенные",count:qt.length,open:Je("live"),onToggle:()=>Et("live")}),Je("live")&&i.jsxs(i.Fragment,{children:[qt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Нет запущенных сессий"})}),qt.map(w=>Oe(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Проекты",count:$t.length,open:Je("workspaces"),onToggle:()=>Et("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{Ve("workspace"),Je("workspaces")||Et("workspaces")}}}),Je("workspaces")&&i.jsxs(i.Fragment,{children:[Xe==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:"",placeholder:"Название папки",onCommit:w=>{J("workspace",w),Ve(null)},onCancel:()=>Ve(null)})})}),$t.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока ни одного"})}),ge.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ne(w.folder.id)&&w.items.map(ae=>he(ae))]},w.folder.id)),ge.ungrouped.map(w=>he(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Архив проектов",count:rn.length,open:Je("workspacesArchive"),onToggle:()=>Et("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),Je("workspacesArchive")&&i.jsxs(i.Fragment,{children:[rn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока пусто"})}),He.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ne(w.folder.id)&&w.items.map(ae=>k(ae))]},w.folder.id)),He.ungrouped.map(w=>k(w))]})]}),R&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Сессии",count:kt.length,open:Je("sessions"),onToggle:()=>Et("sessions"),action:{label:"Новая папка сессий",onClick:()=>{Ve("session"),Je("sessions")||Et("sessions")}}}),Je("sessions")&&i.jsxs(i.Fragment,{children:[Xe==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:"",placeholder:"Название папки",onCommit:w=>{J("session",w,R),Ve(null)},onCancel:()=>Ve(null)})})}),kt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока ни одной"})}),B.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ne(w.folder.id)&&w.items.map(ae=>Y(ae))]},w.folder.id)),B.ungrouped.map(w=>Y(w))]}),x.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Архив",count:vn.length,open:Je("archive"),onToggle:()=>Et("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Je("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),vn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока пусто"})}),P.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ne(w.folder.id)&&w.items.map(ae=>fe(ae))]},w.folder.id)),P.ungrouped.map(w=>fe(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:be,children:[i.jsx("span",{className:L!=null&&L.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:L===null?"Аккаунт":L.loggedIn?L.email||"Вход выполнен":"Войти в аккаунт"}),(L==null?void 0:L.plan)&&i.jsx("span",{className:"chip",children:L.plan})]}),N&&i.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:N,children:[i.jsx("span",{className:ye!=null&&ye.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:ye===null?"Удалённый доступ":ye.paired?ye.connected?ye.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(ye==null?void 0:ye.connected)&&ye.clients>0&&i.jsx("span",{className:"chip",children:ye.clients})]}),i.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!ce,title:"MCP-серверы и плагины",onClick:()=>ce==null?void 0:ce(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:V,children:"Настройки"}),i.jsx("button",{className:"btn btn--ghost",onClick:Ee,children:"+ Проект"}),i.jsx(Oj,{disabled:!R,onStart:A})]}),tn&&i.jsx(ar,{x:tn.x,y:tn.y,items:Un,note:Ut,onClose:pn}),Lt&&i.jsx(ar,{x:Lt.x,y:Lt.y,items:Ti,note:Fl,onClose:zt}),Me&&i.jsx(ar,{x:Me.x,y:Me.y,items:Tn,note:mn,onClose:tl}),jn&&i.jsx(ar,{x:jn.x,y:jn.y,items:Ul,note:qh,onClose:Rs}),Yn&&i.jsx(ar,{x:Yn.x,y:Yn.y,items:ll,note:qh,onClose:Yt})]})}function ac(s,l,r){const c=["row"];return s&&c.push("row--active"),l&&c.push("row--selected"),r&&c.push("row--antigravity"),c.join(" ")}function No(s,l,r=c=>c.folderId){const c=new Map(l.map(p=>[p.id,p])),o=new Map,d=[];for(const p of s){const g=r(p),x=g?c.get(g):void 0;if(!x){d.push(p);continue}const _=o.get(x.id);_?_.push(p):o.set(x.id,[p])}return{groups:[...o.entries()].map(([p,g])=>({folder:c.get(p),items:g})).sort((p,g)=>p.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:d}}function Bj(s,l,r){return[...s.flatMap(c=>c.items.map(r)),...l.map(r)]}const Ij="\0ungrouped";function qj(s,l,r){const c=new Map;for(const o of s)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of l)c.set(r(o),Ij);return c}function Gh(s,l,r,c,o){const d=[...l.map(p=>p.items),r].find(p=>p.some(g=>c(g)===s));if(!d)return null;const h=d.findIndex(p=>c(p)===s);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 mf(s){const[l,r]=y.useState(null),[c,o]=y.useState(null),d=y.useMemo(()=>Bj(s.groups,s.ungrouped,s.itemKey),[s.groups,s.ungrouped,s.itemKey]),h=y.useMemo(()=>qj(s.groups,s.ungrouped,s.itemKey),[s.groups,s.ungrouped,s.itemKey]);function p(){r(null),o(null)}function g(X,F){s.enabled&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),r(X),o(null))}function x(X,F){var D;if(!l)return;const G=(D=document.elementFromPoint(X,F))==null?void 0:D.closest("[data-row-key]"),O=G==null?void 0:G.dataset.rowKey;if(!O||O===l||h.get(O)!==h.get(l)){o(null);return}const K=G.getBoundingClientRect(),C=F-K.top<K.height/2?"before":"after";o(H=>(H==null?void 0:H.key)===O&&H.position===C?H:{key:O,position:C})}function _(X){x(X.clientX,X.clientY)}function S(){if(l&&c){const X=hf(d,l,c.key,c.position);X&&s.onReorder(s.scope,X,s.workspaceId)}p()}function v(X,F){if(!s.enabled)return;const G=Gh(X,s.groups,s.ungrouped,s.itemKey,F);if(!G)return;const O=hf(d,X,G.target,G.position);O&&s.onReorder(s.scope,O,s.workspaceId)}function E(X,F){const G=Gh(X,s.groups,s.ungrouped,s.itemKey,"up"),O=Gh(X,s.groups,s.ungrouped,s.itemKey,"down"),K=[{id:"move-up",label:"Переместить выше",disabled:!G,onSelect:()=>{if(!G)return;const C=hf(d,X,G.target,G.position);C&&s.onReorder(s.scope,C,s.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!O,onSelect:()=>{if(!O)return;const C=hf(d,X,O.target,O.position);C&&s.onReorder(s.scope,C,s.workspaceId)}}];return F&&K.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>s.onReorder(s.scope,null,s.workspaceId)}),K}function T(X){return l===X?" row--dragging":(c==null?void 0:c.key)===X?c.position==="before"?" row--drop-before":" row--drop-after":""}function R(X){return{onPointerDown:F=>g(X,F),onPointerMove:_,onPointerUp:S,onPointerCancel:p}}function z(X,F){!F.altKey||F.key!=="ArrowUp"&&F.key!=="ArrowDown"||(F.preventDefault(),v(X,F.key==="ArrowUp"?"up":"down"))}return{dragging:l!==null,dropClass:T,gripHandlers:R,onKeyDown:z,menuItems:E}}function To(s){return[...[...s.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{s.ids.forEach(c=>s.assign(c,r.id)),s.onClear()}})),...s.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{s.ids.forEach(r=>s.assign(r,null)),s.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:s.onNewFolder}]}function Gj(s){return s.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function Yh(s){const[l,r]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(p,g,x){if(p.ctrlKey||p.metaKey){r(_=>_.includes(g.id)?_.filter(S=>S!==g.id):[..._,g.id]),c.current=g.id;return}if(p.shiftKey&&c.current){const _=s.findIndex(v=>v.id===c.current),S=s.findIndex(v=>v.id===g.id);if(_!==-1&&S!==-1){const[v,E]=_<S?[_,S]:[S,_];r(s.slice(v,E+1).map(T=>T.id));return}}o(),c.current=g.id,x()}function h(p){return l.includes(p.id)?l:(r([p.id]),c.current=p.id,[p.id])}return{selected:l,click:d,targetsFor:h,clear:o}}const Yj={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},Xj={width:22,height:22,borderRadius:6};function ic({title:s,count:l,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${s}»`:`Развернуть «${s}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:Yj,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(By,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:s}),i.jsx("span",{className:"sidebar__count",children:l})]}),d&&i.jsx("button",{className:"theme-btn",style:Xj,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(Jj,{})})]})}const vx={paddingLeft:22},Vj={display:"flex",alignItems:"center",gap:6,width:"100%"},$j={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function Qj({folder:s,count:l,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:p,onDelete:g}){return c?i.jsx("div",{className:"row",style:vx,children:i.jsx("div",{className:"row__main",children:i.jsx(ea,{value:s.name,placeholder:"Название папки",onCommit:h,onCancel:p})})}):i.jsxs("div",{className:"row",style:vx,children:[i.jsxs("button",{className:"row__main",style:Vj,"aria-expanded":r,title:r?`Свернуть папку «${s.name}»`:`Развернуть папку «${s.name}»`,onClick:o,children:[i.jsx(By,{open:r}),i.jsx("span",{style:$j,children:s.name}),i.jsx("span",{className:"sidebar__count",children:l})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${s.name}»`,onClick:d,children:"✎"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${s.name}»`,onClick:g,children:"✕"})]})}function By({open:s}){return i.jsx("svg",{className:s?"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 gf(){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 Kj(){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 Zj({className:s}){return i.jsxs("svg",{className:s,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 Fj(){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 Jj(){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 Wj(){try{const s=localStorage.getItem(zy);if(s===null)return["archive","workspacesArchive"];const l=JSON.parse(s);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function Pj(){try{const s=localStorage.getItem(Hy);if(s===null)return[];const l=JSON.parse(s);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function eS(){try{const s=localStorage.getItem(Uy);return s==="pinned"||s==="live"?s:"default"}catch{return"default"}}const jx={system:"как в системе",light:"светлая",dark:"тёмная"};function tS({mode:s}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return s==="dark"?i.jsx("svg",{...l,children:i.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):s==="light"?i.jsxs("svg",{...l,children:[i.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),i.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):i.jsxs("svg",{...l,children:[i.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),i.jsx("path",{d:"M5.6 13.4h4.8"})]})}function nS(s){switch(s.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return s.backgroundWork?"работает в фоне":lS(s.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function lS(s){switch(s){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function sS(s){switch(s.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return s.backgroundWork?"background":aS(s.lastTurn);case"error":return"error";case"closed":return"closed"}}function aS(s){switch(s){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Xh({session:s,tail:l}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${sS(s)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),nS(s)]})," · ",l]})}function bf({title:s,pinned:l,provider:r,projectName:c,projectPath:o}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[l&&i.jsx(Zj,{className:"row__pin"}),r==="antigravity"&&i.jsx(Ly,{className:"row__provider"}),s]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function iS(s){const l=s.archivedAuto?"сама, по сроку молчания":"убрана вручную";return s.archivedAt?`${new Date(s.archivedAt).toLocaleString()} · ${l}`:l}function rS(s){return s.archivedAt?`закрыт ${new Date(s.archivedAt).toLocaleString()}`:"закрыт"}const Sx=3,cS=15e5;function Iy(s,l){if(!l||typeof l!="object")return null;const r=l,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(s==="Write"){if(typeof r.content!="string")return null;const o=Vh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(s==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=dS(oS(Vh(r.old_string),Vh(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 Vh(s){if(s==="")return[];const l=s.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function oS(s,l){let r=0;for(;r<s.length&&r<l.length&&s[r]===l[r];)r++;let c=s.length,o=l.length;for(;c>r&&o>r&&s[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...s.slice(0,r).map(d),...uS(s.slice(r,c),l.slice(r,o)),...s.slice(c).map(d)]}function uS(s,l){if(s.length===0&&l.length===0)return[];if(s.length===0)return l.map(_=>({type:"add",text:_}));if(l.length===0)return s.map(_=>({type:"del",text:_}));if((s.length+1)*(l.length+1)>cS)return[...s.map(_=>({type:"del",text:_})),...l.map(_=>({type:"add",text:_}))];const r=s.length,c=l.length,o=c+1,d=new Uint32Array((r+1)*o),h=(_,S)=>d[_*o+S]??0;for(let _=r-1;_>=0;_--)for(let S=c-1;S>=0;S--)d[_*o+S]=s[_]===l[S]?h(_+1,S+1)+1:Math.max(h(_+1,S),h(_,S+1));const p=[];let g=0,x=0;for(;g<r&&x<c;){const _=s[g],S=l[x];_===S?(p.push({type:"ctx",text:_}),g++,x++):h(g+1,x)>=h(g,x+1)?(p.push({type:"del",text:_}),g++):(p.push({type:"add",text:S}),x++)}for(;g<r;)p.push({type:"del",text:s[g++]});for(;x<c;)p.push({type:"add",text:l[x++]});return fS(p)}function fS(s){const l=[];let r=[];function c(){l.push(...r.filter(o=>o.type==="del")),l.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of s)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function dS(s){if(!s.some(d=>d.type!=="ctx"))return s;const l=s.map(()=>!1);s.forEach((d,h)=>{if(d.type!=="ctx")for(let p=Math.max(0,h-Sx);p<=Math.min(s.length-1,h+Sx);p++)l[p]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${hS(c.length)} без изменений`}),c=[]}return s.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function hS(s){const l=s%100;if(l>=11&&l<=14)return"строк";switch(s%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Sc(s){try{return await navigator.clipboard.writeText(s),!0}catch{}const l=document.createElement("textarea");l.value=s,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function op(){try{return await navigator.clipboard.readText()}catch{return null}}const Np=1600,hr="Копировать",hc="Скопировано";function Tp({text:s,hint:l,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Np);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[s]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?hc:`${hr} ${l}`,title:c?hc:`${hr} ${l}`,onClick:()=>{Sc(s).then(d=>{d&&o(!0)})},children:c?hc:hr})}function Ep({diff:s}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:s.filePath,children:s.filePath}),i.jsxs("span",{className:"diff__stat",children:[s.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",s.added]}),s.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",s.removed]})]})]}),s.note&&i.jsx("div",{className:"diff__note",children:s.note}),i.jsx("div",{className:"diff__body",children:s.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):s.rows.map((l,r)=>i.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function pS({waiting:s}){const[l,r]=y.useState(0);return y.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),i.jsxs("div",{className:s?"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:s?"ждёт разрешения":"думает"}),!s&&i.jsxs("span",{className:"work__time",children:[l," с"]})]})}function Ap({items:s,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:p,onEditMessage:g,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),S=y.useRef(null),v=y.useRef(!0),E=y.useRef(null),T=y.useRef(null),R=y.useRef(!1);y.useEffect(()=>{v.current=!0,E.current=null,R.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[p]),y.useEffect(()=>{const O=_.current,K=S.current;if(!O||!K)return;function C(te){!O||te===O.scrollTop||(R.current=!0,O.scrollTop=te)}function D(){if(!O)return;const te=E.current;if(te){const de=kx(O,te.id);if(de){const J=de.getBoundingClientRect().top-O.getBoundingClientRect().top;C(O.scrollTop+(J-te.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{E.current=null},500);return}v.current&&C(O.scrollHeight)}const H=new ResizeObserver(D);return H.observe(K),()=>{H.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function z(){const O=_.current;if(O){if(R.current){R.current=!1;return}v.current=O.scrollHeight-O.scrollTop-O.clientHeight<80}}function X(){if(d)return;const O=_.current,K=c[0];if(O&&K){const C=kx(O,K.id);C&&(E.current={id:K.id,top:C.getBoundingClientRect().top-O.getBoundingClientRect().top})}h==null||h()}let F=0;function G(O){return O.kind==="user"?F++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:z,children:i.jsxs("div",{className:"stream",ref:S,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:X,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(O=>i.jsx(wx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),c.length>0&&s.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&s.length===0&&i.jsx("p",{className:"empty",children:x}),s.map(O=>i.jsx(wx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),l&&i.jsx(pS,{waiting:r})]})})}function wx({item:s,userIndex:l,onEditMessage:r}){switch(s.kind){case"user":return i.jsx(gS,{item:s,userIndex:l,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":s.id,children:[i.jsx(bS,{text:s.text}),s.streaming&&i.jsx("span",{className:"caret"}),s.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(Tp,{text:s.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":s.id,children:s.text});case"tool":return i.jsx(yS,{item:s});case"result":return i.jsxs("div",{className:"result-line","data-item-id":s.id,children:[i.jsx("span",{children:s.isError?"✗ "+s.subtype:"✓ готово"}),i.jsxs("span",{children:[(s.durationMs/1e3).toFixed(1)," с"]}),s.costUsd!==null&&i.jsxs("span",{children:["$",s.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",Tx(s.inputTokens)," ↓",Tx(s.outputTokens)]})]});case"notice":return i.jsx("div",{className:s.tone==="error"?"notice notice--error":"notice","data-item-id":s.id,children:s.text})}}const mS=500;function gS({item:s,userIndex:l,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[p,g]=y.useState(s.text),x=y.useRef(null),_=Uf("(max-width: 860px)"),S=y.useRef(null);function v(D,H){o({x:D,y:H})}function E(D){D.preventDefault(),v(D.clientX,D.clientY)}function T(D){const H=D.touches[0];if(!H)return;const te={timer:0,x:H.clientX,y:H.clientY,fired:!1};te.timer=window.setTimeout(()=>{te.fired=!0,v(te.x,te.y)},mS),S.current=te}function R(D){const H=S.current,te=D.touches[0];!H||!te||Math.hypot(te.clientX-H.x,te.clientY-H.y)>10&&(window.clearTimeout(H.timer),S.current=null)}function z(D){const H=S.current;H&&(window.clearTimeout(H.timer),H.fired&&D.preventDefault())}function X(){g(s.text),h(!0)}function F(){h(!1)}function G(){const D=p.trim();D===""&&!(s.images&&s.images.length>0)||(r==null||r(l,D,s.images),h(!1))}y.useEffect(()=>{const D=x.current;!D||!d||(D.style.height="auto",D.style.height=`${D.scrollHeight}px`)},[p,d]),y.useEffect(()=>{if(!d)return;const D=x.current;D&&(D.focus(),D.setSelectionRange(D.value.length,D.value.length))},[d]);function O(D){if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),F();return}D.key==="Enter"&&!D.shiftKey&&!_&&(D.preventDefault(),G())}const K=s.images&&s.images.length>0&&i.jsx("div",{className:"msg--user__images",children:s.images.map((D,H)=>i.jsx("img",{className:"msg--user__image",src:`data:${D.mediaType};base64,${D.data}`,alt:"Вложение"},H))});if(d){const D=p.trim()!==""||!!(s.images&&s.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":s.id,children:[K,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:p,onChange:H=>g(H.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:F,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:G,disabled:!D,children:"Сохранить"})]})]})]})}const C=[{id:"copy",label:"Копировать",onSelect:()=>void Sc(s.text)},...r?[{id:"edit",label:"Изменить",onSelect:X}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":s.id,onContextMenu:E,onTouchStart:T,onTouchMove:R,onTouchEnd:z,onTouchCancel:z,children:[K,s.text,c&&i.jsx(ar,{x:c.x,y:c.y,items:C,onClose:()=>o(null)})]})}function kx(s,l){const r=s.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function bS({text:s}){const[l,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return If(s).then(h=>{d||r(xS(h))}),()=>{d=!0}},[s]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const p=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";p!==""&&Sc(p).then(_=>{if(!_)return;h.textContent=hc,h.setAttribute("aria-label",hc),h.classList.add("copybtn--done");const S=window.setTimeout(()=>{h.isConnected&&(h.textContent=hr,h.setAttribute("aria-label",up),h.classList.remove("copybtn--done"))},Np);c.current.push(S)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const up=`${hr} блок кода`;function xS(s){if(!s.includes("<pre"))return s;const l=new DOMParser().parseFromString(s,"text/html");for(const r of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",up),o.title=up,o.textContent=hr,c.append(o)}return l.body.innerHTML}function yS({item:s}){const[l,r]=y.useState(!1),c=s.result===null,o=Iy(s.name,s.input),d=s.name==="AskUserQuestion"?jS(s.input):null;return i.jsxs("div",{className:"tool"+(s.isError?" tool--error":"")+(s.awaitingPermission?" tool--wait":""),"data-item-id":s.id,children:[i.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__name",children:s.name}),i.jsx("span",{className:"tool__arg",children:d?vS(d):_S(s.input)}),i.jsx("span",{className:"tool__status",children:c?"…":s.isError?"ошибка":l?"▴":"▾"})]}),l&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(SS,{questions:d,answers:s.answers}):o?i.jsx(Ep,{diff:o}):i.jsx(Nx,{text:JSON.stringify(s.input,null,2),hint:"аргументы вызова"}),s.result!==null&&(!d||s.isError)&&i.jsx(Nx,{text:s.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Nx({text:s,hint:l,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:s}),i.jsx(Tp,{text:s,hint:l,className:"codeblock__copy"})]})}function _S(s){if(!s||typeof s!="object")return"";const l=s;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=l[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function vS(s){var r;const l=s.map(c=>c.header).filter(c=>c.length>0);return l.length===s.length?l.join(" · "):((r=s[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function jS(s){if(typeof s!="object"||s===null)return null;const l=s.questions;if(!Array.isArray(l)||l.length===0)return null;const r=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:p}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:_,description:S,preview:v}=x;if(typeof _!="string"||typeof S!="string")return null;g.push({label:_,description:S,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:p===!0})}return r}function SS({questions:s,answers:l}){return i.jsx("div",{className:"tool__questions",children:s.map((r,c)=>i.jsxs("div",{className:"tool__question",children:[i.jsxs("div",{className:"tool__question-head",children:[r.header&&i.jsx("span",{className:"chip chip--accent",children:r.header}),i.jsx("span",{className:"tool__question-text",children:r.question})]}),i.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?i.jsx("span",{className:"tool__answer-value",children:l[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Tx(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}const wS="ccv.dictation.lang",Ex="ru-RU";function kS(s){try{return Function.prototype.toString.call(s).includes("[native code]")}catch{return!1}}function Ax(){const s=window,l=[s.SpeechRecognition,s.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(kS);return!r&&l.length>0&&ks("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function qy(){var s;try{return((s=localStorage.getItem(wS))==null?void 0:s.trim())||Ex}catch{return Ex}}function ks(s,l){l===void 0?console.debug(`[dictation] ${s}`):console.debug(`[dictation] ${s}`,l)}const NS=3,TS=400,ES=5,AS=250,CS=2e3,RS=2e4;async function MS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const DS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${qy()}`};function OS(s){const[l]=y.useState(()=>Ax()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),p=y.useRef(!1),g=y.useRef(!1),x=y.useRef(s),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),S=y.useRef(null),v=y.useRef(!1),E=y.useRef(null),T=y.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=null},[]),R=y.useCallback(()=>{T();const O=async K=>{if(E.current=null,!(!p.current||v.current)){if(!K&&!await MS()){if(ks("ждём ответа на запрос доступа к микрофону"),!p.current||v.current)return;E.current=setTimeout(()=>void O(!0),RS);return}ks("движок не ответил на start()"),p.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};E.current=setTimeout(()=>void O(!1),CS)},[T]);y.useEffect(()=>{x.current=s}),y.useEffect(()=>{const O=Ax();if(!O)return;const K=new O;return K.lang=qy(),K.continuous=!0,K.interimResults=!0,K.onstart=()=>{ks("сессия открыта"),v.current=!0,T(),c(!0)},K.onaudiostart=()=>{ks("пошёл звук с микрофона"),_.current.audio=!0},K.onresult=C=>{var de;if(g.current)return;let D="",H="";for(let J=C.resultIndex;J<C.results.length;J++){const ue=C.results[J];if(!ue)continue;const je=((de=ue[0])==null?void 0:de.transcript)??"";ue.isFinal?D+=je:H+=je}const te=_.current;te.heard=!0,te.everHeard=!0,ks("распознано",{final:D,interim:H}),x.current(D,H)},K.onerror=C=>{_.current.lastError=C.error,ks("ошибка движка",C.error),!(C.error==="no-speech"||C.error==="aborted")&&(p.current=!1,c(!1),d(DS[C.error]??`Распознавание не работает: ${C.error}`))},K.onend=()=>{g.current=!1,v.current=!1;const C=_.current,D=Date.now()-C.openedAt;if(ks("сессия закрыта",{мс:D,звук:C.audio,слова:C.heard,ошибка:C.lastError||null}),!p.current){c(!1);return}if(C.dead=!C.audio&&D<TS?C.dead+1:0,C.dead>=ES){p.current=!1,c(!1),d(C.lastError?`Распознавание не работает: ${C.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}C.silent=C.heard?0:C.silent+1,!C.everHeard&&!C.warned&&C.silent>=NS&&(C.warned=!0,d(C.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),S.current=setTimeout(()=>{if(S.current=null,!!p.current){C.openedAt=Date.now(),C.audio=!1,C.heard=!1,C.lastError="",R();try{K.start()}catch{}}},AS)},h.current=K,()=>{p.current=!1,S.current&&clearTimeout(S.current),S.current=null,T(),K.onend=null,K.onresult=null,K.onerror=null,K.onstart=null,K.onaudiostart=null,K.abort(),h.current=null}},[]);const z=y.useCallback(()=>{var O;if(p.current){if(p.current=!1,ks("выключение микрофона"),S.current&&clearTimeout(S.current),S.current=null,T(),!v.current){c(!1);return}(O=h.current)==null||O.stop()}},[]),X=y.useCallback(()=>{const O=h.current;if(O){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),p.current=!0,g.current=!1,S.current&&clearTimeout(S.current),S.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),ks("включение микрофона",{язык:O.lang}),R();try{O.start()}catch(K){ks("start() не прошёл",K)}}},[R]),F=y.useCallback(()=>{p.current?z():X()},[X,z]),G=y.useCallback(()=>{var O;p.current&&v.current&&(g.current=!0,(O=h.current)==null||O.abort())},[]);return{supported:l,listening:r,error:o,toggle:F,stop:z,drop:G}}const LS="(max-width: 860px)",Cx=/^\/(\S*)$/,zS=new Set(["model","permissions"]);function US(s){return zS.has(s.name)||s.name.startsWith("__")}const HS=new Set(["clear","rename"]),Rx=/(?:^|\s)@([^\s@]*)$/,BS=200,IS=100,qS=190,GS=5,YS=20*1024*1024,XS=1568,VS=.85;let Mx=0;async function $S(s){var S,v;if(!s.type.startsWith("image/")||s.size>YS)return null;const l=await QS(s);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,XS/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(l.image,0,0,d.width,d.height),(v=(S=l.image).close)==null||v.call(S);const p=s.type==="image/png",g=p?"image/png":"image/jpeg",x=d.toDataURL(g,p?void 0:VS),_=x.slice(x.indexOf(",")+1);return _?(Mx+=1,{id:`att${Mx}`,mediaType:g,data:_,previewUrl:x}):null}async function QS(s){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(s);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(s),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),l(null)},c.src=r})}function Gy({disabled:s,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:p,sendLabel:g="Отправить",autoFocus:x=!1,attachmentsEnabled:_=!0,onContextSearch:S,onCommand:v,onSend:E,onInterrupt:T,onEscape:R}){var He;const z=Uf(LS),[X,F]=y.useState(()=>p?Rh(p):""),[G,O]=y.useState(!1),[K,C]=y.useState(0),D=y.useRef(null),H=y.useRef(null),te=y.useRef(null),[de,J]=y.useState(()=>p?Rh(p).length:0),[ue,je]=y.useState([]),Ce=y.useRef(null),Ee=y.useCallback(B=>{!_||B.length===0||Promise.all(B.map($S)).then(P=>{const _e=P.filter(Be=>Be!==null);_e.length!==0&&je(Be=>[...Be,..._e].slice(0,GS))})},[_]);function A(B){je(P=>P.filter(_e=>_e.id!==B))}function ce(B){var Be;if(!_)return;const P=(Be=B.clipboardData)==null?void 0:Be.items;if(!P)return;const _e=[];for(const Gt of P){if(!Gt.type.startsWith("image/"))continue;const vl=Gt.getAsFile();vl&&_e.push(vl)}_e.length!==0&&(B.preventDefault(),Ee(_e))}function L(B){const P=B.target.files?Array.from(B.target.files):[];B.target.value="",Ee(P)}y.useEffect(()=>{_||je([])},[_]);const[be,ye]=y.useState([]),[N,V]=y.useState(-1),re=y.useRef(""),[me,we]=y.useState(""),ve=OS(y.useCallback((B,P)=>{B&&F(_e=>$h(_e,B)),we(P.trim())},[])),De=me?$h(X,me):X;y.useEffect(()=>{ve.listening||me===""||(F(B=>$h(B,me)),we(""))},[ve.listening,me]),y.useEffect(()=>{var B;x&&((B=D.current)==null||B.focus())},[x]);const xt=y.useRef(new Map),Xe=y.useRef(new Map),Ve=y.useRef(p),$e=y.useRef({text:X,caret:de});$e.current={text:X,caret:de};const Wt=y.useCallback((B,P,_e)=>{P===""?(xt.current.delete(B),Xe.current.delete(B)):(xt.current.set(B,P),Xe.current.set(B,_e)),sy(B,P)},[]),it=ve.drop;y.useLayoutEffect(()=>{const B=Ve.current;if(B===p)return;Ve.current=p,B&&Wt(B,$e.current.text,$e.current.caret);const P=p?xt.current.get(p)??Rh(p):"",_e=p?Xe.current.get(p):void 0,Be=Math.min(_e??P.length,P.length);F(P),J(Be),te.current=[Be,Be],we(""),C(0),O(!1),V(-1),re.current="",je([]),it()},[p,Wt,it]),y.useEffect(()=>{p&&Wt(p,X,de)},[p,X,de,Wt]);const un=s?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",ut=y.useRef(0),fn=y.useCallback(B=>{const P=parseFloat(getComputedStyle(B).maxHeight),_e=Number.isFinite(P)&&P>0?P:qS;B.style.height="auto";const Be=B.scrollHeight;B.style.height=`${Math.min(Be,_e)}px`,B.style.overflowY=Be>_e?"auto":"hidden"},[]);y.useEffect(()=>{const B=D.current;B&&fn(B)},[De,un,s,fn]),y.useLayoutEffect(()=>{const B=D.current,P=te.current;!B||!P||(te.current=null,B.setSelectionRange(P[0],P[1]))}),y.useEffect(()=>{const B=D.current;if(!B)return;const P=new ResizeObserver(([_e])=>{const Be=_e==null?void 0:_e.contentRect.width;Be===void 0||Math.abs(Be-ut.current)<1||(ut.current=Be,fn(B))});return P.observe(B),()=>P.disconnect()},[fn]);const kn=ve.stop;y.useEffect(()=>{s&&kn()},[s,kn]);const _n=y.useMemo(()=>ve.error?{ok:!1,message:ve.error}:null,[ve.error]),Pt=y.useMemo(()=>{var _e;const B=(_e=Cx.exec(X))==null?void 0:_e[1];if(B===void 0)return[];const P=B.toLowerCase();return r.filter(Be=>!US(Be)&&Qh(Be,P)<Yy).sort((Be,Gt)=>Qh(Be,P)-Qh(Gt,P))},[X,r]),tt=!G&&Pt.length>0,Pe=Math.min(K,Pt.length-1),en=G?null:((He=Rx.exec(De.slice(0,de)))==null?void 0:He[1])??null,Vt=y.useRef(S);Vt.current=S,y.useEffect(()=>{if(en===null||en===""||en.endsWith("/")){Vt.current(en);return}const B=setTimeout(()=>Vt.current(en),BS);return()=>clearTimeout(B)},[en]);const nt=en!==null&&(o==null?void 0:o.query)===en,wt=nt?o.entries:[],$t=en!==null,rn=$t&&!nt,kt=Math.min(K,Math.max(wt.length-1,0));y.useEffect(()=>{var P,_e;if(!tt&&!$t)return;const B=tt?Pe:kt;(_e=(P=H.current)==null?void 0:P.children[B])==null||_e.scrollIntoView({block:"nearest"})},[tt,$t,Pe,kt]);function vn(B,P){var _e;F(B),J(P),te.current=[P,P],C(0),O(!1),me!==""&&(we(""),ve.drop()),(_e=D.current)==null||_e.focus()}function It(){F(""),we(""),C(0),J(0),O(!1),V(-1),re.current="",je([]),ve.drop(),p&&Wt(p,"",0)}function dn(B){const P=B.trim();P===""&&ue.length===0||s||(E(P,ue.length>0?ue.map(_e=>({mediaType:_e.mediaType,data:_e.data})):void 0),P!==""&&ye(_e=>[P,..._e.filter(Be=>Be!==P)].slice(0,IS)),It())}function Ln(B){if(B<-1||B>=be.length)return;N===-1&&(re.current=X);const P=B===-1?re.current:be[B]??"";V(B),vn(P,P.length)}function qt(){var Be;const B=((Be=D.current)==null?void 0:Be.selectionStart)??De.length,_e=`${B>0&&!/\s$/.test(De.slice(0,B))?" ":""}@`;vn(De.slice(0,B)+_e+De.slice(B),B+_e.length)}function rt(B){var Gt;const P=(Gt=Rx.exec(De.slice(0,de)))==null?void 0:Gt[1];if(P===void 0)return;const _e=de-P.length-1,Be=B.kind==="dir"?`@${B.path}/`:`@${B.path} `;vn(De.slice(0,_e)+Be+De.slice(de),_e+Be.length)}function Et(){var P;const B=(P=Cx.exec(De.trim()))==null?void 0:P[1];if(B&&v(B)){It();return}dn(De)}function Je(B,P){F(B),J(P),C(0),O(!1),V(-1),me!==""&&(we(""),ve.drop())}function _l(B){var Be;const P=HS.has(B.name)?c:null,_e=`/${B.name} `;F(_e+(P??"")),J(_e.length+((P==null?void 0:P.length)??0)),P&&(te.current=[_e.length,_e.length+P.length]),C(0),(Be=D.current)==null||Be.focus()}function ne(B){if(v(B.name)){F(""),C(0),O(!1);return}B.argumentHint?_l(B):dn(`/${B.name}`)}function ge(B){if(tt){if(B.key==="ArrowDown")return B.preventDefault(),C(P=>(Math.min(P,Pt.length-1)+1)%Pt.length);if(B.key==="ArrowUp"){B.preventDefault();const P=Pt.length-1;return C(_e=>(Math.min(_e,P)+P)%Pt.length)}if(B.key==="Enter"&&!B.shiftKey){B.preventDefault();const P=Pt[Pe];P&&ne(P);return}if(B.key==="Tab"){B.preventDefault();const P=Pt[Pe];P&&_l(P);return}if(B.key==="Escape"){B.preventDefault(),B.stopPropagation(),O(!0);return}}if($t){if(B.key==="ArrowDown"&&wt.length>0)return B.preventDefault(),C(P=>(Math.min(P,wt.length-1)+1)%wt.length);if(B.key==="ArrowUp"&&wt.length>0){B.preventDefault();const P=wt.length-1;return C(_e=>(Math.min(_e,P)+P)%wt.length)}if(B.key==="Enter"&&!B.shiftKey||B.key==="Tab"){const P=wt[kt];if(P){B.preventDefault(),rt(P);return}if(B.key==="Tab")return}if(B.key==="Escape"){B.preventDefault(),B.stopPropagation(),O(!0);return}}if((B.key==="ArrowUp"||B.key==="ArrowDown")&&!B.shiftKey){const P=B.currentTarget,_e=P.selectionStart;if(P.selectionEnd===_e){const Gt=B.key==="ArrowUp"?N+1:N-1;Gt>=-1&&Gt<be.length&&requestAnimationFrame(()=>{P.selectionStart===_e&&P.selectionEnd===_e&&Ln(Gt)})}}if(B.key==="Escape"&&R){B.preventDefault(),B.stopPropagation(),R();return}B.key==="Enter"&&!B.shiftKey&&!z&&(B.preventDefault(),Et())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(gr,{result:_n}),$t&&!tt&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:H,children:[wt.map((B,P)=>i.jsxs("button",{role:"option","aria-selected":P===kt,className:P===kt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>C(P),onMouseDown:_e=>{_e.preventDefault(),rt(B)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[B.name,B.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:B.path}),B.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},B.path)),wt.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:rn?"ищем…":en?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),tt&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:H,children:Pt.map((B,P)=>i.jsxs("button",{role:"option","aria-selected":P===Pe,className:P===Pe?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>C(P),onMouseDown:_e=>{_e.preventDefault(),ne(B)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",B.name]}),B.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:B.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:B.description})]},B.name))}),ue.length>0&&i.jsx("div",{className:"composer__attachments",children:ue.map(B=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:B.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>A(B.id),children:i.jsx(PS,{})})]},B.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:s,onClick:qt,children:i.jsx(FS,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Ce,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:L}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:s,onClick:()=>{var B;return(B=Ce.current)==null?void 0:B.click()},children:i.jsx(WS,{})})]}),i.jsx("textarea",{ref:D,value:De,disabled:s,placeholder:un,onChange:B=>Je(B.target.value,B.target.selectionStart),onSelect:B=>J(B.currentTarget.selectionStart),onKeyDown:ge,onPaste:ce}),ve.supported&&i.jsx("button",{type:"button",className:ve.listening?"micbtn is-on":"micbtn",title:ve.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":ve.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":ve.listening,disabled:s,onClick:ve.toggle,children:i.jsx(ew,{on:ve.listening})}),l?i.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Et,disabled:s||De.trim()===""&&ue.length===0,"aria-label":g,title:g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(JS,{})]})]})]})})}function $h(s,l){const r=l.trim();if(r==="")return s;const c=fp(r).slice(KS(s,r)).join(" ");return c===""?s:s===""||/\s$/.test(s)?s+c:`${s} ${c}`}function KS(s,l){const r=fp(s),c=fp(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>ZS(d,c[h]??"")))return o;return 0}function fp(s){return s.split(/\s+/).filter(l=>l!=="")}function ZS(s,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(s)===r(l)}function FS(){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 JS(){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 WS(){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 PS(){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 ew({on:s}){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:s?"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 Yy=4;function Qh(s,l){const r=s.name.toLowerCase();return r===l?0:r.startsWith(l)?1:s.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:Yy}function tw({request:s,queued:l,onDecide:r}){const c=Iy(s.toolName,s.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:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:s.toolName}),s.reason&&i.jsx("p",{className:"sheet__reason",children:s.reason}),c?i.jsx(Ep,{diff:c}):i.jsx("pre",{className:"code",children:JSON.stringify(s.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>r(s.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>r(s.requestId,"allow"),children:"Разрешить"})]})]})})}function nw({request:s,queued:l,onAnswer:r,onDecline:c}){const{questions:o}=s,[d,h]=y.useState(()=>o.map(()=>new Set)),[p,g]=y.useState(()=>o.map(()=>"")),[x,_]=y.useState(()=>Dx(o));y.useEffect(()=>{h(o.map(()=>new Set)),g(o.map(()=>"")),_(Dx(o))},[s.requestId]);const S=y.useMemo(()=>sw(o,d,p),[o,d,p]),v=S!==null;function E(G,O){var K,C;(C=(K=o[G])==null?void 0:K.options[O])!=null&&C.preview&&_(D=>{const H=D.slice();return H[G]=O,H})}function T(G,O,K){h(C=>{const D=C.slice(),H=new Set(D[G]);return K?H.has(O)?H.delete(O):H.add(O):H.has(O)||(H.clear(),H.add(O)),D[G]=H,D}),O!=="other"&&E(G,O)}function R(G,O){g(K=>{const C=K.slice();return C[G]=O,C})}function z(){S&&r(s.requestId,S)}function X(G){G.key==="Enter"&&(G.target.closest("button")||v&&(G.preventDefault(),z()))}function F(G){var D;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(G.key))return;const O=Array.from(G.currentTarget.querySelectorAll("button.qsheet__option")),K=O.indexOf(document.activeElement);if(K===-1)return;G.preventDefault();const C=G.key==="ArrowDown"||G.key==="ArrowRight"?1:-1;(D=O[(K+C+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:X,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})`,l>0&&` — ещё ${l} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[s.reason&&i.jsx("p",{className:"qsheet__reason",children:s.reason}),o.map((G,O)=>i.jsx(lw,{q:G,qi:O,selected:d[O]??new Set,otherText:p[O]??"",previewIndex:x[O]??null,onToggle:T,onFocusOption:E,onOtherText:R,onOptionsKeyDown:F},O))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>c(s.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:z,children:"Ответить"})]})]})})}function lw({q:s,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:p,onOptionsKeyDown:g}){var E;const x=s.options.some(T=>T.preview),_=o!==null?(E=s.options[o])==null?void 0:E.preview:void 0,S=r.has("other"),v=s.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:s.header}),i.jsx("span",{className:"qsheet__qtext",children:s.question})]}),i.jsxs("div",{className:"qsheet__options"+(s.multiSelect?"":" qsheet__options--radio"),role:s.multiSelect?"group":"radiogroup","aria-label":s.question,onKeyDown:g,children:[s.options.map((T,R)=>{const z=r.has(R);return i.jsxs("button",{type:"button",role:v,"aria-checked":z,className:"qsheet__option"+(z?" is-selected":""),onClick:()=>d(l,R,s.multiSelect),onFocus:()=>h(l,R),onMouseEnter:()=>h(l,R),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})]})]},R)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":S,className:"qsheet__option qsheet__option--other"+(S?" is-selected":""),onClick:()=>d(l,"other",s.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:"Свой вариант ответа"})]})]}),S&&i.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${s.question}»`,value:c,onChange:T=>p(l,T.target.value),autoFocus:!0})]})]}),x&&i.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Dx(s){return s.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function sw(s,l,r){const c={};for(let o=0;o<s.length;o++){const d=s[o];if(!d)continue;const h=l[o]??new Set,p=[];for(let g=0;g<d.options.length;g++){const x=d.options[g];x&&h.has(g)&&p.push(x.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&p.push(g)}if(p.length===0)return null;c[d.question]=p.join(", ")}return c}function aw({request:s,plan:l,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(l),[p,g]=y.useState("preview");y.useEffect(()=>{h(l),g("preview")},[s.requestId,l]);const x=d.trim().length>0;function _(){x&&c(s.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(rw,{})}),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"+(p==="preview"?" is-on":""),role:"tab","aria-selected":p==="preview",onClick:()=>g("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(p==="source"?" is-on":""),role:"tab","aria-selected":p==="source",onClick:()=>g("source"),children:"Код"})]})]}),i.jsxs("div",{className:"plansheet__body",children:[s.reason&&i.jsx("p",{className:"plansheet__reason",children:s.reason}),i.jsx("div",{className:"plansheet__content",children:p==="preview"?i.jsx(iw,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:S=>h(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(s.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!x,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function iw({text:s}){const[l,r]=y.useState("");return y.useEffect(()=>{let c=!1;return If(s).then(o=>{c||r(o)}),()=>{c=!0}},[s]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function rw(){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 cw(s,l){if(s!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function Xy({path:s}){const[l,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!l)return;function p(g){var x;(x=d.current)!=null&&x.contains(g.target)||r(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),y.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),Np);return()=>clearTimeout(p)},[c]),y.useEffect(()=>r(!1),[s]);async function h(){await Sc(s)&&o(!0)}return i.jsxs("div",{ref:d,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${s}`,onClick:()=>r(p=>!p),onKeyDown:p=>{p.key!=="Escape"||!l||(p.preventDefault(),p.stopPropagation(),r(!1))},children:[i.jsx(ow,{open:l}),i.jsx("span",{className:"cwd__short",children:s})]}),l&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:s}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?hc:hr})]})]})}function ow({open:s}){return i.jsx("svg",{className:s?"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 uw=["low","medium","high"];function Vy({models:s,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:p,onModel:g,onEffort:x,onUltracode:_,onThinking:S,onSwitchOnFlag:v}){const[E,T]=y.useState(!1),[R,z]=y.useState(0),X=y.useRef(null),F=y.useRef(null),G=s.find(H=>H.value===l)??null,O=G&&G.supportsEffort?G.effortLevels.length>0?G.effortLevels:uw:[],K=O.includes("xhigh");y.useEffect(()=>{if(!E)return;const H=s.findIndex(te=>te.value===l);z(H===-1?0:H)},[E]),y.useEffect(()=>{if(!E)return;function H(te){var de;(de=X.current)!=null&&de.contains(te.target)||T(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[E]),y.useEffect(()=>{var H,te;E&&((te=(H=F.current)==null?void 0:H.querySelector(".is-cursor"))==null||te.scrollIntoView({block:"nearest"}))},[E,R]);function C(H){T(!1),H.value!==l&&g(H.value)}function D(H){if(H.key==="Escape"){if(!E)return;H.preventDefault(),H.stopPropagation(),T(!1);return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){if(H.preventDefault(),!E)return T(!0);if(s.length===0)return;const te=H.key==="ArrowDown"?1:s.length-1;return z(de=>(de+te)%s.length)}if(H.key==="Enter"||H.key===" "){if(H.preventDefault(),!E)return T(!0);const te=s[R];te&&C(te)}}return i.jsxs("div",{ref:X,className:"select"+(E?" select--open":"")+(p?` ${p}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":E,onClick:()=>T(H=>!H),onKeyDown:D,children:[(G==null?void 0:G.displayName)??l?i.jsx("span",{className:"select__value",children:(G==null?void 0:G.displayName)??l}):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(fw,{})]}),E&&i.jsxs("div",{ref:F,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),s.map((H,te)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":H.value===l,className:"select__option"+(te===R?" is-cursor":"")+(H.value===l?" is-on":""),onMouseEnter:()=>z(te),onClick:()=>C(H),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:H.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:H.displayName}),H.description&&i.jsx("span",{className:"select__hint",children:H.description})]},H.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(H=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":H===r,className:H===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(H),children:H},H))})]}),K&&i.jsx(Kh,{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(Kh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>S(!o)}),h&&i.jsx(Kh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function Kh({label:s,desc:l,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[i.jsxs("span",{className:"modelmenu__label",children:[s,i.jsx("span",{className:"modelmenu__desc",children:l})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function fw(){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 yl({title:s,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function p(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const _=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),S=_[0],v=_[_.length-1];!S||!v||(g.shiftKey&&document.activeElement===S?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),S.focus()))}return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[d]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&d()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":s,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:s}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:l}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function dw({candidates:s,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:p,onAskAgent:g,onInterrupt:x,onSubmit:_,onCreate:S,onClose:v}){const[E,T]=y.useState("open"),[R,z]=y.useState(""),[X,F]=y.useState(!1),[G,O]=y.useState(""),[K,C]=y.useState(""),[D,H]=y.useState({git:!0,claudeMd:!0,readme:!0}),te=R.trim(),de=te!=="",J=G.trim(),ue=K.trim(),je=J!==""&&ue!=="";y.useEffect(()=>{G===""&&d.length>0&&O(d[0])},[d]);const Ce=y.useRef(p);Ce.current=p,y.useEffect(()=>{if(E!=="open")return;const L=R.trim(),be=setTimeout(()=>Ce.current(L),200);return()=>clearTimeout(be)},[R,E]);function Ee(){de&&_(te)}function A(){je&&S(J,ue,D)}function ce(){de&&(F(!0),g(te))}return h?i.jsxs(yl,{title:"Новый проект",onClose:v,actions:i.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[i.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),i.jsx("p",{className:"newproj__preview",children:h.path}),i.jsx("div",{className:"modal__error",children:i.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(L=>i.jsx("li",{children:L},L))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(yl,{title:"Новый проект",className:X&&E==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),E==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!de,onClick:ce,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!de,onClick:Ee,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!je,onClick:A,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Ox,{label:"Открыть",on:E==="open",onClick:()=>T("open")}),i.jsx(Ox,{label:"Создать",on:E==="create",onClick:()=>T("create")})]}),E==="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:R,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:L=>z(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),Ee())}}),o&&i.jsx("p",{className:"modal__error",children:o}),s.length>0&&i.jsx("ul",{className:"finds",children:s.map(L=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:L.open,title:L.open?"Этот проект уже открыт":L.path,onClick:()=>z(L.path),onDoubleClick:()=>_(L.path),children:[i.jsx("span",{className:"find__name",children:L.name}),i.jsx("span",{className:"find__path",children:L.path}),i.jsx("span",{className:"find__note",children:mw(L)})]})},L.path))}),s.length===0&&de&&!l&&!X&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),X&&i.jsx("div",{className:"finds__agent",children:i.jsx(Ap,{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:L=>O(L.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(L=>i.jsx("button",{type:"button",className:L===J?"newproj__root is-on":"newproj__root",title:L,onClick:()=>O(L),children:pw(L)},L))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:K,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:L=>C(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),A())}}),i.jsx("p",{className:"newproj__preview",children:je?hw(J,ue):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Zh,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>H(L=>({...L,git:!L.git}))}),i.jsx(Zh,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>H(L=>({...L,claudeMd:!L.claudeMd}))}),i.jsx(Zh,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>H(L=>({...L,readme:!L.readme}))})]})]})]})}function Ox({label:s,on:l,onClick:r}){return i.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:s})}function Zh({label:s,desc:l,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[i.jsxs("span",{className:"newproj__optlabel",children:[s,i.jsx("span",{className:"newproj__optdesc",children:l})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function hw(s,l){const r=s.includes("\\")?"\\":"/";return s.replace(/[\\/]+$/,"")+r+l}function pw(s){const l=s.includes("\\")?"\\":"/",r=s.split(/[\\/]/).filter(Boolean);return r.length<=2?s:`…${l}${r.slice(-2).join(l)}`}function mw(s){return s.open?"уже открыт":s.why?s.why:s.sessions===0?"рядом с вашими проектами":`${gw(s.sessions)}${bw(s.lastUsedAt)}`}function gw(s){const l=s%10,r=s%100;return r>=11&&r<=14?`${s} сессий`:l===1?`${s} сессия`:l>=2&&l<=4?`${s} сессии`:`${s} сессий`}function bw(s){if(!s)return"";const l=Math.floor((Date.now()-s)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(s).toLocaleDateString("ru-RU")}`}const Cp=7;function xw(s){const l=[],r=[];let c=1;for(const o of s){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=Lx(l),l[h]=o.hash);const[p,...g]=o.parents;l[h]=p??null;const x=[];p!==void 0&&x.push({from:h,to:h});for(const v of g){let E=l.indexOf(v);E===-1&&(E=Lx(l),l[E]=v),x.push({from:h,to:E})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.push({from:v,to:h}),v!==h&&(l[v]=null));const S=[];for(let v=0;v<d.length;v++){const E=d[v];!E||E===o.hash||v===h||l[v]===E&&S.push(v)}yw(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:_,down:x,through:S})}return{rows:r,columns:Math.min(c,Cp)}}function Lx(s){const l=s.indexOf(null);return l!==-1?l:(s.push(null),s.length-1)}function yw(s){for(;s.length>0&&s[s.length-1]===null;)s.pop()}const $y=1500;function _w(s){const l=[];let r=!1;for(const c of s.patch.split(`
|
|
119
|
+
`)){if(l.length>=$y){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:vw(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:s.path||s.oldPath,rows:l,added:s.added,removed:s.removed,note:jw(s,r)}}function vw(s){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(s);if(!l)return s;const r=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function jw(s,l){const r=[];return s.status==="added"&&r.push("новый файл"),s.status==="deleted"&&r.push("файл удалён"),s.status==="renamed"&&r.push(`переименован из ${s.oldPath}`),s.binary?r.push("двоичный файл"):s.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${$y} строк`),r.length>0?r.join(" · "):null}function Sw({open:s,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:p,onPush:g,onPull:x,onPublish:_,onConnectRemote:S,onDismissResult:v,onClose:E,zoomed:T,onToggleZoom:R}){const z=xw((l==null?void 0:l.commits)??[]),X=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(F=>({value:F.name,label:F.name,hint:F.hash.slice(0,8)}))];return i.jsxs("aside",{className:(s?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:F=>{R&&(F.target.closest("button")||R())},children:[i.jsx(Ew,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),R&&i.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:R,children:i.jsx(kc,{active:T})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:E,children:"✕"})]}),l===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"gitbar",children:i.jsx(Es,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:X,onChange:F=>{F&&p(F,`ветку ${F}`)}})}),l.detached&&i.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),i.jsx("div",{className:"gitbar__actions",children:o?i.jsxs("p",{className:"gitbar__busy",children:[i.jsx(Mw,{}),o]}):l.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(Aw,{}),"Отправить",l.ahead>0&&i.jsx("span",{className:"gitbar__count",children:l.ahead})]}),i.jsxs("div",{className:"gitbar__group",children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[i.jsx(Cw,{}),"Забрать",l.behind>0&&i.jsx("span",{className:"gitbar__count",children:l.behind})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:i.jsx(Rw,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(Ux,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:S,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${Lw(l.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(F=>Ow(F.path)).join(", "):"незакоммиченных изменений нет"})]})}),z.rows.map(F=>i.jsx(ww,{row:F,columns:z.columns,head:F.commit.hash===l.head,local:l.hasRemote&&!F.commit.pushed,active:c===F.commit.hash,onOpen:()=>h(F.commit.hash)},F.commit.hash)),z.rows.length===0&&i.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):i.jsxs("div",{className:"gitempty",children:[i.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[i.jsx(Ux,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(gr,{result:r,onDismiss:v})]})}const Eo=50,zx=13;function ww({row:s,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=s,p=h.refs.map(Dw).filter(Boolean);return i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[i.jsx(kw,{row:s,columns:l,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[p.map(g=>i.jsx("span",{className:"gitrow__ref",children:g},g)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",zw(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function kw({row:s,columns:l,head:r,local:c}){const o=l*zx+6,d=Eo/2,h=x=>8+Math.min(x,Cp-1)*zx,p=c?"3.5 2.5":void 0,g=xf(s.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:Eo,viewBox:`0 0 ${o} ${Eo}`,"aria-hidden":"true",children:[s.through.map(x=>i.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Eo,style:{stroke:xf(x)}},`t${x}`)),s.up.map((x,_)=>i.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:xf(x.from),strokeDasharray:p}},`u${_}`)),s.down.map((x,_)=>i.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Eo}`,fill:"none",style:{stroke:xf(x.to),strokeDasharray:p}},`d${_}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(s.col),cy:d,r:s.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(s.col),cy:d,r:s.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function xf(s){return`var(--lane-${s%Cp})`}function Nw({detail:s,local:l,onCheckout:r,onClose:c}){const o=s.hash==="";return i.jsxs(yl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${s.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(s.hash,`коммит ${s.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:s.subject}),i.jsxs("p",{className:"commit__meta",children:[s.author,s.email&&` <${s.email}>`," · ",Uw(s.date)," ·"," ",i.jsx("span",{className:"commit__hash",children:s.hash})]}),l&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),s.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[s.parents.length>1?"слияние: ":"родитель: ",s.parents.map(d=>d.slice(0,8)).join(", ")]}),s.body&&i.jsx("pre",{className:"commit__body",children:s.body})]}),s.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),s.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):s.files.map(d=>i.jsx(Tw,{file:d,defaultOpen:s.files.length<=3},d.path+d.oldPath))]})}function Tw({file:s,defaultOpen:l}){const[r,c]=y.useState(l);return i.jsxs("div",{className:"commit__file",children:[i.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"commit__filepath",children:s.path||s.oldPath}),i.jsxs("span",{className:"diff__stat",children:[s.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",s.added]}),s.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",s.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(Ep,{diff:_w(s)})]})}function Ew(){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 Aw(){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 Cw(){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 Rw(){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 Ux(){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 Mw(){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 Dw(s){return s.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Ow(s){const l=s.split("/");return l[l.length-1]??s}function Lw(s){const l=s%100;if(l>=11&&l<=14)return"файлов";switch(s%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function zw(s){const l=Date.parse(s);if(Number.isNaN(l))return s;const r=Math.round((Date.now()-l)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Uw(s){const l=Date.parse(s);return Number.isNaN(l)?s:new Date(l).toLocaleString()}function Hx(s){return s.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Hw({status:s,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:p,onSaveToken:g,onPublish:x,onDismissResult:_,onClose:S}){var L;const[v,E]=y.useState(()=>Hx(c)),[T,R]=y.useState(""),[z,X]=y.useState(""),[F,G]=y.useState(!0),[O,K]=y.useState("Первый коммит"),[C,D]=y.useState(null),[H,te]=y.useState("");y.useEffect(()=>{!T&&l.length>0&&R(l[0].login)},[T,l]),y.useEffect(()=>{r&&C===null&&D(new Set(r.files))},[r,C]);const de=(s==null?void 0:s.connected)===!0,J=l.map(be=>({value:be.login,label:be.login,hint:be.kind==="org"?"организация":void 0})),ue=y.useMemo(()=>{if(!r)return[];const be=H.trim().toLowerCase();return be?r.files.filter(ye=>ye.toLowerCase().includes(be)):r.files},[r,H]),je=(C==null?void 0:C.size)??0,Ce=de&&v.trim()!==""&&T!==""&&d===""&&(o||je>0);function Ee(be){D(ye=>{const N=new Set(ye??[]);return N.has(be)?N.delete(be):N.add(be),N})}function A(be){D(ye=>{const N=new Set(ye??[]);for(const V of ue)be?N.add(V):N.delete(V);return N})}function ce(){if(!Ce)return;const be=(r==null?void 0:r.files)??[];x({owner:T,name:v.trim(),description:z.trim(),private:F,include:o?[]:be.filter(ye=>C==null?void 0:C.has(ye)),ignore:o?[]:be.filter(ye=>!(C!=null&&C.has(ye))),message:o?"":O.trim()||"Первый коммит"})}return i.jsxs(yl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:S,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:S,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!Ce,onClick:ce,children:d||"Опубликовать"})]}),children:[i.jsx(Bw,{status:s,onRefreshStatus:p,onSaveToken:g}),i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Имя"}),i.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:be=>E(Hx(be.target.value))})]}),v.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),l.length>1?i.jsx(Es,{className:"settings__select",value:T,options:J,onChange:R,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((L=l[0])==null?void 0:L.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:z,placeholder:"о чём проект — одной строкой",onChange:be=>X(be.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(Bx,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:F,onClick:()=>G(!0)}),i.jsx(Bx,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!F,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:[je," из ",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:H,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:be=>te(be.target.value)}),i.jsx("div",{className:"publish__filelist",children:ue.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ue.map(be=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(C==null?void 0:C.has(be))===!0,className:"publish__file",onClick:()=>Ee(be),children:[i.jsx("span",{className:"publish__box"+(C!=null&&C.has(be)?" is-on":""),"aria-hidden":"true",children:(C==null?void 0:C.has(be))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:be})]},be))}),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:be=>K(be.target.value)})]})]})]}),i.jsx(gr,{result:h,onDismiss:_})]})}function Bx({title:s,desc:l,on:r,risky:c,onClick:o}){return i.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[s,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:l})]})]})}function Bw({status:s,onRefreshStatus:l,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"}),s===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):s.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:s.login}),i.jsx("span",{className:"publish__accountvia",children:s.source==="gh"?"через GitHub CLI":"по личному токену"}),s.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[s.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(Iw,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(p=>!p),placeholder:"ghp_…"})]}),i.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",i.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",i.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),s.message&&i.jsx("p",{className:"modal__error",children:s.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Iw({value:s,onChange:l,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:s,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(Gw,{}):i.jsx(qw,{})})]})}function qw(){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 Gw(){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 Yw({busy:s,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=y.useState(""),p=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(yl,{title:"Подключить существующий репозиторий",onClose:o,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!p||s!=="",onClick:()=>r(d.trim()),children:s||"Подключить"})]}),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"&&p&&s===""&&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(gr,{result:l,onDismiss:c})]})}function Xw({open:s,items:l,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:p,model:g,effort:x,ultracode:_,thinking:S,switchOnFlag:v,onContextSearch:E,onCommand:T,onModel:R,onEffort:z,onUltracode:X,onThinking:F,onSwitchOnFlag:G,onAsk:O,onInterrupt:K,onReset:C,onClose:D,zoomed:H,onToggleZoom:te}){return i.jsxs("aside",{className:(s?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(H?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:de=>{te&&(de.target.closest("button")||te())},children:[i.jsx(Vw,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:C,children:"↻"}),te&&i.jsx("button",{className:"sidepane__btn",title:H?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":H?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":H,onClick:te,children:i.jsx(kc,{active:H})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),p.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Vy,{className:"select--compact",models:p,value:g,effort:x,ultracode:_,thinking:S,switchOnFlag:v,onModel:R,onEffort:z,onUltracode:X,onThinking:F,onSwitchOnFlag:G}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(Ap,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(Gy,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:s,attachmentsEnabled:!1,onContextSearch:E,onCommand:T,onSend:O,onInterrupt:K,onEscape:r?K:D})]})}function Vw(){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 $w=75,Qw=90;function Qy({usage:s}){if(!(s!=null&&s.available))return null;const l=s.buckets??[],r=l.length>0?l.map(o=>({key:o.id,label:o.label,window:o.window})):[...s.fiveHour?[{key:"five",label:"5 ч",window:s.fiveHour}]:[],...s.sevenDay?[{key:"week",label:"нед",window:s.sevenDay}]:[]];if(r.length===0)return null;const c=l.length>0?"Квота Antigravity":`Расход лимитов плана${s.plan?` ${s.plan}`:""}`;return i.jsx("div",{className:"usage",title:Fw(s,l),"aria-label":c,children:r.map(o=>i.jsx(Kw,{label:o.label,window:o.window},o.key))})}function Kw({label:s,window:l}){const r=Math.round(l.utilization),c=Ww(l.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:s}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":s,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${Zw(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:Rp(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Zw(s){return s>=Qw?" usage__fill--over":s>=$w?" usage__fill--warn":""}function Fw(s,l){if(l.length>0)return Jw(l);const r=[s.plan?`Лимиты плана ${s.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=Rp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",s.fiveHour),c("Неделя",s.sevenDay),c("Неделя, Opus",s.sevenDayOpus),r.join(`
|
|
120
|
+
`)}function Jw(s){const l=["Квота Antigravity"];for(const r of s){const c=Rp(r.window.resetsAt),o=Math.round(r.window.utilization);l.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&l.push(r.description)}return l.join(`
|
|
121
|
+
`)}function Ky(s){if(!s)return null;const l=new Date(s);return Number.isNaN(l.getTime())?null:l}function Zy(s){return s.getTime()-Date.now()<1440*60*1e3}function Ww(s){const l=Ky(s);return l?Zy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function Rp(s){const l=Ky(s);return l?`обнулится ${Zy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function Fy(){const[s,l]=y.useState(()=>new Date);return y.useEffect(()=>{let r=0;const c=()=>{const d=new Date;l(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:s.toISOString(),title:Pw(s),children:[i.jsx("span",{className:"clock__time",children:s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:s.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function Pw(s){return s.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function ek({onClose:s,permission:l,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:p,metersFetchedAt:g,onRename:x,onStop:_}){return i.jsx(yl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:s,children:i.jsxs("div",{className:"sessionmenu",children:[l&&i.jsx(rc,{label:"Режим прав",children:l}),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(Qy,{usage:c})}),i.jsxs("button",{type:"button",className:p?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":p,disabled:p,onClick:h,children:[i.jsx(tk,{}),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(Fy,{})}),d&&i.jsx(rc,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(rc,{label:"Каталог проекта",children:i.jsx(Xy,{path:o})}),x&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"}),_&&i.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:_,children:"Остановить сессию"})]})})}function rc({label:s,children:l}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:s}),l]})}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:"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 nk({tab:s,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:p,onClose:g}){const x=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(yl,{title:"Расширения",className:"modal--wide",onClose:g,children:[i.jsx("div",{className:"tabs",role:"tablist",children:x.map(_=>i.jsxs("button",{role:"tab","aria-selected":s===_.id,className:s===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>p(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),s==="mcp"&&i.jsx(lk,{servers:l,actions:h}),s==="plugins"&&i.jsx(ck,{plugins:r,marketplaces:c,actions:h}),s==="catalog"&&i.jsx(ok,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>p("plugins")}),i.jsx(gr,{result:d})]})}function lk({servers:s,actions:l}){const[r,c]=y.useState(!1);return i.jsxs(i.Fragment,{children:[s.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:s.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--${ak(o.status)}`,children:sk[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:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),r?i.jsx(ik,{onCancel:()=>c(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),c(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const sk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function ak(s){return s==="connected"?"ok":s==="failed"?"bad":s==="needs-auth"?"warn":"mute"}function ik({onSubmit:s,onCancel:l}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,p]=y.useState(""),[g,x]=y.useState(""),[_,S]=y.useState(""),v=o==="stdio",E=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function T(){if(E)if(v){const[R,...z]=rk(h);s(r.trim(),{transport:"stdio",command:R??"",args:z,env:Ix(_)})}else s(r.trim(),{transport:o,url:g.trim(),headers:Ix(_)})}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:R=>c(R.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Es,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:R=>d(R)}),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:R=>p(R.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:R=>x(R.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:R=>S(R.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!E,onClick:T,children:"Подключить"})]})]})}function Ix(s){const l={};for(const r of s.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||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function rk(s){return(s.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function ck({plugins:s,marketplaces:l,actions:r}){const[c,o]=y.useState("");return i.jsxs(i.Fragment,{children:[s.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:s.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:l.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 Ao=30;function ok({catalog:s,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,p]=y.useState(""),[g,x]=y.useState(Ao),[_,S]=y.useState(""),v=y.useMemo(()=>[...new Set(s.map(R=>R.category).filter(Boolean))].sort(),[s]),E=y.useMemo(()=>{const T=o.trim().toLowerCase();return s.filter(R=>h&&R.category!==h?!1:T?`${R.name} ${R.displayName} ${R.description} ${R.author}`.toLowerCase().includes(T):!0)},[s,o,h]);return s.length===0?i.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",i.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"catalog__filters",children:[i.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:T=>{d(T.target.value),x(Ao)}}),i.jsx(Es,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{p(T),x(Ao)}})]}),E.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:E.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))}),E.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>x(T=>T+Ao),children:["Ещё ",Math.min(Ao,E.length-g)," из ",E.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=>S(T.target.value),onKeyDown:T=>{T.key!=="Enter"||_.trim()===""||(T.preventDefault(),r.pluginInstall(_.trim()),S(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),S("")},children:"Установить"})]})]})]})}function uk({status:s,login:l,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:p,onClose:g}){const[x,_]=y.useState(""),[S,v]=y.useState(!1),[E,T]=y.useState(!1),R=d!==null&&(s==null?void 0:s.loggedIn)===!0&&!E&&!S,z=y.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const G=l.output.trim();return G===""?null:{ok:!0,message:G}},[l.error,l.output]);function X(G=x){const O=G.trim();O!==""&&(r.submitCode(O),_(""))}function F(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return i.jsxs(yl,{title:"Аккаунт",onClose:g,children:[s===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):s.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:s.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:hk[s.method]??s.method}),s.plan&&i.jsx("span",{className:"chip",children:s.plan})]}),s.organization&&i.jsx("div",{className:"extlist__meta",children:s.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?i.jsx(pk,{login:l,remote:c,code:x,onCode:_,onSubmit:X,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(gr,{result:z}),E&&i.jsx("p",{className:"account__warn",role:"alert",children:fk(o)}),R&&h&&i.jsx("p",{className:"account__note",children:p}),i.jsx("div",{className:`extbar${s!=null&&s.loggedIn?" account__bar":""}`,children:s!=null&&s.loggedIn?i.jsxs(i.Fragment,{children:[R&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
123
|
+
${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(dk,{}),"Переподключить"]}),E?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:F,children:"Сменить аккаунт"}),S?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 fk(s){const l=s%10,r=s%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${s} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function dk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const hk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function pk({login:s,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,p]=y.useState(null),g=y.useRef(""),x=y.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async R=>{const{code:z,onCode:X,onSubmit:F}=x.current;if(R&&z.trim()!=="")return;const G=await op();if(G===null){R||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const O=G.trim();if(!qx(O)){R||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(R){if(g.current===O)return;g.current=O}p(null),X(O),F(O)},[]);y.useEffect(()=>{if(!s.awaitingCode)return;const R=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",R),()=>document.removeEventListener("visibilitychange",R)},[s.awaitingCode,_]);const S=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!qx(r),E=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[s.url?l?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:s.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:s.url}),i.jsx(Tp,{text:s.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:s.url,target:"_blank",rel:"noreferrer",children:s.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),s.awaitingCode&&i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),i.jsxs("div",{className:"extform__row account__coderow",children:[i.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:R=>{p(null),c(R.target.value)},onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),o())}}),S&&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:"Готово"})]}),E&&i.jsx("p",{className:"account__note account__note--code",children:E})]}),s.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:s.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function qx(s){const l=s.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}function mk({state:s,onPair:l,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,p]=y.useState(""),[g,x]=y.useState(!1),_=y.useRef(null),S=(s==null?void 0:s.paired)===!0;y.useEffect(()=>{var E;S||(E=_.current)==null||E.focus()},[S]),y.useEffect(()=>{x(!1),S&&d("")},[S,s==null?void 0:s.error]);const v=(s==null?void 0:s.url)??"https://claudevisual.com";return i.jsx(yl,{title:"Удалённый доступ",onClose:c,children:S?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Gx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(s==null?void 0:s.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:s!=null&&s.connected?"dot dot--on":"dot"})," ",s!=null&&s.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(s==null?void 0:s.clients)??0," вкладок"]})]})]}),(s==null?void 0:s.error)&&i.jsx("p",{className:"relay__error",children:s.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:Gx(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:E=>{E.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:E=>d(E.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:E=>p(E.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(s==null?void 0:s.error)&&i.jsx("p",{className:"relay__error",children:s.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function Gx(s){try{return new URL(s).host}catch{return s}}const Fh="",gk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],bk=cy.map(s=>({value:s.value,label:s.value,hint:s.hint})),yf=3600*1e3,xk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],oc={"6h":6*yf,"24h":24*yf,"48h":48*yf,"168h":168*yf,never:0};function yk(s){return oc[s]??oc["48h"]}const _k=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],_f=60*1e3,uc={"5m":5*_f,"10m":10*_f,"30m":30*_f,"60m":60*_f,never:0};function vk(s){return uc[s]??uc["10m"]}function jk(s){const l=Object.entries(uc).find(([,r])=>r===s);return l?l[0]:Object.keys(uc).reduce((r,c)=>Math.abs(uc[c]-s)<Math.abs(uc[r]-s)?c:r)}function Sk(s){const l=Object.entries(oc).find(([,r])=>r===s);return l?l[0]:Object.keys(oc).reduce((r,c)=>Math.abs(oc[c]-s)<Math.abs(oc[r]-s)?c:r)}const wk=[{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 kk(s){return fc[s]??fc.off}function Yx(s){return Number.isFinite(s)?Math.min(100,Math.max(0,Math.round(s))):0}function Nk(s){const l=Object.entries(fc).find(([,r])=>r===s);return l?l[0]:Object.keys(fc).reduce((r,c)=>Math.abs(fc[c]-s)<Math.abs(fc[r]-s)?c:r)}const Tk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Ek({settings:s,models:l,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:p,onClose:g}){const x=s===null,_=!x&&s.terminalEnabled===!0,S=!x&&s.liveSessionsFirst===!0,v=!_,E=y.useMemo(()=>{const R=[{value:Fh,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(z=>({value:z.value,label:z.displayName,hint:z.description})):gk];return s&&s.startModel!==null&&!R.some(z=>z.value===s.startModel)&&R.push({value:s.startModel,label:s.startModel}),R},[l,s]);function T(){var R,z;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:p,children:"Связать компьютер"})]}):(R=r.shell)!=null&&R.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:"Запретить"})]}):(z=r.shell)!=null&&z.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(yl,{title:"Настройки",onClose:g,children:i.jsxs("div",{className:"settings",children:[i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),i.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Es,{className:"settings__select",value:Sk(s.autoArchiveAfterMs),options:xk,onChange:R=>o({autoArchiveAfterMs:yk(R)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Es,{className:"settings__select",value:jk(s.autoStopAfterMs),options:_k,onChange:R=>o({autoStopAfterMs:vk(R)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),i.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:s.limitStopFiveHourPct,onChange:R=>o({limitStopFiveHourPct:Yx(R.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:s.limitStopSevenDayPct,onChange:R=>o({limitStopSevenDayPct:Yx(R.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Es,{className:"settings__select",value:Nk(s.autoSaveAfterPauseMs),options:wk,onChange:R=>o({autoSaveAfterPauseMs:kk(R)}),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:"Модель"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Es,{className:"settings__select",value:s.startModel??Fh,options:E,onChange:R=>o({startModel:R===Fh?null:R}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Es,{className:"settings__select",value:s.startPermissionMode,options:bk,onChange:R=>o({startPermissionMode:R}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsx("section",{className:"settings__section",children:i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),i.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),x?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":S,"aria-label":"Запущенные сессии сверху",className:S?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!S}),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:Tk.map(R=>{const z=!x&&s.folderAccess===R.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":z,disabled:x,className:"access__card"+(z?" is-on":"")+(R.risky?" access__card--risky":""),onClick:()=>o({folderAccess:R.value}),children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[R.title,R.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:R.description})]})]},R.value)})})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Терминал"}),i.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?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:"Удалённый доступ к терминалу"}),x?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[v&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),T()]})]})]})]})})}const Ak={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Ck(s){if(!s)return"срок неизвестен";const l=new Date(s);return Number.isNaN(l.getTime())?"срок неизвестен":l.toLocaleString()}function Rk({handoff:s,onContinue:l,onShow:r,onDismiss:c}){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:[Ak[s.limit]," (",Math.round(s.utilization)," %) — сессия остановлена"," ",new Date(s.stoppedAt).toLocaleString(),". Окно сбросится: ",Ck(s.resetsAt),".",s.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:l,children:"Продолжить в новой сессии"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function Mk({handoff:s,onClose:l}){const[r,c]=y.useState("");return y.useEffect(()=>{let o=!1;return If(s.text).then(d=>{o||c(d)}),()=>{o=!0}},[s.text]),i.jsx(yl,{title:"Хэндофф",className:"modal--wide",onClose:l,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Dk={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Ok=12e3;function Lk(s){const l=s%10,r=s%100;return r>=11&&r<=14?"сессий":l===1?"сессия":l>=2&&l<=4?"сессии":"сессий"}function zk({notices:s,onDismiss:l}){return s.length===0?null:i.jsx("div",{className:"limittoasts",children:s.map(r=>i.jsx(Uk,{notice:r,onDismiss:()=>l(r.id)},r.id))})}function Uk({notice:s,onDismiss:l}){return y.useEffect(()=>{const r=window.setTimeout(l,Ok);return()=>window.clearTimeout(r)},[l]),i.jsxs("div",{className:"limittoast",role:"status",children:[i.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),i.jsxs("span",{className:"limittoast__body",children:["Достигнут ",Dk[s.limit]," (",Math.round(s.utilization)," %): остановлено"," ",s.stopped," ",Lk(s.stopped),", хэндоффов — ",s.handoffs,"."]}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:l,children:"✕"})]})}const Hk=16;function Bk({pane:s,width:l,onResize:r,onReset:c}){const o=fr[s],d=y.useRef(null);function h(_){if(_.button!==0)return;const S=document.querySelector(".main"),v=S?Math.max(0,S.getBoundingClientRect().width-Y0):0;d.current={x:_.clientX,width:l,max:Math.min(o.max,l+v)},_.currentTarget.setPointerCapture(_.pointerId),document.body.classList.add("is-resizing"),_.preventDefault()}function p(_){const S=d.current;if(!S)return;const v=o.side==="left"?_.clientX-S.x:S.x-_.clientX;r(Math.min(S.max,S.width+v))}function g(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function x(_){const S=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;S!==0&&(_.preventDefault(),r(l+S*Hk*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${s} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:p,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:x,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Ik=16;function qk({height:s,onResize:l,onReset:r}){const c=y.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const _=x.getBoundingClientRect().height-Q0;return Math.round(s+Math.max(0,_))}function d(x){x.button===0&&(c.current={y:x.clientY,height:s,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const _=c.current;if(!_)return;const S=_.y-x.clientY;l(_.height+S,_.max)}function p(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const _=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;_!==0&&(x.preventDefault(),l(s+_*Ik,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":s,"aria-valuemin":fy,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:r,onKeyDown:g,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function Xx(){const s=document.documentElement,l=getComputedStyle(s),r=F=>l.getPropertyValue(F).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),p=r("--accent"),g=r("--accent-fg"),x=r("--select"),_=r("--danger"),S=r("--ok"),v=r("--warn"),E=r("--cm-fn"),T=r("--cm-key"),R=r("--cm-type"),z=Vx(o,c,55),X=F=>Vx(F,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:g,selectionBackground:x,black:z,brightBlack:h,red:_,brightRed:X(_),green:S,brightGreen:X(S),yellow:v,brightYellow:X(v),blue:E,brightBlue:X(E),magenta:T,brightMagenta:X(T),cyan:R,brightCyan:X(R),white:d,brightWhite:o}}function Gk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Ks=null;function Yk(s){return Ks||(Ks=document.createElement("span"),Ks.style.position="fixed",Ks.style.width="0",Ks.style.height="0",Ks.style.opacity="0",Ks.style.pointerEvents="none",document.body.appendChild(Ks)),Ks.style.color=s,getComputedStyle(Ks).color}function Vx(s,l,r){return Yk(`color-mix(in srgb, ${s} ${100-r}%, ${l} ${r}%)`)}let vf=null;function Xk(){return vf||(vf=Promise.all([Ke(()=>import("./xterm-D6Mng-DB.js").then(s=>s.x),__vite__mapDeps([22,23]),import.meta.url),Ke(()=>import("./addon-fit-CevVMrUA.js").then(s=>s.a),__vite__mapDeps([24,23]),import.meta.url),Ke(()=>import("./addon-web-links-CnB65OV_.js").then(s=>s.a),__vite__mapDeps([25,23]),import.meta.url),Ke(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([s,l,r])=>({Terminal:s.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(s=>{throw vf=null,s})),vf}function Vk({terminals:s,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:p=!1,zoomed:g,onToggleZoom:x,onSelect:_,onOpen:S,onClose:v,onInput:E,onResize:T,onAttach:R,onHide:z,registerSink:X}){const[F,G]=y.useState(()=>Xx());return y.useEffect(()=>{const O=new MutationObserver(()=>G(Xx()));return O.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>O.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(p?" termpanel--mobile":"")+(!p&&g?" termpanel--zoomed":""),style:p?{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=>{x&&(O.target.closest("button")||x())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:s.map(O=>i.jsxs("div",{role:"tab","aria-selected":O.id===l,className:"termtab"+(O.id===l?" is-on":"")+(O.exitCode!==null?" termtab--exited":""),onDoubleClick:K=>{x&&(K.target.closest(".termtab__close")||x())},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:S,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),x&&i.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:x,children:i.jsx(kc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:z,children:"✕"})]}),c&&s.length>0&&i.jsx($x,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&s.length===0?i.jsx($x,{message:c,onRetry:r?null:S,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):s.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:S,children:"Открыть терминал"})]}),s.map(O=>i.jsx(Qk,{id:O.id,exitCode:O.exitCode,active:O.id===l,theme:F,mobile:p,onInput:E,onResize:T,onAttach:R,registerSink:X},O.id))]})]})}function $x({message:s,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=$k(s);return i.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),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 $k(s){const[l="",...r]=s.trim().split(`
|
|
124
|
+
|
|
125
|
+
`),c=l.split(`
|
|
126
|
+
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??s.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
127
|
+
|
|
128
|
+
`).trim()}}function Qk({id:s,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:p,registerSink:g}){const x=y.useRef(null),_=y.useRef(null),S=y.useRef(!1),v=y.useRef(o);v.current=o;const E=y.useRef(c),T=y.useRef(l),[R,z]=y.useState("loading"),[X,F]=y.useState(!1);return y.useEffect(()=>{if(!x.current)return;let O=!1,K=null;z("loading"),F(!1);const C=window.setTimeout(()=>{O||F(!0)},200);return(async()=>{var ye;let D;try{D=await Xk()}catch{window.clearTimeout(C),O||z("error");return}if(O||!x.current)return;window.clearTimeout(C);const{Terminal:H,FitAddon:te,WebLinksAddon:de}=D,J=new H({fontFamily:Gk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:E.current}),ue=new te;J.loadAddon(ue),J.loadAddon(new de),J.open(x.current),_.current=J,J.attachCustomKeyEventHandler(N=>{if(N.type!=="keydown"||!(N.ctrlKey||N.metaKey))return!0;if(N.key==="`")return N.preventDefault(),!1;if(N.key==="c"||N.key==="C"){const re=J.getSelection();return re?(N.preventDefault(),Sc(re),!1):!N.shiftKey}return N.key==="v"||N.key==="V"?(N.preventDefault(),op().then(re=>{re&&J.paste(re)}),!1):!0});const je=N=>{N.preventDefault();const V=J.getSelection();if(V){Sc(V),J.clearSelection();return}op().then(re=>{re&&J.paste(re)})};(ye=J.element)==null||ye.addEventListener("contextmenu",je);const Ce=J.onData(N=>d(s,N));let Ee={cols:J.cols,rows:J.rows},A=null;const ce=J.onResize(({cols:N,rows:V})=>{A!==null&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,!(N===Ee.cols&&V===Ee.rows)&&(Ee={cols:N,rows:V},h(s,N,V))},100)}),L=new ResizeObserver(()=>{try{ue.fit()}catch{return}v.current&&J.scrollToBottom()});L.observe(x.current);const be=g(s,N=>{N.kind==="buffer"&&J.reset(),J.write(N.data)});p(s),T.current!==null&&!S.current&&(S.current=!0,J.write(`\r
|
|
129
|
+
\x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
|
|
130
|
+
`)),r&&J.focus(),K=()=>{var N;A!==null&&window.clearTimeout(A),L.disconnect(),(N=J.element)==null||N.removeEventListener("contextmenu",je),Ce.dispose(),ce.dispose(),be(),J.dispose(),_.current=null},z("ready")})(),()=>{O=!0,window.clearTimeout(C),K==null||K(),K=null}},[s]),y.useEffect(()=>{if(!o)return;const G=x.current;if(!G)return;let O=null,K=0,C=!1;const D=J=>{J.pointerType==="mouse"||O!==null||(O=J.pointerId,K=J.clientY,C=!1)},H=J=>{if(J.pointerId!==O)return;const ue=K-J.clientY;if(!C){if(Math.abs(ue)<4)return;C=!0,G.setPointerCapture(J.pointerId)}K=J.clientY;const je=G.querySelector(".xterm-viewport");je&&(je.scrollTop+=ue)},te=J=>{J.pointerId===O&&(G.hasPointerCapture(J.pointerId)&&G.releasePointerCapture(J.pointerId),O=null,C=!1)},de=J=>J.stopPropagation();return G.addEventListener("pointerdown",D),G.addEventListener("pointermove",H),G.addEventListener("pointerup",te),G.addEventListener("pointercancel",te),G.addEventListener("touchmove",de,{capture:!0}),()=>{G.removeEventListener("pointerdown",D),G.removeEventListener("pointermove",H),G.removeEventListener("pointerup",te),G.removeEventListener("pointercancel",te),G.removeEventListener("touchmove",de,{capture:!0}),O!==null&&G.hasPointerCapture(O)&&G.releasePointerCapture(O)}},[o]),y.useEffect(()=>{E.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var G;r&&((G=_.current)==null||G.focus())},[r]),y.useEffect(()=>{if(T.current=l,l===null){S.current=!1;return}if(S.current)return;const G=_.current;G&&(S.current=!0,G.write(`\r
|
|
131
|
+
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
132
|
+
`))},[l]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:x,className:"termview__surface"+(R==="ready"?"":" is-hidden")}),R==="loading"&&X&&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:"Загружается терминал…"})]}),R==="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 Kk=2e5,Zk=75,Fk=90;function Jk({tokens:s,maxTokens:l,fetchedAt:r}){if(s===null)return null;const c=l??Kk,o=Math.min(100,Math.round(s/c*100)),d=`${s.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${Wk(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Wk(s){return s>=Fk?" contextbar__fill--over":s>=Zk?" contextbar__fill--warn":""}const Jy="ccv:last-session",Pk=300*1e3,eN=1e4;function tN(){try{const s=localStorage.getItem(Jy);if(!s)return null;const l=JSON.parse(s);if(typeof l!="object"||l===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=l;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function nN(s,l){return s.id===l.sessionId?!0:l.claudeSessionId?s.id===l.claudeSessionId||s.claudeSessionId===l.claudeSessionId:!1}const lN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Qx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],sN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Kx(s,l,r){if(s===null)return null;const c=s.lastIndexOf("/");if(c===-1&&s!=="")return l;const o=r[c===-1?"":s.slice(0,c)];if(!o)return null;const d=s.slice(c+1).toLowerCase();return d===""?{query:s,entries:o}:{query:s,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,p)=>Zx(h.name,d)-Zx(p.name,d))}}function Zx(s,l){return s.toLowerCase().startsWith(l)?0:1}function Fx(s,l){const r=s.find(o=>o.value===l)??s.find(o=>o.resolvedModel===l),c=l&&!r?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...s],selected:(r==null?void 0:r.value)??c??(s.some(o=>o.value==="default")?"default":"")}}function aN(){var Ur;const s=y.useRef(null),[l,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[p,g]=y.useState(!1),x=y.useMemo(()=>wf()==="relay",[]),[_,S]=y.useState([]),[v,E]=y.useState([]),[T,R]=y.useState([]),[z,X]=y.useState([]),[F,G]=y.useState([]),[O,K]=y.useState([]),[C,D]=y.useState([]),[H,te]=y.useState([]),[de,J]=y.useState([]),[ue,je]=y.useState(null),[Ce,Ee]=y.useState(null),[A,ce]=y.useState(null),[L,be]=y.useState(null),[ye,N]=y.useState(null),[V,re]=y.useState(bl),[me,we]=y.useState(Mh),[ve,De]=y.useState(!1),[xt,Xe]=y.useState(!1),Ve=Uf("(max-width: 860px)"),[$e,Wt]=y.useState(!1);y.useEffect(()=>{Ve||Wt(!1)},[Ve]);const[it,un]=y.useState(!1),[ut,fn]=y.useState([]),[kn,_n]=y.useState(!1),[Pt,tt]=y.useState(bl),[Pe,en]=y.useState(null),[Vt,nt]=y.useState(null),[wt,$t]=y.useState([]),[rn,kt]=y.useState(null),[vn,It]=y.useState(null),[dn,Ln]=y.useState([]),[qt,rt]=y.useState([]),[Et,Je]=y.useState([]),[_l,ne]=y.useState([]),[ge,He]=y.useState(null),[B,P]=y.useState({}),[_e,Be]=y.useState(null),[Gt,vl]=y.useState([]),[Zn,Fn]=y.useState(!1),[Jn,Kl]=y.useState(null),[Nn,Ll]=y.useState(null),[fl,Wn]=y.useState(!1),[Pn,tn]=y.useState(sN),[cn,Lt]=y.useState(null),[et,Me]=y.useState(null),[nn,jn]=y.useState(!1),[Cs,,Yn]=I0(),jl=$0(),[Qt,el]=y.useState(!1),[vt,hn]=y.useState(null),[zn,pn]=y.useState(null),[zt,tl]=y.useState(null),[Rs,Yt]=y.useState(null),[dl,os]=y.useState(null),[us,Zl]=y.useState(""),[na,Sl]=y.useState(null),[nl,Un]=y.useState([]),[Ut,zl]=y.useState(!1),[Ti,Fl]=y.useState(null),[Xn,wl]=y.useState(!1),[Tn,mn]=y.useState(!1),[jt,Ul]=y.useState({}),[At,ll]=y.useState([""]),[he,k]=y.useState([]),[Y,fe]=y.useState(null),[Te,Oe]=y.useState(null),[Le,mt]=y.useState(null),[w,ae]=y.useState(null),[ke,We]=y.useState(null),[ft,la]=y.useState({}),[fs,Nc]=y.useState({}),[ds,Ma]=y.useState(!1),[Ei,Hl]=y.useState(null),[Da,sa]=y.useState(null),hs=y.useRef(0),Oa=y.useRef(null),[ps,br]=y.useState(!1),[aa,Ms]=y.useState([]),[Bo,Hn]=y.useState(null),[ia,ra]=y.useState(null),Ds=K0(),Tc=F0(Ve&&ps),ca=y.useRef(new Map),ms=(Nn==null?void 0:Nn.terminalEnabled)===!0,Os=wf()==="relay"&&((Ur=d==null?void 0:d.shell)==null?void 0:Ur.enabled)!==!0,La=y.useRef(!1),Io=y.useCallback((m,I)=>(ca.current.set(m,I),()=>{ca.current.get(m)===I&&ca.current.delete(m)}),[]),[oa,xr]=y.useState(!1),[qo,za]=y.useState(null),[Go,yr]=y.useState(bl),[gs,_r]=y.useState(null),[Ai,Ls]=y.useState({}),Ci=y.useRef([]),[ln,Ec]=y.useState(null);function qf(m){Ec(I=>I===m?null:m)}y.useEffect(()=>{(Ve||ln==="terminal"&&!ps||ln==="files"&&!Tn||ln==="search"&&!ds||ln==="git"&&!Qt||ln==="ask"&&!oa||ln==="main"&&he.length===0)&&Ec(null)},[ln,Ve,ps,Tn,ds,Qt,oa,he.length]);const[Ac]=y.useState(tN),Yo=y.useRef(Ac),vr=y.useRef(!1),Vn=y.useRef(null),Ua=y.useRef(null),Ri=y.useRef(null),Xo=y.useRef(0),En=y.useRef(null),Vo=y.useRef(0);Vn.current=L,En.current=A,Vo.current=V.lastSeq;const $o=y.useRef(me);$o.current=me;const bs=y.useRef(null),Qo=y.useRef(0);Qo.current=Go.lastSeq;const jr=y.useRef(null),Sr=y.useRef(""),ua=y.useRef(null),Bl=y.useRef([]),Ko=y.useRef([""]);Bl.current=he,Ko.current=At;const Ha=y.useRef(new Map),Mi=y.useRef(new Set),Ba=y.useRef(null),Ia=y.useRef(null),Cc=y.useRef(0),Jl=y.useRef(new Set);y.useEffect(()=>{const m=E0();if(!m)return;s.current=m;const I=()=>{r(m.connected),o(m.statusText)};m.onStatus(I),m.onReconnect(()=>{I();const Xt=Vn.current;Xt&&m.send({type:"session.sync",sessionId:Xt,sinceSeq:Vo.current});const An=bs.current;An&&m.send({type:"session.sync",sessionId:An,sinceSeq:Qo.current})});const pe=m.on(Xt=>Gf(Xt));m.connect();const qe=window.setInterval(()=>{I(),m.connected&&m.send({type:"ping",nonce:Date.now()})},15e3);return()=>{pe(),window.clearInterval(qe),m.close()}},[]);const Gf=y.useCallback(m=>{var I,pe,qe,Xt,An,qn,ba,Qi,Xc;switch(m.type){case"hello.ok":r(!0);break;case"workspace.list":{S(m.workspaces),E(m.archived),ce(Ge=>{var ns;if(Ge)return Ge;const pt=Yo.current,Ht=pt&&m.workspaces.find(js=>js.id===pt.workspaceId);return(Ht==null?void 0:Ht.id)??((ns=m.workspaces[0])==null?void 0:ns.id)??null});const xe=ua.current;if(!xe)break;const Ae=m.workspaces.find(Ge=>uN(Ge.path,xe));if(!Ae)break;ua.current=null,un(!1),ce(Ae.id);break}case"workspace.candidates":if(m.query.trim()!==Sr.current)break;fn(m.candidates),m.source==="host"&&_n(!1);break;case"finder.opened":jr.current=m.sessionId;break;case"workspace.roots":$t(m.roots);break;case"workspace.created":if(ce(m.workspace.id),m.warnings.length===0){un(!1),nt(null);break}kt({path:m.workspace.path,warnings:m.warnings});break;case"session.list":if(m.workspaceId!==En.current)break;K(m.sessions),D(m.archived);break;case"folder.list":R(m.workspaceFolders),X(m.sessionFolders),G(m.pinnedFolders??[]);break;case"session.pinned":te(m.sessions);break;case"session.live":J(m.sessions);break;case"order.state":Ee(m.order);break;case"session.summary":if(m.session.id===jr.current){en(m.session);break}if(m.session.parentSessionId){m.session.id===bs.current&&_r(m.session);break}if(J(xe=>{const Ae=xe.findIndex(pt=>pt.id===m.session.id);if(m.session.state==="closed")return Ae===-1?xe:xe.filter(pt=>pt.id!==m.session.id);if(Ae===-1)return[...xe,m.session];const Ge=xe.slice();return Ge[Ae]=m.session,Ge}),K(xe=>{const Ae=xe.findIndex(pt=>pt.id===m.session.id);if(Ae===-1)return[m.session,...xe];const Ge=xe.slice();return Ge[Ae]=m.session,Ge}),te(xe=>{const Ae=xe.findIndex(pt=>pt.id===m.session.id);if(Ae===-1)return xe;const Ge=xe.slice();return Ge[Ae]={...m.session,pinned:!0,...xe[Ae].pinnedAt?{pinnedAt:xe[Ae].pinnedAt}:{}},Ge}),Vn.current===null&&Ri.current&&Ri.current.workspaceId===m.session.workspaceId&&(sy(m.session.id,Ri.current.text),Ri.current=null),be(xe=>xe??m.session.id),((I=Ua.current)==null?void 0:I.sessionId)===m.session.id){const xe=Ua.current;m.session.state==="error"?Ua.current=null:m.session.state!=="closed"&&(Ua.current=null,(pe=s.current)==null||pe.send({type:"prompt.send",sessionId:xe.sessionId,text:xe.text,images:xe.images}))}break;case"usage.state":m.sessionId===Vn.current&&(Lt(m.usage),jn(!1));break;case"context.state":m.sessionId===Vn.current&&(Me(m.context),jn(!1));break;case"session.capabilities":m.sessionId===Vn.current&&N(m.capabilities);break;case"session.events":if(m.sessionId===bs.current){yr(xe=>kf(xe,m.entries));break}if(m.sessionId===jr.current){tt(xe=>kf(xe,m.entries));break}if(m.sessionId!==Vn.current)break;for(const xe of m.entries){if(xe.event.kind!=="rewound")continue;const Ae=xe.event.toUserIndex,Ge=H0($o.current.entries,Ae),pt=Ge.reduce((Ht,ns)=>ns.event.kind==="user.message"?Ht+1:Ht,0);we(Ht=>({...Ht,entries:Ge})),re(Ht=>({...Ht,items:B0(Ht.items,Ae,pt)}))}re(xe=>kf(xe,m.entries));break;case"session.history":if(m.sessionId!==Vn.current)break;we(xe=>L0(xe,m));break;case"side.opened":{if(m.parentSessionId!==Vn.current)break;bs.current=m.sessionId,za(m.sessionId);const xe=Ci.current;Ci.current=[];for(const Ae of xe)Ae(m.sessionId);break}case"side.closed":if(m.parentSessionId!==Vn.current)break;bs.current=null,za(null),yr(bl),_r(null);break;case"git.state":if(m.workspaceId!==En.current)break;hn(m.state);break;case"git.commit":if(m.workspaceId!==En.current)break;pn(m.detail);break;case"git.result":if(m.workspaceId!==En.current)break;Yt({ok:m.ok,message:m.message,url:m.url}),m.ok&&(pn(null),tl(null),zl(!1),wl(!1));break;case"git.busy":if(m.workspaceId!==En.current)break;Zl(m.label);break;case"git.files":if(m.workspaceId!==En.current)break;Fl({files:m.files,truncated:m.truncated});break;case"github.status":Sl(m.status);break;case"github.owners":Un(m.owners);break;case"fs.dir":if(m.workspaceId!==En.current)break;Ul(xe=>({...xe,[m.path]:m.entries}));break;case"fs.search":if(m.workspaceId!==En.current)break;if(m.scope!=="tree"){const xe=m.scope;Nc(Ae=>({...Ae,[xe]:{query:m.query,entries:m.entries}}));break}We({query:m.query,entries:m.entries,truncated:m.truncated});break;case"fs.grep":if(m.workspaceId!==En.current)break;Hl({query:m.query,matches:m.matches,truncated:m.truncated});break;case"fs.file":{if(m.workspaceId!==En.current)break;const xe=Mi.current.delete(m.file.path);k(Ge=>{const pt=Ge.findIndex(js=>js.path===m.file.path);if(pt===-1)return[...Ge,gx(m.file,++Cc.current)];const Ht=Ge[pt],ns=Ge.slice();return ns[pt]=Ht.saved===m.file.content&&!Aa(Ht)?{...Ht,mtime:m.file.mtime,size:m.file.size,stale:!1}:gx(m.file,++Cc.current),ns}),xe&&fe(m.file.path);const Ae=Oa.current;Ae&&Ae.path===m.file.path&&(Oa.current=null,sa({...Ae,token:++hs.current}));break}case"fs.media":{if(m.workspaceId!==En.current)break;Jl.current.delete(m.path),k(xe=>xe.map(Ae=>Ae.path===m.path?{...Ae,mediaBase64:m.base64,mediaError:void 0}:Ae));break}case"fs.mediaFailed":{if(m.workspaceId!==En.current)break;Jl.current.delete(m.path),k(xe=>xe.map(Ae=>Ae.path===m.path?{...Ae,mediaError:m.message}:Ae));break}case"fs.saved":{if(m.workspaceId!==En.current)break;const xe=Ha.current.get(m.path);Ha.current.delete(m.path);const Ae=xe!==void 0;k(pt=>pt.map(Ht=>Ht.path!==m.path?Ht:Ae?{...Ht,saved:xe,mtime:m.mtime,size:m.size,stale:!1}:{...Ht,stale:!0}));const Ge=Bl.current.find(pt=>pt.path===m.path);!Ae&&Ge&&!Aa(Ge)&&((qe=s.current)==null||qe.send({type:"fs.read",workspaceId:m.workspaceId,path:m.path})),(Xt=s.current)==null||Xt.send({type:"git.state",workspaceId:m.workspaceId});break}case"fs.result":{if(m.workspaceId!==En.current)break;if(Oe({ok:m.ok,message:m.message}),m.ok||Ha.current.delete(m.path),m.conflict&&k(Ae=>Ae.map(Ge=>Ge.path===m.path?{...Ge,stale:!0}:Ge)),Ia.current===m.path){const Ae=Ia.current;Ia.current=null,m.ok&&(Mi.current.add(Ae),(An=s.current)==null||An.send({type:"fs.read",workspaceId:m.workspaceId,path:Ae}))}const xe=Ba.current;if(m.ok&&xe&&xe.to===m.path){Ba.current=null;const Ae=Ge=>Ge===xe.from?xe.to:Ge.startsWith(`${xe.from}/`)?xe.to+Ge.slice(xe.from.length):Ge;k(Ge=>Ge.map(pt=>({...pt,path:Ae(pt.path)}))),fe(Ge=>Ge===null?null:Ae(Ge)),ll(Ge=>Ge.map(Ae)),Ul(Ge=>{const pt={};for(const[Ht,ns]of Object.entries(Ge))Ht===xe.from||Ht.startsWith(`${xe.from}/`)||(pt[Ht]=ns);return pt})}m.ok&&((qn=s.current)==null||qn.send({type:"git.state",workspaceId:m.workspaceId}));break}case"term.list":if(m.workspaceId!==En.current)break;Ms(m.terminals);break;case"term.opened":if(m.terminal.workspaceId!==En.current)break;ra(null),Ms(xe=>{const Ae=xe.findIndex(pt=>pt.id===m.terminal.id);if(Ae===-1)return[...xe,m.terminal];const Ge=xe.slice();return Ge[Ae]=m.terminal,Ge}),La.current&&(La.current=!1,Hn(m.terminal.id));break;case"term.buffer":(ba=ca.current.get(m.id))==null||ba({kind:"buffer",data:m.data});break;case"term.data":(Qi=ca.current.get(m.id))==null||Qi({kind:"data",data:m.data});break;case"term.exit":Ms(xe=>xe.map(Ae=>Ae.id===m.id?{...Ae,exitCode:m.exitCode}:Ae));break;case"term.closed":Ms(xe=>xe.filter(Ae=>Ae.id!==m.id));break;case"mcp.list":m.sessionId===Vn.current&&Ln(m.servers);break;case"plugin.list":if(m.sessionId!==Vn.current)break;rt(m.plugins),Je(m.marketplaces),ne(m.catalog);break;case"operation.result":m.sessionId===Vn.current&&He(m.result);break;case"auth.status":Kl(m.status);break;case"relay.state":h(m.state);break;case"settings.state":Ll(m.settings);break;case"handoff.state":P(xe=>{if(!m.handoff){if(!(m.sessionId in xe))return xe;const Ae={...xe};return delete Ae[m.sessionId],Ae}return{...xe,[m.sessionId]:m.handoff}});break;case"limit.stopped":Xo.current+=1,vl(xe=>[...xe,{id:Xo.current,limit:m.limit,utilization:m.utilization,stopped:m.stopped,handoffs:m.handoffs}]);break;case"auth.login":tn(m.state),m.state.active&&Fn(!0);break;case"session.closed":J(xe=>xe.filter(Ae=>Ae.id!==m.sessionId)),K(xe=>xe.map(Ae=>Ae.id===m.sessionId?{...Ae,state:"closed"}:Ae));break;case"error":console.error("[host]",m.message,m.context??""),(m.context==="workspace.open"||m.context==="workspace.create")&&(ua.current=null,nt(m.message)),(Xc=m.context)!=null&&Xc.startsWith("term.")&&ra(m.message);break}},[]),le=y.useCallback(m=>{var I;(I=s.current)==null||I.send(m)},[]);y.useEffect(()=>{A&&le({type:"session.list",workspaceId:A})},[A,le]),y.useEffect(()=>{l&&le({type:"session.pins"})},[l,le]),y.useEffect(()=>{l&&le({type:"settings.get"})},[l,le]),y.useEffect(()=>{if(l)return le({type:"session.drafts",sessionIds:ay()}),M0(m=>le({type:"session.drafts",sessionIds:m}))},[l,le]),y.useEffect(()=>{if(vr.current)return;const m=Yo.current;if(!m||!A)return;if(A!==m.workspaceId){vr.current=!0;return}if(L){vr.current=!0;return}if(O.length===0)return;const I=O.find(pe=>nN(pe,m));vr.current=!0,I&&Bi(I)},[O,A,L]),y.useEffect(()=>{!A||Os||!ms||le({type:"term.list",workspaceId:A})},[A,Os,ms,le]),y.useEffect(()=>{Hn(m=>{var I;return m&&aa.some(pe=>pe.id===m)?m:((I=aa[0])==null?void 0:I.id)??null})},[aa]),y.useEffect(()=>{it&&le({type:"workspace.roots"})},[it,le]);const qa=y.useCallback(()=>{const m=Vn.current;m&&(jn(!0),le({type:"usage.get",sessionId:m}),le({type:"context.get",sessionId:m}))},[le]);y.useEffect(()=>{if(!nn)return;const m=window.setTimeout(()=>jn(!1),eN);return()=>window.clearTimeout(m)},[nn]);const wr=y.useMemo(()=>{const m=Math.max((cn==null?void 0:cn.fetchedAt)??0,(et==null?void 0:et.fetchedAt)??0);return m>0?m:null},[cn==null?void 0:cn.fetchedAt,et==null?void 0:et.fetchedAt]);y.useEffect(()=>{if(Me(null),!L)return;qa();const m=()=>{document.hidden||qa()},I=window.setInterval(m,Pk),pe=()=>{document.hidden||qa()};return document.addEventListener("visibilitychange",pe),()=>{window.clearInterval(I),document.removeEventListener("visibilitychange",pe)}},[L,qa]),y.useEffect(()=>{if(!L){we(Mh);return}we({...Mh,loading:!0}),le({type:"session.history",sessionId:L})},[L,le]);const Zo=y.useCallback(()=>{!L||me.loading||!Mb(me)||(we(m=>({...m,loading:!0})),le({type:"session.history",sessionId:L,before:ry(me)}))},[L,me,le]),Di=y.useMemo(()=>z0(me.entries),[me.entries]),W=y.useMemo(()=>O.find(m=>m.id===L)??null,[O,L]),Oi=L?(W==null?void 0:W.claudeSessionId)??L:null,zs=Oi?B[Oi]??null:null;y.useEffect(()=>{Oi&&le({type:"handoff.get",sessionId:Oi})},[Oi,le]),y.useEffect(()=>{_e&&!(_e.sessionId in B)&&Be(null)},[B,_e]);const Rc=y.useMemo(()=>{var pe;if(!cn)return null;const m=(((pe=cn.buckets)==null?void 0:pe.length)??0)>0,I=(W==null?void 0:W.provider)==="antigravity";return m===I?cn:null},[cn,W==null?void 0:W.provider]),Mc="Обновить лимиты и контекст",Dc=Mc+(wr?`
|
|
134
|
+
обновлено в ${new Date(wr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{document.documentElement.dataset.provider=(W==null?void 0:W.provider)??"claude"},[W==null?void 0:W.provider]),y.useEffect(()=>{(W==null?void 0:W.provider)==="antigravity"&&xr(!1)},[W==null?void 0:W.provider]);const Us=_.find(m=>m.id===A)??v.find(m=>m.id===A)??null;y.useEffect(()=>{if(!A||!L)return;const m={workspaceId:A,sessionId:L,claudeSessionId:(W==null?void 0:W.claudeSessionId)??null};try{localStorage.setItem(Jy,JSON.stringify(m))}catch{}},[A,L,W==null?void 0:W.claudeSessionId]);function Fo(m){ua.current=m,nt(null),le({type:"workspace.open",path:m})}function Jo(m,I,pe){nt(null),le({type:"workspace.create",parent:m,name:I,init:pe})}function Wo(m){if(Sr.current=m,!m){fn([]),_n(!1);return}_n(!0),le({type:"workspace.find",query:m})}function Yf(m){Sr.current=m,tt(bl),le({type:"workspace.find.agent",query:m})}function Xf(){un(!1),nt(null),kt(null),fn([]),tt(bl),en(null),Sr.current="",ua.current=null}function Ga(){const m=Vn.current;m&&bs.current&&le({type:"side.reset",sessionId:m}),bs.current=null,za(null),yr(bl),_r(null),Ls({}),Ci.current=[]}function Vf(m){le({type:"workspace.close",workspaceIds:m}),!(!A||!m.includes(A))&&(Ga(),ce(null),be(null),K([]),D([]),re(bl),N(null),Xe(!1))}function $f(m,I){le({type:"session.archive",workspaceId:m,sessionIds:I}),L&&(I.includes(L)||W!=null&&W.claudeSessionId&&I.includes(W.claudeSessionId))&&(Ga(),be(null),re(bl),N(null),Xe(!1))}function hl(m){le({type:"workspace.restore",workspaceIds:m})}function Li(m,I,pe){le({type:"folder.create",scope:m,name:I,workspaceId:pe})}function Po(m,I){le({type:"folder.rename",folderId:m,name:I})}function eu(m){le({type:"folder.delete",folderId:m})}function tu(m,I,pe,qe){le({type:"folder.assign",scope:m,itemId:I,folderId:pe,workspaceId:qe})}function nu(m="claude"){A&&(Ga(),be(null),N(null),re(bl),Xe(!1),le({type:"session.start",workspaceId:A,provider:m}),De(!1))}function zi(m){Ga(),Wl(),ce(m),be(null),re(bl),N(null),Xe(!1),hn(null),pn(null),tl(null),Yt(null),Zl(""),zl(!1),Fl(null),wl(!1),Ms([]),Hn(null)}function Qf(m,I,pe){le({type:"session.pin",workspaceId:m,sessionIds:I,pinned:pe})}function Ya(m){return m.state==="running"||m.state==="waiting_permission"||m.state==="reconnecting"||m.backgroundWork}function Ui(m){if(Ya(m)){je(m);return}le({type:"session.close",sessionId:m.id})}function Hi(m,I,pe){Ee(qe=>{const Xt=qe??{workspaces:[],sessions:{},pinned:[],live:[]};if(m==="sessions"){if(!pe)return qe;const An={...Xt.sessions};return I&&I.length>0?An[pe]=I:delete An[pe],{...Xt,sessions:An}}return{...Xt,[m]:I??[]}}),le({type:"order.set",scope:m,ids:I,...pe?{workspaceId:pe}:{}})}function Oc(m){m.workspaceId!==A&&zi(m.workspaceId),Bi(m)}function Bi(m){if(De(!1),Ga(),re(bl),N(null),Xe(!1),m.state==="closed"){be(null),le({type:"session.start",workspaceId:m.workspaceId,resume:m.id});return}be(m.id),le({type:"session.sync",sessionId:m.id,sinceSeq:0})}function fa(m,I){if(L){if((W==null?void 0:W.state)==="closed"){Ua.current={sessionId:W.id,text:m,images:I},Bi(W);return}le({type:"prompt.send",sessionId:L,text:m,images:I})}}function Xa(m){Ri.current={workspaceId:m.workspaceId,text:m.text},m.workspaceId!==A?zi(m.workspaceId):(Ga(),be(null),N(null),re(bl),Xe(!1)),le({type:"session.start",workspaceId:m.workspaceId,provider:"claude"}),De(!1)}function Lc(m){le({type:"handoff.dismiss",sessionId:m})}function zc(m,I){le({type:"session.rename",sessionId:m.id,title:I,workspaceId:m.workspaceId}),K(pe=>pe.map(qe=>qe.id===m.id?{...qe,title:I}:qe))}function Hs(m){L&&(De(!1),He(null),It(m),le({type:"mcp.list",sessionId:L}),le({type:"plugin.list",sessionId:L}))}const lu={mcpAction:(m,I)=>{L&&(le({type:"mcp.action",sessionId:L,name:m,action:I}),It(null))},mcpAdd:(m,I)=>{L&&le({type:"mcp.add",sessionId:L,name:m,draft:I})},mcpRemove:m=>{L&&le({type:"mcp.remove",sessionId:L,name:m})},pluginInstall:m=>{L&&le({type:"plugin.install",sessionId:L,spec:m})},pluginUninstall:m=>{L&&le({type:"plugin.uninstall",sessionId:L,id:m})},pluginToggle:(m,I)=>{L&&le({type:"plugin.toggle",sessionId:L,id:m,enabled:I})},marketplaceAdd:m=>{L&&le({type:"marketplace.add",sessionId:L,source:m})},marketplaceRemove:m=>{L&&le({type:"marketplace.remove",sessionId:L,name:m})}};function Uc(){De(!1),Fn(!0),le({type:"auth.status"})}const kr={login:(m,I)=>le({type:"auth.login",mode:m,switchAccount:I}),submitCode:m=>le({type:"auth.code",code:m}),cancel:()=>le({type:"auth.cancel"}),logout:()=>le({type:"auth.logout"})};function Kf(){De(!1),Wn(!0),le({type:"settings.get"})}function Zf(m){Ll(I=>I&&{...I,...m}),le({type:"settings.update",settings:m})}function Ff(m){L&&le({type:"side.ask",sessionId:L,text:m})}function su(){L&&(le({type:"side.reset",sessionId:L}),bs.current=null,za(null),yr(bl),_r(null),Ls({}),Ci.current=[])}function Va(m){const I=bs.current;if(I){m(I);return}const pe=Vn.current;pe&&(Ci.current.push(m),le({type:"side.open",sessionId:pe}))}function Nr(){A&&le({type:"git.state",workspaceId:A})}function Il(m){A&&(tl(m),le({type:"git.show",workspaceId:A,ref:m}))}function Ii(m,I){Yt(null),os({target:m,label:I})}function kl(){!A||!dl||(le({type:"git.checkout",workspaceId:A,target:dl.target}),os(null))}function $a(){A&&(Yt(null),le({type:"git.push",workspaceId:A}))}function Hc(m){A&&(Yt(null),le({type:"git.pull",workspaceId:A,merge:m}))}function Tr(){A&&(Yt(null),Fl(null),zl(!0),le({type:"github.status"}),le({type:"github.owners"}),le({type:"git.files",workspaceId:A}))}function Er(m){A&&(Yt(null),le({type:"git.publish",workspaceId:A,...m}))}function Bc(m){A&&(Yt(null),le({type:"git.remote",workspaceId:A,url:m}))}function da(){Yt(null),wl(!0)}function au(m){le({type:"github.token",token:m}),le({type:"github.owners"})}function Ar(){le({type:"github.status"}),le({type:"github.owners"})}y.useEffect(()=>{if(!(!Tn||!A))for(const m of At)m in jt||le({type:"fs.list",workspaceId:A,path:m})},[Tn,At,jt,A,le]);function Qa(m){ll(I=>I.includes(m)?I.filter(pe=>pe!==m):[...I,m])}function Jf(m){if(!m){We(null);return}A&&le({type:"fs.search",workspaceId:A,query:m})}function pl(m){if(!m){Hl(null);return}A&&le({type:"fs.grep",workspaceId:A,query:m})}const Cr=y.useCallback((m,I)=>{la(Xt=>({...Xt,[m]:I}));const pe=En.current;if(I===null||!pe)return;const qe=I.lastIndexOf("/");if(qe!==-1){le({type:"fs.list",workspaceId:pe,path:I.slice(0,qe)});return}if(I===""){le({type:"fs.list",workspaceId:pe,path:""});return}le({type:"fs.search",workspaceId:pe,query:I,scope:m})},[le]),xs=y.useMemo(()=>Kx(ft.mention??null,fs.mention??null,jt),[ft.mention,fs.mention,jt]),iu=y.useMemo(()=>Kx(ft.side??null,fs.side??null,jt),[ft.side,fs.side,jt]);function Rr(m){qi(m.path,{line:m.line,column:m.column})}function ha(m){const I=[];let pe=dr(m.path);for(;I.push(pe),!!pe;)pe=dr(pe);ll(qe=>{const Xt=new Set(qe);for(const An of I)Xt.add(An);return m.kind==="dir"&&Xt.add(m.path),[...Xt]}),m.kind==="file"&&qi(m.path)}function qi(m,I){if(Bl.current.find(qe=>qe.path===m)){fe(m),I&&sa({path:m,...I,token:++hs.current});return}A&&(I&&(Oa.current={path:m,...I}),Mi.current.add(m),le({type:"fs.read",workspaceId:A,path:m}))}function Mr(m,I=!1){const pe=Bl.current,qe=pe.find(qn=>qn.path===m);if(qe&&Aa(qe)&&!I){ae(m);return}ae(null);const Xt=pe.findIndex(qn=>qn.path===m),An=pe.filter(qn=>qn.path!==m);k(An),fe(qn=>{var ba;return qn===m?((ba=An[Math.min(Xt,An.length-1)])==null?void 0:ba.path)??null:qn})}function Ka(m,I=!1){const pe=Bl.current.find(qe=>qe.path===m);!pe||!A||!I&&!Aa(pe)||(Ha.current.set(m,pe.text),le({type:"fs.write",workspaceId:A,path:m,content:pe.text,eol:pe.eol,encoding:pe.encoding,baseMtime:pe.mtime,...I?{force:!0}:{}}))}function ru(m){A&&le({type:"fs.read",workspaceId:A,path:m})}function Nl(m){A&&(Jl.current.has(m)||(Jl.current.add(m),le({type:"fs.readMedia",workspaceId:A,path:m})))}const Za=y.useRef(new Map);function Fa(m){const I=Za.current,pe=I.get(m);pe&&clearTimeout(pe);const qe=(Nn==null?void 0:Nn.autoSaveAfterPauseMs)??0;qe<=0||I.set(m,setTimeout(()=>{I.delete(m);const Xt=Bl.current.find(An=>An.path===m);Xt&&Aa(Xt)&&!Xt.stale&&Ka(m)},qe))}function Dr(m,I,pe){if(!A)return;const qe=m?`${m}/${pe}`:pe;Oe(null),I==="file"&&(Ia.current=qe),le({type:"fs.create",workspaceId:A,path:qe,kind:I})}function Gi(m,I){if(!A)return;const pe=dr(m),qe=pe?`${pe}/${I}`:I;Oe(null),Ba.current={from:m,to:qe},le({type:"fs.rename",workspaceId:A,path:m,to:qe})}function Tl(m,I){if(!A)return;const pe=m.slice(m.lastIndexOf("/")+1),qe=I?`${I}/${pe}`:pe;qe!==m&&(Oe(null),Ba.current={from:m,to:qe},le({type:"fs.rename",workspaceId:A,path:m,to:qe}))}function El(m,I){A&&(Oe(null),le({type:"fs.copy",workspaceId:A,path:m,toDir:I}))}function Bs(m){A&&(Oe(null),mt(null),le({type:"fs.delete",workspaceId:A,path:m.path}),k(I=>I.filter(pe=>pe.path!==m.path&&!pe.path.startsWith(`${m.path}/`))),fe(I=>I&&(I===m.path||I.startsWith(`${m.path}/`))?null:I))}function Wl(){Ul({}),ll([""]),k([]),fe(null),Oe(null),We(null),Hl(null),la({}),Nc({}),sa(null),Mi.current.clear(),Ha.current.clear(),Jl.current.clear(),Oa.current=null,Ba.current=null,Ia.current=null}function Pl(){!A||Os||!ms||(ra(null),La.current=!0,le({type:"term.open",workspaceId:A,cols:80,rows:24}))}function ys(m){le({type:"term.close",id:m})}function cu(m,I){L&&le({type:"permission.respond",sessionId:L,requestId:m,decision:I})}function Ic(m,I){L&&le({type:"permission.respond",sessionId:L,requestId:m,decision:"allow",answers:I})}function qc(m){L&&le({type:"permission.respond",sessionId:L,requestId:m,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function ou(m,I){L&&le({type:"permission.respond",sessionId:L,requestId:m,decision:"allow",plan:I})}function Bn(m){L&&le({type:"permission.respond",sessionId:L,requestId:m,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function m(I){if(I.key!=="Escape")return;if(ln!==null){const qe=I.target;if(!(qe instanceof HTMLElement&&qe.closest(".termview, .editor, .sidepane"))){Ec(null);return}}if(!L||V.pending.length>0)return;const pe=I.target;pe instanceof HTMLElement&&pe.closest(".sidepane, .editor")||le({type:"control.interrupt",sessionId:L})}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[L,V.pending.length,le,ln]),y.useEffect(()=>{function m(I){I.key!=="`"||!(I.ctrlKey||I.metaKey)||ms&&(I.preventDefault(),br(pe=>!pe))}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[ms]);const Ct=y.useMemo(()=>{const m=(ye==null?void 0:ye.commands)??[];return m.length===0||(W==null?void 0:W.provider)==="antigravity"?m:[...m,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Qx]},[ye,W==null?void 0:W.provider]);function lt(m){const I=lN[m];return I&&(W==null?void 0:W.provider)!=="antigravity"?(Hs(I),!0):(W==null?void 0:W.provider)==="antigravity"||!Qx.some(pe=>pe.name===m)?!1:(Uc(),m==="logout"&&kr.logout(),m==="switch-account"&&kr.login("claudeai",!0),!0)}const ql=(W==null?void 0:W.state)==="waiting_permission",sn=(W==null?void 0:W.state)==="reconnecting",ml=(W==null?void 0:W.state)==="running"||sn||ql,gn=V.pending[0]??null,Gc=gn?cw(gn.toolName,gn.input):null;y.useEffect(()=>{!Qt&&!Tn||!A||ml||le({type:"git.state",workspaceId:A})},[Qt,Tn,A,ml,le]),y.useEffect(()=>{if(!(ml||!A)){Tn&&Ul(m=>{const I={};for(const[pe,qe]of Object.entries(m))Ko.current.includes(pe)||(I[pe]=qe);return I});for(const m of Bl.current)Aa(m)||le({type:"fs.read",workspaceId:A,path:m.path})}},[ml,A,Tn,le]);const Or=(W==null?void 0:W.cwd)??(ye==null?void 0:ye.cwd)??null,pa=(ye==null?void 0:ye.models)??[],es=(W==null?void 0:W.model)??(ye==null?void 0:ye.model)??null,{rows:Lr,selected:Yi}=Fx(pa,es),ma=gs?{model:gs.model,effort:gs.effort,ultracode:gs.ultracode,thinking:gs.thinking,switchOnFlag:gs.switchModelsOnFlag}:{model:Ai.model??es,effort:Ai.effort??(W==null?void 0:W.effort)??null,ultracode:Ai.ultracode??(W==null?void 0:W.ultracode)??!1,thinking:Ai.thinking??(W==null?void 0:W.thinking)??!0,switchOnFlag:Ai.switchOnFlag??(W==null?void 0:W.switchModelsOnFlag)??!0},Is=Fx(pa,ma.model),_s=(gs==null?void 0:gs.state)==="running",ts=Y?he.find(m=>m.path===Y)??null:null,vs=new Set(he.filter(Aa).map(m=>m.path)),ga=m=>i.jsx(Bk,{pane:m,width:jl.widths[m],onResize:I=>jl.setWidth(m,I),onReset:()=>jl.reset(m)}),qs=m=>Ve?null:()=>qf(m),Ja=(W==null?void 0:W.provider)==="antigravity"?G0:cy,Xi=ye&&i.jsx(Es,{title:"Режим прав",value:(W==null?void 0:W.permissionMode)??"default",options:Ja.map(m=>({value:m.value,label:m.value,hint:m.hint})),onChange:m=>{L&&le({type:"control.set_mode",sessionId:L,mode:m})}}),Gs=Lr.length>0?i.jsx(Vy,{models:Lr,value:Yi,effort:(W==null?void 0:W.effort)??null,ultracode:(W==null?void 0:W.ultracode)??!1,thinking:(W==null?void 0:W.thinking)??!0,switchOnFlag:(W==null?void 0:W.switchModelsOnFlag)??!0,showSwitchOnFlag:(W==null?void 0:W.provider)!=="antigravity",onModel:m=>{!L||!m||le({type:"control.set_model",sessionId:L,model:m})},onEffort:m=>{L&&le({type:"control.set_effort",sessionId:L,effort:m})},onUltracode:m=>{L&&le({type:"control.set_ultracode",sessionId:L,enabled:m})},onThinking:m=>{L&&le({type:"control.set_thinking",sessionId:L,enabled:m})},onSwitchOnFlag:m=>{L&&le({type:"control.set_flag_switch",sessionId:L,enabled:m})}}):es&&i.jsx("span",{className:"badge",children:es}),In=ml&&i.jsx("span",{className:ql?"badge badge--wait":"badge badge--live",children:ql?"ждёт":sn?"переподключается":"работает"}),zr=(W==null?void 0:W.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Yc=In||zr,uu=()=>{L&&le({type:"session.reconnect",sessionId:L})},Wf=sn?"Сессия уже поднимает новый процесс":ml?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Pf=L&&(sn||(W==null?void 0:W.state)==="error")?i.jsxs("div",{className:sn?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),sn?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:sn?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:uu,children:sn?"Переподключить сейчас":"Переподключить"})]}):null,bn=zs?i.jsx(Rk,{handoff:zs,onContinue:()=>Xa(zs),onShow:()=>Be(zs),onDismiss:()=>Lc(zs.sessionId)}):null,Vi=W&&W.totalCostUsd>0?`$${W.totalCostUsd.toFixed(3)}`:null,Wa=(W==null?void 0:W.provider)!=="antigravity"&&i.jsx("button",{className:oa?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":oa,onClick:()=>xr(m=>!m),children:i.jsx(dN,{})}),$i=W&&W.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Ui(W),children:i.jsx(oN,{})});return i.jsxs("div",{className:"app",style:jl.style,children:[i.jsx(Hj,{open:ve,connected:l,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:T,sessionFolders:z.filter(m=>m.workspaceId===A),pinnedFolders:F,sessions:O.filter(m=>m.workspaceId===A),archived:C.filter(m=>m.workspaceId===A),pinned:H,live:de,listOrder:Ce,liveSessionsFirst:(Nn==null?void 0:Nn.liveSessionsFirst)===!0,onReorder:Hi,activeWorkspaceId:A,activeSessionId:L,onPinSessions:Qf,onSelectPinned:Oc,onCloseWorkspaces:Vf,onRestoreWorkspaces:hl,onArchiveSessions:$f,onUnarchiveSessions:m=>{A&&le({type:"session.unarchive",workspaceId:A,sessionIds:m})},onCreateFolder:Li,onRenameFolder:Po,onDeleteFolder:eu,onAssignToFolder:tu,onSelectWorkspace:zi,onSelectSession:Bi,onRenameSession:zc,onStopSession:Ui,onOpenWorkspace:()=>un(!0),onNewSession:nu,onOpenExtensions:L&&(W==null?void 0:W.provider)!=="antigravity"?()=>Hs("mcp"):null,account:Jn,onOpenAccount:Uc,relay:d,onOpenRelay:x?null:()=>g(!0),onOpenSettings:Kf,themeMode:Cs,onCycleTheme:Yn}),ga("sidebar"),ve&&i.jsx("div",{className:"scrim",onClick:()=>De(!1)}),i.jsx(tj,{open:Tn,tree:jt,expanded:new Set(At),activePath:Y,dirty:vs,gitChanges:(vt==null?void 0:vt.changed)??[],result:Te,searchResult:ke,onSearch:Jf,onReveal:ha,onToggle:Qa,onOpen:qi,onCreate:Dr,onRename:Gi,onMove:Tl,onCopy:El,onDelete:mt,onRefresh:()=>{Oe(null),Ul({}),Nr()},onClose:()=>mn(!1),zoomed:ln==="files",onToggleZoom:qs("files")}),Tn&&ln!=="files"&&ga("files"),i.jsx(fj,{open:ds,result:Ei,onSearch:pl,onOpenMatch:Rr,onClose:()=>Ma(!1),zoomed:ln==="search",onToggleZoom:qs("search")}),ds&&ln!=="search"&&ga("search"),i.jsx(Sw,{open:Qt,state:vt,result:Rs,selected:zt,busy:us,onRefresh:Nr,onShow:Il,onCheckout:Ii,onPush:$a,onPull:Hc,onPublish:Tr,onConnectRemote:da,onDismissResult:()=>Yt(null),onClose:()=>el(!1),zoomed:ln==="git",onToggleZoom:qs("git")}),Qt&&ln!=="git"&&ga("git"),i.jsxs("main",{className:ln==="main"||ln==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>De(!0),children:"☰"}),i.jsx("button",{className:Tn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Tn,onClick:()=>{mn(m=>!m),el(!1),Ma(!1)},children:i.jsx(iN,{})}),i.jsx("button",{className:ds?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":ds,onClick:()=>{Ma(m=>!m),mn(!1),el(!1)},children:i.jsx(rN,{})}),i.jsx("button",{className:Qt?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Qt,onClick:()=>{el(m=>!m),mn(!1),Ma(!1)},children:i.jsx(cN,{})}),ms&&i.jsx("button",{className:ps?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ps,onClick:()=>br(m=>!m),children:i.jsx(fN,{})}),Ve&&Wa,Ve&&i.jsx("button",{className:$e?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":$e,onClick:()=>Wt(!0),children:i.jsx(hN,{})}),i.jsxs("div",{className:"topbar__id",children:[xt&&W?i.jsx(ea,{className:"rename--title",value:W.title??"",onCommit:m=>{zc(W,m),Xe(!1)},onCancel:()=>Xe(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!W||Ve,title:W&&!Ve?"Переименовать сессию":void 0,onClick:()=>Xe(!0),children:(W==null?void 0:W.title)??"Claude Code Visual"}),Us&&i.jsx("span",{className:"topbar__project",title:Us.path,children:Us.name})]}),Ve?Yc:Or&&i.jsx(Xy,{path:Or})]}),!Ve&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:nn?"meters-refresh is-busy":"meters-refresh",title:Dc,"aria-label":Mc,"aria-busy":nn,disabled:!L||nn,onClick:qa,children:i.jsx(pN,{})}),i.jsx(Qy,{usage:Rc}),i.jsx(Fy,{}),Xi,Gs,Yc,Vi&&i.jsx("span",{className:"badge badge--cost",children:Vi}),$i,Wa]})]}),i.jsx(Jk,{tokens:(et==null?void 0:et.tokens)??V.contextTokens,maxTokens:(et==null?void 0:et.maxTokens)??null,fetchedAt:(et==null?void 0:et.fetchedAt)??null}),Ve&&$e&&i.jsx(ek,{onClose:()=>Wt(!1),permission:Xi,model:Gs,usage:Rc,cwd:Or,costLabel:Vi,onRefresh:qa,refreshing:nn,metersFetchedAt:wr,onRename:W?()=>{Xe(!0),Wt(!1)}:null,onStop:W&&W.state!=="closed"?()=>{Ui(W),Wt(!1)}:null}),he.length>0&&i.jsx(Cj,{files:he,activePath:Y,busy:ml,onSelect:fe,onClose:m=>Mr(m),zoomed:ln==="main",onToggleZoom:qs("main")}),ts?i.jsx(Ej,{file:ts,goto:(Da==null?void 0:Da.path)===ts.path?Da:null,onChange:(m,I)=>{k(pe=>pe.map(qe=>qe.path===m?{...qe,text:I}:qe)),Fa(m)},onSave:m=>Ka(m),onReload:ru,onOverwrite:m=>Ka(m,!0),onRequestMedia:Nl,onTogglePreview:m=>k(I=>I.map(pe=>pe.path===m?{...pe,previewMode:!pe.previewMode}:pe))}):i.jsxs(i.Fragment,{children:[i.jsx(Ap,{items:V.items,busy:ml&&!sn,waiting:ql,empty:(W==null?void 0:W.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:Di,historyHasMore:Mb(me),historyLoading:me.loading,onLoadHistory:Zo,sessionId:L??void 0,onEditMessage:(W==null?void 0:W.provider)==="antigravity"?void 0:(m,I,pe)=>{L&&le({type:"prompt.edit",sessionId:L,userIndex:m,text:I,images:pe})}}),Pf,bn,i.jsx(Gy,{disabled:!L,busy:ml&&!sn,placeholder:sn?"Промпт уйдёт, как только связь вернётся":(W==null?void 0:W.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:Ct,sessionTitle:(W==null?void 0:W.title)??null,contextResult:xs,draftKey:L,onContextSearch:m=>Cr("mention",m),onCommand:lt,onSend:fa,onInterrupt:()=>{L&&le({type:"control.interrupt",sessionId:L})}})]}),ps&&ms&&i.jsxs(i.Fragment,{children:[!Ve&&ln!=="terminal"&&i.jsx(qk,{height:Ds.height,onResize:Ds.setHeight,onReset:Ds.reset}),i.jsx(Vk,{mobile:Ve,zoomed:ln==="terminal",onToggleZoom:qs("terminal"),terminals:aa,activeId:Bo,blocked:Os,error:ia,onDismissError:()=>ra(null),height:Ve?Tc.height:Ds.height,offset:Ve?{top:Tc.offsetTop,left:Tc.offsetLeft}:void 0,onSelect:Hn,onOpen:Pl,onClose:ys,onInput:(m,I)=>le({type:"term.input",id:m,data:I}),onResize:(m,I,pe)=>le({type:"term.resize",id:m,cols:I,rows:pe}),onAttach:m=>le({type:"term.attach",id:m}),onHide:()=>br(!1),registerSink:Io})]})]}),i.jsx(Xw,{open:oa,items:Go.items,busy:_s,ready:L!==null,commands:Ct,contextResult:iu,draftKey:L,models:Is.rows,model:Is.selected,effort:ma.effort,ultracode:ma.ultracode,thinking:ma.thinking,switchOnFlag:ma.switchOnFlag,onContextSearch:m=>Cr("side",m),onCommand:lt,onModel:m=>{m&&(Ls(I=>({...I,model:m})),Va(I=>le({type:"control.set_model",sessionId:I,model:m})))},onEffort:m=>{Ls(I=>({...I,effort:m,ultracode:!1})),Va(I=>le({type:"control.set_effort",sessionId:I,effort:m}))},onUltracode:m=>{Ls(I=>({...I,ultracode:m,...m?{effort:"xhigh"}:{}})),Va(I=>le({type:"control.set_ultracode",sessionId:I,enabled:m}))},onThinking:m=>{Ls(I=>({...I,thinking:m})),Va(I=>le({type:"control.set_thinking",sessionId:I,enabled:m}))},onSwitchOnFlag:m=>{Ls(I=>({...I,switchOnFlag:m})),Va(I=>le({type:"control.set_flag_switch",sessionId:I,enabled:m}))},onAsk:Ff,onInterrupt:()=>{qo&&le({type:"control.interrupt",sessionId:qo})},onReset:su,onClose:()=>xr(!1),zoomed:ln==="ask",onToggleZoom:qs("ask")}),oa&&ln!=="ask"&&ga("ask"),(Qt||oa||Tn||ds)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{el(!1),xr(!1),mn(!1),Ma(!1)}}),zn&&i.jsx(Nw,{detail:zn,local:((vt==null?void 0:vt.hasRemote)??!1)&&(vt==null?void 0:vt.commits.some(m=>m.hash===zn.hash&&!m.pushed))===!0,onCheckout:Ii,onClose:()=>{pn(null),tl(null)}}),ue&&i.jsx(yl,{title:"Остановить сессию?",onClose:()=>je(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>je(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{le({type:"session.close",sessionId:ue.id}),je(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),dl&&i.jsxs(yl,{title:"Переключить рабочее дерево?",onClose:()=>os(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>os(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:kl,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",dl.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),ml&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),vt&&vt.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",vt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Ut&&i.jsx(Hw,{status:na,owners:nl,files:Ti,defaultName:(Us==null?void 0:Us.name)??"",hasCommits:vt===null||vt.head!=="",busy:us,result:Rs,onRefreshStatus:Ar,onSaveToken:au,onPublish:Er,onDismissResult:()=>Yt(null),onClose:()=>zl(!1)}),Xn&&i.jsx(Yw,{busy:us,result:Rs,onSubmit:Bc,onDismissResult:()=>Yt(null),onClose:()=>wl(!1)}),Le&&i.jsx(yl,{title:Le.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>mt(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>mt(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Bs(Le),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[Le.path," будет удалён с диска",Le.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),w&&i.jsx(yl,{title:"Закрыть без сохранения?",onClose:()=>ae(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>ae(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Mr(w,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{Ka(w),Mr(w,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",w," есть несохранённые правки."]})}),vn&&i.jsx(nk,{tab:vn,servers:dn,plugins:qt,marketplaces:Et,catalog:_l,result:ge,actions:lu,onTab:It,onClose:()=>It(null)}),Zn&&i.jsx(uk,{status:Jn,login:Pn,actions:kr,remote:x,runningSessions:O.filter(m=>m.state==="running"||m.state==="waiting_permission").length,onReconnect:L?()=>{uu(),Fn(!1)}:null,reconnectBlocked:ml,reconnectHint:Wf,onClose:()=>Fn(!1)}),p&&i.jsx(mk,{state:d,onPair:(m,I)=>le({type:"relay.pair",code:m,...I?{name:I}:{}}),onUnpair:()=>le({type:"relay.unpair"}),onClose:()=>g(!1)}),fl&&i.jsx(Ek,{settings:Nn,models:(ye==null?void 0:ye.models)??[],relayState:d,local:wf()==="local",onChange:Zf,onEnableShell:()=>le({type:"relay.shell.enable"}),onDisableShell:()=>le({type:"relay.shell.disable"}),onOpenRelay:()=>{Wn(!1),g(!0)},onClose:()=>Wn(!1)}),it&&i.jsx(dw,{candidates:ut,searching:kn,agentItems:Pt.items,agentBusy:(Pe==null?void 0:Pe.state)==="running",error:Vt,roots:wt,created:rn,onSearch:Wo,onAskAgent:Yf,onInterrupt:()=>{const m=jr.current;m&&le({type:"control.interrupt",sessionId:m})},onSubmit:Fo,onCreate:Jo,onClose:Xf}),gn!=null&&gn.questions&&gn.questions.length>0?i.jsx(nw,{request:{...gn,questions:gn.questions},queued:V.pending.length-1,onAnswer:Ic,onDecline:qc}):gn&&Gc!==null?i.jsx(aw,{request:gn,plan:Gc,queued:V.pending.length-1,onAccept:ou,onDecline:Bn}):gn&&i.jsx(tw,{request:gn,queued:V.pending.length-1,onDecide:cu}),_e&&i.jsx(Mk,{handoff:_e,onClose:()=>Be(null)}),i.jsx(zk,{notices:Gt,onDismiss:m=>vl(I=>I.filter(pe=>pe.id!==m))})]})}function iN(){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 rN(){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 cN(){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 oN(){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 uN(s,l){return Jx(s)===Jx(l)}function Jx(s){return s.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function fN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),i.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),i.jsx("path",{d:"M8.2 10h3.1"})]})}function dN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function hN(){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 pN(){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 Wy=document.getElementById("root");if(!Wy)throw new Error("#root not found");v0.createRoot(Wy).render(i.jsx(y.StrictMode,{children:i.jsx(aN,{})}));export{y1 as D,Zt as I,Jt as N,bN as P,rs as T,As as a,ky as b,Ol as c,gN as d,Cy as e,Lo as f,H1 as h,xN as p,yN as s,Ne as t};
|