@i14ks/ccv 0.16.3 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +43 -6
- package/package.json +1 -1
- package/web/assets/{codemirror-CkgU8c7a.js → codemirror-DcwBBoHv.js} +1 -1
- package/web/assets/{index-CQqNgFvZ.js → index--smhGK8Y.js} +1 -1
- package/web/assets/{index-B0NcQgiZ.js → index-B0Ss0xRi.js} +1 -1
- package/web/assets/{index-GT_NZ0qK.js → index-B9bs4QFR.js} +1 -1
- package/web/assets/{index--DhZrg25.js → index-Bee9erGK.js} +1 -1
- package/web/assets/{index-gmvISUqO.js → index-BpL4NCNb.js} +1 -1
- package/web/assets/{index-DvhOZOas.js → index-BrAmkvn2.js} +1 -1
- package/web/assets/{index-Bhx7H3mC.js → index-CLScHnZN.js} +1 -1
- package/web/assets/{index-CstcrxY-.js → index-CO3xirid.js} +1 -1
- package/web/assets/{index-OuSuAczZ.js → index-CQ0-WYgR.js} +1 -1
- package/web/assets/index-ChuReHk_.css +1 -0
- package/web/assets/{index-BC7TmL8M.js → index-CjxzVwrV.js} +1 -1
- package/web/assets/{index-BFwSwibX.js → index-CnCCNUTy.js} +1 -1
- package/web/assets/{index-s7Wcfj5F.js → index-Cu4PsUGS.js} +1 -1
- package/web/assets/{index-DfGVckBo.js → index-D51RIwGp.js} +1 -1
- package/web/assets/{index-DaRnRpPz.js → index-D9qvIR3L.js} +1 -1
- package/web/assets/{index-Dv0cw76Z.js → index-DB25Lbd8.js} +1 -1
- package/web/assets/{index-P6m4z84O.js → index-DwamecDE.js} +1 -1
- package/web/assets/{index-DoqmNDN4.js → index-DzgVil07.js} +1 -1
- package/web/assets/index-RifJd-I8.js +134 -0
- package/web/assets/{index-DHVISfG-.js → index-TIzoSl17.js} +1 -1
- package/web/assets/{index-CNQ0551W.js → index-VZG_Pg4O.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-DlOju0OY.js +0 -134
- package/web/assets/index-tvzk50nQ.css +0 -1
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-gmvISUqO.js","./index-BC7TmL8M.js","./index-DHVISfG-.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-CQqNgFvZ.js","./index-s7Wcfj5F.js","./index-B0NcQgiZ.js","./index-Dv0cw76Z.js","./index-DvhOZOas.js","./index-DaRnRpPz.js","./index-DfGVckBo.js","./index-OuSuAczZ.js","./index--DhZrg25.js","./index-P6m4z84O.js","./index-CstcrxY-.js","./index-Bhx7H3mC.js","./index-BFwSwibX.js","./index-GT_NZ0qK.js","./index-DoqmNDN4.js","./index-CNQ0551W.js","./codemirror-CkgU8c7a.js","./xterm-D6Mng-DB.js","./_commonjsHelpers-CqkleIqs.js","./addon-fit-CevVMrUA.js","./addon-web-links-CnB65OV_.js","./xterm-DYP7pi_n.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var m0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var g0=(l,s,r)=>s in l?m0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Dt=(l,s,r)=>g0(l,typeof s!="symbol"?s+"":s,r),Eh=(l,s,r)=>s.has(l)||vb("Cannot "+r);var Ye=(l,s,r)=>(Eh(l,s,"read from private field"),r?r.call(l):s.get(l)),fn=(l,s,r)=>s.has(l)?vb("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),vt=(l,s,r,c)=>(Eh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),Mn=(l,s,r)=>(Eh(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Ch={exports:{}},No={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var jb;function b0(){if(jb)return No;jb=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:l,type:c,key:h,ref:o!==void 0?o:null,props:d}}return No.Fragment=s,No.jsx=r,No.jsxs=r,No}var Sb;function x0(){return Sb||(Sb=1,Ch.exports=b0()),Ch.exports}var i=x0(),Ah={exports:{}},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 wb;function y0(){if(wb)return Qe;wb=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),v=Symbol.iterator;function E(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,L={};function $(N,V,re){this.props=N,this.context=V,this.refs=L,this.updater=re||T}$.prototype.isReactComponent={},$.prototype.setState=function(N,V){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,V,"setState")},$.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function J(){}J.prototype=$.prototype;function G(N,V,re){this.props=N,this.context=V,this.refs=L,this.updater=re||T}var O=G.prototype=new J;O.constructor=G,C(O,$.prototype),O.isPureReactComponent=!0;var Z=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function ne(N,V,re){var me=re.ref;return{$$typeof:l,type:N,key:V,ref:me!==void 0?me:null,props:re}}function he(N,V){return ne(N.type,V,N.props)}function W(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}function ue(N){var V={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(re){return V[re]})}var je=/\/+/g;function Me(N,V){return typeof N=="object"&&N!==null&&N.key!=null?ue(""+N.key):V.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(M,M):(N.status="pending",N.then(function(V){N.status==="pending"&&(N.status="fulfilled",N.value=V)},function(V){N.status==="pending"&&(N.status="rejected",N.reason=V)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function A(N,V,re,me,Ne){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 l:case s:De=!0;break;case _:return De=N._init,A(De(N._payload),V,re,me,Ne)}}if(De)return Ne=Ne(N),De=me===""?"."+Me(N,0):me,Z(Ne)?(re="",De!=null&&(re=De.replace(je,"$&/")+"/"),A(Ne,V,re,"",function(Xe){return Xe})):Ne!=null&&(W(Ne)&&(Ne=he(Ne,re+(Ne.key==null||N&&N.key===Ne.key?"":(""+Ne.key).replace(je,"$&/")+"/")+De)),V.push(Ne)),1;De=0;var yt=me===""?".":me+":";if(Z(N))for(var $e=0;$e<N.length;$e++)me=N[$e],ve=yt+Me(me,$e),De+=A(me,V,re,ve,Ne);else if($e=E(N),typeof $e=="function")for(N=$e.call(N),$e=0;!(me=N.next()).done;)me=me.value,ve=yt+Me(me,$e++),De+=A(me,V,re,ve,Ne);else if(ve==="object"){if(typeof N.then=="function")return A(Ce(N),V,re,me,Ne);throw V=String(N),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return De}function ce(N,V,re){if(N==null)return N;var me=[],Ne=0;return A(N,me,"","",function(ve){return V.call(re,ve,Ne++)}),me}function z(N){if(N._status===-1){var V=N._result;V=V(),V.then(function(re){(N._status===0||N._status===-1)&&(N._status=1,N._result=re)},function(re){(N._status===0||N._status===-1)&&(N._status=2,N._result=re)}),N._status===-1&&(N._status=0,N._result=V)}if(N._status===1)return N._result.default;throw N._result}var be=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},ye={map:ce,forEach:function(N,V,re){ce(N,function(){V.apply(this,arguments)},re)},count:function(N){var V=0;return ce(N,function(){V++}),V},toArray:function(N){return ce(N,function(V){return V})||[]},only:function(N){if(!W(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Qe.Activity=S,Qe.Children=ye,Qe.Component=$,Qe.Fragment=r,Qe.Profiler=o,Qe.PureComponent=G,Qe.StrictMode=c,Qe.Suspense=g,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},Qe.cache=function(N){return function(){return N.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(N,V,re){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var me=C({},N.props),Ne=N.key;if(V!=null)for(ve in V.key!==void 0&&(Ne=""+V.key),V)!H.call(V,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&V.ref===void 0||(me[ve]=V[ve]);var ve=arguments.length-2;if(ve===1)me.children=re;else if(1<ve){for(var De=Array(ve),yt=0;yt<ve;yt++)De[yt]=arguments[yt+2];me.children=De}return ne(N.type,Ne,me)},Qe.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:d,_context:N},N},Qe.createElement=function(N,V,re){var me,Ne={},ve=null;if(V!=null)for(me in V.key!==void 0&&(ve=""+V.key),V)H.call(V,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(Ne[me]=V[me]);var De=arguments.length-2;if(De===1)Ne.children=re;else if(1<De){for(var yt=Array(De),$e=0;$e<De;$e++)yt[$e]=arguments[$e+2];Ne.children=yt}if(N&&N.defaultProps)for(me in De=N.defaultProps,De)Ne[me]===void 0&&(Ne[me]=De[me]);return ne(N,ve,Ne)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(N){return{$$typeof:m,render:N}},Qe.isValidElement=W,Qe.lazy=function(N){return{$$typeof:_,_payload:{_status:-1,_result:N},_init:z}},Qe.memo=function(N,V){return{$$typeof:b,type:N,compare:V===void 0?null:V}},Qe.startTransition=function(N){var V=D.T,re={};D.T=re;try{var me=N(),Ne=D.S;Ne!==null&&Ne(re,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(M,be)}catch(ve){be(ve)}finally{V!==null&&re.types!==null&&(V.types=re.types),D.T=V}},Qe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Qe.use=function(N){return D.H.use(N)},Qe.useActionState=function(N,V,re){return D.H.useActionState(N,V,re)},Qe.useCallback=function(N,V){return D.H.useCallback(N,V)},Qe.useContext=function(N){return D.H.useContext(N)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(N,V){return D.H.useDeferredValue(N,V)},Qe.useEffect=function(N,V){return D.H.useEffect(N,V)},Qe.useEffectEvent=function(N){return D.H.useEffectEvent(N)},Qe.useId=function(){return D.H.useId()},Qe.useImperativeHandle=function(N,V,re){return D.H.useImperativeHandle(N,V,re)},Qe.useInsertionEffect=function(N,V){return D.H.useInsertionEffect(N,V)},Qe.useLayoutEffect=function(N,V){return D.H.useLayoutEffect(N,V)},Qe.useMemo=function(N,V){return D.H.useMemo(N,V)},Qe.useOptimistic=function(N,V){return D.H.useOptimistic(N,V)},Qe.useReducer=function(N,V,re){return D.H.useReducer(N,V,re)},Qe.useRef=function(N){return D.H.useRef(N)},Qe.useState=function(N){return D.H.useState(N)},Qe.useSyncExternalStore=function(N,V,re){return D.H.useSyncExternalStore(N,V,re)},Qe.useTransition=function(){return D.H.useTransition()},Qe.version="19.2.8",Qe}var kb;function gp(){return kb||(kb=1,Ah.exports=y0()),Ah.exports}var y=gp(),Mh={exports:{}},To={},Rh={exports:{}},Dh={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Nb;function _0(){return Nb||(Nb=1,(function(l){function s(A,ce){var z=A.length;A.push(ce);e:for(;0<z;){var be=z-1>>>1,ye=A[be];if(0<o(ye,ce))A[be]=ce,A[z]=ye,z=be;else break e}}function r(A){return A.length===0?null:A[0]}function c(A){if(A.length===0)return null;var ce=A[0],z=A.pop();if(z!==ce){A[0]=z;e:for(var be=0,ye=A.length,N=ye>>>1;be<N;){var V=2*(be+1)-1,re=A[V],me=V+1,Ne=A[me];if(0>o(re,z))me<ye&&0>o(Ne,re)?(A[be]=Ne,A[me]=z,be=me):(A[be]=re,A[V]=z,be=V);else if(me<ye&&0>o(Ne,z))A[be]=Ne,A[me]=z,be=me;else break e}}return ce}function o(A,ce){var z=A.sortIndex-ce.sortIndex;return z!==0?z:A.id-ce.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],b=[],_=1,S=null,v=3,E=!1,T=!1,C=!1,L=!1,$=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function O(A){for(var ce=r(b);ce!==null;){if(ce.callback===null)c(b);else if(ce.startTime<=A)c(b),ce.sortIndex=ce.expirationTime,s(g,ce);else break;ce=r(b)}}function Z(A){if(C=!1,O(A),!T)if(r(g)!==null)T=!0,M||(M=!0,ue());else{var ce=r(b);ce!==null&&Ce(Z,ce.startTime-A)}}var M=!1,D=-1,H=5,ne=-1;function he(){return L?!0:!(l.unstable_now()-ne<H)}function W(){if(L=!1,M){var A=l.unstable_now();ne=A;var ce=!0;try{e:{T=!1,C&&(C=!1,J(D),D=-1),E=!0;var z=v;try{t:{for(O(A),S=r(g);S!==null&&!(S.expirationTime>A&&he());){var be=S.callback;if(typeof be=="function"){S.callback=null,v=S.priorityLevel;var ye=be(S.expirationTime<=A);if(A=l.unstable_now(),typeof ye=="function"){S.callback=ye,O(A),ce=!0;break t}S===r(g)&&c(g),O(A)}else c(g);S=r(g)}if(S!==null)ce=!0;else{var N=r(b);N!==null&&Ce(Z,N.startTime-A),ce=!1}}break e}finally{S=null,v=z,E=!1}ce=void 0}}finally{ce?ue():M=!1}}}var ue;if(typeof G=="function")ue=function(){G(W)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Me=je.port2;je.port1.onmessage=W,ue=function(){Me.postMessage(null)}}else ue=function(){$(W,0)};function Ce(A,ce){D=$(function(){A(l.unstable_now())},ce)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(A){A.callback=null},l.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<A?Math.floor(1e3/A):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(A){switch(v){case 1:case 2:case 3:var ce=3;break;default:ce=v}var z=v;v=ce;try{return A()}finally{v=z}},l.unstable_requestPaint=function(){L=!0},l.unstable_runWithPriority=function(A,ce){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var z=v;v=A;try{return ce()}finally{v=z}},l.unstable_scheduleCallback=function(A,ce,z){var be=l.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?be+z:be):z=be,A){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=z+ye,A={id:_++,callback:ce,priorityLevel:A,startTime:z,expirationTime:ye,sortIndex:-1},z>be?(A.sortIndex=z,s(b,A),r(g)===null&&A===r(b)&&(C?(J(D),D=-1):C=!0,Ce(Z,z-be))):(A.sortIndex=ye,s(g,A),T||E||(T=!0,M||(M=!0,ue()))),A},l.unstable_shouldYield=he,l.unstable_wrapCallback=function(A){var ce=v;return function(){var z=v;v=ce;try{return A.apply(this,arguments)}finally{v=z}}}})(Dh)),Dh}var Tb;function v0(){return Tb||(Tb=1,Rh.exports=_0()),Rh.exports}var Oh={exports:{}},cl={};/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Eb;function j0(){if(Eb)return cl;Eb=1;var l=gp();function s(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)b+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,b,_){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:g,containerInfo:b,implementation:_}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return cl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,cl.createPortal=function(g,b){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(s(299));return d(g,b,null,_)},cl.flushSync=function(g){var b=h.T,_=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=_,c.d.f()}},cl.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(g,b))},cl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},cl.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var _=b.as,S=m(_,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,E=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;_==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:S,integrity:v,fetchPriority:E}):_==="script"&&c.d.X(g,{crossOrigin:S,integrity:v,fetchPriority:E,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},cl.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var _=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(g)},cl.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var _=b.as,S=m(_,b.crossOrigin);c.d.L(g,_,{crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},cl.preloadModule=function(g,b){if(typeof g=="string")if(b){var _=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},cl.requestFormReset=function(g){c.d.r(g)},cl.unstable_batchedUpdates=function(g,b){return g(b)},cl.useFormState=function(g,b,_){return h.H.useFormState(g,b,_)},cl.useFormStatus=function(){return h.H.useHostTransitionStatus()},cl.version="19.2.8",cl}var Cb;function S0(){if(Cb)return Oh.exports;Cb=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Oh.exports=j0(),Oh.exports}/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-dom-client.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var Ab;function w0(){if(Ab)return To;Ab=1;var l=v0(),s=gp(),r=S0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===a)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var x=!1,j=u.child;j;){if(j===n){x=!0,n=u,a=f;break}if(j===a){x=!0,a=u,n=f;break}j=j.sibling}if(!x){for(j=f.child;j;){if(j===n){x=!0,n=f,a=u;break}if(j===a){x=!0,a=f,n=u;break}j=j.sibling}if(!x)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,v=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),G=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),he=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 je=Symbol.for("react.client.reference");function Me(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case $:return"Profiler";case L:return"StrictMode";case Z:return"Suspense";case M:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case G:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:Me(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return Me(e(t))}catch{}}return null}var Ce=Array.isArray,A=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},be=[],ye=-1;function N(e){return{current:e}}function V(e){0>ye||(e.current=be[ye],be[ye]=null,ye--)}function re(e,t){ye++,be[ye]=e.current,e.current=t}var me=N(null),Ne=N(null),ve=N(null),De=N(null);function yt(e,t){switch(re(ve,t),re(Ne,e),re(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$g(t),e=Xg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(me),re(me,e)}function $e(){V(me),V(Ne),V(ve)}function Xe(e){e.memoizedState!==null&&re(De,e);var t=me.current,n=Xg(t,e.type);t!==n&&(re(Ne,e),re(me,n))}function Ve(e){Ne.current===e&&(V(me),V(Ne)),De.current===e&&(V(De),jo._currentValue=z)}var It,rt;function dn(e){if(It===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);It=t&&t[1]||"",rt=-1<n.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+It+e+rt}var ft=!1;function hn(e,t){if(!e||ft)return"";ft=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(te){var F=te}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(te){F=te}e.call(oe.prototype)}}else{try{throw Error()}catch(te){F=te}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(te){if(te&&F&&typeof te.stack=="string")return[te.stack,F.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),x=f[0],j=f[1];if(x&&j){var R=x.split(`
|
|
45
|
-
`),K=j.split(`
|
|
46
|
-
`);for(u=a=0;a<R.length&&!R[a].includes("DetermineComponentFrameRoot");)a++;for(;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;if(a===R.length||u===K.length)for(a=R.length-1,u=K.length-1;1<=a&&0<=u&&R[a]!==K[u];)u--;for(;1<=a&&0<=u;a--,u--)if(R[a]!==K[u]){if(a!==1||u!==1)do if(a--,u--,0>u||R[a]!==K[u]){var ae=`
|
|
47
|
-
`+R[a].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=a&&0<=u);break}}}finally{ft=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?dn(n):""}function Sn(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 xn(e){try{var t="",n=null;do t+=Sn(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
48
|
-
Error generating stack: `+a.message+`
|
|
49
|
-
`+a.stack}}var en=Object.prototype.hasOwnProperty,tt=l.unstable_scheduleCallback,et=l.unstable_cancelCallback,tn=l.unstable_shouldYield,$t=l.unstable_requestPaint,nt=l.unstable_now,St=l.unstable_getCurrentPriorityLevel,Xt=l.unstable_ImmediatePriority,cn=l.unstable_UserBlockingPriority,wt=l.unstable_NormalPriority,yn=l.unstable_LowPriority,qt=l.unstable_IdlePriority,pn=l.log,Dn=l.unstable_setDisableYieldValue,Gt=null,ct=null;function Et(e){if(typeof pn=="function"&&Dn(e),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(Gt,e)}catch{}}var Pe=Math.clz32?Math.clz32:ge,wl=Math.log,le=Math.LN2;function ge(e){return e>>>=0,e===0?32:31-(wl(e)/le|0)|0}var He=256,B=262144,P=4194304;function _e(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Be(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var j=a&134217727;return j!==0?(a=j&~f,a!==0?u=_e(a):(x&=j,x!==0?u=_e(x):n||(n=j&~e,n!==0&&(u=_e(n))))):(j=a&~f,j!==0?u=_e(j):x!==0?u=_e(x):n||(n=a&~e,n!==0&&(u=_e(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function Ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function fl(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 On(){var e=P;return P<<=1,(P&62914560)===0&&(P=4194304),e}function dl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function sl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bl(e,t,n,a,u,f){var x=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,R=e.expirationTimes,K=e.hiddenUpdates;for(n=x&~n;0<n;){var ae=31-Pe(n),oe=1<<ae;j[ae]=0,R[ae]=-1;var F=K[ae];if(F!==null)for(K[ae]=null,ae=0;ae<F.length;ae++){var te=F[ae];te!==null&&(te.lane&=-536870913)}n&=~oe}a!==0&&ds(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function ds(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Pe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function hl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Pe(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function al(e,t){var n=t&-t;return n=(n&42)!==0?1:pl(n),(n&(e.suspendedLanes|t))!==0?0:n}function pl(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 Yt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Vt(){var e=ce.p;return e!==0?e:(e=window.event,e===void 0?32:pb(e.type))}function kl(e,t){var n=ce.p;try{return ce.p=e,t()}finally{ce.p=n}}var kt=Math.random().toString(36).slice(2),Qt="__reactFiber$"+kt,Oe="__reactProps$"+kt,Ct="__reactContainer$"+kt,qn="__reactEvents$"+kt,nn="__reactListeners$"+kt,Ln="__reactHandles$"+kt,il="__reactResources$"+kt,wn="__reactMarker$"+kt;function Il(e){delete e[Qt],delete e[Oe],delete e[qn],delete e[nn],delete e[Ln]}function rl(e){var t=e[Qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[Qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wg(e);e!==null;){if(n=e[Qt])return n;e=Wg(e)}return t}e=n,n=e.parentNode}return null}function ln(e){if(e=e[Qt]||e[Ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Kt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function on(e){var t=e[il];return t||(t=e[il]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Fe(e){e[wn]=!0}var ml=new Set,Ms={};function Gn(e,t){Zl(e,t),Zl(e+"Capture",t)}function Zl(e,t){for(Ms[e]=t,e=0;e<t.length;e++)ml.add(t[e])}var hs=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]*$"),ps={},mn={};function Fl(e){return en.call(mn,e)?!0:en.call(ps,e)?!1:hs.test(e)?mn[e]=!0:(ps[e]=!0,!1)}function Zn(e,t,n){if(Fl(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function 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 kn(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 Lt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Di(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(x){n=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ds(e){if(!e._valueTracker){var t=Rs(e)?"checked":"value";e._valueTracker=Di(e,t,""+e[t])}}function Yn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Rs(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Nl(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 La=/[\n"\\]/g;function Nn(e){return e.replace(La,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sn(e,t,n,a,u,f,x,j){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Lt(t)):e.value!==""+Lt(t)&&(e.value=""+Lt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?lt(e,x,Lt(t)):n!=null?lt(e,x,Lt(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Lt(j):e.removeAttribute("name")}function Jl(e,t,n,a,u,f,x,j){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Ds(e);return}n=n!=null?""+Lt(n):"",t=t!=null?""+Lt(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=j?e.checked:!!a,e.defaultChecked=!!a,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Ds(e)}function lt(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function $n(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=""+Lt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function pe(e,t,n){if(t!=null&&(t=""+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Lt(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=Lt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Ds(e)}function Y(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fe=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function we(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||fe.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ae(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&we(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&we(e,f,t[f])}function ze(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dt=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 se(e){return w.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ke(){}var Je=null;function ht(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ms=null,za=null;function gr(e){var t=ln(e);if(t&&(e=t.stateNode)){var n=e[Oe]||null;e:switch(e=t.stateNode,t.type){case"input":if(sn(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="'+Nn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[Oe]||null;if(!u)throw Error(c(90));sn(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&&Yn(a)}break e;case"textarea":pe(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&$n(e,!!n.multiple,t,!1)}}}var Ua=!1;function wc(e,t,n){if(Ua)return e(t,n);Ua=!0;try{var a=e(t);return a}finally{if(Ua=!1,(ms!==null||za!==null)&&(qu(),ms&&(t=ms,e=za,za=ms=null,gr(t),e)))for(t=0;t<e.length;t++)gr(e[t])}}function Os(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Oe]||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 Wl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gs=!1;if(Wl)try{var bs={};Object.defineProperty(bs,"passive",{get:function(){gs=!0}}),window.addEventListener("test",bs,bs),window.removeEventListener("test",bs,bs)}catch{gs=!1}var Ls=null,Oi=null,sa=null;function br(){if(sa)return sa;var e,t=Oi,n=t.length,a,u="value"in Ls?Ls.value:Ls.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var x=n-e;for(a=1;a<=x&&t[n-a]===u[f-a];a++);return sa=u.slice(e,1<a?1-a:void 0)}function Li(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 aa(){return!0}function ia(){return!1}function Xn(e){function t(n,a,u,f,x){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(f):f[j]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?aa:ia,this.isPropagationStopped=ia,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=aa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=aa)},persist:function(){},isPersistent:aa}),t}var Pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zs=Xn(Pl),zi=S({},Pl,{view:0,detail:0}),xr=Xn(zi),kc,Ha,Us,Ba=S({},zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ua,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Us&&(Us&&e.type==="mousemove"?(kc=e.screenX-Us.screenX,Ha=e.screenY-Us.screenY):Ha=kc=0,Us=e),kc)},movementY:function(e){return"movementY"in e?e.movementY:Ha}}),Ia=Xn(Ba),ra=S({},Ba,{dataTransfer:0}),yr=Xn(ra),Nc=S({},zi,{relatedTarget:0}),Tc=Xn(Nc),ca=S({},Pl,{animationName:0,elapsedTime:0,pseudoElement:0}),_r=Xn(ca),Xo=S({},Pl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vr=Xn(Xo),Vo=S({},Pl,{data:0}),Ui=Xn(Vo),xs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jr={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"},Hi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oa(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hi[e])?!!t[e]:!1}function ua(){return oa}var an=S({},zi,{key:function(e){if(e.key){var t=xs[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ua,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ec=Xn(an),Kf=S({},Ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qo=Xn(Kf),Ko=S({},zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ua}),Sr=Xn(Ko),Un=S({},Pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bi=Xn(Un),Ii=S({},Ba,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Zo=Xn(Ii),Tn=S({},Pl,{newState:0,oldState:0}),Fo=Xn(Tn),Jo=[9,13,27,32],ql=Wl&&"CompositionEvent"in window,qa=null;Wl&&"documentMode"in document&&(qa=document.documentMode);var wr=Wl&&"TextEvent"in window&&!qa,qi=Wl&&(!ql||qa&&8<qa&&11>=qa),Ga=" ",Hs=!1;function Cc(e,t){switch(e){case"keyup":return Jo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ya(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ys=!1;function Gi(e,t){switch(e){case"compositionend":return Ya(t);case"keypress":return t.which!==32?null:(Hs=!0,Ga);case"textInput":return e=t.data,e===Ga&&Hs?null:e;default:return null}}function Yi(e,t){if(ys)return e==="compositionend"||!ql&&Cc(e,t)?(e=br(),sa=Oi=Ls=null,ys=!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 qi&&t.locale!=="ko"?null:t.data;default:return null}}var Wo={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $a(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wo[e.type]:t==="textarea"}function Po(e,t,n,a){ms?za?za.push(a):za=[a]:ms=a,t=Ku(t,"onChange"),0<t.length&&(n=new zs("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ee=null,es=null;function Ac(e){Hg(e,0)}function kr(e){var t=Kt(e);if(Yn(t))return e}function eu(e,t){if(e==="change")return t}var X=!1;if(Wl){var fa;if(Wl){var da="oninput"in document;if(!da){var Mc=document.createElement("div");Mc.setAttribute("oninput","return;"),da=typeof Mc.oninput=="function"}fa=da}else fa=!1;X=fa&&(!document.documentMode||9<document.documentMode)}function Rc(){ee&&(ee.detachEvent("onpropertychange",tu),es=ee=null)}function tu(e){if(e.propertyName==="value"&&kr(es)){var t=[];Po(t,es,e,ht(e)),wc(Ac,t)}}function Xa(e,t,n){e==="focusin"?(Rc(),ee=t,es=n,ee.attachEvent("onpropertychange",tu)):e==="focusout"&&Rc()}function Zf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kr(es)}function Ff(e,t){if(e==="click")return kr(t)}function Jf(e,t){if(e==="input"||e==="change")return kr(t)}function Wf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gl=typeof Object.is=="function"?Object.is:Wf;function ts(e,t){if(gl(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(!en.call(t,u)||!gl(e[u],t[u]))return!1}return!0}function nu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lu(e,t){var n=nu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nu(n)}}function su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function au(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(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=Nl(e.document)}return t}function Dc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Pf=Wl&&"documentMode"in document&&11>=document.documentMode,Va=null,Oc=null,ha=null,Lc=!1;function iu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lc||Va==null||Va!==Nl(a)||(a=Va,"selectionStart"in a&&Dc(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}),ha&&ts(ha,a)||(ha=a,a=Ku(Oc,"onSelect"),0<a.length&&(t=new zs("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Va)))}function _s(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qa={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionrun:_s("Transition","TransitionRun"),transitionstart:_s("Transition","TransitionStart"),transitioncancel:_s("Transition","TransitionCancel"),transitionend:_s("Transition","TransitionEnd")},zc={},$i={};Wl&&($i=document.createElement("div").style,"AnimationEvent"in window||(delete Qa.animationend.animation,delete Qa.animationiteration.animation,delete Qa.animationstart.animation),"TransitionEvent"in window||delete Qa.transitionend.transition);function pa(e){if(zc[e])return zc[e];if(!Qa[e])return e;var t=Qa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $i)return zc[e]=t[n];return e}var Uc=pa("animationend"),Hc=pa("animationiteration"),Bc=pa("animationstart"),ru=pa("transitionrun"),ed=pa("transitionstart"),cu=pa("transitioncancel"),Ic=pa("transitionend"),ou=new Map,Nr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Nr.push("scrollEnd");function bl(e,t){ou.set(e,t),Gn(t,[e])}var Tr=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)},Tl=[],Ka=0,qc=0;function Bs(){for(var e=Ka,t=qc=Ka=0;t<e;){var n=Tl[t];Tl[t++]=null;var a=Tl[t];Tl[t++]=null;var u=Tl[t];Tl[t++]=null;var f=Tl[t];if(Tl[t++]=null,a!==null&&u!==null){var x=a.pending;x===null?u.next=u:(u.next=x.next,x.next=u),a.pending=u}f!==0&&uu(n,u,f)}}function Xi(e,t,n,a){Tl[Ka++]=e,Tl[Ka++]=t,Tl[Ka++]=n,Tl[Ka++]=a,qc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Gc(e,t,n,a){return Xi(e,t,n,a),Er(e)}function Is(e,t){return Xi(e,null,null,t),Er(e)}function uu(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-Pe(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function Er(e){if(50<mo)throw mo=0,Wd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Za={};function td(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xl(e,t,n,a){return new td(e,t,n,a)}function Yc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vs(e,t){var n=e.alternate;return n===null?(n=xl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fu(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Cr(e,t,n,a,u,f){var x=0;if(a=e,typeof e=="function")Yc(e)&&(x=1);else if(typeof e=="string")x=l0(e,n,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=xl(31,n,t,u),e.elementType=ne,e.lanes=f,e;case C:return ma(n.children,u,f,t);case L:x=8,u|=24;break;case $:return e=xl(12,n,t,u|2),e.elementType=$,e.lanes=f,e;case Z:return e=xl(13,n,t,u),e.elementType=Z,e.lanes=f,e;case M:return e=xl(19,n,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:x=10;break e;case J:x=9;break e;case O:x=11;break e;case D:x=14;break e;case H:x=16,a=null;break e}x=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=xl(x,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function ma(e,t,n,a){return e=xl(7,e,a,t),e.lanes=n,e}function $c(e,t,n){return e=xl(6,e,null,t),e.lanes=n,e}function du(e){var t=xl(18,null,null,0);return t.stateNode=e,t}function Ar(e,t,n){return t=xl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hu=new WeakMap;function El(e,t){if(typeof e=="object"&&e!==null){var n=hu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:xn(t)},hu.set(e,t),t)}return{value:e,source:t,stack:xn(t)}}var Fa=[],Ja=0,Wa=null,ga=0,Fn=[],Cl=0,qs=null,ns=1,ls="";function js(e,t){Fa[Ja++]=ga,Fa[Ja++]=Wa,Wa=e,ga=t}function pu(e,t,n){Fn[Cl++]=ns,Fn[Cl++]=ls,Fn[Cl++]=qs,qs=e;var a=ns;e=ls;var u=32-Pe(a)-1;a&=~(1<<u),n+=1;var f=32-Pe(t)+u;if(30<f){var x=u-u%5;f=(a&(1<<x)-1).toString(32),a>>=x,u-=x,ns=1<<32-Pe(t)+u|n<<u|a,ls=f+e}else ns=1<<f|n<<u|a,ls=e}function Xc(e){e.return!==null&&(js(e,1),pu(e,1,0))}function Vc(e){for(;e===Wa;)Wa=Fa[--Ja],Fa[Ja]=null,ga=Fa[--Ja],Fa[Ja]=null;for(;e===qs;)qs=Fn[--Cl],Fn[Cl]=null,ls=Fn[--Cl],Fn[Cl]=null,ns=Fn[--Cl],Fn[Cl]=null}function mu(e,t){Fn[Cl++]=ns,Fn[Cl++]=ls,Fn[Cl++]=qs,ns=t.id,ls=t.overflow,qs=e}var Hn=null,zt=null,st=!1,Gs=null,Al=!1,Qc=Error(c(519));function Ys(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jn(El(t,e)),Qc}function gu(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Qt]=e,t[Oe]=a,n){case"dialog":it("cancel",t),it("close",t);break;case"iframe":case"object":case"embed":it("load",t);break;case"video":case"audio":for(n=0;n<bo.length;n++)it(bo[n],t);break;case"source":it("error",t);break;case"img":case"image":case"link":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"input":it("invalid",t),Jl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":it("invalid",t);break;case"textarea":it("invalid",t),k(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Gg(t.textContent,n)?(a.popover!=null&&(it("beforetoggle",t),it("toggle",t)),a.onScroll!=null&&it("scroll",t),a.onScrollEnd!=null&&it("scrollend",t),a.onClick!=null&&(t.onclick=ke),t=!0):t=!1,t||Ys(e,!0)}function Kc(e){for(Hn=e.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Al=!1;return;case 27:case 3:Al=!0;return;default:Hn=Hn.return}}function ba(e){if(e!==Hn)return!1;if(!st)return Kc(e),st=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||hh(e.type,e.memoizedProps)),n=!n),n&&zt&&Ys(e),Kc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));zt=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));zt=Jg(e)}else t===27?(t=zt,bi(e.type)?(e=xh,xh=null,zt=e):zt=t):zt=Hn?rs(e.stateNode.nextSibling):null;return!0}function ss(){zt=Hn=null,st=!1}function yl(){var e=Gs;return e!==null&&(zl===null?zl=e:zl.push.apply(zl,e),Gs=null),e}function Jn(e){Gs===null?Gs=[e]:Gs.push(e)}var Wn=N(null),$s=null,Gl=null;function Ss(e,t,n){re(Wn,t._currentValue),t._currentValue=n}function Ml(e){e._currentValue=Wn.current,V(Wn)}function Mr(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 Zc(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=u.child;f=f.firstContext;e:for(;f!==null;){var j=f;f=u;for(var R=0;R<t.length;R++)if(j.context===t[R]){f.lanes|=n,j=f.alternate,j!==null&&(j.lanes|=n),Mr(f.return,n,e),a||(x=null);break e}f=j.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(c(341));x.lanes|=n,f=x.alternate,f!==null&&(f.lanes|=n),Mr(x,n,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function as(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var j=u.type;gl(u.pendingProps.value,x.value)||(e!==null?e.push(j):e=[j])}}else if(u===De.current){if(x=u.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(jo):e=[jo])}u=u.return}e!==null&&Zc(t,e,n,a),t.flags|=262144}function Vi(e){for(e=e.firstContext;e!==null;){if(!gl(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){$s=e,Gl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _n(e){return Pa($s,e)}function Rr(e,t){return $s===null&&xa(e),Pa(e,t)}function Pa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gl===null){if(e===null)throw Error(c(308));Gl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gl=Gl.next=t;return n}var ei=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()})}},nd=l.unstable_scheduleCallback,bu=l.unstable_NormalPriority,un={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fc(){return{controller:new ei,data:new Map,refCount:0}}function Qi(e){e.refCount--,e.refCount===0&&nd(bu,function(){e.controller.abort()})}var ti=null,Dr=0,ni=0,li=null;function ld(e,t){if(ti===null){var n=ti=[];Dr=0,ni=sh(),li={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Dr++,t.then(Or,Or),t}function Or(){if(--Dr===0&&ti!==null){li!==null&&(li.status="fulfilled");var e=ti;ti=null,ni=0,li=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xu(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 yu=A.S;A.S=function(e,t){dg=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ld(e,t),yu!==null&&yu(e,t)};var Rl=N(null);function Ki(){var e=Rl.current;return e!==null?e:Bt.pooledCache}function Lr(e,t){t===null?re(Rl,Rl.current):re(Rl,t.pool)}function Jc(){var e=Ki();return e===null?null:{parent:un._currentValue,pool:e}}var ya=Error(c(460)),p=Error(c(474)),I=Error(c(542)),de={then:function(){}};function Ge(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ut(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ke,ke),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wc(e),e;default:if(typeof t.status=="string")t.then(ke,ke);else{if(e=Bt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wc(e),e}throw Bn=t,ya}}function Zt(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Bn=n,ya):n}}var Bn=null;function si(){if(Bn===null)throw Error(c(459));var e=Bn;return Bn=null,e}function Wc(e){if(e===ya||e===I)throw Error(c(483))}var _a=null,xe=0;function Ee(e){var t=xe;return xe+=1,_a===null&&(_a=[]),Ut(_a,e,t)}function Ie(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function gt(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 Ht(e){function t(q,U){if(e){var Q=q.deletions;Q===null?(q.deletions=[U],q.flags|=16):Q.push(U)}}function n(q,U){if(!e)return null;for(;U!==null;)t(q,U),U=U.sibling;return null}function a(q){for(var U=new Map;q!==null;)q.key!==null?U.set(q.key,q):U.set(q.index,q),q=q.sibling;return U}function u(q,U){return q=vs(q,U),q.index=0,q.sibling=null,q}function f(q,U,Q){return q.index=Q,e?(Q=q.alternate,Q!==null?(Q=Q.index,Q<U?(q.flags|=67108866,U):Q):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function x(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function j(q,U,Q,ie){return U===null||U.tag!==6?(U=$c(Q,q.mode,ie),U.return=q,U):(U=u(U,Q),U.return=q,U)}function R(q,U,Q,ie){var Ue=Q.type;return Ue===C?ae(q,U,Q.props.children,ie,Q.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===H&&Zt(Ue)===U.type)?(U=u(U,Q.props),Ie(U,Q),U.return=q,U):(U=Cr(Q.type,Q.key,Q.props,null,q.mode,ie),Ie(U,Q),U.return=q,U)}function K(q,U,Q,ie){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Ar(Q,q.mode,ie),U.return=q,U):(U=u(U,Q.children||[]),U.return=q,U)}function ae(q,U,Q,ie,Ue){return U===null||U.tag!==7?(U=ma(Q,q.mode,ie,Ue),U.return=q,U):(U=u(U,Q),U.return=q,U)}function oe(q,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=$c(""+U,q.mode,Q),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case E:return Q=Cr(U.type,U.key,U.props,null,q.mode,Q),Ie(Q,U),Q.return=q,Q;case T:return U=Ar(U,q.mode,Q),U.return=q,U;case H:return U=Zt(U),oe(q,U,Q)}if(Ce(U)||ue(U))return U=ma(U,q.mode,Q,null),U.return=q,U;if(typeof U.then=="function")return oe(q,Ee(U),Q);if(U.$$typeof===G)return oe(q,Rr(q,U),Q);gt(q,U)}return null}function F(q,U,Q,ie){var Ue=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:j(q,U,""+Q,ie);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case E:return Q.key===Ue?R(q,U,Q,ie):null;case T:return Q.key===Ue?K(q,U,Q,ie):null;case H:return Q=Zt(Q),F(q,U,Q,ie)}if(Ce(Q)||ue(Q))return Ue!==null?null:ae(q,U,Q,ie,null);if(typeof Q.then=="function")return F(q,U,Ee(Q),ie);if(Q.$$typeof===G)return F(q,U,Rr(q,Q),ie);gt(q,Q)}return null}function te(q,U,Q,ie,Ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return q=q.get(Q)||null,j(U,q,""+ie,Ue);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return q=q.get(ie.key===null?Q:ie.key)||null,R(U,q,ie,Ue);case T:return q=q.get(ie.key===null?Q:ie.key)||null,K(U,q,ie,Ue);case H:return ie=Zt(ie),te(q,U,Q,ie,Ue)}if(Ce(ie)||ue(ie))return q=q.get(Q)||null,ae(U,q,ie,Ue,null);if(typeof ie.then=="function")return te(q,U,Q,Ee(ie),Ue);if(ie.$$typeof===G)return te(q,U,Q,Rr(U,ie),Ue);gt(U,ie)}return null}function Re(q,U,Q,ie){for(var Ue=null,bt=null,Le=U,We=U=0,ut=null;Le!==null&&We<Q.length;We++){Le.index>We?(ut=Le,Le=null):ut=Le.sibling;var xt=F(q,Le,Q[We],ie);if(xt===null){Le===null&&(Le=ut);break}e&&Le&&xt.alternate===null&&t(q,Le),U=f(xt,U,We),bt===null?Ue=xt:bt.sibling=xt,bt=xt,Le=ut}if(We===Q.length)return n(q,Le),st&&js(q,We),Ue;if(Le===null){for(;We<Q.length;We++)Le=oe(q,Q[We],ie),Le!==null&&(U=f(Le,U,We),bt===null?Ue=Le:bt.sibling=Le,bt=Le);return st&&js(q,We),Ue}for(Le=a(Le);We<Q.length;We++)ut=te(Le,q,We,Q[We],ie),ut!==null&&(e&&ut.alternate!==null&&Le.delete(ut.key===null?We:ut.key),U=f(ut,U,We),bt===null?Ue=ut:bt.sibling=ut,bt=ut);return e&&Le.forEach(function(ji){return t(q,ji)}),st&&js(q,We),Ue}function qe(q,U,Q,ie){if(Q==null)throw Error(c(151));for(var Ue=null,bt=null,Le=U,We=U=0,ut=null,xt=Q.next();Le!==null&&!xt.done;We++,xt=Q.next()){Le.index>We?(ut=Le,Le=null):ut=Le.sibling;var ji=F(q,Le,xt.value,ie);if(ji===null){Le===null&&(Le=ut);break}e&&Le&&ji.alternate===null&&t(q,Le),U=f(ji,U,We),bt===null?Ue=ji:bt.sibling=ji,bt=ji,Le=ut}if(xt.done)return n(q,Le),st&&js(q,We),Ue;if(Le===null){for(;!xt.done;We++,xt=Q.next())xt=oe(q,xt.value,ie),xt!==null&&(U=f(xt,U,We),bt===null?Ue=xt:bt.sibling=xt,bt=xt);return st&&js(q,We),Ue}for(Le=a(Le);!xt.done;We++,xt=Q.next())xt=te(Le,q,We,xt.value,ie),xt!==null&&(e&&xt.alternate!==null&&Le.delete(xt.key===null?We:xt.key),U=f(xt,U,We),bt===null?Ue=xt:bt.sibling=xt,bt=xt);return e&&Le.forEach(function(p0){return t(q,p0)}),st&&js(q,We),Ue}function Rt(q,U,Q,ie){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case E:e:{for(var Ue=Q.key;U!==null;){if(U.key===Ue){if(Ue=Q.type,Ue===C){if(U.tag===7){n(q,U.sibling),ie=u(U,Q.props.children),ie.return=q,q=ie;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===H&&Zt(Ue)===U.type){n(q,U.sibling),ie=u(U,Q.props),Ie(ie,Q),ie.return=q,q=ie;break e}n(q,U);break}else t(q,U);U=U.sibling}Q.type===C?(ie=ma(Q.props.children,q.mode,ie,Q.key),ie.return=q,q=ie):(ie=Cr(Q.type,Q.key,Q.props,null,q.mode,ie),Ie(ie,Q),ie.return=q,q=ie)}return x(q);case T:e:{for(Ue=Q.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){n(q,U.sibling),ie=u(U,Q.children||[]),ie.return=q,q=ie;break e}else{n(q,U);break}else t(q,U);U=U.sibling}ie=Ar(Q,q.mode,ie),ie.return=q,q=ie}return x(q);case H:return Q=Zt(Q),Rt(q,U,Q,ie)}if(Ce(Q))return Re(q,U,Q,ie);if(ue(Q)){if(Ue=ue(Q),typeof Ue!="function")throw Error(c(150));return Q=Ue.call(Q),qe(q,U,Q,ie)}if(typeof Q.then=="function")return Rt(q,U,Ee(Q),ie);if(Q.$$typeof===G)return Rt(q,U,Rr(q,Q),ie);gt(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(n(q,U.sibling),ie=u(U,Q),ie.return=q,q=ie):(n(q,U),ie=$c(Q,q.mode,ie),ie.return=q,q=ie),x(q)):n(q,U)}return function(q,U,Q,ie){try{xe=0;var Ue=Rt(q,U,Q,ie);return _a=null,Ue}catch(Le){if(Le===ya||Le===I)throw Le;var bt=xl(29,Le,null,q.mode);return bt.lanes=ie,bt.return=q,bt}finally{}}}var Pn=Ht(!0),zr=Ht(!1),ai=!1;function sd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ad(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ii(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ri(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(_t&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Er(e),uu(e,null,n),t}return Xi(e,a,t,n),Er(e)}function Pc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,hl(e,n)}}function id(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var x={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var rd=!1;function eo(){if(rd){var e=li;if(e!==null)throw e}}function to(e,t,n,a){rd=!1;var u=e.updateQueue;ai=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,j=u.shared.pending;if(j!==null){u.shared.pending=null;var R=j,K=R.next;R.next=null,x===null?f=K:x.next=K,x=R;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==x&&(j===null?ae.firstBaseUpdate=K:j.next=K,ae.lastBaseUpdate=R))}if(f!==null){var oe=u.baseState;x=0,ae=K=R=null,j=f;do{var F=j.lane&-536870913,te=F!==j.lane;if(te?(ot&F)===F:(a&F)===F){F!==0&&F===ni&&(rd=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Re=e,qe=j;F=t;var Rt=n;switch(qe.tag){case 1:if(Re=qe.payload,typeof Re=="function"){oe=Re.call(Rt,oe,F);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=qe.payload,F=typeof Re=="function"?Re.call(Rt,oe,F):Re,F==null)break e;oe=S({},oe,F);break e;case 2:ai=!0}}F=j.callback,F!==null&&(e.flags|=64,te&&(e.flags|=8192),te=u.callbacks,te===null?u.callbacks=[F]:te.push(F))}else te={lane:F,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(K=ae=te,R=oe):ae=ae.next=te,x|=F;if(j=j.next,j===null){if(j=u.shared.pending,j===null)break;te=j,j=te.next,te.next=null,u.lastBaseUpdate=te,u.shared.pending=null}}while(!0);ae===null&&(R=oe),u.baseState=R,u.firstBaseUpdate=K,u.lastBaseUpdate=ae,f===null&&(u.shared.lanes=0),di|=x,e.lanes=x,e.memoizedState=oe}}function Up(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Hp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Up(n[e],t)}var Ur=N(null),_u=N(0);function Bp(e,t){e=Ca,re(_u,e),re(Ur,t),Ca=e|t.baseLanes}function cd(){re(_u,Ca),re(Ur,Ur.current)}function od(){Ca=_u.current,V(Ur),V(_u)}var Yl=N(null),is=null;function ci(e){var t=e.alternate;re(vn,vn.current&1),re(Yl,e),is===null&&(t===null||Ur.current!==null||t.memoizedState!==null)&&(is=e)}function ud(e){re(vn,vn.current),re(Yl,e),is===null&&(is=e)}function Ip(e){e.tag===22?(re(vn,vn.current),re(Yl,e),is===null&&(is=e)):oi()}function oi(){re(vn,vn.current),re(Yl,Yl.current)}function $l(e){V(Yl),is===e&&(is=null),V(vn)}var vn=N(0);function vu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gh(n)||bh(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var va=0,Ze=null,At=null,En=null,ju=!1,Hr=!1,Zi=!1,Su=0,no=0,Br=null,s_=0;function gn(){throw Error(c(321))}function fd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gl(e[n],t[n]))return!1;return!0}function dd(e,t,n,a,u,f){return va=f,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Sm:Td,Zi=!1,f=n(a,u),Zi=!1,Hr&&(f=Gp(t,n,a,u)),qp(e),f}function qp(e){A.H=ao;var t=At!==null&&At.next!==null;if(va=0,En=At=Ze=null,ju=!1,no=0,Br=null,t)throw Error(c(300));e===null||Cn||(e=e.dependencies,e!==null&&Vi(e)&&(Cn=!0))}function Gp(e,t,n,a){Ze=e;var u=0;do{if(Hr&&(Br=null),no=0,Hr=!1,25<=u)throw Error(c(301));if(u+=1,En=At=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=wm,f=t(n,a)}while(Hr);return f}function a_(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?lo(t):t,e=e.useState()[0],(At!==null?At.memoizedState:null)!==e&&(Ze.flags|=1024),t}function hd(){var e=Su!==0;return Su=0,e}function pd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function md(e){if(ju){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ju=!1}va=0,En=At=Ze=null,Hr=!1,no=Su=0,Br=null}function _l(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?Ze.memoizedState=En=e:En=En.next=e,En}function jn(){if(At===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=At.next;var t=En===null?Ze.memoizedState:En.next;if(t!==null)En=t,At=e;else{if(e===null)throw Ze.alternate===null?Error(c(467)):Error(c(310));At=e,e={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},En===null?Ze.memoizedState=En=e:En=En.next=e}return En}function wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(e){var t=no;return no+=1,Br===null&&(Br=[]),e=Ut(Br,e,t),t=Ze,(En===null?t.memoizedState:En.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Sm:Td),e}function ku(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return lo(e);if(e.$$typeof===G)return _n(e)}throw Error(c(438,String(e)))}function gd(e){var t=null,n=Ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Ze.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=wu(),Ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=he;return t.index++,n}function ja(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=jn();return bd(t,At,e)}function bd(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var x=u.next;u.next=f.next,f.next=x}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var j=x=null,R=null,K=t,ae=!1;do{var oe=K.lane&-536870913;if(oe!==K.lane?(ot&oe)===oe:(va&oe)===oe){var F=K.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),oe===ni&&(ae=!0);else if((va&F)===F){K=K.next,F===ni&&(ae=!0);continue}else oe={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(j=R=oe,x=f):R=R.next=oe,Ze.lanes|=F,di|=F;oe=K.action,Zi&&n(f,oe),f=K.hasEagerState?K.eagerState:n(f,oe)}else F={lane:oe,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(j=R=F,x=f):R=R.next=F,Ze.lanes|=oe,di|=oe;K=K.next}while(K!==null&&K!==t);if(R===null?x=f:R.next=j,!gl(f,e.memoizedState)&&(Cn=!0,ae&&(n=li,n!==null)))throw n;e.memoizedState=f,e.baseState=x,e.baseQueue=R,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function xd(e){var t=jn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);gl(f,t.memoizedState)||(Cn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Yp(e,t,n){var a=Ze,u=jn(),f=st;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var x=!gl((At||u).memoizedState,n);if(x&&(u.memoizedState=n,Cn=!0),u=u.queue,vd(Vp.bind(null,a,u,e),[e]),u.getSnapshot!==t||x||En!==null&&En.memoizedState.tag&1){if(a.flags|=2048,Ir(9,{destroy:void 0},Xp.bind(null,a,u,n,t),null),Bt===null)throw Error(c(349));f||(va&127)!==0||$p(a,t,n)}return n}function $p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t=wu(),Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xp(e,t,n,a){t.value=n,t.getSnapshot=a,Qp(t)&&Kp(e)}function Vp(e,t,n){return n(function(){Qp(t)&&Kp(e)})}function Qp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gl(e,n)}catch{return!0}}function Kp(e){var t=Is(e,2);t!==null&&Ul(t,e,2)}function yd(e){var t=_l();if(typeof e=="function"){var n=e;if(e=n(),Zi){Et(!0);try{n()}finally{Et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:e},t}function Zp(e,t,n,a){return e.baseState=n,bd(e,At,typeof a=="function"?a:ja)}function i_(e,t,n,a,u){if(Cu(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};A.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Fp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Fp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=A.T,x={};A.T=x;try{var j=n(u,a),R=A.S;R!==null&&R(x,j),Jp(e,t,j)}catch(K){_d(e,t,K)}finally{f!==null&&x.types!==null&&(f.types=x.types),A.T=f}}else try{f=n(u,a),Jp(e,t,f)}catch(K){_d(e,t,K)}}function Jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Wp(e,t,a)},function(a){return _d(e,t,a)}):Wp(e,t,n)}function Wp(e,t,n){t.status="fulfilled",t.value=n,Pp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Fp(e,n)))}function _d(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Pp(t),t=t.next;while(t!==a)}e.action=null}function Pp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function em(e,t){return t}function tm(e,t){if(st){var n=Bt.formState;if(n!==null){e:{var a=Ze;if(st){if(zt){t:{for(var u=zt,f=Al;u.nodeType!==8;){if(!f){u=null;break t}if(u=rs(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){zt=rs(u.nextSibling),a=u.data==="F!";break e}}Ys(a)}a=!1}a&&(t=n[0])}}return n=_l(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:t},n.queue=a,n=_m.bind(null,Ze,a),a.dispatch=n,a=yd(!1),f=Nd.bind(null,Ze,!1,a.queue),a=_l(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=i_.bind(null,Ze,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function nm(e){var t=jn();return lm(t,At,e)}function lm(e,t,n){if(t=bd(e,t,em)[0],e=Nu(ja)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=lo(t)}catch(x){throw x===ya?I:x}else a=t;t=jn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Ze.flags|=2048,Ir(9,{destroy:void 0},r_.bind(null,u,n),null)),[a,f,e]}function r_(e,t){e.action=t}function sm(e){var t=jn(),n=At;if(n!==null)return lm(t,n,e);jn(),t=t.memoizedState,n=jn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ir(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=wu(),Ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function am(){return jn().memoizedState}function Tu(e,t,n,a){var u=_l();Ze.flags|=e,u.memoizedState=Ir(1|t,{destroy:void 0},n,a===void 0?null:a)}function Eu(e,t,n,a){var u=jn();a=a===void 0?null:a;var f=u.memoizedState.inst;At!==null&&a!==null&&fd(a,At.memoizedState.deps)?u.memoizedState=Ir(t,f,n,a):(Ze.flags|=e,u.memoizedState=Ir(1|t,f,n,a))}function im(e,t){Tu(8390656,8,e,t)}function vd(e,t){Eu(2048,8,e,t)}function c_(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=wu(),Ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function rm(e){var t=jn().memoizedState;return c_({ref:t,nextImpl:e}),function(){if((_t&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function cm(e,t){return Eu(4,2,e,t)}function om(e,t){return Eu(4,4,e,t)}function um(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fm(e,t,n){n=n!=null?n.concat([e]):null,Eu(4,4,um.bind(null,t,e),n)}function jd(){}function dm(e,t){var n=jn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&fd(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function hm(e,t){var n=jn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&fd(t,a[1]))return a[0];if(a=e(),Zi){Et(!0);try{e()}finally{Et(!1)}}return n.memoizedState=[a,t],a}function Sd(e,t,n){return n===void 0||(va&1073741824)!==0&&(ot&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=pg(),Ze.lanes|=e,di|=e,n)}function pm(e,t,n,a){return gl(n,t)?n:Ur.current!==null?(e=Sd(e,n,a),gl(e,t)||(Cn=!0),e):(va&42)===0||(va&1073741824)!==0&&(ot&261930)===0?(Cn=!0,e.memoizedState=n):(e=pg(),Ze.lanes|=e,di|=e,t)}function mm(e,t,n,a,u){var f=ce.p;ce.p=f!==0&&8>f?f:8;var x=A.T,j={};A.T=j,Nd(e,!1,t,n);try{var R=u(),K=A.S;if(K!==null&&K(j,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ae=xu(R,a);so(e,t,ae,Ql(e))}else so(e,t,a,Ql(e))}catch(oe){so(e,t,{then:function(){},status:"rejected",reason:oe},Ql())}finally{ce.p=f,x!==null&&j.types!==null&&(x.types=j.types),A.T=x}}function o_(){}function wd(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=gm(e).queue;mm(e,u,t,z,n===null?o_:function(){return bm(e),n(a)})}function gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:z},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bm(e){var t=gm(e);t.next===null&&(t=e.alternate.memoizedState),so(e,t.next.queue,{},Ql())}function kd(){return _n(jo)}function xm(){return jn().memoizedState}function ym(){return jn().memoizedState}function u_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ql();e=ii(n);var a=ri(t,e,n);a!==null&&(Ul(a,t,n),Pc(a,t,n)),t={cache:Fc()},e.payload=t;return}t=t.return}}function f_(e,t,n){var a=Ql();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cu(e)?vm(t,n):(n=Gc(e,t,n,a),n!==null&&(Ul(n,e,a),jm(n,t,a)))}function _m(e,t,n){var a=Ql();so(e,t,n,a)}function so(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))vm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var x=t.lastRenderedState,j=f(x,n);if(u.hasEagerState=!0,u.eagerState=j,gl(j,x))return Xi(e,t,u,0),Bt===null&&Bs(),!1}catch{}finally{}if(n=Gc(e,t,u,a),n!==null)return Ul(n,e,a),jm(n,t,a),!0}return!1}function Nd(e,t,n,a){if(a={lane:2,revertLane:sh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(t)throw Error(c(479))}else t=Gc(e,n,a,2),t!==null&&Ul(t,e,2)}function Cu(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function vm(e,t){Hr=ju=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,hl(e,n)}}var ao={readContext:_n,use:ku,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useLayoutEffect:gn,useInsertionEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useSyncExternalStore:gn,useId:gn,useHostTransitionStatus:gn,useFormState:gn,useActionState:gn,useOptimistic:gn,useMemoCache:gn,useCacheRefresh:gn};ao.useEffectEvent=gn;var Sm={readContext:_n,use:ku,useCallback:function(e,t){return _l().memoizedState=[e,t===void 0?null:t],e},useContext:_n,useEffect:im,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Tu(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tu(4194308,4,e,t)},useInsertionEffect:function(e,t){Tu(4,2,e,t)},useMemo:function(e,t){var n=_l();t=t===void 0?null:t;var a=e();if(Zi){Et(!0);try{e()}finally{Et(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=_l();if(n!==void 0){var u=n(t);if(Zi){Et(!0);try{n(t)}finally{Et(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=f_.bind(null,Ze,e),[a.memoizedState,e]},useRef:function(e){var t=_l();return e={current:e},t.memoizedState=e},useState:function(e){e=yd(e);var t=e.queue,n=_m.bind(null,Ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:jd,useDeferredValue:function(e,t){var n=_l();return Sd(n,e,t)},useTransition:function(){var e=yd(!1);return e=mm.bind(null,Ze,e.queue,!0,!1),_l().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Ze,u=_l();if(st){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Bt===null)throw Error(c(349));(ot&127)!==0||$p(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,im(Vp.bind(null,a,f,e),[e]),a.flags|=2048,Ir(9,{destroy:void 0},Xp.bind(null,a,f,n,t),null),n},useId:function(){var e=_l(),t=Bt.identifierPrefix;if(st){var n=ls,a=ns;n=(a&~(1<<32-Pe(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Su++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=s_++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kd,useFormState:tm,useActionState:tm,useOptimistic:function(e){var t=_l();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Nd.bind(null,Ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:gd,useCacheRefresh:function(){return _l().memoizedState=u_.bind(null,Ze)},useEffectEvent:function(e){var t=_l(),n={impl:e};return t.memoizedState=n,function(){if((_t&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Td={readContext:_n,use:ku,useCallback:dm,useContext:_n,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:Nu,useRef:am,useState:function(){return Nu(ja)},useDebugValue:jd,useDeferredValue:function(e,t){var n=jn();return pm(n,At.memoizedState,e,t)},useTransition:function(){var e=Nu(ja)[0],t=jn().memoizedState;return[typeof e=="boolean"?e:lo(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:kd,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=jn();return Zp(n,At,e,t)},useMemoCache:gd,useCacheRefresh:ym};Td.useEffectEvent=rm;var wm={readContext:_n,use:ku,useCallback:dm,useContext:_n,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:xd,useRef:am,useState:function(){return xd(ja)},useDebugValue:jd,useDeferredValue:function(e,t){var n=jn();return At===null?Sd(n,e,t):pm(n,At.memoizedState,e,t)},useTransition:function(){var e=xd(ja)[0],t=jn().memoizedState;return[typeof e=="boolean"?e:lo(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:kd,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=jn();return At!==null?Zp(n,At,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:gd,useCacheRefresh:ym};wm.useEffectEvent=rm;function Ed(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cd={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Ql(),u=ii(a);u.payload=t,n!=null&&(u.callback=n),t=ri(e,u,a),t!==null&&(Ul(t,e,a),Pc(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Ql(),u=ii(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ri(e,u,a),t!==null&&(Ul(t,e,a),Pc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ql(),a=ii(n);a.tag=2,t!=null&&(a.callback=t),t=ri(e,a,n),t!==null&&(Ul(t,e,n),Pc(t,e,n))}};function km(e,t,n,a,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,x):t.prototype&&t.prototype.isPureReactComponent?!ts(n,a)||!ts(u,f):!0}function Nm(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Cd.enqueueReplaceState(t,t.state,null)}function Fi(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=S({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Tm(e){Tr(e)}function Em(e){console.error(e)}function Cm(e){Tr(e)}function Au(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Am(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ad(e,t,n){return n=ii(n),n.tag=3,n.payload={element:null},n.callback=function(){Au(e,t)},n}function Mm(e){return e=ii(e),e.tag=3,e}function Rm(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){Am(t,n,a)}}var x=n.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Am(t,n,a),typeof u!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var j=a.stack;this.componentDidCatch(a.value,{componentStack:j!==null?j:""})})}function d_(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&as(t,n,u,!0),n=Yl.current,n!==null){switch(n.tag){case 31:case 13:return is===null?Gu():n.alternate===null&&bn===0&&(bn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===de?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),th(e,a,u)),!1;case 22:return n.flags|=65536,a===de?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),th(e,a,u)),!1}throw Error(c(435,n.tag))}return th(e,a,u),Gu(),!1}if(st)return t=Yl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==Qc&&(e=Error(c(422),{cause:a}),Jn(El(e,n)))):(a!==Qc&&(t=Error(c(423),{cause:a}),Jn(El(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=El(a,n),u=Ad(e.stateNode,a,u),id(e,u),bn!==4&&(bn=2)),!1;var f=Error(c(520),{cause:a});if(f=El(f,n),po===null?po=[f]:po.push(f),bn!==4&&(bn=2),t===null)return!0;a=El(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Ad(n.stateNode,a,e),id(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(hi===null||!hi.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Mm(u),Rm(u,e,n,a),id(n,u),!1}n=n.return}while(n!==null);return!1}var Md=Error(c(461)),Cn=!1;function el(e,t,n,a){t.child=e===null?zr(t,null,n,a):Pn(t,e.child,n,a)}function Dm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var x={};for(var j in a)j!=="ref"&&(x[j]=a[j])}else x=a;return xa(t),a=dd(e,t,n,x,f,u),j=hd(),e!==null&&!Cn?(pd(e,t,u),Sa(e,t,u)):(st&&j&&Xc(t),t.flags|=1,el(e,t,a,u),t.child)}function Om(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!Yc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Lm(e,t,f,a,u)):(e=Cr(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Bd(e,u)){var x=f.memoizedProps;if(n=n.compare,n=n!==null?n:ts,n(x,a)&&e.ref===t.ref)return Sa(e,t,u)}return t.flags|=1,e=vs(f,a),e.ref=t.ref,e.return=t,t.child=e}function Lm(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(ts(f,a)&&e.ref===t.ref)if(Cn=!1,t.pendingProps=a=f,Bd(e,u))(e.flags&131072)!==0&&(Cn=!0);else return t.lanes=e.lanes,Sa(e,t,u)}return Rd(e,t,n,a,u)}function zm(e,t,n,a){var u=a.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~f}else a=0,t.child=null;return Um(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Lr(t,f!==null?f.cachePool:null),f!==null?Bp(t,f):cd(),Ip(t);else return a=t.lanes=536870912,Um(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(Lr(t,f.cachePool),Bp(t,f),oi(),t.memoizedState=null):(e!==null&&Lr(t,null),cd(),oi());return el(e,t,u,n),t.child}function io(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Um(e,t,n,a,u){var f=Ki();return f=f===null?null:{parent:un._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Lr(t,null),cd(),Ip(t),e!==null&&as(e,t,a,!0),t.childLanes=u,null}function Mu(e,t){return t=Du({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hm(e,t,n){return Pn(t,e.child,null,n),e=Mu(t,t.pendingProps),e.flags|=2,$l(t),t.memoizedState=null,e}function h_(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(st){if(a.mode==="hidden")return e=Mu(t,a),t.lanes=536870912,io(null,e);if(ud(t),(e=zt)?(e=Fg(e,Al),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qs!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=du(e),n.return=t,t.child=n,Hn=t,zt=null)):e=null,e===null)throw Ys(t);return t.lanes=536870912,null}return Mu(t,a)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(ud(t),u)if(t.flags&256)t.flags&=-257,t=Hm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Cn||as(e,t,n,!1),u=(n&e.childLanes)!==0,Cn||u){if(a=Bt,a!==null&&(x=al(a,n),x!==0&&x!==f.retryLane))throw f.retryLane=x,Is(e,x),Ul(a,e,x),Md;Gu(),t=Hm(e,t,n)}else e=f.treeContext,zt=rs(x.nextSibling),Hn=t,st=!0,Gs=null,Al=!1,e!==null&&mu(t,e),t=Mu(t,a),t.flags|=4096;return t}return e=vs(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ru(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rd(e,t,n,a,u){return xa(t),n=dd(e,t,n,a,void 0,u),a=hd(),e!==null&&!Cn?(pd(e,t,u),Sa(e,t,u)):(st&&a&&Xc(t),t.flags|=1,el(e,t,n,u),t.child)}function Bm(e,t,n,a,u,f){return xa(t),t.updateQueue=null,n=Gp(t,a,n,u),qp(e),a=hd(),e!==null&&!Cn?(pd(e,t,f),Sa(e,t,f)):(st&&a&&Xc(t),t.flags|=1,el(e,t,n,f),t.child)}function Im(e,t,n,a,u){if(xa(t),t.stateNode===null){var f=Za,x=n.contextType;typeof x=="object"&&x!==null&&(f=_n(x)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Cd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},sd(t),x=n.contextType,f.context=typeof x=="object"&&x!==null?_n(x):Za,f.state=t.memoizedState,x=n.getDerivedStateFromProps,typeof x=="function"&&(Ed(t,n,x,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Cd.enqueueReplaceState(f,f.state,null),to(t,a,f,u),eo(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var j=t.memoizedProps,R=Fi(n,j);f.props=R;var K=f.context,ae=n.contextType;x=Za,typeof ae=="object"&&ae!==null&&(x=_n(ae));var oe=n.getDerivedStateFromProps;ae=typeof oe=="function"||typeof f.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,ae||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(j||K!==x)&&Nm(t,f,a,x),ai=!1;var F=t.memoizedState;f.state=F,to(t,a,f,u),eo(),K=t.memoizedState,j||F!==K||ai?(typeof oe=="function"&&(Ed(t,n,oe,a),K=t.memoizedState),(R=ai||km(t,n,R,a,F,K,x))?(ae||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=K),f.props=a,f.state=K,f.context=x,a=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,ad(e,t),x=t.memoizedProps,ae=Fi(n,x),f.props=ae,oe=t.pendingProps,F=f.context,K=n.contextType,R=Za,typeof K=="object"&&K!==null&&(R=_n(K)),j=n.getDerivedStateFromProps,(K=typeof j=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==oe||F!==R)&&Nm(t,f,a,R),ai=!1,F=t.memoizedState,f.state=F,to(t,a,f,u),eo();var te=t.memoizedState;x!==oe||F!==te||ai||e!==null&&e.dependencies!==null&&Vi(e.dependencies)?(typeof j=="function"&&(Ed(t,n,j,a),te=t.memoizedState),(ae=ai||km(t,n,ae,a,F,te,R)||e!==null&&e.dependencies!==null&&Vi(e.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,te,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,te,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=te),f.props=a,f.state=te,f.context=R,a=ae):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,Ru(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=Pn(t,e.child,null,u),t.child=Pn(t,null,n,u)):el(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Sa(e,t,u),e}function qm(e,t,n,a){return ss(),t.flags|=256,el(e,t,n,a),t.child}var Dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Od(e){return{baseLanes:e,cachePool:Jc()}}function Ld(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Vl),e}function Gm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(vn.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(u?ci(t):oi(),(e=zt)?(e=Fg(e,Al),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qs!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=du(e),n.return=t,t.child=n,Hn=t,zt=null)):e=null,e===null)throw Ys(t);return bh(e)?t.lanes=32:t.lanes=536870912,null}var j=a.children;return a=a.fallback,u?(oi(),u=t.mode,j=Du({mode:"hidden",children:j},u),a=ma(a,u,n,null),j.return=t,a.return=t,j.sibling=a,t.child=j,a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,x,n),t.memoizedState=Dd,io(null,a)):(ci(t),zd(t,j))}var R=e.memoizedState;if(R!==null&&(j=R.dehydrated,j!==null)){if(f)t.flags&256?(ci(t),t.flags&=-257,t=Ud(e,t,n)):t.memoizedState!==null?(oi(),t.child=e.child,t.flags|=128,t=null):(oi(),j=a.fallback,u=t.mode,a=Du({mode:"visible",children:a.children},u),j=ma(j,u,n,null),j.flags|=2,a.return=t,j.return=t,a.sibling=j,t.child=a,Pn(t,e.child,null,n),a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,x,n),t.memoizedState=Dd,t=io(null,a));else if(ci(t),bh(j)){if(x=j.nextSibling&&j.nextSibling.dataset,x)var K=x.dgst;x=K,a=Error(c(419)),a.stack="",a.digest=x,Jn({value:a,source:null,stack:null}),t=Ud(e,t,n)}else if(Cn||as(e,t,n,!1),x=(n&e.childLanes)!==0,Cn||x){if(x=Bt,x!==null&&(a=al(x,n),a!==0&&a!==R.retryLane))throw R.retryLane=a,Is(e,a),Ul(x,e,a),Md;gh(j)||Gu(),t=Ud(e,t,n)}else gh(j)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,zt=rs(j.nextSibling),Hn=t,st=!0,Gs=null,Al=!1,e!==null&&mu(t,e),t=zd(t,a.children),t.flags|=4096);return t}return u?(oi(),j=a.fallback,u=t.mode,R=e.child,K=R.sibling,a=vs(R,{mode:"hidden",children:a.children}),a.subtreeFlags=R.subtreeFlags&65011712,K!==null?j=vs(K,j):(j=ma(j,u,n,null),j.flags|=2),j.return=t,a.return=t,a.sibling=j,t.child=a,io(null,a),a=t.child,j=e.child.memoizedState,j===null?j=Od(n):(u=j.cachePool,u!==null?(R=un._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=Jc(),j={baseLanes:j.baseLanes|n,cachePool:u}),a.memoizedState=j,a.childLanes=Ld(e,x,n),t.memoizedState=Dd,io(e.child,a)):(ci(t),n=e.child,e=n.sibling,n=vs(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=n,t.memoizedState=null,n)}function zd(e,t){return t=Du({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Du(e,t){return e=xl(22,e,null,t),e.lanes=0,e}function Ud(e,t,n){return Pn(t,e.child,null,n),e=zd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ym(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Mr(e.return,t,n)}function Hd(e,t,n,a,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=a,x.tail=n,x.tailMode=u,x.treeForkCount=f)}function $m(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var x=vn.current,j=(x&2)!==0;if(j?(x=x&1|2,t.flags|=128):x&=1,re(vn,x),el(e,t,a,n),a=st?ga:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ym(e,n,t);else if(e.tag===19)Ym(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&vu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Hd(t,!1,u,n,f,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&vu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Hd(t,!0,n,null,f,a);break;case"together":Hd(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Sa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),di|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(as(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=vs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Bd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Vi(e)))}function p_(e,t,n){switch(t.tag){case 3:yt(t,t.stateNode.containerInfo),Ss(t,un,e.memoizedState.cache),ss();break;case 27:case 5:Xe(t);break;case 4:yt(t,t.stateNode.containerInfo);break;case 10:Ss(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ud(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ci(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Gm(e,t,n):(ci(t),e=Sa(e,t,n),e!==null?e.sibling:null);ci(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(as(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return $m(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),re(vn,vn.current),a)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:Ss(t,un,e.memoizedState.cache)}return Sa(e,t,n)}function Xm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Cn=!0;else{if(!Bd(e,n)&&(t.flags&128)===0)return Cn=!1,p_(e,t,n);Cn=(e.flags&131072)!==0}else Cn=!1,st&&(t.flags&1048576)!==0&&pu(t,ga,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Zt(t.elementType),t.type=e,typeof e=="function")Yc(e)?(a=Fi(e,a),t.tag=1,t=Im(null,t,e,a,n)):(t.tag=0,t=Rd(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===O){t.tag=11,t=Dm(null,t,e,a,n);break e}else if(u===D){t.tag=14,t=Om(null,t,e,a,n);break e}}throw t=Me(e)||e,Error(c(306,t,""))}}return t;case 0:return Rd(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=Fi(a,t.pendingProps),Im(e,t,a,u,n);case 3:e:{if(yt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,ad(e,t),to(t,a,null,n);var x=t.memoizedState;if(a=x.cache,Ss(t,un,a),a!==f.cache&&Zc(t,[un],n,!0),eo(),a=x.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=qm(e,t,a,n);break e}else if(a!==u){u=El(Error(c(424)),t),Jn(u),t=qm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(zt=rs(e.firstChild),Hn=t,st=!0,Gs=null,Al=!0,n=zr(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ss(),a===u){t=Sa(e,t,n);break e}el(e,t,a,n)}t=t.child}return t;case 26:return Ru(e,t),e===null?(n=nb(t.type,null,t.pendingProps,null))?t.memoizedState=n:st||(n=t.type,e=t.pendingProps,a=Zu(ve.current).createElement(n),a[Qt]=t,a[Oe]=e,tl(a,n,e),Fe(a),t.stateNode=a):t.memoizedState=nb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xe(t),e===null&&st&&(a=t.stateNode=Pg(t.type,t.pendingProps,ve.current),Hn=t,Al=!0,u=zt,bi(t.type)?(xh=u,zt=rs(a.firstChild)):zt=u),el(e,t,t.pendingProps.children,n),Ru(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((u=a=zt)&&(a=$_(a,t.type,t.pendingProps,Al),a!==null?(t.stateNode=a,Hn=t,zt=rs(a.firstChild),Al=!1,u=!0):u=!1),u||Ys(t)),Xe(t),u=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,a=f.children,hh(u,f)?a=null:x!==null&&hh(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=dd(e,t,a_,null,null,n),jo._currentValue=u),Ru(e,t),el(e,t,a,n),t.child;case 6:return e===null&&st&&((e=n=zt)&&(n=X_(n,t.pendingProps,Al),n!==null?(t.stateNode=n,Hn=t,zt=null,e=!0):e=!1),e||Ys(t)),null;case 13:return Gm(e,t,n);case 4:return yt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Pn(t,null,a,n):el(e,t,a,n),t.child;case 11:return Dm(e,t,t.type,t.pendingProps,n);case 7:return el(e,t,t.pendingProps,n),t.child;case 8:return el(e,t,t.pendingProps.children,n),t.child;case 12:return el(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Ss(t,t.type,a.value),el(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,xa(t),u=_n(u),a=a(u),t.flags|=1,el(e,t,a,n),t.child;case 14:return Om(e,t,t.type,t.pendingProps,n);case 15:return Lm(e,t,t.type,t.pendingProps,n);case 19:return $m(e,t,n);case 31:return h_(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return xa(t),a=_n(un),e===null?(u=Ki(),u===null&&(u=Bt,f=Fc(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},sd(t),Ss(t,un,u)):((e.lanes&n)!==0&&(ad(e,t),to(t,null,null,n),eo()),u=e.memoizedState,f=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ss(t,un,a)):(a=f.cache,Ss(t,un,a),a!==u.cache&&Zc(t,[un],n,!0))),el(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function wa(e){e.flags|=4}function Id(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(xg())e.flags|=8192;else throw Bn=de,p}else e.flags&=-16777217}function Vm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rb(t))if(xg())e.flags|=8192;else throw Bn=de,p}function Ou(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?On():536870912,e.lanes|=t,$r|=t)}function ro(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function m_(e,t,n){var a=t.pendingProps;switch(Vc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return Ft(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ml(un),$e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ba(t)?wa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yl())),Ft(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(wa(t),f!==null?(Ft(t),Vm(t,f)):(Ft(t),Id(t,u,null,a,n))):f?f!==e.memoizedState?(wa(t),Ft(t),Vm(t,f)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&wa(t),Ft(t),Id(t,u,e,a,n)),null;case 27:if(Ve(t),n=ve.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&wa(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}e=me.current,ba(t)?gu(t):(e=Pg(u,a,n),t.stateNode=e,wa(t))}return Ft(t),null;case 5:if(Ve(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&wa(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}if(f=me.current,ba(t))gu(t);else{var x=Zu(ve.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?x.createElement("select",{is:a.is}):x.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?x.createElement(u,{is:a.is}):x.createElement(u)}}f[Qt]=t,f[Oe]=a;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=f;e:switch(tl(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&&wa(t)}}return Ft(t),Id(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&wa(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=ve.current,ba(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Hn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Qt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Gg(e.nodeValue,n)),e||Ys(t,!0)}else e=Zu(e).createTextNode(a),e[Qt]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=ba(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[Qt]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($l(t),t):($l(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ft(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ba(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[Qt]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),u=!1}else u=yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?($l(t),t):($l(t),null)}return $l(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ou(t,t.updateQueue),Ft(t),null);case 4:return $e(),e===null&&ch(t.stateNode.containerInfo),Ft(t),null;case 10:return Ml(t.type),Ft(t),null;case 19:if(V(vn),a=t.memoizedState,a===null)return Ft(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)ro(a,!1);else{if(bn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=vu(e),f!==null){for(t.flags|=128,ro(a,!1),e=f.updateQueue,t.updateQueue=e,Ou(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fu(n,e),n=n.sibling;return re(vn,vn.current&1|2),st&&js(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&nt()>Bu&&(t.flags|=128,u=!0,ro(a,!1),t.lanes=4194304)}else{if(!u)if(e=vu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ou(t,e),ro(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!st)return Ft(t),null}else 2*nt()-a.renderingStartTime>Bu&&n!==536870912&&(t.flags|=128,u=!0,ro(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=nt(),e.sibling=null,n=vn.current,re(vn,u?n&1|2:n&1),st&&js(t,a.treeForkCount),e):(Ft(t),null);case 22:case 23:return $l(t),od(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),n=t.updateQueue,n!==null&&Ou(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&V(Rl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ml(un),Ft(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function g_(e,t){switch(Vc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ml(un),$e(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ve(t),null;case 31:if(t.memoizedState!==null){if($l(t),t.alternate===null)throw Error(c(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($l(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(vn),null;case 4:return $e(),null;case 10:return Ml(t.type),null;case 22:case 23:return $l(t),od(),e!==null&&V(Rl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ml(un),null;case 25:return null;default:return null}}function Qm(e,t){switch(Vc(t),t.tag){case 3:Ml(un),$e();break;case 26:case 27:case 5:Ve(t);break;case 4:$e();break;case 31:t.memoizedState!==null&&$l(t);break;case 13:$l(t);break;case 19:V(vn);break;case 10:Ml(t.type);break;case 22:case 23:$l(t),od(),e!==null&&V(Rl);break;case 24:Ml(un)}}function co(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,x=n.inst;a=f(),x.destroy=a}n=n.next}while(n!==u)}}catch(j){Tt(t,t.return,j)}}function ui(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var x=a.inst,j=x.destroy;if(j!==void 0){x.destroy=void 0,u=t;var R=n,K=j;try{K()}catch(ae){Tt(u,R,ae)}}}a=a.next}while(a!==f)}}catch(ae){Tt(t,t.return,ae)}}function Km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hp(t,n)}catch(a){Tt(e,e.return,a)}}}function Zm(e,t,n){n.props=Fi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Tt(e,t,a)}}function oo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){Tt(e,t,u)}}function Xs(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){Tt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){Tt(e,t,u)}else n.current=null}function Fm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){Tt(e,e.return,u)}}function qd(e,t,n){try{var a=e.stateNode;H_(a,e.type,n,t),a[Oe]=t}catch(u){Tt(e,e.return,u)}}function Jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bi(e.type)||e.tag===4}function Gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yd(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ke));else if(a!==4&&(a===27&&bi(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yd(e,t,n),e=e.sibling;e!==null;)Yd(e,t,n),e=e.sibling}function Lu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&bi(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Wm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);tl(t,a,n),t[Qt]=e,t[Oe]=n}catch(f){Tt(e,e.return,f)}}var ka=!1,An=!1,$d=!1,Pm=typeof WeakSet=="function"?WeakSet:Set,Vn=null;function b_(e,t){if(e=e.containerInfo,fh=nf,e=au(e),Dc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var x=0,j=-1,R=-1,K=0,ae=0,oe=e,F=null;t:for(;;){for(var te;oe!==n||u!==0&&oe.nodeType!==3||(j=x+u),oe!==f||a!==0&&oe.nodeType!==3||(R=x+a),oe.nodeType===3&&(x+=oe.nodeValue.length),(te=oe.firstChild)!==null;)F=oe,oe=te;for(;;){if(oe===e)break t;if(F===n&&++K===u&&(j=x),F===f&&++ae===a&&(R=x),(te=oe.nextSibling)!==null)break;oe=F,F=oe.parentNode}oe=te}n=j===-1||R===-1?null:{start:j,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(dh={focusedElem:e,selectionRange:n},nf=!1,Vn=t;Vn!==null;)if(t=Vn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Vn=e;else for(;Vn!==null;){switch(t=Vn,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,a=n.stateNode;try{var Re=Fi(n.type,u);e=a.getSnapshotBeforeUpdate(Re,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(qe){Tt(n,n.return,qe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Vn=e;break}Vn=t.return}}function eg(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Ta(e,n),a&4&&co(5,n);break;case 1:if(Ta(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(x){Tt(n,n.return,x)}else{var u=Fi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Tt(n,n.return,x)}}a&64&&Km(n),a&512&&oo(n,n.return);break;case 3:if(Ta(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Hp(e,t)}catch(x){Tt(n,n.return,x)}}break;case 27:t===null&&a&4&&Wm(n);case 26:case 5:Ta(e,n),t===null&&a&4&&Fm(n),a&512&&oo(n,n.return);break;case 12:Ta(e,n);break;case 31:Ta(e,n),a&4&&lg(e,n);break;case 13:Ta(e,n),a&4&&sg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=N_.bind(null,n),V_(e,n))));break;case 22:if(a=n.memoizedState!==null||ka,!a){t=t!==null&&t.memoizedState!==null||An,u=ka;var f=An;ka=a,(An=t)&&!f?Ea(e,n,(n.subtreeFlags&8772)!==0):Ta(e,n),ka=u,An=f}break;case 30:break;default:Ta(e,n)}}function tg(e){var t=e.alternate;t!==null&&(e.alternate=null,tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Il(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rn=null,Dl=!1;function Na(e,t,n){for(n=n.child;n!==null;)ng(e,t,n),n=n.sibling}function ng(e,t,n){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(Gt,n)}catch{}switch(n.tag){case 26:An||Xs(n,t),Na(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:An||Xs(n,t);var a=rn,u=Dl;bi(n.type)&&(rn=n.stateNode,Dl=!1),Na(e,t,n),yo(n.stateNode),rn=a,Dl=u;break;case 5:An||Xs(n,t);case 6:if(a=rn,u=Dl,rn=null,Na(e,t,n),rn=a,Dl=u,rn!==null)if(Dl)try{(rn.nodeType===9?rn.body:rn.nodeName==="HTML"?rn.ownerDocument.body:rn).removeChild(n.stateNode)}catch(f){Tt(n,t,f)}else try{rn.removeChild(n.stateNode)}catch(f){Tt(n,t,f)}break;case 18:rn!==null&&(Dl?(e=rn,Kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wr(e)):Kg(rn,n.stateNode));break;case 4:a=rn,u=Dl,rn=n.stateNode.containerInfo,Dl=!0,Na(e,t,n),rn=a,Dl=u;break;case 0:case 11:case 14:case 15:ui(2,n,t),An||ui(4,n,t),Na(e,t,n);break;case 1:An||(Xs(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Zm(n,t,a)),Na(e,t,n);break;case 21:Na(e,t,n);break;case 22:An=(a=An)||n.memoizedState!==null,Na(e,t,n),An=a;break;default:Na(e,t,n)}}function lg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wr(e)}catch(n){Tt(t,t.return,n)}}}function sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wr(e)}catch(n){Tt(t,t.return,n)}}function x_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Pm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pm),t;default:throw Error(c(435,e.tag))}}function zu(e,t){var n=x_(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=T_.bind(null,e,a);a.then(u,u)}})}function Ol(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,x=t,j=x;e:for(;j!==null;){switch(j.tag){case 27:if(bi(j.type)){rn=j.stateNode,Dl=!1;break e}break;case 5:rn=j.stateNode,Dl=!1;break e;case 3:case 4:rn=j.stateNode.containerInfo,Dl=!0;break e}j=j.return}if(rn===null)throw Error(c(160));ng(f,x,u),rn=null,Dl=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ag(t,e),t=t.sibling}var ws=null;function ag(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ol(t,e),Ll(e),a&4&&(ui(3,e,e.return),co(3,e),ui(5,e,e.return));break;case 1:Ol(t,e),Ll(e),a&512&&(An||n===null||Xs(n,n.return)),a&64&&ka&&(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=ws;if(Ol(t,e),Ll(e),a&512&&(An||n===null||Xs(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[wn]||f[Qt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),tl(f,a,n),f[Qt]=e,Fe(f),a=f;break e;case"link":var x=ab("link","href",u).get(a+(n.href||""));if(x){for(var j=0;j<x.length;j++)if(f=x[j],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){x.splice(j,1);break t}}f=u.createElement(a),tl(f,a,n),u.head.appendChild(f);break;case"meta":if(x=ab("meta","content",u).get(a+(n.content||""))){for(j=0;j<x.length;j++)if(f=x[j],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){x.splice(j,1);break t}}f=u.createElement(a),tl(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Qt]=e,Fe(f),a=f}e.stateNode=a}else ib(u,e.type,e.stateNode);else e.stateNode=sb(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?ib(u,e.type,e.stateNode):sb(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&qd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ol(t,e),Ll(e),a&512&&(An||n===null||Xs(n,n.return)),n!==null&&a&4&&qd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ol(t,e),Ll(e),a&512&&(An||n===null||Xs(n,n.return)),e.flags&32){u=e.stateNode;try{Y(u,"")}catch(Re){Tt(e,e.return,Re)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,qd(e,u,n!==null?n.memoizedProps:u)),a&1024&&($d=!0);break;case 6:if(Ol(t,e),Ll(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Re){Tt(e,e.return,Re)}}break;case 3:if(Wu=null,u=ws,ws=Fu(t.containerInfo),Ol(t,e),ws=u,Ll(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Wr(t.containerInfo)}catch(Re){Tt(e,e.return,Re)}$d&&($d=!1,ig(e));break;case 4:a=ws,ws=Fu(e.stateNode.containerInfo),Ol(t,e),Ll(e),ws=a;break;case 12:Ol(t,e),Ll(e);break;case 31:Ol(t,e),Ll(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 13:Ol(t,e),Ll(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Hu=nt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 22:u=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,K=ka,ae=An;if(ka=K||u,An=ae||R,Ol(t,e),An=ae,ka=K,Ll(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||ka||An||Ji(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{j=R.stateNode;var oe=R.memoizedProps.style,F=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;j.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(Re){Tt(R,R.return,Re)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(Re){Tt(R,R.return,Re)}}}else if(t.tag===18){if(n===null){R=t;try{var te=R.stateNode;u?Zg(te,!0):Zg(R.stateNode,!1)}catch(Re){Tt(R,R.return,Re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,zu(e,n))));break;case 19:Ol(t,e),Ll(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 30:break;case 21:break;default:Ol(t,e),Ll(e)}}function Ll(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Jm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Gd(e);Lu(e,f,u);break;case 5:var x=n.stateNode;n.flags&32&&(Y(x,""),n.flags&=-33);var j=Gd(e);Lu(e,j,x);break;case 3:case 4:var R=n.stateNode.containerInfo,K=Gd(e);Yd(e,K,R);break;default:throw Error(c(161))}}catch(ae){Tt(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ig(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ig(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ta(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)eg(e,t.alternate,t),t=t.sibling}function Ji(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ui(4,t,t.return),Ji(t);break;case 1:Xs(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zm(t,t.return,n),Ji(t);break;case 27:yo(t.stateNode);case 26:case 5:Xs(t,t.return),Ji(t);break;case 22:t.memoizedState===null&&Ji(t);break;case 30:Ji(t);break;default:Ji(t)}e=e.sibling}}function Ea(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:Ea(u,f,n),co(4,f);break;case 1:if(Ea(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(K){Tt(a,a.return,K)}if(a=f,u=a.updateQueue,u!==null){var j=a.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Up(R[u],j)}catch(K){Tt(a,a.return,K)}}n&&x&64&&Km(f),oo(f,f.return);break;case 27:Wm(f);case 26:case 5:Ea(u,f,n),n&&a===null&&x&4&&Fm(f),oo(f,f.return);break;case 12:Ea(u,f,n);break;case 31:Ea(u,f,n),n&&x&4&&lg(u,f);break;case 13:Ea(u,f,n),n&&x&4&&sg(u,f);break;case 22:f.memoizedState===null&&Ea(u,f,n),oo(f,f.return);break;case 30:break;default:Ea(u,f,n)}t=t.sibling}}function Xd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Qi(n))}function Vd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e))}function ks(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rg(e,t,n,a),t=t.sibling}function rg(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ks(e,t,n,a),u&2048&&co(9,t);break;case 1:ks(e,t,n,a);break;case 3:ks(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&&Qi(e)));break;case 12:if(u&2048){ks(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,j=f.onPostCommit;typeof j=="function"&&j(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Tt(t,t.return,R)}}else ks(e,t,n,a);break;case 31:ks(e,t,n,a);break;case 13:ks(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?ks(e,t,n,a):uo(e,t):f._visibility&2?ks(e,t,n,a):(f._visibility|=2,qr(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Xd(x,t);break;case 24:ks(e,t,n,a),u&2048&&Vd(t.alternate,t);break;default:ks(e,t,n,a)}}function qr(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,x=t,j=n,R=a,K=x.flags;switch(x.tag){case 0:case 11:case 15:qr(f,x,j,R,u),co(8,x);break;case 23:break;case 22:var ae=x.stateNode;x.memoizedState!==null?ae._visibility&2?qr(f,x,j,R,u):uo(f,x):(ae._visibility|=2,qr(f,x,j,R,u)),u&&K&2048&&Xd(x.alternate,x);break;case 24:qr(f,x,j,R,u),u&&K&2048&&Vd(x.alternate,x);break;default:qr(f,x,j,R,u)}t=t.sibling}}function uo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:uo(n,a),u&2048&&Xd(a.alternate,a);break;case 24:uo(n,a),u&2048&&Vd(a.alternate,a);break;default:uo(n,a)}t=t.sibling}}var fo=8192;function Gr(e,t,n){if(e.subtreeFlags&fo)for(e=e.child;e!==null;)cg(e,t,n),e=e.sibling}function cg(e,t,n){switch(e.tag){case 26:Gr(e,t,n),e.flags&fo&&e.memoizedState!==null&&s0(n,ws,e.memoizedState,e.memoizedProps);break;case 5:Gr(e,t,n);break;case 3:case 4:var a=ws;ws=Fu(e.stateNode.containerInfo),Gr(e,t,n),ws=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=fo,fo=16777216,Gr(e,t,n),fo=a):Gr(e,t,n));break;default:Gr(e,t,n)}}function og(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ho(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Vn=a,fg(a,e)}og(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ug(e),e=e.sibling}function ug(e){switch(e.tag){case 0:case 11:case 15:ho(e),e.flags&2048&&ui(9,e,e.return);break;case 3:ho(e);break;case 12:ho(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uu(e)):ho(e);break;default:ho(e)}}function Uu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Vn=a,fg(a,e)}og(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ui(8,t,t.return),Uu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Uu(t));break;default:Uu(t)}e=e.sibling}}function fg(e,t){for(;Vn!==null;){var n=Vn;switch(n.tag){case 0:case 11:case 15:ui(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:Qi(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Vn=a;else e:for(n=e;Vn!==null;){a=Vn;var u=a.sibling,f=a.return;if(tg(a),a===n){Vn=null;break e}if(u!==null){u.return=f,Vn=u;break e}Vn=f}}}var y_={getCacheForType:function(e){var t=_n(un),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return _n(un).controller.signal}},__=typeof WeakMap=="function"?WeakMap:Map,_t=0,Bt=null,at=null,ot=0,Nt=0,Xl=null,fi=!1,Yr=!1,Qd=!1,Ca=0,bn=0,di=0,Wi=0,Kd=0,Vl=0,$r=0,po=null,zl=null,Zd=!1,Hu=0,dg=0,Bu=1/0,Iu=null,hi=null,In=0,pi=null,Xr=null,Aa=0,Fd=0,Jd=null,hg=null,mo=0,Wd=null;function Ql(){return(_t&2)!==0&&ot!==0?ot&-ot:A.T!==null?sh():Vt()}function pg(){if(Vl===0)if((ot&536870912)===0||st){var e=B;B<<=1,(B&3932160)===0&&(B=262144),Vl=e}else Vl=536870912;return e=Yl.current,e!==null&&(e.flags|=32),Vl}function Ul(e,t,n){(e===Bt&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)&&(Vr(e,0),mi(e,ot,Vl,!1)),sl(e,n),((_t&2)===0||e!==Bt)&&(e===Bt&&((_t&2)===0&&(Wi|=n),bn===4&&mi(e,ot,Vl,!1)),Vs(e))}function mg(e,t,n){if((_t&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ot(e,t),u=a?S_(e,t):eh(e,t,!0),f=a;do{if(u===0){Yr&&!a&&mi(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!v_(n)){u=eh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var j=e;u=po;var R=j.current.memoizedState.isDehydrated;if(R&&(Vr(j,x).flags|=256),x=eh(j,x,!1),x!==2){if(Qd&&!R){j.errorRecoveryDisabledLanes|=f,Wi|=f,u=4;break e}f=zl,zl=u,f!==null&&(zl===null?zl=f:zl.push.apply(zl,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){Vr(e,0),mi(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:mi(a,t,Vl,!fi);break e;case 2:zl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Hu+300-nt(),10<u)){if(mi(a,t,Vl,!fi),Be(a,0,!0)!==0)break e;Aa=t,a.timeoutHandle=Vg(gg.bind(null,a,n,zl,Iu,Zd,t,Vl,Wi,$r,fi,f,"Throttled",-0,0),u);break e}gg(a,n,zl,Iu,Zd,t,Vl,Wi,$r,fi,f,null,-0,0)}}break}while(!0);Vs(e)}function gg(e,t,n,a,u,f,x,j,R,K,ae,oe,F,te){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ke},cg(t,f,oe);var Re=(f&62914560)===f?Hu-nt():(f&4194048)===f?dg-nt():0;if(Re=a0(oe,Re),Re!==null){Aa=f,e.cancelPendingCommit=Re(wg.bind(null,e,t,f,n,a,u,x,j,R,ae,oe,null,F,te)),mi(e,f,x,!K);return}}wg(e,t,f,n,a,u,x,j,R)}function v_(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],f=u.getSnapshot;u=u.value;try{if(!gl(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 mi(e,t,n,a){t&=~Kd,t&=~Wi,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-Pe(u),x=1<<f;a[f]=-1,u&=~x}n!==0&&ds(e,n,t)}function qu(){return(_t&6)===0?(go(0),!1):!0}function Pd(){if(at!==null){if(Nt===0)var e=at.return;else e=at,Gl=$s=null,md(e),_a=null,xe=0,e=at;for(;e!==null;)Qm(e.alternate,e),e=e.return;at=null}}function Vr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,q_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Aa=0,Pd(),Bt=e,at=n=vs(e.current,null),ot=t,Nt=0,Xl=null,fi=!1,Yr=Ot(e,t),Qd=!1,$r=Vl=Kd=Wi=di=bn=0,zl=po=null,Zd=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-Pe(a),f=1<<u;t|=e[u],a&=~f}return Ca=t,Bs(),n}function bg(e,t){Ze=null,A.H=ao,t===ya||t===I?(t=si(),Nt=3):t===p?(t=si(),Nt=4):Nt=t===Md?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Xl=t,at===null&&(bn=1,Au(e,El(t,e.current)))}function xg(){var e=Yl.current;return e===null?!0:(ot&4194048)===ot?is===null:(ot&62914560)===ot||(ot&536870912)!==0?e===is:!1}function yg(){var e=A.H;return A.H=ao,e===null?ao:e}function _g(){var e=A.A;return A.A=y_,e}function Gu(){bn=4,fi||(ot&4194048)!==ot&&Yl.current!==null||(Yr=!0),(di&134217727)===0&&(Wi&134217727)===0||Bt===null||mi(Bt,ot,Vl,!1)}function eh(e,t,n){var a=_t;_t|=2;var u=yg(),f=_g();(Bt!==e||ot!==t)&&(Iu=null,Vr(e,t)),t=!1;var x=bn;e:do try{if(Nt!==0&&at!==null){var j=at,R=Xl;switch(Nt){case 8:Pd(),x=6;break e;case 3:case 2:case 9:case 6:Yl.current===null&&(t=!0);var K=Nt;if(Nt=0,Xl=null,Qr(e,j,R,K),n&&Yr){x=0;break e}break;default:K=Nt,Nt=0,Xl=null,Qr(e,j,R,K)}}j_(),x=bn;break}catch(ae){bg(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Gl=$s=null,_t=a,A.H=u,A.A=f,at===null&&(Bt=null,ot=0,Bs()),x}function j_(){for(;at!==null;)vg(at)}function S_(e,t){var n=_t;_t|=2;var a=yg(),u=_g();Bt!==e||ot!==t?(Iu=null,Bu=nt()+500,Vr(e,t)):Yr=Ot(e,t);e:do try{if(Nt!==0&&at!==null){t=at;var f=Xl;t:switch(Nt){case 1:Nt=0,Xl=null,Qr(e,t,f,1);break;case 2:case 9:if(Ge(f)){Nt=0,Xl=null,jg(t);break}t=function(){Nt!==2&&Nt!==9||Bt!==e||(Nt=7),Vs(e)},f.then(t,t);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:Ge(f)?(Nt=0,Xl=null,jg(t)):(Nt=0,Xl=null,Qr(e,t,f,7));break;case 5:var x=null;switch(at.tag){case 26:x=at.memoizedState;case 5:case 27:var j=at;if(x?rb(x):j.stateNode.complete){Nt=0,Xl=null;var R=j.sibling;if(R!==null)at=R;else{var K=j.return;K!==null?(at=K,Yu(K)):at=null}break t}}Nt=0,Xl=null,Qr(e,t,f,5);break;case 6:Nt=0,Xl=null,Qr(e,t,f,6);break;case 8:Pd(),bn=6;break e;default:throw Error(c(462))}}w_();break}catch(ae){bg(e,ae)}while(!0);return Gl=$s=null,A.H=a,A.A=u,_t=n,at!==null?0:(Bt=null,ot=0,Bs(),bn)}function w_(){for(;at!==null&&!tn();)vg(at)}function vg(e){var t=Xm(e.alternate,e,Ca);e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function jg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bm(n,t,t.pendingProps,t.type,void 0,ot);break;case 11:t=Bm(n,t,t.pendingProps,t.type.render,t.ref,ot);break;case 5:md(t);default:Qm(n,t),t=at=fu(t,Ca),t=Xm(n,t,Ca)}e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function Qr(e,t,n,a){Gl=$s=null,md(t),_a=null,xe=0;var u=t.return;try{if(d_(e,u,t,n,ot)){bn=1,Au(e,El(n,e.current)),at=null;return}}catch(f){if(u!==null)throw at=u,f;bn=1,Au(e,El(n,e.current)),at=null;return}t.flags&32768?(st||a===1?e=!0:Yr||(ot&536870912)!==0?e=!1:(fi=e=!0,(a===2||a===9||a===3||a===6)&&(a=Yl.current,a!==null&&a.tag===13&&(a.flags|=16384))),Sg(t,e)):Yu(t)}function Yu(e){var t=e;do{if((t.flags&32768)!==0){Sg(t,fi);return}e=t.return;var n=m_(t.alternate,t,Ca);if(n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);bn===0&&(bn=5)}function Sg(e,t){do{var n=g_(e.alternate,e);if(n!==null){n.flags&=32767,at=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){at=e;return}at=e=n}while(e!==null);bn=6,at=null}function wg(e,t,n,a,u,f,x,j,R){e.cancelPendingCommit=null;do $u();while(In!==0);if((_t&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=qc,Bl(e,n,f,x,j,R),e===Bt&&(at=Bt=null,ot=0),Xr=t,pi=e,Aa=n,Fd=f,Jd=u,hg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E_(wt,function(){return Cg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null,u=ce.p,ce.p=2,x=_t,_t|=4;try{b_(e,t,n)}finally{_t=x,ce.p=u,A.T=a}}In=1,kg(),Ng(),Tg()}}function kg(){if(In===1){In=0;var e=pi,t=Xr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var a=ce.p;ce.p=2;var u=_t;_t|=4;try{ag(t,e);var f=dh,x=au(e.containerInfo),j=f.focusedElem,R=f.selectionRange;if(x!==j&&j&&j.ownerDocument&&su(j.ownerDocument.documentElement,j)){if(R!==null&&Dc(j)){var K=R.start,ae=R.end;if(ae===void 0&&(ae=K),"selectionStart"in j)j.selectionStart=K,j.selectionEnd=Math.min(ae,j.value.length);else{var oe=j.ownerDocument||document,F=oe&&oe.defaultView||window;if(F.getSelection){var te=F.getSelection(),Re=j.textContent.length,qe=Math.min(R.start,Re),Rt=R.end===void 0?qe:Math.min(R.end,Re);!te.extend&&qe>Rt&&(x=Rt,Rt=qe,qe=x);var q=lu(j,qe),U=lu(j,Rt);if(q&&U&&(te.rangeCount!==1||te.anchorNode!==q.node||te.anchorOffset!==q.offset||te.focusNode!==U.node||te.focusOffset!==U.offset)){var Q=oe.createRange();Q.setStart(q.node,q.offset),te.removeAllRanges(),qe>Rt?(te.addRange(Q),te.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),te.addRange(Q))}}}}for(oe=[],te=j;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<oe.length;j++){var ie=oe[j];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}nf=!!fh,dh=fh=null}finally{_t=u,ce.p=a,A.T=n}}e.current=t,In=2}}function Ng(){if(In===2){In=0;var e=pi,t=Xr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var a=ce.p;ce.p=2;var u=_t;_t|=4;try{eg(e,t.alternate,t)}finally{_t=u,ce.p=a,A.T=n}}In=3}}function Tg(){if(In===4||In===3){In=0,$t();var e=pi,t=Xr,n=Aa,a=hg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?In=5:(In=0,Xr=pi=null,Eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(hi=null),Yt(n),t=t.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(Gt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=A.T,u=ce.p,ce.p=2,A.T=null;try{for(var f=e.onRecoverableError,x=0;x<a.length;x++){var j=a[x];f(j.value,{componentStack:j.stack})}}finally{A.T=t,ce.p=u}}(Aa&3)!==0&&$u(),Vs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Wd?mo++:(mo=0,Wd=e):mo=0,go(0)}}function Eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qi(t)))}function $u(){return kg(),Ng(),Tg(),Cg()}function Cg(){if(In!==5)return!1;var e=pi,t=Fd;Fd=0;var n=Yt(Aa),a=A.T,u=ce.p;try{ce.p=32>n?32:n,A.T=null,n=Jd,Jd=null;var f=pi,x=Aa;if(In=0,Xr=pi=null,Aa=0,(_t&6)!==0)throw Error(c(331));var j=_t;if(_t|=4,ug(f.current),rg(f,f.current,x,n),_t=j,go(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(Gt,f)}catch{}return!0}finally{ce.p=u,A.T=a,Eg(e,t)}}function Ag(e,t,n){t=El(n,t),t=Ad(e.stateNode,t,2),e=ri(e,t,2),e!==null&&(sl(e,2),Vs(e))}function Tt(e,t,n){if(e.tag===3)Ag(e,e,n);else for(;t!==null;){if(t.tag===3){Ag(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(hi===null||!hi.has(a))){e=El(n,e),n=Mm(2),a=ri(t,n,2),a!==null&&(Rm(n,a,t,e),sl(a,2),Vs(a));break}}t=t.return}}function th(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new __;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(Qd=!0,u.add(n),e=k_.bind(null,e,t,n),t.then(e,e))}function k_(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bt===e&&(ot&n)===n&&(bn===4||bn===3&&(ot&62914560)===ot&&300>nt()-Hu?(_t&2)===0&&Vr(e,0):Kd|=n,$r===ot&&($r=0)),Vs(e)}function Mg(e,t){t===0&&(t=On()),e=Is(e,t),e!==null&&(sl(e,t),Vs(e))}function N_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mg(e,n)}function T_(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),Mg(e,n)}function E_(e,t){return tt(e,t)}var Xu=null,Kr=null,nh=!1,Vu=!1,lh=!1,gi=0;function Vs(e){e!==Kr&&e.next===null&&(Kr===null?Xu=Kr=e:Kr=Kr.next=e),Vu=!0,nh||(nh=!0,A_())}function go(e,t){if(!lh&&Vu){lh=!0;do for(var n=!1,a=Xu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var x=a.suspendedLanes,j=a.pingedLanes;f=(1<<31-Pe(42|e)+1)-1,f&=u&~(x&~j),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Lg(a,f))}else f=ot,f=Be(a,a===Bt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||Ot(a,f)||(n=!0,Lg(a,f));a=a.next}while(n);lh=!1}}function C_(){Rg()}function Rg(){Vu=nh=!1;var e=0;gi!==0&&I_()&&(e=gi);for(var t=nt(),n=null,a=Xu;a!==null;){var u=a.next,f=Dg(a,t);f===0?(a.next=null,n===null?Xu=u:n.next=u,u===null&&(Kr=n)):(n=a,(e!==0||(f&3)!==0)&&(Vu=!0)),a=u}In!==0&&In!==5||go(e),gi!==0&&(gi=0)}function Dg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Pe(f),j=1<<x,R=u[x];R===-1?((j&n)===0||(j&a)!==0)&&(u[x]=fl(j,t)):R<=t&&(e.expiredLanes|=j),f&=~j}if(t=Bt,n=ot,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&et(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&et(a),Yt(n)){case 2:case 8:n=cn;break;case 32:n=wt;break;case 268435456:n=qt;break;default:n=wt}return a=Og.bind(null,e),n=tt(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&et(a),e.callbackPriority=2,e.callbackNode=null,2}function Og(e,t){if(In!==0&&In!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var a=ot;return a=Be(e,e===Bt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(mg(e,a,t),Dg(e,nt()),e.callbackNode!=null&&e.callbackNode===n?Og.bind(null,e):null)}function Lg(e,t){if($u())return null;mg(e,t,!0)}function A_(){G_(function(){(_t&6)!==0?tt(Xt,C_):Rg()})}function sh(){if(gi===0){var e=ni;e===0&&(e=He,He<<=1,(He&261888)===0&&(He=256)),gi=e}return gi}function zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:se(""+e)}function Ug(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function M_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=zg((u[Oe]||null).action),x=a.submitter;x&&(t=(t=x[Oe]||null)?zg(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var j=new zs("action","action",null,a,u);e.push({event:j,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(gi!==0){var R=x?Ug(u,x):new FormData(u);wd(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(j.preventDefault(),R=x?Ug(u,x):new FormData(u),wd(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var ah=0;ah<Nr.length;ah++){var ih=Nr[ah],R_=ih.toLowerCase(),D_=ih[0].toUpperCase()+ih.slice(1);bl(R_,"on"+D_)}bl(Uc,"onAnimationEnd"),bl(Hc,"onAnimationIteration"),bl(Bc,"onAnimationStart"),bl("dblclick","onDoubleClick"),bl("focusin","onFocus"),bl("focusout","onBlur"),bl(ru,"onTransitionRun"),bl(ed,"onTransitionStart"),bl(cu,"onTransitionCancel"),bl(Ic,"onTransitionEnd"),Zl("onMouseEnter",["mouseout","mouseover"]),Zl("onMouseLeave",["mouseout","mouseover"]),Zl("onPointerEnter",["pointerout","pointerover"]),Zl("onPointerLeave",["pointerout","pointerover"]),Gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),O_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bo));function Hg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var x=a.length-1;0<=x;x--){var j=a[x],R=j.instance,K=j.currentTarget;if(j=j.listener,R!==f&&u.isPropagationStopped())break e;f=j,u.currentTarget=K;try{f(u)}catch(ae){Tr(ae)}u.currentTarget=null,f=R}else for(x=0;x<a.length;x++){if(j=a[x],R=j.instance,K=j.currentTarget,j=j.listener,R!==f&&u.isPropagationStopped())break e;f=j,u.currentTarget=K;try{f(u)}catch(ae){Tr(ae)}u.currentTarget=null,f=R}}}}function it(e,t){var n=t[qn];n===void 0&&(n=t[qn]=new Set);var a=e+"__bubble";n.has(a)||(Bg(t,e,2,!1),n.add(a))}function rh(e,t,n){var a=0;t&&(a|=4),Bg(n,e,a,t)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function ch(e){if(!e[Qu]){e[Qu]=!0,ml.forEach(function(n){n!=="selectionchange"&&(O_.has(n)||rh(n,!1,e),rh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qu]||(t[Qu]=!0,rh("selectionchange",!1,t))}}function Bg(e,t,n,a){switch(pb(t)){case 2:var u=c0;break;case 8:u=o0;break;default:u=Sh}n=u.bind(null,t,n,e),u=void 0,!gs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function oh(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var x=a.tag;if(x===3||x===4){var j=a.stateNode.containerInfo;if(j===u)break;if(x===4)for(x=a.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;j!==null;){if(x=rl(j),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){a=f=x;continue e}j=j.parentNode}}a=a.return}wc(function(){var K=f,ae=ht(n),oe=[];e:{var F=ou.get(e);if(F!==void 0){var te=zs,Re=e;switch(e){case"keypress":if(Li(n)===0)break e;case"keydown":case"keyup":te=Ec;break;case"focusin":Re="focus",te=Tc;break;case"focusout":Re="blur",te=Tc;break;case"beforeblur":case"afterblur":te=Tc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Ia;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=yr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Sr;break;case Uc:case Hc:case Bc:te=_r;break;case Ic:te=Bi;break;case"scroll":case"scrollend":te=xr;break;case"wheel":te=Zo;break;case"copy":case"cut":case"paste":te=vr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Qo;break;case"toggle":case"beforetoggle":te=Fo}var qe=(t&4)!==0,Rt=!qe&&(e==="scroll"||e==="scrollend"),q=qe?F!==null?F+"Capture":null:F;qe=[];for(var U=K,Q;U!==null;){var ie=U;if(Q=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Q===null||q===null||(ie=Os(U,q),ie!=null&&qe.push(xo(U,ie,Q))),Rt)break;U=U.return}0<qe.length&&(F=new te(F,Re,null,n,ae),oe.push({event:F,listeners:qe}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",F&&n!==Je&&(Re=n.relatedTarget||n.fromElement)&&(rl(Re)||Re[Ct]))break e;if((te||F)&&(F=ae.window===ae?ae:(F=ae.ownerDocument)?F.defaultView||F.parentWindow:window,te?(Re=n.relatedTarget||n.toElement,te=K,Re=Re?rl(Re):null,Re!==null&&(Rt=d(Re),qe=Re.tag,Re!==Rt||qe!==5&&qe!==27&&qe!==6)&&(Re=null)):(te=null,Re=K),te!==Re)){if(qe=Ia,ie="onMouseLeave",q="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(qe=Qo,ie="onPointerLeave",q="onPointerEnter",U="pointer"),Rt=te==null?F:Kt(te),Q=Re==null?F:Kt(Re),F=new qe(ie,U+"leave",te,n,ae),F.target=Rt,F.relatedTarget=Q,ie=null,rl(ae)===K&&(qe=new qe(q,U+"enter",Re,n,ae),qe.target=Q,qe.relatedTarget=Rt,ie=qe),Rt=ie,te&&Re)t:{for(qe=L_,q=te,U=Re,Q=0,ie=q;ie;ie=qe(ie))Q++;ie=0;for(var Ue=U;Ue;Ue=qe(Ue))ie++;for(;0<Q-ie;)q=qe(q),Q--;for(;0<ie-Q;)U=qe(U),ie--;for(;Q--;){if(q===U||U!==null&&q===U.alternate){qe=q;break t}q=qe(q),U=qe(U)}qe=null}else qe=null;te!==null&&Ig(oe,F,te,qe,!1),Re!==null&&Rt!==null&&Ig(oe,Rt,Re,qe,!0)}}e:{if(F=K?Kt(K):window,te=F.nodeName&&F.nodeName.toLowerCase(),te==="select"||te==="input"&&F.type==="file")var bt=eu;else if($a(F))if(X)bt=Jf;else{bt=Zf;var Le=Xa}else te=F.nodeName,!te||te.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?K&&ze(K.elementType)&&(bt=eu):bt=Ff;if(bt&&(bt=bt(e,K))){Po(oe,bt,n,ae);break e}Le&&Le(e,F,K),e==="focusout"&&K&&F.type==="number"&&K.memoizedProps.value!=null&<(F,"number",F.value)}switch(Le=K?Kt(K):window,e){case"focusin":($a(Le)||Le.contentEditable==="true")&&(Va=Le,Oc=K,ha=null);break;case"focusout":ha=Oc=Va=null;break;case"mousedown":Lc=!0;break;case"contextmenu":case"mouseup":case"dragend":Lc=!1,iu(oe,n,ae);break;case"selectionchange":if(Pf)break;case"keydown":case"keyup":iu(oe,n,ae)}var We;if(ql)e:{switch(e){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else ys?Cc(e,n)&&(ut="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ut="onCompositionStart");ut&&(qi&&n.locale!=="ko"&&(ys||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&ys&&(We=br()):(Ls=ae,Oi="value"in Ls?Ls.value:Ls.textContent,ys=!0)),Le=Ku(K,ut),0<Le.length&&(ut=new Ui(ut,e,null,n,ae),oe.push({event:ut,listeners:Le}),We?ut.data=We:(We=Ya(n),We!==null&&(ut.data=We)))),(We=wr?Gi(e,n):Yi(e,n))&&(ut=Ku(K,"onBeforeInput"),0<ut.length&&(Le=new Ui("onBeforeInput","beforeinput",null,n,ae),oe.push({event:Le,listeners:ut}),Le.data=We)),M_(oe,e,K,n,ae)}Hg(oe,t)})}function xo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ku(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Os(e,n),u!=null&&a.unshift(xo(e,u,f)),u=Os(e,t),u!=null&&a.push(xo(e,u,f))),e.tag===3)return a;e=e.return}return[]}function L_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ig(e,t,n,a,u){for(var f=t._reactName,x=[];n!==null&&n!==a;){var j=n,R=j.alternate,K=j.stateNode;if(j=j.tag,R!==null&&R===a)break;j!==5&&j!==26&&j!==27||K===null||(R=K,u?(K=Os(n,f),K!=null&&x.unshift(xo(n,K,R))):u||(K=Os(n,f),K!=null&&x.push(xo(n,K,R)))),n=n.return}x.length!==0&&e.push({event:t,listeners:x})}var z_=/\r\n?/g,U_=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(z_,`
|
|
50
|
-
`).replace(U_,"")}function Gg(e,t){return t=qg(t),qg(e)===t}function Mt(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Y(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Y(e,""+a);break;case"className":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":Ae(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=se(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Mt(e,t,"name",u.name,u,null),Mt(e,t,"formEncType",u.formEncType,u,null),Mt(e,t,"formMethod",u.formMethod,u,null),Mt(e,t,"formTarget",u.formTarget,u,null)):(Mt(e,t,"encType",u.encType,u,null),Mt(e,t,"method",u.method,u,null),Mt(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=se(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ke);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=se(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":it("beforetoggle",e),it("toggle",e),Zn(e,"popover",a);break;case"xlinkActuate":kn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":kn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":kn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":kn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":kn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":kn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":kn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":kn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":kn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Zn(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=dt.get(n)||n,Zn(e,n,a))}}function uh(e,t,n,a,u,f){switch(n){case"style":Ae(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Y(e,a):(typeof a=="number"||typeof a=="bigint")&&Y(e,""+a);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ke);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ms.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[Oe]||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,""):Zn(e,n,a)}}}function tl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var x=n[f];if(x!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Mt(e,t,f,x,n,null)}}u&&Mt(e,t,"srcSet",n.srcSet,n,null),a&&Mt(e,t,"src",n.src,n,null);return;case"input":it("invalid",e);var j=f=x=u=null,R=null,K=null;for(a in n)if(n.hasOwnProperty(a)){var ae=n[a];if(ae!=null)switch(a){case"name":u=ae;break;case"type":x=ae;break;case"checked":R=ae;break;case"defaultChecked":K=ae;break;case"value":f=ae;break;case"defaultValue":j=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(c(137,t));break;default:Mt(e,t,a,ae,n,null)}}Jl(e,f,j,R,K,x,u,!1);return;case"select":it("invalid",e),a=x=f=null;for(u in n)if(n.hasOwnProperty(u)&&(j=n[u],j!=null))switch(u){case"value":f=j;break;case"defaultValue":x=j;break;case"multiple":a=j;default:Mt(e,t,u,j,n,null)}t=f,n=x,e.multiple=!!a,t!=null?$n(e,!!a,t,!1):n!=null&&$n(e,!!a,n,!0);return;case"textarea":it("invalid",e),f=u=a=null;for(x in n)if(n.hasOwnProperty(x)&&(j=n[x],j!=null))switch(x){case"value":a=j;break;case"defaultValue":u=j;break;case"children":f=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(91));break;default:Mt(e,t,x,j,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:Mt(e,t,R,a,n,null)}return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(a=0;a<bo.length;a++)it(bo[a],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in n)if(n.hasOwnProperty(K)&&(a=n[K],a!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Mt(e,t,K,a,n,null)}return;default:if(ze(t)){for(ae in n)n.hasOwnProperty(ae)&&(a=n[ae],a!==void 0&&uh(e,t,ae,a,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(a=n[j],a!=null&&Mt(e,t,j,a,n,null))}function H_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,x=null,j=null,R=null,K=null,ae=null;for(te in n){var oe=n[te];if(n.hasOwnProperty(te)&&oe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":R=oe;default:a.hasOwnProperty(te)||Mt(e,t,te,null,a,oe)}}for(var F in a){var te=a[F];if(oe=n[F],a.hasOwnProperty(F)&&(te!=null||oe!=null))switch(F){case"type":f=te;break;case"name":u=te;break;case"checked":K=te;break;case"defaultChecked":ae=te;break;case"value":x=te;break;case"defaultValue":j=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(c(137,t));break;default:te!==oe&&Mt(e,t,F,te,a,oe)}}sn(e,x,j,R,K,ae,f,u);return;case"select":te=x=j=F=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":te=R;default:a.hasOwnProperty(f)||Mt(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":j=f;break;case"multiple":x=f;default:f!==R&&Mt(e,t,u,f,a,R)}t=j,n=x,a=te,F!=null?$n(e,!!n,F,!1):!!a!=!!n&&(t!=null?$n(e,!!n,t,!0):$n(e,!!n,n?[]:"",!1));return;case"textarea":te=F=null;for(j in n)if(u=n[j],n.hasOwnProperty(j)&&u!=null&&!a.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Mt(e,t,j,null,a,u)}for(x in a)if(u=a[x],f=n[x],a.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":F=u;break;case"defaultValue":te=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Mt(e,t,x,u,a,f)}pe(e,F,te);return;case"option":for(var Re in n)if(F=n[Re],n.hasOwnProperty(Re)&&F!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Mt(e,t,Re,null,a,F)}for(R in a)if(F=a[R],te=n[R],a.hasOwnProperty(R)&&F!==te&&(F!=null||te!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Mt(e,t,R,F,a,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var qe in n)F=n[qe],n.hasOwnProperty(qe)&&F!=null&&!a.hasOwnProperty(qe)&&Mt(e,t,qe,null,a,F);for(K in a)if(F=a[K],te=n[K],a.hasOwnProperty(K)&&F!==te&&(F!=null||te!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(c(137,t));break;default:Mt(e,t,K,F,a,te)}return;default:if(ze(t)){for(var Rt in n)F=n[Rt],n.hasOwnProperty(Rt)&&F!==void 0&&!a.hasOwnProperty(Rt)&&uh(e,t,Rt,void 0,a,F);for(ae in a)F=a[ae],te=n[ae],!a.hasOwnProperty(ae)||F===te||F===void 0&&te===void 0||uh(e,t,ae,F,a,te);return}}for(var q in n)F=n[q],n.hasOwnProperty(q)&&F!=null&&!a.hasOwnProperty(q)&&Mt(e,t,q,null,a,F);for(oe in a)F=a[oe],te=n[oe],!a.hasOwnProperty(oe)||F===te||F==null&&te==null||Mt(e,t,oe,F,a,te)}function Yg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,x=u.initiatorType,j=u.duration;if(f&&j&&Yg(x)){for(x=0,j=u.responseEnd,a+=1;a<n.length;a++){var R=n[a],K=R.startTime;if(K>j)break;var ae=R.transferSize,oe=R.initiatorType;ae&&Yg(oe)&&(R=R.responseEnd,x+=ae*(R<j?1:(j-K)/(R-K)))}if(--a,t+=8*(f+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var fh=null,dh=null;function Zu(e){return e.nodeType===9?e:e.ownerDocument}function $g(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function hh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ph=null;function I_(){var e=window.event;return e&&e.type==="popstate"?e===ph?!1:(ph=e,!0):(ph=null,!1)}var Vg=typeof setTimeout=="function"?setTimeout:void 0,q_=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,G_=typeof queueMicrotask=="function"?queueMicrotask:typeof Qg<"u"?function(e){return Qg.resolve(null).then(e).catch(Y_)}:Vg;function Y_(e){setTimeout(function(){throw e})}function bi(e){return e==="head"}function Kg(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),Wr(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")yo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,yo(n);for(var f=n.firstChild;f;){var x=f.nextSibling,j=f.nodeName;f[wn]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=x}}else n==="body"&&yo(e.ownerDocument.body);n=u}while(n);Wr(t)}function Zg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function mh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":mh(n),Il(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function $_(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[wn])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=rs(e.nextSibling),e===null)break}return null}function X_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=rs(e.nextSibling),e===null))return null;return e}function Fg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=rs(e.nextSibling),e===null))return null;return e}function gh(e){return e.data==="$?"||e.data==="$~"}function bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function V_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function rs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var xh=null;function Jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return rs(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Wg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Pg(e,t,n){switch(t=Zu(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function yo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Il(e)}var cs=new Map,eb=new Set;function Fu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ma=ce.d;ce.d={f:Q_,r:K_,D:Z_,C:F_,L:J_,m:W_,X:e0,S:P_,M:t0};function Q_(){var e=Ma.f(),t=qu();return e||t}function K_(e){var t=ln(e);t!==null&&t.tag===5&&t.type==="form"?bm(t):Ma.r(e)}var Zr=typeof document>"u"?null:document;function tb(e,t,n){var a=Zr;if(a&&typeof t=="string"&&t){var u=Nn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),eb.has(u)||(eb.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),tl(t,"link",e),Fe(t),a.head.appendChild(t)))}}function Z_(e){Ma.D(e),tb("dns-prefetch",e,null)}function F_(e,t){Ma.C(e,t),tb("preconnect",e,t)}function J_(e,t,n){Ma.L(e,t,n);var a=Zr;if(a&&e&&t){var u='link[rel="preload"][as="'+Nn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Nn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Nn(n.imageSizes)+'"]')):u+='[href="'+Nn(e)+'"]';var f=u;switch(t){case"style":f=Fr(e);break;case"script":f=Jr(e)}cs.has(f)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),cs.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(_o(f))||t==="script"&&a.querySelector(vo(f))||(t=a.createElement("link"),tl(t,"link",e),Fe(t),a.head.appendChild(t)))}}function W_(e,t){Ma.m(e,t);var n=Zr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Nn(a)+'"][href="'+Nn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Jr(e)}if(!cs.has(f)&&(e=S({rel:"modulepreload",href:e},t),cs.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(vo(f)))return}a=n.createElement("link"),tl(a,"link",e),Fe(a),n.head.appendChild(a)}}}function P_(e,t,n){Ma.S(e,t,n);var a=Zr;if(a&&e){var u=on(a).hoistableStyles,f=Fr(e);t=t||"default";var x=u.get(f);if(!x){var j={loading:0,preload:null};if(x=a.querySelector(_o(f)))j.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=cs.get(f))&&yh(e,n);var R=x=a.createElement("link");Fe(R),tl(R,"link",e),R._p=new Promise(function(K,ae){R.onload=K,R.onerror=ae}),R.addEventListener("load",function(){j.loading|=1}),R.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ju(x,t,a)}x={type:"stylesheet",instance:x,count:1,state:j},u.set(f,x)}}}function e0(e,t){Ma.X(e,t);var n=Zr;if(n&&e){var a=on(n).hoistableScripts,u=Jr(e),f=a.get(u);f||(f=n.querySelector(vo(u)),f||(e=S({src:e,async:!0},t),(t=cs.get(u))&&_h(e,t),f=n.createElement("script"),Fe(f),tl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function t0(e,t){Ma.M(e,t);var n=Zr;if(n&&e){var a=on(n).hoistableScripts,u=Jr(e),f=a.get(u);f||(f=n.querySelector(vo(u)),f||(e=S({src:e,async:!0,type:"module"},t),(t=cs.get(u))&&_h(e,t),f=n.createElement("script"),Fe(f),tl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function nb(e,t,n,a){var u=(u=ve.current)?Fu(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Fr(n.href),n=on(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=Fr(n.href);var f=on(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(_o(e)))&&!f._p&&(x.instance=f,x.state.loading=5),cs.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},cs.set(e,n),f||n0(u,e,n,x.state))),t&&a===null)throw Error(c(528,""));return x}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jr(n),n=on(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 Fr(e){return'href="'+Nn(e)+'"'}function _o(e){return'link[rel="stylesheet"]['+e+"]"}function lb(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function n0(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),tl(t,"link",n),Fe(t),e.head.appendChild(t))}function Jr(e){return'[src="'+Nn(e)+'"]'}function vo(e){return"script[async]"+e}function sb(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Nn(n.href)+'"]');if(a)return t.instance=a,Fe(a),a;var u=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Fe(a),tl(a,"style",u),Ju(a,n.precedence,e),t.instance=a;case"stylesheet":u=Fr(n.href);var f=e.querySelector(_o(u));if(f)return t.state.loading|=4,t.instance=f,Fe(f),f;a=lb(n),(u=cs.get(u))&&yh(a,u),f=(e.ownerDocument||e).createElement("link"),Fe(f);var x=f;return x._p=new Promise(function(j,R){x.onload=j,x.onerror=R}),tl(f,"link",a),t.state.loading|=4,Ju(f,n.precedence,e),t.instance=f;case"script":return f=Jr(n.src),(u=e.querySelector(vo(f)))?(t.instance=u,Fe(u),u):(a=n,(u=cs.get(f))&&(a=S({},n),_h(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Fe(u),tl(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ju(a,n.precedence,e));return t.instance}function Ju(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,x=0;x<a.length;x++){var j=a[x];if(j.dataset.precedence===t)f=j;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function yh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wu=null;function ab(e,t,n){if(Wu===null){var a=new Map,u=Wu=new Map;u.set(n,a)}else u=Wu,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[wn]||f[Qt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var j=a.get(x);j?j.push(f):a.set(x,[f])}}return a}function ib(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function l0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function s0(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=Fr(a.href),f=t.querySelector(_o(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Fe(f);return}f=t.ownerDocument||t,a=lb(a),(u=cs.get(u))&&yh(a,u),f=f.createElement("link"),Fe(f);var x=f;x._p=new Promise(function(j,R){x.onload=j,x.onerror=R}),tl(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Pu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var vh=0;function a0(e,t){return e.stylesheets&&e.count===0&&tf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&tf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&vh===0&&(vh=62500*B_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>vh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ef=null;function tf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ef=new Map,t.forEach(i0,e),ef=null,Pu.call(e))}function i0(e,t){if(!(t.state.loading&4)){var n=ef.get(e);if(n)var a=n.get(null);else{n=new Map,ef.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(n.set(x.dataset.precedence,x),a=x)}a&&n.set(null,a)}u=t.instance,x=u.getAttribute("data-precedence"),f=n.get(x)||a,f===a&&n.set(null,u),n.set(x,u),this.count++,a=Pu.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var jo={$$typeof:G,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function r0(e,t,n,a,u,f,x,j,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=dl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dl(0),this.hiddenUpdates=dl(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function cb(e,t,n,a,u,f,x,j,R,K,ae,oe){return e=new r0(e,t,n,x,R,K,ae,oe,j),t=1,f===!0&&(t|=24),f=xl(3,null,null,t),e.current=f,f.stateNode=e,t=Fc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},sd(f),e}function ob(e){return e?(e=Za,e):Za}function ub(e,t,n,a,u,f){u=ob(u),a.context===null?a.context=u:a.pendingContext=u,a=ii(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=ri(e,a,t),n!==null&&(Ul(n,e,t),Pc(n,e,t))}function fb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jh(e,t){fb(e,t),(e=e.alternate)&&fb(e,t)}function db(e){if(e.tag===13||e.tag===31){var t=Is(e,67108864);t!==null&&Ul(t,e,67108864),jh(e,67108864)}}function hb(e){if(e.tag===13||e.tag===31){var t=Ql();t=pl(t);var n=Is(e,t);n!==null&&Ul(n,e,t),jh(e,t)}}var nf=!0;function c0(e,t,n,a){var u=A.T;A.T=null;var f=ce.p;try{ce.p=2,Sh(e,t,n,a)}finally{ce.p=f,A.T=u}}function o0(e,t,n,a){var u=A.T;A.T=null;var f=ce.p;try{ce.p=8,Sh(e,t,n,a)}finally{ce.p=f,A.T=u}}function Sh(e,t,n,a){if(nf){var u=wh(a);if(u===null)oh(e,t,a,lf,n),mb(e,a);else if(f0(u,e,t,n,a))a.stopPropagation();else if(mb(e,a),t&4&&-1<u0.indexOf(e)){for(;u!==null;){var f=ln(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=_e(f.pendingLanes);if(x!==0){var j=f;for(j.pendingLanes|=2,j.entangledLanes|=2;x;){var R=1<<31-Pe(x);j.entanglements[1]|=R,x&=~R}Vs(f),(_t&6)===0&&(Bu=nt()+500,go(0))}}break;case 31:case 13:j=Is(f,2),j!==null&&Ul(j,f,2),qu(),jh(f,2)}if(f=wh(a),f===null&&oh(e,t,a,lf,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else oh(e,t,a,null,n)}}function wh(e){return e=ht(e),kh(e)}var lf=null;function kh(e){if(lf=null,e=rl(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return lf=e,null}function pb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(St()){case Xt:return 2;case cn:return 8;case wt:case yn:return 32;case qt:return 268435456;default:return 32}default:return 32}}var Nh=!1,xi=null,yi=null,_i=null,So=new Map,wo=new Map,vi=[],u0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function mb(e,t){switch(e){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":yi=null;break;case"mouseover":case"mouseout":_i=null;break;case"pointerover":case"pointerout":So.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wo.delete(t.pointerId)}}function ko(e,t,n,a,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:f,targetContainers:[u]},t!==null&&(t=ln(t),t!==null&&db(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function f0(e,t,n,a,u){switch(t){case"focusin":return xi=ko(xi,e,t,n,a,u),!0;case"dragenter":return yi=ko(yi,e,t,n,a,u),!0;case"mouseover":return _i=ko(_i,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return So.set(f,ko(So.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,wo.set(f,ko(wo.get(f)||null,e,t,n,a,u)),!0}return!1}function gb(e){var t=rl(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,kl(e.priority,function(){hb(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,kl(e.priority,function(){hb(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Je=a,n.target.dispatchEvent(a),Je=null}else return t=ln(n),t!==null&&db(t),e.blockedOn=n,!1;t.shift()}return!0}function bb(e,t,n){sf(e)&&n.delete(t)}function d0(){Nh=!1,xi!==null&&sf(xi)&&(xi=null),yi!==null&&sf(yi)&&(yi=null),_i!==null&&sf(_i)&&(_i=null),So.forEach(bb),wo.forEach(bb)}function af(e,t){e.blockedOn===t&&(e.blockedOn=null,Nh||(Nh=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,d0)))}var rf=null;function xb(e){rf!==e&&(rf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){rf===e&&(rf=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(kh(a||n)===null)continue;break}var f=ln(n);f!==null&&(e.splice(t,3),t-=3,wd(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function Wr(e){function t(R){return af(R,e)}xi!==null&&af(xi,e),yi!==null&&af(yi,e),_i!==null&&af(_i,e),So.forEach(t),wo.forEach(t);for(var n=0;n<vi.length;n++){var a=vi[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<vi.length&&(n=vi[0],n.blockedOn===null);)gb(n),n.blockedOn===null&&vi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],x=u[Oe]||null;if(typeof f=="function")x||xb(n);else if(x){var j=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[Oe]||null)j=x.formAction;else if(kh(u)!==null)continue}else j=x.action;typeof j=="function"?n[a+1]=j:(n.splice(a,3),a-=3),xb(n)}}}function yb(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Th(e){this._internalRoot=e}cf.prototype.render=Th.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=Ql();ub(n,a,e,t,null,null)},cf.prototype.unmount=Th.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ub(e.current,2,null,e,null,null),qu(),t[Ct]=null}};function cf(e){this._internalRoot=e}cf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<vi.length&&t!==0&&t<vi[n].priority;n++);vi.splice(n,0,e),n===0&&gb(e)}};var _b=s.version;if(_b!=="19.2.8")throw Error(c(527,_b,"19.2.8"));ce.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=b(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var h0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!of.isDisabled&&of.supportsFiber)try{Gt=of.inject(h0),ct=of}catch{}}return To.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Tm,f=Em,x=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=cb(e,1,!1,null,null,n,a,null,u,f,x,yb),e[Ct]=t.current,ch(e),new Th(t)},To.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Tm,x=Em,j=Cm,R=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=cb(e,1,!0,t,n??null,a,u,R,f,x,j,yb),t.context=ob(null),n=t.current,a=Ql(),a=pl(a),u=ii(a),u.callback=null,ri(n,u,a),n=a,t.current.lanes=n,sl(t,n),Vs(t),e[Ct]=t.current,ch(e),new cf(t)},To.version="19.2.8",To}var Mb;function k0(){if(Mb)return Mh.exports;Mb=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Mh.exports=w0(),Mh.exports}var N0=k0();const ty=1;var Oa,dc,hc,pc,mc,Yo,gc,Yf,ny;class T0{constructor(s){fn(this,Yf);fn(this,Oa,null);fn(this,dc,new Set);fn(this,hc,500);fn(this,pc,null);fn(this,mc,!1);fn(this,Yo,null);fn(this,gc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){vt(this,gc,s)}connect(){if(Ye(this,mc))return;const s=new WebSocket(this.url);vt(this,Oa,s),s.addEventListener("open",()=>{var r,c;vt(this,hc,500),this.send({type:"hello",protocol:ty,clientName:"ccv-web"}),(r=Ye(this,Yo))==null||r.call(this),(c=Ye(this,gc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ye(this,dc))o(c)}),s.addEventListener("close",()=>{var r;vt(this,Oa,null),(r=Ye(this,gc))==null||r.call(this),Mn(this,Yf,ny).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){vt(this,Yo,s)}on(s){return Ye(this,dc).add(s),()=>Ye(this,dc).delete(s)}send(s){var r;((r=Ye(this,Oa))==null?void 0:r.readyState)===WebSocket.OPEN&&Ye(this,Oa).send(JSON.stringify(s))}get connected(){var s;return((s=Ye(this,Oa))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;vt(this,mc,!0),(s=Ye(this,Oa))==null||s.close()}}Oa=new WeakMap,dc=new WeakMap,hc=new WeakMap,pc=new WeakMap,mc=new WeakMap,Yo=new WeakMap,gc=new WeakMap,Yf=new WeakSet,ny=function(){if(Ye(this,mc)||Ye(this,pc)!==null)return;const s=Ye(this,hc);vt(this,hc,Math.min(s*2,1e4)),vt(this,pc,window.setTimeout(()=>{vt(this,pc,null),this.connect()},s))};const E0=1,ly="ccv:relay",Af="ccv:relay.host";function C0(){try{const l=localStorage.getItem(ly);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function sy(){localStorage.removeItem(ly)}var ea,bc,ta,xc,yc,Ai,ar,ir,Mi,rr,_c,cr,or,Wt,ki,tp,ay,nr,np;class A0{constructor(s){fn(this,Wt);fn(this,ea,null);fn(this,bc,new Set);fn(this,ta,null);fn(this,xc,null);fn(this,yc,500);fn(this,Ai,null);fn(this,ar,!1);fn(this,ir,!1);fn(this,Mi,!1);fn(this,rr,null);fn(this,_c,"Подключаемся…");fn(this,cr,0);fn(this,or,[]);this.session=s}get connected(){return Ye(this,ir)&&Ye(this,Mi)}get statusText(){return Ye(this,_c)}get hostId(){return Ye(this,rr)}on(s){return Ye(this,bc).add(s),()=>Ye(this,bc).delete(s)}onReconnect(s){vt(this,xc,s)}onStatus(s){vt(this,ta,s)}connect(){Ye(this,ar)||Mn(this,Wt,tp).call(this)}send(s){if(!Ye(this,ir)){Ye(this,or).length<64&&Ye(this,or).push(s);return}Mn(this,Wt,nr).call(this,{t:"client.frame",body:s})}close(){var s;vt(this,ar,!0),Ye(this,Ai)!==null&&window.clearTimeout(Ye(this,Ai)),(s=Ye(this,ea))==null||s.close()}}ea=new WeakMap,bc=new WeakMap,ta=new WeakMap,xc=new WeakMap,yc=new WeakMap,Ai=new WeakMap,ar=new WeakMap,ir=new WeakMap,Mi=new WeakMap,rr=new WeakMap,_c=new WeakMap,cr=new WeakMap,or=new WeakMap,Wt=new WeakSet,ki=function(s){var r;Ye(this,_c)!==s&&(vt(this,_c,s),(r=Ye(this,ta))==null||r.call(this))},tp=async function(){if(Ye(this,ea))return;if(!Ye(this,rr))try{vt(this,rr,await M0(this.session.token))}catch(c){Mn(this,Wt,ki).call(this,c instanceof Error?c.message:String(c)),Mn(this,Wt,np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);vt(this,ea,r),r.addEventListener("open",()=>{Mn(this,Wt,nr).call(this,{t:"client.hello",protocol:E0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Mn(this,Wt,ay).call(this,o)}),r.addEventListener("close",()=>{var c;vt(this,ea,null),vt(this,ir,!1),vt(this,Mi,!1),Mn(this,Wt,ki).call(this,"Нет связи с сервером"),(c=Ye(this,ta))==null||c.call(this),Mn(this,Wt,np).call(this)}),r.addEventListener("error",()=>r.close())},ay=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":vt(this,yc,500),Mn(this,Wt,nr).call(this,{t:"client.attach",hostId:Ye(this,rr)??"",...Ye(this,cr)>0?{sinceRseq:Ye(this,cr)}:{}});return;case"client.attached":vt(this,ir,!0),vt(this,Mi,s.online),vt(this,cr,s.rseq),Mn(this,Wt,ki).call(this,s.online?"Хост на связи":"Компьютер не на связи"),Mn(this,Wt,nr).call(this,{t:"client.frame",body:{type:"hello",protocol:ty,clientName:"ccv-web-relay"}});const b=Ye(this,or);vt(this,or,[]);for(const _ of b)Mn(this,Wt,nr).call(this,{t:"client.frame",body:_});(r=Ye(this,xc))==null||r.call(this),(c=Ye(this,ta))==null||c.call(this);return;case"host.frame":{s.rseq>0&&vt(this,cr,s.rseq);const _=s.body;for(const S of Ye(this,bc))S(_);return}case"host.online":vt(this,Mi,!0),Mn(this,Wt,ki).call(this,"Хост на связи"),(o=Ye(this,xc))==null||o.call(this),(d=Ye(this,ta))==null||d.call(this);return;case"host.offline":vt(this,Mi,!1),Mn(this,Wt,ki).call(this,"Компьютер не на связи"),(h=Ye(this,ta))==null||h.call(this);return;case"ping":Mn(this,Wt,nr).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){sy(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Af),Mn(this,Wt,ki).call(this,"Этот компьютер отвязан от аккаунта"),vt(this,ar,!0),(m=Ye(this,ea))==null||m.close();return}s.code!=="offline"&&Mn(this,Wt,ki).call(this,s.message),(g=Ye(this,ta))==null||g.call(this);return}},nr=function(s){var r;((r=Ye(this,ea))==null?void 0:r.readyState)===WebSocket.OPEN&&Ye(this,ea).send(JSON.stringify(s))},np=function(){if(Ye(this,ar)||Ye(this,Ai)!==null)return;const s=Ye(this,yc);vt(this,yc,Math.min(s*2,1e4)),vt(this,Ai,window.setTimeout(()=>{vt(this,Ai,null),Mn(this,Wt,tp).call(this)},s))};async function M0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Af,s),s;const r=localStorage.getItem(Af);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw sy(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Af,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Mf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const R0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function D0(){if(Mf()==="local")return new T0(R0);const l=C0();return l?new A0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const iy="ccv:drafts",O0=40,L0=2e4,z0=500;let Ho=null,Bo=null;function bp(){if(Ho)return Ho;const l=new Map;try{const s=localStorage.getItem(iy);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return Ho=l,window.addEventListener("pagehide",oy),l}function Lh(l){return bp().get(l)??""}function ry(l,s){const r=bp(),c=s.slice(0,L0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>O0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}B0(),H0()}function cy(){const l=new Set;for(const s of bp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const lp=new Set;let Rb="";function U0(l){return lp.add(l),()=>lp.delete(l)}function H0(){const l=cy(),s=l.join(`
|
|
51
|
-
`);if(s!==Rb){Rb=s;for(const r of lp)r(l)}}function B0(){Bo===null&&(Bo=window.setTimeout(oy,z0))}function oy(){if(Bo!==null&&window.clearTimeout(Bo),Bo=null,!!Ho)try{localStorage.setItem(iy,JSON.stringify(Object.fromEntries(Ho)))}catch{}}const vl={items:[],pending:[],lastSeq:0,contextTokens:null},zh={entries:[],total:0,loading:!1};function uy(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Db(l){return l.total>0&&uy(l)>1}function I0(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:s.total,loading:!1}}function q0(l){return Rf(vl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Rf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...G0(r,c.event,c.seq),lastSeq:c.seq});return r}function G0(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return Qs(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Qs(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return Pr(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?Qs(l,m):Pr(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Qs(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return Pr(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?Qs(l,m):Pr(l,h,m)}case"tool.use":return Qs(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return Pr(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(g!==-1){const b=c[g];return Pr({...l,pending:m},g,{...b,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:Qs({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return Qs({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=s.usage)==null?void 0:d.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:Qs(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Qs(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Y0(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function $0(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let d=0;d<l.length;d++)if(l[d].kind==="user"){if(o===c)return l.slice(0,d);o++}return l}function Qs(l,s){return{...l,items:[...l.items,s]}}function Pr(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const sp="ccv:theme",Uh=["system","light","dark"];function X0(){const[l,s]=y.useState(V0);y.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=y.useCallback(o=>{try{localStorage.setItem(sp,o)}catch{}s(o)},[]),c=y.useCallback(()=>{s(o=>{const d=Uh[(Uh.indexOf(o)+1)%Uh.length];try{localStorage.setItem(sp,d)}catch{}return d})},[]);return[l,r,c]}function V0(){try{const l=localStorage.getItem(sp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const fy=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Q0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],ur={sidebar:{side:"left",min:200,max:520,width:276,label:"сессий"},files:{side:"left",min:180,max:560,width:260,label:"файлов"},search:{side:"left",min:220,max:640,width:320,label:"поиска"},git:{side:"left",min:220,max:640,width:320,label:"истории"},ask:{side:"right",min:260,max:720,width:380,label:"вопроса"}},K0=320,dy="ccv:panes";function Z0(l){return`--${l}-w`}function hy(l,s){const r=ur[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function F0(){const l={};for(const s of Object.keys(ur))l[s]=ur[s].width;try{const s=localStorage.getItem(dy);if(s){const r=JSON.parse(s);for(const c of Object.keys(ur)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=hy(c,o))}}}catch{}return l}function J0(){const[l,s]=y.useState(F0),r=y.useCallback(h=>{try{localStorage.setItem(dy,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,m)=>{s(g=>{const b=hy(h,m);if(g[h]===b)return g;const _={...g,[h]:b};return r(_),_})},[r]),o=y.useCallback(h=>{s(m=>{const g={...m,[h]:ur[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(ur))d[Z0(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Hh=260,py=120,W0=200,Ob="ccv:terminal-h";function Lb(l,s){return Math.round(Math.min(s,Math.max(py,l)))}function P0(){const[l,s]=y.useState(()=>{try{const d=localStorage.getItem(Ob);if(d){const h=Number(d);if(Number.isFinite(h))return Lb(h,1/0)}}catch{}return Hh}),r=y.useCallback(d=>{try{localStorage.setItem(Ob,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const m=Lb(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=y.useCallback(()=>{s(Hh),r(Hh)},[r]);return{height:l,setHeight:c,reset:o}}function $f(l){const[s,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return y.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const ev=500,tv=6;function my({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=ev,moveCancelPx:o=tv}){const d=y.useRef(null),[h,m]=y.useState(!1),g=y.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=y.useCallback(C=>{if(r||C.button!==0)return;const L={timer:0,x:C.clientX,y:C.clientY,fired:!1};L.timer=window.setTimeout(()=>{L.fired=!0,m(!1),l()},c),d.current=L,m(!0)},[r,c,l]),_=y.useCallback(C=>{const L=d.current;!L||L.fired||Math.hypot(C.clientX-L.x,C.clientY-L.y)>o&&g()},[o,g]),S=y.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=y.useCallback(C=>{var L;if((L=d.current)!=null&&L.fired){d.current=null,C.preventDefault();return}if(!r){if(C.shiftKey){l();return}s()}},[r,s,l]),E=y.useCallback(C=>{C.preventDefault()},[]),T=y.useCallback(C=>{r||C.shiftKey&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:_,onPointerUp:S,onPointerCancel:S,onPointerLeave:S,onClick:v,onContextMenu:E,onKeyDown:T}}}const nv={height:0,offsetTop:0,offsetLeft:0};function zb(){if(typeof window>"u")return nv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function lv(l){const[s,r]=y.useState(zb);return y.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=zb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[l]),s}function xp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pr=xp();function gy(l){pr=l}var lr={exec:()=>null};function ec(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function mt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(ol.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var sv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),ol={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ec(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ec(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ec(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:ec(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:ec(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ec(l=>new RegExp(`^ {0,${l}}>`))},av=/^(?:[ \t]*(?:\n|$))+/,iv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,by=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xy=mt(by).replace(/bull/g,yp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ov=mt(by).replace(/bull/g,yp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_p=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,uv=/^[^\n]+/,vp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fv=mt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dv=mt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,yp).getRegex(),Xf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",jp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,hv=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",jp).replace("tag",Xf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yy=l=>mt(_p).replace("hr",$o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex(),pv=yy(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),mv=yy(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),gv=mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mv).getRegex(),Sp={blockquote:gv,code:iv,def:fv,fences:rv,heading:cv,hr:$o,html:hv,lheading:xy,list:dv,newline:av,paragraph:pv,table:lr,text:uv},Ub=mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex(),bv={...Sp,lheading:ov,table:Ub,paragraph:mt(_p).replace("hr",$o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ub).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex()},xv={...Sp,html:mt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:lr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mt(_p).replace("hr",$o).replace("heading",` *#{1,6} *[^
|
|
52
|
-
]`).replace("lheading",xy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},yv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_v=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_y=/^( {2,}|\\)\n(?!\s*$)/,vv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,jc=/[\p{P}\p{S}]/u,Vf=/[\s\p{P}\p{S}]/u,wp=/[^\s\p{P}\p{S}]/u,jv=mt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vf).getRegex(),vy=/(?!~)[\p{P}\p{S}]/u,Sv=/(?!~)[\s\p{P}\p{S}]/u,wv=/(?:[^\s\p{P}\p{S}]|~)/u,kv=mt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Nv=mt(jy,"u").replace(/punct/g,jc).getRegex(),Tv=mt(jy,"u").replace(/punct/g,vy).getRegex(),Sy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ev=mt(Sy,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,jc).getRegex(),Cv=mt(Sy,"gu").replace(/notPunctSpace/g,wv).replace(/punctSpace/g,Sv).replace(/punct/g,vy).getRegex(),Av=mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,jc).getRegex(),Mv=mt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,jc).getRegex(),Rv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Dv=mt(Rv,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,jc).getRegex(),Ov=mt(/\\(punct)/,"gu").replace(/punct/g,jc).getRegex(),Lv=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(),zv=mt(jp).replace("(?:-->|$)","-->").getRegex(),Uv=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",zv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Hv=mt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Lf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wy=mt(/^!?\[(label)\]\[(ref)\]/).replace("label",Lf).replace("ref",vp).getRegex(),ky=mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",vp).getRegex(),Bv=mt("reflink|nolink(?!\\()","g").replace("reflink",wy).replace("nolink",ky).getRegex(),Hb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kp={_backpedal:lr,anyPunctuation:Ov,autolink:Lv,blockSkip:kv,br:_y,code:_v,del:lr,delLDelim:lr,delRDelim:lr,emStrongLDelim:Nv,emStrongRDelimAst:Ev,emStrongRDelimUnd:Av,escape:yv,link:Hv,nolink:ky,punctuation:jv,reflink:wy,reflinkSearch:Bv,tag:Uv,text:vv,url:lr},Iv={...kp,link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",Lf).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lf).getRegex()},ap={...kp,emStrongRDelimAst:Cv,emStrongLDelim:Tv,delLDelim:Mv,delRDelim:Dv,url:mt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hb).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:mt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Hb).getRegex()},qv={...ap,br:mt(_y).replace("{2,}","*").getRegex(),text:mt(ap.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uf={normal:Sp,gfm:bv,pedantic:xv},Eo={normal:kp,gfm:ap,breaks:qv,pedantic:Iv},Gv={"&":"&","<":"<",">":">",'"':""","'":"'"},Bb=l=>Gv[l];function Js(l,s){if(s){if(ol.escapeTest.test(l))return l.replace(ol.escapeReplace,Bb)}else if(ol.escapeTestNoEncode.test(l))return l.replace(ol.escapeReplaceNoEncode,Bb);return l}function Ib(l){try{l=encodeURI(l).replace(ol.percentDecode,"%")}catch{return null}return l}function qb(l,s){var d;let r=l.replace(ol.findPipe,(h,m,g)=>{let b=!1,_=m;for(;--_>=0&&g[_]==="\\";)b=!b;return b?"|":" |"}),c=r.split(ol.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(ol.slashPipe,"|");return c}function Si(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function Gb(l){let s=l.split(`
|
|
53
|
-
`),r=s.length-1;for(;r>=0&&ol.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
|
|
54
|
-
`)}function Yv(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function $v(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Yb(l,s,r,c,o){let d=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Xv(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
|
|
55
|
-
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
|
|
56
|
-
`)}var zf=class{constructor(l){Dt(this,"options");Dt(this,"rules");Dt(this,"lexer");this.options=l||pr}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:Gb(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=Xv(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Si(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Si(s[0],`
|
|
57
|
-
`),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:Si(s[0],`
|
|
58
|
-
`)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Si(s[0],`
|
|
59
|
-
`).split(`
|
|
60
|
-
`),c="",o="",d=[];for(;r.length>0;){let h=!1,m=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))m.push(r[g]),h=!0;else if(!h)m.push(r[g]);else break;r=r.slice(g);let b=m.join(`
|
|
61
|
-
`),_=b.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
-
${b}`:b,o=o?`${o}
|
|
64
|
-
${_}`:_;let S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,d,!0),this.lexer.state.top=S,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let E=v,T=E.raw+`
|
|
65
|
-
`+r.join(`
|
|
66
|
-
`),C=this.blockquote(T);d[d.length-1]=C,c=c.substring(0,c.length-E.raw.length)+C.raw,o=o.substring(0,o.length-E.text.length)+C.text;break}else if((v==null?void 0:v.type)==="list"){let E=v,T=E.raw+`
|
|
67
|
-
`+r.join(`
|
|
68
|
-
`),C=this.list(T);d[d.length-1]=C,c=c.substring(0,c.length-v.raw.length)+C.raw,o=o.substring(0,o.length-E.raw.length)+C.raw,r=T.substring(d.at(-1).raw.length).split(`
|
|
69
|
-
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;l;){let g=!1,b="",_="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;b=s[0],l=l.substring(b.length);let S=$v(s[2].split(`
|
|
70
|
-
`,1)[0],s[1].length),v=l.split(`
|
|
71
|
-
`,1)[0],E=!S.trim(),T=0;if(this.options.pedantic?(T=2,_=S.trimStart()):E?T=s[1].length+1:(T=S.search(this.rules.other.nonSpaceChar),T=T>4?1:T,_=S.slice(T),T+=s[1].length),E&&this.rules.other.blankLine.test(v)&&(b+=v+`
|
|
72
|
-
`,l=l.substring(v.length+1),g=!0),!g){let C=this.rules.other.nextBulletRegex(T),L=this.rules.other.hrRegex(T),$=this.rules.other.fencesBeginRegex(T),J=this.rules.other.headingBeginRegex(T),G=this.rules.other.htmlBeginRegex(T),O=this.rules.other.blockquoteBeginRegex(T);for(;l;){let Z=l.split(`
|
|
73
|
-
`,1)[0],M;if(v=Z,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),$.test(v)||J.test(v)||G.test(v)||O.test(v)||C.test(v)||L.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=T||!v.trim())_+=`
|
|
74
|
-
`+M.slice(T);else{if(E||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(S)||J.test(S)||L.test(S))break;_+=`
|
|
75
|
-
`+v}E=!v.trim(),b+=Z+`
|
|
76
|
-
`,l=l.substring(Z.length+1),S=M.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=b}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let S=this.lexer.inlineQueue.length-1;S>=0;S--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[S].src)){this.lexer.inlineQueue[S].src=this.lexer.inlineQueue[S].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(g.raw);if(_){let S={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};g.checked=S.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=S.raw+g.tokens[0].raw,g.tokens[0].text=S.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(S)):g.tokens.unshift({type:"paragraph",raw:S.raw,text:S.raw,tokens:[S]}):g.tokens.unshift(S)}}else g.task&&(g.task=!1);if(!o.loose){let _=g.tokens.filter(v=>v.type==="space"),S=_.length>0&&_.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=S}}if(o.loose)for(let g of o.items){g.loose=!0;for(let b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=Gb(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Si(s[0],`
|
|
77
|
-
`),href:c,title:o}}}table(l){var h;let s=this.rules.block.table.exec(l);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let r=qb(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
-
`):[],d={type:"table",raw:Si(s[0],`
|
|
79
|
-
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(qb(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Si(s[0],`
|
|
80
|
-
`),depth:s[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(l){let s=this.rules.block.paragraph.exec(l);if(s){let r=s[1].charAt(s[1].length-1)===`
|
|
81
|
-
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Si(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Yv(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Yb(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Yb(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,b=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,s=s.slice(-1*l.length+o);(c=b.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let _=[...c[0]][0].length,S=l.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let E=S.slice(1,-1);return{type:"em",raw:S,text:E,tokens:this.lexer.inlineTokens(E)}}let v=S.slice(2,-2);return{type:"strong",raw:S,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,s=s.slice(-1*l.length+o);(c=g.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let b=[...c[0]][0].length,_=l.slice(0,o+c.index+b+h),S=_.slice(o,-o);return{type:"del",raw:_,text:S,tokens:this.lexer.inlineTokens(S)}}}}autolink(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let d;do d=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(d!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Ts=class ip{constructor(s){Dt(this,"tokens");Dt(this,"options");Dt(this,"state");Dt(this,"inlineQueue");Dt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||pr,this.options.tokenizer=this.options.tokenizer||new zf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ol,block:uf.normal,inline:Eo.normal};this.options.pedantic?(r.block=uf.pedantic,r.inline=Eo.pedantic):this.options.gfm&&(r.block=uf.gfm,this.options.breaks?r.inline=Eo.breaks:r.inline=Eo.gfm),this.tokenizer.rules=r}static get rules(){return{block:uf,inline:Eo}}static lex(s,r){return new ip(r).lex(s)}static lexInline(s,r){return new ip(r).inlineTokens(s)}lex(s){s=s.replace(ol.carriageReturn,`
|
|
82
|
-
`),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(ol.tabCharGlobal," ").replace(ol.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(_=>(g=_.call({lexer:this},s,r))?(s=s.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.substring(g.raw.length);let _=r.at(-1);g.raw.length===1&&_!==void 0?_.raw+=`
|
|
83
|
-
`:r.push(g);continue}if(g=this.tokenizer.code(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
84
|
-
`)?"":`
|
|
85
|
-
`)+g.raw,_.text+=`
|
|
86
|
-
`+g.text,this.inlineQueue.at(-1).src=_.text):r.push(g);continue}if(g=this.tokenizer.fences(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
87
|
-
`)?"":`
|
|
88
|
-
`)+g.raw,_.text+=`
|
|
89
|
-
`+g.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},r.push(g));continue}if(g=this.tokenizer.table(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),r.push(g);continue}let b=s;if((m=this.options.extensions)!=null&&m.startBlock){let _=1/0,S=s.slice(1),v;this.options.extensions.startBlock.forEach(E=>{v=E.call({lexer:this},S),typeof v=="number"&&v>=0&&(_=Math.min(_,v))}),_<1/0&&_>=0&&(b=s.substring(0,_+1))}if(this.state.top&&(g=this.tokenizer.paragraph(b))){let _=r.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
|
|
90
|
-
`)?"":`
|
|
91
|
-
`)+g.raw,_.text+=`
|
|
92
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(g),c=b.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
93
|
-
`)?"":`
|
|
94
|
-
`)+g.raw,_.text+=`
|
|
95
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(g);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,b,_,S;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,E=>v.includes(E.slice(E.lastIndexOf("[")+1,-1))?"["+"a".repeat(E.length-2)+"]":E))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,E,T)=>{let C=T?T.length:0;return v.slice(0,C)+"["+"a".repeat(v.length-C-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((_=(b=this.options.extensions)==null?void 0:b.inline)!=null&&_.some(T=>(v=T.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let T=r.at(-1);v.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let E=s;if((S=this.options.extensions)!=null&&S.startInline){let T=1/0,C=s.slice(1),L;this.options.extensions.startInline.forEach($=>{L=$.call({lexer:this},C),typeof L=="number"&&L>=0&&(T=Math.min(T,L))}),T<1/0&&T>=0&&(E=s.substring(0,T+1))}if(v=this.tokenizer.inlineText(E)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let T=r.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},Uf=class{constructor(l){Dt(this,"options");Dt(this,"parser");this.options=l||pr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(ol.notSpaceStart))==null?void 0:d[0],o=l.replace(ol.endingNewline,"")+`
|
|
96
|
-
`;return c?'<pre><code class="language-'+Js(c)+'">'+(r?o:Js(o,!0))+`</code></pre>
|
|
97
|
-
`:"<pre><code>"+(r?o:Js(o,!0))+`</code></pre>
|
|
98
|
-
`}blockquote({tokens:l}){return`<blockquote>
|
|
99
|
-
${this.parser.parse(l)}</blockquote>
|
|
100
|
-
`}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:s}){return`<h${s}>${this.parser.parseInline(l)}</h${s}>
|
|
101
|
-
`}hr(l){return`<hr>
|
|
102
|
-
`}list(l){let s=l.ordered,r=l.start,c="";for(let h=0;h<l.items.length;h++){let m=l.items[h];c+=this.listitem(m)}let o=s?"ol":"ul",d=s&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
103
|
-
`+c+"</"+o+`>
|
|
104
|
-
`}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
|
|
105
|
-
`}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
|
|
106
|
-
`}table(l){let s="",r="";for(let o=0;o<l.header.length;o++)r+=this.tablecell(l.header[o]);s+=this.tablerow({text:r});let c="";for(let o=0;o<l.rows.length;o++){let d=l.rows[o];r="";for(let h=0;h<d.length;h++)r+=this.tablecell(d[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
-
<thead>
|
|
108
|
-
`+s+`</thead>
|
|
109
|
-
`+c+`</table>
|
|
110
|
-
`}tablerow({text:l}){return`<tr>
|
|
111
|
-
${l}</tr>
|
|
112
|
-
`}tablecell(l){let s=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+s+`</${r}>
|
|
113
|
-
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Js(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=Ib(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+Js(s)+'"'),d+=">"+c+"</a>",d}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Ib(l);if(o===null)return Js(r);l=o;let d=`<img src="${l}" alt="${Js(r)}"`;return s&&(d+=` title="${Js(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Js(l.text)}},Np=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Es=class rp{constructor(s){Dt(this,"options");Dt(this,"renderer");Dt(this,"textRenderer");this.options=s||pr,this.options.renderer=this.options.renderer||new Uf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Np}static parse(s,r){return new rp(r).parse(s)}static parseInline(s,r){return new rp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=b||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(s,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=b||"";continue}}let g=m;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let b='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return c}},Cf,zo=(Cf=class{constructor(l){Dt(this,"options");Dt(this,"block");this.options=l||pr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Ts.lex:Ts.lexInline}provideParser(l=this.block){return l?Es.parse:Es.parseInline}},Dt(Cf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Dt(Cf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Cf),Vv=class{constructor(...l){Dt(this,"defaults",xp());Dt(this,"options",this.setOptions);Dt(this,"parse",this.parseMarkdown(!0));Dt(this,"parseInline",this.parseMarkdown(!1));Dt(this,"Parser",Es);Dt(this,"Renderer",Uf);Dt(this,"TextRenderer",Np);Dt(this,"Lexer",Ts);Dt(this,"Tokenizer",zf);Dt(this,"Hooks",zo);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let d of l)switch(r=r.concat(s.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,s));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=s.renderers[o.name];d?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=s[o.level];d?d.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new Uf(this.defaults);for(let d in r.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=r.renderer[h],g=o[h];o[h]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new zf(this.defaults);for(let d in r.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=r.tokenizer[h],g=o[h];o[h]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new zo;for(let d in r.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=r.hooks[h],g=o[h];zo.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&zo.passThroughHooksRespectAsync.has(d))return(async()=>{let S=await m.call(o,b);return g.call(o,S)})();let _=m.call(o,b);return g.call(o,_)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let S=await m.apply(o,b);return S===!1&&(S=await g.apply(o,b)),S})();let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return Ts.lex(l,s??this.defaults)}parser(l,s){return Es.parse(l,s??this.defaults)}parseMarkdown(l){return(s,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(l,s){return r=>{if(r.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+Js(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},hr=new Vv;function jt(l,s){return hr.parse(l,s)}jt.options=jt.setOptions=function(l){return hr.setOptions(l),jt.defaults=hr.defaults,gy(jt.defaults),jt};jt.getDefaults=xp;jt.defaults=pr;jt.use=function(...l){return hr.use(...l),jt.defaults=hr.defaults,gy(jt.defaults),jt};jt.walkTokens=function(l,s){return hr.walkTokens(l,s)};jt.parseInline=hr.parseInline;jt.Parser=Es;jt.parser=Es.parse;jt.Renderer=Uf;jt.TextRenderer=Np;jt.Lexer=Ts;jt.lexer=Ts.lex;jt.Tokenizer=zf;jt.Hooks=zo;jt.parse=jt;jt.options;jt.setOptions;jt.use;jt.walkTokens;jt.parseInline;Es.parse;Ts.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function $b(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function Qv(l){if(Array.isArray(l))return l}function Kv(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,b=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(_){b=!0,o=_}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function Zv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
115
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fv(l,s){return Qv(l)||Kv(l,s)||Jv(l,s)||Zv()}function Jv(l,s){if(l){if(typeof l=="string")return $b(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$b(l,s):void 0}}const Ny=Object.entries,Xb=Object.setPrototypeOf,Wv=Object.isFrozen,Pv=Object.getPrototypeOf,e1=Object.getOwnPropertyDescriptor;let nl=Object.freeze,ll=Object.seal,ic=Object.create,Ty=typeof Reflect<"u"&&Reflect,cp=Ty.apply,op=Ty.construct;nl||(nl=function(s){return s});ll||(ll=function(s){return s});cp||(cp=function(s,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return s.apply(r,o)});op||(op=function(s){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new s(...c)});const tc=Rn(Array.prototype.forEach),t1=Rn(Array.prototype.lastIndexOf),Vb=Rn(Array.prototype.pop),nc=Rn(Array.prototype.push),n1=Rn(Array.prototype.splice),Ci=Array.isArray,Uo=Rn(String.prototype.toLowerCase),Bh=Rn(String.prototype.toString),Qb=Rn(String.prototype.match),Co=Rn(String.prototype.replace),Kb=Rn(String.prototype.indexOf),l1=Rn(String.prototype.trim),s1=Rn(Number.prototype.toString),a1=Rn(Boolean.prototype.toString),Zb=typeof BigInt>"u"?null:Rn(BigInt.prototype.toString),Fb=typeof Symbol>"u"?null:Rn(Symbol.prototype.toString),Kn=Rn(Object.prototype.hasOwnProperty),Ao=Rn(Object.prototype.toString),Qn=Rn(RegExp.prototype.test),Pi=i1(TypeError);function Rn(l){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return cp(l,s,c)}}function i1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return op(l,r)}}function pt(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uo;if(Xb&&Xb(l,null),!Ci(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(Wv(s)||(s[c]=d),o=d)}l[o]=!0}return l}function r1(l){for(let s=0;s<l.length;s++)Kn(l,s)||(l[s]=null);return l}function jl(l){const s=ic(null);for(const c of Ny(l)){var r=Fv(c,2);const o=r[0],d=r[1];Kn(l,o)&&(Ci(d)?s[o]=r1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=jl(d):s[o]=d)}return s}function c1(l){switch(typeof l){case"string":return l;case"number":return s1(l);case"boolean":return a1(l);case"bigint":return Zb?Zb(l):"0";case"symbol":return Fb?Fb(l):"Symbol()";case"undefined":return Ao(l);case"function":case"object":{if(l===null)return Ao(l);const s=l,r=Ws(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Ao(c)}return Ao(l)}default:return Ao(l)}}function Ws(l,s){for(;l!==null;){const c=e1(l,s);if(c){if(c.get)return Rn(c.get);if(typeof c.value=="function")return Rn(c.value)}l=Pv(l)}function r(){return null}return r}function o1(l){try{return Qn(l,""),!0}catch{return!1}}const Jb=nl(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ih=nl(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qh=nl(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),u1=nl(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Gh=nl(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),f1=nl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wb=nl(["#text"]),Pb=nl(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Yh=nl(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ex=nl(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ff=nl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),d1=ll(/{{[\w\W]*|^[\w\W]*}}/g),h1=ll(/<%[\w\W]*|^[\w\W]*%>/g),p1=ll(/\${[\w\W]*/g),m1=ll(/^data-[\-\w.\u00B7-\uFFFF]+$/),g1=ll(/^aria-[\-\w]+$/),tx=ll(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),b1=ll(/^(?:\w+script|data):/i),x1=ll(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y1=ll(/^html$/i),_1=ll(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=ll(/<[/\w!]/g),lx=ll(/<[/\w]/g),v1=ll(/<\/no(script|embed|frames)/i),j1=ll(/\/>/i),Kl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},S1=function(){return typeof window>"u"?null:window},w1=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},sx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},wi=function(s,r,c,o){return Kn(s,r)&&Ci(s[r])?pt(o.base?jl(o.base):{},s[r],o.transform):c};function Ey(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S1();const s=pe=>Ey(pe);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==Kl.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const d=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,b=l.NamedNodeMap;b===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const _=l.DOMParser,S=l.trustedTypes,v=m.prototype,E=Ws(v,"cloneNode"),T=Ws(v,"remove"),C=Ws(v,"nextSibling"),L=Ws(v,"childNodes"),$=Ws(v,"parentNode"),J=Ws(v,"shadowRoot"),G=Ws(v,"attributes"),O=h&&h.prototype?Ws(h.prototype,"nodeType"):null,Z=h&&h.prototype?Ws(h.prototype,"nodeName"):null;if(typeof d=="function"){const pe=r.createElement("template");pe.content&&pe.content.ownerDocument&&(r=pe.content.ownerDocument)}let M,D="",H,ne=!1,he=0;const W=function(){if(he>0)throw Pi('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(),he++;try{return M.createHTML(k)}finally{he--}},je=function(k){W(),he++;try{return M.createScriptURL(k)}finally{he--}},Me=function(){return ne||(H=w1(S,o),ne=!0),H},Ce=r,A=Ce.implementation,ce=Ce.createNodeIterator,z=Ce.createDocumentFragment,be=Ce.getElementsByTagName,ye=c.importNode;let N=sx();s.isSupported=typeof Ny=="function"&&typeof $=="function"&&A&&A.createHTMLDocument!==void 0;const V=d1,re=h1,me=p1,Ne=m1,ve=g1,De=b1,yt=x1,$e=_1;let Xe=tx,Ve=null;const It=pt({},[...Jb,...Ih,...qh,...Gh,...Wb]);let rt=null;const dn=pt({},[...Pb,...Yh,...ex,...ff]);let ft=Object.seal(ic(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,Sn=null;const xn=Object.seal(ic(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let en=!0,tt=!0,et=!1,tn=!0,$t=!1,nt=!0,St=!1,Xt=!1,cn=null,wt=null,yn=!1,qt=!1,pn=!1,Dn=!1,Gt=!0,ct=!1;const Et="user-content-";let Pe=!0,wl=!1,le={},ge=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 B=null;const P=pt({},["audio","video","img","source","image","track"]);let _e=null;const Be=pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ot="http://www.w3.org/1998/Math/MathML",fl="http://www.w3.org/2000/svg",On="http://www.w3.org/1999/xhtml";let dl=On,sl=!1,Bl=null;const ds=pt({},[Ot,fl,On],Bh),hl=nl(["mi","mo","mn","ms","mtext"]);let al=pt({},hl);const pl=nl(["annotation-xml"]);let Yt=pt({},pl);const Vt=pt({},["title","style","font","a","script"]);let kl=null;const kt=["application/xhtml+xml","text/html"],Qt="text/html";let Oe=null,Ct=null;const qn=r.createElement("form"),nn=function(k){return k instanceof RegExp||k instanceof Function},Ln=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ct&&Ct===k)return;(!k||typeof k!="object")&&(k={}),k=jl(k),kl=kt.indexOf(k.PARSER_MEDIA_TYPE)===-1?Qt:k.PARSER_MEDIA_TYPE,Oe=kl==="application/xhtml+xml"?Bh:Uo,Ve=wi(k,"ALLOWED_TAGS",It,{transform:Oe}),rt=wi(k,"ALLOWED_ATTR",dn,{transform:Oe}),Bl=wi(k,"ALLOWED_NAMESPACES",ds,{transform:Bh}),_e=wi(k,"ADD_URI_SAFE_ATTR",Be,{transform:Oe,base:Be}),B=wi(k,"ADD_DATA_URI_TAGS",P,{transform:Oe,base:P}),ge=wi(k,"FORBID_CONTENTS",He,{transform:Oe}),hn=wi(k,"FORBID_TAGS",jl({}),{transform:Oe}),Sn=wi(k,"FORBID_ATTR",jl({}),{transform:Oe}),le=Kn(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?jl(k.USE_PROFILES):k.USE_PROFILES:!1,en=k.ALLOW_ARIA_ATTR!==!1,tt=k.ALLOW_DATA_ATTR!==!1,et=k.ALLOW_UNKNOWN_PROTOCOLS||!1,tn=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$t=k.SAFE_FOR_TEMPLATES||!1,nt=k.SAFE_FOR_XML!==!1,St=k.WHOLE_DOCUMENT||!1,qt=k.RETURN_DOM||!1,pn=k.RETURN_DOM_FRAGMENT||!1,Dn=k.RETURN_TRUSTED_TYPE||!1,yn=k.FORCE_BODY||!1,Gt=k.SANITIZE_DOM!==!1,ct=k.SANITIZE_NAMED_PROPS||!1,Pe=k.KEEP_CONTENT!==!1,wl=k.IN_PLACE||!1,Xe=o1(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:tx,dl=typeof k.NAMESPACE=="string"?k.NAMESPACE:On,al=Kn(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?jl(k.MATHML_TEXT_INTEGRATION_POINTS):pt({},hl),Yt=Kn(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?jl(k.HTML_INTEGRATION_POINTS):pt({},pl);const Y=Kn(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?jl(k.CUSTOM_ELEMENT_HANDLING):ic(null);if(ft=ic(null),Kn(Y,"tagNameCheck")&&nn(Y.tagNameCheck)&&(ft.tagNameCheck=Y.tagNameCheck),Kn(Y,"attributeNameCheck")&&nn(Y.attributeNameCheck)&&(ft.attributeNameCheck=Y.attributeNameCheck),Kn(Y,"allowCustomizedBuiltInElements")&&typeof Y.allowCustomizedBuiltInElements=="boolean"&&(ft.allowCustomizedBuiltInElements=Y.allowCustomizedBuiltInElements),ll(ft),$t&&(tt=!1),pn&&(qt=!0),le&&(Ve=pt({},Wb),rt=ic(null),le.html===!0&&(pt(Ve,Jb),pt(rt,Pb)),le.svg===!0&&(pt(Ve,Ih),pt(rt,Yh),pt(rt,ff)),le.svgFilters===!0&&(pt(Ve,qh),pt(rt,Yh),pt(rt,ff)),le.mathMl===!0&&(pt(Ve,Gh),pt(rt,ex),pt(rt,ff))),xn.tagCheck=null,xn.attributeCheck=null,Kn(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?xn.tagCheck=k.ADD_TAGS:Ci(k.ADD_TAGS)&&(Ve===It&&(Ve=jl(Ve)),pt(Ve,k.ADD_TAGS,Oe))),Kn(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?xn.attributeCheck=k.ADD_ATTR:Ci(k.ADD_ATTR)&&(rt===dn&&(rt=jl(rt)),pt(rt,k.ADD_ATTR,Oe))),Kn(k,"ADD_URI_SAFE_ATTR")&&Ci(k.ADD_URI_SAFE_ATTR)&&pt(_e,k.ADD_URI_SAFE_ATTR,Oe),Kn(k,"FORBID_CONTENTS")&&Ci(k.FORBID_CONTENTS)&&(ge===He&&(ge=jl(ge)),pt(ge,k.FORBID_CONTENTS,Oe)),Kn(k,"ADD_FORBID_CONTENTS")&&Ci(k.ADD_FORBID_CONTENTS)&&(ge===He&&(ge=jl(ge)),pt(ge,k.ADD_FORBID_CONTENTS,Oe)),Pe&&(Ve["#text"]=!0),St&&pt(Ve,["html","head","body"]),Ve.table&&(pt(Ve,["tbody"]),delete hn.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const fe=M;M=k.TRUSTED_TYPES_POLICY;try{D=ue("")}catch(we){throw M=fe,we}}else k.TRUSTED_TYPES_POLICY===null?(M=void 0,D=""):(M===void 0&&(M=Me()),M&&typeof D=="string"&&(D=ue("")));nl&&nl(k),Ct=k},il=pt({},[...Ih,...qh,...u1]),wn=pt({},[...Gh,...f1]),Il=function(k,Y,fe){return Y.namespaceURI===On?k==="svg":Y.namespaceURI===Ot?k==="svg"&&(fe==="annotation-xml"||al[fe]):!!il[k]},rl=function(k,Y,fe){return Y.namespaceURI===On?k==="math":Y.namespaceURI===fl?k==="math"&&Yt[fe]:!!wn[k]},ln=function(k,Y,fe){return Y.namespaceURI===fl&&!Yt[fe]||Y.namespaceURI===Ot&&!al[fe]?!1:!wn[k]&&(Vt[k]||!il[k])},Kt=function(k){let Y=$(k);(!Y||!Y.tagName)&&(Y={namespaceURI:dl,tagName:"template"});const fe=Uo(k.tagName),we=Uo(Y.tagName);return Bl[k.namespaceURI]?k.namespaceURI===fl?Il(fe,Y,we):k.namespaceURI===Ot?rl(fe,Y,we):k.namespaceURI===On?ln(fe,Y,we):!!(kl==="application/xhtml+xml"&&Bl[k.namespaceURI]):!1},on=function(k){nc(s.removed,{element:k});try{$(k).removeChild(k)}catch{if(T(k),!$(k))throw Pi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Fe=function(k){Gn(k);const Y=L(k);if(Y){const we=[];tc(Y,Ae=>{nc(we,Ae)}),tc(we,Ae=>{try{T(Ae)}catch{}})}const fe=G(k);if(fe)for(let we=fe.length-1;we>=0;--we){const Ae=fe[we],ze=Ae&&Ae.name;if(typeof ze=="string")try{k.removeAttribute(ze)}catch{}}},ml=function(k,Y){try{nc(s.removed,{attribute:Y.getAttributeNode(k),from:Y})}catch{nc(s.removed,{attribute:null,from:Y})}if(Y.removeAttribute(k),k==="is")if(qt||pn)try{on(Y)}catch{}else try{Y.setAttribute(k,"")}catch{}},Ms=function(k){const Y=G(k);if(Y)for(let fe=Y.length-1;fe>=0;--fe){const we=Y[fe],Ae=we&&we.name;if(!(typeof Ae!="string"||rt[Oe(Ae)]))try{k.removeAttribute(Ae)}catch{}}},Gn=function(k){const Y=[k];for(;Y.length>0;){const fe=Y.pop();(O?O(fe):fe.nodeType)===Kl.element&&Ms(fe);const Ae=L(fe);if(Ae)for(let ze=Ae.length-1;ze>=0;--ze)Y.push(Ae[ze])}},Zl=function(k){if(!nt)return;const Y=[k];for(;Y.length>0;){const fe=Y.pop(),we=O?O(fe):fe.nodeType;if(we===Kl.processingInstruction||we===Kl.comment&&Qn(lx,fe.data)){try{T(fe)}catch{}continue}if(we===Kl.element){const ze=fe,dt=Oe(Z?Z(fe):fe.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&dt!=="label"&&dt!=="output"&&ze.removeAttribute("for")}catch{}}const Ae=L(fe);if(Ae)for(let ze=Ae.length-1;ze>=0;--ze)Y.push(Ae[ze])}},hs=function(k){let Y=null,fe=null;if(yn)k="<remove></remove>"+k;else{const ze=Qb(k,/^[\r\n\t ]+/);fe=ze&&ze[0]}kl==="application/xhtml+xml"&&dl===On&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const we=M?ue(k):k;if(dl===On)try{Y=new _().parseFromString(we,kl)}catch{}if(!Y||!Y.documentElement){Y=A.createDocument(dl,"template",null);try{Y.documentElement.innerHTML=sl?D:we}catch{}}const Ae=Y.body||Y.documentElement;return k&&fe&&Ae.insertBefore(r.createTextNode(fe),Ae.childNodes[0]||null),dl===On?be.call(Y,St?"html":"body")[0]:St?Y.documentElement:Ae},ps=function(k){return ce.call(k.ownerDocument||k,k,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},mn=function(k){return k=Co(k,V," "),k=Co(k,re," "),k=Co(k,me," "),k},Fl=function(k){var Y;k.normalize();const fe=ce.call(k.ownerDocument||k,k,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let we=fe.nextNode();for(;we;)we.data=mn(we.data),we=fe.nextNode();const Ae=(Y=k.querySelectorAll)===null||Y===void 0?void 0:Y.call(k,"template");Ae&&tc(Ae,ze=>{zn(ze.content)&&Fl(ze.content)})},Zn=function(k){const Y=Z?Z(k):null;return typeof Y!="string"||Oe(Y)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==G(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==O(k)||k.childNodes!==L(k)},zn=function(k){if(!O||typeof k!="object"||k===null)return!1;try{return O(k)===Kl.documentFragment}catch{return!1}},kn=function(k){if(!O||typeof k!="object"||k===null)return!1;try{return typeof O(k)=="number"}catch{return!1}};function Lt(pe,k,Y){pe.length!==0&&tc(pe,fe=>{fe.call(s,k,Y,Ct)})}const Rs=function(k,Y){return!!(nt&&k.hasChildNodes()&&!kn(k.firstElementChild)&&Qn(nx,k.textContent)&&Qn(nx,k.innerHTML)||nt&&k.namespaceURI===On&&Y==="style"&&kn(k.firstElementChild)||k.nodeType===Kl.processingInstruction||nt&&k.nodeType===Kl.comment&&Qn(lx,k.data))},Di=function(k,Y){if(!hn[Y]&&La(Y)&&(ft.tagNameCheck instanceof RegExp&&Qn(ft.tagNameCheck,Y)||ft.tagNameCheck instanceof Function&&ft.tagNameCheck(Y)))return!1;if(Pe&&!ge[Y]){const fe=$(k),we=L(k);if(we&&fe){const Ae=we.length;for(let ze=Ae-1;ze>=0;--ze){const dt=wl?we[ze]:E(we[ze],!0);fe.insertBefore(dt,C(k))}}}return on(k),!0},Ds=function(k,Y){if(Lt(N.beforeSanitizeElements,k,null),k!==Y&&$(k)===null)return!0;if(Zn(k))return on(k),!0;const fe=Oe(Z?Z(k):k.nodeName);if(Lt(N.uponSanitizeElement,k,{tagName:fe,allowedTags:Ve}),k!==Y&&$(k)===null)return!0;if(Rs(k,fe))return on(k),!0;if(hn[fe]||!(xn.tagCheck instanceof Function&&xn.tagCheck(fe))&&!Ve[fe]){const Ae=Di(k,fe);return Ae===!1&&Lt(N.afterSanitizeElements,k,null),Ae}if((O?O(k):k.nodeType)===Kl.element&&!Kt(k)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&Qn(v1,k.innerHTML))return on(k),!0;if($t&&k.nodeType===Kl.text){const Ae=mn(k.textContent);k.textContent!==Ae&&(nc(s.removed,{element:k.cloneNode()}),k.textContent=Ae)}return Lt(N.afterSanitizeElements,k,null),!1},Yn=function(k,Y,fe){if(Sn[Y]||nt&&Y==="patchsrc"||nt&&Y==="for"&&k!=="label"&&k!=="output"||Gt&&(Y==="id"||Y==="name")&&(fe in r||fe in qn))return!1;const we=rt[Y]||xn.attributeCheck instanceof Function&&xn.attributeCheck(Y,k);if(!(tt&&Qn(Ne,Y))){if(!(en&&Qn(ve,Y))){if(we){if(!_e[Y]){if(!Qn(Xe,Co(fe,yt,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&k!=="script"&&Kb(fe,"data:")===0&&B[k])){if(!(et&&!Qn(De,Co(fe,yt,"")))){if(fe)return!1}}}}}else if(!(La(k)&&(ft.tagNameCheck instanceof RegExp&&Qn(ft.tagNameCheck,k)||ft.tagNameCheck instanceof Function&&ft.tagNameCheck(k))&&(ft.attributeNameCheck instanceof RegExp&&Qn(ft.attributeNameCheck,Y)||ft.attributeNameCheck instanceof Function&&ft.attributeNameCheck(Y,k))||Y==="is"&&ft.allowCustomizedBuiltInElements&&(ft.tagNameCheck instanceof RegExp&&Qn(ft.tagNameCheck,fe)||ft.tagNameCheck instanceof Function&&ft.tagNameCheck(fe))))return!1}}return!0},Nl=pt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),La=function(k){return!Nl[Uo(k)]&&Qn($e,k)},Nn=function(k,Y,fe,we){if(M&&typeof S=="object"&&typeof S.getAttributeType=="function"&&!fe)switch(S.getAttributeType(k,Y)){case"TrustedHTML":return ue(we);case"TrustedScriptURL":return je(we)}return we},sn=function(k,Y,fe,we){try{fe?k.setAttributeNS(fe,Y,we):k.setAttribute(Y,we),Zn(k)?on(k):Vb(s.removed)}catch{ml(Y,k)}},Jl=function(k){Lt(N.beforeSanitizeAttributes,k,null);const Y=k.attributes;if(!Y||Zn(k))return;const fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:rt,forceKeepAttr:void 0};let we=Y.length;const Ae=Oe(k.nodeName);for(;we--;){const ze=Y[we],dt=ze.name,w=ze.namespaceURI,se=ze.value,ke=Oe(dt),Je=se;let ht=dt==="value"?Je:l1(Je);if(fe.attrName=ke,fe.attrValue=ht,fe.keepAttr=!0,fe.forceKeepAttr=void 0,Lt(N.uponSanitizeAttribute,k,fe),ht=fe.attrValue,ct&&(ke==="id"||ke==="name")&&Kb(ht,Et)!==0&&(ml(dt,k),ht=Et+ht),nt&&Qn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ht)){ml(dt,k);continue}if(ke==="attributename"&&Qb(ht,"href")){ml(dt,k);continue}if(!fe.forceKeepAttr){if(!fe.keepAttr){ml(dt,k);continue}if(!tn&&Qn(j1,ht)){ml(dt,k);continue}if($t&&(ht=mn(ht)),!Yn(Ae,ke,ht)){ml(dt,k);continue}ht=Nn(Ae,ke,w,ht),ht!==Je&&sn(k,dt,w,ht)}}Lt(N.afterSanitizeAttributes,k,null)},lt=function(k){let Y=null;const fe=ps(k);for(Lt(N.beforeSanitizeShadowDOM,k,null);Y=fe.nextNode();)if(Lt(N.uponSanitizeShadowNode,Y,null),Ds(Y,k),Jl(Y),zn(Y.content)&<(Y.content),(O?O(Y):Y.nodeType)===Kl.element){const Ae=J(Y);zn(Ae)&&($n(Ae),lt(Ae))}Lt(N.afterSanitizeShadowDOM,k,null)},$n=function(k){const Y=[{node:k,shadow:null}];for(;Y.length>0;){const fe=Y.pop();if(fe.shadow){lt(fe.shadow);continue}const we=fe.node,ze=(O?O(we):we.nodeType)===Kl.element,dt=L(we);if(dt)for(let w=dt.length-1;w>=0;--w)Y.push({node:dt[w],shadow:null});if(ze){const w=Z?Z(we):null;if(typeof w=="string"&&Oe(w)==="template"){const se=we.content;zn(se)&&Y.push({node:se,shadow:null})}}if(ze){const w=J(we);zn(w)&&Y.push({node:null,shadow:w},{node:w,shadow:null})}}};return s.sanitize=function(pe){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,fe=null,we=null,Ae=null;if(sl=!pe,sl&&(pe="<!-->"),typeof pe!="string"&&!kn(pe)&&(pe=c1(pe),typeof pe!="string"))throw Pi("dirty is not a string, aborting");if(!s.isSupported)return pe;Xt?(Ve=cn,rt=wt):Ln(k),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(Ve=jl(Ve)),N.uponSanitizeAttribute.length>0&&(rt=jl(rt)),s.removed=[];const ze=wl&&typeof pe!="string"&&kn(pe);if(ze){Zl(pe);const ke=Z?Z(pe):pe.nodeName;if(typeof ke=="string"){const Je=Oe(ke);if(!Ve[Je]||hn[Je])throw Fe(pe),Pi("root node is forbidden and cannot be sanitized in-place")}if(Zn(pe))throw Fe(pe),Pi("root node is clobbered and cannot be sanitized in-place");try{$n(pe)}catch(Je){throw Fe(pe),Je}}else if(kn(pe))Y=hs("<!---->"),fe=Y.ownerDocument.importNode(pe,!0),fe.nodeType===Kl.element&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?Y=fe:Y.appendChild(fe),$n(fe);else{if(!qt&&!$t&&!St&&pe.indexOf("<")===-1)return M&&Dn?ue(pe):pe;if(Y=hs(pe),!Y)return qt?null:Dn?D:""}Y&&yn&&on(Y.firstChild);const dt=ze?pe:Y,w=ps(dt);try{for(;we=w.nextNode();)Ds(we,dt),Jl(we),zn(we.content)&<(we.content)}catch(ke){throw ze&&(Fe(pe),tc(s.removed,Je=>{Je.element&&Gn(Je.element)})),ke}if(ze)return tc(s.removed,ke=>{ke.element&&Gn(ke.element)}),$t&&Fl(pe),pe;if(qt){if($t&&Fl(Y),pn)for(Ae=z.call(Y.ownerDocument);Y.firstChild;)Ae.appendChild(Y.firstChild);else Ae=Y;return(rt.shadowroot||rt.shadowrootmode)&&(Ae=ye.call(c,Ae,!0)),Ae}let se=St?Y.outerHTML:Y.innerHTML;return St&&Ve["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Qn(y1,Y.ownerDocument.doctype.name)&&(se="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
|
|
116
|
-
`+se),$t&&(se=mn(se)),M&&Dn?ue(se):se},s.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(pe),Xt=!0,cn=Ve,wt=rt},s.clearConfig=function(){Ct=null,Xt=!1,cn=null,wt=null,M=H,D=""},s.isValidAttribute=function(pe,k,Y){Ct||Ln({});const fe=Oe(pe),we=Oe(k);return Yn(fe,we,Y)},s.addHook=function(pe,k){typeof k=="function"&&Kn(N,pe)&&nc(N[pe],k)},s.removeHook=function(pe,k){if(Kn(N,pe)){if(k!==void 0){const Y=t1(N[pe],k);return Y===-1?void 0:n1(N[pe],Y,1)[0]}return Vb(N[pe])}},s.removeHooks=function(pe){Kn(N,pe)&&(N[pe]=[])},s.removeAllHooks=function(){N=sx()},s}var k1=Ey();const N1=1024;let T1=0;class fs{constructor(s,r){this.from=s,this.to=r}}class Pt{constructor(s={}){this.id=T1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=As.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}Pt.closedBy=new Pt({deserialize:l=>l.split(" ")});Pt.openedBy=new Pt({deserialize:l=>l.split(" ")});Pt.group=new Pt({deserialize:l=>l.split(" ")});Pt.isolate=new Pt({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});Pt.contextHash=new Pt({perNode:!0});Pt.lookAhead=new Pt({perNode:!0});Pt.mounted=new Pt({perNode:!0});class uc{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[Pt.mounted.id]}}const E1=Object.create(null);class As{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):E1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new As(s.name||"",r,s.id,c);if(s.props){for(let d of s.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(Pt.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(Pt.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}As.none=new As("",Object.create(null),0,8);class Cy{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let d of s){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new As(c.name,o,c.id,c.flags):c)}return new Cy(r)}}const df=new WeakMap,ax=new WeakMap;var Jt;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(Jt||(Jt={}));class Hl{constructor(s,r,c,o,d){if(this.type=s,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let s=uc.get(this);if(s&&!s.overlay)return s.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(s=0){return new Hf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=df.get(this)||this.topNode,d=new Hf(o);return d.moveTo(s,r),df.set(this,d._tree),d}get topNode(){return new ul(this,0,0,null)}resolve(s,r=0){let c=Io(df.get(this)||this.topNode,s,r,!1);return df.set(this,c),c}resolveInner(s,r=0){let c=Io(ax.get(this)||this.topNode,s,r,!0);return ax.set(this,c),c}resolveStack(s,r=0){return M1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&Jt.IncludeAnonymous)>0;for(let g=this.cursor(h|Jt.IncludeAnonymous);;){let b=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;b=!0}for(;b&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;b=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Cp(As.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Hl(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Hl(As.none,r,c,o)))}static build(s){return R1(s)}}Hl.empty=new Hl(As.none,[],[],0);class Tp{constructor(s,r){this.buffer=s,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tp(this.buffer,this.index)}}class Ri{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return As.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),s+=4,c==s)return d;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return d+"("+h.join(",")+")"}findChild(s,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(Ay(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,d=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let b=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,b)}return new Ri(d,h,this.set)}}function Ay(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function Io(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof ul&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:Jt.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof ul&&h.index<0&&((o=m.enter(s,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,d);if(!h)return l;l=h}}class My{cursor(s=0){return new Hf(this,s)}getChild(s,r=null,c=null){let o=ix(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return ix(this,s,r,c)}resolve(s,r=0){return Io(this,s,r,!1)}resolveInner(s,r=0){return Io(this,s,r,!0)}matchContext(s){return up(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class ul extends My{constructor(s,r,c,o){super(),this._tree=s,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(s,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,b=r>0?m.length:-1;s!=b;s+=r){let _=m[s],S=g[s]+h.from,v;if(!(!(d&Jt.EnterBracketed&&_ instanceof Hl&&(v=uc.get(_))&&!v.overlay&&v.bracketed&&c>=S&&c<=S+_.length)&&!Ay(o,c,S,S+_.length))){if(_ instanceof Ri){if(d&Jt.ExcludeBuffers)continue;let E=_.findChild(0,_.buffer.length,r,c-S,o);if(E>-1)return new la(new C1(h,_,s,S),null,E)}else if(d&Jt.IncludeAnonymous||!_.type.isAnonymous||Ep(_)){let E;if(!(d&Jt.IgnoreMounts)&&(E=uc.get(_))&&!E.overlay)return new ul(E.tree,S,s,h);let T=new ul(_,S,s,h);return d&Jt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?_.children.length-1:0,r,c,o,d)}}}if(d&Jt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&Jt.IgnoreOverlays)&&(o=uc.get(this._tree))&&o.overlay){let d=s-this.from,h=c&Jt.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=d:m<d)&&(r<0||h?g>=d:g>d))return new ul(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ix(l,s,r,c){let o=l.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(s)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function up(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class C1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class la extends My{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return d<0?null:new la(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&Jt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return d<0?null:new la(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new la(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new la(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];s.push(c.slice(o,d,h)),r.push(0)}return new Hl(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ry(l){if(!l.length)return null;let s=0,r=l[0];for(let d=1;d<l.length;d++){let h=l[d];(h.from>r.from||h.to<r.to)&&(r=h,s=d)}let c=r instanceof ul&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new A1(o,r)}class A1{constructor(s,r){this.heads=s,this.node=r}get next(){return Ry(this.heads)}}function M1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof ul?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(s,r)),d=h}else{let h=uc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new ul(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Io(m,s,r,!1))}}return o?Ry(o):c}class Hf{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Jt.EnterBracketed,s instanceof ul)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof ul?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&Jt.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&Jt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+s,h=s<0?-1:c._tree.children.length;d!=h;d+=s){let m=c._tree.children[d];if(this.mode&Jt.IncludeAnonymous||m instanceof Ri||!m.type.isAnonymous||Ep(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new la(this.buffer,r,this.stack[o]);return this.bufferNode=new la(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return up(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return up(this._tree,s,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Ep(l){return l.children.some(s=>s instanceof Ri||!s.type.isAnonymous||Ep(s))}function R1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=N1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Tp(r,r.length):r,g=c.types,b=0,_=0;function S(Z,M,D,H,ne,he){let{id:W,start:ue,end:je,size:Me}=m,Ce=_,A=b;if(Me<0)if(m.next(),Me==-1){let N=d[W];D.push(N),H.push(ue-Z);return}else if(Me==-3){b=W;return}else if(Me==-4){_=W;return}else throw new RangeError(`Unrecognized record size: ${Me}`);let ce=g[W],z,be,ye=ue-Z;if(je-ue<=o&&(be=L(m.pos-M,ne))){let N=new Uint16Array(be.size-be.skip),V=m.pos-be.size,re=N.length;for(;m.pos>V;)re=$(be.start,N,re);z=new Ri(N,je-be.start,c),ye=be.start-Z}else{let N=m.pos-Me;m.next();let V=[],re=[],me=W>=h?W:-1,Ne=0,ve=je;for(;m.pos>N;)me>=0&&m.id==me&&m.size>=0?(m.end<=ve-o&&(T(V,re,ue,Ne,m.end,ve,me,Ce,A),Ne=V.length,ve=m.end),m.next()):he>2500?v(ue,N,V,re):S(ue,N,V,re,me,he+1);if(me>=0&&Ne>0&&Ne<V.length&&T(V,re,ue,Ne,ue,ve,me,Ce,A),V.reverse(),re.reverse(),me>-1&&Ne>0){let De=E(ce,A);z=Cp(ce,V,re,0,V.length,0,je-ue,De,De)}else z=C(ce,V,re,je-ue,Ce-je,A)}D.push(z),H.push(ye)}function v(Z,M,D,H){let ne=[],he=0,W=-1;for(;m.pos>M;){let{id:ue,start:je,end:Me,size:Ce}=m;if(Ce>4)m.next();else{if(W>-1&&je<W)break;W<0&&(W=Me-o),ne.push(ue,je,Me),he++,m.next()}}if(he){let ue=new Uint16Array(he*4),je=ne[ne.length-2];for(let Me=ne.length-3,Ce=0;Me>=0;Me-=3)ue[Ce++]=ne[Me],ue[Ce++]=ne[Me+1]-je,ue[Ce++]=ne[Me+2]-je,ue[Ce++]=Ce;D.push(new Ri(ue,ne[2]-je,c)),H.push(je-Z)}}function E(Z,M){return(D,H,ne)=>{let he=0,W=D.length-1,ue,je;if(W>=0&&(ue=D[W])instanceof Hl){if(!W&&ue.type==Z&&ue.length==ne)return ue;(je=ue.prop(Pt.lookAhead))&&(he=H[W]+ue.length+je)}return C(Z,D,H,ne,he,M)}}function T(Z,M,D,H,ne,he,W,ue,je){let Me=[],Ce=[];for(;Z.length>H;)Me.push(Z.pop()),Ce.push(M.pop()+D-ne);Z.push(C(c.types[W],Me,Ce,he-ne,ue-he,je)),M.push(ne-D)}function C(Z,M,D,H,ne,he,W){if(he){let ue=[Pt.contextHash,he];W=W?[ue].concat(W):[ue]}if(ne>25){let ue=[Pt.lookAhead,ne];W=W?[ue].concat(W):[ue]}return new Hl(Z,M,D,H,W)}function L(Z,M){let D=m.fork(),H=0,ne=0,he=0,W=D.end-o,ue={size:0,start:0,skip:0};e:for(let je=D.pos-Z;D.pos>je;){let Me=D.size;if(D.id==M&&Me>=0){ue.size=H,ue.start=ne,ue.skip=he,he+=4,H+=4,D.next();continue}let Ce=D.pos-Me;if(Me<0||Ce<je||D.start<W)break;let A=D.id>=h?4:0,ce=D.start;for(D.next();D.pos>Ce;){if(D.size<0)if(D.size==-3||D.size==-4)A+=4;else break e;else D.id>=h&&(A+=4);D.next()}ne=ce,H+=Me,he+=A}return(M<0||H==Z)&&(ue.size=H,ue.start=ne,ue.skip=he),ue.size>4?ue:void 0}function $(Z,M,D){let{id:H,start:ne,end:he,size:W}=m;if(m.next(),W>=0&&H<h){let ue=D;if(W>4){let je=m.pos-(W-4);for(;m.pos>je;)D=$(Z,M,D)}M[--D]=ue,M[--D]=he-Z,M[--D]=ne-Z,M[--D]=H}else W==-3?b=H:W==-4&&(_=H);return D}let J=[],G=[];for(;m.pos>0;)S(l.start||0,l.bufferStart||0,J,G,-1,0);let O=(s=l.length)!==null&&s!==void 0?s:J.length?G[0]+J[0].length:0;return new Hl(g[l.topID],J.reverse(),G.reverse(),O)}const rx=new WeakMap;function Df(l,s){if(!l.isAnonymous||s instanceof Ri||s.type!=l)return 1;let r=rx.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof Hl)){r=1;break}r+=Df(l,c)}rx.set(s,r)}return r}function Cp(l,s,r,c,o,d,h,m,g){let b=0;for(let T=c;T<o;T++)b+=Df(l,s[T]);let _=Math.ceil(b*1.5/8),S=[],v=[];function E(T,C,L,$,J){for(let G=L;G<$;){let O=G,Z=C[G],M=Df(l,T[G]);for(G++;G<$;G++){let D=Df(l,T[G]);if(M+D>=_)break;M+=D}if(G==O+1){if(M>_){let D=T[O];E(D.children,D.positions,0,D.children.length,C[O]+J);continue}S.push(T[O])}else{let D=C[G-1]+T[G-1].length-Z;S.push(Cp(l,T,C,O,G,Z,D,null,g))}v.push(Z+J-d)}}return E(s,r,c,o,0),(m||g)(S,v,h)}class EN{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof la?this.setBuffer(s.context.buffer,s.index,r):s instanceof ul&&this.map.set(s.tree,r)}get(s){return s instanceof la?this.getBuffer(s.context.buffer,s.index):s instanceof ul?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class qo{constructor(s,r,c,o,d=!1,h=!1){this.from=s,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,r=[],c=!1){let o=[new qo(0,s.length,s,0,!1,c)];for(let d of r)d.to>s.length&&o.push(d);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],d=1,h=s.length?s[0]:null;for(let m=0,g=0,b=0;;m++){let _=m<r.length?r[m]:null,S=_?_.fromA:1e9;if(S-g>=c)for(;h&&h.from<S;){let v=h;if(g>=v.from||S<=v.to||b){let E=Math.max(v.from,g)-b,T=Math.min(v.to,S)-b;v=E>=T?null:new qo(E,T,v.tree,v.offset+b,m>0,!!_)}if(v&&o.push(v),h.to>S)break;h=d<s.length?s[d++]:null}if(!_)break;g=_.toA,b=_.toA-_.toB}return o}}class CN{startParse(s,r,c){return typeof s=="string"&&(s=new D1(s)),c=c?c.length?c.map(o=>new fs(o.from,o.to)):[new fs(0,0)]:[new fs(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class D1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function AN(l){return(s,r,c,o)=>new L1(s,l,r,c,o)}class cx{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function ox(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class O1{constructor(s,r,c,o,d,h,m,g){this.parser=s,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const fp=new Pt({perNode:!0});class L1{constructor(s,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Hl(c.type,c.children,c.positions,c.length,c.propValues.concat([[fp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[Pt.mounted.id]=new uc(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new H1(this.fragments),r=null,c=null,o=new Hf(new ul(this.baseTree,this.ranges[0].from,0,null),Jt.IncludeAnonymous|Jt.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(r){let b=r.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(b)for(let _ of b.mount.overlay){let S=_.from+b.pos,v=_.to+b.pos;S>=o.from&&v<=o.to&&!r.ranges.some(E=>E.from<v&&E.to>S)&&r.ranges.push({from:S,to:v})}}m=!1}else if(c&&(h=z1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(U1(o),r&&r.depth++,c&&c.depth++);let b=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new O1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=dx(this.ranges,d.overlay||(o.from<o.to?[new fs(o.from,o.to)]:[]));_.length&&ox(_),(_.length||!d.overlay)&&this.inner.push(new cx(d.parser,_.length?d.parser.startParse(this.input,hx(b,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(S=>new fs(S.from-o.from,S.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new fs(o.from,o.to)),g.from<g.to)){let b=r.ranges.length-1;b>=0&&r.ranges[b].to==g.from?r.ranges[b]={from:r.ranges[b].from,to:g.to}:r.ranges.push(g)}if(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let b=dx(this.ranges,r.ranges);b.length&&(ox(b),this.inner.splice(r.index,0,new cx(r.parser,r.parser.startParse(this.input,hx(r.mounts,b),b),r.ranges.map(_=>new fs(_.from-r.start,_.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function z1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function ux(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function U1(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function b(_,S,v,E,T,C){let L=r[C],$=[],J=[];ux(h,_,L,$,J,E);let G=m[L+1],O=m[L+2];g.push($.length);let Z=C?b(L+4,m[L+3],h.set.types[m[L]],G,O-G,C-1):s.toTree();return $.push(Z),J.push(G-E),ux(h,m[L+3],S,$,J,E),new Hl(v,$,J,T)}o.children[d]=b(0,m.length,As.none,0,h.length,r.length-1);for(let _ of g){let S=l.tree.children[_],v=l.tree.positions[_];l.yield(new ul(S,v+l.from,_,l._tree))}}class fx{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(Jt.IncludeAnonymous|Jt.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,Jt.IgnoreOverlays|Jt.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Hl)r=r.children[0];else break}return!1}}class H1{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(fp))!==null&&r!==void 0?r:c.to,this.inner=new fx(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(fp))!==null&&s!==void 0?s:r.to,this.inner=new fx(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Pt.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=d.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:d.from-g.offset,mount:h})}}}return o}}function dx(l,s){let r=null,c=s;for(let o=1,d=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[d]=new fs(g.from,h),g.to>m&&r.splice(d+1,0,new fs(m,g.to))):g.to>m?r[d--]=new fs(m,g.to):r.splice(d--,1))}}return c}function B1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let _=o==l.length?1e9:h?l[o].to:l[o].from,S=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),E=Math.min(_,S,c);v<E&&b.push(new fs(v,E))}if(g=Math.min(_,S),g==1e9)break;_==g&&(h?(h=!1,o++):h=!0),S==g&&(m?(m=!1,d++):m=!0)}return b}function hx(l,s){let r=[];for(let{pos:c,mount:o,frag:d}of l){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),b=Math.min(d.to,m);if(o.overlay){let _=o.overlay.map(v=>new fs(v.from+c,v.to+c)),S=B1(s,_,g,b);for(let v=0,E=g;;v++){let T=v==S.length,C=T?b:S[v].from;if(C>E&&r.push(new qo(E,C,o.tree,-h,d.from>=E||d.openStart,d.to<=C||d.openEnd)),T)break;E=S[v].to}}else r.push(new qo(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let I1=0;class us{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=I1++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof us&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new us(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(s){let r=new Bf(s);return c=>c.modified.indexOf(r)>-1?c:Bf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let q1=0;class Bf{constructor(s){this.name=s,this.instances=[],this.id=q1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&G1(r,m.modified));if(c)return c;let o=[],d=new us(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=Y1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Bf.get(m,g));return d}}function G1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Y1(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function MN(l){let s=Object.create(null);for(let r in l){let c=l[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let S=0;;){if(m=="..."&&S>0&&S+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),S+=v[0].length,S==o.length)break;let E=o[S++];if(S==o.length&&E=="!"){h=0;break}if(E!="/")throw new RangeError("Invalid path: "+o);m=o.slice(S)}let g=d.length-1,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let _=new Go(c,h,g>0?d.slice(0,g):null);s[b]=_.sort(s[b])}}return Dy.add(s)}const Dy=new Pt({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new Go(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Go{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}Go.empty=new Go([],2,null);function Oy(l,s){let r=Object.create(null);for(let d of l)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=s||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let b=r[g.id];if(b){h=h?h+" "+b:b;break}}return h},scope:c}}function $1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function X1(l,s,r,c=0,o=l.length){let d=new Q1(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function V1(l,s,r,c,o,d=0,h=l.length){let m=d;function g(b,_){if(!(b<=m)){for(let S=l.slice(m,b),v=0;;){let E=S.indexOf(`
|
|
117
|
-
`,v),T=E<0?S.length:E;if(T>v&&c(S.slice(v,T),_),E<0)break;o(),v=E+1}m=b}}X1(s,r,(b,_,S)=>{g(b,""),g(_,S)},d,h),g(h,"")}class Q1{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,d){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(E=>!E.scope||E.scope(h)));let b=o,_=K1(s)||Go.empty,S=$1(d,_.tags);if(S&&(b&&(b+=" "),b+=S,_.mode==1&&(o+=(o?" ":"")+S)),this.startSpan(Math.max(r,m),b),_.opaque)return;let v=s.tree&&s.tree.prop(Pt.mounted);if(v&&v.overlay){let E=s.node.enter(v.overlay[0].from+m,1),T=this.highlighters.filter(L=>!L.scope||L.scope(v.tree.type)),C=s.firstChild();for(let L=0,$=m;;L++){let J=L<v.overlay.length?v.overlay[L]:null,G=J?J.from+m:g,O=Math.max(r,$),Z=Math.min(c,G);if(O<Z&&C)for(;s.from<Z&&(this.highlightRange(s,O,Z,o,d),this.startSpan(Math.min(Z,s.to),b),!(s.to>=G||!s.nextSibling())););if(!J||G>c)break;$=J.to+m,$>r&&(this.highlightRange(E.cursor(),Math.max(r,J.from+m),Math.min(c,$),"",T),this.startSpan(Math.min(c,$),b))}C&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),b)}while(s.nextSibling());s.parent()}}}function K1(l){let s=l.type.prop(Dy);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const Se=us.define,hf=Se(),Ti=Se(),px=Se(Ti),mx=Se(Ti),Ei=Se(),pf=Se(Ei),$h=Se(Ei),Ps=Se(),er=Se(Ps),Ks=Se(),Zs=Se(),dp=Se(),Mo=Se(dp),mf=Se(),Te={comment:hf,lineComment:Se(hf),blockComment:Se(hf),docComment:Se(hf),name:Ti,variableName:Se(Ti),typeName:px,tagName:Se(px),propertyName:mx,attributeName:Se(mx),className:Se(Ti),labelName:Se(Ti),namespace:Se(Ti),macroName:Se(Ti),literal:Ei,string:pf,docString:Se(pf),character:Se(pf),attributeValue:Se(pf),number:$h,integer:Se($h),float:Se($h),bool:Se(Ei),regexp:Se(Ei),escape:Se(Ei),color:Se(Ei),url:Se(Ei),keyword:Ks,self:Se(Ks),null:Se(Ks),atom:Se(Ks),unit:Se(Ks),modifier:Se(Ks),operatorKeyword:Se(Ks),controlKeyword:Se(Ks),definitionKeyword:Se(Ks),moduleKeyword:Se(Ks),operator:Zs,derefOperator:Se(Zs),arithmeticOperator:Se(Zs),logicOperator:Se(Zs),bitwiseOperator:Se(Zs),compareOperator:Se(Zs),updateOperator:Se(Zs),definitionOperator:Se(Zs),typeOperator:Se(Zs),controlOperator:Se(Zs),punctuation:dp,separator:Se(dp),bracket:Mo,angleBracket:Se(Mo),squareBracket:Se(Mo),paren:Se(Mo),brace:Se(Mo),content:Ps,heading:er,heading1:Se(er),heading2:Se(er),heading3:Se(er),heading4:Se(er),heading5:Se(er),heading6:Se(er),contentSeparator:Se(Ps),list:Se(Ps),quote:Se(Ps),emphasis:Se(Ps),strong:Se(Ps),link:Se(Ps),monospace:Se(Ps),strikethrough:Se(Ps),inserted:Se(),deleted:Se(),changed:Se(),invalid:Se(),meta:mf,documentMeta:Se(mf),annotation:Se(mf),processingInstruction:Se(mf),definition:us.defineModifier("definition"),constant:us.defineModifier("constant"),function:us.defineModifier("function"),standard:us.defineModifier("standard"),local:us.defineModifier("local"),special:us.defineModifier("special")};for(let l in Te){let s=Te[l];s instanceof us&&(s.name=l)}Oy([{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 Z1="modulepreload",F1=function(l,s){return new URL(l,s).href},gx={},Ke=function(s,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.map(S=>Promise.resolve(S).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(_=>{if(_=F1(_,c),_ in gx)return;gx[_]=!0;const S=_.endsWith(".css"),v=S?'[rel="stylesheet"]':"";if(!!c)for(let C=m.length-1;C>=0;C--){const L=m[C];if(L.href===_&&(!S||L.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const T=document.createElement("link");if(T.rel=S?"stylesheet":Z1,S||(T.as="script"),T.crossOrigin="",T.href=_,b&&T.setAttribute("nonce",b),document.head.appendChild(T),S)return new Promise((C,L)=>{T.addEventListener("load",C),T.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${_}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return s().catch(d)})},Ly={js:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Ke(async()=>{const{javascript:l}=await import("./index-gmvISUqO.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Ke(async()=>{const{json:l}=await import("./index-s7Wcfj5F.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Ke(async()=>{const{json:l}=await import("./index-s7Wcfj5F.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Ke(async()=>{const{css:l}=await import("./index-B0NcQgiZ.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Ke(async()=>{const{css:l}=await import("./index-B0NcQgiZ.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Ke(async()=>{const{css:l}=await import("./index-B0NcQgiZ.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Ke(async()=>{const{html:l}=await import("./index-Dv0cw76Z.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Ke(async()=>{const{html:l}=await import("./index-Dv0cw76Z.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Ke(async()=>{const{html:l}=await import("./index-Dv0cw76Z.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Ke(async()=>{const{html:l}=await import("./index-Dv0cw76Z.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Ke(async()=>{const{markdown:l}=await import("./index-DvhOZOas.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Ke(async()=>{const{markdown:l}=await import("./index-DvhOZOas.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Ke(async()=>{const{python:l}=await import("./index-DaRnRpPz.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Ke(async()=>{const{python:l}=await import("./index-DaRnRpPz.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Ke(async()=>{const{yaml:l}=await import("./index-DfGVckBo.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Ke(async()=>{const{yaml:l}=await import("./index-DfGVckBo.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Ke(async()=>{const{rust:l}=await import("./index-OuSuAczZ.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index--DhZrg25.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index--DhZrg25.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index--DhZrg25.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index--DhZrg25.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Ke(async()=>{const{cpp:l}=await import("./index--DhZrg25.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Ke(async()=>{const{java:l}=await import("./index-P6m4z84O.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Ke(async()=>{const{go:l}=await import("./index-CstcrxY-.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Ke(async()=>{const{php:l}=await import("./index-Bhx7H3mC.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Ke(async()=>{const{sql:l}=await import("./index-BFwSwibX.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Ke(async()=>{const{xml:l}=await import("./index-GT_NZ0qK.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Ke(async()=>{const{xml:l}=await import("./index-GT_NZ0qK.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},J1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},W1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function P1(l){const s=W1[l.toLowerCase()]??l.toLowerCase(),r=Ly[s];return r?r().catch(()=>null):null}async function ej(l){const s=(l.split("/").pop()??"").toLowerCase(),r=J1[s]??s.split(".").pop()??"",c=Ly[r];return c?c().catch(()=>null):null}const tj=Oy([{tag:[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 gf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&":s==="<"?"<":">")}async function nj(l,s){const r=s?await P1(s):null;if(!r)return gf(l);try{const c=r.language.parser.parse(l);let o="";return V1(l,c,tj,(d,h)=>{o+=h?`<span class="${h}">${gf(d)}</span>`:gf(d)},()=>{o+=`
|
|
118
|
-
`}),o}catch{return gf(l)}}jt.setOptions({gfm:!0,breaks:!1});function zy(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function Qf(l){const s=await jt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await nj(c.text,c.lang??""),c.escaped=!0}});return k1.sanitize(s)}function bx(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:zy(l.path)}}function Ra(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function lj(l){return l.split("/").pop()??l}function fr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Of(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function sr({x:l,y:s,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,m]=y.useState({left:l,top:s}),[g,b]=y.useState(()=>{const v=r.findIndex(E=>!E.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const E=v.getBoundingClientRect(),T=8,C=Math.max(T,Math.min(l,window.innerWidth-E.width-T)),L=Math.max(T,Math.min(s,window.innerHeight-E.height-T));m({left:C,top:L})},[l,s]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(T){var C;(C=d.current)!=null&&C.contains(T.target)||o()}function E(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",E,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",E,!0)}},[o]);function _(v){v.disabled||(v.onSelect(),o())}function S(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const E=r.map((T,C)=>({item:T,index:C})).filter(T=>!T.item.disabled);if(E.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,C=E.findIndex($=>$.index===g),L=E[(((C===-1?0:C)+T)%E.length+E.length)%E.length];L&&b(L.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=r[g];T&&_(T)}}}return i.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:S,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,E)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(E===g?" is-cursor":""),onMouseEnter:()=>b(E),onClick:()=>_(v),children:[i.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&i.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const sj=3500,aj=9e3,xx=220;function mr({result:l,onDismiss:s}){const[r,c]=y.useState(l),[o,d]=y.useState(!1);if(y.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?sj:aj,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+xx);return()=>{clearTimeout(g),clearTimeout(b)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},xx)};return i.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&i.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&s&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function na({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=y.useState(l),m=y.useRef(null);y.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===l)return o();c(b)}return i.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:b=>h(b.target.value),onBlur:g,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),o())}})}function Sc({active:l}){return l?i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 5h3V2"}),i.jsx("path",{d:"M14 5h-3V2"}),i.jsx("path",{d:"M2 11h3v3"}),i.jsx("path",{d:"M14 11h-3v3"})]}):i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 2H2v3"}),i.jsx("path",{d:"M11 2h3v3"}),i.jsx("path",{d:"M2 11v3h3"}),i.jsx("path",{d:"M14 11v3h-3"})]})}const ij=500,tr="application/x-ccv-fs-path",rj=200;function cj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:_,onOpen:S,onCreate:v,onRename:E,onMove:T,onCopy:C,onDelete:L,onRefresh:$,onClose:J,zoomed:G,onToggleZoom:O}){const[Z,M]=y.useState(""),[D,H]=y.useState(null),[ne,he]=y.useState(null),[W,ue]=y.useState(null),[je,Me]=y.useState(null),[Ce,A]=y.useState(null),[ce,z]=y.useState(null),be=$f("(hover: hover)"),ye=y.useRef(null),N=y.useMemo(()=>fj(d),[d]);function V(le){return!(!W||le===W.path||W.kind==="dir"&&le.startsWith(`${W.path}/`)||le===fr(W.path))}function re(le){return!(!Ce||le===Ce.path||Ce.kind==="dir"&&le.startsWith(`${Ce.path}/`)||Ce.mode==="cut"&&le===fr(Ce.path))}function me(le){A({path:le.path,kind:le.kind,mode:"copy"})}function Ne(le){A({path:le.path,kind:le.kind,mode:"cut"})}function ve(le){!Ce||!re(le)||(le&&!r.has(le)&&_(le),Ce.mode==="cut"?(T(Ce.path,le),A(null)):C(Ce.path,le))}function De(le,ge){const He=le.touches[0];if(!He)return;const B={timer:0,x:He.clientX,y:He.clientY,el:le.currentTarget,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,ge(B.x,B.y,B.el)},ij),ye.current=B}function yt(le){const ge=ye.current,He=le.touches[0];!ge||!He||Math.hypot(He.clientX-ge.x,He.clientY-ge.y)>10&&(window.clearTimeout(ge.timer),ye.current=null)}function $e(le){const ge=ye.current;ge&&(window.clearTimeout(ge.timer),ge.fired&&le.preventDefault())}function Xe(){var le;return(le=ye.current)!=null&&le.fired?(ye.current=null,!0):!1}function Ve(le,ge,He,B){M((B==null?void 0:B.path)??""),z({x:le,y:ge,opener:He,entry:B})}function It(){const le=ce==null?void 0:ce.opener;z(null),le!=null&&le.isConnected&&le.focus()}function rt(le){return{onContextMenu:ge=>{ge.preventDefault(),Ve(ge.clientX,ge.clientY,ge.currentTarget,le)},onTouchStart:ge=>De(ge,(He,B,P)=>Ve(He,B,P,le)),onTouchMove:yt,onTouchEnd:$e,onTouchCancel:$e}}function dn(le){le.target===le.currentTarget&&(le.preventDefault(),Ve(le.clientX,le.clientY,le.currentTarget,null))}function ft(le){le.target===le.currentTarget&&De(le,(ge,He,B)=>Ve(ge,He,B,null))}function hn(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const ge=le.key.toLowerCase();if(ge==="v"){le.preventDefault(),ve(Dn());return}if(!Z)return;const He=yx(s,Z);He&&(ge==="c"?(le.preventDefault(),me(He)):ge==="x"&&(le.preventDefault(),Ne(He)))}function Sn(le){return ge=>{ge.dataTransfer.effectAllowed="move",ge.dataTransfer.setData(tr,le.path),ue({path:le.path,kind:le.kind})}}function xn(){ue(null),Me(null)}function en(le){return ge=>{ge.dataTransfer.types.includes(tr)&&(ge.stopPropagation(),!(le.kind!=="dir"||!V(le.path))&&(ge.preventDefault(),Me(le.path)))}}function tt(le){return ge=>{if(!ge.dataTransfer.types.includes(tr)||(ge.stopPropagation(),le.kind!=="dir"||!V(le.path)))return;ge.preventDefault();const He=ge.dataTransfer.getData(tr);Me(null),He&&T(He,le.path)}}function et(le){!le.dataTransfer.types.includes(tr)||!V("")||(le.preventDefault(),Me(""))}function tn(le){if(!le.dataTransfer.types.includes(tr)||!V(""))return;le.preventDefault();const ge=le.dataTransfer.getData(tr);Me(null),ge&&T(ge,"")}const[$t,nt]=y.useState(""),St=$t.trim(),Xt=St.length>0,cn=y.useRef(null),wt=y.useRef(g);wt.current=g;function yn(le){nt(le),cn.current&&clearTimeout(cn.current);const ge=le.trim();if(!ge){wt.current("");return}cn.current=setTimeout(()=>wt.current(ge),rj)}function qt(le){cn.current&&clearTimeout(cn.current),nt(""),wt.current(""),M(le.path),b(le)}const pn=Xt&&(m==null?void 0:m.query)===St?m:null;function Dn(){if(Z==="")return"";const le=yx(s,Z);if((le==null?void 0:le.kind)==="dir")return Z;const ge=Z.lastIndexOf("/");return ge===-1?"":Z.slice(0,ge)}function Gt(le,ge){const He=ge??Dn();He&&!r.has(He)&&_(He),he({parent:He,kind:le})}function ct(){if(!ce)return[];const le=B=>be?B:void 0;if(!ce.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:le("Ctrl+V"),disabled:!re(""),onSelect:()=>ve("")},{id:"new-file",label:"Создать файл",onSelect:()=>Gt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Gt("dir","")}];const ge=ce.entry,He=[ge.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>S(ge.path)}:{id:"toggle",label:r.has(ge.path)?"Свернуть":"Развернуть",onSelect:()=>_(ge.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>me(ge)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>Ne(ge)}];return ge.kind==="dir"&&(He.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!re(ge.path),onSelect:()=>ve(ge.path)}),He.push({id:"new-file",label:"Создать файл",onSelect:()=>Gt("file",ge.path)}),He.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Gt("dir",ge.path)})),He.push({id:"rename",label:"Переименовать",onSelect:()=>H(ge.path)}),He.push({id:"delete",label:"Удалить",onSelect:()=>L(ge)}),He}const Et=Xt?[]:Pe("",0);function Pe(le,ge){const He=s[le],B=[];if(ne&&ne.parent===le&&B.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:Da(ge),children:[i.jsx("span",{className:"fsrow__icon",children:ne.kind==="dir"?i.jsx(qf,{}):i.jsx(Gf,{})}),i.jsx(na,{className:"rename--file",value:"",placeholder:ne.kind==="dir"?"имя каталога":"имя файла",onCommit:P=>{he(null),v(le,ne.kind,P)},onCancel:()=>he(null)})]},`draft:${le}`)),!He)return B.push(i.jsx("p",{className:"fsrow__pending",style:Da(ge),children:"читаем…"},`wait:${le}`)),B;He.length===0&&!ne&&B.push(i.jsx("p",{className:"fsrow__pending",style:Da(ge),children:"пусто"},`empty:${le}`));for(const P of He){const _e=P.kind==="dir"&&r.has(P.path);B.push(D===P.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:Da(ge),children:[i.jsx("span",{className:"fsrow__icon",children:P.kind==="dir"?i.jsx(qf,{open:_e}):i.jsx(Gf,{})}),i.jsx(na,{className:"rename--file",value:P.name,placeholder:"новое имя",onCommit:Be=>{H(null),E(P.path,Be)},onCancel:()=>H(null)})]},P.path):i.jsx(oj,{entry:P,depth:ge,open:_e,active:P.path===c,selected:P.path===Z,dirty:o.has(P.path),gitStatus:N.get(P.path),dragging:(W==null?void 0:W.path)===P.path,dropTarget:je===P.path,cut:(Ce==null?void 0:Ce.mode)==="cut"&&Ce.path===P.path,onClick:()=>{Xe()||(M(P.path),P.kind==="dir"?_(P.path):S(P.path))},onRename:()=>H(P.path),onDelete:()=>L(P),onDragStart:Sn(P),onDragEnd:xn,onDragOver:en(P),onDrop:tt(P),...rt(P)},P.path)),_e&&B.push(...Pe(P.path,ge+1))}return B}function wl(){if(!pn)return[i.jsx("p",{className:"fsrow__pending",style:Da(0),children:"ищем…"},"search:wait")];if(pn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:Da(0),children:"ничего не найдено"},"search:empty")];const le=pn.entries.map(ge=>i.jsx(uj,{entry:ge,gitStatus:N.get(ge.path),onClick:()=>qt(ge)},ge.path));return pn.truncated&&le.push(i.jsxs("p",{className:"fsrow__pending",style:Da(0),children:["показаны первые ",pn.entries.length," — уточните запрос"]},"search:truncated")),le}return i.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(G?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:hn,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{O&&(le.target.closest("button")||O())},children:[i.jsx(mj,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Gt("file"),children:i.jsx(hj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Gt("dir"),children:i.jsx(pj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:$,children:"↻"}),O&&i.jsx("button",{className:"sidepane__btn",title:G?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":G?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":G,onClick:O,children:i.jsx(Sc,{active:G})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:J,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(gj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:$t,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>yn(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),$t?yn(""):le.currentTarget.blur())}}),$t&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>yn(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(je===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:et,onDrop:tn,onContextMenu:dn,onTouchStart:ft,onTouchMove:yt,onTouchEnd:$e,onTouchCancel:$e,children:Xt?wl():Et}),i.jsx(mr,{result:h}),ce&&i.jsx(sr,{x:ce.x,y:ce.y,items:ct(),onClose:It})]})}function oj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:_,onRename:S,onDelete:v,onDragStart:E,onDragEnd:T,onDragOver:C,onDrop:L,onContextMenu:$,onTouchStart:J,onTouchMove:G,onTouchEnd:O,onTouchCancel:Z}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return i.jsxs("div",{className:M,style:Da(s),draggable:!0,onDragStart:E,onDragEnd:T,onDragOver:C,onDrop:L,onContextMenu:$,onTouchStart:J,onTouchMove:G,onTouchEnd:O,onTouchCancel:Z,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:Uy(l),children:[i.jsx("span",{className:"fsrow__icon"+If("fsrow__icon",h),children:l.kind==="dir"?i.jsx(qf,{open:r}):i.jsx(Gf,{})}),i.jsx("span",{className:"fsrow__name"+If("fsrow__name",h),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&i.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),i.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${l.name}`,onClick:S,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function uj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Da(0),onClick:r,title:Uy(l),children:[i.jsx("span",{className:"fsrow__icon"+If("fsrow__icon",s),children:l.kind==="dir"?i.jsx(qf,{}):i.jsx(Gf,{})}),i.jsx("span",{className:"fsrow__name"+If("fsrow__name",s),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function Uy(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Da(l){return{"--depth":l}}function yx(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function fj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=dj(o.status);if(!d)continue;c(o.path,d);let h=fr(o.path);for(;c(h,d),!!h;)h=fr(h)}return s}function dj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function If(l,s){return s?` ${l}--git-${s}`:""}function qf({open:l=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?i.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):i.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function Gf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]})}function hj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function pj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:i.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function mj(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),i.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function gj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const bj=200;function xj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=y.useState(""),b=m.trim(),_=b.length>0,S=y.useRef(null),v=y.useRef(r);v.current=r;function E(L){g(L),S.current&&clearTimeout(S.current);const $=L.trim();if(!$){v.current("");return}S.current=setTimeout(()=>v.current($),bj)}const T=_&&(s==null?void 0:s.query)===b?s:null;function C(){if(!T)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(T.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const L=[];let $="";for(const J of T.matches)J.path!==$&&($=J.path,L.push(i.jsx("p",{className:"searchgroup__path",title:J.path,children:J.path},`path:${J.path}`))),L.push(i.jsx(yj,{match:J,onClick:()=>c(J)},`${J.path}:${J.line}:${J.column}`));return T.truncated&&L.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),L}return i.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:L=>{h&&(L.target.closest("button")||h())},children:[i.jsx(_j,{}),i.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&i.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Sc,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(vj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:L=>E(L.target.value),onKeyDown:L=>{L.stopPropagation(),L.key==="Escape"&&(L.preventDefault(),m?E(""):L.currentTarget.blur())}}),m&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>E(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?C():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function yj({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return i.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:l.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function _j(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function vj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let bf=null;function jj(){return bf||(bf=Promise.all([Ke(()=>import("./index-DoqmNDN4.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Ke(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Ke(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Ke(()=>import("./index-CNQ0551W.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ke(()=>import("./codemirror-CkgU8c7a.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw bf=null,l})),bf}function Sj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),m=y.useRef(null),g=y.useRef(null),b=y.useRef(new Map),_=y.useRef(new Map),S=y.useRef(new Set),v=y.useRef(null),E=y.useRef(o),T=y.useRef(d),C=y.useRef(l),L=y.useRef(r),$=y.useRef(s);E.current=o,T.current=d,C.current=l,L.current=r,$.current=s;const[J,G]=y.useState("loading"),[O,Z]=y.useState(!1);function M(H,ne,he,W,ue){const je=b.current.get(W),Me=_.current.get(W)===ue;if(je&&Me)he.setState(je);else{const A=H.EditorState.create({doc:$.current,extensions:[H.basicSetup,H.Prec.highest(H.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(C.current),!0)}])),H.keymap.of([H.indentWithTab]),ne.of([]),H.editorTheme,H.editorHighlight,H.EditorView.updateListener.of(ce=>{ce.docChanged&&E.current(C.current,ce.state.doc.toString())})]});b.current.set(W,A),_.current.set(W,ue),he.setState(A),S.current.delete(W)}if(S.current.has(W))return()=>{};let Ce=!1;return ej(W).then(A=>{Ce||!A||C.current!==W||(he.dispatch({effects:ne.reconfigure(A)}),b.current.set(W,he.state),S.current.add(W))}),()=>{Ce=!0}}y.useEffect(()=>{if(!h.current)return;let ne=!1,he=null,W=null;G("loading"),Z(!1);const ue=window.setTimeout(()=>{ne||Z(!0)},200);return(async()=>{let je;try{je=await jj()}catch{window.clearTimeout(ue),ne||G("error");return}if(ne||!h.current)return;window.clearTimeout(ue);const Me=new je.Compartment;v.current=Me,g.current=je,W=new je.EditorView({parent:h.current}),m.current=W,he=M(je,Me,W,C.current,L.current),G("ready")})(),()=>{ne=!0,window.clearTimeout(ue),he==null||he(),W==null||W.destroy(),m.current===W&&(m.current=null),g.current=null,v.current=null}},[]),y.useEffect(()=>{const H=g.current,ne=m.current,he=v.current;if(!(!H||!ne||!he))return M(H,he,ne,l,r)},[l,r]);const D=y.useRef(0);return y.useEffect(()=>{const H=m.current,ne=g.current;if(!H||!ne||!c||c.token===D.current)return;D.current=c.token;const he=H.state.doc.lines,W=Math.min(Math.max(c.line,1),he),ue=H.state.doc.line(W),je=Math.min(ue.from+Math.max(c.column-1,0),ue.to);H.dispatch({selection:ne.EditorSelection.cursor(je),effects:ne.EditorView.scrollIntoView(je,{y:"center"})}),H.focus()},[c]),y.useEffect(()=>()=>{const H=m.current;H&&b.current.set(l,H.state)},[l]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(J==="ready"?"":" is-hidden")}),J==="loading"&&O&&i.jsxs("div",{className:"editor__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),J==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:s})]})]})}function Cs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=y.useState(!1),[b,_]=y.useState(0),S=y.useRef(null),v=y.useRef(null),E=s.find(L=>L.value===l)??null;y.useEffect(()=>{if(!m)return;const L=s.findIndex($=>$.value===l);_(L===-1?0:L)},[m]),y.useEffect(()=>{if(!m)return;function L($){var J;(J=S.current)!=null&&J.contains($.target)||g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[m]),y.useEffect(()=>{var L,$;m&&(($=(L=v.current)==null?void 0:L.querySelector(".is-cursor"))==null||$.scrollIntoView({block:"nearest"}))},[m,b]),y.useEffect(()=>{if(!m)return;const L=v.current,$=wj(S.current);if(!L||!$)return;const J=L.getBoundingClientRect().bottom-$.getBoundingClientRect().bottom;J>0&&($.scrollTop+=Math.min(J+8,L.offsetHeight))},[m]);function T(L){g(!1),L.value!==l&&r(L.value)}function C(L){if(L.key==="Escape"){if(!m)return;L.preventDefault(),L.stopPropagation(),g(!1);return}if(L.key==="ArrowDown"||L.key==="ArrowUp"){if(L.preventDefault(),!m)return g(!0);const $=L.key==="ArrowDown"?1:s.length-1;return _(J=>(J+$)%s.length)}if(L.key==="Enter"||L.key===" "){if(L.preventDefault(),!m)return g(!0);const $=s[b];$&&T($)}}return i.jsxs("div",{ref:S,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(L=>!L),onKeyDown:C,children:[i.jsx("span",{className:"select__value",children:(E==null?void 0:E.label)??h}),i.jsx(kj,{})]}),m&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((L,$)=>i.jsxs("button",{type:"button",role:"option","aria-selected":L.value===l,className:"select__option"+($===b?" is-cursor":"")+(L.value===l?" is-on":""),onMouseEnter:()=>_($),onClick:()=>T(L),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:L.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:L.label}),L.hint&&i.jsx("span",{className:"select__hint",children:L.hint})]},L.value))})]})}function wj(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function kj(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function Tj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M4.6 6.6h4"})]})}function Ej(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),i.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function Cj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){y.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=Aj(r,s);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Of(d),"). Лимит — 64 МБ."]})}):c?i.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[i.jsx("p",{className:"mediaview__error",children:c}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(l),children:"Повторить"})]}):m?s.startsWith("image/")?i.jsx(Rj,{url:m}):s.startsWith("video/")?i.jsx(Oj,{url:m}):null:i.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[i.jsx("div",{className:"mediaview__progress",children:i.jsx("div",{className:"mediaview__progress-fill"})}),i.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function Aj(l,s){const[r,c]=y.useState(null);return y.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Ni=1,Hy=8,xf=1.25;function Mj(l){return Math.min(Hy,Math.max(Ni,l))}function Rj({url:l}){const[s,r]=y.useState({scale:Ni,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function m(E,T,C){r(L=>{const $=Mj(L.scale*E);if($===L.scale)return L;if($<=Ni)return{scale:Ni,x:0,y:0};const J=(T-L.x)/L.scale,G=(C-L.y)/L.scale;return{scale:$,x:T-$*J,y:C-$*G}})}y.useEffect(()=>{const E=d.current;if(!E)return;function T(C){C.preventDefault();const L=E.getBoundingClientRect(),$=C.clientX-L.left-L.width/2,J=C.clientY-L.top-L.height/2;m(C.deltaY<0?xf:1/xf,$,J)}return E.addEventListener("wheel",T,{passive:!1}),()=>E.removeEventListener("wheel",T)},[]);function g(E){s.scale<=Ni||(E.currentTarget.setPointerCapture(E.pointerId),h.current={pointerId:E.pointerId,startX:E.clientX,startY:E.clientY,origX:s.x,origY:s.y},o(!0))}function b(E){const T=h.current;!T||T.pointerId!==E.pointerId||r(C=>({...C,x:T.origX+(E.clientX-T.startX),y:T.origY+(E.clientY-T.startY)}))}function _(){h.current=null,o(!1)}const S=s.scale>Ni,v=!S&&s.x===0&&s.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(S?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:b,onPointerUp:_,onPointerCancel:_,children:i.jsx("img",{src:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Ni,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/xf,0,0),children:i.jsx(Tj,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:s.scale>=Hy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(xf,0,0),children:i.jsx(Nj,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Ni,x:0,y:0}),children:i.jsx(Ej,{})})]})]})}const Dj=[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× — обычная"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"2",label:"2×"}];function Oj({url:l}){const s=y.useRef(null),[r,c]=y.useState("1");return y.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(Cs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Dj})]})]})}function Lj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=Ra(l),b=zy(l.path)&&!l.binary&&!l.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:l.path,children:l.path}),i.jsxs("span",{className:"editor__meta",children:[Of(l.size),l.eol==="crlf"&&" · CRLF"]}),b&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?i.jsx(Cj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Of(l.size)," на диске."]}):l.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Of(l.size),"). Такие правит агент, а не браузер."]}):b&&l.previewMode?i.jsx(zj,{text:l.text}):i.jsx(Sj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function zj({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Qf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function Uj({files:l,activePath:s,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[i.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&i.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),l.map(m=>i.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:lj(m.path)}),Ra(m)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Sc,{active:d})})]})}function os(l){return l.claudeSessionId??l.id}function yf(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),d=[],h=[];for(const m of l)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function _x(l){return l.state!=="closed"}function vx(l){return[...l.filter(_x),...l.filter(s=>!_x(s))]}function _f(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),s,...o.slice(d)];return h.every((m,g)=>m===l[g])?null:h}function Ap(l,s,r,c){const o=l%10,d=l%100;return o===1&&d!==11?s:o>=2&&o<=4&&(d<12||d>14)?r:c}function By(l){return`${l} ${Ap(l,"агент","агента","агентов")}`}function Hj(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(By(s)),r>0&&c.push(`${r} ${Ap(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Bj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function Ij(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function qj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Gj({tasks:l,onStop:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(()=>Date.now()),[h,m]=y.useState(()=>new Set);y.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),y.useEffect(()=>{m(b=>{const _=new Set(l.map(v=>v.id)),S=new Set([...b].filter(v=>_.has(v)));return S.size===b.size?b:S})},[l]);const g=b=>{m(_=>new Set(_).add(b)),s(b),window.setTimeout(()=>{m(_=>{if(!_.has(b))return _;const S=new Set(_);return S.delete(b),S})},1e4)};return i.jsxs("div",{className:r?"tasks is-open":"tasks",children:[i.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(b=>!b),children:[i.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),i.jsx("span",{className:"tasks__summary",children:Hj(l)}),i.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&i.jsx("ul",{className:"tasks__list",id:"tasks-list",children:l.map(b=>{const _=h.has(b.id);return i.jsxs("li",{className:_?"task is-stopping":"task",children:[i.jsxs("div",{className:"task__main",children:[i.jsxs("div",{className:"task__head",children:[i.jsx("span",{className:"task__kind",children:Bj(b)}),b.background&&i.jsx("span",{className:"task__bg",children:"фон"}),i.jsx("span",{className:"task__time",children:Ij(o-b.startedAt)})]}),i.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&i.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),i.jsxs("div",{className:"task__stats",children:[qj(b.tokens)," · ",b.toolUses," ",Ap(b.toolUses,"вызов","вызова","вызовов")]})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:_?"Останавливается":"Стоп"})]},b.id)})})]})}const Yj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Iy({className:l}){return i.jsx("img",{src:Yj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const $j=450,Xj=6,vf=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Vj({disabled:l,onStart:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(0),[h,m]=y.useState({left:0,top:0}),g=y.useRef(null),b=y.useRef(null),_=y.useRef(null);function S(){_.current&&window.clearTimeout(_.current.timer),_.current=null}function v(){S(),d(0),c(!0)}function E(M){var D;c(!1),M&&((D=g.current)==null||D.focus())}function T(M){if(l||M.button!==0)return;const D={timer:0,x:M.clientX,y:M.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,v()},$j),_.current=D}function C(M){const D=_.current;!D||D.fired||Math.hypot(M.clientX-D.x,M.clientY-D.y)>Xj&&S()}function L(){_.current&&!_.current.fired&&S()}function $(M){var D;if((D=_.current)!=null&&D.fired){_.current=null,M.preventDefault();return}l||s("claude")}function J(M){M.preventDefault(),!l&&v()}function G(M){if(l)return;(M.key==="ArrowDown"||M.key==="ArrowUp"||M.key==="Enter"&&M.shiftKey)&&(M.preventDefault(),v())}y.useLayoutEffect(()=>{if(!r)return;const M=g.current,D=b.current;if(!M||!D)return;const H=M.getBoundingClientRect(),ne=D.getBoundingClientRect(),he=8,W=Math.max(he,Math.min(H.right-ne.width,window.innerWidth-ne.width-he));let ue=H.top-ne.height-8;ue<he&&(ue=Math.min(H.bottom+8,window.innerHeight-ne.height-he)),m({left:W,top:ue})},[r]),y.useLayoutEffect(()=>{var M;r&&((M=b.current)==null||M.focus())},[r]),y.useLayoutEffect(()=>{if(!r)return;function M(D){var ne,he;const H=D.target;!((ne=b.current)!=null&&ne.contains(H))&&!((he=g.current)!=null&&he.contains(H))&&E(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[r]);function O(M){E(!1),s(M.id)}function Z(M){if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),E(!0);return}if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const D=M.key==="ArrowDown"?1:-1;d(H=>(H+D+vf.length)%vf.length);return}if(M.key==="Enter"||M.key===" "){M.preventDefault();const D=vf[o];D&&O(D);return}M.key==="Tab"&&E(!1)}return i.jsxs("div",{className:"newsession",children:[i.jsxs("button",{ref:g,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:"Удерживайте, чтобы выбрать агента","aria-haspopup":"menu","aria-expanded":r,onClick:$,onContextMenu:J,onPointerDown:T,onPointerMove:C,onPointerUp:L,onPointerCancel:L,onPointerLeave:L,onKeyDown:G,children:["+ Сессия",i.jsx(Qj,{})]}),r&&i.jsx("div",{ref:b,className:"newsession__menu",style:{left:h.left,top:h.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Z,children:vf.map((M,D)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(D===o?" is-cursor":""),onMouseEnter:()=>d(D),onClick:()=>O(M),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${M.id}`,"aria-hidden":"true",children:M.id==="antigravity"?i.jsx(Iy,{className:"newsession__mark-logo"}):i.jsx(Kj,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:M.label}),i.jsx("span",{className:"newsession__hint",children:M.hint})]})]},M.id))})]})}function Qj(){return i.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Kj(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const qy="ccv:sidebar.collapsed",Gy="ccv:sidebar.mode",Yy="ccv:sidebar.foldersCollapsed",Zj=500,Xh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function Fj({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,sessions:g,archived:b,pinned:_,live:S,listOrder:v,liveSessionsFirst:E,onReorder:T,activeWorkspaceId:C,activeSessionId:L,onSelectWorkspace:$,onSelectSession:J,onRenameSession:G,onStopSession:O,onPinSessions:Z,onSelectPinned:M,onCloseWorkspaces:D,onRestoreWorkspaces:H,onArchiveSessions:ne,onUnarchiveSessions:he,onCreateFolder:W,onRenameFolder:ue,onDeleteFolder:je,onAssignToFolder:Me,onOpenWorkspace:Ce,onNewSession:A,onOpenExtensions:ce,account:z,onOpenAccount:be,relay:ye,onOpenRelay:N,onOpenSettings:V,themeMode:re,onCycleTheme:me}){var dt;const[Ne,ve]=y.useState(null),[De,yt]=y.useState(null),[$e,Xe]=y.useState(null),[Ve,It]=y.useState(""),[rt,dn]=y.useState(uS),[ft,hn]=y.useState(fS),[Sn,xn]=y.useState(dS);function en(w){xn(w);try{localStorage.setItem(Gy,w)}catch{}}const tt=Ve.trim().toLowerCase(),et=tt!=="",tn=y.useMemo(()=>yf(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),$t=y.useMemo(()=>{const w=yf(g,C?v==null?void 0:v.sessions[C]:void 0,os,"top");return E?vx(w):w},[g,v,C,E]),nt=y.useMemo(()=>{const w=yf(_,v==null?void 0:v.pinned,os,"bottom");return E?vx(w):w},[_,v,E]),St=y.useMemo(()=>yf(S,v==null?void 0:v.live,os,"bottom"),[S,v]),Xt=y.useMemo(()=>et?tn.filter(w=>w.name.toLowerCase().includes(tt)||w.path.toLowerCase().includes(tt)):tn,[tn,tt,et]),cn=y.useMemo(()=>et?o.filter(w=>w.name.toLowerCase().includes(tt)||w.path.toLowerCase().includes(tt)):o,[o,tt,et]),wt=y.useMemo(()=>et?$t.filter(w=>(w.title??"").toLowerCase().includes(tt)):$t,[$t,tt,et]),yn=y.useMemo(()=>et?b.filter(w=>(w.title??"").toLowerCase().includes(tt)):b,[b,tt,et]),qt=w=>{var se;return((se=c.find(ke=>ke.id===w))==null?void 0:se.name)??"—"},pn=w=>{var se;return(se=c.find(ke=>ke.id===w))==null?void 0:se.path},Dn=y.useMemo(()=>et?nt.filter(w=>(w.title??"").toLowerCase().includes(tt)||qt(w.workspaceId).toLowerCase().includes(tt)):nt,[nt,c,tt,et]),Gt=y.useMemo(()=>et?St.filter(w=>(w.title??"").toLowerCase().includes(tt)||qt(w.workspaceId).toLowerCase().includes(tt)):St,[St,c,tt,et]),ct=!et;function Et(w){dn(se=>{const ke=se.includes(w)?se.filter(Je=>Je!==w):[...se,w];try{localStorage.setItem(qy,JSON.stringify(ke))}catch{}return ke})}const Pe=w=>!rt.includes(w);function wl(w){hn(se=>{const ke=se.includes(w)?se.filter(Je=>Je!==w):[...se,w];try{localStorage.setItem(Yy,JSON.stringify(ke))}catch{}return ke})}const le=w=>!ft.includes(w),ge=y.useMemo(()=>Ro(Xt,d),[Xt,d]),He=y.useMemo(()=>Ro(cn,d),[cn,d]),B=y.useMemo(()=>Ro(wt,h),[wt,h]),P=y.useMemo(()=>Ro(yn,h),[yn,h]),_e=y.useMemo(()=>Ro(Dn,m,w=>w.pinnedFolderId),[Dn,m]),Be=y.useMemo(()=>({groups:[],ungrouped:Gt}),[Gt]),Ot=((v==null?void 0:v.workspaces.length)??0)>0,fl=C?(((dt=v==null?void 0:v.sessions[C])==null?void 0:dt.length)??0)>0:!1,On=((v==null?void 0:v.pinned.length)??0)>0,dl=((v==null?void 0:v.live.length)??0)>0,sl=jf({enabled:ct,scope:"workspaces",itemKey:w=>w.id,groups:ge.groups,ungrouped:ge.ungrouped,onReorder:T}),Bl=jf({enabled:ct,scope:"sessions",workspaceId:C??void 0,itemKey:os,groups:B.groups,ungrouped:B.ungrouped,onReorder:T}),ds=jf({enabled:ct,scope:"pinned",itemKey:os,groups:_e.groups,ungrouped:_e.ungrouped,onReorder:T}),hl=jf({enabled:ct,scope:"live",itemKey:os,groups:Be.groups,ungrouped:Be.ungrouped,onReorder:T}),al=Qh(Xt),pl=Qh(cn),Yt=Qh(wt),[Vt,kl]=y.useState(null),[kt,Qt]=y.useState(null),[Oe,Ct]=y.useState(null),[qn,nn]=y.useState(null),[Ln,il]=y.useState(null),wn=y.useRef(null);function Il(w,se){const ke=w.touches[0];if(!ke)return;const Je={timer:0,x:ke.clientX,y:ke.clientY,el:w.currentTarget,fired:!1};Je.timer=window.setTimeout(()=>{Je.fired=!0,se(Je.x,Je.y,Je.el)},Zj),wn.current=Je}function rl(w){const se=wn.current,ke=w.touches[0];!se||!ke||Math.hypot(ke.clientX-se.x,ke.clientY-se.y)>10&&(window.clearTimeout(se.timer),wn.current=null)}function ln(w){const se=wn.current;se&&(window.clearTimeout(se.timer),se.fired&&w.preventDefault())}function Kt(){var w;return(w=wn.current)!=null&&w.fired?(wn.current=null,!0):!1}function on(){const w=Vt==null?void 0:Vt.opener;kl(null),w!=null&&w.isConnected&&w.focus()}function Fe(){const w=kt==null?void 0:kt.opener;Qt(null),w!=null&&w.isConnected&&w.focus()}function ml(){const w=Oe==null?void 0:Oe.opener;Ct(null),w!=null&&w.isConnected&&w.focus()}function Ms(){const w=qn==null?void 0:qn.opener;nn(null),w!=null&&w.isConnected&&w.focus()}function Gn(){const w=Ln==null?void 0:Ln.opener;il(null),w!=null&&w.isConnected&&w.focus()}function Zl(w){return{onContextMenu:se=>{se.preventDefault(),kl({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:al.targetsFor(w)})},onTouchStart:se=>Il(se,(ke,Je,ht)=>kl({x:ke,y:Je,opener:ht,ids:al.targetsFor(w)})),onTouchMove:rl,onTouchEnd:ln,onTouchCancel:ln}}function hs(w){return{onContextMenu:se=>{se.preventDefault(),Qt({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:pl.targetsFor(w)})},onTouchStart:se=>Il(se,(ke,Je,ht)=>Qt({x:ke,y:Je,opener:ht,ids:pl.targetsFor(w)})),onTouchMove:rl,onTouchEnd:ln,onTouchCancel:ln}}function ps(w){return{onContextMenu:se=>{se.preventDefault(),Ct({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:Yt.targetsFor(w)})},onTouchStart:se=>Il(se,(ke,Je,ht)=>Ct({x:ke,y:Je,opener:ht,ids:Yt.targetsFor(w)})),onTouchMove:rl,onTouchEnd:ln,onTouchCancel:ln}}function mn(w){return{onContextMenu:se=>{se.preventDefault(),nn({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:[w.id]})},onTouchStart:se=>Il(se,(ke,Je,ht)=>nn({x:ke,y:Je,opener:ht,ids:[w.id]})),onTouchMove:rl,onTouchEnd:ln,onTouchCancel:ln}}function Fl(w){return{onContextMenu:se=>{se.preventDefault(),il({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:[w.id]})},onTouchStart:se=>Il(se,(ke,Je,ht)=>il({x:ke,y:Je,opener:ht,ids:[w.id]})),onTouchMove:rl,onTouchEnd:ln,onTouchCancel:ln}}const Zn=g.filter(w=>w.state!=="closed").length,zn=Vt?Xt.find(w=>w.id===Vt.ids[0]):void 0,kn=Vt?[{id:"close",label:Vt.ids.length>1?`Закрыть проекты (${Vt.ids.length})`:"Закрыть проект",onSelect:()=>{D(Vt.ids),al.clear()}},...Do({folders:d,ids:Vt.ids,hasFolder:(zn==null?void 0:zn.folderId)!=null,assign:(w,se)=>Me("workspace",w,se),onClear:()=>al.clear(),onNewFolder:()=>Xe("workspace")}),...Vt.ids.length===1&&ct?sl.menuItems(Vt.ids[0],Ot):[]]:[],Lt=Vt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(C&&Vt.ids.includes(C)&&Zn>0?` в нём сейчас незавершённых сессий: ${Zn} — при закрытии они остановятся на хосте.`:""):void 0,Rs=kt?cn.find(w=>w.id===kt.ids[0]):void 0,Di=kt?[{id:"restore",label:kt.ids.length>1?`Вернуть проекты (${kt.ids.length})`:"Вернуть проект",onSelect:()=>{H(kt.ids),pl.clear()}},...Do({folders:d,ids:kt.ids,hasFolder:(Rs==null?void 0:Rs.folderId)!=null,assign:(w,se)=>Me("workspace",w,se),onClear:()=>pl.clear(),onNewFolder:()=>Xe("workspace")})]:[],Ds=kt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Yn=Oe?wt.find(w=>w.id===Oe.ids[0]):void 0,Nl=(Yn==null?void 0:Yn.pinned)!==!0,La=Oe?[...Oe.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>ve(Oe.ids[0])}]:[],{id:"pin",label:Nl?Oe.ids.length>1?`Закрепить (${Oe.ids.length})`:"Закрепить":Oe.ids.length>1?`Открепить (${Oe.ids.length})`:"Открепить",onSelect:()=>{Yn&&Z(Yn.workspaceId,Oe.ids,Nl),Yt.clear()}},{id:"archive",label:Oe.ids.length>1?`Убрать в архив (${Oe.ids.length})`:"Убрать в архив",onSelect:()=>{ne(C,Oe.ids),Yt.clear()}},...Do({folders:h,ids:Oe.ids,hasFolder:(Yn==null?void 0:Yn.folderId)!=null,assign:(w,se)=>Me("session",w,se,C),onClear:()=>Yt.clear(),onNewFolder:()=>Xe("session")}),...Oe.ids.length===1&&ct&&Yn?Bl.menuItems(os(Yn),fl):[]]:[],Nn=Oe?Xh:void 0,sn=qn?Dn.find(w=>w.id===qn.ids[0]):void 0,Jl=qn?[{id:"rename",label:"Переименовать",onSelect:()=>ve(qn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{sn&&Z(sn.workspaceId,[sn.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{sn&&ne(sn.workspaceId,[sn.id])}},...sn&&sn.workspaceId===C?Do({folders:h,ids:[sn.id],hasFolder:sn.folderId!=null,assign:(w,se)=>Me("session",w,se,sn.workspaceId),onClear:()=>{},onNewFolder:()=>Xe("session")}):[],...eS(sn?Do({folders:m,ids:[sn.id],hasFolder:sn.pinnedFolderId!=null,assign:(w,se)=>Me("pinned",w,se),onClear:()=>{},onNewFolder:()=>Xe("pinned")}):[]),...ct&&sn?ds.menuItems(os(sn),On):[]]:[],lt=Ln?Gt.find(w=>w.id===Ln.ids[0]):void 0,$n=Ln?[{id:"stop",label:"Остановить",onSelect:()=>{lt&&O(lt)}},{id:"rename",label:"Переименовать",onSelect:()=>ve(Ln.ids[0])},{id:"pin",label:(lt==null?void 0:lt.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{lt&&Z(lt.workspaceId,[lt.id],lt.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{lt&&ne(lt.workspaceId,[lt.id])}},...ct&<?hl.menuItems(os(lt),dl):[]]:[];function pe(w){return i.jsxs("div",{"data-row-key":w.id,className:lc(w.id===C,al.selected.includes(w.id))+sl.dropClass(w.id),...Zl(w),children:[ct&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...sl.gripHandlers(w.id),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:se=>{Kt()||al.click(se,w,()=>$(w.id))},onKeyDown:se=>sl.onKeyDown(w.id,se),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:lc(w.id===C,pl.selected.includes(w.id)),...hs(w),children:[i.jsxs("button",{className:"row__main",onClick:se=>{Kt()||pl.click(se,w,()=>$(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:_S(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>H([w.id]),children:"Вернуть"})]},w.id)}function Y(w){const se=os(w);return i.jsx("div",{"data-row-key":se,className:lc(w.id===L,Yt.selected.includes(w.id),w.provider==="antigravity")+Bl.dropClass(se),...Ne===w.id?{}:ps(w),children:Ne===w.id?i.jsx("div",{className:"row__main",children:i.jsx(na,{value:w.title??"",onCommit:ke=>{G(w,ke),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[ct&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Bl.gripHandlers(se),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:ke=>{Kt()||Yt.click(ke,w,()=>J(w))},onKeyDown:ke=>Bl.onKeyDown(se,ke),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:qt(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Kt()||ve(w.id)},children:"✎"})]})},w.id)}function fe(w){return i.jsxs("div",{className:lc(w.id===L,!1,w.provider==="antigravity"),children:[i.jsxs("button",{className:"row__main",onClick:()=>J(w),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:qt(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:yS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>he([w.id]),children:"Вернуть"})]},w.id)}function we(w){const se=os(w);return i.jsx("div",{"data-row-key":se,className:lc(w.id===L,!1,w.provider==="antigravity")+ds.dropClass(se),...Ne===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...mn(w)},children:Ne===w.id?i.jsx("div",{className:"row__main",children:i.jsx(na,{value:w.title??"",onCommit:ke=>{G(w,ke),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[ct&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...ds.gripHandlers(se),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{Kt()||M(w)},onKeyDown:ke=>ds.onKeyDown(se,ke),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:qt(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})},w.id)}function Ae(w){const se=os(w);return i.jsx("div",{"data-row-key":se,className:lc(w.id===L,!1,w.provider==="antigravity")+hl.dropClass(se),...Ne===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Fl(w)},children:Ne===w.id?i.jsx("div",{className:"row__main",children:i.jsx(na,{value:w.title??"",onCommit:ke=>{G(w,ke),ve(null)},onCancel:()=>ve(null)})}):i.jsxs(i.Fragment,{children:[ct&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...hl.gripHandlers(se),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{Kt()||M(w)},onKeyDown:ke=>hl.onKeyDown(se,ke),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:qt(w.workspaceId),projectPath:pn(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:ke=>{ke.stopPropagation(),!Kt()&&O(w)},children:i.jsx(iS,{})})]})},w.id)}function ze(w,se){return i.jsx(aS,{folder:w,count:se,open:le(w.id),renaming:De===w.id,onToggle:()=>wl(w.id),onStartRename:()=>yt(w.id),onCommitRename:ke=>{ue(w.id,ke),yt(null)},onCancelRename:()=>yt(null),onDelete:()=>je(w.id)},w.id)}return i.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:s?"dot dot--on":"dot",title:r}),i.jsx("span",{className:"brand",children:"Claude Code Visual"}),i.jsx("button",{className:"theme-btn",title:`Тема: ${Sx[re]}`,"aria-label":`Тема: ${Sx[re]}. Переключить`,onClick:me,children:i.jsx(hS,{mode:re})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":Sn==="default",className:Sn==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>en("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":Sn==="pinned",className:Sn==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>en("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":Sn==="live",className:Sn==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>en("live"),children:[i.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),S.length>0&&i.jsx("span",{className:"sidebar__tab-count",children:S.length})]})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(cS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:Ve,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>It(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),Ve?It(""):w.currentTarget.blur())}}),Ve&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>It(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:Sn==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(sc,{title:"Закреплённые",count:Dn.length,open:Pe("pinned"),onToggle:()=>Et("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{Xe("pinned"),Pe("pinned")||Et("pinned")}}}),Pe("pinned")&&i.jsxs(i.Fragment,{children:[$e==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(na,{value:"",placeholder:"Название папки",onCommit:w=>{W("pinned",w),Xe(null)},onCancel:()=>Xe(null)})})}),Dn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:et?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),_e.groups.map(w=>i.jsxs(y.Fragment,{children:[ze(w.folder,w.items.length),le(w.folder.id)&&w.items.map(se=>we(se))]},w.folder.id)),_e.ungrouped.map(w=>we(w))]})]}):Sn==="live"?i.jsxs(i.Fragment,{children:[i.jsx(sc,{title:"Запущенные",count:Gt.length,open:Pe("live"),onToggle:()=>Et("live")}),Pe("live")&&i.jsxs(i.Fragment,{children:[Gt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:et?"Ничего не найдено":"Нет запущенных сессий"})}),Gt.map(w=>Ae(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(sc,{title:"Проекты",count:Xt.length,open:Pe("workspaces"),onToggle:()=>Et("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{Xe("workspace"),Pe("workspaces")||Et("workspaces")}}}),Pe("workspaces")&&i.jsxs(i.Fragment,{children:[$e==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(na,{value:"",placeholder:"Название папки",onCommit:w=>{W("workspace",w),Xe(null)},onCancel:()=>Xe(null)})})}),Xt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:et?"Ничего не найдено":"Пока ни одного"})}),ge.groups.map(w=>i.jsxs(y.Fragment,{children:[ze(w.folder,w.items.length),le(w.folder.id)&&w.items.map(se=>pe(se))]},w.folder.id)),ge.ungrouped.map(w=>pe(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(sc,{title:"Архив проектов",count:cn.length,open:Pe("workspacesArchive"),onToggle:()=>Et("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),Pe("workspacesArchive")&&i.jsxs(i.Fragment,{children:[cn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:et?"Ничего не найдено":"Пока пусто"})}),He.groups.map(w=>i.jsxs(y.Fragment,{children:[ze(w.folder,w.items.length),le(w.folder.id)&&w.items.map(se=>k(se))]},w.folder.id)),He.ungrouped.map(w=>k(w))]})]}),C&&i.jsxs(i.Fragment,{children:[i.jsx(sc,{title:"Сессии",count:wt.length,open:Pe("sessions"),onToggle:()=>Et("sessions"),action:{label:"Новая папка сессий",onClick:()=>{Xe("session"),Pe("sessions")||Et("sessions")}}}),Pe("sessions")&&i.jsxs(i.Fragment,{children:[$e==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(na,{value:"",placeholder:"Название папки",onCommit:w=>{W("session",w,C),Xe(null)},onCancel:()=>Xe(null)})})}),wt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:et?"Ничего не найдено":"Пока ни одной"})}),B.groups.map(w=>i.jsxs(y.Fragment,{children:[ze(w.folder,w.items.length),le(w.folder.id)&&w.items.map(se=>Y(se))]},w.folder.id)),B.ungrouped.map(w=>Y(w))]}),b.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(sc,{title:"Архив",count:yn.length,open:Pe("archive"),onToggle:()=>Et("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Pe("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),yn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:et?"Ничего не найдено":"Пока пусто"})}),P.groups.map(w=>i.jsxs(y.Fragment,{children:[ze(w.folder,w.items.length),le(w.folder.id)&&w.items.map(se=>fe(se))]},w.folder.id)),P.ungrouped.map(w=>fe(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:be,children:[i.jsx("span",{className:z!=null&&z.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:z===null?"Аккаунт":z.loggedIn?z.email||"Вход выполнен":"Войти в аккаунт"}),(z==null?void 0:z.plan)&&i.jsx("span",{className:"chip",children:z.plan})]}),N&&i.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:N,children:[i.jsx("span",{className:ye!=null&&ye.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:ye===null?"Удалённый доступ":ye.paired?ye.connected?ye.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(ye==null?void 0:ye.connected)&&ye.clients>0&&i.jsx("span",{className:"chip",children:ye.clients})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",disabled:!ce,title:"MCP-серверы и плагины",onClick:()=>ce==null?void 0:ce(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:V,children:"Настройки"})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",onClick:Ce,children:"+ Проект"}),i.jsx(Vj,{disabled:!C,onStart:A})]})]}),Vt&&i.jsx(sr,{x:Vt.x,y:Vt.y,items:kn,note:Lt,onClose:on}),kt&&i.jsx(sr,{x:kt.x,y:kt.y,items:Di,note:Ds,onClose:Fe}),Oe&&i.jsx(sr,{x:Oe.x,y:Oe.y,items:La,note:Nn,onClose:ml}),qn&&i.jsx(sr,{x:qn.x,y:qn.y,items:Jl,note:Xh,onClose:Ms}),Ln&&i.jsx(sr,{x:Ln.x,y:Ln.y,items:$n,note:Xh,onClose:Gn})]})}function lc(l,s,r){const c=["row"];return l&&c.push("row--active"),s&&c.push("row--selected"),r&&c.push("row--antigravity"),c.join(" ")}function Ro(l,s,r=c=>c.folderId){const c=new Map(s.map(m=>[m.id,m])),o=new Map,d=[];for(const m of l){const g=r(m),b=g?c.get(g):void 0;if(!b){d.push(m);continue}const _=o.get(b.id);_?_.push(m):o.set(b.id,[m])}return{groups:[...o.entries()].map(([m,g])=>({folder:c.get(m),items:g})).sort((m,g)=>m.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:d}}function Jj(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const Wj="\0ungrouped";function Pj(l,s,r){const c=new Map;for(const o of l)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of s)c.set(r(o),Wj);return c}function Vh(l,s,r,c,o){const d=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!d)return null;const h=d.findIndex(m=>c(m)===l);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function jf(l){const[s,r]=y.useState(null),[c,o]=y.useState(null),d=y.useMemo(()=>Jj(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=y.useMemo(()=>Pj(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g($,J){l.enabled&&(J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId),r($),o(null))}function b($,J){var D;if(!s)return;const G=(D=document.elementFromPoint($,J))==null?void 0:D.closest("[data-row-key]"),O=G==null?void 0:G.dataset.rowKey;if(!O||O===s||h.get(O)!==h.get(s)){o(null);return}const Z=G.getBoundingClientRect(),M=J-Z.top<Z.height/2?"before":"after";o(H=>(H==null?void 0:H.key)===O&&H.position===M?H:{key:O,position:M})}function _($){b($.clientX,$.clientY)}function S(){if(s&&c){const $=_f(d,s,c.key,c.position);$&&l.onReorder(l.scope,$,l.workspaceId)}m()}function v($,J){if(!l.enabled)return;const G=Vh($,l.groups,l.ungrouped,l.itemKey,J);if(!G)return;const O=_f(d,$,G.target,G.position);O&&l.onReorder(l.scope,O,l.workspaceId)}function E($,J){const G=Vh($,l.groups,l.ungrouped,l.itemKey,"up"),O=Vh($,l.groups,l.ungrouped,l.itemKey,"down"),Z=[{id:"move-up",label:"Переместить выше",disabled:!G,onSelect:()=>{if(!G)return;const M=_f(d,$,G.target,G.position);M&&l.onReorder(l.scope,M,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!O,onSelect:()=>{if(!O)return;const M=_f(d,$,O.target,O.position);M&&l.onReorder(l.scope,M,l.workspaceId)}}];return J&&Z.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),Z}function T($){return s===$?" row--dragging":(c==null?void 0:c.key)===$?c.position==="before"?" row--drop-before":" row--drop-after":""}function C($){return{onPointerDown:J=>g($,J),onPointerMove:_,onPointerUp:S,onPointerCancel:m}}function L($,J){!J.altKey||J.key!=="ArrowUp"&&J.key!=="ArrowDown"||(J.preventDefault(),v($,J.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:T,gripHandlers:C,onKeyDown:L,menuItems:E}}function Do(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function eS(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Qh(l){const[s,r]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(_=>_.includes(g.id)?_.filter(S=>S!==g.id):[..._,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const _=l.findIndex(v=>v.id===c.current),S=l.findIndex(v=>v.id===g.id);if(_!==-1&&S!==-1){const[v,E]=_<S?[_,S]:[S,_];r(l.slice(v,E+1).map(T=>T.id));return}}o(),c.current=g.id,b()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const tS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},nS={width:22,height:22,borderRadius:6};function sc({title:l,count:s,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:tS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx($y,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:l}),i.jsx("span",{className:"sidebar__count",children:s})]}),d&&i.jsx("button",{className:"theme-btn",style:nS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(oS,{})})]})}const jx={paddingLeft:22},lS={display:"flex",alignItems:"center",gap:6,width:"100%"},sS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function aS({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g}){return c?i.jsx("div",{className:"row",style:jx,children:i.jsx("div",{className:"row__main",children:i.jsx(na,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):i.jsxs("div",{className:"row",style:jx,children:[i.jsxs("button",{className:"row__main",style:lS,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[i.jsx($y,{open:r}),i.jsx("span",{style:sS,children:l.name}),i.jsx("span",{className:"sidebar__count",children:s})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:d,children:"✎"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:g,children:"✕"})]})}function $y({open:l}){return i.jsx("svg",{className:l?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Sf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function iS(){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 rS({className:l}){return i.jsxs("svg",{className:l,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),i.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),i.jsx("path",{d:"M8 12.2v1.4"})]})}function cS(){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 oS(){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 uS(){try{const l=localStorage.getItem(qy);if(l===null)return["archive","workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function fS(){try{const l=localStorage.getItem(Yy);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function dS(){try{const l=localStorage.getItem(Gy);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Sx={system:"как в системе",light:"светлая",dark:"тёмная"};function hS({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?i.jsx("svg",{...s,children:i.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):l==="light"?i.jsxs("svg",{...s,children:[i.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),i.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):i.jsxs("svg",{...s,children:[i.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),i.jsx("path",{d:"M5.6 13.4h4.8"})]})}function pS(l){const s=mS(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${By(r)}`:s}function mS(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":gS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function gS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function bS(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":xS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function xS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Kh({session:l,tail:s}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${bS(l)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),pS(l)]})," · ",s]})}function wf({title:l,pinned:s,provider:r,projectName:c,projectPath:o}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[s&&i.jsx(rS,{className:"row__pin"}),r==="antigravity"&&i.jsx(Iy,{className:"row__provider"}),l]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function yS(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function _S(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const wx=3,vS=15e5;function Xy(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=Zh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=kS(jS(Zh(r.old_string),Zh(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function Zh(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function jS(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(d),...SS(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function SS(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(_=>({type:"add",text:_}));if(s.length===0)return l.map(_=>({type:"del",text:_}));if((l.length+1)*(s.length+1)>vS)return[...l.map(_=>({type:"del",text:_})),...s.map(_=>({type:"add",text:_}))];const r=l.length,c=s.length,o=c+1,d=new Uint32Array((r+1)*o),h=(_,S)=>d[_*o+S]??0;for(let _=r-1;_>=0;_--)for(let S=c-1;S>=0;S--)d[_*o+S]=l[_]===s[S]?h(_+1,S+1)+1:Math.max(h(_+1,S),h(_,S+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const _=l[g],S=s[b];_===S?(m.push({type:"ctx",text:_}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:_}),g++):(m.push({type:"add",text:S}),b++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;b<c;)m.push({type:"add",text:s[b++]});return wS(m)}function wS(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function kS(l){if(!l.some(d=>d.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-wx);m<=Math.min(l.length-1,h+wx);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${NS(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function NS(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function vc(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function hp(){try{return await navigator.clipboard.readText()}catch{return null}}const Mp=1600,dr="Копировать",fc="Скопировано";function Rp({text:l,hint:s,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Mp);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[l]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?fc:`${dr} ${s}`,title:c?fc:`${dr} ${s}`,onClick:()=>{vc(l).then(d=>{d&&o(!0)})},children:c?fc:dr})}function Dp({diff:l}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&i.jsx("div",{className:"diff__note",children:l.note}),i.jsx("div",{className:"diff__body",children:l.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>i.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function TS({waiting:l}){const[s,r]=y.useState(0);return y.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),i.jsxs("div",{className:l?"work work--wait":"work",children:[i.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:l?"ждёт разрешения":"думает"}),!l&&i.jsxs("span",{className:"work__time",children:[s," с"]})]})}function Op({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),S=y.useRef(null),v=y.useRef(!0),E=y.useRef(null),T=y.useRef(null),C=y.useRef(!1);y.useEffect(()=>{v.current=!0,E.current=null,C.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[m]),y.useEffect(()=>{const O=_.current,Z=S.current;if(!O||!Z)return;function M(ne){!O||ne===O.scrollTop||(C.current=!0,O.scrollTop=ne)}function D(){if(!O)return;const ne=E.current;if(ne){const he=Nx(O,ne.id);if(he){const W=he.getBoundingClientRect().top-O.getBoundingClientRect().top;M(O.scrollTop+(W-ne.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{E.current=null},500);return}v.current&&M(O.scrollHeight)}const H=new ResizeObserver(D);return H.observe(Z),()=>{H.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function L(){const O=_.current;if(O){if(C.current){C.current=!1;return}v.current=O.scrollHeight-O.scrollTop-O.clientHeight<80}}function $(){if(d)return;const O=_.current,Z=c[0];if(O&&Z){const M=Nx(O,Z.id);M&&(E.current={id:Z.id,top:M.getBoundingClientRect().top-O.getBoundingClientRect().top})}h==null||h()}let J=0;function G(O){return O.kind==="user"?J++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:L,children:i.jsxs("div",{className:"stream",ref:S,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:$,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(O=>i.jsx(kx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),c.length>0&&l.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&i.jsx("p",{className:"empty",children:b}),l.map(O=>i.jsx(kx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),s&&i.jsx(TS,{waiting:r})]})})}function kx({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return i.jsx(CS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[i.jsx(AS,{text:l.text}),l.streaming&&i.jsx("span",{className:"caret"}),l.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(Rp,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return i.jsx(RS,{item:l});case"result":return i.jsxs("div",{className:"result-line","data-item-id":l.id,children:[i.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),i.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&i.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",Ex(l.inputTokens)," ↓",Ex(l.outputTokens)]})]});case"notice":return i.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const ES=500;function CS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[m,g]=y.useState(l.text),b=y.useRef(null),_=$f("(max-width: 860px)"),S=y.useRef(null);function v(D,H){o({x:D,y:H})}function E(D){D.preventDefault(),v(D.clientX,D.clientY)}function T(D){const H=D.touches[0];if(!H)return;const ne={timer:0,x:H.clientX,y:H.clientY,fired:!1};ne.timer=window.setTimeout(()=>{ne.fired=!0,v(ne.x,ne.y)},ES),S.current=ne}function C(D){const H=S.current,ne=D.touches[0];!H||!ne||Math.hypot(ne.clientX-H.x,ne.clientY-H.y)>10&&(window.clearTimeout(H.timer),S.current=null)}function L(D){const H=S.current;H&&(window.clearTimeout(H.timer),H.fired&&D.preventDefault())}function $(){g(l.text),h(!0)}function J(){h(!1)}function G(){const D=m.trim();D===""&&!(l.images&&l.images.length>0)||(r==null||r(s,D,l.images),h(!1))}y.useEffect(()=>{const D=b.current;!D||!d||(D.style.height="auto",D.style.height=`${D.scrollHeight}px`)},[m,d]),y.useEffect(()=>{if(!d)return;const D=b.current;D&&(D.focus(),D.setSelectionRange(D.value.length,D.value.length))},[d]);function O(D){if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),J();return}D.key==="Enter"&&!D.shiftKey&&!_&&(D.preventDefault(),G())}const Z=l.images&&l.images.length>0&&i.jsx("div",{className:"msg--user__images",children:l.images.map((D,H)=>i.jsx("img",{className:"msg--user__image",src:`data:${D.mediaType};base64,${D.data}`,alt:"Вложение"},H))});if(d){const D=m.trim()!==""||!!(l.images&&l.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[Z,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:H=>g(H.target.value),onKeyDown:O,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:J,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:G,disabled:!D,children:"Сохранить"})]})]})]})}const M=[{id:"copy",label:"Копировать",onSelect:()=>void vc(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:$}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:E,onTouchStart:T,onTouchMove:C,onTouchEnd:L,onTouchCancel:L,children:[Z,l.text,c&&i.jsx(sr,{x:c.x,y:c.y,items:M,onClose:()=>o(null)})]})}function Nx(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function AS({text:l}){const[s,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return Qf(l).then(h=>{d||r(MS(h))}),()=>{d=!0}},[l]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((b=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:b.textContent)??"";m!==""&&vc(m).then(_=>{if(!_)return;h.textContent=fc,h.setAttribute("aria-label",fc),h.classList.add("copybtn--done");const S=window.setTimeout(()=>{h.isConnected&&(h.textContent=dr,h.setAttribute("aria-label",pp),h.classList.remove("copybtn--done"))},Mp);c.current.push(S)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const pp=`${dr} блок кода`;function MS(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",pp),o.title=pp,o.textContent=dr,c.append(o)}return s.body.innerHTML}function RS({item:l}){const[s,r]=y.useState(!1),c=l.result===null,o=Xy(l.name,l.input),d=l.name==="AskUserQuestion"?LS(l.input):null;return i.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[i.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__name",children:l.name}),i.jsx("span",{className:"tool__arg",children:d?OS(d):DS(l.input)}),i.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(zS,{questions:d,answers:l.answers}):o?i.jsx(Dp,{diff:o}):i.jsx(Tx,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&i.jsx(Tx,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Tx({text:l,hint:s,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:l}),i.jsx(Rp,{text:l,hint:s,className:"codeblock__copy"})]})}function DS(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function OS(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function LS(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const b of h){if(typeof b!="object"||b===null)return null;const{label:_,description:S,preview:v}=b;if(typeof _!="string"||typeof S!="string")return null;g.push({label:_,description:S,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function zS({questions:l,answers:s}){return i.jsx("div",{className:"tool__questions",children:l.map((r,c)=>i.jsxs("div",{className:"tool__question",children:[i.jsxs("div",{className:"tool__question-head",children:[r.header&&i.jsx("span",{className:"chip chip--accent",children:r.header}),i.jsx("span",{className:"tool__question-text",children:r.question})]}),i.jsx("div",{className:"tool__question-answer",children:s!=null&&s[r.question]?i.jsx("span",{className:"tool__answer-value",children:s[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Ex(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const US="ccv.dictation.lang",Cx="ru-RU";function HS(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Ax(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(HS);return!r&&s.length>0&&Ns("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function Vy(){var l;try{return((l=localStorage.getItem(US))==null?void 0:l.trim())||Cx}catch{return Cx}}function Ns(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const BS=3,IS=400,qS=5,GS=250,YS=2e3,$S=2e4;async function XS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const VS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Vy()}`};function QS(l){const[s]=y.useState(()=>Ax()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),m=y.useRef(!1),g=y.useRef(!1),b=y.useRef(l),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),S=y.useRef(null),v=y.useRef(!1),E=y.useRef(null),T=y.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=null},[]),C=y.useCallback(()=>{T();const O=async Z=>{if(E.current=null,!(!m.current||v.current)){if(!Z&&!await XS()){if(Ns("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;E.current=setTimeout(()=>void O(!0),$S);return}Ns("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};E.current=setTimeout(()=>void O(!1),YS)},[T]);y.useEffect(()=>{b.current=l}),y.useEffect(()=>{const O=Ax();if(!O)return;const Z=new O;return Z.lang=Vy(),Z.continuous=!0,Z.interimResults=!0,Z.onstart=()=>{Ns("сессия открыта"),v.current=!0,T(),c(!0)},Z.onaudiostart=()=>{Ns("пошёл звук с микрофона"),_.current.audio=!0},Z.onresult=M=>{var he;if(g.current)return;let D="",H="";for(let W=M.resultIndex;W<M.results.length;W++){const ue=M.results[W];if(!ue)continue;const je=((he=ue[0])==null?void 0:he.transcript)??"";ue.isFinal?D+=je:H+=je}const ne=_.current;ne.heard=!0,ne.everHeard=!0,Ns("распознано",{final:D,interim:H}),b.current(D,H)},Z.onerror=M=>{_.current.lastError=M.error,Ns("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(VS[M.error]??`Распознавание не работает: ${M.error}`))},Z.onend=()=>{g.current=!1,v.current=!1;const M=_.current,D=Date.now()-M.openedAt;if(Ns("сессия закрыта",{мс:D,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&D<IS?M.dead+1:0,M.dead>=qS){m.current=!1,c(!1),d(M.lastError?`Распознавание не работает: ${M.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}M.silent=M.heard?0:M.silent+1,!M.everHeard&&!M.warned&&M.silent>=BS&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),S.current=setTimeout(()=>{if(S.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",C();try{Z.start()}catch{}}},GS)},h.current=Z,()=>{m.current=!1,S.current&&clearTimeout(S.current),S.current=null,T(),Z.onend=null,Z.onresult=null,Z.onerror=null,Z.onstart=null,Z.onaudiostart=null,Z.abort(),h.current=null}},[]);const L=y.useCallback(()=>{var O;if(m.current){if(m.current=!1,Ns("выключение микрофона"),S.current&&clearTimeout(S.current),S.current=null,T(),!v.current){c(!1);return}(O=h.current)==null||O.stop()}},[]),$=y.useCallback(()=>{const O=h.current;if(O){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,S.current&&clearTimeout(S.current),S.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Ns("включение микрофона",{язык:O.lang}),C();try{O.start()}catch(Z){Ns("start() не прошёл",Z)}}},[C]),J=y.useCallback(()=>{m.current?L():$()},[$,L]),G=y.useCallback(()=>{var O;m.current&&v.current&&(g.current=!0,(O=h.current)==null||O.abort())},[]);return{supported:s,listening:r,error:o,toggle:J,stop:L,drop:G}}const KS="(max-width: 860px)",Mx=/^\/(\S*)$/,ZS=new Set(["model","permissions"]);function FS(l){return ZS.has(l.name)||l.name.startsWith("__")}const JS=new Set(["clear","rename"]),Rx=/(?:^|\s)@([^\s@]*)$/,WS=200,PS=100,ew=190,tw=5,nw=20*1024*1024,lw=1568,sw=.85;let Dx=0;async function aw(l){var S,v;if(!l.type.startsWith("image/")||l.size>nw)return null;const s=await iw(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,lw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,d.width,d.height),(v=(S=s.image).close)==null||v.call(S);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",b=d.toDataURL(g,m?void 0:sw),_=b.slice(b.indexOf(",")+1);return _?(Dx+=1,{id:`att${Dx}`,mediaType:g,data:_,previewUrl:b}):null}async function iw(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function Qy({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:_=!0,onContextSearch:S,onCommand:v,onSend:E,onInterrupt:T,onEscape:C}){var He;const L=$f(KS),[$,J]=y.useState(()=>m?Lh(m):""),[G,O]=y.useState(!1),[Z,M]=y.useState(0),D=y.useRef(null),H=y.useRef(null),ne=y.useRef(null),[he,W]=y.useState(()=>m?Lh(m).length:0),[ue,je]=y.useState([]),Me=y.useRef(null),Ce=y.useCallback(B=>{!_||B.length===0||Promise.all(B.map(aw)).then(P=>{const _e=P.filter(Be=>Be!==null);_e.length!==0&&je(Be=>[...Be,..._e].slice(0,tw))})},[_]);function A(B){je(P=>P.filter(_e=>_e.id!==B))}function ce(B){var Be;if(!_)return;const P=(Be=B.clipboardData)==null?void 0:Be.items;if(!P)return;const _e=[];for(const Ot of P){if(!Ot.type.startsWith("image/"))continue;const fl=Ot.getAsFile();fl&&_e.push(fl)}_e.length!==0&&(B.preventDefault(),Ce(_e))}function z(B){const P=B.target.files?Array.from(B.target.files):[];B.target.value="",Ce(P)}y.useEffect(()=>{_||je([])},[_]);const[be,ye]=y.useState([]),[N,V]=y.useState(-1),re=y.useRef(""),[me,Ne]=y.useState(""),ve=QS(y.useCallback((B,P)=>{B&&J(_e=>Fh(_e,B)),Ne(P.trim())},[])),De=me?Fh($,me):$;y.useEffect(()=>{ve.listening||me===""||(J(B=>Fh(B,me)),Ne(""))},[ve.listening,me]),y.useEffect(()=>{var B;b&&((B=D.current)==null||B.focus())},[b]);const yt=y.useRef(new Map),$e=y.useRef(new Map),Xe=y.useRef(m),Ve=y.useRef({text:$,caret:he});Ve.current={text:$,caret:he};const It=y.useCallback((B,P,_e)=>{P===""?(yt.current.delete(B),$e.current.delete(B)):(yt.current.set(B,P),$e.current.set(B,_e)),ry(B,P)},[]),rt=ve.drop;y.useLayoutEffect(()=>{const B=Xe.current;if(B===m)return;Xe.current=m,B&&It(B,Ve.current.text,Ve.current.caret);const P=m?yt.current.get(m)??Lh(m):"",_e=m?$e.current.get(m):void 0,Be=Math.min(_e??P.length,P.length);J(P),W(Be),ne.current=[Be,Be],Ne(""),M(0),O(!1),V(-1),re.current="",je([]),rt()},[m,It,rt]),y.useEffect(()=>{m&&It(m,$,he)},[m,$,he,It]);const dn=l?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",ft=y.useRef(0),hn=y.useCallback(B=>{const P=parseFloat(getComputedStyle(B).maxHeight),_e=Number.isFinite(P)&&P>0?P:ew;B.style.height="auto";const Be=B.scrollHeight;B.style.height=`${Math.min(Be,_e)}px`,B.style.overflowY=Be>_e?"auto":"hidden"},[]);y.useEffect(()=>{const B=D.current;B&&hn(B)},[De,dn,l,hn]),y.useLayoutEffect(()=>{const B=D.current,P=ne.current;!B||!P||(ne.current=null,B.setSelectionRange(P[0],P[1]))}),y.useEffect(()=>{const B=D.current;if(!B)return;const P=new ResizeObserver(([_e])=>{const Be=_e==null?void 0:_e.contentRect.width;Be===void 0||Math.abs(Be-ft.current)<1||(ft.current=Be,hn(B))});return P.observe(B),()=>P.disconnect()},[hn]);const Sn=ve.stop;y.useEffect(()=>{l&&Sn()},[l,Sn]);const xn=y.useMemo(()=>ve.error?{ok:!1,message:ve.error}:null,[ve.error]),en=y.useMemo(()=>{var _e;const B=(_e=Mx.exec($))==null?void 0:_e[1];if(B===void 0)return[];const P=B.toLowerCase();return r.filter(Be=>!FS(Be)&&Jh(Be,P)<Ky).sort((Be,Ot)=>Jh(Be,P)-Jh(Ot,P))},[$,r]),tt=!G&&en.length>0,et=Math.min(Z,en.length-1),tn=G?null:((He=Rx.exec(De.slice(0,he)))==null?void 0:He[1])??null,$t=y.useRef(S);$t.current=S,y.useEffect(()=>{if(tn===null||tn===""||tn.endsWith("/")){$t.current(tn);return}const B=setTimeout(()=>$t.current(tn),WS);return()=>clearTimeout(B)},[tn]);const nt=tn!==null&&(o==null?void 0:o.query)===tn,St=nt?o.entries:[],Xt=tn!==null,cn=Xt&&!nt,wt=Math.min(Z,Math.max(St.length-1,0));y.useEffect(()=>{var P,_e;if(!tt&&!Xt)return;const B=tt?et:wt;(_e=(P=H.current)==null?void 0:P.children[B])==null||_e.scrollIntoView({block:"nearest"})},[tt,Xt,et,wt]);function yn(B,P){var _e;J(B),W(P),ne.current=[P,P],M(0),O(!1),me!==""&&(Ne(""),ve.drop()),(_e=D.current)==null||_e.focus()}function qt(){J(""),Ne(""),M(0),W(0),O(!1),V(-1),re.current="",je([]),ve.drop(),m&&It(m,"",0)}function pn(B){const P=B.trim();P===""&&ue.length===0||l||(E(P,ue.length>0?ue.map(_e=>({mediaType:_e.mediaType,data:_e.data})):void 0),P!==""&&ye(_e=>[P,..._e.filter(Be=>Be!==P)].slice(0,PS)),qt())}function Dn(B){if(B<-1||B>=be.length)return;N===-1&&(re.current=$);const P=B===-1?re.current:be[B]??"";V(B),yn(P,P.length)}function Gt(){var Be;const B=((Be=D.current)==null?void 0:Be.selectionStart)??De.length,_e=`${B>0&&!/\s$/.test(De.slice(0,B))?" ":""}@`;yn(De.slice(0,B)+_e+De.slice(B),B+_e.length)}function ct(B){var Ot;const P=(Ot=Rx.exec(De.slice(0,he)))==null?void 0:Ot[1];if(P===void 0)return;const _e=he-P.length-1,Be=B.kind==="dir"?`@${B.path}/`:`@${B.path} `;yn(De.slice(0,_e)+Be+De.slice(he),_e+Be.length)}function Et(){var P;const B=(P=Mx.exec(De.trim()))==null?void 0:P[1];if(B&&v(B)){qt();return}pn(De)}function Pe(B,P){J(B),W(P),M(0),O(!1),V(-1),me!==""&&(Ne(""),ve.drop())}function wl(B){var Be;const P=JS.has(B.name)?c:null,_e=`/${B.name} `;J(_e+(P??"")),W(_e.length+((P==null?void 0:P.length)??0)),P&&(ne.current=[_e.length,_e.length+P.length]),M(0),(Be=D.current)==null||Be.focus()}function le(B){if(v(B.name)){J(""),M(0),O(!1);return}B.argumentHint?wl(B):pn(`/${B.name}`)}function ge(B){if(tt){if(B.key==="ArrowDown")return B.preventDefault(),M(P=>(Math.min(P,en.length-1)+1)%en.length);if(B.key==="ArrowUp"){B.preventDefault();const P=en.length-1;return M(_e=>(Math.min(_e,P)+P)%en.length)}if(B.key==="Enter"&&!B.shiftKey){B.preventDefault();const P=en[et];P&&le(P);return}if(B.key==="Tab"){B.preventDefault();const P=en[et];P&&wl(P);return}if(B.key==="Escape"){B.preventDefault(),B.stopPropagation(),O(!0);return}}if(Xt){if(B.key==="ArrowDown"&&St.length>0)return B.preventDefault(),M(P=>(Math.min(P,St.length-1)+1)%St.length);if(B.key==="ArrowUp"&&St.length>0){B.preventDefault();const P=St.length-1;return M(_e=>(Math.min(_e,P)+P)%St.length)}if(B.key==="Enter"&&!B.shiftKey||B.key==="Tab"){const P=St[wt];if(P){B.preventDefault(),ct(P);return}if(B.key==="Tab")return}if(B.key==="Escape"){B.preventDefault(),B.stopPropagation(),O(!0);return}}if((B.key==="ArrowUp"||B.key==="ArrowDown")&&!B.shiftKey){const P=B.currentTarget,_e=P.selectionStart;if(P.selectionEnd===_e){const Ot=B.key==="ArrowUp"?N+1:N-1;Ot>=-1&&Ot<be.length&&requestAnimationFrame(()=>{P.selectionStart===_e&&P.selectionEnd===_e&&Dn(Ot)})}}if(B.key==="Escape"&&C){B.preventDefault(),B.stopPropagation(),C();return}B.key==="Enter"&&!B.shiftKey&&!L&&(B.preventDefault(),Et())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(mr,{result:xn}),Xt&&!tt&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:H,children:[St.map((B,P)=>i.jsxs("button",{role:"option","aria-selected":P===wt,className:P===wt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(P),onMouseDown:_e=>{_e.preventDefault(),ct(B)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[B.name,B.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:B.path}),B.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},B.path)),St.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:cn?"ищем…":tn?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),tt&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:H,children:en.map((B,P)=>i.jsxs("button",{role:"option","aria-selected":P===et,className:P===et?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(P),onMouseDown:_e=>{_e.preventDefault(),le(B)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",B.name]}),B.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:B.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:B.description})]},B.name))}),ue.length>0&&i.jsx("div",{className:"composer__attachments",children:ue.map(B=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:B.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>A(B.id),children:i.jsx(dw,{})})]},B.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Gt,children:i.jsx(ow,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Me,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:z}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var B;return(B=Me.current)==null?void 0:B.click()},children:i.jsx(fw,{})})]}),i.jsx("textarea",{ref:D,value:De,disabled:l,placeholder:dn,onChange:B=>Pe(B.target.value,B.target.selectionStart),onSelect:B=>W(B.currentTarget.selectionStart),onKeyDown:ge,onPaste:ce}),ve.supported&&i.jsx("button",{type:"button",className:ve.listening?"micbtn is-on":"micbtn",title:ve.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":ve.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":ve.listening,disabled:l,onClick:ve.toggle,children:i.jsx(hw,{on:ve.listening})}),s?i.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Et,disabled:l||De.trim()===""&&ue.length===0,"aria-label":g,title:g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(uw,{})]})]})]})})}function Fh(l,s){const r=s.trim();if(r==="")return l;const c=mp(r).slice(rw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function rw(l,s){const r=mp(l),c=mp(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>cw(d,c[h]??"")))return o;return 0}function mp(l){return l.split(/\s+/).filter(s=>s!=="")}function cw(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function ow(){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 uw(){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 fw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"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 dw(){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 hw({on:l}){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:l?"currentColor":"none"}),i.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),i.jsx("path",{d:"M8 12.8v1.5"})]})}const Ky=4;function Jh(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:Ky}function pw({request:l,queued:s,onDecide:r}){const c=Xy(l.toolName,l.input);return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[i.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&i.jsx("p",{className:"sheet__reason",children:l.reason}),c?i.jsx(Dp,{diff:c}):i.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>r(l.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>r(l.requestId,"allow"),children:"Разрешить"})]})]})})}function mw({request:l,queued:s,onAnswer:r,onDecline:c}){const{questions:o}=l,[d,h]=y.useState(()=>o.map(()=>new Set)),[m,g]=y.useState(()=>o.map(()=>"")),[b,_]=y.useState(()=>Ox(o));y.useEffect(()=>{h(o.map(()=>new Set)),g(o.map(()=>"")),_(Ox(o))},[l.requestId]);const S=y.useMemo(()=>bw(o,d,m),[o,d,m]),v=S!==null;function E(G,O){var Z,M;(M=(Z=o[G])==null?void 0:Z.options[O])!=null&&M.preview&&_(D=>{const H=D.slice();return H[G]=O,H})}function T(G,O,Z){h(M=>{const D=M.slice(),H=new Set(D[G]);return Z?H.has(O)?H.delete(O):H.add(O):H.has(O)||(H.clear(),H.add(O)),D[G]=H,D}),O!=="other"&&E(G,O)}function C(G,O){g(Z=>{const M=Z.slice();return M[G]=O,M})}function L(){S&&r(l.requestId,S)}function $(G){G.key==="Enter"&&(G.target.closest("button")||v&&(G.preventDefault(),L()))}function J(G){var D;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(G.key))return;const O=Array.from(G.currentTarget.querySelectorAll("button.qsheet__option")),Z=O.indexOf(document.activeElement);if(Z===-1)return;G.preventDefault();const M=G.key==="ArrowDown"||G.key==="ArrowRight"?1:-1;(D=O[(Z+M+O.length)%O.length])==null||D.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:$,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,s>0&&` — ещё ${s} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[l.reason&&i.jsx("p",{className:"qsheet__reason",children:l.reason}),o.map((G,O)=>i.jsx(gw,{q:G,qi:O,selected:d[O]??new Set,otherText:m[O]??"",previewIndex:b[O]??null,onToggle:T,onFocusOption:E,onOtherText:C,onOptionsKeyDown:J},O))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>c(l.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:L,children:"Ответить"})]})]})})}function gw({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var E;const b=l.options.some(T=>T.preview),_=o!==null?(E=l.options[o])==null?void 0:E.preview:void 0,S=r.has("other"),v=l.multiSelect?"checkbox":"radio";return i.jsxs("div",{className:"qsheet__question",children:[i.jsxs("div",{className:"qsheet__qhead",children:[i.jsx("span",{className:"chip chip--accent",children:l.header}),i.jsx("span",{className:"qsheet__qtext",children:l.question})]}),i.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((T,C)=>{const L=r.has(C);return i.jsxs("button",{type:"button",role:v,"aria-checked":L,className:"qsheet__option"+(L?" is-selected":""),onClick:()=>d(s,C,l.multiSelect),onFocus:()=>h(s,C),onMouseEnter:()=>h(s,C),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})]})]},C)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":S,className:"qsheet__option qsheet__option--other"+(S?" is-selected":""),onClick:()=>d(s,"other",l.multiSelect),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),i.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),S&&i.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:T=>m(s,T.target.value),autoFocus:!0})]})]}),b&&i.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Ox(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function bw(l,s,r){const c={};for(let o=0;o<l.length;o++){const d=l[o];if(!d)continue;const h=s[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const b=d.options[g];b&&h.has(g)&&m.push(b.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function xw({request:l,plan:s,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(s),[m,g]=y.useState("preview");y.useEffect(()=>{h(s),g("preview")},[l.requestId,s]);const b=d.trim().length>0;function _(){b&&c(l.requestId,d)}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[i.jsxs("div",{className:"plansheet__head",children:[i.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:i.jsx(_w,{})}),i.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),i.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(m==="preview"?" is-on":""),role:"tab","aria-selected":m==="preview",onClick:()=>g("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(m==="source"?" is-on":""),role:"tab","aria-selected":m==="source",onClick:()=>g("source"),children:"Код"})]})]}),i.jsxs("div",{className:"plansheet__body",children:[l.reason&&i.jsx("p",{className:"plansheet__reason",children:l.reason}),i.jsx("div",{className:"plansheet__content",children:m==="preview"?i.jsx(yw,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:S=>h(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(l.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!b,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function yw({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Qf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function _w(){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 vw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function Zy({path:l}){const[s,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!s)return;function m(g){var b;(b=d.current)!=null&&b.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),y.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Mp);return()=>clearTimeout(m)},[c]),y.useEffect(()=>r(!1),[l]);async function h(){await vc(l)&&o(!0)}return i.jsxs("div",{ref:d,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[i.jsx(jw,{open:s}),i.jsx("span",{className:"cwd__short",children:l})]}),s&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:l}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?fc:dr})]})]})}function jw({open:l}){return i.jsx("svg",{className:l?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const Sw=["low","medium","high"];function Fy({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:_,onThinking:S,onSwitchOnFlag:v}){const[E,T]=y.useState(!1),[C,L]=y.useState(0),$=y.useRef(null),J=y.useRef(null),G=l.find(H=>H.value===s)??null,O=G&&G.supportsEffort?G.effortLevels.length>0?G.effortLevels:Sw:[],Z=O.includes("xhigh");y.useEffect(()=>{if(!E)return;const H=l.findIndex(ne=>ne.value===s);L(H===-1?0:H)},[E]),y.useEffect(()=>{if(!E)return;function H(ne){var he;(he=$.current)!=null&&he.contains(ne.target)||T(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[E]),y.useEffect(()=>{var H,ne;E&&((ne=(H=J.current)==null?void 0:H.querySelector(".is-cursor"))==null||ne.scrollIntoView({block:"nearest"}))},[E,C]);function M(H){T(!1),H.value!==s&&g(H.value)}function D(H){if(H.key==="Escape"){if(!E)return;H.preventDefault(),H.stopPropagation(),T(!1);return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){if(H.preventDefault(),!E)return T(!0);if(l.length===0)return;const ne=H.key==="ArrowDown"?1:l.length-1;return L(he=>(he+ne)%l.length)}if(H.key==="Enter"||H.key===" "){if(H.preventDefault(),!E)return T(!0);const ne=l[C];ne&&M(ne)}}return i.jsxs("div",{ref:$,className:"select"+(E?" select--open":"")+(m?` ${m}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":E,onClick:()=>T(H=>!H),onKeyDown:D,children:[(G==null?void 0:G.displayName)??s?i.jsx("span",{className:"select__value",children:(G==null?void 0:G.displayName)??s}):i.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):O.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(ww,{})]}),E&&i.jsxs("div",{ref:J,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((H,ne)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":H.value===s,className:"select__option"+(ne===C?" is-cursor":"")+(H.value===s?" is-on":""),onMouseEnter:()=>L(ne),onClick:()=>M(H),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:H.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:H.displayName}),H.description&&i.jsx("span",{className:"select__hint",children:H.description})]},H.value)),O.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"modelmenu__sep",role:"separator"}),i.jsxs("div",{className:"modelmenu__row",children:[i.jsxs("span",{className:"modelmenu__label",children:["Усилие",i.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),i.jsx("span",{className:"modelmenu__levels",children:O.map(H=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":H===r,className:H===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(H),children:H},H))})]}),Z&&i.jsx(Wh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>_(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(G==null?void 0:G.supportsThinking)!==!1&&i.jsx(Wh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>S(!o)}),h&&i.jsx(Wh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function Wh({label:l,desc:s,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[i.jsxs("span",{className:"modelmenu__label",children:[l,i.jsx("span",{className:"modelmenu__desc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function ww(){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 Sl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const b=h.current;if(!b)return;const _=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),S=_[0],v=_[_.length-1];!S||!v||(g.shiftKey&&document.activeElement===S?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),S.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":l,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:l}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:s}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function kw({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:b,onSubmit:_,onCreate:S,onClose:v}){const[E,T]=y.useState("open"),[C,L]=y.useState(""),[$,J]=y.useState(!1),[G,O]=y.useState(""),[Z,M]=y.useState(""),[D,H]=y.useState({git:!0,claudeMd:!0,readme:!0}),ne=C.trim(),he=ne!=="",W=G.trim(),ue=Z.trim(),je=W!==""&&ue!=="";y.useEffect(()=>{G===""&&d.length>0&&O(d[0])},[d]);const Me=y.useRef(m);Me.current=m,y.useEffect(()=>{if(E!=="open")return;const z=C.trim(),be=setTimeout(()=>Me.current(z),200);return()=>clearTimeout(be)},[C,E]);function Ce(){he&&_(ne)}function A(){je&&S(W,ue,D)}function ce(){he&&(J(!0),g(ne))}return h?i.jsxs(Sl,{title:"Новый проект",onClose:v,actions:i.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[i.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),i.jsx("p",{className:"newproj__preview",children:h.path}),i.jsx("div",{className:"modal__error",children:i.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(z=>i.jsx("li",{children:z},z))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Sl,{title:"Новый проект",className:$&&E==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),E==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:b,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!he,onClick:ce,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!he,onClick:Ce,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!je,onClick:A,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Lx,{label:"Открыть",on:E==="open",onClick:()=>T("open")}),i.jsx(Lx,{label:"Создать",on:E==="create",onClick:()=>T("create")})]}),E==="open"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),i.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),i.jsx("input",{id:"workspace-path",className:"input input--mono",value:C,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:z=>L(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),Ce())}}),o&&i.jsx("p",{className:"modal__error",children:o}),l.length>0&&i.jsx("ul",{className:"finds",children:l.map(z=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:z.open,title:z.open?"Этот проект уже открыт":z.path,onClick:()=>L(z.path),onDoubleClick:()=>_(z.path),children:[i.jsx("span",{className:"find__name",children:z.name}),i.jsx("span",{className:"find__path",children:z.path}),i.jsx("span",{className:"find__note",children:Ew(z)})]})},z.path))}),l.length===0&&he&&!s&&!$&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),$&&i.jsx("div",{className:"finds__agent",children:i.jsx(Op,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),i.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),i.jsx("input",{id:"workspace-parent",className:"input input--mono",value:G,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:z=>O(z.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(z=>i.jsx("button",{type:"button",className:z===W?"newproj__root is-on":"newproj__root",title:z,onClick:()=>O(z),children:Tw(z)},z))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:Z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:z=>M(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),A())}}),i.jsx("p",{className:"newproj__preview",children:je?Nw(W,ue):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Ph,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>H(z=>({...z,git:!z.git}))}),i.jsx(Ph,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>H(z=>({...z,claudeMd:!z.claudeMd}))}),i.jsx(Ph,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>H(z=>({...z,readme:!z.readme}))})]})]})]})}function Lx({label:l,on:s,onClick:r}){return i.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function Ph({label:l,desc:s,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[i.jsxs("span",{className:"newproj__optlabel",children:[l,i.jsx("span",{className:"newproj__optdesc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Nw(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Tw(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function Ew(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Cw(l.sessions)}${Aw(l.lastUsedAt)}`}function Cw(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function Aw(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Lp=7;function Mw(l){const s=[],r=[];let c=1;for(const o of l){const d=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=zx(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let E=s.indexOf(v);E===-1&&(E=zx(s),s[E]=v),b.push({from:h,to:E})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.push({from:v,to:h}),v!==h&&(s[v]=null));const S=[];for(let v=0;v<d.length;v++){const E=d[v];!E||E===o.hash||v===h||s[v]===E&&S.push(v)}Rw(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:_,down:b,through:S})}return{rows:r,columns:Math.min(c,Lp)}}function zx(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Rw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const Jy=1500;function Dw(l){const s=[];let r=!1;for(const c of l.patch.split(`
|
|
119
|
-
`)){if(s.length>=Jy){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:Ow(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:Lw(l,r)}}function Ow(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Lw(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${Jy} строк`),r.length>0?r.join(" · "):null}function zw({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:_,onConnectRemote:S,onDismissResult:v,onClose:E,zoomed:T,onToggleZoom:C}){const L=Mw((s==null?void 0:s.commits)??[]),$=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(J=>({value:J.name,label:J.name,hint:J.hash.slice(0,8)}))];return i.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:J=>{C&&(J.target.closest("button")||C())},children:[i.jsx(qw,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),C&&i.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:C,children:i.jsx(Sc,{active:T})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:E,children:"✕"})]}),s===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"gitbar",children:i.jsx(Cs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:$,onChange:J=>{J&&m(J,`ветку ${J}`)}})}),s.detached&&i.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),i.jsx("div",{className:"gitbar__actions",children:o?i.jsxs("p",{className:"gitbar__busy",children:[i.jsx(Xw,{}),o]}):s.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(Gw,{}),"Отправить",s.ahead>0&&i.jsx("span",{className:"gitbar__count",children:s.ahead})]}),i.jsxs("div",{className:"gitbar__group",children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>b(!0),children:[i.jsx(Yw,{}),"Забрать",s.behind>0&&i.jsx("span",{className:"gitbar__count",children:s.behind})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>b(!1),children:i.jsx($w,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:S,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${Kw(s.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(J=>Qw(J.path)).join(", "):"незакоммиченных изменений нет"})]})}),L.rows.map(J=>i.jsx(Uw,{row:J,columns:L.columns,head:J.commit.hash===s.head,local:s.hasRemote&&!J.commit.pushed,active:c===J.commit.hash,onOpen:()=>h(J.commit.hash)},J.commit.hash)),L.rows.length===0&&i.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):i.jsxs("div",{className:"gitempty",children:[i.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(mr,{result:r,onDismiss:v})]})}const Oo=50,Ux=13;function Uw({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(Vw).filter(Boolean);return i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[i.jsx(Hw,{row:l,columns:s,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[m.map(g=>i.jsx("span",{className:"gitrow__ref",children:g},g)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Zw(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function Hw({row:l,columns:s,head:r,local:c}){const o=s*Ux+6,d=Oo/2,h=b=>8+Math.min(b,Lp-1)*Ux,m=c?"3.5 2.5":void 0,g=kf(l.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:Oo,viewBox:`0 0 ${o} ${Oo}`,"aria-hidden":"true",children:[l.through.map(b=>i.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:Oo,style:{stroke:kf(b)}},`t${b}`)),l.up.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:kf(b.from),strokeDasharray:m}},`u${_}`)),l.down.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${Oo}`,fill:"none",style:{stroke:kf(b.to),strokeDasharray:m}},`d${_}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:d,r:l.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:d,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function kf(l){return`var(--lane-${l%Lp})`}function Bw({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return i.jsxs(Sl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),i.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&i.jsxs("div",{className:"commit__head",children:[i.jsx("p",{className:"commit__subject",children:l.subject}),i.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",Fw(l.date)," ·"," ",i.jsx("span",{className:"commit__hash",children:l.hash})]}),s&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(d=>d.slice(0,8)).join(", ")]}),l.body&&i.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(d=>i.jsx(Iw,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function Iw({file:l,defaultOpen:s}){const[r,c]=y.useState(s);return i.jsxs("div",{className:"commit__file",children:[i.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"commit__filepath",children:l.path||l.oldPath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(Dp,{diff:Dw(l)})]})}function qw(){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 Gw(){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 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 3v10M4.5 9.5 8 13l3.5-3.5"})})}function $w(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"m13 13-2.6-2.6"})]})}function Hx(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function Xw(){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 Vw(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Qw(l){const s=l.split("/");return s[s.length-1]??l}function Kw(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Zw(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(s).toLocaleDateString()}function Fw(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function Bx(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Jw({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:_,onClose:S}){var z;const[v,E]=y.useState(()=>Bx(c)),[T,C]=y.useState(""),[L,$]=y.useState(""),[J,G]=y.useState(!0),[O,Z]=y.useState("Первый коммит"),[M,D]=y.useState(null),[H,ne]=y.useState("");y.useEffect(()=>{!T&&s.length>0&&C(s[0].login)},[T,s]),y.useEffect(()=>{r&&M===null&&D(new Set(r.files))},[r,M]);const he=(l==null?void 0:l.connected)===!0,W=s.map(be=>({value:be.login,label:be.login,hint:be.kind==="org"?"организация":void 0})),ue=y.useMemo(()=>{if(!r)return[];const be=H.trim().toLowerCase();return be?r.files.filter(ye=>ye.toLowerCase().includes(be)):r.files},[r,H]),je=(M==null?void 0:M.size)??0,Me=he&&v.trim()!==""&&T!==""&&d===""&&(o||je>0);function Ce(be){D(ye=>{const N=new Set(ye??[]);return N.has(be)?N.delete(be):N.add(be),N})}function A(be){D(ye=>{const N=new Set(ye??[]);for(const V of ue)be?N.add(V):N.delete(V);return N})}function ce(){if(!Me)return;const be=(r==null?void 0:r.files)??[];b({owner:T,name:v.trim(),description:L.trim(),private:J,include:o?[]:be.filter(ye=>M==null?void 0:M.has(ye)),ignore:o?[]:be.filter(ye=>!(M!=null&&M.has(ye))),message:o?"":O.trim()||"Первый коммит"})}return i.jsxs(Sl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:S,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:S,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!Me,onClick:ce,children:d||"Опубликовать"})]}),children:[i.jsx(Ww,{status:l,onRefreshStatus:m,onSaveToken:g}),i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Имя"}),i.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:be=>E(Bx(be.target.value))})]}),v.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),s.length>1?i.jsx(Cs,{className:"settings__select",value:T,options:W,onChange:C,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((z=s[0])==null?void 0:z.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:L,placeholder:"о чём проект — одной строкой",onChange:be=>$(be.target.value)})]}),i.jsxs("div",{className:"field publish__field",children:[i.jsx("span",{children:"Видимость"}),i.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[i.jsx(Ix,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:J,onClick:()=>G(!0)}),i.jsx(Ix,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!J,onClick:()=>G(!1)})]})]})]}),!o&&i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?i.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"publish__filehead",children:[i.jsxs("span",{className:"publish__filecount",children:[je," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:H,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:be=>ne(be.target.value)}),i.jsx("div",{className:"publish__filelist",children:ue.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ue.map(be=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(be))===!0,className:"publish__file",onClick:()=>Ce(be),children:[i.jsx("span",{className:"publish__box"+(M!=null&&M.has(be)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(be))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:be})]},be))}),r.truncated&&i.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Сообщение коммита"}),i.jsx("input",{className:"input",value:O,onChange:be=>Z(be.target.value)})]})]})]}),i.jsx(mr,{result:h,onDismiss:_})]})}function Ix({title:l,desc:s,on:r,risky:c,onClick:o}){return i.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[l,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:s})]})]})}function Ww({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=y.useState(""),[d,h]=y.useState(!1);return i.jsxs("div",{className:"publish__section publish__section--first",children:[i.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:l.login}),i.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[l.ghInstalled&&i.jsxs("p",{className:"modal__text",children:["В системе установлен ",i.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",i.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Личный токен GitHub"}),i.jsx(Pw,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),i.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",i.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",i.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),l.message&&i.jsx("p",{className:"modal__error",children:l.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Pw({value:l,onChange:s,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return i.jsxs("div",{className:"pwfield",children:[i.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>s(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(tk,{}):i.jsx(ek,{})})]})}function ek(){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 tk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),i.jsx("path",{d:"M2 14 14 2"})]})}function nk({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=y.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(Sl,{title:"Подключить существующий репозиторий",onClose:o,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||l!=="",onClick:()=>r(d.trim()),children:l||"Подключить"})]}),children:[i.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",i.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Адрес репозитория"}),i.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&l===""&&r(d.trim())}})]}),i.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",i.jsx("code",{children:"https://…"}),", ",i.jsx("code",{children:"ssh://…"}),", ",i.jsx("code",{children:"git://…"})," и"," ",i.jsx("code",{children:"git@host:path"}),"."]}),i.jsx(mr,{result:s,onDismiss:c})]})}function lk({open:l,items:s,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:g,effort:b,ultracode:_,thinking:S,switchOnFlag:v,onContextSearch:E,onCommand:T,onModel:C,onEffort:L,onUltracode:$,onThinking:J,onSwitchOnFlag:G,onAsk:O,onInterrupt:Z,onReset:M,onClose:D,zoomed:H,onToggleZoom:ne}){return i.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(H?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:he=>{ne&&(he.target.closest("button")||ne())},children:[i.jsx(sk,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:M,children:"↻"}),ne&&i.jsx("button",{className:"sidepane__btn",title:H?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":H?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":H,onClick:ne,children:i.jsx(Sc,{active:H})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),m.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Fy,{className:"select--compact",models:m,value:g,effort:b,ultracode:_,thinking:S,switchOnFlag:v,onModel:C,onEffort:L,onUltracode:$,onThinking:J,onSwitchOnFlag:G}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(Op,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(Qy,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,onContextSearch:E,onCommand:T,onSend:O,onInterrupt:Z,onEscape:r?Z:D})]})}function sk(){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 ak=75,ik=90;function Wy({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return i.jsx("div",{className:"usage",title:ok(l,s),"aria-label":c,children:r.map(o=>i.jsx(rk,{label:o.label,window:o.window},o.key))})}function rk({label:l,window:s}){const r=Math.round(s.utilization),c=fk(s.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:l}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${ck(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:zp(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function ck(l){return l>=ik?" usage__fill--over":l>=ak?" usage__fill--warn":""}function ok(l,s){if(s.length>0)return uk(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=zp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
|
|
120
|
-
`)}function uk(l){const s=["Квота Antigravity"];for(const r of l){const c=zp(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
|
|
121
|
-
`)}function Py(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function e_(l){return l.getTime()-Date.now()<1440*60*1e3}function fk(l){const s=Py(l);return s?e_(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function zp(l){const s=Py(l);return s?`обнулится ${e_(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function t_(){const[l,s]=y.useState(()=>new Date);return y.useEffect(()=>{let r=0;const c=()=>{const d=new Date;s(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),i.jsxs("time",{className:"clock",dateTime:l.toISOString(),title:dk(l),children:[i.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function dk(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function hk({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:b,onHandoff:_,onFreshSession:S,handoffWriting:v,onStop:E}){const T=my({onLongPress:()=>S==null?void 0:S(),onClick:()=>_==null?void 0:_(),disabled:v});return i.jsx(Sl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:i.jsxs("div",{className:"sessionmenu",children:[s&&i.jsx(ac,{label:"Режим прав",children:s}),i.jsx(ac,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&i.jsx(ac,{label:"Лимиты плана",children:i.jsx(Wy,{usage:c})}),i.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[i.jsx(pk,{}),i.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",g&&i.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsx(ac,{label:"Время",children:i.jsx(t_,{})}),d&&i.jsx(ac,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(ac,{label:"Каталог проекта",children:i.jsx(Zy,{path:o})}),b&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:b,children:"Переименовать сессию"}),_&&i.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":T.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${T.thresholdMs}ms`},"aria-busy":v,disabled:v,...T.handlers,children:[i.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),i.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&i.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),E&&i.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:E,children:"Остановить сессию"})]})})}function ac({label:l,children:s}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function pk(){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 mk({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:m,onClose:g}){const b=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Sl,{title:"Расширения",className:"modal--wide",onClose:g,children:[i.jsx("div",{className:"tabs",role:"tablist",children:b.map(_=>i.jsxs("button",{role:"tab","aria-selected":l===_.id,className:l===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>m(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),l==="mcp"&&i.jsx(gk,{servers:s,actions:h}),l==="plugins"&&i.jsx(vk,{plugins:r,marketplaces:c,actions:h}),l==="catalog"&&i.jsx(jk,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>m("plugins")}),i.jsx(mr,{result:d})]})}function gk({servers:l,actions:s}){const[r,c]=y.useState(!1);return i.jsxs(i.Fragment,{children:[l.length===0&&!r&&i.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",i.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",i.jsx("code",{children:"claude mcp list"}),"."]}),i.jsx("ul",{className:"extlist",children:l.map(o=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:o.name}),i.jsx("span",{className:`chip chip--${xk(o.status)}`,children:bk[o.status]}),o.scope&&i.jsx("span",{className:"chip",children:o.scope}),o.transport&&i.jsx("span",{className:"chip",children:o.transport})]}),o.target&&i.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&i.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&i.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>s.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),r?i.jsx(yk,{onCancel:()=>c(!1),onSubmit:(o,d)=>{s.mcpAdd(o,d),c(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const bk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function xk(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function yk({onSubmit:l,onCancel:s}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,m]=y.useState(""),[g,b]=y.useState(""),[_,S]=y.useState(""),v=o==="stdio",E=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function T(){if(E)if(v){const[C,...L]=_k(h);l(r.trim(),{transport:"stdio",command:C??"",args:L,env:qx(_)})}else l(r.trim(),{transport:o,url:g.trim(),headers:qx(_)})}return i.jsxs("div",{className:"extform extform--card",children:[i.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),i.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:C=>c(C.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Cs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:C=>d(C)}),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:C=>m(C.target.value)})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),i.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:C=>b(C.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:C=>S(C.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!E,onClick:T,children:"Подключить"})]})]})}function qx(l){const s={};for(const r of l.split(`
|
|
122
|
-
`)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function _k(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function vk({plugins:l,marketplaces:s,actions:r}){const[c,o]=y.useState("");return i.jsxs(i.Fragment,{children:[l.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:l.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:d.name}),i.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&i.jsx("span",{className:"chip",children:d.version}),d.scope&&i.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&i.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&i.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),i.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),i.jsx("ul",{className:"extlist",children:s.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsx("div",{className:"extlist__head",children:i.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&i.jsx("div",{className:"extlist__meta",children:d.source}),i.jsx("div",{className:"extlist__actions",children:i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),i.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const Lo=30;function jk({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(Lo),[_,S]=y.useState(""),v=y.useMemo(()=>[...new Set(l.map(C=>C.category).filter(Boolean))].sort(),[l]),E=y.useMemo(()=>{const T=o.trim().toLowerCase();return l.filter(C=>h&&C.category!==h?!1:T?`${C.name} ${C.displayName} ${C.description} ${C.author}`.toLowerCase().includes(T):!0)},[l,o,h]);return l.length===0?i.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",i.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"catalog__filters",children:[i.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:T=>{d(T.target.value),b(Lo)}}),i.jsx(Cs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{m(T),b(Lo)}})]}),E.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:E.slice(0,g).map(T=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&i.jsx("span",{className:"chip",children:T.version}),T.category&&i.jsx("span",{className:"chip",children:T.category})]}),T.description&&i.jsx("div",{className:"catalog__desc",children:T.description}),i.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>r.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),E.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>b(T=>T+Lo),children:["Ещё ",Math.min(Lo,E.length-g)," из ",E.length-g]})}),i.jsxs("div",{className:"extform",children:[i.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>S(T.target.value),onKeyDown:T=>{T.key!=="Enter"||_.trim()===""||(T.preventDefault(),r.pluginInstall(_.trim()),S(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),S("")},children:"Установить"})]})]})]})}function Sk({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[b,_]=y.useState(""),[S,v]=y.useState(!1),[E,T]=y.useState(!1),C=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!E&&!S,L=y.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const G=s.output.trim();return G===""?null:{ok:!0,message:G}},[s.error,s.output]);function $(G=b){const O=G.trim();O!==""&&(r.submitCode(O),_(""))}function J(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return i.jsxs(Sl,{title:"Аккаунт",onClose:g,children:[l===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):l.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:l.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:Nk[l.method]??l.method}),l.plan&&i.jsx("span",{className:"chip",children:l.plan})]}),l.organization&&i.jsx("div",{className:"extlist__meta",children:l.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?i.jsx(Tk,{login:s,remote:c,code:b,onCode:_,onSubmit:$,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(mr,{result:L}),E&&i.jsx("p",{className:"account__warn",role:"alert",children:wk(o)}),C&&h&&i.jsx("p",{className:"account__note",children:m}),i.jsx("div",{className:`extbar${l!=null&&l.loggedIn?" account__bar":""}`,children:l!=null&&l.loggedIn?i.jsxs(i.Fragment,{children:[C&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
123
|
-
${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(kk,{}),"Переподключить"]}),E?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>T(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{T(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:J,children:"Сменить аккаунт"}),S?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{T(!1),v(!0)},children:"Выйти"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function wk(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function 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 Nk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Tk({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,m]=y.useState(null),g=y.useRef(""),b=y.useRef({code:r,onCode:c,onSubmit:o});b.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async C=>{const{code:L,onCode:$,onSubmit:J}=b.current;if(C&&L.trim()!=="")return;const G=await hp();if(G===null){C||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const O=G.trim();if(!Gx(O)){C||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(g.current===O)return;g.current=O}m(null),$(O),J(O)},[]);y.useEffect(()=>{if(!l.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[l.awaitingCode,_]);const S=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!Gx(r),E=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[l.url?s?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:l.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),i.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),i.jsxs("div",{className:"account__raw",children:[i.jsx("span",{className:"account__rawurl",children:l.url}),i.jsx(Rp,{text:l.url,hint:"ссылку входа"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),i.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),i.jsxs("details",{className:"account__fallback",children:[i.jsx("summary",{children:"Браузер не открылся"}),i.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),i.jsx("a",{className:"account__link",href:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.awaitingCode&&i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),i.jsxs("div",{className:"extform__row account__coderow",children:[i.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:C=>{m(null),c(C.target.value)},onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),o())}}),S&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),E&&i.jsx("p",{className:"account__note account__note--code",children:E})]}),l.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:l.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function Gx(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function Ek({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(!1),_=y.useRef(null),S=(l==null?void 0:l.paired)===!0;y.useEffect(()=>{var E;S||(E=_.current)==null||E.focus()},[S]),y.useEffect(()=>{b(!1),S&&d("")},[S,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return i.jsx(Sl,{title:"Удалённый доступ",onClose:c,children:S?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Yx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),i.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),i.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):i.jsxs("div",{className:"relay",children:[i.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),i.jsxs("ol",{className:"relay__steps",children:[i.jsxs("li",{children:["Откройте ",i.jsx("b",{children:Yx(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:E=>{E.preventDefault(),o.trim()&&(b(!0),s(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:E=>d(E.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Как назвать этот компьютер"}),i.jsx("input",{className:"input",value:h,onChange:E=>m(E.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function Yx(l){try{return new URL(l).host}catch{return l}}const ep="",Ck=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Ak=fy.map(l=>({value:l.value,label:l.value,hint:l.hint})),Nf=3600*1e3,Mk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],rc={"6h":6*Nf,"24h":24*Nf,"48h":48*Nf,"168h":168*Nf,never:0};function Rk(l){return rc[l]??rc["48h"]}const Dk=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Tf=60*1e3,cc={"5m":5*Tf,"10m":10*Tf,"30m":30*Tf,"60m":60*Tf,never:0};function Ok(l){return cc[l]??cc["10m"]}function Lk(l){const s=Object.entries(cc).find(([,r])=>r===l);return s?s[0]:Object.keys(cc).reduce((r,c)=>Math.abs(cc[c]-l)<Math.abs(cc[r]-l)?c:r)}function zk(l){const s=Object.entries(rc).find(([,r])=>r===l);return s?s[0]:Object.keys(rc).reduce((r,c)=>Math.abs(rc[c]-l)<Math.abs(rc[r]-l)?c:r)}const Uk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],oc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Hk(l){return oc[l]??oc.off}function $x(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function Bk(l){const s=Object.entries(oc).find(([,r])=>r===l);return s?s[0]:Object.keys(oc).reduce((r,c)=>Math.abs(oc[c]-l)<Math.abs(oc[r]-l)?c:r)}const Ik=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function qk({settings:l,models:s,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:g}){const b=l===null,_=!b&&l.terminalEnabled===!0,S=!b&&l.liveSessionsFirst===!0,v=!_,E=y.useMemo(()=>{const C=[{value:ep,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(L=>({value:L.value,label:L.displayName,hint:L.description})):Ck];return l&&l.startModel!==null&&!C.some(L=>L.value===l.startModel)&&C.push({value:l.startModel,label:l.startModel}),C},[s,l]);function T(){var C,L;return(r==null?void 0:r.paired)!==!0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:m,children:"Связать компьютер"})]}):(C=r.shell)!=null&&C.enabled?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),i.jsx("button",{type:"button",className:"btn btn--danger",disabled:v,onClick:h,children:"Запретить"})]}):(L=r.shell)!=null&&L.pending?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",i.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),i.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Отправить письмо ещё раз"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Разрешить с телефона"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Прислать письмо"})]})]})}return i.jsx(Sl,{title:"Настройки",onClose:g,children:i.jsxs("div",{className:"settings",children:[i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),i.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:zk(l.autoArchiveAfterMs),options:Mk,onChange:C=>o({autoArchiveAfterMs:Rk(C)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:Lk(l.autoStopAfterMs),options:Dk,onChange:C=>o({autoStopAfterMs:Ok(C)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),i.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopFiveHourPct,onChange:C=>o({limitStopFiveHourPct:$x(C.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopSevenDayPct,onChange:C=>o({limitStopSevenDayPct:$x(C.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:Bk(l.autoSaveAfterPauseMs),options:Uk,onChange:C=>o({autoSaveAfterPauseMs:Hk(C)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),i.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Модель"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:l.startModel??ep,options:E,onChange:C=>o({startModel:C===ep?null:C}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:l.startPermissionMode,options:Ak,onChange:C=>o({startPermissionMode:C}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsx("section",{className:"settings__section",children:i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),i.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":S,"aria-label":"Запущенные сессии сверху",className:S?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!S}),children:i.jsx("span",{className:"switch__knob"})})]})}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),i.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),i.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:Ik.map(C=>{const L=!b&&l.folderAccess===C.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:b,className:"access__card"+(L?" is-on":"")+(C.risky?" access__card--risky":""),onClick:()=>o({folderAccess:C.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:[C.title,C.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:C.description})]})]},C.value)})})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Терминал"}),i.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-label":"Терминал",className:_?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!_}),children:i.jsx("span",{className:"switch__knob"})})]}),i.jsxs("div",{className:"settings__nested"+(v?" is-disabled":""),children:[i.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),b?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[v&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),T()]})]})]})]})})}const Xx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Gk(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function Yk({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${Xx[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.stoppedAt).toLocaleString()}`;return i.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[i.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}return i.jsxs("div",{className:"handoff",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[l.limit===null?i.jsxs(i.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):i.jsxs(i.Fragment,{children:[Xx[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",Gk(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,children:"Продолжить в новой сессии"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function $k({handoff:l,onClose:s}){const[r,c]=y.useState("");return y.useEffect(()=>{let o=!1;return Qf(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),i.jsx(Sl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Vx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Xk=12e3;function Vk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function Qk({notices:l,onDismiss:s}){return l.length===0?null:i.jsx("div",{className:"limittoasts",children:l.map(r=>i.jsx(Kk,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function Kk({notice:l,onDismiss:s}){return y.useEffect(()=>{const r=window.setTimeout(s,Xk);return()=>window.clearTimeout(r)},[s]),i.jsxs("div",{className:"limittoast",role:"status",children:[i.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),i.jsx("span",{className:"limittoast__body",children:l.stopped>0?i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",Vk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}const Zk=16;function Fk({pane:l,width:s,onResize:r,onReset:c}){const o=ur[l],d=y.useRef(null);function h(_){if(_.button!==0)return;const S=document.querySelector(".main"),v=S?Math.max(0,S.getBoundingClientRect().width-K0):0;d.current={x:_.clientX,width:s,max:Math.min(o.max,s+v)},_.currentTarget.setPointerCapture(_.pointerId),document.body.classList.add("is-resizing"),_.preventDefault()}function m(_){const S=d.current;if(!S)return;const v=o.side==="left"?_.clientX-S.x:S.x-_.clientX;r(Math.min(S.max,S.width+v))}function g(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function b(_){const S=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;S!==0&&(_.preventDefault(),r(s+S*Zk*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:b,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Jk=16;function Wk({height:l,onResize:s,onReset:r}){const c=y.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const _=b.getBoundingClientRect().height-W0;return Math.round(l+Math.max(0,_))}function d(b){b.button===0&&(c.current={y:b.clientY,height:l,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const _=c.current;if(!_)return;const S=_.y-b.clientY;s(_.height+S,_.max)}function m(b){c.current&&(c.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function g(b){const _=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;_!==0&&(b.preventDefault(),s(l+_*Jk,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":py,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function Qx(){const l=document.documentElement,s=getComputedStyle(l),r=J=>s.getPropertyValue(J).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),_=r("--danger"),S=r("--ok"),v=r("--warn"),E=r("--cm-fn"),T=r("--cm-key"),C=r("--cm-type"),L=Kx(o,c,55),$=J=>Kx(J,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:L,brightBlack:h,red:_,brightRed:$(_),green:S,brightGreen:$(S),yellow:v,brightYellow:$(v),blue:E,brightBlue:$(E),magenta:T,brightMagenta:$(T),cyan:C,brightCyan:$(C),white:d,brightWhite:o}}function Pk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Fs=null;function eN(l){return Fs||(Fs=document.createElement("span"),Fs.style.position="fixed",Fs.style.width="0",Fs.style.height="0",Fs.style.opacity="0",Fs.style.pointerEvents="none",document.body.appendChild(Fs)),Fs.style.color=l,getComputedStyle(Fs).color}function Kx(l,s,r){return eN(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Ef=null;function tN(){return Ef||(Ef=Promise.all([Ke(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Ke(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Ke(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Ke(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Ef=null,l})),Ef}function nN({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:_,onOpen:S,onClose:v,onInput:E,onResize:T,onAttach:C,onHide:L,registerSink:$}){const[J,G]=y.useState(()=>Qx());return y.useEffect(()=>{const O=new MutationObserver(()=>G(Qx()));return O.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>O.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:d},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:O=>{b&&(O.target.closest("button")||b())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(O=>i.jsxs("div",{role:"tab","aria-selected":O.id===s,className:"termtab"+(O.id===s?" is-on":"")+(O.exitCode!==null?" termtab--exited":""),onDoubleClick:Z=>{b&&(Z.target.closest(".termtab__close")||b())},children:[i.jsx("button",{className:"termtab__name",title:O.cwd,onClick:()=>_(O.id),children:O.title}),O.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${O.exitCode}`,children:O.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${O.title}»`,onClick:()=>v(O.id),children:"✕"})]},O.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:S,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),b&&i.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:i.jsx(Sc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:L,children:"✕"})]}),c&&l.length>0&&i.jsx(Zx,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?i.jsx(Zx,{message:c,onRetry:r?null:S,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:S,children:"Открыть терминал"})]}),l.map(O=>i.jsx(sN,{id:O.id,exitCode:O.exitCode,active:O.id===s,theme:J,mobile:m,onInput:E,onResize:T,onAttach:C,registerSink:$},O.id))]})]})}function Zx({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=lN(l);return i.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),d&&i.jsx("p",{className:"termfail__hint",children:d}),h&&i.jsxs("details",{className:"termfail__details",children:[i.jsx("summary",{children:"Подробности"}),i.jsx("pre",{children:h})]})]}),i.jsxs("div",{className:"termfail__bar",children:[r&&i.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),i.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function lN(l){const[s="",...r]=l.trim().split(`
|
|
124
|
-
|
|
125
|
-
`),c=s.split(`
|
|
126
|
-
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??l.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
127
|
-
|
|
128
|
-
`).trim()}}function sN({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=y.useRef(null),_=y.useRef(null),S=y.useRef(!1),v=y.useRef(o);v.current=o;const E=y.useRef(c),T=y.useRef(s),[C,L]=y.useState("loading"),[$,J]=y.useState(!1);return y.useEffect(()=>{if(!b.current)return;let O=!1,Z=null;L("loading"),J(!1);const M=window.setTimeout(()=>{O||J(!0)},200);return(async()=>{var ye;let D;try{D=await tN()}catch{window.clearTimeout(M),O||L("error");return}if(O||!b.current)return;window.clearTimeout(M);const{Terminal:H,FitAddon:ne,WebLinksAddon:he}=D,W=new H({fontFamily:Pk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:E.current}),ue=new ne;W.loadAddon(ue),W.loadAddon(new he),W.open(b.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 re=W.getSelection();return re?(N.preventDefault(),vc(re),!1):!N.shiftKey}return N.key==="v"||N.key==="V"?(N.preventDefault(),hp().then(re=>{re&&W.paste(re)}),!1):!0});const je=N=>{N.preventDefault();const V=W.getSelection();if(V){vc(V),W.clearSelection();return}hp().then(re=>{re&&W.paste(re)})};(ye=W.element)==null||ye.addEventListener("contextmenu",je);const Me=W.onData(N=>d(l,N));let Ce={cols:W.cols,rows:W.rows},A=null;const ce=W.onResize(({cols:N,rows:V})=>{A!==null&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,!(N===Ce.cols&&V===Ce.rows)&&(Ce={cols:N,rows:V},h(l,N,V))},100)}),z=new ResizeObserver(()=>{try{ue.fit()}catch{return}v.current&&W.scrollToBottom()});z.observe(b.current);const be=g(l,N=>{N.kind==="buffer"&&W.reset(),W.write(N.data)});m(l),T.current!==null&&!S.current&&(S.current=!0,W.write(`\r
|
|
129
|
-
\x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
|
|
130
|
-
`)),r&&W.focus(),Z=()=>{var N;A!==null&&window.clearTimeout(A),z.disconnect(),(N=W.element)==null||N.removeEventListener("contextmenu",je),Me.dispose(),ce.dispose(),be(),W.dispose(),_.current=null},L("ready")})(),()=>{O=!0,window.clearTimeout(M),Z==null||Z(),Z=null}},[l]),y.useEffect(()=>{if(!o)return;const G=b.current;if(!G)return;let O=null,Z=0,M=!1;const D=W=>{W.pointerType==="mouse"||O!==null||(O=W.pointerId,Z=W.clientY,M=!1)},H=W=>{if(W.pointerId!==O)return;const ue=Z-W.clientY;if(!M){if(Math.abs(ue)<4)return;M=!0,G.setPointerCapture(W.pointerId)}Z=W.clientY;const je=G.querySelector(".xterm-viewport");je&&(je.scrollTop+=ue)},ne=W=>{W.pointerId===O&&(G.hasPointerCapture(W.pointerId)&&G.releasePointerCapture(W.pointerId),O=null,M=!1)},he=W=>W.stopPropagation();return G.addEventListener("pointerdown",D),G.addEventListener("pointermove",H),G.addEventListener("pointerup",ne),G.addEventListener("pointercancel",ne),G.addEventListener("touchmove",he,{capture:!0}),()=>{G.removeEventListener("pointerdown",D),G.removeEventListener("pointermove",H),G.removeEventListener("pointerup",ne),G.removeEventListener("pointercancel",ne),G.removeEventListener("touchmove",he,{capture:!0}),O!==null&&G.hasPointerCapture(O)&&G.releasePointerCapture(O)}},[o]),y.useEffect(()=>{E.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var G;r&&((G=_.current)==null||G.focus())},[r]),y.useEffect(()=>{if(T.current=s,s===null){S.current=!1;return}if(S.current)return;const G=_.current;G&&(S.current=!0,G.write(`\r
|
|
131
|
-
\x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
|
|
132
|
-
`))},[s]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:b,className:"termview__surface"+(C==="ready"?"":" is-hidden")}),C==="loading"&&$&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),C==="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 aN=2e5,iN=75,rN=90;function cN({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??aN,o=Math.min(100,Math.round(l/c*100)),d=`${l.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
133
|
-
обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return i.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[i.jsx("span",{className:"contextbar__label",children:"контекст"}),i.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`contextbar__fill${oN(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function oN(l){return l>=rN?" contextbar__fill--over":l>=iN?" contextbar__fill--warn":""}const n_="ccv:last-session",uN=300*1e3,fN=1e4;function dN(){try{const l=localStorage.getItem(n_);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function hN(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const pN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Fx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],mN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Jx(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const d=l.slice(c+1).toLowerCase();return d===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>Wx(h.name,d)-Wx(m.name,d))}}function Wx(l,s){return l.toLowerCase().startsWith(s)?0:1}function Px(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function gN(){var Jc,ya;const l=y.useRef(null),[s,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[m,g]=y.useState(!1),b=y.useMemo(()=>Mf()==="relay",[]),[_,S]=y.useState([]),[v,E]=y.useState([]),[T,C]=y.useState([]),[L,$]=y.useState([]),[J,G]=y.useState([]),[O,Z]=y.useState([]),[M,D]=y.useState([]),[H,ne]=y.useState([]),[he,W]=y.useState([]),[ue,je]=y.useState(null),[Me,Ce]=y.useState(null),[A,ce]=y.useState(null),[z,be]=y.useState(null),[ye,N]=y.useState(null),[V,re]=y.useState(vl),[me,Ne]=y.useState(zh),[ve,De]=y.useState(!1),[yt,$e]=y.useState(!1),Xe=$f("(max-width: 860px)"),[Ve,It]=y.useState(!1);y.useEffect(()=>{Xe||It(!1)},[Xe]);const[rt,dn]=y.useState(!1),[ft,hn]=y.useState([]),[Sn,xn]=y.useState(!1),[en,tt]=y.useState(vl),[et,tn]=y.useState(null),[$t,nt]=y.useState(null),[St,Xt]=y.useState([]),[cn,wt]=y.useState(null),[yn,qt]=y.useState(null),[pn,Dn]=y.useState([]),[Gt,ct]=y.useState([]),[Et,Pe]=y.useState([]),[wl,le]=y.useState([]),[ge,He]=y.useState(null),[B,P]=y.useState({}),[_e,Be]=y.useState(null),[Ot,fl]=y.useState({}),[On,dl]=y.useState(null),[sl,Bl]=y.useState([]),[ds,hl]=y.useState(!1),[al,pl]=y.useState(null),[Yt,Vt]=y.useState(null),[kl,kt]=y.useState(!1),[Qt,Oe]=y.useState(mN),[Ct,qn]=y.useState(null),[nn,Ln]=y.useState(null),[il,wn]=y.useState(!1),[Il,,rl]=X0(),ln=J0(),[Kt,on]=y.useState(!1),[Fe,ml]=y.useState(null),[Ms,Gn]=y.useState(null),[Zl,hs]=y.useState(null),[ps,mn]=y.useState(null),[Fl,Zn]=y.useState(null),[zn,kn]=y.useState(""),[Lt,Rs]=y.useState(null),[Di,Ds]=y.useState([]),[Yn,Nl]=y.useState(!1),[La,Nn]=y.useState(null),[sn,Jl]=y.useState(!1),[lt,$n]=y.useState(!1),[pe,k]=y.useState({}),[Y,fe]=y.useState([""]),[we,Ae]=y.useState([]),[ze,dt]=y.useState(null),[w,se]=y.useState(null),[ke,Je]=y.useState(null),[ht,ms]=y.useState(null),[za,gr]=y.useState(null),[Ua,wc]=y.useState({}),[Os,Wl]=y.useState({}),[gs,bs]=y.useState(!1),[Ls,Oi]=y.useState(null),[sa,br]=y.useState(null),Li=y.useRef(0),aa=y.useRef(null),[ia,Xn]=y.useState(!1),[Pl,zs]=y.useState([]),[zi,xr]=y.useState(null),[kc,Ha]=y.useState(null),Us=P0(),Ba=lv(Xe&&ia),Ia=y.useRef(new Map),ra=(Yt==null?void 0:Yt.terminalEnabled)===!0,yr=Mf()==="relay"&&((Jc=d==null?void 0:d.shell)==null?void 0:Jc.enabled)!==!0,Nc=y.useRef(!1),Tc=y.useCallback((p,I)=>(Ia.current.set(p,I),()=>{Ia.current.get(p)===I&&Ia.current.delete(p)}),[]),[ca,_r]=y.useState(!1),[Xo,vr]=y.useState(null),[Vo,Ui]=y.useState(vl),[xs,jr]=y.useState(null),[Hi,oa]=y.useState({}),ua=y.useRef([]),[an,Ec]=y.useState(null);function Kf(p){Ec(I=>I===p?null:p)}y.useEffect(()=>{(Xe||an==="terminal"&&!ia||an==="files"&&!lt||an==="search"&&!gs||an==="git"&&!Kt||an==="ask"&&!ca||an==="main"&&we.length===0)&&Ec(null)},[an,Xe,ia,lt,gs,Kt,ca,we.length]);const[Qo]=y.useState(dN),Ko=y.useRef(Qo),Sr=y.useRef(!1),Un=y.useRef(null),Bi=y.useRef(null),Ii=y.useRef(null),Zo=y.useRef(0),Tn=y.useRef(null),Fo=y.useRef(0);Un.current=z,Tn.current=A,Fo.current=V.lastSeq;const Jo=y.useRef(me);Jo.current=me;const ql=y.useRef(null),qa=y.useRef(0);qa.current=Vo.lastSeq;const wr=y.useRef(null),qi=y.useRef(""),Ga=y.useRef(null),Hs=y.useRef([]),Cc=y.useRef([""]);Hs.current=we,Cc.current=Y;const Ya=y.useRef(new Map),ys=y.useRef(new Set),Gi=y.useRef(null),Yi=y.useRef(null),Wo=y.useRef(0),$a=y.useRef(new Set);y.useEffect(()=>{const p=D0();if(!p)return;l.current=p;const I=()=>{r(p.connected),o(p.statusText)};p.onStatus(I),p.onReconnect(()=>{I(),fl({});const Ut=Un.current;Ut&&p.send({type:"session.sync",sessionId:Ut,sinceSeq:Fo.current});const Zt=ql.current;Zt&&p.send({type:"session.sync",sessionId:Zt,sinceSeq:qa.current})});const de=p.on(Ut=>Po(Ut));p.connect();const Ge=window.setInterval(()=>{I(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{de(),window.clearInterval(Ge),p.close()}},[]);const Po=y.useCallback(p=>{var I,de,Ge,Ut,Zt,Bn,si,Wc,_a;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{S(p.workspaces),E(p.archived),ce(Ie=>{var Pn;if(Ie)return Ie;const gt=Ko.current,Ht=gt&&p.workspaces.find(zr=>zr.id===gt.workspaceId);return(Ht==null?void 0:Ht.id)??((Pn=p.workspaces[0])==null?void 0:Pn.id)??null});const xe=Ga.current;if(!xe)break;const Ee=p.workspaces.find(Ie=>jN(Ie.path,xe));if(!Ee)break;Ga.current=null,dn(!1),ce(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==qi.current)break;hn(p.candidates),p.source==="host"&&xn(!1);break;case"finder.opened":wr.current=p.sessionId;break;case"workspace.roots":Xt(p.roots);break;case"workspace.created":if(ce(p.workspace.id),p.warnings.length===0){dn(!1),nt(null);break}wt({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Tn.current)break;Z(p.sessions),D(p.archived);break;case"folder.list":C(p.workspaceFolders),$(p.sessionFolders),G(p.pinnedFolders??[]);break;case"session.pinned":ne(p.sessions);break;case"session.live":W(p.sessions);break;case"order.state":Ce(p.order);break;case"session.summary":if(p.session.id===wr.current){tn(p.session);break}if(p.session.parentSessionId){p.session.id===ql.current&&jr(p.session);break}if(W(xe=>{const Ee=xe.findIndex(gt=>gt.id===p.session.id);if(p.session.state==="closed")return Ee===-1?xe:xe.filter(gt=>gt.id!==p.session.id);if(Ee===-1)return[...xe,p.session];const Ie=xe.slice();return Ie[Ee]=p.session,Ie}),Z(xe=>{const Ee=xe.findIndex(gt=>gt.id===p.session.id);if(Ee===-1)return[p.session,...xe];const Ie=xe.slice();return Ie[Ee]=p.session,Ie}),ne(xe=>{const Ee=xe.findIndex(gt=>gt.id===p.session.id);if(Ee===-1)return xe;const Ie=xe.slice();return Ie[Ee]={...p.session,pinned:!0,...xe[Ee].pinnedAt?{pinnedAt:xe[Ee].pinnedAt}:{}},Ie}),Un.current===null&&Ii.current&&Ii.current.workspaceId===p.session.workspaceId&&(ry(p.session.id,Ii.current.text),Ii.current=null),be(xe=>xe??p.session.id),((I=Bi.current)==null?void 0:I.sessionId)===p.session.id){const xe=Bi.current;p.session.state==="error"?Bi.current=null:p.session.state!=="closed"&&(Bi.current=null,(de=l.current)==null||de.send({type:"prompt.send",sessionId:xe.sessionId,text:xe.text,images:xe.images}))}break;case"usage.state":p.sessionId===Un.current&&(qn(p.usage),wn(!1));break;case"context.state":p.sessionId===Un.current&&(Ln(p.context),wn(!1));break;case"session.capabilities":p.sessionId===Un.current&&N(p.capabilities);break;case"session.events":if(p.sessionId===ql.current){Ui(xe=>Rf(xe,p.entries));break}if(p.sessionId===wr.current){tt(xe=>Rf(xe,p.entries));break}if(p.sessionId!==Un.current)break;for(const xe of p.entries){if(xe.event.kind!=="rewound")continue;const Ee=xe.event.toUserIndex,Ie=Y0(Jo.current.entries,Ee),gt=Ie.reduce((Ht,Pn)=>Pn.event.kind==="user.message"?Ht+1:Ht,0);Ne(Ht=>({...Ht,entries:Ie})),re(Ht=>({...Ht,items:$0(Ht.items,Ee,gt)}))}re(xe=>Rf(xe,p.entries));break;case"session.history":if(p.sessionId!==Un.current)break;Ne(xe=>I0(xe,p));break;case"side.opened":{if(p.parentSessionId!==Un.current)break;ql.current=p.sessionId,vr(p.sessionId);const xe=ua.current;ua.current=[];for(const Ee of xe)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Un.current)break;ql.current=null,vr(null),Ui(vl),jr(null);break;case"git.state":if(p.workspaceId!==Tn.current)break;ml(p.state);break;case"git.commit":if(p.workspaceId!==Tn.current)break;Gn(p.detail);break;case"git.result":if(p.workspaceId!==Tn.current)break;mn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Gn(null),hs(null),Nl(!1),Jl(!1));break;case"git.busy":if(p.workspaceId!==Tn.current)break;kn(p.label);break;case"git.files":if(p.workspaceId!==Tn.current)break;Nn({files:p.files,truncated:p.truncated});break;case"github.status":Rs(p.status);break;case"github.owners":Ds(p.owners);break;case"fs.dir":if(p.workspaceId!==Tn.current)break;k(xe=>({...xe,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Tn.current)break;if(p.scope!=="tree"){const xe=p.scope;Wl(Ee=>({...Ee,[xe]:{query:p.query,entries:p.entries}}));break}gr({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Tn.current)break;Oi({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Tn.current)break;const xe=ys.current.delete(p.file.path);Ae(Ie=>{const gt=Ie.findIndex(zr=>zr.path===p.file.path);if(gt===-1)return[...Ie,bx(p.file,++Wo.current)];const Ht=Ie[gt],Pn=Ie.slice();return Pn[gt]=Ht.saved===p.file.content&&!Ra(Ht)?{...Ht,mtime:p.file.mtime,size:p.file.size,stale:!1}:bx(p.file,++Wo.current),Pn}),xe&&dt(p.file.path);const Ee=aa.current;Ee&&Ee.path===p.file.path&&(aa.current=null,br({...Ee,token:++Li.current}));break}case"fs.media":{if(p.workspaceId!==Tn.current)break;$a.current.delete(p.path),Ae(xe=>xe.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==Tn.current)break;$a.current.delete(p.path),Ae(xe=>xe.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==Tn.current)break;const xe=Ya.current.get(p.path);Ya.current.delete(p.path);const Ee=xe!==void 0;Ae(gt=>gt.map(Ht=>Ht.path!==p.path?Ht:Ee?{...Ht,saved:xe,mtime:p.mtime,size:p.size,stale:!1}:{...Ht,stale:!0}));const Ie=Hs.current.find(gt=>gt.path===p.path);!Ee&&Ie&&!Ra(Ie)&&((Ge=l.current)==null||Ge.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(Ut=l.current)==null||Ut.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Tn.current)break;if(se({ok:p.ok,message:p.message}),p.ok||Ya.current.delete(p.path),p.conflict&&Ae(Ee=>Ee.map(Ie=>Ie.path===p.path?{...Ie,stale:!0}:Ie)),Yi.current===p.path){const Ee=Yi.current;Yi.current=null,p.ok&&(ys.current.add(Ee),(Zt=l.current)==null||Zt.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const xe=Gi.current;if(p.ok&&xe&&xe.to===p.path){Gi.current=null;const Ee=Ie=>Ie===xe.from?xe.to:Ie.startsWith(`${xe.from}/`)?xe.to+Ie.slice(xe.from.length):Ie;Ae(Ie=>Ie.map(gt=>({...gt,path:Ee(gt.path)}))),dt(Ie=>Ie===null?null:Ee(Ie)),fe(Ie=>Ie.map(Ee)),k(Ie=>{const gt={};for(const[Ht,Pn]of Object.entries(Ie))Ht===xe.from||Ht.startsWith(`${xe.from}/`)||(gt[Ht]=Pn);return gt})}p.ok&&((Bn=l.current)==null||Bn.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Tn.current)break;zs(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Tn.current)break;Ha(null),zs(xe=>{const Ee=xe.findIndex(gt=>gt.id===p.terminal.id);if(Ee===-1)return[...xe,p.terminal];const Ie=xe.slice();return Ie[Ee]=p.terminal,Ie}),Nc.current&&(Nc.current=!1,xr(p.terminal.id));break;case"term.buffer":(si=Ia.current.get(p.id))==null||si({kind:"buffer",data:p.data});break;case"term.data":(Wc=Ia.current.get(p.id))==null||Wc({kind:"data",data:p.data});break;case"term.exit":zs(xe=>xe.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":zs(xe=>xe.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===Un.current&&Dn(p.servers);break;case"plugin.list":if(p.sessionId!==Un.current)break;ct(p.plugins),Pe(p.marketplaces),le(p.catalog);break;case"operation.result":p.sessionId===Un.current&&He(p.result);break;case"auth.status":pl(p.status);break;case"relay.state":h(p.state);break;case"settings.state":Vt(p.settings);break;case"handoff.state":P(xe=>{if(!p.handoff){if(!(p.sessionId in xe))return xe;const Ee={...xe};return delete Ee[p.sessionId],Ee}return{...xe,[p.sessionId]:p.handoff}});break;case"handoff.written":fl(xe=>{if(!(p.sessionId in xe))return xe;const Ee={...xe};return delete Ee[p.sessionId],Ee}),p.handoff&&Un.current===p.sessionId?dl(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Zo.current+=1,Bl(xe=>[...xe,{id:Zo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Oe(p.state),p.state.active&&hl(!0);break;case"session.closed":W(xe=>xe.filter(Ee=>Ee.id!==p.sessionId)),Z(xe=>xe.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Ga.current=null,nt(p.message)),(_a=p.context)!=null&&_a.startsWith("term.")&&Ha(p.message);break}},[]),ee=y.useCallback(p=>{var I;(I=l.current)==null||I.send(p)},[]);y.useEffect(()=>{A&&ee({type:"session.list",workspaceId:A})},[A,ee]),y.useEffect(()=>{s&&ee({type:"session.pins"})},[s,ee]),y.useEffect(()=>{s&&ee({type:"settings.get"})},[s,ee]),y.useEffect(()=>{if(s)return ee({type:"session.drafts",sessionIds:cy()}),U0(p=>ee({type:"session.drafts",sessionIds:p}))},[s,ee]),y.useEffect(()=>{if(Sr.current)return;const p=Ko.current;if(!p||!A)return;if(A!==p.workspaceId){Sr.current=!0;return}if(z){Sr.current=!0;return}if(O.length===0)return;const I=O.find(de=>hN(de,p));Sr.current=!0,I&&I.state!=="closed"&&$i(I)},[O,A,z]),y.useEffect(()=>{!A||yr||!ra||ee({type:"term.list",workspaceId:A})},[A,yr,ra,ee]),y.useEffect(()=>{xr(p=>{var I;return p&&Pl.some(de=>de.id===p)?p:((I=Pl[0])==null?void 0:I.id)??null})},[Pl]),y.useEffect(()=>{rt&&ee({type:"workspace.roots"})},[rt,ee]);const es=y.useCallback(()=>{const p=Un.current;p&&(wn(!0),ee({type:"usage.get",sessionId:p}),ee({type:"context.get",sessionId:p}))},[ee]);y.useEffect(()=>{if(!il)return;const p=window.setTimeout(()=>wn(!1),fN);return()=>window.clearTimeout(p)},[il]);const Ac=y.useMemo(()=>{const p=Math.max((Ct==null?void 0:Ct.fetchedAt)??0,(nn==null?void 0:nn.fetchedAt)??0);return p>0?p:null},[Ct==null?void 0:Ct.fetchedAt,nn==null?void 0:nn.fetchedAt]);y.useEffect(()=>{if(Ln(null),!z)return;es();const p=()=>{document.hidden||es()},I=window.setInterval(p,uN),de=()=>{document.hidden||es()};return document.addEventListener("visibilitychange",de),()=>{window.clearInterval(I),document.removeEventListener("visibilitychange",de)}},[z,es]),y.useEffect(()=>{if(!z){Ne(zh);return}Ne({...zh,loading:!0}),ee({type:"session.history",sessionId:z})},[z,ee]);const kr=y.useCallback(()=>{!z||me.loading||!Db(me)||(Ne(p=>({...p,loading:!0})),ee({type:"session.history",sessionId:z,before:uy(me)}))},[z,me,ee]),eu=y.useMemo(()=>q0(me.entries),[me.entries]),X=y.useMemo(()=>O.find(p=>p.id===z)??null,[O,z]),fa=z?(X==null?void 0:X.claudeSessionId)??z:null,da=fa?B[fa]??null:null;y.useEffect(()=>{fa&&ee({type:"handoff.get",sessionId:fa})},[fa,ee]),y.useEffect(()=>{_e&&!(_e.sessionId in B)&&Be(null)},[B,_e]);const Mc=y.useMemo(()=>{var de;if(!Ct)return null;const p=(((de=Ct.buckets)==null?void 0:de.length)??0)>0,I=(X==null?void 0:X.provider)==="antigravity";return p===I?Ct:null},[Ct,X==null?void 0:X.provider]),Rc="Обновить лимиты и контекст",tu=Rc+(Ac?`
|
|
134
|
-
обновлено в ${new Date(Ac).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{document.documentElement.dataset.provider=(X==null?void 0:X.provider)??"claude"},[X==null?void 0:X.provider]),y.useEffect(()=>{(X==null?void 0:X.provider)==="antigravity"&&_r(!1)},[X==null?void 0:X.provider]);const Xa=_.find(p=>p.id===A)??v.find(p=>p.id===A)??null;y.useEffect(()=>{if(!A||!z)return;const p={workspaceId:A,sessionId:z,claudeSessionId:(X==null?void 0:X.claudeSessionId)??null};try{localStorage.setItem(n_,JSON.stringify(p))}catch{}},[A,z,X==null?void 0:X.claudeSessionId]);function Zf(p){Ga.current=p,nt(null),ee({type:"workspace.open",path:p})}function Ff(p,I,de){nt(null),ee({type:"workspace.create",parent:p,name:I,init:de})}function Jf(p){if(qi.current=p,!p){hn([]),xn(!1);return}xn(!0),ee({type:"workspace.find",query:p})}function Wf(p){qi.current=p,tt(vl),ee({type:"workspace.find.agent",query:p})}function gl(){dn(!1),nt(null),wt(null),hn([]),tt(vl),tn(null),qi.current="",Ga.current=null}function ts(){const p=Un.current;p&&ql.current&&ee({type:"side.reset",sessionId:p}),ql.current=null,vr(null),Ui(vl),jr(null),oa({}),ua.current=[]}function nu(p){ee({type:"workspace.close",workspaceIds:p}),!(!A||!p.includes(A))&&(ts(),ce(null),be(null),Z([]),D([]),re(vl),N(null),$e(!1))}function lu(p,I){ee({type:"session.archive",workspaceId:p,sessionIds:I}),z&&(I.includes(z)||X!=null&&X.claudeSessionId&&I.includes(X.claudeSessionId))&&(ts(),be(null),re(vl),N(null),$e(!1))}function su(p){ee({type:"workspace.restore",workspaceIds:p})}function au(p,I,de){ee({type:"folder.create",scope:p,name:I,workspaceId:de})}function Dc(p,I){ee({type:"folder.rename",folderId:p,name:I})}function Pf(p){ee({type:"folder.delete",folderId:p})}function Va(p,I,de,Ge){ee({type:"folder.assign",scope:p,itemId:I,folderId:de,workspaceId:Ge})}function Oc(p="claude"){A&&(ts(),be(null),N(null),re(vl),$e(!1),ee({type:"session.start",workspaceId:A,provider:p}),De(!1))}function ha(p){ts(),Hn(),ce(p),be(null),re(vl),N(null),$e(!1),ml(null),Gn(null),hs(null),mn(null),kn(""),Nl(!1),Nn(null),Jl(!1),zs([]),xr(null)}function Lc(p,I,de){ee({type:"session.pin",workspaceId:p,sessionIds:I,pinned:de})}function iu(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function _s(p){if(iu(p)){je(p);return}ee({type:"session.close",sessionId:p.id})}function Qa(p,I,de){Ce(Ge=>{const Ut=Ge??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!de)return Ge;const Zt={...Ut.sessions};return I&&I.length>0?Zt[de]=I:delete Zt[de],{...Ut,sessions:Zt}}return{...Ut,[p]:I??[]}}),ee({type:"order.set",scope:p,ids:I,...de?{workspaceId:de}:{}})}function zc(p){p.workspaceId!==A&&ha(p.workspaceId),$i(p)}function $i(p){if(De(!1),ts(),re(vl),N(null),$e(!1),p.state==="closed"){be(null),ee({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}be(p.id),ee({type:"session.sync",sessionId:p.id,sinceSeq:0})}function pa(p,I){if(z){if((X==null?void 0:X.state)==="closed"){Bi.current={sessionId:X.id,text:p,images:I},$i(X);return}ee({type:"prompt.send",sessionId:z,text:p,images:I})}}function Uc(p){const I=he.find(de=>(de.claudeSessionId??de.id)===p.sessionId&&de.state!=="closed");Bc(p.workspaceId,p.sessionId,p.text),I&&ee({type:"session.close",sessionId:I.id})}function Hc(p){Bc(p.workspaceId,p.claudeSessionId??p.id,null)}function Bc(p,I,de){Ii.current=de===null?null:{workspaceId:p,text:de},p!==A?ha(p):(ts(),be(null),N(null),re(vl),$e(!1)),ee({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:I,...de===null?{}:{fromHandoff:!0}}),De(!1)}y.useEffect(()=>{On&&(dl(null),Uc(On))},[On]);function ru(p){Ot[p.id]||(fl(I=>({...I,[p.id]:!0})),ee({type:"session.handoff",sessionId:p.id}))}function ed(p){ee({type:"handoff.dismiss",sessionId:p})}function cu(p,I){ee({type:"session.rename",sessionId:p.id,title:I,workspaceId:p.workspaceId}),Z(de=>de.map(Ge=>Ge.id===p.id?{...Ge,title:I}:Ge))}function Ic(p){z&&(De(!1),He(null),qt(p),ee({type:"mcp.list",sessionId:z}),ee({type:"plugin.list",sessionId:z}))}const ou={mcpAction:(p,I)=>{z&&(ee({type:"mcp.action",sessionId:z,name:p,action:I}),qt(null))},mcpAdd:(p,I)=>{z&&ee({type:"mcp.add",sessionId:z,name:p,draft:I})},mcpRemove:p=>{z&&ee({type:"mcp.remove",sessionId:z,name:p})},pluginInstall:p=>{z&&ee({type:"plugin.install",sessionId:z,spec:p})},pluginUninstall:p=>{z&&ee({type:"plugin.uninstall",sessionId:z,id:p})},pluginToggle:(p,I)=>{z&&ee({type:"plugin.toggle",sessionId:z,id:p,enabled:I})},marketplaceAdd:p=>{z&&ee({type:"marketplace.add",sessionId:z,source:p})},marketplaceRemove:p=>{z&&ee({type:"marketplace.remove",sessionId:z,name:p})}};function Nr(){De(!1),hl(!0),ee({type:"auth.status"})}const bl={login:(p,I)=>ee({type:"auth.login",mode:p,switchAccount:I}),submitCode:p=>ee({type:"auth.code",code:p}),cancel:()=>ee({type:"auth.cancel"}),logout:()=>ee({type:"auth.logout"})};function Tr(){De(!1),kt(!0),ee({type:"settings.get"})}function Tl(p){Vt(I=>I&&{...I,...p}),ee({type:"settings.update",settings:p})}function Ka(p){z&&ee({type:"side.ask",sessionId:z,text:p})}function qc(){z&&(ee({type:"side.reset",sessionId:z}),ql.current=null,vr(null),Ui(vl),jr(null),oa({}),ua.current=[])}function Bs(p){const I=ql.current;if(I){p(I);return}const de=Un.current;de&&(ua.current.push(p),ee({type:"side.open",sessionId:de}))}function Xi(){A&&ee({type:"git.state",workspaceId:A})}function Gc(p){A&&(hs(p),ee({type:"git.show",workspaceId:A,ref:p}))}function Is(p,I){mn(null),Zn({target:p,label:I})}function uu(){!A||!Fl||(ee({type:"git.checkout",workspaceId:A,target:Fl.target}),Zn(null))}function Er(){A&&(mn(null),ee({type:"git.push",workspaceId:A}))}function Za(p){A&&(mn(null),ee({type:"git.pull",workspaceId:A,merge:p}))}function td(){A&&(mn(null),Nn(null),Nl(!0),ee({type:"github.status"}),ee({type:"github.owners"}),ee({type:"git.files",workspaceId:A}))}function xl(p){A&&(mn(null),ee({type:"git.publish",workspaceId:A,...p}))}function Yc(p){A&&(mn(null),ee({type:"git.remote",workspaceId:A,url:p}))}function vs(){mn(null),Jl(!0)}function fu(p){ee({type:"github.token",token:p}),ee({type:"github.owners"})}function Cr(){ee({type:"github.status"}),ee({type:"github.owners"})}y.useEffect(()=>{if(!(!lt||!A))for(const p of Y)p in pe||ee({type:"fs.list",workspaceId:A,path:p})},[lt,Y,pe,A,ee]);function ma(p){fe(I=>I.includes(p)?I.filter(de=>de!==p):[...I,p])}function $c(p){if(!p){gr(null);return}A&&ee({type:"fs.search",workspaceId:A,query:p})}function du(p){if(!p){Oi(null);return}A&&ee({type:"fs.grep",workspaceId:A,query:p})}const Ar=y.useCallback((p,I)=>{wc(Ut=>({...Ut,[p]:I}));const de=Tn.current;if(I===null||!de)return;const Ge=I.lastIndexOf("/");if(Ge!==-1){ee({type:"fs.list",workspaceId:de,path:I.slice(0,Ge)});return}if(I===""){ee({type:"fs.list",workspaceId:de,path:""});return}ee({type:"fs.search",workspaceId:de,query:I,scope:p})},[ee]),hu=y.useMemo(()=>Jx(Ua.mention??null,Os.mention??null,pe),[Ua.mention,Os.mention,pe]),El=y.useMemo(()=>Jx(Ua.side??null,Os.side??null,pe),[Ua.side,Os.side,pe]);function Fa(p){Wa(p.path,{line:p.line,column:p.column})}function Ja(p){const I=[];let de=fr(p.path);for(;I.push(de),!!de;)de=fr(de);fe(Ge=>{const Ut=new Set(Ge);for(const Zt of I)Ut.add(Zt);return p.kind==="dir"&&Ut.add(p.path),[...Ut]}),p.kind==="file"&&Wa(p.path)}function Wa(p,I){if(Hs.current.find(Ge=>Ge.path===p)){dt(p),I&&br({path:p,...I,token:++Li.current});return}A&&(I&&(aa.current={path:p,...I}),ys.current.add(p),ee({type:"fs.read",workspaceId:A,path:p}))}function ga(p,I=!1){const de=Hs.current,Ge=de.find(Bn=>Bn.path===p);if(Ge&&Ra(Ge)&&!I){ms(p);return}ms(null);const Ut=de.findIndex(Bn=>Bn.path===p),Zt=de.filter(Bn=>Bn.path!==p);Ae(Zt),dt(Bn=>{var si;return Bn===p?((si=Zt[Math.min(Ut,Zt.length-1)])==null?void 0:si.path)??null:Bn})}function Fn(p,I=!1){const de=Hs.current.find(Ge=>Ge.path===p);!de||!A||!I&&!Ra(de)||(Ya.current.set(p,de.text),ee({type:"fs.write",workspaceId:A,path:p,content:de.text,eol:de.eol,encoding:de.encoding,baseMtime:de.mtime,...I?{force:!0}:{}}))}function Cl(p){A&&ee({type:"fs.read",workspaceId:A,path:p})}function qs(p){A&&($a.current.has(p)||($a.current.add(p),ee({type:"fs.readMedia",workspaceId:A,path:p})))}const ns=y.useRef(new Map);function ls(p){const I=ns.current,de=I.get(p);de&&clearTimeout(de);const Ge=(Yt==null?void 0:Yt.autoSaveAfterPauseMs)??0;Ge<=0||I.set(p,setTimeout(()=>{I.delete(p);const Ut=Hs.current.find(Zt=>Zt.path===p);Ut&&Ra(Ut)&&!Ut.stale&&Fn(p)},Ge))}function js(p,I,de){if(!A)return;const Ge=p?`${p}/${de}`:de;se(null),I==="file"&&(Yi.current=Ge),ee({type:"fs.create",workspaceId:A,path:Ge,kind:I})}function pu(p,I){if(!A)return;const de=fr(p),Ge=de?`${de}/${I}`:I;se(null),Gi.current={from:p,to:Ge},ee({type:"fs.rename",workspaceId:A,path:p,to:Ge})}function Xc(p,I){if(!A)return;const de=p.slice(p.lastIndexOf("/")+1),Ge=I?`${I}/${de}`:de;Ge!==p&&(se(null),Gi.current={from:p,to:Ge},ee({type:"fs.rename",workspaceId:A,path:p,to:Ge}))}function Vc(p,I){A&&(se(null),ee({type:"fs.copy",workspaceId:A,path:p,toDir:I}))}function mu(p){A&&(se(null),Je(null),ee({type:"fs.delete",workspaceId:A,path:p.path}),Ae(I=>I.filter(de=>de.path!==p.path&&!de.path.startsWith(`${p.path}/`))),dt(I=>I&&(I===p.path||I.startsWith(`${p.path}/`))?null:I))}function Hn(){k({}),fe([""]),Ae([]),dt(null),se(null),gr(null),Oi(null),wc({}),Wl({}),br(null),ys.current.clear(),Ya.current.clear(),$a.current.clear(),aa.current=null,Gi.current=null,Yi.current=null}function zt(){!A||yr||!ra||(Ha(null),Nc.current=!0,ee({type:"term.open",workspaceId:A,cols:80,rows:24}))}function st(p){ee({type:"term.close",id:p})}function Gs(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:I})}function Al(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",answers:I})}function Qc(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Ys(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",plan:I})}function gu(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function p(I){if(I.key!=="Escape")return;if(an!==null){const Ge=I.target;if(!(Ge instanceof HTMLElement&&Ge.closest(".termview, .editor, .sidepane"))){Ec(null);return}}if(!z||V.pending.length>0)return;const de=I.target;de instanceof HTMLElement&&de.closest(".sidepane, .editor")||ee({type:"control.interrupt",sessionId:z})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[z,V.pending.length,ee,an]),y.useEffect(()=>{function p(I){I.key!=="`"||!(I.ctrlKey||I.metaKey)||ra&&(I.preventDefault(),Xn(de=>!de))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[ra]);const Kc=y.useMemo(()=>{const p=(ye==null?void 0:ye.commands)??[];return p.length===0||(X==null?void 0:X.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Fx]},[ye,X==null?void 0:X.provider]);function ba(p){const I=pN[p];return I&&(X==null?void 0:X.provider)!=="antigravity"?(Ic(I),!0):(X==null?void 0:X.provider)==="antigravity"||!Fx.some(de=>de.name===p)?!1:(Nr(),p==="logout"&&bl.logout(),p==="switch-account"&&bl.login("claudeai",!0),!0)}const ss=(X==null?void 0:X.state)==="waiting_permission",yl=(X==null?void 0:X.state)==="reconnecting",Jn=(X==null?void 0:X.state)==="running"||yl||ss,Wn=V.pending[0]??null,$s=Wn?vw(Wn.toolName,Wn.input):null;y.useEffect(()=>{!Kt&&!lt||!A||Jn||ee({type:"git.state",workspaceId:A})},[Kt,lt,A,Jn,ee]),y.useEffect(()=>{if(!(Jn||!A)){lt&&k(p=>{const I={};for(const[de,Ge]of Object.entries(p))Cc.current.includes(de)||(I[de]=Ge);return I});for(const p of Hs.current)Ra(p)||ee({type:"fs.read",workspaceId:A,path:p.path})}},[Jn,A,lt,ee]);const Gl=(X==null?void 0:X.cwd)??(ye==null?void 0:ye.cwd)??null,Ss=(ye==null?void 0:ye.models)??[],Ml=(X==null?void 0:X.model)??(ye==null?void 0:ye.model)??null,{rows:Mr,selected:Zc}=Px(Ss,Ml),as=xs?{model:xs.model,effort:xs.effort,ultracode:xs.ultracode,thinking:xs.thinking,switchOnFlag:xs.switchModelsOnFlag}:{model:Hi.model??Ml,effort:Hi.effort??(X==null?void 0:X.effort)??null,ultracode:Hi.ultracode??(X==null?void 0:X.ultracode)??!1,thinking:Hi.thinking??(X==null?void 0:X.thinking)??!0,switchOnFlag:Hi.switchOnFlag??(X==null?void 0:X.switchModelsOnFlag)??!0},Vi=Px(Ss,as.model),xa=(xs==null?void 0:xs.state)==="running",_n=ze?we.find(p=>p.path===ze)??null:null,Rr=new Set(we.filter(Ra).map(p=>p.path)),Pa=p=>i.jsx(Fk,{pane:p,width:ln.widths[p],onResize:I=>ln.setWidth(p,I),onReset:()=>ln.reset(p)}),ei=p=>Xe?null:()=>Kf(p),nd=(X==null?void 0:X.provider)==="antigravity"?Q0:fy,bu=ye&&i.jsx(Cs,{title:"Режим прав",value:(X==null?void 0:X.permissionMode)??"default",options:nd.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{z&&ee({type:"control.set_mode",sessionId:z,mode:p})}}),un=Mr.length>0?i.jsx(Fy,{models:Mr,value:Zc,effort:(X==null?void 0:X.effort)??null,ultracode:(X==null?void 0:X.ultracode)??!1,thinking:(X==null?void 0:X.thinking)??!0,switchOnFlag:(X==null?void 0:X.switchModelsOnFlag)??!0,showSwitchOnFlag:(X==null?void 0:X.provider)!=="antigravity",onModel:p=>{!z||!p||ee({type:"control.set_model",sessionId:z,model:p})},onEffort:p=>{z&&ee({type:"control.set_effort",sessionId:z,effort:p})},onUltracode:p=>{z&&ee({type:"control.set_ultracode",sessionId:z,enabled:p})},onThinking:p=>{z&&ee({type:"control.set_thinking",sessionId:z,enabled:p})},onSwitchOnFlag:p=>{z&&ee({type:"control.set_flag_switch",sessionId:z,enabled:p})}}):Ml&&i.jsx("span",{className:"badge",children:Ml}),Fc=Jn&&i.jsx("span",{className:ss?"badge badge--wait":"badge badge--live",children:ss?"ждёт":yl?"переподключается":"работает"}),Qi=(X==null?void 0:X.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),ti=Fc||Qi,Dr=()=>{z&&ee({type:"session.reconnect",sessionId:z})},ni=yl?"Сессия уже поднимает новый процесс":Jn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",li=z&&(yl||(X==null?void 0:X.state)==="error")?i.jsxs("div",{className:yl?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),yl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:yl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Dr,children:yl?"Переподключить сейчас":"Переподключить"})]}):null,ld=da?i.jsx(Yk,{handoff:da,onContinue:()=>Uc(da),onShow:()=>Be(da),onDismiss:()=>ed(da.sessionId)}):null,Or=X&&X.totalCostUsd>0?`$${X.totalCostUsd.toFixed(3)}`:null,xu=(X==null?void 0:X.provider)!=="antigravity"&&i.jsx("button",{className:ca?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":ca,onClick:()=>_r(p=>!p),children:i.jsx(wN,{})}),yu=X&&X.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>_s(X),children:i.jsx(_N,{})}),Rl=X?Ot[X.id]===!0:!1,Ki=my({onLongPress:()=>{X&&Hc(X)},onClick:()=>{X&&ru(X)},disabled:Rl}),Lr=X&&X.state!=="closed"&&X.provider!=="antigravity"&&i.jsxs("button",{type:"button",className:Rl?"pane-btn pane-btn--handoff is-busy":Ki.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${Ki.thresholdMs}ms`},title:Rl?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Rl,disabled:Rl,...Ki.handlers,children:[i.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),i.jsx(vN,{})]});return i.jsxs("div",{className:"app",style:ln.style,children:[i.jsx(Fj,{open:ve,connected:s,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:T,sessionFolders:L.filter(p=>p.workspaceId===A),pinnedFolders:J,sessions:O.filter(p=>p.workspaceId===A),archived:M.filter(p=>p.workspaceId===A),pinned:H,live:he,listOrder:Me,liveSessionsFirst:(Yt==null?void 0:Yt.liveSessionsFirst)===!0,onReorder:Qa,activeWorkspaceId:A,activeSessionId:z,onPinSessions:Lc,onSelectPinned:zc,onCloseWorkspaces:nu,onRestoreWorkspaces:su,onArchiveSessions:lu,onUnarchiveSessions:p=>{A&&ee({type:"session.unarchive",workspaceId:A,sessionIds:p})},onCreateFolder:au,onRenameFolder:Dc,onDeleteFolder:Pf,onAssignToFolder:Va,onSelectWorkspace:ha,onSelectSession:$i,onRenameSession:cu,onStopSession:_s,onOpenWorkspace:()=>dn(!0),onNewSession:Oc,onOpenExtensions:z&&(X==null?void 0:X.provider)!=="antigravity"?()=>Ic("mcp"):null,account:al,onOpenAccount:Nr,relay:d,onOpenRelay:b?null:()=>g(!0),onOpenSettings:Tr,themeMode:Il,onCycleTheme:rl}),Pa("sidebar"),ve&&i.jsx("div",{className:"scrim",onClick:()=>De(!1)}),i.jsx(cj,{open:lt,tree:pe,expanded:new Set(Y),activePath:ze,dirty:Rr,gitChanges:(Fe==null?void 0:Fe.changed)??[],result:w,searchResult:za,onSearch:$c,onReveal:Ja,onToggle:ma,onOpen:Wa,onCreate:js,onRename:pu,onMove:Xc,onCopy:Vc,onDelete:Je,onRefresh:()=>{se(null),k({}),Xi()},onClose:()=>$n(!1),zoomed:an==="files",onToggleZoom:ei("files")}),lt&&an!=="files"&&Pa("files"),i.jsx(xj,{open:gs,result:Ls,onSearch:du,onOpenMatch:Fa,onClose:()=>bs(!1),zoomed:an==="search",onToggleZoom:ei("search")}),gs&&an!=="search"&&Pa("search"),i.jsx(zw,{open:Kt,state:Fe,result:ps,selected:Zl,busy:zn,onRefresh:Xi,onShow:Gc,onCheckout:Is,onPush:Er,onPull:Za,onPublish:td,onConnectRemote:vs,onDismissResult:()=>mn(null),onClose:()=>on(!1),zoomed:an==="git",onToggleZoom:ei("git")}),Kt&&an!=="git"&&Pa("git"),i.jsxs("main",{className:an==="main"||an==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>De(!0),children:"☰"}),i.jsx("button",{className:lt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":lt,onClick:()=>{$n(p=>!p),on(!1),bs(!1)},children:i.jsx(bN,{})}),i.jsx("button",{className:gs?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":gs,onClick:()=>{bs(p=>!p),$n(!1),on(!1)},children:i.jsx(xN,{})}),i.jsx("button",{className:Kt?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Kt,onClick:()=>{on(p=>!p),$n(!1),bs(!1)},children:i.jsx(yN,{})}),ra&&i.jsx("button",{className:ia?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ia,onClick:()=>Xn(p=>!p),children:i.jsx(SN,{})}),Xe&&xu,Xe&&i.jsx("button",{className:Ve?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Ve,onClick:()=>It(!0),children:i.jsx(kN,{})}),i.jsxs("div",{className:"topbar__id",children:[yt&&X?i.jsx(na,{className:"rename--title",value:X.title??"",onCommit:p=>{cu(X,p),$e(!1)},onCancel:()=>$e(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!X||Xe,title:X&&!Xe?"Переименовать сессию":void 0,onClick:()=>$e(!0),children:(X==null?void 0:X.title)??"Claude Code Visual"}),Xa&&i.jsx("span",{className:"topbar__project",title:Xa.path,children:Xa.name})]}),Xe?ti:Gl&&i.jsx(Zy,{path:Gl})]}),!Xe&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:il?"meters-refresh is-busy":"meters-refresh",title:tu,"aria-label":Rc,"aria-busy":il,disabled:!z||il,onClick:es,children:i.jsx(NN,{})}),i.jsx(Wy,{usage:Mc}),i.jsx(t_,{}),bu,un,ti,Or&&i.jsx("span",{className:"badge badge--cost",children:Or}),Lr,yu,xu]})]}),i.jsx(cN,{tokens:(nn==null?void 0:nn.tokens)??V.contextTokens,maxTokens:(nn==null?void 0:nn.maxTokens)??null,fetchedAt:(nn==null?void 0:nn.fetchedAt)??null}),Xe&&Ve&&i.jsx(hk,{onClose:()=>It(!1),permission:bu,model:un,usage:Mc,cwd:Gl,costLabel:Or,onRefresh:es,refreshing:il,metersFetchedAt:Ac,onRename:X?()=>{$e(!0),It(!1)}:null,onHandoff:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{ru(X),It(!1)}:null,onFreshSession:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{Hc(X),It(!1)}:null,handoffWriting:Rl,onStop:X&&X.state!=="closed"?()=>{_s(X),It(!1)}:null}),we.length>0&&i.jsx(Uj,{files:we,activePath:ze,busy:Jn,onSelect:dt,onClose:p=>ga(p),zoomed:an==="main",onToggleZoom:ei("main")}),_n?i.jsx(Lj,{file:_n,goto:(sa==null?void 0:sa.path)===_n.path?sa:null,onChange:(p,I)=>{Ae(de=>de.map(Ge=>Ge.path===p?{...Ge,text:I}:Ge)),ls(p)},onSave:p=>Fn(p),onReload:Cl,onOverwrite:p=>Fn(p,!0),onRequestMedia:qs,onTogglePreview:p=>Ae(I=>I.map(de=>de.path===p?{...de,previewMode:!de.previewMode}:de))}):i.jsxs(i.Fragment,{children:[i.jsx(Op,{items:V.items,busy:Jn&&!yl,waiting:ss,empty:(X==null?void 0:X.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:eu,historyHasMore:Db(me),historyLoading:me.loading,onLoadHistory:kr,sessionId:z??void 0,onEditMessage:(X==null?void 0:X.provider)==="antigravity"?void 0:(p,I,de)=>{z&&ee({type:"prompt.edit",sessionId:z,userIndex:p,text:I,images:de})}}),li,ld,z&&((ya=X==null?void 0:X.tasks)!=null&&ya.length)?i.jsx(Gj,{tasks:X.tasks,onStop:p=>ee({type:"task.stop",sessionId:z,taskId:p})}):null,i.jsx(Qy,{disabled:!z,busy:Jn&&!yl,placeholder:yl?"Промпт уйдёт, как только связь вернётся":(X==null?void 0:X.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:Kc,sessionTitle:(X==null?void 0:X.title)??null,contextResult:hu,draftKey:z,onContextSearch:p=>Ar("mention",p),onCommand:ba,onSend:pa,onInterrupt:()=>{z&&ee({type:"control.interrupt",sessionId:z})}})]}),ia&&ra&&i.jsxs(i.Fragment,{children:[!Xe&&an!=="terminal"&&i.jsx(Wk,{height:Us.height,onResize:Us.setHeight,onReset:Us.reset}),i.jsx(nN,{mobile:Xe,zoomed:an==="terminal",onToggleZoom:ei("terminal"),terminals:Pl,activeId:zi,blocked:yr,error:kc,onDismissError:()=>Ha(null),height:Xe?Ba.height:Us.height,offset:Xe?{top:Ba.offsetTop,left:Ba.offsetLeft}:void 0,onSelect:xr,onOpen:zt,onClose:st,onInput:(p,I)=>ee({type:"term.input",id:p,data:I}),onResize:(p,I,de)=>ee({type:"term.resize",id:p,cols:I,rows:de}),onAttach:p=>ee({type:"term.attach",id:p}),onHide:()=>Xn(!1),registerSink:Tc})]})]}),i.jsx(lk,{open:ca,items:Vo.items,busy:xa,ready:z!==null,commands:Kc,contextResult:El,draftKey:z,models:Vi.rows,model:Vi.selected,effort:as.effort,ultracode:as.ultracode,thinking:as.thinking,switchOnFlag:as.switchOnFlag,onContextSearch:p=>Ar("side",p),onCommand:ba,onModel:p=>{p&&(oa(I=>({...I,model:p})),Bs(I=>ee({type:"control.set_model",sessionId:I,model:p})))},onEffort:p=>{oa(I=>({...I,effort:p,ultracode:!1})),Bs(I=>ee({type:"control.set_effort",sessionId:I,effort:p}))},onUltracode:p=>{oa(I=>({...I,ultracode:p,...p?{effort:"xhigh"}:{}})),Bs(I=>ee({type:"control.set_ultracode",sessionId:I,enabled:p}))},onThinking:p=>{oa(I=>({...I,thinking:p})),Bs(I=>ee({type:"control.set_thinking",sessionId:I,enabled:p}))},onSwitchOnFlag:p=>{oa(I=>({...I,switchOnFlag:p})),Bs(I=>ee({type:"control.set_flag_switch",sessionId:I,enabled:p}))},onAsk:Ka,onInterrupt:()=>{Xo&&ee({type:"control.interrupt",sessionId:Xo})},onReset:qc,onClose:()=>_r(!1),zoomed:an==="ask",onToggleZoom:ei("ask")}),ca&&an!=="ask"&&Pa("ask"),(Kt||ca||lt||gs)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{on(!1),_r(!1),$n(!1),bs(!1)}}),Ms&&i.jsx(Bw,{detail:Ms,local:((Fe==null?void 0:Fe.hasRemote)??!1)&&(Fe==null?void 0:Fe.commits.some(p=>p.hash===Ms.hash&&!p.pushed))===!0,onCheckout:Is,onClose:()=>{Gn(null),hs(null)}}),ue&&i.jsx(Sl,{title:"Остановить сессию?",onClose:()=>je(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>je(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{ee({type:"session.close",sessionId:ue.id}),je(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Fl&&i.jsxs(Sl,{title:"Переключить рабочее дерево?",onClose:()=>Zn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Zn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:uu,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",Fl.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Jn&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Fe&&Fe.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Fe.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Yn&&i.jsx(Jw,{status:Lt,owners:Di,files:La,defaultName:(Xa==null?void 0:Xa.name)??"",hasCommits:Fe===null||Fe.head!=="",busy:zn,result:ps,onRefreshStatus:Cr,onSaveToken:fu,onPublish:xl,onDismissResult:()=>mn(null),onClose:()=>Nl(!1)}),sn&&i.jsx(nk,{busy:zn,result:ps,onSubmit:Yc,onDismissResult:()=>mn(null),onClose:()=>Jl(!1)}),ke&&i.jsx(Sl,{title:ke.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Je(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Je(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>mu(ke),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[ke.path," будет удалён с диска",ke.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),ht&&i.jsx(Sl,{title:"Закрыть без сохранения?",onClose:()=>ms(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>ms(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>ga(ht,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{Fn(ht),ga(ht,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",ht," есть несохранённые правки."]})}),yn&&i.jsx(mk,{tab:yn,servers:pn,plugins:Gt,marketplaces:Et,catalog:wl,result:ge,actions:ou,onTab:qt,onClose:()=>qt(null)}),ds&&i.jsx(Sk,{status:al,login:Qt,actions:bl,remote:b,runningSessions:O.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:z?()=>{Dr(),hl(!1)}:null,reconnectBlocked:Jn,reconnectHint:ni,onClose:()=>hl(!1)}),m&&i.jsx(Ek,{state:d,onPair:(p,I)=>ee({type:"relay.pair",code:p,...I?{name:I}:{}}),onUnpair:()=>ee({type:"relay.unpair"}),onClose:()=>g(!1)}),kl&&i.jsx(qk,{settings:Yt,models:(ye==null?void 0:ye.models)??[],relayState:d,local:Mf()==="local",onChange:Tl,onEnableShell:()=>ee({type:"relay.shell.enable"}),onDisableShell:()=>ee({type:"relay.shell.disable"}),onOpenRelay:()=>{kt(!1),g(!0)},onClose:()=>kt(!1)}),rt&&i.jsx(kw,{candidates:ft,searching:Sn,agentItems:en.items,agentBusy:(et==null?void 0:et.state)==="running",error:$t,roots:St,created:cn,onSearch:Jf,onAskAgent:Wf,onInterrupt:()=>{const p=wr.current;p&&ee({type:"control.interrupt",sessionId:p})},onSubmit:Zf,onCreate:Ff,onClose:gl}),Wn!=null&&Wn.questions&&Wn.questions.length>0?i.jsx(mw,{request:{...Wn,questions:Wn.questions},queued:V.pending.length-1,onAnswer:Al,onDecline:Qc}):Wn&&$s!==null?i.jsx(xw,{request:Wn,plan:$s,queued:V.pending.length-1,onAccept:Ys,onDecline:gu}):Wn&&i.jsx(pw,{request:Wn,queued:V.pending.length-1,onDecide:Gs}),_e&&i.jsx($k,{handoff:_e,onClose:()=>Be(null)}),i.jsx(Qk,{notices:sl,onDismiss:p=>Bl(I=>I.filter(de=>de.id!==p))})]})}function bN(){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 xN(){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 yN(){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 _N(){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 vN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),i.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),i.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function jN(l,s){return ey(l)===ey(s)}function ey(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function SN(){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 wN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("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 kN(){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 NN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const l_=document.getElementById("root");if(!l_)throw new Error("#root not found");N0.createRoot(l_).render(i.jsx(y.StrictMode,{children:i.jsx(gN,{})}));export{N1 as D,Jt as I,Pt as N,CN as P,us as T,As as a,Cy as b,Hl as c,EN as d,Oy as e,qo as f,X1 as h,AN as p,MN as s,Te as t};
|