@i14ks/ccv 0.42.0 → 0.43.1
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 +21 -3
- package/package.json +1 -1
- package/web/assets/{codemirror-D_aocakD.js → codemirror-DsTONvL-.js} +1 -1
- package/web/assets/{index-Bqw5VmKB.js → index-1f2CtYmb.js} +1 -1
- package/web/assets/{index-Jj_AHiE6.js → index-B5PgjCy2.js} +1 -1
- package/web/assets/index-B5TsjSo7.js +135 -0
- package/web/assets/{index-kZWq9En4.js → index-BEknqxbE.js} +1 -1
- package/web/assets/{index-Daw0RVbK.js → index-BMdxgpgr.js} +1 -1
- package/web/assets/{index-D3QPzaZ2.js → index-BieVw7oe.js} +1 -1
- package/web/assets/{index-BUB7eB21.js → index-CKm4LyXr.js} +1 -1
- package/web/assets/{index-CU5O6qy8.js → index-CTOsqnj0.js} +1 -1
- package/web/assets/{index-CGl8tRHI.js → index-CdCc_AYg.js} +1 -1
- package/web/assets/{index-k5pUSa38.js → index-Cs3FSccd.js} +1 -1
- package/web/assets/{index-B0wzgXzo.js → index-DFrY42c9.js} +1 -1
- package/web/assets/{index-DP6n5Sf2.js → index-DIp8Svzr.js} +1 -1
- package/web/assets/{index-HJo8MrpC.js → index-DSH6K6tq.js} +1 -1
- package/web/assets/{index-Djyf6cqy.js → index-D_IqGnua.js} +1 -1
- package/web/assets/{index-DSyXOala.js → index-Duur5KBZ.js} +1 -1
- package/web/assets/{index-Ah1jCJ1U.js → index-DvbV5juq.js} +1 -1
- package/web/assets/{index-DRswmveP.js → index-M02GPU4M.js} +1 -1
- package/web/assets/{index-UG3FALpE.js → index-eBfccJOZ.js} +1 -1
- package/web/assets/{index-CTJjaC2C.js → index-qP25soUp.js} +1 -1
- package/web/assets/{index-aSVj6-S6.js → index-uknuSOmh.js} +1 -1
- package/web/index.html +1 -1
- package/web/assets/index-tzF8oiHD.js +0 -135
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DSyXOala.js","./index-CTJjaC2C.js","./index-HJo8MrpC.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-UG3FALpE.js","./index-DRswmveP.js","./index-Bqw5VmKB.js","./index-Jj_AHiE6.js","./index-k5pUSa38.js","./index-Daw0RVbK.js","./index-DP6n5Sf2.js","./index-D3QPzaZ2.js","./index-CGl8tRHI.js","./index-B0wzgXzo.js","./index-Djyf6cqy.js","./index-kZWq9En4.js","./index-aSVj6-S6.js","./index-BUB7eB21.js","./index-Ah1jCJ1U.js","./index-CU5O6qy8.js","./codemirror-D_aocakD.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 ev=Object.defineProperty;var $x=n=>{throw TypeError(n)};var tv=(n,l,r)=>l in n?ev(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r;var Zt=(n,l,r)=>tv(n,typeof l!="symbol"?l+"":l,r),Fh=(n,l,r)=>l.has(n)||$x("Cannot "+r);var Je=(n,l,r)=>(Fh(n,l,"read from private field"),r?r.call(n):l.get(n)),Nn=(n,l,r)=>l.has(n)?$x("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,r),Dt=(n,l,r,c)=>(Fh(n,l,"write to private field"),c?c.call(n,r):l.set(n,r),r),Yn=(n,l,r)=>(Fh(n,l,"access private method"),r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Zh={exports:{}},cu={};/**
|
|
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 qx;function nv(){if(qx)return cu;qx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:d}}return cu.Fragment=l,cu.jsx=r,cu.jsxs=r,cu}var Gx;function sv(){return Gx||(Gx=1,Zh.exports=nv()),Zh.exports}var a=sv(),Jh={exports:{}},nt={};/**
|
|
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 Yx;function lv(){if(Yx)return nt;Yx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function F(E,ne,X){this.props=E,this.context=ne,this.refs=A,this.updater=X||k}F.prototype.isReactComponent={},F.prototype.setState=function(E,ne){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,ne,"setState")},F.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Q(){}Q.prototype=F.prototype;function q(E,ne,X){this.props=E,this.context=ne,this.refs=A,this.updater=X||k}var B=q.prototype=new Q;B.constructor=q,C(B,F.prototype),B.isPureReactComponent=!0;var Y=Array.isArray;function M(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function Z(E,ne,X){var Ne=X.ref;return{$$typeof:n,type:E,key:ne,ref:Ne!==void 0?Ne:null,props:X}}function re(E,ne){return Z(E.type,ne,E.props)}function G(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function $(E){var ne={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(X){return ne[X]})}var he=/\/+/g;function ve(E,ne){return typeof E=="object"&&E!==null&&E.key!=null?$(""+E.key):ne.toString(36)}function K(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(M,M):(E.status="pending",E.then(function(ne){E.status==="pending"&&(E.status="fulfilled",E.value=ne)},function(ne){E.status==="pending"&&(E.status="rejected",E.reason=ne)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function O(E,ne,X,Ne,U){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var Le=!1;if(E===null)Le=!0;else switch(ye){case"bigint":case"string":case"number":Le=!0;break;case"object":switch(E.$$typeof){case n:case l:Le=!0;break;case y:return Le=E._init,O(Le(E._payload),ne,X,Ne,U)}}if(Le)return U=U(E),Le=Ne===""?"."+ve(E,0):Ne,Y(U)?(X="",Le!=null&&(X=Le.replace(he,"$&/")+"/"),O(U,ne,X,"",function($t){return $t})):U!=null&&(G(U)&&(U=re(U,X+(U.key==null||E&&E.key===U.key?"":(""+U.key).replace(he,"$&/")+"/")+Le)),ne.push(U)),1;Le=0;var Ie=Ne===""?".":Ne+":";if(Y(E))for(var qe=0;qe<E.length;qe++)Ne=E[qe],ye=Ie+ve(Ne,qe),Le+=O(Ne,ne,X,ye,U);else if(qe=S(E),typeof qe=="function")for(E=qe.call(E),qe=0;!(Ne=E.next()).done;)Ne=Ne.value,ye=Ie+ve(Ne,qe++),Le+=O(Ne,ne,X,ye,U);else if(ye==="object"){if(typeof E.then=="function")return O(K(E),ne,X,Ne,U);throw ne=String(E),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Le}function I(E,ne,X){if(E==null)return E;var Ne=[],U=0;return O(E,Ne,"","",function(ye){return ne.call(X,ye,U++)}),Ne}function oe(E){if(E._status===-1){var ne=E._result;ne=ne(),ne.then(function(X){(E._status===0||E._status===-1)&&(E._status=1,E._result=X)},function(X){(E._status===0||E._status===-1)&&(E._status=2,E._result=X)}),E._status===-1&&(E._status=0,E._result=ne)}if(E._status===1)return E._result.default;throw E._result}var pe=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=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(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},je={map:I,forEach:function(E,ne,X){I(E,function(){ne.apply(this,arguments)},X)},count:function(E){var ne=0;return I(E,function(){ne++}),ne},toArray:function(E){return I(E,function(ne){return ne})||[]},only:function(E){if(!G(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return nt.Activity=j,nt.Children=je,nt.Component=F,nt.Fragment=r,nt.Profiler=o,nt.PureComponent=q,nt.StrictMode=c,nt.Suspense=g,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,nt.__COMPILER_RUNTIME={__proto__:null,c:function(E){return z.H.useMemoCache(E)}},nt.cache=function(E){return function(){return E.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(E,ne,X){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var Ne=C({},E.props),U=E.key;if(ne!=null)for(ye in ne.key!==void 0&&(U=""+ne.key),ne)!R.call(ne,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&ne.ref===void 0||(Ne[ye]=ne[ye]);var ye=arguments.length-2;if(ye===1)Ne.children=X;else if(1<ye){for(var Le=Array(ye),Ie=0;Ie<ye;Ie++)Le[Ie]=arguments[Ie+2];Ne.children=Le}return Z(E.type,U,Ne)},nt.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},nt.createElement=function(E,ne,X){var Ne,U={},ye=null;if(ne!=null)for(Ne in ne.key!==void 0&&(ye=""+ne.key),ne)R.call(ne,Ne)&&Ne!=="key"&&Ne!=="__self"&&Ne!=="__source"&&(U[Ne]=ne[Ne]);var Le=arguments.length-2;if(Le===1)U.children=X;else if(1<Le){for(var Ie=Array(Le),qe=0;qe<Le;qe++)Ie[qe]=arguments[qe+2];U.children=Ie}if(E&&E.defaultProps)for(Ne in Le=E.defaultProps,Le)U[Ne]===void 0&&(U[Ne]=Le[Ne]);return Z(E,ye,U)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(E){return{$$typeof:m,render:E}},nt.isValidElement=G,nt.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:oe}},nt.memo=function(E,ne){return{$$typeof:b,type:E,compare:ne===void 0?null:ne}},nt.startTransition=function(E){var ne=z.T,X={};z.T=X;try{var Ne=E(),U=z.S;U!==null&&U(X,Ne),typeof Ne=="object"&&Ne!==null&&typeof Ne.then=="function"&&Ne.then(M,pe)}catch(ye){pe(ye)}finally{ne!==null&&X.types!==null&&(ne.types=X.types),z.T=ne}},nt.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},nt.use=function(E){return z.H.use(E)},nt.useActionState=function(E,ne,X){return z.H.useActionState(E,ne,X)},nt.useCallback=function(E,ne){return z.H.useCallback(E,ne)},nt.useContext=function(E){return z.H.useContext(E)},nt.useDebugValue=function(){},nt.useDeferredValue=function(E,ne){return z.H.useDeferredValue(E,ne)},nt.useEffect=function(E,ne){return z.H.useEffect(E,ne)},nt.useEffectEvent=function(E){return z.H.useEffectEvent(E)},nt.useId=function(){return z.H.useId()},nt.useImperativeHandle=function(E,ne,X){return z.H.useImperativeHandle(E,ne,X)},nt.useInsertionEffect=function(E,ne){return z.H.useInsertionEffect(E,ne)},nt.useLayoutEffect=function(E,ne){return z.H.useLayoutEffect(E,ne)},nt.useMemo=function(E,ne){return z.H.useMemo(E,ne)},nt.useOptimistic=function(E,ne){return z.H.useOptimistic(E,ne)},nt.useReducer=function(E,ne,X){return z.H.useReducer(E,ne,X)},nt.useRef=function(E){return z.H.useRef(E)},nt.useState=function(E){return z.H.useState(E)},nt.useSyncExternalStore=function(E,ne,X){return z.H.useSyncExternalStore(E,ne,X)},nt.useTransition=function(){return z.H.useTransition()},nt.version="19.2.8",nt}var Xx;function Ip(){return Xx||(Xx=1,Jh.exports=lv()),Jh.exports}var x=Ip(),Wh={exports:{}},ou={},Ph={exports:{}},ep={};/**
|
|
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 Vx;function av(){return Vx||(Vx=1,(function(n){function l(O,I){var oe=O.length;O.push(I);e:for(;0<oe;){var pe=oe-1>>>1,je=O[pe];if(0<o(je,I))O[pe]=I,O[oe]=je,oe=pe;else break e}}function r(O){return O.length===0?null:O[0]}function c(O){if(O.length===0)return null;var I=O[0],oe=O.pop();if(oe!==I){O[0]=oe;e:for(var pe=0,je=O.length,E=je>>>1;pe<E;){var ne=2*(pe+1)-1,X=O[ne],Ne=ne+1,U=O[Ne];if(0>o(X,oe))Ne<je&&0>o(U,X)?(O[pe]=U,O[Ne]=oe,pe=Ne):(O[pe]=X,O[ne]=oe,pe=ne);else if(Ne<je&&0>o(U,oe))O[pe]=U,O[Ne]=oe,pe=Ne;else break e}}return I}function o(O,I){var oe=O.sortIndex-I.sortIndex;return oe!==0?oe:O.id-I.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var g=[],b=[],y=1,j=null,v=3,S=!1,k=!1,C=!1,A=!1,F=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function B(O){for(var I=r(b);I!==null;){if(I.callback===null)c(b);else if(I.startTime<=O)c(b),I.sortIndex=I.expirationTime,l(g,I);else break;I=r(b)}}function Y(O){if(C=!1,B(O),!k)if(r(g)!==null)k=!0,M||(M=!0,$());else{var I=r(b);I!==null&&K(Y,I.startTime-O)}}var M=!1,z=-1,R=5,Z=-1;function re(){return A?!0:!(n.unstable_now()-Z<R)}function G(){if(A=!1,M){var O=n.unstable_now();Z=O;var I=!0;try{e:{k=!1,C&&(C=!1,Q(z),z=-1),S=!0;var oe=v;try{t:{for(B(O),j=r(g);j!==null&&!(j.expirationTime>O&&re());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var je=pe(j.expirationTime<=O);if(O=n.unstable_now(),typeof je=="function"){j.callback=je,B(O),I=!0;break t}j===r(g)&&c(g),B(O)}else c(g);j=r(g)}if(j!==null)I=!0;else{var E=r(b);E!==null&&K(Y,E.startTime-O),I=!1}}break e}finally{j=null,v=oe,S=!1}I=void 0}}finally{I?$():M=!1}}}var $;if(typeof q=="function")$=function(){q(G)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,ve=he.port2;he.port1.onmessage=G,$=function(){ve.postMessage(null)}}else $=function(){F(G,0)};function K(O,I){z=F(function(){O(n.unstable_now())},I)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(O){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var oe=v;v=I;try{return O()}finally{v=oe}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var oe=v;v=O;try{return I()}finally{v=oe}},n.unstable_scheduleCallback=function(O,I,oe){var pe=n.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?pe+oe:pe):oe=pe,O){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=oe+je,O={id:y++,callback:I,priorityLevel:O,startTime:oe,expirationTime:je,sortIndex:-1},oe>pe?(O.sortIndex=oe,l(b,O),r(g)===null&&O===r(b)&&(C?(Q(z),z=-1):C=!0,K(Y,oe-pe))):(O.sortIndex=je,l(g,O),k||S||(k=!0,M||(M=!0,$()))),O},n.unstable_shouldYield=re,n.unstable_wrapCallback=function(O){var I=v;return function(){var oe=v;v=I;try{return O.apply(this,arguments)}finally{v=oe}}}})(ep)),ep}var Qx;function iv(){return Qx||(Qx=1,Ph.exports=av()),Ph.exports}var tp={exports:{}},xs={};/**
|
|
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 Kx;function rv(){if(Kx)return xs;Kx=1;var n=Ip();function l(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)b+="&args[]="+encodeURIComponent(arguments[y])}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(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,b,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:b,implementation:y}}var h=n.__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 xs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,xs.createPortal=function(g,b){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(l(299));return d(g,b,null,y)},xs.flushSync=function(g){var b=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=y,c.d.f()}},xs.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))},xs.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},xs.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var y=b.as,j=m(y,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,S=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;y==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:S}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:S,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},xs.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var y=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:y,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)},xs.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var y=b.as,j=m(y,b.crossOrigin);c.d.L(g,y,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},xs.preloadModule=function(g,b){if(typeof g=="string")if(b){var y=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:y,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},xs.requestFormReset=function(g){c.d.r(g)},xs.unstable_batchedUpdates=function(g,b){return g(b)},xs.useFormState=function(g,b,y){return h.H.useFormState(g,b,y)},xs.useFormStatus=function(){return h.H.useHostTransitionStatus()},xs.version="19.2.8",xs}var Fx;function cv(){if(Fx)return tp.exports;Fx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),tp.exports=rv(),tp.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 Zx;function ov(){if(Zx)return ou;Zx=1;var n=iv(),l=Ip(),r=cv();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s: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 s=e,i=t;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(c(188))}if(s.return!==i.return)s=u,i=f;else{for(var _=!1,N=u.child;N;){if(N===s){_=!0,s=u,i=f;break}if(N===i){_=!0,i=u,s=f;break}N=N.sibling}if(!_){for(N=f.child;N;){if(N===s){_=!0,s=f,i=u;break}if(N===i){_=!0,i=f,s=u;break}N=N.sibling}if(!_)throw Error(c(189))}}if(s.alternate!==i)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),q=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function ve(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case F:return"Profiler";case A:return"StrictMode";case Y:return"Suspense";case M:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case q:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:ve(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return ve(e(t))}catch{}}return null}var K=Array.isArray,O=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},pe=[],je=-1;function E(e){return{current:e}}function ne(e){0>je||(e.current=pe[je],pe[je]=null,je--)}function X(e,t){je++,pe[je]=e.current,e.current=t}var Ne=E(null),U=E(null),ye=E(null),Le=E(null);function Ie(e,t){switch(X(ye,t),X(U,e),X(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ux(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ux(t),e=dx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ne(Ne),X(Ne,e)}function qe(){ne(Ne),ne(U),ne(ye)}function $t(e){e.memoizedState!==null&&X(Le,e);var t=Ne.current,s=dx(t,e.type);t!==s&&(X(U,e),X(Ne,s))}function Ve(e){U.current===e&&(ne(Ne),ne(U)),Le.current===e&&(ne(Le),lu._currentValue=oe)}var Cn,it;function lt(e){if(Cn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Cn=t&&t[1]||"",it=-1<s.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+Cn+e+it}var tt=!1;function Lt(e,t){if(!e||tt)return"";tt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ce){var ie=ce}Reflect.construct(e,[],xe)}else{try{xe.call()}catch(ce){ie=ce}e.call(xe.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(xe=e())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),_=f[0],N=f[1];if(_&&N){var D=_.split(`
|
|
45
|
-
`),le=N.split(`
|
|
46
|
-
`);for(u=i=0;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;for(;u<le.length&&!le[u].includes("DetermineComponentFrameRoot");)u++;if(i===D.length||u===le.length)for(i=D.length-1,u=le.length-1;1<=i&&0<=u&&D[i]!==le[u];)u--;for(;1<=i&&0<=u;i--,u--)if(D[i]!==le[u]){if(i!==1||u!==1)do if(i--,u--,0>u||D[i]!==le[u]){var fe=`
|
|
47
|
-
`+D[i].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=i&&0<=u);break}}}finally{tt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?lt(s):""}function _t(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return Lt(e.type,!1);case 11:return Lt(e.type.render,!1);case 1:return Lt(e.type,!0);case 31:return lt("Activity");default:return""}}function vt(e){try{var t="",s=null;do t+=_t(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
|
|
48
|
-
Error generating stack: `+i.message+`
|
|
49
|
-
`+i.stack}}var qt=Object.prototype.hasOwnProperty,Te=n.unstable_scheduleCallback,We=n.unstable_cancelCallback,At=n.unstable_shouldYield,gt=n.unstable_requestPaint,Ye=n.unstable_now,wn=n.unstable_getCurrentPriorityLevel,zn=n.unstable_ImmediatePriority,St=n.unstable_UserBlockingPriority,Jt=n.unstable_NormalPriority,hs=n.unstable_LowPriority,An=n.unstable_IdlePriority,xn=n.log,as=n.unstable_setDisableYieldValue,zt=null,on=null;function ln(e){if(typeof xn=="function"&&as(e),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(zt,e)}catch{}}var Gt=Math.clz32?Math.clz32:ke,Zn=Math.log,ue=Math.LN2;function ke(e){return e>>>=0,e===0?32:31-(Zn(e)/ue|0)|0}var Qe=256,rt=262144,He=4194304;function Pe(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 W(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~f,i!==0?u=Pe(i):(_&=N,_!==0?u=Pe(_):s||(s=N&~e,s!==0&&(u=Pe(s))))):(N=i&~f,N!==0?u=Pe(N):_!==0?u=Pe(_):s||(s=i&~e,s!==0&&(u=Pe(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Re(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 Ge(){var e=He;return He<<=1,(He&62914560)===0&&(He=4194304),e}function Yt(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Mn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ms(e,t,s,i,u,f){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var N=e.entanglements,D=e.expirationTimes,le=e.hiddenUpdates;for(s=_&~s;0<s;){var fe=31-Gt(s),xe=1<<fe;N[fe]=0,D[fe]=-1;var ie=le[fe];if(ie!==null)for(le[fe]=null,fe=0;fe<ie.length;fe++){var ce=ie[fe];ce!==null&&(ce.lane&=-536870913)}s&=~xe}i!==0&&Rl(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(_&~t))}function Rl(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Gt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function ea(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-Gt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function Rs(e,t){var s=t&-t;return s=(s&42)!==0?1:vs(s),(s&(e.suspendedLanes|t))!==0?0:s}function vs(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 bn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Qs(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Ox(e.type))}function yn(e,t){var s=I.p;try{return I.p=e,t()}finally{I.p=s}}var ps=Math.random().toString(36).slice(2),Xt="__reactFiber$"+ps,Ze="__reactProps$"+ps,Vn="__reactContainer$"+ps,hl="__reactEvents$"+ps,ta="__reactListeners$"+ps,Dl="__reactHandles$"+ps,is="__reactResources$"+ps,js="__reactMarker$"+ps;function na(e){delete e[Xt],delete e[Ze],delete e[hl],delete e[ta],delete e[Dl]}function pl(e){var t=e[Xt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Vn]||s[Xt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bx(e);e!==null;){if(s=e[Xt])return s;e=bx(e)}return t}e=s,s=e.parentNode}return null}function Ks(e){if(e=e[Xt]||e[Vn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ml(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function an(e){var t=e[is];return t||(t=e[is]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ut(e){e[js]=!0}var Ds=new Set,Fs={};function ms(e,t){Jn(e,t),Jn(e+"Capture",t)}function Jn(e,t){for(Fs[e]=t,e=0;e<t.length;e++)Ds.add(t[e])}var rs=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]*$"),gl={},gs={};function Os(e){return qt.call(gs,e)?!0:qt.call(gl,e)?!1:rs.test(e)?gs[e]=!0:(gl[e]=!0,!1)}function yt(e,t,s){if(Os(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Wn(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function jt(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ol(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,f.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qn(e){if(!e._valueTracker){var t=sa(e)?"checked":"value";e._valueTracker=Ol(e,t,""+e[t])}}function Ls(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=sa(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function Un(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 kt(e){return e.replace(la,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zs(e,t,s,i,u,f,_,N){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Rn(e,_,ct(t)):s!=null?Rn(e,_,ct(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+ct(N):e.removeAttribute("name")}function Wt(e,t,s,i,u,f,_,N){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Qn(e);return}s=s!=null?""+ct(s):"",t=t!=null?""+ct(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Qn(e)}function Rn(e,t,s){t==="number"&&Un(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function un(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+ct(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function we(e,t,s){if(t!=null&&(t=""+ct(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+ct(s):""}function T(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(c(92));if(K(i)){if(1<i.length)throw Error(c(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=ct(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Qn(e)}function P(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var be=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 Me(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||be.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function $e(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&Me(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Me(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 Ut=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"]]),dn=/^[\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 fn(e){return dn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vt(){}var kn=null;function Pt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dn=null,Js=null;function en(e){var t=Ks(e);if(t&&(e=t.stateNode)){var s=e[Ze]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zs(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[Ze]||null;if(!u)throw Error(c(90));Zs(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&Ls(i)}break e;case"textarea":we(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&un(e,!!s.multiple,t,!1)}}}var Ma=!1;function In(e,t,s){if(Ma)return e(t,s);Ma=!0;try{var i=e(t);return i}finally{if(Ma=!1,(Dn!==null||Js!==null)&&(xd(),Dn&&(t=Dn,e=Js,Js=Dn=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function Ra(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Ze]||null;if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var Ws=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gi=!1;if(Ws)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){gi=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch{gi=!1}var xl=null,Ll=null,Da=null;function xi(){if(Da)return Da;var e,t=Ll,s=t.length,i,u="value"in xl?xl.value:xl.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(i=1;i<=_&&t[s-i]===u[f-i];i++);return Da=u.slice(e,1<i?1-i:void 0)}function zl(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 bl(){return!0}function w(){return!1}function ee(e){function t(s,i,u,f,_){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=_,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(f):f[N]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?bl:w,this.isPropagationStopped=w,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),t}var _e={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},De=ee(_e),ft=j({},_e,{view:0,detail:0}),Pn=ee(ft),Qt,vn,ia,_l=j({},ft,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ur,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!==ia&&(ia&&e.type==="mousemove"?(Qt=e.screenX-ia.screenX,vn=e.screenY-ia.screenY):vn=Qt=0,ia=e),Qt)},movementY:function(e){return"movementY"in e?e.movementY:vn}}),Tu=ee(_l),ra=j({},_l,{dataTransfer:0}),rr=ee(ra),ec=j({},ft,{relatedTarget:0}),Oa=ee(ec),tc=j({},_e,{animationName:0,elapsedTime:0,pseudoElement:0}),Af=ee(tc),yo=j({},_e,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nc=ee(yo),Cu=j({},_e,{data:0}),cr=ee(Cu),Au={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},La={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"},or={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=or[e])?!!t[e]:!1}function ur(){return Mf}var sc=j({},ft,{key:function(e){if(e.key){var t=Au[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?La[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ur,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vo=ee(sc),Mu=j({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dr=ee(Mu),bi=j({},ft,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ur}),jo=ee(bi),lc=j({},_e,{propertyName:0,elapsedTime:0,pseudoElement:0}),fr=ee(lc),Rf=j({},_l,{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}),ac=ee(Rf),Df=j({},_e,{newState:0,oldState:0}),ic=ee(Df),rc=[9,13,27,32],hr=Ws&&"CompositionEvent"in window,Ul=null;Ws&&"documentMode"in document&&(Ul=document.documentMode);var za=Ws&&"TextEvent"in window&&!Ul,pr=Ws&&(!hr||Ul&&8<Ul&&11>=Ul),cc=" ",Ru=!1;function ca(e,t){switch(e){case"keyup":return rc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ua=!1;function oc(e,t){switch(e){case"compositionend":return mr(t);case"keypress":return t.which!==32?null:(Ru=!0,cc);case"textInput":return e=t.data,e===cc&&Ru?null:e;default:return null}}function Du(e,t){if(Ua)return e==="compositionend"||!hr&&ca(e,t)?(e=xi(),Da=Ll=xl=null,Ua=!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 pr&&t.locale!=="ko"?null:t.data;default:return null}}var uc={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 yl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uc[e.type]:t==="textarea"}function gr(e,t,s,i){Dn?Js?Js.push(i):Js=[i]:Dn=i,t=wd(t,"onChange"),0<t.length&&(s=new De("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Il=null,Ps=null;function xr(e){lx(e,0)}function tn(e){var t=ml(e);if(Ls(t))return e}function dc(e,t){if(e==="change")return t}var Ou=!1;if(Ws){var No;if(Ws){var br="oninput"in document;if(!br){var _r=document.createElement("div");_r.setAttribute("oninput","return;"),br=typeof _r.oninput=="function"}No=br}else No=!1;Ou=No&&(!document.documentMode||9<document.documentMode)}function On(){Il&&(Il.detachEvent("onpropertychange",_i),Ps=Il=null)}function _i(e){if(e.propertyName==="value"&&tn(Ps)){var t=[];gr(t,Ps,e,Pt(e)),In(xr,t)}}function yr(e,t,s){e==="focusin"?(On(),Il=t,Ps=s,Il.attachEvent("onpropertychange",_i)):e==="focusout"&&On()}function Lu(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tn(Ps)}function Hn(e,t){if(e==="click")return tn(t)}function zu(e,t){if(e==="input"||e==="change")return tn(t)}function Uu(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:Uu;function yi(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!qt.call(t,u)||!jn(e[u],t[u]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var s=vr(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=vr(s)}}function vi(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vi(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oa(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Un(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Un(e.document)}return t}function fc(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 Nr=Ws&&"documentMode"in document&&11>=document.documentMode,Hl=null,Ia=null,Bl=null,hc=!1;function ji(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;hc||Hl==null||Hl!==Un(i)||(i=Hl,"selectionStart"in i&&fc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Bl&&yi(Bl,i)||(Bl=i,i=wd(Ia,"onSelect"),0<i.length&&(t=new De("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Hl)))}function Ha(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ae={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},ua={},pc={};Ws&&(pc=document.createElement("div").style,"AnimationEvent"in window||(delete ae.animationend.animation,delete ae.animationiteration.animation,delete ae.animationstart.animation),"TransitionEvent"in window||delete ae.transitionend.transition);function Ba(e){if(ua[e])return ua[e];if(!ae[e])return e;var t=ae[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in pc)return ua[e]=t[s];return e}var Iu=Ba("animationend"),J=Ba("animationiteration"),vl=Ba("animationstart"),el=Ba("transitionrun"),Hu=Ba("transitionstart"),mc=Ba("transitioncancel"),wo=Ba("transitionend"),Bu=new Map,Ns="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(" ");Ns.push("scrollEnd");function tl(e,t){Bu.set(e,t),ms(t,[e])}var wr=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)},zs=[],nl=0,gc=0;function xc(){for(var e=nl,t=gc=nl=0;t<e;){var s=zs[t];zs[t++]=null;var i=zs[t];zs[t++]=null;var u=zs[t];zs[t++]=null;var f=zs[t];if(zs[t++]=null,i!==null&&u!==null){var _=i.pending;_===null?u.next=u:(u.next=_.next,_.next=u),i.pending=u}f!==0&&qa(s,u,f)}}function bc(e,t,s,i){zs[nl++]=e,zs[nl++]=t,zs[nl++]=s,zs[nl++]=i,gc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function ko(e,t,s,i){return bc(e,t,s,i),_c(e)}function $a(e,t){return bc(e,null,null,t),_c(e)}function qa(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),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-Gt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function _c(e){if(50<Jo)throw Jo=0,_h=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function $u(e,t,s,i){this.tag=e,this.key=s,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ws(e,t,s,i){return new $u(e,t,s,i)}function So(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $l(e,t){var s=e.alternate;return s===null?(s=ws(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function qu(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yc(e,t,s,i,u,f){var _=0;if(i=e,typeof e=="function")So(e)&&(_=1);else if(typeof e=="string")_=q0(e,s,Ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Z:return e=ws(31,s,t,u),e.elementType=Z,e.lanes=f,e;case C:return Ga(s.children,u,f,t);case A:_=8,u|=24;break;case F:return e=ws(12,s,t,u|2),e.elementType=F,e.lanes=f,e;case Y:return e=ws(13,s,t,u),e.elementType=Y,e.lanes=f,e;case M:return e=ws(19,s,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:_=10;break e;case Q:_=9;break e;case B:_=11;break e;case z:_=14;break e;case R:_=16,i=null;break e}_=29,s=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=ws(_,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Ga(e,t,s,i){return e=ws(7,e,i,t),e.lanes=s,e}function Eo(e,t,s){return e=ws(6,e,null,t),e.lanes=s,e}function Gu(e){var t=ws(18,null,null,0);return t.stateNode=e,t}function kr(e,t,s){return t=ws(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yu=new WeakMap;function Us(e,t){if(typeof e=="object"&&e!==null){var s=Yu.get(e);return s!==void 0?s:(t={value:e,source:t,stack:vt(t)},Yu.set(e,t),t)}return{value:e,source:t,stack:vt(t)}}var da=[],wi=0,vc=null,Ya=0,Is=[],ks=0,jl=null,sl=1,Hs="";function Nl(e,t){da[wi++]=Ya,da[wi++]=vc,vc=e,Ya=t}function To(e,t,s){Is[ks++]=sl,Is[ks++]=Hs,Is[ks++]=jl,jl=e;var i=sl;e=Hs;var u=32-Gt(i)-1;i&=~(1<<u),s+=1;var f=32-Gt(t)+u;if(30<f){var _=u-u%5;f=(i&(1<<_)-1).toString(32),i>>=_,u-=_,sl=1<<32-Gt(t)+u|s<<u|i,Hs=f+e}else sl=1<<f|s<<u|i,Hs=e}function jc(e){e.return!==null&&(Nl(e,1),To(e,1,0))}function Co(e){for(;e===vc;)vc=da[--wi],da[wi]=null,Ya=da[--wi],da[wi]=null;for(;e===jl;)jl=Is[--ks],Is[ks]=null,Hs=Is[--ks],Is[ks]=null,sl=Is[--ks],Is[ks]=null}function Ao(e,t){Is[ks++]=sl,Is[ks++]=Hs,Is[ks++]=jl,sl=t.id,Hs=t.overflow,jl=e}var Bn=null,nn=null,ht=!1,wl=null,Bs=!1,Sr=Error(c(519));function fa(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Er(Us(t,e)),Sr}function Xu(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[Xt]=e,t[Ze]=i,s){case"dialog":mt("cancel",t),mt("close",t);break;case"iframe":case"object":case"embed":mt("load",t);break;case"video":case"audio":for(s=0;s<Po.length;s++)mt(Po[s],t);break;case"source":mt("error",t);break;case"img":case"image":case"link":mt("error",t),mt("load",t);break;case"details":mt("toggle",t);break;case"input":mt("invalid",t),Wt(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":mt("invalid",t);break;case"textarea":mt("invalid",t),T(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||cx(t.textContent,s)?(i.popover!=null&&(mt("beforetoggle",t),mt("toggle",t)),i.onScroll!=null&&mt("scroll",t),i.onScrollEnd!=null&&mt("scrollend",t),i.onClick!=null&&(t.onclick=Vt),t=!0):t=!1,t||fa(e,!0)}function Vu(e){for(Bn=e.return;Bn;)switch(Bn.tag){case 5:case 31:case 13:Bs=!1;return;case 27:case 3:Bs=!0;return;default:Bn=Bn.return}}function ki(e){if(e!==Bn)return!1;if(!ht)return Vu(e),ht=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Oh(e.type,e.memoizedProps)),s=!s),s&&nn&&fa(e),Vu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));nn=xx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));nn=xx(e)}else t===27?(t=nn,Gi(e.type)?(e=Hh,Hh=null,nn=e):nn=t):nn=Bn?Sl(e.stateNode.nextSibling):null;return!0}function ll(){nn=Bn=null,ht=!1}function Nc(){var e=wl;return e!==null&&(Ys===null?Ys=e:Ys.push.apply(Ys,e),wl=null),e}function Er(e){wl===null?wl=[e]:wl.push(e)}var wc=E(null),Xa=null,ql=null;function ha(e,t,s){X(wc,t._currentValue),t._currentValue=s}function Gl(e){e._currentValue=wc.current,ne(wc)}function Mo(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function Ro(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var _=u.child;f=f.firstContext;e:for(;f!==null;){var N=f;f=u;for(var D=0;D<t.length;D++)if(N.context===t[D]){f.lanes|=s,N=f.alternate,N!==null&&(N.lanes|=s),Mo(f.return,s,e),i||(_=null);break e}f=N.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(c(341));_.lanes|=s,f=_.alternate,f!==null&&(f.lanes|=s),Mo(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function Si(e,t,s,i){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 _=u.alternate;if(_===null)throw Error(c(387));if(_=_.memoizedProps,_!==null){var N=u.type;jn(u.pendingProps.value,_.value)||(e!==null?e.push(N):e=[N])}}else if(u===Le.current){if(_=u.alternate,_===null)throw Error(c(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(lu):e=[lu])}u=u.return}e!==null&&Ro(t,e,s,i),t.flags|=262144}function kc(e){for(e=e.firstContext;e!==null;){if(!jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Va(e){Xa=e,ql=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kn(e){return Qu(Xa,e)}function Sc(e,t){return Xa===null&&Va(e),Qu(e,t)}function Qu(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ql===null){if(e===null)throw Error(c(308));ql=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ql=ql.next=t;return s}var Ku=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Of=n.unstable_scheduleCallback,Lf=n.unstable_NormalPriority,Sn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Do(){return{controller:new Ku,data:new Map,refCount:0}}function Qa(e){e.refCount--,e.refCount===0&&Of(Lf,function(){e.controller.abort()})}var Ka=null,Ei=0,Ti=0,Ci=null;function zf(e,t){if(Ka===null){var s=Ka=[];Ei=0,Ti=kh(),Ci={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Ei++,t.then(Fu,Fu),t}function Fu(){if(--Ei===0&&Ka!==null){Ci!==null&&(Ci.status="fulfilled");var e=Ka;Ka=null,Ti=0,Ci=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Uf(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Zu=O.S;O.S=function(e,t){Rg=Ye(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zf(e,t),Zu!==null&&Zu(e,t)};var Fa=E(null);function Oo(){var e=Fa.current;return e!==null?e:sn.pooledCache}function Ec(e,t){t===null?X(Fa,Fa.current):X(Fa,t.pool)}function Ju(){var e=Oo();return e===null?null:{parent:Sn._currentValue,pool:e}}var Ai=Error(c(460)),Lo=Error(c(474)),Tc=Error(c(542)),Cc={then:function(){}};function Wu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pu(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Vt,Vt),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tr(e),e;default:if(typeof t.status=="string")t.then(Vt,Vt);else{if(e=sn,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tr(e),e}throw pa=t,Ai}}function Za(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(pa=s,Ai):s}}var pa=null;function zo(){if(pa===null)throw Error(c(459));var e=pa;return pa=null,e}function Tr(e){if(e===Ai||e===Tc)throw Error(c(483))}var es=null,cs=0;function It(e){var t=cs;return cs+=1,es===null&&(es=[]),Pu(es,e,t)}function Ja(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ac(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 ed(e){function t(V,H){if(e){var se=V.deletions;se===null?(V.deletions=[H],V.flags|=16):se.push(H)}}function s(V,H){if(!e)return null;for(;H!==null;)t(V,H),H=H.sibling;return null}function i(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function u(V,H){return V=$l(V,H),V.index=0,V.sibling=null,V}function f(V,H,se){return V.index=se,e?(se=V.alternate,se!==null?(se=se.index,se<H?(V.flags|=67108866,H):se):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function _(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function N(V,H,se,me){return H===null||H.tag!==6?(H=Eo(se,V.mode,me),H.return=V,H):(H=u(H,se),H.return=V,H)}function D(V,H,se,me){var Xe=se.type;return Xe===C?fe(V,H,se.props.children,me,se.key):H!==null&&(H.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===R&&Za(Xe)===H.type)?(H=u(H,se.props),Ja(H,se),H.return=V,H):(H=yc(se.type,se.key,se.props,null,V.mode,me),Ja(H,se),H.return=V,H)}function le(V,H,se,me){return H===null||H.tag!==4||H.stateNode.containerInfo!==se.containerInfo||H.stateNode.implementation!==se.implementation?(H=kr(se,V.mode,me),H.return=V,H):(H=u(H,se.children||[]),H.return=V,H)}function fe(V,H,se,me,Xe){return H===null||H.tag!==7?(H=Ga(se,V.mode,me,Xe),H.return=V,H):(H=u(H,se),H.return=V,H)}function xe(V,H,se){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Eo(""+H,V.mode,se),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return se=yc(H.type,H.key,H.props,null,V.mode,se),Ja(se,H),se.return=V,se;case k:return H=kr(H,V.mode,se),H.return=V,H;case R:return H=Za(H),xe(V,H,se)}if(K(H)||$(H))return H=Ga(H,V.mode,se,null),H.return=V,H;if(typeof H.then=="function")return xe(V,It(H),se);if(H.$$typeof===q)return xe(V,Sc(V,H),se);Ac(V,H)}return null}function ie(V,H,se,me){var Xe=H!==null?H.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Xe!==null?null:N(V,H,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return se.key===Xe?D(V,H,se,me):null;case k:return se.key===Xe?le(V,H,se,me):null;case R:return se=Za(se),ie(V,H,se,me)}if(K(se)||$(se))return Xe!==null?null:fe(V,H,se,me,null);if(typeof se.then=="function")return ie(V,H,It(se),me);if(se.$$typeof===q)return ie(V,H,Sc(V,se),me);Ac(V,se)}return null}function ce(V,H,se,me,Xe){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return V=V.get(se)||null,N(H,V,""+me,Xe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return V=V.get(me.key===null?se:me.key)||null,D(H,V,me,Xe);case k:return V=V.get(me.key===null?se:me.key)||null,le(H,V,me,Xe);case R:return me=Za(me),ce(V,H,se,me,Xe)}if(K(me)||$(me))return V=V.get(se)||null,fe(H,V,me,Xe,null);if(typeof me.then=="function")return ce(V,H,se,It(me),Xe);if(me.$$typeof===q)return ce(V,H,se,Sc(H,me),Xe);Ac(H,me)}return null}function Ue(V,H,se,me){for(var Xe=null,Tt=null,Be=H,ot=H=0,bt=null;Be!==null&&ot<se.length;ot++){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var Ct=ie(V,Be,se[ot],me);if(Ct===null){Be===null&&(Be=bt);break}e&&Be&&Ct.alternate===null&&t(V,Be),H=f(Ct,H,ot),Tt===null?Xe=Ct:Tt.sibling=Ct,Tt=Ct,Be=bt}if(ot===se.length)return s(V,Be),ht&&Nl(V,ot),Xe;if(Be===null){for(;ot<se.length;ot++)Be=xe(V,se[ot],me),Be!==null&&(H=f(Be,H,ot),Tt===null?Xe=Be:Tt.sibling=Be,Tt=Be);return ht&&Nl(V,ot),Xe}for(Be=i(Be);ot<se.length;ot++)bt=ce(Be,V,ot,se[ot],me),bt!==null&&(e&&bt.alternate!==null&&Be.delete(bt.key===null?ot:bt.key),H=f(bt,H,ot),Tt===null?Xe=bt:Tt.sibling=bt,Tt=bt);return e&&Be.forEach(function(Ki){return t(V,Ki)}),ht&&Nl(V,ot),Xe}function Fe(V,H,se,me){if(se==null)throw Error(c(151));for(var Xe=null,Tt=null,Be=H,ot=H=0,bt=null,Ct=se.next();Be!==null&&!Ct.done;ot++,Ct=se.next()){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var Ki=ie(V,Be,Ct.value,me);if(Ki===null){Be===null&&(Be=bt);break}e&&Be&&Ki.alternate===null&&t(V,Be),H=f(Ki,H,ot),Tt===null?Xe=Ki:Tt.sibling=Ki,Tt=Ki,Be=bt}if(Ct.done)return s(V,Be),ht&&Nl(V,ot),Xe;if(Be===null){for(;!Ct.done;ot++,Ct=se.next())Ct=xe(V,Ct.value,me),Ct!==null&&(H=f(Ct,H,ot),Tt===null?Xe=Ct:Tt.sibling=Ct,Tt=Ct);return ht&&Nl(V,ot),Xe}for(Be=i(Be);!Ct.done;ot++,Ct=se.next())Ct=ce(Be,V,ot,Ct.value,me),Ct!==null&&(e&&Ct.alternate!==null&&Be.delete(Ct.key===null?ot:Ct.key),H=f(Ct,H,ot),Tt===null?Xe=Ct:Tt.sibling=Ct,Tt=Ct);return e&&Be.forEach(function(P0){return t(V,P0)}),ht&&Nl(V,ot),Xe}function Ft(V,H,se,me){if(typeof se=="object"&&se!==null&&se.type===C&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case S:e:{for(var Xe=se.key;H!==null;){if(H.key===Xe){if(Xe=se.type,Xe===C){if(H.tag===7){s(V,H.sibling),me=u(H,se.props.children),me.return=V,V=me;break e}}else if(H.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===R&&Za(Xe)===H.type){s(V,H.sibling),me=u(H,se.props),Ja(me,se),me.return=V,V=me;break e}s(V,H);break}else t(V,H);H=H.sibling}se.type===C?(me=Ga(se.props.children,V.mode,me,se.key),me.return=V,V=me):(me=yc(se.type,se.key,se.props,null,V.mode,me),Ja(me,se),me.return=V,V=me)}return _(V);case k:e:{for(Xe=se.key;H!==null;){if(H.key===Xe)if(H.tag===4&&H.stateNode.containerInfo===se.containerInfo&&H.stateNode.implementation===se.implementation){s(V,H.sibling),me=u(H,se.children||[]),me.return=V,V=me;break e}else{s(V,H);break}else t(V,H);H=H.sibling}me=kr(se,V.mode,me),me.return=V,V=me}return _(V);case R:return se=Za(se),Ft(V,H,se,me)}if(K(se))return Ue(V,H,se,me);if($(se)){if(Xe=$(se),typeof Xe!="function")throw Error(c(150));return se=Xe.call(se),Fe(V,H,se,me)}if(typeof se.then=="function")return Ft(V,H,It(se),me);if(se.$$typeof===q)return Ft(V,H,Sc(V,se),me);Ac(V,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,H!==null&&H.tag===6?(s(V,H.sibling),me=u(H,se),me.return=V,V=me):(s(V,H),me=Eo(se,V.mode,me),me.return=V,V=me),_(V)):s(V,H)}return function(V,H,se,me){try{cs=0;var Xe=Ft(V,H,se,me);return es=null,Xe}catch(Be){if(Be===Ai||Be===Tc)throw Be;var Tt=ws(29,Be,null,V.mode);return Tt.lanes=me,Tt.return=V,Tt}finally{}}}var kl=ed(!0),Uo=ed(!1),al=!1;function Cr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mc(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 il(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yl(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Rt&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=_c(e),qa(e,null,s),t}return bc(e,i,t,s),_c(e)}function Ar(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,ea(e,s)}}function Wa(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=_:f=f.next=_,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Rc=!1;function Mr(){if(Rc){var e=Ci;if(e!==null)throw e}}function Pa(e,t,s,i){Rc=!1;var u=e.updateQueue;al=!1;var f=u.firstBaseUpdate,_=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var D=N,le=D.next;D.next=null,_===null?f=le:_.next=le,_=D;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,N=fe.lastBaseUpdate,N!==_&&(N===null?fe.firstBaseUpdate=le:N.next=le,fe.lastBaseUpdate=D))}if(f!==null){var xe=u.baseState;_=0,fe=le=D=null,N=f;do{var ie=N.lane&-536870913,ce=ie!==N.lane;if(ce?(xt&ie)===ie:(i&ie)===ie){ie!==0&&ie===Ti&&(Rc=!0),fe!==null&&(fe=fe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ue=e,Fe=N;ie=t;var Ft=s;switch(Fe.tag){case 1:if(Ue=Fe.payload,typeof Ue=="function"){xe=Ue.call(Ft,xe,ie);break e}xe=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=Fe.payload,ie=typeof Ue=="function"?Ue.call(Ft,xe,ie):Ue,ie==null)break e;xe=j({},xe,ie);break e;case 2:al=!0}}ie=N.callback,ie!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=u.callbacks,ce===null?u.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:N.tag,payload:N.payload,callback:N.callback,next:null},fe===null?(le=fe=ce,D=xe):fe=fe.next=ce,_|=ie;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;ce=N,N=ce.next,ce.next=null,u.lastBaseUpdate=ce,u.shared.pending=null}}while(!0);fe===null&&(D=xe),u.baseState=D,u.firstBaseUpdate=le,u.lastBaseUpdate=fe,f===null&&(u.shared.lanes=0),Ii|=_,e.lanes=_,e.memoizedState=xe}}function td(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Mi(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)td(s[e],t)}var rl=E(null),Dc=E(0);function Io(e,t){e=ci,X(Dc,e),X(rl,t),ci=e|t.baseLanes}function Oc(){X(Dc,ci),X(rl,rl.current)}function Ho(){ci=Dc.current,ne(rl),ne(Dc)}var Ss=E(null),Es=null;function Xl(e){var t=e.alternate;X(Et,Et.current&1),X(Ss,e),Es===null&&(t===null||rl.current!==null||t.memoizedState!==null)&&(Es=e)}function Bo(e){X(Et,Et.current),X(Ss,e),Es===null&&(Es=e)}function nd(e){e.tag===22?(X(Et,Et.current),X(Ss,e),Es===null&&(Es=e)):ts()}function ts(){X(Et,Et.current),X(Ss,Ss.current)}function Ts(e){ne(Ss),Es===e&&(Es=null),ne(Et)}var Et=E(0);function ei(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Uh(s)||Ih(s)))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 Vl=0,et=null,Mt=null,En=null,cl=!1,ma=!1,ti=!1,Rr=0,Ri=0,p=null,L=0;function te(){throw Error(c(321))}function Ee(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!jn(e[s],t[s]))return!1;return!0}function at(e,t,s,i,u,f){return Vl=f,et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Gm:Kf,ti=!1,f=s(i,u),ti=!1,ma&&(f=$n(t,s,i,u)),rn(e),f}function rn(e){O.H=qo;var t=Mt!==null&&Mt.next!==null;if(Vl=0,En=Mt=et=null,cl=!1,Ri=0,p=null,t)throw Error(c(300));e===null||qn||(e=e.dependencies,e!==null&&kc(e)&&(qn=!0))}function $n(e,t,s,i){et=e;var u=0;do{if(ma&&(p=null),Ri=0,ma=!1,25<=u)throw Error(c(301));if(u+=1,En=Mt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}O.H=Ym,f=t(s,i)}while(ma);return f}function Ql(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?Ce(t):t,e=e.useState()[0],(Mt!==null?Mt.memoizedState:null)!==e&&(et.flags|=1024),t}function Di(){var e=Rr!==0;return Rr=0,e}function Oi(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Li(e){if(cl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cl=!1}Vl=0,En=Mt=et=null,ma=!1,Ri=Rr=0,p=null}function Ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?et.memoizedState=En=e:En=En.next=e,En}function de(){if(Mt===null){var e=et.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=En===null?et.memoizedState:En.next;if(t!==null)En=t,Mt=e;else{if(e===null)throw et.alternate===null?Error(c(467)):Error(c(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},En===null?et.memoizedState=En=e:En=En.next=e}return En}function Se(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ce(e){var t=Ri;return Ri+=1,p===null&&(p=[]),e=Pu(p,e,t),t=et,(En===null?t.memoizedState:En.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Gm:Kf),e}function Ke(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ce(e);if(e.$$typeof===q)return Kn(e)}throw Error(c(438,String(e)))}function dt(e){var t=null,s=et.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=et.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Se(),et.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=re;return t.index++,s}function cn(e,t){return typeof t=="function"?t(e):t}function Lc(e){var t=de();return If(t,Mt,e)}function If(e,t,s){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var _=u.next;u.next=f.next,f.next=_}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var N=_=null,D=null,le=t,fe=!1;do{var xe=le.lane&-536870913;if(xe!==le.lane?(xt&xe)===xe:(Vl&xe)===xe){var ie=le.revertLane;if(ie===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),xe===Ti&&(fe=!0);else if((Vl&ie)===ie){le=le.next,ie===Ti&&(fe=!0);continue}else xe={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},D===null?(N=D=xe,_=f):D=D.next=xe,et.lanes|=ie,Ii|=ie;xe=le.action,ti&&s(f,xe),f=le.hasEagerState?le.eagerState:s(f,xe)}else ie={lane:xe,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},D===null?(N=D=ie,_=f):D=D.next=ie,et.lanes|=xe,Ii|=xe;le=le.next}while(le!==null&&le!==t);if(D===null?_=f:D.next=N,!jn(f,e.memoizedState)&&(qn=!0,fe&&(s=Ci,s!==null)))throw s;e.memoizedState=f,e.baseState=_,e.baseQueue=D,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Hf(e){var t=de(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do f=e(f,_.action),_=_.next;while(_!==u);jn(f,t.memoizedState)||(qn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function om(e,t,s){var i=et,u=de(),f=ht;if(f){if(s===void 0)throw Error(c(407));s=s()}else s=t();var _=!jn((Mt||u).memoizedState,s);if(_&&(u.memoizedState=s,qn=!0),u=u.queue,qf(fm.bind(null,i,u,e),[e]),u.getSnapshot!==t||_||En!==null&&En.memoizedState.tag&1){if(i.flags|=2048,zc(9,{destroy:void 0},dm.bind(null,i,u,s,t),null),sn===null)throw Error(c(349));f||(Vl&127)!==0||um(i,t,s)}return s}function um(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=et.updateQueue,t===null?(t=Se(),et.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function dm(e,t,s,i){t.value=s,t.getSnapshot=i,hm(t)&&pm(e)}function fm(e,t,s){return s(function(){hm(t)&&pm(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!jn(e,s)}catch{return!0}}function pm(e){var t=$a(e,2);t!==null&&Xs(t,e,2)}function Bf(e){var t=Ln();if(typeof e=="function"){var s=e;if(e=s(),ti){ln(!0);try{s()}finally{ln(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:e},t}function mm(e,t,s,i){return e.baseState=s,If(e,Mt,typeof i=="function"?i:cn)}function Xy(e,t,s,i,u){if(ad(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(_){f.listeners.push(_)}};O.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,gm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function gm(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=O.T,_={};O.T=_;try{var N=s(u,i),D=O.S;D!==null&&D(_,N),xm(e,t,N)}catch(le){$f(e,t,le)}finally{f!==null&&_.types!==null&&(f.types=_.types),O.T=f}}else try{f=s(u,i),xm(e,t,f)}catch(le){$f(e,t,le)}}function xm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){bm(e,t,i)},function(i){return $f(e,t,i)}):bm(e,t,s)}function bm(e,t,s){t.status="fulfilled",t.value=s,_m(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,gm(e,s)))}function $f(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,_m(t),t=t.next;while(t!==i)}e.action=null}function _m(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function vm(e,t){if(ht){var s=sn.formState;if(s!==null){e:{var i=et;if(ht){if(nn){t:{for(var u=nn,f=Bs;u.nodeType!==8;){if(!f){u=null;break t}if(u=Sl(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){nn=Sl(u.nextSibling),i=u.data==="F!";break e}}fa(i)}i=!1}i&&(t=s[0])}}return s=Ln(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},s.queue=i,s=Bm.bind(null,et,i),i.dispatch=s,i=Bf(!1),f=Qf.bind(null,et,!1,i.queue),i=Ln(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Xy.bind(null,et,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function jm(e){var t=de();return Nm(t,Mt,e)}function Nm(e,t,s){if(t=If(e,t,ym)[0],e=Lc(cn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ce(t)}catch(_){throw _===Ai?Tc:_}else i=t;t=de();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(et.flags|=2048,zc(9,{destroy:void 0},Vy.bind(null,u,s),null)),[i,f,e]}function Vy(e,t){e.action=t}function wm(e){var t=de(),s=Mt;if(s!==null)return Nm(t,s,e);de(),t=t.memoizedState,s=de();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function zc(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=et.updateQueue,t===null&&(t=Se(),et.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function km(){return de().memoizedState}function sd(e,t,s,i){var u=Ln();et.flags|=e,u.memoizedState=zc(1|t,{destroy:void 0},s,i===void 0?null:i)}function ld(e,t,s,i){var u=de();i=i===void 0?null:i;var f=u.memoizedState.inst;Mt!==null&&i!==null&&Ee(i,Mt.memoizedState.deps)?u.memoizedState=zc(t,f,s,i):(et.flags|=e,u.memoizedState=zc(1|t,f,s,i))}function Sm(e,t){sd(8390656,8,e,t)}function qf(e,t){ld(2048,8,e,t)}function Qy(e){et.flags|=4;var t=et.updateQueue;if(t===null)t=Se(),et.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Em(e){var t=de().memoizedState;return Qy({ref:t,nextImpl:e}),function(){if((Rt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Tm(e,t){return ld(4,2,e,t)}function Cm(e,t){return ld(4,4,e,t)}function Am(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mm(e,t,s){s=s!=null?s.concat([e]):null,ld(4,4,Am.bind(null,t,e),s)}function Gf(){}function Rm(e,t){var s=de();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&Ee(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function Dm(e,t){var s=de();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&Ee(t,i[1]))return i[0];if(i=e(),ti){ln(!0);try{e()}finally{ln(!1)}}return s.memoizedState=[i,t],i}function Yf(e,t,s){return s===void 0||(Vl&1073741824)!==0&&(xt&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Og(),et.lanes|=e,Ii|=e,s)}function Om(e,t,s,i){return jn(s,t)?s:rl.current!==null?(e=Yf(e,s,i),jn(e,t)||(qn=!0),e):(Vl&42)===0||(Vl&1073741824)!==0&&(xt&261930)===0?(qn=!0,e.memoizedState=s):(e=Og(),et.lanes|=e,Ii|=e,t)}function Lm(e,t,s,i,u){var f=I.p;I.p=f!==0&&8>f?f:8;var _=O.T,N={};O.T=N,Qf(e,!1,t,s);try{var D=u(),le=O.S;if(le!==null&&le(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var fe=Uf(D,i);$o(e,t,fe,dl(e))}else $o(e,t,i,dl(e))}catch(xe){$o(e,t,{then:function(){},status:"rejected",reason:xe},dl())}finally{I.p=f,_!==null&&N.types!==null&&(_.types=N.types),O.T=_}}function Ky(){}function Xf(e,t,s,i){if(e.tag!==5)throw Error(c(476));var u=zm(e).queue;Lm(e,u,t,oe,s===null?Ky:function(){return Um(e),s(i)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:oe},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cn,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Um(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),$o(e,t.next.queue,{},dl())}function Vf(){return Kn(lu)}function Im(){return de().memoizedState}function Hm(){return de().memoizedState}function Fy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=dl();e=il(s);var i=Yl(t,e,s);i!==null&&(Xs(i,t,s),Ar(i,t,s)),t={cache:Do()},e.payload=t;return}t=t.return}}function Zy(e,t,s){var i=dl();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ad(e)?$m(t,s):(s=ko(e,t,s,i),s!==null&&(Xs(s,e,i),qm(s,t,i)))}function Bm(e,t,s){var i=dl();$o(e,t,s,i)}function $o(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ad(e))$m(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var _=t.lastRenderedState,N=f(_,s);if(u.hasEagerState=!0,u.eagerState=N,jn(N,_))return bc(e,t,u,0),sn===null&&xc(),!1}catch{}finally{}if(s=ko(e,t,u,i),s!==null)return Xs(s,e,i),qm(s,t,i),!0}return!1}function Qf(e,t,s,i){if(i={lane:2,revertLane:kh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ad(e)){if(t)throw Error(c(479))}else t=ko(e,s,i,2),t!==null&&Xs(t,e,2)}function ad(e){var t=e.alternate;return e===et||t!==null&&t===et}function $m(e,t){ma=cl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function qm(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,ea(e,s)}}var qo={readContext:Kn,use:Ke,useCallback:te,useContext:te,useEffect:te,useImperativeHandle:te,useLayoutEffect:te,useInsertionEffect:te,useMemo:te,useReducer:te,useRef:te,useState:te,useDebugValue:te,useDeferredValue:te,useTransition:te,useSyncExternalStore:te,useId:te,useHostTransitionStatus:te,useFormState:te,useActionState:te,useOptimistic:te,useMemoCache:te,useCacheRefresh:te};qo.useEffectEvent=te;var Gm={readContext:Kn,use:Ke,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:Kn,useEffect:Sm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,sd(4194308,4,Am.bind(null,t,e),s)},useLayoutEffect:function(e,t){return sd(4194308,4,e,t)},useInsertionEffect:function(e,t){sd(4,2,e,t)},useMemo:function(e,t){var s=Ln();t=t===void 0?null:t;var i=e();if(ti){ln(!0);try{e()}finally{ln(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=Ln();if(s!==void 0){var u=s(t);if(ti){ln(!0);try{s(t)}finally{ln(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=Zy.bind(null,et,e),[i.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:function(e){e=Bf(e);var t=e.queue,s=Bm.bind(null,et,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Gf,useDeferredValue:function(e,t){var s=Ln();return Yf(s,e,t)},useTransition:function(){var e=Bf(!1);return e=Lm.bind(null,et,e.queue,!0,!1),Ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=et,u=Ln();if(ht){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),sn===null)throw Error(c(349));(xt&127)!==0||um(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,Sm(fm.bind(null,i,f,e),[e]),i.flags|=2048,zc(9,{destroy:void 0},dm.bind(null,i,f,s,t),null),s},useId:function(){var e=Ln(),t=sn.identifierPrefix;if(ht){var s=Hs,i=sl;s=(i&~(1<<32-Gt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Rr++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=L++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vf,useFormState:vm,useActionState:vm,useOptimistic:function(e){var t=Ln();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Qf.bind(null,et,!0,s),s.dispatch=t,[e,t]},useMemoCache:dt,useCacheRefresh:function(){return Ln().memoizedState=Fy.bind(null,et)},useEffectEvent:function(e){var t=Ln(),s={impl:e};return t.memoizedState=s,function(){if((Rt&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},Kf={readContext:Kn,use:Ke,useCallback:Rm,useContext:Kn,useEffect:qf,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Cm,useMemo:Dm,useReducer:Lc,useRef:km,useState:function(){return Lc(cn)},useDebugValue:Gf,useDeferredValue:function(e,t){var s=de();return Om(s,Mt.memoizedState,e,t)},useTransition:function(){var e=Lc(cn)[0],t=de().memoizedState;return[typeof e=="boolean"?e:Ce(e),t]},useSyncExternalStore:om,useId:Im,useHostTransitionStatus:Vf,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var s=de();return mm(s,Mt,e,t)},useMemoCache:dt,useCacheRefresh:Hm};Kf.useEffectEvent=Em;var Ym={readContext:Kn,use:Ke,useCallback:Rm,useContext:Kn,useEffect:qf,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Cm,useMemo:Dm,useReducer:Hf,useRef:km,useState:function(){return Hf(cn)},useDebugValue:Gf,useDeferredValue:function(e,t){var s=de();return Mt===null?Yf(s,e,t):Om(s,Mt.memoizedState,e,t)},useTransition:function(){var e=Hf(cn)[0],t=de().memoizedState;return[typeof e=="boolean"?e:Ce(e),t]},useSyncExternalStore:om,useId:Im,useHostTransitionStatus:Vf,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var s=de();return Mt!==null?mm(s,Mt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:dt,useCacheRefresh:Hm};Ym.useEffectEvent=Em;function Ff(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:j({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zf={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=dl(),u=il(i);u.payload=t,s!=null&&(u.callback=s),t=Yl(e,u,i),t!==null&&(Xs(t,e,i),Ar(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=dl(),u=il(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Yl(e,u,i),t!==null&&(Xs(t,e,i),Ar(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=dl(),i=il(s);i.tag=2,t!=null&&(i.callback=t),t=Yl(e,i,s),t!==null&&(Xs(t,e,s),Ar(t,e,s))}};function Xm(e,t,s,i,u,f,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,_):t.prototype&&t.prototype.isPureReactComponent?!yi(s,i)||!yi(u,f):!0}function Vm(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Zf.enqueueReplaceState(t,t.state,null)}function Dr(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=j({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Qm(e){wr(e)}function Km(e){console.error(e)}function Fm(e){wr(e)}function id(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Zm(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Jf(e,t,s){return s=il(s),s.tag=3,s.payload={element:null},s.callback=function(){id(e,t)},s}function Jm(e){return e=il(e),e.tag=3,e}function Wm(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Zm(t,s,i)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Zm(t,s,i),typeof u!="function"&&(Hi===null?Hi=new Set([this]):Hi.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function Jy(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&Si(t,s,u,!0),s=Ss.current,s!==null){switch(s.tag){case 31:case 13:return Es===null?bd():s.alternate===null&&Tn===0&&(Tn=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===Cc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),jh(e,i,u)),!1;case 22:return s.flags|=65536,i===Cc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),jh(e,i,u)),!1}throw Error(c(435,s.tag))}return jh(e,i,u),bd(),!1}if(ht)return t=Ss.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Sr&&(e=Error(c(422),{cause:i}),Er(Us(e,s)))):(i!==Sr&&(t=Error(c(423),{cause:i}),Er(Us(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Us(i,s),u=Jf(e.stateNode,i,u),Wa(e,u),Tn!==4&&(Tn=2)),!1;var f=Error(c(520),{cause:i});if(f=Us(f,s),Zo===null?Zo=[f]:Zo.push(f),Tn!==4&&(Tn=2),t===null)return!0;i=Us(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Jf(s.stateNode,i,e),Wa(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Hi===null||!Hi.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Jm(u),Wm(u,e,s,i),Wa(s,u),!1}s=s.return}while(s!==null);return!1}var Wf=Error(c(461)),qn=!1;function os(e,t,s,i){t.child=e===null?Uo(t,null,s,i):kl(t,e.child,s,i)}function Pm(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var _={};for(var N in i)N!=="ref"&&(_[N]=i[N])}else _=i;return Va(t),i=at(e,t,s,_,f,u),N=Di(),e!==null&&!qn?(Oi(e,t,u),ni(e,t,u)):(ht&&N&&jc(t),t.flags|=1,os(e,t,i,u),t.child)}function eg(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!So(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,tg(e,t,f,i,u)):(e=yc(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!ih(e,u)){var _=f.memoizedProps;if(s=s.compare,s=s!==null?s:yi,s(_,i)&&e.ref===t.ref)return ni(e,t,u)}return t.flags|=1,e=$l(f,i),e.ref=t.ref,e.return=t,t.child=e}function tg(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(yi(f,i)&&e.ref===t.ref)if(qn=!1,t.pendingProps=i=f,ih(e,u))(e.flags&131072)!==0&&(qn=!0);else return t.lanes=e.lanes,ni(e,t,u)}return Pf(e,t,s,i,u)}function ng(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return sg(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ec(t,f!==null?f.cachePool:null),f!==null?Io(t,f):Oc(),nd(t);else return i=t.lanes=536870912,sg(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Ec(t,f.cachePool),Io(t,f),ts(),t.memoizedState=null):(e!==null&&Ec(t,null),Oc(),ts());return os(e,t,u,s),t.child}function Go(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sg(e,t,s,i,u){var f=Oo();return f=f===null?null:{parent:Sn._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&Ec(t,null),Oc(),nd(t),e!==null&&Si(e,t,i,!0),t.childLanes=u,null}function rd(e,t){return t=od({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lg(e,t,s){return kl(t,e.child,null,s),e=rd(t,t.pendingProps),e.flags|=2,Ts(t),t.memoizedState=null,e}function Wy(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ht){if(i.mode==="hidden")return e=rd(t,i),t.lanes=536870912,Go(null,e);if(Bo(t),(e=nn)?(e=gx(e,Bs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jl!==null?{id:sl,overflow:Hs}:null,retryLane:536870912,hydrationErrors:null},s=Gu(e),s.return=t,t.child=s,Bn=t,nn=null)):e=null,e===null)throw fa(t);return t.lanes=536870912,null}return rd(t,i)}var f=e.memoizedState;if(f!==null){var _=f.dehydrated;if(Bo(t),u)if(t.flags&256)t.flags&=-257,t=lg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(qn||Si(e,t,s,!1),u=(s&e.childLanes)!==0,qn||u){if(i=sn,i!==null&&(_=Rs(i,s),_!==0&&_!==f.retryLane))throw f.retryLane=_,$a(e,_),Xs(i,e,_),Wf;bd(),t=lg(e,t,s)}else e=f.treeContext,nn=Sl(_.nextSibling),Bn=t,ht=!0,wl=null,Bs=!1,e!==null&&Ao(t,e),t=rd(t,i),t.flags|=4096;return t}return e=$l(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cd(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Pf(e,t,s,i,u){return Va(t),s=at(e,t,s,i,void 0,u),i=Di(),e!==null&&!qn?(Oi(e,t,u),ni(e,t,u)):(ht&&i&&jc(t),t.flags|=1,os(e,t,s,u),t.child)}function ag(e,t,s,i,u,f){return Va(t),t.updateQueue=null,s=$n(t,i,s,u),rn(e),i=Di(),e!==null&&!qn?(Oi(e,t,f),ni(e,t,f)):(ht&&i&&jc(t),t.flags|=1,os(e,t,s,f),t.child)}function ig(e,t,s,i,u){if(Va(t),t.stateNode===null){var f=Ni,_=s.contextType;typeof _=="object"&&_!==null&&(f=Kn(_)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Zf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Cr(t),_=s.contextType,f.context=typeof _=="object"&&_!==null?Kn(_):Ni,f.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Ff(t,s,_,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(_=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),_!==f.state&&Zf.enqueueReplaceState(f,f.state,null),Pa(t,i,f,u),Mr(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var N=t.memoizedProps,D=Dr(s,N);f.props=D;var le=f.context,fe=s.contextType;_=Ni,typeof fe=="object"&&fe!==null&&(_=Kn(fe));var xe=s.getDerivedStateFromProps;fe=typeof xe=="function"||typeof f.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,fe||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(N||le!==_)&&Vm(t,f,i,_),al=!1;var ie=t.memoizedState;f.state=ie,Pa(t,i,f,u),Mr(),le=t.memoizedState,N||ie!==le||al?(typeof xe=="function"&&(Ff(t,s,xe,i),le=t.memoizedState),(D=al||Xm(t,s,D,i,ie,le,_))?(fe||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=i,t.memoizedState=le),f.props=i,f.state=le,f.context=_,i=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Mc(e,t),_=t.memoizedProps,fe=Dr(s,_),f.props=fe,xe=t.pendingProps,ie=f.context,le=s.contextType,D=Ni,typeof le=="object"&&le!==null&&(D=Kn(le)),N=s.getDerivedStateFromProps,(le=typeof N=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_!==xe||ie!==D)&&Vm(t,f,i,D),al=!1,ie=t.memoizedState,f.state=ie,Pa(t,i,f,u),Mr();var ce=t.memoizedState;_!==xe||ie!==ce||al||e!==null&&e.dependencies!==null&&kc(e.dependencies)?(typeof N=="function"&&(Ff(t,s,N,i),ce=t.memoizedState),(fe=al||Xm(t,s,fe,i,ie,ce,D)||e!==null&&e.dependencies!==null&&kc(e.dependencies))?(le||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ce,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ce,D)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ce),f.props=i,f.state=ce,f.context=D,i=fe):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,cd(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=kl(t,e.child,null,u),t.child=kl(t,null,s,u)):os(e,t,s,u),t.memoizedState=f.state,e=t.child):e=ni(e,t,u),e}function rg(e,t,s,i){return ll(),t.flags|=256,os(e,t,s,i),t.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function th(e){return{baseLanes:e,cachePool:Ju()}}function nh(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=ul),e}function cg(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,_;if((_=f)||(_=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(ht){if(u?Xl(t):ts(),(e=nn)?(e=gx(e,Bs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jl!==null?{id:sl,overflow:Hs}:null,retryLane:536870912,hydrationErrors:null},s=Gu(e),s.return=t,t.child=s,Bn=t,nn=null)):e=null,e===null)throw fa(t);return Ih(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,u?(ts(),u=t.mode,N=od({mode:"hidden",children:N},u),i=Ga(i,u,s,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=th(s),i.childLanes=nh(e,_,s),t.memoizedState=eh,Go(null,i)):(Xl(t),sh(t,N))}var D=e.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(f)t.flags&256?(Xl(t),t.flags&=-257,t=lh(e,t,s)):t.memoizedState!==null?(ts(),t.child=e.child,t.flags|=128,t=null):(ts(),N=i.fallback,u=t.mode,i=od({mode:"visible",children:i.children},u),N=Ga(N,u,s,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,kl(t,e.child,null,s),i=t.child,i.memoizedState=th(s),i.childLanes=nh(e,_,s),t.memoizedState=eh,t=Go(null,i));else if(Xl(t),Ih(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var le=_.dgst;_=le,i=Error(c(419)),i.stack="",i.digest=_,Er({value:i,source:null,stack:null}),t=lh(e,t,s)}else if(qn||Si(e,t,s,!1),_=(s&e.childLanes)!==0,qn||_){if(_=sn,_!==null&&(i=Rs(_,s),i!==0&&i!==D.retryLane))throw D.retryLane=i,$a(e,i),Xs(_,e,i),Wf;Uh(N)||bd(),t=lh(e,t,s)}else Uh(N)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,nn=Sl(N.nextSibling),Bn=t,ht=!0,wl=null,Bs=!1,e!==null&&Ao(t,e),t=sh(t,i.children),t.flags|=4096);return t}return u?(ts(),N=i.fallback,u=t.mode,D=e.child,le=D.sibling,i=$l(D,{mode:"hidden",children:i.children}),i.subtreeFlags=D.subtreeFlags&65011712,le!==null?N=$l(le,N):(N=Ga(N,u,s,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Go(null,i),i=t.child,N=e.child.memoizedState,N===null?N=th(s):(u=N.cachePool,u!==null?(D=Sn._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=Ju(),N={baseLanes:N.baseLanes|s,cachePool:u}),i.memoizedState=N,i.childLanes=nh(e,_,s),t.memoizedState=eh,Go(e.child,i)):(Xl(t),s=e.child,e=s.sibling,s=$l(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function sh(e,t){return t=od({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function od(e,t){return e=ws(22,e,null,t),e.lanes=0,e}function lh(e,t,s){return kl(t,e.child,null,s),e=sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function og(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Mo(e.return,t,s)}function ah(e,t,s,i,u,f){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=s,_.tailMode=u,_.treeForkCount=f)}function ug(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var _=Et.current,N=(_&2)!==0;if(N?(_=_&1|2,t.flags|=128):_&=1,X(Et,_),os(e,t,i,s),i=ht?Ya:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&og(e,s,t);else if(e.tag===19)og(e,s,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(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&ei(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),ah(t,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ei(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}ah(t,!0,s,null,f,i);break;case"together":ah(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ni(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ii|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Si(e,t,s,!1),(s&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,s=$l(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=$l(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function ih(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&kc(e)))}function Py(e,t,s){switch(t.tag){case 3:Ie(t,t.stateNode.containerInfo),ha(t,Sn,e.memoizedState.cache),ll();break;case 27:case 5:$t(t);break;case 4:Ie(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Bo(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Xl(t),t.flags|=128,null):(s&t.child.childLanes)!==0?cg(e,t,s):(Xl(t),e=ni(e,t,s),e!==null?e.sibling:null);Xl(t);break;case 19:var u=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(Si(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return ug(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),X(Et,Et.current),i)break;return null;case 22:return t.lanes=0,ng(e,t,s,t.pendingProps);case 24:ha(t,Sn,e.memoizedState.cache)}return ni(e,t,s)}function dg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)qn=!0;else{if(!ih(e,s)&&(t.flags&128)===0)return qn=!1,Py(e,t,s);qn=(e.flags&131072)!==0}else qn=!1,ht&&(t.flags&1048576)!==0&&To(t,Ya,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e=="function")So(e)?(i=Dr(e,i),t.tag=1,t=ig(null,t,e,i,s)):(t.tag=0,t=Pf(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===B){t.tag=11,t=Pm(null,t,e,i,s);break e}else if(u===z){t.tag=14,t=eg(null,t,e,i,s);break e}}throw t=ve(e)||e,Error(c(306,t,""))}}return t;case 0:return Pf(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=Dr(i,t.pendingProps),ig(e,t,i,u,s);case 3:e:{if(Ie(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Mc(e,t),Pa(t,i,null,s);var _=t.memoizedState;if(i=_.cache,ha(t,Sn,i),i!==f.cache&&Ro(t,[Sn],s,!0),Mr(),i=_.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=rg(e,t,i,s);break e}else if(i!==u){u=Us(Error(c(424)),t),Er(u),t=rg(e,t,i,s);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(nn=Sl(e.firstChild),Bn=t,ht=!0,wl=null,Bs=!0,s=Uo(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ll(),i===u){t=ni(e,t,s);break e}os(e,t,i,s)}t=t.child}return t;case 26:return cd(e,t),e===null?(s=jx(t.type,null,t.pendingProps,null))?t.memoizedState=s:ht||(s=t.type,e=t.pendingProps,i=kd(ye.current).createElement(s),i[Xt]=t,i[Ze]=e,us(i,s,e),ut(i),t.stateNode=i):t.memoizedState=jx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $t(t),e===null&&ht&&(i=t.stateNode=_x(t.type,t.pendingProps,ye.current),Bn=t,Bs=!0,u=nn,Gi(t.type)?(Hh=u,nn=Sl(i.firstChild)):nn=u),os(e,t,t.pendingProps.children,s),cd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ht&&((u=i=nn)&&(i=C0(i,t.type,t.pendingProps,Bs),i!==null?(t.stateNode=i,Bn=t,nn=Sl(i.firstChild),Bs=!1,u=!0):u=!1),u||fa(t)),$t(t),u=t.type,f=t.pendingProps,_=e!==null?e.memoizedProps:null,i=f.children,Oh(u,f)?i=null:_!==null&&Oh(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=at(e,t,Ql,null,null,s),lu._currentValue=u),cd(e,t),os(e,t,i,s),t.child;case 6:return e===null&&ht&&((e=s=nn)&&(s=A0(s,t.pendingProps,Bs),s!==null?(t.stateNode=s,Bn=t,nn=null,e=!0):e=!1),e||fa(t)),null;case 13:return cg(e,t,s);case 4:return Ie(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=kl(t,null,i,s):os(e,t,i,s),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,s);case 7:return os(e,t,t.pendingProps,s),t.child;case 8:return os(e,t,t.pendingProps.children,s),t.child;case 12:return os(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,ha(t,t.type,i.value),os(e,t,i.children,s),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Va(t),u=Kn(u),i=i(u),t.flags|=1,os(e,t,i,s),t.child;case 14:return eg(e,t,t.type,t.pendingProps,s);case 15:return tg(e,t,t.type,t.pendingProps,s);case 19:return ug(e,t,s);case 31:return Wy(e,t,s);case 22:return ng(e,t,s,t.pendingProps);case 24:return Va(t),i=Kn(Sn),e===null?(u=Oo(),u===null&&(u=sn,f=Do(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},Cr(t),ha(t,Sn,u)):((e.lanes&s)!==0&&(Mc(e,t),Pa(t,null,null,s),Mr()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ha(t,Sn,i)):(i=f.cache,ha(t,Sn,i),i!==u.cache&&Ro(t,[Sn],s,!0))),os(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function si(e){e.flags|=4}function rh(e,t,s,i,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(Ig())e.flags|=8192;else throw pa=Cc,Lo}else e.flags&=-16777217}function fg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ex(t))if(Ig())e.flags|=8192;else throw pa=Cc,Lo}function ud(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ge():536870912,e.lanes|=t,Bc|=t)}function Yo(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function hn(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function e0(e,t,s){var i=t.pendingProps;switch(Co(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(t),null;case 1:return hn(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Gl(Sn),qe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ki(t)?si(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nc())),hn(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(si(t),f!==null?(hn(t),fg(t,f)):(hn(t),rh(t,u,null,i,s))):f?f!==e.memoizedState?(si(t),hn(t),fg(t,f)):(hn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&si(t),hn(t),rh(t,u,e,i,s)),null;case 27:if(Ve(t),s=ye.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&si(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return hn(t),null}e=Ne.current,ki(t)?Xu(t):(e=_x(u,i,s),t.stateNode=e,si(t))}return hn(t),null;case 5:if(Ve(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&si(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return hn(t),null}if(f=Ne.current,ki(t))Xu(t);else{var _=kd(ye.current);switch(f){case 1:f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=_.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?_.createElement("select",{is:i.is}):_.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?_.createElement(u,{is:i.is}):_.createElement(u)}}f[Xt]=t,f[Ze]=i;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)f.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=f;e:switch(us(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&si(t)}}return hn(t),rh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&si(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=ye.current,ki(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=Bn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[Xt]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||cx(e.nodeValue,s)),e||fa(t,!0)}else e=kd(e).createTextNode(i),e[Xt]=t,t.stateNode=e}return hn(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=ki(t),s!==null){if(e===null){if(!i)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Xt]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;hn(t),e=!1}else s=Nc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Ts(t),t):(Ts(t),null);if((t.flags&128)!==0)throw Error(c(558))}return hn(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ki(t),i!==null&&i.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[Xt]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;hn(t),u=!1}else u=Nc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Ts(t),t):(Ts(t),null)}return Ts(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),ud(t,t.updateQueue),hn(t),null);case 4:return qe(),e===null&&Ch(t.stateNode.containerInfo),hn(t),null;case 10:return Gl(t.type),hn(t),null;case 19:if(ne(Et),i=t.memoizedState,i===null)return hn(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Yo(i,!1);else{if(Tn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ei(e),f!==null){for(t.flags|=128,Yo(i,!1),e=f.updateQueue,t.updateQueue=e,ud(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)qu(s,e),s=s.sibling;return X(Et,Et.current&1|2),ht&&Nl(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ye()>md&&(t.flags|=128,u=!0,Yo(i,!1),t.lanes=4194304)}else{if(!u)if(e=ei(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,ud(t,e),Yo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!ht)return hn(t),null}else 2*Ye()-i.renderingStartTime>md&&s!==536870912&&(t.flags|=128,u=!0,Yo(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ye(),e.sibling=null,s=Et.current,X(Et,u?s&1|2:s&1),ht&&Nl(t,i.treeForkCount),e):(hn(t),null);case 22:case 23:return Ts(t),Ho(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(hn(t),t.subtreeFlags&6&&(t.flags|=8192)):hn(t),s=t.updateQueue,s!==null&&ud(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&ne(Fa),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Gl(Sn),hn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function t0(e,t){switch(Co(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gl(Sn),qe(),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(Ts(t),t.alternate===null)throw Error(c(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ts(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(Et),null;case 4:return qe(),null;case 10:return Gl(t.type),null;case 22:case 23:return Ts(t),Ho(),e!==null&&ne(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gl(Sn),null;case 25:return null;default:return null}}function hg(e,t){switch(Co(t),t.tag){case 3:Gl(Sn),qe();break;case 26:case 27:case 5:Ve(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&Ts(t);break;case 13:Ts(t);break;case 19:ne(Et);break;case 10:Gl(t.type);break;case 22:case 23:Ts(t),Ho(),e!==null&&ne(Fa);break;case 24:Gl(Sn)}}function Xo(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,_=s.inst;i=f(),_.destroy=i}s=s.next}while(s!==u)}}catch(N){Bt(t,t.return,N)}}function zi(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var _=i.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,u=t;var D=s,le=N;try{le()}catch(fe){Bt(u,D,fe)}}}i=i.next}while(i!==f)}}catch(fe){Bt(t,t.return,fe)}}function pg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Mi(t,s)}catch(i){Bt(e,e.return,i)}}}function mg(e,t,s){s.props=Dr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){Bt(e,t,i)}}function Vo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){Bt(e,t,u)}}function ga(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){Bt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Bt(e,t,u)}else s.current=null}function gg(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){Bt(e,e.return,u)}}function ch(e,t,s){try{var i=e.stateNode;N0(i,e.type,s,t),i[Ze]=t}catch(u){Bt(e,e.return,u)}}function xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gi(e.type)||e.tag===4}function oh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xg(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&&Gi(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 uh(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Vt));else if(i!==4&&(i===27&&Gi(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(uh(e,t,s),e=e.sibling;e!==null;)uh(e,t,s),e=e.sibling}function dd(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&Gi(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(dd(e,t,s),e=e.sibling;e!==null;)dd(e,t,s),e=e.sibling}function bg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);us(t,i,s),t[Xt]=e,t[Ze]=s}catch(f){Bt(e,e.return,f)}}var li=!1,Gn=!1,dh=!1,_g=typeof WeakSet=="function"?WeakSet:Set,ns=null;function n0(e,t){if(e=e.containerInfo,Rh=Rd,e=oa(e),fc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var _=0,N=-1,D=-1,le=0,fe=0,xe=e,ie=null;t:for(;;){for(var ce;xe!==s||u!==0&&xe.nodeType!==3||(N=_+u),xe!==f||i!==0&&xe.nodeType!==3||(D=_+i),xe.nodeType===3&&(_+=xe.nodeValue.length),(ce=xe.firstChild)!==null;)ie=xe,xe=ce;for(;;){if(xe===e)break t;if(ie===s&&++le===u&&(N=_),ie===f&&++fe===i&&(D=_),(ce=xe.nextSibling)!==null)break;xe=ie,ie=xe.parentNode}xe=ce}s=N===-1||D===-1?null:{start:N,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(Dh={focusedElem:e,selectionRange:s},Rd=!1,ns=t;ns!==null;)if(t=ns,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ns=e;else for(;ns!==null;){switch(t=ns,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(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var Ue=Dr(s.type,u);e=i.getSnapshotBeforeUpdate(Ue,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Fe){Bt(s,s.return,Fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)zh(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zh(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,ns=e;break}ns=t.return}}function yg(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:ii(e,s),i&4&&Xo(5,s);break;case 1:if(ii(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){Bt(s,s.return,_)}else{var u=Dr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Bt(s,s.return,_)}}i&64&&pg(s),i&512&&Vo(s,s.return);break;case 3:if(ii(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Mi(e,t)}catch(_){Bt(s,s.return,_)}}break;case 27:t===null&&i&4&&bg(s);case 26:case 5:ii(e,s),t===null&&i&4&&gg(s),i&512&&Vo(s,s.return);break;case 12:ii(e,s);break;case 31:ii(e,s),i&4&&Ng(e,s);break;case 13:ii(e,s),i&4&&wg(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=d0.bind(null,s),M0(e,s))));break;case 22:if(i=s.memoizedState!==null||li,!i){t=t!==null&&t.memoizedState!==null||Gn,u=li;var f=Gn;li=i,(Gn=t)&&!f?ri(e,s,(s.subtreeFlags&8772)!==0):ii(e,s),li=u,Gn=f}break;case 30:break;default:ii(e,s)}}function vg(e){var t=e.alternate;t!==null&&(e.alternate=null,vg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&na(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 _n=null,$s=!1;function ai(e,t,s){for(s=s.child;s!==null;)jg(e,t,s),s=s.sibling}function jg(e,t,s){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(zt,s)}catch{}switch(s.tag){case 26:Gn||ga(s,t),ai(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Gn||ga(s,t);var i=_n,u=$s;Gi(s.type)&&(_n=s.stateNode,$s=!1),ai(e,t,s),tu(s.stateNode),_n=i,$s=u;break;case 5:Gn||ga(s,t);case 6:if(i=_n,u=$s,_n=null,ai(e,t,s),_n=i,$s=u,_n!==null)if($s)try{(_n.nodeType===9?_n.body:_n.nodeName==="HTML"?_n.ownerDocument.body:_n).removeChild(s.stateNode)}catch(f){Bt(s,t,f)}else try{_n.removeChild(s.stateNode)}catch(f){Bt(s,t,f)}break;case 18:_n!==null&&($s?(e=_n,px(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Kc(e)):px(_n,s.stateNode));break;case 4:i=_n,u=$s,_n=s.stateNode.containerInfo,$s=!0,ai(e,t,s),_n=i,$s=u;break;case 0:case 11:case 14:case 15:zi(2,s,t),Gn||zi(4,s,t),ai(e,t,s);break;case 1:Gn||(ga(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&mg(s,t,i)),ai(e,t,s);break;case 21:ai(e,t,s);break;case 22:Gn=(i=Gn)||s.memoizedState!==null,ai(e,t,s),Gn=i;break;default:ai(e,t,s)}}function Ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kc(e)}catch(s){Bt(t,t.return,s)}}}function wg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kc(e)}catch(s){Bt(t,t.return,s)}}function s0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _g),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _g),t;default:throw Error(c(435,e.tag))}}function fd(e,t){var s=s0(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=f0.bind(null,e,i);i.then(u,u)}})}function qs(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,_=t,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Gi(N.type)){_n=N.stateNode,$s=!1;break e}break;case 5:_n=N.stateNode,$s=!1;break e;case 3:case 4:_n=N.stateNode.containerInfo,$s=!0;break e}N=N.return}if(_n===null)throw Error(c(160));jg(f,_,u),_n=null,$s=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kg(t,e),t=t.sibling}var Kl=null;function kg(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qs(t,e),Gs(e),i&4&&(zi(3,e,e.return),Xo(3,e),zi(5,e,e.return));break;case 1:qs(t,e),Gs(e),i&512&&(Gn||s===null||ga(s,s.return)),i&64&&li&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=Kl;if(qs(t,e),Gs(e),i&512&&(Gn||s===null||ga(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[js]||f[Xt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),us(f,i,s),f[Xt]=e,ut(f),i=f;break e;case"link":var _=kx("link","href",u).get(i+(s.href||""));if(_){for(var N=0;N<_.length;N++)if(f=_[N],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(N,1);break t}}f=u.createElement(i),us(f,i,s),u.head.appendChild(f);break;case"meta":if(_=kx("meta","content",u).get(i+(s.content||""))){for(N=0;N<_.length;N++)if(f=_[N],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(N,1);break t}}f=u.createElement(i),us(f,i,s),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[Xt]=e,ut(f),i=f}e.stateNode=i}else Sx(u,e.type,e.stateNode);else e.stateNode=wx(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Sx(u,e.type,e.stateNode):wx(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&ch(e,e.memoizedProps,s.memoizedProps)}break;case 27:qs(t,e),Gs(e),i&512&&(Gn||s===null||ga(s,s.return)),s!==null&&i&4&&ch(e,e.memoizedProps,s.memoizedProps);break;case 5:if(qs(t,e),Gs(e),i&512&&(Gn||s===null||ga(s,s.return)),e.flags&32){u=e.stateNode;try{P(u,"")}catch(Ue){Bt(e,e.return,Ue)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,ch(e,u,s!==null?s.memoizedProps:u)),i&1024&&(dh=!0);break;case 6:if(qs(t,e),Gs(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(Ue){Bt(e,e.return,Ue)}}break;case 3:if(Td=null,u=Kl,Kl=Sd(t.containerInfo),qs(t,e),Kl=u,Gs(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Kc(t.containerInfo)}catch(Ue){Bt(e,e.return,Ue)}dh&&(dh=!1,Sg(e));break;case 4:i=Kl,Kl=Sd(e.stateNode.containerInfo),qs(t,e),Gs(e),Kl=i;break;case 12:qs(t,e),Gs(e);break;case 31:qs(t,e),Gs(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fd(e,i)));break;case 13:qs(t,e),Gs(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pd=Ye()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fd(e,i)));break;case 22:u=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,le=li,fe=Gn;if(li=le||u,Gn=fe||D,qs(t,e),Gn=fe,li=le,Gs(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||D||li||Gn||Or(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(f=D.stateNode,u)_=f.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=D.stateNode;var xe=D.memoizedProps.style,ie=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;N.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Ue){Bt(D,D.return,Ue)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(Ue){Bt(D,D.return,Ue)}}}else if(t.tag===18){if(s===null){D=t;try{var ce=D.stateNode;u?mx(ce,!0):mx(D.stateNode,!1)}catch(Ue){Bt(D,D.return,Ue)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,fd(e,s))));break;case 19:qs(t,e),Gs(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fd(e,i)));break;case 30:break;case 21:break;default:qs(t,e),Gs(e)}}function Gs(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(xg(i)){s=i;break}i=i.return}if(s==null)throw Error(c(160));switch(s.tag){case 27:var u=s.stateNode,f=oh(e);dd(e,f,u);break;case 5:var _=s.stateNode;s.flags&32&&(P(_,""),s.flags&=-33);var N=oh(e);dd(e,N,_);break;case 3:case 4:var D=s.stateNode.containerInfo,le=oh(e);uh(e,le,D);break;default:throw Error(c(161))}}catch(fe){Bt(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ii(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yg(e,t.alternate,t),t=t.sibling}function Or(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zi(4,t,t.return),Or(t);break;case 1:ga(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&mg(t,t.return,s),Or(t);break;case 27:tu(t.stateNode);case 26:case 5:ga(t,t.return),Or(t);break;case 22:t.memoizedState===null&&Or(t);break;case 30:Or(t);break;default:Or(t)}e=e.sibling}}function ri(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,_=f.flags;switch(f.tag){case 0:case 11:case 15:ri(u,f,s),Xo(4,f);break;case 1:if(ri(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(le){Bt(i,i.return,le)}if(i=f,u=i.updateQueue,u!==null){var N=i.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)td(D[u],N)}catch(le){Bt(i,i.return,le)}}s&&_&64&&pg(f),Vo(f,f.return);break;case 27:bg(f);case 26:case 5:ri(u,f,s),s&&i===null&&_&4&&gg(f),Vo(f,f.return);break;case 12:ri(u,f,s);break;case 31:ri(u,f,s),s&&_&4&&Ng(u,f);break;case 13:ri(u,f,s),s&&_&4&&wg(u,f);break;case 22:f.memoizedState===null&&ri(u,f,s),Vo(f,f.return);break;case 30:break;default:ri(u,f,s)}t=t.sibling}}function fh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Qa(s))}function hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qa(e))}function Fl(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eg(e,t,s,i),t=t.sibling}function Eg(e,t,s,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Fl(e,t,s,i),u&2048&&Xo(9,t);break;case 1:Fl(e,t,s,i);break;case 3:Fl(e,t,s,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qa(e)));break;case 12:if(u&2048){Fl(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,_=f.id,N=f.onPostCommit;typeof N=="function"&&N(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Bt(t,t.return,D)}}else Fl(e,t,s,i);break;case 31:Fl(e,t,s,i);break;case 13:Fl(e,t,s,i);break;case 23:break;case 22:f=t.stateNode,_=t.alternate,t.memoizedState!==null?f._visibility&2?Fl(e,t,s,i):Qo(e,t):f._visibility&2?Fl(e,t,s,i):(f._visibility|=2,Uc(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&fh(_,t);break;case 24:Fl(e,t,s,i),u&2048&&hh(t.alternate,t);break;default:Fl(e,t,s,i)}}function Uc(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,_=t,N=s,D=i,le=_.flags;switch(_.tag){case 0:case 11:case 15:Uc(f,_,N,D,u),Xo(8,_);break;case 23:break;case 22:var fe=_.stateNode;_.memoizedState!==null?fe._visibility&2?Uc(f,_,N,D,u):Qo(f,_):(fe._visibility|=2,Uc(f,_,N,D,u)),u&&le&2048&&fh(_.alternate,_);break;case 24:Uc(f,_,N,D,u),u&&le&2048&&hh(_.alternate,_);break;default:Uc(f,_,N,D,u)}t=t.sibling}}function Qo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:Qo(s,i),u&2048&&fh(i.alternate,i);break;case 24:Qo(s,i),u&2048&&hh(i.alternate,i);break;default:Qo(s,i)}t=t.sibling}}var Ko=8192;function Ic(e,t,s){if(e.subtreeFlags&Ko)for(e=e.child;e!==null;)Tg(e,t,s),e=e.sibling}function Tg(e,t,s){switch(e.tag){case 26:Ic(e,t,s),e.flags&Ko&&e.memoizedState!==null&&G0(s,Kl,e.memoizedState,e.memoizedProps);break;case 5:Ic(e,t,s);break;case 3:case 4:var i=Kl;Kl=Sd(e.stateNode.containerInfo),Ic(e,t,s),Kl=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Ko,Ko=16777216,Ic(e,t,s),Ko=i):Ic(e,t,s));break;default:Ic(e,t,s)}}function Cg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];ns=i,Mg(i,e)}Cg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ag(e),e=e.sibling}function Ag(e){switch(e.tag){case 0:case 11:case 15:Fo(e),e.flags&2048&&zi(9,e,e.return);break;case 3:Fo(e);break;case 12:Fo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hd(e)):Fo(e);break;default:Fo(e)}}function hd(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];ns=i,Mg(i,e)}Cg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zi(8,t,t.return),hd(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,hd(t));break;default:hd(t)}e=e.sibling}}function Mg(e,t){for(;ns!==null;){var s=ns;switch(s.tag){case 0:case 11:case 15:zi(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Qa(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,ns=i;else e:for(s=e;ns!==null;){i=ns;var u=i.sibling,f=i.return;if(vg(i),i===s){ns=null;break e}if(u!==null){u.return=f,ns=u;break e}ns=f}}}var l0={getCacheForType:function(e){var t=Kn(Sn),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Kn(Sn).controller.signal}},a0=typeof WeakMap=="function"?WeakMap:Map,Rt=0,sn=null,pt=null,xt=0,Ht=0,ol=null,Ui=!1,Hc=!1,ph=!1,ci=0,Tn=0,Ii=0,Lr=0,mh=0,ul=0,Bc=0,Zo=null,Ys=null,gh=!1,pd=0,Rg=0,md=1/0,gd=null,Hi=null,Fn=0,Bi=null,$c=null,oi=0,xh=0,bh=null,Dg=null,Jo=0,_h=null;function dl(){return(Rt&2)!==0&&xt!==0?xt&-xt:O.T!==null?kh():Qs()}function Og(){if(ul===0)if((xt&536870912)===0||ht){var e=rt;rt<<=1,(rt&3932160)===0&&(rt=262144),ul=e}else ul=536870912;return e=Ss.current,e!==null&&(e.flags|=32),ul}function Xs(e,t,s){(e===sn&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)&&(qc(e,0),$i(e,xt,ul,!1)),Mn(e,s),((Rt&2)===0||e!==sn)&&(e===sn&&((Rt&2)===0&&(Lr|=s),Tn===4&&$i(e,xt,ul,!1)),xa(e))}function Lg(e,t,s){if((Rt&6)!==0)throw Error(c(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ge(e,t),u=i?c0(e,t):vh(e,t,!0),f=i;do{if(u===0){Hc&&!i&&$i(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!i0(s)){u=vh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var N=e;u=Zo;var D=N.current.memoizedState.isDehydrated;if(D&&(qc(N,_).flags|=256),_=vh(N,_,!1),_!==2){if(ph&&!D){N.errorRecoveryDisabledLanes|=f,Lr|=f,u=4;break e}f=Ys,Ys=u,f!==null&&(Ys===null?Ys=f:Ys.push.apply(Ys,f))}u=_}if(f=!1,u!==2)continue}}if(u===1){qc(e,0),$i(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:$i(i,t,ul,!Ui);break e;case 2:Ys=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=pd+300-Ye(),10<u)){if($i(i,t,ul,!Ui),W(i,0,!0)!==0)break e;oi=t,i.timeoutHandle=fx(zg.bind(null,i,s,Ys,gd,gh,t,ul,Lr,Bc,Ui,f,"Throttled",-0,0),u);break e}zg(i,s,Ys,gd,gh,t,ul,Lr,Bc,Ui,f,null,-0,0)}}break}while(!0);xa(e)}function zg(e,t,s,i,u,f,_,N,D,le,fe,xe,ie,ce){if(e.timeoutHandle=-1,xe=t.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vt},Tg(t,f,xe);var Ue=(f&62914560)===f?pd-Ye():(f&4194048)===f?Rg-Ye():0;if(Ue=Y0(xe,Ue),Ue!==null){oi=f,e.cancelPendingCommit=Ue(Yg.bind(null,e,t,f,s,i,u,_,N,D,fe,xe,null,ie,ce)),$i(e,f,_,!le);return}}Yg(e,t,f,s,i,u,_,N,D)}function i0(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!jn(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $i(e,t,s,i){t&=~mh,t&=~Lr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Gt(u),_=1<<f;i[f]=-1,u&=~_}s!==0&&Rl(e,s,t)}function xd(){return(Rt&6)===0?(Wo(0),!1):!0}function yh(){if(pt!==null){if(Ht===0)var e=pt.return;else e=pt,ql=Xa=null,Li(e),es=null,cs=0,e=pt;for(;e!==null;)hg(e.alternate,e),e=e.return;pt=null}}function qc(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,S0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),oi=0,yh(),sn=e,pt=s=$l(e.current,null),xt=t,Ht=0,ol=null,Ui=!1,Hc=ge(e,t),ph=!1,Bc=ul=mh=Lr=Ii=Tn=0,Ys=Zo=null,gh=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-Gt(i),f=1<<u;t|=e[u],i&=~f}return ci=t,xc(),s}function Ug(e,t){et=null,O.H=qo,t===Ai||t===Tc?(t=zo(),Ht=3):t===Lo?(t=zo(),Ht=4):Ht=t===Wf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ol=t,pt===null&&(Tn=1,id(e,Us(t,e.current)))}function Ig(){var e=Ss.current;return e===null?!0:(xt&4194048)===xt?Es===null:(xt&62914560)===xt||(xt&536870912)!==0?e===Es:!1}function Hg(){var e=O.H;return O.H=qo,e===null?qo:e}function Bg(){var e=O.A;return O.A=l0,e}function bd(){Tn=4,Ui||(xt&4194048)!==xt&&Ss.current!==null||(Hc=!0),(Ii&134217727)===0&&(Lr&134217727)===0||sn===null||$i(sn,xt,ul,!1)}function vh(e,t,s){var i=Rt;Rt|=2;var u=Hg(),f=Bg();(sn!==e||xt!==t)&&(gd=null,qc(e,t)),t=!1;var _=Tn;e:do try{if(Ht!==0&&pt!==null){var N=pt,D=ol;switch(Ht){case 8:yh(),_=6;break e;case 3:case 2:case 9:case 6:Ss.current===null&&(t=!0);var le=Ht;if(Ht=0,ol=null,Gc(e,N,D,le),s&&Hc){_=0;break e}break;default:le=Ht,Ht=0,ol=null,Gc(e,N,D,le)}}r0(),_=Tn;break}catch(fe){Ug(e,fe)}while(!0);return t&&e.shellSuspendCounter++,ql=Xa=null,Rt=i,O.H=u,O.A=f,pt===null&&(sn=null,xt=0,xc()),_}function r0(){for(;pt!==null;)$g(pt)}function c0(e,t){var s=Rt;Rt|=2;var i=Hg(),u=Bg();sn!==e||xt!==t?(gd=null,md=Ye()+500,qc(e,t)):Hc=ge(e,t);e:do try{if(Ht!==0&&pt!==null){t=pt;var f=ol;t:switch(Ht){case 1:Ht=0,ol=null,Gc(e,t,f,1);break;case 2:case 9:if(Wu(f)){Ht=0,ol=null,qg(t);break}t=function(){Ht!==2&&Ht!==9||sn!==e||(Ht=7),xa(e)},f.then(t,t);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:Wu(f)?(Ht=0,ol=null,qg(t)):(Ht=0,ol=null,Gc(e,t,f,7));break;case 5:var _=null;switch(pt.tag){case 26:_=pt.memoizedState;case 5:case 27:var N=pt;if(_?Ex(_):N.stateNode.complete){Ht=0,ol=null;var D=N.sibling;if(D!==null)pt=D;else{var le=N.return;le!==null?(pt=le,_d(le)):pt=null}break t}}Ht=0,ol=null,Gc(e,t,f,5);break;case 6:Ht=0,ol=null,Gc(e,t,f,6);break;case 8:yh(),Tn=6;break e;default:throw Error(c(462))}}o0();break}catch(fe){Ug(e,fe)}while(!0);return ql=Xa=null,O.H=i,O.A=u,Rt=s,pt!==null?0:(sn=null,xt=0,xc(),Tn)}function o0(){for(;pt!==null&&!At();)$g(pt)}function $g(e){var t=dg(e.alternate,e,ci);e.memoizedProps=e.pendingProps,t===null?_d(e):pt=t}function qg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=ag(s,t,t.pendingProps,t.type,void 0,xt);break;case 11:t=ag(s,t,t.pendingProps,t.type.render,t.ref,xt);break;case 5:Li(t);default:hg(s,t),t=pt=qu(t,ci),t=dg(s,t,ci)}e.memoizedProps=e.pendingProps,t===null?_d(e):pt=t}function Gc(e,t,s,i){ql=Xa=null,Li(t),es=null,cs=0;var u=t.return;try{if(Jy(e,u,t,s,xt)){Tn=1,id(e,Us(s,e.current)),pt=null;return}}catch(f){if(u!==null)throw pt=u,f;Tn=1,id(e,Us(s,e.current)),pt=null;return}t.flags&32768?(ht||i===1?e=!0:Hc||(xt&536870912)!==0?e=!1:(Ui=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ss.current,i!==null&&i.tag===13&&(i.flags|=16384))),Gg(t,e)):_d(t)}function _d(e){var t=e;do{if((t.flags&32768)!==0){Gg(t,Ui);return}e=t.return;var s=e0(t.alternate,t,ci);if(s!==null){pt=s;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);Tn===0&&(Tn=5)}function Gg(e,t){do{var s=t0(e.alternate,e);if(s!==null){s.flags&=32767,pt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){pt=e;return}pt=e=s}while(e!==null);Tn=6,pt=null}function Yg(e,t,s,i,u,f,_,N,D){e.cancelPendingCommit=null;do yd();while(Fn!==0);if((Rt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=gc,Ms(e,s,f,_,N,D),e===sn&&(pt=sn=null,xt=0),$c=t,Bi=e,oi=s,xh=f,bh=u,Dg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,h0(Jt,function(){return Fg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=O.T,O.T=null,u=I.p,I.p=2,_=Rt,Rt|=4;try{n0(e,t,s)}finally{Rt=_,I.p=u,O.T=i}}Fn=1,Xg(),Vg(),Qg()}}function Xg(){if(Fn===1){Fn=0;var e=Bi,t=$c,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var i=I.p;I.p=2;var u=Rt;Rt|=4;try{kg(t,e);var f=Dh,_=oa(e.containerInfo),N=f.focusedElem,D=f.selectionRange;if(_!==N&&N&&N.ownerDocument&&vi(N.ownerDocument.documentElement,N)){if(D!==null&&fc(N)){var le=D.start,fe=D.end;if(fe===void 0&&(fe=le),"selectionStart"in N)N.selectionStart=le,N.selectionEnd=Math.min(fe,N.value.length);else{var xe=N.ownerDocument||document,ie=xe&&xe.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Ue=N.textContent.length,Fe=Math.min(D.start,Ue),Ft=D.end===void 0?Fe:Math.min(D.end,Ue);!ce.extend&&Fe>Ft&&(_=Ft,Ft=Fe,Fe=_);var V=jr(N,Fe),H=jr(N,Ft);if(V&&H&&(ce.rangeCount!==1||ce.anchorNode!==V.node||ce.anchorOffset!==V.offset||ce.focusNode!==H.node||ce.focusOffset!==H.offset)){var se=xe.createRange();se.setStart(V.node,V.offset),ce.removeAllRanges(),Fe>Ft?(ce.addRange(se),ce.extend(H.node,H.offset)):(se.setEnd(H.node,H.offset),ce.addRange(se))}}}}for(xe=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&xe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<xe.length;N++){var me=xe[N];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Rd=!!Rh,Dh=Rh=null}finally{Rt=u,I.p=i,O.T=s}}e.current=t,Fn=2}}function Vg(){if(Fn===2){Fn=0;var e=Bi,t=$c,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var i=I.p;I.p=2;var u=Rt;Rt|=4;try{yg(e,t.alternate,t)}finally{Rt=u,I.p=i,O.T=s}}Fn=3}}function Qg(){if(Fn===4||Fn===3){Fn=0,gt();var e=Bi,t=$c,s=oi,i=Dg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Fn=5:(Fn=0,$c=Bi=null,Kg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Hi=null),bn(s),t=t.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(zt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=O.T,u=I.p,I.p=2,O.T=null;try{for(var f=e.onRecoverableError,_=0;_<i.length;_++){var N=i[_];f(N.value,{componentStack:N.stack})}}finally{O.T=t,I.p=u}}(oi&3)!==0&&yd(),xa(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===_h?Jo++:(Jo=0,_h=e):Jo=0,Wo(0)}}function Kg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qa(t)))}function yd(){return Xg(),Vg(),Qg(),Fg()}function Fg(){if(Fn!==5)return!1;var e=Bi,t=xh;xh=0;var s=bn(oi),i=O.T,u=I.p;try{I.p=32>s?32:s,O.T=null,s=bh,bh=null;var f=Bi,_=oi;if(Fn=0,$c=Bi=null,oi=0,(Rt&6)!==0)throw Error(c(331));var N=Rt;if(Rt|=4,Ag(f.current),Eg(f,f.current,_,s),Rt=N,Wo(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(zt,f)}catch{}return!0}finally{I.p=u,O.T=i,Kg(e,t)}}function Zg(e,t,s){t=Us(s,t),t=Jf(e.stateNode,t,2),e=Yl(e,t,2),e!==null&&(Mn(e,2),xa(e))}function Bt(e,t,s){if(e.tag===3)Zg(e,e,s);else for(;t!==null;){if(t.tag===3){Zg(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Hi===null||!Hi.has(i))){e=Us(s,e),s=Jm(2),i=Yl(t,s,2),i!==null&&(Wm(s,i,t,e),Mn(i,2),xa(i));break}}t=t.return}}function jh(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new a0;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(ph=!0,u.add(s),e=u0.bind(null,e,t,s),t.then(e,e))}function u0(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,sn===e&&(xt&s)===s&&(Tn===4||Tn===3&&(xt&62914560)===xt&&300>Ye()-pd?(Rt&2)===0&&qc(e,0):mh|=s,Bc===xt&&(Bc=0)),xa(e)}function Jg(e,t){t===0&&(t=Ge()),e=$a(e,t),e!==null&&(Mn(e,t),xa(e))}function d0(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Jg(e,s)}function f0(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(c(314))}i!==null&&i.delete(t),Jg(e,s)}function h0(e,t){return Te(e,t)}var vd=null,Yc=null,Nh=!1,jd=!1,wh=!1,qi=0;function xa(e){e!==Yc&&e.next===null&&(Yc===null?vd=Yc=e:Yc=Yc.next=e),jd=!0,Nh||(Nh=!0,m0())}function Wo(e,t){if(!wh&&jd){wh=!0;do for(var s=!1,i=vd;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var _=i.suspendedLanes,N=i.pingedLanes;f=(1<<31-Gt(42|e)+1)-1,f&=u&~(_&~N),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,tx(i,f))}else f=xt,f=W(i,i===sn?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||ge(i,f)||(s=!0,tx(i,f));i=i.next}while(s);wh=!1}}function p0(){Wg()}function Wg(){jd=Nh=!1;var e=0;qi!==0&&k0()&&(e=qi);for(var t=Ye(),s=null,i=vd;i!==null;){var u=i.next,f=Pg(i,t);f===0?(i.next=null,s===null?vd=u:s.next=u,u===null&&(Yc=s)):(s=i,(e!==0||(f&3)!==0)&&(jd=!0)),i=u}Fn!==0&&Fn!==5||Wo(e),qi!==0&&(qi=0)}function Pg(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var _=31-Gt(f),N=1<<_,D=u[_];D===-1?((N&s)===0||(N&i)!==0)&&(u[_]=Re(N,t)):D<=t&&(e.expiredLanes|=N),f&=~N}if(t=sn,s=xt,s=W(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&We(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ge(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&We(i),bn(s)){case 2:case 8:s=St;break;case 32:s=Jt;break;case 268435456:s=An;break;default:s=Jt}return i=ex.bind(null,e),s=Te(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&We(i),e.callbackPriority=2,e.callbackNode=null,2}function ex(e,t){if(Fn!==0&&Fn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(yd()&&e.callbackNode!==s)return null;var i=xt;return i=W(e,e===sn?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Lg(e,i,t),Pg(e,Ye()),e.callbackNode!=null&&e.callbackNode===s?ex.bind(null,e):null)}function tx(e,t){if(yd())return null;Lg(e,t,!0)}function m0(){E0(function(){(Rt&6)!==0?Te(zn,p0):Wg()})}function kh(){if(qi===0){var e=Ti;e===0&&(e=Qe,Qe<<=1,(Qe&261888)===0&&(Qe=256)),qi=e}return qi}function nx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fn(""+e)}function sx(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function g0(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=nx((u[Ze]||null).action),_=i.submitter;_&&(t=(t=_[Ze]||null)?nx(t.formAction):_.getAttribute("formAction"),t!==null&&(f=t,_=null));var N=new De("action","action",null,i,u);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(qi!==0){var D=_?sx(u,_):new FormData(u);Xf(s,{pending:!0,data:D,method:u.method,action:f},null,D)}}else typeof f=="function"&&(N.preventDefault(),D=_?sx(u,_):new FormData(u),Xf(s,{pending:!0,data:D,method:u.method,action:f},f,D))},currentTarget:u}]})}}for(var Sh=0;Sh<Ns.length;Sh++){var Eh=Ns[Sh],x0=Eh.toLowerCase(),b0=Eh[0].toUpperCase()+Eh.slice(1);tl(x0,"on"+b0)}tl(Iu,"onAnimationEnd"),tl(J,"onAnimationIteration"),tl(vl,"onAnimationStart"),tl("dblclick","onDoubleClick"),tl("focusin","onFocus"),tl("focusout","onBlur"),tl(el,"onTransitionRun"),tl(Hu,"onTransitionStart"),tl(mc,"onTransitionCancel"),tl(wo,"onTransitionEnd"),Jn("onMouseEnter",["mouseout","mouseover"]),Jn("onMouseLeave",["mouseout","mouseover"]),Jn("onPointerEnter",["pointerout","pointerover"]),Jn("onPointerLeave",["pointerout","pointerover"]),ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Po="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(" "),_0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Po));function lx(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var _=i.length-1;0<=_;_--){var N=i[_],D=N.instance,le=N.currentTarget;if(N=N.listener,D!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=le;try{f(u)}catch(fe){wr(fe)}u.currentTarget=null,f=D}else for(_=0;_<i.length;_++){if(N=i[_],D=N.instance,le=N.currentTarget,N=N.listener,D!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=le;try{f(u)}catch(fe){wr(fe)}u.currentTarget=null,f=D}}}}function mt(e,t){var s=t[hl];s===void 0&&(s=t[hl]=new Set);var i=e+"__bubble";s.has(i)||(ax(t,e,2,!1),s.add(i))}function Th(e,t,s){var i=0;t&&(i|=4),ax(s,e,i,t)}var Nd="_reactListening"+Math.random().toString(36).slice(2);function Ch(e){if(!e[Nd]){e[Nd]=!0,Ds.forEach(function(s){s!=="selectionchange"&&(_0.has(s)||Th(s,!1,e),Th(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,Th("selectionchange",!1,t))}}function ax(e,t,s,i){switch(Ox(t)){case 2:var u=Q0;break;case 8:u=K0;break;default:u=Yh}s=u.bind(null,t,s,e),u=void 0,!gi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Ah(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var N=i.stateNode.containerInfo;if(N===u)break;if(_===4)for(_=i.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;N!==null;){if(_=pl(N),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){i=f=_;continue e}N=N.parentNode}}i=i.return}In(function(){var le=f,fe=Pt(s),xe=[];e:{var ie=Bu.get(e);if(ie!==void 0){var ce=De,Ue=e;switch(e){case"keypress":if(zl(s)===0)break e;case"keydown":case"keyup":ce=vo;break;case"focusin":Ue="focus",ce=Oa;break;case"focusout":Ue="blur",ce=Oa;break;case"beforeblur":case"afterblur":ce=Oa;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Tu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=rr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=jo;break;case Iu:case J:case vl:ce=Af;break;case wo:ce=fr;break;case"scroll":case"scrollend":ce=Pn;break;case"wheel":ce=ac;break;case"copy":case"cut":case"paste":ce=nc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=dr;break;case"toggle":case"beforetoggle":ce=ic}var Fe=(t&4)!==0,Ft=!Fe&&(e==="scroll"||e==="scrollend"),V=Fe?ie!==null?ie+"Capture":null:ie;Fe=[];for(var H=le,se;H!==null;){var me=H;if(se=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||se===null||V===null||(me=Ra(H,V),me!=null&&Fe.push(eu(H,me,se))),Ft)break;H=H.return}0<Fe.length&&(ie=new ce(ie,Ue,null,s,fe),xe.push({event:ie,listeners:Fe}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",ie&&s!==kn&&(Ue=s.relatedTarget||s.fromElement)&&(pl(Ue)||Ue[Vn]))break e;if((ce||ie)&&(ie=fe.window===fe?fe:(ie=fe.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(Ue=s.relatedTarget||s.toElement,ce=le,Ue=Ue?pl(Ue):null,Ue!==null&&(Ft=d(Ue),Fe=Ue.tag,Ue!==Ft||Fe!==5&&Fe!==27&&Fe!==6)&&(Ue=null)):(ce=null,Ue=le),ce!==Ue)){if(Fe=Tu,me="onMouseLeave",V="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Fe=dr,me="onPointerLeave",V="onPointerEnter",H="pointer"),Ft=ce==null?ie:ml(ce),se=Ue==null?ie:ml(Ue),ie=new Fe(me,H+"leave",ce,s,fe),ie.target=Ft,ie.relatedTarget=se,me=null,pl(fe)===le&&(Fe=new Fe(V,H+"enter",Ue,s,fe),Fe.target=se,Fe.relatedTarget=Ft,me=Fe),Ft=me,ce&&Ue)t:{for(Fe=y0,V=ce,H=Ue,se=0,me=V;me;me=Fe(me))se++;me=0;for(var Xe=H;Xe;Xe=Fe(Xe))me++;for(;0<se-me;)V=Fe(V),se--;for(;0<me-se;)H=Fe(H),me--;for(;se--;){if(V===H||H!==null&&V===H.alternate){Fe=V;break t}V=Fe(V),H=Fe(H)}Fe=null}else Fe=null;ce!==null&&ix(xe,ie,ce,Fe,!1),Ue!==null&&Ft!==null&&ix(xe,Ft,Ue,Fe,!0)}}e:{if(ie=le?ml(le):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var Tt=dc;else if(yl(ie))if(Ou)Tt=zu;else{Tt=Lu;var Be=yr}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?le&&ze(le.elementType)&&(Tt=dc):Tt=Hn;if(Tt&&(Tt=Tt(e,le))){gr(xe,Tt,s,fe);break e}Be&&Be(e,ie,le),e==="focusout"&&le&&ie.type==="number"&&le.memoizedProps.value!=null&&Rn(ie,"number",ie.value)}switch(Be=le?ml(le):window,e){case"focusin":(yl(Be)||Be.contentEditable==="true")&&(Hl=Be,Ia=le,Bl=null);break;case"focusout":Bl=Ia=Hl=null;break;case"mousedown":hc=!0;break;case"contextmenu":case"mouseup":case"dragend":hc=!1,ji(xe,s,fe);break;case"selectionchange":if(Nr)break;case"keydown":case"keyup":ji(xe,s,fe)}var ot;if(hr)e:{switch(e){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Ua?ca(e,s)&&(bt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(bt="onCompositionStart");bt&&(pr&&s.locale!=="ko"&&(Ua||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Ua&&(ot=xi()):(xl=fe,Ll="value"in xl?xl.value:xl.textContent,Ua=!0)),Be=wd(le,bt),0<Be.length&&(bt=new cr(bt,e,null,s,fe),xe.push({event:bt,listeners:Be}),ot?bt.data=ot:(ot=mr(s),ot!==null&&(bt.data=ot)))),(ot=za?oc(e,s):Du(e,s))&&(bt=wd(le,"onBeforeInput"),0<bt.length&&(Be=new cr("onBeforeInput","beforeinput",null,s,fe),xe.push({event:Be,listeners:bt}),Be.data=ot)),g0(xe,e,le,s,fe)}lx(xe,t)})}function eu(e,t,s){return{instance:e,listener:t,currentTarget:s}}function wd(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Ra(e,s),u!=null&&i.unshift(eu(e,u,f)),u=Ra(e,t),u!=null&&i.push(eu(e,u,f))),e.tag===3)return i;e=e.return}return[]}function y0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ix(e,t,s,i,u){for(var f=t._reactName,_=[];s!==null&&s!==i;){var N=s,D=N.alternate,le=N.stateNode;if(N=N.tag,D!==null&&D===i)break;N!==5&&N!==26&&N!==27||le===null||(D=le,u?(le=Ra(s,f),le!=null&&_.unshift(eu(s,le,D))):u||(le=Ra(s,f),le!=null&&_.push(eu(s,le,D)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var v0=/\r\n?/g,j0=/\u0000|\uFFFD/g;function rx(e){return(typeof e=="string"?e:""+e).replace(v0,`
|
|
50
|
-
`).replace(j0,"")}function cx(e,t){return t=rx(t),rx(e)===t}function Kt(e,t,s,i,u,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||P(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&P(e,""+i);break;case"className":Wn(e,"class",i);break;case"tabIndex":Wn(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Wn(e,s,i);break;case"style":$e(e,i,f);break;case"data":if(t!=="object"){Wn(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=fn(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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"&&(s==="formAction"?(t!=="input"&&Kt(e,t,"name",u.name,u,null),Kt(e,t,"formEncType",u.formEncType,u,null),Kt(e,t,"formMethod",u.formMethod,u,null),Kt(e,t,"formTarget",u.formTarget,u,null)):(Kt(e,t,"encType",u.encType,u,null),Kt(e,t,"method",u.method,u,null),Kt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=fn(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=Vt);break;case"onScroll":i!=null&&mt("scroll",e);break;case"onScrollEnd":i!=null&&mt("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=fn(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":mt("beforetoggle",e),mt("toggle",e),yt(e,"popover",i);break;case"xlinkActuate":jt(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":jt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":jt(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":jt(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":jt(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":jt(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":jt(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":jt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":jt(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":yt(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ut.get(s)||s,yt(e,s,i))}}function Mh(e,t,s,i,u,f){switch(s){case"style":$e(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"children":typeof i=="string"?P(e,i):(typeof i=="number"||typeof i=="bigint")&&P(e,""+i);break;case"onScroll":i!=null&&mt("scroll",e);break;case"onScrollEnd":i!=null&&mt("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Vt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fs.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),f=e[Ze]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):yt(e,s,i)}}}function us(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",e),mt("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var _=s[f];if(_!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Kt(e,t,f,_,s,null)}}u&&Kt(e,t,"srcSet",s.srcSet,s,null),i&&Kt(e,t,"src",s.src,s,null);return;case"input":mt("invalid",e);var N=f=_=u=null,D=null,le=null;for(i in s)if(s.hasOwnProperty(i)){var fe=s[i];if(fe!=null)switch(i){case"name":u=fe;break;case"type":_=fe;break;case"checked":D=fe;break;case"defaultChecked":le=fe;break;case"value":f=fe;break;case"defaultValue":N=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(c(137,t));break;default:Kt(e,t,i,fe,s,null)}}Wt(e,f,N,D,le,_,u,!1);return;case"select":mt("invalid",e),i=_=f=null;for(u in s)if(s.hasOwnProperty(u)&&(N=s[u],N!=null))switch(u){case"value":f=N;break;case"defaultValue":_=N;break;case"multiple":i=N;default:Kt(e,t,u,N,s,null)}t=f,s=_,e.multiple=!!i,t!=null?un(e,!!i,t,!1):s!=null&&un(e,!!i,s,!0);return;case"textarea":mt("invalid",e),f=u=i=null;for(_ in s)if(s.hasOwnProperty(_)&&(N=s[_],N!=null))switch(_){case"value":i=N;break;case"defaultValue":u=N;break;case"children":f=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:Kt(e,t,_,N,s,null)}T(e,i,u,f);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(i=s[D],i!=null))switch(D){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Kt(e,t,D,i,s,null)}return;case"dialog":mt("beforetoggle",e),mt("toggle",e),mt("cancel",e),mt("close",e);break;case"iframe":case"object":mt("load",e);break;case"video":case"audio":for(i=0;i<Po.length;i++)mt(Po[i],e);break;case"image":mt("error",e),mt("load",e);break;case"details":mt("toggle",e);break;case"embed":case"source":case"link":mt("error",e),mt("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(le in s)if(s.hasOwnProperty(le)&&(i=s[le],i!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Kt(e,t,le,i,s,null)}return;default:if(ze(t)){for(fe in s)s.hasOwnProperty(fe)&&(i=s[fe],i!==void 0&&Mh(e,t,fe,i,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(i=s[N],i!=null&&Kt(e,t,N,i,s,null))}function N0(e,t,s,i){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,_=null,N=null,D=null,le=null,fe=null;for(ce in s){var xe=s[ce];if(s.hasOwnProperty(ce)&&xe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":D=xe;default:i.hasOwnProperty(ce)||Kt(e,t,ce,null,i,xe)}}for(var ie in i){var ce=i[ie];if(xe=s[ie],i.hasOwnProperty(ie)&&(ce!=null||xe!=null))switch(ie){case"type":f=ce;break;case"name":u=ce;break;case"checked":le=ce;break;case"defaultChecked":fe=ce;break;case"value":_=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(c(137,t));break;default:ce!==xe&&Kt(e,t,ie,ce,i,xe)}}Zs(e,_,N,D,le,fe,f,u);return;case"select":ce=_=N=ie=null;for(f in s)if(D=s[f],s.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":ce=D;default:i.hasOwnProperty(f)||Kt(e,t,f,null,i,D)}for(u in i)if(f=i[u],D=s[u],i.hasOwnProperty(u)&&(f!=null||D!=null))switch(u){case"value":ie=f;break;case"defaultValue":N=f;break;case"multiple":_=f;default:f!==D&&Kt(e,t,u,f,i,D)}t=N,s=_,i=ce,ie!=null?un(e,!!s,ie,!1):!!i!=!!s&&(t!=null?un(e,!!s,t,!0):un(e,!!s,s?[]:"",!1));return;case"textarea":ce=ie=null;for(N in s)if(u=s[N],s.hasOwnProperty(N)&&u!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Kt(e,t,N,null,i,u)}for(_ in i)if(u=i[_],f=s[_],i.hasOwnProperty(_)&&(u!=null||f!=null))switch(_){case"value":ie=u;break;case"defaultValue":ce=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Kt(e,t,_,u,i,f)}we(e,ie,ce);return;case"option":for(var Ue in s)if(ie=s[Ue],s.hasOwnProperty(Ue)&&ie!=null&&!i.hasOwnProperty(Ue))switch(Ue){case"selected":e.selected=!1;break;default:Kt(e,t,Ue,null,i,ie)}for(D in i)if(ie=i[D],ce=s[D],i.hasOwnProperty(D)&&ie!==ce&&(ie!=null||ce!=null))switch(D){case"selected":e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:Kt(e,t,D,ie,i,ce)}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 Fe in s)ie=s[Fe],s.hasOwnProperty(Fe)&&ie!=null&&!i.hasOwnProperty(Fe)&&Kt(e,t,Fe,null,i,ie);for(le in i)if(ie=i[le],ce=s[le],i.hasOwnProperty(le)&&ie!==ce&&(ie!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:Kt(e,t,le,ie,i,ce)}return;default:if(ze(t)){for(var Ft in s)ie=s[Ft],s.hasOwnProperty(Ft)&&ie!==void 0&&!i.hasOwnProperty(Ft)&&Mh(e,t,Ft,void 0,i,ie);for(fe in i)ie=i[fe],ce=s[fe],!i.hasOwnProperty(fe)||ie===ce||ie===void 0&&ce===void 0||Mh(e,t,fe,ie,i,ce);return}}for(var V in s)ie=s[V],s.hasOwnProperty(V)&&ie!=null&&!i.hasOwnProperty(V)&&Kt(e,t,V,null,i,ie);for(xe in i)ie=i[xe],ce=s[xe],!i.hasOwnProperty(xe)||ie===ce||ie==null&&ce==null||Kt(e,t,xe,ie,i,ce)}function ox(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,_=u.initiatorType,N=u.duration;if(f&&N&&ox(_)){for(_=0,N=u.responseEnd,i+=1;i<s.length;i++){var D=s[i],le=D.startTime;if(le>N)break;var fe=D.transferSize,xe=D.initiatorType;fe&&ox(xe)&&(D=D.responseEnd,_+=fe*(D<N?1:(N-le)/(D-le)))}if(--i,t+=8*(f+_)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Rh=null,Dh=null;function kd(e){return e.nodeType===9?e:e.ownerDocument}function ux(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 dx(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Oh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lh=null;function k0(){var e=window.event;return e&&e.type==="popstate"?e===Lh?!1:(Lh=e,!0):(Lh=null,!1)}var fx=typeof setTimeout=="function"?setTimeout:void 0,S0=typeof clearTimeout=="function"?clearTimeout:void 0,hx=typeof Promise=="function"?Promise:void 0,E0=typeof queueMicrotask=="function"?queueMicrotask:typeof hx<"u"?function(e){return hx.resolve(null).then(e).catch(T0)}:fx;function T0(e){setTimeout(function(){throw e})}function Gi(e){return e==="head"}function px(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),Kc(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")tu(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,tu(s);for(var f=s.firstChild;f;){var _=f.nextSibling,N=f.nodeName;f[js]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=_}}else s==="body"&&tu(e.ownerDocument.body);s=u}while(s);Kc(t)}function mx(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function zh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":zh(s),na(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function C0(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[js])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=Sl(e.nextSibling),e===null)break}return null}function A0(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Sl(e.nextSibling),e===null))return null;return e}function gx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Sl(e.nextSibling),e===null))return null;return e}function Uh(e){return e.data==="$?"||e.data==="$~"}function Ih(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function M0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Sl(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 Hh=null;function xx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Sl(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function bx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function _x(e,t,s){switch(t=kd(s),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 tu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);na(e)}var El=new Map,yx=new Set;function Sd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ui=I.d;I.d={f:R0,r:D0,D:O0,C:L0,L:z0,m:U0,X:H0,S:I0,M:B0};function R0(){var e=ui.f(),t=xd();return e||t}function D0(e){var t=Ks(e);t!==null&&t.tag===5&&t.type==="form"?Um(t):ui.r(e)}var Xc=typeof document>"u"?null:document;function vx(e,t,s){var i=Xc;if(i&&typeof t=="string"&&t){var u=kt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),yx.has(u)||(yx.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),us(t,"link",e),ut(t),i.head.appendChild(t)))}}function O0(e){ui.D(e),vx("dns-prefetch",e,null)}function L0(e,t){ui.C(e,t),vx("preconnect",e,t)}function z0(e,t,s){ui.L(e,t,s);var i=Xc;if(i&&e&&t){var u='link[rel="preload"][as="'+kt(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+kt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+kt(s.imageSizes)+'"]')):u+='[href="'+kt(e)+'"]';var f=u;switch(t){case"style":f=Vc(e);break;case"script":f=Qc(e)}El.has(f)||(e=j({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),El.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(nu(f))||t==="script"&&i.querySelector(su(f))||(t=i.createElement("link"),us(t,"link",e),ut(t),i.head.appendChild(t)))}}function U0(e,t){ui.m(e,t);var s=Xc;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+kt(i)+'"][href="'+kt(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Qc(e)}if(!El.has(f)&&(e=j({rel:"modulepreload",href:e},t),El.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(su(f)))return}i=s.createElement("link"),us(i,"link",e),ut(i),s.head.appendChild(i)}}}function I0(e,t,s){ui.S(e,t,s);var i=Xc;if(i&&e){var u=an(i).hoistableStyles,f=Vc(e);t=t||"default";var _=u.get(f);if(!_){var N={loading:0,preload:null};if(_=i.querySelector(nu(f)))N.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},s),(s=El.get(f))&&Bh(e,s);var D=_=i.createElement("link");ut(D),us(D,"link",e),D._p=new Promise(function(le,fe){D.onload=le,D.onerror=fe}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ed(_,t,i)}_={type:"stylesheet",instance:_,count:1,state:N},u.set(f,_)}}}function H0(e,t){ui.X(e,t);var s=Xc;if(s&&e){var i=an(s).hoistableScripts,u=Qc(e),f=i.get(u);f||(f=s.querySelector(su(u)),f||(e=j({src:e,async:!0},t),(t=El.get(u))&&$h(e,t),f=s.createElement("script"),ut(f),us(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function B0(e,t){ui.M(e,t);var s=Xc;if(s&&e){var i=an(s).hoistableScripts,u=Qc(e),f=i.get(u);f||(f=s.querySelector(su(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=El.get(u))&&$h(e,t),f=s.createElement("script"),ut(f),us(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function jx(e,t,s,i){var u=(u=ye.current)?Sd(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Vc(s.href),s=an(u).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Vc(s.href);var f=an(u).hoistableStyles,_=f.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,_),(f=u.querySelector(nu(e)))&&!f._p&&(_.instance=f,_.state.loading=5),El.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},El.set(e,s),f||$0(u,e,s,_.state))),t&&i===null)throw Error(c(528,""));return _}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qc(s),s=an(u).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Vc(e){return'href="'+kt(e)+'"'}function nu(e){return'link[rel="stylesheet"]['+e+"]"}function Nx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function $0(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),us(t,"link",s),ut(t),e.head.appendChild(t))}function Qc(e){return'[src="'+kt(e)+'"]'}function su(e){return"script[async]"+e}function wx(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+kt(s.href)+'"]');if(i)return t.instance=i,ut(i),i;var u=j({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),ut(i),us(i,"style",u),Ed(i,s.precedence,e),t.instance=i;case"stylesheet":u=Vc(s.href);var f=e.querySelector(nu(u));if(f)return t.state.loading|=4,t.instance=f,ut(f),f;i=Nx(s),(u=El.get(u))&&Bh(i,u),f=(e.ownerDocument||e).createElement("link"),ut(f);var _=f;return _._p=new Promise(function(N,D){_.onload=N,_.onerror=D}),us(f,"link",i),t.state.loading|=4,Ed(f,s.precedence,e),t.instance=f;case"script":return f=Qc(s.src),(u=e.querySelector(su(f)))?(t.instance=u,ut(u),u):(i=s,(u=El.get(f))&&(i=j({},s),$h(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),ut(u),us(u,"link",i),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&&(i=t.instance,t.state.loading|=4,Ed(i,s.precedence,e));return t.instance}function Ed(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,_=0;_<i.length;_++){var N=i[_];if(N.dataset.precedence===t)f=N;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Bh(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 Td=null;function kx(e,t,s){if(Td===null){var i=new Map,u=Td=new Map;u.set(s,i)}else u=Td,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[js]||f[Xt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var _=f.getAttribute(t)||"";_=e+_;var N=i.get(_);N?N.push(f):i.set(_,[f])}}return i}function Sx(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function q0(e,t,s){if(s===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 Ex(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function G0(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Vc(i.href),f=t.querySelector(nu(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Cd.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,ut(f);return}f=t.ownerDocument||t,i=Nx(i),(u=El.get(u))&&Bh(i,u),f=f.createElement("link"),ut(f);var _=f;_._p=new Promise(function(N,D){_.onload=N,_.onerror=D}),us(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Cd.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var qh=0;function Y0(e,t){return e.stylesheets&&e.count===0&&Md(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Md(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&qh===0&&(qh=62500*w0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Md(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>qh?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Cd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Md(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ad=null;function Md(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ad=new Map,t.forEach(X0,e),Ad=null,Cd.call(e))}function X0(e,t){if(!(t.state.loading&4)){var s=Ad.get(e);if(s)var i=s.get(null);else{s=new Map,Ad.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var _=u[f];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),i=_)}i&&s.set(null,i)}u=t.instance,_=u.getAttribute("data-precedence"),f=s.get(_)||i,f===i&&s.set(null,u),s.set(_,u),this.count++,i=Cd.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var lu={$$typeof:q,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function V0(e,t,s,i,u,f,_,N,D){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=Yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.hiddenUpdates=Yt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Tx(e,t,s,i,u,f,_,N,D,le,fe,xe){return e=new V0(e,t,s,_,D,le,fe,xe,N),t=1,f===!0&&(t|=24),f=ws(3,null,null,t),e.current=f,f.stateNode=e,t=Do(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},Cr(f),e}function Cx(e){return e?(e=Ni,e):Ni}function Ax(e,t,s,i,u,f){u=Cx(u),i.context===null?i.context=u:i.pendingContext=u,i=il(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Yl(e,i,t),s!==null&&(Xs(s,e,t),Ar(s,e,t))}function Mx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Gh(e,t){Mx(e,t),(e=e.alternate)&&Mx(e,t)}function Rx(e){if(e.tag===13||e.tag===31){var t=$a(e,67108864);t!==null&&Xs(t,e,67108864),Gh(e,67108864)}}function Dx(e){if(e.tag===13||e.tag===31){var t=dl();t=vs(t);var s=$a(e,t);s!==null&&Xs(s,e,t),Gh(e,t)}}var Rd=!0;function Q0(e,t,s,i){var u=O.T;O.T=null;var f=I.p;try{I.p=2,Yh(e,t,s,i)}finally{I.p=f,O.T=u}}function K0(e,t,s,i){var u=O.T;O.T=null;var f=I.p;try{I.p=8,Yh(e,t,s,i)}finally{I.p=f,O.T=u}}function Yh(e,t,s,i){if(Rd){var u=Xh(i);if(u===null)Ah(e,t,i,Dd,s),Lx(e,i);else if(Z0(u,e,t,s,i))i.stopPropagation();else if(Lx(e,i),t&4&&-1<F0.indexOf(e)){for(;u!==null;){var f=Ks(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var _=Pe(f.pendingLanes);if(_!==0){var N=f;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var D=1<<31-Gt(_);N.entanglements[1]|=D,_&=~D}xa(f),(Rt&6)===0&&(md=Ye()+500,Wo(0))}}break;case 31:case 13:N=$a(f,2),N!==null&&Xs(N,f,2),xd(),Gh(f,2)}if(f=Xh(i),f===null&&Ah(e,t,i,Dd,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else Ah(e,t,i,null,s)}}function Xh(e){return e=Pt(e),Vh(e)}var Dd=null;function Vh(e){if(Dd=null,e=pl(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dd=e,null}function Ox(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(wn()){case zn:return 2;case St:return 8;case Jt:case hs:return 32;case An:return 268435456;default:return 32}default:return 32}}var Qh=!1,Yi=null,Xi=null,Vi=null,au=new Map,iu=new Map,Qi=[],F0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lx(e,t){switch(e){case"focusin":case"focusout":Yi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":au.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":iu.delete(t.pointerId)}}function ru(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Ks(t),t!==null&&Rx(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Z0(e,t,s,i,u){switch(t){case"focusin":return Yi=ru(Yi,e,t,s,i,u),!0;case"dragenter":return Xi=ru(Xi,e,t,s,i,u),!0;case"mouseover":return Vi=ru(Vi,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return au.set(f,ru(au.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,iu.set(f,ru(iu.get(f)||null,e,t,s,i,u)),!0}return!1}function zx(e){var t=pl(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,yn(e.priority,function(){Dx(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,yn(e.priority,function(){Dx(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Od(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Xh(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);kn=i,s.target.dispatchEvent(i),kn=null}else return t=Ks(s),t!==null&&Rx(t),e.blockedOn=s,!1;t.shift()}return!0}function Ux(e,t,s){Od(e)&&s.delete(t)}function J0(){Qh=!1,Yi!==null&&Od(Yi)&&(Yi=null),Xi!==null&&Od(Xi)&&(Xi=null),Vi!==null&&Od(Vi)&&(Vi=null),au.forEach(Ux),iu.forEach(Ux)}function Ld(e,t){e.blockedOn===t&&(e.blockedOn=null,Qh||(Qh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,J0)))}var zd=null;function Ix(e){zd!==e&&(zd=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){zd===e&&(zd=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Vh(i||s)===null)continue;break}var f=Ks(s);f!==null&&(e.splice(t,3),t-=3,Xf(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function Kc(e){function t(D){return Ld(D,e)}Yi!==null&&Ld(Yi,e),Xi!==null&&Ld(Xi,e),Vi!==null&&Ld(Vi,e),au.forEach(t),iu.forEach(t);for(var s=0;s<Qi.length;s++){var i=Qi[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Qi.length&&(s=Qi[0],s.blockedOn===null);)zx(s),s.blockedOn===null&&Qi.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],_=u[Ze]||null;if(typeof f=="function")_||Ix(s);else if(_){var N=null;if(f&&f.hasAttribute("formAction")){if(u=f,_=f[Ze]||null)N=_.formAction;else if(Vh(u)!==null)continue}else N=_.action;typeof N=="function"?s[i+1]=N:(s.splice(i,3),i-=3),Ix(s)}}}function Hx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!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 i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Kh(e){this._internalRoot=e}Ud.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,i=dl();Ax(s,i,e,t,null,null)},Ud.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ax(e.current,2,null,e,null,null),xd(),t[Vn]=null}};function Ud(e){this._internalRoot=e}Ud.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qs();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Qi.length&&t!==0&&t<Qi[s].priority;s++);Qi.splice(s,0,e),s===0&&zx(e)}};var Bx=l.version;if(Bx!=="19.2.8")throw Error(c(527,Bx,"19.2.8"));I.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?y(e):null,e=e===null?null:e.stateNode,e};var W0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Id=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Id.isDisabled&&Id.supportsFiber)try{zt=Id.inject(W0),on=Id}catch{}}return ou.createRoot=function(e,t){if(!o(e))throw Error(c(299));var s=!1,i="",u=Qm,f=Km,_=Fm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Tx(e,1,!1,null,null,s,i,null,u,f,_,Hx),e[Vn]=t.current,Ch(e),new Kh(t)},ou.hydrateRoot=function(e,t,s){if(!o(e))throw Error(c(299));var i=!1,u="",f=Qm,_=Km,N=Fm,D=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=Tx(e,1,!0,t,s??null,i,u,D,f,_,N,Hx),t.context=Cx(null),s=t.current,i=dl(),i=vs(i),u=il(i),u.callback=null,Yl(s,u,i),s=i,t.current.lanes=s,Mn(t,s),xa(t),e[Vn]=t.current,Ch(e),new Ud(t)},ou.version="19.2.8",ou}var Jx;function uv(){if(Jx)return Wh.exports;Jx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Wh.exports=ov(),Wh.exports}var dv=uv();const R_=1,Pi="main",Wx=["skills","agents","hooks","commands","plugins","output-styles","CLAUDE.md","settings.json","keybindings.json"],mi=["orange","blue","green","purple","pink","teal"];function fv(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${D_(n)}`}function hv(n){const l=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${l.replace(/^-+|-+$/g,"")||"project"}-${D_(n)}`,c=fv(n);return[l,r].filter(o=>o!==c)}function D_(n){const l=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return pv(l?n.toLowerCase():n)}function pv(n){let l=3735928559,r=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);l=Math.imul(l^o,2654435761),r=Math.imul(r^o,1597334677)}return l=Math.imul(l^l>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(l^l>>>13,3266489909),(4294967296*(2097151&r)+(l>>>0)).toString(36)}const Hp=x.createContext({accounts:[],auth:{},multi:!1});function Bp(){return x.useContext(Hp)}function mv(n,l="claude"){const{accounts:r,multi:c}=x.useContext(Hp);return!c||l==="antigravity"||!n?null:r.find(o=>o.id===n)??null}const tf={orange:"оранжевый",blue:"синий",green:"зелёный",purple:"фиолетовый",pink:"розовый",teal:"бирюзовый"};function O_(n){const l=Array.from(n.trim())[0];return l?l.toUpperCase():"?"}function L_(n){return n?n.loggedIn?n.plan||"вход выполнен":"вход не выполнен":""}const z_="ccv:last-account";function gv(){try{return localStorage.getItem(z_)}catch{return null}}function xv(n){try{localStorage.setItem(z_,n)}catch{}}function Aa({account:n,size:l="sm",className:r}){const c=`Аккаунт «${n.name}», ${tf[n.color]}`;return a.jsx("span",{className:`acct-mark acct-mark--${l} acct--${n.color}${r?` ${r}`:""}`,role:"img","aria-label":c,title:c,children:a.jsx("span",{"aria-hidden":"true",children:O_(n.name)})})}function Px({account:n,onClick:l,className:r}){const c=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"acct-mark acct-mark--sm","aria-hidden":"true",children:a.jsx("span",{children:O_(n.name)})}),a.jsx("span",{className:"acct-chip__name",children:n.name})]}),o=`acct-chip acct--${n.color}${r?` ${r}`:""}`,d=`Сессия идёт под аккаунтом «${n.name}» — лимиты и тариф берутся из него`;return l?a.jsx("button",{type:"button",className:o,title:d,"aria-label":`Аккаунт «${n.name}». Открыть аккаунты`,onClick:l,children:c}):a.jsx("span",{className:o,title:d,role:"group","aria-label":`Аккаунт «${n.name}»`,children:c})}var pi,ro,co,oo,uo,Su,fo,jf,U_;class bv{constructor(l){Nn(this,jf);Nn(this,pi,null);Nn(this,ro,new Set);Nn(this,co,500);Nn(this,oo,null);Nn(this,uo,!1);Nn(this,Su,null);Nn(this,fo,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){Dt(this,fo,l)}connect(){if(Je(this,uo))return;const l=new WebSocket(this.url);Dt(this,pi,l),l.addEventListener("open",()=>{var r,c;Dt(this,co,500),this.send({type:"hello",protocol:R_,clientName:"ccv-web"}),(r=Je(this,Su))==null||r.call(this),(c=Je(this,fo))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Je(this,ro))o(c)}),l.addEventListener("close",()=>{var r;Dt(this,pi,null),(r=Je(this,fo))==null||r.call(this),Yn(this,jf,U_).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){Dt(this,Su,l)}on(l){return Je(this,ro).add(l),()=>Je(this,ro).delete(l)}send(l){var r;((r=Je(this,pi))==null?void 0:r.readyState)===WebSocket.OPEN&&Je(this,pi).send(JSON.stringify(l))}get connected(){var l;return((l=Je(this,pi))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;Dt(this,uo,!0),(l=Je(this,pi))==null||l.close()}}pi=new WeakMap,ro=new WeakMap,co=new WeakMap,oo=new WeakMap,uo=new WeakMap,Su=new WeakMap,fo=new WeakMap,jf=new WeakSet,U_=function(){if(Je(this,uo)||Je(this,oo)!==null)return;const l=Je(this,co);Dt(this,co,Math.min(l*2,1e4)),Dt(this,oo,window.setTimeout(()=>{Dt(this,oo,null),this.connect()},l))};const _v=1,I_="ccv:relay",nf="ccv:relay.host";function yv(){try{const n=localStorage.getItem(I_);if(!n)return null;const l=JSON.parse(n);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function H_(){localStorage.removeItem(I_)}var ka,ho,Sa,po,mo,sr,Gr,Yr,lr,Xr,go,Vr,Qr,mn,Ji,vp,B_,Br,jp;class vv{constructor(l){Nn(this,mn);Nn(this,ka,null);Nn(this,ho,new Set);Nn(this,Sa,null);Nn(this,po,null);Nn(this,mo,500);Nn(this,sr,null);Nn(this,Gr,!1);Nn(this,Yr,!1);Nn(this,lr,!1);Nn(this,Xr,null);Nn(this,go,"Подключаемся…");Nn(this,Vr,0);Nn(this,Qr,[]);this.session=l}get connected(){return Je(this,Yr)&&Je(this,lr)}get statusText(){return Je(this,go)}get hostId(){return Je(this,Xr)}on(l){return Je(this,ho).add(l),()=>Je(this,ho).delete(l)}onReconnect(l){Dt(this,po,l)}onStatus(l){Dt(this,Sa,l)}connect(){Je(this,Gr)||Yn(this,mn,vp).call(this)}send(l){if(!Je(this,Yr)){Je(this,Qr).length<64&&Je(this,Qr).push(l);return}Yn(this,mn,Br).call(this,{t:"client.frame",body:l})}close(){var l;Dt(this,Gr,!0),Je(this,sr)!==null&&window.clearTimeout(Je(this,sr)),(l=Je(this,ka))==null||l.close()}}ka=new WeakMap,ho=new WeakMap,Sa=new WeakMap,po=new WeakMap,mo=new WeakMap,sr=new WeakMap,Gr=new WeakMap,Yr=new WeakMap,lr=new WeakMap,Xr=new WeakMap,go=new WeakMap,Vr=new WeakMap,Qr=new WeakMap,mn=new WeakSet,Ji=function(l){var r;Je(this,go)!==l&&(Dt(this,go,l),(r=Je(this,Sa))==null||r.call(this))},vp=async function(){if(Je(this,ka))return;if(!Je(this,Xr))try{Dt(this,Xr,await jv(this.session.token))}catch(c){Yn(this,mn,Ji).call(this,c instanceof Error?c.message:String(c)),Yn(this,mn,jp).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);Dt(this,ka,r),r.addEventListener("open",()=>{Yn(this,mn,Br).call(this,{t:"client.hello",protocol:_v,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Yn(this,mn,B_).call(this,o)}),r.addEventListener("close",()=>{var c;Dt(this,ka,null),Dt(this,Yr,!1),Dt(this,lr,!1),Yn(this,mn,Ji).call(this,"Нет связи с сервером"),(c=Je(this,Sa))==null||c.call(this),Yn(this,mn,jp).call(this)}),r.addEventListener("error",()=>r.close())},B_=function(l){var r,c,o,d,h,m,g;switch(l.t){case"client.ok":Dt(this,mo,500),Yn(this,mn,Br).call(this,{t:"client.attach",hostId:Je(this,Xr)??"",...Je(this,Vr)>0?{sinceRseq:Je(this,Vr)}:{}});return;case"client.attached":Dt(this,Yr,!0),Dt(this,lr,l.online),Dt(this,Vr,l.rseq),Yn(this,mn,Ji).call(this,l.online?"Хост на связи":"Компьютер не на связи"),Yn(this,mn,Br).call(this,{t:"client.frame",body:{type:"hello",protocol:R_,clientName:"ccv-web-relay"}});const b=Je(this,Qr);Dt(this,Qr,[]);for(const y of b)Yn(this,mn,Br).call(this,{t:"client.frame",body:y});(r=Je(this,po))==null||r.call(this),(c=Je(this,Sa))==null||c.call(this);return;case"host.frame":{l.rseq>0&&Dt(this,Vr,l.rseq);const y=l.body;for(const j of Je(this,ho))j(y);return}case"host.online":Dt(this,lr,!0),Yn(this,mn,Ji).call(this,"Хост на связи"),(o=Je(this,po))==null||o.call(this),(d=Je(this,Sa))==null||d.call(this);return;case"host.offline":Dt(this,lr,!1),Yn(this,mn,Ji).call(this,"Компьютер не на связи"),(h=Je(this,Sa))==null||h.call(this);return;case"ping":Yn(this,mn,Br).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){H_(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(nf),Yn(this,mn,Ji).call(this,"Этот компьютер отвязан от аккаунта"),Dt(this,Gr,!0),(m=Je(this,ka))==null||m.close();return}l.code!=="offline"&&Yn(this,mn,Ji).call(this,l.message),(g=Je(this,Sa))==null||g.call(this);return}},Br=function(l){var r;((r=Je(this,ka))==null?void 0:r.readyState)===WebSocket.OPEN&&Je(this,ka).send(JSON.stringify(l))},jp=function(){if(Je(this,Gr)||Je(this,sr)!==null)return;const l=Je(this,mo);Dt(this,mo,Math.min(l*2,1e4)),Dt(this,sr,window.setTimeout(()=>{Dt(this,sr,null),Yn(this,mn,vp).call(this)},l))};async function jv(n){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(nf,l),l;const r=localStorage.getItem(nf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw H_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(nf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function sf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const Nv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function wv(){if(sf()==="local")return new bv(Nv);const n=yv();return n?new vv(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const $_="ccv:drafts",kv=40,Sv=2e4,Ev=500;let _u=null,yu=null;function $p(){if(_u)return _u;const n=new Map;try{const l=localStorage.getItem($_);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return _u=n,window.addEventListener("pagehide",Y_),n}function np(n){return $p().get(n)??""}function q_(n,l){const r=$p(),c=l.slice(0,Sv),o=r.has(n);if(o&&r.delete(n),c!=="")r.set(n,c);else if(!o)return;for(;r.size>kv;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Av(),Cv()}function G_(){const n=new Set;for(const l of $p().keys())n.add(l.startsWith("side:")?l.slice(5):l);return[...n].sort()}const Np=new Set;let eb="";function Tv(n){return Np.add(n),()=>Np.delete(n)}function Cv(){const n=G_(),l=n.join(`
|
|
51
|
-
`);if(l!==eb){eb=l;for(const r of Np)r(n)}}function Av(){yu===null&&(yu=window.setTimeout(Y_,Ev))}function Y_(){if(yu!==null&&window.clearTimeout(yu),yu=null,!!_u)try{localStorage.setItem($_,JSON.stringify(Object.fromEntries(_u)))}catch{}}const Cs={items:[],pending:[],lastSeq:0,contextTokens:null},sp={entries:[],total:0,loading:!1};function X_(n){var l;return((l=n.entries[0])==null?void 0:l.seq)??1}function tb(n){return n.total>0&&X_(n)>1}function Mv(n,l){const r=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function Rv(n){return lf(Cs,n).items.map(l=>({...l,id:`h:${l.id}`}))}function lf(n,l){let r=n;for(const c of l)c.seq<=r.lastSeq||(r={...Dv(r,c.event,c.seq),lastSeq:c.seq});return r}function Dv(n,l,r){var o,d;const c=n.items;switch(l.kind){case"user.message":return ba(n,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ba(n,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const m=c[h];return Fc(n,h,{...m,text:m.text+l.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?ba(n,m):Fc(n,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ba(n,{id:l.blockId,kind:"thinking",text:l.text});const m=c[h];return Fc(n,h,{...m,text:m.text+l.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"thinking",text:l.text};return h===-1?ba(n,m):Fc(n,h,m)}case"tool.use":return ba(n,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===l.toolUseId);if(h===-1)return n;const m=c[h];return Fc(n,h,{...m,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(g=>g.requestId===l.requestId),m=n.pending.filter(g=>g.requestId!==l.requestId);if(l.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 Fc({...n,pending:m},g,{...b,answers:l.answers})}}return l.decision==="allow"?{...n,pending:m}:ba({...n,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=n.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=l.contextTokens??n.contextTokens;return ba({...n,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?n:ba(n,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ba(n,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return n;case"rewound":return n;default:return n}}function Ov(n,l){let r=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(r===l)return n.slice(0,c);r++}return n}function Lv(n,l,r){const c=l-r;if(c<=0)return[];let o=0;for(let d=0;d<n.length;d++)if(n[d].kind==="user"){if(o===c)return n.slice(0,d);o++}return n}function ba(n,l){return{...n,items:[...n.items,l]}}function Fc(n,l,r){const c=n.items.slice();return c[l]=r,{...n,items:c}}const wp="ccv:theme",lp=["system","light","dark"];function zv(){const[n,l]=x.useState(Uv);x.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[n]);const r=x.useCallback(o=>{try{localStorage.setItem(wp,o)}catch{}l(o)},[]),c=x.useCallback(()=>{l(o=>{const d=lp[(lp.indexOf(o)+1)%lp.length];try{localStorage.setItem(wp,d)}catch{}return d})},[]);return[n,r,c]}function Uv(){try{const n=localStorage.getItem(wp);if(n==="light"||n==="dark"||n==="system")return n}catch{}return"system"}const V_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Iv=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Kr={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:"вопроса"}},Hv=320,Q_="ccv:panes";function Bv(n){return`--${n}-w`}function K_(n,l){const r=Kr[n];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function $v(){const n={};for(const l of Object.keys(Kr))n[l]=Kr[l].width;try{const l=localStorage.getItem(Q_);if(l){const r=JSON.parse(l);for(const c of Object.keys(Kr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=K_(c,o))}}}catch{}return n}function qv(){const[n,l]=x.useState($v),r=x.useCallback(h=>{try{localStorage.setItem(Q_,JSON.stringify(h))}catch{}},[]),c=x.useCallback((h,m)=>{l(g=>{const b=K_(h,m);if(g[h]===b)return g;const y={...g,[h]:b};return r(y),y})},[r]),o=x.useCallback(h=>{l(m=>{const g={...m,[h]:Kr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(Kr))d[Bv(h)]=`${n[h]}px`;return{widths:n,style:d,setWidth:c,reset:o}}const ap=260,F_=120,Gv=200,nb="ccv:terminal-h";function sb(n,l){return Math.round(Math.min(l,Math.max(F_,n)))}function Yv(){const[n,l]=x.useState(()=>{try{const d=localStorage.getItem(nb);if(d){const h=Number(d);if(Number.isFinite(h))return sb(h,1/0)}}catch{}return ap}),r=x.useCallback(d=>{try{localStorage.setItem(nb,String(d))}catch{}},[]),c=x.useCallback((d,h)=>{const m=sb(d,h);l(g=>g===m?g:(r(m),m))},[r]),o=x.useCallback(()=>{l(ap),r(ap)},[r]);return{height:n,setHeight:c,reset:o}}function Nf(n){const[l,r]=x.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return x.useEffect(()=>{const c=window.matchMedia(n),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),l}const Xv=500,Vv=6;function Z_({onLongPress:n,onClick:l,disabled:r=!1,thresholdMs:c=Xv,moveCancelPx:o=Vv}){const d=x.useRef(null),[h,m]=x.useState(!1),g=x.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=x.useCallback(C=>{if(r||C.button!==0)return;const A={timer:0,x:C.clientX,y:C.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,m(!1),n()},c),d.current=A,m(!0)},[r,c,n]),y=x.useCallback(C=>{const A=d.current;!A||A.fired||Math.hypot(C.clientX-A.x,C.clientY-A.y)>o&&g()},[o,g]),j=x.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=x.useCallback(C=>{var A;if((A=d.current)!=null&&A.fired){d.current=null,C.preventDefault();return}if(!r){if(C.shiftKey){n();return}l()}},[r,l,n]),S=x.useCallback(C=>{C.preventDefault()},[]),k=x.useCallback(C=>{r||C.shiftKey&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),n())},[r,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:S,onKeyDown:k}}}const Qv={height:0,offsetTop:0,offsetLeft:0};function lb(){if(typeof window>"u")return Qv;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Kv(n){const[l,r]=x.useState(lb);return x.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const d=lb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[n]),l}function qp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wr=qp();function J_(n){Wr=n}var $r={exec:()=>null};function Zc(n){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=n(c),l[c]=o),o}}function wt(n,l=""){let r=typeof n=="string"?n:n.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(_s.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var Fv=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),_s={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Zc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Zc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}>`))},Zv=/^(?:[ \t]*(?:\n|$))+/,Jv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Eu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,W_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,P_=wt(W_).replace(/bull/g,Gp).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(),ej=wt(W_).replace(/bull/g,Gp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,tj=/^[^\n]+/,Xp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,nj=wt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sj=wt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Gp).getRegex(),wf="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",Vp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,lj=wt("^ {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",Vp).replace("tag",wf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ey=n=>wt(Yp).replace("hr",Eu).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",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wf).getRegex(),aj=ey(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ij=ey(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),rj=wt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ij).getRegex(),Qp={blockquote:rj,code:Jv,def:nj,fences:Wv,heading:Pv,hr:Eu,html:lj,lheading:P_,list:sj,newline:Zv,paragraph:aj,table:$r,text:tj},ab=wt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Eu).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",wf).getRegex(),cj={...Qp,lheading:ej,table:ab,paragraph:wt(Yp).replace("hr",Eu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ab).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",wf).getRegex()},oj={...Qp,html:wt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Vp).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:$r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:wt(Yp).replace("hr",Eu).replace("heading",` *#{1,6} *[^
|
|
52
|
-
]`).replace("lheading",P_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dj=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ty=/^( {2,}|\\)\n(?!\s*$)/,fj=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bo=/[\p{P}\p{S}]/u,kf=/[\s\p{P}\p{S}]/u,Kp=/[^\s\p{P}\p{S}]/u,hj=wt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kf).getRegex(),ny=/(?!~)[\p{P}\p{S}]/u,pj=/(?!~)[\s\p{P}\p{S}]/u,mj=/(?:[^\s\p{P}\p{S}]|~)/u,gj=wt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Fv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),sy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,xj=wt(sy,"u").replace(/punct/g,bo).getRegex(),bj=wt(sy,"u").replace(/punct/g,ny).getRegex(),ly="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_j=wt(ly,"gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,kf).replace(/punct/g,bo).getRegex(),yj=wt(ly,"gu").replace(/notPunctSpace/g,mj).replace(/punctSpace/g,pj).replace(/punct/g,ny).getRegex(),vj=wt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,kf).replace(/punct/g,bo).getRegex(),jj=wt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,bo).getRegex(),Nj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wj=wt(Nj,"gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,kf).replace(/punct/g,bo).getRegex(),kj=wt(/\\(punct)/,"gu").replace(/punct/g,bo).getRegex(),Sj=wt(/^<(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(),Ej=wt(Vp).replace("(?:-->|$)","-->").getRegex(),Tj=wt("^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",Ej).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ff=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Cj=wt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ff).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ay=wt(/^!?\[(label)\]\[(ref)\]/).replace("label",ff).replace("ref",Xp).getRegex(),iy=wt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xp).getRegex(),Aj=wt("reflink|nolink(?!\\()","g").replace("reflink",ay).replace("nolink",iy).getRegex(),ib=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fp={_backpedal:$r,anyPunctuation:kj,autolink:Sj,blockSkip:gj,br:ty,code:dj,del:$r,delLDelim:$r,delRDelim:$r,emStrongLDelim:xj,emStrongRDelimAst:_j,emStrongRDelimUnd:vj,escape:uj,link:Cj,nolink:iy,punctuation:hj,reflink:ay,reflinkSearch:Aj,tag:Tj,text:fj,url:$r},Mj={...Fp,link:wt(/^!?\[(label)\]\((.*?)\)/).replace("label",ff).getRegex(),reflink:wt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ff).getRegex()},kp={...Fp,emStrongRDelimAst:yj,emStrongLDelim:bj,delLDelim:jj,delRDelim:wj,url:wt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ib).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:wt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ib).getRegex()},Rj={...kp,br:wt(ty).replace("{2,}","*").getRegex(),text:wt(kp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Hd={normal:Qp,gfm:cj,pedantic:oj},uu={normal:Fp,gfm:kp,breaks:Rj,pedantic:Mj},Dj={"&":"&","<":"<",">":">",'"':""","'":"'"},rb=n=>Dj[n];function ja(n,l){if(l){if(_s.escapeTest.test(n))return n.replace(_s.escapeReplace,rb)}else if(_s.escapeTestNoEncode.test(n))return n.replace(_s.escapeReplaceNoEncode,rb);return n}function cb(n){try{n=encodeURI(n).replace(_s.percentDecode,"%")}catch{return null}return n}function ob(n,l){var d;let r=n.replace(_s.findPipe,(h,m,g)=>{let b=!1,y=m;for(;--y>=0&&g[y]==="\\";)b=!b;return b?"|":" |"}),c=r.split(_s.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(_s.slashPipe,"|");return c}function Fi(n,l,r){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===l;)o++;return n.slice(0,c-o)}function ub(n){let l=n.split(`
|
|
53
|
-
`),r=l.length-1;for(;r>=0&&_s.blankLine.test(l[r]);)r--;return l.length-r<=2?n:l.slice(0,r+1).join(`
|
|
54
|
-
`)}function Oj(n,l){if(n.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===l[0])r++;else if(n[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function Lj(n,l=0){let r=l,c="";for(let o of n)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function db(n,l,r,c,o){let d=l.href,h=l.title||null,m=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function zj(n,l,r){let c=n.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
55
|
-
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
|
|
56
|
-
`)}var hf=class{constructor(n){Zt(this,"options");Zt(this,"rules");Zt(this,"lexer");this.options=n||Wr}space(n){let l=this.rules.block.newline.exec(n);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(n){let l=this.rules.block.code.exec(n);if(l){let r=this.options.pedantic?l[0]:ub(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(n){let l=this.rules.block.fences.exec(n);if(l){let r=l[0],c=zj(r,l[3]||"",this.rules);return{type:"code",raw:r,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(n){let l=this.rules.block.heading.exec(n);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=Fi(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Fi(l[0],`
|
|
57
|
-
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let l=this.rules.block.hr.exec(n);if(l)return{type:"hr",raw:Fi(l[0],`
|
|
58
|
-
`)}}blockquote(n){let l=this.rules.block.blockquote.exec(n);if(l){let r=Fi(l[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
|
-
`),y=b.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
-
${b}`:b,o=o?`${o}
|
|
64
|
-
${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,d,!0),this.lexer.state.top=j,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let S=v,k=S.raw+`
|
|
65
|
-
`+r.join(`
|
|
66
|
-
`),C=this.blockquote(k);d[d.length-1]=C,c=c.substring(0,c.length-S.raw.length)+C.raw,o=o.substring(0,o.length-S.text.length)+C.text;break}else if((v==null?void 0:v.type)==="list"){let S=v,k=S.raw+`
|
|
67
|
-
`+r.join(`
|
|
68
|
-
`),C=this.list(k);d[d.length-1]=C,c=c.substring(0,c.length-v.raw.length)+C.raw,o=o.substring(0,o.length-S.raw.length)+C.raw,r=k.substring(d.at(-1).raw.length).split(`
|
|
69
|
-
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(n){let l=this.rules.block.list.exec(n);if(l){let r=l[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;n;){let g=!1,b="",y="";if(!(l=d.exec(n))||this.rules.block.hr.test(n))break;b=l[0],n=n.substring(b.length);let j=Lj(l[2].split(`
|
|
70
|
-
`,1)[0],l[1].length),v=n.split(`
|
|
71
|
-
`,1)[0],S=!j.trim(),k=0;if(this.options.pedantic?(k=2,y=j.trimStart()):S?k=l[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,y=j.slice(k),k+=l[1].length),S&&this.rules.other.blankLine.test(v)&&(b+=v+`
|
|
72
|
-
`,n=n.substring(v.length+1),g=!0),!g){let C=this.rules.other.nextBulletRegex(k),A=this.rules.other.hrRegex(k),F=this.rules.other.fencesBeginRegex(k),Q=this.rules.other.headingBeginRegex(k),q=this.rules.other.htmlBeginRegex(k),B=this.rules.other.blockquoteBeginRegex(k);for(;n;){let Y=n.split(`
|
|
73
|
-
`,1)[0],M;if(v=Y,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),F.test(v)||Q.test(v)||q.test(v)||B.test(v)||C.test(v)||A.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=k||!v.trim())y+=`
|
|
74
|
-
`+M.slice(k);else{if(S||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||F.test(j)||Q.test(j)||A.test(j))break;y+=`
|
|
75
|
-
`+v}S=!v.trim(),b+=Y+`
|
|
76
|
-
`,n=n.substring(Y.length+1),j=M.slice(k)}}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(y),loose:!1,text:y,tokens:[]}),o.raw+=b}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let y=this.rules.other.listTaskCheckbox.exec(g.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let y=g.tokens.filter(v=>v.type==="space"),j=y.length>0&&y.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(n){let l=this.rules.block.html.exec(n);if(l){let r=ub(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(n){let l=this.rules.block.def.exec(n);if(l){let r=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:r,raw:Fi(l[0],`
|
|
77
|
-
`),href:c,title:o}}}table(n){var h;let l=this.rules.block.table.exec(n);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=ob(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
-
`):[],d={type:"table",raw:Fi(l[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(ob(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(n){let l=this.rules.block.lheading.exec(n);if(l){let r=l[1].trim();return{type:"heading",raw:Fi(l[0],`
|
|
80
|
-
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let l=this.rules.block.paragraph.exec(n);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
81
|
-
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let l=this.rules.block.text.exec(n);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(n){let l=this.rules.inline.escape.exec(n);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(n){let l=this.rules.inline.tag.exec(n);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(n){let l=this.rules.inline.link.exec(n);if(l){let r=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Fi(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Oj(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),db(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(n,l){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return db(r,o,r[0],this.lexer,this.rules)}}emStrong(n,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(n);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,l=l.slice(-1*n.length+o);(c=b.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let y=[...c[0]][0].length,j=n.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let S=j.slice(1,-1);return{type:"em",raw:j,text:S,tokens:this.lexer.inlineTokens(S)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let l=this.rules.inline.code.exec(n);if(l){let r=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:l[0],text:r}}}br(n){let l=this.rules.inline.br.exec(n);if(l)return{type:"br",raw:l[0]}}del(n,l,r=""){let c=this.rules.inline.delLDelim.exec(n);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,l=l.slice(-1*n.length+o);(c=g.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let b=[...c[0]][0].length,y=n.slice(0,o+c.index+b+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(n){let l=this.rules.inline.autolink.exec(n);if(l){let r,c;return l[2]==="@"?(r=l[1],c="mailto:"+r):(r=l[1],c=r),{type:"link",raw:l[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let l;if(l=this.rules.inline.url.exec(n)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((r=this.rules.inline._backpedal.exec(l[0]))==null?void 0:r[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let l=this.rules.inline.text.exec(n);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},Jl=class Sp{constructor(l){Zt(this,"tokens");Zt(this,"options");Zt(this,"state");Zt(this,"inlineQueue");Zt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Wr,this.options.tokenizer=this.options.tokenizer||new hf,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:_s,block:Hd.normal,inline:uu.normal};this.options.pedantic?(r.block=Hd.pedantic,r.inline=uu.pedantic):this.options.gfm&&(r.block=Hd.gfm,this.options.breaks?r.inline=uu.breaks:r.inline=uu.gfm),this.tokenizer.rules=r}static get rules(){return{block:Hd,inline:uu}}static lex(l,r){return new Sp(r).lex(l)}static lexInline(l,r){return new Sp(r).inlineTokens(l)}lex(l){l=l.replace(_s.carriageReturn,`
|
|
82
|
-
`),this.blockTokens(l,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(_s.tabCharGlobal," ").replace(_s.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(g=y.call({lexer:this},l,r))?(l=l.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(l)){l=l.substring(g.raw.length);let y=r.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
|
|
83
|
-
`:r.push(g);continue}if(g=this.tokenizer.code(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
84
|
-
`)?"":`
|
|
85
|
-
`)+g.raw,y.text+=`
|
|
86
|
-
`+g.text,this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(g=this.tokenizer.fences(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
87
|
-
`)?"":`
|
|
88
|
-
`)+g.raw,y.text+=`
|
|
89
|
-
`+g.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},r.push(g));continue}if(g=this.tokenizer.table(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(l)){l=l.substring(g.raw.length),r.push(g);continue}let b=l;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(S=>{v=S.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(b=l.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(b))){let y=r.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
|
|
90
|
-
`)?"":`
|
|
91
|
-
`)+g.raw,y.text+=`
|
|
92
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g),c=b.length!==l.length,l=l.substring(g.raw.length);continue}if(g=this.tokenizer.text(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
93
|
-
`)?"":`
|
|
94
|
-
`)+g.raw,y.text+=`
|
|
95
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,r}inline(l,r=[]){return this.inlineQueue.push({src:l,tokens:r}),r}inlineTokens(l,r=[]){var m,g,b,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,S=>v.includes(S.slice(S.lastIndexOf("[")+1,-1))?"["+"a".repeat(S.length-2)+"]":S))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,S,k)=>{let C=k?k.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(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(b=this.options.extensions)==null?void 0:b.inline)!=null&&y.some(k=>(v=k.call({lexer:this},l,r))?(l=l.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let k=r.at(-1);v.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),r.push(v);continue}let S=l;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,C=l.slice(1),A;this.options.extensions.startInline.forEach(F=>{A=F.call({lexer:this},C),typeof A=="number"&&A>=0&&(k=Math.min(k,A))}),k<1/0&&k>=0&&(S=l.substring(0,k+1))}if(v=this.tokenizer.inlineText(S)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let k=r.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return r}infiniteLoopError(l){let r="Infinite loop on byte: "+l;if(this.options.silent)console.error(r);else throw new Error(r)}},pf=class{constructor(n){Zt(this,"options");Zt(this,"parser");this.options=n||Wr}space(n){return""}code({text:n,lang:l,escaped:r}){var d;let c=(d=(l||"").match(_s.notSpaceStart))==null?void 0:d[0],o=n.replace(_s.endingNewline,"")+`
|
|
96
|
-
`;return c?'<pre><code class="language-'+ja(c)+'">'+(r?o:ja(o,!0))+`</code></pre>
|
|
97
|
-
`:"<pre><code>"+(r?o:ja(o,!0))+`</code></pre>
|
|
98
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
99
|
-
${this.parser.parse(n)}</blockquote>
|
|
100
|
-
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:l}){return`<h${l}>${this.parser.parseInline(n)}</h${l}>
|
|
101
|
-
`}hr(n){return`<hr>
|
|
102
|
-
`}list(n){let l=n.ordered,r=n.start,c="";for(let h=0;h<n.items.length;h++){let m=n.items[h];c+=this.listitem(m)}let o=l?"ol":"ul",d=l&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
103
|
-
`+c+"</"+o+`>
|
|
104
|
-
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
105
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
106
|
-
`}table(n){let l="",r="";for(let o=0;o<n.header.length;o++)r+=this.tablecell(n.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<n.rows.length;o++){let d=n.rows[o];r="";for(let h=0;h<d.length;h++)r+=this.tablecell(d[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
-
<thead>
|
|
108
|
-
`+l+`</thead>
|
|
109
|
-
`+c+`</table>
|
|
110
|
-
`}tablerow({text:n}){return`<tr>
|
|
111
|
-
${n}</tr>
|
|
112
|
-
`}tablecell(n){let l=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+l+`</${r}>
|
|
113
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ja(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:l,tokens:r}){let c=this.parser.parseInline(r),o=cb(n);if(o===null)return c;n=o;let d='<a href="'+n+'"';return l&&(d+=' title="'+ja(l)+'"'),d+=">"+c+"</a>",d}image({href:n,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=cb(n);if(o===null)return ja(r);n=o;let d=`<img src="${n}" alt="${ja(r)}"`;return l&&(d+=` title="${ja(l)}"`),d+=">",d}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ja(n.text)}},Zp=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Wl=class Ep{constructor(l){Zt(this,"options");Zt(this,"renderer");Zt(this,"textRenderer");this.options=l||Wr,this.options.renderer=this.options.renderer||new pf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zp}static parse(l,r){return new Ep(r).parse(l)}static parseInline(l,r){return new Ep(r).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,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(l,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let m=l[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}},ef,gu=(ef=class{constructor(n){Zt(this,"options");Zt(this,"block");this.options=n||Wr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?Jl.lex:Jl.lexInline}provideParser(n=this.block){return n?Wl.parse:Wl.parseInline}},Zt(ef,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Zt(ef,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ef),Uj=class{constructor(...n){Zt(this,"defaults",qp());Zt(this,"options",this.setOptions);Zt(this,"parse",this.parseMarkdown(!0));Zt(this,"parseInline",this.parseMarkdown(!1));Zt(this,"Parser",Wl);Zt(this,"Renderer",pf);Zt(this,"TextRenderer",Zp);Zt(this,"Lexer",Jl);Zt(this,"Tokenizer",hf);Zt(this,"Hooks",gu);this.use(...n)}walkTokens(n,l){var c,o;let r=[];for(let d of n)switch(r=r.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,l));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,l));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...n){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),r.renderer){let o=this.defaults.renderer||new pf(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 y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new hf(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 y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new gu;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];gu.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&gu.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,b);return g.call(o,j)})();let y=m.call(o,b);return g.call(o,y)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,b);return j===!1&&(j=await g.apply(o,b)),j})();let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,l){return Jl.lex(n,l??this.defaults)}parser(n,l){return Wl.parse(n,l??this.defaults)}parseMarkdown(n){return(l,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,m=await(o.hooks?await o.hooks.provideLexer(n):n?Jl.lex:Jl.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(n):n?Wl.parse:Wl.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(n):n?Jl.lex:Jl.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(n):n?Wl.parse:Wl.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(n,l){return r=>{if(r.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+ja(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},Jr=new Uj;function Ot(n,l){return Jr.parse(n,l)}Ot.options=Ot.setOptions=function(n){return Jr.setOptions(n),Ot.defaults=Jr.defaults,J_(Ot.defaults),Ot};Ot.getDefaults=qp;Ot.defaults=Wr;Ot.use=function(...n){return Jr.use(...n),Ot.defaults=Jr.defaults,J_(Ot.defaults),Ot};Ot.walkTokens=function(n,l){return Jr.walkTokens(n,l)};Ot.parseInline=Jr.parseInline;Ot.Parser=Wl;Ot.parser=Wl.parse;Ot.Renderer=pf;Ot.TextRenderer=Zp;Ot.Lexer=Jl;Ot.lexer=Jl.lex;Ot.Tokenizer=hf;Ot.Hooks=gu;Ot.parse=Ot;Ot.options;Ot.setOptions;Ot.use;Ot.walkTokens;Ot.parseInline;Wl.parse;Jl.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 fb(n,l){(l==null||l>n.length)&&(l=n.length);for(var r=0,c=Array(l);r<l;r++)c[r]=n[r];return c}function Ij(n){if(Array.isArray(n))return n}function Hj(n,l){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,b=!1;try{if(d=(r=r.call(n)).next,l!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==l);g=!0);}catch(y){b=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function Bj(){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 $j(n,l){return Ij(n)||Hj(n,l)||qj(n,l)||Bj()}function qj(n,l){if(n){if(typeof n=="string")return fb(n,l);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fb(n,l):void 0}}const ry=Object.entries,hb=Object.setPrototypeOf,Gj=Object.isFrozen,Yj=Object.getPrototypeOf,Xj=Object.getOwnPropertyDescriptor;let ds=Object.freeze,fs=Object.seal,Pc=Object.create,cy=typeof Reflect<"u"&&Reflect,Tp=cy.apply,Cp=cy.construct;ds||(ds=function(l){return l});fs||(fs=function(l){return l});Tp||(Tp=function(l,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(r,o)});Cp||(Cp=function(l){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new l(...c)});const Jc=Xn(Array.prototype.forEach),Vj=Xn(Array.prototype.lastIndexOf),pb=Xn(Array.prototype.pop),Wc=Xn(Array.prototype.push),Qj=Xn(Array.prototype.splice),nr=Array.isArray,xu=Xn(String.prototype.toLowerCase),ip=Xn(String.prototype.toString),mb=Xn(String.prototype.match),du=Xn(String.prototype.replace),gb=Xn(String.prototype.indexOf),Kj=Xn(String.prototype.trim),Fj=Xn(Number.prototype.toString),Zj=Xn(Boolean.prototype.toString),xb=typeof BigInt>"u"?null:Xn(BigInt.prototype.toString),bb=typeof Symbol>"u"?null:Xn(Symbol.prototype.toString),ls=Xn(Object.prototype.hasOwnProperty),fu=Xn(Object.prototype.toString),ss=Xn(RegExp.prototype.test),zr=Jj(TypeError);function Xn(n){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return Tp(n,l,c)}}function Jj(n){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return Cp(n,r)}}function Nt(n,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xu;if(hb&&hb(n,null),!nr(l))return n;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&(Gj(l)||(l[c]=d),o=d)}n[o]=!0}return n}function Wj(n){for(let l=0;l<n.length;l++)ls(n,l)||(n[l]=null);return n}function As(n){const l=Pc(null);for(const c of ry(n)){var r=$j(c,2);const o=r[0],d=r[1];ls(n,o)&&(nr(d)?l[o]=Wj(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=As(d):l[o]=d)}return l}function Pj(n){switch(typeof n){case"string":return n;case"number":return Fj(n);case"boolean":return Zj(n);case"bigint":return xb?xb(n):"0";case"symbol":return bb?bb(n):"Symbol()";case"undefined":return fu(n);case"function":case"object":{if(n===null)return fu(n);const l=n,r=Na(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:fu(c)}return fu(n)}default:return fu(n)}}function Na(n,l){for(;n!==null;){const c=Xj(n,l);if(c){if(c.get)return Xn(c.get);if(typeof c.value=="function")return Xn(c.value)}n=Yj(n)}function r(){return null}return r}function e1(n){try{return ss(n,""),!0}catch{return!1}}const _b=ds(["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"]),rp=ds(["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"]),cp=ds(["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"]),t1=ds(["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"]),op=ds(["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"]),n1=ds(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yb=ds(["#text"]),vb=ds(["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"]),up=ds(["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"]),jb=ds(["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"]),Bd=ds(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),s1=fs(/{{[\w\W]*|^[\w\W]*}}/g),l1=fs(/<%[\w\W]*|^[\w\W]*%>/g),a1=fs(/\${[\w\W]*/g),i1=fs(/^data-[\-\w.\u00B7-\uFFFF]+$/),r1=fs(/^aria-[\-\w]+$/),Nb=fs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),c1=fs(/^(?:\w+script|data):/i),o1=fs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),u1=fs(/^html$/i),d1=fs(/^[a-z][.\w]*(-[.\w]+)+$/i),wb=fs(/<[/\w!]/g),kb=fs(/<[/\w]/g),f1=fs(/<\/no(script|embed|frames)/i),h1=fs(/\/>/i),fl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},p1=function(){return typeof window>"u"?null:window},m1=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Sb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Zi=function(l,r,c,o){return ls(l,r)&&nr(l[r])?Nt(o.base?As(o.base):{},l[r],o.transform):c};function oy(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p1();const l=we=>oy(we);if(l.version="3.4.12",l.removed=[],!n||!n.document||n.document.nodeType!==fl.document||!n.Element)return l.isSupported=!1,l;let r=n.document;const c=r,o=c.currentScript;n.DocumentFragment;const d=n.HTMLTemplateElement,h=n.Node,m=n.Element,g=n.NodeFilter,b=n.NamedNodeMap;b===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,j=n.trustedTypes,v=m.prototype,S=Na(v,"cloneNode"),k=Na(v,"remove"),C=Na(v,"nextSibling"),A=Na(v,"childNodes"),F=Na(v,"parentNode"),Q=Na(v,"shadowRoot"),q=Na(v,"attributes"),B=h&&h.prototype?Na(h.prototype,"nodeType"):null,Y=h&&h.prototype?Na(h.prototype,"nodeName"):null;if(typeof d=="function"){const we=r.createElement("template");we.content&&we.content.ownerDocument&&(r=we.content.ownerDocument)}let M,z="",R,Z=!1,re=0;const G=function(){if(re>0)throw zr('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.')},$=function(T){G(),re++;try{return M.createHTML(T)}finally{re--}},he=function(T){G(),re++;try{return M.createScriptURL(T)}finally{re--}},ve=function(){return Z||(R=m1(j,o),Z=!0),R},K=r,O=K.implementation,I=K.createNodeIterator,oe=K.createDocumentFragment,pe=K.getElementsByTagName,je=c.importNode;let E=Sb();l.isSupported=typeof ry=="function"&&typeof F=="function"&&O&&O.createHTMLDocument!==void 0;const ne=s1,X=l1,Ne=a1,U=i1,ye=r1,Le=c1,Ie=o1,qe=d1;let $t=Nb,Ve=null;const Cn=Nt({},[..._b,...rp,...cp,...op,...yb]);let it=null;const lt=Nt({},[...vb,...up,...jb,...Bd]);let tt=Object.seal(Pc(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}})),Lt=null,_t=null;const vt=Object.seal(Pc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let qt=!0,Te=!0,We=!1,At=!0,gt=!1,Ye=!0,wn=!1,zn=!1,St=null,Jt=null,hs=!1,An=!1,xn=!1,as=!1,zt=!0,on=!1;const ln="user-content-";let Gt=!0,Zn=!1,ue={},ke=null;const Qe=Nt({},["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 rt=null;const He=Nt({},["audio","video","img","source","image","track"]);let Pe=null;const W=Nt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let Yt=Ge,Mn=!1,Ms=null;const Rl=Nt({},[ge,Re,Ge],ip),ea=ds(["mi","mo","mn","ms","mtext"]);let Rs=Nt({},ea);const vs=ds(["annotation-xml"]);let bn=Nt({},vs);const Qs=Nt({},["title","style","font","a","script"]);let yn=null;const ps=["application/xhtml+xml","text/html"],Xt="text/html";let Ze=null,Vn=null;const hl=r.createElement("form"),ta=function(T){return T instanceof RegExp||T instanceof Function},Dl=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Vn&&Vn===T)return;(!T||typeof T!="object")&&(T={}),T=As(T),yn=ps.indexOf(T.PARSER_MEDIA_TYPE)===-1?Xt:T.PARSER_MEDIA_TYPE,Ze=yn==="application/xhtml+xml"?ip:xu,Ve=Zi(T,"ALLOWED_TAGS",Cn,{transform:Ze}),it=Zi(T,"ALLOWED_ATTR",lt,{transform:Ze}),Ms=Zi(T,"ALLOWED_NAMESPACES",Rl,{transform:ip}),Pe=Zi(T,"ADD_URI_SAFE_ATTR",W,{transform:Ze,base:W}),rt=Zi(T,"ADD_DATA_URI_TAGS",He,{transform:Ze,base:He}),ke=Zi(T,"FORBID_CONTENTS",Qe,{transform:Ze}),Lt=Zi(T,"FORBID_TAGS",As({}),{transform:Ze}),_t=Zi(T,"FORBID_ATTR",As({}),{transform:Ze}),ue=ls(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?As(T.USE_PROFILES):T.USE_PROFILES:!1,qt=T.ALLOW_ARIA_ATTR!==!1,Te=T.ALLOW_DATA_ATTR!==!1,We=T.ALLOW_UNKNOWN_PROTOCOLS||!1,At=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,gt=T.SAFE_FOR_TEMPLATES||!1,Ye=T.SAFE_FOR_XML!==!1,wn=T.WHOLE_DOCUMENT||!1,An=T.RETURN_DOM||!1,xn=T.RETURN_DOM_FRAGMENT||!1,as=T.RETURN_TRUSTED_TYPE||!1,hs=T.FORCE_BODY||!1,zt=T.SANITIZE_DOM!==!1,on=T.SANITIZE_NAMED_PROPS||!1,Gt=T.KEEP_CONTENT!==!1,Zn=T.IN_PLACE||!1,$t=e1(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:Nb,Yt=typeof T.NAMESPACE=="string"?T.NAMESPACE:Ge,Rs=ls(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?As(T.MATHML_TEXT_INTEGRATION_POINTS):Nt({},ea),bn=ls(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?As(T.HTML_INTEGRATION_POINTS):Nt({},vs);const P=ls(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?As(T.CUSTOM_ELEMENT_HANDLING):Pc(null);if(tt=Pc(null),ls(P,"tagNameCheck")&&ta(P.tagNameCheck)&&(tt.tagNameCheck=P.tagNameCheck),ls(P,"attributeNameCheck")&&ta(P.attributeNameCheck)&&(tt.attributeNameCheck=P.attributeNameCheck),ls(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),fs(tt),gt&&(Te=!1),xn&&(An=!0),ue&&(Ve=Nt({},yb),it=Pc(null),ue.html===!0&&(Nt(Ve,_b),Nt(it,vb)),ue.svg===!0&&(Nt(Ve,rp),Nt(it,up),Nt(it,Bd)),ue.svgFilters===!0&&(Nt(Ve,cp),Nt(it,up),Nt(it,Bd)),ue.mathMl===!0&&(Nt(Ve,op),Nt(it,jb),Nt(it,Bd))),vt.tagCheck=null,vt.attributeCheck=null,ls(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?vt.tagCheck=T.ADD_TAGS:nr(T.ADD_TAGS)&&(Ve===Cn&&(Ve=As(Ve)),Nt(Ve,T.ADD_TAGS,Ze))),ls(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?vt.attributeCheck=T.ADD_ATTR:nr(T.ADD_ATTR)&&(it===lt&&(it=As(it)),Nt(it,T.ADD_ATTR,Ze))),ls(T,"ADD_URI_SAFE_ATTR")&&nr(T.ADD_URI_SAFE_ATTR)&&Nt(Pe,T.ADD_URI_SAFE_ATTR,Ze),ls(T,"FORBID_CONTENTS")&&nr(T.FORBID_CONTENTS)&&(ke===Qe&&(ke=As(ke)),Nt(ke,T.FORBID_CONTENTS,Ze)),ls(T,"ADD_FORBID_CONTENTS")&&nr(T.ADD_FORBID_CONTENTS)&&(ke===Qe&&(ke=As(ke)),Nt(ke,T.ADD_FORBID_CONTENTS,Ze)),Gt&&(Ve["#text"]=!0),wn&&Nt(Ve,["html","head","body"]),Ve.table&&(Nt(Ve,["tbody"]),delete Lt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const be=M;M=T.TRUSTED_TYPES_POLICY;try{z=$("")}catch(Me){throw M=be,Me}}else T.TRUSTED_TYPES_POLICY===null?(M=void 0,z=""):(M===void 0&&(M=ve()),M&&typeof z=="string"&&(z=$("")));ds&&ds(T),Vn=T},is=Nt({},[...rp,...cp,...t1]),js=Nt({},[...op,...n1]),na=function(T,P,be){return P.namespaceURI===Ge?T==="svg":P.namespaceURI===ge?T==="svg"&&(be==="annotation-xml"||Rs[be]):!!is[T]},pl=function(T,P,be){return P.namespaceURI===Ge?T==="math":P.namespaceURI===Re?T==="math"&&bn[be]:!!js[T]},Ks=function(T,P,be){return P.namespaceURI===Re&&!bn[be]||P.namespaceURI===ge&&!Rs[be]?!1:!js[T]&&(Qs[T]||!is[T])},ml=function(T){let P=F(T);(!P||!P.tagName)&&(P={namespaceURI:Yt,tagName:"template"});const be=xu(T.tagName),Me=xu(P.tagName);return Ms[T.namespaceURI]?T.namespaceURI===Re?na(be,P,Me):T.namespaceURI===ge?pl(be,P,Me):T.namespaceURI===Ge?Ks(be,P,Me):!!(yn==="application/xhtml+xml"&&Ms[T.namespaceURI]):!1},an=function(T){Wc(l.removed,{element:T});try{F(T).removeChild(T)}catch{if(k(T),!F(T))throw zr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ut=function(T){ms(T);const P=A(T);if(P){const Me=[];Jc(P,$e=>{Wc(Me,$e)}),Jc(Me,$e=>{try{k($e)}catch{}})}const be=q(T);if(be)for(let Me=be.length-1;Me>=0;--Me){const $e=be[Me],ze=$e&&$e.name;if(typeof ze=="string")try{T.removeAttribute(ze)}catch{}}},Ds=function(T,P){try{Wc(l.removed,{attribute:P.getAttributeNode(T),from:P})}catch{Wc(l.removed,{attribute:null,from:P})}if(P.removeAttribute(T),T==="is")if(An||xn)try{an(P)}catch{}else try{P.setAttribute(T,"")}catch{}},Fs=function(T){const P=q(T);if(P)for(let be=P.length-1;be>=0;--be){const Me=P[be],$e=Me&&Me.name;if(!(typeof $e!="string"||it[Ze($e)]))try{T.removeAttribute($e)}catch{}}},ms=function(T){const P=[T];for(;P.length>0;){const be=P.pop();(B?B(be):be.nodeType)===fl.element&&Fs(be);const $e=A(be);if($e)for(let ze=$e.length-1;ze>=0;--ze)P.push($e[ze])}},Jn=function(T){if(!Ye)return;const P=[T];for(;P.length>0;){const be=P.pop(),Me=B?B(be):be.nodeType;if(Me===fl.processingInstruction||Me===fl.comment&&ss(kb,be.data)){try{k(be)}catch{}continue}if(Me===fl.element){const ze=be,Ut=Ze(Y?Y(be):be.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&Ut!=="label"&&Ut!=="output"&&ze.removeAttribute("for")}catch{}}const $e=A(be);if($e)for(let ze=$e.length-1;ze>=0;--ze)P.push($e[ze])}},rs=function(T){let P=null,be=null;if(hs)T="<remove></remove>"+T;else{const ze=mb(T,/^[\r\n\t ]+/);be=ze&&ze[0]}yn==="application/xhtml+xml"&&Yt===Ge&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const Me=M?$(T):T;if(Yt===Ge)try{P=new y().parseFromString(Me,yn)}catch{}if(!P||!P.documentElement){P=O.createDocument(Yt,"template",null);try{P.documentElement.innerHTML=Mn?z:Me}catch{}}const $e=P.body||P.documentElement;return T&&be&&$e.insertBefore(r.createTextNode(be),$e.childNodes[0]||null),Yt===Ge?pe.call(P,wn?"html":"body")[0]:wn?P.documentElement:$e},gl=function(T){return I.call(T.ownerDocument||T,T,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},gs=function(T){return T=du(T,ne," "),T=du(T,X," "),T=du(T,Ne," "),T},Os=function(T){var P;T.normalize();const be=I.call(T.ownerDocument||T,T,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Me=be.nextNode();for(;Me;)Me.data=gs(Me.data),Me=be.nextNode();const $e=(P=T.querySelectorAll)===null||P===void 0?void 0:P.call(T,"template");$e&&Jc($e,ze=>{Wn(ze.content)&&Os(ze.content)})},yt=function(T){const P=Y?Y(T):null;return typeof P!="string"||Ze(P)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==q(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==B(T)||T.childNodes!==A(T)},Wn=function(T){if(!B||typeof T!="object"||T===null)return!1;try{return B(T)===fl.documentFragment}catch{return!1}},jt=function(T){if(!B||typeof T!="object"||T===null)return!1;try{return typeof B(T)=="number"}catch{return!1}};function ct(we,T,P){we.length!==0&&Jc(we,be=>{be.call(l,T,P,Vn)})}const sa=function(T,P){return!!(Ye&&T.hasChildNodes()&&!jt(T.firstElementChild)&&ss(wb,T.textContent)&&ss(wb,T.innerHTML)||Ye&&T.namespaceURI===Ge&&P==="style"&&jt(T.firstElementChild)||T.nodeType===fl.processingInstruction||Ye&&T.nodeType===fl.comment&&ss(kb,T.data))},Ol=function(T,P){if(!Lt[P]&&la(P)&&(tt.tagNameCheck instanceof RegExp&&ss(tt.tagNameCheck,P)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(P)))return!1;if(Gt&&!ke[P]){const be=F(T),Me=A(T);if(Me&&be){const $e=Me.length;for(let ze=$e-1;ze>=0;--ze){const Ut=Zn?Me[ze]:S(Me[ze],!0);be.insertBefore(Ut,C(T))}}}return an(T),!0},Qn=function(T,P){if(ct(E.beforeSanitizeElements,T,null),T!==P&&F(T)===null)return!0;if(yt(T))return an(T),!0;const be=Ze(Y?Y(T):T.nodeName);if(ct(E.uponSanitizeElement,T,{tagName:be,allowedTags:Ve}),T!==P&&F(T)===null)return!0;if(sa(T,be))return an(T),!0;if(Lt[be]||!(vt.tagCheck instanceof Function&&vt.tagCheck(be))&&!Ve[be]){const $e=Ol(T,be);return $e===!1&&ct(E.afterSanitizeElements,T,null),$e}if((B?B(T):T.nodeType)===fl.element&&!ml(T)||(be==="noscript"||be==="noembed"||be==="noframes")&&ss(f1,T.innerHTML))return an(T),!0;if(gt&&T.nodeType===fl.text){const $e=gs(T.textContent);T.textContent!==$e&&(Wc(l.removed,{element:T.cloneNode()}),T.textContent=$e)}return ct(E.afterSanitizeElements,T,null),!1},Ls=function(T,P,be){if(_t[P]||Ye&&P==="patchsrc"||Ye&&P==="for"&&T!=="label"&&T!=="output"||zt&&(P==="id"||P==="name")&&(be in r||be in hl))return!1;const Me=it[P]||vt.attributeCheck instanceof Function&&vt.attributeCheck(P,T);if(!(Te&&ss(U,P))){if(!(qt&&ss(ye,P))){if(Me){if(!Pe[P]){if(!ss($t,du(be,Ie,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&T!=="script"&&gb(be,"data:")===0&&rt[T])){if(!(We&&!ss(Le,du(be,Ie,"")))){if(be)return!1}}}}}else if(!(la(T)&&(tt.tagNameCheck instanceof RegExp&&ss(tt.tagNameCheck,T)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(T))&&(tt.attributeNameCheck instanceof RegExp&&ss(tt.attributeNameCheck,P)||tt.attributeNameCheck instanceof Function&&tt.attributeNameCheck(P,T))||P==="is"&&tt.allowCustomizedBuiltInElements&&(tt.tagNameCheck instanceof RegExp&&ss(tt.tagNameCheck,be)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(be))))return!1}}return!0},Un=Nt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),la=function(T){return!Un[xu(T)]&&ss(qe,T)},kt=function(T,P,be,Me){if(M&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!be)switch(j.getAttributeType(T,P)){case"TrustedHTML":return $(Me);case"TrustedScriptURL":return he(Me)}return Me},Zs=function(T,P,be,Me){try{be?T.setAttributeNS(be,P,Me):T.setAttribute(P,Me),yt(T)?an(T):pb(l.removed)}catch{Ds(P,T)}},Wt=function(T){ct(E.beforeSanitizeAttributes,T,null);const P=T.attributes;if(!P||yt(T))return;const be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:it,forceKeepAttr:void 0};let Me=P.length;const $e=Ze(T.nodeName);for(;Me--;){const ze=P[Me],Ut=ze.name,dn=ze.namespaceURI,fn=ze.value,Vt=Ze(Ut),kn=fn;let Pt=Ut==="value"?kn:Kj(kn);if(be.attrName=Vt,be.attrValue=Pt,be.keepAttr=!0,be.forceKeepAttr=void 0,ct(E.uponSanitizeAttribute,T,be),Pt=be.attrValue,on&&(Vt==="id"||Vt==="name")&&gb(Pt,ln)!==0&&(Ds(Ut,T),Pt=ln+Pt),Ye&&ss(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pt)){Ds(Ut,T);continue}if(Vt==="attributename"&&mb(Pt,"href")){Ds(Ut,T);continue}if(!be.forceKeepAttr){if(!be.keepAttr){Ds(Ut,T);continue}if(!At&&ss(h1,Pt)){Ds(Ut,T);continue}if(gt&&(Pt=gs(Pt)),!Ls($e,Vt,Pt)){Ds(Ut,T);continue}Pt=kt($e,Vt,dn,Pt),Pt!==kn&&Zs(T,Ut,dn,Pt)}}ct(E.afterSanitizeAttributes,T,null)},Rn=function(T){let P=null;const be=gl(T);for(ct(E.beforeSanitizeShadowDOM,T,null);P=be.nextNode();)if(ct(E.uponSanitizeShadowNode,P,null),Qn(P,T),Wt(P),Wn(P.content)&&Rn(P.content),(B?B(P):P.nodeType)===fl.element){const $e=Q(P);Wn($e)&&(un($e),Rn($e))}ct(E.afterSanitizeShadowDOM,T,null)},un=function(T){const P=[{node:T,shadow:null}];for(;P.length>0;){const be=P.pop();if(be.shadow){Rn(be.shadow);continue}const Me=be.node,ze=(B?B(Me):Me.nodeType)===fl.element,Ut=A(Me);if(Ut)for(let dn=Ut.length-1;dn>=0;--dn)P.push({node:Ut[dn],shadow:null});if(ze){const dn=Y?Y(Me):null;if(typeof dn=="string"&&Ze(dn)==="template"){const fn=Me.content;Wn(fn)&&P.push({node:fn,shadow:null})}}if(ze){const dn=Q(Me);Wn(dn)&&P.push({node:null,shadow:dn},{node:dn,shadow:null})}}};return l.sanitize=function(we){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,be=null,Me=null,$e=null;if(Mn=!we,Mn&&(we="<!-->"),typeof we!="string"&&!jt(we)&&(we=Pj(we),typeof we!="string"))throw zr("dirty is not a string, aborting");if(!l.isSupported)return we;zn?(Ve=St,it=Jt):Dl(T),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(Ve=As(Ve)),E.uponSanitizeAttribute.length>0&&(it=As(it)),l.removed=[];const ze=Zn&&typeof we!="string"&&jt(we);if(ze){Jn(we);const Vt=Y?Y(we):we.nodeName;if(typeof Vt=="string"){const kn=Ze(Vt);if(!Ve[kn]||Lt[kn])throw ut(we),zr("root node is forbidden and cannot be sanitized in-place")}if(yt(we))throw ut(we),zr("root node is clobbered and cannot be sanitized in-place");try{un(we)}catch(kn){throw ut(we),kn}}else if(jt(we))P=rs("<!---->"),be=P.ownerDocument.importNode(we,!0),be.nodeType===fl.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?P=be:P.appendChild(be),un(be);else{if(!An&&!gt&&!wn&&we.indexOf("<")===-1)return M&&as?$(we):we;if(P=rs(we),!P)return An?null:as?z:""}P&&hs&&an(P.firstChild);const Ut=ze?we:P,dn=gl(Ut);try{for(;Me=dn.nextNode();)Qn(Me,Ut),Wt(Me),Wn(Me.content)&&Rn(Me.content)}catch(Vt){throw ze&&(ut(we),Jc(l.removed,kn=>{kn.element&&ms(kn.element)})),Vt}if(ze)return Jc(l.removed,Vt=>{Vt.element&&ms(Vt.element)}),gt&&Os(we),we;if(An){if(gt&&Os(P),xn)for($e=oe.call(P.ownerDocument);P.firstChild;)$e.appendChild(P.firstChild);else $e=P;return(it.shadowroot||it.shadowrootmode)&&($e=je.call(c,$e,!0)),$e}let fn=wn?P.outerHTML:P.innerHTML;return wn&&Ve["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&ss(u1,P.ownerDocument.doctype.name)&&(fn="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
|
|
116
|
-
`+fn),gt&&(fn=gs(fn)),M&&as?$(fn):fn},l.setConfig=function(){let we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dl(we),zn=!0,St=Ve,Jt=it},l.clearConfig=function(){Vn=null,zn=!1,St=null,Jt=null,M=R,z=""},l.isValidAttribute=function(we,T,P){Vn||Dl({});const be=Ze(we),Me=Ze(T);return Ls(be,Me,P)},l.addHook=function(we,T){typeof T=="function"&&ls(E,we)&&Wc(E[we],T)},l.removeHook=function(we,T){if(ls(E,we)){if(T!==void 0){const P=Vj(E[we],T);return P===-1?void 0:Qj(E[we],P,1)[0]}return pb(E[we])}},l.removeHooks=function(we){ls(E,we)&&(E[we]=[])},l.removeAllHooks=function(){E=Sb()},l}var g1=oy();const x1=1024;let b1=0;class Ml{constructor(l,r){this.from=l,this.to=r}}class gn{constructor(l={}){this.id=b1++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Pl.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}gn.closedBy=new gn({deserialize:n=>n.split(" ")});gn.openedBy=new gn({deserialize:n=>n.split(" ")});gn.group=new gn({deserialize:n=>n.split(" ")});gn.isolate=new gn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});gn.contextHash=new gn({perNode:!0});gn.lookAhead=new gn({perNode:!0});gn.mounted=new gn({perNode:!0});class ao{constructor(l,r,c,o=!1){this.tree=l,this.overlay=r,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[gn.mounted.id]}}const _1=Object.create(null);class Pl{constructor(l,r,c,o=0){this.name=l,this.props=r,this.id=c,this.flags=o}static define(l){let r=l.props&&l.props.length?Object.create(null):_1,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Pl(l.name||"",r,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let r=this.prop(gn.group);return r?r.indexOf(l)>-1:!1}return this.id==l}static match(l){let r=Object.create(null);for(let c in l)for(let o of c.split(" "))r[o]=l[c];return c=>{for(let o=c.prop(gn.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}Pl.none=new Pl("",Object.create(null),0,8);class uy{constructor(l){this.types=l;for(let r=0;r<l.length;r++)if(l[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let r=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let 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 Pl(c.name,o,c.id,c.flags):c)}return new uy(r)}}const $d=new WeakMap,Eb=new WeakMap;var pn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(pn||(pn={}));class Vs{constructor(l,r,c,o,d){if(this.type=l,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let l=ao.get(this);if(l&&!l.overlay)return l.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(l=0){return new mf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=$d.get(this)||this.topNode,d=new mf(o);return d.moveTo(l,r),$d.set(this,d._tree),d}get topNode(){return new ys(this,0,0,null)}resolve(l,r=0){let c=Nu($d.get(this)||this.topNode,l,r,!1);return $d.set(this,c),c}resolveInner(l,r=0){let c=Nu(Eb.get(this)||this.topNode,l,r,!0);return Eb.set(this,c),c}resolveStack(l,r=0){return j1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,m=(h&pn.IncludeAnonymous)>0;for(let g=this.cursor(h|pn.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(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:Pp(Pl.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Vs(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new Vs(Pl.none,r,c,o)))}static build(l){return N1(l)}}Vs.empty=new Vs(Pl.none,[],[],0);class Jp{constructor(l,r){this.buffer=l,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Jp(this.buffer,this.index)}}class ir{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return Pl.none}toString(){let l=[];for(let r=0;r<this.buffer.length;)l.push(this.childString(r)),r=this.buffer[r+3];return l.join(",")}childString(l){let r=this.buffer[l],c=this.buffer[l+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=l;g!=r&&!(dy(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let m=l,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let b=d[g++]=o[m++]-c;d[g++]=o[m++]-l,h=Math.max(h,b)}return new ir(d,h,this.set)}}function dy(n,l,r,c){switch(n){case-2:return r<l;case-1:return c>=l&&r<l;case 0:return r<l&&c>l;case 1:return r<=l&&c>l;case 2:return c>l;case 4:return!0}}function Nu(n,l,r,c){for(var o;n.from==n.to||(r<1?n.from>=l:n.from>l)||(r>-1?n.to<=l:n.to<l);){let h=!c&&n instanceof ys&&n.index<0?null:n.parent;if(!h)return n;n=h}let d=c?0:pn.IgnoreOverlays;if(c)for(let h=n,m=h.parent;m;h=m,m=h.parent)h instanceof ys&&h.index<0&&((o=m.enter(l,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(n=m);for(;;){let h=n.enter(l,r,d);if(!h)return n;n=h}}class fy{cursor(l=0){return new mf(this,l)}getChild(l,r=null,c=null){let o=Tb(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return Tb(this,l,r,c)}resolve(l,r=0){return Nu(this,l,r,!1)}resolveInner(l,r=0){return Nu(this,l,r,!0)}matchContext(l){return Ap(this.parent,l)}enterUnfinishedNodesBefore(l){let r=this.childBefore(l),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class ys extends fy{constructor(l,r,c,o){super(),this._tree=l,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,b=r>0?m.length:-1;l!=b;l+=r){let y=m[l],j=g[l]+h.from,v;if(!(!(d&pn.EnterBracketed&&y instanceof Vs&&(v=ao.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!dy(o,c,j,j+y.length))){if(y instanceof ir){if(d&pn.ExcludeBuffers)continue;let S=y.findChild(0,y.buffer.length,r,c-j,o);if(S>-1)return new Ea(new y1(h,y,l,j),null,S)}else if(d&pn.IncludeAnonymous||!y.type.isAnonymous||Wp(y)){let S;if(!(d&pn.IgnoreMounts)&&(S=ao.get(y))&&!S.overlay)return new ys(S.tree,j,l,h);let k=new ys(y,j,l,h);return d&pn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&pn.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+r:l=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,r,c=0){let o;if(!(c&pn.IgnoreOverlays)&&(o=ao.get(this._tree))&&o.overlay){let d=l-this.from,h=c&pn.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 ys(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,r,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Tb(n,l,r,c){let o=n.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function Ap(n,l,r=l.length-1){for(let c=n;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[r]&&l[r]!=c.name)return!1;r--}}return!0}class y1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class Ea extends fy{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,r,c){super(),this.context=l,this._parent=r,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.context.start,c);return d<0?null:new Ea(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,r,c=0){if(c&pn.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,l-this.context.start,r);return d<0?null:new Ea(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,r=l.buffer[this.index+3];return r<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new Ea(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new Ea(this.context,this._parent,l.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),r.push(0)}return new Vs(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hy(n){if(!n.length)return null;let l=0,r=n[0];for(let d=1;d<n.length;d++){let h=n[d];(h.from>r.from||h.to<r.to)&&(r=h,l=d)}let c=r instanceof ys&&r.index<0?null:r.parent,o=n.slice();return c?o[l]=c:o.splice(l,1),new v1(o,r)}class v1{constructor(l,r){this.heads=l,this.node=r}get next(){return hy(this.heads)}}function j1(n,l,r){let c=n.resolveInner(l,r),o=null;for(let d=c instanceof ys?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,r)),d=h}else{let h=ao.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let m=new ys(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Nu(m,l,r,!1))}}return o?hy(o):c}class mf{get name(){return this.type.name}constructor(l,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~pn.EnterBracketed,l instanceof ys)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,r){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof ys?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,r,c=this.mode){return this.buffer?c&pn.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&pn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&pn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let r,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let m=c._tree.children[d];if(this.mode&pn.IncludeAnonymous||m instanceof ir||!m.type.isAnonymous||Wp(m))return!1}return!0}move(l,r){if(r&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,r=0){for(;(this.from==this.to||(r<1?this.from>=l:this.from>l)||(r>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,r););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,r=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new Ea(this.buffer,r,this.stack[o]);return this.bufferNode=new Ea(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Ap(this.node.parent,l);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return Ap(this._tree,l,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Wp(n){return n.children.some(l=>l instanceof ir||!l.type.isAnonymous||Wp(l))}function N1(n){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=x1,reused:d=[],minRepeatType:h=c.types.length}=n,m=Array.isArray(r)?new Jp(r,r.length):r,g=c.types,b=0,y=0;function j(Y,M,z,R,Z,re){let{id:G,start:$,end:he,size:ve}=m,K=y,O=b;if(ve<0)if(m.next(),ve==-1){let E=d[G];z.push(E),R.push($-Y);return}else if(ve==-3){b=G;return}else if(ve==-4){y=G;return}else throw new RangeError(`Unrecognized record size: ${ve}`);let I=g[G],oe,pe,je=$-Y;if(he-$<=o&&(pe=A(m.pos-M,Z))){let E=new Uint16Array(pe.size-pe.skip),ne=m.pos-pe.size,X=E.length;for(;m.pos>ne;)X=F(pe.start,E,X);oe=new ir(E,he-pe.start,c),je=pe.start-Y}else{let E=m.pos-ve;m.next();let ne=[],X=[],Ne=G>=h?G:-1,U=0,ye=he;for(;m.pos>E;)Ne>=0&&m.id==Ne&&m.size>=0?(m.end<=ye-o&&(k(ne,X,$,U,m.end,ye,Ne,K,O),U=ne.length,ye=m.end),m.next()):re>2500?v($,E,ne,X):j($,E,ne,X,Ne,re+1);if(Ne>=0&&U>0&&U<ne.length&&k(ne,X,$,U,$,ye,Ne,K,O),ne.reverse(),X.reverse(),Ne>-1&&U>0){let Le=S(I,O);oe=Pp(I,ne,X,0,ne.length,0,he-$,Le,Le)}else oe=C(I,ne,X,he-$,K-he,O)}z.push(oe),R.push(je)}function v(Y,M,z,R){let Z=[],re=0,G=-1;for(;m.pos>M;){let{id:$,start:he,end:ve,size:K}=m;if(K>4)m.next();else{if(G>-1&&he<G)break;G<0&&(G=ve-o),Z.push($,he,ve),re++,m.next()}}if(re){let $=new Uint16Array(re*4),he=Z[Z.length-2];for(let ve=Z.length-3,K=0;ve>=0;ve-=3)$[K++]=Z[ve],$[K++]=Z[ve+1]-he,$[K++]=Z[ve+2]-he,$[K++]=K;z.push(new ir($,Z[2]-he,c)),R.push(he-Y)}}function S(Y,M){return(z,R,Z)=>{let re=0,G=z.length-1,$,he;if(G>=0&&($=z[G])instanceof Vs){if(!G&&$.type==Y&&$.length==Z)return $;(he=$.prop(gn.lookAhead))&&(re=R[G]+$.length+he)}return C(Y,z,R,Z,re,M)}}function k(Y,M,z,R,Z,re,G,$,he){let ve=[],K=[];for(;Y.length>R;)ve.push(Y.pop()),K.push(M.pop()+z-Z);Y.push(C(c.types[G],ve,K,re-Z,$-re,he)),M.push(Z-z)}function C(Y,M,z,R,Z,re,G){if(re){let $=[gn.contextHash,re];G=G?[$].concat(G):[$]}if(Z>25){let $=[gn.lookAhead,Z];G=G?[$].concat(G):[$]}return new Vs(Y,M,z,R,G)}function A(Y,M){let z=m.fork(),R=0,Z=0,re=0,G=z.end-o,$={size:0,start:0,skip:0};e:for(let he=z.pos-Y;z.pos>he;){let ve=z.size;if(z.id==M&&ve>=0){$.size=R,$.start=Z,$.skip=re,re+=4,R+=4,z.next();continue}let K=z.pos-ve;if(ve<0||K<he||z.start<G)break;let O=z.id>=h?4:0,I=z.start;for(z.next();z.pos>K;){if(z.size<0)if(z.size==-3||z.size==-4)O+=4;else break e;else z.id>=h&&(O+=4);z.next()}Z=I,R+=ve,re+=O}return(M<0||R==Y)&&($.size=R,$.start=Z,$.skip=re),$.size>4?$:void 0}function F(Y,M,z){let{id:R,start:Z,end:re,size:G}=m;if(m.next(),G>=0&&R<h){let $=z;if(G>4){let he=m.pos-(G-4);for(;m.pos>he;)z=F(Y,M,z)}M[--z]=$,M[--z]=re-Y,M[--z]=Z-Y,M[--z]=R}else G==-3?b=R:G==-4&&(y=R);return z}let Q=[],q=[];for(;m.pos>0;)j(n.start||0,n.bufferStart||0,Q,q,-1,0);let B=(l=n.length)!==null&&l!==void 0?l:Q.length?q[0]+Q[0].length:0;return new Vs(g[n.topID],Q.reverse(),q.reverse(),B)}const Cb=new WeakMap;function af(n,l){if(!n.isAnonymous||l instanceof ir||l.type!=n)return 1;let r=Cb.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=n||!(c instanceof Vs)){r=1;break}r+=af(n,c)}Cb.set(l,r)}return r}function Pp(n,l,r,c,o,d,h,m,g){let b=0;for(let k=c;k<o;k++)b+=af(n,l[k]);let y=Math.ceil(b*1.5/8),j=[],v=[];function S(k,C,A,F,Q){for(let q=A;q<F;){let B=q,Y=C[q],M=af(n,k[q]);for(q++;q<F;q++){let z=af(n,k[q]);if(M+z>=y)break;M+=z}if(q==B+1){if(M>y){let z=k[B];S(z.children,z.positions,0,z.children.length,C[B]+Q);continue}j.push(k[B])}else{let z=C[q-1]+k[q-1].length-Y;j.push(Pp(n,k,C,B,q,Y,z,null,g))}v.push(Y+Q-d)}}return S(l,r,c,o,0),(m||g)(j,v,h)}class GE{constructor(){this.map=new WeakMap}setBuffer(l,r,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(r,c)}getBuffer(l,r){let c=this.map.get(l);return c&&c.get(r)}set(l,r){l instanceof Ea?this.setBuffer(l.context.buffer,l.index,r):l instanceof ys&&this.map.set(l.tree,r)}get(l){return l instanceof Ea?this.getBuffer(l.context.buffer,l.index):l instanceof ys?this.map.get(l.tree):void 0}cursorSet(l,r){l.buffer?this.setBuffer(l.buffer.buffer,l.index,r):this.map.set(l.tree,r)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class wu{constructor(l,r,c,o,d=!1,h=!1){this.from=l,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,r=[],c=!1){let o=[new wu(0,l.length,l,0,!1,c)];for(let d of r)d.to>l.length&&o.push(d);return o}static applyChanges(l,r,c=128){if(!r.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let m=0,g=0,b=0;;m++){let y=m<r.length?r[m]:null,j=y?y.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||b){let S=Math.max(v.from,g)-b,k=Math.min(v.to,j)-b;v=S>=k?null:new wu(S,k,v.tree,v.offset+b,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;g=y.toA,b=y.toA-y.toB}return o}}class YE{startParse(l,r,c){return typeof l=="string"&&(l=new w1(l)),c=c?c.length?c.map(o=>new Ml(o.from,o.to)):[new Ml(0,0)]:[new Ml(0,l.length)],this.createParse(l,r||[],c)}parse(l,r,c){let o=this.startParse(l,r,c);for(;;){let d=o.advance();if(d)return d}}}class w1{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,r){return this.string.slice(l,r)}}function XE(n){return(l,r,c,o)=>new S1(l,n,r,c,o)}class Ab{constructor(l,r,c,o,d,h){this.parser=l,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Mb(n){if(!n.length||n.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class k1{constructor(l,r,c,o,d,h,m,g){this.parser=l,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 Mp=new gn({perNode:!0});class S1{constructor(l,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Vs(c.type,c.children,c.positions,c.length,c.propValues.concat([[Mp,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],r=l.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[gn.mounted.id]=new ao(r,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<l&&(l=Math.min(l,this.inner[r].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(l)}startInner(){let l=new C1(this.fragments),r=null,c=null,o=new mf(new ys(this.baseTree,this.ranges[0].from,0,null),pn.IncludeAnonymous|pn.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(l.hasNode(o)){if(r){let b=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(b)for(let y of b.mount.overlay){let j=y.from+b.pos,v=y.to+b.pos;j>=o.from&&v<=o.to&&!r.ranges.some(S=>S.from<v&&S.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=E1(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||(T1(o),r&&r.depth++,c&&c.depth++);let b=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new k1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=Ob(this.ranges,d.overlay||(o.from<o.to?[new Ml(o.from,o.to)]:[]));y.length&&Mb(y),(y.length||!d.overlay)&&this.inner.push(new Ab(d.parser,y.length?d.parser.startParse(this.input,Lb(b,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Ml(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,y.length?y[0].from:o.from)),d.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new Ml(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=Ob(this.ranges,r.ranges);b.length&&(Mb(b),this.inner.splice(r.index,0,new Ab(r.parser,r.parser.startParse(this.input,Lb(r.mounts,b),b),r.ranges.map(y=>new Ml(y.from-r.start,y.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function E1(n,l,r){for(let c of n){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function Rb(n,l,r,c,o,d){if(l<r){let h=n.buffer[l+1];c.push(n.slice(l,r,h)),o.push(h-d)}}function T1(n){let{node:l}=n,r=[],c=l.context.buffer;do r.push(n.index),n.parent();while(!n.tree);let o=n.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function b(y,j,v,S,k,C){let A=r[C],F=[],Q=[];Rb(h,y,A,F,Q,S);let q=m[A+1],B=m[A+2];g.push(F.length);let Y=C?b(A+4,m[A+3],h.set.types[m[A]],q,B-q,C-1):l.toTree();return F.push(Y),Q.push(q-S),Rb(h,m[A+3],j,F,Q,S),new Vs(v,F,Q,k)}o.children[d]=b(0,m.length,Pl.none,0,h.length,r.length-1);for(let y of g){let j=n.tree.children[y],v=n.tree.positions[y];n.yield(new ys(j,v+n.from,y,n._tree))}}class Db{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(pn.IncludeAnonymous|pn.IgnoreMounts)}moveTo(l){let{cursor:r}=this,c=l-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=l&&r.enter(c,1,pn.IgnoreOverlays|pn.ExcludeBuffers)))if(r.to<=l)r.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==l.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Vs)r=r.children[0];else break}return!1}}class C1{constructor(l){var r;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(r=c.tree.prop(Mp))!==null&&r!==void 0?r:c.to,this.inner=new Db(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(l=r.tree.prop(Mp))!==null&&l!==void 0?l:r.to,this.inner=new Db(r.tree,-r.offset)}}findMounts(l,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(gn.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 Ob(n,l){let r=null,c=l;for(let o=1,d=0;o<n.length;o++){let h=n[o-1].to,m=n[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=l.slice()),g.from<h?(r[d]=new Ml(g.from,h),g.to>m&&r.splice(d+1,0,new Ml(m,g.to))):g.to>m?r[d--]=new Ml(m,g.to):r.splice(d--,1))}}return c}function A1(n,l,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let y=o==n.length?1e9:h?n[o].to:n[o].from,j=d==l.length?1e9:m?l[d].to:l[d].from;if(h!=m){let v=Math.max(g,r),S=Math.min(y,j,c);v<S&&b.push(new Ml(v,S))}if(g=Math.min(y,j),g==1e9)break;y==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return b}function Lb(n,l){let r=[];for(let{pos:c,mount:o,frag:d}of n){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 y=o.overlay.map(v=>new Ml(v.from+c,v.to+c)),j=A1(l,y,g,b);for(let v=0,S=g;;v++){let k=v==j.length,C=k?b:j[v].from;if(C>S&&r.push(new wu(S,C,o.tree,-h,d.from>=S||d.openStart,d.to<=C||d.openEnd)),k)break;S=j[v].to}}else r.push(new wu(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let M1=0;class Cl{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=M1++}toString(){let{name:l}=this;for(let r of this.modified)r.name&&(l=`${r.name}(${l})`);return l}static define(l,r){let c=typeof l=="string"?l:"?";if(l instanceof Cl&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new Cl(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(l){let r=new gf(l);return c=>c.modified.indexOf(r)>-1?c:gf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let R1=0;class gf{constructor(l){this.name=l,this.instances=[],this.id=R1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(m=>m.base==l&&D1(r,m.modified));if(c)return c;let o=[],d=new Cl(l.name,o,l,r);for(let m of r)m.instances.push(d);let h=O1(r);for(let m of l.set)if(!m.modified.length)for(let g of h)o.push(gf.get(m,g));return d}}function D1(n,l){return n.length==l.length&&n.every((r,c)=>r==l[c])}function O1(n){let l=[[]];for(let r=0;r<n.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(n[r]));return l.sort((r,c)=>c.length-r.length)}function VE(n){let l=Object.create(null);for(let r in n){let c=n[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let S=o[j++];if(j==o.length&&S=="!"){h=0;break}if(S!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let y=new ku(c,h,g>0?d.slice(0,g):null);l[b]=y.sort(l[b])}}return py.add(l)}const py=new gn({combine(n,l){let r,c,o;for(;n||l;){if(!n||l&&n.depth>=l.depth?(o=l,l=l.next):(o=n,n=n.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new ku(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class ku{constructor(l,r,c,o){this.tags=l,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}ku.empty=new ku([],2,null);function my(n,l){let r=Object.create(null);for(let d of n)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let 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 L1(n,l){let r=null;for(let c of n){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function z1(n,l,r,c=0,o=n.length){let d=new I1(c,Array.isArray(l)?l:[l],r);d.highlightRange(n.cursor(),c,o,"",d.highlighters),d.flush(o)}function U1(n,l,r,c,o,d=0,h=n.length){let m=d;function g(b,y){if(!(b<=m)){for(let j=n.slice(m,b),v=0;;){let S=j.indexOf(`
|
|
117
|
-
`,v),k=S<0?j.length:S;if(k>v&&c(j.slice(v,k),y),S<0)break;o(),v=S+1}m=b}}z1(l,r,(b,y,j)=>{g(b,""),g(y,j)},d,h),g(h,"")}class I1{constructor(l,r,c){this.at=l,this.highlighters=r,this.span=c,this.class=""}startSpan(l,r){r!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=r)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,r,c,o,d){let{type:h,from:m,to:g}=l;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(S=>!S.scope||S.scope(h)));let b=o,y=H1(l)||ku.empty,j=L1(d,y.tags);if(j&&(b&&(b+=" "),b+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),b),y.opaque)return;let v=l.tree&&l.tree.prop(gn.mounted);if(v&&v.overlay){let S=l.node.enter(v.overlay[0].from+m,1),k=this.highlighters.filter(A=>!A.scope||A.scope(v.tree.type)),C=l.firstChild();for(let A=0,F=m;;A++){let Q=A<v.overlay.length?v.overlay[A]:null,q=Q?Q.from+m:g,B=Math.max(r,F),Y=Math.min(c,q);if(B<Y&&C)for(;l.from<Y&&(this.highlightRange(l,B,Y,o,d),this.startSpan(Math.min(Y,l.to),b),!(l.to>=q||!l.nextSibling())););if(!Q||q>c)break;F=Q.to+m,F>r&&(this.highlightRange(S.cursor(),Math.max(r,Q.from+m),Math.min(c,F),"",k),this.startSpan(Math.min(c,F),b))}C&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,d),this.startSpan(Math.min(c,l.to),b)}while(l.nextSibling());l.parent()}}}function H1(n){let l=n.type.prop(py);for(;l&&l.context&&!n.matchContext(l.context);)l=l.next;return l||null}const Ae=Cl.define,qd=Ae(),er=Ae(),zb=Ae(er),Ub=Ae(er),tr=Ae(),Gd=Ae(tr),dp=Ae(tr),wa=Ae(),Ur=Ae(wa),_a=Ae(),ya=Ae(),Rp=Ae(),hu=Ae(Rp),Yd=Ae(),Oe={comment:qd,lineComment:Ae(qd),blockComment:Ae(qd),docComment:Ae(qd),name:er,variableName:Ae(er),typeName:zb,tagName:Ae(zb),propertyName:Ub,attributeName:Ae(Ub),className:Ae(er),labelName:Ae(er),namespace:Ae(er),macroName:Ae(er),literal:tr,string:Gd,docString:Ae(Gd),character:Ae(Gd),attributeValue:Ae(Gd),number:dp,integer:Ae(dp),float:Ae(dp),bool:Ae(tr),regexp:Ae(tr),escape:Ae(tr),color:Ae(tr),url:Ae(tr),keyword:_a,self:Ae(_a),null:Ae(_a),atom:Ae(_a),unit:Ae(_a),modifier:Ae(_a),operatorKeyword:Ae(_a),controlKeyword:Ae(_a),definitionKeyword:Ae(_a),moduleKeyword:Ae(_a),operator:ya,derefOperator:Ae(ya),arithmeticOperator:Ae(ya),logicOperator:Ae(ya),bitwiseOperator:Ae(ya),compareOperator:Ae(ya),updateOperator:Ae(ya),definitionOperator:Ae(ya),typeOperator:Ae(ya),controlOperator:Ae(ya),punctuation:Rp,separator:Ae(Rp),bracket:hu,angleBracket:Ae(hu),squareBracket:Ae(hu),paren:Ae(hu),brace:Ae(hu),content:wa,heading:Ur,heading1:Ae(Ur),heading2:Ae(Ur),heading3:Ae(Ur),heading4:Ae(Ur),heading5:Ae(Ur),heading6:Ae(Ur),contentSeparator:Ae(wa),list:Ae(wa),quote:Ae(wa),emphasis:Ae(wa),strong:Ae(wa),link:Ae(wa),monospace:Ae(wa),strikethrough:Ae(wa),inserted:Ae(),deleted:Ae(),changed:Ae(),invalid:Ae(),meta:Yd,documentMeta:Ae(Yd),annotation:Ae(Yd),processingInstruction:Ae(Yd),definition:Cl.defineModifier("definition"),constant:Cl.defineModifier("constant"),function:Cl.defineModifier("function"),standard:Cl.defineModifier("standard"),local:Cl.defineModifier("local"),special:Cl.defineModifier("special")};for(let n in Oe){let l=Oe[n];l instanceof Cl&&(l.name=n)}my([{tag:Oe.link,class:"tok-link"},{tag:Oe.heading,class:"tok-heading"},{tag:Oe.emphasis,class:"tok-emphasis"},{tag:Oe.strong,class:"tok-strong"},{tag:Oe.keyword,class:"tok-keyword"},{tag:Oe.atom,class:"tok-atom"},{tag:Oe.bool,class:"tok-bool"},{tag:Oe.url,class:"tok-url"},{tag:Oe.labelName,class:"tok-labelName"},{tag:Oe.inserted,class:"tok-inserted"},{tag:Oe.deleted,class:"tok-deleted"},{tag:Oe.literal,class:"tok-literal"},{tag:Oe.string,class:"tok-string"},{tag:Oe.number,class:"tok-number"},{tag:[Oe.regexp,Oe.escape,Oe.special(Oe.string)],class:"tok-string2"},{tag:Oe.variableName,class:"tok-variableName"},{tag:Oe.local(Oe.variableName),class:"tok-variableName tok-local"},{tag:Oe.definition(Oe.variableName),class:"tok-variableName tok-definition"},{tag:Oe.special(Oe.variableName),class:"tok-variableName2"},{tag:Oe.definition(Oe.propertyName),class:"tok-propertyName tok-definition"},{tag:Oe.typeName,class:"tok-typeName"},{tag:Oe.namespace,class:"tok-namespace"},{tag:Oe.className,class:"tok-className"},{tag:Oe.macroName,class:"tok-macroName"},{tag:Oe.propertyName,class:"tok-propertyName"},{tag:Oe.operator,class:"tok-operator"},{tag:Oe.comment,class:"tok-comment"},{tag:Oe.meta,class:"tok-meta"},{tag:Oe.invalid,class:"tok-invalid"},{tag:Oe.punctuation,class:"tok-punctuation"}]);const B1="modulepreload",$1=function(n,l){return new URL(n,l).href},Ib={},st=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=$1(y,c),y in Ib)return;Ib[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let C=m.length-1;C>=0;C--){const A=m[C];if(A.href===y&&(!j||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":B1,j||(k.as="script"),k.crossOrigin="",k.href=y,b&&k.setAttribute("nonce",b),document.head.appendChild(k),j)return new Promise((C,A)=>{k.addEventListener("load",C),k.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return l().catch(d)})},gy={js:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await st(async()=>{const{javascript:n}=await import("./index-DSyXOala.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await st(async()=>{const{json:n}=await import("./index-DRswmveP.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await st(async()=>{const{json:n}=await import("./index-DRswmveP.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await st(async()=>{const{css:n}=await import("./index-Bqw5VmKB.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await st(async()=>{const{css:n}=await import("./index-Bqw5VmKB.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await st(async()=>{const{css:n}=await import("./index-Bqw5VmKB.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await st(async()=>{const{html:n}=await import("./index-Jj_AHiE6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await st(async()=>{const{html:n}=await import("./index-Jj_AHiE6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await st(async()=>{const{html:n}=await import("./index-Jj_AHiE6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await st(async()=>{const{html:n}=await import("./index-Jj_AHiE6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await st(async()=>{const{markdown:n}=await import("./index-k5pUSa38.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await st(async()=>{const{markdown:n}=await import("./index-k5pUSa38.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await st(async()=>{const{python:n}=await import("./index-Daw0RVbK.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await st(async()=>{const{python:n}=await import("./index-Daw0RVbK.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await st(async()=>{const{yaml:n}=await import("./index-DP6n5Sf2.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await st(async()=>{const{yaml:n}=await import("./index-DP6n5Sf2.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await st(async()=>{const{rust:n}=await import("./index-D3QPzaZ2.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await st(async()=>{const{cpp:n}=await import("./index-CGl8tRHI.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await st(async()=>{const{cpp:n}=await import("./index-CGl8tRHI.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await st(async()=>{const{cpp:n}=await import("./index-CGl8tRHI.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await st(async()=>{const{cpp:n}=await import("./index-CGl8tRHI.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await st(async()=>{const{cpp:n}=await import("./index-CGl8tRHI.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await st(async()=>{const{java:n}=await import("./index-B0wzgXzo.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await st(async()=>{const{go:n}=await import("./index-Djyf6cqy.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await st(async()=>{const{php:n}=await import("./index-kZWq9En4.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await st(async()=>{const{sql:n}=await import("./index-aSVj6-S6.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await st(async()=>{const{xml:n}=await import("./index-BUB7eB21.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await st(async()=>{const{xml:n}=await import("./index-BUB7eB21.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},q1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},G1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function Y1(n){const l=G1[n.toLowerCase()]??n.toLowerCase(),r=gy[l];return r?r().catch(()=>null):null}async function X1(n){const l=(n.split("/").pop()??"").toLowerCase(),r=q1[l]??l.split(".").pop()??"",c=gy[r];return c?c().catch(()=>null):null}const V1=my([{tag:[Oe.keyword,Oe.modifier,Oe.controlKeyword,Oe.moduleKeyword],class:"cmh-key"},{tag:[Oe.propertyName],class:"cmh-prop"},{tag:[Oe.function(Oe.variableName),Oe.labelName],class:"cmh-fn"},{tag:[Oe.color,Oe.constant(Oe.name),Oe.standard(Oe.name),Oe.bool],class:"cmh-const"},{tag:[Oe.typeName,Oe.className,Oe.changed,Oe.annotation,Oe.self,Oe.namespace],class:"cmh-type"},{tag:[Oe.number,Oe.integer,Oe.float],class:"cmh-num"},{tag:[Oe.string,Oe.special(Oe.string),Oe.regexp],class:"cmh-str"},{tag:[Oe.operator,Oe.operatorKeyword,Oe.escape],class:"cmh-op"},{tag:[Oe.meta,Oe.comment],class:"cmh-comment"},{tag:Oe.invalid,class:"cmh-invalid"}]);function Xd(n){return n.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function Q1(n,l){const r=l?await Y1(l):null;if(!r)return Xd(n);try{const c=r.language.parser.parse(n);let o="";return U1(n,c,V1,(d,h)=>{o+=h?`<span class="${h}">${Xd(d)}</span>`:Xd(d)},()=>{o+=`
|
|
118
|
-
`}),o}catch{return Xd(n)}}Ot.setOptions({gfm:!0,breaks:!1});function xy(n){var r;const l=(r=n.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function Sf(n){const l=await Ot.parse(n,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await Q1(c.text,c.lang??""),c.escaped=!0}});return g1.sanitize(l)}function Hb(n,l){return{path:n.path,text:n.content,saved:n.content,eol:n.eol,encoding:n.encoding,mtime:n.mtime,size:n.size,binary:n.binary,tooLarge:n.tooLarge,mediaMime:n.mediaMime,mediaTooLarge:n.mediaTooLarge,stale:!1,revision:l,previewMode:xy(n.path)}}function di(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function K1(n){return n.split("/").pop()??n}function Fr(n){const l=n.lastIndexOf("/");return l===-1?"":n.slice(0,l)}function rf(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}function ar({x:n,y:l,items:r,note:c,onClose:o}){const d=x.useRef(null),[h,m]=x.useState({left:n,top:l}),[g,b]=x.useState(()=>{const v=r.findIndex(S=>!S.disabled);return v===-1?0:v});x.useLayoutEffect(()=>{const v=d.current;if(!v)return;const S=v.getBoundingClientRect(),k=8,C=Math.max(k,Math.min(n,window.innerWidth-S.width-k)),A=Math.max(k,Math.min(l,window.innerHeight-S.height-k));m({left:C,top:A})},[n,l]),x.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),x.useLayoutEffect(()=>{function v(k){var C;(C=d.current)!=null&&C.contains(k.target)||o()}function S(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",S,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const S=r.map((k,C)=>({item:k,index:C})).filter(k=>!k.item.disabled);if(S.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const k=v.key==="ArrowDown"?1:-1,C=S.findIndex(F=>F.index===g),A=S[(((C===-1?0:C)+k)%S.length+S.length)%S.length];A&&b(A.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const k=r[g];k&&y(k)}}}return a.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,S)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(S===g?" is-cursor":""),onMouseEnter:()=>b(S),onClick:()=>y(v),children:[a.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&a.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const F1=3500,Z1=9e3,Bb=220;function Pr({result:n,onDismiss:l}){const[r,c]=x.useState(n),[o,d]=x.useState(!1);if(x.useEffect(()=>{if(!n){c(null),d(!1);return}if(c(n),d(!1),n.url)return;const m=n.ok?F1:Z1,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+Bb);return()=>{clearTimeout(g),clearTimeout(b)}},[n]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Bb)};return a.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&&a.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Ta({value:n,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=x.useState(n),m=x.useRef(null);x.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===n)return o();c(b)}return a.jsx("input",{ref:m,className:l?`rename ${l}`:"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 _o({active:n}){return n?a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 5h3V2"}),a.jsx("path",{d:"M14 5h-3V2"}),a.jsx("path",{d:"M2 11h3v3"}),a.jsx("path",{d:"M14 11h-3v3"})]}):a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2H2v3"}),a.jsx("path",{d:"M11 2h3v3"}),a.jsx("path",{d:"M2 11v3h3"}),a.jsx("path",{d:"M14 11v3h-3"})]})}const J1=500,Ir="application/x-ccv-fs-path",W1=200;function P1({open:n,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:y,onOpen:j,onCreate:v,onRename:S,onMove:k,onCopy:C,onDelete:A,onRefresh:F,onClose:Q,zoomed:q,onToggleZoom:B}){const[Y,M]=x.useState(""),[z,R]=x.useState(null),[Z,re]=x.useState(null),[G,$]=x.useState(null),[he,ve]=x.useState(null),[K,O]=x.useState(null),[I,oe]=x.useState(null),pe=Nf("(hover: hover)"),je=x.useRef(null),E=x.useMemo(()=>nN(d),[d]);function ne(ue){return!(!G||ue===G.path||G.kind==="dir"&&ue.startsWith(`${G.path}/`)||ue===Fr(G.path))}function X(ue){return!(!K||ue===K.path||K.kind==="dir"&&ue.startsWith(`${K.path}/`)||K.mode==="cut"&&ue===Fr(K.path))}function Ne(ue){O({path:ue.path,kind:ue.kind,mode:"copy"})}function U(ue){O({path:ue.path,kind:ue.kind,mode:"cut"})}function ye(ue){!K||!X(ue)||(ue&&!r.has(ue)&&y(ue),K.mode==="cut"?(k(K.path,ue),O(null)):C(K.path,ue))}function Le(ue,ke){const Qe=ue.touches[0];if(!Qe)return;const rt={timer:0,x:Qe.clientX,y:Qe.clientY,el:ue.currentTarget,fired:!1};rt.timer=window.setTimeout(()=>{rt.fired=!0,ke(rt.x,rt.y,rt.el)},J1),je.current=rt}function Ie(ue){const ke=je.current,Qe=ue.touches[0];!ke||!Qe||Math.hypot(Qe.clientX-ke.x,Qe.clientY-ke.y)>10&&(window.clearTimeout(ke.timer),je.current=null)}function qe(ue){const ke=je.current;ke&&(window.clearTimeout(ke.timer),ke.fired&&ue.preventDefault())}function $t(){var ue;return(ue=je.current)!=null&&ue.fired?(je.current=null,!0):!1}function Ve(ue,ke,Qe,rt){M((rt==null?void 0:rt.path)??""),oe({x:ue,y:ke,opener:Qe,entry:rt})}function Cn(){const ue=I==null?void 0:I.opener;oe(null),ue!=null&&ue.isConnected&&ue.focus()}function it(ue){return{onContextMenu:ke=>{ke.preventDefault(),Ve(ke.clientX,ke.clientY,ke.currentTarget,ue)},onTouchStart:ke=>Le(ke,(Qe,rt,He)=>Ve(Qe,rt,He,ue)),onTouchMove:Ie,onTouchEnd:qe,onTouchCancel:qe}}function lt(ue){ue.target===ue.currentTarget&&(ue.preventDefault(),Ve(ue.clientX,ue.clientY,ue.currentTarget,null))}function tt(ue){ue.target===ue.currentTarget&&Le(ue,(ke,Qe,rt)=>Ve(ke,Qe,rt,null))}function Lt(ue){if(!(ue.ctrlKey||ue.metaKey)||ue.target instanceof HTMLInputElement)return;const ke=ue.key.toLowerCase();if(ke==="v"){ue.preventDefault(),ye(as());return}if(!Y)return;const Qe=$b(l,Y);Qe&&(ke==="c"?(ue.preventDefault(),Ne(Qe)):ke==="x"&&(ue.preventDefault(),U(Qe)))}function _t(ue){return ke=>{ke.dataTransfer.effectAllowed="move",ke.dataTransfer.setData(Ir,ue.path),$({path:ue.path,kind:ue.kind})}}function vt(){$(null),ve(null)}function qt(ue){return ke=>{ke.dataTransfer.types.includes(Ir)&&(ke.stopPropagation(),!(ue.kind!=="dir"||!ne(ue.path))&&(ke.preventDefault(),ve(ue.path)))}}function Te(ue){return ke=>{if(!ke.dataTransfer.types.includes(Ir)||(ke.stopPropagation(),ue.kind!=="dir"||!ne(ue.path)))return;ke.preventDefault();const Qe=ke.dataTransfer.getData(Ir);ve(null),Qe&&k(Qe,ue.path)}}function We(ue){!ue.dataTransfer.types.includes(Ir)||!ne("")||(ue.preventDefault(),ve(""))}function At(ue){if(!ue.dataTransfer.types.includes(Ir)||!ne(""))return;ue.preventDefault();const ke=ue.dataTransfer.getData(Ir);ve(null),ke&&k(ke,"")}const[gt,Ye]=x.useState(""),wn=gt.trim(),zn=wn.length>0,St=x.useRef(null),Jt=x.useRef(g);Jt.current=g;function hs(ue){Ye(ue),St.current&&clearTimeout(St.current);const ke=ue.trim();if(!ke){Jt.current("");return}St.current=setTimeout(()=>Jt.current(ke),W1)}function An(ue){St.current&&clearTimeout(St.current),Ye(""),Jt.current(""),M(ue.path),b(ue)}const xn=zn&&(m==null?void 0:m.query)===wn?m:null;function as(){if(Y==="")return"";const ue=$b(l,Y);if((ue==null?void 0:ue.kind)==="dir")return Y;const ke=Y.lastIndexOf("/");return ke===-1?"":Y.slice(0,ke)}function zt(ue,ke){const Qe=ke??as();Qe&&!r.has(Qe)&&y(Qe),re({parent:Qe,kind:ue})}function on(){if(!I)return[];const ue=rt=>pe?rt:void 0;if(!I.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ue("Ctrl+V"),disabled:!X(""),onSelect:()=>ye("")},{id:"new-file",label:"Создать файл",onSelect:()=>zt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>zt("dir","")}];const ke=I.entry,Qe=[ke.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ke.path)}:{id:"toggle",label:r.has(ke.path)?"Свернуть":"Развернуть",onSelect:()=>y(ke.path)},{id:"copy",label:"Копировать",hint:ue("Ctrl+C"),onSelect:()=>Ne(ke)},{id:"cut",label:"Вырезать",hint:ue("Ctrl+X"),onSelect:()=>U(ke)}];return ke.kind==="dir"&&(Qe.push({id:"paste",label:"Вставить",hint:ue("Ctrl+V"),disabled:!X(ke.path),onSelect:()=>ye(ke.path)}),Qe.push({id:"new-file",label:"Создать файл",onSelect:()=>zt("file",ke.path)}),Qe.push({id:"new-dir",label:"Создать каталог",onSelect:()=>zt("dir",ke.path)})),Qe.push({id:"rename",label:"Переименовать",onSelect:()=>R(ke.path)}),Qe.push({id:"delete",label:"Удалить",onSelect:()=>A(ke)}),Qe}const ln=zn?[]:Gt("",0);function Gt(ue,ke){const Qe=l[ue],rt=[];if(Z&&Z.parent===ue&&rt.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:fi(ke),children:[a.jsx("span",{className:"fsrow__icon",children:Z.kind==="dir"?a.jsx(bf,{}):a.jsx(_f,{})}),a.jsx(Ta,{className:"rename--file",value:"",placeholder:Z.kind==="dir"?"имя каталога":"имя файла",onCommit:He=>{re(null),v(ue,Z.kind,He)},onCancel:()=>re(null)})]},`draft:${ue}`)),!Qe)return rt.push(a.jsx("p",{className:"fsrow__pending",style:fi(ke),children:"читаем…"},`wait:${ue}`)),rt;Qe.length===0&&!Z&&rt.push(a.jsx("p",{className:"fsrow__pending",style:fi(ke),children:"пусто"},`empty:${ue}`));for(const He of Qe){const Pe=He.kind==="dir"&&r.has(He.path);rt.push(z===He.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:fi(ke),children:[a.jsx("span",{className:"fsrow__icon",children:He.kind==="dir"?a.jsx(bf,{open:Pe}):a.jsx(_f,{})}),a.jsx(Ta,{className:"rename--file",value:He.name,placeholder:"новое имя",onCommit:W=>{R(null),S(He.path,W)},onCancel:()=>R(null)})]},He.path):a.jsx(eN,{entry:He,depth:ke,open:Pe,active:He.path===c,selected:He.path===Y,dirty:o.has(He.path),gitStatus:E.get(He.path),dragging:(G==null?void 0:G.path)===He.path,dropTarget:he===He.path,cut:(K==null?void 0:K.mode)==="cut"&&K.path===He.path,onClick:()=>{$t()||(M(He.path),He.kind==="dir"?y(He.path):j(He.path))},onRename:()=>R(He.path),onDelete:()=>A(He),onDragStart:_t(He),onDragEnd:vt,onDragOver:qt(He),onDrop:Te(He),...it(He)},He.path)),Pe&&rt.push(...Gt(He.path,ke+1))}return rt}function Zn(){if(!xn)return[a.jsx("p",{className:"fsrow__pending",style:fi(0),children:"ищем…"},"search:wait")];if(xn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:fi(0),children:"ничего не найдено"},"search:empty")];const ue=xn.entries.map(ke=>a.jsx(tN,{entry:ke,gitStatus:E.get(ke.path),onClick:()=>An(ke)},ke.path));return xn.truncated&&ue.push(a.jsxs("p",{className:"fsrow__pending",style:fi(0),children:["показаны первые ",xn.entries.length," — уточните запрос"]},"search:truncated")),ue}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(q?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:Lt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:ue=>{B&&(ue.target.closest("button")||B())},children:[a.jsx(iN,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>zt("file"),children:a.jsx(lN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>zt("dir"),children:a.jsx(aN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:F,children:"↻"}),B&&a.jsx("button",{className:"sidepane__btn",title:q?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":q?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":q,onClick:B,children:a.jsx(_o,{active:q})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:Q,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(rN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:gt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:ue=>hs(ue.target.value),onKeyDown:ue=>{ue.stopPropagation(),ue.key==="Escape"&&(ue.preventDefault(),gt?hs(""):ue.currentTarget.blur())}}),gt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>hs(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(he===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:We,onDrop:At,onContextMenu:lt,onTouchStart:tt,onTouchMove:Ie,onTouchEnd:qe,onTouchCancel:qe,children:zn?Zn():ln}),a.jsx(Pr,{result:h}),I&&a.jsx(ar,{x:I.x,y:I.y,items:on(),onClose:Cn})]})}function eN({entry:n,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:y,onRename:j,onDelete:v,onDragStart:S,onDragEnd:k,onDragOver:C,onDrop:A,onContextMenu:F,onTouchStart:Q,onTouchMove:q,onTouchEnd:B,onTouchCancel:Y}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return a.jsxs("div",{className:M,style:fi(l),draggable:!0,onDragStart:S,onDragEnd:k,onDragOver:C,onDrop:A,onContextMenu:F,onTouchStart:Q,onTouchMove:q,onTouchEnd:B,onTouchCancel:Y,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:by(n),children:[a.jsx("span",{className:"fsrow__icon"+xf("fsrow__icon",h),children:n.kind==="dir"?a.jsx(bf,{open:r}):a.jsx(_f,{})}),a.jsx("span",{className:"fsrow__name"+xf("fsrow__name",h),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:v,children:"✕"})]})}function tN({entry:n,gitStatus:l,onClick:r}){const c=n.path.slice(0,n.path.length-n.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(n.ignored?" fsrow--ignored":""),style:fi(0),onClick:r,title:by(n),children:[a.jsx("span",{className:"fsrow__icon"+xf("fsrow__icon",l),children:n.kind==="dir"?a.jsx(bf,{}):a.jsx(_f,{})}),a.jsx("span",{className:"fsrow__name"+xf("fsrow__name",l),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function by(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function fi(n){return{"--depth":n}}function $b(n,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=n[c])==null?void 0:o.find(d=>d.path===l))??null}function nN(n){const l=new Map,r={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||r[d]>r[h])&&l.set(o,d)};for(const o of n){const d=sN(o.status);if(!d)continue;c(o.path,d);let h=Fr(o.path);for(;c(h,d),!!h;)h=Fr(h)}return l}function sN(n){if(n==="??")return"added";const[l="",r=""]=n;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function xf(n,l){return l?` ${n}--git-${l}`:""}function bf({open:n=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:n?a.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"}):a.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 _f(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]})}function lN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[a.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"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function aN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:a.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"})}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function iN(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function rN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const cN=200;function oN({open:n,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=x.useState(""),b=m.trim(),y=b.length>0,j=x.useRef(null),v=x.useRef(r);v.current=r;function S(A){g(A),j.current&&clearTimeout(j.current);const F=A.trim();if(!F){v.current("");return}j.current=setTimeout(()=>v.current(F),cN)}const k=y&&(l==null?void 0:l.query)===b?l:null;function C(){if(!k)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let F="";for(const Q of k.matches)Q.path!==F&&(F=Q.path,A.push(a.jsx("p",{className:"searchgroup__path",title:Q.path,children:Q.path},`path:${Q.path}`))),A.push(a.jsx(uN,{match:Q,onClick:()=>c(Q)},`${Q.path}:${Q.line}:${Q.column}`));return k.truncated&&A.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),A}return a.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:A=>{h&&(A.target.closest("button")||h())},children:[a.jsx(dN,{}),a.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&a.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:a.jsx(_o,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(fN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>S(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),m?S(""):A.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>S(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?C():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function uN({match:n,onClick:l}){const r=n.lineText.slice(0,n.column-1),c=n.lineText.slice(n.column-1,n.column-1+n.matchLength),o=n.lineText.slice(n.column-1+n.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:l,title:`${n.path}:${n.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:n.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function dN(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function fN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Vd=null;function hN(){return Vd||(Vd=Promise.all([st(()=>import("./index-Ah1jCJ1U.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),st(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),st(()=>import("./index-BHot-lnj.js"),[],import.meta.url),st(()=>import("./index-CU5O6qy8.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),st(()=>import("./codemirror-D_aocakD.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,l,r,c,o])=>({EditorView:l.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw Vd=null,n})),Vd}function pN({path:n,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=x.useRef(null),m=x.useRef(null),g=x.useRef(null),b=x.useRef(new Map),y=x.useRef(new Map),j=x.useRef(new Set),v=x.useRef(null),S=x.useRef(o),k=x.useRef(d),C=x.useRef(n),A=x.useRef(r),F=x.useRef(l);S.current=o,k.current=d,C.current=n,A.current=r,F.current=l;const[Q,q]=x.useState("loading"),[B,Y]=x.useState(!1);function M(R,Z,re,G,$){const he=b.current.get(G),ve=y.current.get(G)===$;if(he&&ve)re.setState(he);else{const O=R.EditorState.create({doc:F.current,extensions:[R.basicSetup,R.Prec.highest(R.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(C.current),!0)}])),R.keymap.of([R.indentWithTab]),Z.of([]),R.editorTheme,R.editorHighlight,R.EditorView.updateListener.of(I=>{I.docChanged&&S.current(C.current,I.state.doc.toString())})]});b.current.set(G,O),y.current.set(G,$),re.setState(O),j.current.delete(G)}if(j.current.has(G))return()=>{};let K=!1;return X1(G).then(O=>{K||!O||C.current!==G||(re.dispatch({effects:Z.reconfigure(O)}),b.current.set(G,re.state),j.current.add(G))}),()=>{K=!0}}x.useEffect(()=>{if(!h.current)return;let Z=!1,re=null,G=null;q("loading"),Y(!1);const $=window.setTimeout(()=>{Z||Y(!0)},200);return(async()=>{let he;try{he=await hN()}catch{window.clearTimeout($),Z||q("error");return}if(Z||!h.current)return;window.clearTimeout($);const ve=new he.Compartment;v.current=ve,g.current=he,G=new he.EditorView({parent:h.current}),m.current=G,re=M(he,ve,G,C.current,A.current),q("ready")})(),()=>{Z=!0,window.clearTimeout($),re==null||re(),G==null||G.destroy(),m.current===G&&(m.current=null),g.current=null,v.current=null}},[]),x.useEffect(()=>{const R=g.current,Z=m.current,re=v.current;if(!(!R||!Z||!re))return M(R,re,Z,n,r)},[n,r]);const z=x.useRef(0);return x.useEffect(()=>{const R=m.current,Z=g.current;if(!R||!Z||!c||c.token===z.current)return;z.current=c.token;const re=R.state.doc.lines,G=Math.min(Math.max(c.line,1),re),$=R.state.doc.line(G),he=Math.min($.from+Math.max(c.column-1,0),$.to);R.dispatch({selection:Z.EditorSelection.cursor(he),effects:Z.EditorView.scrollIntoView(he,{y:"center"})}),R.focus()},[c]),x.useEffect(()=>()=>{const R=m.current;R&&b.current.set(n,R.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(Q==="ready"?"":" is-hidden")}),Q==="loading"&&B&&a.jsxs("div",{className:"editor__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),Q==="error"&&a.jsxs("div",{className:"editor__fallback",children:[a.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[a.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),a.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function Al({value:n,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=x.useState(!1),[b,y]=x.useState(0),j=x.useRef(null),v=x.useRef(null),S=l.find(A=>A.value===n)??null;x.useEffect(()=>{if(!m)return;const A=l.findIndex(F=>F.value===n);y(A===-1?0:A)},[m]),x.useEffect(()=>{if(!m)return;function A(F){var Q;(Q=j.current)!=null&&Q.contains(F.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),x.useEffect(()=>{var A,F;m&&((F=(A=v.current)==null?void 0:A.querySelector(".is-cursor"))==null||F.scrollIntoView({block:"nearest"}))},[m,b]),x.useEffect(()=>{if(!m)return;const A=v.current,F=mN(j.current);if(!A||!F)return;const Q=A.getBoundingClientRect().bottom-F.getBoundingClientRect().bottom;Q>0&&(F.scrollTop+=Math.min(Q+8,A.offsetHeight))},[m]);function k(A){g(!1),A.value!==n&&r(A.value)}function C(A){if(A.key==="Escape"){if(!m)return;A.preventDefault(),A.stopPropagation(),g(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!m)return g(!0);const F=A.key==="ArrowDown"?1:l.length-1;return y(Q=>(Q+F)%l.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!m)return g(!0);const F=l[b];F&&k(F)}}return a.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(A=>!A),onKeyDown:C,children:[a.jsx("span",{className:"select__value",children:(S==null?void 0:S.label)??h}),a.jsx(gN,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((A,F)=>a.jsxs("button",{type:"button",role:"option","aria-selected":A.value===n,className:"select__option"+(F===b?" is-cursor":"")+(A.value===n?" is-on":""),onMouseEnter:()=>y(F),onClick:()=>k(A),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:A.label}),A.hint&&a.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function mN(n){let l=(n==null?void 0:n.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function gN(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function xN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function bN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M4.6 6.6h4"})]})}function _N(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function yN({path:n,mime:l,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){x.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(n)},[]);const m=vN(r,l);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",rf(d),"). Лимит — 64 МБ."]})}):c?a.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[a.jsx("p",{className:"mediaview__error",children:c}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(n),children:"Повторить"})]}):m?l.startsWith("image/")?a.jsx(NN,{url:m}):l.startsWith("video/")?a.jsx(kN,{url:m}):null:a.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[a.jsx("div",{className:"mediaview__progress",children:a.jsx("div",{className:"mediaview__progress-fill"})}),a.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function vN(n,l){const[r,c]=x.useState(null);return x.useEffect(()=>{if(n===void 0){c(null);return}const o=atob(n),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:l}));return c(h),()=>URL.revokeObjectURL(h)},[n,l]),r}const Wi=1,_y=8,Qd=1.25;function jN(n){return Math.min(_y,Math.max(Wi,n))}function NN({url:n}){const[l,r]=x.useState({scale:Wi,x:0,y:0}),[c,o]=x.useState(!1),d=x.useRef(null),h=x.useRef(null);function m(S,k,C){r(A=>{const F=jN(A.scale*S);if(F===A.scale)return A;if(F<=Wi)return{scale:Wi,x:0,y:0};const Q=(k-A.x)/A.scale,q=(C-A.y)/A.scale;return{scale:F,x:k-F*Q,y:C-F*q}})}x.useEffect(()=>{const S=d.current;if(!S)return;function k(C){C.preventDefault();const A=S.getBoundingClientRect(),F=C.clientX-A.left-A.width/2,Q=C.clientY-A.top-A.height/2;m(C.deltaY<0?Qd:1/Qd,F,Q)}return S.addEventListener("wheel",k,{passive:!1}),()=>S.removeEventListener("wheel",k)},[]);function g(S){l.scale<=Wi||(S.currentTarget.setPointerCapture(S.pointerId),h.current={pointerId:S.pointerId,startX:S.clientX,startY:S.clientY,origX:l.x,origY:l.y},o(!0))}function b(S){const k=h.current;!k||k.pointerId!==S.pointerId||r(C=>({...C,x:k.origX+(S.clientX-k.startX),y:k.origY+(S.clientY-k.startY)}))}function y(){h.current=null,o(!1)}const j=l.scale>Wi,v=!j&&l.x===0&&l.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:b,onPointerUp:y,onPointerCancel:y,children:a.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:l.scale<=Wi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Qd,0,0),children:a.jsx(bN,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:l.scale>=_y,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Qd,0,0),children:a.jsx(xN,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Wi,x:0,y:0}),children:a.jsx(_N,{})})]})]})}const wN=[{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 kN({url:n}){const l=x.useRef(null),[r,c]=x.useState("1");return x.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:l,className:"mediaview__video",src:n,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Al,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:wN})]})]})}function SN({file:n,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=di(n),b=xy(n.path)&&!n.binary&&!n.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:n.path,children:n.path}),a.jsxs("span",{className:"editor__meta",children:[rf(n.size),n.eol==="crlf"&&" · CRLF"]}),b&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(n.previewMode?" is-on":""),role:"tab","aria-selected":n.previewMode,onClick:()=>!n.previewMode&&m(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&m(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:g?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?a.jsx(yN,{path:n.path,mime:n.mediaMime,base64:n.mediaBase64,error:n.mediaError,tooLarge:n.mediaTooLarge,size:n.size,onRequestMedia:h},n.path):n.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",rf(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",rf(n.size),"). Такие правит агент, а не браузер."]}):b&&n.previewMode?a.jsx(EN,{text:n.text}):a.jsx(pN,{path:n.path,doc:n.text,revision:n.revision,goto:l,onChange:r,onSave:c})]})}function EN({text:n}){const[l,r]=x.useState("");return x.useEffect(()=>{let c=!1;return Sf(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function TN({files:n,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(m=>a.jsxs("div",{className:"worktab"+(m.path===l?" is-on":""),role:"tab","aria-selected":m.path===l,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:K1(m.path)}),di(m)?a.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):a.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),a.jsx("div",{className:"worktabs__spacer"}),h&&a.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:a.jsx(_o,{active:d})})]})}function Tl(n){return n.claudeSessionId??n.id}function cf(n,l,r,c){if(!l||l.length===0)return n;const o=new Map(l.map((m,g)=>[m,g])),d=[],h=[];for(const m of n)(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 qb(n){return n.state!=="closed"}function yy(n){return[...n.filter(qb),...n.filter(l=>!qb(l))]}function Kd(n,l,r,c){if(l===r||!n.includes(l)||!n.includes(r))return null;const o=n.filter(m=>m!==l),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),l,...o.slice(d)];return h.every((m,g)=>m===n[g])?null:h}function em(n,l,r,c){const o=n%10,d=n%100;return o===1&&d!==11?l:o>=2&&o<=4&&(d<12||d>14)?r:c}function vy(n){return`${n} ${em(n,"агент","агента","агентов")}`}function CN(n){const l=n.filter(o=>o.kind==="agent").length,r=n.length-l,c=[];return l>0&&c.push(vy(l)),r>0&&c.push(`${r} ${em(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function AN(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function MN(n){const l=Math.max(0,Math.floor(n/1e3)),r=Math.floor(l/3600),c=Math.floor(l%3600/60),o=l%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function RN(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function DN({tasks:n,onStop:l}){const[r,c]=x.useState(!1),[o,d]=x.useState(()=>Date.now()),[h,m]=x.useState(()=>new Set);x.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),x.useEffect(()=>{m(b=>{const y=new Set(n.map(v=>v.id)),j=new Set([...b].filter(v=>y.has(v)));return j.size===b.size?b:j})},[n]);const g=b=>{m(y=>new Set(y).add(b)),l(b),window.setTimeout(()=>{m(y=>{if(!y.has(b))return y;const j=new Set(y);return j.delete(b),j})},1e4)};return a.jsxs("div",{className:r?"tasks is-open":"tasks",children:[a.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(b=>!b),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:CN(n)}),a.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(b=>{const y=h.has(b.id);return a.jsxs("li",{className:y?"task is-stopping":"task",children:[a.jsxs("div",{className:"task__main",children:[a.jsxs("div",{className:"task__head",children:[a.jsx("span",{className:"task__kind",children:AN(b)}),b.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:MN(o-b.startedAt)})]}),a.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&a.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),a.jsxs("div",{className:"task__stats",children:[RN(b.tokens)," · ",b.toolUses," ",em(b.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:y?"Останавливается":"Стоп"})]},b.id)})})]})}const ON=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function tm({className:n}){return a.jsx("img",{src:ON,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const LN=450,zN=6,UN={claude:{label:"Claude",hint:"Claude Code — как обычно"},antigravity:{label:"Antigravity",hint:"Google agy, отдельная палитра и права"}};function IN({disabled:n,providers:l,lastAccountId:r,onStart:c,onSignIn:o}){var O;const{accounts:d,auth:h,multi:m}=Bp(),g=["claude","antigravity"].filter(I=>l.includes(I)).flatMap(I=>I==="claude"&&m?d.map(oe=>{const pe=h[oe.id],je=L_(pe);return{key:`claude:${oe.id}`,id:"claude",label:oe.name,hint:je?`Claude Code, ${je}`:"Claude Code",account:oe,isDefault:oe.id===r,needsLogin:oe.id!==Pi&&pe!=null&&!pe.loggedIn}}):[{key:I,id:I,...UN[I]}]),b=g.length>1,y=g.find(I=>I.isDefault)??g[0],j=Math.max(0,g.indexOf(y)),[v,S]=x.useState(!1),[k,C]=x.useState(0),[A,F]=x.useState({left:0,top:0}),Q=x.useRef(null),q=x.useRef(null),B=x.useRef(null);function Y(){B.current&&window.clearTimeout(B.current.timer),B.current=null}function M(){Y(),C(j),S(!0)}function z(I){var oe;S(!1),I&&((oe=Q.current)==null||oe.focus())}function R(I){if(n||!b||I.button!==0)return;const oe={timer:0,x:I.clientX,y:I.clientY,fired:!1};oe.timer=window.setTimeout(()=>{oe.fired=!0,M()},LN),B.current=oe}function Z(I){const oe=B.current;!oe||oe.fired||Math.hypot(I.clientX-oe.x,I.clientY-oe.y)>zN&&Y()}function re(){B.current&&!B.current.fired&&Y()}function G(I){var oe;if((oe=B.current)!=null&&oe.fired){B.current=null,I.preventDefault();return}n||y&&ve(y)}function $(I){b&&(I.preventDefault(),!n&&M())}function he(I){if(n||!b)return;(I.key==="ArrowDown"||I.key==="ArrowUp"||I.key==="Enter"&&I.shiftKey)&&(I.preventDefault(),M())}x.useLayoutEffect(()=>{if(!v)return;const I=Q.current,oe=q.current;if(!I||!oe)return;const pe=I.getBoundingClientRect(),je=oe.getBoundingClientRect(),E=8,ne=Math.max(E,Math.min(pe.right-je.width,window.innerWidth-je.width-E));let X=pe.top-je.height-8;X<E&&(X=Math.min(pe.bottom+8,window.innerHeight-je.height-E)),F({left:ne,top:X})},[v]),x.useLayoutEffect(()=>{var I;v&&((I=q.current)==null||I.focus())},[v]),x.useLayoutEffect(()=>{if(!v)return;function I(oe){var je,E;const pe=oe.target;!((je=q.current)!=null&&je.contains(pe))&&!((E=Q.current)!=null&&E.contains(pe))&&z(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[v]);function ve(I){var oe;if(z(!1),I.needsLogin&&I.account){o(I.account.id);return}c(I.id,(oe=I.account)==null?void 0:oe.id)}function K(I){if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),z(!0);return}if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault();const oe=I.key==="ArrowDown"?1:-1;C(pe=>(pe+oe+g.length)%g.length);return}if(I.key==="Enter"||I.key===" "){I.preventDefault();const oe=g[k];oe&&ve(oe);return}I.key==="Tab"&&z(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:Q,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:b?m?`Новая сессия под «${((O=y==null?void 0:y.account)==null?void 0:O.name)??""}». Удерживайте, чтобы выбрать агента или аккаунт`:"Удерживайте, чтобы выбрать агента":void 0,"aria-label":m&&(y!=null&&y.account)?`Новая сессия, аккаунт «${y.account.name}»`:void 0,"aria-haspopup":b?"menu":void 0,"aria-expanded":b?v:void 0,onClick:G,onContextMenu:$,onPointerDown:R,onPointerMove:Z,onPointerUp:re,onPointerCancel:re,onPointerLeave:re,onKeyDown:he,children:["+ Сессия",m&&(y==null?void 0:y.account)&&a.jsx("span",{className:`newsession__acct acct--${y.account.color}`,"aria-hidden":"true"}),b&&a.jsx(HN,{})]}),v&&b&&a.jsx("div",{ref:q,className:"newsession__menu",style:{left:A.left,top:A.top},role:"menu","aria-label":m?"Выбрать агента и аккаунт для новой сессии":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:K,children:g.map((I,oe)=>{var pe;return a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(oe===k?" is-cursor":"")+(oe>0&&((pe=g[oe-1])==null?void 0:pe.id)!==I.id?" newsession__item--sep":""),onMouseEnter:()=>C(oe),onClick:()=>ve(I),children:[I.account?a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(Aa,{account:I.account,size:"md"})}):a.jsx("span",{className:`newsession__mark newsession__mark--${I.id}`,"aria-hidden":"true",children:I.id==="antigravity"?a.jsx(tm,{className:"newsession__mark-logo"}):a.jsx(BN,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:I.label}),a.jsx("span",{className:"newsession__hint",children:I.hint})]}),I.needsLogin?a.jsx("span",{className:"newsession__tag newsession__tag--login",children:"Войти"}):I.isDefault&&a.jsx("span",{className:"newsession__tag",children:"по клику"})]},I.key)})})]})}function HN(){return a.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function BN(){return a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const jy="ccv:sidebar.collapsed",Ny="ccv:sidebar.mode",wy="ccv:sidebar.foldersCollapsed",Gb="ccv:sidebar.expandedProjects",Yb="ccv:sidebar.expandedProjectArchives",$N=500,Dp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function qN({open:n,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,projectSessions:g,onRequestSessions:b,pinned:y,live:j,listOrder:v,liveSessionsFirst:S,onReorder:k,activeWorkspaceId:C,activeSessionId:A,onSelectWorkspace:F,onRenameSession:Q,onStopSession:q,onPinSessions:B,onSelectPinned:Y,onCloseWorkspaces:M,onRestoreWorkspaces:z,onUnmarkWorkspaces:R,onArchiveSessions:Z,onUnarchiveSessions:re,onCreateFolder:G,onRenameFolder:$,onSetFolderColor:he,onDeleteFolder:ve,onAssignToFolder:K,folderNotice:O,onDismissFolderNotice:I,movingProjectId:oe,onOpenWorkspace:pe,onOpenUnopened:je,onNewSession:E,enabledProviders:ne,lastAccountId:X,onSignInAccount:Ne,onOpenExtensions:U,account:ye,onOpenAccount:Le,relay:Ie,onOpenRelay:qe,onOpenSettings:$t,themeMode:Ve,onCycleTheme:Cn}){var bl;const it=Bp(),[lt,tt]=x.useState(null),[Lt,_t]=x.useState(null),[vt,qt]=x.useState(null);function Te(w){return(vt==null?void 0:vt.folderId)===w.id?vt.color??void 0:w.color}function We(w){const ee=w&&Te(w);return ee?{"--folder-color":ee}:void 0}const At=x.useRef(void 0),[gt,Ye]=x.useState(null),[wn,zn]=x.useState(null),[St,Jt]=x.useState(""),[hs,An]=x.useState(sw),[xn,as]=x.useState(lw),[zt,on]=x.useState(aw),[ln,Gt]=x.useState(()=>Qb(Gb)),[Zn,ue]=x.useState(()=>Qb(Yb)),[ke,Qe]=x.useState([]);function rt(w){on(w);try{localStorage.setItem(Ny,w)}catch{}}const He=St.trim().toLowerCase(),Pe=He!=="",W=x.useMemo(()=>cf(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),ge=x.useMemo(()=>{const w=cf(y,v==null?void 0:v.pinned,Tl,"bottom");return S?yy(w):w},[y,v,S]),Re=x.useMemo(()=>cf(j,v==null?void 0:v.live,Tl,"bottom"),[j,v]),Ge=x.useMemo(()=>{const w=new Map,ee=new Map,_e=new Map,De=new Map(c.map(ft=>[ft.id,ft.folderId]));for(const ft of j){const Pn=Ty(ft);hp(w,ft.workspaceId,Pn),ft.folderId&&hp(ee,ft.folderId,Pn);const Qt=De.get(ft.workspaceId);Qt&&hp(_e,Qt,Pn)}return{byWorkspace:w,bySessionFolder:ee,byWorkspaceFolder:_e}},[j,c]),Yt=w=>w.name.toLowerCase().includes(He)||w.path.toLowerCase().includes(He),Mn=x.useMemo(()=>Pe?W.filter(w=>{if(Yt(w))return!0;const ee=g[w.id];return!!ee&&(ee.sessions.some(_e=>vu(_e,He))||ee.archived.some(_e=>vu(_e,He)))}):W,[W,g,He,Pe]),Ms=x.useMemo(()=>Pe?o.filter(Yt):o,[o,He,Pe]),Rl=w=>{var ee;return((ee=c.find(_e=>_e.id===w))==null?void 0:ee.name)??"—"},ea=w=>{var ee;return(ee=c.find(_e=>_e.id===w))==null?void 0:ee.path},Rs=x.useMemo(()=>Pe?ge.filter(w=>(w.title??"").toLowerCase().includes(He)||Rl(w.workspaceId).toLowerCase().includes(He)):ge,[ge,c,He,Pe]),vs=x.useMemo(()=>Pe?Re.filter(w=>(w.title??"").toLowerCase().includes(He)||Rl(w.workspaceId).toLowerCase().includes(He)):Re,[Re,c,He,Pe]),bn=!Pe;function Qs(w){An(ee=>{const _e=ee.includes(w)?ee.filter(De=>De!==w):[...ee,w];try{localStorage.setItem(jy,JSON.stringify(_e))}catch{}return _e})}const yn=w=>!hs.includes(w);function ps(w){as(ee=>{const _e=ee.includes(w)?ee.filter(De=>De!==w):[...ee,w];try{localStorage.setItem(wy,JSON.stringify(_e))}catch{}return _e})}const Xt=w=>!xn.includes(w);function Ze(w,ee){Gt(_e=>{if(_e.includes(w)===ee)return _e;const De=ee?[..._e,w]:_e.filter(ft=>ft!==w);return Kb(Gb,De),De})}function Vn(w){ue(ee=>{const _e=ee.includes(w)?ee.filter(De=>De!==w):[...ee,w];return Kb(Yb,_e),_e})}x.useEffect(()=>{C&&Ze(C,!0)},[C]),x.useEffect(()=>Qe(w=>w.length?[]:w),[He]);const hl=x.useRef(new Set);x.useEffect(()=>{if(!l){hl.current.clear();return}for(const w of ln)hl.current.has(w)||!c.some(ee=>ee.id===w)||(hl.current.add(w),w!==C&&b(w))},[l,ln,c,C]);function ta(w){const ee=g[w.id],_e=!Pe||Yt(w),De=!_e,ft=De?!ke.includes(w.id):ln.includes(w.id),Pn=ee?_e?ee.sessions.length:ee.sessions.filter(Qt=>vu(Qt,He)).length:void 0;return{entry:ee,showAll:_e,forced:De,open:ft,count:Pn}}function Dl(w,ee){if(ee.forced){Qe(_e=>_e.includes(w.id)?_e.filter(De=>De!==w.id):[..._e,w.id]);return}Ze(w.id,!ee.open)}const is=x.useMemo(()=>ju(Mn,d,void 0,!Pe),[Mn,d,Pe]),js=x.useMemo(()=>{const w=new Map;for(const ee of d){const _e=(ee.unopened??[]).filter(De=>!Pe||De.name.toLowerCase().includes(He));_e.length&&w.set(ee.id,_e)}return w},[d,He,Pe]),na=x.useMemo(()=>{if(!Pe)return is.groups;const w=new Set(is.groups.map(_e=>_e.folder.id)),ee=d.filter(_e=>!w.has(_e.id)&&js.has(_e.id)).map(_e=>({folder:_e,items:[]}));return ee.length?[...is.groups,...ee].sort((_e,De)=>_e.folder.name.localeCompare(De.folder.name,"ru")):is.groups},[is,d,js,Pe]),[pl,Ks]=x.useState([]),ml=x.useMemo(()=>ju(Ms,d),[Ms,d]),an=x.useMemo(()=>ju(Rs,m,w=>w.pinnedFolderId,!Pe),[Rs,m,Pe]),ut=x.useMemo(()=>({groups:[],ungrouped:vs}),[vs]),Ds=((v==null?void 0:v.workspaces.length)??0)>0,Fs=((v==null?void 0:v.pinned.length)??0)>0,ms=((v==null?void 0:v.live.length)??0)>0,Jn=uf({enabled:bn,scope:"workspaces",itemKey:w=>w.id,groups:is.groups,ungrouped:is.ungrouped,onReorder:k,onMoveToGroup:(w,ee)=>{K("workspace",w,ee.folderId),ee.order&&k("workspaces",ee.order)}}),rs=uf({enabled:bn,scope:"pinned",itemKey:Tl,groups:an.groups,ungrouped:an.ungrouped,onReorder:k}),gl=uf({enabled:bn,scope:"live",itemKey:Tl,groups:ut.groups,ungrouped:ut.ungrouped,onReorder:k});x.useEffect(()=>{if(!vt)return;const w=[...m,...d,...h].find(ee=>ee.id===vt.folderId);w&&w.color===(vt.color??void 0)&&qt(null)},[vt,m,d,h]),x.useEffect(()=>()=>window.clearTimeout(At.current),[]);const gs=Op(Mn),Os=Op(Ms),[yt,Wn]=x.useState(null),[jt,ct]=x.useState(null),[sa,Ol]=x.useState(null),[Qn,Ls]=x.useState(null),[Un,la]=x.useState(null),kt=x.useRef(null);function Zs(w,ee){const _e=w.touches[0];if(!_e)return;const De={timer:0,x:_e.clientX,y:_e.clientY,el:w.currentTarget,fired:!1};De.timer=window.setTimeout(()=>{De.fired=!0,ee(De.x,De.y,De.el)},$N),kt.current=De}function Wt(w){const ee=kt.current,_e=w.touches[0];!ee||!_e||Math.hypot(_e.clientX-ee.x,_e.clientY-ee.y)>10&&(window.clearTimeout(ee.timer),kt.current=null)}function Rn(w){const ee=kt.current;ee&&(window.clearTimeout(ee.timer),ee.fired&&w.preventDefault())}function un(){var w;return(w=kt.current)!=null&&w.fired?(kt.current=null,!0):!1}function we(){const w=yt==null?void 0:yt.opener;Wn(null),w!=null&&w.isConnected&&w.focus()}function T(){const w=jt==null?void 0:jt.opener;ct(null),w!=null&&w.isConnected&&w.focus()}function P(){const w=Qn==null?void 0:Qn.opener;Ls(null),w!=null&&w.isConnected&&w.focus()}function be(){const w=Un==null?void 0:Un.opener;la(null),w!=null&&w.isConnected&&w.focus()}function Me(w){return{onContextMenu:ee=>{ee.preventDefault(),Wn({x:ee.clientX,y:ee.clientY,opener:ee.currentTarget,ids:gs.targetsFor(w)})},onTouchStart:ee=>Zs(ee,(_e,De,ft)=>Wn({x:_e,y:De,opener:ft,ids:gs.targetsFor(w)})),onTouchMove:Wt,onTouchEnd:Rn,onTouchCancel:Rn}}function $e(w){return{onContextMenu:ee=>{ee.preventDefault(),ct({x:ee.clientX,y:ee.clientY,opener:ee.currentTarget,ids:Os.targetsFor(w)})},onTouchStart:ee=>Zs(ee,(_e,De,ft)=>ct({x:_e,y:De,opener:ft,ids:Os.targetsFor(w)})),onTouchMove:Wt,onTouchEnd:Rn,onTouchCancel:Rn}}function ze(w){return{onContextMenu:ee=>{ee.preventDefault(),Ls({x:ee.clientX,y:ee.clientY,opener:ee.currentTarget,ids:[w.id]})},onTouchStart:ee=>Zs(ee,(_e,De,ft)=>Ls({x:_e,y:De,opener:ft,ids:[w.id]})),onTouchMove:Wt,onTouchEnd:Rn,onTouchCancel:Rn}}function Ut(w){return{onContextMenu:ee=>{ee.preventDefault(),la({x:ee.clientX,y:ee.clientY,opener:ee.currentTarget,ids:[w.id]})},onTouchStart:ee=>Zs(ee,(_e,De,ft)=>la({x:_e,y:De,opener:ft,ids:[w.id]})),onTouchMove:Wt,onTouchEnd:Rn,onTouchCancel:Rn}}const dn=((C?(bl=g[C])==null?void 0:bl.sessions:void 0)??[]).filter(w=>w.state!=="closed").length,fn=yt?Mn.find(w=>w.id===yt.ids[0]):void 0,Vt=yt?[{id:"close",label:yt.ids.length>1?`Закрыть проекты (${yt.ids.length})`:"Закрыть проект",onSelect:()=>{M(yt.ids),gs.clear()}},...yt.ids.length===1?[{id:"new-session-folder",label:"Новая папка сессий",onSelect:()=>{const w=yt.ids[0];Ze(w,!0),zn(w)}}]:[],...yt.ids.length===1?[{id:"unmark",label:"Снять отметку проекта",onSelect:()=>Ol(yt.ids[0])}]:[],...bu({folders:d,ids:yt.ids,hasFolder:(fn==null?void 0:fn.folderId)!=null,assign:(w,ee)=>K("workspace",w,ee),onClear:()=>gs.clear(),onNewFolder:()=>Ye("workspace")}),...yt.ids.length===1&&bn?Jn.menuItems(yt.ids[0],Ds):[]]:[],kn=yt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(C&&yt.ids.includes(C)&&dn>0?` в нём сейчас незавершённых сессий: ${dn} — при закрытии они остановятся на хосте.`:""):void 0,Pt=jt?Ms.find(w=>w.id===jt.ids[0]):void 0,Dn=jt?[{id:"restore",label:jt.ids.length>1?`Вернуть проекты (${jt.ids.length})`:"Вернуть проект",onSelect:()=>{z(jt.ids),Os.clear()}},...jt.ids.length===1?[{id:"unmark",label:"Снять отметку проекта",onSelect:()=>Ol(jt.ids[0])}]:[],...bu({folders:d,ids:jt.ids,hasFolder:(Pt==null?void 0:Pt.folderId)!=null,assign:(w,ee)=>K("workspace",w,ee),onClear:()=>Os.clear(),onNewFolder:()=>Ye("workspace")})]:[],Js=jt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,en=Qn?Rs.find(w=>w.id===Qn.ids[0]):void 0,Ma=Qn?[{id:"rename",label:"Переименовать",onSelect:()=>tt(Qn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{en&&B(en.workspaceId,[en.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{en&&Z(en.workspaceId,[en.id])}},...en&&en.workspaceId===C?bu({folders:h.filter(w=>w.workspaceId===en.workspaceId),ids:[en.id],hasFolder:en.folderId!=null,assign:(w,ee)=>K("session",w,ee,en.workspaceId),onClear:()=>{},onNewFolder:()=>{Ze(en.workspaceId,!0),zn(en.workspaceId)}}):[],...QN(en?bu({folders:m,ids:[en.id],hasFolder:en.pinnedFolderId!=null,assign:(w,ee)=>K("pinned",w,ee),onClear:()=>{},onNewFolder:()=>Ye("pinned")}):[]),...bn&&en?rs.menuItems(Tl(en),Fs):[]]:[],In=Un?vs.find(w=>w.id===Un.ids[0]):void 0,Ra=Un?[{id:"stop",label:"Остановить",onSelect:()=>{In&&q(In)}},{id:"rename",label:"Переименовать",onSelect:()=>tt(Un.ids[0])},{id:"pin",label:(In==null?void 0:In.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{In&&B(In.workspaceId,[In.id],In.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{In&&Z(In.workspaceId,[In.id])}},...bn&&In?gl.menuItems(Tl(In),ms):[]]:[],Ws={start:Zs,move:Wt,end:Rn,consumed:un};function gi(w,ee){return a.jsxs("div",{className:"row row--confirm",style:to(ee),role:"alertdialog","aria-label":`Снять отметку с «${w.name}»`,children:[a.jsx("p",{className:"row__confirm-text",children:`Снять отметку с «${w.name}»? Каталог и файлы останутся на диске, сессии проекта будут остановлены.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>Ol(null),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>{Ol(null),R([w.id])},children:"Снять отметку"})]})]},w.id)}function aa(w,ee){var Pn,Qt;const _e=ee?1:0;if(sa===w.id)return gi(w,_e);const De=ta(w),ft=`ws-branch-${w.id}`;return a.jsxs(x.Fragment,{children:[a.jsxs("div",{"data-row-key":w.id,"data-row-scope":"workspaces",className:eo(w.id===C,gs.selected.includes(w.id),!1,!!ee)+" row--project"+Jn.dropClass(w.id),style:hi(_e,We(ee)),...Me(w),children:[qr(ee),bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить в папку (каталог проекта переедет на диске) или изменить порядок","aria-label":"Перетащить проект: в папку или на другое место в списке",...Jn.gripHandlers(w.id),children:a.jsx(df,{})}),a.jsx("button",{type:"button",className:"row__chev","aria-expanded":De.open,"aria-controls":ft,"aria-label":`${De.open?"Свернуть":"Развернуть"} проект «${w.name}»`,title:De.open?"Свернуть сессии проекта":"Показать сессии проекта",onClick:()=>{un()||Dl(w,De)},children:a.jsx(Ef,{open:De.open})}),a.jsxs("button",{className:"row__main",onClick:vn=>{un()||gs.click(vn,w,()=>{F(w.id),Ze(w.id,!0)})},onKeyDown:vn=>Jn.onKeyDown(w.id,vn),children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:w.path,children:oe===w.id?"переносим…":w.path})]}),a.jsx(Cy,{agg:Ge.byWorkspace.get(w.id)}),De.count!==void 0&&a.jsx("span",{className:"sidebar__count row__count",title:"Всего сессий в проекте, запущенных и нет",children:De.count})]}),De.open&&a.jsx("div",{id:ft,role:"group","aria-label":`Сессии проекта «${w.name}»`,className:ee?"tree__branch tree__branch--railed":"tree__branch",style:hi(_e,We(ee)),children:a.jsx(GN,{workspace:w,baseDepth:_e+1,loaded:De.entry!==void 0,sessions:((Pn=De.entry)==null?void 0:Pn.sessions)??Xb,archived:((Qt=De.entry)==null?void 0:Qt.archived)??Xb,folders:h.filter(vn=>vn.workspaceId===w.id),needle:He,showAll:De.showAll,reorderEnabled:bn,listOrder:v,liveSessionsFirst:S,activeSessionId:A,archiveExpanded:Zn.includes(w.id),onToggleArchive:()=>Vn(w.id),creatingFolder:wn===w.id,onStartCreateFolder:()=>zn(w.id),onFinishCreateFolder:()=>zn(null),renamingId:lt,setRenamingId:tt,renderFolderHead:zl,liveInFolder:Ge.bySessionFolder,isFolderOpen:Xt,folderRowStyle:We,longPress:Ws,onOpenSession:Y,onRenameSession:Q,onPinSessions:B,onArchiveSessions:Z,onUnarchiveSessions:re,onCreateFolder:G,onAssignToFolder:K,onReorder:k})})]},w.id)}function xl(w){const ee=js.get(w.id);if(!ee)return null;const _e=Pe||pl.includes(w.id),De=_e?ee:ee.slice(0,Vb),ft=ee.length-De.length,Pn=hi(1,We(w));return a.jsxs("div",{role:"group","aria-label":`Не открытые в ccv каталоги папки «${w.name}»`,children:[De.map(Qt=>a.jsxs("div",{className:"row row--foldered row--unopened",style:Pn,children:[qr(w),a.jsxs("button",{type:"button",className:"row__main row__main--unopened",title:`${Qt.path}
|
|
119
|
-
Не открыт в ccv — нажмите, чтобы открыть как проект`,onClick:()=>je(Qt.path),children:[a.jsx("span",{className:"row__unopened-icon","aria-hidden":"true",children:a.jsx(WN,{})}),a.jsx("span",{className:"row__title",children:Qt.name})]})]},Qt.path)),(ft>0||_e&&!Pe&&ee.length>Vb)&&a.jsxs("div",{className:"row row--foldered row--unopened",style:Pn,children:[qr(w),a.jsxs("button",{type:"button",className:"row__main row__main--unopened row__more","aria-expanded":_e,onClick:()=>Ks(Qt=>Qt.includes(w.id)?Qt.filter(vn=>vn!==w.id):[...Qt,w.id]),children:[a.jsx("span",{className:"row__unopened-icon","aria-hidden":"true"}),a.jsx("span",{className:"row__title",children:ft>0?`Ещё ${ft}`:"Свернуть"})]})]})]})}function Ll(w,ee){return sa===w.id?gi(w,ee?1:0):a.jsxs("div",{className:eo(w.id===C,Os.selected.includes(w.id),!1,!!ee),style:We(ee),...$e(w),children:[qr(ee),a.jsxs("button",{className:"row__main",onClick:_e=>{un()||Os.click(_e,w,()=>F(w.id))},children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:fw(w)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>z([w.id]),children:"Вернуть"})]},w.id)}function Da(w,ee){const _e=Tl(w);return a.jsxs("div",{"data-row-key":_e,"data-row-scope":"pinned",className:eo(w.id===A,!1,w.provider==="antigravity",!!ee,!0)+rs.dropClass(_e),style:We(ee),...lt===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...ze(w)},children:[qr(ee),lt===w.id?a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:w.title??"",onCommit:De=>{Q(w,De),tt(null)},onCancel:()=>tt(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...rs.gripHandlers(_e),children:a.jsx(df,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{un()||Y(w)},onKeyDown:De=>rs.onKeyDown(_e,De),children:a.jsx(yf,{session:w,pinned:!1,projectName:Rl(w.workspaceId),projectPath:ea(w.workspaceId)})})]})]},w.id)}function xi(w){const ee=Tl(w);return a.jsx("div",{"data-row-key":ee,"data-row-scope":"live",className:eo(w.id===A,!1,w.provider==="antigravity",!1,!0)+gl.dropClass(ee),...lt===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ut(w)},children:lt===w.id?a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:w.title??"",onCommit:_e=>{Q(w,_e),tt(null)},onCancel:()=>tt(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...gl.gripHandlers(ee),children:a.jsx(df,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{un()||Y(w)},onKeyDown:_e=>gl.onKeyDown(ee,_e),children:a.jsx(yf,{session:w,pinned:w.pinned===!0,projectName:Rl(w.workspaceId),projectPath:ea(w.workspaceId)})}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:_e=>{_e.stopPropagation(),!un()&&q(w)},children:a.jsx(PN,{})})]})},w.id)}function zl(w,ee,_e={}){return a.jsx(ZN,{folder:w,count:ee,live:_e.live,depth:_e.depth??0,droppable:_e.droppable===!0,dropActive:_e.droppable===!0&&Jn.isDropFolder(w.id),open:Xt(w.id),renaming:Lt===w.id,onToggle:()=>ps(w.id),onStartRename:()=>_t(w.id),onCommitRename:De=>{$(w.id,De),_t(null)},onCancelRename:()=>_t(null),onDelete:()=>ve(w.id),onOpenAsProject:w.id.startsWith("dir:")&&w.path?()=>je(w.path):void 0,color:Te(w),onPreviewColor:De=>{window.clearTimeout(At.current),qt({folderId:w.id,color:De})},onCommitColor:De=>{qt({folderId:w.id,color:De}),he(w.id,De),window.clearTimeout(At.current),At.current=window.setTimeout(()=>qt(null),4e3)},onResetColor:()=>{window.clearTimeout(At.current),qt(null),he(w.id,null)}},w.id)}return a.jsxs("aside",{className:n?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:l?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Fb[Ve]}`,"aria-label":`Тема: ${Fb[Ve]}. Переключить`,onClick:Cn,children:a.jsx(iw,{mode:Ve})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":zt==="default",className:zt==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>rt("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":zt==="pinned",className:zt==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>rt("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":zt==="live",className:zt==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>rt("live"),children:[a.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&a.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]}),a.jsxs("div",{className:"fssearch fssearch--sidebar",children:[a.jsx(tw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:St,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>Jt(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),St?Jt(""):w.currentTarget.blur())}}),St&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Jt(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:zt==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Закреплённые",count:Rs.length,open:yn("pinned"),onToggle:()=>Qs("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{Ye("pinned"),yn("pinned")||Qs("pinned")}}}),yn("pinned")&&a.jsxs(a.Fragment,{children:[gt==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:"",placeholder:"Название папки",onCommit:w=>{G("pinned",w),Ye(null)},onCancel:()=>Ye(null)})})}),Rs.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),an.groups.map(w=>a.jsxs(x.Fragment,{children:[zl(w.folder,w.items.length),Xt(w.folder.id)&&w.items.map(ee=>Da(ee,w.folder))]},w.folder.id)),an.ungrouped.map(w=>Da(w))]})]}):zt==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Запущенные",count:vs.length,open:yn("live"),onToggle:()=>Qs("live")}),yn("live")&&a.jsxs(a.Fragment,{children:[vs.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Нет запущенных сессий"})}),vs.map(w=>xi(w))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Проекты",count:Mn.length,open:yn("workspaces"),onToggle:()=>Qs("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{Ye("workspace"),yn("workspaces")||Qs("workspaces")}}}),yn("workspaces")&&a.jsxs(a.Fragment,{children:[O&&a.jsxs("div",{className:"sidebar__notice",role:"alert",children:[a.jsx("span",{children:O}),a.jsx("button",{type:"button",className:"sidebar__notice-close","aria-label":"Закрыть сообщение",onClick:I,children:"✕"})]}),gt==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:"",placeholder:"Название папки",onCommit:w=>{G("workspace",w),Ye(null)},onCancel:()=>Ye(null)})})}),Mn.length===0&&js.size===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока ни одного"})}),na.map(w=>a.jsxs(x.Fragment,{children:[zl(w.folder,w.items.length,{droppable:bn,live:Ge.byWorkspaceFolder.get(w.folder.id)}),Xt(w.folder.id)&&w.items.map(ee=>aa(ee,w.folder)),Xt(w.folder.id)&&xl(w.folder)]},w.folder.id)),is.ungrouped.map(w=>aa(w)),Jn.canUngroup&&a.jsx("div",{className:Jn.zoneActive?"tree__zone tree__zone--active":"tree__zone","data-drop-zone":"ungrouped",children:"Без папки"})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Архив проектов",count:Ms.length,open:yn("workspacesArchive"),onToggle:()=>Qs("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),yn("workspacesArchive")&&a.jsxs(a.Fragment,{children:[Ms.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:Pe?"Ничего не найдено":"Пока пусто"})}),ml.groups.map(w=>a.jsxs(x.Fragment,{children:[zl(w.folder,w.items.length),Xt(w.folder.id)&&w.items.map(ee=>Ll(ee,w.folder))]},w.folder.id)),ml.ungrouped.map(w=>Ll(w))]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[it.multi?a.jsxs("button",{className:"account-btn",title:"Аккаунты Claude",onClick:Le,children:[a.jsx("span",{className:"account-btn__marks",children:it.accounts.map(w=>{var _e;const ee=((_e=it.auth[w.id])==null?void 0:_e.loggedIn)===!1;return a.jsx("span",{className:ee?"account-btn__mark is-out":"account-btn__mark",children:a.jsx(Aa,{account:w})},w.id)})}),a.jsx("span",{className:"account-btn__id",children:"Аккаунты Claude"}),it.accounts.some(w=>{var ee;return((ee=it.auth[w.id])==null?void 0:ee.loggedIn)===!1})&&a.jsx("span",{className:"chip chip--warn",children:"нет входа"})]}):a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:Le,children:[a.jsx("span",{className:ye!=null&&ye.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:ye===null?"Аккаунт":ye.loggedIn?ye.email||"Вход выполнен":"Войти в аккаунт"}),(ye==null?void 0:ye.plan)&&a.jsx("span",{className:"chip",children:ye.plan})]}),qe&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:qe,children:[a.jsx("span",{className:Ie!=null&&Ie.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Ie===null?"Удалённый доступ":Ie.paired?Ie.connected?Ie.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(Ie==null?void 0:Ie.connected)&&Ie.clients>0&&a.jsx("span",{className:"chip",children:Ie.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!U,title:"MCP-серверы и плагины",onClick:()=>U==null?void 0:U(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:$t,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:pe,children:"+ Проект"}),a.jsx(IN,{disabled:!C,providers:ne,lastAccountId:X,onStart:E,onSignIn:Ne})]})]}),yt&&a.jsx(ar,{x:yt.x,y:yt.y,items:Vt,note:kn,onClose:we}),jt&&a.jsx(ar,{x:jt.x,y:jt.y,items:Dn,note:Js,onClose:T}),Qn&&a.jsx(ar,{x:Qn.x,y:Qn.y,items:Ma,note:Dp,onClose:P}),Un&&a.jsx(ar,{x:Un.x,y:Un.y,items:Ra,note:Dp,onClose:be})]})}const Xb=[];function vu(n,l){return(n.title??"").toLowerCase().includes(l)}function qr(n){return n?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}function hi(n,l){return{"--depth":n,...l}}function GN({workspace:n,baseDepth:l,loaded:r,sessions:c,archived:o,folders:d,needle:h,showAll:m,reorderEnabled:g,listOrder:b,liveSessionsFirst:y,activeSessionId:j,archiveExpanded:v,onToggleArchive:S,creatingFolder:k,onStartCreateFolder:C,onFinishCreateFolder:A,renamingId:F,setRenamingId:Q,renderFolderHead:q,liveInFolder:B,isFolderOpen:Y,folderRowStyle:M,longPress:z,onOpenSession:R,onRenameSession:Z,onPinSessions:re,onArchiveSessions:G,onUnarchiveSessions:$,onCreateFolder:he,onAssignToFolder:ve,onReorder:K}){var qt;const O=n.id,I=h!=="",oe=x.useMemo(()=>{const Te=cf(c,b==null?void 0:b.sessions[O],Tl,"top");return y?yy(Te):Te},[c,b,O,y]),pe=x.useMemo(()=>m?oe:oe.filter(Te=>vu(Te,h)),[oe,m,h]),je=x.useMemo(()=>m?o:o.filter(Te=>vu(Te,h)),[o,m,h]),E=x.useMemo(()=>ju(pe,d,void 0,!I),[pe,d,I]),ne=x.useMemo(()=>ju(je,d),[je,d]),X=(((qt=b==null?void 0:b.sessions[O])==null?void 0:qt.length)??0)>0,Ne=uf({enabled:g,scope:"sessions",workspaceId:O,itemKey:Tl,groups:E.groups,ungrouped:E.ungrouped,onReorder:K}),U=Op(pe),[ye,Le]=x.useState(null),[Ie,qe]=x.useState(!1);x.useEffect(()=>qe(!1),[h]);const $t=I&&je.length>0,Ve=$t?!Ie:v;function Cn(){const Te=ye==null?void 0:ye.opener;Le(null),Te!=null&&Te.isConnected&&Te.focus()}function it(Te){return{onContextMenu:We=>{We.preventDefault(),Le({x:We.clientX,y:We.clientY,opener:We.currentTarget,ids:U.targetsFor(Te)})},onTouchStart:We=>z.start(We,(At,gt,Ye)=>Le({x:At,y:gt,opener:Ye,ids:U.targetsFor(Te)})),onTouchMove:z.move,onTouchEnd:z.end,onTouchCancel:z.end}}const lt=ye?pe.find(Te=>Te.id===ye.ids[0]):void 0,tt=(lt==null?void 0:lt.pinned)!==!0,Lt=ye?[...ye.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Q(ye.ids[0])}]:[],{id:"pin",label:tt?ye.ids.length>1?`Закрепить (${ye.ids.length})`:"Закрепить":ye.ids.length>1?`Открепить (${ye.ids.length})`:"Открепить",onSelect:()=>{re(O,ye.ids,tt),U.clear()}},{id:"archive",label:ye.ids.length>1?`Убрать в архив (${ye.ids.length})`:"Убрать в архив",onSelect:()=>{G(O,ye.ids),U.clear()}},...bu({folders:d,ids:ye.ids,hasFolder:(lt==null?void 0:lt.folderId)!=null,assign:(Te,We)=>ve("session",Te,We,O),onClear:()=>U.clear(),onNewFolder:C}),...ye.ids.length===1&&g&<?Ne.menuItems(Tl(lt),X):[]]:[];function _t(Te,We,At){const gt=Tl(Te);return a.jsxs("div",{"data-row-key":gt,"data-row-scope":"sessions",className:eo(Te.id===j,U.selected.includes(Te.id),Te.provider==="antigravity",!!At,!0)+Ne.dropClass(gt),style:hi(We,M(At)),...F===Te.id?{}:it(Te),children:[qr(At),F===Te.id?a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:Te.title??"",onCommit:Ye=>{Z(Te,Ye),Q(null)},onCancel:()=>Q(null)})}):a.jsxs(a.Fragment,{children:[g&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ne.gripHandlers(gt),children:a.jsx(df,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:Ye=>{z.consumed()||U.click(Ye,Te,()=>R(Te))},onKeyDown:Ye=>Ne.onKeyDown(gt,Ye),children:a.jsx(yf,{session:Te,pinned:Te.pinned===!0})}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{z.consumed()||Q(Te.id)},children:"✎"})]})]},Te.id)}function vt(Te,We,At){return a.jsxs("div",{className:eo(Te.id===j,!1,Te.provider==="antigravity",!!At,!0),style:hi(We,M(At)),children:[qr(At),a.jsx("button",{className:"row__main row__main--session",onClick:()=>R(Te),children:a.jsx(yf,{session:Te,pinned:!1,archived:!0})}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>$(O,[Te.id]),children:"Вернуть"})]},Te.id)}return a.jsxs(a.Fragment,{children:[k&&a.jsx("div",{className:"row row--hint",style:hi(l,void 0),children:a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:"",placeholder:"Название папки",onCommit:Te=>{he("session",Te,O),A()},onCancel:A})})}),r?pe.length===0&&a.jsx("div",{className:"row row--hint",style:hi(l,void 0),children:a.jsx("span",{className:"row__meta",children:"Пока ни одной"})}):a.jsx("div",{className:"row row--hint",style:hi(l,void 0),"aria-busy":"true",children:a.jsx("span",{className:"row__meta",children:"Загрузка…"})}),E.groups.map(Te=>a.jsxs(x.Fragment,{children:[q(Te.folder,Te.items.length,{depth:l,live:B.get(Te.folder.id)}),Y(Te.folder.id)&&Te.items.map(We=>_t(We,l+1,Te.folder))]},Te.folder.id)),E.ungrouped.map(Te=>_t(Te,l)),r&&o.length>0&&(!I||je.length>0)&&a.jsxs(a.Fragment,{children:[a.jsx(YN,{title:"Архив",count:je.length,open:Ve,depth:l,hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется",onToggle:()=>$t?qe(Te=>!Te):S()}),Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row row--hint",style:hi(l,void 0),children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),ne.groups.map(Te=>a.jsxs(x.Fragment,{children:[q(Te.folder,Te.items.length,{depth:l}),Y(Te.folder.id)&&Te.items.map(We=>vt(We,l+1,Te.folder))]},Te.folder.id)),ne.ungrouped.map(Te=>vt(Te,l))]})]}),ye&&a.jsx(ar,{x:ye.x,y:ye.y,items:Lt,note:Dp,onClose:Cn})]})}function YN({title:n,count:l,open:r,depth:c,hint:o,onToggle:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsx("div",{className:"row",style:to(c),children:a.jsxs("button",{className:"row__main",style:ky,"aria-expanded":r,title:`${h} — ${o}`,onClick:d,children:[a.jsx(Ef,{open:r}),a.jsx("span",{style:Ey,children:n}),a.jsx("span",{className:"sidebar__count",children:l})]})})}function eo(n,l,r,c,o){const d=["row"];return o&&d.push("row--session"),c&&d.push("row--foldered"),n&&d.push("row--active"),l&&d.push("row--selected"),r&&d.push("row--antigravity"),d.join(" ")}function ju(n,l,r=o=>o.folderId,c=!1){const o=new Map(l.map(g=>[g.id,g])),d=new Map,h=[];for(const g of n){const b=r(g),y=b?o.get(b):void 0;if(!y){h.push(g);continue}const j=d.get(y.id);j?j.push(g):d.set(y.id,[g])}if(c)for(const g of l)d.has(g.id)||d.set(g.id,[]);return{groups:[...d.entries()].map(([g,b])=>({folder:o.get(g),items:b})).sort((g,b)=>g.folder.name.localeCompare(b.folder.name,"ru")),ungrouped:h}}function XN(n,l,r){return[...n.flatMap(c=>c.items.map(r)),...l.map(r)]}const of="\0ungrouped";function VN(n,l,r){const c=new Map;for(const o of n)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of l)c.set(r(o),of);return c}function fp(n,l,r,c,o){const d=[...l.map(m=>m.items),r].find(m=>m.some(g=>c(g)===n));if(!d)return null;const h=d.findIndex(m=>c(m)===n);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 uf(n){const[l,r]=x.useState(null),[c,o]=x.useState(null),[d,h]=x.useState(null),m=n.onMoveToGroup,g=x.useMemo(()=>XN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),b=x.useMemo(()=>VN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),y=x.useRef({raf:0,el:null,x:0,y:0}),j=x.useRef(()=>{});function v(){window.cancelAnimationFrame(y.current.raf),y.current.raf=0,y.current.el=null}function S(G){v();const $=y.current;if($.el=G.closest(".sidebar__scroll"),!$.el)return;const he=56,ve=16,K=()=>{const O=$.el;if(!O)return;const I=O.getBoundingClientRect();let oe=0;if($.y<I.top+he?oe=-ve*Math.min(1,(I.top+he-$.y)/he):$.y>I.bottom-he&&(oe=ve*Math.min(1,($.y-(I.bottom-he))/he)),oe!==0){const pe=O.scrollTop;O.scrollTop=pe+oe,O.scrollTop!==pe&&j.current($.x,$.y)}$.raf=window.requestAnimationFrame(K)};$.raf=window.requestAnimationFrame(K)}x.useEffect(()=>v,[]);function k(){v(),r(null),o(null),h(null)}function C(G,$){n.enabled&&($.preventDefault(),$.currentTarget.setPointerCapture($.pointerId),y.current.x=$.clientX,y.current.y=$.clientY,S($.currentTarget),r(G),o(null),h(null))}function A(G,$){if(!l)return;const he=document.elementFromPoint(G,$),ve=b.get(l);if(m){const je=he==null?void 0:he.closest("[data-drop-folder]"),E=je?null:he==null?void 0:he.closest("[data-drop-zone]");if(je||E){const ne=je?je.dataset.dropFolder:null,X=ne??of;o(null),h(X===ve?null:{folderId:ne});return}}const K=he==null?void 0:he.closest("[data-row-key]"),O=(K==null?void 0:K.dataset.rowScope)===n.scope?K.dataset.rowKey:void 0,I=O?b.get(O):void 0;if(h(null),!O||O===l||I===void 0||!m&&I!==ve){o(null);return}const oe=K.getBoundingClientRect(),pe=$-oe.top<oe.height/2?"before":"after";o(je=>(je==null?void 0:je.key)===O&&je.position===pe?je:{key:O,position:pe})}j.current=A;function F(G){y.current.x=G.clientX,y.current.y=G.clientY,A(G.clientX,G.clientY)}function Q(){if(l&&d&&m)m(l,{folderId:d.folderId,order:null});else if(l&&c){const G=Kd(g,l,c.key,c.position),$=b.get(c.key);m&&$!==b.get(l)?m(l,{folderId:$===of?null:$??null,order:G}):G&&n.onReorder(n.scope,G,n.workspaceId)}k()}function q(G,$){if(!n.enabled)return;const he=fp(G,n.groups,n.ungrouped,n.itemKey,$);if(!he)return;const ve=Kd(g,G,he.target,he.position);ve&&n.onReorder(n.scope,ve,n.workspaceId)}function B(G,$){const he=fp(G,n.groups,n.ungrouped,n.itemKey,"up"),ve=fp(G,n.groups,n.ungrouped,n.itemKey,"down"),K=[{id:"move-up",label:"Переместить выше",disabled:!he,onSelect:()=>{if(!he)return;const O=Kd(g,G,he.target,he.position);O&&n.onReorder(n.scope,O,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!ve,onSelect:()=>{if(!ve)return;const O=Kd(g,G,ve.target,ve.position);O&&n.onReorder(n.scope,O,n.workspaceId)}}];return $&&K.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),K}function Y(G){return l===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function M(G){return{onPointerDown:$=>C(G,$),onPointerMove:F,onPointerUp:Q,onPointerCancel:k,onLostPointerCapture:k}}function z(G,$){!$.altKey||$.key!=="ArrowUp"&&$.key!=="ArrowDown"||($.preventDefault(),q(G,$.key==="ArrowUp"?"up":"down"))}const R=G=>(d==null?void 0:d.folderId)===G,Z=!!m&&l!==null&&b.get(l)!==of,re=d!==null&&d.folderId===null;return{dragging:l!==null,dropClass:Y,gripHandlers:M,onKeyDown:z,menuItems:B,isDropFolder:R,canUngroup:Z,zoneActive:re}}function bu(n){return[...[...n.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,r.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(r=>n.assign(r,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function QN(n){return n.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function Op(n){const[l,r]=x.useState([]),c=x.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(y=>y.includes(g.id)?y.filter(j=>j!==g.id):[...y,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const y=n.findIndex(v=>v.id===c.current),j=n.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,S]=y<j?[y,j]:[j,y];r(n.slice(v,S+1).map(k=>k.id));return}}o(),c.current=g.id,b()}function h(m){return l.includes(m.id)?l:(r([m.id]),c.current=m.id,[m.id])}return{selected:l,click:d,targetsFor:h,clear:o}}const KN={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},FN={width:22,height:22,borderRadius:6};function Fd({title:n,count:l,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:KN,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(Ef,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:n}),a.jsx("span",{className:"sidebar__count",children:l})]}),d&&a.jsx("button",{className:"theme-btn",style:FN,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(nw,{})})]})}function to(n){return{paddingLeft:`calc(37px + ${n} * var(--tree-indent, 24px))`}}const ky={display:"flex",alignItems:"center",gap:6,width:"100%"},Sy={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500},Ey={...Sy,color:"var(--muted)",fontSize:12.5};function ZN({folder:n,count:l,live:r,open:c,renaming:o,onToggle:d,onStartRename:h,onCommitRename:m,onCancelRename:g,onDelete:b,onOpenAsProject:y,color:j,onPreviewColor:v,onCommitColor:S,onResetColor:k,depth:C,droppable:A,dropActive:F}){const Q=x.useRef(null),[q,B]=x.useState(!1),[Y,M]=x.useState(!1),z=x.useRef(S);if(z.current=S,x.useEffect(()=>{const R=Q.current;if(!R)return;const Z=()=>z.current(R.value);return R.addEventListener("change",Z),()=>R.removeEventListener("change",Z)},[o]),Y&&y)return a.jsxs("div",{className:"row row--confirm",style:to(C),role:"alertdialog","aria-label":`Открыть «${n.name}» как проект`,children:[a.jsx("p",{className:"row__confirm-text",children:`Открыть «${n.name}» как проект? Проекты внутри останутся открытыми, но без папки.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>M(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm",autoFocus:!0,onClick:()=>{M(!1),y()},children:"Открыть как проект"})]})]});if(q){const R=n.id.startsWith("dir:");return a.jsxs("div",{className:"row row--confirm",style:to(C),role:"alertdialog","aria-label":`Удалить папку «${n.name}»`,children:[a.jsx("p",{className:"row__confirm-text",children:R?`Удалить папку «${n.name}»? Проекты внутри поднимутся в корень проектов, ничего не удаляется.`:`Удалить папку «${n.name}»? Её содержимое останется, просто без папки.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>B(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>{B(!1),b()},children:"Удалить папку"})]})]})}return o?a.jsx("div",{className:"row",style:to(C),children:a.jsx("div",{className:"row__main",children:a.jsx(Ta,{value:n.name,placeholder:"Название папки",onCommit:m,onCancel:g})})}):a.jsxs("div",{className:F?"row row--drop-target":"row",style:to(C),"data-drop-folder":A?n.id:void 0,children:[a.jsxs("button",{className:"row__main",style:ky,"aria-expanded":c,title:c?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:d,children:[a.jsx(Ef,{open:c}),a.jsx("span",{style:C>0?Ey:Sy,children:n.name}),!c&&a.jsx(Cy,{agg:r}),a.jsx("span",{className:"sidebar__count",children:l})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${n.name}»`,onClick:h,children:"✎"}),a.jsxs("label",{className:j?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:j?{background:j}:void 0}),a.jsx("input",{ref:Q,type:"color",value:j??JN(),"aria-label":`Цвет папки «${n.name}»`,onChange:R=>v(R.target.value)})]}),n.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${n.name}»`,onClick:k,children:"↺"}),y&&a.jsx("button",{className:"row__edit row__edit--text",title:"Открыть каталог как проект: подойдёт, если в нём нет git","aria-label":`Это проект: открыть «${n.name}» как проект`,onClick:()=>M(!0),children:"Это проект"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — проекты и сессии внутри останутся, просто без папки","aria-label":`Удалить папку «${n.name}»`,onClick:()=>B(!0),children:"✕"})]})}function JN(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}const Vb=8;function WN(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",children:a.jsx("path",{d:"M2 4.5A1.5 1.5 0 0 1 3.5 3h2.6l1.4 1.5h5A1.5 1.5 0 0 1 14 6v5.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 11.5z"})})}function Ef({open:n}){return a.jsx("svg",{className:n?"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:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function df(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function PN(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function ew({className:n}){return a.jsxs("svg",{className:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),a.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),a.jsx("path",{d:"M8 12.2v1.4"})]})}function tw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function nw(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function sw(){try{const n=localStorage.getItem(jy);if(n===null)return["workspacesArchive"];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="pinned"||r==="live"):["workspacesArchive"]}catch{return["workspacesArchive"]}}function Qb(n){try{const l=localStorage.getItem(n);if(l===null)return[];const r=JSON.parse(l);return Array.isArray(r)?r.filter(c=>typeof c=="string"):[]}catch{return[]}}function Kb(n,l){try{localStorage.setItem(n,JSON.stringify(l))}catch{}}function lw(){try{const n=localStorage.getItem(wy);if(n===null)return[];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function aw(){try{const n=localStorage.getItem(Ny);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Fb={system:"как в системе",light:"светлая",dark:"тёмная"};function iw({mode:n}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return n==="dark"?a.jsx("svg",{...l,children:a.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"})}):n==="light"?a.jsxs("svg",{...l,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.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"})]}):a.jsxs("svg",{...l,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Zb(n){const l=rw(n),r=(n.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${l} · ${vy(r)}`:l}function rw(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":cw(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function cw(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function Ty(n){switch(n.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return n.backgroundWork?"background":ow(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function ow(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function yf({session:n,pinned:l,projectName:r,projectPath:c,archived:o}){const d=o?"closed":Ty(n);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`row__lead row__state--${d}`,"aria-hidden":"true",children:a.jsx("span",{className:"row__state-dot"})}),a.jsxs("span",{className:"row__body"+(r!==void 0?" row__body--with-project":"")+(o?" row__body--archived":""),title:o?dw(n):`${Zb(n)} · ${new Date(n.updatedAt).toLocaleString()}`,children:[a.jsx(uw,{title:n.title??"Без названия",pinned:l,provider:n.provider,accountId:n.accountId,projectName:r,projectPath:c}),o?a.jsxs("span",{className:"row__meta row__vh row__vh--wide",children:[a.jsx("span",{className:"row__state",children:n.archivedAuto?"по сроку":"вручную"}),n.archivedAt?a.jsx("span",{className:"row__time",children:` · ${pp(n.archivedAt)}`}):null]}):a.jsxs("span",{className:`row__meta${d==="closed"?` row__vh${r===void 0?" row__vh--time":""}`:""}`,children:[a.jsx("span",{className:`row__state row__state--${d}${d==="closed"?" row__vh":""}`,children:Zb(n)}),r===void 0&&a.jsx("span",{className:"row__time",children:d==="closed"?pp(n.updatedAt):` · ${pp(n.updatedAt)}`})]})]})]})}const Jb=["waiting","error","running","reconnecting","background","starting","halted","ready","fresh","closed"];function hp(n,l,r){const c=n.get(l);if(!c){n.set(l,{count:1,tone:r,waiting:r==="waiting"?1:0});return}c.count+=1,r==="waiting"&&(c.waiting+=1),Jb.indexOf(r)<Jb.indexOf(c.tone)&&(c.tone=r)}function Cy({agg:n}){if(!n)return null;const l=`Запущено сессий: ${n.count}`,r=n.waiting>0?`${l}, ждут решения: ${n.waiting}`:l;return a.jsxs("span",{className:`row__live row__state--${n.tone}`,role:"img","aria-label":r,title:r,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),a.jsx("span",{"aria-hidden":"true",children:n.count})]})}function uw({title:n,pinned:l,provider:r,accountId:c,projectName:o,projectPath:d}){const h=mv(c,r);return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[l&&a.jsx(ew,{className:"row__pin"}),h&&a.jsx(Aa,{account:h,className:"row__acct"}),r==="antigravity"&&a.jsx(tm,{className:"row__provider"}),n]}),o!==void 0&&a.jsx("span",{className:"row__project",title:d,children:o})]})}function pp(n){const l=new Date(n);return l.toDateString()===new Date().toDateString()?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"})}function dw(n){const l=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${l}`:l}function fw(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Wb=3,hw=15e5;function Ay(n,l){if(!l||typeof l!="object")return null;const r=l,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(n==="Write"){if(typeof r.content!="string")return null;const o=mp(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(n==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=xw(pw(mp(r.old_string),mp(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 mp(n){if(n==="")return[];const l=n.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function pw(n,l){let r=0;for(;r<n.length&&r<l.length&&n[r]===l[r];)r++;let c=n.length,o=l.length;for(;c>r&&o>r&&n[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...n.slice(0,r).map(d),...mw(n.slice(r,c),l.slice(r,o)),...n.slice(c).map(d)]}function mw(n,l){if(n.length===0&&l.length===0)return[];if(n.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return n.map(y=>({type:"del",text:y}));if((n.length+1)*(l.length+1)>hw)return[...n.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const r=n.length,c=l.length,o=c+1,d=new Uint32Array((r+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=r-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=n[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const y=n[g],j=l[b];y===j?(m.push({type:"ctx",text:y}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),b++)}for(;g<r;)m.push({type:"del",text:n[g++]});for(;b<c;)m.push({type:"add",text:l[b++]});return gw(m)}function gw(n){const l=[];let r=[];function c(){l.push(...r.filter(o=>o.type==="del")),l.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of n)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function xw(n){if(!n.some(d=>d.type!=="ctx"))return n;const l=n.map(()=>!1);n.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-Wb);m<=Math.min(n.length-1,h+Wb);m++)l[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${bw(c.length)} без изменений`}),c=[]}return n.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function bw(n){const l=n%100;if(l>=11&&l<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Ca(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const l=document.createElement("textarea");l.value=n,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function Lp(){try{return await navigator.clipboard.readText()}catch{return null}}const nm=1600,Zr="Копировать",io="Скопировано";function xo({text:n,hint:l,className:r}){const[c,o]=x.useState(!1);return x.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),nm);return()=>clearTimeout(d)},[c]),x.useEffect(()=>o(!1),[n]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?io:`${Zr} ${l}`,title:c?io:`${Zr} ${l}`,onClick:()=>{Ca(n).then(d=>{d&&o(!0)})},children:c?io:Zr})}function sm({diff:n}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:n.filePath,children:n.filePath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]})]}),n.note&&a.jsx("div",{className:"diff__note",children:n.note}),a.jsx("div",{className:"diff__body",children:n.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):n.rows.map((l,r)=>a.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function _w({waiting:n}){const[l,r]=x.useState(0);return x.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:n?"work work--wait":"work",children:[a.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:n?"ждёт разрешения":"думает"}),!n&&a.jsxs("span",{className:"work__time",children:[l," с"]})]})}function lm({items:n,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=x.useRef(null),j=x.useRef(null),v=x.useRef(!0),S=x.useRef(null),k=x.useRef(null),C=x.useRef(!1);x.useEffect(()=>{v.current=!0,S.current=null,C.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[m]),x.useEffect(()=>{const B=y.current,Y=j.current;if(!B||!Y)return;function M(Z){!B||Z===B.scrollTop||(C.current=!0,B.scrollTop=Z)}function z(){if(!B)return;const Z=S.current;if(Z){const re=e_(B,Z.id);if(re){const G=re.getBoundingClientRect().top-B.getBoundingClientRect().top;M(B.scrollTop+(G-Z.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{S.current=null},500);return}v.current&&M(B.scrollHeight)}const R=new ResizeObserver(z);return R.observe(Y),()=>{R.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function A(){const B=y.current;if(B){if(C.current){C.current=!1;return}v.current=B.scrollHeight-B.scrollTop-B.clientHeight<80}}function F(){if(d)return;const B=y.current,Y=c[0];if(B&&Y){const M=e_(B,Y.id);M&&(S.current={id:Y.id,top:M.getBoundingClientRect().top-B.getBoundingClientRect().top})}h==null||h()}let Q=0;function q(B){return B.kind==="user"?Q++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:A,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:F,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(B=>a.jsx(Pb,{item:B,userIndex:q(B),onEditMessage:g},B.id)),c.length>0&&n.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&n.length===0&&a.jsx("p",{className:"empty",children:b}),n.map(B=>a.jsx(Pb,{item:B,userIndex:q(B),onEditMessage:g},B.id)),l&&a.jsx(_w,{waiting:r})]})})}function Pb({item:n,userIndex:l,onEditMessage:r}){switch(n.kind){case"user":return a.jsx(vw,{item:n,userIndex:l,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[a.jsx(jw,{text:n.text}),n.streaming&&a.jsx("span",{className:"caret"}),n.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(xo,{text:n.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":n.id,children:n.text});case"tool":return a.jsx(ww,{item:n});case"result":return a.jsxs("div",{className:"result-line","data-item-id":n.id,children:[a.jsx("span",{children:n.isError?"✗ "+n.subtype:"✓ готово"}),a.jsxs("span",{children:[(n.durationMs/1e3).toFixed(1)," с"]}),n.costUsd!==null&&a.jsxs("span",{children:["$",n.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",n_(n.inputTokens)," ↓",n_(n.outputTokens)]})]});case"notice":return a.jsx("div",{className:n.tone==="error"?"notice notice--error":"notice","data-item-id":n.id,children:n.text})}}const yw=500;function vw({item:n,userIndex:l,onEditMessage:r}){const[c,o]=x.useState(null),[d,h]=x.useState(!1),[m,g]=x.useState(n.text),b=x.useRef(null),y=x.useRef(!1),j=Nf("(max-width: 860px)"),v=x.useRef(null);function S(R,Z){o({x:R,y:Z})}function k(R){R.preventDefault(),S(R.clientX,R.clientY)}function C(R){const Z=R.touches[0];if(!Z)return;const re={timer:0,x:Z.clientX,y:Z.clientY,fired:!1};re.timer=window.setTimeout(()=>{re.fired=!0,S(re.x,re.y)},yw),v.current=re}function A(R){const Z=v.current,re=R.touches[0];!Z||!re||Math.hypot(re.clientX-Z.x,re.clientY-Z.y)>10&&(window.clearTimeout(Z.timer),v.current=null)}function F(R){const Z=v.current;Z&&(window.clearTimeout(Z.timer),Z.fired&&R.preventDefault())}function Q(){g(n.text),h(!0)}function q(){h(!1)}function B(){const R=m.trim();if(R===""&&!(n.images&&n.images.length>0))return;const Z=r==null?void 0:r(l,R,n.images);if(Z instanceof Promise){if(y.current)return;y.current=!0,Z.then(re=>{y.current=!1,re&&h(!1)},()=>{y.current=!1});return}Z!==!1&&h(!1)}x.useEffect(()=>{const R=b.current;!R||!d||(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[m,d]),x.useEffect(()=>{if(!d)return;const R=b.current;R&&(R.focus(),R.setSelectionRange(R.value.length,R.value.length))},[d]);function Y(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),q();return}R.key==="Enter"&&!R.shiftKey&&!j&&(R.preventDefault(),B())}const M=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((R,Z)=>a.jsx("img",{className:"msg--user__image",src:`data:${R.mediaType};base64,${R.data}`,alt:"Вложение"},Z))});if(d){const R=m.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[M,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:Z=>g(Z.target.value),onKeyDown:Y,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:q,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:B,disabled:!R,children:"Сохранить"})]})]})]})}const z=[{id:"copy",label:"Копировать",onSelect:()=>void Ca(n.text)},...r?[{id:"edit",label:"Изменить",onSelect:Q}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:C,onTouchMove:A,onTouchEnd:F,onTouchCancel:F,children:[M,n.text,c&&a.jsx(ar,{x:c.x,y:c.y,items:z,onClose:()=>o(null)})]})}function e_(n,l){const r=n.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function jw({text:n}){const[l,r]=x.useState(""),c=x.useRef([]);x.useEffect(()=>{let d=!1;return Sf(n).then(h=>{d||r(Nw(h))}),()=>{d=!0}},[n]),x.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!==""&&Ca(m).then(y=>{if(!y)return;h.textContent=io,h.setAttribute("aria-label",io),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Zr,h.setAttribute("aria-label",zp),h.classList.remove("copybtn--done"))},nm);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const zp=`${Zr} блок кода`;function Nw(n){if(!n.includes("<pre"))return n;const l=new DOMParser().parseFromString(n,"text/html");for(const r of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",zp),o.title=zp,o.textContent=Zr,c.append(o)}return l.body.innerHTML}function ww({item:n}){const[l,r]=x.useState(!1),c=n.result===null,o=Ay(n.name,n.input),d=n.name==="AskUserQuestion"?Ew(n.input):null;return a.jsxs("div",{className:"tool"+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:n.name}),a.jsx("span",{className:"tool__arg",children:d?Sw(d):kw(n.input)}),a.jsx("span",{className:"tool__status",children:c?"…":n.isError?"ошибка":l?"▴":"▾"})]}),l&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx(Tw,{questions:d,answers:n.answers}):o?a.jsx(sm,{diff:o}):a.jsx(t_,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!d||n.isError)&&a.jsx(t_,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function t_({text:n,hint:l,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:n}),a.jsx(xo,{text:n,hint:l,className:"codeblock__copy"})]})}function kw(n){if(!n||typeof n!="object")return"";const l=n;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=l[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function Sw(n){var r;const l=n.map(c=>c.header).filter(c=>c.length>0);return l.length===n.length?l.join(" · "):((r=n[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function Ew(n){if(typeof n!="object"||n===null)return null;const l=n.questions;if(!Array.isArray(l)||l.length===0)return null;const r=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect: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:y,description:j,preview:v}=b;if(typeof y!="string"||typeof j!="string")return null;g.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function Tw({questions:n,answers:l}){return a.jsx("div",{className:"tool__questions",children:n.map((r,c)=>a.jsxs("div",{className:"tool__question",children:[a.jsxs("div",{className:"tool__question-head",children:[r.header&&a.jsx("span",{className:"chip chip--accent",children:r.header}),a.jsx("span",{className:"tool__question-text",children:r.question})]}),a.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?a.jsx("span",{className:"tool__answer-value",children:l[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function n_(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}const Cw="ccv.dictation.lang",s_="ru-RU";function Aw(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function l_(){const n=window,l=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(Aw);return!r&&l.length>0&&Zl("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function My(){var n;try{return((n=localStorage.getItem(Cw))==null?void 0:n.trim())||s_}catch{return s_}}function Zl(n,l){l===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,l)}const Mw=3,Rw=400,Dw=5,Ow=250,Lw=2e3,zw=2e4;async function Uw(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const Iw={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${My()}`};function Hw(n){const[l]=x.useState(()=>l_()!==null),[r,c]=x.useState(!1),[o,d]=x.useState(null),h=x.useRef(null),m=x.useRef(!1),g=x.useRef(!1),b=x.useRef(n),y=x.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=x.useRef(null),v=x.useRef(!1),S=x.useRef(null),k=x.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=null},[]),C=x.useCallback(()=>{k();const B=async Y=>{if(S.current=null,!(!m.current||v.current)){if(!Y&&!await Uw()){if(Zl("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;S.current=setTimeout(()=>void B(!0),zw);return}Zl("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};S.current=setTimeout(()=>void B(!1),Lw)},[k]);x.useEffect(()=>{b.current=n}),x.useEffect(()=>{const B=l_();if(!B)return;const Y=new B;return Y.lang=My(),Y.continuous=!0,Y.interimResults=!0,Y.onstart=()=>{Zl("сессия открыта"),v.current=!0,k(),c(!0)},Y.onaudiostart=()=>{Zl("пошёл звук с микрофона"),y.current.audio=!0},Y.onresult=M=>{var re;if(g.current)return;let z="",R="";for(let G=M.resultIndex;G<M.results.length;G++){const $=M.results[G];if(!$)continue;const he=((re=$[0])==null?void 0:re.transcript)??"";$.isFinal?z+=he:R+=he}const Z=y.current;Z.heard=!0,Z.everHeard=!0,Zl("распознано",{final:z,interim:R}),b.current(z,R)},Y.onerror=M=>{y.current.lastError=M.error,Zl("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(Iw[M.error]??`Распознавание не работает: ${M.error}`))},Y.onend=()=>{g.current=!1,v.current=!1;const M=y.current,z=Date.now()-M.openedAt;if(Zl("сессия закрыта",{мс:z,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&z<Rw?M.dead+1:0,M.dead>=Dw){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>=Mw&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",C();try{Y.start()}catch{}}},Ow)},h.current=Y,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),Y.onend=null,Y.onresult=null,Y.onerror=null,Y.onstart=null,Y.onaudiostart=null,Y.abort(),h.current=null}},[]);const A=x.useCallback(()=>{var B;if(m.current){if(m.current=!1,Zl("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(B=h.current)==null||B.stop()}},[]),F=x.useCallback(()=>{const B=h.current;if(B){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,y.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Zl("включение микрофона",{язык:B.lang}),C();try{B.start()}catch(Y){Zl("start() не прошёл",Y)}}},[C]),Q=x.useCallback(()=>{m.current?A():F()},[F,A]),q=x.useCallback(()=>{var B;m.current&&v.current&&(g.current=!0,(B=h.current)==null||B.abort())},[]);return{supported:l,listening:r,error:o,toggle:Q,stop:A,drop:q}}const Bw="(max-width: 860px)",a_=/^\/(\S*)$/,$w=new Set(["model","permissions"]);function qw(n){return $w.has(n.name)||n.name.startsWith("__")}const Gw=new Set(["clear","rename"]),i_=/(?:^|\s)@([^\s@]*)$/,Yw=200,Xw=100,Vw=190,Qw=5,Kw=20*1024*1024,Fw=1568,Zw=.85;let r_=0;async function Jw(n){var j,v;if(!n.type.startsWith("image/")||n.size>Kw)return null;const l=await Ww(n);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,Fw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(l.image,0,0,d.width,d.height),(v=(j=l.image).close)==null||v.call(j);const m=n.type==="image/png",g=m?"image/png":"image/jpeg",b=d.toDataURL(g,m?void 0:Zw),y=b.slice(b.indexOf(",")+1);return y?(r_+=1,{id:`att${r_}`,mediaType:g,data:y,previewUrl:b}):null}async function Ww(n){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(n);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),l(null)},c.src=r})}function Ry({disabled:n,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:y=!0,sendBlocked:j=!1,onContextSearch:v,onCommand:S,onSend:k,onInterrupt:C,onEscape:A}){var Pe;const F=Nf(Bw),[Q,q]=x.useState(()=>m?np(m):""),[B,Y]=x.useState(!1),[M,z]=x.useState(0),R=x.useRef(null),Z=x.useRef(null),re=x.useRef(!1),G=x.useRef(null),[$,he]=x.useState(()=>m?np(m).length:0),[ve,K]=x.useState([]),O=x.useRef(null),I=x.useCallback(W=>{!y||W.length===0||Promise.all(W.map(Jw)).then(ge=>{const Re=ge.filter(Ge=>Ge!==null);Re.length!==0&&K(Ge=>[...Ge,...Re].slice(0,Qw))})},[y]);function oe(W){K(ge=>ge.filter(Re=>Re.id!==W))}function pe(W){var Ge;if(!y)return;const ge=(Ge=W.clipboardData)==null?void 0:Ge.items;if(!ge)return;const Re=[];for(const Yt of ge){if(!Yt.type.startsWith("image/"))continue;const Mn=Yt.getAsFile();Mn&&Re.push(Mn)}Re.length!==0&&(W.preventDefault(),I(Re))}function je(W){const ge=W.target.files?Array.from(W.target.files):[];W.target.value="",I(ge)}x.useEffect(()=>{y||K([])},[y]);const[E,ne]=x.useState([]),[X,Ne]=x.useState(-1),U=x.useRef(""),[ye,Le]=x.useState(""),Ie=Hw(x.useCallback((W,ge)=>{W&&q(Re=>gp(Re,W)),Le(ge.trim())},[])),qe=ye?gp(Q,ye):Q;x.useEffect(()=>{Ie.listening||ye===""||(q(W=>gp(W,ye)),Le(""))},[Ie.listening,ye]),x.useEffect(()=>{var W;b&&((W=R.current)==null||W.focus())},[b]);const $t=x.useRef(new Map),Ve=x.useRef(new Map),Cn=x.useRef(m),it=x.useRef({text:Q,caret:$});it.current={text:Q,caret:$};const lt=x.useCallback((W,ge,Re)=>{ge===""?($t.current.delete(W),Ve.current.delete(W)):($t.current.set(W,ge),Ve.current.set(W,Re)),q_(W,ge)},[]),tt=Ie.drop;x.useLayoutEffect(()=>{const W=Cn.current;if(W===m)return;Cn.current=m,W&<(W,it.current.text,it.current.caret);const ge=m?$t.current.get(m)??np(m):"",Re=m?Ve.current.get(m):void 0,Ge=Math.min(Re??ge.length,ge.length);q(ge),he(Ge),G.current=[Ge,Ge],Le(""),z(0),Y(!1),Ne(-1),U.current="",K([]),tt()},[m,lt,tt]),x.useEffect(()=>{m&<(m,Q,$)},[m,Q,$,lt]);const Lt=n?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",_t=x.useRef(0),vt=x.useCallback(W=>{const ge=parseFloat(getComputedStyle(W).maxHeight),Re=Number.isFinite(ge)&&ge>0?ge:Vw;W.style.height="auto";const Ge=W.scrollHeight;W.style.height=`${Math.min(Ge,Re)}px`,W.style.overflowY=Ge>Re?"auto":"hidden"},[]);x.useEffect(()=>{const W=R.current;W&&vt(W)},[qe,Lt,n,vt]),x.useLayoutEffect(()=>{const W=R.current,ge=G.current;!W||!ge||(G.current=null,W.setSelectionRange(ge[0],ge[1]))}),x.useEffect(()=>{const W=R.current;if(!W)return;const ge=new ResizeObserver(([Re])=>{const Ge=Re==null?void 0:Re.contentRect.width;Ge===void 0||Math.abs(Ge-_t.current)<1||(_t.current=Ge,vt(W))});return ge.observe(W),()=>ge.disconnect()},[vt]);const qt=Ie.stop;x.useEffect(()=>{n&&qt()},[n,qt]);const Te=x.useMemo(()=>Ie.error?{ok:!1,message:Ie.error}:null,[Ie.error]),We=x.useMemo(()=>{var Re;const W=(Re=a_.exec(Q))==null?void 0:Re[1];if(W===void 0)return[];const ge=W.toLowerCase();return r.filter(Ge=>!qw(Ge)&&xp(Ge,ge)<Dy).sort((Ge,Yt)=>xp(Ge,ge)-xp(Yt,ge))},[Q,r]),At=!B&&We.length>0,gt=Math.min(M,We.length-1),Ye=B?null:((Pe=i_.exec(qe.slice(0,$)))==null?void 0:Pe[1])??null,wn=x.useRef(v);wn.current=v,x.useEffect(()=>{if(Ye===null||Ye===""||Ye.endsWith("/")){wn.current(Ye);return}const W=setTimeout(()=>wn.current(Ye),Yw);return()=>clearTimeout(W)},[Ye]);const zn=Ye!==null&&(o==null?void 0:o.query)===Ye,St=zn?o.entries:[],Jt=Ye!==null,hs=Jt&&!zn,An=Math.min(M,Math.max(St.length-1,0));x.useEffect(()=>{var ge,Re;if(!At&&!Jt)return;const W=At?gt:An;(Re=(ge=Z.current)==null?void 0:ge.children[W])==null||Re.scrollIntoView({block:"nearest"})},[At,Jt,gt,An]);function xn(W,ge){var Re;q(W),he(ge),G.current=[ge,ge],z(0),Y(!1),ye!==""&&(Le(""),Ie.drop()),(Re=R.current)==null||Re.focus()}function as(){q(""),Le(""),z(0),he(0),Y(!1),Ne(-1),U.current="",K([]),Ie.drop(),m&<(m,"",0)}function zt(W){const ge=W.trim();if(ge===""&&ve.length===0||n||j||re.current)return;const Re=k(ge,ve.length>0?ve.map(Ge=>({mediaType:Ge.mediaType,data:Ge.data})):void 0);if(Re instanceof Promise){re.current=!0,Re.then(Ge=>{re.current=!1,Ge&&on(ge)},()=>{re.current=!1});return}Re!==!1&&on(ge)}function on(W){W!==""&&ne(ge=>[W,...ge.filter(Re=>Re!==W)].slice(0,Xw)),as()}function ln(W){if(W<-1||W>=E.length)return;X===-1&&(U.current=Q);const ge=W===-1?U.current:E[W]??"";Ne(W),xn(ge,ge.length)}function Gt(){var Ge;const W=((Ge=R.current)==null?void 0:Ge.selectionStart)??qe.length,Re=`${W>0&&!/\s$/.test(qe.slice(0,W))?" ":""}@`;xn(qe.slice(0,W)+Re+qe.slice(W),W+Re.length)}function Zn(W){var Yt;const ge=(Yt=i_.exec(qe.slice(0,$)))==null?void 0:Yt[1];if(ge===void 0)return;const Re=$-ge.length-1,Ge=W.kind==="dir"?`@${W.path}/`:`@${W.path} `;xn(qe.slice(0,Re)+Ge+qe.slice($),Re+Ge.length)}function ue(){var ge;if(j)return;const W=(ge=a_.exec(qe.trim()))==null?void 0:ge[1];if(W&&S(W)){as();return}zt(qe)}function ke(W,ge){q(W),he(ge),z(0),Y(!1),Ne(-1),ye!==""&&(Le(""),Ie.drop())}function Qe(W){var Ge;const ge=Gw.has(W.name)?c:null,Re=`/${W.name} `;q(Re+(ge??"")),he(Re.length+((ge==null?void 0:ge.length)??0)),ge&&(G.current=[Re.length,Re.length+ge.length]),z(0),(Ge=R.current)==null||Ge.focus()}function rt(W){if(S(W.name)){q(""),z(0),Y(!1);return}W.argumentHint?Qe(W):zt(`/${W.name}`)}function He(W){if(At){if(W.key==="ArrowDown")return W.preventDefault(),z(ge=>(Math.min(ge,We.length-1)+1)%We.length);if(W.key==="ArrowUp"){W.preventDefault();const ge=We.length-1;return z(Re=>(Math.min(Re,ge)+ge)%We.length)}if(W.key==="Enter"&&!W.shiftKey){W.preventDefault();const ge=We[gt];ge&&rt(ge);return}if(W.key==="Tab"){W.preventDefault();const ge=We[gt];ge&&Qe(ge);return}if(W.key==="Escape"){W.preventDefault(),W.stopPropagation(),Y(!0);return}}if(Jt){if(W.key==="ArrowDown"&&St.length>0)return W.preventDefault(),z(ge=>(Math.min(ge,St.length-1)+1)%St.length);if(W.key==="ArrowUp"&&St.length>0){W.preventDefault();const ge=St.length-1;return z(Re=>(Math.min(Re,ge)+ge)%St.length)}if(W.key==="Enter"&&!W.shiftKey||W.key==="Tab"){const ge=St[An];if(ge){W.preventDefault(),Zn(ge);return}if(W.key==="Tab")return}if(W.key==="Escape"){W.preventDefault(),W.stopPropagation(),Y(!0);return}}if((W.key==="ArrowUp"||W.key==="ArrowDown")&&!W.shiftKey){const ge=W.currentTarget,Re=ge.selectionStart;if(ge.selectionEnd===Re){const Yt=W.key==="ArrowUp"?X+1:X-1;Yt>=-1&&Yt<E.length&&requestAnimationFrame(()=>{ge.selectionStart===Re&&ge.selectionEnd===Re&&ln(Yt)})}}if(W.key==="Escape"&&A){W.preventDefault(),W.stopPropagation(),A();return}W.key==="Enter"&&!W.shiftKey&&!F&&(W.preventDefault(),ue())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Pr,{result:Te}),Jt&&!At&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:Z,children:[St.map((W,ge)=>a.jsxs("button",{role:"option","aria-selected":ge===An,className:ge===An?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(ge),onMouseDown:Re=>{Re.preventDefault(),Zn(W)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[W.name,W.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:W.path}),W.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},W.path)),St.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:hs?"ищем…":Ye?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),At&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:Z,children:We.map((W,ge)=>a.jsxs("button",{role:"option","aria-selected":ge===gt,className:ge===gt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(ge),onMouseDown:Re=>{Re.preventDefault(),rt(W)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",W.name]}),W.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:W.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:W.description})]},W.name))}),ve.length>0&&a.jsx("div",{className:"composer__attachments",children:ve.map(W=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:W.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>oe(W.id),children:a.jsx(lk,{})})]},W.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:Gt,children:a.jsx(tk,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:je}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var W;return(W=O.current)==null?void 0:W.click()},children:a.jsx(sk,{})})]}),a.jsx("textarea",{ref:R,value:qe,disabled:n,placeholder:Lt,onChange:W=>ke(W.target.value,W.target.selectionStart),onSelect:W=>he(W.currentTarget.selectionStart),onKeyDown:He,onPaste:pe}),Ie.supported&&a.jsx("button",{type:"button",className:Ie.listening?"micbtn is-on":"micbtn",title:Ie.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Ie.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Ie.listening,disabled:n,onClick:Ie.toggle,children:a.jsx(ak,{on:Ie.listening})}),l?a.jsx("button",{className:"btn",onClick:C,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:ue,disabled:n||j||qe.trim()===""&&ve.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(nk,{})]})]})]})})}function gp(n,l){const r=l.trim();if(r==="")return n;const c=Up(r).slice(Pw(n,r)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function Pw(n,l){const r=Up(n),c=Up(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>ek(d,c[h]??"")))return o;return 0}function Up(n){return n.split(/\s+/).filter(l=>l!=="")}function ek(n,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(n)===r(l)}function tk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function nk(){return a.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:a.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function sk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.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 lk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function ak({on:n}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:n?"currentColor":"none"}),a.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),a.jsx("path",{d:"M8 12.8v1.5"})]})}const Dy=4;function xp(n,l){const r=n.name.toLowerCase();return r===l?0:r.startsWith(l)?1:n.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:Dy}function ik({request:n,plan:l,queued:r,collapsed:c,onCollapse:o,onAccept:d,onDecline:h}){const[m,g]=x.useState(l),[b,y]=x.useState("preview");x.useEffect(()=>{g(l),y("preview")},[n.requestId,l]);const j=m.trim().length>0;function v(){j&&d(n.requestId,m)}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:c,children:a.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[a.jsxs("div",{className:"plansheet__head",children:[a.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:a.jsx(Oy,{})}),a.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),a.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(b==="preview"?" is-on":""),role:"tab","aria-selected":b==="preview",onClick:()=>y("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(b==="source"?" is-on":""),role:"tab","aria-selected":b==="source",onClick:()=>y("source"),children:"Код"})]}),a.jsx(am,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[n.reason&&a.jsx("p",{className:"plansheet__reason",children:n.reason}),a.jsx("div",{className:"plansheet__content",children:b==="preview"?a.jsx(rk,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:S=>g(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(n.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function rk({text:n}){const[l,r]=x.useState("");return x.useEffect(()=>{let c=!1;return Sf(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function Oy(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),a.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function ck({kind:n,toolName:l,queued:r,onExpand:c}){const o=n==="question"?"Уточняющий вопрос":n==="plan"?"План на согласование":`Разрешить действие: ${l}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${n}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:n==="question"?"?":n==="plan"?a.jsx(Oy,{}):"!"}),a.jsxs("span",{className:"decision-bar__text",children:[a.jsx("span",{className:"decision-bar__title",children:o}),a.jsxs("span",{className:"decision-bar__sub",children:["ждёт вашего решения",r>0&&` — ещё ${r} в очереди`]})]}),a.jsxs("span",{className:"decision-bar__action",children:["Развернуть",a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 10 4-4 4 4"})})]})]})}function am({onClick:n}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:n,title:"Свернуть — агент продолжит ждать","aria-label":"Свернуть",children:[a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 6 4 4 4-4"})}),a.jsx("span",{className:"decision-collapse__label",children:"Свернуть"})]})}function ok({request:n,queued:l,collapsed:r,onCollapse:c,onDecide:o}){const d=Ay(n.toolName,n.input);return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Запрос разрешения",children:[a.jsxs("div",{className:"sheet__head",children:[a.jsxs("span",{className:"sheet__head-text",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),a.jsx(am,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:n.toolName}),n.reason&&a.jsx("p",{className:"sheet__reason",children:n.reason}),d?a.jsx(sm,{diff:d}):a.jsx("pre",{className:"code",children:JSON.stringify(n.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(n.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(n.requestId,"allow"),children:"Разрешить"})]})]})})}function uk({request:n,queued:l,collapsed:r,onCollapse:c,onAnswer:o,onDecline:d}){const{questions:h}=n,[m,g]=x.useState(()=>h.map(()=>new Set)),[b,y]=x.useState(()=>h.map(()=>"")),[j,v]=x.useState(()=>c_(h));x.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(c_(h))},[n.requestId]);const S=x.useMemo(()=>fk(h,m,b),[h,m,b]),k=S!==null;function C(Y,M){var z,R;(R=(z=h[Y])==null?void 0:z.options[M])!=null&&R.preview&&v(Z=>{const re=Z.slice();return re[Y]=M,re})}function A(Y,M,z){g(R=>{const Z=R.slice(),re=new Set(Z[Y]);return z?re.has(M)?re.delete(M):re.add(M):re.has(M)||(re.clear(),re.add(M)),Z[Y]=re,Z}),M!=="other"&&C(Y,M)}function F(Y,M){y(z=>{const R=z.slice();return R[Y]=M,R})}function Q(){S&&o(n.requestId,S)}function q(Y){Y.key==="Enter"&&(Y.target.closest("button")||k&&(Y.preventDefault(),Q()))}function B(Y){var Z;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Y.key))return;const M=Array.from(Y.currentTarget.querySelectorAll("button.qsheet__option")),z=M.indexOf(document.activeElement);if(z===-1)return;Y.preventDefault();const R=Y.key==="ArrowDown"||Y.key==="ArrowRight"?1:-1;(Z=M[(z+R+M.length)%M.length])==null||Z.focus()}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:q,children:[a.jsxs("div",{className:"qsheet__head",children:[a.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),a.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,l>0&&` — ещё ${l} в очереди`]}),a.jsx(am,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[n.reason&&a.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map((Y,M)=>a.jsx(dk,{q:Y,qi:M,selected:m[M]??new Set,otherText:b[M]??"",previewIndex:j[M]??null,onToggle:A,onFocusOption:C,onOtherText:F,onOptionsKeyDown:B},M))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(n.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:Q,children:"Ответить"})]})]})})}function dk({q:n,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var S;const b=n.options.some(k=>k.preview),y=o!==null?(S=n.options[o])==null?void 0:S.preview:void 0,j=r.has("other"),v=n.multiSelect?"checkbox":"radio";return a.jsxs("div",{className:"qsheet__question",children:[a.jsxs("div",{className:"qsheet__qhead",children:[a.jsx("span",{className:"chip chip--accent",children:n.header}),a.jsx("span",{className:"qsheet__qtext",children:n.question})]}),a.jsxs("div",{className:"qsheet__options"+(n.multiSelect?"":" qsheet__options--radio"),role:n.multiSelect?"group":"radiogroup","aria-label":n.question,onKeyDown:g,children:[n.options.map((k,C)=>{const A=r.has(C);return a.jsxs("button",{type:"button",role:v,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>d(l,C,n.multiSelect),onFocus:()=>h(l,C),onMouseEnter:()=>h(l,C),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},C)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",n.multiSelect),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),a.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:k=>m(l,k.target.value),autoFocus:!0})]})]}),b&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function c_(n){return n.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function fk(n,l,r){const c={};for(let o=0;o<n.length;o++){const d=n[o];if(!d)continue;const h=l[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 hk(n,l){if(n!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function Ly({path:n}){const[l,r]=x.useState(!1),[c,o]=x.useState(!1),d=x.useRef(null);x.useEffect(()=>{if(!l)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)},[l]),x.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),nm);return()=>clearTimeout(m)},[c]),x.useEffect(()=>r(!1),[n]);async function h(){await Ca(n)&&o(!0)}return a.jsxs("div",{ref:d,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${n}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!l||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(pk,{open:l}),a.jsx("span",{className:"cwd__short",children:n})]}),l&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:n}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?io:Zr})]})]})}function pk({open:n}){return a.jsx("svg",{className:n?"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:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const mk=["low","medium","high"];function zy({models:n,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[S,k]=x.useState(!1),[C,A]=x.useState(0),F=x.useRef(null),Q=x.useRef(null),q=n.find(R=>R.value===l)??null,B=q&&q.supportsEffort?q.effortLevels.length>0?q.effortLevels:mk:[],Y=B.includes("xhigh");x.useEffect(()=>{if(!S)return;const R=n.findIndex(Z=>Z.value===l);A(R===-1?0:R)},[S]),x.useEffect(()=>{if(!S)return;function R(Z){var re;(re=F.current)!=null&&re.contains(Z.target)||k(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[S]),x.useEffect(()=>{var R,Z;S&&((Z=(R=Q.current)==null?void 0:R.querySelector(".is-cursor"))==null||Z.scrollIntoView({block:"nearest"}))},[S,C]);function M(R){k(!1),R.value!==l&&g(R.value)}function z(R){if(R.key==="Escape"){if(!S)return;R.preventDefault(),R.stopPropagation(),k(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!S)return k(!0);if(n.length===0)return;const Z=R.key==="ArrowDown"?1:n.length-1;return A(re=>(re+Z)%n.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!S)return k(!0);const Z=n[C];Z&&M(Z)}}return a.jsxs("div",{ref:F,className:"select"+(S?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":S,onClick:()=>k(R=>!R),onKeyDown:z,children:[(q==null?void 0:q.displayName)??l?a.jsx("span",{className:"select__value",children:(q==null?void 0:q.displayName)??l}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):B.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(gk,{})]}),S&&a.jsxs("div",{ref:Q,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((R,Z)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===l,className:"select__option"+(Z===C?" is-cursor":"")+(R.value===l?" is-on":""),onMouseEnter:()=>A(Z),onClick:()=>M(R),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:R.displayName}),R.description&&a.jsx("span",{className:"select__hint",children:R.description})]},R.value)),B.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"modelmenu__sep",role:"separator"}),a.jsxs("div",{className:"modelmenu__row",children:[a.jsxs("span",{className:"modelmenu__label",children:["Усилие",a.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),a.jsx("span",{className:"modelmenu__levels",children:B.map(R=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===r,className:R===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(R),children:R},R))})]}),Y&&a.jsx(bp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),(q==null?void 0:q.supportsThinking)!==!1&&a.jsx(bp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(bp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function bp({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[a.jsxs("span",{className:"modelmenu__label",children:[n,a.jsx("span",{className:"modelmenu__desc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function gk(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function bs({title:n,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=x.useRef(null);return x.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 y=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:a.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":n,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:n}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:l}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function xk({candidates:n,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,folders:h,projectsRoot:m,created:g,onSearch:b,onAskAgent:y,onInterrupt:j,onSubmit:v,onCreate:S,onClose:k}){const[C,A]=x.useState("open"),[F,Q]=x.useState(""),[q,B]=x.useState(!1),[Y,M]=x.useState(""),[z,R]=x.useState(""),[Z,re]=x.useState(""),[G,$]=x.useState({git:!0,claudeMd:!0,readme:!0}),he=F.trim(),ve=he!=="",K=Y.trim(),O=z.trim(),I=h.find(U=>U.id===Z),oe=I!==void 0&&m!==null,pe=O!==""&&(oe||Z===""&&K!==""),je=[{value:"",label:"Без папки",hint:"каталог по указанному пути"},...h.map(U=>({value:U.id,label:U.name}))];x.useEffect(()=>{Y===""&&d.length>0&&M(d[0])},[d]);const E=x.useRef(b);E.current=b,x.useEffect(()=>{if(C!=="open")return;const U=F.trim(),ye=setTimeout(()=>E.current(U),200);return()=>clearTimeout(ye)},[F,C]);function ne(){ve&&v(he)}function X(){pe&&S(oe?m:K,O,G,oe?I.id:void 0)}function Ne(){ve&&(B(!0),y(he))}return g?a.jsxs(bs,{title:"Новый проект",onClose:k,actions:a.jsx("button",{className:"btn btn--primary",onClick:k,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:g.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:g.warnings.map(U=>a.jsx("li",{children:U},U))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(bs,{title:"Новый проект",className:q&&C==="open"?"modal--wide":void 0,onClose:k,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:k,children:"Отмена"}),C==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:j,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!ve,onClick:Ne,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!ve,onClick:ne,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!pe,onClick:X,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(o_,{label:"Открыть",on:C==="open",onClick:()=>A("open")}),a.jsx(o_,{label:"Создать",on:C==="create",onClick:()=>A("create")})]}),C==="open"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),a.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),a.jsx("input",{id:"workspace-path",className:"input input--mono",value:F,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:U=>Q(U.target.value),onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),ne())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(U=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:U.open,title:U.open?"Этот проект уже открыт":U.path,onClick:()=>Q(U.path),onDoubleClick:()=>v(U.path),children:[a.jsx("span",{className:"find__name",children:U.name}),a.jsx("span",{className:"find__path",children:U.path}),a.jsx("span",{className:"find__note",children:_k(U)})]})},U.path))}),n.length===0&&ve&&!l&&!q&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),q&&a.jsx("div",{className:"finds__agent",children:a.jsx(lm,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),h.length>0&&m!==null&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"field",children:"Папка"}),a.jsx(Al,{value:Z,options:je,ariaLabel:"Папка проектов",onChange:re})]}),oe?a.jsxs("p",{className:"account__step newproj__where",children:["Каталог появится внутри папки «",I.name,"» в корне проектов."]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),a.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Y,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:U=>M(U.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(U=>a.jsx("button",{type:"button",className:U===K?"newproj__root is-on":"newproj__root",title:U,onClick:()=>M(U),children:bk(U)},U))})]}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:U=>R(U.target.value),onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),X())}}),a.jsx("p",{className:"newproj__preview",children:pe?u_(oe?u_(m,I.name):K,O):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(_p,{label:"git init",desc:"панель истории работает сразу",on:G.git,onToggle:()=>$(U=>({...U,git:!U.git}))}),a.jsx(_p,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:G.claudeMd,onToggle:()=>$(U=>({...U,claudeMd:!U.claudeMd}))}),a.jsx(_p,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:G.readme,onToggle:()=>$(U=>({...U,readme:!U.readme}))})]})]})]})}function o_({label:n,on:l,onClick:r}){return a.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:n})}function _p({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[a.jsxs("span",{className:"newproj__optlabel",children:[n,a.jsx("span",{className:"newproj__optdesc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function u_(n,l){const r=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+r+l}function bk(n){const l=n.includes("\\")?"\\":"/",r=n.split(/[\\/]/).filter(Boolean);return r.length<=2?n:`…${l}${r.slice(-2).join(l)}`}function _k(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${yk(n.sessions)}${vk(n.lastUsedAt)}`}function yk(n){const l=n%10,r=n%100;return r>=11&&r<=14?`${n} сессий`:l===1?`${n} сессия`:l>=2&&l<=4?`${n} сессии`:`${n} сессий`}function vk(n){if(!n)return"";const l=Math.floor((Date.now()-n)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const im=7;function jk(n){const l=[],r=[];let c=1;for(const o of n){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=d_(l),l[h]=o.hash);const[m,...g]=o.parents;l[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let S=l.indexOf(v);S===-1&&(S=d_(l),l[S]=v),b.push({from:h,to:S})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const S=d[v];!S||S===o.hash||v===h||l[v]===S&&j.push(v)}Nk(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:y,down:b,through:j})}return{rows:r,columns:Math.min(c,im)}}function d_(n){const l=n.indexOf(null);return l!==-1?l:(n.push(null),n.length-1)}function Nk(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const Uy=1500;function wk(n){const l=[];let r=!1;for(const c of n.patch.split(`
|
|
120
|
-
`)){if(l.length>=Uy){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:kk(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:l,added:n.added,removed:n.removed,note:Sk(n,r)}}function kk(n){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!l)return n;const r=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Sk(n,l){const r=[];return n.status==="added"&&r.push("новый файл"),n.status==="deleted"&&r.push("файл удалён"),n.status==="renamed"&&r.push(`переименован из ${n.oldPath}`),n.binary?r.push("двоичный файл"):n.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${Uy} строк`),r.length>0?r.join(" · "):null}function Ek({open:n,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:S,zoomed:k,onToggleZoom:C}){const A=jk((l==null?void 0:l.commits)??[]),F=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(Q=>({value:Q.name,label:Q.name,hint:Q.hash.slice(0,8)}))];return a.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:Q=>{C&&(Q.target.closest("button")||C())},children:[a.jsx(Dk,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),C&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:C,children:a.jsx(_o,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:S,children:"✕"})]}),l===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Al,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:F,onChange:Q=>{Q&&m(Q,`ветку ${Q}`)}}),a.jsx(xo,{text:l.detached?l.head:l.branch,hint:l.detached?"хеш HEAD":"имя ветки"})]}),l.detached&&a.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),a.jsx("div",{className:"gitbar__actions",children:o?a.jsxs("p",{className:"gitbar__busy",children:[a.jsx(Uk,{}),o]}):l.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(Ok,{}),"Отправить",l.ahead>0&&a.jsx("span",{className:"gitbar__count",children:l.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>b(!0),children:[a.jsx(Lk,{}),"Забрать",l.behind>0&&a.jsx("span",{className:"gitbar__count",children:l.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>b(!1),children:a.jsx(zk,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),a.jsxs("div",{className:"sidepane__scroll",children:[a.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:a.jsxs("span",{className:"gitrow__body",children:[a.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${$k(l.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(Q=>Bk(Q.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(Q=>a.jsx(Ck,{row:Q,columns:A.columns,head:Q.commit.hash===l.head,local:l.hasRemote&&!Q.commit.pushed,active:c===Q.commit.hash,onOpen:()=>h(Q.commit.hash)},Q.commit.hash)),A.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Pr,{result:r,onDismiss:v})]})}const pu=50,f_=13,Tk=500;function Ck({row:n,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=n,m=h.refs.map(Ik).filter(Boolean),[g,b]=x.useState(null),y=x.useRef(null);function j(C){const A=C.touches[0];if(!A)return;const F={timer:0,x:A.clientX,y:A.clientY,fired:!1};F.timer=window.setTimeout(()=>{F.fired=!0,b({x:F.x,y:F.y})},Tk),y.current=F}function v(C){const A=y.current,F=C.touches[0];!A||!F||Math.hypot(F.clientX-A.x,F.clientY-A.y)>10&&(window.clearTimeout(A.timer),y.current=null)}function S(C){const A=y.current;A&&(window.clearTimeout(A.timer),A.fired&&C.preventDefault())}function k(){const C=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void Ca(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void Ca(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void Ca(h.subject)}],A=new Set;for(const F of h.refs){const Q=F.startsWith("tag: "),q=Hk(F);!q||A.has(q)||(A.add(q),C.push({id:`ref:${q}`,label:Q?"Копировать тег":"Копировать ветку",hint:q,onSelect:()=>void Ca(q)}))}return C}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var C;if((C=y.current)!=null&&C.fired){y.current=null;return}d()},onContextMenu:C=>{C.preventDefault(),b({x:C.clientX,y:C.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:S,onTouchCancel:S,children:[a.jsx(Ak,{row:n,columns:l,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(C=>a.jsx("span",{className:"gitrow__ref",children:C},C)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",qk(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(ar,{x:g.x,y:g.y,items:k(),onClose:()=>b(null)})]})}function Ak({row:n,columns:l,head:r,local:c}){const o=l*f_+6,d=pu/2,h=b=>8+Math.min(b,im-1)*f_,m=c?"3.5 2.5":void 0,g=Zd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:pu,viewBox:`0 0 ${o} ${pu}`,"aria-hidden":"true",children:[n.through.map(b=>a.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:pu,style:{stroke:Zd(b)}},`t${b}`)),n.up.map((b,y)=>a.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:Zd(b.from),strokeDasharray:m}},`u${y}`)),n.down.map((b,y)=>a.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${pu}`,fill:"none",style:{stroke:Zd(b.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:d,r:n.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:d,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Zd(n){return`var(--lane-${n%im})`}function Mk({detail:n,local:l,onCheckout:r,onClose:c}){const o=n.hash==="";return a.jsxs(bs,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(n.hash,`коммит ${n.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),a.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&a.jsxs("div",{className:"commit__head",children:[a.jsxs("div",{className:"commit__line",children:[a.jsx("p",{className:"commit__subject",children:n.subject}),a.jsx(xo,{text:n.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",Gk(n.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:n.hash}),a.jsx(xo,{text:n.hash,hint:"хеш коммита"})]}),l&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),n.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[n.parents.length>1?"слияние: ":"родитель: ",n.parents.map(d=>d.slice(0,8)).join(", ")]}),n.body&&a.jsx("pre",{className:"commit__body",children:n.body})]}),n.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),n.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):n.files.map(d=>a.jsx(Rk,{file:d,defaultOpen:n.files.length<=3},d.path+d.oldPath))]})}function Rk({file:n,defaultOpen:l}){const[r,c]=x.useState(l);return a.jsxs("div",{className:"commit__file",children:[a.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[a.jsx("span",{className:"commit__filepath",children:n.path||n.oldPath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]}),a.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&a.jsx(sm,{diff:wk(n)})]})}function Dk(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),a.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),a.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),a.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Ok(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function Lk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function zk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"m13 13-2.6-2.6"})]})}function h_(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a.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 Uk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Ik(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Hk(n){const l=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return l==="HEAD"?"":l}function Bk(n){const l=n.split("/");return l[l.length-1]??n}function $k(n){const l=n%100;if(l>=11&&l<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function qk(n){const l=Date.parse(n);if(Number.isNaN(l))return n;const r=Math.round((Date.now()-l)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Gk(n){const l=Date.parse(n);return Number.isNaN(l)?n:new Date(l).toLocaleString()}function p_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Yk({status:n,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:y,onClose:j}){var oe;const[v,S]=x.useState(()=>p_(c)),[k,C]=x.useState(""),[A,F]=x.useState(""),[Q,q]=x.useState(!0),[B,Y]=x.useState("Первый коммит"),[M,z]=x.useState(null),[R,Z]=x.useState("");x.useEffect(()=>{!k&&l.length>0&&C(l[0].login)},[k,l]),x.useEffect(()=>{r&&M===null&&z(new Set(r.files))},[r,M]);const re=(n==null?void 0:n.connected)===!0,G=l.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),$=x.useMemo(()=>{if(!r)return[];const pe=R.trim().toLowerCase();return pe?r.files.filter(je=>je.toLowerCase().includes(pe)):r.files},[r,R]),he=(M==null?void 0:M.size)??0,ve=re&&v.trim()!==""&&k!==""&&d===""&&(o||he>0);function K(pe){z(je=>{const E=new Set(je??[]);return E.has(pe)?E.delete(pe):E.add(pe),E})}function O(pe){z(je=>{const E=new Set(je??[]);for(const ne of $)pe?E.add(ne):E.delete(ne);return E})}function I(){if(!ve)return;const pe=(r==null?void 0:r.files)??[];b({owner:k,name:v.trim(),description:A.trim(),private:Q,include:o?[]:pe.filter(je=>M==null?void 0:M.has(je)),ignore:o?[]:pe.filter(je=>!(M!=null&&M.has(je))),message:o?"":B.trim()||"Первый коммит"})}return a.jsxs(bs,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!ve,onClick:I,children:d||"Опубликовать"})]}),children:[a.jsx(Xk,{status:n,onRefreshStatus:m,onSaveToken:g}),a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Имя"}),a.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:pe=>S(p_(pe.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),l.length>1?a.jsx(Al,{className:"settings__select",value:k,options:G,onChange:C,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((oe=l[0])==null?void 0:oe.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:pe=>F(pe.target.value)})]}),a.jsxs("div",{className:"field publish__field",children:[a.jsx("span",{children:"Видимость"}),a.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[a.jsx(m_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:Q,onClick:()=>q(!0)}),a.jsx(m_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!Q,onClick:()=>q(!1)})]})]})]}),!o&&a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?a.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"publish__filehead",children:[a.jsxs("span",{className:"publish__filecount",children:[he," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>O(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>O(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:R,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>Z(pe.target.value)}),a.jsx("div",{className:"publish__filelist",children:$.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):$.map(pe=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(pe))===!0,className:"publish__file",onClick:()=>K(pe),children:[a.jsx("span",{className:"publish__box"+(M!=null&&M.has(pe)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(pe))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),r.truncated&&a.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Сообщение коммита"}),a.jsx("input",{className:"input",value:B,onChange:pe=>Y(pe.target.value)})]})]})]}),a.jsx(Pr,{result:h,onDismiss:y})]})}function m_({title:n,desc:l,on:r,risky:c,onClick:o}){return a.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[n,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:l})]})]})}function Xk({status:n,onRefreshStatus:l,onSaveToken:r}){const[c,o]=x.useState(""),[d,h]=x.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),n===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):n.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:n.login}),a.jsx("span",{className:"publish__accountvia",children:n.source==="gh"?"через GitHub CLI":"по личному токену"}),n.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[n.ghInstalled&&a.jsxs("p",{className:"modal__text",children:["В системе установлен ",a.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",a.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Личный токен GitHub"}),a.jsx(Vk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),a.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",a.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",a.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),n.message&&a.jsx("p",{className:"modal__error",children:n.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Vk({value:n,onChange:l,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(Kk,{}):a.jsx(Qk,{})})]})}function Qk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function Kk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),a.jsx("path",{d:"M2 14 14 2"})]})}function Fk({busy:n,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=x.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return a.jsxs(bs,{title:"Подключить существующий репозиторий",onClose:o,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||n!=="",onClick:()=>r(d.trim()),children:n||"Подключить"})]}),children:[a.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",a.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Адрес репозитория"}),a.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&&n===""&&r(d.trim())}})]}),a.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",a.jsx("code",{children:"https://…"}),", ",a.jsx("code",{children:"ssh://…"}),", ",a.jsx("code",{children:"git://…"})," и"," ",a.jsx("code",{children:"git@host:path"}),"."]}),a.jsx(Pr,{result:l,onDismiss:c})]})}function Zk({open:n,items:l,busy:r,ready:c,sendBlocked:o,commands:d,contextResult:h,draftKey:m,models:g,model:b,effort:y,ultracode:j,thinking:v,switchOnFlag:S,onContextSearch:k,onCommand:C,onModel:A,onEffort:F,onUltracode:Q,onThinking:q,onSwitchOnFlag:B,onAsk:Y,onInterrupt:M,onReset:z,onClose:R,zoomed:Z,onToggleZoom:re}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(Z?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:G=>{re&&(G.target.closest("button")||re())},children:[a.jsx(Jk,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:z,children:"↻"}),re&&a.jsx("button",{className:"sidepane__btn",title:Z?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Z?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":Z,onClick:re,children:a.jsx(_o,{active:Z})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:R,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(zy,{className:"select--compact",models:g,value:b,effort:y,ultracode:j,thinking:v,switchOnFlag:S,onModel:A,onEffort:F,onUltracode:Q,onThinking:q,onSwitchOnFlag:B}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(lm,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Ry,{className:"composer--side",disabled:!c,busy:r,commands:d,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:C,onSend:Y,onInterrupt:M,onEscape:r?M:R})]})}function Jk(){return a.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:[a.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"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const Wk=75,Pk=90;function rm({usage:n,variant:l="topbar"}){if(!(n!=null&&n.available))return null;const r=n.buckets??[],c=r.length>0?r.map(d=>({key:d.id,label:d.label,window:d.window})):[...n.fiveHour?[{key:"five",label:"5 ч",window:n.fiveHour}]:[],...n.sevenDay?[{key:"week",label:"нед",window:n.sevenDay}]:[]];if(c.length===0)return null;const o=r.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return a.jsx("div",{className:l==="card"?"usage usage--card":"usage",title:nS(n,r),role:"group","aria-label":o,children:c.map(d=>a.jsx(eS,{label:d.label,window:d.window},d.key))})}function eS({label:n,window:l}){const r=Math.round(l.utilization),c=lS(l.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:n}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":n,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${tS(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:cm(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function tS(n){return n>=Pk?" usage__fill--over":n>=Wk?" usage__fill--warn":""}function nS(n,l){if(l.length>0)return sS(l);const r=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=cm(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),r.join(`
|
|
121
|
-
`)}function sS(n){const l=["Квота Antigravity"];for(const r of n){const c=cm(r.window.resetsAt),o=Math.round(r.window.utilization);l.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&l.push(r.description)}return l.join(`
|
|
122
|
-
`)}function Iy(n){if(!n)return null;const l=new Date(n);return Number.isNaN(l.getTime())?null:l}function Hy(n){return n.getTime()-Date.now()<1440*60*1e3}function lS(n){const l=Iy(n);return l?Hy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function cm(n){const l=Iy(n);return l?`обнулится ${Hy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function By(){const[n,l]=x.useState(()=>new Date);return x.useEffect(()=>{let r=0;const c=()=>{const d=new Date;l(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),a.jsxs("time",{className:"clock",dateTime:n.toISOString(),title:aS(n),children:[a.jsx("span",{className:"clock__time",children:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:n.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function aS(n){return n.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function iS({onClose:n,permission:l,model:r,account:c,usage:o,cwd:d,costLabel:h,onRefresh:m,refreshing:g,metersFetchedAt:b,onRename:y,onHandoff:j,onFreshSession:v,handoffWriting:S,handoffAccount:k,onStop:C}){const A=Z_({onLongPress:()=>v==null?void 0:v(),onClick:()=>j==null?void 0:j(),disabled:S});return a.jsx(bs,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:n,children:a.jsxs("div",{className:"sessionmenu",children:[l&&a.jsx(Hr,{label:"Режим прав",children:l}),a.jsx(Hr,{label:"Модель",children:r}),c&&a.jsx(Hr,{label:"Аккаунт",children:c}),(o==null?void 0:o.available)&&(o.fiveHour||o.sevenDay||o.buckets&&o.buckets.length>0)&&a.jsx(Hr,{label:"Лимиты плана",children:a.jsx(rm,{usage:o})}),a.jsxs("button",{type:"button",className:g?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":g,disabled:g,onClick:m,children:[a.jsx(rS,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",b&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(b).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(Hr,{label:"Время",children:a.jsx(By,{})}),h&&a.jsx(Hr,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:h})}),d&&a.jsx(Hr,{label:"Каталог проекта",children:a.jsx(Ly,{path:d})}),y&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:y,children:"Переименовать сессию"}),j&&a.jsxs("button",{type:"button",className:S?"sessionmenu__handoff is-busy":A.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${A.thresholdMs}ms`},"aria-busy":S,disabled:S,...A.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[S?"Пишется хэндофф…":"Хэндофф и новая сессия",!S&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),j&&k,C&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function Hr({label:n,children:l}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:n}),l]})}function rS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function cS({tab:n,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,auth:h,remote:m,actions:g,onTab:b,onClose:y}){const j=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(bs,{title:"Расширения",className:"modal--wide",onClose:y,children:[a.jsx("div",{className:"tabs",role:"tablist",children:j.map(v=>a.jsxs("button",{role:"tab","aria-selected":n===v.id,className:n===v.id?"tabs__tab is-on":"tabs__tab",onClick:()=>b(v.id),children:[v.label,a.jsx("span",{className:"tabs__count",children:v.count})]},v.id))}),n==="mcp"&&a.jsx(oS,{servers:l,auth:h,remote:m,actions:g}),n==="plugins"&&a.jsx(mS,{plugins:r,marketplaces:c,actions:g}),n==="catalog"&&a.jsx(gS,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>b("plugins")}),a.jsx(Pr,{result:d})]})}function oS({servers:n,auth:l,remote:r,actions:c}){const[o,d]=x.useState(!1);return a.jsxs(a.Fragment,{children:[n.length===0&&!o&&a.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",a.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",a.jsx("code",{children:"claude mcp list"}),"."]}),a.jsx("ul",{className:"extlist",children:n.map(h=>{const m=(l==null?void 0:l.name)===h.name?l:null,g=m!==null&&m.active&&m.url==="",b=m!==null&&m.active&&m.url!=="";return a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:h.name}),a.jsx("span",{className:`chip chip--${fS(h.status)}`,children:dS[h.status]}),h.scope&&a.jsx("span",{className:"chip",children:h.scope}),h.transport&&a.jsx("span",{className:"chip",children:h.transport})]}),h.target&&a.jsx("div",{className:"extlist__meta",title:h.target,children:h.target}),h.error&&a.jsx("div",{className:"extlist__error",children:h.error}),h.tools.length>0&&a.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",h.tools.length," · ",h.tools.slice(0,6).join(", "),h.tools.length>6&&"…"]}),a.jsxs("div",{className:"extlist__actions",children:[h.status==="needs-auth"&&a.jsx("button",{className:b?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":b?"Начать заново":"Авторизовать"}),a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"reconnect"),children:"Переподключить"}),h.status==="disabled"?a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"enable"),children:"Включить"}):a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"disable"),children:"Выключить"}),h.editable&&a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>c.mcpRemove(h.name),children:"Удалить"})]}),m&&a.jsx(uS,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(hS,{onCancel:()=>d(!1),onSubmit:(h,m)=>{c.mcpAdd(h,m),d(!1)}}):a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn btn--primary",onClick:()=>d(!0),children:"+ Сервер"})})]})}function uS({auth:n,remote:l,actions:r}){const[c,o]=x.useState("");function d(){const g=c.trim();g!==""&&(r.mcpAuthCallback(n.name,g),o(""))}if(!n.active)return n.error?a.jsx("div",{className:"extlist__error",children:n.error}):n.done?a.jsxs("div",{className:"extauth extauth--done",role:"status",children:[a.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=a.jsxs("div",{className:"extauth__paste",children:[l&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${n.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${n.name}`,"aria-label":"Адрес из строки браузера после входа",className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off",placeholder:"http://localhost:…/callback?code=…",onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),d())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:d,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:l?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=n.callbackExpected&&(l?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[n.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!l&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,n.error&&a.jsx("div",{className:"extlist__error",children:n.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const dS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function fS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function hS({onSubmit:n,onCancel:l}){const[r,c]=x.useState(""),[o,d]=x.useState("stdio"),[h,m]=x.useState(""),[g,b]=x.useState(""),[y,j]=x.useState(""),v=o==="stdio",S=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function k(){if(S)if(v){const[C,...A]=pS(h);n(r.trim(),{transport:"stdio",command:C??"",args:A,env:g_(y)})}else n(r.trim(),{transport:o,url:g.trim(),headers:g_(y)})}return a.jsxs("div",{className:"extform extform--card",children:[a.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),a.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)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Al,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:C=>d(C)}),v?a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),a.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)})]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),a.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)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),a.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:C=>j(C.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:k,children:"Подключить"})]})]})}function g_(n){const l={};for(const r of n.split(`
|
|
123
|
-
`)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function pS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function mS({plugins:n,marketplaces:l,actions:r}){const[c,o]=x.useState("");return a.jsxs(a.Fragment,{children:[n.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:n.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:d.name}),a.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&a.jsx("span",{className:"chip",children:d.version}),d.scope&&a.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&a.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:l.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&a.jsx("div",{className:"extlist__meta",children:d.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),a.jsxs("div",{className:"extform__row",children:[a.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(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const mu=30;function gS({catalog:n,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=x.useState(""),[h,m]=x.useState(""),[g,b]=x.useState(mu),[y,j]=x.useState(""),v=x.useMemo(()=>[...new Set(n.map(C=>C.category).filter(Boolean))].sort(),[n]),S=x.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(C=>h&&C.category!==h?!1:k?`${C.name} ${C.displayName} ${C.description} ${C.author}`.toLowerCase().includes(k):!0)},[n,o,h]);return n.length===0?a.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),b(mu)}}),a.jsx(Al,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{m(k),b(mu)}})]}),S.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:S.slice(0,g).map(k=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&a.jsx("span",{className:"chip",children:k.version}),k.category&&a.jsx("span",{className:"chip",children:k.category})]}),k.description&&a.jsx("div",{className:"catalog__desc",children:k.description}),a.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>r.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),S.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>b(k=>k+mu),children:["Ещё ",Math.min(mu,S.length-g)," из ",S.length-g]})}),a.jsxs("div",{className:"extform",children:[a.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:"plugin-spec",className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||y.trim()===""||(k.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function xS({accounts:n,auth:l,logins:r,candidates:c,usage:o,actions:d,activeAccountId:h,error:m,onReconnect:g,reconnectBlocked:b,reconnectHint:y,onOpenLogin:j,onClose:v}){const S=n.length>1,[k,C]=x.useState(!1),A=n.find($=>$.main)??n[0],F=x.useRef(n.length);x.useEffect(()=>{n.length>F.current&&C(!1),F.current=n.length},[n.length]);const Q=n.map($=>`${$.id}:${$.dir}`).join("|"),q=x.useRef(d.discover);q.current=d.discover,x.useEffect(()=>{q.current()},[Q]);const B=x.useRef(d.requestUsage);B.current=d.requestUsage;const[Y,M]=x.useState(!1);x.useEffect(()=>{B.current();const $=window.setInterval(()=>B.current(),9e4),he=window.setTimeout(()=>M(!0),25e3);return()=>{window.clearInterval($),window.clearTimeout(he)}},[]);const[z,R]=x.useState(null),Z=z!==null&&Object.values(o).some($=>$!=null&&$.fetchedAt>=z),re=z!==null&&!Z;x.useEffect(()=>{if(z===null)return;if(Z){R(null);return}const $=window.setTimeout(()=>R(null),25e3);return()=>window.clearTimeout($)},[z,Z]);const G=(c??[]).filter($=>$.accountId===null&&!n.some(he=>he.dir===$.configDir));return a.jsxs(bs,{title:S?"Аккаунты":"Аккаунт",className:"modal--accounts",onClose:v,children:[a.jsxs("div",{className:"acctlimits",children:[a.jsx("span",{className:"acctlimits__title",children:"Лимиты плана"}),a.jsxs("button",{type:"button",className:re?"btn btn--ghost btn--sm acctlimits__btn is-busy":"btn btn--ghost btn--sm acctlimits__btn","aria-label":"Обновить лимиты","aria-busy":re,disabled:re,onClick:()=>{R(Date.now()),d.requestUsage()},children:[a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]}),a.jsx("span",{"aria-live":"polite",children:re?"Обновляем…":"Обновить"})]})]}),n.map($=>{var he;return a.jsx(SS,{account:$,multi:S,status:l[$.id]??null,usage:o[$.id],usageSettled:Y,main:A,loginActive:((he=r[$.id])==null?void 0:he.active)===!0,actions:d,takenColors:n.filter(ve=>ve.id!==$.id).map(ve=>ve.color),onReconnect:$.id===h?g:null,reconnectBlocked:b,reconnectHint:y,onOpenLogin:()=>j($.id)},$.id)}),m&&a.jsx("p",{className:"account__warn",role:"alert",children:m}),G.length>0&&A&&a.jsx(yS,{found:G,accounts:n,main:A,onConnect:($,he,ve,K)=>d.add(he,ve,$.configDir,K),onMakeMain:$=>d.update(A.id,{configDir:$.configDir})}),k?a.jsx(CS,{accounts:n,onAdd:d.add,onCancel:()=>C(!1)}):a.jsx("button",{type:"button",className:"btn account__add",onClick:()=>C(!0),children:"+ Добавить аккаунт"})]})}function bS(n){const l=n.split(/[\\/]+/).filter(Boolean),r=l[l.length-1];return r&&(/^(users|home)$/i.test(l[0]??"")||/^(users|home)$/i.test(l[1]??""))&&l.length<=4?`~/${r}`:n}function _S(n){const l=n.split(/[\\/]+/).filter(Boolean);return(l[l.length-1]??"").replace(/^\.+/,"").slice(0,Tf)}function yS({found:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){return a.jsxs("section",{className:"found","aria-labelledby":"found-title",children:[a.jsx("h3",{className:"found__title",id:"found-title",children:"Найдено на этом компьютере"}),a.jsx("p",{className:"account__step found__lead",children:"Здесь уже есть вход Claude Code. Ничего не копируется: аккаунт просто указывает на эту папку, а вход остаётся у Claude Code."}),a.jsx("ul",{className:"found__list",children:n.map(d=>a.jsx(vS,{candidate:d,accounts:l,main:r,onConnect:c,onMakeMain:o},d.configDir))})]})}function vS({candidate:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){const[d,h]=x.useState(!1),[m,g]=x.useState(!1),[b,y]=x.useState(()=>_S(n.configDir)),[j,v]=x.useState(!0),S=b.trim(),k=l.some(q=>q.name.toLowerCase()===S.toLowerCase()),C=mi.find(q=>!l.some(B=>B.color===q))??mi[1],A=`found-${n.configDir.replace(/[^a-z0-9]/gi,"-")}`,F=r.liveSessions>0;function Q(q){q.preventDefault(),S!==""&&c(n,S,C,j)}return a.jsxs("li",{className:"found__row",children:[a.jsxs("div",{className:"found__id",children:[a.jsx("span",{className:"found__email",children:n.email||"Вход выполнен"}),n.plan&&a.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&a.jsx("div",{className:"extlist__meta",children:n.organization}),a.jsx("div",{className:"acctcard__dir found__dir",title:n.configDir,children:bS(n.configDir)}),d?a.jsxs("form",{className:"found__form",onSubmit:Q,children:[a.jsx("label",{className:"field",htmlFor:`${A}-name`,children:"Название аккаунта"}),a.jsx("input",{id:`${A}-name`,className:"input",value:b,maxLength:Tf,autoFocus:!0,autoComplete:"off","aria-describedby":k?`${A}-taken`:void 0,onChange:q=>y(q.target.value)}),k&&a.jsx("p",{className:"account__note",id:`${A}-taken`,children:"Такое имя уже есть — хост откажет. Выберите другое."}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:j,onChange:q=>v(q.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsx("span",{className:"account__step acctform__checkhint",children:"Что именно делится, задаётся в Настройках. Файлы, которые уже лежат в подключаемой папке, не перезаписываются. Если часть настроек и данных плагинов включена в общие, они станут общими с другими аккаунтами."})]})]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>h(!1),children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:S==="",children:"Подключить"})]})]}):a.jsxs("div",{className:"found__actions",children:[a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",onClick:()=>h(!0),children:"Подключить"}),a.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm found__more","aria-expanded":m,"aria-controls":`${A}-more`,onClick:()=>g(q=>!q),children:["Ещё",a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:m?"is-open":"",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),m&&!d&&a.jsxs("div",{className:"found__menu",id:`${A}-more`,children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:F,onClick:()=>o(n),children:"Сделать основным"}),a.jsx("span",{className:"account__note found__why",children:F?`Сначала закройте сессии основного аккаунта (${r.liveSessions}).`:`Основной аккаунт «${r.name}» будет брать вход из этой папки.`})]})]})}const jS="Вход выполняется в Настройках → Вход и выход Claude Code.",NS=120*1e3;function wS(n){const l=Math.max(1,Math.round((Date.now()-n)/6e4));if(l<60)return`${l} мин назад`;const r=Math.round(l/60);return r<48?`${r} ч назад`:`${Math.round(r/24)} дн. назад`}function kS({usage:n,settled:l}){if(!n)return a.jsx("p",{className:"account__note usage__state","aria-live":"polite",children:l?"Лимиты не получены — попробуем снова при следующем обновлении.":"Загружаем лимиты…"});if(!n.available)return a.jsx("p",{className:"account__note usage__state",children:"Лимиты недоступны: у этого способа входа нет окон плана."});const r=Date.now()-n.fetchedAt>NS;return a.jsxs("div",{className:"acctusage",children:[a.jsx(rm,{usage:n,variant:"card"}),r&&a.jsxs("p",{className:"account__step acctusage__age",children:["Показания от ",wS(n.fetchedAt)]})]})}function SS({account:n,multi:l,status:r,usage:c,usageSettled:o,main:d,loginActive:h,actions:m,takenColors:g,onReconnect:b,reconnectBlocked:y,reconnectHint:j,onOpenLogin:v}){const[S,k]=x.useState(!1),C=n.id,A=b!==null&&(r==null?void 0:r.loggedIn)===!0,F=!l,Q=!S&&a.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>k(!0),"aria-label":l?`Изменить аккаунт «${n.name}»`:"Изменить каталог аккаунта",children:l?"Изменить":"Изменить каталог"});return a.jsxs("section",{className:`acctcard acct--${n.color}${F?" acctcard--single":""}`,"aria-label":l?`Аккаунт «${n.name}»`:void 0,children:[l&&a.jsxs("header",{className:"acctcard__head",children:[a.jsx(Aa,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),Q]}),S?a.jsx(TS,{account:n,multi:l,main:d,takenColors:g,onSave:q=>{m.update(C,q),k(!1)},onMakeMain:()=>{m.makeMain(C),k(!1)},onRemove:()=>m.remove(C),onCancel:()=>k(!1)}):r===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):r.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:r.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:ES[r.method]??r.method}),r.plan&&a.jsx("span",{className:"chip",children:r.plan})]}),r.organization&&a.jsx("div",{className:"extlist__meta",children:r.organization}),a.jsx(kS,{usage:c,settled:o})]}):a.jsxs("div",{className:"account__signedout",children:[a.jsx("p",{className:"modal__text",children:l?"Вход не выполнен. Сессии этого аккаунта не запустятся, пока вы в него не войдёте.":"Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён."}),a.jsx("p",{className:"account__note",children:h?"Вход идёт — продолжите в Настройках.":jS}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:v,children:h?"Продолжить вход":"Открыть вход в Настройках"})]}),!S&&n.dir!==""&&a.jsxs("div",{className:"acctdir",children:[a.jsx("div",{className:"acctcard__dir",title:"Каталог конфигурации: вход, тариф, лимиты и транскрипты этого аккаунта",children:n.dir}),n.main&&n.configDir===null&&a.jsx("span",{className:"account__step",children:"унаследован из окружения"}),F&&a.jsx("div",{className:"acctdir__edit",children:Q})]}),A&&!S&&a.jsxs(a.Fragment,{children:[y&&a.jsx("p",{className:"account__note",children:j}),a.jsx("div",{className:"extbar account__bar",children:a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
124
|
-
${j}`,"aria-label":"Переподключить сессию",disabled:y,onClick:b??void 0,children:[a.jsx(AS,{}),"Переподключить"]})})]})]})}const ES={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function $y({value:n,taken:l,onChange:r}){function c(o){const d=o.key==="ArrowRight"||o.key==="ArrowDown"?1:o.key==="ArrowLeft"||o.key==="ArrowUp"?-1:0;if(d===0)return;o.preventDefault();const h=mi.indexOf(n),m=mi[(h+d+mi.length)%mi.length];if(m){r(m);const g=o.currentTarget;window.requestAnimationFrame(()=>{var b;return(b=g.querySelector(`[data-color="${m}"]`))==null?void 0:b.focus()})}}return a.jsx("div",{className:"colorpick",role:"radiogroup","aria-label":"Цвет аккаунта",onKeyDown:c,children:mi.map(o=>{const d=o===n;return a.jsx("button",{type:"button",role:"radio","aria-checked":d,"aria-label":tf[o],title:l.includes(o)?`${tf[o]} — уже у другого аккаунта`:tf[o],"data-color":o,tabIndex:d?0:-1,className:`colorpick__item acct--${o}${d?" is-selected":""}`,onClick:()=>r(o),children:d&&a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.6 6.3 5 8.6l4.4-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})},o)})})}const Tf=40;function TS({account:n,multi:l,main:r,takenColors:c,onSave:o,onMakeMain:d,onRemove:h,onCancel:m}){const[g,b]=x.useState(n.name),[y,j]=x.useState(n.color),[v,S]=x.useState(n.dir),[k,C]=x.useState(!1),[A,F]=x.useState(!1),Q=g.trim(),q=v.trim(),B=q!==""&&q!==n.dir,Y=Q!==n.name||y!==n.color||B,M=n.liveSessions,z=M>0,R=`acct-edit-${n.id}`,Z=!n.main&&r!==void 0,re=M>0||((r==null?void 0:r.liveSessions)??0)>0,G=!n.main;function $(he){he.preventDefault(),!(l&&Q===""||!Y)&&o({...Q!==n.name?{name:Q}:{},...y!==n.color?{color:y}:{},...B?{configDir:q}:{}})}return a.jsxs("div",{className:"acctform",children:[a.jsxs("form",{className:"extform acctform__fields",onSubmit:$,children:[l&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:`${R}-name`,children:"Имя"}),a.jsx("input",{id:`${R}-name`,className:"input",value:g,maxLength:Tf,autoFocus:!0,autoComplete:"off",onChange:he=>b(he.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx($y,{value:y,taken:c,onChange:j})]}),a.jsx("label",{className:"field",htmlFor:`${R}-dir`,children:"Каталог конфигурации"}),a.jsx("input",{id:`${R}-dir`,className:"input input--mono",value:v,disabled:z,spellCheck:!1,autoComplete:"off",autoFocus:!l,placeholder:"~/.claude","aria-describedby":`${R}-dirnote`,onChange:he=>S(he.target.value)}),a.jsx("p",{className:"account__step acctform__note",id:`${R}-dirnote`,children:z?`Каталог нельзя менять, пока у аккаунта есть живые сессии (${M}) — сначала закройте их.`:"Здесь лежат вход, тариф и история аккаунта. Файлы не переносятся: аккаунт начнёт брать вход из новой папки."}),n.main&&n.configDir!==null&&a.jsx("button",{type:"button",className:"btn btn--sm acctform__inherit",disabled:z,onClick:()=>o({configDir:null}),children:"Вернуть унаследованный"}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:m,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:l&&Q===""||!Y,children:"Сохранить"})]})]}),Z&&a.jsxs("div",{className:"acctform__zone",children:[a.jsx("h4",{className:"acctform__zonetitle",children:"Основной аккаунт"}),a.jsx("p",{className:"account__note",children:`Аккаунты поменяются местами: «Основной» станет «${n.name}» и наоборот — каталог, имя и цвет. Файлы не переносятся.`}),re?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:!0,children:"Сделать основным"}),a.jsx("p",{className:"account__note acctform__why",children:M>0&&((r==null?void 0:r.liveSessions)??0)>0?`Сначала закройте сессии обоих аккаунтов: этого (${M}) и основного (${r==null?void 0:r.liveSessions}).`:M>0?`Сначала закройте сессии этого аккаунта (${M}).`:`Сначала закройте сессии основного аккаунта (${r==null?void 0:r.liveSessions}).`})]}):k?a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>C(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",autoFocus:!0,onClick:d,children:"Поменять местами"})]}):a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>C(!0),children:"Сделать основным"})]}),G&&a.jsxs("div",{className:"acctform__zone",children:[a.jsx("h4",{className:"acctform__zonetitle",children:"Убрать аккаунт"}),M>0?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",disabled:!0,children:"Убрать из списка"}),a.jsx("p",{className:"account__note acctform__why",children:`Сначала закройте сессии этого аккаунта (${M}).`})]}):A?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"account__note",role:"alert",children:`Убрать аккаунт «${n.name}» из списка? Его каталог ${n.dir} останется на диске, вход в нём сохранится.`}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>F(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:h,children:"Убрать из списка"})]})]}):a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",onClick:()=>F(!0),children:"Убрать из списка"})]})]})}function CS({accounts:n,onAdd:l,onCancel:r}){const c=n.map(k=>k.color),[o,d]=x.useState(""),[h,m]=x.useState(()=>mi.find(k=>!c.includes(k))??mi[1]),[g,b]=x.useState(""),[y,j]=x.useState(!0),v=o.trim();function S(k){k.preventDefault(),v!==""&&l(v,h,g.trim()===""?null:g.trim(),y)}return a.jsxs("form",{className:"extform extform--card acctform",onSubmit:S,children:[a.jsx("label",{className:"field",htmlFor:"acct-new-name",children:"Название аккаунта"}),a.jsx("input",{id:"acct-new-name",className:"input",value:o,maxLength:Tf,placeholder:"Например, Работа",autoFocus:!0,autoComplete:"off",onChange:k=>d(k.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx($y,{value:h,taken:c,onChange:m}),a.jsxs("details",{className:"account__fallback acctform__dir",children:[a.jsx("summary",{children:"Каталог конфигурации"}),a.jsx("label",{className:"field",htmlFor:"acct-new-dir",children:"Путь к каталогу"}),a.jsx("input",{id:"acct-new-dir",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"~/.claude-ccv-…",onChange:k=>b(k.target.value)}),a.jsxs("p",{className:"account__step",children:["Если оставить пустым, хост создаст отдельный каталог ",a.jsx("code",{children:"~/.claude-ccv-…"})," сам."]})]}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:y,onChange:k=>j(k.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsxs("span",{className:"account__step acctform__checkhint",children:["Аккаунт получит ссылки на общую папку, а не копии. Что именно делится, задаётся в Настройках. Вход, лимиты, переписка и ",a.jsx("code",{children:".claude.json"})," остаются отдельными. Если в общие включены настройки и плагины, их данные (в том числе токены плагинов) станут общими с другими аккаунтами."]})]})]}),a.jsxs("p",{className:"account__step",children:[y?"Новый аккаунт начнётся с общей конфигурации из Настроек.":"Новый аккаунт начнётся с чистого листа: своя конфигурация, плагины и CLAUDE.md."," ","Если в папке ещё нет входа, войдите в него отдельно — в Настройках, в разделе «Вход и выход Claude Code»."]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:r,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:v==="",children:"Добавить"})]})]})}function AS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function MS({state:n,onPair:l,onUnpair:r,onClose:c}){const[o,d]=x.useState(""),[h,m]=x.useState(""),[g,b]=x.useState(!1),y=x.useRef(null),j=(n==null?void 0:n.paired)===!0;x.useEffect(()=>{var S;j||(S=y.current)==null||S.focus()},[j]),x.useEffect(()=>{b(!1),j&&d("")},[j,n==null?void 0:n.error]);const v=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(bs,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:x_(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(n==null?void 0:n.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:n!=null&&n.connected?"dot dot--on":"dot"})," ",n!=null&&n.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(n==null?void 0:n.clients)??0," вкладок"]})]})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),a.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),a.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):a.jsxs("div",{className:"relay",children:[a.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),a.jsxs("ol",{className:"relay__steps",children:[a.jsxs("li",{children:["Откройте ",a.jsx("b",{children:x_(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:S=>{S.preventDefault(),o.trim()&&(b(!0),l(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:S=>d(S.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Как назвать этот компьютер"}),a.jsx("input",{className:"input",value:h,onChange:S=>m(S.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function x_(n){try{return new URL(n).host}catch{return n}}const RS={active:!1,url:"",awaitingCode:!1,output:"",error:null},DS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function OS({accounts:n,auth:l,logins:r,actions:c,remote:o,runningByAccount:d,focusAccountId:h}){return a.jsx("div",{className:"loginlist",children:n.map(m=>a.jsx(LS,{account:m,status:l[m.id]??null,login:r[m.id]??RS,actions:c,remote:o,running:d[m.id]??0,focused:m.id===h},m.id))})}function LS({account:n,status:l,login:r,actions:c,remote:o,running:d,focused:h}){const[m,g]=x.useState(""),[b,y]=x.useState(!1),[j,v]=x.useState(!1),S=x.useRef(null),k=n.id;x.useEffect(()=>{var q;h&&((q=S.current)==null||q.scrollIntoView({block:"nearest"}))},[h]);const C=x.useMemo(()=>{if(r.error)return{ok:!1,message:r.error};const q=r.output.trim();return q===""?null:{ok:!0,message:q}},[r.error,r.output]);function A(q=m){const B=q.trim();B!==""&&(c.submitCode(k,B),g(""))}function F(){if(d>0){y(!1),v(!0);return}c.login(k,"claudeai",!0)}const Q=(l==null?void 0:l.loggedIn)===!0;return a.jsxs("section",{ref:S,className:`acctcard logincard acct--${n.color}${h?" is-focused":""}`,"aria-label":`Вход аккаунта «${n.name}»`,children:[a.jsxs("header",{className:"acctcard__head",children:[a.jsx(Aa,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),a.jsx("span",{className:`chip ${l===null?"chip--mute":Q?"chip--ok":"chip--warn"}`,children:l===null?"проверяем":Q?"вошёл":"не вошёл"})]}),Q&&a.jsx("div",{className:"logincard__who",children:[l.email||"Вход выполнен",l.plan,DS[l.method]??l.method].filter(Boolean).join(" · ")}),r.active?a.jsx(US,{login:r,remote:o,code:m,onCode:g,onSubmit:A,onCancel:()=>c.cancel(k),inputId:`auth-code-${k}`}):a.jsxs(a.Fragment,{children:[a.jsx(Pr,{result:C}),(j||b)&&d>0&&a.jsx("p",{className:"account__warn",role:"alert",children:zS(d)}),a.jsx("div",{className:"extbar logincard__bar",children:Q?a.jsxs(a.Fragment,{children:[j?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>v(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--warn",autoFocus:!0,onClick:()=>{v(!1),c.login(k,"claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{type:"button",className:"btn",onClick:F,children:"Сменить аккаунт"}),b?a.jsx("button",{type:"button",className:"btn btn--danger",autoFocus:!0,onClick:()=>{y(!1),c.logout(k)},children:"Точно выйти?"}):a.jsx("button",{type:"button",className:"btn",onClick:()=>{v(!1),y(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>c.login(k,"console",!1),children:"Через Console"}),a.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>c.login(k,"claudeai",!1),children:"Войти"})]})})]})]})}function zS(n){const l=n%10,r=n%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function US({login:n,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d,inputId:h}){var C;const[m,g]=x.useState(null),b=x.useRef(""),y=x.useRef({code:r,onCode:c,onSubmit:o});y.current={code:r,onCode:c,onSubmit:o};const j=x.useCallback(async A=>{const{code:F,onCode:Q,onSubmit:q}=y.current;if(A&&F.trim()!=="")return;const B=await Lp();if(B===null){A||g("Не получилось прочитать буфер — вставьте код в поле руками.");return}const Y=B.trim();if(!b_(Y)){A||g("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(A){if(b.current===Y)return;b.current=Y}g(null),Q(Y),q(Y)},[]);x.useEffect(()=>{if(!n.awaitingCode)return;const A=()=>{document.visibilityState==="visible"&&j(!0)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},[n.awaitingCode,j]);const v=typeof((C=navigator.clipboard)==null?void 0:C.readText)=="function",S=r.trim()!==""&&!b_(r),k=m??(S?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[n.url?l?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:n.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),a.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),a.jsxs("div",{className:"account__raw",children:[a.jsx("span",{className:"account__rawurl",children:n.url}),a.jsx(xo,{text:n.url,hint:"ссылку входа"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),a.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),a.jsxs("details",{className:"account__fallback",children:[a.jsx("summary",{children:"Браузер не открылся"}),a.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),a.jsx("a",{className:"account__link",href:n.url,target:"_blank",rel:"noreferrer",children:n.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),n.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:h,children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:h,className:"input input--mono",value:r,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:A=>{g(null),c(A.target.value)},onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),o())}}),v&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void j(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),k&&a.jsx("p",{className:"account__note account__note--code",children:k})]}),n.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:n.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function b_(n){const l=n.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}const __=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],IS=[{id:"skills",label:"Скиллы",hint:"Читаются Claude Code, безопасно делить."},{id:"agents",label:"Агенты",hint:"Читаются Claude Code, безопасно делить."},{id:"commands",label:"Команды",hint:"Читаются Claude Code, безопасно делить."},{id:"hooks",label:"Хуки",hint:"Читаются Claude Code, безопасно делить."},{id:"output-styles",label:"Стили вывода",hint:"Читаются Claude Code, безопасно делить."},{id:"plugins",label:"Плагины",hint:"Вместе с данными плагинов — в них могут лежать токены."},{id:"CLAUDE.md",label:"CLAUDE.md",hint:"Общие инструкции."},{id:"settings.json",label:"settings.json",hint:"Модель, права, хуки, список плагинов: изменение в одном аккаунте сразу видно в другом. Ссылку Claude Code может заменить обычным файлом."},{id:"keybindings.json",label:"keybindings.json",hint:"Сочетания клавиш."}],HS=[{label:"Вход и токены (.credentials.json)",why:"У каждого аккаунта свой."},{label:".claude.json",why:"В нём личность вошедшего и пользовательские MCP-серверы: общий файл смешал бы аккаунты."},{label:"История сессий и лимиты",why:"У каждого аккаунта своя."}],yp="",BS=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],$S=V_.map(n=>({value:n.value,label:n.value,hint:n.hint})),Jd=3600*1e3,qS=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],no={"6h":6*Jd,"24h":24*Jd,"48h":48*Jd,"168h":168*Jd,never:0};function GS(n){return no[n]??no["48h"]}const YS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Wd=60*1e3,so={"5m":5*Wd,"10m":10*Wd,"30m":30*Wd,"60m":60*Wd,never:0};function XS(n){return so[n]??so["10m"]}function VS(n){const l=Object.entries(so).find(([,r])=>r===n);return l?l[0]:Object.keys(so).reduce((r,c)=>Math.abs(so[c]-n)<Math.abs(so[r]-n)?c:r)}function QS(n){const l=Object.entries(no).find(([,r])=>r===n);return l?l[0]:Object.keys(no).reduce((r,c)=>Math.abs(no[c]-n)<Math.abs(no[r]-n)?c:r)}const KS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],lo={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function FS(n){return lo[n]??lo.off}function y_(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function ZS(n){const l=Object.entries(lo).find(([,r])=>r===n);return l?l[0]:Object.keys(lo).reduce((r,c)=>Math.abs(lo[c]-n)<Math.abs(lo[r]-n)?c:r)}const JS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function WS({settings:n,models:l,relayState:r,networkState:c,local:o,onChange:d,onEnableShell:h,onDisableShell:m,onOpenRelay:g,claudeLogin:b,projectsRootHint:y,onClose:j}){const v=x.useRef(null),S=n===null,k=b.focusAccountId!==null;x.useEffect(()=>{var K;k&&((K=v.current)==null||K.scrollIntoView({block:"start"}))},[k]);const C=(n==null?void 0:n.projectsRoot)??"",[A,F]=x.useState(C);x.useEffect(()=>F(C),[C]);function Q(){const K=A.trim();K!==C&&d({projectsRoot:K===""?null:K})}const[q,B]=x.useState(""),[Y,M]=x.useState(null),z=!S&&n.networkGuardEnabled,R=(n==null?void 0:n.networkGuardBlockedCountries)??[];function Z(){const K=q.trim().toUpperCase();if(K!==""){if(!/^[A-Z]{2}$/.test(K)){M("Нужен код из двух латинских букв, например RU или CN.");return}if(R.includes(K)){M(`Код ${K} уже в списке.`);return}M(null),B(""),d({networkGuardBlockedCountries:[...R,K]})}}const re=!S&&n.terminalEnabled===!0,G=!S&&n.liveSessionsFirst===!0,$=!re,he=x.useMemo(()=>{const K=[{value:yp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(O=>({value:O.value,label:O.displayName,hint:O.description})):BS];return n&&n.startModel!==null&&!K.some(O=>O.value===n.startModel)&&K.push({value:n.startModel,label:n.startModel}),K},[l,n]);function ve(){var K,O;return(r==null?void 0:r.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:$,onClick:g,children:"Связать компьютер"})]}):(K=r.shell)!=null&&K.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:$,onClick:m,children:"Запретить"})]}):(O=r.shell)!=null&&O.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:$,onClick:h,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),o?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:$,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:$,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(bs,{title:"Настройки",onClose:j,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Al,{className:"settings__select",value:QS(n.autoArchiveAfterMs),options:qS,onChange:K=>d({autoArchiveAfterMs:GS(K)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Al,{className:"settings__select",value:VS(n.autoStopAfterMs),options:YS,onChange:K=>d({autoStopAfterMs:XS(K)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Корень проектов"}),a.jsx("p",{className:"settings__hint",children:"Папки проектов в боковой панели — настоящие каталоги внутри этого корня, а перенос проекта в папку переносит его каталог на диске. Пусто — корень выбирается автоматически."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx("input",{className:"input input--mono",value:A,spellCheck:!1,autoComplete:"off",placeholder:y??"Автоматически","aria-label":"Корень проектов",onChange:K=>F(K.target.value),onBlur:Q,onKeyDown:K=>{K.key==="Enter"&&(K.preventDefault(),Q())}})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),a.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:n.limitStopFiveHourPct,onChange:K=>d({limitStopFiveHourPct:y_(K.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:n.limitStopSevenDayPct,onChange:K=>d({limitStopSevenDayPct:y_(K.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),a.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":z,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:z?"switch is-on":"switch",onClick:()=>d({networkGuardEnabled:!z}),children:a.jsx("span",{className:"switch__knob"})})]}),z&&c&&a.jsx("p",{className:c.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:c.status==="blocked"?c.reason??"Маршрут не прошёл проверку.":c.country?`Сейчас: ${c.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:z?"settings__field":"settings__field settings__nested is-disabled",children:[a.jsx("span",{className:"settings__field-label",children:"Запрещённые страны"}),a.jsxs("ul",{className:"countries","aria-label":"Запрещённые страны",children:[R.map(K=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${K} из списка`,disabled:!z,onClick:()=>d({networkGuardBlockedCountries:R.filter(O=>O!==K)}),children:"×"})]},K)),R.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:K=>{K.preventDefault(),Z()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:q,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!z,"aria-label":"Код страны, две буквы","aria-invalid":Y!==null,onChange:K=>{B(K.target.value.toUpperCase()),M(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!z||q.trim()==="",children:"Добавить"})]}),Y&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:Y})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Al,{className:"settings__select",value:ZS(n.autoSaveAfterPauseMs),options:KS,onChange:K=>d({autoSaveAfterPauseMs:FS(K)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),__.map(K=>{const O=(n==null?void 0:n.enabledProviders)??["claude","antigravity"],I=!S&&O.includes(K.id),oe=I&&O.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${K.id}`,"aria-hidden":"true",children:K.id==="antigravity"?a.jsx(tm,{className:"newsession__mark-logo"}):a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),a.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[a.jsx("span",{className:"settings__field-label",children:K.label}),a.jsx("span",{className:"settings__hint",children:oe?"Хотя бы один агент должен остаться включённым":K.hint})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":I,"aria-label":K.label,disabled:oe,title:oe?"Хотя бы один агент должен остаться включённым":void 0,className:I?"switch is-on":"switch",onClick:()=>{const pe=__.map(je=>je.id).filter(je=>je===K.id?!I:O.includes(je));d({enabledProviders:pe})},children:a.jsx("span",{className:"switch__knob"})})]},K.id)})]}),a.jsxs("section",{className:"settings__section","aria-labelledby":"settings-shared-title",children:[a.jsx("h3",{className:"settings__heading",id:"settings-shared-title",children:"Общая конфигурация аккаунтов"}),a.jsx("p",{className:"settings__hint",children:"Выбор действует, когда аккаунт добавляется или подключается с включённым общим доступом. Уже существующие аккаунты не меняются, ссылки не удаляются."}),IS.map(K=>{const O=(n==null?void 0:n.sharedConfigItems)??Wx,I=!S&&O.includes(K.id);return a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("span",{className:"settings__field-label",children:K.label}),a.jsx("span",{className:"settings__hint",children:K.hint})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":I,"aria-label":K.label,className:I?"switch is-on":"switch",onClick:()=>d({sharedConfigItems:Wx.filter(oe=>oe===K.id?!I:O.includes(oe))}),children:a.jsx("span",{className:"switch__knob"})})]},K.id)}),a.jsx("h4",{className:"settings__subheading",children:"Никогда не делится"}),a.jsx("ul",{className:"settings__never",children:HS.map(K=>a.jsxs("li",{children:[a.jsx("span",{className:"settings__never-name",children:K.label}),a.jsx("span",{className:"settings__hint",children:K.why})]},K.label))})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Модель"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Al,{className:"settings__select",value:n.startModel??yp,options:he,onChange:K=>d({startModel:K===yp?null:K}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Al,{className:"settings__select",value:n.startPermissionMode,options:$S,onChange:K=>d({startPermissionMode:K}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),a.jsx("section",{className:"settings__section",children:a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),a.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":G,"aria-label":"Запущенные сессии сверху",className:G?"switch is-on":"switch",onClick:()=>d({liveSessionsFirst:!G}),children:a.jsx("span",{className:"switch__knob"})})]})}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),a.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),a.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:JS.map(K=>{const O=!S&&n.folderAccess===K.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":O,disabled:S,className:"access__card"+(O?" is-on":"")+(K.risky?" access__card--risky":""),onClick:()=>d({folderAccess:K.value}),children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[K.title,K.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:K.description})]})]},K.value)})})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Терминал"}),a.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":re,"aria-label":"Терминал",className:re?"switch is-on":"switch",onClick:()=>d({terminalEnabled:!re}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+($?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),S?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[$&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),ve()]})]})]}),a.jsxs("details",{ref:v,className:"settings__section settings__advanced",open:k||void 0,children:[a.jsxs("summary",{className:"settings__advanced-summary",children:[a.jsx("h3",{className:"settings__heading",children:"Вход и выход Claude Code (расширенное)"}),a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"settings__advanced-chev",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a.jsxs("div",{className:"settings__advanced-body",children:[a.jsxs("p",{className:"settings__hint",children:["ccv не хранит ни паролей, ни токенов. Эти кнопки запускают собственные команды Claude Code — ",a.jsx("code",{children:"claude auth login"})," и ",a.jsx("code",{children:"claude auth logout"})," — для папки выбранного аккаунта."]}),a.jsxs("ul",{className:"settings__hint settings__advanced-list",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Войти"})," — входит в эту папку: откроется ссылка в браузере, и Claude Code попросит код."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Выйти"})," — убирает вход из этой папки для всех сессий аккаунта."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Сменить аккаунт"})," — выйти и войти заново."]})]}),a.jsx(OS,{...b})]})]})]})})}const Cf="Новая сессия начнётся с нуля: на другой аккаунт переходит только текст хэндоффа, прежний разговор под ним не открыть.";function qy({targets:n,selectedId:l,sourceId:r,onSelect:c,variant:o,className:d,disabled:h}){const{auth:m}=Bp(),g=n.find(M=>M.id===l)??n[0],[b,y]=x.useState(!1),[j,v]=x.useState(0),[S,k]=x.useState({left:0,top:0}),C=x.useRef(null),A=x.useRef(null);function F(){v(Math.max(0,n.findIndex(M=>M.id===l))),y(!0)}function Q(M){var z;y(!1),M&&((z=C.current)==null||z.focus())}function q(M){c(M.id),Q(!0)}x.useLayoutEffect(()=>{if(!b)return;const M=C.current,z=A.current;if(!M||!z)return;const R=M.getBoundingClientRect(),Z=z.getBoundingClientRect(),re=8,G=Math.max(re,Math.min(R.right-Z.width,window.innerWidth-Z.width-re));let $=R.bottom+6;$+Z.height>window.innerHeight-re&&($=Math.max(re,R.top-Z.height-6)),k({left:G,top:$}),z.focus()},[b]),x.useLayoutEffect(()=>{if(!b)return;function M(z){var Z,re;const R=z.target;!((Z=A.current)!=null&&Z.contains(R))&&!((re=C.current)!=null&&re.contains(R))&&Q(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[b]);function B(M){if(M.key==="Escape")M.preventDefault(),M.stopPropagation(),Q(!0);else if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const z=M.key==="ArrowDown"?1:-1;v(R=>(R+z+n.length)%n.length)}else if(M.key==="Enter"||M.key===" "){M.preventDefault();const z=n[j];z&&q(z)}else M.key==="Tab"&&Q(!1)}if(!g)return null;const Y=`Аккаунт новой сессии: «${g.name}». Сменить`;return a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:C,type:"button",className:`${o==="split"?"splitbtn__caret":"pane-btn pane-btn--target"}${d?` ${d}`:""}`,title:Y,"aria-label":Y,"aria-haspopup":"menu","aria-expanded":b,disabled:h,onClick:()=>b?Q(!1):F(),onKeyDown:M=>{(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),F())},children:[o==="mark"&&a.jsx(Aa,{account:g,size:"sm",className:"pane-btn__mark"}),a.jsx("svg",{className:"splitbtn__icon",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),b&&a.jsxs("div",{ref:A,className:"newsession__menu targetmenu",style:{left:S.left,top:S.top},role:"menu","aria-label":"Аккаунт новой сессии",tabIndex:-1,onKeyDown:B,children:[a.jsx("p",{className:"targetmenu__note",children:Cf}),n.map((M,z)=>{const R=L_(m[M.id]);return a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M.id===l,className:"newsession__item"+(z===j?" is-cursor":""),onMouseEnter:()=>v(z),onClick:()=>q(M),children:[a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(Aa,{account:M,size:"md"})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:M.name}),R&&a.jsx("span",{className:"newsession__hint",children:R})]}),M.id===r&&a.jsx("span",{className:"newsession__tag",children:"прежняя"}),M.id===l&&a.jsx("svg",{className:"targetmenu__check",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m2.5 6.4 2.4 2.4 4.6-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]},M.id)})]})]})}function PS({targets:n,selectedId:l,onSelect:r}){return a.jsxs("div",{className:"targetchips",role:"radiogroup","aria-label":"Аккаунт новой сессии",children:[a.jsx("span",{className:"targetchips__label",children:"Новая сессия на аккаунте"}),a.jsx("div",{className:"targetchips__row",children:n.map(c=>a.jsxs("button",{type:"button",role:"radio","aria-checked":c.id===l,className:`targetchips__chip acct--${c.color}${c.id===l?" is-on":""}`,onClick:()=>r(c.id),children:[a.jsx(Aa,{account:c,size:"sm"}),a.jsx("span",{className:"targetchips__name",children:c.name})]},c.id))}),a.jsx("span",{className:"targetchips__note",children:Cf})]})}const v_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function eE(n){if(!n)return"срок неизвестен";const l=new Date(n);return Number.isNaN(l.getTime())?"срок неизвестен":l.toLocaleString()}function j_({label:n,primary:l,choice:r,onContinue:c}){const o=`btn btn--sm${l?" btn--primary":""}`,d=r==null?void 0:r.targets.find(m=>m.id===r.selectedId);if(!r||!d)return a.jsx("button",{type:"button",className:o,onClick:c,children:n});const h=d.id!==r.sourceId;return a.jsxs("span",{className:`splitbtn${l?" splitbtn--primary":""}`,children:[a.jsxs("button",{type:"button",className:`${o} splitbtn__main`,title:h?Cf:`Новая сессия на том же аккаунте «${d.name}»`,onClick:c,children:[a.jsx("span",{className:`newsession__acct acct--${d.color}`,"aria-hidden":"true"}),n," на «",d.name,"»"]}),a.jsx(qy,{variant:"split",className:o,targets:r.targets,selectedId:r.selectedId,sourceId:r.sourceId,onSelect:r.onSelect})]})}function tE({handoff:n,onContinue:l,onShow:r,onDismiss:c,sourceAccount:o=null,accountChoice:d=null}){if(n.continuedAt!==void 0){const h=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${v_[n.limit]} (${Math.round(n.utilization)} %) — работа прервана ${new Date(n.stoppedAt).toLocaleString()}`;return a.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(n.continuedAt).toLocaleString(),"."]})," ",h,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),a.jsx(j_,{label:"Продолжить ещё раз",primary:!1,choice:d,onContinue:l})]})]})}return a.jsxs("div",{className:"handoff",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[n.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(n.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Aa,{account:o,size:"sm",className:"handoff__acct"})," ",a.jsxs("strong",{className:"handoff__acctname",children:["«",o.name,"»"]}),":"," "]}),v_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",eE(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),d&&d.selectedId!==d.sourceId&&a.jsx("p",{className:"handoff__hint",children:Cf}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx(j_,{label:d?"Продолжить":"Продолжить в новой сессии",primary:!0,choice:d,onContinue:l}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function nE({handoff:n,onClose:l}){const[r,c]=x.useState("");return x.useEffect(()=>{let o=!1;return Sf(n.text).then(d=>{o||c(d)}),()=>{o=!0}},[n.text]),a.jsx(bs,{title:"Хэндофф",className:"modal--wide",onClose:l,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function sE({state:n}){return a.jsxs("div",{className:"netguard",role:"alert",children:[a.jsxs("svg",{className:"netguard__icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.8 14.2 13H1.8L8 1.8Z",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round"}),a.jsx("path",{d:"M8 6.4v3",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11.2",r:"0.8",fill:"currentColor"})]}),a.jsxs("div",{className:"netguard__copy",children:[a.jsx("strong",{className:"netguard__reason",children:n.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const vf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},lE=12e3;function aE(n){const l=n%10,r=n%100;return l===1&&r!==11?"сессии":"сессиях"}function iE({notices:n,onDismiss:l}){return n.length===0?null:a.jsx("div",{className:"limittoasts",children:n.map(r=>a.jsx(rE,{notice:r,onDismiss:()=>l(r.id)},r.id))})}function rE({notice:n,onDismiss:l}){return x.useEffect(()=>{const r=window.setTimeout(l,lE);return()=>window.clearTimeout(r)},[l]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:n.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",vf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",aE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",vf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:l,children:"✕"})]})}function cE(n,l,r=Date.now()){if(!n||!n.available||!l)return null;const c=[["fiveHour",n.fiveHour,l.limitStopFiveHourPct],["sevenDay",n.sevenDay,l.limitStopSevenDayPct]];for(const[o,d,h]of c){if(!d||h<=0||d.utilization<h)continue;const m=Date.parse(d.resetsAt);if(!(!Number.isFinite(m)||m<=r))return{limit:o,utilization:d.utilization,resetsAt:m}}return null}function oE(n,l=Date.now()){const r=new Date(n),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(l).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const uE=16;function dE({pane:n,width:l,onResize:r,onReset:c}){const o=Kr[n],d=x.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-Hv):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;r(Math.min(j.max,j.width+v))}function g(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function b(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(l+j*uE*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${n} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:b,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const fE=16;function hE({height:n,onResize:l,onReset:r}){const c=x.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const y=b.getBoundingClientRect().height-Gv;return Math.round(n+Math.max(0,y))}function d(b){b.button===0&&(c.current={y:b.clientY,height:n,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const y=c.current;if(!y)return;const j=y.y-b.clientY;l(y.height+j,y.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 y=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;y!==0&&(b.preventDefault(),l(n+y*fE,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":F_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function N_(){const n=document.documentElement,l=getComputedStyle(n),r=Q=>l.getPropertyValue(Q).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),S=r("--cm-fn"),k=r("--cm-key"),C=r("--cm-type"),A=w_(o,c,55),F=Q=>w_(Q,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:A,brightBlack:h,red:y,brightRed:F(y),green:j,brightGreen:F(j),yellow:v,brightYellow:F(v),blue:S,brightBlue:F(S),magenta:k,brightMagenta:F(k),cyan:C,brightCyan:F(C),white:d,brightWhite:o}}function pE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let va=null;function mE(n){return va||(va=document.createElement("span"),va.style.position="fixed",va.style.width="0",va.style.height="0",va.style.opacity="0",va.style.pointerEvents="none",document.body.appendChild(va)),va.style.color=n,getComputedStyle(va).color}function w_(n,l,r){return mE(`color-mix(in srgb, ${n} ${100-r}%, ${l} ${r}%)`)}let Pd=null;function gE(){return Pd||(Pd=Promise.all([st(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),st(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),st(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),st(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,l,r])=>({Terminal:n.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(n=>{throw Pd=null,n})),Pd}function xE({terminals:n,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:y,onOpen:j,onClose:v,onInput:S,onResize:k,onAttach:C,onHide:A,registerSink:F}){const[Q,q]=x.useState(()=>N_());return x.useEffect(()=>{const B=new MutationObserver(()=>q(N_()));return B.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>B.disconnect()},[]),a.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:[a.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:B=>{b&&(B.target.closest("button")||b())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(B=>a.jsxs("div",{role:"tab","aria-selected":B.id===l,className:"termtab"+(B.id===l?" is-on":"")+(B.exitCode!==null?" termtab--exited":""),onDoubleClick:Y=>{b&&(Y.target.closest(".termtab__close")||b())},children:[a.jsx("button",{className:"termtab__name",title:B.cwd,onClick:()=>y(B.id),children:B.title}),B.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${B.exitCode}`,children:B.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${B.title}»`,onClick:()=>v(B.id),children:"✕"})]},B.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),b&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:a.jsx(_o,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&n.length>0&&a.jsx(k_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?a.jsx(k_,{message:c,onRetry:r?null:j,onDismiss:o}):r?a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминал с удалённых устройств выключен"}),a.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):n.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),n.map(B=>a.jsx(_E,{id:B.id,exitCode:B.exitCode,active:B.id===l,theme:Q,mobile:m,onInput:S,onResize:k,onAttach:C,registerSink:F},B.id))]})]})}function k_({message:n,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=bE(n);return a.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),d&&a.jsx("p",{className:"termfail__hint",children:d}),h&&a.jsxs("details",{className:"termfail__details",children:[a.jsx("summary",{children:"Подробности"}),a.jsx("pre",{children:h})]})]}),a.jsxs("div",{className:"termfail__bar",children:[r&&a.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),a.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function bE(n){const[l="",...r]=n.trim().split(`
|
|
125
|
-
|
|
126
|
-
`),c=l.split(`
|
|
127
|
-
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
128
|
-
|
|
129
|
-
`).trim()}}function _E({id:n,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=x.useRef(null),y=x.useRef(null),j=x.useRef(!1),v=x.useRef(o);v.current=o;const S=x.useRef(c),k=x.useRef(l),[C,A]=x.useState("loading"),[F,Q]=x.useState(!1);return x.useEffect(()=>{if(!b.current)return;let B=!1,Y=null;A("loading"),Q(!1);const M=window.setTimeout(()=>{B||Q(!0)},200);return(async()=>{var je;let z;try{z=await gE()}catch{window.clearTimeout(M),B||A("error");return}if(B||!b.current)return;window.clearTimeout(M);const{Terminal:R,FitAddon:Z,WebLinksAddon:re}=z,G=new R({fontFamily:pE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:S.current}),$=new Z;G.loadAddon($),G.loadAddon(new re),G.open(b.current),y.current=G,G.attachCustomKeyEventHandler(E=>{if(E.type!=="keydown"||!(E.ctrlKey||E.metaKey))return!0;if(E.key==="`")return E.preventDefault(),!1;if(E.key==="c"||E.key==="C"){const X=G.getSelection();return X?(E.preventDefault(),Ca(X),!1):!E.shiftKey}return E.key==="v"||E.key==="V"?(E.preventDefault(),Lp().then(X=>{X&&G.paste(X)}),!1):!0});const he=E=>{E.preventDefault();const ne=G.getSelection();if(ne){Ca(ne),G.clearSelection();return}Lp().then(X=>{X&&G.paste(X)})};(je=G.element)==null||je.addEventListener("contextmenu",he);const ve=G.onData(E=>d(n,E));let K={cols:G.cols,rows:G.rows},O=null;const I=G.onResize(({cols:E,rows:ne})=>{O!==null&&window.clearTimeout(O),O=window.setTimeout(()=>{O=null,!(E===K.cols&&ne===K.rows)&&(K={cols:E,rows:ne},h(n,E,ne))},100)}),oe=new ResizeObserver(()=>{try{$.fit()}catch{return}v.current&&G.scrollToBottom()});oe.observe(b.current);const pe=g(n,E=>{E.kind==="buffer"&&G.reset(),G.write(E.data)});m(n),k.current!==null&&!j.current&&(j.current=!0,G.write(`\r
|
|
130
|
-
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
131
|
-
`)),r&&G.focus(),Y=()=>{var E;O!==null&&window.clearTimeout(O),oe.disconnect(),(E=G.element)==null||E.removeEventListener("contextmenu",he),ve.dispose(),I.dispose(),pe(),G.dispose(),y.current=null},A("ready")})(),()=>{B=!0,window.clearTimeout(M),Y==null||Y(),Y=null}},[n]),x.useEffect(()=>{if(!o)return;const q=b.current;if(!q)return;let B=null,Y=0,M=!1;const z=G=>{G.pointerType==="mouse"||B!==null||(B=G.pointerId,Y=G.clientY,M=!1)},R=G=>{if(G.pointerId!==B)return;const $=Y-G.clientY;if(!M){if(Math.abs($)<4)return;M=!0,q.setPointerCapture(G.pointerId)}Y=G.clientY;const he=q.querySelector(".xterm-viewport");he&&(he.scrollTop+=$)},Z=G=>{G.pointerId===B&&(q.hasPointerCapture(G.pointerId)&&q.releasePointerCapture(G.pointerId),B=null,M=!1)},re=G=>G.stopPropagation();return q.addEventListener("pointerdown",z),q.addEventListener("pointermove",R),q.addEventListener("pointerup",Z),q.addEventListener("pointercancel",Z),q.addEventListener("touchmove",re,{capture:!0}),()=>{q.removeEventListener("pointerdown",z),q.removeEventListener("pointermove",R),q.removeEventListener("pointerup",Z),q.removeEventListener("pointercancel",Z),q.removeEventListener("touchmove",re,{capture:!0}),B!==null&&q.hasPointerCapture(B)&&q.releasePointerCapture(B)}},[o]),x.useEffect(()=>{S.current=c,y.current&&(y.current.options.theme=c)},[c]),x.useEffect(()=>{var q;r&&((q=y.current)==null||q.focus())},[r]),x.useEffect(()=>{if(k.current=l,l===null){j.current=!1;return}if(j.current)return;const q=y.current;q&&(j.current=!0,q.write(`\r
|
|
132
|
-
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
133
|
-
`))},[l]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:b,className:"termview__surface"+(C==="ready"?"":" is-hidden")}),C==="loading"&&F&&a.jsxs("div",{className:"termview__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),C==="error"&&a.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[a.jsx("p",{children:"Не удалось загрузить терминал"}),a.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),a.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const yE=2e5,vE=75,jE=90;function NE({tokens:n,maxTokens:l,fetchedAt:r}){if(n===null)return null;const c=l??yE,o=Math.min(100,Math.round(n/c*100)),d=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
134
|
-
обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return a.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[a.jsx("span",{className:"contextbar__label",children:"контекст"}),a.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`contextbar__fill${wE(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function wE(n){return n>=jE?" contextbar__fill--over":n>=vE?" contextbar__fill--warn":""}const Gy="ccv:last-session",kE=300*1e3,SE=1e4;function EE(){try{const n=localStorage.getItem(Gy);if(!n)return null;const l=JSON.parse(n);if(typeof l!="object"||l===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=l;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function TE(n,l){const r=n.find(o=>o.id===l);if(r)return r;const c=n.filter(o=>hv(o.path).includes(l));return c.length===1?c[0]:void 0}function CE(n,l){return n.id===l.sessionId?!0:l.claudeSessionId?n.id===l.claudeSessionId||n.claudeSessionId===l.claudeSessionId:!1}const AE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},S_=[{name:"login",description:"Войти в аккаунт Claude — Настройки, раздел входа",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново (Настройки)",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude (Настройки)",argumentHint:"",aliases:["signout","выход"]}],E_=[{id:Pi,name:"Основной",color:"orange",configDir:null,dir:"",main:!0,liveSessions:0}];function T_(n,l,r){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return l;const o=r[c===-1?"":n.slice(0,c)];if(!o)return null;const d=n.slice(c+1).toLowerCase();return d===""?{query:n,entries:o}:{query:n,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>C_(h.name,d)-C_(m.name,d))}}function C_(n,l){return n.toLowerCase().startsWith(l)?0:1}function A_(n,l){const r=n.find(o=>o.value===l)??n.find(o=>o.resolvedModel===l),c=l&&!r?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(r==null?void 0:r.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function ME(){var Rr,Ri;const n=x.useRef(null),[l,r]=x.useState(!1),[c,o]=x.useState("Нет связи с хостом"),[d,h]=x.useState(null),[m,g]=x.useState(null),b=(m==null?void 0:m.status)==="blocked",[y,j]=x.useState(!1),v=x.useMemo(()=>sf()==="relay",[]),[S,k]=x.useState([]),[C,A]=x.useState([]),[F,Q]=x.useState([]),[q,B]=x.useState([]),[Y,M]=x.useState([]),[z,R]=x.useState([]),[Z,re]=x.useState([]),[G,$]=x.useState({}),[he,ve]=x.useState([]),[K,O]=x.useState([]),[I,oe]=x.useState(null),[pe,je]=x.useState(null),[E,ne]=x.useState(null),[X,Ne]=x.useState(null),[U,ye]=x.useState(null),[Le,Ie]=x.useState(null),[qe,$t]=x.useState(Cs),[Ve,Cn]=x.useState(sp),[it,lt]=x.useState(!1),[tt,Lt]=x.useState(!1),_t=Nf("(max-width: 860px)"),[vt,qt]=x.useState(!1);x.useEffect(()=>{_t||qt(!1)},[_t]);const[Te,We]=x.useState(!1),[At,gt]=x.useState([]),[Ye,wn]=x.useState(!1),[zn,St]=x.useState(Cs),[Jt,hs]=x.useState(null),[An,xn]=x.useState(null),[as,zt]=x.useState(null),[on,ln]=x.useState(null),[Gt,Zn]=x.useState(null),[ue,ke]=x.useState({}),[Qe,rt]=x.useState([]),[He,Pe]=x.useState(null),[W,ge]=x.useState(null),[Re,Ge]=x.useState([]),[Yt,Mn]=x.useState([]),[Ms,Rl]=x.useState([]),[ea,Rs]=x.useState([]),[vs,bn]=x.useState(null),[Qs,yn]=x.useState(null),[ps,Xt]=x.useState({}),[Ze,Vn]=x.useState(null),[hl,ta]=x.useState({}),[Dl,is]=x.useState(null),[js,na]=x.useState({}),[pl,Ks]=x.useState([]),[ml,an]=x.useState(!1),[ut,Ds]=x.useState(E_),[Fs,ms]=x.useState({}),[Jn,rs]=x.useState(null),[gl,gs]=x.useState(null),[Os,yt]=x.useState(null),[Wn,jt]=x.useState(()=>gv()??Pi),[ct,sa]=x.useState(null),Ol=(ct==null?void 0:ct.enabledProviders)??["claude","antigravity"],[Qn,Ls]=x.useState(!1),[Un,la]=x.useState({}),[kt,Zs]=x.useState(null),[Wt,Rn]=x.useState(null),[un,we]=x.useState(!1),[T,,P]=zv(),be=qv(),[Me,$e]=x.useState(!1),[ze,Ut]=x.useState(null),[dn,fn]=x.useState(null),[Vt,kn]=x.useState(null),[Pt,Dn]=x.useState(null),[Js,en]=x.useState(null),[Ma,In]=x.useState(""),[Ra,Ws]=x.useState(null),[gi,aa]=x.useState([]),[xl,Ll]=x.useState(!1),[Da,xi]=x.useState(null),[zl,bl]=x.useState(!1),[w,ee]=x.useState(!1),[_e,De]=x.useState({}),[ft,Pn]=x.useState([""]),[Qt,vn]=x.useState([]),[ia,_l]=x.useState(null),[Tu,ra]=x.useState(null),[rr,ec]=x.useState(null),[Oa,tc]=x.useState(null),[Af,yo]=x.useState(null),[nc,Cu]=x.useState({}),[cr,Au]=x.useState({}),[La,or]=x.useState(!1),[Mf,ur]=x.useState(null),[sc,vo]=x.useState(null),Mu=x.useRef(0),dr=x.useRef(null),[bi,jo]=x.useState(!1),[lc,fr]=x.useState([]),[Rf,ac]=x.useState(null),[Df,ic]=x.useState(null),rc=Yv(),hr=Kv(_t&&bi),Ul=x.useRef(new Map),za=(ct==null?void 0:ct.terminalEnabled)===!0,pr=sf()==="relay"&&((Rr=d==null?void 0:d.shell)==null?void 0:Rr.enabled)!==!0,cc=x.useRef(!1),Ru=x.useCallback((p,L)=>(Ul.current.set(p,L),()=>{Ul.current.get(p)===L&&Ul.current.delete(p)}),[]),[ca,mr]=x.useState(!1),[Ua,oc]=x.useState(null),[Du,uc]=x.useState(Cs),[yl,gr]=x.useState(null),[Il,Ps]=x.useState({}),xr=x.useRef([]),[tn,dc]=x.useState(null);function Ou(p){dc(L=>L===p?null:p)}x.useEffect(()=>{(_t||tn==="terminal"&&!bi||tn==="files"&&!w||tn==="search"&&!La||tn==="git"&&!Me||tn==="ask"&&!ca||tn==="main"&&Qt.length===0)&&dc(null)},[tn,_t,bi,w,La,Me,ca,Qt.length]);const[No]=x.useState(EE),br=x.useRef(No),_r=x.useRef(!1),On=x.useRef(null),_i=x.useRef(null),yr=x.useRef(null),Lu=x.useRef(0),Hn=x.useRef(null),zu=x.useRef(0);On.current=U,Hn.current=X,zu.current=qe.lastSeq;const Uu=x.useRef(Ve);Uu.current=Ve;const jn=x.useRef(null),yi=x.useRef(0);yi.current=Du.lastSeq;const vr=x.useRef(null),jr=x.useRef(""),vi=x.useRef(null),oa=x.useRef([]),fc=x.useRef([""]);oa.current=Qt,fc.current=ft;const Nr=x.useRef(new Map),Hl=x.useRef(new Set),Ia=x.useRef(null),Bl=x.useRef(null),hc=x.useRef(0),ji=x.useRef(new Set);x.useEffect(()=>{const p=wv();if(!p)return;n.current=p;const L=()=>{r(p.connected),o(p.statusText)};p.onStatus(L),p.onReconnect(()=>{L(),ta({});const at=On.current;at&&p.send({type:"session.sync",sessionId:at,sinceSeq:zu.current});const rn=jn.current;rn&&p.send({type:"session.sync",sessionId:rn,sinceSeq:yi.current})});const te=p.on(at=>Ha(at));p.connect();const Ee=window.setInterval(()=>{L(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{te(),window.clearInterval(Ee),p.close()}},[]);const Ha=x.useCallback(p=>{var L,te,Ee,at,rn,$n,Ql,Di,Oi,Li,Ln;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{k(p.workspaces),A(p.archived),Zn(null),Ne(Ce=>{var cn;if(Ce)return Ce;const Ke=br.current,dt=Ke&&TE(p.workspaces,Ke.workspaceId);return Ke&&dt&&dt.id!==Ke.workspaceId&&(br.current={...Ke,workspaceId:dt.id}),(dt==null?void 0:dt.id)??((cn=p.workspaces[0])==null?void 0:cn.id)??null});const de=vi.current;if(!de)break;const Se=p.workspaces.find(Ce=>UE(Ce.path,de));if(!Se)break;vi.current=null,We(!1),Ne(Se.id);break}case"workspace.candidates":if(p.query.trim()!==jr.current)break;gt(p.candidates),p.source==="host"&&wn(!1);break;case"finder.opened":vr.current=p.sessionId;break;case"workspace.roots":rt(p.roots);break;case"workspace.created":if(Ne(p.workspace.id),p.warnings.length===0){We(!1),xn(null);break}Pe({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if($(de=>({...de,[p.workspaceId]:{sessions:p.sessions??[],archived:p.archived??[]}})),p.workspaceId!==Hn.current)break;R(p.sessions),re(p.archived);break;case"folder.list":Q(p.workspaceFolders),B(p.sessionFolders),M(p.pinnedFolders??[]),zt(p.projectsRoot??null),Zn(null);break;case"session.pinned":ve(p.sessions);break;case"session.live":O(p.sessions);break;case"order.state":ne(p.order);break;case"session.summary":if(p.session.id===vr.current){hs(p.session);break}if(p.session.parentSessionId){p.session.id===jn.current&&gr(p.session);break}if(O(de=>{const Se=de.findIndex(Ke=>Ke.id===p.session.id);if(p.session.state==="closed")return Se===-1?de:de.filter(Ke=>Ke.id!==p.session.id);if(Se===-1)return[...de,p.session];const Ce=de.slice();return Ce[Se]=p.session,Ce}),R(de=>{const Se=de.findIndex(Ke=>Ke.id===p.session.id);if(Se===-1)return[p.session,...de];const Ce=de.slice();return Ce[Se]=p.session,Ce}),$(de=>{const Se=de[p.session.workspaceId];if(!Se)return de;const Ce=Se.sessions.findIndex(dt=>dt.id===p.session.id);let Ke;if(Ce!==-1)Ke=Se.sessions.slice(),Ke[Ce]=p.session;else{if(Se.archived.some(dt=>dt.id===p.session.id))return de;Ke=[p.session,...Se.sessions]}return{...de,[p.session.workspaceId]:{...Se,sessions:Ke}}}),ve(de=>{const Se=de.findIndex(Ke=>Ke.id===p.session.id);if(Se===-1)return de;const Ce=de.slice();return Ce[Se]={...p.session,pinned:!0,...de[Se].pinnedAt?{pinnedAt:de[Se].pinnedAt}:{}},Ce}),On.current===null&&yr.current&&yr.current.workspaceId===p.session.workspaceId&&(q_(p.session.id,yr.current.text),yr.current=null),ye(de=>de??p.session.id),((L=_i.current)==null?void 0:L.sessionId)===p.session.id){const de=_i.current;p.session.state==="error"?_i.current=null:p.session.state!=="closed"&&(_i.current=null,(te=n.current)==null||te.send({type:"prompt.send",sessionId:de.sessionId,text:de.text,images:de.images}))}break;case"usage.state":p.sessionId===On.current&&(Zs(p.usage),we(!1));break;case"context.state":p.sessionId===On.current&&(Rn(p.context),we(!1));break;case"session.capabilities":p.sessionId===On.current&&Ie(p.capabilities);break;case"session.events":if(p.sessionId===jn.current){uc(de=>lf(de,p.entries));break}if(p.sessionId===vr.current){St(de=>lf(de,p.entries));break}if(p.sessionId!==On.current)break;for(const de of p.entries){if(de.event.kind!=="rewound")continue;const Se=de.event.toUserIndex,Ce=Ov(Uu.current.entries,Se),Ke=Ce.reduce((dt,cn)=>cn.event.kind==="user.message"?dt+1:dt,0);Cn(dt=>({...dt,entries:Ce})),$t(dt=>({...dt,items:Lv(dt.items,Se,Ke)}))}$t(de=>lf(de,p.entries));break;case"session.history":if(p.sessionId!==On.current)break;Cn(de=>Mv(de,p));break;case"side.opened":{if(p.parentSessionId!==On.current)break;jn.current=p.sessionId,oc(p.sessionId);const de=xr.current;xr.current=[];for(const Se of de)Se(p.sessionId);break}case"side.closed":if(p.parentSessionId!==On.current)break;jn.current=null,oc(null),uc(Cs),gr(null);break;case"git.state":if(p.workspaceId!==Hn.current)break;Ut(p.state);break;case"git.commit":if(p.workspaceId!==Hn.current)break;fn(p.detail);break;case"git.result":if(p.workspaceId!==Hn.current)break;Dn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(fn(null),kn(null),Ll(!1),bl(!1));break;case"git.busy":if(p.workspaceId!==Hn.current)break;In(p.label);break;case"git.files":if(p.workspaceId!==Hn.current)break;xi({files:p.files,truncated:p.truncated});break;case"github.status":Ws(p.status);break;case"github.owners":aa(p.owners);break;case"fs.dir":if(p.workspaceId!==Hn.current)break;De(de=>({...de,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Hn.current)break;if(p.scope!=="tree"){const de=p.scope;Au(Se=>({...Se,[de]:{query:p.query,entries:p.entries}}));break}yo({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Hn.current)break;ur({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Hn.current)break;const de=Hl.current.delete(p.file.path);vn(Ce=>{const Ke=Ce.findIndex(Lc=>Lc.path===p.file.path);if(Ke===-1)return[...Ce,Hb(p.file,++hc.current)];const dt=Ce[Ke],cn=Ce.slice();return cn[Ke]=dt.saved===p.file.content&&!di(dt)?{...dt,mtime:p.file.mtime,size:p.file.size,stale:!1}:Hb(p.file,++hc.current),cn}),de&&_l(p.file.path);const Se=dr.current;Se&&Se.path===p.file.path&&(dr.current=null,vo({...Se,token:++Mu.current}));break}case"fs.media":{if(p.workspaceId!==Hn.current)break;ji.current.delete(p.path),vn(de=>de.map(Se=>Se.path===p.path?{...Se,mediaBase64:p.base64,mediaError:void 0}:Se));break}case"fs.mediaFailed":{if(p.workspaceId!==Hn.current)break;ji.current.delete(p.path),vn(de=>de.map(Se=>Se.path===p.path?{...Se,mediaError:p.message}:Se));break}case"fs.saved":{if(p.workspaceId!==Hn.current)break;const de=Nr.current.get(p.path);Nr.current.delete(p.path);const Se=de!==void 0;vn(Ke=>Ke.map(dt=>dt.path!==p.path?dt:Se?{...dt,saved:de,mtime:p.mtime,size:p.size,stale:!1}:{...dt,stale:!0}));const Ce=oa.current.find(Ke=>Ke.path===p.path);!Se&&Ce&&!di(Ce)&&((Ee=n.current)==null||Ee.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(at=n.current)==null||at.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Hn.current)break;if(ra({ok:p.ok,message:p.message}),p.ok||Nr.current.delete(p.path),p.conflict&&vn(Se=>Se.map(Ce=>Ce.path===p.path?{...Ce,stale:!0}:Ce)),Bl.current===p.path){const Se=Bl.current;Bl.current=null,p.ok&&(Hl.current.add(Se),(rn=n.current)==null||rn.send({type:"fs.read",workspaceId:p.workspaceId,path:Se}))}const de=Ia.current;if(p.ok&&de&&de.to===p.path){Ia.current=null;const Se=Ce=>Ce===de.from?de.to:Ce.startsWith(`${de.from}/`)?de.to+Ce.slice(de.from.length):Ce;vn(Ce=>Ce.map(Ke=>({...Ke,path:Se(Ke.path)}))),_l(Ce=>Ce===null?null:Se(Ce)),Pn(Ce=>Ce.map(Se)),De(Ce=>{const Ke={};for(const[dt,cn]of Object.entries(Ce))dt===de.from||dt.startsWith(`${de.from}/`)||(Ke[dt]=cn);return Ke})}p.ok&&(($n=n.current)==null||$n.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Hn.current)break;fr(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Hn.current)break;ic(null),fr(de=>{const Se=de.findIndex(Ke=>Ke.id===p.terminal.id);if(Se===-1)return[...de,p.terminal];const Ce=de.slice();return Ce[Se]=p.terminal,Ce}),cc.current&&(cc.current=!1,ac(p.terminal.id));break;case"term.buffer":(Ql=Ul.current.get(p.id))==null||Ql({kind:"buffer",data:p.data});break;case"term.data":(Di=Ul.current.get(p.id))==null||Di({kind:"data",data:p.data});break;case"term.exit":fr(de=>de.map(Se=>Se.id===p.id?{...Se,exitCode:p.exitCode}:Se));break;case"term.closed":fr(de=>de.filter(Se=>Se.id!==p.id));break;case"mcp.list":p.sessionId===On.current&&Ge(p.servers);break;case"mcp.auth":p.sessionId===On.current&&yn(p.state);break;case"plugin.list":if(p.sessionId!==On.current)break;Mn(p.plugins),Rl(p.marketplaces),Rs(p.catalog);break;case"operation.result":p.sessionId===On.current&&bn(p.result);break;case"auth.status":ms(de=>({...de,[p.accountId]:p.status}));break;case"accounts.candidates":gs(p.candidates);break;case"accounts.usage":ke(de=>{const Se={...de};for(const[Ce,Ke]of Object.entries(p.usage))(Ke!==null||!(Ce in Se))&&(Se[Ce]=Ke);return Se});break;case"accounts.state":Ds(p.accounts.length>0?p.accounts:E_),rs(null),ms(de=>{const Se={};for(const Ce of p.accounts)Se[Ce.id]=p.auth[Ce.id]??de[Ce.id]??null;return Se});break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":sa(p.settings);break;case"handoff.state":Xt(de=>{if(!p.handoff){if(!(p.sessionId in de))return de;const Se={...de};return delete Se[p.sessionId],Se}return{...de,[p.sessionId]:p.handoff}});break;case"handoff.written":ta(de=>{if(!(p.sessionId in de))return de;const Se={...de};return delete Se[p.sessionId],Se}),p.handoff&&On.current===p.sessionId?is(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Lu.current+=1,Ks(de=>[...de,{id:Lu.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":la(de=>({...de,[p.accountId]:p.state})),p.state.active&&an(!0);break;case"session.closed":O(de=>de.filter(Se=>Se.id!==p.sessionId)),R(de=>de.map(Se=>Se.id===p.sessionId?{...Se,state:"closed"}:Se)),$(de=>{let Se=!1;const Ce={};for(const[Ke,dt]of Object.entries(de))dt.sessions.some(cn=>cn.id===p.sessionId&&cn.state!=="closed")?(Se=!0,Ce[Ke]={...dt,sessions:dt.sessions.map(cn=>cn.id===p.sessionId?{...cn,state:"closed"}:cn)}):Ce[Ke]=dt;return Se?Ce:de});break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(vi.current=null,xn(p.message)),(Oi=p.context)!=null&&Oi.startsWith("term.")&&ic(p.message),(Li=p.context)!=null&&Li.startsWith("folder.")&&(Zn(null),ln(`${p.message} Ничего не изменилось.`)),(Ln=p.context)!=null&&Ln.startsWith("accounts.")&&rs(p.message);break}},[]),ae=x.useCallback(p=>{var L;(L=n.current)==null||L.send(p)},[]);x.useEffect(()=>{X&&ae({type:"session.list",workspaceId:X})},[X,ae]),x.useEffect(()=>{l&&ae({type:"session.pins"})},[l,ae]),x.useEffect(()=>{l&&ae({type:"settings.get"})},[l,ae]),x.useEffect(()=>{if(l)return ae({type:"session.drafts",sessionIds:G_()}),Tv(p=>ae({type:"session.drafts",sessionIds:p}))},[l,ae]),x.useEffect(()=>{if(_r.current)return;const p=br.current;if(!p||!X)return;if(X!==p.workspaceId){_r.current=!0;return}if(U){_r.current=!0;return}if(z.length===0)return;const L=z.find(te=>CE(te,p));_r.current=!0,L&&L.state!=="closed"&&Ya(L)},[z,X,U]),x.useEffect(()=>{!X||pr||!za||ae({type:"term.list",workspaceId:X})},[X,pr,za,ae]),x.useEffect(()=>{ac(p=>{var L;return p&&lc.some(te=>te.id===p)?p:((L=lc[0])==null?void 0:L.id)??null})},[lc]),x.useEffect(()=>{Te&&ae({type:"workspace.roots"})},[Te,ae]);const ua=x.useCallback(()=>{const p=On.current;p&&(we(!0),ae({type:"usage.get",sessionId:p}),ae({type:"context.get",sessionId:p}))},[ae]);x.useEffect(()=>{if(!un)return;const p=window.setTimeout(()=>we(!1),SE);return()=>window.clearTimeout(p)},[un]);const pc=x.useMemo(()=>{const p=Math.max((kt==null?void 0:kt.fetchedAt)??0,(Wt==null?void 0:Wt.fetchedAt)??0);return p>0?p:null},[kt==null?void 0:kt.fetchedAt,Wt==null?void 0:Wt.fetchedAt]);x.useEffect(()=>{if(Rn(null),!U)return;ua();const p=()=>{document.hidden||ua()},L=window.setInterval(p,kE),te=()=>{document.hidden||ua()};return document.addEventListener("visibilitychange",te),()=>{window.clearInterval(L),document.removeEventListener("visibilitychange",te)}},[U,ua]),x.useEffect(()=>{if(!U){Cn(sp);return}Cn({...sp,loading:!0}),ae({type:"session.history",sessionId:U})},[U,ae]);const Ba=x.useCallback(()=>{!U||Ve.loading||!tb(Ve)||(Cn(p=>({...p,loading:!0})),ae({type:"session.history",sessionId:U,before:X_(Ve)}))},[U,Ve,ae]),Iu=x.useMemo(()=>Rv(Ve.entries),[Ve.entries]),J=x.useMemo(()=>z.find(p=>p.id===U)??null,[z,U]),vl=U?(J==null?void 0:J.claudeSessionId)??U:null,el=vl?ps[vl]??null:null;x.useEffect(()=>{vl&&ae({type:"handoff.get",sessionId:vl})},[vl,ae]),x.useEffect(()=>{Ze&&!(Ze.sessionId in ps)&&Vn(null)},[ps,Ze]);const Hu=x.useMemo(()=>{var te;if(!kt)return null;const p=(((te=kt.buckets)==null?void 0:te.length)??0)>0,L=(J==null?void 0:J.provider)==="antigravity";return p===L?kt:null},[kt,J==null?void 0:J.provider]),mc=ut.length>1;function wo(p){return ut.some(L=>L.id===p)?p:Pi}const Bu=x.useMemo(()=>({accounts:ut,auth:Fs,multi:ut.length>1}),[ut,Fs]),Ns=mc&&J&&J.provider!=="antigravity"?ut.find(p=>p.id===J.accountId)??null:null,tl=x.useMemo(()=>{const p={};for(const L of z)L.provider!=="antigravity"&&(L.state!=="running"&&L.state!=="waiting_permission"||(p[L.accountId]=(p[L.accountId]??0)+1));return p},[z]),wr="Обновить лимиты и контекст",zs=wr+(pc?`
|
|
135
|
-
обновлено в ${new Date(pc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");x.useEffect(()=>{document.documentElement.dataset.provider=(J==null?void 0:J.provider)??"claude"},[J==null?void 0:J.provider]),x.useEffect(()=>{(J==null?void 0:J.provider)==="antigravity"&&mr(!1)},[J==null?void 0:J.provider]);const nl=S.find(p=>p.id===X)??C.find(p=>p.id===X)??null;x.useEffect(()=>{if(!X||!U)return;const p={workspaceId:X,sessionId:U,claudeSessionId:(J==null?void 0:J.claudeSessionId)??null};try{localStorage.setItem(Gy,JSON.stringify(p))}catch{}},[X,U,J==null?void 0:J.claudeSessionId]),x.useEffect(()=>{if(!Gt)return;const p=window.setTimeout(()=>Zn(null),6e4);return()=>window.clearTimeout(p)},[Gt]);function gc(p){vi.current=p,xn(null),ae({type:"workspace.open",path:p})}function xc(p,L,te,Ee){xn(null),ae({type:"workspace.create",parent:p,name:L,init:te,...Ee?{folderId:Ee}:{}})}function bc(p){if(jr.current=p,!p){gt([]),wn(!1);return}wn(!0),ae({type:"workspace.find",query:p})}function ko(p){jr.current=p,St(Cs),ae({type:"workspace.find.agent",query:p})}function $a(){We(!1),xn(null),Pe(null),gt([]),St(Cs),hs(null),jr.current="",vi.current=null}function qa(){const p=On.current;p&&jn.current&&ae({type:"side.reset",sessionId:p}),jn.current=null,oc(null),uc(Cs),gr(null),Ps({}),xr.current=[]}function _c(p){ae({type:"workspace.close",workspaceIds:p}),$u(p)}function Ni(p){ae({type:"workspace.unmark",workspaceIds:p}),$u(p)}function $u(p){!X||!p.includes(X)||(qa(),Ne(null),ye(null),R([]),re([]),$t(Cs),Ie(null),Lt(!1))}function ws(p,L){ae({type:"session.archive",workspaceId:p,sessionIds:L}),U&&(L.includes(U)||J!=null&&J.claudeSessionId&&L.includes(J.claudeSessionId))&&(qa(),ye(null),$t(Cs),Ie(null),Lt(!1))}function So(p){ae({type:"workspace.restore",workspaceIds:p})}function $l(p,L,te){ln(null),ae({type:"folder.create",scope:p,name:L,workspaceId:te})}function qu(p,L){ln(null),ae({type:"folder.rename",folderId:p,name:L})}function yc(p,L){ae({type:"folder.setColor",folderId:p,color:L})}function Ga(p){ln(null),ae({type:"folder.delete",folderId:p})}function Eo(p,L,te,Ee){ln(null),p==="workspace"&&Zn(L),ae({type:"folder.assign",scope:p,itemId:L,folderId:te,workspaceId:Ee})}function Gu(p=Ol[0]??"claude",L){if(!X)return;let te;p==="claude"&&mc&&(te=L??wo(Wn),jt(te),xv(te)),qa(),ye(null),Ie(null),$t(Cs),Lt(!1),ae({type:"session.start",workspaceId:X,provider:p,...te?{accountId:te}:{}}),lt(!1)}function kr(p){qa(),Ju(),Ne(p),ye(null),$t(Cs),Ie(null),Lt(!1),Ut(null),fn(null),kn(null),Dn(null),In(""),Ll(!1),xi(null),bl(!1),fr([]),ac(null)}function Yu(p,L,te){ae({type:"session.pin",workspaceId:p,sessionIds:L,pinned:te})}function Us(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function da(p){if(Us(p)){oe(p);return}ae({type:"session.close",sessionId:p.id})}function wi(p,L,te){ne(Ee=>{const at=Ee??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!te)return Ee;const rn={...at.sessions};return L&&L.length>0?rn[te]=L:delete rn[te],{...at,sessions:rn}}return{...at,[p]:L??[]}}),ae({type:"order.set",scope:p,ids:L,...te?{workspaceId:te}:{}})}function vc(p){p.workspaceId!==X&&kr(p.workspaceId),Ya(p)}function Ya(p){if(lt(!1),qa(),$t(Cs),Ie(null),Lt(!1),p.state==="closed"){ye(null),ae({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}ye(p.id),ae({type:"session.sync",sessionId:p.id,sinceSeq:0})}function Is(p,L){if(!U||b)return!1;const te=U,Ee=J;return ks(()=>{if((Ee==null?void 0:Ee.state)==="closed"){_i.current={sessionId:Ee.id,text:p,images:L},Ya(Ee);return}ae({type:"prompt.send",sessionId:te,text:p,images:L})})}function ks(p){const L=(J==null?void 0:J.provider)==="antigravity"?null:cE(kt,ct);return L?new Promise(te=>{je(Ee=>(Ee==null||Ee.resolve(!1),{warning:L,resolve:te}))}).then(te=>(te&&p(),te)):(p(),!0)}function jl(p){pe&&(pe.resolve(p),je(null))}function sl(p){const L=K.find(at=>(at.claudeSessionId??at.id)===p.sessionId&&at.state!=="closed"),te=Hs(p.sessionId,p.workspaceId,p.limit!==null),Ee=te!=null&&te.canChoose?te.selectedId:(te==null?void 0:te.sourceId)??(L==null?void 0:L.accountId);To(p.workspaceId,p.sessionId,p.text,Ee),L&&ae({type:"session.close",sessionId:L.id})}function Hs(p,L,te){var Ln,de,Se;if(!mc)return null;const Ee=Ce=>Ce.id===p||Ce.claudeSessionId===p,at=K.find(Ee)??z.find(Ee)??((Ln=G[L])==null?void 0:Ln.sessions.find(Ee));if((at==null?void 0:at.provider)==="antigravity")return null;const rn=at==null?void 0:at.accountId,$n=ut.filter(Ce=>{var Ke;return((Ke=Fs[Ce.id])==null?void 0:Ke.loggedIn)!==!1}),Ql=Ce=>Ce&&$n.some(Ke=>Ke.id===Ce)?Ce:void 0,Di=Ql(js[p]),Oi=rn?(de=$n.find(Ce=>Ce.id!==rn))==null?void 0:de.id:void 0,Li=Di??(te?Oi:void 0)??Ql(rn)??Ql(Pi)??((Se=$n[0])==null?void 0:Se.id)??Pi;return{source:ut.find(Ce=>Ce.id===rn)??null,sourceId:rn,targets:$n,selectedId:Li,canChoose:$n.length>1}}function Nl(p){To(p.workspaceId,p.claudeSessionId??p.id,null,p.accountId)}function To(p,L,te,Ee){yr.current=te===null?null:{workspaceId:p,text:te},p!==X?kr(p):(qa(),ye(null),Ie(null),$t(Cs),Lt(!1)),ae({type:"session.start",workspaceId:p,provider:"claude",...mc&&Ee?{accountId:Ee}:{},continuesFrom:L,...te===null?{}:{fromHandoff:!0}}),lt(!1)}x.useEffect(()=>{Dl&&(is(null),sl(Dl))},[Dl]);function jc(p){hl[p.id]||(ta(L=>({...L,[p.id]:!0})),ae({type:"session.handoff",sessionId:p.id}))}function Co(p){ae({type:"handoff.dismiss",sessionId:p})}function Ao(p,L){ae({type:"session.rename",sessionId:p.id,title:L,workspaceId:p.workspaceId}),R(te=>te.map(Ee=>Ee.id===p.id?{...Ee,title:L}:Ee)),$(te=>{const Ee=te[p.workspaceId];return Ee?{...te,[p.workspaceId]:{...Ee,sessions:Ee.sessions.map(at=>at.id===p.id?{...at,title:L}:at)}}:te})}function Bn(p){U&&(lt(!1),bn(null),yn(null),ge(p),ae({type:"mcp.list",sessionId:U}),ae({type:"plugin.list",sessionId:U}))}const nn={mcpAction:(p,L)=>{U&&(bn(null),ae({type:"mcp.action",sessionId:U,name:p,action:L}))},mcpAuth:p=>{U&&(bn(null),yn({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),ae({type:"mcp.auth",sessionId:U,name:p}))},mcpAuthCallback:(p,L)=>{U&&ae({type:"mcp.auth_callback",sessionId:U,name:p,callbackUrl:L})},mcpAdd:(p,L)=>{U&&ae({type:"mcp.add",sessionId:U,name:p,draft:L})},mcpRemove:p=>{U&&ae({type:"mcp.remove",sessionId:U,name:p})},pluginInstall:p=>{U&&ae({type:"plugin.install",sessionId:U,spec:p})},pluginUninstall:p=>{U&&ae({type:"plugin.uninstall",sessionId:U,id:p})},pluginToggle:(p,L)=>{U&&ae({type:"plugin.toggle",sessionId:U,id:p,enabled:L})},marketplaceAdd:p=>{U&&ae({type:"marketplace.add",sessionId:U,source:p})},marketplaceRemove:p=>{U&&ae({type:"marketplace.remove",sessionId:U,name:p})}};function ht(){lt(!1),an(!0),rs(null);for(const p of ut)ae({type:"auth.status",accountId:p.id})}const wl={login:(p,L,te)=>ae({type:"auth.login",mode:L,switchAccount:te,accountId:p}),submitCode:(p,L)=>ae({type:"auth.code",code:L,accountId:p}),cancel:p=>ae({type:"auth.cancel",accountId:p}),logout:p=>ae({type:"auth.logout",accountId:p})},Bs={discover:()=>ae({type:"accounts.discover"}),requestUsage:()=>ae({type:"accounts.usage"}),add:(p,L,te,Ee)=>{rs(null),ae({type:"accounts.add",name:p,color:L,...te?{configDir:te}:{},...Ee?{shareConfig:!0}:{}})},update:(p,L)=>{rs(null),ae({type:"accounts.update",accountId:p,...L})},remove:p=>{rs(null),ae({type:"accounts.remove",accountId:p})},makeMain:p=>{rs(null),ae({type:"accounts.makeMain",accountId:p})}};function Sr(p){an(!1),lt(!1),yt(p),Ls(!0),ae({type:"settings.get"});for(const L of ut)ae({type:"auth.status",accountId:L.id})}function fa(){lt(!1),yt(null),Ls(!0),ae({type:"settings.get"});for(const p of ut)ae({type:"auth.status",accountId:p.id})}function Xu(p){sa(L=>L&&{...L,...p}),ae({type:"settings.update",settings:p})}function Vu(p){!U||b||ae({type:"side.ask",sessionId:U,text:p})}function ki(){U&&(ae({type:"side.reset",sessionId:U}),jn.current=null,oc(null),uc(Cs),gr(null),Ps({}),xr.current=[])}function ll(p){const L=jn.current;if(L){p(L);return}const te=On.current;te&&(xr.current.push(p),ae({type:"side.open",sessionId:te}))}function Nc(){X&&ae({type:"git.state",workspaceId:X})}function Er(p){X&&(kn(p),ae({type:"git.show",workspaceId:X,ref:p}))}function wc(p,L){Dn(null),en({target:p,label:L})}function Xa(){!X||!Js||(ae({type:"git.checkout",workspaceId:X,target:Js.target}),en(null))}function ql(){X&&(Dn(null),ae({type:"git.push",workspaceId:X}))}function ha(p){X&&(Dn(null),ae({type:"git.pull",workspaceId:X,merge:p}))}function Gl(){X&&(Dn(null),xi(null),Ll(!0),ae({type:"github.status"}),ae({type:"github.owners"}),ae({type:"git.files",workspaceId:X}))}function Mo(p){X&&(Dn(null),ae({type:"git.publish",workspaceId:X,...p}))}function Ro(p){X&&(Dn(null),ae({type:"git.remote",workspaceId:X,url:p}))}function Si(){Dn(null),bl(!0)}function kc(p){ae({type:"github.token",token:p}),ae({type:"github.owners"})}function Va(){ae({type:"github.status"}),ae({type:"github.owners"})}x.useEffect(()=>{if(!(!w||!X))for(const p of ft)p in _e||ae({type:"fs.list",workspaceId:X,path:p})},[w,ft,_e,X,ae]);function Kn(p){Pn(L=>L.includes(p)?L.filter(te=>te!==p):[...L,p])}function Sc(p){if(!p){yo(null);return}X&&ae({type:"fs.search",workspaceId:X,query:p})}function Qu(p){if(!p){ur(null);return}X&&ae({type:"fs.grep",workspaceId:X,query:p})}const Ku=x.useCallback((p,L)=>{Cu(at=>({...at,[p]:L}));const te=Hn.current;if(L===null||!te)return;const Ee=L.lastIndexOf("/");if(Ee!==-1){ae({type:"fs.list",workspaceId:te,path:L.slice(0,Ee)});return}if(L===""){ae({type:"fs.list",workspaceId:te,path:""});return}ae({type:"fs.search",workspaceId:te,query:L,scope:p})},[ae]),Of=x.useMemo(()=>T_(nc.mention??null,cr.mention??null,_e),[nc.mention,cr.mention,_e]),Lf=x.useMemo(()=>T_(nc.side??null,cr.side??null,_e),[nc.side,cr.side,_e]);function Sn(p){Qa(p.path,{line:p.line,column:p.column})}function Do(p){const L=[];let te=Fr(p.path);for(;L.push(te),!!te;)te=Fr(te);Pn(Ee=>{const at=new Set(Ee);for(const rn of L)at.add(rn);return p.kind==="dir"&&at.add(p.path),[...at]}),p.kind==="file"&&Qa(p.path)}function Qa(p,L){if(oa.current.find(Ee=>Ee.path===p)){_l(p),L&&vo({path:p,...L,token:++Mu.current});return}X&&(L&&(dr.current={path:p,...L}),Hl.current.add(p),ae({type:"fs.read",workspaceId:X,path:p}))}function Ka(p,L=!1){const te=oa.current,Ee=te.find($n=>$n.path===p);if(Ee&&di(Ee)&&!L){tc(p);return}tc(null);const at=te.findIndex($n=>$n.path===p),rn=te.filter($n=>$n.path!==p);vn(rn),_l($n=>{var Ql;return $n===p?((Ql=rn[Math.min(at,rn.length-1)])==null?void 0:Ql.path)??null:$n})}function Ei(p,L=!1){const te=oa.current.find(Ee=>Ee.path===p);!te||!X||!L&&!di(te)||(Nr.current.set(p,te.text),ae({type:"fs.write",workspaceId:X,path:p,content:te.text,eol:te.eol,encoding:te.encoding,baseMtime:te.mtime,...L?{force:!0}:{}}))}function Ti(p){X&&ae({type:"fs.read",workspaceId:X,path:p})}function Ci(p){X&&(ji.current.has(p)||(ji.current.add(p),ae({type:"fs.readMedia",workspaceId:X,path:p})))}const zf=x.useRef(new Map);function Fu(p){const L=zf.current,te=L.get(p);te&&clearTimeout(te);const Ee=(ct==null?void 0:ct.autoSaveAfterPauseMs)??0;Ee<=0||L.set(p,setTimeout(()=>{L.delete(p);const at=oa.current.find(rn=>rn.path===p);at&&di(at)&&!at.stale&&Ei(p)},Ee))}function Uf(p,L,te){if(!X)return;const Ee=p?`${p}/${te}`:te;ra(null),L==="file"&&(Bl.current=Ee),ae({type:"fs.create",workspaceId:X,path:Ee,kind:L})}function Zu(p,L){if(!X)return;const te=Fr(p),Ee=te?`${te}/${L}`:L;ra(null),Ia.current={from:p,to:Ee},ae({type:"fs.rename",workspaceId:X,path:p,to:Ee})}function Fa(p,L){if(!X)return;const te=p.slice(p.lastIndexOf("/")+1),Ee=L?`${L}/${te}`:te;Ee!==p&&(ra(null),Ia.current={from:p,to:Ee},ae({type:"fs.rename",workspaceId:X,path:p,to:Ee}))}function Oo(p,L){X&&(ra(null),ae({type:"fs.copy",workspaceId:X,path:p,toDir:L}))}function Ec(p){X&&(ra(null),ec(null),ae({type:"fs.delete",workspaceId:X,path:p.path}),vn(L=>L.filter(te=>te.path!==p.path&&!te.path.startsWith(`${p.path}/`))),_l(L=>L&&(L===p.path||L.startsWith(`${p.path}/`))?null:L))}function Ju(){De({}),Pn([""]),vn([]),_l(null),ra(null),yo(null),ur(null),Cu({}),Au({}),vo(null),Hl.current.clear(),Nr.current.clear(),ji.current.clear(),dr.current=null,Ia.current=null,Bl.current=null}function Ai(){!X||pr||!za||(ic(null),cc.current=!0,ae({type:"term.open",workspaceId:X,cols:80,rows:24}))}function Lo(p){ae({type:"term.close",id:p})}function Tc(p,L){U&&ae({type:"permission.respond",sessionId:U,requestId:p,decision:L})}function Cc(p,L){U&&ae({type:"permission.respond",sessionId:U,requestId:p,decision:"allow",answers:L})}function Wu(p){U&&ae({type:"permission.respond",sessionId:U,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Pu(p,L){U&&ae({type:"permission.respond",sessionId:U,requestId:p,decision:"allow",plan:L})}function Za(p){U&&ae({type:"permission.respond",sessionId:U,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}x.useEffect(()=>{function p(L){if(L.key!=="Escape")return;if(tn!==null){const Ee=L.target;if(!(Ee instanceof HTMLElement&&Ee.closest(".termview, .editor, .sidepane"))){dc(null);return}}if(!U||qe.pending.length>0)return;const te=L.target;te instanceof HTMLElement&&te.closest(".sidepane, .editor")||ae({type:"control.interrupt",sessionId:U})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[U,qe.pending.length,ae,tn]),x.useEffect(()=>{function p(L){L.key!=="`"||!(L.ctrlKey||L.metaKey)||za&&(L.preventDefault(),jo(te=>!te))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[za]);const pa=x.useMemo(()=>{const p=(Le==null?void 0:Le.commands)??[];return p.length===0||(J==null?void 0:J.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...S_]},[Le,J==null?void 0:J.provider]);function zo(p){const L=AE[p];if(L&&(J==null?void 0:J.provider)!=="antigravity")return Bn(L),!0;if((J==null?void 0:J.provider)==="antigravity"||!S_.some(Ee=>Ee.name===p))return!1;const te=(J==null?void 0:J.accountId)??Pi;return Sr(te),p==="logout"&&wl.logout(te),p==="switch-account"&&wl.login(te,"claudeai",!0),!0}const Tr=(J==null?void 0:J.state)==="waiting_permission",es=(J==null?void 0:J.state)==="reconnecting",cs=(J==null?void 0:J.state)==="running"||es||Tr,It=qe.pending[0]??null,Ja=It?hk(It.toolName,It.input):null,[Ac,ed]=x.useState(()=>new Set),kl=It?Ac.has(It.requestId):!1,Uo=It?It.questions&&It.questions.length>0?"question":Ja!==null?"plan":"permission":null;function al(p,L){ed(te=>{if(te.has(p)===L)return te;const Ee=new Set(te);return L?Ee.add(p):Ee.delete(p),Ee})}x.useEffect(()=>{!Me&&!w||!X||cs||ae({type:"git.state",workspaceId:X})},[Me,w,X,cs,ae]),x.useEffect(()=>{if(!(cs||!X)){w&&De(p=>{const L={};for(const[te,Ee]of Object.entries(p))fc.current.includes(te)||(L[te]=Ee);return L});for(const p of oa.current)di(p)||ae({type:"fs.read",workspaceId:X,path:p.path})}},[cs,X,w,ae]);const Cr=(J==null?void 0:J.cwd)??(Le==null?void 0:Le.cwd)??null,Mc=(Le==null?void 0:Le.models)??[],il=(J==null?void 0:J.model)??(Le==null?void 0:Le.model)??null,{rows:Yl,selected:Ar}=A_(Mc,il),Wa=yl?{model:yl.model,effort:yl.effort,ultracode:yl.ultracode,thinking:yl.thinking,switchOnFlag:yl.switchModelsOnFlag}:{model:Il.model??il,effort:Il.effort??(J==null?void 0:J.effort)??null,ultracode:Il.ultracode??(J==null?void 0:J.ultracode)??!1,thinking:Il.thinking??(J==null?void 0:J.thinking)??!0,switchOnFlag:Il.switchOnFlag??(J==null?void 0:J.switchModelsOnFlag)??!0},Rc=A_(Mc,Wa.model),Mr=(yl==null?void 0:yl.state)==="running",Pa=ia?Qt.find(p=>p.path===ia)??null:null,td=new Set(Qt.filter(di).map(p=>p.path)),Mi=p=>a.jsx(dE,{pane:p,width:be.widths[p],onResize:L=>be.setWidth(p,L),onReset:()=>be.reset(p)}),rl=p=>_t?null:()=>Ou(p),Dc=(J==null?void 0:J.provider)==="antigravity"?Iv:V_,Io=Le&&a.jsx(Al,{title:"Режим прав",value:(J==null?void 0:J.permissionMode)??"default",options:Dc.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{U&&ae({type:"control.set_mode",sessionId:U,mode:p})}}),Oc=Yl.length>0?a.jsx(zy,{models:Yl,value:Ar,effort:(J==null?void 0:J.effort)??null,ultracode:(J==null?void 0:J.ultracode)??!1,thinking:(J==null?void 0:J.thinking)??!0,switchOnFlag:(J==null?void 0:J.switchModelsOnFlag)??!0,showSwitchOnFlag:(J==null?void 0:J.provider)!=="antigravity",onModel:p=>{!U||!p||ae({type:"control.set_model",sessionId:U,model:p})},onEffort:p=>{U&&ae({type:"control.set_effort",sessionId:U,effort:p})},onUltracode:p=>{U&&ae({type:"control.set_ultracode",sessionId:U,enabled:p})},onThinking:p=>{U&&ae({type:"control.set_thinking",sessionId:U,enabled:p})},onSwitchOnFlag:p=>{U&&ae({type:"control.set_flag_switch",sessionId:U,enabled:p})}}):il&&a.jsx("span",{className:"badge",children:il}),Ho=cs&&a.jsx("span",{className:Tr?"badge badge--wait":"badge badge--live",children:Tr?"ждёт":es?"переподключается":"работает"}),Ss=(J==null?void 0:J.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Es=Ho||Ss,Xl=()=>{U&&ae({type:"session.reconnect",sessionId:U})},Bo=es?"Сессия уже поднимает новый процесс":cs?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",nd=U&&(es||(J==null?void 0:J.state)==="error")?a.jsxs("div",{className:es?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),es?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:es?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Xl,children:es?"Переподключить сейчас":"Переподключить"})]}):null,ts=el?Hs(el.sessionId,el.workspaceId,el.limit!==null):null,Ts=el&&(ts!=null&&ts.canChoose)?{targets:ts.targets,selectedId:ts.selectedId,sourceId:ts.sourceId,onSelect:p=>na(L=>({...L,[el.sessionId]:p}))}:null,Et=J&&J.state!=="closed"&&J.provider!=="antigravity"&&vl?Hs(vl,J.workspaceId,!1):null,ei=Et!=null&&Et.canChoose&&vl?p=>na(L=>({...L,[vl]:p})):null,Vl=el?a.jsx(tE,{handoff:el,sourceAccount:(ts==null?void 0:ts.source)??null,accountChoice:Ts,onContinue:()=>sl(el),onShow:()=>Vn(el),onDismiss:()=>Co(el.sessionId)}):null,et=J&&J.totalCostUsd>0?`$${J.totalCostUsd.toFixed(3)}`:null,Mt=(J==null?void 0:J.provider)!=="antigravity"&&a.jsx("button",{className:ca?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":ca,onClick:()=>mr(p=>!p),children:a.jsx(HE,{})}),En=J&&J.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>da(J),children:a.jsx(LE,{})}),cl=J?hl[J.id]===!0:!1,ma=Z_({onLongPress:()=>{J&&Nl(J)},onClick:()=>{J&&jc(J)},disabled:cl}),ti=J&&J.state!=="closed"&&J.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:cl?"pane-btn pane-btn--handoff is-busy":ma.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${ma.thresholdMs}ms`},title:cl?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":cl,disabled:cl,...ma.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(zE,{})]});return a.jsx(Hp.Provider,{value:Bu,children:a.jsxs("div",{className:"app",style:be.style,children:[a.jsx(qN,{open:it,connected:l,status:c,workspaces:S,archivedWorkspaces:C,workspaceFolders:F,sessionFolders:q,pinnedFolders:Y,projectSessions:G,onRequestSessions:p=>ae({type:"session.list",workspaceId:p}),pinned:he,live:K,listOrder:E,liveSessionsFirst:(ct==null?void 0:ct.liveSessionsFirst)===!0,onReorder:wi,activeWorkspaceId:X,activeSessionId:U,onPinSessions:Yu,onSelectPinned:vc,onCloseWorkspaces:_c,onRestoreWorkspaces:So,onUnmarkWorkspaces:Ni,onArchiveSessions:ws,onUnarchiveSessions:(p,L)=>{ae({type:"session.unarchive",workspaceId:p,sessionIds:L})},onCreateFolder:$l,onRenameFolder:qu,onSetFolderColor:yc,onDeleteFolder:Ga,onAssignToFolder:Eo,folderNotice:on,onDismissFolderNotice:()=>ln(null),movingProjectId:Gt,onSelectWorkspace:kr,onRenameSession:Ao,onStopSession:da,onOpenWorkspace:()=>We(!0),onOpenUnopened:gc,onNewSession:Gu,enabledProviders:Ol,lastAccountId:wo(Wn),onSignInAccount:Sr,onOpenExtensions:U&&(J==null?void 0:J.provider)!=="antigravity"?()=>Bn("mcp"):null,account:Fs[Pi]??null,onOpenAccount:ht,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:fa,themeMode:T,onCycleTheme:P}),Mi("sidebar"),it&&a.jsx("div",{className:"scrim",onClick:()=>lt(!1)}),a.jsx(P1,{open:w,tree:_e,expanded:new Set(ft),activePath:ia,dirty:td,gitChanges:(ze==null?void 0:ze.changed)??[],result:Tu,searchResult:Af,onSearch:Sc,onReveal:Do,onToggle:Kn,onOpen:Qa,onCreate:Uf,onRename:Zu,onMove:Fa,onCopy:Oo,onDelete:ec,onRefresh:()=>{ra(null),De({}),Nc()},onClose:()=>ee(!1),zoomed:tn==="files",onToggleZoom:rl("files")}),w&&tn!=="files"&&Mi("files"),a.jsx(oN,{open:La,result:Mf,onSearch:Qu,onOpenMatch:Sn,onClose:()=>or(!1),zoomed:tn==="search",onToggleZoom:rl("search")}),La&&tn!=="search"&&Mi("search"),a.jsx(Ek,{open:Me,state:ze,result:Pt,selected:Vt,busy:Ma,onRefresh:Nc,onShow:Er,onCheckout:wc,onPush:ql,onPull:ha,onPublish:Gl,onConnectRemote:Si,onDismissResult:()=>Dn(null),onClose:()=>$e(!1),zoomed:tn==="git",onToggleZoom:rl("git")}),Me&&tn!=="git"&&Mi("git"),a.jsxs("main",{className:(tn==="main"||tn==="terminal"?"main main--zoomed":"main")+(Ns?` main--acct acct--${Ns.color}`:""),children:[m&&b&&a.jsx(sE,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>lt(!0),children:"☰"}),a.jsx("button",{className:w?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":w,onClick:()=>{ee(p=>!p),$e(!1),or(!1)},children:a.jsx(RE,{})}),a.jsx("button",{className:La?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":La,onClick:()=>{or(p=>!p),ee(!1),$e(!1)},children:a.jsx(DE,{})}),a.jsx("button",{className:Me?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Me,onClick:()=>{$e(p=>!p),ee(!1),or(!1)},children:a.jsx(OE,{})}),za&&a.jsx("button",{className:bi?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":bi,onClick:()=>jo(p=>!p),children:a.jsx(IE,{})}),_t&&Mt,_t&&a.jsx("button",{className:vt?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":vt,onClick:()=>qt(!0),children:a.jsx(BE,{})}),a.jsxs("div",{className:"topbar__id",children:[tt&&J?a.jsx(Ta,{className:"rename--title",value:J.title??"",onCommit:p=>{Ao(J,p),Lt(!1)},onCancel:()=>Lt(!1)}):a.jsxs("div",{className:"topbar__head",children:[_t&&Ns&&a.jsx(Aa,{account:Ns}),a.jsx("button",{className:"topbar__title",disabled:!J||_t,title:J&&!_t?"Переименовать сессию":void 0,onClick:()=>Lt(!0),children:(J==null?void 0:J.title)??"Claude Code Visual"}),nl&&a.jsx("span",{className:"topbar__project",title:nl.path,children:nl.name})]}),_t?Es:Cr&&a.jsx(Ly,{path:Cr})]}),!_t&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:un?"meters-refresh is-busy":"meters-refresh",title:zs,"aria-label":wr,"aria-busy":un,disabled:!U||un,onClick:ua,children:a.jsx($E,{})}),Ns&&a.jsx(Px,{account:Ns,onClick:ht}),a.jsx(rm,{usage:Hu}),a.jsx(By,{}),Io,Oc,Es,et&&a.jsx("span",{className:"badge badge--cost",children:et}),ti,Et&&ei&&!cl&&a.jsx(qy,{variant:"mark",targets:Et.targets,selectedId:Et.selectedId,sourceId:Et.sourceId,onSelect:ei}),En,Mt]})]}),a.jsx(NE,{tokens:(Wt==null?void 0:Wt.tokens)??qe.contextTokens,maxTokens:(Wt==null?void 0:Wt.maxTokens)??null,fetchedAt:(Wt==null?void 0:Wt.fetchedAt)??null}),_t&&vt&&a.jsx(iS,{onClose:()=>qt(!1),permission:Io,model:Oc,account:Ns&&a.jsx(Px,{account:Ns}),usage:Hu,cwd:Cr,costLabel:et,onRefresh:ua,refreshing:un,metersFetchedAt:pc,onRename:J?()=>{Lt(!0),qt(!1)}:null,onHandoff:J&&J.state!=="closed"&&J.provider!=="antigravity"?()=>{jc(J),qt(!1)}:null,onFreshSession:J&&J.state!=="closed"&&J.provider!=="antigravity"?()=>{Nl(J),qt(!1)}:null,handoffWriting:cl,handoffAccount:Et&&ei&&!cl?a.jsx(PS,{targets:Et.targets,selectedId:Et.selectedId,onSelect:ei}):null,onStop:J&&J.state!=="closed"?()=>{da(J),qt(!1)}:null}),Qt.length>0&&a.jsx(TN,{files:Qt,activePath:ia,busy:cs,onSelect:_l,onClose:p=>Ka(p),zoomed:tn==="main",onToggleZoom:rl("main")}),Pa?a.jsx(SN,{file:Pa,goto:(sc==null?void 0:sc.path)===Pa.path?sc:null,onChange:(p,L)=>{vn(te=>te.map(Ee=>Ee.path===p?{...Ee,text:L}:Ee)),Fu(p)},onSave:p=>Ei(p),onReload:Ti,onOverwrite:p=>Ei(p,!0),onRequestMedia:Ci,onTogglePreview:p=>vn(L=>L.map(te=>te.path===p?{...te,previewMode:!te.previewMode}:te))}):a.jsxs(a.Fragment,{children:[a.jsx(lm,{items:qe.items,busy:cs&&!es,waiting:Tr,empty:(J==null?void 0:J.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:Iu,historyHasMore:tb(Ve),historyLoading:Ve.loading,onLoadHistory:Ba,sessionId:U??void 0,onEditMessage:(J==null?void 0:J.provider)==="antigravity"?void 0:(p,L,te)=>{if(!U||b)return!1;const Ee=U;return ks(()=>ae({type:"prompt.edit",sessionId:Ee,userIndex:p,text:L,images:te}))}}),nd,Vl,U&&((Ri=J==null?void 0:J.tasks)!=null&&Ri.length)?a.jsx(DN,{tasks:J.tasks,onStop:p=>ae({type:"task.stop",sessionId:U,taskId:p})}):null,It&&Uo&&kl&&a.jsx(ck,{kind:Uo,toolName:It.toolName,queued:qe.pending.length-1,onExpand:()=>al(It.requestId,!1)}),a.jsx(Ry,{disabled:!U,busy:cs&&!es,sendBlocked:b,placeholder:es?"Промпт уйдёт, как только связь вернётся":(J==null?void 0:J.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:pa,sessionTitle:(J==null?void 0:J.title)??null,contextResult:Of,draftKey:U,onContextSearch:p=>Ku("mention",p),onCommand:zo,onSend:Is,onInterrupt:()=>{U&&ae({type:"control.interrupt",sessionId:U})}})]}),bi&&za&&a.jsxs(a.Fragment,{children:[!_t&&tn!=="terminal"&&a.jsx(hE,{height:rc.height,onResize:rc.setHeight,onReset:rc.reset}),a.jsx(xE,{mobile:_t,zoomed:tn==="terminal",onToggleZoom:rl("terminal"),terminals:lc,activeId:Rf,blocked:pr,error:Df,onDismissError:()=>ic(null),height:_t?hr.height:rc.height,offset:_t?{top:hr.offsetTop,left:hr.offsetLeft}:void 0,onSelect:ac,onOpen:Ai,onClose:Lo,onInput:(p,L)=>ae({type:"term.input",id:p,data:L}),onResize:(p,L,te)=>ae({type:"term.resize",id:p,cols:L,rows:te}),onAttach:p=>ae({type:"term.attach",id:p}),onHide:()=>jo(!1),registerSink:Ru})]})]}),a.jsx(Zk,{open:ca,items:Du.items,busy:Mr,ready:U!==null,sendBlocked:b,commands:pa,contextResult:Lf,draftKey:U,models:Rc.rows,model:Rc.selected,effort:Wa.effort,ultracode:Wa.ultracode,thinking:Wa.thinking,switchOnFlag:Wa.switchOnFlag,onContextSearch:p=>Ku("side",p),onCommand:zo,onModel:p=>{p&&(Ps(L=>({...L,model:p})),ll(L=>ae({type:"control.set_model",sessionId:L,model:p})))},onEffort:p=>{Ps(L=>({...L,effort:p,ultracode:!1})),ll(L=>ae({type:"control.set_effort",sessionId:L,effort:p}))},onUltracode:p=>{Ps(L=>({...L,ultracode:p,...p?{effort:"xhigh"}:{}})),ll(L=>ae({type:"control.set_ultracode",sessionId:L,enabled:p}))},onThinking:p=>{Ps(L=>({...L,thinking:p})),ll(L=>ae({type:"control.set_thinking",sessionId:L,enabled:p}))},onSwitchOnFlag:p=>{Ps(L=>({...L,switchOnFlag:p})),ll(L=>ae({type:"control.set_flag_switch",sessionId:L,enabled:p}))},onAsk:Vu,onInterrupt:()=>{Ua&&ae({type:"control.interrupt",sessionId:Ua})},onReset:ki,onClose:()=>mr(!1),zoomed:tn==="ask",onToggleZoom:rl("ask")}),ca&&tn!=="ask"&&Mi("ask"),(Me||ca||w||La)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{$e(!1),mr(!1),ee(!1),or(!1)}}),dn&&a.jsx(Mk,{detail:dn,local:((ze==null?void 0:ze.hasRemote)??!1)&&(ze==null?void 0:ze.commits.some(p=>p.hash===dn.hash&&!p.pushed))===!0,onCheckout:wc,onClose:()=>{fn(null),kn(null)}}),pe&&a.jsxs(bs,{title:"Лимит плана почти исчерпан",onClose:()=>jl(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>jl(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>jl(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[vf[pe.warning.limit][0].toUpperCase(),vf[pe.warning.limit].slice(1)," использован на"," ",Math.round(pe.warning.utilization)," %, сброс в"," ",oE(pe.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),I&&a.jsx(bs,{title:"Остановить сессию?",onClose:()=>oe(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>oe(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{ae({type:"session.close",sessionId:I.id}),oe(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Js&&a.jsxs(bs,{title:"Переключить рабочее дерево?",onClose:()=>en(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>en(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:Xa,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",Js.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),cs&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),ze&&ze.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",ze.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),xl&&a.jsx(Yk,{status:Ra,owners:gi,files:Da,defaultName:(nl==null?void 0:nl.name)??"",hasCommits:ze===null||ze.head!=="",busy:Ma,result:Pt,onRefreshStatus:Va,onSaveToken:kc,onPublish:Mo,onDismissResult:()=>Dn(null),onClose:()=>Ll(!1)}),zl&&a.jsx(Fk,{busy:Ma,result:Pt,onSubmit:Ro,onDismissResult:()=>Dn(null),onClose:()=>bl(!1)}),rr&&a.jsx(bs,{title:rr.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>ec(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>ec(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Ec(rr),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[rr.path," будет удалён с диска",rr.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Oa&&a.jsx(bs,{title:"Закрыть без сохранения?",onClose:()=>tc(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>tc(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Ka(Oa,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Ei(Oa),Ka(Oa,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Oa," есть несохранённые правки."]})}),W&&a.jsx(cS,{tab:W,servers:Re,plugins:Yt,marketplaces:Ms,catalog:ea,result:vs,auth:Qs,remote:v,actions:nn,onTab:ge,onClose:()=>ge(null)}),ml&&a.jsx(xS,{accounts:ut,auth:Fs,logins:Un,candidates:gl,usage:ue,actions:Bs,onOpenLogin:Sr,activeAccountId:(Ns==null?void 0:Ns.id)??null,error:Jn,onReconnect:U?()=>{Xl(),an(!1)}:null,reconnectBlocked:cs,reconnectHint:Bo,onClose:()=>an(!1)}),y&&a.jsx(MS,{state:d,onPair:(p,L)=>ae({type:"relay.pair",code:p,...L?{name:L}:{}}),onUnpair:()=>ae({type:"relay.unpair"}),onClose:()=>j(!1)}),Qn&&a.jsx(WS,{settings:ct,projectsRootHint:as,models:(Le==null?void 0:Le.models)??[],relayState:d,networkState:m,local:sf()==="local",onChange:Xu,onEnableShell:()=>ae({type:"relay.shell.enable"}),onDisableShell:()=>ae({type:"relay.shell.disable"}),onOpenRelay:()=>{Ls(!1),j(!0)},claudeLogin:{accounts:ut,auth:Fs,logins:Un,actions:wl,remote:v,runningByAccount:tl,focusAccountId:Os},onClose:()=>{Ls(!1),yt(null)}}),Te&&a.jsx(xk,{candidates:At,searching:Ye,agentItems:zn.items,agentBusy:(Jt==null?void 0:Jt.state)==="running",error:An,roots:Qe,folders:F,projectsRoot:as,created:He,onSearch:bc,onAskAgent:ko,onInterrupt:()=>{const p=vr.current;p&&ae({type:"control.interrupt",sessionId:p})},onSubmit:gc,onCreate:xc,onClose:$a}),It!=null&&It.questions&&It.questions.length>0?a.jsx(uk,{request:{...It,questions:It.questions},queued:qe.pending.length-1,collapsed:kl,onCollapse:()=>al(It.requestId,!0),onAnswer:Cc,onDecline:Wu}):It&&Ja!==null?a.jsx(ik,{request:It,plan:Ja,queued:qe.pending.length-1,collapsed:kl,onCollapse:()=>al(It.requestId,!0),onAccept:Pu,onDecline:Za}):It&&a.jsx(ok,{request:It,queued:qe.pending.length-1,collapsed:kl,onCollapse:()=>al(It.requestId,!0),onDecide:Tc}),Ze&&a.jsx(nE,{handoff:Ze,onClose:()=>Vn(null)}),a.jsx(iE,{notices:pl,onDismiss:p=>Ks(L=>L.filter(te=>te.id!==p))})]})})}function RE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.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 DE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function OE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),a.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),a.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),a.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function LE(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function zE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),a.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),a.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function UE(n,l){return M_(n)===M_(l)}function M_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function IE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),a.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),a.jsx("path",{d:"M8.2 10h3.1"})]})}function HE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.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"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function BE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function $E(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Yy=document.getElementById("root");if(!Yy)throw new Error("#root not found");dv.createRoot(Yy).render(a.jsx(x.StrictMode,{children:a.jsx(ME,{})}));export{x1 as D,pn as I,gn as N,YE as P,Cl as T,Pl as a,uy as b,Vs as c,GE as d,my as e,wu as f,z1 as h,XE as p,VE as s,Oe as t};
|