@i14ks/ccv 0.13.0 → 0.14.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 +110 -2
- package/package.json +1 -1
- package/web/assets/{codemirror-DAgbW3uz.js → codemirror-DfnUEAQ1.js} +1 -1
- package/web/assets/{index-B_KTK-Ue.js → index-1NZdgXKt.js} +1 -1
- package/web/assets/{index-1j2ILa-W.js → index-6WrTm4Cl.js} +1 -1
- package/web/assets/{index-C11bbOpw.js → index-Aa3M3Mcp.js} +1 -1
- package/web/assets/{index-CIpZI228.js → index-B4QS6XYB.js} +1 -1
- package/web/assets/{index-D-pPtz2I.js → index-BBJ7uyxo.js} +1 -1
- package/web/assets/{index-DPG5pWPG.js → index-BFyhFly9.js} +1 -1
- package/web/assets/{index-BI8B49yl.js → index-BSHub4Y3.js} +1 -1
- package/web/assets/{index-C0igZOa9.js → index-BUVVNNln.js} +1 -1
- package/web/assets/{index-CquqZqWN.js → index-BrhFysJH.js} +1 -1
- package/web/assets/{index-CFzKsiua.js → index-C33PhVuR.js} +1 -1
- package/web/assets/{index-XkZY-Wpw.js → index-CE-6gz9W.js} +1 -1
- package/web/assets/{index-CzYpffog.js → index-CReKaug6.js} +1 -1
- package/web/assets/{index-Bjh8yEB4.js → index-C_0hLH-6.js} +1 -1
- package/web/assets/{index-BO3Em_j_.js → index-Cu9yVjDd.js} +1 -1
- package/web/assets/{index-Cd-2HW_i.js → index-DLoVg97c.js} +1 -1
- package/web/assets/{index-BTNpZcr3.js → index-DNvUBsh8.js} +1 -1
- package/web/assets/{index-DDJ5NYOk.js → index-DdCEnSCp.js} +1 -1
- package/web/assets/{index-DmfDW_VA.js → index-DdWyOJPD.js} +1 -1
- package/web/assets/{index-CBTNRCgC.js → index-UUIF3jgc.js} +1 -1
- package/web/assets/index-i3oOZBX4.js +133 -0
- package/web/assets/index-ihyDKGfF.css +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-CWCyiPjz.js +0 -132
- package/web/assets/index-s-BhjU3m.css +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Cu9yVjDd.js","./index-1NZdgXKt.js","./index-UUIF3jgc.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-B4QS6XYB.js","./index-DLoVg97c.js","./index-6WrTm4Cl.js","./index-DdCEnSCp.js","./index-BrhFysJH.js","./index-BBJ7uyxo.js","./index-CReKaug6.js","./index-Aa3M3Mcp.js","./index-BFyhFly9.js","./index-BSHub4Y3.js","./index-C_0hLH-6.js","./index-C33PhVuR.js","./index-BUVVNNln.js","./index-DNvUBsh8.js","./index-DdWyOJPD.js","./index-CE-6gz9W.js","./codemirror-DfnUEAQ1.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 i0=Object.defineProperty;var gb=s=>{throw TypeError(s)};var r0=(s,l,r)=>l in s?i0(s,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[l]=r;var It=(s,l,r)=>r0(s,typeof l!="symbol"?l+"":l,r),ph=(s,l,r)=>l.has(s)||gb("Cannot "+r);var qe=(s,l,r)=>(ph(s,l,"read from private field"),r?r.call(s):l.get(s)),fn=(s,l,r)=>l.has(s)?gb("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(s):l.set(s,r),wt=(s,l,r,c)=>(ph(s,l,"write to private field"),c?c.call(s,r):l.set(s,r),r),zn=(s,l,r)=>(ph(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 mh={exports:{}},so={};/**
|
|
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 bb;function c0(){if(bb)return so;bb=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 so.Fragment=l,so.jsx=r,so.jsxs=r,so}var xb;function o0(){return xb||(xb=1,mh.exports=c0()),mh.exports}var i=o0(),gh={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 yb;function u0(){if(yb)return Qe;yb=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"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function A(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(){}},M=Object.assign,z={};function G(N,X,ie){this.props=N,this.context=X,this.refs=z,this.updater=ie||T}G.prototype.isReactComponent={},G.prototype.setState=function(N,X){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,X,"setState")},G.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function Q(){}Q.prototype=G.prototype;function Y(N,X,ie){this.props=N,this.context=X,this.refs=z,this.updater=ie||T}var D=Y.prototype=new Q;D.constructor=Y,M(D,G.prototype),D.isPureReactComponent=!0;var K=Array.isArray;function H(){}var C={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ae(N,X,ie){var he=ie.ref;return{$$typeof:s,type:N,key:X,ref:he!==void 0?he:null,props:ie}}function be(N,X){return ae(N.type,X,N.props)}function W(N){return typeof N=="object"&&N!==null&&N.$$typeof===s}function ue(N){var X={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ie){return X[ie]})}var Se=/\/+/g;function Re(N,X){return typeof N=="object"&&N!==null&&N.key!=null?ue(""+N.key):X.toString(36)}function Ce(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(H,H):(N.status="pending",N.then(function(X){N.status==="pending"&&(N.status="fulfilled",N.value=X)},function(X){N.status==="pending"&&(N.status="rejected",N.reason=X)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function E(N,X,ie,he,ke){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,E(De(N._payload),X,ie,he,ke)}}if(De)return ke=ke(N),De=he===""?"."+Re(N,0):he,K(ke)?(ie="",De!=null&&(ie=De.replace(Se,"$&/")+"/"),E(ke,X,ie,"",function(Ve){return Ve})):ke!=null&&(W(ke)&&(ke=be(ke,ie+(ke.key==null||N&&N.key===ke.key?"":(""+ke.key).replace(Se,"$&/")+"/")+De)),X.push(ke)),1;De=0;var vt=he===""?".":he+":";if(K(N))for(var Xe=0;Xe<N.length;Xe++)he=N[Xe],ve=vt+Re(he,Xe),De+=E(he,X,ie,ve,ke);else if(Xe=A(N),typeof Xe=="function")for(N=Xe.call(N),Xe=0;!(he=N.next()).done;)he=he.value,ve=vt+Re(he,Xe++),De+=E(he,X,ie,ve,ke);else if(ve==="object"){if(typeof N.then=="function")return E(Ce(N),X,ie,he,ke);throw X=String(N),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return De}function re(N,X,ie){if(N==null)return N;var he=[],ke=0;return E(N,he,"","",function(ve){return X.call(ie,ve,ke++)}),he}function O(N){if(N._status===-1){var X=N._result;X=X(),X.then(function(ie){(N._status===0||N._status===-1)&&(N._status=1,N._result=ie)},function(ie){(N._status===0||N._status===-1)&&(N._status=2,N._result=ie)}),N._status===-1&&(N._status=0,N._result=X)}if(N._status===1)return N._result.default;throw N._result}var ge=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=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(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},xe={map:re,forEach:function(N,X,ie){re(N,function(){X.apply(this,arguments)},ie)},count:function(N){var X=0;return re(N,function(){X++}),X},toArray:function(N){return re(N,function(X){return X})||[]},only:function(N){if(!W(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Qe.Activity=j,Qe.Children=xe,Qe.Component=G,Qe.Fragment=r,Qe.Profiler=o,Qe.PureComponent=Y,Qe.StrictMode=c,Qe.Suspense=m,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return C.H.useMemoCache(N)}},Qe.cache=function(N){return function(){return N.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(N,X,ie){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var he=M({},N.props),ke=N.key;if(X!=null)for(ve in X.key!==void 0&&(ke=""+X.key),X)!Z.call(X,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&X.ref===void 0||(he[ve]=X[ve]);var ve=arguments.length-2;if(ve===1)he.children=ie;else if(1<ve){for(var De=Array(ve),vt=0;vt<ve;vt++)De[vt]=arguments[vt+2];he.children=De}return ae(N.type,ke,he)},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,X,ie){var he,ke={},ve=null;if(X!=null)for(he in X.key!==void 0&&(ve=""+X.key),X)Z.call(X,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(ke[he]=X[he]);var De=arguments.length-2;if(De===1)ke.children=ie;else if(1<De){for(var vt=Array(De),Xe=0;Xe<De;Xe++)vt[Xe]=arguments[Xe+2];ke.children=vt}if(N&&N.defaultProps)for(he in De=N.defaultProps,De)ke[he]===void 0&&(ke[he]=De[he]);return ae(N,ve,ke)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(N){return{$$typeof:p,render:N}},Qe.isValidElement=W,Qe.lazy=function(N){return{$$typeof:_,_payload:{_status:-1,_result:N},_init:O}},Qe.memo=function(N,X){return{$$typeof:x,type:N,compare:X===void 0?null:X}},Qe.startTransition=function(N){var X=C.T,ie={};C.T=ie;try{var he=N(),ke=C.S;ke!==null&&ke(ie,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(H,ge)}catch(ve){ge(ve)}finally{X!==null&&ie.types!==null&&(X.types=ie.types),C.T=X}},Qe.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},Qe.use=function(N){return C.H.use(N)},Qe.useActionState=function(N,X,ie){return C.H.useActionState(N,X,ie)},Qe.useCallback=function(N,X){return C.H.useCallback(N,X)},Qe.useContext=function(N){return C.H.useContext(N)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(N,X){return C.H.useDeferredValue(N,X)},Qe.useEffect=function(N,X){return C.H.useEffect(N,X)},Qe.useEffectEvent=function(N){return C.H.useEffectEvent(N)},Qe.useId=function(){return C.H.useId()},Qe.useImperativeHandle=function(N,X,ie){return C.H.useImperativeHandle(N,X,ie)},Qe.useInsertionEffect=function(N,X){return C.H.useInsertionEffect(N,X)},Qe.useLayoutEffect=function(N,X){return C.H.useLayoutEffect(N,X)},Qe.useMemo=function(N,X){return C.H.useMemo(N,X)},Qe.useOptimistic=function(N,X){return C.H.useOptimistic(N,X)},Qe.useReducer=function(N,X,ie){return C.H.useReducer(N,X,ie)},Qe.useRef=function(N){return C.H.useRef(N)},Qe.useState=function(N){return C.H.useState(N)},Qe.useSyncExternalStore=function(N,X,ie){return C.H.useSyncExternalStore(N,X,ie)},Qe.useTransition=function(){return C.H.useTransition()},Qe.version="19.2.8",Qe}var _b;function lp(){return _b||(_b=1,gh.exports=u0()),gh.exports}var y=lp(),bh={exports:{}},ao={},xh={exports:{}},yh={};/**
|
|
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 vb;function f0(){return vb||(vb=1,(function(s){function l(E,re){var O=E.length;E.push(re);e:for(;0<O;){var ge=O-1>>>1,xe=E[ge];if(0<o(xe,re))E[ge]=re,E[O]=xe,O=ge;else break e}}function r(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var re=E[0],O=E.pop();if(O!==re){E[0]=O;e:for(var ge=0,xe=E.length,N=xe>>>1;ge<N;){var X=2*(ge+1)-1,ie=E[X],he=X+1,ke=E[he];if(0>o(ie,O))he<xe&&0>o(ke,ie)?(E[ge]=ke,E[he]=O,ge=he):(E[ge]=ie,E[X]=O,ge=X);else if(he<xe&&0>o(ke,O))E[ge]=ke,E[he]=O,ge=he;else break e}}return re}function o(E,re){var O=E.sortIndex-re.sortIndex;return O!==0?O:E.id-re.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 m=[],x=[],_=1,j=null,v=3,A=!1,T=!1,M=!1,z=!1,G=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function D(E){for(var re=r(x);re!==null;){if(re.callback===null)c(x);else if(re.startTime<=E)c(x),re.sortIndex=re.expirationTime,l(m,re);else break;re=r(x)}}function K(E){if(M=!1,D(E),!T)if(r(m)!==null)T=!0,H||(H=!0,ue());else{var re=r(x);re!==null&&Ce(K,re.startTime-E)}}var H=!1,C=-1,Z=5,ae=-1;function be(){return z?!0:!(s.unstable_now()-ae<Z)}function W(){if(z=!1,H){var E=s.unstable_now();ae=E;var re=!0;try{e:{T=!1,M&&(M=!1,Q(C),C=-1),A=!0;var O=v;try{t:{for(D(E),j=r(m);j!==null&&!(j.expirationTime>E&&be());){var ge=j.callback;if(typeof ge=="function"){j.callback=null,v=j.priorityLevel;var xe=ge(j.expirationTime<=E);if(E=s.unstable_now(),typeof xe=="function"){j.callback=xe,D(E),re=!0;break t}j===r(m)&&c(m),D(E)}else c(m);j=r(m)}if(j!==null)re=!0;else{var N=r(x);N!==null&&Ce(K,N.startTime-E),re=!1}}break e}finally{j=null,v=O,A=!1}re=void 0}}finally{re?ue():H=!1}}}var ue;if(typeof Y=="function")ue=function(){Y(W)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,Re=Se.port2;Se.port1.onmessage=W,ue=function(){Re.postMessage(null)}}else ue=function(){G(W,0)};function Ce(E,re){C=G(function(){E(s.unstable_now())},re)}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(E){E.callback=null},s.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<E?Math.floor(1e3/E):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(E){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var O=v;v=re;try{return E()}finally{v=O}},s.unstable_requestPaint=function(){z=!0},s.unstable_runWithPriority=function(E,re){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var O=v;v=E;try{return re()}finally{v=O}},s.unstable_scheduleCallback=function(E,re,O){var ge=s.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?ge+O:ge):O=ge,E){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=O+xe,E={id:_++,callback:re,priorityLevel:E,startTime:O,expirationTime:xe,sortIndex:-1},O>ge?(E.sortIndex=O,l(x,E),r(m)===null&&E===r(x)&&(M?(Q(C),C=-1):M=!0,Ce(K,O-ge))):(E.sortIndex=xe,l(m,E),T||A||(T=!0,H||(H=!0,ue()))),E},s.unstable_shouldYield=be,s.unstable_wrapCallback=function(E){var re=v;return function(){var O=v;v=re;try{return E.apply(this,arguments)}finally{v=O}}}})(yh)),yh}var Sb;function d0(){return Sb||(Sb=1,xh.exports=f0()),xh.exports}var _h={exports:{}},rl={};/**
|
|
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 jb;function h0(){if(jb)return rl;jb=1;var s=lp();function l(m){var x="https://react.dev/errors/"+m;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; 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(m,x,_){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:m,containerInfo:x,implementation:_}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,x){if(m==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return rl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,rl.createPortal=function(m,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(m,x,null,_)},rl.flushSync=function(m){var x=h.T,_=c.p;try{if(h.T=null,c.p=2,m)return m()}finally{h.T=x,c.p=_,c.d.f()}},rl.preconnect=function(m,x){typeof m=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(m,x))},rl.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},rl.preinit=function(m,x){if(typeof m=="string"&&x&&typeof x.as=="string"){var _=x.as,j=p(_,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,A=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?c.d.S(m,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:A}):_==="script"&&c.d.X(m,{crossOrigin:j,integrity:v,fetchPriority:A,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},rl.preinitModule=function(m,x){if(typeof m=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=p(x.as,x.crossOrigin);c.d.M(m,{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(m)},rl.preload=function(m,x){if(typeof m=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,j=p(_,x.crossOrigin);c.d.L(m,_,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},rl.preloadModule=function(m,x){if(typeof m=="string")if(x){var _=p(x.as,x.crossOrigin);c.d.m(m,{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(m)},rl.requestFormReset=function(m){c.d.r(m)},rl.unstable_batchedUpdates=function(m,x){return m(x)},rl.useFormState=function(m,x,_){return h.H.useFormState(m,x,_)},rl.useFormStatus=function(){return h.H.useHostTransitionStatus()},rl.version="19.2.8",rl}var wb;function p0(){if(wb)return _h.exports;wb=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(),_h.exports=h0(),_h.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 kb;function m0(){if(kb)return ao;kb=1;var s=d0(),l=lp(),r=p0();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 m(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 m(u),e;if(f===a)return m(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var b=!1,S=u.child;S;){if(S===n){b=!0,n=u,a=f;break}if(S===a){b=!0,a=u,n=f;break}S=S.sibling}if(!b){for(S=f.child;S;){if(S===n){b=!0,n=f,a=u;break}if(S===a){b=!0,a=f,n=u;break}S=S.sibling}if(!b)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case G:return"Profiler";case z:return"StrictMode";case K:return"Suspense";case H:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case Y:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var Ce=Array.isArray,E=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O={pending:!1,data:null,method:null,action:null},ge=[],xe=-1;function N(e){return{current:e}}function X(e){0>xe||(e.current=ge[xe],ge[xe]=null,xe--)}function ie(e,t){xe++,ge[xe]=e.current,e.current=t}var he=N(null),ke=N(null),ve=N(null),De=N(null);function vt(e,t){switch(ie(ve,t),ie(ke,e),ie(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bg(t),e=Ig(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}X(he),ie(he,e)}function Xe(){X(he),X(ke),X(ve)}function Ve(e){e.memoizedState!==null&&ie(De,e);var t=he.current,n=Ig(t,e.type);t!==n&&(ie(ke,e),ie(he,n))}function $e(e){ke.current===e&&(X(he),X(ke)),De.current===e&&(X(De),eo._currentValue=O)}var tn,it;function dn(e){if(tn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);tn=t&&t[1]||"",it=-1<n.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+tn+e+it}var ut=!1;function hn(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 ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(P){var F=P}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(P){F=P}e.call(ce.prototype)}}else{try{throw Error()}catch(P){F=P}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(P){if(P&&F&&typeof P.stack=="string")return[P.stack,F.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),b=f[0],S=f[1];if(b&&S){var R=b.split(`
|
|
45
|
+
`),$=S.split(`
|
|
46
|
+
`);for(u=a=0;a<R.length&&!R[a].includes("DetermineComponentFrameRoot");)a++;for(;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;if(a===R.length||u===$.length)for(a=R.length-1,u=$.length-1;1<=a&&0<=u&&R[a]!==$[u];)u--;for(;1<=a&&0<=u;a--,u--)if(R[a]!==$[u]){if(a!==1||u!==1)do if(a--,u--,0>u||R[a]!==$[u]){var ne=`
|
|
47
|
+
`+R[a].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=a&&0<=u);break}}}finally{ut=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?dn(n):""}function En(e,t){switch(e.tag){case 26:case 27:case 5:return dn(e.type);case 16:return dn("Lazy");case 13:return e.child!==t&&t!==null?dn("Suspense Fallback"):dn("Suspense");case 19:return dn("SuspenseList");case 0:case 15:return hn(e.type,!1);case 11:return hn(e.type.render,!1);case 1:return hn(e.type,!0);case 31:return dn("Activity");default:return""}}function Sn(e){try{var t="",n=null;do t+=En(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
48
|
+
Error generating stack: `+a.message+`
|
|
49
|
+
`+a.stack}}var nn=Object.prototype.hasOwnProperty,nt=s.unstable_scheduleCallback,Pe=s.unstable_cancelCallback,ln=s.unstable_shouldYield,Kt=s.unstable_requestPaint,lt=s.unstable_now,Et=s.unstable_getCurrentPriorityLevel,Zt=s.unstable_ImmediatePriority,on=s.unstable_UserBlockingPriority,At=s.unstable_NormalPriority,jn=s.unstable_LowPriority,$t=s.unstable_IdlePriority,pn=s.log,Hn=s.unstable_setDisableYieldValue,Qt=null,rt=null;function Ot(e){if(typeof pn=="function"&&Hn(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Qt,e)}catch{}}var We=Math.clz32?Math.clz32:pe,gl=Math.log,ee=Math.LN2;function pe(e){return e>>>=0,e===0?32:31-(gl(e)/ee|0)|0}var He=256,U=262144,J=4194304;function ye(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 Ge(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=a&134217727;return S!==0?(a=S&~f,a!==0?u=ye(a):(b&=S,b!==0?u=ye(b):n||(n=S&~e,n!==0&&(u=ye(n))))):(S=a&~f,S!==0?u=ye(S):b!==0?u=ye(b):n||(n=a&~e,n!==0&&(u=ye(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 ft(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bl(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 Qn(){var e=J;return J<<=1,(J&62914560)===0&&(J=4194304),e}function tl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ql(e,t,n,a,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,$=e.hiddenUpdates;for(n=b&~n;0<n;){var ne=31-We(n),ce=1<<ne;S[ne]=0,R[ne]=-1;var F=$[ne];if(F!==null)for($[ne]=null,ne=0;ne<F.length;ne++){var P=F[ne];P!==null&&(P.lane&=-536870913)}n&=~ce}a!==0&&In(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function In(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-We(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Kl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-We(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function Ct(e,t){var n=t&-t;return n=(n&42)!==0?1:ll(n),(n&(e.suspendedLanes|t))!==0?0:n}function ll(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 mn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function qt(){var e=re.p;return e!==0?e:(e=window.event,e===void 0?32:ob(e.type))}function xl(e,t){var n=re.p;try{return re.p=e,t()}finally{re.p=n}}var Gt=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Gt,Ee="__reactProps$"+Gt,un="__reactContainer$"+Gt,gt="__reactEvents$"+Gt,rs="__reactListeners$"+Gt,An="__reactHandles$"+Gt,yl="__reactResources$"+Gt,Kn="__reactMarker$"+Gt;function sl(e){delete e[Lt],delete e[Ee],delete e[gt],delete e[rs],delete e[An]}function qn(e){var t=e[Lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[un]||n[Lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qg(e);e!==null;){if(n=e[Lt])return n;e=Qg(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[Lt]||e[un]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function gn(e){var t=e[yl];return t||(t=e[yl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Rt(e){e[Kn]=!0}var ul=new Set,_a={};function fl(e,t){Zl(e,t),Zl(e+"Capture",t)}function Zl(e,t){for(_a[e]=t,e=0;e<t.length;e++)ul.add(t[e])}var va=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]*$"),$s={},_l={};function Qs(e){return nn.call(_l,e)?!0:nn.call($s,e)?!1:va.test(e)?_l[e]=!0:($s[e]=!0,!1)}function al(e,t,n){if(Qs(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 Zn(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 bn(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 et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ul(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 Sl(e){if(!e._valueTracker){var t=vl(e)?"checked":"value";e._valueTracker=Ul(e,t,""+e[t])}}function wn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=vl(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function jl(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 wl=/[\n"\\]/g;function zt(e){return e.replace(wl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yt(e,t,n,a,u,f,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+et(t)):e.value!==""+et(t)&&(e.value=""+et(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Ft(e,b,et(t)):n!=null?Ft(e,b,et(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+et(S):e.removeAttribute("name")}function dl(e,t,n,a,u,f,b,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Sl(e);return}n=n!=null?""+et(n):"",t=t!=null?""+et(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=S?e.checked:!!a,e.defaultChecked=!!a,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Sl(e)}function Ft(e,t,n){t==="number"&&jl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function kn(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=""+et(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 de(e,t,n){if(t!=null&&(t=""+et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+et(n):""}function k(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(Ce(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=et(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Sl(e)}function q(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var oe=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 Ae(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||oe.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ze(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&&Ae(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&Ae(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 kt=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 le(e){return w.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function je(){}var Ze=null;function St(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ws=null,cs=null;function ar(e){var t=bt(e);if(t&&(e=t.stateNode)){var n=e[Ee]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yt(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="'+zt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[Ee]||null;if(!u)throw Error(c(90));Yt(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&&wn(a)}break e;case"textarea":de(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&kn(e,!!n.multiple,t,!1)}}}var ir=!1;function di(e,t,n){if(ir)return e(t,n);ir=!0;try{var a=e(t);return a}finally{if(ir=!1,(ws!==null||cs!==null)&&(ju(),ws&&(t=ws,e=cs,cs=ws=null,ar(t),e)))for(t=0;t<e.length;t++)ar(e[t])}}function Fl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Ee]||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"),Sa=!1;if(Hl)try{var os={};Object.defineProperty(os,"passive",{get:function(){Sa=!0}}),window.addEventListener("test",os,os),window.removeEventListener("test",os,os)}catch{Sa=!1}var ks=null,ja=null,rr=null;function hi(){if(rr)return rr;var e,t=ja,n=t.length,a,u="value"in ks?ks.value:ks.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 rr=u.slice(e,1<a?1-a:void 0)}function Ks(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 wa(){return!0}function ka(){return!1}function xn(e){function t(n,a,u,f,b){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?wa:ka,this.isPropagationStopped=ka,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=wa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=wa)},persist:function(){},isPersistent:wa}),t}var Jl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Na=xn(Jl),pi=j({},Jl,{view:0,detail:0}),Zs=xn(pi),mi,cr,Ns,gi=j({},pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fr,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!==Ns&&(Ns&&e.type==="mousemove"?(mi=e.screenX-Ns.screenX,cr=e.screenY-Ns.screenY):cr=mi=0,Ns=e),mi)},movementY:function(e){return"movementY"in e?e.movementY:cr}}),bi=xn(gi),us=j({},gi,{dataTransfer:0}),or=xn(us),xi=j({},pi,{relatedTarget:0}),fs=xn(xi),yi=j({},Jl,{animationName:0,elapsedTime:0,pseudoElement:0}),sn=xn(yi),uc=j({},Jl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ef=xn(uc),Af=j({},Jl,{data:0}),fc=xn(Af),ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fn={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"},_i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=_i[e])?!!t[e]:!1}function fr(){return Rn}var wo=j({},pi,{key:function(e){if(e.key){var t=ur[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ks(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Fn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fr,charCode:function(e){return e.type==="keypress"?Ks(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ks(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ds=xn(wo),ko=j({},gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vi=xn(ko),dr=j({},pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fr}),Si=xn(dr),Fs=j({},Jl,{propertyName:0,elapsedTime:0,pseudoElement:0}),No=xn(Fs),ji=j({},gi,{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}),hr=xn(ji),wi=j({},Jl,{newState:0,oldState:0}),ki=xn(wi),To=[9,13,27,32],Js=Hl&&"CompositionEvent"in window,Ni=null;Hl&&"documentMode"in document&&(Ni=document.documentMode);var te=Hl&&"TextEvent"in window&&!Ni,Ws=Hl&&(!Js||Ni&&8<Ni&&11>=Ni),pr=" ",Eo=!1;function Ao(e,t){switch(e){case"keyup":return To.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Co(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var me=!1;function Ta(e,t){switch(e){case"compositionend":return Co(t);case"keypress":return t.which!==32?null:(Eo=!0,pr);case"textInput":return e=t.data,e===pr&&Eo?null:e;default:return null}}function Cf(e,t){if(me)return e==="compositionend"||!Js&&Ao(e,t)?(e=hi(),rr=ja=ks=null,me=!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 Ws&&t.locale!=="ko"?null:t.data;default:return null}}var Rf={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 Ro(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Rf[e.type]:t==="textarea"}function Mo(e,t,n,a){ws?cs?cs.push(a):cs=[a]:ws=a,t=Cu(t,"onChange"),0<t.length&&(n=new Na("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Ti=null,hs=null;function Mf(e){Dg(e,0)}function mr(e){var t=Cn(e);if(wn(t))return e}function Do(e,t){if(e==="change")return t}var Oo=!1;if(Hl){var dc;if(Hl){var hc="oninput"in document;if(!hc){var Lo=document.createElement("div");Lo.setAttribute("oninput","return;"),hc=typeof Lo.oninput=="function"}dc=hc}else dc=!1;Oo=dc&&(!document.documentMode||9<document.documentMode)}function zo(){Ti&&(Ti.detachEvent("onpropertychange",pc),hs=Ti=null)}function pc(e){if(e.propertyName==="value"&&mr(hs)){var t=[];Mo(t,hs,e,St(e)),di(Mf,t)}}function Df(e,t,n){e==="focusin"?(zo(),Ti=t,hs=n,Ti.attachEvent("onpropertychange",pc)):e==="focusout"&&zo()}function Of(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mr(hs)}function mc(e,t){if(e==="click")return mr(t)}function Lf(e,t){if(e==="input"||e==="change")return mr(t)}function zf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gn=typeof Object.is=="function"?Object.is:zf;function Ei(e,t){if(Gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!nn.call(t,u)||!Gn(e[u],t[u]))return!1}return!0}function gc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bc(e,t){var n=gc(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=gc(n)}}function Uo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jl(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=jl(e.document)}return t}function Ai(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Uf=Hl&&"documentMode"in document&&11>=document.documentMode,Ea=null,yc=null,Ci=null,Ps=!1;function _c(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ps||Ea==null||Ea!==jl(a)||(a=Ea,"selectionStart"in a&&Ai(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ci&&Ei(Ci,a)||(Ci=a,a=Cu(yc,"onSelect"),0<a.length&&(t=new Na("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ea)))}function ea(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ta={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},vc={},Ho={};Hl&&(Ho=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function na(e){if(vc[e])return vc[e];if(!ta[e])return e;var t=ta[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ho)return vc[e]=t[n];return e}var Bo=na("animationend"),Io=na("animationiteration"),qo=na("animationstart"),Hf=na("transitionrun"),Bf=na("transitionstart"),If=na("transitioncancel"),Go=na("transitionend"),Yo=new Map,Sc="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(" ");Sc.push("scrollEnd");function kl(e,t){Yo.set(e,t),fl(t,[e])}var gr=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)},Nl=[],Aa=0,jc=0;function Ca(){for(var e=Aa,t=jc=Aa=0;t<e;){var n=Nl[t];Nl[t++]=null;var a=Nl[t];Nl[t++]=null;var u=Nl[t];Nl[t++]=null;var f=Nl[t];if(Nl[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&&Xo(n,u,f)}}function Ra(e,t,n,a){Nl[Aa++]=e,Nl[Aa++]=t,Nl[Aa++]=n,Nl[Aa++]=a,jc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ma(e,t,n,a){return Ra(e,t,n,a),br(e)}function la(e,t){return Ra(e,null,null,t),br(e)}function Xo(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-We(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function br(e){if(50<Qc)throw Qc=0,Hd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Da={};function qf(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 hl(e,t,n,a){return new qf(e,t,n,a)}function wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ps(e,t){var n=e.alternate;return n===null?(n=hl(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 Vo(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 xr(e,t,n,a,u,f){var b=0;if(a=e,typeof e=="function")wc(e)&&(b=1);else if(typeof e=="string")b=K_(e,n,he.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=hl(31,n,t,u),e.elementType=ae,e.lanes=f,e;case M:return sa(n.children,u,f,t);case z:b=8,u|=24;break;case G:return e=hl(12,n,t,u|2),e.elementType=G,e.lanes=f,e;case K:return e=hl(13,n,t,u),e.elementType=K,e.lanes=f,e;case H:return e=hl(19,n,t,u),e.elementType=H,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:b=10;break e;case Q:b=9;break e;case D:b=11;break e;case C:b=14;break e;case Z:b=16,a=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=hl(b,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function sa(e,t,n,a){return e=hl(7,e,a,t),e.lanes=n,e}function kc(e,t,n){return e=hl(6,e,null,t),e.lanes=n,e}function $o(e){var t=hl(18,null,null,0);return t.stateNode=e,t}function Nc(e,t,n){return t=hl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Qo=new WeakMap;function Tl(e,t){if(typeof e=="object"&&e!==null){var n=Qo.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Sn(t)},Qo.set(e,t),t)}return{value:e,source:t,stack:Sn(t)}}var Oa=[],aa=0,Ri=null,Ts=0,an=[],rn=0,yn=null,Bl=1,El="";function Wl(e,t){Oa[aa++]=Ts,Oa[aa++]=Ri,Ri=e,Ts=t}function Mi(e,t,n){an[rn++]=Bl,an[rn++]=El,an[rn++]=yn,yn=e;var a=Bl;e=El;var u=32-We(a)-1;a&=~(1<<u),n+=1;var f=32-We(t)+u;if(30<f){var b=u-u%5;f=(a&(1<<b)-1).toString(32),a>>=b,u-=b,Bl=1<<32-We(t)+u|n<<u|a,El=f+e}else Bl=1<<f|n<<u|a,El=e}function yr(e){e.return!==null&&(Wl(e,1),Mi(e,1,0))}function Tc(e){for(;e===Ri;)Ri=Oa[--aa],Oa[aa]=null,Ts=Oa[--aa],Oa[aa]=null;for(;e===yn;)yn=an[--rn],an[rn]=null,El=an[--rn],an[rn]=null,Bl=an[--rn],an[rn]=null}function La(e,t){an[rn++]=Bl,an[rn++]=El,an[rn++]=yn,Bl=t.id,El=t.overflow,yn=e}var Mn=null,Xt=null,tt=!1,Es=null,Yn=!1,As=Error(c(519));function ms(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Di(Tl(t,e)),As}function Ec(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Lt]=e,t[Ee]=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<Zc.length;n++)at(Zc[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),dl(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||Ug(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=je),t=!0):t=!1,t||ms(e,!0)}function Ko(e){for(Mn=e.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Yn=!1;return;case 27:case 3:Yn=!0;return;default:Mn=Mn.return}}function za(e){if(e!==Mn)return!1;if(!tt)return Ko(e),tt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Pd(e.type,e.memoizedProps)),n=!n),n&&Xt&&ms(e),Ko(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Xt=$g(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Xt=$g(e)}else t===27?(t=Xt,Fa(e.type)?(e=sh,sh=null,Xt=e):Xt=t):Xt=Mn?ns(e.stateNode.nextSibling):null;return!0}function Cs(){Xt=Mn=null,tt=!1}function _r(){var e=Es;return e!==null&&(Ml===null?Ml=e:Ml.push.apply(Ml,e),Es=null),e}function Di(e){Es===null?Es=[e]:Es.push(e)}var Ac=N(null),gs=null,Pl=null;function Rs(e,t,n){ie(Ac,t._currentValue),t._currentValue=n}function es(e){e._currentValue=Ac.current,X(Ac)}function g(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 I(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var R=0;R<t.length;R++)if(S.context===t[R]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),g(f.return,n,e),a||(b=null);break e}f=S.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(c(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),g(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 fe(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(c(387));if(b=b.memoizedProps,b!==null){var S=u.type;Gn(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}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(eo):e=[eo])}u=u.return}e!==null&&I(t,e,n,a),t.flags|=262144}function Be(e){for(e=e.firstContext;e!==null;){if(!Gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xt(e){gs=e,Pl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dt(e){return Ua(gs,e)}function il(e,t){return gs===null&&xt(e),Ua(e,t)}function Ua(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pl===null){if(e===null)throw Error(c(308));Pl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pl=Pl.next=t;return n}var Zo=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()})}},Fo=s.unstable_scheduleCallback,Ne=s.unstable_NormalPriority,_e={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ye(){return{controller:new Zo,data:new Map,refCount:0}}function ht(e){e.refCount--,e.refCount===0&&Fo(Ne,function(){e.controller.abort()})}var Nt=null,Il=0,Ms=0,vr=null;function Qy(e,t){if(Nt===null){var n=Nt=[];Il=0,Ms=Xd(),vr={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Il++,t.then(jp,jp),t}function jp(){if(--Il===0&&Nt!==null){vr!==null&&(vr.status="fulfilled");var e=Nt;Nt=null,Ms=0,vr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ky(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 wp=E.S;E.S=function(e,t){rg=lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qy(e,t),wp!==null&&wp(e,t)};var Oi=N(null);function Gf(){var e=Oi.current;return e!==null?e:Vt.pooledCache}function Jo(e,t){t===null?ie(Oi,Oi.current):ie(Oi,t.pool)}function kp(){var e=Gf();return e===null?null:{parent:_e._currentValue,pool:e}}var Sr=Error(c(460)),Yf=Error(c(474)),Wo=Error(c(542)),Po={then:function(){}};function Np(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(je,je),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ap(e),e;default:if(typeof t.status=="string")t.then(je,je);else{if(e=Vt,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,Ap(e),e}throw zi=t,Sr}}function Li(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(zi=n,Sr):n}}var zi=null;function Ep(){if(zi===null)throw Error(c(459));var e=zi;return zi=null,e}function Ap(e){if(e===Sr||e===Wo)throw Error(c(483))}var jr=null,Cc=0;function eu(e){var t=Cc;return Cc+=1,jr===null&&(jr=[]),Tp(jr,e,t)}function Rc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function tu(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 Cp(e){function t(B,L){if(e){var V=B.deletions;V===null?(B.deletions=[L],B.flags|=16):V.push(L)}}function n(B,L){if(!e)return null;for(;L!==null;)t(B,L),L=L.sibling;return null}function a(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function u(B,L){return B=ps(B,L),B.index=0,B.sibling=null,B}function f(B,L,V){return B.index=V,e?(V=B.alternate,V!==null?(V=V.index,V<L?(B.flags|=67108866,L):V):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function S(B,L,V,se){return L===null||L.tag!==6?(L=kc(V,B.mode,se),L.return=B,L):(L=u(L,V),L.return=B,L)}function R(B,L,V,se){var Ue=V.type;return Ue===M?ne(B,L,V.props.children,se,V.key):L!==null&&(L.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Z&&Li(Ue)===L.type)?(L=u(L,V.props),Rc(L,V),L.return=B,L):(L=xr(V.type,V.key,V.props,null,B.mode,se),Rc(L,V),L.return=B,L)}function $(B,L,V,se){return L===null||L.tag!==4||L.stateNode.containerInfo!==V.containerInfo||L.stateNode.implementation!==V.implementation?(L=Nc(V,B.mode,se),L.return=B,L):(L=u(L,V.children||[]),L.return=B,L)}function ne(B,L,V,se,Ue){return L===null||L.tag!==7?(L=sa(V,B.mode,se,Ue),L.return=B,L):(L=u(L,V),L.return=B,L)}function ce(B,L,V){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=kc(""+L,B.mode,V),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case A:return V=xr(L.type,L.key,L.props,null,B.mode,V),Rc(V,L),V.return=B,V;case T:return L=Nc(L,B.mode,V),L.return=B,L;case Z:return L=Li(L),ce(B,L,V)}if(Ce(L)||ue(L))return L=sa(L,B.mode,V,null),L.return=B,L;if(typeof L.then=="function")return ce(B,eu(L),V);if(L.$$typeof===Y)return ce(B,il(B,L),V);tu(B,L)}return null}function F(B,L,V,se){var Ue=L!==null?L.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ue!==null?null:S(B,L,""+V,se);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case A:return V.key===Ue?R(B,L,V,se):null;case T:return V.key===Ue?$(B,L,V,se):null;case Z:return V=Li(V),F(B,L,V,se)}if(Ce(V)||ue(V))return Ue!==null?null:ne(B,L,V,se,null);if(typeof V.then=="function")return F(B,L,eu(V),se);if(V.$$typeof===Y)return F(B,L,il(B,V),se);tu(B,V)}return null}function P(B,L,V,se,Ue){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return B=B.get(V)||null,S(L,B,""+se,Ue);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return B=B.get(se.key===null?V:se.key)||null,R(L,B,se,Ue);case T:return B=B.get(se.key===null?V:se.key)||null,$(L,B,se,Ue);case Z:return se=Li(se),P(B,L,V,se,Ue)}if(Ce(se)||ue(se))return B=B.get(V)||null,ne(L,B,se,Ue,null);if(typeof se.then=="function")return P(B,L,V,eu(se),Ue);if(se.$$typeof===Y)return P(B,L,V,il(L,se),Ue);tu(L,se)}return null}function Me(B,L,V,se){for(var Ue=null,yt=null,Oe=L,Je=L=0,ot=null;Oe!==null&&Je<V.length;Je++){Oe.index>Je?(ot=Oe,Oe=null):ot=Oe.sibling;var _t=F(B,Oe,V[Je],se);if(_t===null){Oe===null&&(Oe=ot);break}e&&Oe&&_t.alternate===null&&t(B,Oe),L=f(_t,L,Je),yt===null?Ue=_t:yt.sibling=_t,yt=_t,Oe=ot}if(Je===V.length)return n(B,Oe),tt&&Wl(B,Je),Ue;if(Oe===null){for(;Je<V.length;Je++)Oe=ce(B,V[Je],se),Oe!==null&&(L=f(Oe,L,Je),yt===null?Ue=Oe:yt.sibling=Oe,yt=Oe);return tt&&Wl(B,Je),Ue}for(Oe=a(Oe);Je<V.length;Je++)ot=P(Oe,B,Je,V[Je],se),ot!==null&&(e&&ot.alternate!==null&&Oe.delete(ot.key===null?Je:ot.key),L=f(ot,L,Je),yt===null?Ue=ot:yt.sibling=ot,yt=ot);return e&&Oe.forEach(function(ti){return t(B,ti)}),tt&&Wl(B,Je),Ue}function Ie(B,L,V,se){if(V==null)throw Error(c(151));for(var Ue=null,yt=null,Oe=L,Je=L=0,ot=null,_t=V.next();Oe!==null&&!_t.done;Je++,_t=V.next()){Oe.index>Je?(ot=Oe,Oe=null):ot=Oe.sibling;var ti=F(B,Oe,_t.value,se);if(ti===null){Oe===null&&(Oe=ot);break}e&&Oe&&ti.alternate===null&&t(B,Oe),L=f(ti,L,Je),yt===null?Ue=ti:yt.sibling=ti,yt=ti,Oe=ot}if(_t.done)return n(B,Oe),tt&&Wl(B,Je),Ue;if(Oe===null){for(;!_t.done;Je++,_t=V.next())_t=ce(B,_t.value,se),_t!==null&&(L=f(_t,L,Je),yt===null?Ue=_t:yt.sibling=_t,yt=_t);return tt&&Wl(B,Je),Ue}for(Oe=a(Oe);!_t.done;Je++,_t=V.next())_t=P(Oe,B,Je,_t.value,se),_t!==null&&(e&&_t.alternate!==null&&Oe.delete(_t.key===null?Je:_t.key),L=f(_t,L,Je),yt===null?Ue=_t:yt.sibling=_t,yt=_t);return e&&Oe.forEach(function(a0){return t(B,a0)}),tt&&Wl(B,Je),Ue}function Bt(B,L,V,se){if(typeof V=="object"&&V!==null&&V.type===M&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case A:e:{for(var Ue=V.key;L!==null;){if(L.key===Ue){if(Ue=V.type,Ue===M){if(L.tag===7){n(B,L.sibling),se=u(L,V.props.children),se.return=B,B=se;break e}}else if(L.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Z&&Li(Ue)===L.type){n(B,L.sibling),se=u(L,V.props),Rc(se,V),se.return=B,B=se;break e}n(B,L);break}else t(B,L);L=L.sibling}V.type===M?(se=sa(V.props.children,B.mode,se,V.key),se.return=B,B=se):(se=xr(V.type,V.key,V.props,null,B.mode,se),Rc(se,V),se.return=B,B=se)}return b(B);case T:e:{for(Ue=V.key;L!==null;){if(L.key===Ue)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){n(B,L.sibling),se=u(L,V.children||[]),se.return=B,B=se;break e}else{n(B,L);break}else t(B,L);L=L.sibling}se=Nc(V,B.mode,se),se.return=B,B=se}return b(B);case Z:return V=Li(V),Bt(B,L,V,se)}if(Ce(V))return Me(B,L,V,se);if(ue(V)){if(Ue=ue(V),typeof Ue!="function")throw Error(c(150));return V=Ue.call(V),Ie(B,L,V,se)}if(typeof V.then=="function")return Bt(B,L,eu(V),se);if(V.$$typeof===Y)return Bt(B,L,il(B,V),se);tu(B,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,L!==null&&L.tag===6?(n(B,L.sibling),se=u(L,V),se.return=B,B=se):(n(B,L),se=kc(V,B.mode,se),se.return=B,B=se),b(B)):n(B,L)}return function(B,L,V,se){try{Cc=0;var Ue=Bt(B,L,V,se);return jr=null,Ue}catch(Oe){if(Oe===Sr||Oe===Wo)throw Oe;var yt=hl(29,Oe,null,B.mode);return yt.lanes=se,yt.return=B,yt}finally{}}}var Ui=Cp(!0),Rp=Cp(!1),Ha=!1;function Xf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vf(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(jt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=br(e),Xo(e,null,n),t}return Ra(e,a,t,n),br(e)}function Mc(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,Kl(e,n)}}function $f(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 Qf=!1;function Dc(){if(Qf){var e=vr;if(e!==null)throw e}}function Oc(e,t,n,a){Qf=!1;var u=e.updateQueue;Ha=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,$=R.next;R.next=null,b===null?f=$:b.next=$,b=R;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,S=ne.lastBaseUpdate,S!==b&&(S===null?ne.firstBaseUpdate=$:S.next=$,ne.lastBaseUpdate=R))}if(f!==null){var ce=u.baseState;b=0,ne=$=R=null,S=f;do{var F=S.lane&-536870913,P=F!==S.lane;if(P?(ct&F)===F:(a&F)===F){F!==0&&F===Ms&&(Qf=!0),ne!==null&&(ne=ne.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Me=e,Ie=S;F=t;var Bt=n;switch(Ie.tag){case 1:if(Me=Ie.payload,typeof Me=="function"){ce=Me.call(Bt,ce,F);break e}ce=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ie.payload,F=typeof Me=="function"?Me.call(Bt,ce,F):Me,F==null)break e;ce=j({},ce,F);break e;case 2:Ha=!0}}F=S.callback,F!==null&&(e.flags|=64,P&&(e.flags|=8192),P=u.callbacks,P===null?u.callbacks=[F]:P.push(F))}else P={lane:F,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ne===null?($=ne=P,R=ce):ne=ne.next=P,b|=F;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;P=S,S=P.next,P.next=null,u.lastBaseUpdate=P,u.shared.pending=null}}while(!0);ne===null&&(R=ce),u.baseState=R,u.firstBaseUpdate=$,u.lastBaseUpdate=ne,f===null&&(u.shared.lanes=0),Va|=b,e.lanes=b,e.memoizedState=ce}}function Mp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Dp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Mp(n[e],t)}var wr=N(null),nu=N(0);function Op(e,t){e=pa,ie(nu,e),ie(wr,t),pa=e|t.baseLanes}function Kf(){ie(nu,pa),ie(wr,wr.current)}function Zf(){pa=nu.current,X(wr),X(nu)}var ql=N(null),ts=null;function qa(e){var t=e.alternate;ie(Nn,Nn.current&1),ie(ql,e),ts===null&&(t===null||wr.current!==null||t.memoizedState!==null)&&(ts=e)}function Ff(e){ie(Nn,Nn.current),ie(ql,e),ts===null&&(ts=e)}function Lp(e){e.tag===22?(ie(Nn,Nn.current),ie(ql,e),ts===null&&(ts=e)):Ga()}function Ga(){ie(Nn,Nn.current),ie(ql,ql.current)}function Gl(e){X(ql),ts===e&&(ts=null),X(Nn)}var Nn=N(0);function lu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nh(n)||lh(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 ia=0,Fe=null,Ut=null,Dn=null,su=!1,kr=!1,Hi=!1,au=0,Lc=0,Nr=null,Zy=0;function _n(){throw Error(c(321))}function Jf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gn(e[n],t[n]))return!1;return!0}function Wf(e,t,n,a,u,f){return ia=f,Fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?xm:hd,Hi=!1,f=n(a,u),Hi=!1,kr&&(f=Up(t,n,a,u)),zp(e),f}function zp(e){E.H=Hc;var t=Ut!==null&&Ut.next!==null;if(ia=0,Dn=Ut=Fe=null,su=!1,Lc=0,Nr=null,t)throw Error(c(300));e===null||On||(e=e.dependencies,e!==null&&Be(e)&&(On=!0))}function Up(e,t,n,a){Fe=e;var u=0;do{if(kr&&(Nr=null),Lc=0,kr=!1,25<=u)throw Error(c(301));if(u+=1,Dn=Ut=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}E.H=ym,f=t(n,a)}while(kr);return f}function Fy(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?zc(t):t,e=e.useState()[0],(Ut!==null?Ut.memoizedState:null)!==e&&(Fe.flags|=1024),t}function Pf(){var e=au!==0;return au=0,e}function ed(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function td(e){if(su){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}su=!1}ia=0,Dn=Ut=Fe=null,kr=!1,Lc=au=0,Nr=null}function pl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?Fe.memoizedState=Dn=e:Dn=Dn.next=e,Dn}function Tn(){if(Ut===null){var e=Fe.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Dn===null?Fe.memoizedState:Dn.next;if(t!==null)Dn=t,Ut=e;else{if(e===null)throw Fe.alternate===null?Error(c(467)):Error(c(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Dn===null?Fe.memoizedState=Dn=e:Dn=Dn.next=e}return Dn}function iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zc(e){var t=Lc;return Lc+=1,Nr===null&&(Nr=[]),e=Tp(Nr,e,t),t=Fe,(Dn===null?t.memoizedState:Dn.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?xm:hd),e}function ru(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zc(e);if(e.$$typeof===Y)return dt(e)}throw Error(c(438,String(e)))}function nd(e){var t=null,n=Fe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Fe.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=iu(),Fe.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]=be;return t.index++,n}function ra(e,t){return typeof t=="function"?t(e):t}function cu(e){var t=Tn();return ld(t,Ut,e)}function ld(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,R=null,$=t,ne=!1;do{var ce=$.lane&-536870913;if(ce!==$.lane?(ct&ce)===ce:(ia&ce)===ce){var F=$.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),ce===Ms&&(ne=!0);else if((ia&F)===F){$=$.next,F===Ms&&(ne=!0);continue}else ce={lane:0,revertLane:$.revertLane,gesture:null,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},R===null?(S=R=ce,b=f):R=R.next=ce,Fe.lanes|=F,Va|=F;ce=$.action,Hi&&n(f,ce),f=$.hasEagerState?$.eagerState:n(f,ce)}else F={lane:ce,revertLane:$.revertLane,gesture:$.gesture,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},R===null?(S=R=F,b=f):R=R.next=F,Fe.lanes|=ce,Va|=ce;$=$.next}while($!==null&&$!==t);if(R===null?b=f:R.next=S,!Gn(f,e.memoizedState)&&(On=!0,ne&&(n=vr,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=R,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function sd(e){var t=Tn(),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);Gn(f,t.memoizedState)||(On=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Hp(e,t,n){var a=Fe,u=Tn(),f=tt;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!Gn((Ut||u).memoizedState,n);if(b&&(u.memoizedState=n,On=!0),u=u.queue,rd(qp.bind(null,a,u,e),[e]),u.getSnapshot!==t||b||Dn!==null&&Dn.memoizedState.tag&1){if(a.flags|=2048,Tr(9,{destroy:void 0},Ip.bind(null,a,u,n,t),null),Vt===null)throw Error(c(349));f||(ia&127)!==0||Bp(a,t,n)}return n}function Bp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Fe.updateQueue,t===null?(t=iu(),Fe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ip(e,t,n,a){t.value=n,t.getSnapshot=a,Gp(t)&&Yp(e)}function qp(e,t,n){return n(function(){Gp(t)&&Yp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gn(e,n)}catch{return!0}}function Yp(e){var t=la(e,2);t!==null&&Dl(t,e,2)}function ad(e){var t=pl();if(typeof e=="function"){var n=e;if(e=n(),Hi){Ot(!0);try{n()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:e},t}function Xp(e,t,n,a){return e.baseState=n,ld(e,Ut,typeof a=="function"?a:ra)}function Jy(e,t,n,a,u){if(fu(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)}};E.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Vp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Vp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=E.T,b={};E.T=b;try{var S=n(u,a),R=E.S;R!==null&&R(b,S),$p(e,t,S)}catch($){id(e,t,$)}finally{f!==null&&b.types!==null&&(f.types=b.types),E.T=f}}else try{f=n(u,a),$p(e,t,f)}catch($){id(e,t,$)}}function $p(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Qp(e,t,a)},function(a){return id(e,t,a)}):Qp(e,t,n)}function Qp(e,t,n){t.status="fulfilled",t.value=n,Kp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vp(e,n)))}function id(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Kp(t),t=t.next;while(t!==a)}e.action=null}function Kp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zp(e,t){return t}function Fp(e,t){if(tt){var n=Vt.formState;if(n!==null){e:{var a=Fe;if(tt){if(Xt){t:{for(var u=Xt,f=Yn;u.nodeType!==8;){if(!f){u=null;break t}if(u=ns(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Xt=ns(u.nextSibling),a=u.data==="F!";break e}}ms(a)}a=!1}a&&(t=n[0])}}return n=pl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zp,lastRenderedState:t},n.queue=a,n=mm.bind(null,Fe,a),a.dispatch=n,a=ad(!1),f=dd.bind(null,Fe,!1,a.queue),a=pl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=Jy.bind(null,Fe,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function Jp(e){var t=Tn();return Wp(t,Ut,e)}function Wp(e,t,n){if(t=ld(e,t,Zp)[0],e=cu(ra)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=zc(t)}catch(b){throw b===Sr?Wo:b}else a=t;t=Tn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Fe.flags|=2048,Tr(9,{destroy:void 0},Wy.bind(null,u,n),null)),[a,f,e]}function Wy(e,t){e.action=t}function Pp(e){var t=Tn(),n=Ut;if(n!==null)return Wp(t,n,e);Tn(),t=t.memoizedState,n=Tn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Tr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Fe.updateQueue,t===null&&(t=iu(),Fe.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 em(){return Tn().memoizedState}function ou(e,t,n,a){var u=pl();Fe.flags|=e,u.memoizedState=Tr(1|t,{destroy:void 0},n,a===void 0?null:a)}function uu(e,t,n,a){var u=Tn();a=a===void 0?null:a;var f=u.memoizedState.inst;Ut!==null&&a!==null&&Jf(a,Ut.memoizedState.deps)?u.memoizedState=Tr(t,f,n,a):(Fe.flags|=e,u.memoizedState=Tr(1|t,f,n,a))}function tm(e,t){ou(8390656,8,e,t)}function rd(e,t){uu(2048,8,e,t)}function Py(e){Fe.flags|=4;var t=Fe.updateQueue;if(t===null)t=iu(),Fe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function nm(e){var t=Tn().memoizedState;return Py({ref:t,nextImpl:e}),function(){if((jt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function lm(e,t){return uu(4,2,e,t)}function sm(e,t){return uu(4,4,e,t)}function am(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 im(e,t,n){n=n!=null?n.concat([e]):null,uu(4,4,am.bind(null,t,e),n)}function cd(){}function rm(e,t){var n=Tn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Jf(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function cm(e,t){var n=Tn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Jf(t,a[1]))return a[0];if(a=e(),Hi){Ot(!0);try{e()}finally{Ot(!1)}}return n.memoizedState=[a,t],a}function od(e,t,n){return n===void 0||(ia&1073741824)!==0&&(ct&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=og(),Fe.lanes|=e,Va|=e,n)}function om(e,t,n,a){return Gn(n,t)?n:wr.current!==null?(e=od(e,n,a),Gn(e,t)||(On=!0),e):(ia&42)===0||(ia&1073741824)!==0&&(ct&261930)===0?(On=!0,e.memoizedState=n):(e=og(),Fe.lanes|=e,Va|=e,t)}function um(e,t,n,a,u){var f=re.p;re.p=f!==0&&8>f?f:8;var b=E.T,S={};E.T=S,dd(e,!1,t,n);try{var R=u(),$=E.S;if($!==null&&$(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ne=Ky(R,a);Uc(e,t,ne,Vl(e))}else Uc(e,t,a,Vl(e))}catch(ce){Uc(e,t,{then:function(){},status:"rejected",reason:ce},Vl())}finally{re.p=f,b!==null&&S.types!==null&&(b.types=S.types),E.T=b}}function e_(){}function ud(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=fm(e).queue;um(e,u,t,O,n===null?e_:function(){return dm(e),n(a)})}function fm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:O,baseState:O,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:O},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dm(e){var t=fm(e);t.next===null&&(t=e.alternate.memoizedState),Uc(e,t.next.queue,{},Vl())}function fd(){return dt(eo)}function hm(){return Tn().memoizedState}function pm(){return Tn().memoizedState}function t_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vl();e=Ba(n);var a=Ia(t,e,n);a!==null&&(Dl(a,t,n),Mc(a,t,n)),t={cache:Ye()},e.payload=t;return}t=t.return}}function n_(e,t,n){var a=Vl();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fu(e)?gm(t,n):(n=Ma(e,t,n,a),n!==null&&(Dl(n,e,a),bm(n,t,a)))}function mm(e,t,n){var a=Vl();Uc(e,t,n,a)}function Uc(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fu(e))gm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,S=f(b,n);if(u.hasEagerState=!0,u.eagerState=S,Gn(S,b))return Ra(e,t,u,0),Vt===null&&Ca(),!1}catch{}finally{}if(n=Ma(e,t,u,a),n!==null)return Dl(n,e,a),bm(n,t,a),!0}return!1}function dd(e,t,n,a){if(a={lane:2,revertLane:Xd(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},fu(e)){if(t)throw Error(c(479))}else t=Ma(e,n,a,2),t!==null&&Dl(t,e,2)}function fu(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function gm(e,t){kr=su=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Kl(e,n)}}var Hc={readContext:dt,use:ru,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useLayoutEffect:_n,useInsertionEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useSyncExternalStore:_n,useId:_n,useHostTransitionStatus:_n,useFormState:_n,useActionState:_n,useOptimistic:_n,useMemoCache:_n,useCacheRefresh:_n};Hc.useEffectEvent=_n;var xm={readContext:dt,use:ru,useCallback:function(e,t){return pl().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:tm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ou(4194308,4,am.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ou(4194308,4,e,t)},useInsertionEffect:function(e,t){ou(4,2,e,t)},useMemo:function(e,t){var n=pl();t=t===void 0?null:t;var a=e();if(Hi){Ot(!0);try{e()}finally{Ot(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=pl();if(n!==void 0){var u=n(t);if(Hi){Ot(!0);try{n(t)}finally{Ot(!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=n_.bind(null,Fe,e),[a.memoizedState,e]},useRef:function(e){var t=pl();return e={current:e},t.memoizedState=e},useState:function(e){e=ad(e);var t=e.queue,n=mm.bind(null,Fe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:cd,useDeferredValue:function(e,t){var n=pl();return od(n,e,t)},useTransition:function(){var e=ad(!1);return e=um.bind(null,Fe,e.queue,!0,!1),pl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Fe,u=pl();if(tt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Vt===null)throw Error(c(349));(ct&127)!==0||Bp(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,tm(qp.bind(null,a,f,e),[e]),a.flags|=2048,Tr(9,{destroy:void 0},Ip.bind(null,a,f,n,t),null),n},useId:function(){var e=pl(),t=Vt.identifierPrefix;if(tt){var n=El,a=Bl;n=(a&~(1<<32-We(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=au++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Zy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:fd,useFormState:Fp,useActionState:Fp,useOptimistic:function(e){var t=pl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dd.bind(null,Fe,!0,n),n.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return pl().memoizedState=t_.bind(null,Fe)},useEffectEvent:function(e){var t=pl(),n={impl:e};return t.memoizedState=n,function(){if((jt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},hd={readContext:dt,use:ru,useCallback:rm,useContext:dt,useEffect:rd,useImperativeHandle:im,useInsertionEffect:lm,useLayoutEffect:sm,useMemo:cm,useReducer:cu,useRef:em,useState:function(){return cu(ra)},useDebugValue:cd,useDeferredValue:function(e,t){var n=Tn();return om(n,Ut.memoizedState,e,t)},useTransition:function(){var e=cu(ra)[0],t=Tn().memoizedState;return[typeof e=="boolean"?e:zc(e),t]},useSyncExternalStore:Hp,useId:hm,useHostTransitionStatus:fd,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,t){var n=Tn();return Xp(n,Ut,e,t)},useMemoCache:nd,useCacheRefresh:pm};hd.useEffectEvent=nm;var ym={readContext:dt,use:ru,useCallback:rm,useContext:dt,useEffect:rd,useImperativeHandle:im,useInsertionEffect:lm,useLayoutEffect:sm,useMemo:cm,useReducer:sd,useRef:em,useState:function(){return sd(ra)},useDebugValue:cd,useDeferredValue:function(e,t){var n=Tn();return Ut===null?od(n,e,t):om(n,Ut.memoizedState,e,t)},useTransition:function(){var e=sd(ra)[0],t=Tn().memoizedState;return[typeof e=="boolean"?e:zc(e),t]},useSyncExternalStore:Hp,useId:hm,useHostTransitionStatus:fd,useFormState:Pp,useActionState:Pp,useOptimistic:function(e,t){var n=Tn();return Ut!==null?Xp(n,Ut,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nd,useCacheRefresh:pm};ym.useEffectEvent=nm;function pd(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var md={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Vl(),u=Ba(a);u.payload=t,n!=null&&(u.callback=n),t=Ia(e,u,a),t!==null&&(Dl(t,e,a),Mc(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Vl(),u=Ba(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Ia(e,u,a),t!==null&&(Dl(t,e,a),Mc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vl(),a=Ba(n);a.tag=2,t!=null&&(a.callback=t),t=Ia(e,a,n),t!==null&&(Dl(t,e,n),Mc(t,e,n))}};function _m(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?!Ei(n,a)||!Ei(u,f):!0}function vm(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&&md.enqueueReplaceState(t,t.state,null)}function Bi(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Sm(e){gr(e)}function jm(e){console.error(e)}function wm(e){gr(e)}function du(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function km(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 gd(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){du(e,t)},n}function Nm(e){return e=Ba(e),e.tag=3,e}function Tm(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(){km(t,n,a)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){km(t,n,a),typeof u!="function"&&($a===null?$a=new Set([this]):$a.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})})}function l_(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&fe(t,n,u,!0),n=ql.current,n!==null){switch(n.tag){case 31:case 13:return ts===null?wu():n.alternate===null&&vn===0&&(vn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===Po?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),qd(e,a,u)),!1;case 22:return n.flags|=65536,a===Po?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)),qd(e,a,u)),!1}throw Error(c(435,n.tag))}return qd(e,a,u),wu(),!1}if(tt)return t=ql.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==As&&(e=Error(c(422),{cause:a}),Di(Tl(e,n)))):(a!==As&&(t=Error(c(423),{cause:a}),Di(Tl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Tl(a,n),u=gd(e.stateNode,a,u),$f(e,u),vn!==4&&(vn=2)),!1;var f=Error(c(520),{cause:a});if(f=Tl(f,n),$c===null?$c=[f]:$c.push(f),vn!==4&&(vn=2),t===null)return!0;a=Tl(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=gd(n.stateNode,a,e),$f(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"&&($a===null||!$a.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Nm(u),Tm(u,e,n,a),$f(n,u),!1}n=n.return}while(n!==null);return!1}var bd=Error(c(461)),On=!1;function Jn(e,t,n,a){t.child=e===null?Rp(t,null,n,a):Ui(t,e.child,n,a)}function Em(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var b={};for(var S in a)S!=="ref"&&(b[S]=a[S])}else b=a;return xt(t),a=Wf(e,t,n,b,f,u),S=Pf(),e!==null&&!On?(ed(e,t,u),ca(e,t,u)):(tt&&S&&yr(t),t.flags|=1,Jn(e,t,a,u),t.child)}function Am(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!wc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Cm(e,t,f,a,u)):(e=xr(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!kd(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:Ei,n(b,a)&&e.ref===t.ref)return ca(e,t,u)}return t.flags|=1,e=ps(f,a),e.ref=t.ref,e.return=t,t.child=e}function Cm(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(Ei(f,a)&&e.ref===t.ref)if(On=!1,t.pendingProps=a=f,kd(e,u))(e.flags&131072)!==0&&(On=!0);else return t.lanes=e.lanes,ca(e,t,u)}return xd(e,t,n,a,u)}function Rm(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 Mm(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Jo(t,f!==null?f.cachePool:null),f!==null?Op(t,f):Kf(),Lp(t);else return a=t.lanes=536870912,Mm(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(Jo(t,f.cachePool),Op(t,f),Ga(),t.memoizedState=null):(e!==null&&Jo(t,null),Kf(),Ga());return Jn(e,t,u,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mm(e,t,n,a,u){var f=Gf();return f=f===null?null:{parent:_e._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Jo(t,null),Kf(),Lp(t),e!==null&&fe(e,t,a,!0),t.childLanes=u,null}function hu(e,t){return t=mu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Dm(e,t,n){return Ui(t,e.child,null,n),e=hu(t,t.pendingProps),e.flags|=2,Gl(t),t.memoizedState=null,e}function s_(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(tt){if(a.mode==="hidden")return e=hu(t,a),t.lanes=536870912,Bc(null,e);if(Ff(t),(e=Xt)?(e=Vg(e,Yn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yn!==null?{id:Bl,overflow:El}:null,retryLane:536870912,hydrationErrors:null},n=$o(e),n.return=t,t.child=n,Mn=t,Xt=null)):e=null,e===null)throw ms(t);return t.lanes=536870912,null}return hu(t,a)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(Ff(t),u)if(t.flags&256)t.flags&=-257,t=Dm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(On||fe(e,t,n,!1),u=(n&e.childLanes)!==0,On||u){if(a=Vt,a!==null&&(b=Ct(a,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,la(e,b),Dl(a,e,b),bd;wu(),t=Dm(e,t,n)}else e=f.treeContext,Xt=ns(b.nextSibling),Mn=t,tt=!0,Es=null,Yn=!1,e!==null&&La(t,e),t=hu(t,a),t.flags|=4096;return t}return e=ps(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pu(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 xd(e,t,n,a,u){return xt(t),n=Wf(e,t,n,a,void 0,u),a=Pf(),e!==null&&!On?(ed(e,t,u),ca(e,t,u)):(tt&&a&&yr(t),t.flags|=1,Jn(e,t,n,u),t.child)}function Om(e,t,n,a,u,f){return xt(t),t.updateQueue=null,n=Up(t,a,n,u),zp(e),a=Pf(),e!==null&&!On?(ed(e,t,f),ca(e,t,f)):(tt&&a&&yr(t),t.flags|=1,Jn(e,t,n,f),t.child)}function Lm(e,t,n,a,u){if(xt(t),t.stateNode===null){var f=Da,b=n.contextType;typeof b=="object"&&b!==null&&(f=dt(b)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=md,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},Xf(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?dt(b):Da,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(pd(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&&md.enqueueReplaceState(f,f.state,null),Oc(t,a,f,u),Dc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,R=Bi(n,S);f.props=R;var $=f.context,ne=n.contextType;b=Da,typeof ne=="object"&&ne!==null&&(b=dt(ne));var ce=n.getDerivedStateFromProps;ne=typeof ce=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ne||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||$!==b)&&vm(t,f,a,b),Ha=!1;var F=t.memoizedState;f.state=F,Oc(t,a,f,u),Dc(),$=t.memoizedState,S||F!==$||Ha?(typeof ce=="function"&&(pd(t,n,ce,a),$=t.memoizedState),(R=Ha||_m(t,n,R,a,F,$,b))?(ne||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=$),f.props=a,f.state=$,f.context=b,a=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,Vf(e,t),b=t.memoizedProps,ne=Bi(n,b),f.props=ne,ce=t.pendingProps,F=f.context,$=n.contextType,R=Da,typeof $=="object"&&$!==null&&(R=dt($)),S=n.getDerivedStateFromProps,($=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==ce||F!==R)&&vm(t,f,a,R),Ha=!1,F=t.memoizedState,f.state=F,Oc(t,a,f,u),Dc();var P=t.memoizedState;b!==ce||F!==P||Ha||e!==null&&e.dependencies!==null&&Be(e.dependencies)?(typeof S=="function"&&(pd(t,n,S,a),P=t.memoizedState),(ne=Ha||_m(t,n,ne,a,F,P,R)||e!==null&&e.dependencies!==null&&Be(e.dependencies))?($||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,P,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,P,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=P),f.props=a,f.state=P,f.context=R,a=ne):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,pu(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=Ui(t,e.child,null,u),t.child=Ui(t,null,n,u)):Jn(e,t,n,u),t.memoizedState=f.state,e=t.child):e=ca(e,t,u),e}function zm(e,t,n,a){return Cs(),t.flags|=256,Jn(e,t,n,a),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _d(e){return{baseLanes:e,cachePool:kp()}}function vd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Xl),e}function Um(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:(Nn.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(tt){if(u?qa(t):Ga(),(e=Xt)?(e=Vg(e,Yn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yn!==null?{id:Bl,overflow:El}:null,retryLane:536870912,hydrationErrors:null},n=$o(e),n.return=t,t.child=n,Mn=t,Xt=null)):e=null,e===null)throw ms(t);return lh(e)?t.lanes=32:t.lanes=536870912,null}var S=a.children;return a=a.fallback,u?(Ga(),u=t.mode,S=mu({mode:"hidden",children:S},u),a=sa(a,u,n,null),S.return=t,a.return=t,S.sibling=a,t.child=S,a=t.child,a.memoizedState=_d(n),a.childLanes=vd(e,b,n),t.memoizedState=yd,Bc(null,a)):(qa(t),Sd(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(f)t.flags&256?(qa(t),t.flags&=-257,t=jd(e,t,n)):t.memoizedState!==null?(Ga(),t.child=e.child,t.flags|=128,t=null):(Ga(),S=a.fallback,u=t.mode,a=mu({mode:"visible",children:a.children},u),S=sa(S,u,n,null),S.flags|=2,a.return=t,S.return=t,a.sibling=S,t.child=a,Ui(t,e.child,null,n),a=t.child,a.memoizedState=_d(n),a.childLanes=vd(e,b,n),t.memoizedState=yd,t=Bc(null,a));else if(qa(t),lh(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var $=b.dgst;b=$,a=Error(c(419)),a.stack="",a.digest=b,Di({value:a,source:null,stack:null}),t=jd(e,t,n)}else if(On||fe(e,t,n,!1),b=(n&e.childLanes)!==0,On||b){if(b=Vt,b!==null&&(a=Ct(b,n),a!==0&&a!==R.retryLane))throw R.retryLane=a,la(e,a),Dl(b,e,a),bd;nh(S)||wu(),t=jd(e,t,n)}else nh(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,Xt=ns(S.nextSibling),Mn=t,tt=!0,Es=null,Yn=!1,e!==null&&La(t,e),t=Sd(t,a.children),t.flags|=4096);return t}return u?(Ga(),S=a.fallback,u=t.mode,R=e.child,$=R.sibling,a=ps(R,{mode:"hidden",children:a.children}),a.subtreeFlags=R.subtreeFlags&65011712,$!==null?S=ps($,S):(S=sa(S,u,n,null),S.flags|=2),S.return=t,a.return=t,a.sibling=S,t.child=a,Bc(null,a),a=t.child,S=e.child.memoizedState,S===null?S=_d(n):(u=S.cachePool,u!==null?(R=_e._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=kp(),S={baseLanes:S.baseLanes|n,cachePool:u}),a.memoizedState=S,a.childLanes=vd(e,b,n),t.memoizedState=yd,Bc(e.child,a)):(qa(t),n=e.child,e=n.sibling,n=ps(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 Sd(e,t){return t=mu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function mu(e,t){return e=hl(22,e,null,t),e.lanes=0,e}function jd(e,t,n){return Ui(t,e.child,null,n),e=Sd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),g(e.return,t,n)}function wd(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 Bm(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var b=Nn.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,ie(Nn,b),Jn(e,t,a,n),a=tt?Ts:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hm(e,n,t);else if(e.tag===19)Hm(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&&lu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),wd(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&&lu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}wd(t,!0,n,null,f,a);break;case"together":wd(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Va|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(fe(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=ps(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ps(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Be(e)))}function a_(e,t,n){switch(t.tag){case 3:vt(t,t.stateNode.containerInfo),Rs(t,_e,e.memoizedState.cache),Cs();break;case 27:case 5:Ve(t);break;case 4:vt(t,t.stateNode.containerInfo);break;case 10:Rs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ff(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(qa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Um(e,t,n):(qa(t),e=ca(e,t,n),e!==null?e.sibling:null);qa(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(fe(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return Bm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ie(Nn,Nn.current),a)break;return null;case 22:return t.lanes=0,Rm(e,t,n,t.pendingProps);case 24:Rs(t,_e,e.memoizedState.cache)}return ca(e,t,n)}function Im(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)On=!0;else{if(!kd(e,n)&&(t.flags&128)===0)return On=!1,a_(e,t,n);On=(e.flags&131072)!==0}else On=!1,tt&&(t.flags&1048576)!==0&&Mi(t,Ts,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Li(t.elementType),t.type=e,typeof e=="function")wc(e)?(a=Bi(e,a),t.tag=1,t=Lm(null,t,e,a,n)):(t.tag=0,t=xd(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=Em(null,t,e,a,n);break e}else if(u===C){t.tag=14,t=Am(null,t,e,a,n);break e}}throw t=Re(e)||e,Error(c(306,t,""))}}return t;case 0:return xd(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=Bi(a,t.pendingProps),Lm(e,t,a,u,n);case 3:e:{if(vt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,Vf(e,t),Oc(t,a,null,n);var b=t.memoizedState;if(a=b.cache,Rs(t,_e,a),a!==f.cache&&I(t,[_e],n,!0),Dc(),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=zm(e,t,a,n);break e}else if(a!==u){u=Tl(Error(c(424)),t),Di(u),t=zm(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(Xt=ns(e.firstChild),Mn=t,tt=!0,Es=null,Yn=!0,n=Rp(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Cs(),a===u){t=ca(e,t,n);break e}Jn(e,t,a,n)}t=t.child}return t;case 26:return pu(e,t),e===null?(n=Jg(t.type,null,t.pendingProps,null))?t.memoizedState=n:tt||(n=t.type,e=t.pendingProps,a=Ru(ve.current).createElement(n),a[Lt]=t,a[Ee]=e,Wn(a,n,e),Rt(a),t.stateNode=a):t.memoizedState=Jg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ve(t),e===null&&tt&&(a=t.stateNode=Kg(t.type,t.pendingProps,ve.current),Mn=t,Yn=!0,u=Xt,Fa(t.type)?(sh=u,Xt=ns(a.firstChild)):Xt=u),Jn(e,t,t.pendingProps.children,n),pu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&tt&&((u=a=Xt)&&(a=L_(a,t.type,t.pendingProps,Yn),a!==null?(t.stateNode=a,Mn=t,Xt=ns(a.firstChild),Yn=!1,u=!0):u=!1),u||ms(t)),Ve(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,a=f.children,Pd(u,f)?a=null:b!==null&&Pd(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=Wf(e,t,Fy,null,null,n),eo._currentValue=u),pu(e,t),Jn(e,t,a,n),t.child;case 6:return e===null&&tt&&((e=n=Xt)&&(n=z_(n,t.pendingProps,Yn),n!==null?(t.stateNode=n,Mn=t,Xt=null,e=!0):e=!1),e||ms(t)),null;case 13:return Um(e,t,n);case 4:return vt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Ui(t,null,a,n):Jn(e,t,a,n),t.child;case 11:return Em(e,t,t.type,t.pendingProps,n);case 7:return Jn(e,t,t.pendingProps,n),t.child;case 8:return Jn(e,t,t.pendingProps.children,n),t.child;case 12:return Jn(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Rs(t,t.type,a.value),Jn(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,xt(t),u=dt(u),a=a(u),t.flags|=1,Jn(e,t,a,n),t.child;case 14:return Am(e,t,t.type,t.pendingProps,n);case 15:return Cm(e,t,t.type,t.pendingProps,n);case 19:return Bm(e,t,n);case 31:return s_(e,t,n);case 22:return Rm(e,t,n,t.pendingProps);case 24:return xt(t),a=dt(_e),e===null?(u=Gf(),u===null&&(u=Vt,f=Ye(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},Xf(t),Rs(t,_e,u)):((e.lanes&n)!==0&&(Vf(e,t),Oc(t,null,null,n),Dc()),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),Rs(t,_e,a)):(a=f.cache,Rs(t,_e,a),a!==u.cache&&I(t,[_e],n,!0))),Jn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function oa(e){e.flags|=4}function Nd(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(hg())e.flags|=8192;else throw zi=Po,Yf}else e.flags&=-16777217}function qm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nb(t))if(hg())e.flags|=8192;else throw zi=Po,Yf}function gu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qn():536870912,e.lanes|=t,Rr|=t)}function Ic(e,t){if(!tt)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 Jt(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 i_(e,t,n){var a=t.pendingProps;switch(Tc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jt(t),null;case 1:return Jt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),es(_e),Xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(za(t)?oa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,_r())),Jt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(oa(t),f!==null?(Jt(t),qm(t,f)):(Jt(t),Nd(t,u,null,a,n))):f?f!==e.memoizedState?(oa(t),Jt(t),qm(t,f)):(Jt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&oa(t),Jt(t),Nd(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&&oa(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Jt(t),null}e=he.current,za(t)?Ec(t):(e=Kg(u,a,n),t.stateNode=e,oa(t))}return Jt(t),null;case 5:if($e(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&oa(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Jt(t),null}if(f=he.current,za(t))Ec(t);else{var b=Ru(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[Lt]=t,f[Ee]=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(Wn(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&&oa(t)}}return Jt(t),Nd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&oa(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=ve.current,za(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Mn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Ug(e.nodeValue,n)),e||ms(t,!0)}else e=Ru(e).createTextNode(a),e[Lt]=t,t.stateNode=e}return Jt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=za(t),n!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Lt]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Jt(t),e=!1}else n=_r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Jt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=za(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[Lt]=t}else Cs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Jt(t),u=!1}else u=_r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gu(t,t.updateQueue),Jt(t),null);case 4:return Xe(),e===null&&Kd(t.stateNode.containerInfo),Jt(t),null;case 10:return es(t.type),Jt(t),null;case 19:if(X(Nn),a=t.memoizedState,a===null)return Jt(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)Ic(a,!1);else{if(vn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=lu(e),f!==null){for(t.flags|=128,Ic(a,!1),e=f.updateQueue,t.updateQueue=e,gu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Vo(n,e),n=n.sibling;return ie(Nn,Nn.current&1|2),tt&&Wl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&<()>vu&&(t.flags|=128,u=!0,Ic(a,!1),t.lanes=4194304)}else{if(!u)if(e=lu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,gu(t,e),Ic(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!tt)return Jt(t),null}else 2*lt()-a.renderingStartTime>vu&&n!==536870912&&(t.flags|=128,u=!0,Ic(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=lt(),e.sibling=null,n=Nn.current,ie(Nn,u?n&1|2:n&1),tt&&Wl(t,a.treeForkCount),e):(Jt(t),null);case 22:case 23:return Gl(t),Zf(),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&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),n=t.updateQueue,n!==null&&gu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&X(Oi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),es(_e),Jt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function r_(e,t){switch(Tc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return es(_e),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(Gl(t),t.alternate===null)throw Error(c(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(Nn),null;case 4:return Xe(),null;case 10:return es(t.type),null;case 22:case 23:return Gl(t),Zf(),e!==null&&X(Oi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return es(_e),null;case 25:return null;default:return null}}function Gm(e,t){switch(Tc(t),t.tag){case 3:es(_e),Xe();break;case 26:case 27:case 5:$e(t);break;case 4:Xe();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:X(Nn);break;case 10:es(t.type);break;case 22:case 23:Gl(t),Zf(),e!==null&&X(Oi);break;case 24:es(_e)}}function qc(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,b=n.inst;a=f(),b.destroy=a}n=n.next}while(n!==u)}}catch(S){Dt(t,t.return,S)}}function Ya(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var b=a.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var R=n,$=S;try{$()}catch(ne){Dt(u,R,ne)}}}a=a.next}while(a!==f)}}catch(ne){Dt(t,t.return,ne)}}function Ym(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Dp(t,n)}catch(a){Dt(e,e.return,a)}}}function Xm(e,t,n){n.props=Bi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Dt(e,t,a)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){Dt(e,t,u)}}function Ds(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){Dt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){Dt(e,t,u)}else n.current=null}function Vm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){Dt(e,e.return,u)}}function Td(e,t,n){try{var a=e.stateNode;A_(a,e.type,n,t),a[Ee]=t}catch(u){Dt(e,e.return,u)}}function $m(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fa(e.type)||e.tag===4}function Ed(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$m(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&&Fa(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 Ad(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=je));else if(a!==4&&(a===27&&Fa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ad(e,t,n),e=e.sibling;e!==null;)Ad(e,t,n),e=e.sibling}function bu(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&&Fa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(bu(e,t,n),e=e.sibling;e!==null;)bu(e,t,n),e=e.sibling}function Qm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Wn(t,a,n),t[Lt]=e,t[Ee]=n}catch(f){Dt(e,e.return,f)}}var ua=!1,Ln=!1,Cd=!1,Km=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function c_(e,t){if(e=e.containerInfo,Jd=Hu,e=xc(e),Ai(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,S=-1,R=-1,$=0,ne=0,ce=e,F=null;t:for(;;){for(var P;ce!==n||u!==0&&ce.nodeType!==3||(S=b+u),ce!==f||a!==0&&ce.nodeType!==3||(R=b+a),ce.nodeType===3&&(b+=ce.nodeValue.length),(P=ce.firstChild)!==null;)F=ce,ce=P;for(;;){if(ce===e)break t;if(F===n&&++$===u&&(S=b),F===f&&++ne===a&&(R=b),(P=ce.nextSibling)!==null)break;ce=F,F=ce.parentNode}ce=P}n=S===-1||R===-1?null:{start:S,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},Hu=!1,Xn=t;Xn!==null;)if(t=Xn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xn=e;else for(;Xn!==null;){switch(t=Xn,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 Me=Bi(n.type,u);e=a.getSnapshotBeforeUpdate(Me,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(Ie){Dt(n,n.return,Ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)th(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":th(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Xn=e;break}Xn=t.return}}function Zm(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:da(e,n),a&4&&qc(5,n);break;case 1:if(da(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){Dt(n,n.return,b)}else{var u=Bi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Dt(n,n.return,b)}}a&64&&Ym(n),a&512&&Gc(n,n.return);break;case 3:if(da(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{Dp(e,t)}catch(b){Dt(n,n.return,b)}}break;case 27:t===null&&a&4&&Qm(n);case 26:case 5:da(e,n),t===null&&a&4&&Vm(n),a&512&&Gc(n,n.return);break;case 12:da(e,n);break;case 31:da(e,n),a&4&&Wm(e,n);break;case 13:da(e,n),a&4&&Pm(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=b_.bind(null,n),U_(e,n))));break;case 22:if(a=n.memoizedState!==null||ua,!a){t=t!==null&&t.memoizedState!==null||Ln,u=ua;var f=Ln;ua=a,(Ln=t)&&!f?ha(e,n,(n.subtreeFlags&8772)!==0):da(e,n),ua=u,Ln=f}break;case 30:break;default:da(e,n)}}function Fm(e){var t=e.alternate;t!==null&&(e.alternate=null,Fm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&sl(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 cn=null,Al=!1;function fa(e,t,n){for(n=n.child;n!==null;)Jm(e,t,n),n=n.sibling}function Jm(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(Qt,n)}catch{}switch(n.tag){case 26:Ln||Ds(n,t),fa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ln||Ds(n,t);var a=cn,u=Al;Fa(n.type)&&(cn=n.stateNode,Al=!1),fa(e,t,n),Jc(n.stateNode),cn=a,Al=u;break;case 5:Ln||Ds(n,t);case 6:if(a=cn,u=Al,cn=null,fa(e,t,n),cn=a,Al=u,cn!==null)if(Al)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(n.stateNode)}catch(f){Dt(n,t,f)}else try{cn.removeChild(n.stateNode)}catch(f){Dt(n,t,f)}break;case 18:cn!==null&&(Al?(e=cn,Yg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Br(e)):Yg(cn,n.stateNode));break;case 4:a=cn,u=Al,cn=n.stateNode.containerInfo,Al=!0,fa(e,t,n),cn=a,Al=u;break;case 0:case 11:case 14:case 15:Ya(2,n,t),Ln||Ya(4,n,t),fa(e,t,n);break;case 1:Ln||(Ds(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Xm(n,t,a)),fa(e,t,n);break;case 21:fa(e,t,n);break;case 22:Ln=(a=Ln)||n.memoizedState!==null,fa(e,t,n),Ln=a;break;default:fa(e,t,n)}}function Wm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Br(e)}catch(n){Dt(t,t.return,n)}}}function Pm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Br(e)}catch(n){Dt(t,t.return,n)}}function o_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Km),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Km),t;default:throw Error(c(435,e.tag))}}function xu(e,t){var n=o_(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=x_.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,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(Fa(S.type)){cn=S.stateNode,Al=!1;break e}break;case 5:cn=S.stateNode,Al=!1;break e;case 3:case 4:cn=S.stateNode.containerInfo,Al=!0;break e}S=S.return}if(cn===null)throw Error(c(160));Jm(f,b,u),cn=null,Al=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)eg(t,e),t=t.sibling}var bs=null;function eg(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&&(Ya(3,e,e.return),qc(3,e),Ya(5,e,e.return));break;case 1:Cl(t,e),Rl(e),a&512&&(Ln||n===null||Ds(n,n.return)),a&64&&ua&&(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=bs;if(Cl(t,e),Rl(e),a&512&&(Ln||n===null||Ds(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[Kn]||f[Lt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),Wn(f,a,n),f[Lt]=e,Rt(f),a=f;break e;case"link":var b=eb("link","href",u).get(a+(n.href||""));if(b){for(var S=0;S<b.length;S++)if(f=b[S],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(S,1);break t}}f=u.createElement(a),Wn(f,a,n),u.head.appendChild(f);break;case"meta":if(b=eb("meta","content",u).get(a+(n.content||""))){for(S=0;S<b.length;S++)if(f=b[S],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(S,1);break t}}f=u.createElement(a),Wn(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Lt]=e,Rt(f),a=f}e.stateNode=a}else tb(u,e.type,e.stateNode);else e.stateNode=Pg(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?tb(u,e.type,e.stateNode):Pg(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Td(e,e.memoizedProps,n.memoizedProps)}break;case 27:Cl(t,e),Rl(e),a&512&&(Ln||n===null||Ds(n,n.return)),n!==null&&a&4&&Td(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cl(t,e),Rl(e),a&512&&(Ln||n===null||Ds(n,n.return)),e.flags&32){u=e.stateNode;try{q(u,"")}catch(Me){Dt(e,e.return,Me)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Td(e,u,n!==null?n.memoizedProps:u)),a&1024&&(Cd=!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(Me){Dt(e,e.return,Me)}}break;case 3:if(Ou=null,u=bs,bs=Mu(t.containerInfo),Cl(t,e),bs=u,Rl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Br(t.containerInfo)}catch(Me){Dt(e,e.return,Me)}Cd&&(Cd=!1,tg(e));break;case 4:a=bs,bs=Mu(e.stateNode.containerInfo),Cl(t,e),Rl(e),bs=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,xu(e,a)));break;case 13:Cl(t,e),Rl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(_u=lt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,xu(e,a)));break;case 22:u=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,$=ua,ne=Ln;if(ua=$||u,Ln=ne||R,Cl(t,e),Ln=ne,ua=$,Rl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||ua||Ln||Ii(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=R.stateNode;var ce=R.memoizedProps.style,F=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;S.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(Me){Dt(R,R.return,Me)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(Me){Dt(R,R.return,Me)}}}else if(t.tag===18){if(n===null){R=t;try{var P=R.stateNode;u?Xg(P,!0):Xg(R.stateNode,!1)}catch(Me){Dt(R,R.return,Me)}}}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,xu(e,n))));break;case 19:Cl(t,e),Rl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,xu(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($m(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Ed(e);bu(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(q(b,""),n.flags&=-33);var S=Ed(e);bu(e,S,b);break;case 3:case 4:var R=n.stateNode.containerInfo,$=Ed(e);Ad(e,$,R);break;default:throw Error(c(161))}}catch(ne){Dt(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;tg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function da(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zm(e,t.alternate,t),t=t.sibling}function Ii(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ya(4,t,t.return),Ii(t);break;case 1:Ds(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Xm(t,t.return,n),Ii(t);break;case 27:Jc(t.stateNode);case 26:case 5:Ds(t,t.return),Ii(t);break;case 22:t.memoizedState===null&&Ii(t);break;case 30:Ii(t);break;default:Ii(t)}e=e.sibling}}function ha(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:ha(u,f,n),qc(4,f);break;case 1:if(ha(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch($){Dt(a,a.return,$)}if(a=f,u=a.updateQueue,u!==null){var S=a.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Mp(R[u],S)}catch($){Dt(a,a.return,$)}}n&&b&64&&Ym(f),Gc(f,f.return);break;case 27:Qm(f);case 26:case 5:ha(u,f,n),n&&a===null&&b&4&&Vm(f),Gc(f,f.return);break;case 12:ha(u,f,n);break;case 31:ha(u,f,n),n&&b&4&&Wm(u,f);break;case 13:ha(u,f,n),n&&b&4&&Pm(u,f);break;case 22:f.memoizedState===null&&ha(u,f,n),Gc(f,f.return);break;case 30:break;default:ha(u,f,n)}t=t.sibling}}function Rd(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&&ht(n))}function Md(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ht(e))}function xs(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ng(e,t,n,a),t=t.sibling}function ng(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:xs(e,t,n,a),u&2048&&qc(9,t);break;case 1:xs(e,t,n,a);break;case 3:xs(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&&ht(e)));break;case 12:if(u&2048){xs(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Dt(t,t.return,R)}}else xs(e,t,n,a);break;case 31:xs(e,t,n,a);break;case 13:xs(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?xs(e,t,n,a):Yc(e,t):f._visibility&2?xs(e,t,n,a):(f._visibility|=2,Er(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Rd(b,t);break;case 24:xs(e,t,n,a),u&2048&&Md(t.alternate,t);break;default:xs(e,t,n,a)}}function Er(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=n,R=a,$=b.flags;switch(b.tag){case 0:case 11:case 15:Er(f,b,S,R,u),qc(8,b);break;case 23:break;case 22:var ne=b.stateNode;b.memoizedState!==null?ne._visibility&2?Er(f,b,S,R,u):Yc(f,b):(ne._visibility|=2,Er(f,b,S,R,u)),u&&$&2048&&Rd(b.alternate,b);break;case 24:Er(f,b,S,R,u),u&&$&2048&&Md(b.alternate,b);break;default:Er(f,b,S,R,u)}t=t.sibling}}function Yc(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:Yc(n,a),u&2048&&Rd(a.alternate,a);break;case 24:Yc(n,a),u&2048&&Md(a.alternate,a);break;default:Yc(n,a)}t=t.sibling}}var Xc=8192;function Ar(e,t,n){if(e.subtreeFlags&Xc)for(e=e.child;e!==null;)lg(e,t,n),e=e.sibling}function lg(e,t,n){switch(e.tag){case 26:Ar(e,t,n),e.flags&Xc&&e.memoizedState!==null&&Z_(n,bs,e.memoizedState,e.memoizedProps);break;case 5:Ar(e,t,n);break;case 3:case 4:var a=bs;bs=Mu(e.stateNode.containerInfo),Ar(e,t,n),bs=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Xc,Xc=16777216,Ar(e,t,n),Xc=a):Ar(e,t,n));break;default:Ar(e,t,n)}}function sg(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 Vc(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];Xn=a,ig(a,e)}sg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ag(e),e=e.sibling}function ag(e){switch(e.tag){case 0:case 11:case 15:Vc(e),e.flags&2048&&Ya(9,e,e.return);break;case 3:Vc(e);break;case 12:Vc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,yu(e)):Vc(e);break;default:Vc(e)}}function yu(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];Xn=a,ig(a,e)}sg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ya(8,t,t.return),yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,yu(t));break;default:yu(t)}e=e.sibling}}function ig(e,t){for(;Xn!==null;){var n=Xn;switch(n.tag){case 0:case 11:case 15:Ya(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:ht(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Xn=a;else e:for(n=e;Xn!==null;){a=Xn;var u=a.sibling,f=a.return;if(Fm(a),a===n){Xn=null;break e}if(u!==null){u.return=f,Xn=u;break e}Xn=f}}}var u_={getCacheForType:function(e){var t=dt(_e),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return dt(_e).controller.signal}},f_=typeof WeakMap=="function"?WeakMap:Map,jt=0,Vt=null,st=null,ct=0,Mt=0,Yl=null,Xa=!1,Cr=!1,Dd=!1,pa=0,vn=0,Va=0,qi=0,Od=0,Xl=0,Rr=0,$c=null,Ml=null,Ld=!1,_u=0,rg=0,vu=1/0,Su=null,$a=null,Bn=0,Qa=null,Mr=null,ma=0,zd=0,Ud=null,cg=null,Qc=0,Hd=null;function Vl(){return(jt&2)!==0&&ct!==0?ct&-ct:E.T!==null?Xd():qt()}function og(){if(Xl===0)if((ct&536870912)===0||tt){var e=U;U<<=1,(U&3932160)===0&&(U=262144),Xl=e}else Xl=536870912;return e=ql.current,e!==null&&(e.flags|=32),Xl}function Dl(e,t,n){(e===Vt&&(Mt===2||Mt===9)||e.cancelPendingCommit!==null)&&(Dr(e,0),Ka(e,ct,Xl,!1)),nl(e,n),((jt&2)===0||e!==Vt)&&(e===Vt&&((jt&2)===0&&(qi|=n),vn===4&&Ka(e,ct,Xl,!1)),Os(e))}function ug(e,t,n){if((jt&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ft(e,t),u=a?p_(e,t):Id(e,t,!0),f=a;do{if(u===0){Cr&&!a&&Ka(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!d_(n)){u=Id(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var S=e;u=$c;var R=S.current.memoizedState.isDehydrated;if(R&&(Dr(S,b).flags|=256),b=Id(S,b,!1),b!==2){if(Dd&&!R){S.errorRecoveryDisabledLanes|=f,qi|=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){Dr(e,0),Ka(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:Ka(a,t,Xl,!Xa);break e;case 2:Ml=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=_u+300-lt(),10<u)){if(Ka(a,t,Xl,!Xa),Ge(a,0,!0)!==0)break e;ma=t,a.timeoutHandle=qg(fg.bind(null,a,n,Ml,Su,Ld,t,Xl,qi,Rr,Xa,f,"Throttled",-0,0),u);break e}fg(a,n,Ml,Su,Ld,t,Xl,qi,Rr,Xa,f,null,-0,0)}}break}while(!0);Os(e)}function fg(e,t,n,a,u,f,b,S,R,$,ne,ce,F,P){if(e.timeoutHandle=-1,ce=t.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:je},lg(t,f,ce);var Me=(f&62914560)===f?_u-lt():(f&4194048)===f?rg-lt():0;if(Me=F_(ce,Me),Me!==null){ma=f,e.cancelPendingCommit=Me(yg.bind(null,e,t,f,n,a,u,b,S,R,ne,ce,null,F,P)),Ka(e,f,b,!$);return}}yg(e,t,f,n,a,u,b,S,R)}function d_(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(!Gn(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 Ka(e,t,n,a){t&=~Od,t&=~qi,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-We(u),b=1<<f;a[f]=-1,u&=~b}n!==0&&In(e,n,t)}function ju(){return(jt&6)===0?(Kc(0),!1):!0}function Bd(){if(st!==null){if(Mt===0)var e=st.return;else e=st,Pl=gs=null,td(e),jr=null,Cc=0,e=st;for(;e!==null;)Gm(e.alternate,e),e=e.return;st=null}}function Dr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,M_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ma=0,Bd(),Vt=e,st=n=ps(e.current,null),ct=t,Mt=0,Yl=null,Xa=!1,Cr=ft(e,t),Dd=!1,Rr=Xl=Od=qi=Va=vn=0,Ml=$c=null,Ld=!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-We(a),f=1<<u;t|=e[u],a&=~f}return pa=t,Ca(),n}function dg(e,t){Fe=null,E.H=Hc,t===Sr||t===Wo?(t=Ep(),Mt=3):t===Yf?(t=Ep(),Mt=4):Mt=t===bd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yl=t,st===null&&(vn=1,du(e,Tl(t,e.current)))}function hg(){var e=ql.current;return e===null?!0:(ct&4194048)===ct?ts===null:(ct&62914560)===ct||(ct&536870912)!==0?e===ts:!1}function pg(){var e=E.H;return E.H=Hc,e===null?Hc:e}function mg(){var e=E.A;return E.A=u_,e}function wu(){vn=4,Xa||(ct&4194048)!==ct&&ql.current!==null||(Cr=!0),(Va&134217727)===0&&(qi&134217727)===0||Vt===null||Ka(Vt,ct,Xl,!1)}function Id(e,t,n){var a=jt;jt|=2;var u=pg(),f=mg();(Vt!==e||ct!==t)&&(Su=null,Dr(e,t)),t=!1;var b=vn;e:do try{if(Mt!==0&&st!==null){var S=st,R=Yl;switch(Mt){case 8:Bd(),b=6;break e;case 3:case 2:case 9:case 6:ql.current===null&&(t=!0);var $=Mt;if(Mt=0,Yl=null,Or(e,S,R,$),n&&Cr){b=0;break e}break;default:$=Mt,Mt=0,Yl=null,Or(e,S,R,$)}}h_(),b=vn;break}catch(ne){dg(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Pl=gs=null,jt=a,E.H=u,E.A=f,st===null&&(Vt=null,ct=0,Ca()),b}function h_(){for(;st!==null;)gg(st)}function p_(e,t){var n=jt;jt|=2;var a=pg(),u=mg();Vt!==e||ct!==t?(Su=null,vu=lt()+500,Dr(e,t)):Cr=ft(e,t);e:do try{if(Mt!==0&&st!==null){t=st;var f=Yl;t:switch(Mt){case 1:Mt=0,Yl=null,Or(e,t,f,1);break;case 2:case 9:if(Np(f)){Mt=0,Yl=null,bg(t);break}t=function(){Mt!==2&&Mt!==9||Vt!==e||(Mt=7),Os(e)},f.then(t,t);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:Np(f)?(Mt=0,Yl=null,bg(t)):(Mt=0,Yl=null,Or(e,t,f,7));break;case 5:var b=null;switch(st.tag){case 26:b=st.memoizedState;case 5:case 27:var S=st;if(b?nb(b):S.stateNode.complete){Mt=0,Yl=null;var R=S.sibling;if(R!==null)st=R;else{var $=S.return;$!==null?(st=$,ku($)):st=null}break t}}Mt=0,Yl=null,Or(e,t,f,5);break;case 6:Mt=0,Yl=null,Or(e,t,f,6);break;case 8:Bd(),vn=6;break e;default:throw Error(c(462))}}m_();break}catch(ne){dg(e,ne)}while(!0);return Pl=gs=null,E.H=a,E.A=u,jt=n,st!==null?0:(Vt=null,ct=0,Ca(),vn)}function m_(){for(;st!==null&&!ln();)gg(st)}function gg(e){var t=Im(e.alternate,e,pa);e.memoizedProps=e.pendingProps,t===null?ku(e):st=t}function bg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Om(n,t,t.pendingProps,t.type,void 0,ct);break;case 11:t=Om(n,t,t.pendingProps,t.type.render,t.ref,ct);break;case 5:td(t);default:Gm(n,t),t=st=Vo(t,pa),t=Im(n,t,pa)}e.memoizedProps=e.pendingProps,t===null?ku(e):st=t}function Or(e,t,n,a){Pl=gs=null,td(t),jr=null,Cc=0;var u=t.return;try{if(l_(e,u,t,n,ct)){vn=1,du(e,Tl(n,e.current)),st=null;return}}catch(f){if(u!==null)throw st=u,f;vn=1,du(e,Tl(n,e.current)),st=null;return}t.flags&32768?(tt||a===1?e=!0:Cr||(ct&536870912)!==0?e=!1:(Xa=e=!0,(a===2||a===9||a===3||a===6)&&(a=ql.current,a!==null&&a.tag===13&&(a.flags|=16384))),xg(t,e)):ku(t)}function ku(e){var t=e;do{if((t.flags&32768)!==0){xg(t,Xa);return}e=t.return;var n=i_(t.alternate,t,pa);if(n!==null){st=n;return}if(t=t.sibling,t!==null){st=t;return}st=t=e}while(t!==null);vn===0&&(vn=5)}function xg(e,t){do{var n=r_(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);vn=6,st=null}function yg(e,t,n,a,u,f,b,S,R){e.cancelPendingCommit=null;do Nu();while(Bn!==0);if((jt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=jc,Ql(e,n,f,b,S,R),e===Vt&&(st=Vt=null,ct=0),Mr=t,Qa=e,ma=n,zd=f,Ud=u,cg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,y_(At,function(){return wg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=E.T,E.T=null,u=re.p,re.p=2,b=jt,jt|=4;try{c_(e,t,n)}finally{jt=b,re.p=u,E.T=a}}Bn=1,_g(),vg(),Sg()}}function _g(){if(Bn===1){Bn=0;var e=Qa,t=Mr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var a=re.p;re.p=2;var u=jt;jt|=4;try{eg(t,e);var f=Wd,b=xc(e.containerInfo),S=f.focusedElem,R=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&Uo(S.ownerDocument.documentElement,S)){if(R!==null&&Ai(S)){var $=R.start,ne=R.end;if(ne===void 0&&(ne=$),"selectionStart"in S)S.selectionStart=$,S.selectionEnd=Math.min(ne,S.value.length);else{var ce=S.ownerDocument||document,F=ce&&ce.defaultView||window;if(F.getSelection){var P=F.getSelection(),Me=S.textContent.length,Ie=Math.min(R.start,Me),Bt=R.end===void 0?Ie:Math.min(R.end,Me);!P.extend&&Ie>Bt&&(b=Bt,Bt=Ie,Ie=b);var B=bc(S,Ie),L=bc(S,Bt);if(B&&L&&(P.rangeCount!==1||P.anchorNode!==B.node||P.anchorOffset!==B.offset||P.focusNode!==L.node||P.focusOffset!==L.offset)){var V=ce.createRange();V.setStart(B.node,B.offset),P.removeAllRanges(),Ie>Bt?(P.addRange(V),P.extend(L.node,L.offset)):(V.setEnd(L.node,L.offset),P.addRange(V))}}}}for(ce=[],P=S;P=P.parentNode;)P.nodeType===1&&ce.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ce.length;S++){var se=ce[S];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Hu=!!Jd,Wd=Jd=null}finally{jt=u,re.p=a,E.T=n}}e.current=t,Bn=2}}function vg(){if(Bn===2){Bn=0;var e=Qa,t=Mr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var a=re.p;re.p=2;var u=jt;jt|=4;try{Zm(e,t.alternate,t)}finally{jt=u,re.p=a,E.T=n}}Bn=3}}function Sg(){if(Bn===4||Bn===3){Bn=0,Kt();var e=Qa,t=Mr,n=ma,a=cg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Bn=5:(Bn=0,Mr=Qa=null,jg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&($a=null),mn(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=E.T,u=re.p,re.p=2,E.T=null;try{for(var f=e.onRecoverableError,b=0;b<a.length;b++){var S=a[b];f(S.value,{componentStack:S.stack})}}finally{E.T=t,re.p=u}}(ma&3)!==0&&Nu(),Os(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Hd?Qc++:(Qc=0,Hd=e):Qc=0,Kc(0)}}function jg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ht(t)))}function Nu(){return _g(),vg(),Sg(),wg()}function wg(){if(Bn!==5)return!1;var e=Qa,t=zd;zd=0;var n=mn(ma),a=E.T,u=re.p;try{re.p=32>n?32:n,E.T=null,n=Ud,Ud=null;var f=Qa,b=ma;if(Bn=0,Mr=Qa=null,ma=0,(jt&6)!==0)throw Error(c(331));var S=jt;if(jt|=4,ag(f.current),ng(f,f.current,b,n),jt=S,Kc(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Qt,f)}catch{}return!0}finally{re.p=u,E.T=a,jg(e,t)}}function kg(e,t,n){t=Tl(n,t),t=gd(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(nl(e,2),Os(e))}function Dt(e,t,n){if(e.tag===3)kg(e,e,n);else for(;t!==null;){if(t.tag===3){kg(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&($a===null||!$a.has(a))){e=Tl(n,e),n=Nm(2),a=Ia(t,n,2),a!==null&&(Tm(n,a,t,e),nl(a,2),Os(a));break}}t=t.return}}function qd(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new f_;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)||(Dd=!0,u.add(n),e=g_.bind(null,e,t,n),t.then(e,e))}function g_(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vt===e&&(ct&n)===n&&(vn===4||vn===3&&(ct&62914560)===ct&&300>lt()-_u?(jt&2)===0&&Dr(e,0):Od|=n,Rr===ct&&(Rr=0)),Os(e)}function Ng(e,t){t===0&&(t=Qn()),e=la(e,t),e!==null&&(nl(e,t),Os(e))}function b_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ng(e,n)}function x_(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),Ng(e,n)}function y_(e,t){return nt(e,t)}var Tu=null,Lr=null,Gd=!1,Eu=!1,Yd=!1,Za=0;function Os(e){e!==Lr&&e.next===null&&(Lr===null?Tu=Lr=e:Lr=Lr.next=e),Eu=!0,Gd||(Gd=!0,v_())}function Kc(e,t){if(!Yd&&Eu){Yd=!0;do for(var n=!1,a=Tu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var b=a.suspendedLanes,S=a.pingedLanes;f=(1<<31-We(42|e)+1)-1,f&=u&~(b&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Cg(a,f))}else f=ct,f=Ge(a,a===Vt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||ft(a,f)||(n=!0,Cg(a,f));a=a.next}while(n);Yd=!1}}function __(){Tg()}function Tg(){Eu=Gd=!1;var e=0;Za!==0&&R_()&&(e=Za);for(var t=lt(),n=null,a=Tu;a!==null;){var u=a.next,f=Eg(a,t);f===0?(a.next=null,n===null?Tu=u:n.next=u,u===null&&(Lr=n)):(n=a,(e!==0||(f&3)!==0)&&(Eu=!0)),a=u}Bn!==0&&Bn!==5||Kc(e),Za!==0&&(Za=0)}function Eg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-We(f),S=1<<b,R=u[b];R===-1?((S&n)===0||(S&a)!==0)&&(u[b]=bl(S,t)):R<=t&&(e.expiredLanes|=S),f&=~S}if(t=Vt,n=ct,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Mt===2||Mt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Pe(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ft(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Pe(a),mn(n)){case 2:case 8:n=on;break;case 32:n=At;break;case 268435456:n=$t;break;default:n=At}return a=Ag.bind(null,e),n=nt(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Pe(a),e.callbackPriority=2,e.callbackNode=null,2}function Ag(e,t){if(Bn!==0&&Bn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Nu()&&e.callbackNode!==n)return null;var a=ct;return a=Ge(e,e===Vt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(ug(e,a,t),Eg(e,lt()),e.callbackNode!=null&&e.callbackNode===n?Ag.bind(null,e):null)}function Cg(e,t){if(Nu())return null;ug(e,t,!0)}function v_(){D_(function(){(jt&6)!==0?nt(Zt,__):Tg()})}function Xd(){if(Za===0){var e=Ms;e===0&&(e=He,He<<=1,(He&261888)===0&&(He=256)),Za=e}return Za}function Rg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:le(""+e)}function Mg(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 S_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=Rg((u[Ee]||null).action),b=a.submitter;b&&(t=(t=b[Ee]||null)?Rg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new Na("action","action",null,a,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Za!==0){var R=b?Mg(u,b):new FormData(u);ud(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(S.preventDefault(),R=b?Mg(u,b):new FormData(u),ud(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var Vd=0;Vd<Sc.length;Vd++){var $d=Sc[Vd],j_=$d.toLowerCase(),w_=$d[0].toUpperCase()+$d.slice(1);kl(j_,"on"+w_)}kl(Bo,"onAnimationEnd"),kl(Io,"onAnimationIteration"),kl(qo,"onAnimationStart"),kl("dblclick","onDoubleClick"),kl("focusin","onFocus"),kl("focusout","onBlur"),kl(Hf,"onTransitionRun"),kl(Bf,"onTransitionStart"),kl(If,"onTransitionCancel"),kl(Go,"onTransitionEnd"),Zl("onMouseEnter",["mouseout","mouseover"]),Zl("onMouseLeave",["mouseout","mouseover"]),Zl("onPointerEnter",["pointerout","pointerover"]),Zl("onPointerLeave",["pointerout","pointerover"]),fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zc="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(" "),k_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zc));function Dg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var b=a.length-1;0<=b;b--){var S=a[b],R=S.instance,$=S.currentTarget;if(S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=$;try{f(u)}catch(ne){gr(ne)}u.currentTarget=null,f=R}else for(b=0;b<a.length;b++){if(S=a[b],R=S.instance,$=S.currentTarget,S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=$;try{f(u)}catch(ne){gr(ne)}u.currentTarget=null,f=R}}}}function at(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var a=e+"__bubble";n.has(a)||(Og(t,e,2,!1),n.add(a))}function Qd(e,t,n){var a=0;t&&(a|=4),Og(n,e,a,t)}var Au="_reactListening"+Math.random().toString(36).slice(2);function Kd(e){if(!e[Au]){e[Au]=!0,ul.forEach(function(n){n!=="selectionchange"&&(k_.has(n)||Qd(n,!1,e),Qd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Au]||(t[Au]=!0,Qd("selectionchange",!1,t))}}function Og(e,t,n,a){switch(ob(t)){case 2:var u=P_;break;case 8:u=e0;break;default:u=oh}n=u.bind(null,t,n,e),u=void 0,!Sa||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 Zd(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var b=a.tag;if(b===3||b===4){var S=a.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=a.return;b!==null;){var R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=qn(S),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){a=f=b;continue e}S=S.parentNode}}a=a.return}di(function(){var $=f,ne=St(n),ce=[];e:{var F=Yo.get(e);if(F!==void 0){var P=Na,Me=e;switch(e){case"keypress":if(Ks(n)===0)break e;case"keydown":case"keyup":P=ds;break;case"focusin":Me="focus",P=fs;break;case"focusout":Me="blur",P=fs;break;case"beforeblur":case"afterblur":P=fs;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":P=bi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=or;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=Si;break;case Bo:case Io:case qo:P=sn;break;case Go:P=No;break;case"scroll":case"scrollend":P=Zs;break;case"wheel":P=hr;break;case"copy":case"cut":case"paste":P=Ef;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=vi;break;case"toggle":case"beforetoggle":P=ki}var Ie=(t&4)!==0,Bt=!Ie&&(e==="scroll"||e==="scrollend"),B=Ie?F!==null?F+"Capture":null:F;Ie=[];for(var L=$,V;L!==null;){var se=L;if(V=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||V===null||B===null||(se=Fl(L,B),se!=null&&Ie.push(Fc(L,se,V))),Bt)break;L=L.return}0<Ie.length&&(F=new P(F,Me,null,n,ne),ce.push({event:F,listeners:Ie}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",F&&n!==Ze&&(Me=n.relatedTarget||n.fromElement)&&(qn(Me)||Me[un]))break e;if((P||F)&&(F=ne.window===ne?ne:(F=ne.ownerDocument)?F.defaultView||F.parentWindow:window,P?(Me=n.relatedTarget||n.toElement,P=$,Me=Me?qn(Me):null,Me!==null&&(Bt=d(Me),Ie=Me.tag,Me!==Bt||Ie!==5&&Ie!==27&&Ie!==6)&&(Me=null)):(P=null,Me=$),P!==Me)){if(Ie=bi,se="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ie=vi,se="onPointerLeave",B="onPointerEnter",L="pointer"),Bt=P==null?F:Cn(P),V=Me==null?F:Cn(Me),F=new Ie(se,L+"leave",P,n,ne),F.target=Bt,F.relatedTarget=V,se=null,qn(ne)===$&&(Ie=new Ie(B,L+"enter",Me,n,ne),Ie.target=V,Ie.relatedTarget=Bt,se=Ie),Bt=se,P&&Me)t:{for(Ie=N_,B=P,L=Me,V=0,se=B;se;se=Ie(se))V++;se=0;for(var Ue=L;Ue;Ue=Ie(Ue))se++;for(;0<V-se;)B=Ie(B),V--;for(;0<se-V;)L=Ie(L),se--;for(;V--;){if(B===L||L!==null&&B===L.alternate){Ie=B;break t}B=Ie(B),L=Ie(L)}Ie=null}else Ie=null;P!==null&&Lg(ce,F,P,Ie,!1),Me!==null&&Bt!==null&&Lg(ce,Bt,Me,Ie,!0)}}e:{if(F=$?Cn($):window,P=F.nodeName&&F.nodeName.toLowerCase(),P==="select"||P==="input"&&F.type==="file")var yt=Do;else if(Ro(F))if(Oo)yt=Lf;else{yt=Of;var Oe=Df}else P=F.nodeName,!P||P.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?$&&Le($.elementType)&&(yt=Do):yt=mc;if(yt&&(yt=yt(e,$))){Mo(ce,yt,n,ne);break e}Oe&&Oe(e,F,$),e==="focusout"&&$&&F.type==="number"&&$.memoizedProps.value!=null&&Ft(F,"number",F.value)}switch(Oe=$?Cn($):window,e){case"focusin":(Ro(Oe)||Oe.contentEditable==="true")&&(Ea=Oe,yc=$,Ci=null);break;case"focusout":Ci=yc=Ea=null;break;case"mousedown":Ps=!0;break;case"contextmenu":case"mouseup":case"dragend":Ps=!1,_c(ce,n,ne);break;case"selectionchange":if(Uf)break;case"keydown":case"keyup":_c(ce,n,ne)}var Je;if(Js)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 me?Ao(e,n)&&(ot="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ot="onCompositionStart");ot&&(Ws&&n.locale!=="ko"&&(me||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&me&&(Je=hi()):(ks=ne,ja="value"in ks?ks.value:ks.textContent,me=!0)),Oe=Cu($,ot),0<Oe.length&&(ot=new fc(ot,e,null,n,ne),ce.push({event:ot,listeners:Oe}),Je?ot.data=Je:(Je=Co(n),Je!==null&&(ot.data=Je)))),(Je=te?Ta(e,n):Cf(e,n))&&(ot=Cu($,"onBeforeInput"),0<ot.length&&(Oe=new fc("onBeforeInput","beforeinput",null,n,ne),ce.push({event:Oe,listeners:ot}),Oe.data=Je)),S_(ce,e,$,n,ne)}Dg(ce,t)})}function Fc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cu(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=Fl(e,n),u!=null&&a.unshift(Fc(e,u,f)),u=Fl(e,t),u!=null&&a.push(Fc(e,u,f))),e.tag===3)return a;e=e.return}return[]}function N_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lg(e,t,n,a,u){for(var f=t._reactName,b=[];n!==null&&n!==a;){var S=n,R=S.alternate,$=S.stateNode;if(S=S.tag,R!==null&&R===a)break;S!==5&&S!==26&&S!==27||$===null||(R=$,u?($=Fl(n,f),$!=null&&b.unshift(Fc(n,$,R))):u||($=Fl(n,f),$!=null&&b.push(Fc(n,$,R)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var T_=/\r\n?/g,E_=/\u0000|\uFFFD/g;function zg(e){return(typeof e=="string"?e:""+e).replace(T_,`
|
|
50
|
+
`).replace(E_,"")}function Ug(e,t){return t=zg(t),zg(e)===t}function Ht(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||q(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&q(e,""+a);break;case"className":Zn(e,"class",a);break;case"tabIndex":Zn(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Zn(e,n,a);break;case"style":ze(e,a,f);break;case"data":if(t!=="object"){Zn(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=le(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Ht(e,t,"name",u.name,u,null),Ht(e,t,"formEncType",u.formEncType,u,null),Ht(e,t,"formMethod",u.formMethod,u,null),Ht(e,t,"formTarget",u.formTarget,u,null)):(Ht(e,t,"encType",u.encType,u,null),Ht(e,t,"method",u.method,u,null),Ht(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=le(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=je);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=le(""+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),al(e,"popover",a);break;case"xlinkActuate":bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":bn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":bn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":bn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":bn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":al(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=kt.get(n)||n,al(e,n,a))}}function Fd(e,t,n,a,u,f){switch(n){case"style":ze(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"?q(e,a):(typeof a=="number"||typeof a=="bigint")&&q(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=je);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_a.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[Ee]||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,""):al(e,n,a)}}}function Wn(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:Ht(e,t,f,b,n,null)}}u&&Ht(e,t,"srcSet",n.srcSet,n,null),a&&Ht(e,t,"src",n.src,n,null);return;case"input":at("invalid",e);var S=f=b=u=null,R=null,$=null;for(a in n)if(n.hasOwnProperty(a)){var ne=n[a];if(ne!=null)switch(a){case"name":u=ne;break;case"type":b=ne;break;case"checked":R=ne;break;case"defaultChecked":$=ne;break;case"value":f=ne;break;case"defaultValue":S=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(c(137,t));break;default:Ht(e,t,a,ne,n,null)}}dl(e,f,S,R,$,b,u,!1);return;case"select":at("invalid",e),a=b=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":a=S;default:Ht(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!a,t!=null?kn(e,!!a,t,!1):n!=null&&kn(e,!!a,n,!0);return;case"textarea":at("invalid",e),f=u=a=null;for(b in n)if(n.hasOwnProperty(b)&&(S=n[b],S!=null))switch(b){case"value":a=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Ht(e,t,b,S,n,null)}k(e,a,u,f);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(a=n[R],a!=null))switch(R){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ht(e,t,R,a,n,null)}return;case"dialog":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<Zc.length;a++)at(Zc[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($ in n)if(n.hasOwnProperty($)&&(a=n[$],a!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ht(e,t,$,a,n,null)}return;default:if(Le(t)){for(ne in n)n.hasOwnProperty(ne)&&(a=n[ne],a!==void 0&&Fd(e,t,ne,a,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(a=n[S],a!=null&&Ht(e,t,S,a,n,null))}function A_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,R=null,$=null,ne=null;for(P in n){var ce=n[P];if(n.hasOwnProperty(P)&&ce!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":R=ce;default:a.hasOwnProperty(P)||Ht(e,t,P,null,a,ce)}}for(var F in a){var P=a[F];if(ce=n[F],a.hasOwnProperty(F)&&(P!=null||ce!=null))switch(F){case"type":f=P;break;case"name":u=P;break;case"checked":$=P;break;case"defaultChecked":ne=P;break;case"value":b=P;break;case"defaultValue":S=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(c(137,t));break;default:P!==ce&&Ht(e,t,F,P,a,ce)}}Yt(e,b,S,R,$,ne,f,u);return;case"select":P=b=S=F=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":P=R;default:a.hasOwnProperty(f)||Ht(e,t,f,null,a,R)}for(u in a)if(f=a[u],R=n[u],a.hasOwnProperty(u)&&(f!=null||R!=null))switch(u){case"value":F=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==R&&Ht(e,t,u,f,a,R)}t=S,n=b,a=P,F!=null?kn(e,!!n,F,!1):!!a!=!!n&&(t!=null?kn(e,!!n,t,!0):kn(e,!!n,n?[]:"",!1));return;case"textarea":P=F=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!a.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ht(e,t,S,null,a,u)}for(b in a)if(u=a[b],f=n[b],a.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":F=u;break;case"defaultValue":P=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Ht(e,t,b,u,a,f)}de(e,F,P);return;case"option":for(var Me in n)if(F=n[Me],n.hasOwnProperty(Me)&&F!=null&&!a.hasOwnProperty(Me))switch(Me){case"selected":e.selected=!1;break;default:Ht(e,t,Me,null,a,F)}for(R in a)if(F=a[R],P=n[R],a.hasOwnProperty(R)&&F!==P&&(F!=null||P!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Ht(e,t,R,F,a,P)}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)F=n[Ie],n.hasOwnProperty(Ie)&&F!=null&&!a.hasOwnProperty(Ie)&&Ht(e,t,Ie,null,a,F);for($ in a)if(F=a[$],P=n[$],a.hasOwnProperty($)&&F!==P&&(F!=null||P!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(c(137,t));break;default:Ht(e,t,$,F,a,P)}return;default:if(Le(t)){for(var Bt in n)F=n[Bt],n.hasOwnProperty(Bt)&&F!==void 0&&!a.hasOwnProperty(Bt)&&Fd(e,t,Bt,void 0,a,F);for(ne in a)F=a[ne],P=n[ne],!a.hasOwnProperty(ne)||F===P||F===void 0&&P===void 0||Fd(e,t,ne,F,a,P);return}}for(var B in n)F=n[B],n.hasOwnProperty(B)&&F!=null&&!a.hasOwnProperty(B)&&Ht(e,t,B,null,a,F);for(ce in a)F=a[ce],P=n[ce],!a.hasOwnProperty(ce)||F===P||F==null&&P==null||Ht(e,t,ce,F,a,P)}function Hg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&Hg(b)){for(b=0,S=u.responseEnd,a+=1;a<n.length;a++){var R=n[a],$=R.startTime;if($>S)break;var ne=R.transferSize,ce=R.initiatorType;ne&&Hg(ce)&&(R=R.responseEnd,b+=ne*(R<S?1:(S-$)/(R-$)))}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 Jd=null,Wd=null;function Ru(e){return e.nodeType===9?e:e.ownerDocument}function Bg(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 Ig(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 Pd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var eh=null;function R_(){var e=window.event;return e&&e.type==="popstate"?e===eh?!1:(eh=e,!0):(eh=null,!1)}var qg=typeof setTimeout=="function"?setTimeout:void 0,M_=typeof clearTimeout=="function"?clearTimeout:void 0,Gg=typeof Promise=="function"?Promise:void 0,D_=typeof queueMicrotask=="function"?queueMicrotask:typeof Gg<"u"?function(e){return Gg.resolve(null).then(e).catch(O_)}:qg;function O_(e){setTimeout(function(){throw e})}function Fa(e){return e==="head"}function Yg(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),Br(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Jc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Jc(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[Kn]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&Jc(e.ownerDocument.body);n=u}while(n);Br(t)}function Xg(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 th(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":th(n),sl(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function L_(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[Kn])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=ns(e.nextSibling),e===null)break}return null}function z_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ns(e.nextSibling),e===null))return null;return e}function Vg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ns(e.nextSibling),e===null))return null;return e}function nh(e){return e.data==="$?"||e.data==="$~"}function lh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function U_(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 ns(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 sh=null;function $g(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ns(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Qg(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 Kg(e,t,n){switch(t=Ru(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 Jc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);sl(e)}var ls=new Map,Zg=new Set;function Mu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ga=re.d;re.d={f:H_,r:B_,D:I_,C:q_,L:G_,m:Y_,X:V_,S:X_,M:$_};function H_(){var e=ga.f(),t=ju();return e||t}function B_(e){var t=bt(e);t!==null&&t.tag===5&&t.type==="form"?dm(t):ga.r(e)}var zr=typeof document>"u"?null:document;function Fg(e,t,n){var a=zr;if(a&&typeof t=="string"&&t){var u=zt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Zg.has(u)||(Zg.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),Wn(t,"link",e),Rt(t),a.head.appendChild(t)))}}function I_(e){ga.D(e),Fg("dns-prefetch",e,null)}function q_(e,t){ga.C(e,t),Fg("preconnect",e,t)}function G_(e,t,n){ga.L(e,t,n);var a=zr;if(a&&e&&t){var u='link[rel="preload"][as="'+zt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+zt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+zt(n.imageSizes)+'"]')):u+='[href="'+zt(e)+'"]';var f=u;switch(t){case"style":f=Ur(e);break;case"script":f=Hr(e)}ls.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ls.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(Wc(f))||t==="script"&&a.querySelector(Pc(f))||(t=a.createElement("link"),Wn(t,"link",e),Rt(t),a.head.appendChild(t)))}}function Y_(e,t){ga.m(e,t);var n=zr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+zt(a)+'"][href="'+zt(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Hr(e)}if(!ls.has(f)&&(e=j({rel:"modulepreload",href:e},t),ls.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Pc(f)))return}a=n.createElement("link"),Wn(a,"link",e),Rt(a),n.head.appendChild(a)}}}function X_(e,t,n){ga.S(e,t,n);var a=zr;if(a&&e){var u=gn(a).hoistableStyles,f=Ur(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=a.querySelector(Wc(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ls.get(f))&&ah(e,n);var R=b=a.createElement("link");Rt(R),Wn(R,"link",e),R._p=new Promise(function($,ne){R.onload=$,R.onerror=ne}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Du(b,t,a)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function V_(e,t){ga.X(e,t);var n=zr;if(n&&e){var a=gn(n).hoistableScripts,u=Hr(e),f=a.get(u);f||(f=n.querySelector(Pc(u)),f||(e=j({src:e,async:!0},t),(t=ls.get(u))&&ih(e,t),f=n.createElement("script"),Rt(f),Wn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function $_(e,t){ga.M(e,t);var n=zr;if(n&&e){var a=gn(n).hoistableScripts,u=Hr(e),f=a.get(u);f||(f=n.querySelector(Pc(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=ls.get(u))&&ih(e,t),f=n.createElement("script"),Rt(f),Wn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function Jg(e,t,n,a){var u=(u=ve.current)?Mu(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=Ur(n.href),n=gn(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=Ur(n.href);var f=gn(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(Wc(e)))&&!f._p&&(b.instance=f,b.state.loading=5),ls.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},ls.set(e,n),f||Q_(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=Hr(n),n=gn(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 Ur(e){return'href="'+zt(e)+'"'}function Wc(e){return'link[rel="stylesheet"]['+e+"]"}function Wg(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Q_(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}),Wn(t,"link",n),Rt(t),e.head.appendChild(t))}function Hr(e){return'[src="'+zt(e)+'"]'}function Pc(e){return"script[async]"+e}function Pg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+zt(n.href)+'"]');if(a)return t.instance=a,Rt(a),a;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Rt(a),Wn(a,"style",u),Du(a,n.precedence,e),t.instance=a;case"stylesheet":u=Ur(n.href);var f=e.querySelector(Wc(u));if(f)return t.state.loading|=4,t.instance=f,Rt(f),f;a=Wg(n),(u=ls.get(u))&&ah(a,u),f=(e.ownerDocument||e).createElement("link"),Rt(f);var b=f;return b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),Wn(f,"link",a),t.state.loading|=4,Du(f,n.precedence,e),t.instance=f;case"script":return f=Hr(n.src),(u=e.querySelector(Pc(f)))?(t.instance=u,Rt(u),u):(a=n,(u=ls.get(f))&&(a=j({},n),ih(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Rt(u),Wn(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,Du(a,n.precedence,e));return t.instance}function Du(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,b=0;b<a.length;b++){var S=a[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ah(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ih(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ou=null;function eb(e,t,n){if(Ou===null){var a=new Map,u=Ou=new Map;u.set(n,a)}else u=Ou,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[Kn]||f[Lt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=a.get(b);S?S.push(f):a.set(b,[f])}}return a}function tb(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function K_(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 nb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Z_(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=Ur(a.href),f=t.querySelector(Wc(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Rt(f);return}f=t.ownerDocument||t,a=Wg(a),(u=ls.get(u))&&ah(a,u),f=f.createElement("link"),Rt(f);var b=f;b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),Wn(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=Lu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var rh=0;function F_(e,t){return e.stylesheets&&e.count===0&&Uu(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Uu(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*C_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Uu(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var zu=null;function Uu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,zu=new Map,t.forEach(J_,e),zu=null,Lu.call(e))}function J_(e,t){if(!(t.state.loading&4)){var n=zu.get(e);if(n)var a=n.get(null);else{n=new Map,zu.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=Lu.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 eo={$$typeof:Y,Provider:null,Consumer:null,_currentValue:O,_currentValue2:O,_threadCount:0};function W_(e,t,n,a,u,f,b,S,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=tl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tl(0),this.hiddenUpdates=tl(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function lb(e,t,n,a,u,f,b,S,R,$,ne,ce){return e=new W_(e,t,n,b,R,$,ne,ce,S),t=1,f===!0&&(t|=24),f=hl(3,null,null,t),e.current=f,f.stateNode=e,t=Ye(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},Xf(f),e}function sb(e){return e?(e=Da,e):Da}function ab(e,t,n,a,u,f){u=sb(u),a.context===null?a.context=u:a.pendingContext=u,a=Ba(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=Ia(e,a,t),n!==null&&(Dl(n,e,t),Mc(n,e,t))}function ib(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ch(e,t){ib(e,t),(e=e.alternate)&&ib(e,t)}function rb(e){if(e.tag===13||e.tag===31){var t=la(e,67108864);t!==null&&Dl(t,e,67108864),ch(e,67108864)}}function cb(e){if(e.tag===13||e.tag===31){var t=Vl();t=ll(t);var n=la(e,t);n!==null&&Dl(n,e,t),ch(e,t)}}var Hu=!0;function P_(e,t,n,a){var u=E.T;E.T=null;var f=re.p;try{re.p=2,oh(e,t,n,a)}finally{re.p=f,E.T=u}}function e0(e,t,n,a){var u=E.T;E.T=null;var f=re.p;try{re.p=8,oh(e,t,n,a)}finally{re.p=f,E.T=u}}function oh(e,t,n,a){if(Hu){var u=uh(a);if(u===null)Zd(e,t,a,Bu,n),ub(e,a);else if(n0(u,e,t,n,a))a.stopPropagation();else if(ub(e,a),t&4&&-1<t0.indexOf(e)){for(;u!==null;){var f=bt(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=ye(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var R=1<<31-We(b);S.entanglements[1]|=R,b&=~R}Os(f),(jt&6)===0&&(vu=lt()+500,Kc(0))}}break;case 31:case 13:S=la(f,2),S!==null&&Dl(S,f,2),ju(),ch(f,2)}if(f=uh(a),f===null&&Zd(e,t,a,Bu,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else Zd(e,t,a,null,n)}}function uh(e){return e=St(e),fh(e)}var Bu=null;function fh(e){if(Bu=null,e=qn(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 Bu=e,null}function ob(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(Et()){case Zt:return 2;case on:return 8;case At:case jn:return 32;case $t:return 268435456;default:return 32}default:return 32}}var dh=!1,Ja=null,Wa=null,Pa=null,to=new Map,no=new Map,ei=[],t0="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 ub(e,t){switch(e){case"focusin":case"focusout":Ja=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":to.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":no.delete(t.pointerId)}}function lo(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=bt(t),t!==null&&rb(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function n0(e,t,n,a,u){switch(t){case"focusin":return Ja=lo(Ja,e,t,n,a,u),!0;case"dragenter":return Wa=lo(Wa,e,t,n,a,u),!0;case"mouseover":return Pa=lo(Pa,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return to.set(f,lo(to.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,no.set(f,lo(no.get(f)||null,e,t,n,a,u)),!0}return!1}function fb(e){var t=qn(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,xl(e.priority,function(){cb(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,xl(e.priority,function(){cb(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 Iu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=uh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Ze=a,n.target.dispatchEvent(a),Ze=null}else return t=bt(n),t!==null&&rb(t),e.blockedOn=n,!1;t.shift()}return!0}function db(e,t,n){Iu(e)&&n.delete(t)}function l0(){dh=!1,Ja!==null&&Iu(Ja)&&(Ja=null),Wa!==null&&Iu(Wa)&&(Wa=null),Pa!==null&&Iu(Pa)&&(Pa=null),to.forEach(db),no.forEach(db)}function qu(e,t){e.blockedOn===t&&(e.blockedOn=null,dh||(dh=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,l0)))}var Gu=null;function hb(e){Gu!==e&&(Gu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Gu===e&&(Gu=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(fh(a||n)===null)continue;break}var f=bt(n);f!==null&&(e.splice(t,3),t-=3,ud(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function Br(e){function t(R){return qu(R,e)}Ja!==null&&qu(Ja,e),Wa!==null&&qu(Wa,e),Pa!==null&&qu(Pa,e),to.forEach(t),no.forEach(t);for(var n=0;n<ei.length;n++){var a=ei[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ei.length&&(n=ei[0],n.blockedOn===null);)fb(n),n.blockedOn===null&&ei.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[Ee]||null;if(typeof f=="function")b||hb(n);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Ee]||null)S=b.formAction;else if(fh(u)!==null)continue}else S=b.action;typeof S=="function"?n[a+1]=S:(n.splice(a,3),a-=3),hb(n)}}}function pb(){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 hh(e){this._internalRoot=e}Yu.prototype.render=hh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=Vl();ab(n,a,e,t,null,null)},Yu.prototype.unmount=hh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ab(e.current,2,null,e,null,null),ju(),t[un]=null}};function Yu(e){this._internalRoot=e}Yu.prototype.unstable_scheduleHydration=function(e){if(e){var t=qt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ei.length&&t!==0&&t<ei[n].priority;n++);ei.splice(n,0,e),n===0&&fb(e)}};var mb=l.version;if(mb!=="19.2.8")throw Error(c(527,mb,"19.2.8"));re.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 s0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xu.isDisabled&&Xu.supportsFiber)try{Qt=Xu.inject(s0),rt=Xu}catch{}}return ao.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Sm,f=jm,b=wm;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=lb(e,1,!1,null,null,n,a,null,u,f,b,pb),e[un]=t.current,Kd(e),new hh(t)},ao.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Sm,b=jm,S=wm,R=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=lb(e,1,!0,t,n??null,a,u,R,f,b,S,pb),t.context=sb(null),n=t.current,a=Vl(),a=ll(a),u=Ba(a),u.callback=null,Ia(n,u,a),n=a,t.current.lanes=n,nl(t,n),Os(t),e[un]=t.current,Kd(e),new Yu(t)},ao.version="19.2.8",ao}var Nb;function g0(){if(Nb)return bh.exports;Nb=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(),bh.exports=m0(),bh.exports}var b0=g0();const Qx=1;var ya,Wr,Pr,ec,tc,So,nc,wf,Kx;class x0{constructor(l){fn(this,wf);fn(this,ya,null);fn(this,Wr,new Set);fn(this,Pr,500);fn(this,ec,null);fn(this,tc,!1);fn(this,So,null);fn(this,nc,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){wt(this,nc,l)}connect(){if(qe(this,tc))return;const l=new WebSocket(this.url);wt(this,ya,l),l.addEventListener("open",()=>{var r,c;wt(this,Pr,500),this.send({type:"hello",protocol:Qx,clientName:"ccv-web"}),(r=qe(this,So))==null||r.call(this),(c=qe(this,nc))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of qe(this,Wr))o(c)}),l.addEventListener("close",()=>{var r;wt(this,ya,null),(r=qe(this,nc))==null||r.call(this),zn(this,wf,Kx).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){wt(this,So,l)}on(l){return qe(this,Wr).add(l),()=>qe(this,Wr).delete(l)}send(l){var r;((r=qe(this,ya))==null?void 0:r.readyState)===WebSocket.OPEN&&qe(this,ya).send(JSON.stringify(l))}get connected(){var l;return((l=qe(this,ya))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;wt(this,tc,!0),(l=qe(this,ya))==null||l.close()}}ya=new WeakMap,Wr=new WeakMap,Pr=new WeakMap,ec=new WeakMap,tc=new WeakMap,So=new WeakMap,nc=new WeakMap,wf=new WeakSet,Kx=function(){if(qe(this,tc)||qe(this,ec)!==null)return;const l=qe(this,Pr);wt(this,Pr,Math.min(l*2,1e4)),wt(this,ec,window.setTimeout(()=>{wt(this,ec,null),this.connect()},l))};const y0=1,Zx="ccv:relay",ff="ccv:relay.host";function _0(){try{const s=localStorage.getItem(Zx);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 Fx(){localStorage.removeItem(Zx)}var Gs,lc,Ys,sc,ac,oi,Ki,Zi,ui,Fi,ic,Ji,Wi,Pt,si,Gh,Jx,Vi,Yh;class v0{constructor(l){fn(this,Pt);fn(this,Gs,null);fn(this,lc,new Set);fn(this,Ys,null);fn(this,sc,null);fn(this,ac,500);fn(this,oi,null);fn(this,Ki,!1);fn(this,Zi,!1);fn(this,ui,!1);fn(this,Fi,null);fn(this,ic,"Подключаемся…");fn(this,Ji,0);fn(this,Wi,[]);this.session=l}get connected(){return qe(this,Zi)&&qe(this,ui)}get statusText(){return qe(this,ic)}get hostId(){return qe(this,Fi)}on(l){return qe(this,lc).add(l),()=>qe(this,lc).delete(l)}onReconnect(l){wt(this,sc,l)}onStatus(l){wt(this,Ys,l)}connect(){qe(this,Ki)||zn(this,Pt,Gh).call(this)}send(l){if(!qe(this,Zi)){qe(this,Wi).length<64&&qe(this,Wi).push(l);return}zn(this,Pt,Vi).call(this,{t:"client.frame",body:l})}close(){var l;wt(this,Ki,!0),qe(this,oi)!==null&&window.clearTimeout(qe(this,oi)),(l=qe(this,Gs))==null||l.close()}}Gs=new WeakMap,lc=new WeakMap,Ys=new WeakMap,sc=new WeakMap,ac=new WeakMap,oi=new WeakMap,Ki=new WeakMap,Zi=new WeakMap,ui=new WeakMap,Fi=new WeakMap,ic=new WeakMap,Ji=new WeakMap,Wi=new WeakMap,Pt=new WeakSet,si=function(l){var r;qe(this,ic)!==l&&(wt(this,ic,l),(r=qe(this,Ys))==null||r.call(this))},Gh=async function(){if(qe(this,Gs))return;if(!qe(this,Fi))try{wt(this,Fi,await S0(this.session.token))}catch(c){zn(this,Pt,si).call(this,c instanceof Error?c.message:String(c)),zn(this,Pt,Yh).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);wt(this,Gs,r),r.addEventListener("open",()=>{zn(this,Pt,Vi).call(this,{t:"client.hello",protocol:y0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}zn(this,Pt,Jx).call(this,o)}),r.addEventListener("close",()=>{var c;wt(this,Gs,null),wt(this,Zi,!1),wt(this,ui,!1),zn(this,Pt,si).call(this,"Нет связи с сервером"),(c=qe(this,Ys))==null||c.call(this),zn(this,Pt,Yh).call(this)}),r.addEventListener("error",()=>r.close())},Jx=function(l){var r,c,o,d,h,p,m;switch(l.t){case"client.ok":wt(this,ac,500),zn(this,Pt,Vi).call(this,{t:"client.attach",hostId:qe(this,Fi)??"",...qe(this,Ji)>0?{sinceRseq:qe(this,Ji)}:{}});return;case"client.attached":wt(this,Zi,!0),wt(this,ui,l.online),wt(this,Ji,l.rseq),zn(this,Pt,si).call(this,l.online?"Хост на связи":"Компьютер не на связи"),zn(this,Pt,Vi).call(this,{t:"client.frame",body:{type:"hello",protocol:Qx,clientName:"ccv-web-relay"}});const x=qe(this,Wi);wt(this,Wi,[]);for(const _ of x)zn(this,Pt,Vi).call(this,{t:"client.frame",body:_});(r=qe(this,sc))==null||r.call(this),(c=qe(this,Ys))==null||c.call(this);return;case"host.frame":{l.rseq>0&&wt(this,Ji,l.rseq);const _=l.body;for(const j of qe(this,lc))j(_);return}case"host.online":wt(this,ui,!0),zn(this,Pt,si).call(this,"Хост на связи"),(o=qe(this,sc))==null||o.call(this),(d=qe(this,Ys))==null||d.call(this);return;case"host.offline":wt(this,ui,!1),zn(this,Pt,si).call(this,"Компьютер не на связи"),(h=qe(this,Ys))==null||h.call(this);return;case"ping":zn(this,Pt,Vi).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){Fx(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(ff),zn(this,Pt,si).call(this,"Этот компьютер отвязан от аккаунта"),wt(this,Ki,!0),(p=qe(this,Gs))==null||p.close();return}l.code!=="offline"&&zn(this,Pt,si).call(this,l.message),(m=qe(this,Ys))==null||m.call(this);return}},Vi=function(l){var r;((r=qe(this,Gs))==null?void 0:r.readyState)===WebSocket.OPEN&&qe(this,Gs).send(JSON.stringify(l))},Yh=function(){if(qe(this,Ki)||qe(this,oi)!==null)return;const l=qe(this,ac);wt(this,ac,Math.min(l*2,1e4)),wt(this,oi,window.setTimeout(()=>{wt(this,oi,null),zn(this,Pt,Gh).call(this)},l))};async function S0(s){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(ff,l),l;const r=localStorage.getItem(ff);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${s}`}});if(c.status===401)throw Fx(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(ff,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function df(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const j0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function w0(){if(df()==="local")return new x0(j0);const s=_0();return s?new v0(s):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const Wx="ccv:drafts",k0=40,N0=2e4,T0=500;let bo=null,xo=null;function sp(){if(bo)return bo;const s=new Map;try{const l=localStorage.getItem(Wx);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 bo=s,window.addEventListener("pagehide",ey),s}function vh(s){return sp().get(s)??""}function E0(s,l){const r=sp(),c=l.slice(0,N0),o=r.has(s);if(o&&r.delete(s),c!=="")r.set(s,c);else if(!o)return;for(;r.size>k0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}R0(),C0()}function Px(){const s=new Set;for(const l of sp().keys())s.add(l.startsWith("side:")?l.slice(5):l);return[...s].sort()}const Xh=new Set;let Tb="";function A0(s){return Xh.add(s),()=>Xh.delete(s)}function C0(){const s=Px(),l=s.join(`
|
|
51
|
+
`);if(l!==Tb){Tb=l;for(const r of Xh)r(s)}}function R0(){xo===null&&(xo=window.setTimeout(ey,T0))}function ey(){if(xo!==null&&window.clearTimeout(xo),xo=null,!!bo)try{localStorage.setItem(Wx,JSON.stringify(Object.fromEntries(bo)))}catch{}}const Ol={items:[],pending:[],lastSeq:0,contextTokens:null},Sh={entries:[],total:0,loading:!1};function ty(s){var l;return((l=s.entries[0])==null?void 0:l.seq)??1}function Eb(s){return s.total>0&&ty(s)>1}function M0(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 D0(s){return hf(Ol,s).items.map(l=>({...l,id:`h:${l.id}`}))}function hf(s,l){let r=s;for(const c of l)c.seq<=r.lastSeq||(r={...O0(r,c.event,c.seq),lastSeq:c.seq});return r}function O0(s,l,r){var o,d;const c=s.items;switch(l.kind){case"user.message":return Ls(s,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return Ls(s,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return Ir(s,h,{...p,text:p.text+l.text})}case"assistant.text":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?Ls(s,p):Ir(s,h,p)}case"thinking.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return Ls(s,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return Ir(s,h,{...p,text:p.text+l.text})}case"assistant.thinking":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"thinking",text:l.text};return h===-1?Ls(s,p):Ir(s,h,p)}case"tool.use":return Ls(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(m=>m.kind==="tool"&&m.toolUseId===l.toolUseId);if(h===-1)return s;const p=c[h];return Ir(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(m=>m.requestId===l.requestId),p=s.pending.filter(m=>m.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const m=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(m!==-1){const x=c[m];return Ir({...s,pending:p},m,{...x,answers:l.answers})}}return l.decision==="allow"?{...s,pending:p}:Ls({...s,pending:p},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=s.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),p=l.contextTokens??s.contextTokens;return Ls({...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:Ls(s,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Ls(s,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return s;case"rewound":return s;default:return s}}function L0(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 z0(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 Ls(s,l){return{...s,items:[...s.items,l]}}function Ir(s,l,r){const c=s.items.slice();return c[l]=r,{...s,items:c}}const Vh="ccv:theme",jh=["system","light","dark"];function U0(){const[s,l]=y.useState(H0);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(Vh,o)}catch{}l(o)},[]),c=y.useCallback(()=>{l(o=>{const d=jh[(jh.indexOf(o)+1)%jh.length];try{localStorage.setItem(Vh,d)}catch{}return d})},[]);return[s,r,c]}function H0(){try{const s=localStorage.getItem(Vh);if(s==="light"||s==="dark"||s==="system")return s}catch{}return"system"}const ny=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Pi={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:"вопроса"}},B0=320,ly="ccv:panes";function I0(s){return`--${s}-w`}function sy(s,l){const r=Pi[s];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function q0(){const s={};for(const l of Object.keys(Pi))s[l]=Pi[l].width;try{const l=localStorage.getItem(ly);if(l){const r=JSON.parse(l);for(const c of Object.keys(Pi)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(s[c]=sy(c,o))}}}catch{}return s}function G0(){const[s,l]=y.useState(q0),r=y.useCallback(h=>{try{localStorage.setItem(ly,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,p)=>{l(m=>{const x=sy(h,p);if(m[h]===x)return m;const _={...m,[h]:x};return r(_),_})},[r]),o=y.useCallback(h=>{l(p=>{const m={...p,[h]:Pi[h].width};return r(m),m})},[r]),d={};for(const h of Object.keys(Pi))d[I0(h)]=`${s[h]}px`;return{widths:s,style:d,setWidth:c,reset:o}}const wh=260,ay=120,Y0=200,Ab="ccv:terminal-h";function Cb(s,l){return Math.round(Math.min(l,Math.max(ay,s)))}function X0(){const[s,l]=y.useState(()=>{try{const d=localStorage.getItem(Ab);if(d){const h=Number(d);if(Number.isFinite(h))return Cb(h,1/0)}}catch{}return wh}),r=y.useCallback(d=>{try{localStorage.setItem(Ab,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const p=Cb(d,h);l(m=>m===p?m:(r(p),p))},[r]),o=y.useCallback(()=>{l(wh),r(wh)},[r]);return{height:s,setHeight:c,reset:o}}function kf(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 V0={height:0,offsetTop:0,offsetLeft:0};function Rb(){if(typeof window>"u")return V0;const s=window.visualViewport;return s?{height:s.height,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function $0(s){const[l,r]=y.useState(Rb);return y.useEffect(()=>{if(!s)return;const c=window.visualViewport,o=()=>{const d=Rb();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 ap(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var lr=ap();function iy(s){lr=s}var $i={exec:()=>null};function qr(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 mt(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(cl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var Q0=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}catch{return!1}})(),cl={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:qr(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qr(s=>new RegExp(`^ {0,${s}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:qr(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:qr(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:qr(s=>new RegExp(`^ {0,${s}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:qr(s=>new RegExp(`^ {0,${s}}>`))},K0=/^(?:[ \t]*(?:\n|$))+/,Z0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,F0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,jo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,J0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ip=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ry=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cy=mt(ry).replace(/bull/g,ip).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(),W0=mt(ry).replace(/bull/g,ip).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(),rp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,P0=/^[^\n]+/,cp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ev=mt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tv=mt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ip).getRegex(),Nf="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",op=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nv=mt("^ {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",op).replace("tag",Nf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oy=s=>mt(rp).replace("hr",jo).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",Nf).getRegex(),lv=oy(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),sv=oy(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),av=mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sv).getRegex(),up={blockquote:av,code:Z0,def:ev,fences:F0,heading:J0,hr:jo,html:nv,lheading:cy,list:tv,newline:K0,paragraph:lv,table:$i,text:P0},Mb=mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",jo).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",Nf).getRegex(),iv={...up,lheading:W0,table:Mb,paragraph:mt(rp).replace("hr",jo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mb).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",Nf).getRegex()},rv={...up,html:mt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",op).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:$i,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mt(rp).replace("hr",jo).replace("heading",` *#{1,6} *[^
|
|
52
|
+
]`).replace("lheading",cy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},cv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ov=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uy=/^( {2,}|\\)\n(?!\s*$)/,uv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cc=/[\p{P}\p{S}]/u,Tf=/[\s\p{P}\p{S}]/u,fp=/[^\s\p{P}\p{S}]/u,fv=mt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Tf).getRegex(),fy=/(?!~)[\p{P}\p{S}]/u,dv=/(?!~)[\s\p{P}\p{S}]/u,hv=/(?:[^\s\p{P}\p{S}]|~)/u,pv=mt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Q0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mv=mt(dy,"u").replace(/punct/g,cc).getRegex(),gv=mt(dy,"u").replace(/punct/g,fy).getRegex(),hy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bv=mt(hy,"gu").replace(/notPunctSpace/g,fp).replace(/punctSpace/g,Tf).replace(/punct/g,cc).getRegex(),xv=mt(hy,"gu").replace(/notPunctSpace/g,hv).replace(/punctSpace/g,dv).replace(/punct/g,fy).getRegex(),yv=mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fp).replace(/punctSpace/g,Tf).replace(/punct/g,cc).getRegex(),_v=mt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,cc).getRegex(),vv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sv=mt(vv,"gu").replace(/notPunctSpace/g,fp).replace(/punctSpace/g,Tf).replace(/punct/g,cc).getRegex(),jv=mt(/\\(punct)/,"gu").replace(/punct/g,cc).getRegex(),wv=mt(/^<(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(),kv=mt(op).replace("(?:-->|$)","-->").getRegex(),Nv=mt("^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",kv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Tv=mt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",gf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),py=mt(/^!?\[(label)\]\[(ref)\]/).replace("label",gf).replace("ref",cp).getRegex(),my=mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",cp).getRegex(),Ev=mt("reflink|nolink(?!\\()","g").replace("reflink",py).replace("nolink",my).getRegex(),Db=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dp={_backpedal:$i,anyPunctuation:jv,autolink:wv,blockSkip:pv,br:uy,code:ov,del:$i,delLDelim:$i,delRDelim:$i,emStrongLDelim:mv,emStrongRDelimAst:bv,emStrongRDelimUnd:yv,escape:cv,link:Tv,nolink:my,punctuation:fv,reflink:py,reflinkSearch:Ev,tag:Nv,text:uv,url:$i},Av={...dp,link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",gf).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",gf).getRegex()},$h={...dp,emStrongRDelimAst:xv,emStrongLDelim:gv,delLDelim:_v,delRDelim:Sv,url:mt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Db).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:mt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Db).getRegex()},Cv={...$h,br:mt(uy).replace("{2,}","*").getRegex(),text:mt($h.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vu={normal:up,gfm:iv,pedantic:rv},io={normal:dp,gfm:$h,breaks:Cv,pedantic:Av},Rv={"&":"&","<":"<",">":">",'"':""","'":"'"},Ob=s=>Rv[s];function Bs(s,l){if(l){if(cl.escapeTest.test(s))return s.replace(cl.escapeReplace,Ob)}else if(cl.escapeTestNoEncode.test(s))return s.replace(cl.escapeReplaceNoEncode,Ob);return s}function Lb(s){try{s=encodeURI(s).replace(cl.percentDecode,"%")}catch{return null}return s}function zb(s,l){var d;let r=s.replace(cl.findPipe,(h,p,m)=>{let x=!1,_=p;for(;--_>=0&&m[_]==="\\";)x=!x;return x?"|":" |"}),c=r.split(cl.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(cl.slashPipe,"|");return c}function ni(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 Ub(s){let l=s.split(`
|
|
53
|
+
`),r=l.length-1;for(;r>=0&&cl.blankLine.test(l[r]);)r--;return l.length-r<=2?s:l.slice(0,r+1).join(`
|
|
54
|
+
`)}function Mv(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 Dv(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 Hb(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 m={type:s[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,m}function Ov(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 bf=class{constructor(s){It(this,"options");It(this,"rules");It(this,"lexer");this.options=s||lr}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]:Ub(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=Ov(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=ni(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:ni(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:ni(l[0],`
|
|
58
|
+
`)}}blockquote(s){let l=this.rules.block.blockquote.exec(s);if(l){let r=ni(l[0],`
|
|
59
|
+
`).split(`
|
|
60
|
+
`),c="",o="",d=[];for(;r.length>0;){let h=!1,p=[],m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))p.push(r[m]),h=!0;else if(!h)p.push(r[m]);else break;r=r.slice(m);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 j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,d,!0),this.lexer.state.top=j,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let A=v,T=A.raw+`
|
|
65
|
+
`+r.join(`
|
|
66
|
+
`),M=this.blockquote(T);d[d.length-1]=M,c=c.substring(0,c.length-A.raw.length)+M.raw,o=o.substring(0,o.length-A.text.length)+M.text;break}else if((v==null?void 0:v.type)==="list"){let A=v,T=A.raw+`
|
|
67
|
+
`+r.join(`
|
|
68
|
+
`),M=this.list(T);d[d.length-1]=M,c=c.substring(0,c.length-v.raw.length)+M.raw,o=o.substring(0,o.length-A.raw.length)+M.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 m=!1,x="",_="";if(!(l=d.exec(s))||this.rules.block.hr.test(s))break;x=l[0],s=s.substring(x.length);let j=Dv(l[2].split(`
|
|
70
|
+
`,1)[0],l[1].length),v=s.split(`
|
|
71
|
+
`,1)[0],A=!j.trim(),T=0;if(this.options.pedantic?(T=2,_=j.trimStart()):A?T=l[1].length+1:(T=j.search(this.rules.other.nonSpaceChar),T=T>4?1:T,_=j.slice(T),T+=l[1].length),A&&this.rules.other.blankLine.test(v)&&(x+=v+`
|
|
72
|
+
`,s=s.substring(v.length+1),m=!0),!m){let M=this.rules.other.nextBulletRegex(T),z=this.rules.other.hrRegex(T),G=this.rules.other.fencesBeginRegex(T),Q=this.rules.other.headingBeginRegex(T),Y=this.rules.other.htmlBeginRegex(T),D=this.rules.other.blockquoteBeginRegex(T);for(;s;){let K=s.split(`
|
|
73
|
+
`,1)[0],H;if(v=K,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),H=v):H=v.replace(this.rules.other.tabCharGlobal," "),G.test(v)||Q.test(v)||Y.test(v)||D.test(v)||M.test(v)||z.test(v))break;if(H.search(this.rules.other.nonSpaceChar)>=T||!v.trim())_+=`
|
|
74
|
+
`+H.slice(T);else{if(A||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(j)||Q.test(j)||z.test(j))break;_+=`
|
|
75
|
+
`+v}A=!v.trim(),x+=K+`
|
|
76
|
+
`,s=s.substring(K.length+1),j=H.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 m of o.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let x=m.tokens[0];if(m.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(m.raw);if(_){let j={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};m.checked=j.checked,o.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=j.raw+m.tokens[0].raw,m.tokens[0].text=j.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(j)):m.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):m.tokens.unshift(j)}}else m.task&&(m.task=!1);if(!o.loose){let _=m.tokens.filter(v=>v.type==="space"),j=_.length>0&&_.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let m of o.items){m.loose=!0;for(let x of m.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(s){let l=this.rules.block.html.exec(s);if(l){let r=Ub(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:ni(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=zb(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:ni(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(zb(p,d.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),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:ni(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=ni(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Mv(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)),Hb(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 Hb(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,m=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)){m+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p+m);let _=[...c[0]][0].length,j=s.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let A=j.slice(1,-1);return{type:"em",raw:j,text:A,tokens:this.lexer.inlineTokens(A)}}let v=j.slice(2,-2);return{type:"strong",raw:j,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,m=this.rules.inline.delRDelim;for(m.lastIndex=0,l=l.slice(-1*s.length+o);(c=m.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),j=_.slice(o,-o);return{type:"del",raw:_,text:j,tokens:this.lexer.inlineTokens(j)}}}}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}}}},_s=class Qh{constructor(l){It(this,"tokens");It(this,"options");It(this,"state");It(this,"inlineQueue");It(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||lr,this.options.tokenizer=this.options.tokenizer||new bf,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:cl,block:Vu.normal,inline:io.normal};this.options.pedantic?(r.block=Vu.pedantic,r.inline=io.pedantic):this.options.gfm&&(r.block=Vu.gfm,this.options.breaks?r.inline=io.breaks:r.inline=io.gfm),this.tokenizer.rules=r}static get rules(){return{block:Vu,inline:io}}static lex(l,r){return new Qh(r).lex(l)}static lexInline(l,r){return new Qh(r).inlineTokens(l)}lex(l){l=l.replace(cl.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(cl.tabCharGlobal," ").replace(cl.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let m;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(_=>(m=_.call({lexer:this},l,r))?(l=l.substring(m.raw.length),r.push(m),!0):!1))continue;if(m=this.tokenizer.space(l)){l=l.substring(m.raw.length);let _=r.at(-1);m.raw.length===1&&_!==void 0?_.raw+=`
|
|
83
|
+
`:r.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
84
|
+
`)?"":`
|
|
85
|
+
`)+m.raw,_.text+=`
|
|
86
|
+
`+m.text,this.inlineQueue.at(-1).src=_.text):r.push(m);continue}if(m=this.tokenizer.fences(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.heading(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.hr(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.blockquote(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.list(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.html(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.def(l)){l=l.substring(m.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
87
|
+
`)?"":`
|
|
88
|
+
`)+m.raw,_.text+=`
|
|
89
|
+
`+m.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title},r.push(m));continue}if(m=this.tokenizer.table(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.lheading(l)){l=l.substring(m.raw.length),r.push(m);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let _=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(A=>{v=A.call({lexer:this},j),typeof v=="number"&&v>=0&&(_=Math.min(_,v))}),_<1/0&&_>=0&&(x=l.substring(0,_+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){let _=r.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
|
|
90
|
+
`)?"":`
|
|
91
|
+
`)+m.raw,_.text+=`
|
|
92
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(m),c=x.length!==l.length,l=l.substring(m.raw.length);continue}if(m=this.tokenizer.text(l)){l=l.substring(m.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
93
|
+
`)?"":`
|
|
94
|
+
`)+m.raw,_.text+=`
|
|
95
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(m);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,m,x,_,j;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,A=>v.includes(A.slice(A.lastIndexOf("[")+1,-1))?"["+"a".repeat(A.length-2)+"]":A))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,A,T)=>{let M=T?T.length:0;return v.slice(0,M)+"["+"a".repeat(v.length-M-2)+"]"}),c=((m=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:m.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 A=l;if((j=this.options.extensions)!=null&&j.startInline){let T=1/0,M=l.slice(1),z;this.options.extensions.startInline.forEach(G=>{z=G.call({lexer:this},M),typeof z=="number"&&z>=0&&(T=Math.min(T,z))}),T<1/0&&T>=0&&(A=l.substring(0,T+1))}if(v=this.tokenizer.inlineText(A)){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)}},xf=class{constructor(s){It(this,"options");It(this,"parser");this.options=s||lr}space(s){return""}code({text:s,lang:l,escaped:r}){var d;let c=(d=(l||"").match(cl.notSpaceStart))==null?void 0:d[0],o=s.replace(cl.endingNewline,"")+`
|
|
96
|
+
`;return c?'<pre><code class="language-'+Bs(c)+'">'+(r?o:Bs(o,!0))+`</code></pre>
|
|
97
|
+
`:"<pre><code>"+(r?o:Bs(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>${Bs(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=Lb(s);if(o===null)return c;s=o;let d='<a href="'+s+'"';return l&&(d+=' title="'+Bs(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=Lb(s);if(o===null)return Bs(r);s=o;let d=`<img src="${s}" alt="${Bs(r)}"`;return l&&(d+=` title="${Bs(l)}"`),d+=">",d}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Bs(s.text)}},hp=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}},vs=class Kh{constructor(l){It(this,"options");It(this,"renderer");It(this,"textRenderer");this.options=l||lr,this.options.renderer=this.options.renderer||new xf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hp}static parse(l,r){return new Kh(r).parse(l)}static parseInline(l,r){return new Kh(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 m=h,x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(m.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 m='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}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 m=p;switch(m.type){case"escape":{c+=r.text(m);break}case"html":{c+=r.html(m);break}case"link":{c+=r.link(m);break}case"image":{c+=r.image(m);break}case"checkbox":{c+=r.checkbox(m);break}case"strong":{c+=r.strong(m);break}case"em":{c+=r.em(m);break}case"codespan":{c+=r.codespan(m);break}case"br":{c+=r.br(m);break}case"del":{c+=r.del(m);break}case"text":{c+=r.text(m);break}default:{let x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},uf,mo=(uf=class{constructor(s){It(this,"options");It(this,"block");this.options=s||lr}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?_s.lex:_s.lexInline}provideParser(s=this.block){return s?vs.parse:vs.parseInline}},It(uf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),It(uf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),uf),Lv=class{constructor(...s){It(this,"defaults",ap());It(this,"options",this.setOptions);It(this,"parse",this.parseMarkdown(!0));It(this,"parseInline",this.parseMarkdown(!1));It(this,"Parser",vs);It(this,"Renderer",xf);It(this,"TextRenderer",hp);It(this,"Lexer",_s);It(this,"Tokenizer",bf);It(this,"Hooks",mo);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 m of p)r=r.concat(this.walkTokens(m.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 m=h[p].flat(1/0);r=r.concat(this.walkTokens(m,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 xf(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],m=o[h];o[h]=(...x)=>{let _=p.apply(o,x);return _===!1&&(_=m.apply(o,x)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new bf(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],m=o[h];o[h]=(...x)=>{let _=p.apply(o,x);return _===!1&&(_=m.apply(o,x)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new mo;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],m=o[h];mo.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&mo.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await p.call(o,x);return m.call(o,j)})();let _=p.call(o,x);return m.call(o,_)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await p.apply(o,x);return j===!1&&(j=await m.apply(o,x)),j})();let _=p.apply(o,x);return _===!1&&(_=m.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 _s.lex(s,l??this.defaults)}parser(s,l){return vs.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?_s.lex:_s.lexInline)(h,o),m=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(m,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(s):s?vs.parse:vs.parseInline)(m,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?_s.lex:_s.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?vs.parse:vs.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>"+Bs(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},nr=new Lv;function Tt(s,l){return nr.parse(s,l)}Tt.options=Tt.setOptions=function(s){return nr.setOptions(s),Tt.defaults=nr.defaults,iy(Tt.defaults),Tt};Tt.getDefaults=ap;Tt.defaults=lr;Tt.use=function(...s){return nr.use(...s),Tt.defaults=nr.defaults,iy(Tt.defaults),Tt};Tt.walkTokens=function(s,l){return nr.walkTokens(s,l)};Tt.parseInline=nr.parseInline;Tt.Parser=vs;Tt.parser=vs.parse;Tt.Renderer=xf;Tt.TextRenderer=hp;Tt.Lexer=_s;Tt.lexer=_s.lex;Tt.Tokenizer=bf;Tt.Hooks=mo;Tt.parse=Tt;Tt.options;Tt.setOptions;Tt.use;Tt.walkTokens;Tt.parseInline;vs.parse;_s.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 Bb(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 zv(s){if(Array.isArray(s))return s}function Uv(s,l){var r=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(r!=null){var c,o,d,h,p=[],m=!0,x=!1;try{if(d=(r=r.call(s)).next,l!==0)for(;!(m=(c=d.call(r)).done)&&(p.push(c.value),p.length!==l);m=!0);}catch(_){x=!0,o=_}finally{try{if(!m&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function Hv(){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 Bv(s,l){return zv(s)||Uv(s,l)||Iv(s,l)||Hv()}function Iv(s,l){if(s){if(typeof s=="string")return Bb(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)?Bb(s,l):void 0}}const gy=Object.entries,Ib=Object.setPrototypeOf,qv=Object.isFrozen,Gv=Object.getPrototypeOf,Yv=Object.getOwnPropertyDescriptor;let Pn=Object.freeze,el=Object.seal,$r=Object.create,by=typeof Reflect<"u"&&Reflect,Zh=by.apply,Fh=by.construct;Pn||(Pn=function(l){return l});el||(el=function(l){return l});Zh||(Zh=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)});Fh||(Fh=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 Gr=Un(Array.prototype.forEach),Xv=Un(Array.prototype.lastIndexOf),qb=Un(Array.prototype.pop),Yr=Un(Array.prototype.push),Vv=Un(Array.prototype.splice),ci=Array.isArray,go=Un(String.prototype.toLowerCase),kh=Un(String.prototype.toString),Gb=Un(String.prototype.match),ro=Un(String.prototype.replace),Yb=Un(String.prototype.indexOf),$v=Un(String.prototype.trim),Qv=Un(Number.prototype.toString),Kv=Un(Boolean.prototype.toString),Xb=typeof BigInt>"u"?null:Un(BigInt.prototype.toString),Vb=typeof Symbol>"u"?null:Un(Symbol.prototype.toString),$n=Un(Object.prototype.hasOwnProperty),co=Un(Object.prototype.toString),Vn=Un(RegExp.prototype.test),Gi=Zv(TypeError);function Un(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 Zh(s,l,c)}}function Zv(s){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return Fh(s,r)}}function pt(s,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:go;if(Ib&&Ib(s,null),!ci(l))return s;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&(qv(l)||(l[c]=d),o=d)}s[o]=!0}return s}function Fv(s){for(let l=0;l<s.length;l++)$n(s,l)||(s[l]=null);return s}function ml(s){const l=$r(null);for(const c of gy(s)){var r=Bv(c,2);const o=r[0],d=r[1];$n(s,o)&&(ci(d)?l[o]=Fv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=ml(d):l[o]=d)}return l}function Jv(s){switch(typeof s){case"string":return s;case"number":return Qv(s);case"boolean":return Kv(s);case"bigint":return Xb?Xb(s):"0";case"symbol":return Vb?Vb(s):"Symbol()";case"undefined":return co(s);case"function":case"object":{if(s===null)return co(s);const l=s,r=Is(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:co(c)}return co(s)}default:return co(s)}}function Is(s,l){for(;s!==null;){const c=Yv(s,l);if(c){if(c.get)return Un(c.get);if(typeof c.value=="function")return Un(c.value)}s=Gv(s)}function r(){return null}return r}function Wv(s){try{return Vn(s,""),!0}catch{return!1}}const $b=Pn(["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"]),Nh=Pn(["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"]),Th=Pn(["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"]),Pv=Pn(["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"]),Eh=Pn(["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"]),e1=Pn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qb=Pn(["#text"]),Kb=Pn(["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"]),Ah=Pn(["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"]),Zb=Pn(["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"]),$u=Pn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),t1=el(/{{[\w\W]*|^[\w\W]*}}/g),n1=el(/<%[\w\W]*|^[\w\W]*%>/g),l1=el(/\${[\w\W]*/g),s1=el(/^data-[\-\w.\u00B7-\uFFFF]+$/),a1=el(/^aria-[\-\w]+$/),Fb=el(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),i1=el(/^(?:\w+script|data):/i),r1=el(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),c1=el(/^html$/i),o1=el(/^[a-z][.\w]*(-[.\w]+)+$/i),Jb=el(/<[/\w!]/g),Wb=el(/<[/\w]/g),u1=el(/<\/no(script|embed|frames)/i),f1=el(/\/>/i),$l={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},d1=function(){return typeof window>"u"?null:window},h1=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}},Pb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},li=function(l,r,c,o){return $n(l,r)&&ci(l[r])?pt(o.base?ml(o.base):{},l[r],o.transform):c};function xy(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d1();const l=de=>xy(de);if(l.version="3.4.12",l.removed=[],!s||!s.document||s.document.nodeType!==$l.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,m=s.NodeFilter,x=s.NamedNodeMap;x===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const _=s.DOMParser,j=s.trustedTypes,v=p.prototype,A=Is(v,"cloneNode"),T=Is(v,"remove"),M=Is(v,"nextSibling"),z=Is(v,"childNodes"),G=Is(v,"parentNode"),Q=Is(v,"shadowRoot"),Y=Is(v,"attributes"),D=h&&h.prototype?Is(h.prototype,"nodeType"):null,K=h&&h.prototype?Is(h.prototype,"nodeName"):null;if(typeof d=="function"){const de=r.createElement("template");de.content&&de.content.ownerDocument&&(r=de.content.ownerDocument)}let H,C="",Z,ae=!1,be=0;const W=function(){if(be>0)throw Gi('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){W(),be++;try{return H.createHTML(k)}finally{be--}},Se=function(k){W(),be++;try{return H.createScriptURL(k)}finally{be--}},Re=function(){return ae||(Z=h1(j,o),ae=!0),Z},Ce=r,E=Ce.implementation,re=Ce.createNodeIterator,O=Ce.createDocumentFragment,ge=Ce.getElementsByTagName,xe=c.importNode;let N=Pb();l.isSupported=typeof gy=="function"&&typeof G=="function"&&E&&E.createHTMLDocument!==void 0;const X=t1,ie=n1,he=l1,ke=s1,ve=a1,De=i1,vt=r1,Xe=o1;let Ve=Fb,$e=null;const tn=pt({},[...$b,...Nh,...Th,...Eh,...Qb]);let it=null;const dn=pt({},[...Kb,...Ah,...Zb,...$u]);let ut=Object.seal($r(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}})),hn=null,En=null;const Sn=Object.seal($r(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,nt=!0,Pe=!1,ln=!0,Kt=!1,lt=!0,Et=!1,Zt=!1,on=null,At=null,jn=!1,$t=!1,pn=!1,Hn=!1,Qt=!0,rt=!1;const Ot="user-content-";let We=!0,gl=!1,ee={},pe=null;const He=pt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let U=null;const J=pt({},["audio","video","img","source","image","track"]);let ye=null;const Ge=pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",bl="http://www.w3.org/2000/svg",Qn="http://www.w3.org/1999/xhtml";let tl=Qn,nl=!1,Ql=null;const In=pt({},[ft,bl,Qn],kh),Kl=Pn(["mi","mo","mn","ms","mtext"]);let Ct=pt({},Kl);const ll=Pn(["annotation-xml"]);let mn=pt({},ll);const qt=pt({},["title","style","font","a","script"]);let xl=null;const Gt=["application/xhtml+xml","text/html"],Lt="text/html";let Ee=null,un=null;const gt=r.createElement("form"),rs=function(k){return k instanceof RegExp||k instanceof Function},An=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(un&&un===k)return;(!k||typeof k!="object")&&(k={}),k=ml(k),xl=Gt.indexOf(k.PARSER_MEDIA_TYPE)===-1?Lt:k.PARSER_MEDIA_TYPE,Ee=xl==="application/xhtml+xml"?kh:go,$e=li(k,"ALLOWED_TAGS",tn,{transform:Ee}),it=li(k,"ALLOWED_ATTR",dn,{transform:Ee}),Ql=li(k,"ALLOWED_NAMESPACES",In,{transform:kh}),ye=li(k,"ADD_URI_SAFE_ATTR",Ge,{transform:Ee,base:Ge}),U=li(k,"ADD_DATA_URI_TAGS",J,{transform:Ee,base:J}),pe=li(k,"FORBID_CONTENTS",He,{transform:Ee}),hn=li(k,"FORBID_TAGS",ml({}),{transform:Ee}),En=li(k,"FORBID_ATTR",ml({}),{transform:Ee}),ee=$n(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?ml(k.USE_PROFILES):k.USE_PROFILES:!1,nn=k.ALLOW_ARIA_ATTR!==!1,nt=k.ALLOW_DATA_ATTR!==!1,Pe=k.ALLOW_UNKNOWN_PROTOCOLS||!1,ln=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Kt=k.SAFE_FOR_TEMPLATES||!1,lt=k.SAFE_FOR_XML!==!1,Et=k.WHOLE_DOCUMENT||!1,$t=k.RETURN_DOM||!1,pn=k.RETURN_DOM_FRAGMENT||!1,Hn=k.RETURN_TRUSTED_TYPE||!1,jn=k.FORCE_BODY||!1,Qt=k.SANITIZE_DOM!==!1,rt=k.SANITIZE_NAMED_PROPS||!1,We=k.KEEP_CONTENT!==!1,gl=k.IN_PLACE||!1,Ve=Wv(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:Fb,tl=typeof k.NAMESPACE=="string"?k.NAMESPACE:Qn,Ct=$n(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?ml(k.MATHML_TEXT_INTEGRATION_POINTS):pt({},Kl),mn=$n(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?ml(k.HTML_INTEGRATION_POINTS):pt({},ll);const q=$n(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?ml(k.CUSTOM_ELEMENT_HANDLING):$r(null);if(ut=$r(null),$n(q,"tagNameCheck")&&rs(q.tagNameCheck)&&(ut.tagNameCheck=q.tagNameCheck),$n(q,"attributeNameCheck")&&rs(q.attributeNameCheck)&&(ut.attributeNameCheck=q.attributeNameCheck),$n(q,"allowCustomizedBuiltInElements")&&typeof q.allowCustomizedBuiltInElements=="boolean"&&(ut.allowCustomizedBuiltInElements=q.allowCustomizedBuiltInElements),el(ut),Kt&&(nt=!1),pn&&($t=!0),ee&&($e=pt({},Qb),it=$r(null),ee.html===!0&&(pt($e,$b),pt(it,Kb)),ee.svg===!0&&(pt($e,Nh),pt(it,Ah),pt(it,$u)),ee.svgFilters===!0&&(pt($e,Th),pt(it,Ah),pt(it,$u)),ee.mathMl===!0&&(pt($e,Eh),pt(it,Zb),pt(it,$u))),Sn.tagCheck=null,Sn.attributeCheck=null,$n(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?Sn.tagCheck=k.ADD_TAGS:ci(k.ADD_TAGS)&&($e===tn&&($e=ml($e)),pt($e,k.ADD_TAGS,Ee))),$n(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?Sn.attributeCheck=k.ADD_ATTR:ci(k.ADD_ATTR)&&(it===dn&&(it=ml(it)),pt(it,k.ADD_ATTR,Ee))),$n(k,"ADD_URI_SAFE_ATTR")&&ci(k.ADD_URI_SAFE_ATTR)&&pt(ye,k.ADD_URI_SAFE_ATTR,Ee),$n(k,"FORBID_CONTENTS")&&ci(k.FORBID_CONTENTS)&&(pe===He&&(pe=ml(pe)),pt(pe,k.FORBID_CONTENTS,Ee)),$n(k,"ADD_FORBID_CONTENTS")&&ci(k.ADD_FORBID_CONTENTS)&&(pe===He&&(pe=ml(pe)),pt(pe,k.ADD_FORBID_CONTENTS,Ee)),We&&($e["#text"]=!0),Et&&pt($e,["html","head","body"]),$e.table&&(pt($e,["tbody"]),delete hn.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const oe=H;H=k.TRUSTED_TYPES_POLICY;try{C=ue("")}catch(Ae){throw H=oe,Ae}}else k.TRUSTED_TYPES_POLICY===null?(H=void 0,C=""):(H===void 0&&(H=Re()),H&&typeof C=="string"&&(C=ue("")));Pn&&Pn(k),un=k},yl=pt({},[...Nh,...Th,...Pv]),Kn=pt({},[...Eh,...e1]),sl=function(k,q,oe){return q.namespaceURI===Qn?k==="svg":q.namespaceURI===ft?k==="svg"&&(oe==="annotation-xml"||Ct[oe]):!!yl[k]},qn=function(k,q,oe){return q.namespaceURI===Qn?k==="math":q.namespaceURI===bl?k==="math"&&mn[oe]:!!Kn[k]},bt=function(k,q,oe){return q.namespaceURI===bl&&!mn[oe]||q.namespaceURI===ft&&!Ct[oe]?!1:!Kn[k]&&(qt[k]||!yl[k])},Cn=function(k){let q=G(k);(!q||!q.tagName)&&(q={namespaceURI:tl,tagName:"template"});const oe=go(k.tagName),Ae=go(q.tagName);return Ql[k.namespaceURI]?k.namespaceURI===bl?sl(oe,q,Ae):k.namespaceURI===ft?qn(oe,q,Ae):k.namespaceURI===Qn?bt(oe,q,Ae):!!(xl==="application/xhtml+xml"&&Ql[k.namespaceURI]):!1},gn=function(k){Yr(l.removed,{element:k});try{G(k).removeChild(k)}catch{if(T(k),!G(k))throw Gi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rt=function(k){fl(k);const q=z(k);if(q){const Ae=[];Gr(q,ze=>{Yr(Ae,ze)}),Gr(Ae,ze=>{try{T(ze)}catch{}})}const oe=Y(k);if(oe)for(let Ae=oe.length-1;Ae>=0;--Ae){const ze=oe[Ae],Le=ze&&ze.name;if(typeof Le=="string")try{k.removeAttribute(Le)}catch{}}},ul=function(k,q){try{Yr(l.removed,{attribute:q.getAttributeNode(k),from:q})}catch{Yr(l.removed,{attribute:null,from:q})}if(q.removeAttribute(k),k==="is")if($t||pn)try{gn(q)}catch{}else try{q.setAttribute(k,"")}catch{}},_a=function(k){const q=Y(k);if(q)for(let oe=q.length-1;oe>=0;--oe){const Ae=q[oe],ze=Ae&&Ae.name;if(!(typeof ze!="string"||it[Ee(ze)]))try{k.removeAttribute(ze)}catch{}}},fl=function(k){const q=[k];for(;q.length>0;){const oe=q.pop();(D?D(oe):oe.nodeType)===$l.element&&_a(oe);const ze=z(oe);if(ze)for(let Le=ze.length-1;Le>=0;--Le)q.push(ze[Le])}},Zl=function(k){if(!lt)return;const q=[k];for(;q.length>0;){const oe=q.pop(),Ae=D?D(oe):oe.nodeType;if(Ae===$l.processingInstruction||Ae===$l.comment&&Vn(Wb,oe.data)){try{T(oe)}catch{}continue}if(Ae===$l.element){const Le=oe,kt=Ee(K?K(oe):oe.nodeName);try{Le.hasAttribute&&Le.hasAttribute("patchsrc")&&Le.removeAttribute("patchsrc"),Le.hasAttribute&&Le.hasAttribute("for")&&kt!=="label"&&kt!=="output"&&Le.removeAttribute("for")}catch{}}const ze=z(oe);if(ze)for(let Le=ze.length-1;Le>=0;--Le)q.push(ze[Le])}},va=function(k){let q=null,oe=null;if(jn)k="<remove></remove>"+k;else{const Le=Gb(k,/^[\r\n\t ]+/);oe=Le&&Le[0]}xl==="application/xhtml+xml"&&tl===Qn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Ae=H?ue(k):k;if(tl===Qn)try{q=new _().parseFromString(Ae,xl)}catch{}if(!q||!q.documentElement){q=E.createDocument(tl,"template",null);try{q.documentElement.innerHTML=nl?C:Ae}catch{}}const ze=q.body||q.documentElement;return k&&oe&&ze.insertBefore(r.createTextNode(oe),ze.childNodes[0]||null),tl===Qn?ge.call(q,Et?"html":"body")[0]:Et?q.documentElement:ze},$s=function(k){return re.call(k.ownerDocument||k,k,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},_l=function(k){return k=ro(k,X," "),k=ro(k,ie," "),k=ro(k,he," "),k},Qs=function(k){var q;k.normalize();const oe=re.call(k.ownerDocument||k,k,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ae=oe.nextNode();for(;Ae;)Ae.data=_l(Ae.data),Ae=oe.nextNode();const ze=(q=k.querySelectorAll)===null||q===void 0?void 0:q.call(k,"template");ze&&Gr(ze,Le=>{Zn(Le.content)&&Qs(Le.content)})},al=function(k){const q=K?K(k):null;return typeof q!="string"||Ee(q)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==Y(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==D(k)||k.childNodes!==z(k)},Zn=function(k){if(!D||typeof k!="object"||k===null)return!1;try{return D(k)===$l.documentFragment}catch{return!1}},bn=function(k){if(!D||typeof k!="object"||k===null)return!1;try{return typeof D(k)=="number"}catch{return!1}};function et(de,k,q){de.length!==0&&Gr(de,oe=>{oe.call(l,k,q,un)})}const vl=function(k,q){return!!(lt&&k.hasChildNodes()&&!bn(k.firstElementChild)&&Vn(Jb,k.textContent)&&Vn(Jb,k.innerHTML)||lt&&k.namespaceURI===Qn&&q==="style"&&bn(k.firstElementChild)||k.nodeType===$l.processingInstruction||lt&&k.nodeType===$l.comment&&Vn(Wb,k.data))},Ul=function(k,q){if(!hn[q]&&wl(q)&&(ut.tagNameCheck instanceof RegExp&&Vn(ut.tagNameCheck,q)||ut.tagNameCheck instanceof Function&&ut.tagNameCheck(q)))return!1;if(We&&!pe[q]){const oe=G(k),Ae=z(k);if(Ae&&oe){const ze=Ae.length;for(let Le=ze-1;Le>=0;--Le){const kt=gl?Ae[Le]:A(Ae[Le],!0);oe.insertBefore(kt,M(k))}}}return gn(k),!0},Sl=function(k,q){if(et(N.beforeSanitizeElements,k,null),k!==q&&G(k)===null)return!0;if(al(k))return gn(k),!0;const oe=Ee(K?K(k):k.nodeName);if(et(N.uponSanitizeElement,k,{tagName:oe,allowedTags:$e}),k!==q&&G(k)===null)return!0;if(vl(k,oe))return gn(k),!0;if(hn[oe]||!(Sn.tagCheck instanceof Function&&Sn.tagCheck(oe))&&!$e[oe]){const ze=Ul(k,oe);return ze===!1&&et(N.afterSanitizeElements,k,null),ze}if((D?D(k):k.nodeType)===$l.element&&!Cn(k)||(oe==="noscript"||oe==="noembed"||oe==="noframes")&&Vn(u1,k.innerHTML))return gn(k),!0;if(Kt&&k.nodeType===$l.text){const ze=_l(k.textContent);k.textContent!==ze&&(Yr(l.removed,{element:k.cloneNode()}),k.textContent=ze)}return et(N.afterSanitizeElements,k,null),!1},wn=function(k,q,oe){if(En[q]||lt&&q==="patchsrc"||lt&&q==="for"&&k!=="label"&&k!=="output"||Qt&&(q==="id"||q==="name")&&(oe in r||oe in gt))return!1;const Ae=it[q]||Sn.attributeCheck instanceof Function&&Sn.attributeCheck(q,k);if(!(nt&&Vn(ke,q))){if(!(nn&&Vn(ve,q))){if(Ae){if(!ye[q]){if(!Vn(Ve,ro(oe,vt,""))){if(!((q==="src"||q==="xlink:href"||q==="href")&&k!=="script"&&Yb(oe,"data:")===0&&U[k])){if(!(Pe&&!Vn(De,ro(oe,vt,"")))){if(oe)return!1}}}}}else if(!(wl(k)&&(ut.tagNameCheck instanceof RegExp&&Vn(ut.tagNameCheck,k)||ut.tagNameCheck instanceof Function&&ut.tagNameCheck(k))&&(ut.attributeNameCheck instanceof RegExp&&Vn(ut.attributeNameCheck,q)||ut.attributeNameCheck instanceof Function&&ut.attributeNameCheck(q,k))||q==="is"&&ut.allowCustomizedBuiltInElements&&(ut.tagNameCheck instanceof RegExp&&Vn(ut.tagNameCheck,oe)||ut.tagNameCheck instanceof Function&&ut.tagNameCheck(oe))))return!1}}return!0},jl=pt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),wl=function(k){return!jl[go(k)]&&Vn(Xe,k)},zt=function(k,q,oe,Ae){if(H&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!oe)switch(j.getAttributeType(k,q)){case"TrustedHTML":return ue(Ae);case"TrustedScriptURL":return Se(Ae)}return Ae},Yt=function(k,q,oe,Ae){try{oe?k.setAttributeNS(oe,q,Ae):k.setAttribute(q,Ae),al(k)?gn(k):qb(l.removed)}catch{ul(q,k)}},dl=function(k){et(N.beforeSanitizeAttributes,k,null);const q=k.attributes;if(!q||al(k))return;const oe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:it,forceKeepAttr:void 0};let Ae=q.length;const ze=Ee(k.nodeName);for(;Ae--;){const Le=q[Ae],kt=Le.name,w=Le.namespaceURI,le=Le.value,je=Ee(kt),Ze=le;let St=kt==="value"?Ze:$v(Ze);if(oe.attrName=je,oe.attrValue=St,oe.keepAttr=!0,oe.forceKeepAttr=void 0,et(N.uponSanitizeAttribute,k,oe),St=oe.attrValue,rt&&(je==="id"||je==="name")&&Yb(St,Ot)!==0&&(ul(kt,k),St=Ot+St),lt&&Vn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,St)){ul(kt,k);continue}if(je==="attributename"&&Gb(St,"href")){ul(kt,k);continue}if(!oe.forceKeepAttr){if(!oe.keepAttr){ul(kt,k);continue}if(!ln&&Vn(f1,St)){ul(kt,k);continue}if(Kt&&(St=_l(St)),!wn(ze,je,St)){ul(kt,k);continue}St=zt(ze,je,w,St),St!==Ze&&Yt(k,kt,w,St)}}et(N.afterSanitizeAttributes,k,null)},Ft=function(k){let q=null;const oe=$s(k);for(et(N.beforeSanitizeShadowDOM,k,null);q=oe.nextNode();)if(et(N.uponSanitizeShadowNode,q,null),Sl(q,k),dl(q),Zn(q.content)&&Ft(q.content),(D?D(q):q.nodeType)===$l.element){const ze=Q(q);Zn(ze)&&(kn(ze),Ft(ze))}et(N.afterSanitizeShadowDOM,k,null)},kn=function(k){const q=[{node:k,shadow:null}];for(;q.length>0;){const oe=q.pop();if(oe.shadow){Ft(oe.shadow);continue}const Ae=oe.node,Le=(D?D(Ae):Ae.nodeType)===$l.element,kt=z(Ae);if(kt)for(let w=kt.length-1;w>=0;--w)q.push({node:kt[w],shadow:null});if(Le){const w=K?K(Ae):null;if(typeof w=="string"&&Ee(w)==="template"){const le=Ae.content;Zn(le)&&q.push({node:le,shadow:null})}}if(Le){const w=Q(Ae);Zn(w)&&q.push({node:null,shadow:w},{node:w,shadow:null})}}};return l.sanitize=function(de){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=null,oe=null,Ae=null,ze=null;if(nl=!de,nl&&(de="<!-->"),typeof de!="string"&&!bn(de)&&(de=Jv(de),typeof de!="string"))throw Gi("dirty is not a string, aborting");if(!l.isSupported)return de;Zt?($e=on,it=At):An(k),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&($e=ml($e)),N.uponSanitizeAttribute.length>0&&(it=ml(it)),l.removed=[];const Le=gl&&typeof de!="string"&&bn(de);if(Le){Zl(de);const je=K?K(de):de.nodeName;if(typeof je=="string"){const Ze=Ee(je);if(!$e[Ze]||hn[Ze])throw Rt(de),Gi("root node is forbidden and cannot be sanitized in-place")}if(al(de))throw Rt(de),Gi("root node is clobbered and cannot be sanitized in-place");try{kn(de)}catch(Ze){throw Rt(de),Ze}}else if(bn(de))q=va("<!---->"),oe=q.ownerDocument.importNode(de,!0),oe.nodeType===$l.element&&oe.nodeName==="BODY"||oe.nodeName==="HTML"?q=oe:q.appendChild(oe),kn(oe);else{if(!$t&&!Kt&&!Et&&de.indexOf("<")===-1)return H&&Hn?ue(de):de;if(q=va(de),!q)return $t?null:Hn?C:""}q&&jn&&gn(q.firstChild);const kt=Le?de:q,w=$s(kt);try{for(;Ae=w.nextNode();)Sl(Ae,kt),dl(Ae),Zn(Ae.content)&&Ft(Ae.content)}catch(je){throw Le&&(Rt(de),Gr(l.removed,Ze=>{Ze.element&&fl(Ze.element)})),je}if(Le)return Gr(l.removed,je=>{je.element&&fl(je.element)}),Kt&&Qs(de),de;if($t){if(Kt&&Qs(q),pn)for(ze=O.call(q.ownerDocument);q.firstChild;)ze.appendChild(q.firstChild);else ze=q;return(it.shadowroot||it.shadowrootmode)&&(ze=xe.call(c,ze,!0)),ze}let le=Et?q.outerHTML:q.innerHTML;return Et&&$e["!doctype"]&&q.ownerDocument&&q.ownerDocument.doctype&&q.ownerDocument.doctype.name&&Vn(c1,q.ownerDocument.doctype.name)&&(le="<!DOCTYPE "+q.ownerDocument.doctype.name+`>
|
|
116
|
+
`+le),Kt&&(le=_l(le)),H&&Hn?ue(le):le},l.setConfig=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};An(de),Zt=!0,on=$e,At=it},l.clearConfig=function(){un=null,Zt=!1,on=null,At=null,H=Z,C=""},l.isValidAttribute=function(de,k,q){un||An({});const oe=Ee(de),Ae=Ee(k);return wn(oe,Ae,q)},l.addHook=function(de,k){typeof k=="function"&&$n(N,de)&&Yr(N[de],k)},l.removeHook=function(de,k){if($n(N,de)){if(k!==void 0){const q=Xv(N[de],k);return q===-1?void 0:Vv(N[de],q,1)[0]}return qb(N[de])}},l.removeHooks=function(de){$n(N,de)&&(N[de]=[])},l.removeAllHooks=function(){N=Pb()},l}var p1=xy();const m1=1024;let g1=0;class is{constructor(l,r){this.from=l,this.to=r}}class en{constructor(l={}){this.id=g1++,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=js.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}en.closedBy=new en({deserialize:s=>s.split(" ")});en.openedBy=new en({deserialize:s=>s.split(" ")});en.group=new en({deserialize:s=>s.split(" ")});en.isolate=new en({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});en.contextHash=new en({perNode:!0});en.lookAhead=new en({perNode:!0});en.mounted=new en({perNode:!0});class Fr{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[en.mounted.id]}}const b1=Object.create(null);class js{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):b1,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new js(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(en.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(en.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}js.none=new js("",Object.create(null),0,8);class yy{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],m=h[0];m.combine&&m.id in o&&(p=m.combine(o[m.id],p)),o[m.id]=p}}r.push(o?new js(c.name,o,c.id,c.flags):c)}return new yy(r)}}const Qu=new WeakMap,ex=new WeakMap;var Wt;(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"})(Wt||(Wt={}));class zl{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=Fr.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 yf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=Qu.get(this)||this.topNode,d=new yf(o);return d.moveTo(l,r),Qu.set(this,d._tree),d}get topNode(){return new ol(this,0,0,null)}resolve(l,r=0){let c=yo(Qu.get(this)||this.topNode,l,r,!1);return Qu.set(this,c),c}resolveInner(l,r=0){let c=yo(ex.get(this)||this.topNode,l,r,!0);return ex.set(this,c),c}resolveStack(l,r=0){return _1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,p=(h&Wt.IncludeAnonymous)>0;for(let m=this.cursor(h|Wt.IncludeAnonymous);;){let x=!1;if(m.from<=d&&m.to>=o&&(!p&&m.type.isAnonymous||r(m)!==!1)){if(m.firstChild())continue;x=!0}for(;x&&c&&(p||!m.type.isAnonymous)&&c(m),!m.nextSibling();){if(!m.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:gp(js.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new zl(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new zl(js.none,r,c,o)))}static build(l){return v1(l)}}zl.empty=new zl(js.none,[],[],0);class pp{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 pp(this.buffer,this.index)}}class fi{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return js.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 m=l;m!=r&&!(_y(d,o,h[m+1],h[m+2])&&(p=m,c>0));m=h[m+3]);return p}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let p=l,m=0;p<r;){d[m++]=o[p++],d[m++]=o[p++]-c;let x=d[m++]=o[p++]-c;d[m++]=o[p++]-l,h=Math.max(h,x)}return new fi(d,h,this.set)}}function _y(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 yo(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 ol&&s.index<0?null:s.parent;if(!h)return s;s=h}let d=c?0:Wt.IgnoreOverlays;if(c)for(let h=s,p=h.parent;p;h=p,p=h.parent)h instanceof ol&&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 vy{cursor(l=0){return new yf(this,l)}getChild(l,r=null,c=null){let o=tx(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return tx(this,l,r,c)}resolve(l,r=0){return yo(this,l,r,!1)}resolveInner(l,r=0){return yo(this,l,r,!0)}matchContext(l){return Jh(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 ol extends vy{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:m}=h._tree,x=r>0?p.length:-1;l!=x;l+=r){let _=p[l],j=m[l]+h.from,v;if(!(!(d&Wt.EnterBracketed&&_ instanceof zl&&(v=Fr.get(_))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+_.length)&&!_y(o,c,j,j+_.length))){if(_ instanceof fi){if(d&Wt.ExcludeBuffers)continue;let A=_.findChild(0,_.buffer.length,r,c-j,o);if(A>-1)return new Vs(new x1(h,_,l,j),null,A)}else if(d&Wt.IncludeAnonymous||!_.type.isAnonymous||mp(_)){let A;if(!(d&Wt.IgnoreMounts)&&(A=Fr.get(_))&&!A.overlay)return new ol(A.tree,j,l,h);let T=new ol(_,j,l,h);return d&Wt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?_.children.length-1:0,r,c,o,d)}}}if(d&Wt.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&Wt.IgnoreOverlays)&&(o=Fr.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Wt.EnterBracketed&&o.bracketed;for(let{from:p,to:m}of o.overlay)if((r>0||h?p<=d:p<d)&&(r<0||h?m>=d:m>d))return new ol(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 tx(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 Jh(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 x1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class Vs extends vy{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 Vs(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&Wt.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 Vs(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 Vs(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 Vs(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 zl(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Sy(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 ol&&r.index<0?null:r.parent,o=s.slice();return c?o[l]=c:o.splice(l,1),new y1(o,r)}class y1{constructor(l,r){this.heads=l,this.node=r}get next(){return Sy(this.heads)}}function _1(s,l,r){let c=s.resolveInner(l,r),o=null;for(let d=c instanceof ol?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=Fr.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new ol(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(yo(p,l,r,!1))}}return o?Sy(o):c}class yf{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&~Wt.EnterBracketed,l instanceof ol)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 ol?(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&Wt.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Wt.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&Wt.IncludeAnonymous||p instanceof fi||!p.type.isAnonymous||mp(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 Vs(this.buffer,r,this.stack[o]);return this.bufferNode=new Vs(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 Jh(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 Jh(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 mp(s){return s.children.some(l=>l instanceof fi||!l.type.isAnonymous||mp(l))}function v1(s){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=m1,reused:d=[],minRepeatType:h=c.types.length}=s,p=Array.isArray(r)?new pp(r,r.length):r,m=c.types,x=0,_=0;function j(K,H,C,Z,ae,be){let{id:W,start:ue,end:Se,size:Re}=p,Ce=_,E=x;if(Re<0)if(p.next(),Re==-1){let N=d[W];C.push(N),Z.push(ue-K);return}else if(Re==-3){x=W;return}else if(Re==-4){_=W;return}else throw new RangeError(`Unrecognized record size: ${Re}`);let re=m[W],O,ge,xe=ue-K;if(Se-ue<=o&&(ge=z(p.pos-H,ae))){let N=new Uint16Array(ge.size-ge.skip),X=p.pos-ge.size,ie=N.length;for(;p.pos>X;)ie=G(ge.start,N,ie);O=new fi(N,Se-ge.start,c),xe=ge.start-K}else{let N=p.pos-Re;p.next();let X=[],ie=[],he=W>=h?W:-1,ke=0,ve=Se;for(;p.pos>N;)he>=0&&p.id==he&&p.size>=0?(p.end<=ve-o&&(T(X,ie,ue,ke,p.end,ve,he,Ce,E),ke=X.length,ve=p.end),p.next()):be>2500?v(ue,N,X,ie):j(ue,N,X,ie,he,be+1);if(he>=0&&ke>0&&ke<X.length&&T(X,ie,ue,ke,ue,ve,he,Ce,E),X.reverse(),ie.reverse(),he>-1&&ke>0){let De=A(re,E);O=gp(re,X,ie,0,X.length,0,Se-ue,De,De)}else O=M(re,X,ie,Se-ue,Ce-Se,E)}C.push(O),Z.push(xe)}function v(K,H,C,Z){let ae=[],be=0,W=-1;for(;p.pos>H;){let{id:ue,start:Se,end:Re,size:Ce}=p;if(Ce>4)p.next();else{if(W>-1&&Se<W)break;W<0&&(W=Re-o),ae.push(ue,Se,Re),be++,p.next()}}if(be){let ue=new Uint16Array(be*4),Se=ae[ae.length-2];for(let Re=ae.length-3,Ce=0;Re>=0;Re-=3)ue[Ce++]=ae[Re],ue[Ce++]=ae[Re+1]-Se,ue[Ce++]=ae[Re+2]-Se,ue[Ce++]=Ce;C.push(new fi(ue,ae[2]-Se,c)),Z.push(Se-K)}}function A(K,H){return(C,Z,ae)=>{let be=0,W=C.length-1,ue,Se;if(W>=0&&(ue=C[W])instanceof zl){if(!W&&ue.type==K&&ue.length==ae)return ue;(Se=ue.prop(en.lookAhead))&&(be=Z[W]+ue.length+Se)}return M(K,C,Z,ae,be,H)}}function T(K,H,C,Z,ae,be,W,ue,Se){let Re=[],Ce=[];for(;K.length>Z;)Re.push(K.pop()),Ce.push(H.pop()+C-ae);K.push(M(c.types[W],Re,Ce,be-ae,ue-be,Se)),H.push(ae-C)}function M(K,H,C,Z,ae,be,W){if(be){let ue=[en.contextHash,be];W=W?[ue].concat(W):[ue]}if(ae>25){let ue=[en.lookAhead,ae];W=W?[ue].concat(W):[ue]}return new zl(K,H,C,Z,W)}function z(K,H){let C=p.fork(),Z=0,ae=0,be=0,W=C.end-o,ue={size:0,start:0,skip:0};e:for(let Se=C.pos-K;C.pos>Se;){let Re=C.size;if(C.id==H&&Re>=0){ue.size=Z,ue.start=ae,ue.skip=be,be+=4,Z+=4,C.next();continue}let Ce=C.pos-Re;if(Re<0||Ce<Se||C.start<W)break;let E=C.id>=h?4:0,re=C.start;for(C.next();C.pos>Ce;){if(C.size<0)if(C.size==-3||C.size==-4)E+=4;else break e;else C.id>=h&&(E+=4);C.next()}ae=re,Z+=Re,be+=E}return(H<0||Z==K)&&(ue.size=Z,ue.start=ae,ue.skip=be),ue.size>4?ue:void 0}function G(K,H,C){let{id:Z,start:ae,end:be,size:W}=p;if(p.next(),W>=0&&Z<h){let ue=C;if(W>4){let Se=p.pos-(W-4);for(;p.pos>Se;)C=G(K,H,C)}H[--C]=ue,H[--C]=be-K,H[--C]=ae-K,H[--C]=Z}else W==-3?x=Z:W==-4&&(_=Z);return C}let Q=[],Y=[];for(;p.pos>0;)j(s.start||0,s.bufferStart||0,Q,Y,-1,0);let D=(l=s.length)!==null&&l!==void 0?l:Q.length?Y[0]+Q[0].length:0;return new zl(m[s.topID],Q.reverse(),Y.reverse(),D)}const nx=new WeakMap;function pf(s,l){if(!s.isAnonymous||l instanceof fi||l.type!=s)return 1;let r=nx.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=s||!(c instanceof zl)){r=1;break}r+=pf(s,c)}nx.set(l,r)}return r}function gp(s,l,r,c,o,d,h,p,m){let x=0;for(let T=c;T<o;T++)x+=pf(s,l[T]);let _=Math.ceil(x*1.5/8),j=[],v=[];function A(T,M,z,G,Q){for(let Y=z;Y<G;){let D=Y,K=M[Y],H=pf(s,T[Y]);for(Y++;Y<G;Y++){let C=pf(s,T[Y]);if(H+C>=_)break;H+=C}if(Y==D+1){if(H>_){let C=T[D];A(C.children,C.positions,0,C.children.length,M[D]+Q);continue}j.push(T[D])}else{let C=M[Y-1]+T[Y-1].length-K;j.push(gp(s,T,M,D,Y,K,C,null,m))}v.push(K+Q-d)}}return A(l,r,c,o,0),(p||m)(j,v,h)}class Fk{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 Vs?this.setBuffer(l.context.buffer,l.index,r):l instanceof ol&&this.map.set(l.tree,r)}get(l){return l instanceof Vs?this.getBuffer(l.context.buffer,l.index):l instanceof ol?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 _o{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 _o(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,m=0,x=0;;p++){let _=p<r.length?r[p]:null,j=_?_.fromA:1e9;if(j-m>=c)for(;h&&h.from<j;){let v=h;if(m>=v.from||j<=v.to||x){let A=Math.max(v.from,m)-x,T=Math.min(v.to,j)-x;v=A>=T?null:new _o(A,T,v.tree,v.offset+x,p>0,!!_)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!_)break;m=_.toA,x=_.toA-_.toB}return o}}class Jk{startParse(l,r,c){return typeof l=="string"&&(l=new S1(l)),c=c?c.length?c.map(o=>new is(o.from,o.to)):[new is(0,0)]:[new is(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 S1{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 Wk(s){return(l,r,c,o)=>new w1(l,s,r,c,o)}class lx{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 sx(s){if(!s.length||s.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class j1{constructor(l,r,c,o,d,h,p,m){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=p,this.prev=m,this.depth=0,this.ranges=[]}}const Wh=new en({perNode:!0});class w1{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 zl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Wh,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[en.mounted.id]=new Fr(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 T1(this.fragments),r=null,c=null,o=new yf(new ol(this.baseTree,this.ranges[0].from,0,null),Wt.IncludeAnonymous|Wt.IgnoreMounts);e:for(let d,h;;){let p=!0,m;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 j=_.from+x.pos,v=_.to+x.pos;j>=o.from&&v<=o.to&&!r.ranges.some(A=>A.from<v&&A.to>j)&&r.ranges.push({from:j,to:v})}}p=!1}else if(c&&(h=k1(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||(N1(o),r&&r.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new j1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=rx(this.ranges,d.overlay||(o.from<o.to?[new is(o.from,o.to)]:[]));_.length&&sx(_),(_.length||!d.overlay)&&this.inner.push(new lx(d.parser,_.length?d.parser.startParse(this.input,cx(x,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new is(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):p=!1}}else if(r&&(m=r.predicate(o))&&(m===!0&&(m=new is(o.from,o.to)),m.from<m.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==m.from?r.ranges[x]={from:r.ranges[x].from,to:m.to}:r.ranges.push(m)}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=rx(this.ranges,r.ranges);x.length&&(sx(x),this.inner.splice(r.index,0,new lx(r.parser,r.parser.startParse(this.input,cx(r.mounts,x),x),r.ranges.map(_=>new is(_.from-r.start,_.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function k1(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 ax(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 N1(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,m=[d];function x(_,j,v,A,T,M){let z=r[M],G=[],Q=[];ax(h,_,z,G,Q,A);let Y=p[z+1],D=p[z+2];m.push(G.length);let K=M?x(z+4,p[z+3],h.set.types[p[z]],Y,D-Y,M-1):l.toTree();return G.push(K),Q.push(Y-A),ax(h,p[z+3],j,G,Q,A),new zl(v,G,Q,T)}o.children[d]=x(0,p.length,js.none,0,h.length,r.length-1);for(let _ of m){let j=s.tree.children[_],v=s.tree.positions[_];s.yield(new ol(j,v+s.from,_,s._tree))}}class ix{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(Wt.IncludeAnonymous|Wt.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,Wt.IgnoreOverlays|Wt.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 zl)r=r.children[0];else break}return!1}}class T1{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(Wh))!==null&&r!==void 0?r:c.to,this.inner=new ix(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(Wh))!==null&&l!==void 0?l:r.to,this.inner=new ix(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(en.mounted);if(h&&h.parser==r)for(let p=this.fragI;p<this.fragments.length;p++){let m=this.fragments[p];if(m.from>=d.to)break;m.tree==this.curFrag.tree&&o.push({frag:m,pos:d.from-m.offset,mount:h})}}}return o}}function rx(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 m=c[d];if(m.from>=p)break;m.to<=h||(r||(c=r=l.slice()),m.from<h?(r[d]=new is(m.from,h),m.to>p&&r.splice(d+1,0,new is(p,m.to))):m.to>p?r[d--]=new is(p,m.to):r.splice(d--,1))}}return c}function E1(s,l,r,c){let o=0,d=0,h=!1,p=!1,m=-1e9,x=[];for(;;){let _=o==s.length?1e9:h?s[o].to:s[o].from,j=d==l.length?1e9:p?l[d].to:l[d].from;if(h!=p){let v=Math.max(m,r),A=Math.min(_,j,c);v<A&&x.push(new is(v,A))}if(m=Math.min(_,j),m==1e9)break;_==m&&(h?(h=!1,o++):h=!0),j==m&&(p?(p=!1,d++):p=!0)}return x}function cx(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,m=Math.max(d.from,h),x=Math.min(d.to,p);if(o.overlay){let _=o.overlay.map(v=>new is(v.from+c,v.to+c)),j=E1(l,_,m,x);for(let v=0,A=m;;v++){let T=v==j.length,M=T?x:j[v].from;if(M>A&&r.push(new _o(A,M,o.tree,-h,d.from>=A||d.openStart,d.to<=M||d.openEnd)),T)break;A=j[v].to}}else r.push(new _o(m,x,o.tree,-h,d.from>=h||d.openStart,d.to<=p||d.openEnd))}return r}let A1=0;class as{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=A1++}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 as&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new as(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 _f(l);return c=>c.modified.indexOf(r)>-1?c:_f.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let C1=0;class _f{constructor(l){this.name=l,this.instances=[],this.id=C1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(p=>p.base==l&&R1(r,p.modified));if(c)return c;let o=[],d=new as(l.name,o,l,r);for(let p of r)p.instances.push(d);let h=M1(r);for(let p of l.set)if(!p.modified.length)for(let m of h)o.push(_f.get(p,m));return d}}function R1(s,l){return s.length==l.length&&s.every((r,c)=>r==l[c])}function M1(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 Pk(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 j=0;;){if(p=="..."&&j>0&&j+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]),j+=v[0].length,j==o.length)break;let A=o[j++];if(j==o.length&&A=="!"){h=0;break}if(A!="/")throw new RangeError("Invalid path: "+o);p=o.slice(j)}let m=d.length-1,x=d[m];if(!x)throw new RangeError("Invalid path: "+o);let _=new vo(c,h,m>0?d.slice(0,m):null);l[x]=_.sort(l[x])}}return jy.add(l)}const jy=new en({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 vo(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class vo{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}}vo.empty=new vo([],2,null);function wy(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 m of p.set){let x=r[m.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function D1(s,l){let r=null;for(let c of s){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function O1(s,l,r,c=0,o=s.length){let d=new z1(c,Array.isArray(l)?l:[l],r);d.highlightRange(s.cursor(),c,o,"",d.highlighters),d.flush(o)}function L1(s,l,r,c,o,d=0,h=s.length){let p=d;function m(x,_){if(!(x<=p)){for(let j=s.slice(p,x),v=0;;){let A=j.indexOf(`
|
|
117
|
+
`,v),T=A<0?j.length:A;if(T>v&&c(j.slice(v,T),_),A<0)break;o(),v=A+1}p=x}}O1(l,r,(x,_,j)=>{m(x,""),m(_,j)},d,h),m(h,"")}class z1{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:m}=l;if(p>=c||m<=r)return;h.isTop&&(d=this.highlighters.filter(A=>!A.scope||A.scope(h)));let x=o,_=U1(l)||vo.empty,j=D1(d,_.tags);if(j&&(x&&(x+=" "),x+=j,_.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,p),x),_.opaque)return;let v=l.tree&&l.tree.prop(en.mounted);if(v&&v.overlay){let A=l.node.enter(v.overlay[0].from+p,1),T=this.highlighters.filter(z=>!z.scope||z.scope(v.tree.type)),M=l.firstChild();for(let z=0,G=p;;z++){let Q=z<v.overlay.length?v.overlay[z]:null,Y=Q?Q.from+p:m,D=Math.max(r,G),K=Math.min(c,Y);if(D<K&&M)for(;l.from<K&&(this.highlightRange(l,D,K,o,d),this.startSpan(Math.min(K,l.to),x),!(l.to>=Y||!l.nextSibling())););if(!Q||Y>c)break;G=Q.to+p,G>r&&(this.highlightRange(A.cursor(),Math.max(r,Q.from+p),Math.min(c,G),"",T),this.startSpan(Math.min(c,G),x))}M&&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 U1(s){let l=s.type.prop(jy);for(;l&&l.context&&!s.matchContext(l.context);)l=l.next;return l||null}const we=as.define,Ku=we(),ii=we(),ox=we(ii),ux=we(ii),ri=we(),Zu=we(ri),Ch=we(ri),qs=we(),Yi=we(qs),zs=we(),Us=we(),Ph=we(),oo=we(Ph),Fu=we(),Te={comment:Ku,lineComment:we(Ku),blockComment:we(Ku),docComment:we(Ku),name:ii,variableName:we(ii),typeName:ox,tagName:we(ox),propertyName:ux,attributeName:we(ux),className:we(ii),labelName:we(ii),namespace:we(ii),macroName:we(ii),literal:ri,string:Zu,docString:we(Zu),character:we(Zu),attributeValue:we(Zu),number:Ch,integer:we(Ch),float:we(Ch),bool:we(ri),regexp:we(ri),escape:we(ri),color:we(ri),url:we(ri),keyword:zs,self:we(zs),null:we(zs),atom:we(zs),unit:we(zs),modifier:we(zs),operatorKeyword:we(zs),controlKeyword:we(zs),definitionKeyword:we(zs),moduleKeyword:we(zs),operator:Us,derefOperator:we(Us),arithmeticOperator:we(Us),logicOperator:we(Us),bitwiseOperator:we(Us),compareOperator:we(Us),updateOperator:we(Us),definitionOperator:we(Us),typeOperator:we(Us),controlOperator:we(Us),punctuation:Ph,separator:we(Ph),bracket:oo,angleBracket:we(oo),squareBracket:we(oo),paren:we(oo),brace:we(oo),content:qs,heading:Yi,heading1:we(Yi),heading2:we(Yi),heading3:we(Yi),heading4:we(Yi),heading5:we(Yi),heading6:we(Yi),contentSeparator:we(qs),list:we(qs),quote:we(qs),emphasis:we(qs),strong:we(qs),link:we(qs),monospace:we(qs),strikethrough:we(qs),inserted:we(),deleted:we(),changed:we(),invalid:we(),meta:Fu,documentMeta:we(Fu),annotation:we(Fu),processingInstruction:we(Fu),definition:as.defineModifier("definition"),constant:as.defineModifier("constant"),function:as.defineModifier("function"),standard:as.defineModifier("standard"),local:as.defineModifier("local"),special:as.defineModifier("special")};for(let s in Te){let l=Te[s];l instanceof as&&(l.name=s)}wy([{tag:Te.link,class:"tok-link"},{tag:Te.heading,class:"tok-heading"},{tag:Te.emphasis,class:"tok-emphasis"},{tag:Te.strong,class:"tok-strong"},{tag:Te.keyword,class:"tok-keyword"},{tag:Te.atom,class:"tok-atom"},{tag:Te.bool,class:"tok-bool"},{tag:Te.url,class:"tok-url"},{tag:Te.labelName,class:"tok-labelName"},{tag:Te.inserted,class:"tok-inserted"},{tag:Te.deleted,class:"tok-deleted"},{tag:Te.literal,class:"tok-literal"},{tag:Te.string,class:"tok-string"},{tag:Te.number,class:"tok-number"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],class:"tok-string2"},{tag:Te.variableName,class:"tok-variableName"},{tag:Te.local(Te.variableName),class:"tok-variableName tok-local"},{tag:Te.definition(Te.variableName),class:"tok-variableName tok-definition"},{tag:Te.special(Te.variableName),class:"tok-variableName2"},{tag:Te.definition(Te.propertyName),class:"tok-propertyName tok-definition"},{tag:Te.typeName,class:"tok-typeName"},{tag:Te.namespace,class:"tok-namespace"},{tag:Te.className,class:"tok-className"},{tag:Te.macroName,class:"tok-macroName"},{tag:Te.propertyName,class:"tok-propertyName"},{tag:Te.operator,class:"tok-operator"},{tag:Te.comment,class:"tok-comment"},{tag:Te.meta,class:"tok-meta"},{tag:Te.invalid,class:"tok-invalid"},{tag:Te.punctuation,class:"tok-punctuation"}]);const H1="modulepreload",B1=function(s,l){return new URL(s,l).href},fx={},Ke=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),x=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(r.map(_=>{if(_=B1(_,c),_ in fx)return;fx[_]=!0;const j=_.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let M=p.length-1;M>=0;M--){const z=p[M];if(z.href===_&&(!j||z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":H1,j||(T.as="script"),T.crossOrigin="",T.href=_,x&&T.setAttribute("nonce",x),document.head.appendChild(T),j)return new Promise((M,z)=>{T.addEventListener("load",M),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)})},ky={js:async()=>(await Ke(async()=>{const{javascript:s}=await import("./index-Cu9yVjDd.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-Cu9yVjDd.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-Cu9yVjDd.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-Cu9yVjDd.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-Cu9yVjDd.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-Cu9yVjDd.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-Cu9yVjDd.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-Cu9yVjDd.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-DLoVg97c.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-DLoVg97c.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-6WrTm4Cl.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-6WrTm4Cl.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-6WrTm4Cl.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-DdCEnSCp.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-DdCEnSCp.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-DdCEnSCp.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-DdCEnSCp.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-BrhFysJH.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-BrhFysJH.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-BBJ7uyxo.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-BBJ7uyxo.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-CReKaug6.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-CReKaug6.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-Aa3M3Mcp.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-BFyhFly9.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-BFyhFly9.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-BFyhFly9.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-BFyhFly9.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-BFyhFly9.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-BSHub4Y3.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-C_0hLH-6.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-C33PhVuR.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-BUVVNNln.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-DNvUBsh8.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-DNvUBsh8.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},I1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},q1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function G1(s){const l=q1[s.toLowerCase()]??s.toLowerCase(),r=ky[l];return r?r().catch(()=>null):null}async function Y1(s){const l=(s.split("/").pop()??"").toLowerCase(),r=I1[l]??l.split(".").pop()??"",c=ky[r];return c?c().catch(()=>null):null}const X1=wy([{tag:[Te.keyword,Te.modifier,Te.controlKeyword,Te.moduleKeyword],class:"cmh-key"},{tag:[Te.propertyName],class:"cmh-prop"},{tag:[Te.function(Te.variableName),Te.labelName],class:"cmh-fn"},{tag:[Te.color,Te.constant(Te.name),Te.standard(Te.name),Te.bool],class:"cmh-const"},{tag:[Te.typeName,Te.className,Te.changed,Te.annotation,Te.self,Te.namespace],class:"cmh-type"},{tag:[Te.number,Te.integer,Te.float],class:"cmh-num"},{tag:[Te.string,Te.special(Te.string),Te.regexp],class:"cmh-str"},{tag:[Te.operator,Te.operatorKeyword,Te.escape],class:"cmh-op"},{tag:[Te.meta,Te.comment],class:"cmh-comment"},{tag:Te.invalid,class:"cmh-invalid"}]);function Ju(s){return s.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function V1(s,l){const r=l?await G1(l):null;if(!r)return Ju(s);try{const c=r.language.parser.parse(s);let o="";return L1(s,c,X1,(d,h)=>{o+=h?`<span class="${h}">${Ju(d)}</span>`:Ju(d)},()=>{o+=`
|
|
118
|
+
`}),o}catch{return Ju(s)}}Tt.setOptions({gfm:!0,breaks:!1});function Ny(s){var r;const l=(r=s.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function bp(s){const l=await Tt.parse(s,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await V1(c.text,c.lang??""),c.escaped=!0}});return p1.sanitize(l)}function dx(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:Ny(s.path)}}function ba(s){return!s.binary&&!s.tooLarge&&s.text!==s.saved}function $1(s){return s.split("/").pop()??s}function er(s){const l=s.lastIndexOf("/");return l===-1?"":s.slice(0,l)}function mf(s){return s<1024?`${s} Б`:s<1024*1024?`${(s/1024).toFixed(1)} КБ`:`${(s/1024/1024).toFixed(1)} МБ`}function Qi({x:s,y:l,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,p]=y.useState({left:s,top:l}),[m,x]=y.useState(()=>{const v=r.findIndex(A=>!A.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const A=v.getBoundingClientRect(),T=8,M=Math.max(T,Math.min(s,window.innerWidth-A.width-T)),z=Math.max(T,Math.min(l,window.innerHeight-A.height-T));p({left:M,top:z})},[s,l]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(T){var M;(M=d.current)!=null&&M.contains(T.target)||o()}function A(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",A,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",A,!0)}},[o]);function _(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const A=r.map((T,M)=>({item:T,index:M})).filter(T=>!T.item.disabled);if(A.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,M=A.findIndex(G=>G.index===m),z=A[(((M===-1?0:M)+T)%A.length+A.length)%A.length];z&&x(z.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=r[m];T&&_(T)}}}return i.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,A)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(A===m?" is-cursor":""),onMouseEnter:()=>x(A),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 Q1=3500,K1=9e3,hx=220;function sr({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?Q1:K1,m=setTimeout(()=>d(!0),p),x=setTimeout(()=>c(null),p+hx);return()=>{clearTimeout(m),clearTimeout(x)}},[s]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},hx)};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 Xs({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 m(){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:m,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),m()):x.key==="Escape"&&(x.preventDefault(),o())}})}function oc({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 Z1=500,Xi="application/x-ccv-fs-path",F1=200;function J1({open:s,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:p,onSearch:m,onReveal:x,onToggle:_,onOpen:j,onCreate:v,onRename:A,onMove:T,onCopy:M,onDelete:z,onRefresh:G,onClose:Q,zoomed:Y,onToggleZoom:D}){const[K,H]=y.useState(""),[C,Z]=y.useState(null),[ae,be]=y.useState(null),[W,ue]=y.useState(null),[Se,Re]=y.useState(null),[Ce,E]=y.useState(null),[re,O]=y.useState(null),ge=kf("(hover: hover)"),xe=y.useRef(null),N=y.useMemo(()=>eS(d),[d]);function X(ee){return!(!W||ee===W.path||W.kind==="dir"&&ee.startsWith(`${W.path}/`)||ee===er(W.path))}function ie(ee){return!(!Ce||ee===Ce.path||Ce.kind==="dir"&&ee.startsWith(`${Ce.path}/`)||Ce.mode==="cut"&&ee===er(Ce.path))}function he(ee){E({path:ee.path,kind:ee.kind,mode:"copy"})}function ke(ee){E({path:ee.path,kind:ee.kind,mode:"cut"})}function ve(ee){!Ce||!ie(ee)||(ee&&!r.has(ee)&&_(ee),Ce.mode==="cut"?(T(Ce.path,ee),E(null)):M(Ce.path,ee))}function De(ee,pe){const He=ee.touches[0];if(!He)return;const U={timer:0,x:He.clientX,y:He.clientY,el:ee.currentTarget,fired:!1};U.timer=window.setTimeout(()=>{U.fired=!0,pe(U.x,U.y,U.el)},Z1),xe.current=U}function vt(ee){const pe=xe.current,He=ee.touches[0];!pe||!He||Math.hypot(He.clientX-pe.x,He.clientY-pe.y)>10&&(window.clearTimeout(pe.timer),xe.current=null)}function Xe(ee){const pe=xe.current;pe&&(window.clearTimeout(pe.timer),pe.fired&&ee.preventDefault())}function Ve(){var ee;return(ee=xe.current)!=null&&ee.fired?(xe.current=null,!0):!1}function $e(ee,pe,He,U){H((U==null?void 0:U.path)??""),O({x:ee,y:pe,opener:He,entry:U})}function tn(){const ee=re==null?void 0:re.opener;O(null),ee!=null&&ee.isConnected&&ee.focus()}function it(ee){return{onContextMenu:pe=>{pe.preventDefault(),$e(pe.clientX,pe.clientY,pe.currentTarget,ee)},onTouchStart:pe=>De(pe,(He,U,J)=>$e(He,U,J,ee)),onTouchMove:vt,onTouchEnd:Xe,onTouchCancel:Xe}}function dn(ee){ee.target===ee.currentTarget&&(ee.preventDefault(),$e(ee.clientX,ee.clientY,ee.currentTarget,null))}function ut(ee){ee.target===ee.currentTarget&&De(ee,(pe,He,U)=>$e(pe,He,U,null))}function hn(ee){if(!(ee.ctrlKey||ee.metaKey)||ee.target instanceof HTMLInputElement)return;const pe=ee.key.toLowerCase();if(pe==="v"){ee.preventDefault(),ve(Hn());return}if(!K)return;const He=px(l,K);He&&(pe==="c"?(ee.preventDefault(),he(He)):pe==="x"&&(ee.preventDefault(),ke(He)))}function En(ee){return pe=>{pe.dataTransfer.effectAllowed="move",pe.dataTransfer.setData(Xi,ee.path),ue({path:ee.path,kind:ee.kind})}}function Sn(){ue(null),Re(null)}function nn(ee){return pe=>{pe.dataTransfer.types.includes(Xi)&&(pe.stopPropagation(),!(ee.kind!=="dir"||!X(ee.path))&&(pe.preventDefault(),Re(ee.path)))}}function nt(ee){return pe=>{if(!pe.dataTransfer.types.includes(Xi)||(pe.stopPropagation(),ee.kind!=="dir"||!X(ee.path)))return;pe.preventDefault();const He=pe.dataTransfer.getData(Xi);Re(null),He&&T(He,ee.path)}}function Pe(ee){!ee.dataTransfer.types.includes(Xi)||!X("")||(ee.preventDefault(),Re(""))}function ln(ee){if(!ee.dataTransfer.types.includes(Xi)||!X(""))return;ee.preventDefault();const pe=ee.dataTransfer.getData(Xi);Re(null),pe&&T(pe,"")}const[Kt,lt]=y.useState(""),Et=Kt.trim(),Zt=Et.length>0,on=y.useRef(null),At=y.useRef(m);At.current=m;function jn(ee){lt(ee),on.current&&clearTimeout(on.current);const pe=ee.trim();if(!pe){At.current("");return}on.current=setTimeout(()=>At.current(pe),F1)}function $t(ee){on.current&&clearTimeout(on.current),lt(""),At.current(""),H(ee.path),x(ee)}const pn=Zt&&(p==null?void 0:p.query)===Et?p:null;function Hn(){if(K==="")return"";const ee=px(l,K);if((ee==null?void 0:ee.kind)==="dir")return K;const pe=K.lastIndexOf("/");return pe===-1?"":K.slice(0,pe)}function Qt(ee,pe){const He=pe??Hn();He&&!r.has(He)&&_(He),be({parent:He,kind:ee})}function rt(){if(!re)return[];const ee=U=>ge?U:void 0;if(!re.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ee("Ctrl+V"),disabled:!ie(""),onSelect:()=>ve("")},{id:"new-file",label:"Создать файл",onSelect:()=>Qt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Qt("dir","")}];const pe=re.entry,He=[pe.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(pe.path)}:{id:"toggle",label:r.has(pe.path)?"Свернуть":"Развернуть",onSelect:()=>_(pe.path)},{id:"copy",label:"Копировать",hint:ee("Ctrl+C"),onSelect:()=>he(pe)},{id:"cut",label:"Вырезать",hint:ee("Ctrl+X"),onSelect:()=>ke(pe)}];return pe.kind==="dir"&&(He.push({id:"paste",label:"Вставить",hint:ee("Ctrl+V"),disabled:!ie(pe.path),onSelect:()=>ve(pe.path)}),He.push({id:"new-file",label:"Создать файл",onSelect:()=>Qt("file",pe.path)}),He.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Qt("dir",pe.path)})),He.push({id:"rename",label:"Переименовать",onSelect:()=>Z(pe.path)}),He.push({id:"delete",label:"Удалить",onSelect:()=>z(pe)}),He}const Ot=Zt?[]:We("",0);function We(ee,pe){const He=l[ee],U=[];if(ae&&ae.parent===ee&&U.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:xa(pe),children:[i.jsx("span",{className:"fsrow__icon",children:ae.kind==="dir"?i.jsx(Sf,{}):i.jsx(jf,{})}),i.jsx(Xs,{className:"rename--file",value:"",placeholder:ae.kind==="dir"?"имя каталога":"имя файла",onCommit:J=>{be(null),v(ee,ae.kind,J)},onCancel:()=>be(null)})]},`draft:${ee}`)),!He)return U.push(i.jsx("p",{className:"fsrow__pending",style:xa(pe),children:"читаем…"},`wait:${ee}`)),U;He.length===0&&!ae&&U.push(i.jsx("p",{className:"fsrow__pending",style:xa(pe),children:"пусто"},`empty:${ee}`));for(const J of He){const ye=J.kind==="dir"&&r.has(J.path);U.push(C===J.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:xa(pe),children:[i.jsx("span",{className:"fsrow__icon",children:J.kind==="dir"?i.jsx(Sf,{open:ye}):i.jsx(jf,{})}),i.jsx(Xs,{className:"rename--file",value:J.name,placeholder:"новое имя",onCommit:Ge=>{Z(null),A(J.path,Ge)},onCancel:()=>Z(null)})]},J.path):i.jsx(W1,{entry:J,depth:pe,open:ye,active:J.path===c,selected:J.path===K,dirty:o.has(J.path),gitStatus:N.get(J.path),dragging:(W==null?void 0:W.path)===J.path,dropTarget:Se===J.path,cut:(Ce==null?void 0:Ce.mode)==="cut"&&Ce.path===J.path,onClick:()=>{Ve()||(H(J.path),J.kind==="dir"?_(J.path):j(J.path))},onRename:()=>Z(J.path),onDelete:()=>z(J),onDragStart:En(J),onDragEnd:Sn,onDragOver:nn(J),onDrop:nt(J),...it(J)},J.path)),ye&&U.push(...We(J.path,pe+1))}return U}function gl(){if(!pn)return[i.jsx("p",{className:"fsrow__pending",style:xa(0),children:"ищем…"},"search:wait")];if(pn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:xa(0),children:"ничего не найдено"},"search:empty")];const ee=pn.entries.map(pe=>i.jsx(P1,{entry:pe,gitStatus:N.get(pe.path),onClick:()=>$t(pe)},pe.path));return pn.truncated&&ee.push(i.jsxs("p",{className:"fsrow__pending",style:xa(0),children:["показаны первые ",pn.entries.length," — уточните запрос"]},"search:truncated")),ee}return i.jsxs("aside",{className:(s?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Y?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:hn,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:ee=>{D&&(ee.target.closest("button")||D())},children:[i.jsx(sS,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Qt("file"),children:i.jsx(nS,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Qt("dir"),children:i.jsx(lS,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:G,children:"↻"}),D&&i.jsx("button",{className:"sidepane__btn",title:Y?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Y?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Y,onClick:D,children:i.jsx(oc,{active:Y})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:Q,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(aS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:Kt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:ee=>jn(ee.target.value),onKeyDown:ee=>{ee.stopPropagation(),ee.key==="Escape"&&(ee.preventDefault(),Kt?jn(""):ee.currentTarget.blur())}}),Kt&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>jn(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(Se===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Pe,onDrop:ln,onContextMenu:dn,onTouchStart:ut,onTouchMove:vt,onTouchEnd:Xe,onTouchCancel:Xe,children:Zt?gl():Ot}),i.jsx(sr,{result:h}),re&&i.jsx(Qi,{x:re.x,y:re.y,items:rt(),onClose:tn})]})}function W1({entry:s,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:p,dropTarget:m,cut:x,onClick:_,onRename:j,onDelete:v,onDragStart:A,onDragEnd:T,onDragOver:M,onDrop:z,onContextMenu:G,onTouchStart:Q,onTouchMove:Y,onTouchEnd:D,onTouchCancel:K}){const H="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(s.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(m?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return i.jsxs("div",{className:H,style:xa(l),draggable:!0,onDragStart:A,onDragEnd:T,onDragOver:M,onDrop:z,onContextMenu:G,onTouchStart:Q,onTouchMove:Y,onTouchEnd:D,onTouchCancel:K,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:Ty(s),children:[i.jsx("span",{className:"fsrow__icon"+vf("fsrow__icon",h),children:s.kind==="dir"?i.jsx(Sf,{open:r}):i.jsx(jf,{})}),i.jsx("span",{className:"fsrow__name"+vf("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:j,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${s.name}`,onClick:v,children:"✕"})]})}function P1({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:xa(0),onClick:r,title:Ty(s),children:[i.jsx("span",{className:"fsrow__icon"+vf("fsrow__icon",l),children:s.kind==="dir"?i.jsx(Sf,{}):i.jsx(jf,{})}),i.jsx("span",{className:"fsrow__name"+vf("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 Ty(s){return s.ignored?`${s.path} — игнорируется git (.gitignore)`:s.path}function xa(s){return{"--depth":s}}function px(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 eS(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=tS(o.status);if(!d)continue;c(o.path,d);let h=er(o.path);for(;c(h,d),!!h;)h=er(h)}return l}function tS(s){if(s==="??")return"added";const[l="",r=""]=s;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function vf(s,l){return l?` ${s}--git-${l}`:""}function Sf({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 jf(){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 nS(){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 lS(){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 sS(){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 aS(){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 iS=200;function rS({open:s,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[p,m]=y.useState(""),x=p.trim(),_=x.length>0,j=y.useRef(null),v=y.useRef(r);v.current=r;function A(z){m(z),j.current&&clearTimeout(j.current);const G=z.trim();if(!G){v.current("");return}j.current=setTimeout(()=>v.current(G),iS)}const T=_&&(l==null?void 0:l.query)===x?l:null;function M(){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 G="";for(const Q of T.matches)Q.path!==G&&(G=Q.path,z.push(i.jsx("p",{className:"searchgroup__path",title:Q.path,children:Q.path},`path:${Q.path}`))),z.push(i.jsx(cS,{match:Q,onClick:()=>c(Q)},`${Q.path}:${Q.line}:${Q.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(oS,{}),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(oc,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(uS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:z=>A(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Escape"&&(z.preventDefault(),p?A(""):z.currentTarget.blur())}}),p&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>A(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?M():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function cS({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 oS(){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 uS(){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 Wu=null;function fS(){return Wu||(Wu=Promise.all([Ke(()=>import("./index-DdWyOJPD.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-CE-6gz9W.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ke(()=>import("./codemirror-DfnUEAQ1.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 Wu=null,s})),Wu}function dS({path:s,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),p=y.useRef(null),m=y.useRef(null),x=y.useRef(new Map),_=y.useRef(new Map),j=y.useRef(new Set),v=y.useRef(null),A=y.useRef(o),T=y.useRef(d),M=y.useRef(s),z=y.useRef(r),G=y.useRef(l);A.current=o,T.current=d,M.current=s,z.current=r,G.current=l;const[Q,Y]=y.useState("loading"),[D,K]=y.useState(!1);function H(Z,ae,be,W,ue){const Se=x.current.get(W),Re=_.current.get(W)===ue;if(Se&&Re)be.setState(Se);else{const E=Z.EditorState.create({doc:G.current,extensions:[Z.basicSetup,Z.Prec.highest(Z.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(M.current),!0)}])),Z.keymap.of([Z.indentWithTab]),ae.of([]),Z.editorTheme,Z.editorHighlight,Z.EditorView.updateListener.of(re=>{re.docChanged&&A.current(M.current,re.state.doc.toString())})]});x.current.set(W,E),_.current.set(W,ue),be.setState(E),j.current.delete(W)}if(j.current.has(W))return()=>{};let Ce=!1;return Y1(W).then(E=>{Ce||!E||M.current!==W||(be.dispatch({effects:ae.reconfigure(E)}),x.current.set(W,be.state),j.current.add(W))}),()=>{Ce=!0}}y.useEffect(()=>{if(!h.current)return;let ae=!1,be=null,W=null;Y("loading"),K(!1);const ue=window.setTimeout(()=>{ae||K(!0)},200);return(async()=>{let Se;try{Se=await fS()}catch{window.clearTimeout(ue),ae||Y("error");return}if(ae||!h.current)return;window.clearTimeout(ue);const Re=new Se.Compartment;v.current=Re,m.current=Se,W=new Se.EditorView({parent:h.current}),p.current=W,be=H(Se,Re,W,M.current,z.current),Y("ready")})(),()=>{ae=!0,window.clearTimeout(ue),be==null||be(),W==null||W.destroy(),p.current===W&&(p.current=null),m.current=null,v.current=null}},[]),y.useEffect(()=>{const Z=m.current,ae=p.current,be=v.current;if(!(!Z||!ae||!be))return H(Z,be,ae,s,r)},[s,r]);const C=y.useRef(0);return y.useEffect(()=>{const Z=p.current,ae=m.current;if(!Z||!ae||!c||c.token===C.current)return;C.current=c.token;const be=Z.state.doc.lines,W=Math.min(Math.max(c.line,1),be),ue=Z.state.doc.line(W),Se=Math.min(ue.from+Math.max(c.column-1,0),ue.to);Z.dispatch({selection:ae.EditorSelection.cursor(Se),effects:ae.EditorView.scrollIntoView(Se,{y:"center"})}),Z.focus()},[c]),y.useEffect(()=>()=>{const Z=p.current;Z&&x.current.set(s,Z.state)},[s]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(Q==="ready"?"":" is-hidden")}),Q==="loading"&&D&&i.jsxs("div",{className:"editor__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),Q==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function Ss({value:s,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[p,m]=y.useState(!1),[x,_]=y.useState(0),j=y.useRef(null),v=y.useRef(null),A=l.find(z=>z.value===s)??null;y.useEffect(()=>{if(!p)return;const z=l.findIndex(G=>G.value===s);_(z===-1?0:z)},[p]),y.useEffect(()=>{if(!p)return;function z(G){var Q;(Q=j.current)!=null&&Q.contains(G.target)||m(!1)}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[p]),y.useEffect(()=>{var z,G;p&&((G=(z=v.current)==null?void 0:z.querySelector(".is-cursor"))==null||G.scrollIntoView({block:"nearest"}))},[p,x]),y.useEffect(()=>{if(!p)return;const z=v.current,G=hS(j.current);if(!z||!G)return;const Q=z.getBoundingClientRect().bottom-G.getBoundingClientRect().bottom;Q>0&&(G.scrollTop+=Math.min(Q+8,z.offsetHeight))},[p]);function T(z){m(!1),z.value!==s&&r(z.value)}function M(z){if(z.key==="Escape"){if(!p)return;z.preventDefault(),z.stopPropagation(),m(!1);return}if(z.key==="ArrowDown"||z.key==="ArrowUp"){if(z.preventDefault(),!p)return m(!0);const G=z.key==="ArrowDown"?1:l.length-1;return _(Q=>(Q+G)%l.length)}if(z.key==="Enter"||z.key===" "){if(z.preventDefault(),!p)return m(!0);const G=l[x];G&&T(G)}}return i.jsxs("div",{ref:j,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(z=>!z),onKeyDown:M,children:[i.jsx("span",{className:"select__value",children:(A==null?void 0:A.label)??h}),i.jsx(pS,{})]}),p&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((z,G)=>i.jsxs("button",{type:"button",role:"option","aria-selected":z.value===s,className:"select__option"+(G===x?" is-cursor":"")+(z.value===s?" is-on":""),onMouseEnter:()=>_(G),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 hS(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 pS(){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 mS(){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 gS(){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 bS(){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 xS({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=yS(r,l);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",mf(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(vS,{url:p}):l.startsWith("video/")?i.jsx(jS,{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 yS(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 ai=1,Ey=8,Pu=1.25;function _S(s){return Math.min(Ey,Math.max(ai,s))}function vS({url:s}){const[l,r]=y.useState({scale:ai,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function p(A,T,M){r(z=>{const G=_S(z.scale*A);if(G===z.scale)return z;if(G<=ai)return{scale:ai,x:0,y:0};const Q=(T-z.x)/z.scale,Y=(M-z.y)/z.scale;return{scale:G,x:T-G*Q,y:M-G*Y}})}y.useEffect(()=>{const A=d.current;if(!A)return;function T(M){M.preventDefault();const z=A.getBoundingClientRect(),G=M.clientX-z.left-z.width/2,Q=M.clientY-z.top-z.height/2;p(M.deltaY<0?Pu:1/Pu,G,Q)}return A.addEventListener("wheel",T,{passive:!1}),()=>A.removeEventListener("wheel",T)},[]);function m(A){l.scale<=ai||(A.currentTarget.setPointerCapture(A.pointerId),h.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,origX:l.x,origY:l.y},o(!0))}function x(A){const T=h.current;!T||T.pointerId!==A.pointerId||r(M=>({...M,x:T.origX+(A.clientX-T.startX),y:T.origY+(A.clientY-T.startY)}))}function _(){h.current=null,o(!1)}const j=l.scale>ai,v=!j&&l.x===0&&l.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:m,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<=ai,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>p(1/Pu,0,0),children:i.jsx(gS,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:l.scale>=Ey,title:"Увеличить","aria-label":"Увеличить",onClick:()=>p(Pu,0,0),children:i.jsx(mS,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:ai,x:0,y:0}),children:i.jsx(bS,{})})]})]})}const SS=[{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 jS({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(Ss,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:SS})]})]})}function wS({file:s,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:p}){const m=ba(s),x=Ny(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:[mf(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:!m,title:"Сохранить (Ctrl+S)",onClick:()=>c(s.path),children:m?"Сохранить":"Сохранено"})]}),s.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",m?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(s.path),children:"Взять с диска"}),m&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(s.path),children:"Сохранить поверх"})]}),s.binary&&s.mediaMime?i.jsx(xS,{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:["Это не текстовый файл — редактировать его здесь нечем. ",mf(s.size)," на диске."]}):s.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",mf(s.size),"). Такие правит агент, а не браузер."]}):x&&s.previewMode?i.jsx(kS,{text:s.text}):i.jsx(dS,{path:s.path,doc:s.text,revision:s.revision,goto:l,onChange:r,onSave:c})]})}function kS({text:s}){const[l,r]=y.useState("");return y.useEffect(()=>{let c=!1;return bp(s).then(o=>{c||r(o)}),()=>{c=!0}},[s]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function NS({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:m=>{h&&(m.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:$1(p.path)}),ba(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(oc,{active:d})})]})}function ss(s){return s.claudeSessionId??s.id}function ef(s,l,r,c){if(!l||l.length===0)return s;const o=new Map(l.map((p,m)=>[p,m])),d=[],h=[];for(const p of s)(o.has(r(p))?d:h).push(p);return d.sort((p,m)=>o.get(r(p))-o.get(r(m))),c==="top"?[...h,...d]:[...d,...h]}function mx(s){return s.state!=="closed"}function gx(s){return[...s.filter(mx),...s.filter(l=>!mx(l))]}function tf(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,m)=>p===s[m])?null:h}const Ay="ccv:sidebar.collapsed",Cy="ccv:sidebar.mode",Ry="ccv:sidebar.foldersCollapsed",TS=500,Rh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function ES({open:s,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:p,sessions:m,archived:x,pinned:_,live:j,listOrder:v,liveSessionsFirst:A,onReorder:T,activeWorkspaceId:M,activeSessionId:z,onSelectWorkspace:G,onSelectSession:Q,onRenameSession:Y,onStopSession:D,onPinSessions:K,onSelectPinned:H,onCloseWorkspaces:C,onRestoreWorkspaces:Z,onArchiveSessions:ae,onUnarchiveSessions:be,onCreateFolder:W,onRenameFolder:ue,onDeleteFolder:Se,onAssignToFolder:Re,onOpenWorkspace:Ce,onNewSession:E,onOpenExtensions:re,account:O,onOpenAccount:ge,relay:xe,onOpenRelay:N,onOpenSettings:X,themeMode:ie,onCycleTheme:he}){var kt;const[ke,ve]=y.useState(null),[De,vt]=y.useState(null),[Xe,Ve]=y.useState(null),[$e,tn]=y.useState(""),[it,dn]=y.useState(GS),[ut,hn]=y.useState(YS),[En,Sn]=y.useState(XS);function nn(w){Sn(w);try{localStorage.setItem(Cy,w)}catch{}}const nt=$e.trim().toLowerCase(),Pe=nt!=="",ln=y.useMemo(()=>ef(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),Kt=y.useMemo(()=>{const w=ef(m,M?v==null?void 0:v.sessions[M]:void 0,ss,"top");return A?gx(w):w},[m,v,M,A]),lt=y.useMemo(()=>{const w=ef(_,v==null?void 0:v.pinned,ss,"bottom");return A?gx(w):w},[_,v,A]),Et=y.useMemo(()=>ef(j,v==null?void 0:v.live,ss,"bottom"),[j,v]),Zt=y.useMemo(()=>Pe?ln.filter(w=>w.name.toLowerCase().includes(nt)||w.path.toLowerCase().includes(nt)):ln,[ln,nt,Pe]),on=y.useMemo(()=>Pe?o.filter(w=>w.name.toLowerCase().includes(nt)||w.path.toLowerCase().includes(nt)):o,[o,nt,Pe]),At=y.useMemo(()=>Pe?Kt.filter(w=>(w.title??"").toLowerCase().includes(nt)):Kt,[Kt,nt,Pe]),jn=y.useMemo(()=>Pe?x.filter(w=>(w.title??"").toLowerCase().includes(nt)):x,[x,nt,Pe]),$t=w=>{var le;return((le=c.find(je=>je.id===w))==null?void 0:le.name)??"—"},pn=w=>{var le;return(le=c.find(je=>je.id===w))==null?void 0:le.path},Hn=y.useMemo(()=>Pe?lt.filter(w=>(w.title??"").toLowerCase().includes(nt)||$t(w.workspaceId).toLowerCase().includes(nt)):lt,[lt,c,nt,Pe]),Qt=y.useMemo(()=>Pe?Et.filter(w=>(w.title??"").toLowerCase().includes(nt)||$t(w.workspaceId).toLowerCase().includes(nt)):Et,[Et,c,nt,Pe]),rt=!Pe;function Ot(w){dn(le=>{const je=le.includes(w)?le.filter(Ze=>Ze!==w):[...le,w];try{localStorage.setItem(Ay,JSON.stringify(je))}catch{}return je})}const We=w=>!it.includes(w);function gl(w){hn(le=>{const je=le.includes(w)?le.filter(Ze=>Ze!==w):[...le,w];try{localStorage.setItem(Ry,JSON.stringify(je))}catch{}return je})}const ee=w=>!ut.includes(w),pe=y.useMemo(()=>uo(Zt,d),[Zt,d]),He=y.useMemo(()=>uo(on,d),[on,d]),U=y.useMemo(()=>uo(At,h),[At,h]),J=y.useMemo(()=>uo(jn,h),[jn,h]),ye=y.useMemo(()=>uo(Hn,p,w=>w.pinnedFolderId),[Hn,p]),Ge=y.useMemo(()=>({groups:[],ungrouped:Qt}),[Qt]),ft=((v==null?void 0:v.workspaces.length)??0)>0,bl=M?(((kt=v==null?void 0:v.sessions[M])==null?void 0:kt.length)??0)>0:!1,Qn=((v==null?void 0:v.pinned.length)??0)>0,tl=((v==null?void 0:v.live.length)??0)>0,nl=nf({enabled:rt,scope:"workspaces",itemKey:w=>w.id,groups:pe.groups,ungrouped:pe.ungrouped,onReorder:T}),Ql=nf({enabled:rt,scope:"sessions",workspaceId:M??void 0,itemKey:ss,groups:U.groups,ungrouped:U.ungrouped,onReorder:T}),In=nf({enabled:rt,scope:"pinned",itemKey:ss,groups:ye.groups,ungrouped:ye.ungrouped,onReorder:T}),Kl=nf({enabled:rt,scope:"live",itemKey:ss,groups:Ge.groups,ungrouped:Ge.ungrouped,onReorder:T}),Ct=Oh(Zt),ll=Oh(on),mn=Oh(At),[qt,xl]=y.useState(null),[Gt,Lt]=y.useState(null),[Ee,un]=y.useState(null),[gt,rs]=y.useState(null),[An,yl]=y.useState(null),Kn=y.useRef(null);function sl(w,le){const je=w.touches[0];if(!je)return;const Ze={timer:0,x:je.clientX,y:je.clientY,el:w.currentTarget,fired:!1};Ze.timer=window.setTimeout(()=>{Ze.fired=!0,le(Ze.x,Ze.y,Ze.el)},TS),Kn.current=Ze}function qn(w){const le=Kn.current,je=w.touches[0];!le||!je||Math.hypot(je.clientX-le.x,je.clientY-le.y)>10&&(window.clearTimeout(le.timer),Kn.current=null)}function bt(w){const le=Kn.current;le&&(window.clearTimeout(le.timer),le.fired&&w.preventDefault())}function Cn(){var w;return(w=Kn.current)!=null&&w.fired?(Kn.current=null,!0):!1}function gn(){const w=qt==null?void 0:qt.opener;xl(null),w!=null&&w.isConnected&&w.focus()}function Rt(){const w=Gt==null?void 0:Gt.opener;Lt(null),w!=null&&w.isConnected&&w.focus()}function ul(){const w=Ee==null?void 0:Ee.opener;un(null),w!=null&&w.isConnected&&w.focus()}function _a(){const w=gt==null?void 0:gt.opener;rs(null),w!=null&&w.isConnected&&w.focus()}function fl(){const w=An==null?void 0:An.opener;yl(null),w!=null&&w.isConnected&&w.focus()}function Zl(w){return{onContextMenu:le=>{le.preventDefault(),xl({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:Ct.targetsFor(w)})},onTouchStart:le=>sl(le,(je,Ze,St)=>xl({x:je,y:Ze,opener:St,ids:Ct.targetsFor(w)})),onTouchMove:qn,onTouchEnd:bt,onTouchCancel:bt}}function va(w){return{onContextMenu:le=>{le.preventDefault(),Lt({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:ll.targetsFor(w)})},onTouchStart:le=>sl(le,(je,Ze,St)=>Lt({x:je,y:Ze,opener:St,ids:ll.targetsFor(w)})),onTouchMove:qn,onTouchEnd:bt,onTouchCancel:bt}}function $s(w){return{onContextMenu:le=>{le.preventDefault(),un({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:mn.targetsFor(w)})},onTouchStart:le=>sl(le,(je,Ze,St)=>un({x:je,y:Ze,opener:St,ids:mn.targetsFor(w)})),onTouchMove:qn,onTouchEnd:bt,onTouchCancel:bt}}function _l(w){return{onContextMenu:le=>{le.preventDefault(),rs({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:[w.id]})},onTouchStart:le=>sl(le,(je,Ze,St)=>rs({x:je,y:Ze,opener:St,ids:[w.id]})),onTouchMove:qn,onTouchEnd:bt,onTouchCancel:bt}}function Qs(w){return{onContextMenu:le=>{le.preventDefault(),yl({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:[w.id]})},onTouchStart:le=>sl(le,(je,Ze,St)=>yl({x:je,y:Ze,opener:St,ids:[w.id]})),onTouchMove:qn,onTouchEnd:bt,onTouchCancel:bt}}const al=m.filter(w=>w.state!=="closed").length,Zn=qt?Zt.find(w=>w.id===qt.ids[0]):void 0,bn=qt?[{id:"close",label:qt.ids.length>1?`Закрыть проекты (${qt.ids.length})`:"Закрыть проект",onSelect:()=>{C(qt.ids),Ct.clear()}},...fo({folders:d,ids:qt.ids,hasFolder:(Zn==null?void 0:Zn.folderId)!=null,assign:(w,le)=>Re("workspace",w,le),onClear:()=>Ct.clear(),onNewFolder:()=>Ve("workspace")}),...qt.ids.length===1&&rt?nl.menuItems(qt.ids[0],ft):[]]:[],et=qt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(M&&qt.ids.includes(M)&&al>0?` в нём сейчас незавершённых сессий: ${al} — при закрытии они остановятся на хосте.`:""):void 0,vl=Gt?on.find(w=>w.id===Gt.ids[0]):void 0,Ul=Gt?[{id:"restore",label:Gt.ids.length>1?`Вернуть проекты (${Gt.ids.length})`:"Вернуть проект",onSelect:()=>{Z(Gt.ids),ll.clear()}},...fo({folders:d,ids:Gt.ids,hasFolder:(vl==null?void 0:vl.folderId)!=null,assign:(w,le)=>Re("workspace",w,le),onClear:()=>ll.clear(),onNewFolder:()=>Ve("workspace")})]:[],Sl=Gt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,wn=Ee?At.find(w=>w.id===Ee.ids[0]):void 0,jl=(wn==null?void 0:wn.pinned)!==!0,wl=Ee?[...Ee.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>ve(Ee.ids[0])}]:[],{id:"pin",label:jl?Ee.ids.length>1?`Закрепить (${Ee.ids.length})`:"Закрепить":Ee.ids.length>1?`Открепить (${Ee.ids.length})`:"Открепить",onSelect:()=>{wn&&K(wn.workspaceId,Ee.ids,jl),mn.clear()}},{id:"archive",label:Ee.ids.length>1?`Убрать в архив (${Ee.ids.length})`:"Убрать в архив",onSelect:()=>{ae(M,Ee.ids),mn.clear()}},...fo({folders:h,ids:Ee.ids,hasFolder:(wn==null?void 0:wn.folderId)!=null,assign:(w,le)=>Re("session",w,le,M),onClear:()=>mn.clear(),onNewFolder:()=>Ve("session")}),...Ee.ids.length===1&&rt&&wn?Ql.menuItems(ss(wn),bl):[]]:[],zt=Ee?Rh:void 0,Yt=gt?Hn.find(w=>w.id===gt.ids[0]):void 0,dl=gt?[{id:"rename",label:"Переименовать",onSelect:()=>ve(gt.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Yt&&K(Yt.workspaceId,[Yt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Yt&&ae(Yt.workspaceId,[Yt.id])}},...Yt&&Yt.workspaceId===M?fo({folders:h,ids:[Yt.id],hasFolder:Yt.folderId!=null,assign:(w,le)=>Re("session",w,le,Yt.workspaceId),onClear:()=>{},onNewFolder:()=>Ve("session")}):[],...MS(Yt?fo({folders:p,ids:[Yt.id],hasFolder:Yt.pinnedFolderId!=null,assign:(w,le)=>Re("pinned",w,le),onClear:()=>{},onNewFolder:()=>Ve("pinned")}):[]),...rt&&Yt?In.menuItems(ss(Yt),Qn):[]]:[],Ft=An?Qt.find(w=>w.id===An.ids[0]):void 0,kn=An?[{id:"stop",label:"Остановить",onSelect:()=>{Ft&&D(Ft)}},{id:"rename",label:"Переименовать",onSelect:()=>ve(An.ids[0])},{id:"pin",label:(Ft==null?void 0:Ft.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{Ft&&K(Ft.workspaceId,[Ft.id],Ft.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ft&&ae(Ft.workspaceId,[Ft.id])}},...rt&&Ft?Kl.menuItems(ss(Ft),tl):[]]:[];function de(w){return i.jsxs("div",{"data-row-key":w.id,className:Mh(w.id===M,Ct.selected.includes(w.id))+nl.dropClass(w.id),...Zl(w),children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...nl.gripHandlers(w.id),children:i.jsx(lf,{})}),i.jsxs("button",{className:"row__main",onClick:le=>{Cn()||Ct.click(le,w,()=>G(w.id))},onKeyDown:le=>nl.onKeyDown(w.id,le),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:Mh(w.id===M,ll.selected.includes(w.id)),...va(w),children:[i.jsxs("button",{className:"row__main",onClick:le=>{Cn()||ll.click(le,w,()=>G(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:JS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>Z([w.id]),children:"Вернуть"})]},w.id)}function q(w){const le=ss(w);return i.jsx("div",{"data-row-key":le,className:Mh(w.id===z,mn.selected.includes(w.id))+Ql.dropClass(le),...ke===w.id?{}:$s(w),children:ke===w.id?i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:w.title??"",onCommit:je=>{Y(w,je),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ql.gripHandlers(le),children:i.jsx(lf,{})}),i.jsxs("button",{className:"row__main",onClick:je=>{Cn()||mn.click(je,w,()=>Q(w))},onKeyDown:je=>Ql.onKeyDown(le,je),children:[i.jsx(sf,{title:w.title??"Без названия",pinned:w.pinned===!0,projectName:$t(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx(Lh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Cn()||ve(w.id)},children:"✎"})]})},w.id)}function oe(w){return i.jsxs("div",{className:w.id===z?"row row--active":"row",children:[i.jsxs("button",{className:"row__main",onClick:()=>Q(w),children:[i.jsx(sf,{title:w.title??"Без названия",pinned:!1,projectName:$t(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:FS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>be([w.id]),children:"Вернуть"})]},w.id)}function Ae(w){const le=ss(w);return i.jsx("div",{"data-row-key":le,className:(w.id===z?"row row--active":"row")+In.dropClass(le),...ke===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",..._l(w)},children:ke===w.id?i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:w.title??"",onCommit:je=>{Y(w,je),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...In.gripHandlers(le),children:i.jsx(lf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{Cn()||H(w)},onKeyDown:je=>In.onKeyDown(le,je),children:[i.jsx(sf,{title:w.title??"Без названия",pinned:!1,projectName:$t(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx(Lh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})},w.id)}function ze(w){const le=ss(w);return i.jsx("div",{"data-row-key":le,className:(w.id===z?"row row--active":"row")+Kl.dropClass(le),...ke===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Qs(w)},children:ke===w.id?i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:w.title??"",onCommit:je=>{Y(w,je),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[rt&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Kl.gripHandlers(le),children:i.jsx(lf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{Cn()||H(w)},onKeyDown:je=>Kl.onKeyDown(le,je),children:[i.jsx(sf,{title:w.title??"Без названия",pinned:w.pinned===!0,projectName:$t(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx(Lh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:je=>{je.stopPropagation(),!Cn()&&D(w)},children:i.jsx(HS,{})})]})},w.id)}function Le(w,le){return i.jsx(US,{folder:w,count:le,open:ee(w.id),renaming:De===w.id,onToggle:()=>gl(w.id),onStartRename:()=>vt(w.id),onCommitRename:je=>{ue(w.id,je),vt(null)},onCancelRename:()=>vt(null),onDelete:()=>Se(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:`Тема: ${xx[ie]}`,"aria-label":`Тема: ${xx[ie]}. Переключить`,onClick:he,children:i.jsx(VS,{mode:ie})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":En==="default",className:En==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>nn("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":En==="pinned",className:En==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>nn("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":En==="live",className:En==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>nn("live"),children:[i.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&i.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(IS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:$e,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>tn(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),$e?tn(""):w.currentTarget.blur())}}),$e&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>tn(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:En==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(Xr,{title:"Закреплённые",count:Hn.length,open:We("pinned"),onToggle:()=>Ot("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{Ve("pinned"),We("pinned")||Ot("pinned")}}}),We("pinned")&&i.jsxs(i.Fragment,{children:[Xe==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:"",placeholder:"Название папки",onCommit:w=>{W("pinned",w),Ve(null)},onCancel:()=>Ve(null)})})}),Hn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),ye.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ee(w.folder.id)&&w.items.map(le=>Ae(le))]},w.folder.id)),ye.ungrouped.map(w=>Ae(w))]})]}):En==="live"?i.jsxs(i.Fragment,{children:[i.jsx(Xr,{title:"Запущенные",count:Qt.length,open:We("live"),onToggle:()=>Ot("live")}),We("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=>ze(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Xr,{title:"Проекты",count:Zt.length,open:We("workspaces"),onToggle:()=>Ot("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{Ve("workspace"),We("workspaces")||Ot("workspaces")}}}),We("workspaces")&&i.jsxs(i.Fragment,{children:[Xe==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:"",placeholder:"Название папки",onCommit:w=>{W("workspace",w),Ve(null)},onCancel:()=>Ve(null)})})}),Zt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока ни одного"})}),pe.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ee(w.folder.id)&&w.items.map(le=>de(le))]},w.folder.id)),pe.ungrouped.map(w=>de(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Xr,{title:"Архив проектов",count:on.length,open:We("workspacesArchive"),onToggle:()=>Ot("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),We("workspacesArchive")&&i.jsxs(i.Fragment,{children:[on.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),ee(w.folder.id)&&w.items.map(le=>k(le))]},w.folder.id)),He.ungrouped.map(w=>k(w))]})]}),M&&i.jsxs(i.Fragment,{children:[i.jsx(Xr,{title:"Сессии",count:At.length,open:We("sessions"),onToggle:()=>Ot("sessions"),action:{label:"Новая папка сессий",onClick:()=>{Ve("session"),We("sessions")||Ot("sessions")}}}),We("sessions")&&i.jsxs(i.Fragment,{children:[Xe==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:"",placeholder:"Название папки",onCommit:w=>{W("session",w,M),Ve(null)},onCancel:()=>Ve(null)})})}),At.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока ни одной"})}),U.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ee(w.folder.id)&&w.items.map(le=>q(le))]},w.folder.id)),U.ungrouped.map(w=>q(w))]}),x.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(Xr,{title:"Архив",count:jn.length,open:We("archive"),onToggle:()=>Ot("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),We("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),jn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока пусто"})}),J.groups.map(w=>i.jsxs(y.Fragment,{children:[Le(w.folder,w.items.length),ee(w.folder.id)&&w.items.map(le=>oe(le))]},w.folder.id)),J.ungrouped.map(w=>oe(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:ge,children:[i.jsx("span",{className:O!=null&&O.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:O===null?"Аккаунт":O.loggedIn?O.email||"Вход выполнен":"Войти в аккаунт"}),(O==null?void 0:O.plan)&&i.jsx("span",{className:"chip",children:O.plan})]}),N&&i.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:N,children:[i.jsx("span",{className:xe!=null&&xe.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:xe===null?"Удалённый доступ":xe.paired?xe.connected?xe.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(xe==null?void 0:xe.connected)&&xe.clients>0&&i.jsx("span",{className:"chip",children:xe.clients})]}),i.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!re,title:"MCP-серверы и плагины",onClick:()=>re==null?void 0:re(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:X,children:"Настройки"}),i.jsx("button",{className:"btn btn--ghost",onClick:Ce,children:"+ Проект"}),i.jsx("button",{className:"btn btn--primary",onClick:E,disabled:!M,children:"+ Сессия"})]}),qt&&i.jsx(Qi,{x:qt.x,y:qt.y,items:bn,note:et,onClose:gn}),Gt&&i.jsx(Qi,{x:Gt.x,y:Gt.y,items:Ul,note:Sl,onClose:Rt}),Ee&&i.jsx(Qi,{x:Ee.x,y:Ee.y,items:wl,note:zt,onClose:ul}),gt&&i.jsx(Qi,{x:gt.x,y:gt.y,items:dl,note:Rh,onClose:_a}),An&&i.jsx(Qi,{x:An.x,y:An.y,items:kn,note:Rh,onClose:fl})]})}function Mh(s,l){const r=["row"];return s&&r.push("row--active"),l&&r.push("row--selected"),r.join(" ")}function uo(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 m=r(p),x=m?c.get(m):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,m])=>({folder:c.get(p),items:m})).sort((p,m)=>p.folder.name.localeCompare(m.folder.name,"ru")),ungrouped:d}}function AS(s,l,r){return[...s.flatMap(c=>c.items.map(r)),...l.map(r)]}const CS="\0ungrouped";function RS(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),CS);return c}function Dh(s,l,r,c,o){const d=[...l.map(p=>p.items),r].find(p=>p.some(m=>c(m)===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 nf(s){const[l,r]=y.useState(null),[c,o]=y.useState(null),d=y.useMemo(()=>AS(s.groups,s.ungrouped,s.itemKey),[s.groups,s.ungrouped,s.itemKey]),h=y.useMemo(()=>RS(s.groups,s.ungrouped,s.itemKey),[s.groups,s.ungrouped,s.itemKey]);function p(){r(null),o(null)}function m(G,Q){s.enabled&&(Q.preventDefault(),Q.currentTarget.setPointerCapture(Q.pointerId),r(G),o(null))}function x(G,Q){var C;if(!l)return;const Y=(C=document.elementFromPoint(G,Q))==null?void 0:C.closest("[data-row-key]"),D=Y==null?void 0:Y.dataset.rowKey;if(!D||D===l||h.get(D)!==h.get(l)){o(null);return}const K=Y.getBoundingClientRect(),H=Q-K.top<K.height/2?"before":"after";o(Z=>(Z==null?void 0:Z.key)===D&&Z.position===H?Z:{key:D,position:H})}function _(G){x(G.clientX,G.clientY)}function j(){if(l&&c){const G=tf(d,l,c.key,c.position);G&&s.onReorder(s.scope,G,s.workspaceId)}p()}function v(G,Q){if(!s.enabled)return;const Y=Dh(G,s.groups,s.ungrouped,s.itemKey,Q);if(!Y)return;const D=tf(d,G,Y.target,Y.position);D&&s.onReorder(s.scope,D,s.workspaceId)}function A(G,Q){const Y=Dh(G,s.groups,s.ungrouped,s.itemKey,"up"),D=Dh(G,s.groups,s.ungrouped,s.itemKey,"down"),K=[{id:"move-up",label:"Переместить выше",disabled:!Y,onSelect:()=>{if(!Y)return;const H=tf(d,G,Y.target,Y.position);H&&s.onReorder(s.scope,H,s.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!D,onSelect:()=>{if(!D)return;const H=tf(d,G,D.target,D.position);H&&s.onReorder(s.scope,H,s.workspaceId)}}];return Q&&K.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>s.onReorder(s.scope,null,s.workspaceId)}),K}function T(G){return l===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function M(G){return{onPointerDown:Q=>m(G,Q),onPointerMove:_,onPointerUp:j,onPointerCancel:p}}function z(G,Q){!Q.altKey||Q.key!=="ArrowUp"&&Q.key!=="ArrowDown"||(Q.preventDefault(),v(G,Q.key==="ArrowUp"?"up":"down"))}return{dragging:l!==null,dropClass:T,gripHandlers:M,onKeyDown:z,menuItems:A}}function fo(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 MS(s){return s.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function Oh(s){const[l,r]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(p,m,x){if(p.ctrlKey||p.metaKey){r(_=>_.includes(m.id)?_.filter(j=>j!==m.id):[..._,m.id]),c.current=m.id;return}if(p.shiftKey&&c.current){const _=s.findIndex(v=>v.id===c.current),j=s.findIndex(v=>v.id===m.id);if(_!==-1&&j!==-1){const[v,A]=_<j?[_,j]:[j,_];r(s.slice(v,A+1).map(T=>T.id));return}}o(),c.current=m.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 DS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},OS={width:22,height:22,borderRadius:6};function Xr({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:DS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(My,{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:OS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(qS,{})})]})}const bx={paddingLeft:22},LS={display:"flex",alignItems:"center",gap:6,width:"100%"},zS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function US({folder:s,count:l,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:p,onDelete:m}){return c?i.jsx("div",{className:"row",style:bx,children:i.jsx("div",{className:"row__main",children:i.jsx(Xs,{value:s.name,placeholder:"Название папки",onCommit:h,onCancel:p})})}):i.jsxs("div",{className:"row",style:bx,children:[i.jsxs("button",{className:"row__main",style:LS,"aria-expanded":r,title:r?`Свернуть папку «${s.name}»`:`Развернуть папку «${s.name}»`,onClick:o,children:[i.jsx(My,{open:r}),i.jsx("span",{style:zS,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:m,children:"✕"})]})}function My({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 lf(){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 HS(){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 BS({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 IS(){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 qS(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function GS(){try{const s=localStorage.getItem(Ay);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 YS(){try{const s=localStorage.getItem(Ry);if(s===null)return[];const l=JSON.parse(s);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function XS(){try{const s=localStorage.getItem(Cy);return s==="pinned"||s==="live"?s:"default"}catch{return"default"}}const xx={system:"как в системе",light:"светлая",dark:"тёмная"};function VS({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 $S(s){switch(s.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return s.backgroundWork?"работает в фоне":QS(s.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function QS(s){switch(s){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function KS(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":ZS(s.lastTurn);case"error":return"error";case"closed":return"closed"}}function ZS(s){switch(s){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Lh({session:s,tail:l}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${KS(s)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),$S(s)]})," · ",l]})}function sf({title:s,pinned:l,projectName:r,projectPath:c}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[l&&i.jsx(BS,{className:"row__pin"}),s]}),i.jsx("span",{className:"row__project",title:c,children:r})]})}function FS(s){const l=s.archivedAuto?"сама, по сроку молчания":"убрана вручную";return s.archivedAt?`${new Date(s.archivedAt).toLocaleString()} · ${l}`:l}function JS(s){return s.archivedAt?`закрыт ${new Date(s.archivedAt).toLocaleString()}`:"закрыт"}const yx=3,WS=15e5;function Dy(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=zh(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=nj(PS(zh(r.old_string),zh(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function zh(s){if(s==="")return[];const l=s.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function PS(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),...ej(s.slice(r,c),l.slice(r,o)),...s.slice(c).map(d)]}function ej(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)>WS)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=(_,j)=>d[_*o+j]??0;for(let _=r-1;_>=0;_--)for(let j=c-1;j>=0;j--)d[_*o+j]=s[_]===l[j]?h(_+1,j+1)+1:Math.max(h(_+1,j),h(_,j+1));const p=[];let m=0,x=0;for(;m<r&&x<c;){const _=s[m],j=l[x];_===j?(p.push({type:"ctx",text:_}),m++,x++):h(m+1,x)>=h(m,x+1)?(p.push({type:"del",text:_}),m++):(p.push({type:"add",text:j}),x++)}for(;m<r;)p.push({type:"del",text:s[m++]});for(;x<c;)p.push({type:"add",text:l[x++]});return tj(p)}function tj(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 nj(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-yx);p<=Math.min(s.length-1,h+yx);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} ${lj(c.length)} без изменений`}),c=[]}return s.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function lj(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 rc(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 ep(){try{return await navigator.clipboard.readText()}catch{return null}}const xp=1600,tr="Копировать",Jr="Скопировано";function yp({text:s,hint:l,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),xp);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[s]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?Jr:`${tr} ${l}`,title:c?Jr:`${tr} ${l}`,onClick:()=>{rc(s).then(d=>{d&&o(!0)})},children:c?Jr:tr})}function _p({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 sj({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 vp({items:s,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:p,onEditMessage:m,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),j=y.useRef(null),v=y.useRef(!0),A=y.useRef(null),T=y.useRef(null),M=y.useRef(!1);y.useEffect(()=>{v.current=!0,A.current=null,M.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[p]),y.useEffect(()=>{const D=_.current,K=j.current;if(!D||!K)return;function H(ae){!D||ae===D.scrollTop||(M.current=!0,D.scrollTop=ae)}function C(){if(!D)return;const ae=A.current;if(ae){const be=vx(D,ae.id);if(be){const W=be.getBoundingClientRect().top-D.getBoundingClientRect().top;H(D.scrollTop+(W-ae.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{A.current=null},500);return}v.current&&H(D.scrollHeight)}const Z=new ResizeObserver(C);return Z.observe(K),()=>{Z.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function z(){const D=_.current;if(D){if(M.current){M.current=!1;return}v.current=D.scrollHeight-D.scrollTop-D.clientHeight<80}}function G(){if(d)return;const D=_.current,K=c[0];if(D&&K){const H=vx(D,K.id);H&&(A.current={id:K.id,top:H.getBoundingClientRect().top-D.getBoundingClientRect().top})}h==null||h()}let Q=0;function Y(D){return D.kind==="user"?Q++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:z,children:i.jsxs("div",{className:"stream",ref:j,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:G,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(D=>i.jsx(_x,{item:D,userIndex:Y(D),onEditMessage:m},D.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(D=>i.jsx(_x,{item:D,userIndex:Y(D),onEditMessage:m},D.id)),l&&i.jsx(sj,{waiting:r})]})})}function _x({item:s,userIndex:l,onEditMessage:r}){switch(s.kind){case"user":return i.jsx(ij,{item:s,userIndex:l,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":s.id,children:[i.jsx(rj,{text:s.text}),s.streaming&&i.jsx("span",{className:"caret"}),s.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(yp,{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(oj,{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:["↑",jx(s.inputTokens)," ↓",jx(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 aj=500;function ij({item:s,userIndex:l,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[p,m]=y.useState(s.text),x=y.useRef(null),_=kf("(max-width: 860px)"),j=y.useRef(null);function v(C,Z){o({x:C,y:Z})}function A(C){C.preventDefault(),v(C.clientX,C.clientY)}function T(C){const Z=C.touches[0];if(!Z)return;const ae={timer:0,x:Z.clientX,y:Z.clientY,fired:!1};ae.timer=window.setTimeout(()=>{ae.fired=!0,v(ae.x,ae.y)},aj),j.current=ae}function M(C){const Z=j.current,ae=C.touches[0];!Z||!ae||Math.hypot(ae.clientX-Z.x,ae.clientY-Z.y)>10&&(window.clearTimeout(Z.timer),j.current=null)}function z(C){const Z=j.current;Z&&(window.clearTimeout(Z.timer),Z.fired&&C.preventDefault())}function G(){m(s.text),h(!0)}function Q(){h(!1)}function Y(){const C=p.trim();C===""&&!(s.images&&s.images.length>0)||(r==null||r(l,C,s.images),h(!1))}y.useEffect(()=>{const C=x.current;!C||!d||(C.style.height="auto",C.style.height=`${C.scrollHeight}px`)},[p,d]),y.useEffect(()=>{if(!d)return;const C=x.current;C&&(C.focus(),C.setSelectionRange(C.value.length,C.value.length))},[d]);function D(C){if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),Q();return}C.key==="Enter"&&!C.shiftKey&&!_&&(C.preventDefault(),Y())}const K=s.images&&s.images.length>0&&i.jsx("div",{className:"msg--user__images",children:s.images.map((C,Z)=>i.jsx("img",{className:"msg--user__image",src:`data:${C.mediaType};base64,${C.data}`,alt:"Вложение"},Z))});if(d){const C=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:Z=>m(Z.target.value),onKeyDown:D,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:Q,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:Y,disabled:!C,children:"Сохранить"})]})]})]})}const H=[{id:"copy",label:"Копировать",onSelect:()=>void rc(s.text)},...r?[{id:"edit",label:"Изменить",onSelect:G}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":s.id,onContextMenu:A,onTouchStart:T,onTouchMove:M,onTouchEnd:z,onTouchCancel:z,children:[K,s.text,c&&i.jsx(Qi,{x:c.x,y:c.y,items:H,onClose:()=>o(null)})]})}function vx(s,l){const r=s.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function rj({text:s}){const[l,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return bp(s).then(h=>{d||r(cj(h))}),()=>{d=!0}},[s]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var m,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const p=((x=(m=h.parentElement)==null?void 0:m.querySelector("pre"))==null?void 0:x.textContent)??"";p!==""&&rc(p).then(_=>{if(!_)return;h.textContent=Jr,h.setAttribute("aria-label",Jr),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=tr,h.setAttribute("aria-label",tp),h.classList.remove("copybtn--done"))},xp);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const tp=`${tr} блок кода`;function cj(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",tp),o.title=tp,o.textContent=tr,c.append(o)}return l.body.innerHTML}function oj({item:s}){const[l,r]=y.useState(!1),c=s.result===null,o=Dy(s.name,s.input),d=s.name==="AskUserQuestion"?dj(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?fj(d):uj(s.input)}),i.jsx("span",{className:"tool__status",children:c?"…":s.isError?"ошибка":l?"▴":"▾"})]}),l&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(hj,{questions:d,answers:s.answers}):o?i.jsx(_p,{diff:o}):i.jsx(Sx,{text:JSON.stringify(s.input,null,2),hint:"аргументы вызова"}),s.result!==null&&(!d||s.isError)&&i.jsx(Sx,{text:s.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Sx({text:s,hint:l,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:s}),i.jsx(yp,{text:s,hint:l,className:"codeblock__copy"})]})}function uj(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 fj(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 dj(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 m=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:_,description:j,preview:v}=x;if(typeof _!="string"||typeof j!="string")return null;m.push({label:_,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:m,multiSelect:p===!0})}return r}function hj({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 jx(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}const pj="ccv.dictation.lang",wx="ru-RU";function mj(s){try{return Function.prototype.toString.call(s).includes("[native code]")}catch{return!1}}function kx(){const s=window,l=[s.SpeechRecognition,s.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(mj);return!r&&l.length>0&&ys("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function Oy(){var s;try{return((s=localStorage.getItem(pj))==null?void 0:s.trim())||wx}catch{return wx}}function ys(s,l){l===void 0?console.debug(`[dictation] ${s}`):console.debug(`[dictation] ${s}`,l)}const gj=3,bj=400,xj=5,yj=250,_j=2e3,vj=2e4;async function Sj(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const jj={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Oy()}`};function wj(s){const[l]=y.useState(()=>kx()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),p=y.useRef(!1),m=y.useRef(!1),x=y.useRef(s),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=y.useRef(null),v=y.useRef(!1),A=y.useRef(null),T=y.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=null},[]),M=y.useCallback(()=>{T();const D=async K=>{if(A.current=null,!(!p.current||v.current)){if(!K&&!await Sj()){if(ys("ждём ответа на запрос доступа к микрофону"),!p.current||v.current)return;A.current=setTimeout(()=>void D(!0),vj);return}ys("движок не ответил на start()"),p.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};A.current=setTimeout(()=>void D(!1),_j)},[T]);y.useEffect(()=>{x.current=s}),y.useEffect(()=>{const D=kx();if(!D)return;const K=new D;return K.lang=Oy(),K.continuous=!0,K.interimResults=!0,K.onstart=()=>{ys("сессия открыта"),v.current=!0,T(),c(!0)},K.onaudiostart=()=>{ys("пошёл звук с микрофона"),_.current.audio=!0},K.onresult=H=>{var be;if(m.current)return;let C="",Z="";for(let W=H.resultIndex;W<H.results.length;W++){const ue=H.results[W];if(!ue)continue;const Se=((be=ue[0])==null?void 0:be.transcript)??"";ue.isFinal?C+=Se:Z+=Se}const ae=_.current;ae.heard=!0,ae.everHeard=!0,ys("распознано",{final:C,interim:Z}),x.current(C,Z)},K.onerror=H=>{_.current.lastError=H.error,ys("ошибка движка",H.error),!(H.error==="no-speech"||H.error==="aborted")&&(p.current=!1,c(!1),d(jj[H.error]??`Распознавание не работает: ${H.error}`))},K.onend=()=>{m.current=!1,v.current=!1;const H=_.current,C=Date.now()-H.openedAt;if(ys("сессия закрыта",{мс:C,звук:H.audio,слова:H.heard,ошибка:H.lastError||null}),!p.current){c(!1);return}if(H.dead=!H.audio&&C<bj?H.dead+1:0,H.dead>=xj){p.current=!1,c(!1),d(H.lastError?`Распознавание не работает: ${H.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}H.silent=H.heard?0:H.silent+1,!H.everHeard&&!H.warned&&H.silent>=gj&&(H.warned=!0,d(H.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!p.current){H.openedAt=Date.now(),H.audio=!1,H.heard=!1,H.lastError="",M();try{K.start()}catch{}}},yj)},h.current=K,()=>{p.current=!1,j.current&&clearTimeout(j.current),j.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 D;if(p.current){if(p.current=!1,ys("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,T(),!v.current){c(!1);return}(D=h.current)==null||D.stop()}},[]),G=y.useCallback(()=>{const D=h.current;if(D){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),p.current=!0,m.current=!1,j.current&&clearTimeout(j.current),j.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),ys("включение микрофона",{язык:D.lang}),M();try{D.start()}catch(K){ys("start() не прошёл",K)}}},[M]),Q=y.useCallback(()=>{p.current?z():G()},[G,z]),Y=y.useCallback(()=>{var D;p.current&&v.current&&(m.current=!0,(D=h.current)==null||D.abort())},[]);return{supported:l,listening:r,error:o,toggle:Q,stop:z,drop:Y}}const kj="(max-width: 860px)",Nx=/^\/(\S*)$/,Nj=new Set(["model","permissions"]);function Tj(s){return Nj.has(s.name)||s.name.startsWith("__")}const Ej=new Set(["clear","rename"]),Tx=/(?:^|\s)@([^\s@]*)$/,Aj=200,Cj=100,Rj=190,Mj=5,Dj=20*1024*1024,Oj=1568,Lj=.85;let Ex=0;async function zj(s){var j,v;if(!s.type.startsWith("image/")||s.size>Dj)return null;const l=await Uj(s);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,Oj/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=(j=l.image).close)==null||v.call(j);const p=s.type==="image/png",m=p?"image/png":"image/jpeg",x=d.toDataURL(m,p?void 0:Lj),_=x.slice(x.indexOf(",")+1);return _?(Ex+=1,{id:`att${Ex}`,mediaType:m,data:_,previewUrl:x}):null}async function Uj(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 Ly({disabled:s,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:p,sendLabel:m="Отправить",autoFocus:x=!1,attachmentsEnabled:_=!0,onContextSearch:j,onCommand:v,onSend:A,onInterrupt:T,onEscape:M}){var He;const z=kf(kj),[G,Q]=y.useState(()=>p?vh(p):""),[Y,D]=y.useState(!1),[K,H]=y.useState(0),C=y.useRef(null),Z=y.useRef(null),ae=y.useRef(null),[be,W]=y.useState(()=>p?vh(p).length:0),[ue,Se]=y.useState([]),Re=y.useRef(null),Ce=y.useCallback(U=>{!_||U.length===0||Promise.all(U.map(zj)).then(J=>{const ye=J.filter(Ge=>Ge!==null);ye.length!==0&&Se(Ge=>[...Ge,...ye].slice(0,Mj))})},[_]);function E(U){Se(J=>J.filter(ye=>ye.id!==U))}function re(U){var Ge;if(!_)return;const J=(Ge=U.clipboardData)==null?void 0:Ge.items;if(!J)return;const ye=[];for(const ft of J){if(!ft.type.startsWith("image/"))continue;const bl=ft.getAsFile();bl&&ye.push(bl)}ye.length!==0&&(U.preventDefault(),Ce(ye))}function O(U){const J=U.target.files?Array.from(U.target.files):[];U.target.value="",Ce(J)}y.useEffect(()=>{_||Se([])},[_]);const[ge,xe]=y.useState([]),[N,X]=y.useState(-1),ie=y.useRef(""),[he,ke]=y.useState(""),ve=wj(y.useCallback((U,J)=>{U&&Q(ye=>Uh(ye,U)),ke(J.trim())},[])),De=he?Uh(G,he):G;y.useEffect(()=>{ve.listening||he===""||(Q(U=>Uh(U,he)),ke(""))},[ve.listening,he]),y.useEffect(()=>{var U;x&&((U=C.current)==null||U.focus())},[x]);const vt=y.useRef(new Map),Xe=y.useRef(new Map),Ve=y.useRef(p),$e=y.useRef({text:G,caret:be});$e.current={text:G,caret:be};const tn=y.useCallback((U,J,ye)=>{J===""?(vt.current.delete(U),Xe.current.delete(U)):(vt.current.set(U,J),Xe.current.set(U,ye)),E0(U,J)},[]),it=ve.drop;y.useLayoutEffect(()=>{const U=Ve.current;if(U===p)return;Ve.current=p,U&&tn(U,$e.current.text,$e.current.caret);const J=p?vt.current.get(p)??vh(p):"",ye=p?Xe.current.get(p):void 0,Ge=Math.min(ye??J.length,J.length);Q(J),W(Ge),ae.current=[Ge,Ge],ke(""),H(0),D(!1),X(-1),ie.current="",Se([]),it()},[p,tn,it]),y.useEffect(()=>{p&&tn(p,G,be)},[p,G,be,tn]);const dn=s?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",ut=y.useRef(0),hn=y.useCallback(U=>{const J=parseFloat(getComputedStyle(U).maxHeight),ye=Number.isFinite(J)&&J>0?J:Rj;U.style.height="auto";const Ge=U.scrollHeight;U.style.height=`${Math.min(Ge,ye)}px`,U.style.overflowY=Ge>ye?"auto":"hidden"},[]);y.useEffect(()=>{const U=C.current;U&&hn(U)},[De,dn,s,hn]),y.useLayoutEffect(()=>{const U=C.current,J=ae.current;!U||!J||(ae.current=null,U.setSelectionRange(J[0],J[1]))}),y.useEffect(()=>{const U=C.current;if(!U)return;const J=new ResizeObserver(([ye])=>{const Ge=ye==null?void 0:ye.contentRect.width;Ge===void 0||Math.abs(Ge-ut.current)<1||(ut.current=Ge,hn(U))});return J.observe(U),()=>J.disconnect()},[hn]);const En=ve.stop;y.useEffect(()=>{s&&En()},[s,En]);const Sn=y.useMemo(()=>ve.error?{ok:!1,message:ve.error}:null,[ve.error]),nn=y.useMemo(()=>{var ye;const U=(ye=Nx.exec(G))==null?void 0:ye[1];if(U===void 0)return[];const J=U.toLowerCase();return r.filter(Ge=>!Tj(Ge)&&Hh(Ge,J)<zy).sort((Ge,ft)=>Hh(Ge,J)-Hh(ft,J))},[G,r]),nt=!Y&&nn.length>0,Pe=Math.min(K,nn.length-1),ln=Y?null:((He=Tx.exec(De.slice(0,be)))==null?void 0:He[1])??null,Kt=y.useRef(j);Kt.current=j,y.useEffect(()=>{if(ln===null||ln===""||ln.endsWith("/")){Kt.current(ln);return}const U=setTimeout(()=>Kt.current(ln),Aj);return()=>clearTimeout(U)},[ln]);const lt=ln!==null&&(o==null?void 0:o.query)===ln,Et=lt?o.entries:[],Zt=ln!==null,on=Zt&&!lt,At=Math.min(K,Math.max(Et.length-1,0));y.useEffect(()=>{var J,ye;if(!nt&&!Zt)return;const U=nt?Pe:At;(ye=(J=Z.current)==null?void 0:J.children[U])==null||ye.scrollIntoView({block:"nearest"})},[nt,Zt,Pe,At]);function jn(U,J){var ye;Q(U),W(J),ae.current=[J,J],H(0),D(!1),he!==""&&(ke(""),ve.drop()),(ye=C.current)==null||ye.focus()}function $t(){Q(""),ke(""),H(0),W(0),D(!1),X(-1),ie.current="",Se([]),ve.drop(),p&&tn(p,"",0)}function pn(U){const J=U.trim();J===""&&ue.length===0||s||(A(J,ue.length>0?ue.map(ye=>({mediaType:ye.mediaType,data:ye.data})):void 0),J!==""&&xe(ye=>[J,...ye.filter(Ge=>Ge!==J)].slice(0,Cj)),$t())}function Hn(U){if(U<-1||U>=ge.length)return;N===-1&&(ie.current=G);const J=U===-1?ie.current:ge[U]??"";X(U),jn(J,J.length)}function Qt(){var Ge;const U=((Ge=C.current)==null?void 0:Ge.selectionStart)??De.length,ye=`${U>0&&!/\s$/.test(De.slice(0,U))?" ":""}@`;jn(De.slice(0,U)+ye+De.slice(U),U+ye.length)}function rt(U){var ft;const J=(ft=Tx.exec(De.slice(0,be)))==null?void 0:ft[1];if(J===void 0)return;const ye=be-J.length-1,Ge=U.kind==="dir"?`@${U.path}/`:`@${U.path} `;jn(De.slice(0,ye)+Ge+De.slice(be),ye+Ge.length)}function Ot(){var J;const U=(J=Nx.exec(De.trim()))==null?void 0:J[1];if(U&&v(U)){$t();return}pn(De)}function We(U,J){Q(U),W(J),H(0),D(!1),X(-1),he!==""&&(ke(""),ve.drop())}function gl(U){var Ge;const J=Ej.has(U.name)?c:null,ye=`/${U.name} `;Q(ye+(J??"")),W(ye.length+((J==null?void 0:J.length)??0)),J&&(ae.current=[ye.length,ye.length+J.length]),H(0),(Ge=C.current)==null||Ge.focus()}function ee(U){if(v(U.name)){Q(""),H(0),D(!1);return}U.argumentHint?gl(U):pn(`/${U.name}`)}function pe(U){if(nt){if(U.key==="ArrowDown")return U.preventDefault(),H(J=>(Math.min(J,nn.length-1)+1)%nn.length);if(U.key==="ArrowUp"){U.preventDefault();const J=nn.length-1;return H(ye=>(Math.min(ye,J)+J)%nn.length)}if(U.key==="Enter"&&!U.shiftKey){U.preventDefault();const J=nn[Pe];J&&ee(J);return}if(U.key==="Tab"){U.preventDefault();const J=nn[Pe];J&&gl(J);return}if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),D(!0);return}}if(Zt){if(U.key==="ArrowDown"&&Et.length>0)return U.preventDefault(),H(J=>(Math.min(J,Et.length-1)+1)%Et.length);if(U.key==="ArrowUp"&&Et.length>0){U.preventDefault();const J=Et.length-1;return H(ye=>(Math.min(ye,J)+J)%Et.length)}if(U.key==="Enter"&&!U.shiftKey||U.key==="Tab"){const J=Et[At];if(J){U.preventDefault(),rt(J);return}if(U.key==="Tab")return}if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),D(!0);return}}if((U.key==="ArrowUp"||U.key==="ArrowDown")&&!U.shiftKey){const J=U.currentTarget,ye=J.selectionStart;if(J.selectionEnd===ye){const ft=U.key==="ArrowUp"?N+1:N-1;ft>=-1&&ft<ge.length&&requestAnimationFrame(()=>{J.selectionStart===ye&&J.selectionEnd===ye&&Hn(ft)})}}if(U.key==="Escape"&&M){U.preventDefault(),U.stopPropagation(),M();return}U.key==="Enter"&&!U.shiftKey&&!z&&(U.preventDefault(),Ot())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(sr,{result:Sn}),Zt&&!nt&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:Z,children:[Et.map((U,J)=>i.jsxs("button",{role:"option","aria-selected":J===At,className:J===At?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(J),onMouseDown:ye=>{ye.preventDefault(),rt(U)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[U.name,U.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:U.path}),U.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},U.path)),Et.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:on?"ищем…":ln?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),nt&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:Z,children:nn.map((U,J)=>i.jsxs("button",{role:"option","aria-selected":J===Pe,className:J===Pe?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(J),onMouseDown:ye=>{ye.preventDefault(),ee(U)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",U.name]}),U.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:U.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:U.description})]},U.name))}),ue.length>0&&i.jsx("div",{className:"composer__attachments",children:ue.map(U=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:U.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>E(U.id),children:i.jsx(Yj,{})})]},U.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(Ij,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Re,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:O}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:s,onClick:()=>{var U;return(U=Re.current)==null?void 0:U.click()},children:i.jsx(Gj,{})})]}),i.jsx("textarea",{ref:C,value:De,disabled:s,placeholder:dn,onChange:U=>We(U.target.value,U.target.selectionStart),onSelect:U=>W(U.currentTarget.selectionStart),onKeyDown:pe,onPaste:re}),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(Xj,{on:ve.listening})}),l?i.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Ot,disabled:s||De.trim()===""&&ue.length===0,"aria-label":m,title:m,children:[i.jsx("span",{className:"sendbtn__label",children:m}),i.jsx(qj,{})]})]})]})})}function Uh(s,l){const r=l.trim();if(r==="")return s;const c=np(r).slice(Hj(s,r)).join(" ");return c===""?s:s===""||/\s$/.test(s)?s+c:`${s} ${c}`}function Hj(s,l){const r=np(s),c=np(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>Bj(d,c[h]??"")))return o;return 0}function np(s){return s.split(/\s+/).filter(l=>l!=="")}function Bj(s,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(s)===r(l)}function Ij(){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 qj(){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 Gj(){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 Yj(){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 Xj({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 zy=4;function Hh(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:zy}function Vj({request:s,queued:l,onDecide:r}){const c=Dy(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(_p,{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 $j({request:s,queued:l,onAnswer:r,onDecline:c}){const{questions:o}=s,[d,h]=y.useState(()=>o.map(()=>new Set)),[p,m]=y.useState(()=>o.map(()=>"")),[x,_]=y.useState(()=>Ax(o));y.useEffect(()=>{h(o.map(()=>new Set)),m(o.map(()=>"")),_(Ax(o))},[s.requestId]);const j=y.useMemo(()=>Kj(o,d,p),[o,d,p]),v=j!==null;function A(Y,D){var K,H;(H=(K=o[Y])==null?void 0:K.options[D])!=null&&H.preview&&_(C=>{const Z=C.slice();return Z[Y]=D,Z})}function T(Y,D,K){h(H=>{const C=H.slice(),Z=new Set(C[Y]);return K?Z.has(D)?Z.delete(D):Z.add(D):Z.has(D)||(Z.clear(),Z.add(D)),C[Y]=Z,C}),D!=="other"&&A(Y,D)}function M(Y,D){m(K=>{const H=K.slice();return H[Y]=D,H})}function z(){j&&r(s.requestId,j)}function G(Y){Y.key==="Enter"&&(Y.target.closest("button")||v&&(Y.preventDefault(),z()))}function Q(Y){var C;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Y.key))return;const D=Array.from(Y.currentTarget.querySelectorAll("button.qsheet__option")),K=D.indexOf(document.activeElement);if(K===-1)return;Y.preventDefault();const H=Y.key==="ArrowDown"||Y.key==="ArrowRight"?1:-1;(C=D[(K+H+D.length)%D.length])==null||C.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:G,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[s.reason&&i.jsx("p",{className:"qsheet__reason",children:s.reason}),o.map((Y,D)=>i.jsx(Qj,{q:Y,qi:D,selected:d[D]??new Set,otherText:p[D]??"",previewIndex:x[D]??null,onToggle:T,onFocusOption:A,onOtherText:M,onOptionsKeyDown:Q},D))]}),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 Qj({q:s,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:p,onOptionsKeyDown:m}){var A;const x=s.options.some(T=>T.preview),_=o!==null?(A=s.options[o])==null?void 0:A.preview:void 0,j=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:m,children:[s.options.map((T,M)=>{const z=r.has(M);return i.jsxs("button",{type:"button",role:v,"aria-checked":z,className:"qsheet__option"+(z?" is-selected":""),onClick:()=>d(l,M,s.multiSelect),onFocus:()=>h(l,M),onMouseEnter:()=>h(l,M),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})]})]},M)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(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:"Свой вариант ответа"})]})]}),j&&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 Ax(s){return s.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function Kj(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 m=0;m<d.options.length;m++){const x=d.options[m];x&&h.has(m)&&p.push(x.label)}if(h.has("other")){const m=(r[o]??"").trim();m&&p.push(m)}if(p.length===0)return null;c[d.question]=p.join(", ")}return c}function Zj({request:s,plan:l,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(l),[p,m]=y.useState("preview");y.useEffect(()=>{h(l),m("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(Jj,{})}),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:()=>m("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(p==="source"?" is-on":""),role:"tab","aria-selected":p==="source",onClick:()=>m("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(Fj,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(s.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!x,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function Fj({text:s}){const[l,r]=y.useState("");return y.useEffect(()=>{let c=!1;return bp(s).then(o=>{c||r(o)}),()=>{c=!0}},[s]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function Jj(){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 Wj(s,l){if(s!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function Uy({path:s}){const[l,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!l)return;function p(m){var x;(x=d.current)!=null&&x.contains(m.target)||r(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),y.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),xp);return()=>clearTimeout(p)},[c]),y.useEffect(()=>r(!1),[s]);async function h(){await rc(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(Pj,{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?Jr:tr})]})]})}function Pj({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 ew=["low","medium","high"];function Hy({models:s,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,className:h,onModel:p,onEffort:m,onUltracode:x,onThinking:_,onSwitchOnFlag:j}){const[v,A]=y.useState(!1),[T,M]=y.useState(0),z=y.useRef(null),G=y.useRef(null),Q=s.find(C=>C.value===l)??null,Y=Q&&Q.supportsEffort?Q.effortLevels.length>0?Q.effortLevels:ew:[],D=Y.includes("xhigh");y.useEffect(()=>{if(!v)return;const C=s.findIndex(Z=>Z.value===l);M(C===-1?0:C)},[v]),y.useEffect(()=>{if(!v)return;function C(Z){var ae;(ae=z.current)!=null&&ae.contains(Z.target)||A(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[v]),y.useEffect(()=>{var C,Z;v&&((Z=(C=G.current)==null?void 0:C.querySelector(".is-cursor"))==null||Z.scrollIntoView({block:"nearest"}))},[v,T]);function K(C){A(!1),C.value!==l&&p(C.value)}function H(C){if(C.key==="Escape"){if(!v)return;C.preventDefault(),C.stopPropagation(),A(!1);return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){if(C.preventDefault(),!v)return A(!0);if(s.length===0)return;const Z=C.key==="ArrowDown"?1:s.length-1;return M(ae=>(ae+Z)%s.length)}if(C.key==="Enter"||C.key===" "){if(C.preventDefault(),!v)return A(!0);const Z=s[T];Z&&K(Z)}}return i.jsxs("div",{ref:z,className:"select"+(v?" select--open":"")+(h?` ${h}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":v,onClick:()=>A(C=>!C),onKeyDown:H,children:[i.jsx("span",{className:"select__value",children:(Q==null?void 0:Q.displayName)??l??"—"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):Y.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(tw,{})]}),v&&i.jsxs("div",{ref:G,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),s.map((C,Z)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":C.value===l,className:"select__option"+(Z===T?" is-cursor":"")+(C.value===l?" is-on":""),onMouseEnter:()=>M(Z),onClick:()=>K(C),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:C.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:C.displayName}),C.description&&i.jsx("span",{className:"select__hint",children:C.description})]},C.value)),Y.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:Y.map(C=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":C===r,className:C===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>m(C),children:C},C))})]}),D&&i.jsx(Bh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>x(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(Q==null?void 0:Q.supportsThinking)!==!1&&i.jsx(Bh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>_(!o)}),i.jsx(Bh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>j(!d)})]})]})}function Bh({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 tw(){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 Ll({title:s,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function p(m){if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),d();return}if(m.key!=="Tab")return;const x=h.current;if(!x)return;const _=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=_[0],v=_[_.length-1];!j||!v||(m.shiftKey&&document.activeElement===j?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),j.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 nw({candidates:s,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:p,onAskAgent:m,onInterrupt:x,onSubmit:_,onCreate:j,onClose:v}){const[A,T]=y.useState("open"),[M,z]=y.useState(""),[G,Q]=y.useState(!1),[Y,D]=y.useState(""),[K,H]=y.useState(""),[C,Z]=y.useState({git:!0,claudeMd:!0,readme:!0}),ae=M.trim(),be=ae!=="",W=Y.trim(),ue=K.trim(),Se=W!==""&&ue!=="";y.useEffect(()=>{Y===""&&d.length>0&&D(d[0])},[d]);const Re=y.useRef(p);Re.current=p,y.useEffect(()=>{if(A!=="open")return;const O=M.trim(),ge=setTimeout(()=>Re.current(O),200);return()=>clearTimeout(ge)},[M,A]);function Ce(){be&&_(ae)}function E(){Se&&j(W,ue,C)}function re(){be&&(Q(!0),m(ae))}return h?i.jsxs(Ll,{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(O=>i.jsx("li",{children:O},O))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Ll,{title:"Новый проект",className:G&&A==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),A==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!be,onClick:re,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!be,onClick:Ce,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!Se,onClick:E,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Cx,{label:"Открыть",on:A==="open",onClick:()=>T("open")}),i.jsx(Cx,{label:"Создать",on:A==="create",onClick:()=>T("create")})]}),A==="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:M,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:O=>z(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),Ce())}}),o&&i.jsx("p",{className:"modal__error",children:o}),s.length>0&&i.jsx("ul",{className:"finds",children:s.map(O=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:O.open,title:O.open?"Этот проект уже открыт":O.path,onClick:()=>z(O.path),onDoubleClick:()=>_(O.path),children:[i.jsx("span",{className:"find__name",children:O.name}),i.jsx("span",{className:"find__path",children:O.path}),i.jsx("span",{className:"find__note",children:aw(O)})]})},O.path))}),s.length===0&&be&&!l&&!G&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),G&&i.jsx("div",{className:"finds__agent",children:i.jsx(vp,{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:Y,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:O=>D(O.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(O=>i.jsx("button",{type:"button",className:O===W?"newproj__root is-on":"newproj__root",title:O,onClick:()=>D(O),children:sw(O)},O))}),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:O=>H(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),E())}}),i.jsx("p",{className:"newproj__preview",children:Se?lw(W,ue):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Ih,{label:"git init",desc:"панель истории работает сразу",on:C.git,onToggle:()=>Z(O=>({...O,git:!O.git}))}),i.jsx(Ih,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:C.claudeMd,onToggle:()=>Z(O=>({...O,claudeMd:!O.claudeMd}))}),i.jsx(Ih,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:C.readme,onToggle:()=>Z(O=>({...O,readme:!O.readme}))})]})]})]})}function Cx({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 Ih({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 lw(s,l){const r=s.includes("\\")?"\\":"/";return s.replace(/[\\/]+$/,"")+r+l}function sw(s){const l=s.includes("\\")?"\\":"/",r=s.split(/[\\/]/).filter(Boolean);return r.length<=2?s:`…${l}${r.slice(-2).join(l)}`}function aw(s){return s.open?"уже открыт":s.why?s.why:s.sessions===0?"рядом с вашими проектами":`${iw(s.sessions)}${rw(s.lastUsedAt)}`}function iw(s){const l=s%10,r=s%100;return r>=11&&r<=14?`${s} сессий`:l===1?`${s} сессия`:l>=2&&l<=4?`${s} сессии`:`${s} сессий`}function rw(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 Sp=7;function cw(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=Rx(l),l[h]=o.hash);const[p,...m]=o.parents;l[h]=p??null;const x=[];p!==void 0&&x.push({from:h,to:h});for(const v of m){let A=l.indexOf(v);A===-1&&(A=Rx(l),l[A]=v),x.push({from:h,to:A})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const A=d[v];!A||A===o.hash||v===h||l[v]===A&&j.push(v)}ow(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:_,down:x,through:j})}return{rows:r,columns:Math.min(c,Sp)}}function Rx(s){const l=s.indexOf(null);return l!==-1?l:(s.push(null),s.length-1)}function ow(s){for(;s.length>0&&s[s.length-1]===null;)s.pop()}const By=1500;function uw(s){const l=[];let r=!1;for(const c of s.patch.split(`
|
|
119
|
+
`)){if(l.length>=By){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:fw(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:dw(s,r)}}function fw(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 dw(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(`показаны первые ${By} строк`),r.length>0?r.join(" · "):null}function hw({open:s,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:p,onPush:m,onPull:x,onPublish:_,onConnectRemote:j,onDismissResult:v,onClose:A,zoomed:T,onToggleZoom:M}){const z=cw((l==null?void 0:l.commits)??[]),G=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(Q=>({value:Q.name,label:Q.name,hint:Q.hash.slice(0,8)}))];return i.jsxs("aside",{className:(s?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:Q=>{M&&(Q.target.closest("button")||M())},children:[i.jsx(xw,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),M&&i.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:M,children:i.jsx(oc,{active:T})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:A,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(Ss,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:G,onChange:Q=>{Q&&p(Q,`ветку ${Q}`)}})}),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(Sw,{}),o]}):l.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:m,children:[i.jsx(yw,{}),"Отправить",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(_w,{}),"Забрать",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(vw,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(Dx,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${kw(l.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(Q=>ww(Q.path)).join(", "):"незакоммиченных изменений нет"})]})}),z.rows.map(Q=>i.jsx(pw,{row:Q,columns:z.columns,head:Q.commit.hash===l.head,local:l.hasRemote&&!Q.commit.pushed,active:c===Q.commit.hash,onOpen:()=>h(Q.commit.hash)},Q.commit.hash)),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(Dx,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(sr,{result:r,onDismiss:v})]})}const ho=50,Mx=13;function pw({row:s,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=s,p=h.refs.map(jw).filter(Boolean);return i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[i.jsx(mw,{row:s,columns:l,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[p.map(m=>i.jsx("span",{className:"gitrow__ref",children:m},m)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Nw(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function mw({row:s,columns:l,head:r,local:c}){const o=l*Mx+6,d=ho/2,h=x=>8+Math.min(x,Sp-1)*Mx,p=c?"3.5 2.5":void 0,m=af(s.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:ho,viewBox:`0 0 ${o} ${ho}`,"aria-hidden":"true",children:[s.through.map(x=>i.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:ho,style:{stroke:af(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:af(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)} ${ho}`,fill:"none",style:{stroke:af(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:m,fill:c?void 0:m}})]})}function af(s){return`var(--lane-${s%Sp})`}function gw({detail:s,local:l,onCheckout:r,onClose:c}){const o=s.hash==="";return i.jsxs(Ll,{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}>`," · ",Tw(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(bw,{file:d,defaultOpen:s.files.length<=3},d.path+d.oldPath))]})}function bw({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(_p,{diff:uw(s)})]})}function xw(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function yw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function _w(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function vw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"m13 13-2.6-2.6"})]})}function Dx(){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 Sw(){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 jw(s){return s.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function ww(s){const l=s.split("/");return l[l.length-1]??s}function kw(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 Nw(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 Tw(s){const l=Date.parse(s);return Number.isNaN(l)?s:new Date(l).toLocaleString()}function Ox(s){return s.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Ew({status:s,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:p,onSaveToken:m,onPublish:x,onDismissResult:_,onClose:j}){var O;const[v,A]=y.useState(()=>Ox(c)),[T,M]=y.useState(""),[z,G]=y.useState(""),[Q,Y]=y.useState(!0),[D,K]=y.useState("Первый коммит"),[H,C]=y.useState(null),[Z,ae]=y.useState("");y.useEffect(()=>{!T&&l.length>0&&M(l[0].login)},[T,l]),y.useEffect(()=>{r&&H===null&&C(new Set(r.files))},[r,H]);const be=(s==null?void 0:s.connected)===!0,W=l.map(ge=>({value:ge.login,label:ge.login,hint:ge.kind==="org"?"организация":void 0})),ue=y.useMemo(()=>{if(!r)return[];const ge=Z.trim().toLowerCase();return ge?r.files.filter(xe=>xe.toLowerCase().includes(ge)):r.files},[r,Z]),Se=(H==null?void 0:H.size)??0,Re=be&&v.trim()!==""&&T!==""&&d===""&&(o||Se>0);function Ce(ge){C(xe=>{const N=new Set(xe??[]);return N.has(ge)?N.delete(ge):N.add(ge),N})}function E(ge){C(xe=>{const N=new Set(xe??[]);for(const X of ue)ge?N.add(X):N.delete(X);return N})}function re(){if(!Re)return;const ge=(r==null?void 0:r.files)??[];x({owner:T,name:v.trim(),description:z.trim(),private:Q,include:o?[]:ge.filter(xe=>H==null?void 0:H.has(xe)),ignore:o?[]:ge.filter(xe=>!(H!=null&&H.has(xe))),message:o?"":D.trim()||"Первый коммит"})}return i.jsxs(Ll,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!Re,onClick:re,children:d||"Опубликовать"})]}),children:[i.jsx(Aw,{status:s,onRefreshStatus:p,onSaveToken:m}),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:ge=>A(Ox(ge.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(Ss,{className:"settings__select",value:T,options:W,onChange:M,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((O=l[0])==null?void 0:O.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:z,placeholder:"о чём проект — одной строкой",onChange:ge=>G(ge.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(Lx,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:Q,onClick:()=>Y(!0)}),i.jsx(Lx,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!Q,onClick:()=>Y(!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:[Se," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>E(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>E(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:Z,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:ge=>ae(ge.target.value)}),i.jsx("div",{className:"publish__filelist",children:ue.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ue.map(ge=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(H==null?void 0:H.has(ge))===!0,className:"publish__file",onClick:()=>Ce(ge),children:[i.jsx("span",{className:"publish__box"+(H!=null&&H.has(ge)?" is-on":""),"aria-hidden":"true",children:(H==null?void 0:H.has(ge))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:ge})]},ge))}),r.truncated&&i.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Сообщение коммита"}),i.jsx("input",{className:"input",value:D,onChange:ge=>K(ge.target.value)})]})]})]}),i.jsx(sr,{result:h,onDismiss:_})]})}function Lx({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 Aw({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(Cw,{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 Cw({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(Mw,{}):i.jsx(Rw,{})})]})}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:"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 Mw(){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 Dw({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(Ll,{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:m=>h(m.target.value),onKeyDown:m=>{m.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(sr,{result:l,onDismiss:c})]})}function Ow({open:s,items:l,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:p,model:m,effort:x,ultracode:_,thinking:j,switchOnFlag:v,onContextSearch:A,onCommand:T,onModel:M,onEffort:z,onUltracode:G,onThinking:Q,onSwitchOnFlag:Y,onAsk:D,onInterrupt:K,onReset:H,onClose:C,zoomed:Z,onToggleZoom:ae}){return i.jsxs("aside",{className:(s?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(Z?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:be=>{ae&&(be.target.closest("button")||ae())},children:[i.jsx(Lw,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:H,children:"↻"}),ae&&i.jsx("button",{className:"sidepane__btn",title:Z?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Z?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":Z,onClick:ae,children:i.jsx(oc,{active:Z})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:C,children:"✕"})]}),p.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Hy,{className:"select--compact",models:p,value:m,effort:x,ultracode:_,thinking:j,switchOnFlag:v,onModel:M,onEffort:z,onUltracode:G,onThinking:Q,onSwitchOnFlag:Y}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(vp,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(Ly,{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:A,onCommand:T,onSend:D,onInterrupt:K,onEscape:r?K:C})]})}function Lw(){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 zw=75,Uw=90;function Iy({usage:s}){if(!(s!=null&&s.available))return null;const l=[];return s.fiveHour&&l.push({key:"five",label:"5 ч",window:s.fiveHour}),s.sevenDay&&l.push({key:"week",label:"нед",window:s.sevenDay}),l.length===0?null:i.jsx("div",{className:"usage",title:Iw(s),"aria-label":`Расход лимитов плана${s.plan?` ${s.plan}`:""}`,children:l.map(r=>i.jsx(Hw,{label:r.label,window:r.window},r.key))})}function Hw({label:s,window:l}){const r=Math.round(l.utilization),c=qw(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${Bw(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:Yy(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Bw(s){return s>=Uw?" usage__fill--over":s>=zw?" usage__fill--warn":""}function Iw(s){const l=[s.plan?`Лимиты плана ${s.plan}`:"Лимиты плана"],r=(c,o)=>{if(!o)return;const d=Yy(o.resetsAt);l.push(`${c}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return r("5 часов",s.fiveHour),r("Неделя",s.sevenDay),r("Неделя, Opus",s.sevenDayOpus),l.join(`
|
|
120
|
+
`)}function qy(s){if(!s)return null;const l=new Date(s);return Number.isNaN(l.getTime())?null:l}function Gy(s){return s.getTime()-Date.now()<1440*60*1e3}function qw(s){const l=qy(s);return l?Gy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function Yy(s){const l=qy(s);return l?`обнулится ${Gy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function Xy(){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:Gw(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 Gw(s){return s.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Yw({onClose:s,permission:l,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:p,metersFetchedAt:m,onRename:x,onStop:_}){return i.jsx(Ll,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:s,children:i.jsxs("div",{className:"sessionmenu",children:[l&&i.jsx(Vr,{label:"Режим прав",children:l}),i.jsx(Vr,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay)&&i.jsx(Vr,{label:"Лимиты плана",children:i.jsx(Iy,{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(Xw,{}),i.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",m&&i.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(m).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsx(Vr,{label:"Время",children:i.jsx(Xy,{})}),d&&i.jsx(Vr,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(Vr,{label:"Каталог проекта",children:i.jsx(Uy,{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 Vr({label:s,children:l}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:s}),l]})}function Xw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("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 Vw({tab:s,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:p,onClose:m}){const x=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Ll,{title:"Расширения",className:"modal--wide",onClose:m,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($w,{servers:l,actions:h}),s==="plugins"&&i.jsx(Jw,{plugins:r,marketplaces:c,actions:h}),s==="catalog"&&i.jsx(Ww,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>p("plugins")}),i.jsx(sr,{result:d})]})}function $w({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--${Kw(o.status)}`,children:Qw[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(Zw,{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 Qw={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Kw(s){return s==="connected"?"ok":s==="failed"?"bad":s==="needs-auth"?"warn":"mute"}function Zw({onSubmit:s,onCancel:l}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,p]=y.useState(""),[m,x]=y.useState(""),[_,j]=y.useState(""),v=o==="stdio",A=r.trim()!==""&&(v?h.trim()!=="":m.trim()!=="");function T(){if(A)if(v){const[M,...z]=Fw(h);s(r.trim(),{transport:"stdio",command:M??"",args:z,env:zx(_)})}else s(r.trim(),{transport:o,url:m.trim(),headers:zx(_)})}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:M=>c(M.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Ss,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:M=>d(M)}),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:M=>p(M.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:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:M=>x(M.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:M=>j(M.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!A,onClick:T,children:"Подключить"})]})]})}function zx(s){const l={};for(const r of s.split(`
|
|
121
|
+
`)){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 Fw(s){return(s.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function Jw({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 po=30;function Ww({catalog:s,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,p]=y.useState(""),[m,x]=y.useState(po),[_,j]=y.useState(""),v=y.useMemo(()=>[...new Set(s.map(M=>M.category).filter(Boolean))].sort(),[s]),A=y.useMemo(()=>{const T=o.trim().toLowerCase();return s.filter(M=>h&&M.category!==h?!1:T?`${M.name} ${M.displayName} ${M.description} ${M.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(po)}}),i.jsx(Ss,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{p(T),x(po)}})]}),A.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:A.slice(0,m).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))}),A.length>m&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>x(T=>T+po),children:["Ещё ",Math.min(po,A.length-m)," из ",A.length-m]})}),i.jsxs("div",{className:"extform",children:[i.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>j(T.target.value),onKeyDown:T=>{T.key!=="Enter"||_.trim()===""||(T.preventDefault(),r.pluginInstall(_.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),j("")},children:"Установить"})]})]})]})}function Pw({status:s,login:l,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:p,onClose:m}){const[x,_]=y.useState(""),[j,v]=y.useState(!1),[A,T]=y.useState(!1),M=d!==null&&(s==null?void 0:s.loggedIn)===!0&&!A&&!j,z=y.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const Y=l.output.trim();return Y===""?null:{ok:!0,message:Y}},[l.error,l.output]);function G(Y=x){const D=Y.trim();D!==""&&(r.submitCode(D),_(""))}function Q(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return i.jsxs(Ll,{title:"Аккаунт",onClose:m,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:nk[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(lk,{login:l,remote:c,code:x,onCode:_,onSubmit:G,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(sr,{result:z}),A&&i.jsx("p",{className:"account__warn",role:"alert",children:ek(o)}),M&&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:[M&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
122
|
+
${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(tk,{}),"Переподключить"]}),A?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:Q,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{T(!1),v(!0)},children:"Выйти"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function ek(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 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"})]})}const nk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function lk({login:s,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,p]=y.useState(null),m=y.useRef(""),x=y.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async M=>{const{code:z,onCode:G,onSubmit:Q}=x.current;if(M&&z.trim()!=="")return;const Y=await ep();if(Y===null){M||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const D=Y.trim();if(!Ux(D)){M||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(M){if(m.current===D)return;m.current=D}p(null),G(D),Q(D)},[]);y.useEffect(()=>{if(!s.awaitingCode)return;const M=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",M),()=>document.removeEventListener("visibilitychange",M)},[s.awaitingCode,_]);const j=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!Ux(r),A=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(yp,{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:M=>{p(null),c(M.target.value)},onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),A&&i.jsx("p",{className:"account__note account__note--code",children:A})]}),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 Ux(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 sk({state:s,onPair:l,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,p]=y.useState(""),[m,x]=y.useState(!1),_=y.useRef(null),j=(s==null?void 0:s.paired)===!0;y.useEffect(()=>{var A;j||(A=_.current)==null||A.focus()},[j]),y.useEffect(()=>{x(!1),j&&d("")},[j,s==null?void 0:s.error]);const v=(s==null?void 0:s.url)??"https://claudevisual.com";return i.jsx(Ll,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Hx(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:Hx(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:A=>{A.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:A=>d(A.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:A=>p(A.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()||m,children:m?"Связываем…":"Связать"})]})]})})}function Hx(s){try{return new URL(s).host}catch{return s}}const qh="",ak=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],ik=ny.map(s=>({value:s.value,label:s.value,hint:s.hint})),rf=3600*1e3,rk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Qr={"6h":6*rf,"24h":24*rf,"48h":48*rf,"168h":168*rf,never:0};function ck(s){return Qr[s]??Qr["48h"]}const ok=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],cf=60*1e3,Kr={"5m":5*cf,"10m":10*cf,"30m":30*cf,"60m":60*cf,never:0};function uk(s){return Kr[s]??Kr["10m"]}function fk(s){const l=Object.entries(Kr).find(([,r])=>r===s);return l?l[0]:Object.keys(Kr).reduce((r,c)=>Math.abs(Kr[c]-s)<Math.abs(Kr[r]-s)?c:r)}function dk(s){const l=Object.entries(Qr).find(([,r])=>r===s);return l?l[0]:Object.keys(Qr).reduce((r,c)=>Math.abs(Qr[c]-s)<Math.abs(Qr[r]-s)?c:r)}const hk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Zr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function pk(s){return Zr[s]??Zr.off}function mk(s){const l=Object.entries(Zr).find(([,r])=>r===s);return l?l[0]:Object.keys(Zr).reduce((r,c)=>Math.abs(Zr[c]-s)<Math.abs(Zr[r]-s)?c:r)}const gk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function bk({settings:s,models:l,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:p,onClose:m}){const x=s===null,_=!x&&s.terminalEnabled===!0,j=!x&&s.liveSessionsFirst===!0,v=!_,A=y.useMemo(()=>{const M=[{value:qh,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(z=>({value:z.value,label:z.displayName,hint:z.description})):ak];return s&&s.startModel!==null&&!M.some(z=>z.value===s.startModel)&&M.push({value:s.startModel,label:s.startModel}),M},[l,s]);function T(){var M,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:"Связать компьютер"})]}):(M=r.shell)!=null&&M.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(Ll,{title:"Настройки",onClose:m,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(Ss,{className:"settings__select",value:dk(s.autoArchiveAfterMs),options:rk,onChange:M=>o({autoArchiveAfterMs:ck(M)}),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(Ss,{className:"settings__select",value:fk(s.autoStopAfterMs),options:ok,onChange:M=>o({autoStopAfterMs:uk(M)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),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(Ss,{className:"settings__select",value:mk(s.autoSaveAfterPauseMs),options:hk,onChange:M=>o({autoSaveAfterPauseMs:pk(M)}),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(Ss,{className:"settings__select",value:s.startModel??qh,options:A,onChange:M=>o({startModel:M===qh?null:M}),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(Ss,{className:"settings__select",value:s.startPermissionMode,options:ik,onChange:M=>o({startPermissionMode:M}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsx("section",{className:"settings__section",children:i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),i.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),x?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":j,"aria-label":"Запущенные сессии сверху",className:j?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!j}),children:i.jsx("span",{className:"switch__knob"})})]})}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),i.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),i.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:gk.map(M=>{const z=!x&&s.folderAccess===M.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":z,disabled:x,className:"access__card"+(z?" is-on":"")+(M.risky?" access__card--risky":""),onClick:()=>o({folderAccess:M.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:[M.title,M.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:M.description})]})]},M.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 xk=16;function yk({pane:s,width:l,onResize:r,onReset:c}){const o=Pi[s],d=y.useRef(null);function h(_){if(_.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-B0):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 j=d.current;if(!j)return;const v=o.side==="left"?_.clientX-j.x:j.x-_.clientX;r(Math.min(j.max,j.width+v))}function m(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function x(_){const j=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;j!==0&&(_.preventDefault(),r(l+j*xk*(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:m,onPointerCancel:m,onDoubleClick:c,onKeyDown:x,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const _k=16;function vk({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-Y0;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 j=_.y-x.clientY;l(_.height+j,_.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 m(x){const _=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;_!==0&&(x.preventDefault(),l(s+_*_k,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":s,"aria-valuemin":ay,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:r,onKeyDown:m,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function Bx(){const s=document.documentElement,l=getComputedStyle(s),r=Q=>l.getPropertyValue(Q).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),p=r("--accent"),m=r("--accent-fg"),x=r("--select"),_=r("--danger"),j=r("--ok"),v=r("--warn"),A=r("--cm-fn"),T=r("--cm-key"),M=r("--cm-type"),z=Ix(o,c,55),G=Q=>Ix(Q,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:m,selectionBackground:x,black:z,brightBlack:h,red:_,brightRed:G(_),green:j,brightGreen:G(j),yellow:v,brightYellow:G(v),blue:A,brightBlue:G(A),magenta:T,brightMagenta:G(T),cyan:M,brightCyan:G(M),white:d,brightWhite:o}}function Sk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Hs=null;function jk(s){return Hs||(Hs=document.createElement("span"),Hs.style.position="fixed",Hs.style.width="0",Hs.style.height="0",Hs.style.opacity="0",Hs.style.pointerEvents="none",document.body.appendChild(Hs)),Hs.style.color=s,getComputedStyle(Hs).color}function Ix(s,l,r){return jk(`color-mix(in srgb, ${s} ${100-r}%, ${l} ${r}%)`)}let of=null;function wk(){return of||(of=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 of=null,s})),of}function kk({terminals:s,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:p=!1,zoomed:m,onToggleZoom:x,onSelect:_,onOpen:j,onClose:v,onInput:A,onResize:T,onAttach:M,onHide:z,registerSink:G}){const[Q,Y]=y.useState(()=>Bx());return y.useEffect(()=>{const D=new MutationObserver(()=>Y(Bx()));return D.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>D.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(p?" termpanel--mobile":"")+(!p&&m?" termpanel--zoomed":""),style:p?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:m?void 0:{height:d},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:D=>{x&&(D.target.closest("button")||x())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:s.map(D=>i.jsxs("div",{role:"tab","aria-selected":D.id===l,className:"termtab"+(D.id===l?" is-on":"")+(D.exitCode!==null?" termtab--exited":""),onDoubleClick:K=>{x&&(K.target.closest(".termtab__close")||x())},children:[i.jsx("button",{className:"termtab__name",title:D.cwd,onClick:()=>_(D.id),children:D.title}),D.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${D.exitCode}`,children:D.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${D.title}»`,onClick:()=>v(D.id),children:"✕"})]},D.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),x&&i.jsx("button",{className:"termpanel__zoom",title:m?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":m?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":m,onClick:x,children:i.jsx(oc,{active:m})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:z,children:"✕"})]}),c&&s.length>0&&i.jsx(qx,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&s.length===0?i.jsx(qx,{message:c,onRetry:r?null:j,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):s.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),s.map(D=>i.jsx(Tk,{id:D.id,exitCode:D.exitCode,active:D.id===l,theme:Q,mobile:p,onInput:A,onResize:T,onAttach:M,registerSink:G},D.id))]})]})}function qx({message:s,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=Nk(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 Nk(s){const[l="",...r]=s.trim().split(`
|
|
123
|
+
|
|
124
|
+
`),c=l.split(`
|
|
125
|
+
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??s.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
126
|
+
|
|
127
|
+
`).trim()}}function Tk({id:s,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:p,registerSink:m}){const x=y.useRef(null),_=y.useRef(null),j=y.useRef(!1),v=y.useRef(o);v.current=o;const A=y.useRef(c),T=y.useRef(l),[M,z]=y.useState("loading"),[G,Q]=y.useState(!1);return y.useEffect(()=>{if(!x.current)return;let D=!1,K=null;z("loading"),Q(!1);const H=window.setTimeout(()=>{D||Q(!0)},200);return(async()=>{var xe;let C;try{C=await wk()}catch{window.clearTimeout(H),D||z("error");return}if(D||!x.current)return;window.clearTimeout(H);const{Terminal:Z,FitAddon:ae,WebLinksAddon:be}=C,W=new Z({fontFamily:Sk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:A.current}),ue=new ae;W.loadAddon(ue),W.loadAddon(new be),W.open(x.current),_.current=W,W.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 ie=W.getSelection();return ie?(N.preventDefault(),rc(ie),!1):!N.shiftKey}return N.key==="v"||N.key==="V"?(N.preventDefault(),ep().then(ie=>{ie&&W.paste(ie)}),!1):!0});const Se=N=>{N.preventDefault();const X=W.getSelection();if(X){rc(X),W.clearSelection();return}ep().then(ie=>{ie&&W.paste(ie)})};(xe=W.element)==null||xe.addEventListener("contextmenu",Se);const Re=W.onData(N=>d(s,N));let Ce={cols:W.cols,rows:W.rows},E=null;const re=W.onResize(({cols:N,rows:X})=>{E!==null&&window.clearTimeout(E),E=window.setTimeout(()=>{E=null,!(N===Ce.cols&&X===Ce.rows)&&(Ce={cols:N,rows:X},h(s,N,X))},100)}),O=new ResizeObserver(()=>{try{ue.fit()}catch{return}v.current&&W.scrollToBottom()});O.observe(x.current);const ge=m(s,N=>{N.kind==="buffer"&&W.reset(),W.write(N.data)});p(s),T.current!==null&&!j.current&&(j.current=!0,W.write(`\r
|
|
128
|
+
\x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
|
|
129
|
+
`)),r&&W.focus(),K=()=>{var N;E!==null&&window.clearTimeout(E),O.disconnect(),(N=W.element)==null||N.removeEventListener("contextmenu",Se),Re.dispose(),re.dispose(),ge(),W.dispose(),_.current=null},z("ready")})(),()=>{D=!0,window.clearTimeout(H),K==null||K(),K=null}},[s]),y.useEffect(()=>{if(!o)return;const Y=x.current;if(!Y)return;let D=null,K=0,H=!1;const C=W=>{W.pointerType==="mouse"||D!==null||(D=W.pointerId,K=W.clientY,H=!1)},Z=W=>{if(W.pointerId!==D)return;const ue=K-W.clientY;if(!H){if(Math.abs(ue)<4)return;H=!0,Y.setPointerCapture(W.pointerId)}K=W.clientY;const Se=Y.querySelector(".xterm-viewport");Se&&(Se.scrollTop+=ue)},ae=W=>{W.pointerId===D&&(Y.hasPointerCapture(W.pointerId)&&Y.releasePointerCapture(W.pointerId),D=null,H=!1)},be=W=>W.stopPropagation();return Y.addEventListener("pointerdown",C),Y.addEventListener("pointermove",Z),Y.addEventListener("pointerup",ae),Y.addEventListener("pointercancel",ae),Y.addEventListener("touchmove",be,{capture:!0}),()=>{Y.removeEventListener("pointerdown",C),Y.removeEventListener("pointermove",Z),Y.removeEventListener("pointerup",ae),Y.removeEventListener("pointercancel",ae),Y.removeEventListener("touchmove",be,{capture:!0}),D!==null&&Y.hasPointerCapture(D)&&Y.releasePointerCapture(D)}},[o]),y.useEffect(()=>{A.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var Y;r&&((Y=_.current)==null||Y.focus())},[r]),y.useEffect(()=>{if(T.current=l,l===null){j.current=!1;return}if(j.current)return;const Y=_.current;Y&&(j.current=!0,Y.write(`\r
|
|
130
|
+
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
131
|
+
`))},[l]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:x,className:"termview__surface"+(M==="ready"?"":" is-hidden")}),M==="loading"&&G&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),M==="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 Ek=2e5,Ak=75,Ck=90;function Rk({tokens:s,maxTokens:l,fetchedAt:r}){if(s===null)return null;const c=l??Ek,o=Math.min(100,Math.round(s/c*100)),d=`${s.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
132
|
+
обновлено в ${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${Mk(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Mk(s){return s>=Ck?" contextbar__fill--over":s>=Ak?" contextbar__fill--warn":""}const Vy="ccv:last-session",Dk=300*1e3,Ok=1e4;function Lk(){try{const s=localStorage.getItem(Vy);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 zk(s,l){return s.id===l.sessionId?!0:l.claudeSessionId?s.id===l.claudeSessionId||s.claudeSessionId===l.claudeSessionId:!1}const Uk={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Gx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Hk={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Yx(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)=>Xx(h.name,d)-Xx(p.name,d))}}function Xx(s,l){return s.toLowerCase().startsWith(l)?0:1}function Vx(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 Bk(){var es;const s=y.useRef(null),[l,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[p,m]=y.useState(!1),x=y.useMemo(()=>df()==="relay",[]),[_,j]=y.useState([]),[v,A]=y.useState([]),[T,M]=y.useState([]),[z,G]=y.useState([]),[Q,Y]=y.useState([]),[D,K]=y.useState([]),[H,C]=y.useState([]),[Z,ae]=y.useState([]),[be,W]=y.useState([]),[ue,Se]=y.useState(null),[Re,Ce]=y.useState(null),[E,re]=y.useState(null),[O,ge]=y.useState(null),[xe,N]=y.useState(null),[X,ie]=y.useState(Ol),[he,ke]=y.useState(Sh),[ve,De]=y.useState(!1),[vt,Xe]=y.useState(!1),Ve=kf("(max-width: 860px)"),[$e,tn]=y.useState(!1);y.useEffect(()=>{Ve||tn(!1)},[Ve]);const[it,dn]=y.useState(!1),[ut,hn]=y.useState([]),[En,Sn]=y.useState(!1),[nn,nt]=y.useState(Ol),[Pe,ln]=y.useState(null),[Kt,lt]=y.useState(null),[Et,Zt]=y.useState([]),[on,At]=y.useState(null),[jn,$t]=y.useState(null),[pn,Hn]=y.useState([]),[Qt,rt]=y.useState([]),[Ot,We]=y.useState([]),[gl,ee]=y.useState([]),[pe,He]=y.useState(null),[U,J]=y.useState(!1),[ye,Ge]=y.useState(null),[ft,bl]=y.useState(null),[Qn,tl]=y.useState(!1),[nl,Ql]=y.useState(Hk),[In,Kl]=y.useState(null),[Ct,ll]=y.useState(null),[mn,qt]=y.useState(!1),[xl,,Gt]=U0(),Lt=G0(),[Ee,un]=y.useState(!1),[gt,rs]=y.useState(null),[An,yl]=y.useState(null),[Kn,sl]=y.useState(null),[qn,bt]=y.useState(null),[Cn,gn]=y.useState(null),[Rt,ul]=y.useState(""),[_a,fl]=y.useState(null),[Zl,va]=y.useState([]),[$s,_l]=y.useState(!1),[Qs,al]=y.useState(null),[Zn,bn]=y.useState(!1),[et,vl]=y.useState(!1),[Ul,Sl]=y.useState({}),[wn,jl]=y.useState([""]),[wl,zt]=y.useState([]),[Yt,dl]=y.useState(null),[Ft,kn]=y.useState(null),[de,k]=y.useState(null),[q,oe]=y.useState(null),[Ae,ze]=y.useState(null),[Le,kt]=y.useState({}),[w,le]=y.useState({}),[je,Ze]=y.useState(!1),[St,ws]=y.useState(null),[cs,ar]=y.useState(null),ir=y.useRef(0),di=y.useRef(null),[Fl,Hl]=y.useState(!1),[Sa,os]=y.useState([]),[ks,ja]=y.useState(null),[rr,hi]=y.useState(null),Ks=X0(),wa=$0(Ve&&Fl),ka=y.useRef(new Map),xn=(ft==null?void 0:ft.terminalEnabled)===!0,Jl=df()==="relay"&&((es=d==null?void 0:d.shell)==null?void 0:es.enabled)!==!0,Na=y.useRef(!1),pi=y.useCallback((g,I)=>(ka.current.set(g,I),()=>{ka.current.get(g)===I&&ka.current.delete(g)}),[]),[Zs,mi]=y.useState(!1),[cr,Ns]=y.useState(null),[gi,bi]=y.useState(Ol),[us,or]=y.useState(null),[xi,fs]=y.useState({}),yi=y.useRef([]),[sn,uc]=y.useState(null);function Ef(g){uc(I=>I===g?null:g)}y.useEffect(()=>{(Ve||sn==="terminal"&&!Fl||sn==="files"&&!et||sn==="search"&&!je||sn==="git"&&!Ee||sn==="ask"&&!Zs||sn==="main"&&wl.length===0)&&uc(null)},[sn,Ve,Fl,et,je,Ee,Zs,wl.length]);const[Af]=y.useState(Lk),fc=y.useRef(Af),ur=y.useRef(!1),Fn=y.useRef(null),_i=y.useRef(null),Rn=y.useRef(null),fr=y.useRef(0);Fn.current=O,Rn.current=E,fr.current=X.lastSeq;const wo=y.useRef(he);wo.current=he;const ds=y.useRef(null),ko=y.useRef(0);ko.current=gi.lastSeq;const vi=y.useRef(null),dr=y.useRef(""),Si=y.useRef(null),Fs=y.useRef([]),No=y.useRef([""]);Fs.current=wl,No.current=wn;const ji=y.useRef(new Map),hr=y.useRef(new Set),wi=y.useRef(null),ki=y.useRef(null),To=y.useRef(0),Js=y.useRef(new Set);y.useEffect(()=>{const g=w0();if(!g)return;s.current=g;const I=()=>{r(g.connected),o(g.statusText)};g.onStatus(I),g.onReconnect(()=>{I();const xt=Fn.current;xt&&g.send({type:"session.sync",sessionId:xt,sinceSeq:fr.current});const dt=ds.current;dt&&g.send({type:"session.sync",sessionId:dt,sinceSeq:ko.current})});const fe=g.on(xt=>Ni(xt));g.connect();const Be=window.setInterval(()=>{I(),g.connected&&g.send({type:"ping",nonce:Date.now()})},15e3);return()=>{fe(),window.clearInterval(Be),g.close()}},[]);const Ni=y.useCallback(g=>{var I,fe,Be,xt,dt,il,Ua,Zo,Fo;switch(g.type){case"hello.ok":r(!0);break;case"workspace.list":{j(g.workspaces),A(g.archived),re(Ye=>{var Il;if(Ye)return Ye;const ht=fc.current,Nt=ht&&g.workspaces.find(Ms=>Ms.id===ht.workspaceId);return(Nt==null?void 0:Nt.id)??((Il=g.workspaces[0])==null?void 0:Il.id)??null});const Ne=Si.current;if(!Ne)break;const _e=g.workspaces.find(Ye=>Xk(Ye.path,Ne));if(!_e)break;Si.current=null,dn(!1),re(_e.id);break}case"workspace.candidates":if(g.query.trim()!==dr.current)break;hn(g.candidates),g.source==="host"&&Sn(!1);break;case"finder.opened":vi.current=g.sessionId;break;case"workspace.roots":Zt(g.roots);break;case"workspace.created":if(re(g.workspace.id),g.warnings.length===0){dn(!1),lt(null);break}At({path:g.workspace.path,warnings:g.warnings});break;case"session.list":if(g.workspaceId!==Rn.current)break;K(g.sessions),C(g.archived);break;case"folder.list":M(g.workspaceFolders),G(g.sessionFolders),Y(g.pinnedFolders??[]);break;case"session.pinned":ae(g.sessions);break;case"session.live":W(g.sessions);break;case"order.state":Ce(g.order);break;case"session.summary":if(g.session.id===vi.current){ln(g.session);break}if(g.session.parentSessionId){g.session.id===ds.current&&or(g.session);break}if(W(Ne=>{const _e=Ne.findIndex(ht=>ht.id===g.session.id);if(g.session.state==="closed")return _e===-1?Ne:Ne.filter(ht=>ht.id!==g.session.id);if(_e===-1)return[...Ne,g.session];const Ye=Ne.slice();return Ye[_e]=g.session,Ye}),K(Ne=>{const _e=Ne.findIndex(ht=>ht.id===g.session.id);if(_e===-1)return[g.session,...Ne];const Ye=Ne.slice();return Ye[_e]=g.session,Ye}),ae(Ne=>{const _e=Ne.findIndex(ht=>ht.id===g.session.id);if(_e===-1)return Ne;const Ye=Ne.slice();return Ye[_e]={...g.session,pinned:!0,...Ne[_e].pinnedAt?{pinnedAt:Ne[_e].pinnedAt}:{}},Ye}),ge(Ne=>Ne??g.session.id),((I=_i.current)==null?void 0:I.sessionId)===g.session.id){const Ne=_i.current;g.session.state==="error"?_i.current=null:g.session.state!=="closed"&&(_i.current=null,(fe=s.current)==null||fe.send({type:"prompt.send",sessionId:Ne.sessionId,text:Ne.text,images:Ne.images}))}break;case"usage.state":g.sessionId===Fn.current&&(Kl(g.usage),qt(!1));break;case"context.state":g.sessionId===Fn.current&&(ll(g.context),qt(!1));break;case"session.capabilities":g.sessionId===Fn.current&&N(g.capabilities);break;case"session.events":if(g.sessionId===ds.current){bi(Ne=>hf(Ne,g.entries));break}if(g.sessionId===vi.current){nt(Ne=>hf(Ne,g.entries));break}if(g.sessionId!==Fn.current)break;for(const Ne of g.entries){if(Ne.event.kind!=="rewound")continue;const _e=Ne.event.toUserIndex,Ye=L0(wo.current.entries,_e),ht=Ye.reduce((Nt,Il)=>Il.event.kind==="user.message"?Nt+1:Nt,0);ke(Nt=>({...Nt,entries:Ye})),ie(Nt=>({...Nt,items:z0(Nt.items,_e,ht)}))}ie(Ne=>hf(Ne,g.entries));break;case"session.history":if(g.sessionId!==Fn.current)break;ke(Ne=>M0(Ne,g));break;case"side.opened":{if(g.parentSessionId!==Fn.current)break;ds.current=g.sessionId,Ns(g.sessionId);const Ne=yi.current;yi.current=[];for(const _e of Ne)_e(g.sessionId);break}case"side.closed":if(g.parentSessionId!==Fn.current)break;ds.current=null,Ns(null),bi(Ol),or(null);break;case"git.state":if(g.workspaceId!==Rn.current)break;rs(g.state);break;case"git.commit":if(g.workspaceId!==Rn.current)break;yl(g.detail);break;case"git.result":if(g.workspaceId!==Rn.current)break;bt({ok:g.ok,message:g.message,url:g.url}),g.ok&&(yl(null),sl(null),_l(!1),bn(!1));break;case"git.busy":if(g.workspaceId!==Rn.current)break;ul(g.label);break;case"git.files":if(g.workspaceId!==Rn.current)break;al({files:g.files,truncated:g.truncated});break;case"github.status":fl(g.status);break;case"github.owners":va(g.owners);break;case"fs.dir":if(g.workspaceId!==Rn.current)break;Sl(Ne=>({...Ne,[g.path]:g.entries}));break;case"fs.search":if(g.workspaceId!==Rn.current)break;if(g.scope!=="tree"){const Ne=g.scope;le(_e=>({..._e,[Ne]:{query:g.query,entries:g.entries}}));break}ze({query:g.query,entries:g.entries,truncated:g.truncated});break;case"fs.grep":if(g.workspaceId!==Rn.current)break;ws({query:g.query,matches:g.matches,truncated:g.truncated});break;case"fs.file":{if(g.workspaceId!==Rn.current)break;const Ne=hr.current.delete(g.file.path);zt(Ye=>{const ht=Ye.findIndex(Ms=>Ms.path===g.file.path);if(ht===-1)return[...Ye,dx(g.file,++To.current)];const Nt=Ye[ht],Il=Ye.slice();return Il[ht]=Nt.saved===g.file.content&&!ba(Nt)?{...Nt,mtime:g.file.mtime,size:g.file.size,stale:!1}:dx(g.file,++To.current),Il}),Ne&&dl(g.file.path);const _e=di.current;_e&&_e.path===g.file.path&&(di.current=null,ar({..._e,token:++ir.current}));break}case"fs.media":{if(g.workspaceId!==Rn.current)break;Js.current.delete(g.path),zt(Ne=>Ne.map(_e=>_e.path===g.path?{..._e,mediaBase64:g.base64,mediaError:void 0}:_e));break}case"fs.mediaFailed":{if(g.workspaceId!==Rn.current)break;Js.current.delete(g.path),zt(Ne=>Ne.map(_e=>_e.path===g.path?{..._e,mediaError:g.message}:_e));break}case"fs.saved":{if(g.workspaceId!==Rn.current)break;const Ne=ji.current.get(g.path);ji.current.delete(g.path);const _e=Ne!==void 0;zt(ht=>ht.map(Nt=>Nt.path!==g.path?Nt:_e?{...Nt,saved:Ne,mtime:g.mtime,size:g.size,stale:!1}:{...Nt,stale:!0}));const Ye=Fs.current.find(ht=>ht.path===g.path);!_e&&Ye&&!ba(Ye)&&((Be=s.current)==null||Be.send({type:"fs.read",workspaceId:g.workspaceId,path:g.path})),(xt=s.current)==null||xt.send({type:"git.state",workspaceId:g.workspaceId});break}case"fs.result":{if(g.workspaceId!==Rn.current)break;if(kn({ok:g.ok,message:g.message}),g.ok||ji.current.delete(g.path),g.conflict&&zt(_e=>_e.map(Ye=>Ye.path===g.path?{...Ye,stale:!0}:Ye)),ki.current===g.path){const _e=ki.current;ki.current=null,g.ok&&(hr.current.add(_e),(dt=s.current)==null||dt.send({type:"fs.read",workspaceId:g.workspaceId,path:_e}))}const Ne=wi.current;if(g.ok&&Ne&&Ne.to===g.path){wi.current=null;const _e=Ye=>Ye===Ne.from?Ne.to:Ye.startsWith(`${Ne.from}/`)?Ne.to+Ye.slice(Ne.from.length):Ye;zt(Ye=>Ye.map(ht=>({...ht,path:_e(ht.path)}))),dl(Ye=>Ye===null?null:_e(Ye)),jl(Ye=>Ye.map(_e)),Sl(Ye=>{const ht={};for(const[Nt,Il]of Object.entries(Ye))Nt===Ne.from||Nt.startsWith(`${Ne.from}/`)||(ht[Nt]=Il);return ht})}g.ok&&((il=s.current)==null||il.send({type:"git.state",workspaceId:g.workspaceId}));break}case"term.list":if(g.workspaceId!==Rn.current)break;os(g.terminals);break;case"term.opened":if(g.terminal.workspaceId!==Rn.current)break;hi(null),os(Ne=>{const _e=Ne.findIndex(ht=>ht.id===g.terminal.id);if(_e===-1)return[...Ne,g.terminal];const Ye=Ne.slice();return Ye[_e]=g.terminal,Ye}),Na.current&&(Na.current=!1,ja(g.terminal.id));break;case"term.buffer":(Ua=ka.current.get(g.id))==null||Ua({kind:"buffer",data:g.data});break;case"term.data":(Zo=ka.current.get(g.id))==null||Zo({kind:"data",data:g.data});break;case"term.exit":os(Ne=>Ne.map(_e=>_e.id===g.id?{..._e,exitCode:g.exitCode}:_e));break;case"term.closed":os(Ne=>Ne.filter(_e=>_e.id!==g.id));break;case"mcp.list":g.sessionId===Fn.current&&Hn(g.servers);break;case"plugin.list":if(g.sessionId!==Fn.current)break;rt(g.plugins),We(g.marketplaces),ee(g.catalog);break;case"operation.result":g.sessionId===Fn.current&&He(g.result);break;case"auth.status":Ge(g.status);break;case"relay.state":h(g.state);break;case"settings.state":bl(g.settings);break;case"auth.login":Ql(g.state),g.state.active&&J(!0);break;case"session.closed":W(Ne=>Ne.filter(_e=>_e.id!==g.sessionId)),K(Ne=>Ne.map(_e=>_e.id===g.sessionId?{..._e,state:"closed"}:_e));break;case"error":console.error("[host]",g.message,g.context??""),(g.context==="workspace.open"||g.context==="workspace.create")&&(Si.current=null,lt(g.message)),(Fo=g.context)!=null&&Fo.startsWith("term.")&&hi(g.message);break}},[]),te=y.useCallback(g=>{var I;(I=s.current)==null||I.send(g)},[]);y.useEffect(()=>{E&&te({type:"session.list",workspaceId:E})},[E,te]),y.useEffect(()=>{l&&te({type:"session.pins"})},[l,te]),y.useEffect(()=>{l&&te({type:"settings.get"})},[l,te]),y.useEffect(()=>{if(l)return te({type:"session.drafts",sessionIds:Px()}),A0(g=>te({type:"session.drafts",sessionIds:g}))},[l,te]),y.useEffect(()=>{if(ur.current)return;const g=fc.current;if(!g||!E)return;if(E!==g.workspaceId){ur.current=!0;return}if(O){ur.current=!0;return}if(D.length===0)return;const I=D.find(fe=>zk(fe,g));ur.current=!0,I&&Gn(I)},[D,E,O]),y.useEffect(()=>{!E||Jl||!xn||te({type:"term.list",workspaceId:E})},[E,Jl,xn,te]),y.useEffect(()=>{ja(g=>{var I;return g&&Sa.some(fe=>fe.id===g)?g:((I=Sa[0])==null?void 0:I.id)??null})},[Sa]),y.useEffect(()=>{it&&te({type:"workspace.roots"})},[it,te]);const Ws=y.useCallback(()=>{const g=Fn.current;g&&(qt(!0),te({type:"usage.get",sessionId:g}),te({type:"context.get",sessionId:g}))},[te]);y.useEffect(()=>{if(!mn)return;const g=window.setTimeout(()=>qt(!1),Ok);return()=>window.clearTimeout(g)},[mn]);const pr=y.useMemo(()=>{const g=Math.max((In==null?void 0:In.fetchedAt)??0,(Ct==null?void 0:Ct.fetchedAt)??0);return g>0?g:null},[In==null?void 0:In.fetchedAt,Ct==null?void 0:Ct.fetchedAt]),Eo="Обновить лимиты и контекст"+(pr?`
|
|
133
|
+
обновлено в ${new Date(pr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{if(ll(null),!O)return;Ws();const g=()=>{document.hidden||Ws()},I=window.setInterval(g,Dk),fe=()=>{document.hidden||Ws()};return document.addEventListener("visibilitychange",fe),()=>{window.clearInterval(I),document.removeEventListener("visibilitychange",fe)}},[O,Ws]),y.useEffect(()=>{if(!O){ke(Sh);return}ke({...Sh,loading:!0}),te({type:"session.history",sessionId:O})},[O,te]);const Ao=y.useCallback(()=>{!O||he.loading||!Eb(he)||(ke(g=>({...g,loading:!0})),te({type:"session.history",sessionId:O,before:ty(he)}))},[O,he,te]),Co=y.useMemo(()=>D0(he.entries),[he.entries]),me=y.useMemo(()=>D.find(g=>g.id===O)??null,[D,O]),Ta=_.find(g=>g.id===E)??v.find(g=>g.id===E)??null;y.useEffect(()=>{if(!E||!O)return;const g={workspaceId:E,sessionId:O,claudeSessionId:(me==null?void 0:me.claudeSessionId)??null};try{localStorage.setItem(Vy,JSON.stringify(g))}catch{}},[E,O,me==null?void 0:me.claudeSessionId]);function Cf(g){Si.current=g,lt(null),te({type:"workspace.open",path:g})}function Rf(g,I,fe){lt(null),te({type:"workspace.create",parent:g,name:I,init:fe})}function Ro(g){if(dr.current=g,!g){hn([]),Sn(!1);return}Sn(!0),te({type:"workspace.find",query:g})}function Mo(g){dr.current=g,nt(Ol),te({type:"workspace.find.agent",query:g})}function Ti(){dn(!1),lt(null),At(null),hn([]),nt(Ol),ln(null),dr.current="",Si.current=null}function hs(){const g=Fn.current;g&&ds.current&&te({type:"side.reset",sessionId:g}),ds.current=null,Ns(null),bi(Ol),or(null),fs({}),yi.current=[]}function Mf(g){te({type:"workspace.close",workspaceIds:g}),!(!E||!g.includes(E))&&(hs(),re(null),ge(null),K([]),C([]),ie(Ol),N(null),Xe(!1))}function mr(g,I){te({type:"session.archive",workspaceId:g,sessionIds:I}),O&&(I.includes(O)||me!=null&&me.claudeSessionId&&I.includes(me.claudeSessionId))&&(hs(),ge(null),ie(Ol),N(null),Xe(!1))}function Do(g){te({type:"workspace.restore",workspaceIds:g})}function Oo(g,I,fe){te({type:"folder.create",scope:g,name:I,workspaceId:fe})}function dc(g,I){te({type:"folder.rename",folderId:g,name:I})}function hc(g){te({type:"folder.delete",folderId:g})}function Lo(g,I,fe,Be){te({type:"folder.assign",scope:g,itemId:I,folderId:fe,workspaceId:Be})}function zo(){E&&(hs(),ge(null),N(null),ie(Ol),Xe(!1),te({type:"session.start",workspaceId:E}),De(!1))}function pc(g){hs(),xr(),re(g),ge(null),ie(Ol),N(null),Xe(!1),rs(null),yl(null),sl(null),bt(null),ul(""),_l(!1),al(null),bn(!1),os([]),ja(null)}function Df(g,I,fe){te({type:"session.pin",workspaceId:g,sessionIds:I,pinned:fe})}function Of(g){return g.state==="running"||g.state==="waiting_permission"||g.state==="reconnecting"||g.backgroundWork}function mc(g){if(Of(g)){Se(g);return}te({type:"session.close",sessionId:g.id})}function Lf(g,I,fe){Ce(Be=>{const xt=Be??{workspaces:[],sessions:{},pinned:[],live:[]};if(g==="sessions"){if(!fe)return Be;const dt={...xt.sessions};return I&&I.length>0?dt[fe]=I:delete dt[fe],{...xt,sessions:dt}}return{...xt,[g]:I??[]}}),te({type:"order.set",scope:g,ids:I,...fe?{workspaceId:fe}:{}})}function zf(g){g.workspaceId!==E&&pc(g.workspaceId),Gn(g)}function Gn(g){if(De(!1),hs(),ie(Ol),N(null),Xe(!1),g.state==="closed"){ge(null),te({type:"session.start",workspaceId:g.workspaceId,resume:g.id});return}ge(g.id),te({type:"session.sync",sessionId:g.id,sinceSeq:0})}function Ei(g,I){if(O){if((me==null?void 0:me.state)==="closed"){_i.current={sessionId:me.id,text:g,images:I},Gn(me);return}te({type:"prompt.send",sessionId:O,text:g,images:I})}}function gc(g,I){te({type:"session.rename",sessionId:g.id,title:I,workspaceId:g.workspaceId}),K(fe=>fe.map(Be=>Be.id===g.id?{...Be,title:I}:Be))}function bc(g){O&&(De(!1),He(null),$t(g),te({type:"mcp.list",sessionId:O}),te({type:"plugin.list",sessionId:O}))}const Uo={mcpAction:(g,I)=>{O&&(te({type:"mcp.action",sessionId:O,name:g,action:I}),$t(null))},mcpAdd:(g,I)=>{O&&te({type:"mcp.add",sessionId:O,name:g,draft:I})},mcpRemove:g=>{O&&te({type:"mcp.remove",sessionId:O,name:g})},pluginInstall:g=>{O&&te({type:"plugin.install",sessionId:O,spec:g})},pluginUninstall:g=>{O&&te({type:"plugin.uninstall",sessionId:O,id:g})},pluginToggle:(g,I)=>{O&&te({type:"plugin.toggle",sessionId:O,id:g,enabled:I})},marketplaceAdd:g=>{O&&te({type:"marketplace.add",sessionId:O,source:g})},marketplaceRemove:g=>{O&&te({type:"marketplace.remove",sessionId:O,name:g})}};function xc(){De(!1),J(!0),te({type:"auth.status"})}const Ai={login:(g,I)=>te({type:"auth.login",mode:g,switchAccount:I}),submitCode:g=>te({type:"auth.code",code:g}),cancel:()=>te({type:"auth.cancel"}),logout:()=>te({type:"auth.logout"})};function Uf(){De(!1),tl(!0),te({type:"settings.get"})}function Ea(g){bl(I=>I&&{...I,...g}),te({type:"settings.update",settings:g})}function yc(g){O&&te({type:"side.ask",sessionId:O,text:g})}function Ci(){O&&(te({type:"side.reset",sessionId:O}),ds.current=null,Ns(null),bi(Ol),or(null),fs({}),yi.current=[])}function Ps(g){const I=ds.current;if(I){g(I);return}const fe=Fn.current;fe&&(yi.current.push(g),te({type:"side.open",sessionId:fe}))}function _c(){E&&te({type:"git.state",workspaceId:E})}function ea(g){E&&(sl(g),te({type:"git.show",workspaceId:E,ref:g}))}function ta(g,I){bt(null),gn({target:g,label:I})}function vc(){!E||!Cn||(te({type:"git.checkout",workspaceId:E,target:Cn.target}),gn(null))}function Ho(){E&&(bt(null),te({type:"git.push",workspaceId:E}))}function na(g){E&&(bt(null),te({type:"git.pull",workspaceId:E,merge:g}))}function Bo(){E&&(bt(null),al(null),_l(!0),te({type:"github.status"}),te({type:"github.owners"}),te({type:"git.files",workspaceId:E}))}function Io(g){E&&(bt(null),te({type:"git.publish",workspaceId:E,...g}))}function qo(g){E&&(bt(null),te({type:"git.remote",workspaceId:E,url:g}))}function Hf(){bt(null),bn(!0)}function Bf(g){te({type:"github.token",token:g}),te({type:"github.owners"})}function If(){te({type:"github.status"}),te({type:"github.owners"})}y.useEffect(()=>{if(!(!et||!E))for(const g of wn)g in Ul||te({type:"fs.list",workspaceId:E,path:g})},[et,wn,Ul,E,te]);function Go(g){jl(I=>I.includes(g)?I.filter(fe=>fe!==g):[...I,g])}function Yo(g){if(!g){ze(null);return}E&&te({type:"fs.search",workspaceId:E,query:g})}function Sc(g){if(!g){ws(null);return}E&&te({type:"fs.grep",workspaceId:E,query:g})}const kl=y.useCallback((g,I)=>{kt(xt=>({...xt,[g]:I}));const fe=Rn.current;if(I===null||!fe)return;const Be=I.lastIndexOf("/");if(Be!==-1){te({type:"fs.list",workspaceId:fe,path:I.slice(0,Be)});return}if(I===""){te({type:"fs.list",workspaceId:fe,path:""});return}te({type:"fs.search",workspaceId:fe,query:I,scope:g})},[te]),gr=y.useMemo(()=>Yx(Le.mention??null,w.mention??null,Ul),[Le.mention,w.mention,Ul]),Nl=y.useMemo(()=>Yx(Le.side??null,w.side??null,Ul),[Le.side,w.side,Ul]);function Aa(g){Ca(g.path,{line:g.line,column:g.column})}function jc(g){const I=[];let fe=er(g.path);for(;I.push(fe),!!fe;)fe=er(fe);jl(Be=>{const xt=new Set(Be);for(const dt of I)xt.add(dt);return g.kind==="dir"&&xt.add(g.path),[...xt]}),g.kind==="file"&&Ca(g.path)}function Ca(g,I){if(Fs.current.find(Be=>Be.path===g)){dl(g),I&&ar({path:g,...I,token:++ir.current});return}E&&(I&&(di.current={path:g,...I}),hr.current.add(g),te({type:"fs.read",workspaceId:E,path:g}))}function Ra(g,I=!1){const fe=Fs.current,Be=fe.find(il=>il.path===g);if(Be&&ba(Be)&&!I){oe(g);return}oe(null);const xt=fe.findIndex(il=>il.path===g),dt=fe.filter(il=>il.path!==g);zt(dt),dl(il=>{var Ua;return il===g?((Ua=dt[Math.min(xt,dt.length-1)])==null?void 0:Ua.path)??null:il})}function Ma(g,I=!1){const fe=Fs.current.find(Be=>Be.path===g);!fe||!E||!I&&!ba(fe)||(ji.current.set(g,fe.text),te({type:"fs.write",workspaceId:E,path:g,content:fe.text,eol:fe.eol,encoding:fe.encoding,baseMtime:fe.mtime,...I?{force:!0}:{}}))}function la(g){E&&te({type:"fs.read",workspaceId:E,path:g})}function Xo(g){E&&(Js.current.has(g)||(Js.current.add(g),te({type:"fs.readMedia",workspaceId:E,path:g})))}const br=y.useRef(new Map);function Da(g){const I=br.current,fe=I.get(g);fe&&clearTimeout(fe);const Be=(ft==null?void 0:ft.autoSaveAfterPauseMs)??0;Be<=0||I.set(g,setTimeout(()=>{I.delete(g);const xt=Fs.current.find(dt=>dt.path===g);xt&&ba(xt)&&!xt.stale&&Ma(g)},Be))}function qf(g,I,fe){if(!E)return;const Be=g?`${g}/${fe}`:fe;kn(null),I==="file"&&(ki.current=Be),te({type:"fs.create",workspaceId:E,path:Be,kind:I})}function hl(g,I){if(!E)return;const fe=er(g),Be=fe?`${fe}/${I}`:I;kn(null),wi.current={from:g,to:Be},te({type:"fs.rename",workspaceId:E,path:g,to:Be})}function wc(g,I){if(!E)return;const fe=g.slice(g.lastIndexOf("/")+1),Be=I?`${I}/${fe}`:fe;Be!==g&&(kn(null),wi.current={from:g,to:Be},te({type:"fs.rename",workspaceId:E,path:g,to:Be}))}function ps(g,I){E&&(kn(null),te({type:"fs.copy",workspaceId:E,path:g,toDir:I}))}function Vo(g){E&&(kn(null),k(null),te({type:"fs.delete",workspaceId:E,path:g.path}),zt(I=>I.filter(fe=>fe.path!==g.path&&!fe.path.startsWith(`${g.path}/`))),dl(I=>I&&(I===g.path||I.startsWith(`${g.path}/`))?null:I))}function xr(){Sl({}),jl([""]),zt([]),dl(null),kn(null),ze(null),ws(null),kt({}),le({}),ar(null),hr.current.clear(),ji.current.clear(),Js.current.clear(),di.current=null,wi.current=null,ki.current=null}function sa(){!E||Jl||!xn||(hi(null),Na.current=!0,te({type:"term.open",workspaceId:E,cols:80,rows:24}))}function kc(g){te({type:"term.close",id:g})}function $o(g,I){O&&te({type:"permission.respond",sessionId:O,requestId:g,decision:I})}function Nc(g,I){O&&te({type:"permission.respond",sessionId:O,requestId:g,decision:"allow",answers:I})}function Qo(g){O&&te({type:"permission.respond",sessionId:O,requestId:g,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Tl(g,I){O&&te({type:"permission.respond",sessionId:O,requestId:g,decision:"allow",plan:I})}function Oa(g){O&&te({type:"permission.respond",sessionId:O,requestId:g,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function g(I){if(I.key!=="Escape")return;if(sn!==null){const Be=I.target;if(!(Be instanceof HTMLElement&&Be.closest(".termview, .editor, .sidepane"))){uc(null);return}}if(!O||X.pending.length>0)return;const fe=I.target;fe instanceof HTMLElement&&fe.closest(".sidepane, .editor")||te({type:"control.interrupt",sessionId:O})}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[O,X.pending.length,te,sn]),y.useEffect(()=>{function g(I){I.key!=="`"||!(I.ctrlKey||I.metaKey)||xn&&(I.preventDefault(),Hl(fe=>!fe))}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[xn]);const aa=y.useMemo(()=>{const g=(xe==null?void 0:xe.commands)??[];return g.length===0?g:[...g,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Gx]},[xe]);function Ri(g){const I=Uk[g];return I?(bc(I),!0):Gx.some(fe=>fe.name===g)?(xc(),g==="logout"&&Ai.logout(),g==="switch-account"&&Ai.login("claudeai",!0),!0):!1}const Ts=(me==null?void 0:me.state)==="waiting_permission",an=(me==null?void 0:me.state)==="reconnecting",rn=(me==null?void 0:me.state)==="running"||an||Ts,yn=X.pending[0]??null,Bl=yn?Wj(yn.toolName,yn.input):null;y.useEffect(()=>{!Ee&&!et||!E||rn||te({type:"git.state",workspaceId:E})},[Ee,et,E,rn,te]),y.useEffect(()=>{if(!(rn||!E)){et&&Sl(g=>{const I={};for(const[fe,Be]of Object.entries(g))No.current.includes(fe)||(I[fe]=Be);return I});for(const g of Fs.current)ba(g)||te({type:"fs.read",workspaceId:E,path:g.path})}},[rn,E,et,te]);const El=(me==null?void 0:me.cwd)??(xe==null?void 0:xe.cwd)??null,Wl=(xe==null?void 0:xe.models)??[],Mi=(me==null?void 0:me.model)??(xe==null?void 0:xe.model)??null,{rows:yr,selected:Tc}=Vx(Wl,Mi),La=us?{model:us.model,effort:us.effort,ultracode:us.ultracode,thinking:us.thinking,switchOnFlag:us.switchModelsOnFlag}:{model:xi.model??Mi,effort:xi.effort??(me==null?void 0:me.effort)??null,ultracode:xi.ultracode??(me==null?void 0:me.ultracode)??!1,thinking:xi.thinking??(me==null?void 0:me.thinking)??!0,switchOnFlag:xi.switchOnFlag??(me==null?void 0:me.switchModelsOnFlag)??!0},Mn=Vx(Wl,La.model),Xt=(us==null?void 0:us.state)==="running",tt=Yt?wl.find(g=>g.path===Yt)??null:null,Es=new Set(wl.filter(ba).map(g=>g.path)),Yn=g=>i.jsx(yk,{pane:g,width:Lt.widths[g],onResize:I=>Lt.setWidth(g,I),onReset:()=>Lt.reset(g)}),As=g=>Ve?null:()=>Ef(g),ms=xe&&i.jsx(Ss,{title:"Режим прав",value:(me==null?void 0:me.permissionMode)??"default",options:ny.map(g=>({value:g.value,label:g.value,hint:g.hint})),onChange:g=>{O&&te({type:"control.set_mode",sessionId:O,mode:g})}}),Ec=yr.length>0?i.jsx(Hy,{models:yr,value:Tc,effort:(me==null?void 0:me.effort)??null,ultracode:(me==null?void 0:me.ultracode)??!1,thinking:(me==null?void 0:me.thinking)??!0,switchOnFlag:(me==null?void 0:me.switchModelsOnFlag)??!0,onModel:g=>{!O||!g||te({type:"control.set_model",sessionId:O,model:g})},onEffort:g=>{O&&te({type:"control.set_effort",sessionId:O,effort:g})},onUltracode:g=>{O&&te({type:"control.set_ultracode",sessionId:O,enabled:g})},onThinking:g=>{O&&te({type:"control.set_thinking",sessionId:O,enabled:g})},onSwitchOnFlag:g=>{O&&te({type:"control.set_flag_switch",sessionId:O,enabled:g})}}):Mi&&i.jsx("span",{className:"badge",children:Mi}),Ko=rn&&i.jsx("span",{className:Ts?"badge badge--wait":"badge badge--live",children:Ts?"ждёт":an?"переподключается":"работает"}),za=(me==null?void 0:me.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Cs=Ko||za,_r=()=>{O&&te({type:"session.reconnect",sessionId:O})},Di=an?"Сессия уже поднимает новый процесс":rn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Ac=O&&(an||(me==null?void 0:me.state)==="error")?i.jsxs("div",{className:an?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),an?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:an?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:_r,children:an?"Переподключить сейчас":"Переподключить"})]}):null,gs=me&&me.totalCostUsd>0?`$${me.totalCostUsd.toFixed(3)}`:null,Pl=i.jsx("button",{className:Zs?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Zs,onClick:()=>mi(g=>!g),children:i.jsx($k,{})}),Rs=me&&me.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>mc(me),children:i.jsx(Yk,{})});return i.jsxs("div",{className:"app",style:Lt.style,children:[i.jsx(ES,{open:ve,connected:l,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:T,sessionFolders:z.filter(g=>g.workspaceId===E),pinnedFolders:Q,sessions:D.filter(g=>g.workspaceId===E),archived:H.filter(g=>g.workspaceId===E),pinned:Z,live:be,listOrder:Re,liveSessionsFirst:(ft==null?void 0:ft.liveSessionsFirst)===!0,onReorder:Lf,activeWorkspaceId:E,activeSessionId:O,onPinSessions:Df,onSelectPinned:zf,onCloseWorkspaces:Mf,onRestoreWorkspaces:Do,onArchiveSessions:mr,onUnarchiveSessions:g=>{E&&te({type:"session.unarchive",workspaceId:E,sessionIds:g})},onCreateFolder:Oo,onRenameFolder:dc,onDeleteFolder:hc,onAssignToFolder:Lo,onSelectWorkspace:pc,onSelectSession:Gn,onRenameSession:gc,onStopSession:mc,onOpenWorkspace:()=>dn(!0),onNewSession:zo,onOpenExtensions:O?()=>bc("mcp"):null,account:ye,onOpenAccount:xc,relay:d,onOpenRelay:x?null:()=>m(!0),onOpenSettings:Uf,themeMode:xl,onCycleTheme:Gt}),Yn("sidebar"),ve&&i.jsx("div",{className:"scrim",onClick:()=>De(!1)}),i.jsx(J1,{open:et,tree:Ul,expanded:new Set(wn),activePath:Yt,dirty:Es,gitChanges:(gt==null?void 0:gt.changed)??[],result:Ft,searchResult:Ae,onSearch:Yo,onReveal:jc,onToggle:Go,onOpen:Ca,onCreate:qf,onRename:hl,onMove:wc,onCopy:ps,onDelete:k,onRefresh:()=>{kn(null),Sl({}),_c()},onClose:()=>vl(!1),zoomed:sn==="files",onToggleZoom:As("files")}),et&&sn!=="files"&&Yn("files"),i.jsx(rS,{open:je,result:St,onSearch:Sc,onOpenMatch:Aa,onClose:()=>Ze(!1),zoomed:sn==="search",onToggleZoom:As("search")}),je&&sn!=="search"&&Yn("search"),i.jsx(hw,{open:Ee,state:gt,result:qn,selected:Kn,busy:Rt,onRefresh:_c,onShow:ea,onCheckout:ta,onPush:Ho,onPull:na,onPublish:Bo,onConnectRemote:Hf,onDismissResult:()=>bt(null),onClose:()=>un(!1),zoomed:sn==="git",onToggleZoom:As("git")}),Ee&&sn!=="git"&&Yn("git"),i.jsxs("main",{className:sn==="main"||sn==="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:et?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":et,onClick:()=>{vl(g=>!g),un(!1),Ze(!1)},children:i.jsx(Ik,{})}),i.jsx("button",{className:je?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":je,onClick:()=>{Ze(g=>!g),vl(!1),un(!1)},children:i.jsx(qk,{})}),i.jsx("button",{className:Ee?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Ee,onClick:()=>{un(g=>!g),vl(!1),Ze(!1)},children:i.jsx(Gk,{})}),xn&&i.jsx("button",{className:Fl?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":Fl,onClick:()=>Hl(g=>!g),children:i.jsx(Vk,{})}),Ve&&Pl,Ve&&i.jsx("button",{className:$e?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":$e,onClick:()=>tn(!0),children:i.jsx(Qk,{})}),i.jsxs("div",{className:"topbar__id",children:[vt&&me?i.jsx(Xs,{className:"rename--title",value:me.title??"",onCommit:g=>{gc(me,g),Xe(!1)},onCancel:()=>Xe(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!me||Ve,title:me&&!Ve?"Переименовать сессию":void 0,onClick:()=>Xe(!0),children:(me==null?void 0:me.title)??"Claude Code Visual"}),Ta&&i.jsx("span",{className:"topbar__project",title:Ta.path,children:Ta.name})]}),Ve?Cs:El&&i.jsx(Uy,{path:El})]}),!Ve&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:mn?"meters-refresh is-busy":"meters-refresh",title:Eo,"aria-label":"Обновить лимиты и контекст","aria-busy":mn,disabled:!O||mn,onClick:Ws,children:i.jsx(Kk,{})}),i.jsx(Iy,{usage:In}),i.jsx(Xy,{}),ms,Ec,Cs,gs&&i.jsx("span",{className:"badge badge--cost",children:gs}),Rs,Pl]})]}),i.jsx(Rk,{tokens:(Ct==null?void 0:Ct.tokens)??X.contextTokens,maxTokens:(Ct==null?void 0:Ct.maxTokens)??null,fetchedAt:(Ct==null?void 0:Ct.fetchedAt)??null}),Ve&&$e&&i.jsx(Yw,{onClose:()=>tn(!1),permission:ms,model:Ec,usage:In,cwd:El,costLabel:gs,onRefresh:Ws,refreshing:mn,metersFetchedAt:pr,onRename:me?()=>{Xe(!0),tn(!1)}:null,onStop:me&&me.state!=="closed"?()=>{mc(me),tn(!1)}:null}),wl.length>0&&i.jsx(NS,{files:wl,activePath:Yt,busy:rn,onSelect:dl,onClose:g=>Ra(g),zoomed:sn==="main",onToggleZoom:As("main")}),tt?i.jsx(wS,{file:tt,goto:(cs==null?void 0:cs.path)===tt.path?cs:null,onChange:(g,I)=>{zt(fe=>fe.map(Be=>Be.path===g?{...Be,text:I}:Be)),Da(g)},onSave:g=>Ma(g),onReload:la,onOverwrite:g=>Ma(g,!0),onRequestMedia:Xo,onTogglePreview:g=>zt(I=>I.map(fe=>fe.path===g?{...fe,previewMode:!fe.previewMode}:fe))}):i.jsxs(i.Fragment,{children:[i.jsx(vp,{items:X.items,busy:rn&&!an,waiting:Ts,history:Co,historyHasMore:Eb(he),historyLoading:he.loading,onLoadHistory:Ao,sessionId:O??void 0,onEditMessage:(g,I,fe)=>{O&&te({type:"prompt.edit",sessionId:O,userIndex:g,text:I,images:fe})}}),Ac,i.jsx(Ly,{disabled:!O,busy:rn&&!an,placeholder:an?"Промпт уйдёт, как только связь вернётся":(me==null?void 0:me.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:aa,sessionTitle:(me==null?void 0:me.title)??null,contextResult:gr,draftKey:O,onContextSearch:g=>kl("mention",g),onCommand:Ri,onSend:Ei,onInterrupt:()=>{O&&te({type:"control.interrupt",sessionId:O})}})]}),Fl&&xn&&i.jsxs(i.Fragment,{children:[!Ve&&sn!=="terminal"&&i.jsx(vk,{height:Ks.height,onResize:Ks.setHeight,onReset:Ks.reset}),i.jsx(kk,{mobile:Ve,zoomed:sn==="terminal",onToggleZoom:As("terminal"),terminals:Sa,activeId:ks,blocked:Jl,error:rr,onDismissError:()=>hi(null),height:Ve?wa.height:Ks.height,offset:Ve?{top:wa.offsetTop,left:wa.offsetLeft}:void 0,onSelect:ja,onOpen:sa,onClose:kc,onInput:(g,I)=>te({type:"term.input",id:g,data:I}),onResize:(g,I,fe)=>te({type:"term.resize",id:g,cols:I,rows:fe}),onAttach:g=>te({type:"term.attach",id:g}),onHide:()=>Hl(!1),registerSink:pi})]})]}),i.jsx(Ow,{open:Zs,items:gi.items,busy:Xt,ready:O!==null,commands:aa,contextResult:Nl,draftKey:O,models:Mn.rows,model:Mn.selected,effort:La.effort,ultracode:La.ultracode,thinking:La.thinking,switchOnFlag:La.switchOnFlag,onContextSearch:g=>kl("side",g),onCommand:Ri,onModel:g=>{g&&(fs(I=>({...I,model:g})),Ps(I=>te({type:"control.set_model",sessionId:I,model:g})))},onEffort:g=>{fs(I=>({...I,effort:g,ultracode:!1})),Ps(I=>te({type:"control.set_effort",sessionId:I,effort:g}))},onUltracode:g=>{fs(I=>({...I,ultracode:g,...g?{effort:"xhigh"}:{}})),Ps(I=>te({type:"control.set_ultracode",sessionId:I,enabled:g}))},onThinking:g=>{fs(I=>({...I,thinking:g})),Ps(I=>te({type:"control.set_thinking",sessionId:I,enabled:g}))},onSwitchOnFlag:g=>{fs(I=>({...I,switchOnFlag:g})),Ps(I=>te({type:"control.set_flag_switch",sessionId:I,enabled:g}))},onAsk:yc,onInterrupt:()=>{cr&&te({type:"control.interrupt",sessionId:cr})},onReset:Ci,onClose:()=>mi(!1),zoomed:sn==="ask",onToggleZoom:As("ask")}),Zs&&sn!=="ask"&&Yn("ask"),(Ee||Zs||et||je)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{un(!1),mi(!1),vl(!1),Ze(!1)}}),An&&i.jsx(gw,{detail:An,local:((gt==null?void 0:gt.hasRemote)??!1)&&(gt==null?void 0:gt.commits.some(g=>g.hash===An.hash&&!g.pushed))===!0,onCheckout:ta,onClose:()=>{yl(null),sl(null)}}),ue&&i.jsx(Ll,{title:"Остановить сессию?",onClose:()=>Se(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Se(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{te({type:"session.close",sessionId:ue.id}),Se(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Cn&&i.jsxs(Ll,{title:"Переключить рабочее дерево?",onClose:()=>gn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>gn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:vc,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",Cn.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),rn&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),gt&>.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",gt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),$s&&i.jsx(Ew,{status:_a,owners:Zl,files:Qs,defaultName:(Ta==null?void 0:Ta.name)??"",hasCommits:gt===null||gt.head!=="",busy:Rt,result:qn,onRefreshStatus:If,onSaveToken:Bf,onPublish:Io,onDismissResult:()=>bt(null),onClose:()=>_l(!1)}),Zn&&i.jsx(Dw,{busy:Rt,result:qn,onSubmit:qo,onDismissResult:()=>bt(null),onClose:()=>bn(!1)}),de&&i.jsx(Ll,{title:de.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>k(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>k(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Vo(de),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[de.path," будет удалён с диска",de.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),q&&i.jsx(Ll,{title:"Закрыть без сохранения?",onClose:()=>oe(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>oe(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Ra(q,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{Ma(q),Ra(q,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",q," есть несохранённые правки."]})}),jn&&i.jsx(Vw,{tab:jn,servers:pn,plugins:Qt,marketplaces:Ot,catalog:gl,result:pe,actions:Uo,onTab:$t,onClose:()=>$t(null)}),U&&i.jsx(Pw,{status:ye,login:nl,actions:Ai,remote:x,runningSessions:D.filter(g=>g.state==="running"||g.state==="waiting_permission").length,onReconnect:O?()=>{_r(),J(!1)}:null,reconnectBlocked:rn,reconnectHint:Di,onClose:()=>J(!1)}),p&&i.jsx(sk,{state:d,onPair:(g,I)=>te({type:"relay.pair",code:g,...I?{name:I}:{}}),onUnpair:()=>te({type:"relay.unpair"}),onClose:()=>m(!1)}),Qn&&i.jsx(bk,{settings:ft,models:(xe==null?void 0:xe.models)??[],relayState:d,local:df()==="local",onChange:Ea,onEnableShell:()=>te({type:"relay.shell.enable"}),onDisableShell:()=>te({type:"relay.shell.disable"}),onOpenRelay:()=>{tl(!1),m(!0)},onClose:()=>tl(!1)}),it&&i.jsx(nw,{candidates:ut,searching:En,agentItems:nn.items,agentBusy:(Pe==null?void 0:Pe.state)==="running",error:Kt,roots:Et,created:on,onSearch:Ro,onAskAgent:Mo,onInterrupt:()=>{const g=vi.current;g&&te({type:"control.interrupt",sessionId:g})},onSubmit:Cf,onCreate:Rf,onClose:Ti}),yn!=null&&yn.questions&&yn.questions.length>0?i.jsx($j,{request:{...yn,questions:yn.questions},queued:X.pending.length-1,onAnswer:Nc,onDecline:Qo}):yn&&Bl!==null?i.jsx(Zj,{request:yn,plan:Bl,queued:X.pending.length-1,onAccept:Tl,onDecline:Oa}):yn&&i.jsx(Vj,{request:yn,queued:X.pending.length-1,onDecide:$o})]})}function Ik(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"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 qk(){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 Gk(){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 Yk(){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 Xk(s,l){return $x(s)===$x(l)}function $x(s){return s.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function Vk(){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 $k(){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 Qk(){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 Kk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("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 $y=document.getElementById("root");if(!$y)throw new Error("#root not found");b0.createRoot($y).render(i.jsx(y.StrictMode,{children:i.jsx(Bk,{})}));export{m1 as D,Wt as I,en as N,Jk as P,as as T,js as a,yy as b,zl as c,Fk as d,wy as e,_o as f,O1 as h,Wk as p,Pk as s,Te as t};
|