@i14ks/ccv 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/bundle/ccv.mjs +174 -33
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-B0NAQjxW.js → codemirror-BFhD_Qok.js} +1 -1
  4. package/web/assets/{index-DhdpnWaP.js → index-BKQ3S7R4.js} +1 -1
  5. package/web/assets/{index-XwIPGsoL.js → index-BeqGzcF4.js} +1 -1
  6. package/web/assets/{index-B5iRbk6K.js → index-BfM9EE1E.js} +1 -1
  7. package/web/assets/{index-fSIv5wMF.js → index-Bng1dR8P.js} +1 -1
  8. package/web/assets/{index-1MYdpgaD.js → index-BqphMi4s.js} +1 -1
  9. package/web/assets/{index-BoyP7MYO.js → index-C--xwv_c.js} +1 -1
  10. package/web/assets/{index-D71l3zbz.js → index-C0UJgxDk.js} +1 -1
  11. package/web/assets/{index-CHbY4Q8q.js → index-CO8tJjX2.js} +1 -1
  12. package/web/assets/{index-D24xx07T.js → index-CTd3OD36.js} +1 -1
  13. package/web/assets/{index-CswcCN2I.js → index-Cp-Vx5md.js} +1 -1
  14. package/web/assets/index-D48z24MD.js +134 -0
  15. package/web/assets/{index-LOhDu6-9.js → index-D6n8Nr5h.js} +1 -1
  16. package/web/assets/{index-pL68uIyG.js → index-DGvQxxdB.js} +1 -1
  17. package/web/assets/{index-Cv6bq7Bb.js → index-DkREaKVS.js} +1 -1
  18. package/web/assets/{index-CO577SPK.css → index-DmlVq6mR.css} +1 -1
  19. package/web/assets/{index-CA0PxYkA.js → index-DswRCrFR.js} +1 -1
  20. package/web/assets/{index-Cg_JGWuj.js → index-DwvMx-lF.js} +1 -1
  21. package/web/assets/{index-C7I7Qrgh.js → index-H0NO4iIy.js} +1 -1
  22. package/web/assets/{index-DMq1FoW-.js → index-Jk59gidx.js} +1 -1
  23. package/web/assets/{index-DiyYHRov.js → index-MdNspwJW.js} +1 -1
  24. package/web/assets/{index-CF_pC8Hx.js → index-Sbrdg0Zd.js} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-wKK666LV.js +0 -134
@@ -1,134 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-XwIPGsoL.js","./index-LOhDu6-9.js","./index-CF_pC8Hx.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-B5iRbk6K.js","./index-DhdpnWaP.js","./index-DMq1FoW-.js","./index-D24xx07T.js","./index-BoyP7MYO.js","./index-CswcCN2I.js","./index-Cg_JGWuj.js","./index-1MYdpgaD.js","./index-pL68uIyG.js","./index-Cv6bq7Bb.js","./index-C7I7Qrgh.js","./index-CA0PxYkA.js","./index-CHbY4Q8q.js","./index-D71l3zbz.js","./index-fSIv5wMF.js","./index-DiyYHRov.js","./codemirror-B0NAQjxW.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 Q0=Object.defineProperty;var Lx=l=>{throw TypeError(l)};var K0=(l,s,r)=>s in l?Q0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Yt=(l,s,r)=>K0(l,typeof s!="symbol"?s+"":s,r),Gh=(l,s,r)=>s.has(l)||Lx("Cannot "+r);var Ze=(l,s,r)=>(Gh(l,s,"read from private field"),r?r.call(l):s.get(l)),bn=(l,s,r)=>s.has(l)?Lx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),Ct=(l,s,r,c)=>(Gh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),$n=(l,s,r)=>(Gh(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(o){if(o.ep)return;o.ep=!0;const f=r(o);fetch(o.href,f)}})();var $h={exports:{}},Ko={};/**
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 zx;function Z0(){if(zx)return Ko;zx=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,o,f){var h=null;if(f!==void 0&&(h=""+f),o.key!==void 0&&(h=""+o.key),"key"in o){f={};for(var m in o)m!=="key"&&(f[m]=o[m])}else f=o;return o=f.ref,{$$typeof:l,type:c,key:h,ref:o!==void 0?o:null,props:f}}return Ko.Fragment=s,Ko.jsx=r,Ko.jsxs=r,Ko}var Ux;function F0(){return Ux||(Ux=1,$h.exports=Z0()),$h.exports}var a=F0(),Yh={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 Hx;function J0(){if(Hx)return nt;Hx=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function T(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,C={};function J(N,ee,U){this.props=N,this.context=ee,this.refs=C,this.updater=U||S}J.prototype.isReactComponent={},J.prototype.setState=function(N,ee){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,ee,"setState")},J.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function le(){}le.prototype=J.prototype;function Y(N,ee,U){this.props=N,this.context=ee,this.refs=C,this.updater=U||S}var H=Y.prototype=new le;H.constructor=Y,A(H,J.prototype),H.isPureReactComponent=!0;var q=Array.isArray;function B(){}var M={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function W(N,ee,U){var ve=U.ref;return{$$typeof:l,type:N,key:ee,ref:ve!==void 0?ve:null,props:U}}function oe(N,ee){return W(N.type,ee,N.props)}function G(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}function Z(N){var ee={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(U){return ee[U]})}var ge=/\/+/g;function ye(N,ee){return typeof N=="object"&&N!==null&&N.key!=null?Z(""+N.key):ee.toString(36)}function Ne(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(B,B):(N.status="pending",N.then(function(ee){N.status==="pending"&&(N.status="fulfilled",N.value=ee)},function(ee){N.status==="pending"&&(N.status="rejected",N.reason=ee)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function z(N,ee,U,ve,F){var je=typeof N;(je==="undefined"||je==="boolean")&&(N=null);var Oe=!1;if(N===null)Oe=!0;else switch(je){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(N.$$typeof){case l:case s:Oe=!0;break;case y:return Oe=N._init,z(Oe(N._payload),ee,U,ve,F)}}if(Oe)return F=F(N),Oe=ve===""?"."+ye(N,0):ve,q(F)?(U="",Oe!=null&&(U=Oe.replace(ge,"$&/")+"/"),z(F,ee,U,"",function(bt){return bt})):F!=null&&(G(F)&&(F=oe(F,U+(F.key==null||N&&N.key===F.key?"":(""+F.key).replace(ge,"$&/")+"/")+Oe)),ee.push(F)),1;Oe=0;var $e=ve===""?".":ve+":";if(q(N))for(var Be=0;Be<N.length;Be++)ve=N[Be],je=$e+ye(ve,Be),Oe+=z(ve,ee,U,je,F);else if(Be=T(N),typeof Be=="function")for(N=Be.call(N),Be=0;!(ve=N.next()).done;)ve=ve.value,je=$e+ye(ve,Be++),Oe+=z(ve,ee,U,je,F);else if(je==="object"){if(typeof N.then=="function")return z(Ne(N),ee,U,ve,F);throw ee=String(N),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function I(N,ee,U){if(N==null)return N;var ve=[],F=0;return z(N,ve,"","",function(je){return ee.call(U,je,F++)}),ve}function V(N){if(N._status===-1){var ee=N._result;ee=ee(),ee.then(function(U){(N._status===0||N._status===-1)&&(N._status=1,N._result=U)},function(U){(N._status===0||N._status===-1)&&(N._status=2,N._result=U)}),N._status===-1&&(N._status=0,N._result=ee)}if(N._status===1)return N._result.default;throw N._result}var pe=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Se={map:I,forEach:function(N,ee,U){I(N,function(){ee.apply(this,arguments)},U)},count:function(N){var ee=0;return I(N,function(){ee++}),ee},toArray:function(N){return I(N,function(ee){return ee})||[]},only:function(N){if(!G(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return nt.Activity=j,nt.Children=Se,nt.Component=J,nt.Fragment=r,nt.Profiler=o,nt.PureComponent=Y,nt.StrictMode=c,nt.Suspense=g,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,nt.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},nt.cache=function(N){return function(){return N.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(N,ee,U){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ve=A({},N.props),F=N.key;if(ee!=null)for(je in ee.key!==void 0&&(F=""+ee.key),ee)!R.call(ee,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&ee.ref===void 0||(ve[je]=ee[je]);var je=arguments.length-2;if(je===1)ve.children=U;else if(1<je){for(var Oe=Array(je),$e=0;$e<je;$e++)Oe[$e]=arguments[$e+2];ve.children=Oe}return W(N.type,F,ve)},nt.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},nt.createElement=function(N,ee,U){var ve,F={},je=null;if(ee!=null)for(ve in ee.key!==void 0&&(je=""+ee.key),ee)R.call(ee,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(F[ve]=ee[ve]);var Oe=arguments.length-2;if(Oe===1)F.children=U;else if(1<Oe){for(var $e=Array(Oe),Be=0;Be<Oe;Be++)$e[Be]=arguments[Be+2];F.children=$e}if(N&&N.defaultProps)for(ve in Oe=N.defaultProps,Oe)F[ve]===void 0&&(F[ve]=Oe[ve]);return W(N,je,F)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(N){return{$$typeof:m,render:N}},nt.isValidElement=G,nt.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:V}},nt.memo=function(N,ee){return{$$typeof:x,type:N,compare:ee===void 0?null:ee}},nt.startTransition=function(N){var ee=M.T,U={};M.T=U;try{var ve=N(),F=M.S;F!==null&&F(U,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(B,pe)}catch(je){pe(je)}finally{ee!==null&&U.types!==null&&(ee.types=U.types),M.T=ee}},nt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},nt.use=function(N){return M.H.use(N)},nt.useActionState=function(N,ee,U){return M.H.useActionState(N,ee,U)},nt.useCallback=function(N,ee){return M.H.useCallback(N,ee)},nt.useContext=function(N){return M.H.useContext(N)},nt.useDebugValue=function(){},nt.useDeferredValue=function(N,ee){return M.H.useDeferredValue(N,ee)},nt.useEffect=function(N,ee){return M.H.useEffect(N,ee)},nt.useEffectEvent=function(N){return M.H.useEffectEvent(N)},nt.useId=function(){return M.H.useId()},nt.useImperativeHandle=function(N,ee,U){return M.H.useImperativeHandle(N,ee,U)},nt.useInsertionEffect=function(N,ee){return M.H.useInsertionEffect(N,ee)},nt.useLayoutEffect=function(N,ee){return M.H.useLayoutEffect(N,ee)},nt.useMemo=function(N,ee){return M.H.useMemo(N,ee)},nt.useOptimistic=function(N,ee){return M.H.useOptimistic(N,ee)},nt.useReducer=function(N,ee,U){return M.H.useReducer(N,ee,U)},nt.useRef=function(N){return M.H.useRef(N)},nt.useState=function(N){return M.H.useState(N)},nt.useSyncExternalStore=function(N,ee,U){return M.H.useSyncExternalStore(N,ee,U)},nt.useTransition=function(){return M.H.useTransition()},nt.version="19.2.8",nt}var Bx;function Rp(){return Bx||(Bx=1,Yh.exports=J0()),Yh.exports}var b=Rp(),Xh={exports:{}},Zo={},Vh={exports:{}},Qh={};/**
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 Ix;function P0(){return Ix||(Ix=1,(function(l){function s(z,I){var V=z.length;z.push(I);e:for(;0<V;){var pe=V-1>>>1,Se=z[pe];if(0<o(Se,I))z[pe]=I,z[V]=Se,V=pe;else break e}}function r(z){return z.length===0?null:z[0]}function c(z){if(z.length===0)return null;var I=z[0],V=z.pop();if(V!==I){z[0]=V;e:for(var pe=0,Se=z.length,N=Se>>>1;pe<N;){var ee=2*(pe+1)-1,U=z[ee],ve=ee+1,F=z[ve];if(0>o(U,V))ve<Se&&0>o(F,U)?(z[pe]=F,z[ve]=V,pe=ve):(z[pe]=U,z[ee]=V,pe=ee);else if(ve<Se&&0>o(F,V))z[pe]=F,z[ve]=V,pe=ve;else break e}}return I}function o(z,I){var V=z.sortIndex-I.sortIndex;return V!==0?V:z.id-I.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],x=[],y=1,j=null,v=3,T=!1,S=!1,A=!1,C=!1,J=typeof setTimeout=="function"?setTimeout:null,le=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function H(z){for(var I=r(x);I!==null;){if(I.callback===null)c(x);else if(I.startTime<=z)c(x),I.sortIndex=I.expirationTime,s(g,I);else break;I=r(x)}}function q(z){if(A=!1,H(z),!S)if(r(g)!==null)S=!0,B||(B=!0,Z());else{var I=r(x);I!==null&&Ne(q,I.startTime-z)}}var B=!1,M=-1,R=5,W=-1;function oe(){return C?!0:!(l.unstable_now()-W<R)}function G(){if(C=!1,B){var z=l.unstable_now();W=z;var I=!0;try{e:{S=!1,A&&(A=!1,le(M),M=-1),T=!0;var V=v;try{t:{for(H(z),j=r(g);j!==null&&!(j.expirationTime>z&&oe());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var Se=pe(j.expirationTime<=z);if(z=l.unstable_now(),typeof Se=="function"){j.callback=Se,H(z),I=!0;break t}j===r(g)&&c(g),H(z)}else c(g);j=r(g)}if(j!==null)I=!0;else{var N=r(x);N!==null&&Ne(q,N.startTime-z),I=!1}}break e}finally{j=null,v=V,T=!1}I=void 0}}finally{I?Z():B=!1}}}var Z;if(typeof Y=="function")Z=function(){Y(G)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ye=ge.port2;ge.port1.onmessage=G,Z=function(){ye.postMessage(null)}}else Z=function(){J(G,0)};function Ne(z,I){M=J(function(){z(l.unstable_now())},I)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(z){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var V=v;v=I;try{return z()}finally{v=V}},l.unstable_requestPaint=function(){C=!0},l.unstable_runWithPriority=function(z,I){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=v;v=z;try{return I()}finally{v=V}},l.unstable_scheduleCallback=function(z,I,V){var pe=l.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?pe+V:pe):V=pe,z){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=V+Se,z={id:y++,callback:I,priorityLevel:z,startTime:V,expirationTime:Se,sortIndex:-1},V>pe?(z.sortIndex=V,s(x,z),r(g)===null&&z===r(x)&&(A?(le(M),M=-1):A=!0,Ne(q,V-pe))):(z.sortIndex=Se,s(g,z),S||T||(S=!0,B||(B=!0,Z()))),z},l.unstable_shouldYield=oe,l.unstable_wrapCallback=function(z){var I=v;return function(){var V=v;v=I;try{return z.apply(this,arguments)}finally{v=V}}}})(Qh)),Qh}var qx;function W0(){return qx||(qx=1,Vh.exports=P0()),Vh.exports}var Kh={exports:{}},xl={};/**
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 Gx;function ev(){if(Gx)return xl;Gx=1;var l=Rp();function s(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)x+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(g,x,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:x,implementation:y}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return xl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,xl.createPortal=function(g,x){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(s(299));return f(g,x,null,y)},xl.flushSync=function(g){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=y,c.d.f()}},xl.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(g,x))},xl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},xl.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,T=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:T}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:T,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},xl.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=m(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(g)},xl.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin);c.d.L(g,y,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},xl.preloadModule=function(g,x){if(typeof g=="string")if(x){var y=m(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},xl.requestFormReset=function(g){c.d.r(g)},xl.unstable_batchedUpdates=function(g,x){return g(x)},xl.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},xl.useFormStatus=function(){return h.H.useHostTransitionStatus()},xl.version="19.2.8",xl}var $x;function tv(){if($x)return Kh.exports;$x=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Kh.exports=ev(),Kh.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 Yx;function nv(){if(Yx)return Zo;Yx=1;var l=W0(),s=Rp(),r=tv();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,i=t;;){var u=n.return;if(u===null)break;var d=u.alternate;if(d===null){if(i=u.return,i!==null){n=i;continue}break}if(u.child===d.child){for(d=u.child;d;){if(d===n)return g(u),e;if(d===i)return g(u),t;d=d.sibling}throw Error(c(188))}if(n.return!==i.return)n=u,i=d;else{for(var _=!1,w=u.child;w;){if(w===n){_=!0,n=u,i=d;break}if(w===i){_=!0,i=u,n=d;break}w=w.sibling}if(!_){for(w=d.child;w;){if(w===n){_=!0,n=d,i=u;break}if(w===i){_=!0,i=d,n=u;break}w=w.sibling}if(!_)throw Error(c(189))}}if(n.alternate!==i)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?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"),T=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case J:return"Profiler";case C:return"StrictMode";case q:return"Suspense";case B:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case Y:return e.displayName||"Context";case le:return(e._context.displayName||"Context")+".Consumer";case H:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var Ne=Array.isArray,z=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},pe=[],Se=-1;function N(e){return{current:e}}function ee(e){0>Se||(e.current=pe[Se],pe[Se]=null,Se--)}function U(e,t){Se++,pe[Se]=e.current,e.current=t}var ve=N(null),F=N(null),je=N(null),Oe=N(null);function $e(e,t){switch(U(je,t),U(F,e),U(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sx(t),e=ax(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ee(ve),U(ve,e)}function Be(){ee(ve),ee(F),ee(je)}function bt(e){e.memoizedState!==null&&U(Oe,e);var t=ve.current,n=ax(t,e.type);t!==n&&(U(F,e),U(ve,n))}function Qe(e){F.current===e&&(ee(ve),ee(F)),Oe.current===e&&(ee(Oe),Yo._currentValue=V)}var fn,We;function st(e){if(fn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fn=t&&t[1]||"",We=-1<n.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+fn+e+We}var ct=!1;function vt(e,t){if(!e||ct)return"";ct=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ie){var se=ie}Reflect.construct(e,[],me)}else{try{me.call()}catch(ie){se=ie}e.call(me.prototype)}}else{try{throw Error()}catch(ie){se=ie}(me=e())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ie){if(ie&&se&&typeof ie.stack=="string")return[ie.stack,se.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 d=i.DetermineComponentFrameRoot(),_=d[0],w=d[1];if(_&&w){var D=_.split(`
45
- `),ne=w.split(`
46
- `);for(u=i=0;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;for(;u<ne.length&&!ne[u].includes("DetermineComponentFrameRoot");)u++;if(i===D.length||u===ne.length)for(i=D.length-1,u=ne.length-1;1<=i&&0<=u&&D[i]!==ne[u];)u--;for(;1<=i&&0<=u;i--,u--)if(D[i]!==ne[u]){if(i!==1||u!==1)do if(i--,u--,0>u||D[i]!==ne[u]){var ue=`
47
- `+D[i].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=i&&0<=u);break}}}finally{ct=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?st(n):""}function ut(e,t){switch(e.tag){case 26:case 27:case 5:return st(e.type);case 16:return st("Lazy");case 13:return e.child!==t&&t!==null?st("Suspense Fallback"):st("Suspense");case 19:return st("SuspenseList");case 0:case 15:return vt(e.type,!1);case 11:return vt(e.type.render,!1);case 1:return vt(e.type,!0);case 31:return st("Activity");default:return""}}function It(e){try{var t="",n=null;do t+=ut(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
48
- Error generating stack: `+i.message+`
49
- `+i.stack}}var wt=Object.prototype.hasOwnProperty,Te=l.unstable_scheduleCallback,et=l.unstable_cancelCallback,At=l.unstable_shouldYield,ft=l.unstable_requestPaint,Fe=l.unstable_now,_n=l.unstable_getCurrentPriorityLevel,tl=l.unstable_ImmediatePriority,Ot=l.unstable_UserBlockingPriority,St=l.unstable_NormalPriority,cl=l.unstable_LowPriority,dn=l.unstable_IdlePriority,an=l.log,ol=l.unstable_setDisableYieldValue,yn=null,Ft=null;function An(e){if(typeof an=="function"&&ol(e),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(yn,e)}catch{}}var Lt=Math.clz32?Math.clz32:be,Et=Math.log,ae=Math.LN2;function be(e){return e>>>=0,e===0?32:31-(Et(e)/ae|0)|0}var Ve=256,at=262144,Je=4194304;function rn(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 X(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var u=0,d=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var w=i&134217727;return w!==0?(i=w&~d,i!==0?u=rn(i):(_&=w,_!==0?u=rn(_):n||(n=w&~e,n!==0&&(u=rn(n))))):(w=i&~d,w!==0?u=rn(w):_!==0?u=rn(_):n||(n=i&~e,n!==0&&(u=rn(n)))),u===0?0:t!==0&&t!==u&&(t&d)===0&&(d=u&-u,n=t&-t,d>=n||d===32&&(n&4194048)!==0)?t:u}function he(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 qe(){var e=Je;return Je<<=1,(Je&62914560)===0&&(Je=4194304),e}function Mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function hn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Mn(e,t,n,i,u,d){var _=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var w=e.entanglements,D=e.expirationTimes,ne=e.hiddenUpdates;for(n=_&~n;0<n;){var ue=31-Lt(n),me=1<<ue;w[ue]=0,D[ue]=-1;var se=ne[ue];if(se!==null)for(ne[ue]=null,ue=0;ue<se.length;ue++){var ie=se[ue];ie!==null&&(ie.lane&=-536870913)}n&=~me}i!==0&&Xl(e,i,0),d!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=d&~(_&~t))}function Xl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Lt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function vn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Lt(n),u=1<<i;u&t|e[i]&t&&(e[i]|=t),n&=~u}}function ls(e,t){var n=t&-t;return n=(n&42)!==0?1:vl(n),(n&(e.suspendedLanes|t))!==0?0:n}function vl(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 nl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Is(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Tx(e.type))}function jl(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Cl=Math.random().toString(36).slice(2),cn="__reactFiber$"+Cl,tt="__reactProps$"+Cl,jn="__reactContainer$"+Cl,Xn="__reactEvents$"+Cl,ma="__reactListeners$"+Cl,ss="__reactHandles$"+Cl,qs="__reactResources$"+Cl,as="__reactMarker$"+Cl;function zn(e){delete e[cn],delete e[tt],delete e[Xn],delete e[ma],delete e[ss]}function ul(e){var t=e[cn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jn]||n[cn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dx(e);e!==null;){if(n=e[cn])return n;e=dx(e)}return t}e=n,n=e.parentNode}return null}function wl(e){if(e=e[cn]||e[jn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Jt(e){var t=e[qs];return t||(t=e[qs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[as]=!0}var fl=new Set,pn={};function ll(e,t){Rn(e,t),Rn(e+"Capture",t)}function Rn(e,t){for(pn[e]=t,e=0;e<t.length;e++)fl.add(t[e])}var Un=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]*$"),Jn={},Xt={};function Sl(e){return wt.call(Xt,e)?!0:wt.call(Jn,e)?!1:Un.test(e)?Xt[e]=!0:(Jn[e]=!0,!1)}function wn(e,t,n){if(Sl(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){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,""+n)}}function Sn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Vt(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function jt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nl(e,t,n){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,d=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){n=""+_,d.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(_){n=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Al(e){if(!e._valueTracker){var t=gs(e)?"checked":"value";e._valueTracker=Nl(e,t,""+e[t])}}function mn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=gs(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function xs(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 Gs=/[\n"\\]/g;function Dn(e){return e.replace(Gs,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ga(e,t,n,i,u,d,_,w){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=""+jt(t)):e.value!==""+jt(t)&&(e.value=""+jt(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?dl(e,_,jt(t)):n!=null?dl(e,_,jt(n)):i!=null&&e.removeAttribute("value"),u==null&&d!=null&&(e.defaultChecked=!!d),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+jt(w):e.removeAttribute("name")}function Vl(e,t,n,i,u,d,_,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||n!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Al(e);return}n=n!=null?""+jt(n):"",t=t!=null?""+jt(t):n,w||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=w?e.checked:!!i,e.defaultChecked=!!i,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Al(e)}function dl(e,t,n){t==="number"&&xs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Pt(e,t,n,i){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&i&&(e[n].defaultSelected=!0)}else{for(n=""+jt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function _e(e,t,n){if(t!=null&&(t=""+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+jt(n):""}function k(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(c(92));if(Ne(i)){if(1<i.length)throw Error(c(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=jt(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Al(e)}function K(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xe=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 ke(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||xe.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ge(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var i in n)!n.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)&&n[u]!==i&&ke(e,u,i)}else for(var d in t)t.hasOwnProperty(d)&&ke(e,d,t[d])}function Le(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qt=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"]]),Nn=/^[\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 on(e){return Nn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ut(){}var kn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hl=null,xn=null;function E(e){var t=wl(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ga(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Dn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var u=i[tt]||null;if(!u)throw Error(c(90));ga(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&mn(i)}break e;case"textarea":_e(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Pt(e,!!n.multiple,t,!1)}}}var re=!1;function we(e,t,n){if(re)return e(t,n);re=!0;try{var i=e(t);return i}finally{if(re=!1,(hl!==null||xn!==null)&&(af(),hl&&(t=hl,e=xn,xn=hl=null,E(t),e)))for(t=0;t<e.length;t++)E(e[t])}}function Ye(e,t){var n=e.stateNode;if(n===null)return null;var i=n[tt]||null;if(i===null)return null;n=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(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hn=!1;if(ot)try{var Wt={};Object.defineProperty(Wt,"passive",{get:function(){Hn=!0}}),window.addEventListener("test",Wt,Wt),window.removeEventListener("test",Wt,Wt)}catch{Hn=!1}var Vn=null,bs=null,Dr=null;function _s(){if(Dr)return Dr;var e,t=bs,n=t.length,i,u="value"in Vn?Vn.value:Vn.textContent,d=u.length;for(e=0;e<n&&t[e]===u[e];e++);var _=n-e;for(i=1;i<=_&&t[n-i]===u[d-i];i++);return Dr=u.slice(e,1<i?1-i:void 0)}function $s(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 xa(){return!0}function Wa(){return!1}function Qn(e){function t(n,i,u,d,_){this._reactName=n,this._targetInst=u,this.type=i,this.nativeEvent=d,this.target=_,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(n=e[w],this[w]=n?n(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?xa:Wa,this.isPropagationStopped=Wa,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=xa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xa)},persist:function(){},isPersistent:xa}),t}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ei=Qn(ba),Ys=j({},ba,{view:0,detail:0}),gu=Qn(Ys),ti,Or,Ql,Xs=j({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ii,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!==Ql&&(Ql&&e.type==="mousemove"?(ti=e.screenX-Ql.screenX,Or=e.screenY-Ql.screenY):Or=ti=0,Ql=e),ti)},movementY:function(e){return"movementY"in e?e.movementY:Or}}),xu=Qn(Xs),Zc=j({},Xs,{dataTransfer:0}),Lr=Qn(Zc),Fc=j({},Ys,{relatedTarget:0}),zr=Qn(Fc),Ur=j({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),ni=Qn(Ur),Jc=j({},ba,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hr=Qn(Jc),Bi=j({},ba,{data:0}),bu=Qn(Bi),Br={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gd={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"},Ir={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ir[e])?!!t[e]:!1}function Ii(){return qr}var qi=j({},Ys,{key:function(e){if(e.key){var t=Br[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ii,charCode:function(e){return e.type==="keypress"?$s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_a=Qn(qi),Gr=j({},Xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$r=Qn(Gr),xd=j({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ii}),ya=Qn(xd),Yr=j({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),_u=Qn(Yr),Xr=j({},Xs,{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}),yu=Qn(Xr),Vr=j({},ba,{newState:0,oldState:0}),ys=Qn(Vr),Qr=[9,13,27,32],va=ot&&"CompositionEvent"in window,Kl=null;ot&&"documentMode"in document&&(Kl=document.documentMode);var Gi=ot&&"TextEvent"in window&&!Kl,en=ot&&(!va||Kl&&8<Kl&&11>=Kl),Kr=" ",vu=!1;function ju(e,t){switch(e){case"keyup":return Qr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vs=!1;function Bn(e,t){switch(e){case"compositionend":return Zr(t);case"keypress":return t.which!==32?null:(vu=!0,Kr);case"textInput":return e=t.data,e===Kr&&vu?null:e;default:return null}}function $i(e,t){if(vs)return e==="compositionend"||!va&&ju(e,t)?(e=_s(),Dr=bs=Vn=null,vs=!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 en&&t.locale!=="ko"?null:t.data;default:return null}}var Yi={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 Pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yi[e.type]:t==="textarea"}function On(e,t,n,i){hl?xn?xn.push(i):xn=[i]:hl=i,t=hf(t,"onChange"),0<t.length&&(n=new ei("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var li=null,si=null;function js(e){Pg(e,0)}function Xi(e){var t=zt(e);if(mn(t))return e}function Vi(e,t){if(e==="change")return t}var Qi=!1;if(ot){var ja;if(ot){var ws="oninput"in document;if(!ws){var Wc=document.createElement("div");Wc.setAttribute("oninput","return;"),ws=typeof Wc.oninput=="function"}ja=ws}else ja=!1;Qi=ja&&(!document.documentMode||9<document.documentMode)}function ai(){li&&(li.detachEvent("onpropertychange",Ki),si=li=null)}function Ki(e){if(e.propertyName==="value"&&Xi(si)){var t=[];On(t,si,e,gn(e)),we(js,t)}}function Zi(e,t,n){e==="focusin"?(ai(),li=t,si=n,li.attachEvent("onpropertychange",Ki)):e==="focusout"&&ai()}function Fi(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xi(si)}function wu(e,t){if(e==="click")return Xi(t)}function Ji(e,t){if(e==="input"||e==="change")return Xi(t)}function bd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var te=typeof Object.is=="function"?Object.is:bd;function is(e,t){if(te(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var u=n[i];if(!wt.call(t,u)||!te(e[u],t[u]))return!1}return!0}function Fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Su(e,t){var n=Fr(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Fr(n)}}function Nu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Q(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=xs(e.document)}return t}function wa(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 Pi=ot&&"documentMode"in document&&11>=document.documentMode,Sa=null,Wi=null,ii=null,eo=!1;function Ml(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;eo||Sa==null||Sa!==xs(i)||(i=Sa,"selectionStart"in i&&wa(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}),ii&&is(ii,i)||(ii=i,i=hf(Wi,"onSelect"),0<i.length&&(t=new ei("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Sa)))}function Na(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ka={animationend:Na("Animation","AnimationEnd"),animationiteration:Na("Animation","AnimationIteration"),animationstart:Na("Animation","AnimationStart"),transitionrun:Na("Transition","TransitionRun"),transitionstart:Na("Transition","TransitionStart"),transitioncancel:Na("Transition","TransitionCancel"),transitionend:Na("Transition","TransitionEnd")},to={},Ea={};ot&&(Ea=document.createElement("div").style,"AnimationEvent"in window||(delete ka.animationend.animation,delete ka.animationiteration.animation,delete ka.animationstart.animation),"TransitionEvent"in window||delete ka.transitionend.transition);function Ta(e){if(to[e])return to[e];if(!ka[e])return e;var t=ka[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ea)return to[e]=t[n];return e}var ku=Ta("animationend"),Eu=Ta("animationiteration"),Tu=Ta("animationstart"),_d=Ta("transitionrun"),ri=Ta("transitionstart"),yd=Ta("transitioncancel"),Cu=Ta("transitionend"),Au=new Map,no="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(" ");no.push("scrollEnd");function Zl(e,t){Au.set(e,t),ll(t,[e])}var Jr=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)},Rl=[],ci=0,lo=0;function oi(){for(var e=ci,t=lo=ci=0;t<e;){var n=Rl[t];Rl[t++]=null;var i=Rl[t];Rl[t++]=null;var u=Rl[t];Rl[t++]=null;var d=Rl[t];if(Rl[t++]=null,i!==null&&u!==null){var _=i.pending;_===null?u.next=u:(u.next=_.next,_.next=u),i.pending=u}d!==0&&Mu(n,u,d)}}function Pr(e,t,n,i){Rl[ci++]=e,Rl[ci++]=t,Rl[ci++]=n,Rl[ci++]=i,lo|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function so(e,t,n,i){return Pr(e,t,n,i),Wr(e)}function Ss(e,t){return Pr(e,null,null,t),Wr(e)}function Mu(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var u=!1,d=e.return;d!==null;)d.childLanes|=n,i=d.alternate,i!==null&&(i.childLanes|=n),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(u=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,u&&t!==null&&(u=31-Lt(n),e=d.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=n|536870912),d):null}function Wr(e){if(50<Uo)throw Uo=0,dh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vs={};function vd(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pl(e,t,n,i){return new vd(e,t,n,i)}function er(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rs(e,t){var n=e.alternate;return n===null?(n=pl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ao(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function tr(e,t,n,i,u,d){var _=0;if(i=e,typeof e=="function")er(e)&&(_=1);else if(typeof e=="string")_=L0(e,n,ve.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=pl(31,n,t,u),e.elementType=W,e.lanes=d,e;case A:return Qs(n.children,u,d,t);case C:_=8,u|=24;break;case J:return e=pl(12,n,t,u|2),e.elementType=J,e.lanes=d,e;case q:return e=pl(13,n,t,u),e.elementType=q,e.lanes=d,e;case B:return e=pl(19,n,t,u),e.elementType=B,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:_=10;break e;case le:_=9;break e;case H:_=11;break e;case M:_=14;break e;case R:_=16,i=null;break e}_=29,n=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=pl(_,n,t,u),t.elementType=e,t.type=i,t.lanes=d,t}function Qs(e,t,n,i){return e=pl(7,e,i,t),e.lanes=n,e}function io(e,t,n){return e=pl(6,e,null,t),e.lanes=n,e}function ro(e){var t=pl(18,null,null,0);return t.stateNode=e,t}function ec(e,t,n){return t=pl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ru=new WeakMap;function ml(e,t){if(typeof e=="object"&&e!==null){var n=Ru.get(e);return n!==void 0?n:(t={value:e,source:t,stack:It(t)},Ru.set(e,t),t)}return{value:e,source:t,stack:It(t)}}var Ks=[],ui=0,tc=null,nr=0,Dl=[],Ol=0,Ll=null,Fl=1,cs="";function os(e,t){Ks[ui++]=nr,Ks[ui++]=tc,tc=e,nr=t}function Du(e,t,n){Dl[Ol++]=Fl,Dl[Ol++]=cs,Dl[Ol++]=Ll,Ll=e;var i=Fl;e=cs;var u=32-Lt(i)-1;i&=~(1<<u),n+=1;var d=32-Lt(t)+u;if(30<d){var _=u-u%5;d=(i&(1<<_)-1).toString(32),i>>=_,u-=_,Fl=1<<32-Lt(t)+u|n<<u|i,cs=d+e}else Fl=1<<d|n<<u|i,cs=e}function co(e){e.return!==null&&(os(e,1),Du(e,1,0))}function oo(e){for(;e===tc;)tc=Ks[--ui],Ks[ui]=null,nr=Ks[--ui],Ks[ui]=null;for(;e===Ll;)Ll=Dl[--Ol],Dl[Ol]=null,cs=Dl[--Ol],Dl[Ol]=null,Fl=Dl[--Ol],Dl[Ol]=null}function Ou(e,t){Dl[Ol++]=Fl,Dl[Ol++]=cs,Dl[Ol++]=Ll,Fl=t.id,cs=t.overflow,Ll=e}var Kn=null,Qt=null,dt=!1,Zs=null,zl=!1,uo=Error(c(519));function Fs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lr(ml(t,e)),uo}function Lu(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[cn]=e,t[tt]=i,n){case"dialog":mt("cancel",t),mt("close",t);break;case"iframe":case"object":case"embed":mt("load",t);break;case"video":case"audio":for(n=0;n<Bo.length;n++)mt(Bo[n],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),Vl(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),k(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||nx(t.textContent,n)?(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=Ut),t=!0):t=!1,t||Fs(e,!0)}function fo(e){for(Kn=e.return;Kn;)switch(Kn.tag){case 5:case 31:case 13:zl=!1;return;case 27:case 3:zl=!0;return;default:Kn=Kn.return}}function fi(e){if(e!==Kn)return!1;if(!dt)return fo(e),dt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Eh(e.type,e.memoizedProps)),n=!n),n&&Qt&&Fs(e),fo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Qt=fx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Qt=fx(e)}else t===27?(t=Qt,vi(e.type)?(e=Rh,Rh=null,Qt=e):Qt=t):Qt=Kn?fs(e.stateNode.nextSibling):null;return!0}function Ca(){Qt=Kn=null,dt=!1}function ho(){var e=Zs;return e!==null&&(Gl===null?Gl=e:Gl.push.apply(Gl,e),Zs=null),e}function lr(e){Zs===null?Zs=[e]:Zs.push(e)}var sr=N(null),Ns=null,Ul=null;function Js(e,t,n){U(sr,t._currentValue),t._currentValue=n}function ks(e){e._currentValue=sr.current,ee(sr)}function po(e,t,n){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===n)break;e=e.return}}function mo(e,t,n,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var d=u.dependencies;if(d!==null){var _=u.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=u;for(var D=0;D<t.length;D++)if(w.context===t[D]){d.lanes|=n,w=d.alternate,w!==null&&(w.lanes|=n),po(d.return,n,e),i||(_=null);break e}d=w.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(c(341));_.lanes|=n,d=_.alternate,d!==null&&(d.lanes|=n),po(_,n,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 di(e,t,n,i){e=null;for(var u=t,d=!1;u!==null;){if(!d){if((u.flags&524288)!==0)d=!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 w=u.type;te(u.pendingProps.value,_.value)||(e!==null?e.push(w):e=[w])}}else if(u===Oe.current){if(_=u.alternate,_===null)throw Error(c(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Yo):e=[Yo])}u=u.return}e!==null&&mo(t,e,n,i),t.flags|=262144}function nc(e){for(e=e.firstContext;e!==null;){if(!te(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Aa(e){Ns=e,Ul=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zn(e){return zu(Ns,e)}function lc(e,t){return Ns===null&&Aa(e),zu(e,t)}function zu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ul===null){if(e===null)throw Error(c(308));Ul=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ul=Ul.next=t;return n}var jd=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},wd=l.unstable_scheduleCallback,Sd=l.unstable_NormalPriority,En={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function go(){return{controller:new jd,data:new Map,refCount:0}}function ar(e){e.refCount--,e.refCount===0&&wd(Sd,function(){e.controller.abort()})}var ir=null,sc=0,Ma=0,Es=null;function Jl(e,t){if(ir===null){var n=ir=[];sc=0,Ma=bh(),Es={status:"pending",value:void 0,then:function(i){n.push(i)}}}return sc++,t.then(Hl,Hl),t}function Hl(){if(--sc===0&&ir!==null){Es!==null&&(Es.status="fulfilled");var e=ir;ir=null,Ma=0,Es=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Zt(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),i}var ac=z.S;z.S=function(e,t){kg=Fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jl(e,t),ac!==null&&ac(e,t)};var Ra=N(null);function xo(){var e=Ra.current;return e!==null?e:Kt.pooledCache}function Da(e,t){t===null?U(Ra,Ra.current):U(Ra,t.pool)}function bo(){var e=xo();return e===null?null:{parent:En._currentValue,pool:e}}var Ts=Error(c(460)),rr=Error(c(474)),cr=Error(c(542)),Oa={then:function(){}};function _o(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Uu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ut,Ut),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ic(e),e;default:if(typeof t.status=="string")t.then(Ut,Ut);else{if(e=Kt,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,ic(e),e}throw Ps=t,Ts}}function Pl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ps=n,Ts):n}}var Ps=null;function Hu(){if(Ps===null)throw Error(c(459));var e=Ps;return Ps=null,e}function ic(e){if(e===Ts||e===cr)throw Error(c(483))}var hi=null,Cs=0;function As(e){var t=Cs;return Cs+=1,hi===null&&(hi=[]),Uu(hi,e,t)}function or(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ur(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 yo(e){function t($,L){if(e){var P=$.deletions;P===null?($.deletions=[L],$.flags|=16):P.push(L)}}function n($,L){if(!e)return null;for(;L!==null;)t($,L),L=L.sibling;return null}function i($){for(var L=new Map;$!==null;)$.key!==null?L.set($.key,$):L.set($.index,$),$=$.sibling;return L}function u($,L){return $=rs($,L),$.index=0,$.sibling=null,$}function d($,L,P){return $.index=P,e?(P=$.alternate,P!==null?(P=P.index,P<L?($.flags|=67108866,L):P):($.flags|=67108866,L)):($.flags|=1048576,L)}function _($){return e&&$.alternate===null&&($.flags|=67108866),$}function w($,L,P,de){return L===null||L.tag!==6?(L=io(P,$.mode,de),L.return=$,L):(L=u(L,P),L.return=$,L)}function D($,L,P,de){var Xe=P.type;return Xe===A?ue($,L,P.props.children,de,P.key):L!==null&&(L.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===R&&Pl(Xe)===L.type)?(L=u(L,P.props),or(L,P),L.return=$,L):(L=tr(P.type,P.key,P.props,null,$.mode,de),or(L,P),L.return=$,L)}function ne($,L,P,de){return L===null||L.tag!==4||L.stateNode.containerInfo!==P.containerInfo||L.stateNode.implementation!==P.implementation?(L=ec(P,$.mode,de),L.return=$,L):(L=u(L,P.children||[]),L.return=$,L)}function ue($,L,P,de,Xe){return L===null||L.tag!==7?(L=Qs(P,$.mode,de,Xe),L.return=$,L):(L=u(L,P),L.return=$,L)}function me($,L,P){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=io(""+L,$.mode,P),L.return=$,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case T:return P=tr(L.type,L.key,L.props,null,$.mode,P),or(P,L),P.return=$,P;case S:return L=ec(L,$.mode,P),L.return=$,L;case R:return L=Pl(L),me($,L,P)}if(Ne(L)||Z(L))return L=Qs(L,$.mode,P,null),L.return=$,L;if(typeof L.then=="function")return me($,As(L),P);if(L.$$typeof===Y)return me($,lc($,L),P);ur($,L)}return null}function se($,L,P,de){var Xe=L!==null?L.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return Xe!==null?null:w($,L,""+P,de);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case T:return P.key===Xe?D($,L,P,de):null;case S:return P.key===Xe?ne($,L,P,de):null;case R:return P=Pl(P),se($,L,P,de)}if(Ne(P)||Z(P))return Xe!==null?null:ue($,L,P,de,null);if(typeof P.then=="function")return se($,L,As(P),de);if(P.$$typeof===Y)return se($,L,lc($,P),de);ur($,P)}return null}function ie($,L,P,de,Xe){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return $=$.get(P)||null,w(L,$,""+de,Xe);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case T:return $=$.get(de.key===null?P:de.key)||null,D(L,$,de,Xe);case S:return $=$.get(de.key===null?P:de.key)||null,ne(L,$,de,Xe);case R:return de=Pl(de),ie($,L,P,de,Xe)}if(Ne(de)||Z(de))return $=$.get(P)||null,ue(L,$,de,Xe,null);if(typeof de.then=="function")return ie($,L,P,As(de),Xe);if(de.$$typeof===Y)return ie($,L,P,lc(L,de),Xe);ur(L,de)}return null}function He($,L,P,de){for(var Xe=null,Nt=null,Ie=L,rt=L=0,xt=null;Ie!==null&&rt<P.length;rt++){Ie.index>rt?(xt=Ie,Ie=null):xt=Ie.sibling;var kt=se($,Ie,P[rt],de);if(kt===null){Ie===null&&(Ie=xt);break}e&&Ie&&kt.alternate===null&&t($,Ie),L=d(kt,L,rt),Nt===null?Xe=kt:Nt.sibling=kt,Nt=kt,Ie=xt}if(rt===P.length)return n($,Ie),dt&&os($,rt),Xe;if(Ie===null){for(;rt<P.length;rt++)Ie=me($,P[rt],de),Ie!==null&&(L=d(Ie,L,rt),Nt===null?Xe=Ie:Nt.sibling=Ie,Nt=Ie);return dt&&os($,rt),Xe}for(Ie=i(Ie);rt<P.length;rt++)xt=ie(Ie,$,rt,P[rt],de),xt!==null&&(e&&xt.alternate!==null&&Ie.delete(xt.key===null?rt:xt.key),L=d(xt,L,rt),Nt===null?Xe=xt:Nt.sibling=xt,Nt=xt);return e&&Ie.forEach(function(ki){return t($,ki)}),dt&&os($,rt),Xe}function Ke($,L,P,de){if(P==null)throw Error(c(151));for(var Xe=null,Nt=null,Ie=L,rt=L=0,xt=null,kt=P.next();Ie!==null&&!kt.done;rt++,kt=P.next()){Ie.index>rt?(xt=Ie,Ie=null):xt=Ie.sibling;var ki=se($,Ie,kt.value,de);if(ki===null){Ie===null&&(Ie=xt);break}e&&Ie&&ki.alternate===null&&t($,Ie),L=d(ki,L,rt),Nt===null?Xe=ki:Nt.sibling=ki,Nt=ki,Ie=xt}if(kt.done)return n($,Ie),dt&&os($,rt),Xe;if(Ie===null){for(;!kt.done;rt++,kt=P.next())kt=me($,kt.value,de),kt!==null&&(L=d(kt,L,rt),Nt===null?Xe=kt:Nt.sibling=kt,Nt=kt);return dt&&os($,rt),Xe}for(Ie=i(Ie);!kt.done;rt++,kt=P.next())kt=ie(Ie,$,rt,kt.value,de),kt!==null&&(e&&kt.alternate!==null&&Ie.delete(kt.key===null?rt:kt.key),L=d(kt,L,rt),Nt===null?Xe=kt:Nt.sibling=kt,Nt=kt);return e&&Ie.forEach(function(V0){return t($,V0)}),dt&&os($,rt),Xe}function $t($,L,P,de){if(typeof P=="object"&&P!==null&&P.type===A&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case T:e:{for(var Xe=P.key;L!==null;){if(L.key===Xe){if(Xe=P.type,Xe===A){if(L.tag===7){n($,L.sibling),de=u(L,P.props.children),de.return=$,$=de;break e}}else if(L.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===R&&Pl(Xe)===L.type){n($,L.sibling),de=u(L,P.props),or(de,P),de.return=$,$=de;break e}n($,L);break}else t($,L);L=L.sibling}P.type===A?(de=Qs(P.props.children,$.mode,de,P.key),de.return=$,$=de):(de=tr(P.type,P.key,P.props,null,$.mode,de),or(de,P),de.return=$,$=de)}return _($);case S:e:{for(Xe=P.key;L!==null;){if(L.key===Xe)if(L.tag===4&&L.stateNode.containerInfo===P.containerInfo&&L.stateNode.implementation===P.implementation){n($,L.sibling),de=u(L,P.children||[]),de.return=$,$=de;break e}else{n($,L);break}else t($,L);L=L.sibling}de=ec(P,$.mode,de),de.return=$,$=de}return _($);case R:return P=Pl(P),$t($,L,P,de)}if(Ne(P))return He($,L,P,de);if(Z(P)){if(Xe=Z(P),typeof Xe!="function")throw Error(c(150));return P=Xe.call(P),Ke($,L,P,de)}if(typeof P.then=="function")return $t($,L,As(P),de);if(P.$$typeof===Y)return $t($,L,lc($,P),de);ur($,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,L!==null&&L.tag===6?(n($,L.sibling),de=u(L,P),de.return=$,$=de):(n($,L),de=io(P,$.mode,de),de.return=$,$=de),_($)):n($,L)}return function($,L,P,de){try{Cs=0;var Xe=$t($,L,P,de);return hi=null,Xe}catch(Ie){if(Ie===Ts||Ie===cr)throw Ie;var Nt=pl(29,Ie,null,$.mode);return Nt.lanes=de,Nt.return=$,Nt}finally{}}}var La=yo(!0),Bu=yo(!1),Ms=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(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 Ws(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ea(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Tt&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=Wr(e),Mu(e,null,n),t}return Pr(e,i,t,n),Wr(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,vn(e,n)}}function cc(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var _={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};d===null?u=d=_:d=d.next=_,n=n.next}while(n!==null);d===null?u=d=t:d=d.next=t}else u=d=t;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var jo=!1;function us(){if(jo){var e=Es;if(e!==null)throw e}}function Ua(e,t,n,i){jo=!1;var u=e.updateQueue;Ms=!1;var d=u.firstBaseUpdate,_=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var D=w,ne=D.next;D.next=null,_===null?d=ne:_.next=ne,_=D;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,w=ue.lastBaseUpdate,w!==_&&(w===null?ue.firstBaseUpdate=ne:w.next=ne,ue.lastBaseUpdate=D))}if(d!==null){var me=u.baseState;_=0,ue=ne=D=null,w=d;do{var se=w.lane&-536870913,ie=se!==w.lane;if(ie?(gt&se)===se:(i&se)===se){se!==0&&se===Ma&&(jo=!0),ue!==null&&(ue=ue.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var He=e,Ke=w;se=t;var $t=n;switch(Ke.tag){case 1:if(He=Ke.payload,typeof He=="function"){me=He.call($t,me,se);break e}me=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Ke.payload,se=typeof He=="function"?He.call($t,me,se):He,se==null)break e;me=j({},me,se);break e;case 2:Ms=!0}}se=w.callback,se!==null&&(e.flags|=64,ie&&(e.flags|=8192),ie=u.callbacks,ie===null?u.callbacks=[se]:ie.push(se))}else ie={lane:se,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ue===null?(ne=ue=ie,D=me):ue=ue.next=ie,_|=se;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;ie=w,w=ie.next,ie.next=null,u.lastBaseUpdate=ie,u.shared.pending=null}}while(!0);ue===null&&(D=me),u.baseState=D,u.firstBaseUpdate=ne,u.lastBaseUpdate=ue,d===null&&(u.shared.lanes=0),gi|=_,e.lanes=_,e.memoizedState=me}}function Iu(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Iu(n[e],t)}var Ha=N(null),p=N(0);function O(e,t){e=Qa,U(p,e),U(Ha,t),Qa=e|t.baseLanes}function ce(){U(p,Qa),U(Ha,Ha.current)}function Ae(){Qa=p.current,ee(Ha),ee(p)}var it=N(null),Rt=null;function In(e){var t=e.alternate;U(fe,fe.current&1),U(it,e),Rt===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Rt=e)}function Ba(e){U(fe,fe.current),U(it,e),Rt===null&&(Rt=e)}function So(e){e.tag===22?(U(fe,fe.current),U(it,e),Rt===null&&(Rt=e)):Rs()}function Rs(){U(fe,fe.current),U(it,it.current)}function gl(e){ee(it),Rt===e&&(Rt=null),ee(fe)}var fe=N(0);function Ee(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ah(n)||Mh(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ze=0,Ce=null,Ue=null,ht=null,oc=!1,uc=!1,fr=!1,qu=0,No=0,fc=null,zy=0;function Tn(){throw Error(c(321))}function Nd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!te(e[n],t[n]))return!1;return!0}function kd(e,t,n,i,u,d){return ze=d,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Um:qd,fr=!1,d=n(i,u),fr=!1,uc&&(d=nm(t,n,i,u)),tm(e),d}function tm(e){z.H=To;var t=Ue!==null&&Ue.next!==null;if(ze=0,ht=Ue=Ce=null,oc=!1,No=0,fc=null,t)throw Error(c(300));e===null||qn||(e=e.dependencies,e!==null&&nc(e)&&(qn=!0))}function nm(e,t,n,i){Ce=e;var u=0;do{if(uc&&(fc=null),No=0,uc=!1,25<=u)throw Error(c(301));if(u+=1,ht=Ue=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}z.H=Hm,d=t(n,i)}while(uc);return d}function Uy(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?ko(t):t,e=e.useState()[0],(Ue!==null?Ue.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Ed(){var e=qu!==0;return qu=0,e}function Td(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Cd(e){if(oc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oc=!1}ze=0,ht=Ue=Ce=null,uc=!1,No=qu=0,fc=null}function kl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ce.memoizedState=ht=e:ht=ht.next=e,ht}function Ln(){if(Ue===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=ht===null?Ce.memoizedState:ht.next;if(t!==null)ht=t,Ue=e;else{if(e===null)throw Ce.alternate===null?Error(c(467)):Error(c(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},ht===null?Ce.memoizedState=ht=e:ht=ht.next=e}return ht}function Gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=No;return No+=1,fc===null&&(fc=[]),e=Uu(fc,e,t),t=Ce,(ht===null?t.memoizedState:ht.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Um:qd),e}function $u(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ko(e);if(e.$$typeof===Y)return Zn(e)}throw Error(c(438,String(e)))}function Ad(e){var t=null,n=Ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=Ce.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}),n===null&&(n=Gu(),Ce.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=oe;return t.index++,n}function Ia(e,t){return typeof t=="function"?t(e):t}function Yu(e){var t=Ln();return Md(t,Ue,e)}function Md(e,t,n){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=n;var u=e.baseQueue,d=i.pending;if(d!==null){if(u!==null){var _=u.next;u.next=d.next,d.next=_}t.baseQueue=u=d,i.pending=null}if(d=e.baseState,u===null)e.memoizedState=d;else{t=u.next;var w=_=null,D=null,ne=t,ue=!1;do{var me=ne.lane&-536870913;if(me!==ne.lane?(gt&me)===me:(ze&me)===me){var se=ne.revertLane;if(se===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),me===Ma&&(ue=!0);else if((ze&se)===se){ne=ne.next,se===Ma&&(ue=!0);continue}else me={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},D===null?(w=D=me,_=d):D=D.next=me,Ce.lanes|=se,gi|=se;me=ne.action,fr&&n(d,me),d=ne.hasEagerState?ne.eagerState:n(d,me)}else se={lane:me,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},D===null?(w=D=se,_=d):D=D.next=se,Ce.lanes|=me,gi|=me;ne=ne.next}while(ne!==null&&ne!==t);if(D===null?_=d:D.next=w,!te(d,e.memoizedState)&&(qn=!0,ue&&(n=Es,n!==null)))throw n;e.memoizedState=d,e.baseState=_,e.baseQueue=D,i.lastRenderedState=d}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Rd(e){var t=Ln(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var i=n.dispatch,u=n.pending,d=t.memoizedState;if(u!==null){n.pending=null;var _=u=u.next;do d=e(d,_.action),_=_.next;while(_!==u);te(d,t.memoizedState)||(qn=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,i]}function lm(e,t,n){var i=Ce,u=Ln(),d=dt;if(d){if(n===void 0)throw Error(c(407));n=n()}else n=t();var _=!te((Ue||u).memoizedState,n);if(_&&(u.memoizedState=n,qn=!0),u=u.queue,Ld(im.bind(null,i,u,e),[e]),u.getSnapshot!==t||_||ht!==null&&ht.memoizedState.tag&1){if(i.flags|=2048,dc(9,{destroy:void 0},am.bind(null,i,u,n,t),null),Kt===null)throw Error(c(349));d||(ze&127)!==0||sm(i,t,n)}return n}function sm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t=Gu(),Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function am(e,t,n,i){t.value=n,t.getSnapshot=i,rm(t)&&cm(e)}function im(e,t,n){return n(function(){rm(t)&&cm(e)})}function rm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!te(e,n)}catch{return!0}}function cm(e){var t=Ss(e,2);t!==null&&$l(t,e,2)}function Dd(e){var t=kl();if(typeof e=="function"){var n=e;if(e=n(),fr){An(!0);try{n()}finally{An(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:e},t}function om(e,t,n,i){return e.baseState=n,Md(e,Ue,typeof i=="function"?i:Ia)}function Hy(e,t,n,i,u){if(Qu(e))throw Error(c(485));if(e=t.action,e!==null){var d={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){d.listeners.push(_)}};z.T!==null?n(!0):d.isTransition=!1,i(d),n=t.pending,n===null?(d.next=t.pending=d,um(t,d)):(d.next=n.next,t.pending=n.next=d)}}function um(e,t){var n=t.action,i=t.payload,u=e.state;if(t.isTransition){var d=z.T,_={};z.T=_;try{var w=n(u,i),D=z.S;D!==null&&D(_,w),fm(e,t,w)}catch(ne){Od(e,t,ne)}finally{d!==null&&_.types!==null&&(d.types=_.types),z.T=d}}else try{d=n(u,i),fm(e,t,d)}catch(ne){Od(e,t,ne)}}function fm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){dm(e,t,i)},function(i){return Od(e,t,i)}):dm(e,t,n)}function dm(e,t,n){t.status="fulfilled",t.value=n,hm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,um(e,n)))}function Od(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,hm(t),t=t.next;while(t!==i)}e.action=null}function hm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pm(e,t){return t}function mm(e,t){if(dt){var n=Kt.formState;if(n!==null){e:{var i=Ce;if(dt){if(Qt){t:{for(var u=Qt,d=zl;u.nodeType!==8;){if(!d){u=null;break t}if(u=fs(u.nextSibling),u===null){u=null;break t}}d=u.data,u=d==="F!"||d==="F"?u:null}if(u){Qt=fs(u.nextSibling),i=u.data==="F!";break e}}Fs(i)}i=!1}i&&(t=n[0])}}return n=kl(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pm,lastRenderedState:t},n.queue=i,n=Om.bind(null,Ce,i),i.dispatch=n,i=Dd(!1),d=Id.bind(null,Ce,!1,i.queue),i=kl(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,n=Hy.bind(null,Ce,u,d,n),u.dispatch=n,i.memoizedState=e,[t,n,!1]}function gm(e){var t=Ln();return xm(t,Ue,e)}function xm(e,t,n){if(t=Md(e,t,pm)[0],e=Yu(Ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=ko(t)}catch(_){throw _===Ts?cr:_}else i=t;t=Ln();var u=t.queue,d=u.dispatch;return n!==t.memoizedState&&(Ce.flags|=2048,dc(9,{destroy:void 0},By.bind(null,u,n),null)),[i,d,e]}function By(e,t){e.action=t}function bm(e){var t=Ln(),n=Ue;if(n!==null)return xm(t,n,e);Ln(),t=t.memoizedState,n=Ln();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function dc(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Gu(),Ce.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function _m(){return Ln().memoizedState}function Xu(e,t,n,i){var u=kl();Ce.flags|=e,u.memoizedState=dc(1|t,{destroy:void 0},n,i===void 0?null:i)}function Vu(e,t,n,i){var u=Ln();i=i===void 0?null:i;var d=u.memoizedState.inst;Ue!==null&&i!==null&&Nd(i,Ue.memoizedState.deps)?u.memoizedState=dc(t,d,n,i):(Ce.flags|=e,u.memoizedState=dc(1|t,d,n,i))}function ym(e,t){Xu(8390656,8,e,t)}function Ld(e,t){Vu(2048,8,e,t)}function Iy(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=Gu(),Ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vm(e){var t=Ln().memoizedState;return Iy({ref:t,nextImpl:e}),function(){if((Tt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function jm(e,t){return Vu(4,2,e,t)}function wm(e,t){return Vu(4,4,e,t)}function Sm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Nm(e,t,n){n=n!=null?n.concat([e]):null,Vu(4,4,Sm.bind(null,t,e),n)}function zd(){}function km(e,t){var n=Ln();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Nd(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Em(e,t){var n=Ln();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Nd(t,i[1]))return i[0];if(i=e(),fr){An(!0);try{e()}finally{An(!1)}}return n.memoizedState=[i,t],i}function Ud(e,t,n){return n===void 0||(ze&1073741824)!==0&&(gt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Tg(),Ce.lanes|=e,gi|=e,n)}function Tm(e,t,n,i){return te(n,t)?n:Ha.current!==null?(e=Ud(e,n,i),te(e,t)||(qn=!0),e):(ze&42)===0||(ze&1073741824)!==0&&(gt&261930)===0?(qn=!0,e.memoizedState=n):(e=Tg(),Ce.lanes|=e,gi|=e,t)}function Cm(e,t,n,i,u){var d=I.p;I.p=d!==0&&8>d?d:8;var _=z.T,w={};z.T=w,Id(e,!1,t,n);try{var D=u(),ne=z.S;if(ne!==null&&ne(w,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ue=Zt(D,i);Eo(e,t,ue,ts(e))}else Eo(e,t,i,ts(e))}catch(me){Eo(e,t,{then:function(){},status:"rejected",reason:me},ts())}finally{I.p=d,_!==null&&w.types!==null&&(_.types=w.types),z.T=_}}function qy(){}function Hd(e,t,n,i){if(e.tag!==5)throw Error(c(476));var u=Am(e).queue;Cm(e,u,t,V,n===null?qy:function(){return Mm(e),n(i)})}function Am(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:V},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Mm(e){var t=Am(e);t.next===null&&(t=e.alternate.memoizedState),Eo(e,t.next.queue,{},ts())}function Bd(){return Zn(Yo)}function Rm(){return Ln().memoizedState}function Dm(){return Ln().memoizedState}function Gy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ts();e=Ws(n);var i=ea(t,e,n);i!==null&&($l(i,t,n),za(i,t,n)),t={cache:go()},e.payload=t;return}t=t.return}}function $y(e,t,n){var i=ts();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Qu(e)?Lm(t,n):(n=so(e,t,n,i),n!==null&&($l(n,e,i),zm(n,t,i)))}function Om(e,t,n){var i=ts();Eo(e,t,n,i)}function Eo(e,t,n,i){var u={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qu(e))Lm(t,u);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var _=t.lastRenderedState,w=d(_,n);if(u.hasEagerState=!0,u.eagerState=w,te(w,_))return Pr(e,t,u,0),Kt===null&&oi(),!1}catch{}finally{}if(n=so(e,t,u,i),n!==null)return $l(n,e,i),zm(n,t,i),!0}return!1}function Id(e,t,n,i){if(i={lane:2,revertLane:bh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Qu(e)){if(t)throw Error(c(479))}else t=so(e,n,i,2),t!==null&&$l(t,e,2)}function Qu(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Lm(e,t){uc=oc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zm(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,vn(e,n)}}var To={readContext:Zn,use:$u,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn};To.useEffectEvent=Tn;var Um={readContext:Zn,use:$u,useCallback:function(e,t){return kl().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:ym,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Xu(4194308,4,Sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xu(4194308,4,e,t)},useInsertionEffect:function(e,t){Xu(4,2,e,t)},useMemo:function(e,t){var n=kl();t=t===void 0?null:t;var i=e();if(fr){An(!0);try{e()}finally{An(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=kl();if(n!==void 0){var u=n(t);if(fr){An(!0);try{n(t)}finally{An(!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=$y.bind(null,Ce,e),[i.memoizedState,e]},useRef:function(e){var t=kl();return e={current:e},t.memoizedState=e},useState:function(e){e=Dd(e);var t=e.queue,n=Om.bind(null,Ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:zd,useDeferredValue:function(e,t){var n=kl();return Ud(n,e,t)},useTransition:function(){var e=Dd(!1);return e=Cm.bind(null,Ce,e.queue,!0,!1),kl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ce,u=kl();if(dt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Kt===null)throw Error(c(349));(gt&127)!==0||sm(i,t,n)}u.memoizedState=n;var d={value:n,getSnapshot:t};return u.queue=d,ym(im.bind(null,i,d,e),[e]),i.flags|=2048,dc(9,{destroy:void 0},am.bind(null,i,d,n,t),null),n},useId:function(){var e=kl(),t=Kt.identifierPrefix;if(dt){var n=cs,i=Fl;n=(i&~(1<<32-Lt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=qu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=zy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bd,useFormState:mm,useActionState:mm,useOptimistic:function(e){var t=kl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Id.bind(null,Ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ad,useCacheRefresh:function(){return kl().memoizedState=Gy.bind(null,Ce)},useEffectEvent:function(e){var t=kl(),n={impl:e};return t.memoizedState=n,function(){if((Tt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},qd={readContext:Zn,use:$u,useCallback:km,useContext:Zn,useEffect:Ld,useImperativeHandle:Nm,useInsertionEffect:jm,useLayoutEffect:wm,useMemo:Em,useReducer:Yu,useRef:_m,useState:function(){return Yu(Ia)},useDebugValue:zd,useDeferredValue:function(e,t){var n=Ln();return Tm(n,Ue.memoizedState,e,t)},useTransition:function(){var e=Yu(Ia)[0],t=Ln().memoizedState;return[typeof e=="boolean"?e:ko(e),t]},useSyncExternalStore:lm,useId:Rm,useHostTransitionStatus:Bd,useFormState:gm,useActionState:gm,useOptimistic:function(e,t){var n=Ln();return om(n,Ue,e,t)},useMemoCache:Ad,useCacheRefresh:Dm};qd.useEffectEvent=vm;var Hm={readContext:Zn,use:$u,useCallback:km,useContext:Zn,useEffect:Ld,useImperativeHandle:Nm,useInsertionEffect:jm,useLayoutEffect:wm,useMemo:Em,useReducer:Rd,useRef:_m,useState:function(){return Rd(Ia)},useDebugValue:zd,useDeferredValue:function(e,t){var n=Ln();return Ue===null?Ud(n,e,t):Tm(n,Ue.memoizedState,e,t)},useTransition:function(){var e=Rd(Ia)[0],t=Ln().memoizedState;return[typeof e=="boolean"?e:ko(e),t]},useSyncExternalStore:lm,useId:Rm,useHostTransitionStatus:Bd,useFormState:bm,useActionState:bm,useOptimistic:function(e,t){var n=Ln();return Ue!==null?om(n,Ue,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ad,useCacheRefresh:Dm};Hm.useEffectEvent=vm;function Gd(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $d={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ts(),u=Ws(i);u.payload=t,n!=null&&(u.callback=n),t=ea(e,u,i),t!==null&&($l(t,e,i),za(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ts(),u=Ws(i);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ea(e,u,i),t!==null&&($l(t,e,i),za(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ts(),i=Ws(n);i.tag=2,t!=null&&(i.callback=t),t=ea(e,i,n),t!==null&&($l(t,e,n),za(t,e,n))}};function Bm(e,t,n,i,u,d,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,d,_):t.prototype&&t.prototype.isPureReactComponent?!is(n,i)||!is(u,d):!0}function Im(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&$d.enqueueReplaceState(t,t.state,null)}function dr(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function qm(e){Jr(e)}function Gm(e){console.error(e)}function $m(e){Jr(e)}function Ku(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Ym(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Yd(e,t,n){return n=Ws(n),n.tag=3,n.payload={element:null},n.callback=function(){Ku(e,t)},n}function Xm(e){return e=Ws(e),e.tag=3,e}function Vm(e,t,n,i){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var d=i.value;e.payload=function(){return u(d)},e.callback=function(){Ym(t,n,i)}}var _=n.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Ym(t,n,i),typeof u!="function"&&(xi===null?xi=new Set([this]):xi.add(this));var w=i.stack;this.componentDidCatch(i.value,{componentStack:w!==null?w:""})})}function Yy(e,t,n,i,u){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&di(t,n,u,!0),n=it.current,n!==null){switch(n.tag){case 31:case 13:return Rt===null?rf():n.alternate===null&&Cn===0&&(Cn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,i===Oa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),mh(e,i,u)),!1;case 22:return n.flags|=65536,i===Oa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),mh(e,i,u)),!1}throw Error(c(435,n.tag))}return mh(e,i,u),rf(),!1}if(dt)return t=it.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==uo&&(e=Error(c(422),{cause:i}),lr(ml(e,n)))):(i!==uo&&(t=Error(c(423),{cause:i}),lr(ml(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=ml(i,n),u=Yd(e.stateNode,i,u),cc(e,u),Cn!==4&&(Cn=2)),!1;var d=Error(c(520),{cause:i});if(d=ml(d,n),zo===null?zo=[d]:zo.push(d),Cn!==4&&(Cn=2),t===null)return!0;i=ml(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Yd(n.stateNode,i,e),cc(n,e),!1;case 1:if(t=n.type,d=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(xi===null||!xi.has(d))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Xm(u),Vm(u,e,n,i),cc(n,u),!1}n=n.return}while(n!==null);return!1}var Xd=Error(c(461)),qn=!1;function sl(e,t,n,i){t.child=e===null?Bu(t,null,n,i):La(t,e.child,n,i)}function Qm(e,t,n,i,u){n=n.render;var d=t.ref;if("ref"in i){var _={};for(var w in i)w!=="ref"&&(_[w]=i[w])}else _=i;return Aa(t),i=kd(e,t,n,_,d,u),w=Ed(),e!==null&&!qn?(Td(e,t,u),qa(e,t,u)):(dt&&w&&co(t),t.flags|=1,sl(e,t,i,u),t.child)}function Km(e,t,n,i,u){if(e===null){var d=n.type;return typeof d=="function"&&!er(d)&&d.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=d,Zm(e,t,d,i,u)):(e=tr(n.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Wd(e,u)){var _=d.memoizedProps;if(n=n.compare,n=n!==null?n:is,n(_,i)&&e.ref===t.ref)return qa(e,t,u)}return t.flags|=1,e=rs(d,i),e.ref=t.ref,e.return=t,t.child=e}function Zm(e,t,n,i,u){if(e!==null){var d=e.memoizedProps;if(is(d,i)&&e.ref===t.ref)if(qn=!1,t.pendingProps=i=d,Wd(e,u))(e.flags&131072)!==0&&(qn=!0);else return t.lanes=e.lanes,qa(e,t,u)}return Vd(e,t,n,i,u)}function Fm(e,t,n,i){var u=i.children,d=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(d=d!==null?d.baseLanes|n:n,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~d}else i=0,t.child=null;return Jm(e,t,d,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Da(t,d!==null?d.cachePool:null),d!==null?O(t,d):ce(),So(t);else return i=t.lanes=536870912,Jm(e,t,d!==null?d.baseLanes|n:n,n,i)}else d!==null?(Da(t,d.cachePool),O(t,d),Rs(),t.memoizedState=null):(e!==null&&Da(t,null),ce(),Rs());return sl(e,t,u,n),t.child}function Co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jm(e,t,n,i,u){var d=xo();return d=d===null?null:{parent:En._currentValue,pool:d},t.memoizedState={baseLanes:n,cachePool:d},e!==null&&Da(t,null),ce(),So(t),e!==null&&di(e,t,i,!0),t.childLanes=u,null}function Zu(e,t){return t=Ju({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Pm(e,t,n){return La(t,e.child,null,n),e=Zu(t,t.pendingProps),e.flags|=2,gl(t),t.memoizedState=null,e}function Xy(e,t,n){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(dt){if(i.mode==="hidden")return e=Zu(t,i),t.lanes=536870912,Co(null,e);if(Ba(t),(e=Qt)?(e=ux(e,zl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ll!==null?{id:Fl,overflow:cs}:null,retryLane:536870912,hydrationErrors:null},n=ro(e),n.return=t,t.child=n,Kn=t,Qt=null)):e=null,e===null)throw Fs(t);return t.lanes=536870912,null}return Zu(t,i)}var d=e.memoizedState;if(d!==null){var _=d.dehydrated;if(Ba(t),u)if(t.flags&256)t.flags&=-257,t=Pm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(qn||di(e,t,n,!1),u=(n&e.childLanes)!==0,qn||u){if(i=Kt,i!==null&&(_=ls(i,n),_!==0&&_!==d.retryLane))throw d.retryLane=_,Ss(e,_),$l(i,e,_),Xd;rf(),t=Pm(e,t,n)}else e=d.treeContext,Qt=fs(_.nextSibling),Kn=t,dt=!0,Zs=null,zl=!1,e!==null&&Ou(t,e),t=Zu(t,i),t.flags|=4096;return t}return e=rs(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Vd(e,t,n,i,u){return Aa(t),n=kd(e,t,n,i,void 0,u),i=Ed(),e!==null&&!qn?(Td(e,t,u),qa(e,t,u)):(dt&&i&&co(t),t.flags|=1,sl(e,t,n,u),t.child)}function Wm(e,t,n,i,u,d){return Aa(t),t.updateQueue=null,n=nm(t,i,n,u),tm(e),i=Ed(),e!==null&&!qn?(Td(e,t,d),qa(e,t,d)):(dt&&i&&co(t),t.flags|=1,sl(e,t,n,d),t.child)}function eg(e,t,n,i,u){if(Aa(t),t.stateNode===null){var d=Vs,_=n.contextType;typeof _=="object"&&_!==null&&(d=Zn(_)),d=new n(i,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=$d,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=i,d.state=t.memoizedState,d.refs={},rc(t),_=n.contextType,d.context=typeof _=="object"&&_!==null?Zn(_):Vs,d.state=t.memoizedState,_=n.getDerivedStateFromProps,typeof _=="function"&&(Gd(t,n,_,i),d.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(_=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),_!==d.state&&$d.enqueueReplaceState(d,d.state,null),Ua(t,i,d,u),us(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){d=t.stateNode;var w=t.memoizedProps,D=dr(n,w);d.props=D;var ne=d.context,ue=n.contextType;_=Vs,typeof ue=="object"&&ue!==null&&(_=Zn(ue));var me=n.getDerivedStateFromProps;ue=typeof me=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ue||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||ne!==_)&&Im(t,d,i,_),Ms=!1;var se=t.memoizedState;d.state=se,Ua(t,i,d,u),us(),ne=t.memoizedState,w||se!==ne||Ms?(typeof me=="function"&&(Gd(t,n,me,i),ne=t.memoizedState),(D=Ms||Bm(t,n,D,i,se,ne,_))?(ue||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=ne),d.props=i,d.state=ne,d.context=_,i=D):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{d=t.stateNode,vo(e,t),_=t.memoizedProps,ue=dr(n,_),d.props=ue,me=t.pendingProps,se=d.context,ne=n.contextType,D=Vs,typeof ne=="object"&&ne!==null&&(D=Zn(ne)),w=n.getDerivedStateFromProps,(ne=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(_!==me||se!==D)&&Im(t,d,i,D),Ms=!1,se=t.memoizedState,d.state=se,Ua(t,i,d,u),us();var ie=t.memoizedState;_!==me||se!==ie||Ms||e!==null&&e.dependencies!==null&&nc(e.dependencies)?(typeof w=="function"&&(Gd(t,n,w,i),ie=t.memoizedState),(ue=Ms||Bm(t,n,ue,i,se,ie,D)||e!==null&&e.dependencies!==null&&nc(e.dependencies))?(ne||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(i,ie,D),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(i,ie,D)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||_===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ie),d.props=i,d.state=ie,d.context=D,i=ue):(typeof d.componentDidUpdate!="function"||_===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),i=!1)}return d=i,Fu(e,t),i=(t.flags&128)!==0,d||i?(d=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&i?(t.child=La(t,e.child,null,u),t.child=La(t,null,n,u)):sl(e,t,n,u),t.memoizedState=d.state,e=t.child):e=qa(e,t,u),e}function tg(e,t,n,i){return Ca(),t.flags|=256,sl(e,t,n,i),t.child}var Qd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kd(e){return{baseLanes:e,cachePool:bo()}}function Zd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=es),e}function ng(e,t,n){var i=t.pendingProps,u=!1,d=(t.flags&128)!==0,_;if((_=d)||(_=e!==null&&e.memoizedState===null?!1:(fe.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(dt){if(u?In(t):Rs(),(e=Qt)?(e=ux(e,zl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ll!==null?{id:Fl,overflow:cs}:null,retryLane:536870912,hydrationErrors:null},n=ro(e),n.return=t,t.child=n,Kn=t,Qt=null)):e=null,e===null)throw Fs(t);return Mh(e)?t.lanes=32:t.lanes=536870912,null}var w=i.children;return i=i.fallback,u?(Rs(),u=t.mode,w=Ju({mode:"hidden",children:w},u),i=Qs(i,u,n,null),w.return=t,i.return=t,w.sibling=i,t.child=w,i=t.child,i.memoizedState=Kd(n),i.childLanes=Zd(e,_,n),t.memoizedState=Qd,Co(null,i)):(In(t),Fd(t,w))}var D=e.memoizedState;if(D!==null&&(w=D.dehydrated,w!==null)){if(d)t.flags&256?(In(t),t.flags&=-257,t=Jd(e,t,n)):t.memoizedState!==null?(Rs(),t.child=e.child,t.flags|=128,t=null):(Rs(),w=i.fallback,u=t.mode,i=Ju({mode:"visible",children:i.children},u),w=Qs(w,u,n,null),w.flags|=2,i.return=t,w.return=t,i.sibling=w,t.child=i,La(t,e.child,null,n),i=t.child,i.memoizedState=Kd(n),i.childLanes=Zd(e,_,n),t.memoizedState=Qd,t=Co(null,i));else if(In(t),Mh(w)){if(_=w.nextSibling&&w.nextSibling.dataset,_)var ne=_.dgst;_=ne,i=Error(c(419)),i.stack="",i.digest=_,lr({value:i,source:null,stack:null}),t=Jd(e,t,n)}else if(qn||di(e,t,n,!1),_=(n&e.childLanes)!==0,qn||_){if(_=Kt,_!==null&&(i=ls(_,n),i!==0&&i!==D.retryLane))throw D.retryLane=i,Ss(e,i),$l(_,e,i),Xd;Ah(w)||rf(),t=Jd(e,t,n)}else Ah(w)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,Qt=fs(w.nextSibling),Kn=t,dt=!0,Zs=null,zl=!1,e!==null&&Ou(t,e),t=Fd(t,i.children),t.flags|=4096);return t}return u?(Rs(),w=i.fallback,u=t.mode,D=e.child,ne=D.sibling,i=rs(D,{mode:"hidden",children:i.children}),i.subtreeFlags=D.subtreeFlags&65011712,ne!==null?w=rs(ne,w):(w=Qs(w,u,n,null),w.flags|=2),w.return=t,i.return=t,i.sibling=w,t.child=i,Co(null,i),i=t.child,w=e.child.memoizedState,w===null?w=Kd(n):(u=w.cachePool,u!==null?(D=En._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=bo(),w={baseLanes:w.baseLanes|n,cachePool:u}),i.memoizedState=w,i.childLanes=Zd(e,_,n),t.memoizedState=Qd,Co(e.child,i)):(In(t),n=e.child,e=n.sibling,n=rs(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=n,t.memoizedState=null,n)}function Fd(e,t){return t=Ju({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ju(e,t){return e=pl(22,e,null,t),e.lanes=0,e}function Jd(e,t,n){return La(t,e.child,null,n),e=Fd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lg(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),po(e.return,t,n)}function Pd(e,t,n,i,u,d){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:u,treeForkCount:d}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=n,_.tailMode=u,_.treeForkCount=d)}function sg(e,t,n){var i=t.pendingProps,u=i.revealOrder,d=i.tail;i=i.children;var _=fe.current,w=(_&2)!==0;if(w?(_=_&1|2,t.flags|=128):_&=1,U(fe,_),sl(e,t,i,n),i=dt?nr:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lg(e,n,t);else if(e.tag===19)lg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&Ee(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Pd(t,!1,u,n,d,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ee(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Pd(t,!0,n,null,d,i);break;case"together":Pd(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function qa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(di(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=rs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Wd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&nc(e)))}function Vy(e,t,n){switch(t.tag){case 3:$e(t,t.stateNode.containerInfo),Js(t,En,e.memoizedState.cache),Ca();break;case 27:case 5:bt(t);break;case 4:$e(t,t.stateNode.containerInfo);break;case 10:Js(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ba(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(In(t),t.flags|=128,null):(n&t.child.childLanes)!==0?ng(e,t,n):(In(t),e=qa(e,t,n),e!==null?e.sibling:null);In(t);break;case 19:var u=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(di(e,t,n,!1),i=(n&t.childLanes)!==0),u){if(i)return sg(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),U(fe,fe.current),i)break;return null;case 22:return t.lanes=0,Fm(e,t,n,t.pendingProps);case 24:Js(t,En,e.memoizedState.cache)}return qa(e,t,n)}function ag(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)qn=!0;else{if(!Wd(e,n)&&(t.flags&128)===0)return qn=!1,Vy(e,t,n);qn=(e.flags&131072)!==0}else qn=!1,dt&&(t.flags&1048576)!==0&&Du(t,nr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Pl(t.elementType),t.type=e,typeof e=="function")er(e)?(i=dr(e,i),t.tag=1,t=eg(null,t,e,i,n)):(t.tag=0,t=Vd(null,t,e,i,n));else{if(e!=null){var u=e.$$typeof;if(u===H){t.tag=11,t=Qm(null,t,e,i,n);break e}else if(u===M){t.tag=14,t=Km(null,t,e,i,n);break e}}throw t=ye(e)||e,Error(c(306,t,""))}}return t;case 0:return Vd(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,u=dr(i,t.pendingProps),eg(e,t,i,u,n);case 3:e:{if($e(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var d=t.memoizedState;u=d.element,vo(e,t),Ua(t,i,null,n);var _=t.memoizedState;if(i=_.cache,Js(t,En,i),i!==d.cache&&mo(t,[En],n,!0),us(),i=_.element,d.isDehydrated)if(d={element:i,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=tg(e,t,i,n);break e}else if(i!==u){u=ml(Error(c(424)),t),lr(u),t=tg(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qt=fs(e.firstChild),Kn=t,dt=!0,Zs=null,zl=!0,n=Bu(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ca(),i===u){t=qa(e,t,n);break e}sl(e,t,i,n)}t=t.child}return t;case 26:return Fu(e,t),e===null?(n=gx(t.type,null,t.pendingProps,null))?t.memoizedState=n:dt||(n=t.type,e=t.pendingProps,i=pf(je.current).createElement(n),i[cn]=t,i[tt]=e,al(i,n,e),Pe(i),t.stateNode=i):t.memoizedState=gx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return bt(t),e===null&&dt&&(i=t.stateNode=hx(t.type,t.pendingProps,je.current),Kn=t,zl=!0,u=Qt,vi(t.type)?(Rh=u,Qt=fs(i.firstChild)):Qt=u),sl(e,t,t.pendingProps.children,n),Fu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&dt&&((u=i=Qt)&&(i=j0(i,t.type,t.pendingProps,zl),i!==null?(t.stateNode=i,Kn=t,Qt=fs(i.firstChild),zl=!1,u=!0):u=!1),u||Fs(t)),bt(t),u=t.type,d=t.pendingProps,_=e!==null?e.memoizedProps:null,i=d.children,Eh(u,d)?i=null:_!==null&&Eh(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=kd(e,t,Uy,null,null,n),Yo._currentValue=u),Fu(e,t),sl(e,t,i,n),t.child;case 6:return e===null&&dt&&((e=n=Qt)&&(n=w0(n,t.pendingProps,zl),n!==null?(t.stateNode=n,Kn=t,Qt=null,e=!0):e=!1),e||Fs(t)),null;case 13:return ng(e,t,n);case 4:return $e(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=La(t,null,i,n):sl(e,t,i,n),t.child;case 11:return Qm(e,t,t.type,t.pendingProps,n);case 7:return sl(e,t,t.pendingProps,n),t.child;case 8:return sl(e,t,t.pendingProps.children,n),t.child;case 12:return sl(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Js(t,t.type,i.value),sl(e,t,i.children,n),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Aa(t),u=Zn(u),i=i(u),t.flags|=1,sl(e,t,i,n),t.child;case 14:return Km(e,t,t.type,t.pendingProps,n);case 15:return Zm(e,t,t.type,t.pendingProps,n);case 19:return sg(e,t,n);case 31:return Xy(e,t,n);case 22:return Fm(e,t,n,t.pendingProps);case 24:return Aa(t),i=Zn(En),e===null?(u=xo(),u===null&&(u=Kt,d=go(),u.pooledCache=d,d.refCount++,d!==null&&(u.pooledCacheLanes|=n),u=d),t.memoizedState={parent:i,cache:u},rc(t),Js(t,En,u)):((e.lanes&n)!==0&&(vo(e,t),Ua(t,null,null,n),us()),u=e.memoizedState,d=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Js(t,En,i)):(i=d.cache,Js(t,En,i),i!==u.cache&&mo(t,[En],n,!0))),sl(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ga(e){e.flags|=4}function eh(e,t,n,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(Rg())e.flags|=8192;else throw Ps=Oa,rr}else e.flags&=-16777217}function ig(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vx(t))if(Rg())e.flags|=8192;else throw Ps=Oa,rr}function Pu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qe():536870912,e.lanes|=t,gc|=t)}function Ao(e,t){if(!dt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function tn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var u=e.child;u!==null;)n|=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;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Qy(e,t,n){var i=t.pendingProps;switch(oo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(t),null;case 1:return tn(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ks(En),Be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fi(t)?Ga(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ho())),tn(t),null;case 26:var u=t.type,d=t.memoizedState;return e===null?(Ga(t),d!==null?(tn(t),ig(t,d)):(tn(t),eh(t,u,null,i,n))):d?d!==e.memoizedState?(Ga(t),tn(t),ig(t,d)):(tn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Ga(t),tn(t),eh(t,u,e,i,n)),null;case 27:if(Qe(t),n=je.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ga(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return tn(t),null}e=ve.current,fi(t)?Lu(t):(e=hx(u,i,n),t.stateNode=e,Ga(t))}return tn(t),null;case 5:if(Qe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ga(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return tn(t),null}if(d=ve.current,fi(t))Lu(t);else{var _=pf(je.current);switch(d){case 1:d=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:d=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":d=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":d=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":d=_.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof i.is=="string"?_.createElement("select",{is:i.is}):_.createElement("select"),i.multiple?d.multiple=!0:i.size&&(d.size=i.size);break;default:d=typeof i.is=="string"?_.createElement(u,{is:i.is}):_.createElement(u)}}d[cn]=t,d[tt]=i;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)d.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=d;e:switch(al(d,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&&Ga(t)}}return tn(t),eh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ga(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=je.current,fi(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,u=Kn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[cn]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||nx(e.nodeValue,n)),e||Fs(t,!0)}else e=pf(e).createTextNode(i),e[cn]=t,t.stateNode=e}return tn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=fi(t),n!==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[cn]=t}else Ca(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tn(t),e=!1}else n=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(gl(t),t):(gl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return tn(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=fi(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[cn]=t}else Ca(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tn(t),u=!1}else u=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(gl(t),t):(gl(t),null)}return gl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==u&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pu(t,t.updateQueue),tn(t),null);case 4:return Be(),e===null&&jh(t.stateNode.containerInfo),tn(t),null;case 10:return ks(t.type),tn(t),null;case 19:if(ee(fe),i=t.memoizedState,i===null)return tn(t),null;if(u=(t.flags&128)!==0,d=i.rendering,d===null)if(u)Ao(i,!1);else{if(Cn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Ee(e),d!==null){for(t.flags|=128,Ao(i,!1),e=d.updateQueue,t.updateQueue=e,Pu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ao(n,e),n=n.sibling;return U(fe,fe.current&1|2),dt&&os(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Fe()>lf&&(t.flags|=128,u=!0,Ao(i,!1),t.lanes=4194304)}else{if(!u)if(e=Ee(d),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Pu(t,e),Ao(i,!0),i.tail===null&&i.tailMode==="hidden"&&!d.alternate&&!dt)return tn(t),null}else 2*Fe()-i.renderingStartTime>lf&&n!==536870912&&(t.flags|=128,u=!0,Ao(i,!1),t.lanes=4194304);i.isBackwards?(d.sibling=t.child,t.child=d):(e=i.last,e!==null?e.sibling=d:t.child=d,i.last=d)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Fe(),e.sibling=null,n=fe.current,U(fe,u?n&1|2:n&1),dt&&os(t,i.treeForkCount),e):(tn(t),null);case 22:case 23:return gl(t),Ae(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(tn(t),t.subtreeFlags&6&&(t.flags|=8192)):tn(t),n=t.updateQueue,n!==null&&Pu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&ee(Ra),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ks(En),tn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Ky(e,t){switch(oo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ks(En),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Qe(t),null;case 31:if(t.memoizedState!==null){if(gl(t),t.alternate===null)throw Error(c(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ee(fe),null;case 4:return Be(),null;case 10:return ks(t.type),null;case 22:case 23:return gl(t),Ae(),e!==null&&ee(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ks(En),null;case 25:return null;default:return null}}function rg(e,t){switch(oo(t),t.tag){case 3:ks(En),Be();break;case 26:case 27:case 5:Qe(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&gl(t);break;case 13:gl(t);break;case 19:ee(fe);break;case 10:ks(t.type);break;case 22:case 23:gl(t),Ae(),e!==null&&ee(Ra);break;case 24:ks(En)}}function Mo(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var u=i.next;n=u;do{if((n.tag&e)===e){i=void 0;var d=n.create,_=n.inst;i=d(),_.destroy=i}n=n.next}while(n!==u)}}catch(w){Bt(t,t.return,w)}}function pi(e,t,n){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var d=u.next;i=d;do{if((i.tag&e)===e){var _=i.inst,w=_.destroy;if(w!==void 0){_.destroy=void 0,u=t;var D=n,ne=w;try{ne()}catch(ue){Bt(u,D,ue)}}}i=i.next}while(i!==d)}}catch(ue){Bt(t,t.return,ue)}}function cg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(i){Bt(e,e.return,i)}}}function og(e,t,n){n.props=dr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Bt(e,t,i)}}function Ro(e,t){try{var n=e.ref;if(n!==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 n=="function"?e.refCleanup=n(i):n.current=i}}catch(u){Bt(e,t,u)}}function ta(e,t){var n=e.ref,i=e.refCleanup;if(n!==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 n=="function")try{n(null)}catch(u){Bt(e,t,u)}else n.current=null}function ug(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(u){Bt(e,e.return,u)}}function th(e,t,n){try{var i=e.stateNode;g0(i,e.type,n,t),i[tt]=t}catch(u){Bt(e,e.return,u)}}function fg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&vi(e.type)||e.tag===4}function nh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fg(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&&vi(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 lh(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ut));else if(i!==4&&(i===27&&vi(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(lh(e,t,n),e=e.sibling;e!==null;)lh(e,t,n),e=e.sibling}function Wu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&vi(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Wu(e,t,n),e=e.sibling;e!==null;)Wu(e,t,n),e=e.sibling}function dg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);al(t,i,n),t[cn]=e,t[tt]=n}catch(d){Bt(e,e.return,d)}}var $a=!1,Gn=!1,sh=!1,hg=typeof WeakSet=="function"?WeakSet:Set,Pn=null;function Zy(e,t){if(e=e.containerInfo,Nh=vf,e=Q(e),wa(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var _=0,w=-1,D=-1,ne=0,ue=0,me=e,se=null;t:for(;;){for(var ie;me!==n||u!==0&&me.nodeType!==3||(w=_+u),me!==d||i!==0&&me.nodeType!==3||(D=_+i),me.nodeType===3&&(_+=me.nodeValue.length),(ie=me.firstChild)!==null;)se=me,me=ie;for(;;){if(me===e)break t;if(se===n&&++ne===u&&(w=_),se===d&&++ue===i&&(D=_),(ie=me.nextSibling)!==null)break;me=se,se=me.parentNode}me=ie}n=w===-1||D===-1?null:{start:w,end:D}}else n=null}n=n||{start:0,end:0}}else n=null;for(kh={focusedElem:e,selectionRange:n},vf=!1,Pn=t;Pn!==null;)if(t=Pn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pn=e;else for(;Pn!==null;){switch(t=Pn,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,n=t,u=d.memoizedProps,d=d.memoizedState,i=n.stateNode;try{var He=dr(n.type,u);e=i.getSnapshotBeforeUpdate(He,d),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ke){Bt(n,n.return,Ke)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Ch(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ch(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,Pn=e;break}Pn=t.return}}function pg(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Xa(e,n),i&4&&Mo(5,n);break;case 1:if(Xa(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(_){Bt(n,n.return,_)}else{var u=dr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Bt(n,n.return,_)}}i&64&&cg(n),i&512&&Ro(n,n.return);break;case 3:if(Xa(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{wo(e,t)}catch(_){Bt(n,n.return,_)}}break;case 27:t===null&&i&4&&dg(n);case 26:case 5:Xa(e,n),t===null&&i&4&&ug(n),i&512&&Ro(n,n.return);break;case 12:Xa(e,n);break;case 31:Xa(e,n),i&4&&xg(e,n);break;case 13:Xa(e,n),i&4&&bg(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=s0.bind(null,n),S0(e,n))));break;case 22:if(i=n.memoizedState!==null||$a,!i){t=t!==null&&t.memoizedState!==null||Gn,u=$a;var d=Gn;$a=i,(Gn=t)&&!d?Va(e,n,(n.subtreeFlags&8772)!==0):Xa(e,n),$a=u,Gn=d}break;case 30:break;default:Xa(e,n)}}function mg(e){var t=e.alternate;t!==null&&(e.alternate=null,mg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zn(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 un=null,Bl=!1;function Ya(e,t,n){for(n=n.child;n!==null;)gg(e,t,n),n=n.sibling}function gg(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(yn,n)}catch{}switch(n.tag){case 26:Gn||ta(n,t),Ya(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Gn||ta(n,t);var i=un,u=Bl;vi(n.type)&&(un=n.stateNode,Bl=!1),Ya(e,t,n),qo(n.stateNode),un=i,Bl=u;break;case 5:Gn||ta(n,t);case 6:if(i=un,u=Bl,un=null,Ya(e,t,n),un=i,Bl=u,un!==null)if(Bl)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(n.stateNode)}catch(d){Bt(n,t,d)}else try{un.removeChild(n.stateNode)}catch(d){Bt(n,t,d)}break;case 18:un!==null&&(Bl?(e=un,cx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Sc(e)):cx(un,n.stateNode));break;case 4:i=un,u=Bl,un=n.stateNode.containerInfo,Bl=!0,Ya(e,t,n),un=i,Bl=u;break;case 0:case 11:case 14:case 15:pi(2,n,t),Gn||pi(4,n,t),Ya(e,t,n);break;case 1:Gn||(ta(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&og(n,t,i)),Ya(e,t,n);break;case 21:Ya(e,t,n);break;case 22:Gn=(i=Gn)||n.memoizedState!==null,Ya(e,t,n),Gn=i;break;default:Ya(e,t,n)}}function xg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Sc(e)}catch(n){Bt(t,t.return,n)}}}function bg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Sc(e)}catch(n){Bt(t,t.return,n)}}function Fy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hg),t;default:throw Error(c(435,e.tag))}}function ef(e,t){var n=Fy(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var u=a0.bind(null,e,i);i.then(u,u)}})}function Il(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var u=n[i],d=e,_=t,w=_;e:for(;w!==null;){switch(w.tag){case 27:if(vi(w.type)){un=w.stateNode,Bl=!1;break e}break;case 5:un=w.stateNode,Bl=!1;break e;case 3:case 4:un=w.stateNode.containerInfo,Bl=!0;break e}w=w.return}if(un===null)throw Error(c(160));gg(d,_,u),un=null,Bl=!1,d=u.alternate,d!==null&&(d.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_g(t,e),t=t.sibling}var Ds=null;function _g(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Il(t,e),ql(e),i&4&&(pi(3,e,e.return),Mo(3,e),pi(5,e,e.return));break;case 1:Il(t,e),ql(e),i&512&&(Gn||n===null||ta(n,n.return)),i&64&&$a&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var u=Ds;if(Il(t,e),ql(e),i&512&&(Gn||n===null||ta(n,n.return)),i&4){var d=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":d=u.getElementsByTagName("title")[0],(!d||d[as]||d[cn]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=u.createElement(i),u.head.insertBefore(d,u.querySelector("head > title"))),al(d,i,n),d[cn]=e,Pe(d),i=d;break e;case"link":var _=_x("link","href",u).get(i+(n.href||""));if(_){for(var w=0;w<_.length;w++)if(d=_[w],d.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&d.getAttribute("rel")===(n.rel==null?null:n.rel)&&d.getAttribute("title")===(n.title==null?null:n.title)&&d.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){_.splice(w,1);break t}}d=u.createElement(i),al(d,i,n),u.head.appendChild(d);break;case"meta":if(_=_x("meta","content",u).get(i+(n.content||""))){for(w=0;w<_.length;w++)if(d=_[w],d.getAttribute("content")===(n.content==null?null:""+n.content)&&d.getAttribute("name")===(n.name==null?null:n.name)&&d.getAttribute("property")===(n.property==null?null:n.property)&&d.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&d.getAttribute("charset")===(n.charSet==null?null:n.charSet)){_.splice(w,1);break t}}d=u.createElement(i),al(d,i,n),u.head.appendChild(d);break;default:throw Error(c(468,i))}d[cn]=e,Pe(d),i=d}e.stateNode=i}else yx(u,e.type,e.stateNode);else e.stateNode=bx(u,i,e.memoizedProps);else d!==i?(d===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):d.count--,i===null?yx(u,e.type,e.stateNode):bx(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&th(e,e.memoizedProps,n.memoizedProps)}break;case 27:Il(t,e),ql(e),i&512&&(Gn||n===null||ta(n,n.return)),n!==null&&i&4&&th(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Il(t,e),ql(e),i&512&&(Gn||n===null||ta(n,n.return)),e.flags&32){u=e.stateNode;try{K(u,"")}catch(He){Bt(e,e.return,He)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,th(e,u,n!==null?n.memoizedProps:u)),i&1024&&(sh=!0);break;case 6:if(Il(t,e),ql(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(He){Bt(e,e.return,He)}}break;case 3:if(xf=null,u=Ds,Ds=mf(t.containerInfo),Il(t,e),Ds=u,ql(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Sc(t.containerInfo)}catch(He){Bt(e,e.return,He)}sh&&(sh=!1,yg(e));break;case 4:i=Ds,Ds=mf(e.stateNode.containerInfo),Il(t,e),ql(e),Ds=i;break;case 12:Il(t,e),ql(e);break;case 31:Il(t,e),ql(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ef(e,i)));break;case 13:Il(t,e),ql(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nf=Fe()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ef(e,i)));break;case 22:u=e.memoizedState!==null;var D=n!==null&&n.memoizedState!==null,ne=$a,ue=Gn;if($a=ne||u,Gn=ue||D,Il(t,e),Gn=ue,$a=ne,ql(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||D||$a||Gn||hr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){D=n=t;try{if(d=D.stateNode,u)_=d.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{w=D.stateNode;var me=D.memoizedProps.style,se=me!=null&&me.hasOwnProperty("display")?me.display:null;w.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(He){Bt(D,D.return,He)}}}else if(t.tag===6){if(n===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(He){Bt(D,D.return,He)}}}else if(t.tag===18){if(n===null){D=t;try{var ie=D.stateNode;u?ox(ie,!0):ox(D.stateNode,!1)}catch(He){Bt(D,D.return,He)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,ef(e,n))));break;case 19:Il(t,e),ql(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ef(e,i)));break;case 30:break;case 21:break;default:Il(t,e),ql(e)}}function ql(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(fg(i)){n=i;break}i=i.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,d=nh(e);Wu(e,d,u);break;case 5:var _=n.stateNode;n.flags&32&&(K(_,""),n.flags&=-33);var w=nh(e);Wu(e,w,_);break;case 3:case 4:var D=n.stateNode.containerInfo,ne=nh(e);lh(e,ne,D);break;default:throw Error(c(161))}}catch(ue){Bt(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Xa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pg(e,t.alternate,t),t=t.sibling}function hr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pi(4,t,t.return),hr(t);break;case 1:ta(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&og(t,t.return,n),hr(t);break;case 27:qo(t.stateNode);case 26:case 5:ta(t,t.return),hr(t);break;case 22:t.memoizedState===null&&hr(t);break;case 30:hr(t);break;default:hr(t)}e=e.sibling}}function Va(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,d=t,_=d.flags;switch(d.tag){case 0:case 11:case 15:Va(u,d,n),Mo(4,d);break;case 1:if(Va(u,d,n),i=d,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(ne){Bt(i,i.return,ne)}if(i=d,u=i.updateQueue,u!==null){var w=i.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)Iu(D[u],w)}catch(ne){Bt(i,i.return,ne)}}n&&_&64&&cg(d),Ro(d,d.return);break;case 27:dg(d);case 26:case 5:Va(u,d,n),n&&i===null&&_&4&&ug(d),Ro(d,d.return);break;case 12:Va(u,d,n);break;case 31:Va(u,d,n),n&&_&4&&xg(u,d);break;case 13:Va(u,d,n),n&&_&4&&bg(u,d);break;case 22:d.memoizedState===null&&Va(u,d,n),Ro(d,d.return);break;case 30:break;default:Va(u,d,n)}t=t.sibling}}function ah(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ar(n))}function ih(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ar(e))}function Os(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vg(e,t,n,i),t=t.sibling}function vg(e,t,n,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Os(e,t,n,i),u&2048&&Mo(9,t);break;case 1:Os(e,t,n,i);break;case 3:Os(e,t,n,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ar(e)));break;case 12:if(u&2048){Os(e,t,n,i),e=t.stateNode;try{var d=t.memoizedProps,_=d.id,w=d.onPostCommit;typeof w=="function"&&w(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Bt(t,t.return,D)}}else Os(e,t,n,i);break;case 31:Os(e,t,n,i);break;case 13:Os(e,t,n,i);break;case 23:break;case 22:d=t.stateNode,_=t.alternate,t.memoizedState!==null?d._visibility&2?Os(e,t,n,i):Do(e,t):d._visibility&2?Os(e,t,n,i):(d._visibility|=2,hc(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&ah(_,t);break;case 24:Os(e,t,n,i),u&2048&&ih(t.alternate,t);break;default:Os(e,t,n,i)}}function hc(e,t,n,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,_=t,w=n,D=i,ne=_.flags;switch(_.tag){case 0:case 11:case 15:hc(d,_,w,D,u),Mo(8,_);break;case 23:break;case 22:var ue=_.stateNode;_.memoizedState!==null?ue._visibility&2?hc(d,_,w,D,u):Do(d,_):(ue._visibility|=2,hc(d,_,w,D,u)),u&&ne&2048&&ah(_.alternate,_);break;case 24:hc(d,_,w,D,u),u&&ne&2048&&ih(_.alternate,_);break;default:hc(d,_,w,D,u)}t=t.sibling}}function Do(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,u=i.flags;switch(i.tag){case 22:Do(n,i),u&2048&&ah(i.alternate,i);break;case 24:Do(n,i),u&2048&&ih(i.alternate,i);break;default:Do(n,i)}t=t.sibling}}var Oo=8192;function pc(e,t,n){if(e.subtreeFlags&Oo)for(e=e.child;e!==null;)jg(e,t,n),e=e.sibling}function jg(e,t,n){switch(e.tag){case 26:pc(e,t,n),e.flags&Oo&&e.memoizedState!==null&&z0(n,Ds,e.memoizedState,e.memoizedProps);break;case 5:pc(e,t,n);break;case 3:case 4:var i=Ds;Ds=mf(e.stateNode.containerInfo),pc(e,t,n),Ds=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Oo,Oo=16777216,pc(e,t,n),Oo=i):pc(e,t,n));break;default:pc(e,t,n)}}function wg(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 Lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Pn=i,Ng(i,e)}wg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sg(e),e=e.sibling}function Sg(e){switch(e.tag){case 0:case 11:case 15:Lo(e),e.flags&2048&&pi(9,e,e.return);break;case 3:Lo(e);break;case 12:Lo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,tf(e)):Lo(e);break;default:Lo(e)}}function tf(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Pn=i,Ng(i,e)}wg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pi(8,t,t.return),tf(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,tf(t));break;default:tf(t)}e=e.sibling}}function Ng(e,t){for(;Pn!==null;){var n=Pn;switch(n.tag){case 0:case 11:case 15:pi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:ar(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Pn=i;else e:for(n=e;Pn!==null;){i=Pn;var u=i.sibling,d=i.return;if(mg(i),i===n){Pn=null;break e}if(u!==null){u.return=d,Pn=u;break e}Pn=d}}}var Jy={getCacheForType:function(e){var t=Zn(En),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zn(En).controller.signal}},Py=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Kt=null,pt=null,gt=0,Ht=0,Wl=null,mi=!1,mc=!1,rh=!1,Qa=0,Cn=0,gi=0,pr=0,ch=0,es=0,gc=0,zo=null,Gl=null,oh=!1,nf=0,kg=0,lf=1/0,sf=null,xi=null,Fn=0,bi=null,xc=null,Ka=0,uh=0,fh=null,Eg=null,Uo=0,dh=null;function ts(){return(Tt&2)!==0&&gt!==0?gt&-gt:z.T!==null?bh():Is()}function Tg(){if(es===0)if((gt&536870912)===0||dt){var e=at;at<<=1,(at&3932160)===0&&(at=262144),es=e}else es=536870912;return e=it.current,e!==null&&(e.flags|=32),es}function $l(e,t,n){(e===Kt&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)&&(bc(e,0),_i(e,gt,es,!1)),hn(e,n),((Tt&2)===0||e!==Kt)&&(e===Kt&&((Tt&2)===0&&(pr|=n),Cn===4&&_i(e,gt,es,!1)),na(e))}function Cg(e,t,n){if((Tt&6)!==0)throw Error(c(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||he(e,t),u=i?t0(e,t):ph(e,t,!0),d=i;do{if(u===0){mc&&!i&&_i(e,t,0,!1);break}else{if(n=e.current.alternate,d&&!Wy(n)){u=ph(e,t,!1),d=!1;continue}if(u===2){if(d=t,e.errorRecoveryDisabledLanes&d)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var w=e;u=zo;var D=w.current.memoizedState.isDehydrated;if(D&&(bc(w,_).flags|=256),_=ph(w,_,!1),_!==2){if(rh&&!D){w.errorRecoveryDisabledLanes|=d,pr|=d,u=4;break e}d=Gl,Gl=u,d!==null&&(Gl===null?Gl=d:Gl.push.apply(Gl,d))}u=_}if(d=!1,u!==2)continue}}if(u===1){bc(e,0),_i(e,t,0,!0);break}e:{switch(i=e,d=u,d){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:_i(i,t,es,!mi);break e;case 2:Gl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=nf+300-Fe(),10<u)){if(_i(i,t,es,!mi),X(i,0,!0)!==0)break e;Ka=t,i.timeoutHandle=ix(Ag.bind(null,i,n,Gl,sf,oh,t,es,pr,gc,mi,d,"Throttled",-0,0),u);break e}Ag(i,n,Gl,sf,oh,t,es,pr,gc,mi,d,null,-0,0)}}break}while(!0);na(e)}function Ag(e,t,n,i,u,d,_,w,D,ne,ue,me,se,ie){if(e.timeoutHandle=-1,me=t.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ut},jg(t,d,me);var He=(d&62914560)===d?nf-Fe():(d&4194048)===d?kg-Fe():0;if(He=U0(me,He),He!==null){Ka=d,e.cancelPendingCommit=He(Hg.bind(null,e,t,d,n,i,u,_,w,D,ue,me,null,se,ie)),_i(e,d,_,!ne);return}}Hg(e,t,d,n,i,u,_,w,D)}function Wy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var u=n[i],d=u.getSnapshot;u=u.value;try{if(!te(d(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _i(e,t,n,i){t&=~ch,t&=~pr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var d=31-Lt(u),_=1<<d;i[d]=-1,u&=~_}n!==0&&Xl(e,n,t)}function af(){return(Tt&6)===0?(Ho(0),!1):!0}function hh(){if(pt!==null){if(Ht===0)var e=pt.return;else e=pt,Ul=Ns=null,Cd(e),hi=null,Cs=0,e=pt;for(;e!==null;)rg(e.alternate,e),e=e.return;pt=null}}function bc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,_0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ka=0,hh(),Kt=e,pt=n=rs(e.current,null),gt=t,Ht=0,Wl=null,mi=!1,mc=he(e,t),rh=!1,gc=es=ch=pr=gi=Cn=0,Gl=zo=null,oh=!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-Lt(i),d=1<<u;t|=e[u],i&=~d}return Qa=t,oi(),n}function Mg(e,t){Ce=null,z.H=To,t===Ts||t===cr?(t=Hu(),Ht=3):t===rr?(t=Hu(),Ht=4):Ht=t===Xd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wl=t,pt===null&&(Cn=1,Ku(e,ml(t,e.current)))}function Rg(){var e=it.current;return e===null?!0:(gt&4194048)===gt?Rt===null:(gt&62914560)===gt||(gt&536870912)!==0?e===Rt:!1}function Dg(){var e=z.H;return z.H=To,e===null?To:e}function Og(){var e=z.A;return z.A=Jy,e}function rf(){Cn=4,mi||(gt&4194048)!==gt&&it.current!==null||(mc=!0),(gi&134217727)===0&&(pr&134217727)===0||Kt===null||_i(Kt,gt,es,!1)}function ph(e,t,n){var i=Tt;Tt|=2;var u=Dg(),d=Og();(Kt!==e||gt!==t)&&(sf=null,bc(e,t)),t=!1;var _=Cn;e:do try{if(Ht!==0&&pt!==null){var w=pt,D=Wl;switch(Ht){case 8:hh(),_=6;break e;case 3:case 2:case 9:case 6:it.current===null&&(t=!0);var ne=Ht;if(Ht=0,Wl=null,_c(e,w,D,ne),n&&mc){_=0;break e}break;default:ne=Ht,Ht=0,Wl=null,_c(e,w,D,ne)}}e0(),_=Cn;break}catch(ue){Mg(e,ue)}while(!0);return t&&e.shellSuspendCounter++,Ul=Ns=null,Tt=i,z.H=u,z.A=d,pt===null&&(Kt=null,gt=0,oi()),_}function e0(){for(;pt!==null;)Lg(pt)}function t0(e,t){var n=Tt;Tt|=2;var i=Dg(),u=Og();Kt!==e||gt!==t?(sf=null,lf=Fe()+500,bc(e,t)):mc=he(e,t);e:do try{if(Ht!==0&&pt!==null){t=pt;var d=Wl;t:switch(Ht){case 1:Ht=0,Wl=null,_c(e,t,d,1);break;case 2:case 9:if(_o(d)){Ht=0,Wl=null,zg(t);break}t=function(){Ht!==2&&Ht!==9||Kt!==e||(Ht=7),na(e)},d.then(t,t);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:_o(d)?(Ht=0,Wl=null,zg(t)):(Ht=0,Wl=null,_c(e,t,d,7));break;case 5:var _=null;switch(pt.tag){case 26:_=pt.memoizedState;case 5:case 27:var w=pt;if(_?vx(_):w.stateNode.complete){Ht=0,Wl=null;var D=w.sibling;if(D!==null)pt=D;else{var ne=w.return;ne!==null?(pt=ne,cf(ne)):pt=null}break t}}Ht=0,Wl=null,_c(e,t,d,5);break;case 6:Ht=0,Wl=null,_c(e,t,d,6);break;case 8:hh(),Cn=6;break e;default:throw Error(c(462))}}n0();break}catch(ue){Mg(e,ue)}while(!0);return Ul=Ns=null,z.H=i,z.A=u,Tt=n,pt!==null?0:(Kt=null,gt=0,oi(),Cn)}function n0(){for(;pt!==null&&!At();)Lg(pt)}function Lg(e){var t=ag(e.alternate,e,Qa);e.memoizedProps=e.pendingProps,t===null?cf(e):pt=t}function zg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wm(n,t,t.pendingProps,t.type,void 0,gt);break;case 11:t=Wm(n,t,t.pendingProps,t.type.render,t.ref,gt);break;case 5:Cd(t);default:rg(n,t),t=pt=ao(t,Qa),t=ag(n,t,Qa)}e.memoizedProps=e.pendingProps,t===null?cf(e):pt=t}function _c(e,t,n,i){Ul=Ns=null,Cd(t),hi=null,Cs=0;var u=t.return;try{if(Yy(e,u,t,n,gt)){Cn=1,Ku(e,ml(n,e.current)),pt=null;return}}catch(d){if(u!==null)throw pt=u,d;Cn=1,Ku(e,ml(n,e.current)),pt=null;return}t.flags&32768?(dt||i===1?e=!0:mc||(gt&536870912)!==0?e=!1:(mi=e=!0,(i===2||i===9||i===3||i===6)&&(i=it.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ug(t,e)):cf(t)}function cf(e){var t=e;do{if((t.flags&32768)!==0){Ug(t,mi);return}e=t.return;var n=Qy(t.alternate,t,Qa);if(n!==null){pt=n;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);Cn===0&&(Cn=5)}function Ug(e,t){do{var n=Ky(e.alternate,e);if(n!==null){n.flags&=32767,pt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pt=e;return}pt=e=n}while(e!==null);Cn=6,pt=null}function Hg(e,t,n,i,u,d,_,w,D){e.cancelPendingCommit=null;do of();while(Fn!==0);if((Tt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(d=t.lanes|t.childLanes,d|=lo,Mn(e,n,d,_,w,D),e===Kt&&(pt=Kt=null,gt=0),xc=t,bi=e,Ka=n,uh=d,fh=u,Eg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,i0(St,function(){return $g(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=z.T,z.T=null,u=I.p,I.p=2,_=Tt,Tt|=4;try{Zy(e,t,n)}finally{Tt=_,I.p=u,z.T=i}}Fn=1,Bg(),Ig(),qg()}}function Bg(){if(Fn===1){Fn=0;var e=bi,t=xc,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var i=I.p;I.p=2;var u=Tt;Tt|=4;try{_g(t,e);var d=kh,_=Q(e.containerInfo),w=d.focusedElem,D=d.selectionRange;if(_!==w&&w&&w.ownerDocument&&Nu(w.ownerDocument.documentElement,w)){if(D!==null&&wa(w)){var ne=D.start,ue=D.end;if(ue===void 0&&(ue=ne),"selectionStart"in w)w.selectionStart=ne,w.selectionEnd=Math.min(ue,w.value.length);else{var me=w.ownerDocument||document,se=me&&me.defaultView||window;if(se.getSelection){var ie=se.getSelection(),He=w.textContent.length,Ke=Math.min(D.start,He),$t=D.end===void 0?Ke:Math.min(D.end,He);!ie.extend&&Ke>$t&&(_=$t,$t=Ke,Ke=_);var $=Su(w,Ke),L=Su(w,$t);if($&&L&&(ie.rangeCount!==1||ie.anchorNode!==$.node||ie.anchorOffset!==$.offset||ie.focusNode!==L.node||ie.focusOffset!==L.offset)){var P=me.createRange();P.setStart($.node,$.offset),ie.removeAllRanges(),Ke>$t?(ie.addRange(P),ie.extend(L.node,L.offset)):(P.setEnd(L.node,L.offset),ie.addRange(P))}}}}for(me=[],ie=w;ie=ie.parentNode;)ie.nodeType===1&&me.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<me.length;w++){var de=me[w];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}vf=!!Nh,kh=Nh=null}finally{Tt=u,I.p=i,z.T=n}}e.current=t,Fn=2}}function Ig(){if(Fn===2){Fn=0;var e=bi,t=xc,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var i=I.p;I.p=2;var u=Tt;Tt|=4;try{pg(e,t.alternate,t)}finally{Tt=u,I.p=i,z.T=n}}Fn=3}}function qg(){if(Fn===4||Fn===3){Fn=0,ft();var e=bi,t=xc,n=Ka,i=Eg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Fn=5:(Fn=0,xc=bi=null,Gg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(xi=null),nl(n),t=t.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(yn,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=z.T,u=I.p,I.p=2,z.T=null;try{for(var d=e.onRecoverableError,_=0;_<i.length;_++){var w=i[_];d(w.value,{componentStack:w.stack})}}finally{z.T=t,I.p=u}}(Ka&3)!==0&&of(),na(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===dh?Uo++:(Uo=0,dh=e):Uo=0,Ho(0)}}function Gg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ar(t)))}function of(){return Bg(),Ig(),qg(),$g()}function $g(){if(Fn!==5)return!1;var e=bi,t=uh;uh=0;var n=nl(Ka),i=z.T,u=I.p;try{I.p=32>n?32:n,z.T=null,n=fh,fh=null;var d=bi,_=Ka;if(Fn=0,xc=bi=null,Ka=0,(Tt&6)!==0)throw Error(c(331));var w=Tt;if(Tt|=4,Sg(d.current),vg(d,d.current,_,n),Tt=w,Ho(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(yn,d)}catch{}return!0}finally{I.p=u,z.T=i,Gg(e,t)}}function Yg(e,t,n){t=ml(n,t),t=Yd(e.stateNode,t,2),e=ea(e,t,2),e!==null&&(hn(e,2),na(e))}function Bt(e,t,n){if(e.tag===3)Yg(e,e,n);else for(;t!==null;){if(t.tag===3){Yg(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(xi===null||!xi.has(i))){e=ml(n,e),n=Xm(2),i=ea(t,n,2),i!==null&&(Vm(n,i,t,e),hn(i,2),na(i));break}}t=t.return}}function mh(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Py;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(n)||(rh=!0,u.add(n),e=l0.bind(null,e,t,n),t.then(e,e))}function l0(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Kt===e&&(gt&n)===n&&(Cn===4||Cn===3&&(gt&62914560)===gt&&300>Fe()-nf?(Tt&2)===0&&bc(e,0):ch|=n,gc===gt&&(gc=0)),na(e)}function Xg(e,t){t===0&&(t=qe()),e=Ss(e,t),e!==null&&(hn(e,t),na(e))}function s0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xg(e,n)}function a0(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(n=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),Xg(e,n)}function i0(e,t){return Te(e,t)}var uf=null,yc=null,gh=!1,ff=!1,xh=!1,yi=0;function na(e){e!==yc&&e.next===null&&(yc===null?uf=yc=e:yc=yc.next=e),ff=!0,gh||(gh=!0,c0())}function Ho(e,t){if(!xh&&ff){xh=!0;do for(var n=!1,i=uf;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var d=0;else{var _=i.suspendedLanes,w=i.pingedLanes;d=(1<<31-Lt(42|e)+1)-1,d&=u&~(_&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(n=!0,Zg(i,d))}else d=gt,d=X(i,i===Kt?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(d&3)===0||he(i,d)||(n=!0,Zg(i,d));i=i.next}while(n);xh=!1}}function r0(){Vg()}function Vg(){ff=gh=!1;var e=0;yi!==0&&b0()&&(e=yi);for(var t=Fe(),n=null,i=uf;i!==null;){var u=i.next,d=Qg(i,t);d===0?(i.next=null,n===null?uf=u:n.next=u,u===null&&(yc=n)):(n=i,(e!==0||(d&3)!==0)&&(ff=!0)),i=u}Fn!==0&&Fn!==5||Ho(e),yi!==0&&(yi=0)}function Qg(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var _=31-Lt(d),w=1<<_,D=u[_];D===-1?((w&n)===0||(w&i)!==0)&&(u[_]=Re(w,t)):D<=t&&(e.expiredLanes|=w),d&=~w}if(t=Kt,n=gt,n=X(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&et(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||he(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&et(i),nl(n)){case 2:case 8:n=Ot;break;case 32:n=St;break;case 268435456:n=dn;break;default:n=St}return i=Kg.bind(null,e),n=Te(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&et(i),e.callbackPriority=2,e.callbackNode=null,2}function Kg(e,t){if(Fn!==0&&Fn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(of()&&e.callbackNode!==n)return null;var i=gt;return i=X(e,e===Kt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Cg(e,i,t),Qg(e,Fe()),e.callbackNode!=null&&e.callbackNode===n?Kg.bind(null,e):null)}function Zg(e,t){if(of())return null;Cg(e,t,!0)}function c0(){y0(function(){(Tt&6)!==0?Te(tl,r0):Vg()})}function bh(){if(yi===0){var e=Ma;e===0&&(e=Ve,Ve<<=1,(Ve&261888)===0&&(Ve=256)),yi=e}return yi}function Fg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:on(""+e)}function Jg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function o0(e,t,n,i,u){if(t==="submit"&&n&&n.stateNode===u){var d=Fg((u[tt]||null).action),_=i.submitter;_&&(t=(t=_[tt]||null)?Fg(t.formAction):_.getAttribute("formAction"),t!==null&&(d=t,_=null));var w=new ei("action","action",null,i,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(yi!==0){var D=_?Jg(u,_):new FormData(u);Hd(n,{pending:!0,data:D,method:u.method,action:d},null,D)}}else typeof d=="function"&&(w.preventDefault(),D=_?Jg(u,_):new FormData(u),Hd(n,{pending:!0,data:D,method:u.method,action:d},d,D))},currentTarget:u}]})}}for(var _h=0;_h<no.length;_h++){var yh=no[_h],u0=yh.toLowerCase(),f0=yh[0].toUpperCase()+yh.slice(1);Zl(u0,"on"+f0)}Zl(ku,"onAnimationEnd"),Zl(Eu,"onAnimationIteration"),Zl(Tu,"onAnimationStart"),Zl("dblclick","onDoubleClick"),Zl("focusin","onFocus"),Zl("focusout","onBlur"),Zl(_d,"onTransitionRun"),Zl(ri,"onTransitionStart"),Zl(yd,"onTransitionCancel"),Zl(Cu,"onTransitionEnd"),Rn("onMouseEnter",["mouseout","mouseover"]),Rn("onMouseLeave",["mouseout","mouseover"]),Rn("onPointerEnter",["pointerout","pointerover"]),Rn("onPointerLeave",["pointerout","pointerover"]),ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ll("onBeforeInput",["compositionend","keypress","textInput","paste"]),ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),d0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bo));function Pg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],u=i.event;i=i.listeners;e:{var d=void 0;if(t)for(var _=i.length-1;0<=_;_--){var w=i[_],D=w.instance,ne=w.currentTarget;if(w=w.listener,D!==d&&u.isPropagationStopped())break e;d=w,u.currentTarget=ne;try{d(u)}catch(ue){Jr(ue)}u.currentTarget=null,d=D}else for(_=0;_<i.length;_++){if(w=i[_],D=w.instance,ne=w.currentTarget,w=w.listener,D!==d&&u.isPropagationStopped())break e;d=w,u.currentTarget=ne;try{d(u)}catch(ue){Jr(ue)}u.currentTarget=null,d=D}}}}function mt(e,t){var n=t[Xn];n===void 0&&(n=t[Xn]=new Set);var i=e+"__bubble";n.has(i)||(Wg(t,e,2,!1),n.add(i))}function vh(e,t,n){var i=0;t&&(i|=4),Wg(n,e,i,t)}var df="_reactListening"+Math.random().toString(36).slice(2);function jh(e){if(!e[df]){e[df]=!0,fl.forEach(function(n){n!=="selectionchange"&&(d0.has(n)||vh(n,!1,e),vh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[df]||(t[df]=!0,vh("selectionchange",!1,t))}}function Wg(e,t,n,i){switch(Tx(t)){case 2:var u=I0;break;case 8:u=q0;break;default:u=Uh}n=u.bind(null,t,n,e),u=void 0,!Hn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function wh(e,t,n,i,u){var d=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var w=i.stateNode.containerInfo;if(w===u)break;if(_===4)for(_=i.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;w!==null;){if(_=ul(w),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){i=d=_;continue e}w=w.parentNode}}i=i.return}we(function(){var ne=d,ue=gn(n),me=[];e:{var se=Au.get(e);if(se!==void 0){var ie=ei,He=e;switch(e){case"keypress":if($s(n)===0)break e;case"keydown":case"keyup":ie=_a;break;case"focusin":He="focus",ie=zr;break;case"focusout":He="blur",ie=zr;break;case"beforeblur":case"afterblur":ie=zr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=xu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Lr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=ya;break;case ku:case Eu:case Tu:ie=ni;break;case Cu:ie=_u;break;case"scroll":case"scrollend":ie=gu;break;case"wheel":ie=yu;break;case"copy":case"cut":case"paste":ie=Hr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=$r;break;case"toggle":case"beforetoggle":ie=ys}var Ke=(t&4)!==0,$t=!Ke&&(e==="scroll"||e==="scrollend"),$=Ke?se!==null?se+"Capture":null:se;Ke=[];for(var L=ne,P;L!==null;){var de=L;if(P=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||P===null||$===null||(de=Ye(L,$),de!=null&&Ke.push(Io(L,de,P))),$t)break;L=L.return}0<Ke.length&&(se=new ie(se,He,null,n,ue),me.push({event:se,listeners:Ke}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",se&&n!==kn&&(He=n.relatedTarget||n.fromElement)&&(ul(He)||He[jn]))break e;if((ie||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,ie?(He=n.relatedTarget||n.toElement,ie=ne,He=He?ul(He):null,He!==null&&($t=f(He),Ke=He.tag,He!==$t||Ke!==5&&Ke!==27&&Ke!==6)&&(He=null)):(ie=null,He=ne),ie!==He)){if(Ke=xu,de="onMouseLeave",$="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ke=$r,de="onPointerLeave",$="onPointerEnter",L="pointer"),$t=ie==null?se:zt(ie),P=He==null?se:zt(He),se=new Ke(de,L+"leave",ie,n,ue),se.target=$t,se.relatedTarget=P,de=null,ul(ue)===ne&&(Ke=new Ke($,L+"enter",He,n,ue),Ke.target=P,Ke.relatedTarget=$t,de=Ke),$t=de,ie&&He)t:{for(Ke=h0,$=ie,L=He,P=0,de=$;de;de=Ke(de))P++;de=0;for(var Xe=L;Xe;Xe=Ke(Xe))de++;for(;0<P-de;)$=Ke($),P--;for(;0<de-P;)L=Ke(L),de--;for(;P--;){if($===L||L!==null&&$===L.alternate){Ke=$;break t}$=Ke($),L=Ke(L)}Ke=null}else Ke=null;ie!==null&&ex(me,se,ie,Ke,!1),He!==null&&$t!==null&&ex(me,$t,He,Ke,!0)}}e:{if(se=ne?zt(ne):window,ie=se.nodeName&&se.nodeName.toLowerCase(),ie==="select"||ie==="input"&&se.type==="file")var Nt=Vi;else if(Pc(se))if(Qi)Nt=Ji;else{Nt=Fi;var Ie=Zi}else ie=se.nodeName,!ie||ie.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ne&&Le(ne.elementType)&&(Nt=Vi):Nt=wu;if(Nt&&(Nt=Nt(e,ne))){On(me,Nt,n,ue);break e}Ie&&Ie(e,se,ne),e==="focusout"&&ne&&se.type==="number"&&ne.memoizedProps.value!=null&&dl(se,"number",se.value)}switch(Ie=ne?zt(ne):window,e){case"focusin":(Pc(Ie)||Ie.contentEditable==="true")&&(Sa=Ie,Wi=ne,ii=null);break;case"focusout":ii=Wi=Sa=null;break;case"mousedown":eo=!0;break;case"contextmenu":case"mouseup":case"dragend":eo=!1,Ml(me,n,ue);break;case"selectionchange":if(Pi)break;case"keydown":case"keyup":Ml(me,n,ue)}var rt;if(va)e:{switch(e){case"compositionstart":var xt="onCompositionStart";break e;case"compositionend":xt="onCompositionEnd";break e;case"compositionupdate":xt="onCompositionUpdate";break e}xt=void 0}else vs?ju(e,n)&&(xt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(xt="onCompositionStart");xt&&(en&&n.locale!=="ko"&&(vs||xt!=="onCompositionStart"?xt==="onCompositionEnd"&&vs&&(rt=_s()):(Vn=ue,bs="value"in Vn?Vn.value:Vn.textContent,vs=!0)),Ie=hf(ne,xt),0<Ie.length&&(xt=new bu(xt,e,null,n,ue),me.push({event:xt,listeners:Ie}),rt?xt.data=rt:(rt=Zr(n),rt!==null&&(xt.data=rt)))),(rt=Gi?Bn(e,n):$i(e,n))&&(xt=hf(ne,"onBeforeInput"),0<xt.length&&(Ie=new bu("onBeforeInput","beforeinput",null,n,ue),me.push({event:Ie,listeners:xt}),Ie.data=rt)),o0(me,e,ne,n,ue)}Pg(me,t)})}function Io(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hf(e,t){for(var n=t+"Capture",i=[];e!==null;){var u=e,d=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||d===null||(u=Ye(e,n),u!=null&&i.unshift(Io(e,u,d)),u=Ye(e,t),u!=null&&i.push(Io(e,u,d))),e.tag===3)return i;e=e.return}return[]}function h0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ex(e,t,n,i,u){for(var d=t._reactName,_=[];n!==null&&n!==i;){var w=n,D=w.alternate,ne=w.stateNode;if(w=w.tag,D!==null&&D===i)break;w!==5&&w!==26&&w!==27||ne===null||(D=ne,u?(ne=Ye(n,d),ne!=null&&_.unshift(Io(n,ne,D))):u||(ne=Ye(n,d),ne!=null&&_.push(Io(n,ne,D)))),n=n.return}_.length!==0&&e.push({event:t,listeners:_})}var p0=/\r\n?/g,m0=/\u0000|\uFFFD/g;function tx(e){return(typeof e=="string"?e:""+e).replace(p0,`
50
- `).replace(m0,"")}function nx(e,t){return t=tx(t),tx(e)===t}function Gt(e,t,n,i,u,d){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||K(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&K(e,""+i);break;case"className":Sn(e,"class",i);break;case"tabIndex":Sn(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Sn(e,n,i);break;case"style":Ge(e,i,d);break;case"data":if(t!=="object"){Sn(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=on(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(n==="formAction"?(t!=="input"&&Gt(e,t,"name",u.name,u,null),Gt(e,t,"formEncType",u.formEncType,u,null),Gt(e,t,"formMethod",u.formMethod,u,null),Gt(e,t,"formTarget",u.formTarget,u,null)):(Gt(e,t,"encType",u.encType,u,null),Gt(e,t,"method",u.method,u,null),Gt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=on(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=Ut);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(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}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}n=on(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":mt("beforetoggle",e),mt("toggle",e),wn(e,"popover",i);break;case"xlinkActuate":Vt(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Vt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Vt(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Vt(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Vt(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Vt(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":wn(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=qt.get(n)||n,wn(e,n,i))}}function Sh(e,t,n,i,u,d){switch(n){case"style":Ge(e,i,d);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof i=="string"?K(e,i):(typeof i=="number"||typeof i=="bigint")&&K(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=Ut);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pn.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),d=e[tt]||null,d=d!=null?d[n]:null,typeof d=="function"&&e.removeEventListener(t,d,u),typeof i=="function")){typeof d!="function"&&d!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,u);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):wn(e,n,i)}}}function al(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",e),mt("load",e);var i=!1,u=!1,d;for(d in n)if(n.hasOwnProperty(d)){var _=n[d];if(_!=null)switch(d){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Gt(e,t,d,_,n,null)}}u&&Gt(e,t,"srcSet",n.srcSet,n,null),i&&Gt(e,t,"src",n.src,n,null);return;case"input":mt("invalid",e);var w=d=_=u=null,D=null,ne=null;for(i in n)if(n.hasOwnProperty(i)){var ue=n[i];if(ue!=null)switch(i){case"name":u=ue;break;case"type":_=ue;break;case"checked":D=ue;break;case"defaultChecked":ne=ue;break;case"value":d=ue;break;case"defaultValue":w=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(c(137,t));break;default:Gt(e,t,i,ue,n,null)}}Vl(e,d,w,D,ne,_,u,!1);return;case"select":mt("invalid",e),i=_=d=null;for(u in n)if(n.hasOwnProperty(u)&&(w=n[u],w!=null))switch(u){case"value":d=w;break;case"defaultValue":_=w;break;case"multiple":i=w;default:Gt(e,t,u,w,n,null)}t=d,n=_,e.multiple=!!i,t!=null?Pt(e,!!i,t,!1):n!=null&&Pt(e,!!i,n,!0);return;case"textarea":mt("invalid",e),d=u=i=null;for(_ in n)if(n.hasOwnProperty(_)&&(w=n[_],w!=null))switch(_){case"value":i=w;break;case"defaultValue":u=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(c(91));break;default:Gt(e,t,_,w,n,null)}k(e,i,u,d);return;case"option":for(D in n)if(n.hasOwnProperty(D)&&(i=n[D],i!=null))switch(D){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Gt(e,t,D,i,n,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<Bo.length;i++)mt(Bo[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(ne in n)if(n.hasOwnProperty(ne)&&(i=n[ne],i!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Gt(e,t,ne,i,n,null)}return;default:if(Le(t)){for(ue in n)n.hasOwnProperty(ue)&&(i=n[ue],i!==void 0&&Sh(e,t,ue,i,n,void 0));return}}for(w in n)n.hasOwnProperty(w)&&(i=n[w],i!=null&&Gt(e,t,w,i,n,null))}function g0(e,t,n,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,d=null,_=null,w=null,D=null,ne=null,ue=null;for(ie in n){var me=n[ie];if(n.hasOwnProperty(ie)&&me!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":D=me;default:i.hasOwnProperty(ie)||Gt(e,t,ie,null,i,me)}}for(var se in i){var ie=i[se];if(me=n[se],i.hasOwnProperty(se)&&(ie!=null||me!=null))switch(se){case"type":d=ie;break;case"name":u=ie;break;case"checked":ne=ie;break;case"defaultChecked":ue=ie;break;case"value":_=ie;break;case"defaultValue":w=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:ie!==me&&Gt(e,t,se,ie,i,me)}}ga(e,_,w,D,ne,ue,d,u);return;case"select":ie=_=w=se=null;for(d in n)if(D=n[d],n.hasOwnProperty(d)&&D!=null)switch(d){case"value":break;case"multiple":ie=D;default:i.hasOwnProperty(d)||Gt(e,t,d,null,i,D)}for(u in i)if(d=i[u],D=n[u],i.hasOwnProperty(u)&&(d!=null||D!=null))switch(u){case"value":se=d;break;case"defaultValue":w=d;break;case"multiple":_=d;default:d!==D&&Gt(e,t,u,d,i,D)}t=w,n=_,i=ie,se!=null?Pt(e,!!n,se,!1):!!i!=!!n&&(t!=null?Pt(e,!!n,t,!0):Pt(e,!!n,n?[]:"",!1));return;case"textarea":ie=se=null;for(w in n)if(u=n[w],n.hasOwnProperty(w)&&u!=null&&!i.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Gt(e,t,w,null,i,u)}for(_ in i)if(u=i[_],d=n[_],i.hasOwnProperty(_)&&(u!=null||d!=null))switch(_){case"value":se=u;break;case"defaultValue":ie=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==d&&Gt(e,t,_,u,i,d)}_e(e,se,ie);return;case"option":for(var He in n)if(se=n[He],n.hasOwnProperty(He)&&se!=null&&!i.hasOwnProperty(He))switch(He){case"selected":e.selected=!1;break;default:Gt(e,t,He,null,i,se)}for(D in i)if(se=i[D],ie=n[D],i.hasOwnProperty(D)&&se!==ie&&(se!=null||ie!=null))switch(D){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Gt(e,t,D,se,i,ie)}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 Ke in n)se=n[Ke],n.hasOwnProperty(Ke)&&se!=null&&!i.hasOwnProperty(Ke)&&Gt(e,t,Ke,null,i,se);for(ne in i)if(se=i[ne],ie=n[ne],i.hasOwnProperty(ne)&&se!==ie&&(se!=null||ie!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Gt(e,t,ne,se,i,ie)}return;default:if(Le(t)){for(var $t in n)se=n[$t],n.hasOwnProperty($t)&&se!==void 0&&!i.hasOwnProperty($t)&&Sh(e,t,$t,void 0,i,se);for(ue in i)se=i[ue],ie=n[ue],!i.hasOwnProperty(ue)||se===ie||se===void 0&&ie===void 0||Sh(e,t,ue,se,i,ie);return}}for(var $ in n)se=n[$],n.hasOwnProperty($)&&se!=null&&!i.hasOwnProperty($)&&Gt(e,t,$,null,i,se);for(me in i)se=i[me],ie=n[me],!i.hasOwnProperty(me)||se===ie||se==null&&ie==null||Gt(e,t,me,se,i,ie)}function lx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var u=n[i],d=u.transferSize,_=u.initiatorType,w=u.duration;if(d&&w&&lx(_)){for(_=0,w=u.responseEnd,i+=1;i<n.length;i++){var D=n[i],ne=D.startTime;if(ne>w)break;var ue=D.transferSize,me=D.initiatorType;ue&&lx(me)&&(D=D.responseEnd,_+=ue*(D<w?1:(w-ne)/(D-ne)))}if(--i,t+=8*(d+_)/(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 Nh=null,kh=null;function pf(e){return e.nodeType===9?e:e.ownerDocument}function sx(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 ax(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 Eh(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 Th=null;function b0(){var e=window.event;return e&&e.type==="popstate"?e===Th?!1:(Th=e,!0):(Th=null,!1)}var ix=typeof setTimeout=="function"?setTimeout:void 0,_0=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,y0=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(e){return rx.resolve(null).then(e).catch(v0)}:ix;function v0(e){setTimeout(function(){throw e})}function vi(e){return e==="head"}function cx(e,t){var n=t,i=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(u),Sc(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")qo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,qo(n);for(var d=n.firstChild;d;){var _=d.nextSibling,w=d.nodeName;d[as]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&d.rel.toLowerCase()==="stylesheet"||n.removeChild(d),d=_}}else n==="body"&&qo(e.ownerDocument.body);n=u}while(n);Sc(t)}function ox(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Ch(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ch(n),zn(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function j0(e,t,n,i){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[as])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==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(d=e.getAttribute("src"),(d!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=fs(e.nextSibling),e===null)break}return null}function w0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=fs(e.nextSibling),e===null))return null;return e}function ux(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=fs(e.nextSibling),e===null))return null;return e}function Ah(e){return e.data==="$?"||e.data==="$~"}function Mh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function S0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function fs(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 Rh=null;function fx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return fs(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function dx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function hx(e,t,n){switch(t=pf(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function qo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zn(e)}var ds=new Map,px=new Set;function mf(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Za=I.d;I.d={f:N0,r:k0,D:E0,C:T0,L:C0,m:A0,X:R0,S:M0,M:D0};function N0(){var e=Za.f(),t=af();return e||t}function k0(e){var t=wl(e);t!==null&&t.tag===5&&t.type==="form"?Mm(t):Za.r(e)}var vc=typeof document>"u"?null:document;function mx(e,t,n){var i=vc;if(i&&typeof t=="string"&&t){var u=Dn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),px.has(u)||(px.add(u),e={rel:e,crossOrigin:n,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),al(t,"link",e),Pe(t),i.head.appendChild(t)))}}function E0(e){Za.D(e),mx("dns-prefetch",e,null)}function T0(e,t){Za.C(e,t),mx("preconnect",e,t)}function C0(e,t,n){Za.L(e,t,n);var i=vc;if(i&&e&&t){var u='link[rel="preload"][as="'+Dn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Dn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Dn(n.imageSizes)+'"]')):u+='[href="'+Dn(e)+'"]';var d=u;switch(t){case"style":d=jc(e);break;case"script":d=wc(e)}ds.has(d)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ds.set(d,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Go(d))||t==="script"&&i.querySelector($o(d))||(t=i.createElement("link"),al(t,"link",e),Pe(t),i.head.appendChild(t)))}}function A0(e,t){Za.m(e,t);var n=vc;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Dn(i)+'"][href="'+Dn(e)+'"]',d=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=wc(e)}if(!ds.has(d)&&(e=j({rel:"modulepreload",href:e},t),ds.set(d,e),n.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector($o(d)))return}i=n.createElement("link"),al(i,"link",e),Pe(i),n.head.appendChild(i)}}}function M0(e,t,n){Za.S(e,t,n);var i=vc;if(i&&e){var u=Jt(i).hoistableStyles,d=jc(e);t=t||"default";var _=u.get(d);if(!_){var w={loading:0,preload:null};if(_=i.querySelector(Go(d)))w.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ds.get(d))&&Dh(e,n);var D=_=i.createElement("link");Pe(D),al(D,"link",e),D._p=new Promise(function(ne,ue){D.onload=ne,D.onerror=ue}),D.addEventListener("load",function(){w.loading|=1}),D.addEventListener("error",function(){w.loading|=2}),w.loading|=4,gf(_,t,i)}_={type:"stylesheet",instance:_,count:1,state:w},u.set(d,_)}}}function R0(e,t){Za.X(e,t);var n=vc;if(n&&e){var i=Jt(n).hoistableScripts,u=wc(e),d=i.get(u);d||(d=n.querySelector($o(u)),d||(e=j({src:e,async:!0},t),(t=ds.get(u))&&Oh(e,t),d=n.createElement("script"),Pe(d),al(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(u,d))}}function D0(e,t){Za.M(e,t);var n=vc;if(n&&e){var i=Jt(n).hoistableScripts,u=wc(e),d=i.get(u);d||(d=n.querySelector($o(u)),d||(e=j({src:e,async:!0,type:"module"},t),(t=ds.get(u))&&Oh(e,t),d=n.createElement("script"),Pe(d),al(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(u,d))}}function gx(e,t,n,i){var u=(u=je.current)?mf(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=jc(n.href),n=Jt(u).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=jc(n.href);var d=Jt(u).hoistableStyles,_=d.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,_),(d=u.querySelector(Go(e)))&&!d._p&&(_.instance=d,_.state.loading=5),ds.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ds.set(e,n),d||O0(u,e,n,_.state))),t&&i===null)throw Error(c(528,""));return _}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=wc(n),n=Jt(u).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function jc(e){return'href="'+Dn(e)+'"'}function Go(e){return'link[rel="stylesheet"]['+e+"]"}function xx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function O0(e,t,n,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}),al(t,"link",n),Pe(t),e.head.appendChild(t))}function wc(e){return'[src="'+Dn(e)+'"]'}function $o(e){return"script[async]"+e}function bx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Dn(n.href)+'"]');if(i)return t.instance=i,Pe(i),i;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Pe(i),al(i,"style",u),gf(i,n.precedence,e),t.instance=i;case"stylesheet":u=jc(n.href);var d=e.querySelector(Go(u));if(d)return t.state.loading|=4,t.instance=d,Pe(d),d;i=xx(n),(u=ds.get(u))&&Dh(i,u),d=(e.ownerDocument||e).createElement("link"),Pe(d);var _=d;return _._p=new Promise(function(w,D){_.onload=w,_.onerror=D}),al(d,"link",i),t.state.loading|=4,gf(d,n.precedence,e),t.instance=d;case"script":return d=wc(n.src),(u=e.querySelector($o(d)))?(t.instance=u,Pe(u),u):(i=n,(u=ds.get(d))&&(i=j({},n),Oh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Pe(u),al(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,gf(i,n.precedence,e));return t.instance}function gf(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,d=u,_=0;_<i.length;_++){var w=i[_];if(w.dataset.precedence===t)d=w;else if(d!==u)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Dh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Oh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xf=null;function _x(e,t,n){if(xf===null){var i=new Map,u=xf=new Map;u.set(n,i)}else u=xf,i=u.get(n),i||(i=new Map,u.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var d=n[u];if(!(d[as]||d[cn]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var _=d.getAttribute(t)||"";_=e+_;var w=i.get(_);w?w.push(d):i.set(_,[d])}}return i}function yx(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function L0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function z0(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jc(i.href),d=t.querySelector(Go(u));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=d,Pe(d);return}d=t.ownerDocument||t,i=xx(i),(u=ds.get(u))&&Dh(i,u),d=d.createElement("link"),Pe(d);var _=d;_._p=new Promise(function(w,D){_.onload=w,_.onerror=D}),al(d,"link",i),n.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=bf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Lh=0;function U0(e,t){return e.stylesheets&&e.count===0&&yf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&yf(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Lh===0&&(Lh=62500*x0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yf(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function bf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _f=null;function yf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_f=new Map,t.forEach(H0,e),_f=null,bf.call(e))}function H0(e,t){if(!(t.state.loading&4)){var n=_f.get(e);if(n)var i=n.get(null);else{n=new Map,_f.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<u.length;d++){var _=u[d];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(n.set(_.dataset.precedence,_),i=_)}i&&n.set(null,i)}u=t.instance,_=u.getAttribute("data-precedence"),d=n.get(_)||i,d===i&&n.set(null,u),n.set(_,u),this.count++,i=bf.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),d?d.parentNode.insertBefore(u,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Yo={$$typeof:Y,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function B0(e,t,n,i,u,d,_,w,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=Mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mt(0),this.hiddenUpdates=Mt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=d,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function jx(e,t,n,i,u,d,_,w,D,ne,ue,me){return e=new B0(e,t,n,_,D,ne,ue,me,w),t=1,d===!0&&(t|=24),d=pl(3,null,null,t),e.current=d,d.stateNode=e,t=go(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:i,isDehydrated:n,cache:t},rc(d),e}function wx(e){return e?(e=Vs,e):Vs}function Sx(e,t,n,i,u,d){u=wx(u),i.context===null?i.context=u:i.pendingContext=u,i=Ws(t),i.payload={element:n},d=d===void 0?null:d,d!==null&&(i.callback=d),n=ea(e,i,t),n!==null&&($l(n,e,t),za(n,e,t))}function Nx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function zh(e,t){Nx(e,t),(e=e.alternate)&&Nx(e,t)}function kx(e){if(e.tag===13||e.tag===31){var t=Ss(e,67108864);t!==null&&$l(t,e,67108864),zh(e,67108864)}}function Ex(e){if(e.tag===13||e.tag===31){var t=ts();t=vl(t);var n=Ss(e,t);n!==null&&$l(n,e,t),zh(e,t)}}var vf=!0;function I0(e,t,n,i){var u=z.T;z.T=null;var d=I.p;try{I.p=2,Uh(e,t,n,i)}finally{I.p=d,z.T=u}}function q0(e,t,n,i){var u=z.T;z.T=null;var d=I.p;try{I.p=8,Uh(e,t,n,i)}finally{I.p=d,z.T=u}}function Uh(e,t,n,i){if(vf){var u=Hh(i);if(u===null)wh(e,t,i,jf,n),Cx(e,i);else if($0(u,e,t,n,i))i.stopPropagation();else if(Cx(e,i),t&4&&-1<G0.indexOf(e)){for(;u!==null;){var d=wl(u);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var _=rn(d.pendingLanes);if(_!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;_;){var D=1<<31-Lt(_);w.entanglements[1]|=D,_&=~D}na(d),(Tt&6)===0&&(lf=Fe()+500,Ho(0))}}break;case 31:case 13:w=Ss(d,2),w!==null&&$l(w,d,2),af(),zh(d,2)}if(d=Hh(i),d===null&&wh(e,t,i,jf,n),d===u)break;u=d}u!==null&&i.stopPropagation()}else wh(e,t,i,null,n)}}function Hh(e){return e=gn(e),Bh(e)}var jf=null;function Bh(e){if(jf=null,e=ul(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jf=e,null}function Tx(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(_n()){case tl:return 2;case Ot:return 8;case St:case cl:return 32;case dn:return 268435456;default:return 32}default:return 32}}var Ih=!1,ji=null,wi=null,Si=null,Xo=new Map,Vo=new Map,Ni=[],G0="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 Cx(e,t){switch(e){case"focusin":case"focusout":ji=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":Si=null;break;case"pointerover":case"pointerout":Xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(t.pointerId)}}function Qo(e,t,n,i,u,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:d,targetContainers:[u]},t!==null&&(t=wl(t),t!==null&&kx(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function $0(e,t,n,i,u){switch(t){case"focusin":return ji=Qo(ji,e,t,n,i,u),!0;case"dragenter":return wi=Qo(wi,e,t,n,i,u),!0;case"mouseover":return Si=Qo(Si,e,t,n,i,u),!0;case"pointerover":var d=u.pointerId;return Xo.set(d,Qo(Xo.get(d)||null,e,t,n,i,u)),!0;case"gotpointercapture":return d=u.pointerId,Vo.set(d,Qo(Vo.get(d)||null,e,t,n,i,u)),!0}return!1}function Ax(e){var t=ul(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,jl(e.priority,function(){Ex(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,jl(e.priority,function(){Ex(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hh(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);kn=i,n.target.dispatchEvent(i),kn=null}else return t=wl(n),t!==null&&kx(t),e.blockedOn=n,!1;t.shift()}return!0}function Mx(e,t,n){wf(e)&&n.delete(t)}function Y0(){Ih=!1,ji!==null&&wf(ji)&&(ji=null),wi!==null&&wf(wi)&&(wi=null),Si!==null&&wf(Si)&&(Si=null),Xo.forEach(Mx),Vo.forEach(Mx)}function Sf(e,t){e.blockedOn===t&&(e.blockedOn=null,Ih||(Ih=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Y0)))}var Nf=null;function Rx(e){Nf!==e&&(Nf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Nf===e&&(Nf=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Bh(i||n)===null)continue;break}var d=wl(n);d!==null&&(e.splice(t,3),t-=3,Hd(d,{pending:!0,data:u,method:n.method,action:i},i,u))}}))}function Sc(e){function t(D){return Sf(D,e)}ji!==null&&Sf(ji,e),wi!==null&&Sf(wi,e),Si!==null&&Sf(Si,e),Xo.forEach(t),Vo.forEach(t);for(var n=0;n<Ni.length;n++){var i=Ni[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ni.length&&(n=Ni[0],n.blockedOn===null);)Ax(n),n.blockedOn===null&&Ni.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var u=n[i],d=n[i+1],_=u[tt]||null;if(typeof d=="function")_||Rx(n);else if(_){var w=null;if(d&&d.hasAttribute("formAction")){if(u=d,_=d[tt]||null)w=_.formAction;else if(Bh(u)!==null)continue}else w=_.action;typeof w=="function"?n[i+1]=w:(n.splice(i,3),i-=3),Rx(n)}}}function Dx(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.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(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function qh(e){this._internalRoot=e}kf.prototype.render=qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,i=ts();Sx(n,i,e,t,null,null)},kf.prototype.unmount=qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sx(e.current,2,null,e,null,null),af(),t[jn]=null}};function kf(e){this._internalRoot=e}kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Is();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ni.length&&t!==0&&t<Ni[n].priority;n++);Ni.splice(n,0,e),n===0&&Ax(e)}};var Ox=s.version;if(Ox!=="19.2.8")throw Error(c(527,Ox,"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=x(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var X0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ef=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ef.isDisabled&&Ef.supportsFiber)try{yn=Ef.inject(X0),Ft=Ef}catch{}}return Zo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,i="",u=qm,d=Gm,_=$m;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=jx(e,1,!1,null,null,n,i,null,u,d,_,Dx),e[jn]=t.current,jh(e),new qh(t)},Zo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var i=!1,u="",d=qm,_=Gm,w=$m,D=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(_=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError),n.formState!==void 0&&(D=n.formState)),t=jx(e,1,!0,t,n??null,i,u,D,d,_,w,Dx),t.context=wx(null),n=t.current,i=ts(),i=vl(i),u=Ws(i),u.callback=null,ea(n,u,i),n=i,t.current.lanes=n,hn(t,n),na(t),e[jn]=t.current,jh(e),new kf(t)},Zo.version="19.2.8",Zo}var Xx;function lv(){if(Xx)return Xh.exports;Xx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Xh.exports=nv(),Xh.exports}var sv=lv();const j_=1,Ac="main",yr=["orange","blue","green","purple","pink","teal"];function av(l){return`${l.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${w_(l)}`}function iv(l){const s=l.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${s.replace(/^-+|-+$/g,"")||"project"}-${w_(l)}`,c=av(l);return[s,r].filter(o=>o!==c)}function w_(l){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(l);return rv(s?l.toLowerCase():l)}function rv(l){let s=3735928559,r=1103547991;for(let c=0;c<l.length;c++){const o=l.charCodeAt(c);s=Math.imul(s^o,2654435761),r=Math.imul(r^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&r)+(s>>>0)).toString(36)}const Dp=b.createContext({accounts:[],auth:{},multi:!1});function S_(){return b.useContext(Dp)}function cv(l,s="claude"){const{accounts:r,multi:c}=b.useContext(Dp);return!c||s==="antigravity"||!l?null:r.find(o=>o.id===l)??null}const Yf={orange:"оранжевый",blue:"синий",green:"зелёный",purple:"фиолетовый",pink:"розовый",teal:"бирюзовый"};function N_(l){const s=Array.from(l.trim())[0];return s?s.toUpperCase():"?"}function ov(l){return l?l.loggedIn?l.plan||"вход выполнен":"вход не выполнен":""}const k_="ccv:last-account";function uv(){try{return localStorage.getItem(k_)}catch{return null}}function fv(l){try{localStorage.setItem(k_,l)}catch{}}function pu({account:l,size:s="sm",className:r}){const c=`Аккаунт «${l.name}», ${Yf[l.color]}`;return a.jsx("span",{className:`acct-mark acct-mark--${s} acct--${l.color}${r?` ${r}`:""}`,role:"img","aria-label":c,title:c,children:a.jsx("span",{"aria-hidden":"true",children:N_(l.name)})})}function Vx({account:l,onClick:s,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:N_(l.name)})}),a.jsx("span",{className:"acct-chip__name",children:l.name})]}),o=`acct-chip acct--${l.color}${r?` ${r}`:""}`,f=`Сессия идёт под аккаунтом «${l.name}» — лимиты и тариф берутся из него`;return s?a.jsx("button",{type:"button",className:o,title:f,"aria-label":`Аккаунт «${l.name}». Открыть аккаунты`,onClick:s,children:c}):a.jsx("span",{className:o,title:f,role:"group","aria-label":`Аккаунт «${l.name}»`,children:c})}var Pa,Uc,Hc,Bc,Ic,hu,qc,ud,E_;class dv{constructor(s){bn(this,ud);bn(this,Pa,null);bn(this,Uc,new Set);bn(this,Hc,500);bn(this,Bc,null);bn(this,Ic,!1);bn(this,hu,null);bn(this,qc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){Ct(this,qc,s)}connect(){if(Ze(this,Ic))return;const s=new WebSocket(this.url);Ct(this,Pa,s),s.addEventListener("open",()=>{var r,c;Ct(this,Hc,500),this.send({type:"hello",protocol:j_,clientName:"ccv-web"}),(r=Ze(this,hu))==null||r.call(this),(c=Ze(this,qc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ze(this,Uc))o(c)}),s.addEventListener("close",()=>{var r;Ct(this,Pa,null),(r=Ze(this,qc))==null||r.call(this),$n(this,ud,E_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){Ct(this,hu,s)}on(s){return Ze(this,Uc).add(s),()=>Ze(this,Uc).delete(s)}send(s){var r;((r=Ze(this,Pa))==null?void 0:r.readyState)===WebSocket.OPEN&&Ze(this,Pa).send(JSON.stringify(s))}get connected(){var s;return((s=Ze(this,Pa))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;Ct(this,Ic,!0),(s=Ze(this,Pa))==null||s.close()}}Pa=new WeakMap,Uc=new WeakMap,Hc=new WeakMap,Bc=new WeakMap,Ic=new WeakMap,hu=new WeakMap,qc=new WeakMap,ud=new WeakSet,E_=function(){if(Ze(this,Ic)||Ze(this,Bc)!==null)return;const s=Ze(this,Hc);Ct(this,Hc,Math.min(s*2,1e4)),Ct(this,Bc,window.setTimeout(()=>{Ct(this,Bc,null),this.connect()},s))};const hv=1,T_="ccv:relay",Xf="ccv:relay.host";function pv(){try{const l=localStorage.getItem(T_);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function C_(){localStorage.removeItem(T_)}var ua,Gc,fa,$c,Yc,Li,jr,wr,zi,Sr,Xc,Nr,kr,ln,Ci,pp,A_,_r,mp;class mv{constructor(s){bn(this,ln);bn(this,ua,null);bn(this,Gc,new Set);bn(this,fa,null);bn(this,$c,null);bn(this,Yc,500);bn(this,Li,null);bn(this,jr,!1);bn(this,wr,!1);bn(this,zi,!1);bn(this,Sr,null);bn(this,Xc,"Подключаемся…");bn(this,Nr,0);bn(this,kr,[]);this.session=s}get connected(){return Ze(this,wr)&&Ze(this,zi)}get statusText(){return Ze(this,Xc)}get hostId(){return Ze(this,Sr)}on(s){return Ze(this,Gc).add(s),()=>Ze(this,Gc).delete(s)}onReconnect(s){Ct(this,$c,s)}onStatus(s){Ct(this,fa,s)}connect(){Ze(this,jr)||$n(this,ln,pp).call(this)}send(s){if(!Ze(this,wr)){Ze(this,kr).length<64&&Ze(this,kr).push(s);return}$n(this,ln,_r).call(this,{t:"client.frame",body:s})}close(){var s;Ct(this,jr,!0),Ze(this,Li)!==null&&window.clearTimeout(Ze(this,Li)),(s=Ze(this,ua))==null||s.close()}}ua=new WeakMap,Gc=new WeakMap,fa=new WeakMap,$c=new WeakMap,Yc=new WeakMap,Li=new WeakMap,jr=new WeakMap,wr=new WeakMap,zi=new WeakMap,Sr=new WeakMap,Xc=new WeakMap,Nr=new WeakMap,kr=new WeakMap,ln=new WeakSet,Ci=function(s){var r;Ze(this,Xc)!==s&&(Ct(this,Xc,s),(r=Ze(this,fa))==null||r.call(this))},pp=async function(){if(Ze(this,ua))return;if(!Ze(this,Sr))try{Ct(this,Sr,await gv(this.session.token))}catch(c){$n(this,ln,Ci).call(this,c instanceof Error?c.message:String(c)),$n(this,ln,mp).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);Ct(this,ua,r),r.addEventListener("open",()=>{$n(this,ln,_r).call(this,{t:"client.hello",protocol:hv,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}$n(this,ln,A_).call(this,o)}),r.addEventListener("close",()=>{var c;Ct(this,ua,null),Ct(this,wr,!1),Ct(this,zi,!1),$n(this,ln,Ci).call(this,"Нет связи с сервером"),(c=Ze(this,fa))==null||c.call(this),$n(this,ln,mp).call(this)}),r.addEventListener("error",()=>r.close())},A_=function(s){var r,c,o,f,h,m,g;switch(s.t){case"client.ok":Ct(this,Yc,500),$n(this,ln,_r).call(this,{t:"client.attach",hostId:Ze(this,Sr)??"",...Ze(this,Nr)>0?{sinceRseq:Ze(this,Nr)}:{}});return;case"client.attached":Ct(this,wr,!0),Ct(this,zi,s.online),Ct(this,Nr,s.rseq),$n(this,ln,Ci).call(this,s.online?"Хост на связи":"Компьютер не на связи"),$n(this,ln,_r).call(this,{t:"client.frame",body:{type:"hello",protocol:j_,clientName:"ccv-web-relay"}});const x=Ze(this,kr);Ct(this,kr,[]);for(const y of x)$n(this,ln,_r).call(this,{t:"client.frame",body:y});(r=Ze(this,$c))==null||r.call(this),(c=Ze(this,fa))==null||c.call(this);return;case"host.frame":{s.rseq>0&&Ct(this,Nr,s.rseq);const y=s.body;for(const j of Ze(this,Gc))j(y);return}case"host.online":Ct(this,zi,!0),$n(this,ln,Ci).call(this,"Хост на связи"),(o=Ze(this,$c))==null||o.call(this),(f=Ze(this,fa))==null||f.call(this);return;case"host.offline":Ct(this,zi,!1),$n(this,ln,Ci).call(this,"Компьютер не на связи"),(h=Ze(this,fa))==null||h.call(this);return;case"ping":$n(this,ln,_r).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){C_(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Xf),$n(this,ln,Ci).call(this,"Этот компьютер отвязан от аккаунта"),Ct(this,jr,!0),(m=Ze(this,ua))==null||m.close();return}s.code!=="offline"&&$n(this,ln,Ci).call(this,s.message),(g=Ze(this,fa))==null||g.call(this);return}},_r=function(s){var r;((r=Ze(this,ua))==null?void 0:r.readyState)===WebSocket.OPEN&&Ze(this,ua).send(JSON.stringify(s))},mp=function(){if(Ze(this,jr)||Ze(this,Li)!==null)return;const s=Ze(this,Yc);Ct(this,Yc,Math.min(s*2,1e4)),Ct(this,Li,window.setTimeout(()=>{Ct(this,Li,null),$n(this,ln,pp).call(this)},s))};async function gv(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Xf,s),s;const r=localStorage.getItem(Xf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw C_(),location.href="/login",new Error("нужен вход");const f=(await c.json()).hosts??[];if(f.length===1&&f[0])return localStorage.setItem(Xf,f[0].id),f[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Vf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const xv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function bv(){if(Vf()==="local")return new dv(xv);const l=pv();return l?new mv(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const M_="ccv:drafts",_v=40,yv=2e4,vv=500;let au=null,iu=null;function Op(){if(au)return au;const l=new Map;try{const s=localStorage.getItem(M_);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return au=l,window.addEventListener("pagehide",O_),l}function Zh(l){return Op().get(l)??""}function R_(l,s){const r=Op(),c=s.slice(0,yv),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>_v;){const f=r.keys().next();if(f.done)break;r.delete(f.value)}Sv(),wv()}function D_(){const l=new Set;for(const s of Op().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const gp=new Set;let Qx="";function jv(l){return gp.add(l),()=>gp.delete(l)}function wv(){const l=D_(),s=l.join(`
51
- `);if(s!==Qx){Qx=s;for(const r of gp)r(l)}}function Sv(){iu===null&&(iu=window.setTimeout(O_,vv))}function O_(){if(iu!==null&&window.clearTimeout(iu),iu=null,!!au)try{localStorage.setItem(M_,JSON.stringify(Object.fromEntries(au)))}catch{}}const El={items:[],pending:[],lastSeq:0,contextTokens:null},Fh={entries:[],total:0,loading:!1};function L_(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Kx(l){return l.total>0&&L_(l)>1}function Nv(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,f)=>o.seq-f.seq),total:s.total,loading:!1}}function kv(l){return Qf(El,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Qf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...Ev(r,c.event,c.seq),lastSeq:c.seq});return r}function Ev(l,s,r){var o,f;const c=l.items;switch(s.kind){case"user.message":return la(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return la(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return Nc(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?la(l,m):Nc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return la(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return Nc(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?la(l,m):Nc(l,h,m)}case"tool.use":return la(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return Nc(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return Nc({...l,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:la({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return la({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((f=s.usage)==null?void 0:f.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:la(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return la(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Tv(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function Cv(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let f=0;f<l.length;f++)if(l[f].kind==="user"){if(o===c)return l.slice(0,f);o++}return l}function la(l,s){return{...l,items:[...l.items,s]}}function Nc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const xp="ccv:theme",Jh=["system","light","dark"];function Av(){const[l,s]=b.useState(Mv);b.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return f(),o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[l]);const r=b.useCallback(o=>{try{localStorage.setItem(xp,o)}catch{}s(o)},[]),c=b.useCallback(()=>{s(o=>{const f=Jh[(Jh.indexOf(o)+1)%Jh.length];try{localStorage.setItem(xp,f)}catch{}return f})},[]);return[l,r,c]}function Mv(){try{const l=localStorage.getItem(xp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const z_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Rv=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Er={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:"вопроса"}},Dv=320,U_="ccv:panes";function Ov(l){return`--${l}-w`}function H_(l,s){const r=Er[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function Lv(){const l={};for(const s of Object.keys(Er))l[s]=Er[s].width;try{const s=localStorage.getItem(U_);if(s){const r=JSON.parse(s);for(const c of Object.keys(Er)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=H_(c,o))}}}catch{}return l}function zv(){const[l,s]=b.useState(Lv),r=b.useCallback(h=>{try{localStorage.setItem(U_,JSON.stringify(h))}catch{}},[]),c=b.useCallback((h,m)=>{s(g=>{const x=H_(h,m);if(g[h]===x)return g;const y={...g,[h]:x};return r(y),y})},[r]),o=b.useCallback(h=>{s(m=>{const g={...m,[h]:Er[h].width};return r(g),g})},[r]),f={};for(const h of Object.keys(Er))f[Ov(h)]=`${l[h]}px`;return{widths:l,style:f,setWidth:c,reset:o}}const Ph=260,B_=120,Uv=200,Zx="ccv:terminal-h";function Fx(l,s){return Math.round(Math.min(s,Math.max(B_,l)))}function Hv(){const[l,s]=b.useState(()=>{try{const f=localStorage.getItem(Zx);if(f){const h=Number(f);if(Number.isFinite(h))return Fx(h,1/0)}}catch{}return Ph}),r=b.useCallback(f=>{try{localStorage.setItem(Zx,String(f))}catch{}},[]),c=b.useCallback((f,h)=>{const m=Fx(f,h);s(g=>g===m?g:(r(m),m))},[r]),o=b.useCallback(()=>{s(Ph),r(Ph)},[r]);return{height:l,setHeight:c,reset:o}}function fd(l){const[s,r]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return b.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const Bv=500,Iv=6;function I_({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=Bv,moveCancelPx:o=Iv}){const f=b.useRef(null),[h,m]=b.useState(!1),g=b.useCallback(()=>{f.current&&window.clearTimeout(f.current.timer),f.current=null,m(!1)},[]),x=b.useCallback(A=>{if(r||A.button!==0)return;const C={timer:0,x:A.clientX,y:A.clientY,fired:!1};C.timer=window.setTimeout(()=>{C.fired=!0,m(!1),l()},c),f.current=C,m(!0)},[r,c,l]),y=b.useCallback(A=>{const C=f.current;!C||C.fired||Math.hypot(A.clientX-C.x,A.clientY-C.y)>o&&g()},[o,g]),j=b.useCallback(()=>{f.current&&!f.current.fired?g():m(!1)},[g]),v=b.useCallback(A=>{var C;if((C=f.current)!=null&&C.fired){f.current=null,A.preventDefault();return}if(!r){if(A.shiftKey){l();return}s()}},[r,s,l]),T=b.useCallback(A=>{A.preventDefault()},[]),S=b.useCallback(A=>{r||A.shiftKey&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:T,onKeyDown:S}}}const qv={height:0,offsetTop:0,offsetLeft:0};function Jx(){if(typeof window>"u")return qv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Gv(l){const[s,r]=b.useState(Jx);return b.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const f=Jx();r(h=>h.height===f.height&&h.offsetTop===f.offsetTop&&h.offsetLeft===f.offsetLeft?h:f)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[l]),s}function Lp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mr=Lp();function q_(l){Mr=l}var vr={exec:()=>null};function kc(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function yt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,f)=>{let h=typeof f=="string"?f:f.source;return h=h.replace(_l.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var $v=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),_l={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:kc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:kc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:kc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:kc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:kc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:kc(l=>new RegExp(`^ {0,${l}}>`))},Yv=/^(?:[ \t]*(?:\n|$))+/,Xv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Vv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,G_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$_=yt(G_).replace(/bull/g,zp).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(),Kv=yt(G_).replace(/bull/g,zp).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(),Up=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Zv=/^[^\n]+/,Hp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Fv=yt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jv=yt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zp).getRegex(),dd="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",Bp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pv=yt("^ {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",Bp).replace("tag",dd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Y_=l=>yt(Up).replace("hr",mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dd).getRegex(),Wv=Y_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),e1=Y_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),t1=yt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",e1).getRegex(),Ip={blockquote:t1,code:Xv,def:Fv,fences:Vv,heading:Qv,hr:mu,html:Pv,lheading:$_,list:Jv,newline:Yv,paragraph:Wv,table:vr,text:Zv},Px=yt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mu).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",dd).getRegex(),n1={...Ip,lheading:Kv,table:Px,paragraph:yt(Up).replace("hr",mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Px).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",dd).getRegex()},l1={...Ip,html:yt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bp).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:vr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:yt(Up).replace("hr",mu).replace("heading",` *#{1,6} *[^
52
- ]`).replace("lheading",$_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},s1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,a1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,X_=/^( {2,}|\\)\n(?!\s*$)/,i1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qc=/[\p{P}\p{S}]/u,hd=/[\s\p{P}\p{S}]/u,qp=/[^\s\p{P}\p{S}]/u,r1=yt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hd).getRegex(),V_=/(?!~)[\p{P}\p{S}]/u,c1=/(?!~)[\s\p{P}\p{S}]/u,o1=/(?:[^\s\p{P}\p{S}]|~)/u,u1=yt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$v?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Q_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,f1=yt(Q_,"u").replace(/punct/g,Qc).getRegex(),d1=yt(Q_,"u").replace(/punct/g,V_).getRegex(),K_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",h1=yt(K_,"gu").replace(/notPunctSpace/g,qp).replace(/punctSpace/g,hd).replace(/punct/g,Qc).getRegex(),p1=yt(K_,"gu").replace(/notPunctSpace/g,o1).replace(/punctSpace/g,c1).replace(/punct/g,V_).getRegex(),m1=yt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qp).replace(/punctSpace/g,hd).replace(/punct/g,Qc).getRegex(),g1=yt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qc).getRegex(),x1="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",b1=yt(x1,"gu").replace(/notPunctSpace/g,qp).replace(/punctSpace/g,hd).replace(/punct/g,Qc).getRegex(),_1=yt(/\\(punct)/,"gu").replace(/punct/g,Qc).getRegex(),y1=yt(/^<(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(),v1=yt(Bp).replace("(?:-->|$)","-->").getRegex(),j1=yt("^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",v1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ed=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,w1=yt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ed).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Z_=yt(/^!?\[(label)\]\[(ref)\]/).replace("label",ed).replace("ref",Hp).getRegex(),F_=yt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hp).getRegex(),S1=yt("reflink|nolink(?!\\()","g").replace("reflink",Z_).replace("nolink",F_).getRegex(),Wx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gp={_backpedal:vr,anyPunctuation:_1,autolink:y1,blockSkip:u1,br:X_,code:a1,del:vr,delLDelim:vr,delRDelim:vr,emStrongLDelim:f1,emStrongRDelimAst:h1,emStrongRDelimUnd:m1,escape:s1,link:w1,nolink:F_,punctuation:r1,reflink:Z_,reflinkSearch:S1,tag:j1,text:i1,url:vr},N1={...Gp,link:yt(/^!?\[(label)\]\((.*?)\)/).replace("label",ed).getRegex(),reflink:yt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ed).getRegex()},bp={...Gp,emStrongRDelimAst:p1,emStrongLDelim:d1,delLDelim:g1,delRDelim:b1,url:yt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Wx).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:yt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Wx).getRegex()},k1={...bp,br:yt(X_).replace("{2,}","*").getRegex(),text:yt(bp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tf={normal:Ip,gfm:n1,pedantic:l1},Fo={normal:Gp,gfm:bp,breaks:k1,pedantic:N1},E1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},eb=l=>E1[l];function ra(l,s){if(s){if(_l.escapeTest.test(l))return l.replace(_l.escapeReplace,eb)}else if(_l.escapeTestNoEncode.test(l))return l.replace(_l.escapeReplaceNoEncode,eb);return l}function tb(l){try{l=encodeURI(l).replace(_l.percentDecode,"%")}catch{return null}return l}function nb(l,s){var f;let r=l.replace(_l.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(_l.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((f=c.at(-1))!=null&&f.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(_l.slashPipe,"|");return c}function Ei(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function lb(l){let s=l.split(`
53
- `),r=s.length-1;for(;r>=0&&_l.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
- `)}function T1(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function C1(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let f=4-r%4;c+=" ".repeat(f),r+=f}else c+=o,r++;return c}function sb(l,s,r,c,o){let f=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:f,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function A1(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
55
- `).map(f=>{let h=f.match(r.other.beginningSpace);if(h===null)return f;let[m]=h;return m.length>=o.length?f.slice(o.length):f}).join(`
56
- `)}var td=class{constructor(l){Yt(this,"options");Yt(this,"rules");Yt(this,"lexer");this.options=l||Mr}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:lb(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=A1(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Ei(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Ei(s[0],`
57
- `),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:Ei(s[0],`
58
- `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Ei(s[0],`
59
- `).split(`
60
- `),c="",o="",f=[];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 x=m.join(`
61
- `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
62
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
63
- ${x}`:x,o=o?`${o}
64
- ${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,f,!0),this.lexer.state.top=j,r.length===0)break;let v=f.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let T=v,S=T.raw+`
65
- `+r.join(`
66
- `),A=this.blockquote(S);f[f.length-1]=A,c=c.substring(0,c.length-T.raw.length)+A.raw,o=o.substring(0,o.length-T.text.length)+A.text;break}else if((v==null?void 0:v.type)==="list"){let T=v,S=T.raw+`
67
- `+r.join(`
68
- `),A=this.list(S);f[f.length-1]=A,c=c.substring(0,c.length-v.raw.length)+A.raw,o=o.substring(0,o.length-T.raw.length)+A.raw,r=S.substring(f.at(-1).raw.length).split(`
69
- `);continue}}return{type:"blockquote",raw:c,tokens:f,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let f=this.rules.other.listItemRegex(r),h=!1;for(;l;){let g=!1,x="",y="";if(!(s=f.exec(l))||this.rules.block.hr.test(l))break;x=s[0],l=l.substring(x.length);let j=C1(s[2].split(`
70
- `,1)[0],s[1].length),v=l.split(`
71
- `,1)[0],T=!j.trim(),S=0;if(this.options.pedantic?(S=2,y=j.trimStart()):T?S=s[1].length+1:(S=j.search(this.rules.other.nonSpaceChar),S=S>4?1:S,y=j.slice(S),S+=s[1].length),T&&this.rules.other.blankLine.test(v)&&(x+=v+`
72
- `,l=l.substring(v.length+1),g=!0),!g){let A=this.rules.other.nextBulletRegex(S),C=this.rules.other.hrRegex(S),J=this.rules.other.fencesBeginRegex(S),le=this.rules.other.headingBeginRegex(S),Y=this.rules.other.htmlBeginRegex(S),H=this.rules.other.blockquoteBeginRegex(S);for(;l;){let q=l.split(`
73
- `,1)[0],B;if(v=q,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),B=v):B=v.replace(this.rules.other.tabCharGlobal," "),J.test(v)||le.test(v)||Y.test(v)||H.test(v)||A.test(v)||C.test(v))break;if(B.search(this.rules.other.nonSpaceChar)>=S||!v.trim())y+=`
74
- `+B.slice(S);else{if(T||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||J.test(j)||le.test(j)||C.test(j))break;y+=`
75
- `+v}T=!v.trim(),x+=q+`
76
- `,l=l.substring(q.length+1),j=B.slice(S)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=x}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 x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let 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 x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=lb(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Ei(s[0],`
77
- `),href:c,title:o}}}table(l){var h;let s=this.rules.block.table.exec(l);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let r=nb(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
78
- `):[],f={type:"table",raw:Ei(s[0],`
79
- `),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?f.align.push("right"):this.rules.other.tableAlignCenter.test(m)?f.align.push("center"):this.rules.other.tableAlignLeft.test(m)?f.align.push("left"):f.align.push(null);for(let m=0;m<r.length;m++)f.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:f.align[m]});for(let m of o)f.rows.push(nb(m,f.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:f.align[x]})));return f}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Ei(s[0],`
80
- `),depth:s[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(l){let s=this.rules.block.paragraph.exec(l);if(s){let r=s[1].charAt(s[1].length-1)===`
81
- `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let f=Ei(r.slice(0,-1),"\\");if((r.length-f.length)%2===0)return}else{let f=T1(s[2],"()");if(f===-2)return;if(f>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+f;s[2]=s[2].substring(0,f),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let f=this.rules.other.pedanticHrefTitle.exec(c);f&&(c=f[1],o=f[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),sb(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let f=r[0].charAt(0);return{type:"text",raw:f,text:f}}return sb(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,f,h,m=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*l.length+o);(c=x.exec(s))!==null;){if(f=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!f)continue;if(h=[...f].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=l.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let T=j.slice(1,-1);return{type:"em",raw:j,text:T,tokens:this.lexer.inlineTokens(T)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,f,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,s=s.slice(-1*l.length+o);(c=g.exec(s))!==null;){if(f=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!f||(h=[...f].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 x=[...c[0]][0].length,y=l.slice(0,o+c.index+x+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let f;do f=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(f!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},zs=class _p{constructor(s){Yt(this,"tokens");Yt(this,"options");Yt(this,"state");Yt(this,"inlineQueue");Yt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Mr,this.options.tokenizer=this.options.tokenizer||new td,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:_l,block:Tf.normal,inline:Fo.normal};this.options.pedantic?(r.block=Tf.pedantic,r.inline=Fo.pedantic):this.options.gfm&&(r.block=Tf.gfm,this.options.breaks?r.inline=Fo.breaks:r.inline=Fo.gfm),this.tokenizer.rules=r}static get rules(){return{block:Tf,inline:Fo}}static lex(s,r){return new _p(r).lex(s)}static lexInline(s,r){return new _p(r).inlineTokens(s)}lex(s){s=s.replace(_l.carriageReturn,`
82
- `),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],c=!1){var f,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(_l.tabCharGlobal," ").replace(_l.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}let g;if((h=(f=this.options.extensions)==null?void 0:f.block)!=null&&h.some(y=>(g=y.call({lexer:this},s,r))?(s=s.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.substring(g.raw.length);let y=r.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
83
- `:r.push(g);continue}if(g=this.tokenizer.code(s)){s=s.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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(s)){s=s.substring(g.raw.length);let 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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),r.push(g);continue}let x=s;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=s.slice(1),v;this.options.extensions.startBlock.forEach(T=>{v=T.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=s.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){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=x.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.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(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,x,y,j;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,T=>v.includes(T.slice(T.lastIndexOf("[")+1,-1))?"["+"a".repeat(T.length-2)+"]":T))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,T,S)=>{let A=S?S.length:0;return v.slice(0,A)+"["+"a".repeat(v.length-A-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,f="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(f=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(S=>(v=S.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let S=r.at(-1);v.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=v.raw,S.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,f)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,f)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let T=s;if((j=this.options.extensions)!=null&&j.startInline){let S=1/0,A=s.slice(1),C;this.options.extensions.startInline.forEach(J=>{C=J.call({lexer:this},A),typeof C=="number"&&C>=0&&(S=Math.min(S,C))}),S<1/0&&S>=0&&(T=s.substring(0,S+1))}if(v=this.tokenizer.inlineText(T)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(f=v.raw.slice(-1)),o=!0;let S=r.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=v.raw,S.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},nd=class{constructor(l){Yt(this,"options");Yt(this,"parser");this.options=l||Mr}space(l){return""}code({text:l,lang:s,escaped:r}){var f;let c=(f=(s||"").match(_l.notSpaceStart))==null?void 0:f[0],o=l.replace(_l.endingNewline,"")+`
96
- `;return c?'<pre><code class="language-'+ra(c)+'">'+(r?o:ra(o,!0))+`</code></pre>
97
- `:"<pre><code>"+(r?o:ra(o,!0))+`</code></pre>
98
- `}blockquote({tokens:l}){return`<blockquote>
99
- ${this.parser.parse(l)}</blockquote>
100
- `}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:s}){return`<h${s}>${this.parser.parseInline(l)}</h${s}>
101
- `}hr(l){return`<hr>
102
- `}list(l){let s=l.ordered,r=l.start,c="";for(let h=0;h<l.items.length;h++){let m=l.items[h];c+=this.listitem(m)}let o=s?"ol":"ul",f=s&&r!==1?' start="'+r+'"':"";return"<"+o+f+`>
103
- `+c+"</"+o+`>
104
- `}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
105
- `}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
106
- `}table(l){let s="",r="";for(let o=0;o<l.header.length;o++)r+=this.tablecell(l.header[o]);s+=this.tablerow({text:r});let c="";for(let o=0;o<l.rows.length;o++){let f=l.rows[o];r="";for(let h=0;h<f.length;h++)r+=this.tablecell(f[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
107
- <thead>
108
- `+s+`</thead>
109
- `+c+`</table>
110
- `}tablerow({text:l}){return`<tr>
111
- ${l}</tr>
112
- `}tablecell(l){let s=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+s+`</${r}>
113
- `}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${ra(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=tb(l);if(o===null)return c;l=o;let f='<a href="'+l+'"';return s&&(f+=' title="'+ra(s)+'"'),f+=">"+c+"</a>",f}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=tb(l);if(o===null)return ra(r);l=o;let f=`<img src="${l}" alt="${ra(r)}"`;return s&&(f+=` title="${ra(s)}"`),f+=">",f}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:ra(l.text)}},$p=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Us=class yp{constructor(s){Yt(this,"options");Yt(this,"renderer");Yt(this,"textRenderer");this.options=s||Mr,this.options.renderer=this.options.renderer||new nd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $p}static parse(s,r){return new yp(r).parse(s)}static parseInline(s,r){return new yp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let f=0;f<s.length;f++){let h=s[f];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=x||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(s,r=this.renderer){var o,f;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((f=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&f[m.type]){let x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=x||"";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 x='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},$f,nu=($f=class{constructor(l){Yt(this,"options");Yt(this,"block");this.options=l||Mr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?zs.lex:zs.lexInline}provideParser(l=this.block){return l?Us.parse:Us.parseInline}},Yt($f,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Yt($f,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),$f),M1=class{constructor(...l){Yt(this,"defaults",Lp());Yt(this,"options",this.setOptions);Yt(this,"parse",this.parseMarkdown(!0));Yt(this,"parseInline",this.parseMarkdown(!1));Yt(this,"Parser",Us);Yt(this,"Renderer",nd);Yt(this,"TextRenderer",$p);Yt(this,"Lexer",zs);Yt(this,"Tokenizer",td);Yt(this,"Hooks",nu);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let f of l)switch(r=r.concat(s.call(this,f)),f.type){case"table":{let h=f;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=f;r=r.concat(this.walkTokens(h.items,s));break}default:{let h=f;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let f=s.renderers[o.name];f?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=f.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let f=s[o.level];f?f.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new nd(this.defaults);for(let f in r.renderer){if(!(f in o))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;let h=f,m=r.renderer[h],g=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new td(this.defaults);for(let f in r.tokenizer){if(!(f in o))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;let h=f,m=r.tokenizer[h],g=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new nu;for(let f in r.hooks){if(!(f in o))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;let h=f,m=r.hooks[h],g=o[h];nu.passThroughHooks.has(f)?o[h]=x=>{if(this.defaults.async&&nu.passThroughHooksRespectAsync.has(f))return(async()=>{let j=await m.call(o,x);return g.call(o,j)})();let y=m.call(o,x);return g.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,x);return j===!1&&(j=await g.apply(o,x)),j})();let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,f=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(f.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return zs.lex(l,s??this.defaults)}parser(l,s){return Us.parse(l,s??this.defaults)}parseMarkdown(l){return(s,r)=>{let c={...r},o={...this.defaults,...c},f=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?zs.lex:zs.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(l):l?Us.parse:Us.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(f);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?zs.lex:zs.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Us.parse:Us.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return f(h)}}}onError(l,s){return r=>{if(r.message+=`
114
- Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+ra(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},Ar=new M1;function Dt(l,s){return Ar.parse(l,s)}Dt.options=Dt.setOptions=function(l){return Ar.setOptions(l),Dt.defaults=Ar.defaults,q_(Dt.defaults),Dt};Dt.getDefaults=Lp;Dt.defaults=Mr;Dt.use=function(...l){return Ar.use(...l),Dt.defaults=Ar.defaults,q_(Dt.defaults),Dt};Dt.walkTokens=function(l,s){return Ar.walkTokens(l,s)};Dt.parseInline=Ar.parseInline;Dt.Parser=Us;Dt.parser=Us.parse;Dt.Renderer=nd;Dt.TextRenderer=$p;Dt.Lexer=zs;Dt.lexer=zs.lex;Dt.Tokenizer=td;Dt.Hooks=nu;Dt.parse=Dt;Dt.options;Dt.setOptions;Dt.use;Dt.walkTokens;Dt.parseInline;Us.parse;zs.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 ab(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function R1(l){if(Array.isArray(l))return l}function D1(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,f,h,m=[],g=!0,x=!1;try{if(f=(r=r.call(l)).next,s!==0)for(;!(g=(c=f.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(y){x=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function O1(){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 L1(l,s){return R1(l)||D1(l,s)||z1(l,s)||O1()}function z1(l,s){if(l){if(typeof l=="string")return ab(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ab(l,s):void 0}}const J_=Object.entries,ib=Object.setPrototypeOf,U1=Object.isFrozen,H1=Object.getPrototypeOf,B1=Object.getOwnPropertyDescriptor;let il=Object.freeze,rl=Object.seal,Cc=Object.create,P_=typeof Reflect<"u"&&Reflect,vp=P_.apply,jp=P_.construct;il||(il=function(s){return s});rl||(rl=function(s){return s});vp||(vp=function(s,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),f=2;f<c;f++)o[f-2]=arguments[f];return s.apply(r,o)});jp||(jp=function(s){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new s(...c)});const Ec=Yn(Array.prototype.forEach),I1=Yn(Array.prototype.lastIndexOf),rb=Yn(Array.prototype.pop),Tc=Yn(Array.prototype.push),q1=Yn(Array.prototype.splice),Oi=Array.isArray,lu=Yn(String.prototype.toLowerCase),Wh=Yn(String.prototype.toString),cb=Yn(String.prototype.match),Jo=Yn(String.prototype.replace),ob=Yn(String.prototype.indexOf),G1=Yn(String.prototype.trim),$1=Yn(Number.prototype.toString),Y1=Yn(Boolean.prototype.toString),ub=typeof BigInt>"u"?null:Yn(BigInt.prototype.toString),fb=typeof Symbol>"u"?null:Yn(Symbol.prototype.toString),el=Yn(Object.prototype.hasOwnProperty),Po=Yn(Object.prototype.toString),Wn=Yn(RegExp.prototype.test),mr=X1(TypeError);function Yn(l){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return vp(l,s,c)}}function X1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return jp(l,r)}}function _t(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lu;if(ib&&ib(l,null),!Oi(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const f=r(o);f!==o&&(U1(s)||(s[c]=f),o=f)}l[o]=!0}return l}function V1(l){for(let s=0;s<l.length;s++)el(l,s)||(l[s]=null);return l}function Tl(l){const s=Cc(null);for(const c of J_(l)){var r=L1(c,2);const o=r[0],f=r[1];el(l,o)&&(Oi(f)?s[o]=V1(f):f&&typeof f=="object"&&f.constructor===Object?s[o]=Tl(f):s[o]=f)}return s}function Q1(l){switch(typeof l){case"string":return l;case"number":return $1(l);case"boolean":return Y1(l);case"bigint":return ub?ub(l):"0";case"symbol":return fb?fb(l):"Symbol()";case"undefined":return Po(l);case"function":case"object":{if(l===null)return Po(l);const s=l,r=ca(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Po(c)}return Po(l)}default:return Po(l)}}function ca(l,s){for(;l!==null;){const c=B1(l,s);if(c){if(c.get)return Yn(c.get);if(typeof c.value=="function")return Yn(c.value)}l=H1(l)}function r(){return null}return r}function K1(l){try{return Wn(l,""),!0}catch{return!1}}const db=il(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ep=il(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),tp=il(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Z1=il(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),np=il(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),F1=il(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hb=il(["#text"]),pb=il(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),lp=il(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mb=il(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Cf=il(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),J1=rl(/{{[\w\W]*|^[\w\W]*}}/g),P1=rl(/<%[\w\W]*|^[\w\W]*%>/g),W1=rl(/\${[\w\W]*/g),ej=rl(/^data-[\-\w.\u00B7-\uFFFF]+$/),tj=rl(/^aria-[\-\w]+$/),gb=rl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nj=rl(/^(?:\w+script|data):/i),lj=rl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sj=rl(/^html$/i),aj=rl(/^[a-z][.\w]*(-[.\w]+)+$/i),xb=rl(/<[/\w!]/g),bb=rl(/<[/\w]/g),ij=rl(/<\/no(script|embed|frames)/i),rj=rl(/\/>/i),ns={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},cj=function(){return typeof window>"u"?null:window},oj=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const f="dompurify"+(c?"#"+c:"");try{return s.createPolicy(f,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},_b=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ti=function(s,r,c,o){return el(s,r)&&Oi(s[r])?_t(o.base?Tl(o.base):{},s[r],o.transform):c};function W_(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cj();const s=_e=>W_(_e);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==ns.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const f=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,x=l.NamedNodeMap;x===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const y=l.DOMParser,j=l.trustedTypes,v=m.prototype,T=ca(v,"cloneNode"),S=ca(v,"remove"),A=ca(v,"nextSibling"),C=ca(v,"childNodes"),J=ca(v,"parentNode"),le=ca(v,"shadowRoot"),Y=ca(v,"attributes"),H=h&&h.prototype?ca(h.prototype,"nodeType"):null,q=h&&h.prototype?ca(h.prototype,"nodeName"):null;if(typeof f=="function"){const _e=r.createElement("template");_e.content&&_e.content.ownerDocument&&(r=_e.content.ownerDocument)}let B,M="",R,W=!1,oe=0;const G=function(){if(oe>0)throw mr('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.')},Z=function(k){G(),oe++;try{return B.createHTML(k)}finally{oe--}},ge=function(k){G(),oe++;try{return B.createScriptURL(k)}finally{oe--}},ye=function(){return W||(R=oj(j,o),W=!0),R},Ne=r,z=Ne.implementation,I=Ne.createNodeIterator,V=Ne.createDocumentFragment,pe=Ne.getElementsByTagName,Se=c.importNode;let N=_b();s.isSupported=typeof J_=="function"&&typeof J=="function"&&z&&z.createHTMLDocument!==void 0;const ee=J1,U=P1,ve=W1,F=ej,je=tj,Oe=nj,$e=lj,Be=aj;let bt=gb,Qe=null;const fn=_t({},[...db,...ep,...tp,...np,...hb]);let We=null;const st=_t({},[...pb,...lp,...mb,...Cf]);let ct=Object.seal(Cc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),vt=null,ut=null;const It=Object.seal(Cc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let wt=!0,Te=!0,et=!1,At=!0,ft=!1,Fe=!0,_n=!1,tl=!1,Ot=null,St=null,cl=!1,dn=!1,an=!1,ol=!1,yn=!0,Ft=!1;const An="user-content-";let Lt=!0,Et=!1,ae={},be=null;const Ve=_t({},["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 at=null;const Je=_t({},["audio","video","img","source","image","track"]);let rn=null;const X=_t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",qe="http://www.w3.org/1999/xhtml";let Mt=qe,hn=!1,Mn=null;const Xl=_t({},[he,Re,qe],Wh),vn=il(["mi","mo","mn","ms","mtext"]);let ls=_t({},vn);const vl=il(["annotation-xml"]);let nl=_t({},vl);const Is=_t({},["title","style","font","a","script"]);let jl=null;const Cl=["application/xhtml+xml","text/html"],cn="text/html";let tt=null,jn=null;const Xn=r.createElement("form"),ma=function(k){return k instanceof RegExp||k instanceof Function},ss=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(jn&&jn===k)return;(!k||typeof k!="object")&&(k={}),k=Tl(k),jl=Cl.indexOf(k.PARSER_MEDIA_TYPE)===-1?cn:k.PARSER_MEDIA_TYPE,tt=jl==="application/xhtml+xml"?Wh:lu,Qe=Ti(k,"ALLOWED_TAGS",fn,{transform:tt}),We=Ti(k,"ALLOWED_ATTR",st,{transform:tt}),Mn=Ti(k,"ALLOWED_NAMESPACES",Xl,{transform:Wh}),rn=Ti(k,"ADD_URI_SAFE_ATTR",X,{transform:tt,base:X}),at=Ti(k,"ADD_DATA_URI_TAGS",Je,{transform:tt,base:Je}),be=Ti(k,"FORBID_CONTENTS",Ve,{transform:tt}),vt=Ti(k,"FORBID_TAGS",Tl({}),{transform:tt}),ut=Ti(k,"FORBID_ATTR",Tl({}),{transform:tt}),ae=el(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?Tl(k.USE_PROFILES):k.USE_PROFILES:!1,wt=k.ALLOW_ARIA_ATTR!==!1,Te=k.ALLOW_DATA_ATTR!==!1,et=k.ALLOW_UNKNOWN_PROTOCOLS||!1,At=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=k.SAFE_FOR_TEMPLATES||!1,Fe=k.SAFE_FOR_XML!==!1,_n=k.WHOLE_DOCUMENT||!1,dn=k.RETURN_DOM||!1,an=k.RETURN_DOM_FRAGMENT||!1,ol=k.RETURN_TRUSTED_TYPE||!1,cl=k.FORCE_BODY||!1,yn=k.SANITIZE_DOM!==!1,Ft=k.SANITIZE_NAMED_PROPS||!1,Lt=k.KEEP_CONTENT!==!1,Et=k.IN_PLACE||!1,bt=K1(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:gb,Mt=typeof k.NAMESPACE=="string"?k.NAMESPACE:qe,ls=el(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?Tl(k.MATHML_TEXT_INTEGRATION_POINTS):_t({},vn),nl=el(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?Tl(k.HTML_INTEGRATION_POINTS):_t({},vl);const K=el(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?Tl(k.CUSTOM_ELEMENT_HANDLING):Cc(null);if(ct=Cc(null),el(K,"tagNameCheck")&&ma(K.tagNameCheck)&&(ct.tagNameCheck=K.tagNameCheck),el(K,"attributeNameCheck")&&ma(K.attributeNameCheck)&&(ct.attributeNameCheck=K.attributeNameCheck),el(K,"allowCustomizedBuiltInElements")&&typeof K.allowCustomizedBuiltInElements=="boolean"&&(ct.allowCustomizedBuiltInElements=K.allowCustomizedBuiltInElements),rl(ct),ft&&(Te=!1),an&&(dn=!0),ae&&(Qe=_t({},hb),We=Cc(null),ae.html===!0&&(_t(Qe,db),_t(We,pb)),ae.svg===!0&&(_t(Qe,ep),_t(We,lp),_t(We,Cf)),ae.svgFilters===!0&&(_t(Qe,tp),_t(We,lp),_t(We,Cf)),ae.mathMl===!0&&(_t(Qe,np),_t(We,mb),_t(We,Cf))),It.tagCheck=null,It.attributeCheck=null,el(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?It.tagCheck=k.ADD_TAGS:Oi(k.ADD_TAGS)&&(Qe===fn&&(Qe=Tl(Qe)),_t(Qe,k.ADD_TAGS,tt))),el(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?It.attributeCheck=k.ADD_ATTR:Oi(k.ADD_ATTR)&&(We===st&&(We=Tl(We)),_t(We,k.ADD_ATTR,tt))),el(k,"ADD_URI_SAFE_ATTR")&&Oi(k.ADD_URI_SAFE_ATTR)&&_t(rn,k.ADD_URI_SAFE_ATTR,tt),el(k,"FORBID_CONTENTS")&&Oi(k.FORBID_CONTENTS)&&(be===Ve&&(be=Tl(be)),_t(be,k.FORBID_CONTENTS,tt)),el(k,"ADD_FORBID_CONTENTS")&&Oi(k.ADD_FORBID_CONTENTS)&&(be===Ve&&(be=Tl(be)),_t(be,k.ADD_FORBID_CONTENTS,tt)),Lt&&(Qe["#text"]=!0),_n&&_t(Qe,["html","head","body"]),Qe.table&&(_t(Qe,["tbody"]),delete vt.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw mr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const xe=B;B=k.TRUSTED_TYPES_POLICY;try{M=Z("")}catch(ke){throw B=xe,ke}}else k.TRUSTED_TYPES_POLICY===null?(B=void 0,M=""):(B===void 0&&(B=ye()),B&&typeof M=="string"&&(M=Z("")));il&&il(k),jn=k},qs=_t({},[...ep,...tp,...Z1]),as=_t({},[...np,...F1]),zn=function(k,K,xe){return K.namespaceURI===qe?k==="svg":K.namespaceURI===he?k==="svg"&&(xe==="annotation-xml"||ls[xe]):!!qs[k]},ul=function(k,K,xe){return K.namespaceURI===qe?k==="math":K.namespaceURI===Re?k==="math"&&nl[xe]:!!as[k]},wl=function(k,K,xe){return K.namespaceURI===Re&&!nl[xe]||K.namespaceURI===he&&!ls[xe]?!1:!as[k]&&(Is[k]||!qs[k])},zt=function(k){let K=J(k);(!K||!K.tagName)&&(K={namespaceURI:Mt,tagName:"template"});const xe=lu(k.tagName),ke=lu(K.tagName);return Mn[k.namespaceURI]?k.namespaceURI===Re?zn(xe,K,ke):k.namespaceURI===he?ul(xe,K,ke):k.namespaceURI===qe?wl(xe,K,ke):!!(jl==="application/xhtml+xml"&&Mn[k.namespaceURI]):!1},Jt=function(k){Tc(s.removed,{element:k});try{J(k).removeChild(k)}catch{if(S(k),!J(k))throw mr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Pe=function(k){ll(k);const K=C(k);if(K){const ke=[];Ec(K,Ge=>{Tc(ke,Ge)}),Ec(ke,Ge=>{try{S(Ge)}catch{}})}const xe=Y(k);if(xe)for(let ke=xe.length-1;ke>=0;--ke){const Ge=xe[ke],Le=Ge&&Ge.name;if(typeof Le=="string")try{k.removeAttribute(Le)}catch{}}},fl=function(k,K){try{Tc(s.removed,{attribute:K.getAttributeNode(k),from:K})}catch{Tc(s.removed,{attribute:null,from:K})}if(K.removeAttribute(k),k==="is")if(dn||an)try{Jt(K)}catch{}else try{K.setAttribute(k,"")}catch{}},pn=function(k){const K=Y(k);if(K)for(let xe=K.length-1;xe>=0;--xe){const ke=K[xe],Ge=ke&&ke.name;if(!(typeof Ge!="string"||We[tt(Ge)]))try{k.removeAttribute(Ge)}catch{}}},ll=function(k){const K=[k];for(;K.length>0;){const xe=K.pop();(H?H(xe):xe.nodeType)===ns.element&&pn(xe);const Ge=C(xe);if(Ge)for(let Le=Ge.length-1;Le>=0;--Le)K.push(Ge[Le])}},Rn=function(k){if(!Fe)return;const K=[k];for(;K.length>0;){const xe=K.pop(),ke=H?H(xe):xe.nodeType;if(ke===ns.processingInstruction||ke===ns.comment&&Wn(bb,xe.data)){try{S(xe)}catch{}continue}if(ke===ns.element){const Le=xe,qt=tt(q?q(xe):xe.nodeName);try{Le.hasAttribute&&Le.hasAttribute("patchsrc")&&Le.removeAttribute("patchsrc"),Le.hasAttribute&&Le.hasAttribute("for")&&qt!=="label"&&qt!=="output"&&Le.removeAttribute("for")}catch{}}const Ge=C(xe);if(Ge)for(let Le=Ge.length-1;Le>=0;--Le)K.push(Ge[Le])}},Un=function(k){let K=null,xe=null;if(cl)k="<remove></remove>"+k;else{const Le=cb(k,/^[\r\n\t ]+/);xe=Le&&Le[0]}jl==="application/xhtml+xml"&&Mt===qe&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const ke=B?Z(k):k;if(Mt===qe)try{K=new y().parseFromString(ke,jl)}catch{}if(!K||!K.documentElement){K=z.createDocument(Mt,"template",null);try{K.documentElement.innerHTML=hn?M:ke}catch{}}const Ge=K.body||K.documentElement;return k&&xe&&Ge.insertBefore(r.createTextNode(xe),Ge.childNodes[0]||null),Mt===qe?pe.call(K,_n?"html":"body")[0]:_n?K.documentElement:Ge},Jn=function(k){return I.call(k.ownerDocument||k,k,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Xt=function(k){return k=Jo(k,ee," "),k=Jo(k,U," "),k=Jo(k,ve," "),k},Sl=function(k){var K;k.normalize();const xe=I.call(k.ownerDocument||k,k,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let ke=xe.nextNode();for(;ke;)ke.data=Xt(ke.data),ke=xe.nextNode();const Ge=(K=k.querySelectorAll)===null||K===void 0?void 0:K.call(k,"template");Ge&&Ec(Ge,Le=>{Sn(Le.content)&&Sl(Le.content)})},wn=function(k){const K=q?q(k):null;return typeof K!="string"||tt(K)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==Y(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==H(k)||k.childNodes!==C(k)},Sn=function(k){if(!H||typeof k!="object"||k===null)return!1;try{return H(k)===ns.documentFragment}catch{return!1}},Vt=function(k){if(!H||typeof k!="object"||k===null)return!1;try{return typeof H(k)=="number"}catch{return!1}};function jt(_e,k,K){_e.length!==0&&Ec(_e,xe=>{xe.call(s,k,K,jn)})}const gs=function(k,K){return!!(Fe&&k.hasChildNodes()&&!Vt(k.firstElementChild)&&Wn(xb,k.textContent)&&Wn(xb,k.innerHTML)||Fe&&k.namespaceURI===qe&&K==="style"&&Vt(k.firstElementChild)||k.nodeType===ns.processingInstruction||Fe&&k.nodeType===ns.comment&&Wn(bb,k.data))},Nl=function(k,K){if(!vt[K]&&Gs(K)&&(ct.tagNameCheck instanceof RegExp&&Wn(ct.tagNameCheck,K)||ct.tagNameCheck instanceof Function&&ct.tagNameCheck(K)))return!1;if(Lt&&!be[K]){const xe=J(k),ke=C(k);if(ke&&xe){const Ge=ke.length;for(let Le=Ge-1;Le>=0;--Le){const qt=Et?ke[Le]:T(ke[Le],!0);xe.insertBefore(qt,A(k))}}}return Jt(k),!0},Al=function(k,K){if(jt(N.beforeSanitizeElements,k,null),k!==K&&J(k)===null)return!0;if(wn(k))return Jt(k),!0;const xe=tt(q?q(k):k.nodeName);if(jt(N.uponSanitizeElement,k,{tagName:xe,allowedTags:Qe}),k!==K&&J(k)===null)return!0;if(gs(k,xe))return Jt(k),!0;if(vt[xe]||!(It.tagCheck instanceof Function&&It.tagCheck(xe))&&!Qe[xe]){const Ge=Nl(k,xe);return Ge===!1&&jt(N.afterSanitizeElements,k,null),Ge}if((H?H(k):k.nodeType)===ns.element&&!zt(k)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Wn(ij,k.innerHTML))return Jt(k),!0;if(ft&&k.nodeType===ns.text){const Ge=Xt(k.textContent);k.textContent!==Ge&&(Tc(s.removed,{element:k.cloneNode()}),k.textContent=Ge)}return jt(N.afterSanitizeElements,k,null),!1},mn=function(k,K,xe){if(ut[K]||Fe&&K==="patchsrc"||Fe&&K==="for"&&k!=="label"&&k!=="output"||yn&&(K==="id"||K==="name")&&(xe in r||xe in Xn))return!1;const ke=We[K]||It.attributeCheck instanceof Function&&It.attributeCheck(K,k);if(!(Te&&Wn(F,K))){if(!(wt&&Wn(je,K))){if(ke){if(!rn[K]){if(!Wn(bt,Jo(xe,$e,""))){if(!((K==="src"||K==="xlink:href"||K==="href")&&k!=="script"&&ob(xe,"data:")===0&&at[k])){if(!(et&&!Wn(Oe,Jo(xe,$e,"")))){if(xe)return!1}}}}}else if(!(Gs(k)&&(ct.tagNameCheck instanceof RegExp&&Wn(ct.tagNameCheck,k)||ct.tagNameCheck instanceof Function&&ct.tagNameCheck(k))&&(ct.attributeNameCheck instanceof RegExp&&Wn(ct.attributeNameCheck,K)||ct.attributeNameCheck instanceof Function&&ct.attributeNameCheck(K,k))||K==="is"&&ct.allowCustomizedBuiltInElements&&(ct.tagNameCheck instanceof RegExp&&Wn(ct.tagNameCheck,xe)||ct.tagNameCheck instanceof Function&&ct.tagNameCheck(xe))))return!1}}return!0},xs=_t({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Gs=function(k){return!xs[lu(k)]&&Wn(Be,k)},Dn=function(k,K,xe,ke){if(B&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!xe)switch(j.getAttributeType(k,K)){case"TrustedHTML":return Z(ke);case"TrustedScriptURL":return ge(ke)}return ke},ga=function(k,K,xe,ke){try{xe?k.setAttributeNS(xe,K,ke):k.setAttribute(K,ke),wn(k)?Jt(k):rb(s.removed)}catch{fl(K,k)}},Vl=function(k){jt(N.beforeSanitizeAttributes,k,null);const K=k.attributes;if(!K||wn(k))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:We,forceKeepAttr:void 0};let ke=K.length;const Ge=tt(k.nodeName);for(;ke--;){const Le=K[ke],qt=Le.name,Nn=Le.namespaceURI,on=Le.value,Ut=tt(qt),kn=on;let gn=qt==="value"?kn:G1(kn);if(xe.attrName=Ut,xe.attrValue=gn,xe.keepAttr=!0,xe.forceKeepAttr=void 0,jt(N.uponSanitizeAttribute,k,xe),gn=xe.attrValue,Ft&&(Ut==="id"||Ut==="name")&&ob(gn,An)!==0&&(fl(qt,k),gn=An+gn),Fe&&Wn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,gn)){fl(qt,k);continue}if(Ut==="attributename"&&cb(gn,"href")){fl(qt,k);continue}if(!xe.forceKeepAttr){if(!xe.keepAttr){fl(qt,k);continue}if(!At&&Wn(rj,gn)){fl(qt,k);continue}if(ft&&(gn=Xt(gn)),!mn(Ge,Ut,gn)){fl(qt,k);continue}gn=Dn(Ge,Ut,Nn,gn),gn!==kn&&ga(k,qt,Nn,gn)}}jt(N.afterSanitizeAttributes,k,null)},dl=function(k){let K=null;const xe=Jn(k);for(jt(N.beforeSanitizeShadowDOM,k,null);K=xe.nextNode();)if(jt(N.uponSanitizeShadowNode,K,null),Al(K,k),Vl(K),Sn(K.content)&&dl(K.content),(H?H(K):K.nodeType)===ns.element){const Ge=le(K);Sn(Ge)&&(Pt(Ge),dl(Ge))}jt(N.afterSanitizeShadowDOM,k,null)},Pt=function(k){const K=[{node:k,shadow:null}];for(;K.length>0;){const xe=K.pop();if(xe.shadow){dl(xe.shadow);continue}const ke=xe.node,Le=(H?H(ke):ke.nodeType)===ns.element,qt=C(ke);if(qt)for(let Nn=qt.length-1;Nn>=0;--Nn)K.push({node:qt[Nn],shadow:null});if(Le){const Nn=q?q(ke):null;if(typeof Nn=="string"&&tt(Nn)==="template"){const on=ke.content;Sn(on)&&K.push({node:on,shadow:null})}}if(Le){const Nn=le(ke);Sn(Nn)&&K.push({node:null,shadow:Nn},{node:Nn,shadow:null})}}};return s.sanitize=function(_e){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=null,xe=null,ke=null,Ge=null;if(hn=!_e,hn&&(_e="<!-->"),typeof _e!="string"&&!Vt(_e)&&(_e=Q1(_e),typeof _e!="string"))throw mr("dirty is not a string, aborting");if(!s.isSupported)return _e;tl?(Qe=Ot,We=St):ss(k),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(Qe=Tl(Qe)),N.uponSanitizeAttribute.length>0&&(We=Tl(We)),s.removed=[];const Le=Et&&typeof _e!="string"&&Vt(_e);if(Le){Rn(_e);const Ut=q?q(_e):_e.nodeName;if(typeof Ut=="string"){const kn=tt(Ut);if(!Qe[kn]||vt[kn])throw Pe(_e),mr("root node is forbidden and cannot be sanitized in-place")}if(wn(_e))throw Pe(_e),mr("root node is clobbered and cannot be sanitized in-place");try{Pt(_e)}catch(kn){throw Pe(_e),kn}}else if(Vt(_e))K=Un("<!---->"),xe=K.ownerDocument.importNode(_e,!0),xe.nodeType===ns.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?K=xe:K.appendChild(xe),Pt(xe);else{if(!dn&&!ft&&!_n&&_e.indexOf("<")===-1)return B&&ol?Z(_e):_e;if(K=Un(_e),!K)return dn?null:ol?M:""}K&&cl&&Jt(K.firstChild);const qt=Le?_e:K,Nn=Jn(qt);try{for(;ke=Nn.nextNode();)Al(ke,qt),Vl(ke),Sn(ke.content)&&dl(ke.content)}catch(Ut){throw Le&&(Pe(_e),Ec(s.removed,kn=>{kn.element&&ll(kn.element)})),Ut}if(Le)return Ec(s.removed,Ut=>{Ut.element&&ll(Ut.element)}),ft&&Sl(_e),_e;if(dn){if(ft&&Sl(K),an)for(Ge=V.call(K.ownerDocument);K.firstChild;)Ge.appendChild(K.firstChild);else Ge=K;return(We.shadowroot||We.shadowrootmode)&&(Ge=Se.call(c,Ge,!0)),Ge}let on=_n?K.outerHTML:K.innerHTML;return _n&&Qe["!doctype"]&&K.ownerDocument&&K.ownerDocument.doctype&&K.ownerDocument.doctype.name&&Wn(sj,K.ownerDocument.doctype.name)&&(on="<!DOCTYPE "+K.ownerDocument.doctype.name+`>
116
- `+on),ft&&(on=Xt(on)),B&&ol?Z(on):on},s.setConfig=function(){let _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ss(_e),tl=!0,Ot=Qe,St=We},s.clearConfig=function(){jn=null,tl=!1,Ot=null,St=null,B=R,M=""},s.isValidAttribute=function(_e,k,K){jn||ss({});const xe=tt(_e),ke=tt(k);return mn(xe,ke,K)},s.addHook=function(_e,k){typeof k=="function"&&el(N,_e)&&Tc(N[_e],k)},s.removeHook=function(_e,k){if(el(N,_e)){if(k!==void 0){const K=I1(N[_e],k);return K===-1?void 0:q1(N[_e],K,1)[0]}return rb(N[_e])}},s.removeHooks=function(_e){el(N,_e)&&(N[_e]=[])},s.removeAllHooks=function(){N=_b()},s}var uj=W_();const fj=1024;let dj=0;class ms{constructor(s,r){this.from=s,this.to=r}}class sn{constructor(s={}){this.id=dj++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=Bs.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}sn.closedBy=new sn({deserialize:l=>l.split(" ")});sn.openedBy=new sn({deserialize:l=>l.split(" ")});sn.group=new sn({deserialize:l=>l.split(" ")});sn.isolate=new sn({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});sn.contextHash=new sn({perNode:!0});sn.lookAhead=new sn({perNode:!0});sn.mounted=new sn({perNode:!0});class Lc{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[sn.mounted.id]}}const hj=Object.create(null);class Bs{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):hj,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Bs(s.name||"",r,s.id,c);if(s.props){for(let f of s.props)if(Array.isArray(f)||(f=f(o)),f){if(f[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[f[0].id]=f[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(sn.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(sn.group),f=-1;f<(o?o.length:0);f++){let h=r[f<0?c.name:o[f]];if(h)return h}}}}Bs.none=new Bs("",Object.create(null),0,8);class ey{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let f of s){let h=f(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 Bs(c.name,o,c.id,c.flags):c)}return new ey(r)}}const Af=new WeakMap,yb=new WeakMap;var nn;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(nn||(nn={}));class Yl{constructor(s,r,c,o,f){if(this.type=s,this.children=r,this.positions=c,this.length=o,this.props=null,f&&f.length){this.props=Object.create(null);for(let[h,m]of f)this.props[typeof h=="number"?h:h.id]=m}}toString(){let s=Lc.get(this);if(s&&!s.overlay)return s.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(s=0){return new ld(this.topNode,s)}cursorAt(s,r=0,c=0){let o=Af.get(this)||this.topNode,f=new ld(o);return f.moveTo(s,r),Af.set(this,f._tree),f}get topNode(){return new yl(this,0,0,null)}resolve(s,r=0){let c=uu(Af.get(this)||this.topNode,s,r,!1);return Af.set(this,c),c}resolveInner(s,r=0){let c=uu(yb.get(this)||this.topNode,s,r,!0);return yb.set(this,c),c}resolveStack(s,r=0){return gj(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:f=this.length}=s,h=s.mode||0,m=(h&nn.IncludeAnonymous)>0;for(let g=this.cursor(h|nn.IncludeAnonymous);;){let x=!1;if(g.from<=f&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Vp(Bs.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Yl(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Yl(Bs.none,r,c,o)))}static build(s){return xj(s)}}Yl.empty=new Yl(Bs.none,[],[],0);class Yp{constructor(s,r){this.buffer=s,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Yp(this.buffer,this.index)}}class Hi{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return Bs.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],f=o.name;if(/\W/.test(f)&&!o.isError&&(f=JSON.stringify(f)),s+=4,c==s)return f;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return f+"("+h.join(",")+")"}findChild(s,r,c,o,f){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(ty(f,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,f=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){f[g++]=o[m++],f[g++]=o[m++]-c;let x=f[g++]=o[m++]-c;f[g++]=o[m++]-s,h=Math.max(h,x)}return new Hi(f,h,this.set)}}function ty(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function uu(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof yl&&l.index<0?null:l.parent;if(!h)return l;l=h}let f=c?0:nn.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof yl&&h.index<0&&((o=m.enter(s,r,f))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,f);if(!h)return l;l=h}}class ny{cursor(s=0){return new ld(this,s)}getChild(s,r=null,c=null){let o=vb(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return vb(this,s,r,c)}resolve(s,r=0){return uu(this,s,r,!1)}resolveInner(s,r=0){return uu(this,s,r,!0)}matchContext(s){return wp(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class yl extends ny{constructor(s,r,c,o){super(),this._tree=s,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(s,r,c,o,f=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,x=r>0?m.length:-1;s!=x;s+=r){let y=m[s],j=g[s]+h.from,v;if(!(!(f&nn.EnterBracketed&&y instanceof Yl&&(v=Lc.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!ty(o,c,j,j+y.length))){if(y instanceof Hi){if(f&nn.ExcludeBuffers)continue;let T=y.findChild(0,y.buffer.length,r,c-j,o);if(T>-1)return new da(new pj(h,y,s,j),null,T)}else if(f&nn.IncludeAnonymous||!y.type.isAnonymous||Xp(y)){let T;if(!(f&nn.IgnoreMounts)&&(T=Lc.get(y))&&!T.overlay)return new yl(T.tree,j,s,h);let S=new yl(y,j,s,h);return f&nn.IncludeAnonymous||!S.type.isAnonymous?S:S.nextChild(r<0?y.children.length-1:0,r,c,o,f)}}}if(f&nn.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&nn.IgnoreOverlays)&&(o=Lc.get(this._tree))&&o.overlay){let f=s-this.from,h=c&nn.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=f:m<f)&&(r<0||h?g>=f:g>f))return new yl(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function vb(l,s,r,c){let o=l.cursor(),f=[];if(!o.firstChild())return f;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return f}for(;;){if(c!=null&&o.type.is(c))return f;if(o.type.is(s)&&f.push(o.node),!o.nextSibling())return c==null?f:[]}}function wp(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class pj{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class da extends ny{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,f=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return f<0?null:new da(this.context,this,f)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&nn.ExcludeBuffers)return null;let{buffer:o}=this.context,f=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return f<0?null:new da(this.context,this,f)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new da(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new da(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],r=[],{buffer:c}=this.context,o=this.index+4,f=c.buffer[this.index+3];if(f>o){let h=c.buffer[this.index+1];s.push(c.slice(o,f,h)),r.push(0)}return new Yl(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ly(l){if(!l.length)return null;let s=0,r=l[0];for(let f=1;f<l.length;f++){let h=l[f];(h.from>r.from||h.to<r.to)&&(r=h,s=f)}let c=r instanceof yl&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new mj(o,r)}class mj{constructor(s,r){this.heads=s,this.node=r}get next(){return ly(this.heads)}}function gj(l,s,r){let c=l.resolveInner(s,r),o=null;for(let f=c instanceof yl?c:c.context.parent;f;f=f.parent)if(f.index<0){let h=f.parent;(o||(o=[c])).push(h.resolve(s,r)),f=h}else{let h=Lc.get(f.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new yl(h.tree,h.overlay[0].from+f.from,-1,f);(o||(o=[c])).push(uu(m,s,r,!1))}}return o?ly(o):c}class ld{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~nn.EnterBracketed,s instanceof yl)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof yl?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,f=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.buffer.start,c);return f<0?!1:(this.stack.push(this.index),this.yieldBuf(f))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&nn.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&nn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&nn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let f=0;f<this.index;f++)if(o.buffer.buffer[f+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 f=r+s,h=s<0?-1:c._tree.children.length;f!=h;f+=s){let m=c._tree.children[f];if(this.mode&nn.IncludeAnonymous||m instanceof Hi||!m.type.isAnonymous||Xp(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,f=this.stack.length;f>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=f+1;break e}o=this.stack[--f]}for(let o=c;o<this.stack.length;o++)r=new da(this.buffer,r,this.stack[o]);return this.bufferNode=new da(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return wp(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,f=this.stack.length-1;o>=0;f--){if(f<0)return wp(this._tree,s,o);let h=c[r.buffer[this.stack[f]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Xp(l){return l.children.some(s=>s instanceof Hi||!s.type.isAnonymous||Xp(s))}function xj(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=fj,reused:f=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Yp(r,r.length):r,g=c.types,x=0,y=0;function j(q,B,M,R,W,oe){let{id:G,start:Z,end:ge,size:ye}=m,Ne=y,z=x;if(ye<0)if(m.next(),ye==-1){let N=f[G];M.push(N),R.push(Z-q);return}else if(ye==-3){x=G;return}else if(ye==-4){y=G;return}else throw new RangeError(`Unrecognized record size: ${ye}`);let I=g[G],V,pe,Se=Z-q;if(ge-Z<=o&&(pe=C(m.pos-B,W))){let N=new Uint16Array(pe.size-pe.skip),ee=m.pos-pe.size,U=N.length;for(;m.pos>ee;)U=J(pe.start,N,U);V=new Hi(N,ge-pe.start,c),Se=pe.start-q}else{let N=m.pos-ye;m.next();let ee=[],U=[],ve=G>=h?G:-1,F=0,je=ge;for(;m.pos>N;)ve>=0&&m.id==ve&&m.size>=0?(m.end<=je-o&&(S(ee,U,Z,F,m.end,je,ve,Ne,z),F=ee.length,je=m.end),m.next()):oe>2500?v(Z,N,ee,U):j(Z,N,ee,U,ve,oe+1);if(ve>=0&&F>0&&F<ee.length&&S(ee,U,Z,F,Z,je,ve,Ne,z),ee.reverse(),U.reverse(),ve>-1&&F>0){let Oe=T(I,z);V=Vp(I,ee,U,0,ee.length,0,ge-Z,Oe,Oe)}else V=A(I,ee,U,ge-Z,Ne-ge,z)}M.push(V),R.push(Se)}function v(q,B,M,R){let W=[],oe=0,G=-1;for(;m.pos>B;){let{id:Z,start:ge,end:ye,size:Ne}=m;if(Ne>4)m.next();else{if(G>-1&&ge<G)break;G<0&&(G=ye-o),W.push(Z,ge,ye),oe++,m.next()}}if(oe){let Z=new Uint16Array(oe*4),ge=W[W.length-2];for(let ye=W.length-3,Ne=0;ye>=0;ye-=3)Z[Ne++]=W[ye],Z[Ne++]=W[ye+1]-ge,Z[Ne++]=W[ye+2]-ge,Z[Ne++]=Ne;M.push(new Hi(Z,W[2]-ge,c)),R.push(ge-q)}}function T(q,B){return(M,R,W)=>{let oe=0,G=M.length-1,Z,ge;if(G>=0&&(Z=M[G])instanceof Yl){if(!G&&Z.type==q&&Z.length==W)return Z;(ge=Z.prop(sn.lookAhead))&&(oe=R[G]+Z.length+ge)}return A(q,M,R,W,oe,B)}}function S(q,B,M,R,W,oe,G,Z,ge){let ye=[],Ne=[];for(;q.length>R;)ye.push(q.pop()),Ne.push(B.pop()+M-W);q.push(A(c.types[G],ye,Ne,oe-W,Z-oe,ge)),B.push(W-M)}function A(q,B,M,R,W,oe,G){if(oe){let Z=[sn.contextHash,oe];G=G?[Z].concat(G):[Z]}if(W>25){let Z=[sn.lookAhead,W];G=G?[Z].concat(G):[Z]}return new Yl(q,B,M,R,G)}function C(q,B){let M=m.fork(),R=0,W=0,oe=0,G=M.end-o,Z={size:0,start:0,skip:0};e:for(let ge=M.pos-q;M.pos>ge;){let ye=M.size;if(M.id==B&&ye>=0){Z.size=R,Z.start=W,Z.skip=oe,oe+=4,R+=4,M.next();continue}let Ne=M.pos-ye;if(ye<0||Ne<ge||M.start<G)break;let z=M.id>=h?4:0,I=M.start;for(M.next();M.pos>Ne;){if(M.size<0)if(M.size==-3||M.size==-4)z+=4;else break e;else M.id>=h&&(z+=4);M.next()}W=I,R+=ye,oe+=z}return(B<0||R==q)&&(Z.size=R,Z.start=W,Z.skip=oe),Z.size>4?Z:void 0}function J(q,B,M){let{id:R,start:W,end:oe,size:G}=m;if(m.next(),G>=0&&R<h){let Z=M;if(G>4){let ge=m.pos-(G-4);for(;m.pos>ge;)M=J(q,B,M)}B[--M]=Z,B[--M]=oe-q,B[--M]=W-q,B[--M]=R}else G==-3?x=R:G==-4&&(y=R);return M}let le=[],Y=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,le,Y,-1,0);let H=(s=l.length)!==null&&s!==void 0?s:le.length?Y[0]+le[0].length:0;return new Yl(g[l.topID],le.reverse(),Y.reverse(),H)}const jb=new WeakMap;function Kf(l,s){if(!l.isAnonymous||s instanceof Hi||s.type!=l)return 1;let r=jb.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof Yl)){r=1;break}r+=Kf(l,c)}jb.set(s,r)}return r}function Vp(l,s,r,c,o,f,h,m,g){let x=0;for(let S=c;S<o;S++)x+=Kf(l,s[S]);let y=Math.ceil(x*1.5/8),j=[],v=[];function T(S,A,C,J,le){for(let Y=C;Y<J;){let H=Y,q=A[Y],B=Kf(l,S[Y]);for(Y++;Y<J;Y++){let M=Kf(l,S[Y]);if(B+M>=y)break;B+=M}if(Y==H+1){if(B>y){let M=S[H];T(M.children,M.positions,0,M.children.length,A[H]+le);continue}j.push(S[H])}else{let M=A[Y-1]+S[Y-1].length-q;j.push(Vp(l,S,A,H,Y,q,M,null,g))}v.push(q+le-f)}}return T(s,r,c,o,0),(m||g)(j,v,h)}class wE{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof da?this.setBuffer(s.context.buffer,s.index,r):s instanceof yl&&this.map.set(s.tree,r)}get(s){return s instanceof da?this.getBuffer(s.context.buffer,s.index):s instanceof yl?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class fu{constructor(s,r,c,o,f=!1,h=!1){this.from=s,this.to=r,this.tree=c,this.offset=o,this.open=(f?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,r=[],c=!1){let o=[new fu(0,s.length,s,0,!1,c)];for(let f of r)f.to>s.length&&o.push(f);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],f=1,h=s.length?s[0]:null;for(let m=0,g=0,x=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||x){let T=Math.max(v.from,g)-x,S=Math.min(v.to,j)-x;v=T>=S?null:new fu(T,S,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=f<s.length?s[f++]:null}if(!y)break;g=y.toA,x=y.toA-y.toB}return o}}class SE{startParse(s,r,c){return typeof s=="string"&&(s=new bj(s)),c=c?c.length?c.map(o=>new ms(o.from,o.to)):[new ms(0,0)]:[new ms(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let f=o.advance();if(f)return f}}}class bj{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function NE(l){return(s,r,c,o)=>new yj(s,l,r,c,o)}class wb{constructor(s,r,c,o,f,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=f,this.from=h}}function Sb(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class _j{constructor(s,r,c,o,f,h,m,g){this.parser=s,this.predicate=r,this.mounts=c,this.index=o,this.start=f,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const Sp=new sn({perNode:!0});class yj{constructor(s,r,c,o,f){this.nest=r,this.input=c,this.fragments=o,this.ranges=f,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Yl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Sp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[sn.mounted.id]=new Lc(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new wj(this.fragments),r=null,c=null,o=new ld(new yl(this.baseTree,this.ranges[0].from,0,null),nn.IncludeAnonymous|nn.IgnoreMounts);e:for(let f,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(r){let x=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(x)for(let y of x.mount.overlay){let j=y.from+x.pos,v=y.to+x.pos;j>=o.from&&v<=o.to&&!r.ranges.some(T=>T.from<v&&T.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=vj(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(f=this.nest(o,this.input))&&(o.from<o.to||!f.overlay)){o.tree||(jj(o),r&&r.depth++,c&&c.depth++);let x=s.findMounts(o.from,f.parser);if(typeof f.overlay=="function")r=new _j(f.parser,f.overlay,x,this.inner.length,o.from,!!f.bracketed,o.tree,r);else{let y=Eb(this.ranges,f.overlay||(o.from<o.to?[new ms(o.from,o.to)]:[]));y.length&&Sb(y),(y.length||!f.overlay)&&this.inner.push(new wb(f.parser,y.length?f.parser.startParse(this.input,Tb(x,y),y):f.parser.startParse(""),f.overlay?f.overlay.map(j=>new ms(j.from-o.from,j.to-o.from)):null,!!f.bracketed,o.tree,y.length?y[0].from:o.from)),f.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new ms(o.from,o.to)),g.from<g.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==g.from?r.ranges[x]={from:r.ranges[x].from,to:g.to}:r.ranges.push(g)}if(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let x=Eb(this.ranges,r.ranges);x.length&&(Sb(x),this.inner.splice(r.index,0,new wb(r.parser,r.parser.startParse(this.input,Tb(r.mounts,x),x),r.ranges.map(y=>new ms(y.from-r.start,y.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function vj(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function Nb(l,s,r,c,o,f){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-f)}}function jj(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,f=o.children.indexOf(c),h=o.children[f],m=h.buffer,g=[f];function x(y,j,v,T,S,A){let C=r[A],J=[],le=[];Nb(h,y,C,J,le,T);let Y=m[C+1],H=m[C+2];g.push(J.length);let q=A?x(C+4,m[C+3],h.set.types[m[C]],Y,H-Y,A-1):s.toTree();return J.push(q),le.push(Y-T),Nb(h,m[C+3],j,J,le,T),new Yl(v,J,le,S)}o.children[f]=x(0,m.length,Bs.none,0,h.length,r.length-1);for(let y of g){let j=l.tree.children[y],v=l.tree.positions[y];l.yield(new yl(j,v+l.from,y,l._tree))}}class kb{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(nn.IncludeAnonymous|nn.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,nn.IgnoreOverlays|nn.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Yl)r=r.children[0];else break}return!1}}class wj{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(Sp))!==null&&r!==void 0?r:c.to,this.inner=new kb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(Sp))!==null&&s!==void 0?s:r.to,this.inner=new kb(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let f=this.inner.cursor.node;f;f=f.parent){let h=(c=f.tree)===null||c===void 0?void 0:c.prop(sn.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=f.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:f.from-g.offset,mount:h})}}}return o}}function Eb(l,s){let r=null,c=s;for(let o=1,f=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;f<c.length;f++){let g=c[f];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[f]=new ms(g.from,h),g.to>m&&r.splice(f+1,0,new ms(m,g.to))):g.to>m?r[f--]=new ms(m,g.to):r.splice(f--,1))}}return c}function Sj(l,s,r,c){let o=0,f=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let y=o==l.length?1e9:h?l[o].to:l[o].from,j=f==s.length?1e9:m?s[f].to:s[f].from;if(h!=m){let v=Math.max(g,r),T=Math.min(y,j,c);v<T&&x.push(new ms(v,T))}if(g=Math.min(y,j),g==1e9)break;y==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,f++):m=!0)}return x}function Tb(l,s){let r=[];for(let{pos:c,mount:o,frag:f}of l){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(f.from,h),x=Math.min(f.to,m);if(o.overlay){let y=o.overlay.map(v=>new ms(v.from+c,v.to+c)),j=Sj(s,y,g,x);for(let v=0,T=g;;v++){let S=v==j.length,A=S?x:j[v].from;if(A>T&&r.push(new fu(T,A,o.tree,-h,f.from>=T||f.openStart,f.to<=A||f.openEnd)),S)break;T=j[v].to}}else r.push(new fu(g,x,o.tree,-h,f.from>=h||f.openStart,f.to<=m||f.openEnd))}return r}let Nj=0;class ps{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=Nj++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof ps&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new ps(c,[],null,[]);if(o.set.push(o),r)for(let f of r.set)o.set.push(f);return o}static defineModifier(s){let r=new sd(s);return c=>c.modified.indexOf(r)>-1?c:sd.get(c.base||c,c.modified.concat(r).sort((o,f)=>o.id-f.id))}}let kj=0;class sd{constructor(s){this.name=s,this.instances=[],this.id=kj++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&Ej(r,m.modified));if(c)return c;let o=[],f=new ps(s.name,o,s,r);for(let m of r)m.instances.push(f);let h=Tj(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(sd.get(m,g));return f}}function Ej(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Tj(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function kE(l){let s=Object.create(null);for(let r in l){let c=l[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let f=[],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(f.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let T=o[j++];if(j==o.length&&T=="!"){h=0;break}if(T!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=f.length-1,x=f[g];if(!x)throw new RangeError("Invalid path: "+o);let y=new du(c,h,g>0?f.slice(0,g):null);s[x]=y.sort(s[x])}}return sy.add(s)}const sy=new sn({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let f=new du(o.tags,o.mode,o.context);r?r.next=f:c=f,r=f}return c}});class du{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}du.empty=new du([],2,null);function ay(l,s){let r=Object.create(null);for(let f of l)if(!Array.isArray(f.tag))r[f.tag.id]=f.class;else for(let h of f.tag)r[h.id]=f.class;let{scope:c,all:o=null}=s||{};return{style:f=>{let h=o;for(let m of f)for(let g of m.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function Cj(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function Aj(l,s,r,c=0,o=l.length){let f=new Rj(c,Array.isArray(s)?s:[s],r);f.highlightRange(l.cursor(),c,o,"",f.highlighters),f.flush(o)}function Mj(l,s,r,c,o,f=0,h=l.length){let m=f;function g(x,y){if(!(x<=m)){for(let j=l.slice(m,x),v=0;;){let T=j.indexOf(`
117
- `,v),S=T<0?j.length:T;if(S>v&&c(j.slice(v,S),y),T<0)break;o(),v=T+1}m=x}}Aj(s,r,(x,y,j)=>{g(x,""),g(y,j)},f,h),g(h,"")}class Rj{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,f){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(f=this.highlighters.filter(T=>!T.scope||T.scope(h)));let x=o,y=Dj(s)||du.empty,j=Cj(f,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),x),y.opaque)return;let v=s.tree&&s.tree.prop(sn.mounted);if(v&&v.overlay){let T=s.node.enter(v.overlay[0].from+m,1),S=this.highlighters.filter(C=>!C.scope||C.scope(v.tree.type)),A=s.firstChild();for(let C=0,J=m;;C++){let le=C<v.overlay.length?v.overlay[C]:null,Y=le?le.from+m:g,H=Math.max(r,J),q=Math.min(c,Y);if(H<q&&A)for(;s.from<q&&(this.highlightRange(s,H,q,o,f),this.startSpan(Math.min(q,s.to),x),!(s.to>=Y||!s.nextSibling())););if(!le||Y>c)break;J=le.to+m,J>r&&(this.highlightRange(T.cursor(),Math.max(r,le.from+m),Math.min(c,J),"",S),this.startSpan(Math.min(c,J),x))}A&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,f),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function Dj(l){let s=l.type.prop(sy);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const Me=ps.define,Mf=Me(),Mi=Me(),Cb=Me(Mi),Ab=Me(Mi),Ri=Me(),Rf=Me(Ri),sp=Me(Ri),oa=Me(),gr=Me(oa),sa=Me(),aa=Me(),Np=Me(),Wo=Me(Np),Df=Me(),De={comment:Mf,lineComment:Me(Mf),blockComment:Me(Mf),docComment:Me(Mf),name:Mi,variableName:Me(Mi),typeName:Cb,tagName:Me(Cb),propertyName:Ab,attributeName:Me(Ab),className:Me(Mi),labelName:Me(Mi),namespace:Me(Mi),macroName:Me(Mi),literal:Ri,string:Rf,docString:Me(Rf),character:Me(Rf),attributeValue:Me(Rf),number:sp,integer:Me(sp),float:Me(sp),bool:Me(Ri),regexp:Me(Ri),escape:Me(Ri),color:Me(Ri),url:Me(Ri),keyword:sa,self:Me(sa),null:Me(sa),atom:Me(sa),unit:Me(sa),modifier:Me(sa),operatorKeyword:Me(sa),controlKeyword:Me(sa),definitionKeyword:Me(sa),moduleKeyword:Me(sa),operator:aa,derefOperator:Me(aa),arithmeticOperator:Me(aa),logicOperator:Me(aa),bitwiseOperator:Me(aa),compareOperator:Me(aa),updateOperator:Me(aa),definitionOperator:Me(aa),typeOperator:Me(aa),controlOperator:Me(aa),punctuation:Np,separator:Me(Np),bracket:Wo,angleBracket:Me(Wo),squareBracket:Me(Wo),paren:Me(Wo),brace:Me(Wo),content:oa,heading:gr,heading1:Me(gr),heading2:Me(gr),heading3:Me(gr),heading4:Me(gr),heading5:Me(gr),heading6:Me(gr),contentSeparator:Me(oa),list:Me(oa),quote:Me(oa),emphasis:Me(oa),strong:Me(oa),link:Me(oa),monospace:Me(oa),strikethrough:Me(oa),inserted:Me(),deleted:Me(),changed:Me(),invalid:Me(),meta:Df,documentMeta:Me(Df),annotation:Me(Df),processingInstruction:Me(Df),definition:ps.defineModifier("definition"),constant:ps.defineModifier("constant"),function:ps.defineModifier("function"),standard:ps.defineModifier("standard"),local:ps.defineModifier("local"),special:ps.defineModifier("special")};for(let l in De){let s=De[l];s instanceof ps&&(s.name=l)}ay([{tag:De.link,class:"tok-link"},{tag:De.heading,class:"tok-heading"},{tag:De.emphasis,class:"tok-emphasis"},{tag:De.strong,class:"tok-strong"},{tag:De.keyword,class:"tok-keyword"},{tag:De.atom,class:"tok-atom"},{tag:De.bool,class:"tok-bool"},{tag:De.url,class:"tok-url"},{tag:De.labelName,class:"tok-labelName"},{tag:De.inserted,class:"tok-inserted"},{tag:De.deleted,class:"tok-deleted"},{tag:De.literal,class:"tok-literal"},{tag:De.string,class:"tok-string"},{tag:De.number,class:"tok-number"},{tag:[De.regexp,De.escape,De.special(De.string)],class:"tok-string2"},{tag:De.variableName,class:"tok-variableName"},{tag:De.local(De.variableName),class:"tok-variableName tok-local"},{tag:De.definition(De.variableName),class:"tok-variableName tok-definition"},{tag:De.special(De.variableName),class:"tok-variableName2"},{tag:De.definition(De.propertyName),class:"tok-propertyName tok-definition"},{tag:De.typeName,class:"tok-typeName"},{tag:De.namespace,class:"tok-namespace"},{tag:De.className,class:"tok-className"},{tag:De.macroName,class:"tok-macroName"},{tag:De.propertyName,class:"tok-propertyName"},{tag:De.operator,class:"tok-operator"},{tag:De.comment,class:"tok-comment"},{tag:De.meta,class:"tok-meta"},{tag:De.invalid,class:"tok-invalid"},{tag:De.punctuation,class:"tok-punctuation"}]);const Oj="modulepreload",Lj=function(l,s){return new URL(l,s).href},Mb={},lt=function(s,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]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=Lj(y,c),y in Mb)return;Mb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let A=m.length-1;A>=0;A--){const C=m[A];if(C.href===y&&(!j||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=j?"stylesheet":Oj,j||(S.as="script"),S.crossOrigin="",S.href=y,x&&S.setAttribute("nonce",x),document.head.appendChild(S),j)return new Promise((A,C)=>{S.addEventListener("load",A),S.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(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"&&f(m.reason);return s().catch(f)})},iy={js:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await lt(async()=>{const{javascript:l}=await import("./index-XwIPGsoL.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await lt(async()=>{const{json:l}=await import("./index-DhdpnWaP.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await lt(async()=>{const{json:l}=await import("./index-DhdpnWaP.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await lt(async()=>{const{css:l}=await import("./index-DMq1FoW-.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await lt(async()=>{const{css:l}=await import("./index-DMq1FoW-.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await lt(async()=>{const{css:l}=await import("./index-DMq1FoW-.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await lt(async()=>{const{html:l}=await import("./index-D24xx07T.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await lt(async()=>{const{html:l}=await import("./index-D24xx07T.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await lt(async()=>{const{html:l}=await import("./index-D24xx07T.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await lt(async()=>{const{html:l}=await import("./index-D24xx07T.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await lt(async()=>{const{markdown:l}=await import("./index-BoyP7MYO.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await lt(async()=>{const{markdown:l}=await import("./index-BoyP7MYO.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await lt(async()=>{const{python:l}=await import("./index-CswcCN2I.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await lt(async()=>{const{python:l}=await import("./index-CswcCN2I.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await lt(async()=>{const{yaml:l}=await import("./index-Cg_JGWuj.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await lt(async()=>{const{yaml:l}=await import("./index-Cg_JGWuj.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await lt(async()=>{const{rust:l}=await import("./index-1MYdpgaD.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await lt(async()=>{const{cpp:l}=await import("./index-pL68uIyG.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await lt(async()=>{const{cpp:l}=await import("./index-pL68uIyG.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await lt(async()=>{const{cpp:l}=await import("./index-pL68uIyG.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await lt(async()=>{const{cpp:l}=await import("./index-pL68uIyG.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await lt(async()=>{const{cpp:l}=await import("./index-pL68uIyG.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await lt(async()=>{const{java:l}=await import("./index-Cv6bq7Bb.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await lt(async()=>{const{go:l}=await import("./index-C7I7Qrgh.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await lt(async()=>{const{php:l}=await import("./index-CA0PxYkA.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await lt(async()=>{const{sql:l}=await import("./index-CHbY4Q8q.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await lt(async()=>{const{xml:l}=await import("./index-D71l3zbz.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await lt(async()=>{const{xml:l}=await import("./index-D71l3zbz.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},zj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},Uj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function Hj(l){const s=Uj[l.toLowerCase()]??l.toLowerCase(),r=iy[s];return r?r().catch(()=>null):null}async function Bj(l){const s=(l.split("/").pop()??"").toLowerCase(),r=zj[s]??s.split(".").pop()??"",c=iy[r];return c?c().catch(()=>null):null}const Ij=ay([{tag:[De.keyword,De.modifier,De.controlKeyword,De.moduleKeyword],class:"cmh-key"},{tag:[De.propertyName],class:"cmh-prop"},{tag:[De.function(De.variableName),De.labelName],class:"cmh-fn"},{tag:[De.color,De.constant(De.name),De.standard(De.name),De.bool],class:"cmh-const"},{tag:[De.typeName,De.className,De.changed,De.annotation,De.self,De.namespace],class:"cmh-type"},{tag:[De.number,De.integer,De.float],class:"cmh-num"},{tag:[De.string,De.special(De.string),De.regexp],class:"cmh-str"},{tag:[De.operator,De.operatorKeyword,De.escape],class:"cmh-op"},{tag:[De.meta,De.comment],class:"cmh-comment"},{tag:De.invalid,class:"cmh-invalid"}]);function Of(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function qj(l,s){const r=s?await Hj(s):null;if(!r)return Of(l);try{const c=r.language.parser.parse(l);let o="";return Mj(l,c,Ij,(f,h)=>{o+=h?`<span class="${h}">${Of(f)}</span>`:Of(f)},()=>{o+=`
118
- `}),o}catch{return Of(l)}}Dt.setOptions({gfm:!0,breaks:!1});function ry(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function pd(l){const s=await Dt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await qj(c.text,c.lang??""),c.escaped=!0}});return uj.sanitize(s)}function Rb(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:ry(l.path)}}function Fa(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function Gj(l){return l.split("/").pop()??l}function Tr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Zf(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function Ui({x:l,y:s,items:r,note:c,onClose:o}){const f=b.useRef(null),[h,m]=b.useState({left:l,top:s}),[g,x]=b.useState(()=>{const v=r.findIndex(T=>!T.disabled);return v===-1?0:v});b.useLayoutEffect(()=>{const v=f.current;if(!v)return;const T=v.getBoundingClientRect(),S=8,A=Math.max(S,Math.min(l,window.innerWidth-T.width-S)),C=Math.max(S,Math.min(s,window.innerHeight-T.height-S));m({left:A,top:C})},[l,s]),b.useLayoutEffect(()=>{var v;(v=f.current)==null||v.focus()},[]),b.useLayoutEffect(()=>{function v(S){var A;(A=f.current)!=null&&A.contains(S.target)||o()}function T(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",T,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",T,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const T=r.map((S,A)=>({item:S,index:A})).filter(S=>!S.item.disabled);if(T.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const S=v.key==="ArrowDown"?1:-1,A=T.findIndex(J=>J.index===g),C=T[(((A===-1?0:A)+S)%T.length+T.length)%T.length];C&&x(C.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const S=r[g];S&&y(S)}}}return a.jsxs("div",{ref:f,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,T)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(T===g?" is-cursor":""),onMouseEnter:()=>x(T),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 $j=3500,Yj=9e3,Db=220;function Rr({result:l,onDismiss:s}){const[r,c]=b.useState(l),[o,f]=b.useState(!1);if(b.useEffect(()=>{if(!l){c(null),f(!1);return}if(c(l),f(!1),l.url)return;const m=l.ok?$j:Yj,g=setTimeout(()=>f(!0),m),x=setTimeout(()=>c(null),m+Db);return()=>{clearTimeout(g),clearTimeout(x)}},[l]),!r)return null;const h=()=>{f(!0),setTimeout(()=>{c(null),s==null||s()},Db)};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&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ha({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[f,h]=b.useState(l),m=b.useRef(null);b.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function g(){const x=f.trim();if(!x||x===l)return o();c(x)}return a.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:f,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:x=>h(x.target.value),onBlur:g,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Kc({active:l}){return l?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 Xj=500,xr="application/x-ccv-fs-path",Vj=200;function Qj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:f,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:T,onMove:S,onCopy:A,onDelete:C,onRefresh:J,onClose:le,zoomed:Y,onToggleZoom:H}){const[q,B]=b.useState(""),[M,R]=b.useState(null),[W,oe]=b.useState(null),[G,Z]=b.useState(null),[ge,ye]=b.useState(null),[Ne,z]=b.useState(null),[I,V]=b.useState(null),pe=fd("(hover: hover)"),Se=b.useRef(null),N=b.useMemo(()=>Fj(f),[f]);function ee(ae){return!(!G||ae===G.path||G.kind==="dir"&&ae.startsWith(`${G.path}/`)||ae===Tr(G.path))}function U(ae){return!(!Ne||ae===Ne.path||Ne.kind==="dir"&&ae.startsWith(`${Ne.path}/`)||Ne.mode==="cut"&&ae===Tr(Ne.path))}function ve(ae){z({path:ae.path,kind:ae.kind,mode:"copy"})}function F(ae){z({path:ae.path,kind:ae.kind,mode:"cut"})}function je(ae){!Ne||!U(ae)||(ae&&!r.has(ae)&&y(ae),Ne.mode==="cut"?(S(Ne.path,ae),z(null)):A(Ne.path,ae))}function Oe(ae,be){const Ve=ae.touches[0];if(!Ve)return;const at={timer:0,x:Ve.clientX,y:Ve.clientY,el:ae.currentTarget,fired:!1};at.timer=window.setTimeout(()=>{at.fired=!0,be(at.x,at.y,at.el)},Xj),Se.current=at}function $e(ae){const be=Se.current,Ve=ae.touches[0];!be||!Ve||Math.hypot(Ve.clientX-be.x,Ve.clientY-be.y)>10&&(window.clearTimeout(be.timer),Se.current=null)}function Be(ae){const be=Se.current;be&&(window.clearTimeout(be.timer),be.fired&&ae.preventDefault())}function bt(){var ae;return(ae=Se.current)!=null&&ae.fired?(Se.current=null,!0):!1}function Qe(ae,be,Ve,at){B((at==null?void 0:at.path)??""),V({x:ae,y:be,opener:Ve,entry:at})}function fn(){const ae=I==null?void 0:I.opener;V(null),ae!=null&&ae.isConnected&&ae.focus()}function We(ae){return{onContextMenu:be=>{be.preventDefault(),Qe(be.clientX,be.clientY,be.currentTarget,ae)},onTouchStart:be=>Oe(be,(Ve,at,Je)=>Qe(Ve,at,Je,ae)),onTouchMove:$e,onTouchEnd:Be,onTouchCancel:Be}}function st(ae){ae.target===ae.currentTarget&&(ae.preventDefault(),Qe(ae.clientX,ae.clientY,ae.currentTarget,null))}function ct(ae){ae.target===ae.currentTarget&&Oe(ae,(be,Ve,at)=>Qe(be,Ve,at,null))}function vt(ae){if(!(ae.ctrlKey||ae.metaKey)||ae.target instanceof HTMLInputElement)return;const be=ae.key.toLowerCase();if(be==="v"){ae.preventDefault(),je(ol());return}if(!q)return;const Ve=Ob(s,q);Ve&&(be==="c"?(ae.preventDefault(),ve(Ve)):be==="x"&&(ae.preventDefault(),F(Ve)))}function ut(ae){return be=>{be.dataTransfer.effectAllowed="move",be.dataTransfer.setData(xr,ae.path),Z({path:ae.path,kind:ae.kind})}}function It(){Z(null),ye(null)}function wt(ae){return be=>{be.dataTransfer.types.includes(xr)&&(be.stopPropagation(),!(ae.kind!=="dir"||!ee(ae.path))&&(be.preventDefault(),ye(ae.path)))}}function Te(ae){return be=>{if(!be.dataTransfer.types.includes(xr)||(be.stopPropagation(),ae.kind!=="dir"||!ee(ae.path)))return;be.preventDefault();const Ve=be.dataTransfer.getData(xr);ye(null),Ve&&S(Ve,ae.path)}}function et(ae){!ae.dataTransfer.types.includes(xr)||!ee("")||(ae.preventDefault(),ye(""))}function At(ae){if(!ae.dataTransfer.types.includes(xr)||!ee(""))return;ae.preventDefault();const be=ae.dataTransfer.getData(xr);ye(null),be&&S(be,"")}const[ft,Fe]=b.useState(""),_n=ft.trim(),tl=_n.length>0,Ot=b.useRef(null),St=b.useRef(g);St.current=g;function cl(ae){Fe(ae),Ot.current&&clearTimeout(Ot.current);const be=ae.trim();if(!be){St.current("");return}Ot.current=setTimeout(()=>St.current(be),Vj)}function dn(ae){Ot.current&&clearTimeout(Ot.current),Fe(""),St.current(""),B(ae.path),x(ae)}const an=tl&&(m==null?void 0:m.query)===_n?m:null;function ol(){if(q==="")return"";const ae=Ob(s,q);if((ae==null?void 0:ae.kind)==="dir")return q;const be=q.lastIndexOf("/");return be===-1?"":q.slice(0,be)}function yn(ae,be){const Ve=be??ol();Ve&&!r.has(Ve)&&y(Ve),oe({parent:Ve,kind:ae})}function Ft(){if(!I)return[];const ae=at=>pe?at:void 0;if(!I.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ae("Ctrl+V"),disabled:!U(""),onSelect:()=>je("")},{id:"new-file",label:"Создать файл",onSelect:()=>yn("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>yn("dir","")}];const be=I.entry,Ve=[be.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(be.path)}:{id:"toggle",label:r.has(be.path)?"Свернуть":"Развернуть",onSelect:()=>y(be.path)},{id:"copy",label:"Копировать",hint:ae("Ctrl+C"),onSelect:()=>ve(be)},{id:"cut",label:"Вырезать",hint:ae("Ctrl+X"),onSelect:()=>F(be)}];return be.kind==="dir"&&(Ve.push({id:"paste",label:"Вставить",hint:ae("Ctrl+V"),disabled:!U(be.path),onSelect:()=>je(be.path)}),Ve.push({id:"new-file",label:"Создать файл",onSelect:()=>yn("file",be.path)}),Ve.push({id:"new-dir",label:"Создать каталог",onSelect:()=>yn("dir",be.path)})),Ve.push({id:"rename",label:"Переименовать",onSelect:()=>R(be.path)}),Ve.push({id:"delete",label:"Удалить",onSelect:()=>C(be)}),Ve}const An=tl?[]:Lt("",0);function Lt(ae,be){const Ve=s[ae],at=[];if(W&&W.parent===ae&&at.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:Ja(be),children:[a.jsx("span",{className:"fsrow__icon",children:W.kind==="dir"?a.jsx(id,{}):a.jsx(rd,{})}),a.jsx(ha,{className:"rename--file",value:"",placeholder:W.kind==="dir"?"имя каталога":"имя файла",onCommit:Je=>{oe(null),v(ae,W.kind,Je)},onCancel:()=>oe(null)})]},`draft:${ae}`)),!Ve)return at.push(a.jsx("p",{className:"fsrow__pending",style:Ja(be),children:"читаем…"},`wait:${ae}`)),at;Ve.length===0&&!W&&at.push(a.jsx("p",{className:"fsrow__pending",style:Ja(be),children:"пусто"},`empty:${ae}`));for(const Je of Ve){const rn=Je.kind==="dir"&&r.has(Je.path);at.push(M===Je.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:Ja(be),children:[a.jsx("span",{className:"fsrow__icon",children:Je.kind==="dir"?a.jsx(id,{open:rn}):a.jsx(rd,{})}),a.jsx(ha,{className:"rename--file",value:Je.name,placeholder:"новое имя",onCommit:X=>{R(null),T(Je.path,X)},onCancel:()=>R(null)})]},Je.path):a.jsx(Kj,{entry:Je,depth:be,open:rn,active:Je.path===c,selected:Je.path===q,dirty:o.has(Je.path),gitStatus:N.get(Je.path),dragging:(G==null?void 0:G.path)===Je.path,dropTarget:ge===Je.path,cut:(Ne==null?void 0:Ne.mode)==="cut"&&Ne.path===Je.path,onClick:()=>{bt()||(B(Je.path),Je.kind==="dir"?y(Je.path):j(Je.path))},onRename:()=>R(Je.path),onDelete:()=>C(Je),onDragStart:ut(Je),onDragEnd:It,onDragOver:wt(Je),onDrop:Te(Je),...We(Je)},Je.path)),rn&&at.push(...Lt(Je.path,be+1))}return at}function Et(){if(!an)return[a.jsx("p",{className:"fsrow__pending",style:Ja(0),children:"ищем…"},"search:wait")];if(an.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:Ja(0),children:"ничего не найдено"},"search:empty")];const ae=an.entries.map(be=>a.jsx(Zj,{entry:be,gitStatus:N.get(be.path),onClick:()=>dn(be)},be.path));return an.truncated&&ae.push(a.jsxs("p",{className:"fsrow__pending",style:Ja(0),children:["показаны первые ",an.entries.length," — уточните запрос"]},"search:truncated")),ae}return a.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Y?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:vt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:ae=>{H&&(ae.target.closest("button")||H())},children:[a.jsx(ew,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>yn("file"),children:a.jsx(Pj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>yn("dir"),children:a.jsx(Wj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:J,children:"↻"}),H&&a.jsx("button",{className:"sidepane__btn",title:Y?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Y?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Y,onClick:H,children:a.jsx(Kc,{active:Y})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:le,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(tw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:ft,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:ae=>cl(ae.target.value),onKeyDown:ae=>{ae.stopPropagation(),ae.key==="Escape"&&(ae.preventDefault(),ft?cl(""):ae.currentTarget.blur())}}),ft&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>cl(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(ge===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:et,onDrop:At,onContextMenu:st,onTouchStart:ct,onTouchMove:$e,onTouchEnd:Be,onTouchCancel:Be,children:tl?Et():An}),a.jsx(Rr,{result:h}),I&&a.jsx(Ui,{x:I.x,y:I.y,items:Ft(),onClose:fn})]})}function Kj({entry:l,depth:s,open:r,active:c,selected:o,dirty:f,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:T,onDragEnd:S,onDragOver:A,onDrop:C,onContextMenu:J,onTouchStart:le,onTouchMove:Y,onTouchEnd:H,onTouchCancel:q}){const B="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return a.jsxs("div",{className:B,style:Ja(s),draggable:!0,onDragStart:T,onDragEnd:S,onDragOver:A,onDrop:C,onContextMenu:J,onTouchStart:le,onTouchMove:Y,onTouchEnd:H,onTouchCancel:q,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:cy(l),children:[a.jsx("span",{className:"fsrow__icon"+ad("fsrow__icon",h),children:l.kind==="dir"?a.jsx(id,{open:r}):a.jsx(rd,{})}),a.jsx("span",{className:"fsrow__name"+ad("fsrow__name",h),children:l.name}),l.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),f&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${l.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function Zj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Ja(0),onClick:r,title:cy(l),children:[a.jsx("span",{className:"fsrow__icon"+ad("fsrow__icon",s),children:l.kind==="dir"?a.jsx(id,{}):a.jsx(rd,{})}),a.jsx("span",{className:"fsrow__name"+ad("fsrow__name",s),children:l.name}),l.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function cy(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Ja(l){return{"--depth":l}}function Ob(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(f=>f.path===s))??null}function Fj(l){const s=new Map,r={added:1,modified:2},c=(o,f)=>{const h=s.get(o);(!h||r[f]>r[h])&&s.set(o,f)};for(const o of l){const f=Jj(o.status);if(!f)continue;c(o.path,f);let h=Tr(o.path);for(;c(h,f),!!h;)h=Tr(h)}return s}function Jj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function ad(l,s){return s?` ${l}--git-${s}`:""}function id({open:l=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?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 rd(){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 Pj(){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 Wj(){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 ew(){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 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"})]})}const nw=200;function lw({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:f,onToggleZoom:h}){const[m,g]=b.useState(""),x=m.trim(),y=x.length>0,j=b.useRef(null),v=b.useRef(r);v.current=r;function T(C){g(C),j.current&&clearTimeout(j.current);const J=C.trim();if(!J){v.current("");return}j.current=setTimeout(()=>v.current(J),nw)}const S=y&&(s==null?void 0:s.query)===x?s:null;function A(){if(!S)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(S.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const C=[];let J="";for(const le of S.matches)le.path!==J&&(J=le.path,C.push(a.jsx("p",{className:"searchgroup__path",title:le.path,children:le.path},`path:${le.path}`))),C.push(a.jsx(sw,{match:le,onClick:()=>c(le)},`${le.path}:${le.line}:${le.column}`));return S.truncated&&C.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",S.matches.length," — уточните запрос"]},"grep:truncated")),C}return a.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(f?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:C=>{h&&(C.target.closest("button")||h())},children:[a.jsx(aw,{}),a.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&a.jsx("button",{className:"sidepane__btn",title:f?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":f?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":f,onClick:h,children:a.jsx(Kc,{active:f})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(iw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:C=>T(C.target.value),onKeyDown:C=>{C.stopPropagation(),C.key==="Escape"&&(C.preventDefault(),m?T(""):C.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>T(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?A():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function sw({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:l.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function aw(){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 iw(){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 Lf=null;function rw(){return Lf||(Lf=Promise.all([lt(()=>import("./index-fSIv5wMF.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),lt(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),lt(()=>import("./index-BHot-lnj.js"),[],import.meta.url),lt(()=>import("./index-DiyYHRov.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),lt(()=>import("./codemirror-B0NAQjxW.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw Lf=null,l})),Lf}function cw({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:f}){const h=b.useRef(null),m=b.useRef(null),g=b.useRef(null),x=b.useRef(new Map),y=b.useRef(new Map),j=b.useRef(new Set),v=b.useRef(null),T=b.useRef(o),S=b.useRef(f),A=b.useRef(l),C=b.useRef(r),J=b.useRef(s);T.current=o,S.current=f,A.current=l,C.current=r,J.current=s;const[le,Y]=b.useState("loading"),[H,q]=b.useState(!1);function B(R,W,oe,G,Z){const ge=x.current.get(G),ye=y.current.get(G)===Z;if(ge&&ye)oe.setState(ge);else{const z=R.EditorState.create({doc:J.current,extensions:[R.basicSetup,R.Prec.highest(R.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(S.current(A.current),!0)}])),R.keymap.of([R.indentWithTab]),W.of([]),R.editorTheme,R.editorHighlight,R.EditorView.updateListener.of(I=>{I.docChanged&&T.current(A.current,I.state.doc.toString())})]});x.current.set(G,z),y.current.set(G,Z),oe.setState(z),j.current.delete(G)}if(j.current.has(G))return()=>{};let Ne=!1;return Bj(G).then(z=>{Ne||!z||A.current!==G||(oe.dispatch({effects:W.reconfigure(z)}),x.current.set(G,oe.state),j.current.add(G))}),()=>{Ne=!0}}b.useEffect(()=>{if(!h.current)return;let W=!1,oe=null,G=null;Y("loading"),q(!1);const Z=window.setTimeout(()=>{W||q(!0)},200);return(async()=>{let ge;try{ge=await rw()}catch{window.clearTimeout(Z),W||Y("error");return}if(W||!h.current)return;window.clearTimeout(Z);const ye=new ge.Compartment;v.current=ye,g.current=ge,G=new ge.EditorView({parent:h.current}),m.current=G,oe=B(ge,ye,G,A.current,C.current),Y("ready")})(),()=>{W=!0,window.clearTimeout(Z),oe==null||oe(),G==null||G.destroy(),m.current===G&&(m.current=null),g.current=null,v.current=null}},[]),b.useEffect(()=>{const R=g.current,W=m.current,oe=v.current;if(!(!R||!W||!oe))return B(R,oe,W,l,r)},[l,r]);const M=b.useRef(0);return b.useEffect(()=>{const R=m.current,W=g.current;if(!R||!W||!c||c.token===M.current)return;M.current=c.token;const oe=R.state.doc.lines,G=Math.min(Math.max(c.line,1),oe),Z=R.state.doc.line(G),ge=Math.min(Z.from+Math.max(c.column-1,0),Z.to);R.dispatch({selection:W.EditorSelection.cursor(ge),effects:W.EditorView.scrollIntoView(ge,{y:"center"})}),R.focus()},[c]),b.useEffect(()=>()=>{const R=m.current;R&&x.current.set(l,R.state)},[l]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(le==="ready"?"":" is-hidden")}),le==="loading"&&H&&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:"Загружается редактор…"})]}),le==="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:s})]})]})}function Hs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:f,placeholder:h="—"}){const[m,g]=b.useState(!1),[x,y]=b.useState(0),j=b.useRef(null),v=b.useRef(null),T=s.find(C=>C.value===l)??null;b.useEffect(()=>{if(!m)return;const C=s.findIndex(J=>J.value===l);y(C===-1?0:C)},[m]),b.useEffect(()=>{if(!m)return;function C(J){var le;(le=j.current)!=null&&le.contains(J.target)||g(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[m]),b.useEffect(()=>{var C,J;m&&((J=(C=v.current)==null?void 0:C.querySelector(".is-cursor"))==null||J.scrollIntoView({block:"nearest"}))},[m,x]),b.useEffect(()=>{if(!m)return;const C=v.current,J=ow(j.current);if(!C||!J)return;const le=C.getBoundingClientRect().bottom-J.getBoundingClientRect().bottom;le>0&&(J.scrollTop+=Math.min(le+8,C.offsetHeight))},[m]);function S(C){g(!1),C.value!==l&&r(C.value)}function A(C){if(C.key==="Escape"){if(!m)return;C.preventDefault(),C.stopPropagation(),g(!1);return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){if(C.preventDefault(),!m)return g(!0);const J=C.key==="ArrowDown"?1:s.length-1;return y(le=>(le+J)%s.length)}if(C.key==="Enter"||C.key===" "){if(C.preventDefault(),!m)return g(!0);const J=s[x];J&&S(J)}}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":f??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(C=>!C),onKeyDown:A,children:[a.jsx("span",{className:"select__value",children:(T==null?void 0:T.label)??h}),a.jsx(uw,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":f??o,children:s.map((C,J)=>a.jsxs("button",{type:"button",role:"option","aria-selected":C.value===l,className:"select__option"+(J===x?" is-cursor":"")+(C.value===l?" is-on":""),onMouseEnter:()=>y(J),onClick:()=>S(C),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:C.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:C.label}),C.hint&&a.jsx("span",{className:"select__hint",children:C.hint})]},C.value))})]})}function ow(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function uw(){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 fw(){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 dw(){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 hw(){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 pw({path:l,mime:s,base64:r,error:c,tooLarge:o,size:f,onRequestMedia:h}){b.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=mw(r,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Zf(f),"). Лимит — 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(l),children:"Повторить"})]}):m?s.startsWith("image/")?a.jsx(xw,{url:m}):s.startsWith("video/")?a.jsx(_w,{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 mw(l,s){const[r,c]=b.useState(null);return b.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),f=new Uint8Array(o.length);for(let m=0;m<o.length;m++)f[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([f],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Ai=1,oy=8,zf=1.25;function gw(l){return Math.min(oy,Math.max(Ai,l))}function xw({url:l}){const[s,r]=b.useState({scale:Ai,x:0,y:0}),[c,o]=b.useState(!1),f=b.useRef(null),h=b.useRef(null);function m(T,S,A){r(C=>{const J=gw(C.scale*T);if(J===C.scale)return C;if(J<=Ai)return{scale:Ai,x:0,y:0};const le=(S-C.x)/C.scale,Y=(A-C.y)/C.scale;return{scale:J,x:S-J*le,y:A-J*Y}})}b.useEffect(()=>{const T=f.current;if(!T)return;function S(A){A.preventDefault();const C=T.getBoundingClientRect(),J=A.clientX-C.left-C.width/2,le=A.clientY-C.top-C.height/2;m(A.deltaY<0?zf:1/zf,J,le)}return T.addEventListener("wheel",S,{passive:!1}),()=>T.removeEventListener("wheel",S)},[]);function g(T){s.scale<=Ai||(T.currentTarget.setPointerCapture(T.pointerId),h.current={pointerId:T.pointerId,startX:T.clientX,startY:T.clientY,origX:s.x,origY:s.y},o(!0))}function x(T){const S=h.current;!S||S.pointerId!==T.pointerId||r(A=>({...A,x:S.origX+(T.clientX-S.startX),y:S.origY+(T.clientY-S.startY)}))}function y(){h.current=null,o(!1)}const j=s.scale>Ai,v=!j&&s.x===0&&s.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:f,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:x,onPointerUp:y,onPointerCancel:y,children:a.jsx("img",{src:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Ai,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/zf,0,0),children:a.jsx(dw,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:s.scale>=oy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(zf,0,0),children:a.jsx(fw,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Ai,x:0,y:0}),children:a.jsx(hw,{})})]})]})}const bw=[{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 _w({url:l}){const s=b.useRef(null),[r,c]=b.useState("1");return b.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Hs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:bw})]})]})}function yw({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:f,onRequestMedia:h,onTogglePreview:m}){const g=Fa(l),x=ry(l.path)&&!l.binary&&!l.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:l.path,children:l.path}),a.jsxs("span",{className:"editor__meta",children:[Zf(l.size),l.eol==="crlf"&&" · CRLF"]}),x&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>f(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?a.jsx(pw,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Zf(l.size)," на диске."]}):l.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Zf(l.size),"). Такие правит агент, а не браузер."]}):x&&l.previewMode?a.jsx(vw,{text:l.text}):a.jsx(cw,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function vw({text:l}){const[s,r]=b.useState("");return b.useEffect(()=>{let c=!1;return pd(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function jw({files:l,activePath:s,busy:r,onSelect:c,onClose:o,zoomed:f,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===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:"Агент работает"})]}),l.map(m=>a.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:Gj(m.path)}),Fa(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:f?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":f?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":f,onClick:h,children:a.jsx(Kc,{active:f})})]})}function hs(l){return l.claudeSessionId??l.id}function Ff(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),f=[],h=[];for(const m of l)(o.has(r(m))?f:h).push(m);return f.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...f]:[...f,...h]}function Lb(l){return l.state!=="closed"}function uy(l){return[...l.filter(Lb),...l.filter(s=>!Lb(s))]}function Uf(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),f=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,f),s,...o.slice(f)];return h.every((m,g)=>m===l[g])?null:h}function Qp(l,s,r,c){const o=l%10,f=l%100;return o===1&&f!==11?s:o>=2&&o<=4&&(f<12||f>14)?r:c}function fy(l){return`${l} ${Qp(l,"агент","агента","агентов")}`}function ww(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(fy(s)),r>0&&c.push(`${r} ${Qp(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Sw(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function Nw(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,f=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${f}`:`${c}:${f}`}function kw(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Ew({tasks:l,onStop:s}){const[r,c]=b.useState(!1),[o,f]=b.useState(()=>Date.now()),[h,m]=b.useState(()=>new Set);b.useEffect(()=>{const x=window.setInterval(()=>f(Date.now()),1e3);return()=>window.clearInterval(x)},[]),b.useEffect(()=>{m(x=>{const y=new Set(l.map(v=>v.id)),j=new Set([...x].filter(v=>y.has(v)));return j.size===x.size?x:j})},[l]);const g=x=>{m(y=>new Set(y).add(x)),s(x),window.setTimeout(()=>{m(y=>{if(!y.has(x))return y;const j=new Set(y);return j.delete(x),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(x=>!x),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:ww(l)}),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:l.map(x=>{const y=h.has(x.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:Sw(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:Nw(o-x.startedAt)})]}),a.jsx("div",{className:"task__desc",title:x.description,children:x.description}),(x.activity||x.lastTool)&&a.jsx("div",{className:"task__activity",title:x.activity??x.lastTool??void 0,children:x.activity??x.lastTool}),a.jsxs("div",{className:"task__stats",children:[kw(x.tokens)," · ",x.toolUses," ",Qp(x.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:y?"Останавливается":"Стоп"})]},x.id)})})]})}const Tw=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Kp({className:l}){return a.jsx("img",{src:Tw,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Cw=450,Aw=6,Mw={claude:{label:"Claude",hint:"Claude Code — как обычно"},antigravity:{label:"Antigravity",hint:"Google agy, отдельная палитра и права"}};function Rw({disabled:l,providers:s,lastAccountId:r,onStart:c,onSignIn:o}){var z;const{accounts:f,auth:h,multi:m}=S_(),g=["claude","antigravity"].filter(I=>s.includes(I)).flatMap(I=>I==="claude"&&m?f.map(V=>{const pe=h[V.id],Se=ov(pe);return{key:`claude:${V.id}`,id:"claude",label:V.name,hint:Se?`Claude Code, ${Se}`:"Claude Code",account:V,isDefault:V.id===r,needsLogin:V.id!==Ac&&pe!=null&&!pe.loggedIn}}):[{key:I,id:I,...Mw[I]}]),x=g.length>1,y=g.find(I=>I.isDefault)??g[0],j=Math.max(0,g.indexOf(y)),[v,T]=b.useState(!1),[S,A]=b.useState(0),[C,J]=b.useState({left:0,top:0}),le=b.useRef(null),Y=b.useRef(null),H=b.useRef(null);function q(){H.current&&window.clearTimeout(H.current.timer),H.current=null}function B(){q(),A(j),T(!0)}function M(I){var V;T(!1),I&&((V=le.current)==null||V.focus())}function R(I){if(l||!x||I.button!==0)return;const V={timer:0,x:I.clientX,y:I.clientY,fired:!1};V.timer=window.setTimeout(()=>{V.fired=!0,B()},Cw),H.current=V}function W(I){const V=H.current;!V||V.fired||Math.hypot(I.clientX-V.x,I.clientY-V.y)>Aw&&q()}function oe(){H.current&&!H.current.fired&&q()}function G(I){var V;if((V=H.current)!=null&&V.fired){H.current=null,I.preventDefault();return}l||y&&ye(y)}function Z(I){x&&(I.preventDefault(),!l&&B())}function ge(I){if(l||!x)return;(I.key==="ArrowDown"||I.key==="ArrowUp"||I.key==="Enter"&&I.shiftKey)&&(I.preventDefault(),B())}b.useLayoutEffect(()=>{if(!v)return;const I=le.current,V=Y.current;if(!I||!V)return;const pe=I.getBoundingClientRect(),Se=V.getBoundingClientRect(),N=8,ee=Math.max(N,Math.min(pe.right-Se.width,window.innerWidth-Se.width-N));let U=pe.top-Se.height-8;U<N&&(U=Math.min(pe.bottom+8,window.innerHeight-Se.height-N)),J({left:ee,top:U})},[v]),b.useLayoutEffect(()=>{var I;v&&((I=Y.current)==null||I.focus())},[v]),b.useLayoutEffect(()=>{if(!v)return;function I(V){var Se,N;const pe=V.target;!((Se=Y.current)!=null&&Se.contains(pe))&&!((N=le.current)!=null&&N.contains(pe))&&M(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[v]);function ye(I){var V;if(M(!1),I.needsLogin&&I.account){o(I.account.id);return}c(I.id,(V=I.account)==null?void 0:V.id)}function Ne(I){if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),M(!0);return}if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault();const V=I.key==="ArrowDown"?1:-1;A(pe=>(pe+V+g.length)%g.length);return}if(I.key==="Enter"||I.key===" "){I.preventDefault();const V=g[S];V&&ye(V);return}I.key==="Tab"&&M(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:le,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:x?m?`Новая сессия под «${((z=y==null?void 0:y.account)==null?void 0:z.name)??""}». Удерживайте, чтобы выбрать агента или аккаунт`:"Удерживайте, чтобы выбрать агента":void 0,"aria-label":m&&(y!=null&&y.account)?`Новая сессия, аккаунт «${y.account.name}»`:void 0,"aria-haspopup":x?"menu":void 0,"aria-expanded":x?v:void 0,onClick:G,onContextMenu:Z,onPointerDown:R,onPointerMove:W,onPointerUp:oe,onPointerCancel:oe,onPointerLeave:oe,onKeyDown:ge,children:["+ Сессия",m&&(y==null?void 0:y.account)&&a.jsx("span",{className:`newsession__acct acct--${y.account.color}`,"aria-hidden":"true"}),x&&a.jsx(Dw,{})]}),v&&x&&a.jsx("div",{ref:Y,className:"newsession__menu",style:{left:C.left,top:C.top},role:"menu","aria-label":m?"Выбрать агента и аккаунт для новой сессии":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Ne,children:g.map((I,V)=>{var pe;return a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(V===S?" is-cursor":"")+(V>0&&((pe=g[V-1])==null?void 0:pe.id)!==I.id?" newsession__item--sep":""),onMouseEnter:()=>A(V),onClick:()=>ye(I),children:[I.account?a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(pu,{account:I.account,size:"md"})}):a.jsx("span",{className:`newsession__mark newsession__mark--${I.id}`,"aria-hidden":"true",children:I.id==="antigravity"?a.jsx(Kp,{className:"newsession__mark-logo"}):a.jsx(Ow,{})}),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 Dw(){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 Ow(){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 dy="ccv:sidebar.collapsed",hy="ccv:sidebar.mode",py="ccv:sidebar.foldersCollapsed",zb="ccv:sidebar.expandedProjects",Ub="ccv:sidebar.expandedProjectArchives",Lw=500,kp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function zw({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:f,sessionFolders:h,pinnedFolders:m,projectSessions:g,onRequestSessions:x,pinned:y,live:j,listOrder:v,liveSessionsFirst:T,onReorder:S,activeWorkspaceId:A,activeSessionId:C,onSelectWorkspace:J,onRenameSession:le,onStopSession:Y,onPinSessions:H,onSelectPinned:q,onCloseWorkspaces:B,onRestoreWorkspaces:M,onArchiveSessions:R,onUnarchiveSessions:W,onCreateFolder:oe,onRenameFolder:G,onSetFolderColor:Z,onDeleteFolder:ge,onAssignToFolder:ye,onOpenWorkspace:Ne,onNewSession:z,enabledProviders:I,lastAccountId:V,onSignInAccount:pe,onOpenExtensions:Se,account:N,onOpenAccount:ee,relay:U,onOpenRelay:ve,onOpenSettings:F,themeMode:je,onCycleTheme:Oe}){var xn;const $e=S_(),[Be,bt]=b.useState(null),[Qe,fn]=b.useState(null),[We,st]=b.useState(null);function ct(E){return(We==null?void 0:We.folderId)===E.id?We.color??void 0:E.color}function vt(E){const re=E&&ct(E);return re?{"--folder-color":re}:void 0}const ut=b.useRef(void 0),[It,wt]=b.useState(null),[Te,et]=b.useState(null),[At,ft]=b.useState(""),[Fe,_n]=b.useState(Fw),[tl,Ot]=b.useState(Jw),[St,cl]=b.useState(Pw),[dn,an]=b.useState(()=>Bb(zb)),[ol,yn]=b.useState(()=>Bb(Ub)),[Ft,An]=b.useState([]);function Lt(E){cl(E);try{localStorage.setItem(hy,E)}catch{}}const Et=At.trim().toLowerCase(),ae=Et!=="",be=b.useMemo(()=>Ff(c,v==null?void 0:v.workspaces,E=>E.id,"bottom"),[c,v]),Ve=b.useMemo(()=>{const E=Ff(y,v==null?void 0:v.pinned,hs,"bottom");return T?uy(E):E},[y,v,T]),at=b.useMemo(()=>Ff(j,v==null?void 0:v.live,hs,"bottom"),[j,v]),Je=b.useMemo(()=>{const E=new Map,re=new Map,we=new Map,Ye=new Map(c.map(ot=>[ot.id,ot.folderId]));for(const ot of j){const Hn=by(ot);ip(E,ot.workspaceId,Hn),ot.folderId&&ip(re,ot.folderId,Hn);const Wt=Ye.get(ot.workspaceId);Wt&&ip(we,Wt,Hn)}return{byWorkspace:E,bySessionFolder:re,byWorkspaceFolder:we}},[j,c]),rn=E=>E.name.toLowerCase().includes(Et)||E.path.toLowerCase().includes(Et),X=b.useMemo(()=>ae?be.filter(E=>{if(rn(E))return!0;const re=g[E.id];return!!re&&(re.sessions.some(we=>ru(we,Et))||re.archived.some(we=>ru(we,Et)))}):be,[be,g,Et,ae]),he=b.useMemo(()=>ae?o.filter(rn):o,[o,Et,ae]),Re=E=>{var re;return((re=c.find(we=>we.id===E))==null?void 0:re.name)??"—"},qe=E=>{var re;return(re=c.find(we=>we.id===E))==null?void 0:re.path},Mt=b.useMemo(()=>ae?Ve.filter(E=>(E.title??"").toLowerCase().includes(Et)||Re(E.workspaceId).toLowerCase().includes(Et)):Ve,[Ve,c,Et,ae]),hn=b.useMemo(()=>ae?at.filter(E=>(E.title??"").toLowerCase().includes(Et)||Re(E.workspaceId).toLowerCase().includes(Et)):at,[at,c,Et,ae]),Mn=!ae;function Xl(E){_n(re=>{const we=re.includes(E)?re.filter(Ye=>Ye!==E):[...re,E];try{localStorage.setItem(dy,JSON.stringify(we))}catch{}return we})}const vn=E=>!Fe.includes(E);function ls(E){Ot(re=>{const we=re.includes(E)?re.filter(Ye=>Ye!==E):[...re,E];try{localStorage.setItem(py,JSON.stringify(we))}catch{}return we})}const vl=E=>!tl.includes(E);function nl(E,re){an(we=>{if(we.includes(E)===re)return we;const Ye=re?[...we,E]:we.filter(ot=>ot!==E);return Ib(zb,Ye),Ye})}function Is(E){yn(re=>{const we=re.includes(E)?re.filter(Ye=>Ye!==E):[...re,E];return Ib(Ub,we),we})}b.useEffect(()=>{A&&nl(A,!0)},[A]),b.useEffect(()=>An(E=>E.length?[]:E),[Et]);const jl=b.useRef(new Set);b.useEffect(()=>{if(!s){jl.current.clear();return}for(const E of dn)jl.current.has(E)||!c.some(re=>re.id===E)||(jl.current.add(E),E!==A&&x(E))},[s,dn,c,A]);function Cl(E){const re=g[E.id],we=!ae||rn(E),Ye=!we,ot=Ye?!Ft.includes(E.id):dn.includes(E.id),Hn=re?we?re.sessions.length:re.sessions.filter(Wt=>ru(Wt,Et)).length:void 0;return{entry:re,showAll:we,forced:Ye,open:ot,count:Hn}}function cn(E,re){if(re.forced){An(we=>we.includes(E.id)?we.filter(Ye=>Ye!==E.id):[...we,E.id]);return}nl(E.id,!re.open)}const tt=b.useMemo(()=>ou(X,f,void 0,!ae),[X,f,ae]),jn=b.useMemo(()=>ou(he,f),[he,f]),Xn=b.useMemo(()=>ou(Mt,m,E=>E.pinnedFolderId,!ae),[Mt,m,ae]),ma=b.useMemo(()=>({groups:[],ungrouped:hn}),[hn]),ss=((v==null?void 0:v.workspaces.length)??0)>0,qs=((v==null?void 0:v.pinned.length)??0)>0,as=((v==null?void 0:v.live.length)??0)>0,zn=Pf({enabled:Mn,scope:"workspaces",itemKey:E=>E.id,groups:tt.groups,ungrouped:tt.ungrouped,onReorder:S,onMoveToGroup:(E,re)=>{ye("workspace",E,re.folderId),re.order&&S("workspaces",re.order)}}),ul=Pf({enabled:Mn,scope:"pinned",itemKey:hs,groups:Xn.groups,ungrouped:Xn.ungrouped,onReorder:S}),wl=Pf({enabled:Mn,scope:"live",itemKey:hs,groups:ma.groups,ungrouped:ma.ungrouped,onReorder:S});b.useEffect(()=>{if(!We)return;const E=[...m,...f,...h].find(re=>re.id===We.folderId);E&&E.color===(We.color??void 0)&&st(null)},[We,m,f,h]),b.useEffect(()=>()=>window.clearTimeout(ut.current),[]);const zt=Ep(X),Jt=Ep(he),[Pe,fl]=b.useState(null),[pn,ll]=b.useState(null),[Rn,Un]=b.useState(null),[Jn,Xt]=b.useState(null),Sl=b.useRef(null);function wn(E,re){const we=E.touches[0];if(!we)return;const Ye={timer:0,x:we.clientX,y:we.clientY,el:E.currentTarget,fired:!1};Ye.timer=window.setTimeout(()=>{Ye.fired=!0,re(Ye.x,Ye.y,Ye.el)},Lw),Sl.current=Ye}function Sn(E){const re=Sl.current,we=E.touches[0];!re||!we||Math.hypot(we.clientX-re.x,we.clientY-re.y)>10&&(window.clearTimeout(re.timer),Sl.current=null)}function Vt(E){const re=Sl.current;re&&(window.clearTimeout(re.timer),re.fired&&E.preventDefault())}function jt(){var E;return(E=Sl.current)!=null&&E.fired?(Sl.current=null,!0):!1}function gs(){const E=Pe==null?void 0:Pe.opener;fl(null),E!=null&&E.isConnected&&E.focus()}function Nl(){const E=pn==null?void 0:pn.opener;ll(null),E!=null&&E.isConnected&&E.focus()}function Al(){const E=Rn==null?void 0:Rn.opener;Un(null),E!=null&&E.isConnected&&E.focus()}function mn(){const E=Jn==null?void 0:Jn.opener;Xt(null),E!=null&&E.isConnected&&E.focus()}function xs(E){return{onContextMenu:re=>{re.preventDefault(),fl({x:re.clientX,y:re.clientY,opener:re.currentTarget,ids:zt.targetsFor(E)})},onTouchStart:re=>wn(re,(we,Ye,ot)=>fl({x:we,y:Ye,opener:ot,ids:zt.targetsFor(E)})),onTouchMove:Sn,onTouchEnd:Vt,onTouchCancel:Vt}}function Gs(E){return{onContextMenu:re=>{re.preventDefault(),ll({x:re.clientX,y:re.clientY,opener:re.currentTarget,ids:Jt.targetsFor(E)})},onTouchStart:re=>wn(re,(we,Ye,ot)=>ll({x:we,y:Ye,opener:ot,ids:Jt.targetsFor(E)})),onTouchMove:Sn,onTouchEnd:Vt,onTouchCancel:Vt}}function Dn(E){return{onContextMenu:re=>{re.preventDefault(),Un({x:re.clientX,y:re.clientY,opener:re.currentTarget,ids:[E.id]})},onTouchStart:re=>wn(re,(we,Ye,ot)=>Un({x:we,y:Ye,opener:ot,ids:[E.id]})),onTouchMove:Sn,onTouchEnd:Vt,onTouchCancel:Vt}}function ga(E){return{onContextMenu:re=>{re.preventDefault(),Xt({x:re.clientX,y:re.clientY,opener:re.currentTarget,ids:[E.id]})},onTouchStart:re=>wn(re,(we,Ye,ot)=>Xt({x:we,y:Ye,opener:ot,ids:[E.id]})),onTouchMove:Sn,onTouchEnd:Vt,onTouchCancel:Vt}}const Vl=((A?(xn=g[A])==null?void 0:xn.sessions:void 0)??[]).filter(E=>E.state!=="closed").length,dl=Pe?X.find(E=>E.id===Pe.ids[0]):void 0,Pt=Pe?[{id:"close",label:Pe.ids.length>1?`Закрыть проекты (${Pe.ids.length})`:"Закрыть проект",onSelect:()=>{B(Pe.ids),zt.clear()}},...Pe.ids.length===1?[{id:"new-session-folder",label:"Новая папка сессий",onSelect:()=>{const E=Pe.ids[0];nl(E,!0),et(E)}}]:[],...su({folders:f,ids:Pe.ids,hasFolder:(dl==null?void 0:dl.folderId)!=null,assign:(E,re)=>ye("workspace",E,re),onClear:()=>zt.clear(),onNewFolder:()=>wt("workspace")}),...Pe.ids.length===1&&Mn?zn.menuItems(Pe.ids[0],ss):[]]:[],_e=Pe?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(A&&Pe.ids.includes(A)&&Vl>0?` в нём сейчас незавершённых сессий: ${Vl} — при закрытии они остановятся на хосте.`:""):void 0,k=pn?he.find(E=>E.id===pn.ids[0]):void 0,K=pn?[{id:"restore",label:pn.ids.length>1?`Вернуть проекты (${pn.ids.length})`:"Вернуть проект",onSelect:()=>{M(pn.ids),Jt.clear()}},...su({folders:f,ids:pn.ids,hasFolder:(k==null?void 0:k.folderId)!=null,assign:(E,re)=>ye("workspace",E,re),onClear:()=>Jt.clear(),onNewFolder:()=>wt("workspace")})]:[],xe=pn?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,ke=Rn?Mt.find(E=>E.id===Rn.ids[0]):void 0,Ge=Rn?[{id:"rename",label:"Переименовать",onSelect:()=>bt(Rn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ke&&H(ke.workspaceId,[ke.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ke&&R(ke.workspaceId,[ke.id])}},...ke&&ke.workspaceId===A?su({folders:h.filter(E=>E.workspaceId===ke.workspaceId),ids:[ke.id],hasFolder:ke.folderId!=null,assign:(E,re)=>ye("session",E,re,ke.workspaceId),onClear:()=>{},onNewFolder:()=>{nl(ke.workspaceId,!0),et(ke.workspaceId)}}):[],...qw(ke?su({folders:m,ids:[ke.id],hasFolder:ke.pinnedFolderId!=null,assign:(E,re)=>ye("pinned",E,re),onClear:()=>{},onNewFolder:()=>wt("pinned")}):[]),...Mn&&ke?ul.menuItems(hs(ke),qs):[]]:[],Le=Jn?hn.find(E=>E.id===Jn.ids[0]):void 0,qt=Jn?[{id:"stop",label:"Остановить",onSelect:()=>{Le&&Y(Le)}},{id:"rename",label:"Переименовать",onSelect:()=>bt(Jn.ids[0])},{id:"pin",label:(Le==null?void 0:Le.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{Le&&H(Le.workspaceId,[Le.id],Le.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Le&&R(Le.workspaceId,[Le.id])}},...Mn&&Le?wl.menuItems(hs(Le),as):[]]:[],Nn={start:wn,move:Sn,end:Vt,consumed:jt};function on(E,re){var Hn,Wt;const we=Cl(E),Ye=`ws-branch-${E.id}`,ot=re?1:0;return a.jsxs(b.Fragment,{children:[a.jsxs("div",{"data-row-key":E.id,"data-row-scope":"workspaces",className:Mc(E.id===A,zt.selected.includes(E.id),!1,!!re)+" row--project"+zn.dropClass(E.id),style:Di(ot,vt(re)),...xs(E),children:[cu(re),Mn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить в другую папку или изменить порядок","aria-label":"Перетащить проект: в папку или на другое место в списке",...zn.gripHandlers(E.id),children:a.jsx(Wf,{})}),a.jsx("button",{type:"button",className:"row__chev","aria-expanded":we.open,"aria-controls":Ye,"aria-label":`${we.open?"Свернуть":"Развернуть"} проект «${E.name}»`,title:we.open?"Свернуть сессии проекта":"Показать сессии проекта",onClick:()=>{jt()||cn(E,we)},children:a.jsx(md,{open:we.open})}),a.jsxs("button",{className:"row__main",onClick:Vn=>{jt()||zt.click(Vn,E,()=>{J(E.id),nl(E.id,!0)})},onKeyDown:Vn=>zn.onKeyDown(E.id,Vn),children:[a.jsxs("span",{className:"row__title",children:[E.name,E.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:E.path,children:E.path})]}),a.jsx(_y,{agg:Je.byWorkspace.get(E.id)}),we.count!==void 0&&a.jsx("span",{className:"sidebar__count row__count",title:"Всего сессий в проекте, запущенных и нет",children:we.count})]}),we.open&&a.jsx("div",{id:Ye,role:"group","aria-label":`Сессии проекта «${E.name}»`,className:re?"tree__branch tree__branch--railed":"tree__branch",style:Di(ot,vt(re)),children:a.jsx(Uw,{workspace:E,baseDepth:ot+1,loaded:we.entry!==void 0,sessions:((Hn=we.entry)==null?void 0:Hn.sessions)??Hb,archived:((Wt=we.entry)==null?void 0:Wt.archived)??Hb,folders:h.filter(Vn=>Vn.workspaceId===E.id),needle:Et,showAll:we.showAll,reorderEnabled:Mn,listOrder:v,liveSessionsFirst:T,activeSessionId:C,archiveExpanded:ol.includes(E.id),onToggleArchive:()=>Is(E.id),creatingFolder:Te===E.id,onStartCreateFolder:()=>et(E.id),onFinishCreateFolder:()=>et(null),renamingId:Be,setRenamingId:bt,renderFolderHead:hl,liveInFolder:Je.bySessionFolder,isFolderOpen:vl,folderRowStyle:vt,longPress:Nn,onOpenSession:q,onRenameSession:le,onPinSessions:H,onArchiveSessions:R,onUnarchiveSessions:W,onCreateFolder:oe,onAssignToFolder:ye,onReorder:S})})]},E.id)}function Ut(E,re){return a.jsxs("div",{className:Mc(E.id===A,Jt.selected.includes(E.id),!1,!!re),style:vt(re),...Gs(E),children:[cu(re),a.jsxs("button",{className:"row__main",onClick:we=>{jt()||Jt.click(we,E,()=>J(E.id))},children:[a.jsxs("span",{className:"row__title",children:[E.name,E.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:aS(E)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>M([E.id]),children:"Вернуть"})]},E.id)}function kn(E,re){const we=hs(E);return a.jsxs("div",{"data-row-key":we,"data-row-scope":"pinned",className:Mc(E.id===C,!1,E.provider==="antigravity",!!re,!0)+ul.dropClass(we),style:vt(re),...Be===E.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Dn(E)},children:[cu(re),Be===E.id?a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:E.title??"",onCommit:Ye=>{le(E,Ye),bt(null)},onCancel:()=>bt(null)})}):a.jsxs(a.Fragment,{children:[Mn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...ul.gripHandlers(we),children:a.jsx(Wf,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{jt()||q(E)},onKeyDown:Ye=>ul.onKeyDown(we,Ye),children:a.jsx(cd,{session:E,pinned:!1,projectName:Re(E.workspaceId),projectPath:qe(E.workspaceId)})})]})]},E.id)}function gn(E){const re=hs(E);return a.jsx("div",{"data-row-key":re,"data-row-scope":"live",className:Mc(E.id===C,!1,E.provider==="antigravity",!1,!0)+wl.dropClass(re),...Be===E.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...ga(E)},children:Be===E.id?a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:E.title??"",onCommit:we=>{le(E,we),bt(null)},onCancel:()=>bt(null)})}):a.jsxs(a.Fragment,{children:[Mn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...wl.gripHandlers(re),children:a.jsx(Wf,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{jt()||q(E)},onKeyDown:we=>wl.onKeyDown(re,we),children:a.jsx(cd,{session:E,pinned:E.pinned===!0,projectName:Re(E.workspaceId),projectPath:qe(E.workspaceId)})}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:we=>{we.stopPropagation(),!jt()&&Y(E)},children:a.jsx(Vw,{})})]})},E.id)}function hl(E,re,we={}){return a.jsx(Yw,{folder:E,count:re,live:we.live,depth:we.depth??0,droppable:we.droppable===!0,dropActive:we.droppable===!0&&zn.isDropFolder(E.id),open:vl(E.id),renaming:Qe===E.id,onToggle:()=>ls(E.id),onStartRename:()=>fn(E.id),onCommitRename:Ye=>{G(E.id,Ye),fn(null)},onCancelRename:()=>fn(null),onDelete:()=>ge(E.id),color:ct(E),onPreviewColor:Ye=>{window.clearTimeout(ut.current),st({folderId:E.id,color:Ye})},onCommitColor:Ye=>{st({folderId:E.id,color:Ye}),Z(E.id,Ye),window.clearTimeout(ut.current),ut.current=window.setTimeout(()=>st(null),4e3)},onResetColor:()=>{window.clearTimeout(ut.current),st(null),Z(E.id,null)}},E.id)}return a.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:s?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${qb[je]}`,"aria-label":`Тема: ${qb[je]}. Переключить`,onClick:Oe,children:a.jsx(Ww,{mode:je})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":St==="default",className:St==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Lt("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":St==="pinned",className:St==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Lt("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":St==="live",className:St==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Lt("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(Kw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:At,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:E=>ft(E.target.value),onKeyDown:E=>{E.stopPropagation(),E.key==="Escape"&&(E.preventDefault(),At?ft(""):E.currentTarget.blur())}}),At&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>ft(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:St==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Hf,{title:"Закреплённые",count:Mt.length,open:vn("pinned"),onToggle:()=>Xl("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{wt("pinned"),vn("pinned")||Xl("pinned")}}}),vn("pinned")&&a.jsxs(a.Fragment,{children:[It==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:"",placeholder:"Название папки",onCommit:E=>{oe("pinned",E),wt(null)},onCancel:()=>wt(null)})})}),Mt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ae?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Xn.groups.map(E=>a.jsxs(b.Fragment,{children:[hl(E.folder,E.items.length),vl(E.folder.id)&&E.items.map(re=>kn(re,E.folder))]},E.folder.id)),Xn.ungrouped.map(E=>kn(E))]})]}):St==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Hf,{title:"Запущенные",count:hn.length,open:vn("live"),onToggle:()=>Xl("live")}),vn("live")&&a.jsxs(a.Fragment,{children:[hn.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ae?"Ничего не найдено":"Нет запущенных сессий"})}),hn.map(E=>gn(E))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Hf,{title:"Проекты",count:X.length,open:vn("workspaces"),onToggle:()=>Xl("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{wt("workspace"),vn("workspaces")||Xl("workspaces")}}}),vn("workspaces")&&a.jsxs(a.Fragment,{children:[It==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:"",placeholder:"Название папки",onCommit:E=>{oe("workspace",E),wt(null)},onCancel:()=>wt(null)})})}),X.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ae?"Ничего не найдено":"Пока ни одного"})}),tt.groups.map(E=>a.jsxs(b.Fragment,{children:[hl(E.folder,E.items.length,{droppable:Mn,live:Je.byWorkspaceFolder.get(E.folder.id)}),vl(E.folder.id)&&E.items.map(re=>on(re,E.folder))]},E.folder.id)),tt.ungrouped.map(E=>on(E)),zn.canUngroup&&a.jsx("div",{className:zn.zoneActive?"tree__zone tree__zone--active":"tree__zone","data-drop-zone":"ungrouped",children:"Без папки"})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Hf,{title:"Архив проектов",count:he.length,open:vn("workspacesArchive"),onToggle:()=>Xl("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),vn("workspacesArchive")&&a.jsxs(a.Fragment,{children:[he.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ae?"Ничего не найдено":"Пока пусто"})}),jn.groups.map(E=>a.jsxs(b.Fragment,{children:[hl(E.folder,E.items.length),vl(E.folder.id)&&E.items.map(re=>Ut(re,E.folder))]},E.folder.id)),jn.ungrouped.map(E=>Ut(E))]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[$e.multi?a.jsxs("button",{className:"account-btn",title:"Аккаунты Claude",onClick:ee,children:[a.jsx("span",{className:"account-btn__marks",children:$e.accounts.map(E=>{var we;const re=((we=$e.auth[E.id])==null?void 0:we.loggedIn)===!1;return a.jsx("span",{className:re?"account-btn__mark is-out":"account-btn__mark",children:a.jsx(pu,{account:E})},E.id)})}),a.jsx("span",{className:"account-btn__id",children:"Аккаунты Claude"}),$e.accounts.some(E=>{var re;return((re=$e.auth[E.id])==null?void 0:re.loggedIn)===!1})&&a.jsx("span",{className:"chip chip--warn",children:"нет входа"})]}):a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:ee,children:[a.jsx("span",{className:N!=null&&N.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:N===null?"Аккаунт":N.loggedIn?N.email||"Вход выполнен":"Войти в аккаунт"}),(N==null?void 0:N.plan)&&a.jsx("span",{className:"chip",children:N.plan})]}),ve&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:ve,children:[a.jsx("span",{className:U!=null&&U.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:U===null?"Удалённый доступ":U.paired?U.connected?U.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(U==null?void 0:U.connected)&&U.clients>0&&a.jsx("span",{className:"chip",children:U.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!Se,title:"MCP-серверы и плагины",onClick:()=>Se==null?void 0:Se(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:F,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:Ne,children:"+ Проект"}),a.jsx(Rw,{disabled:!A,providers:I,lastAccountId:V,onStart:z,onSignIn:pe})]})]}),Pe&&a.jsx(Ui,{x:Pe.x,y:Pe.y,items:Pt,note:_e,onClose:gs}),pn&&a.jsx(Ui,{x:pn.x,y:pn.y,items:K,note:xe,onClose:Nl}),Rn&&a.jsx(Ui,{x:Rn.x,y:Rn.y,items:Ge,note:kp,onClose:Al}),Jn&&a.jsx(Ui,{x:Jn.x,y:Jn.y,items:qt,note:kp,onClose:mn})]})}const Hb=[];function ru(l,s){return(l.title??"").toLowerCase().includes(s)}function cu(l){return l?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}function Di(l,s){return{"--depth":l,...s}}function Uw({workspace:l,baseDepth:s,loaded:r,sessions:c,archived:o,folders:f,needle:h,showAll:m,reorderEnabled:g,listOrder:x,liveSessionsFirst:y,activeSessionId:j,archiveExpanded:v,onToggleArchive:T,creatingFolder:S,onStartCreateFolder:A,onFinishCreateFolder:C,renamingId:J,setRenamingId:le,renderFolderHead:Y,liveInFolder:H,isFolderOpen:q,folderRowStyle:B,longPress:M,onOpenSession:R,onRenameSession:W,onPinSessions:oe,onArchiveSessions:G,onUnarchiveSessions:Z,onCreateFolder:ge,onAssignToFolder:ye,onReorder:Ne}){var wt;const z=l.id,I=h!=="",V=b.useMemo(()=>{const Te=Ff(c,x==null?void 0:x.sessions[z],hs,"top");return y?uy(Te):Te},[c,x,z,y]),pe=b.useMemo(()=>m?V:V.filter(Te=>ru(Te,h)),[V,m,h]),Se=b.useMemo(()=>m?o:o.filter(Te=>ru(Te,h)),[o,m,h]),N=b.useMemo(()=>ou(pe,f,void 0,!I),[pe,f,I]),ee=b.useMemo(()=>ou(Se,f),[Se,f]),U=(((wt=x==null?void 0:x.sessions[z])==null?void 0:wt.length)??0)>0,ve=Pf({enabled:g,scope:"sessions",workspaceId:z,itemKey:hs,groups:N.groups,ungrouped:N.ungrouped,onReorder:Ne}),F=Ep(pe),[je,Oe]=b.useState(null),[$e,Be]=b.useState(!1);b.useEffect(()=>Be(!1),[h]);const bt=I&&Se.length>0,Qe=bt?!$e:v;function fn(){const Te=je==null?void 0:je.opener;Oe(null),Te!=null&&Te.isConnected&&Te.focus()}function We(Te){return{onContextMenu:et=>{et.preventDefault(),Oe({x:et.clientX,y:et.clientY,opener:et.currentTarget,ids:F.targetsFor(Te)})},onTouchStart:et=>M.start(et,(At,ft,Fe)=>Oe({x:At,y:ft,opener:Fe,ids:F.targetsFor(Te)})),onTouchMove:M.move,onTouchEnd:M.end,onTouchCancel:M.end}}const st=je?pe.find(Te=>Te.id===je.ids[0]):void 0,ct=(st==null?void 0:st.pinned)!==!0,vt=je?[...je.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>le(je.ids[0])}]:[],{id:"pin",label:ct?je.ids.length>1?`Закрепить (${je.ids.length})`:"Закрепить":je.ids.length>1?`Открепить (${je.ids.length})`:"Открепить",onSelect:()=>{oe(z,je.ids,ct),F.clear()}},{id:"archive",label:je.ids.length>1?`Убрать в архив (${je.ids.length})`:"Убрать в архив",onSelect:()=>{G(z,je.ids),F.clear()}},...su({folders:f,ids:je.ids,hasFolder:(st==null?void 0:st.folderId)!=null,assign:(Te,et)=>ye("session",Te,et,z),onClear:()=>F.clear(),onNewFolder:A}),...je.ids.length===1&&g&&st?ve.menuItems(hs(st),U):[]]:[];function ut(Te,et,At){const ft=hs(Te);return a.jsxs("div",{"data-row-key":ft,"data-row-scope":"sessions",className:Mc(Te.id===j,F.selected.includes(Te.id),Te.provider==="antigravity",!!At,!0)+ve.dropClass(ft),style:Di(et,B(At)),...J===Te.id?{}:We(Te),children:[cu(At),J===Te.id?a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:Te.title??"",onCommit:Fe=>{W(Te,Fe),le(null)},onCancel:()=>le(null)})}):a.jsxs(a.Fragment,{children:[g&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...ve.gripHandlers(ft),children:a.jsx(Wf,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:Fe=>{M.consumed()||F.click(Fe,Te,()=>R(Te))},onKeyDown:Fe=>ve.onKeyDown(ft,Fe),children:a.jsx(cd,{session:Te,pinned:Te.pinned===!0})}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{M.consumed()||le(Te.id)},children:"✎"})]})]},Te.id)}function It(Te,et,At){return a.jsxs("div",{className:Mc(Te.id===j,!1,Te.provider==="antigravity",!!At,!0),style:Di(et,B(At)),children:[cu(At),a.jsx("button",{className:"row__main row__main--session",onClick:()=>R(Te),children:a.jsx(cd,{session:Te,pinned:!1,archived:!0})}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>Z(z,[Te.id]),children:"Вернуть"})]},Te.id)}return a.jsxs(a.Fragment,{children:[S&&a.jsx("div",{className:"row row--hint",style:Di(s,void 0),children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:"",placeholder:"Название папки",onCommit:Te=>{ge("session",Te,z),C()},onCancel:C})})}),r?pe.length===0&&a.jsx("div",{className:"row row--hint",style:Di(s,void 0),children:a.jsx("span",{className:"row__meta",children:"Пока ни одной"})}):a.jsx("div",{className:"row row--hint",style:Di(s,void 0),"aria-busy":"true",children:a.jsx("span",{className:"row__meta",children:"Загрузка…"})}),N.groups.map(Te=>a.jsxs(b.Fragment,{children:[Y(Te.folder,Te.items.length,{depth:s,live:H.get(Te.folder.id)}),q(Te.folder.id)&&Te.items.map(et=>ut(et,s+1,Te.folder))]},Te.folder.id)),N.ungrouped.map(Te=>ut(Te,s)),r&&o.length>0&&(!I||Se.length>0)&&a.jsxs(a.Fragment,{children:[a.jsx(Hw,{title:"Архив",count:Se.length,open:Qe,depth:s,hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется",onToggle:()=>bt?Be(Te=>!Te):T()}),Qe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row row--hint",style:Di(s,void 0),children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),ee.groups.map(Te=>a.jsxs(b.Fragment,{children:[Y(Te.folder,Te.items.length,{depth:s}),q(Te.folder.id)&&Te.items.map(et=>It(et,s+1,Te.folder))]},Te.folder.id)),ee.ungrouped.map(Te=>It(Te,s))]})]}),je&&a.jsx(Ui,{x:je.x,y:je.y,items:vt,note:kp,onClose:fn})]})}function Hw({title:l,count:s,open:r,depth:c,hint:o,onToggle:f}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return a.jsx("div",{className:"row",style:Tp(c),children:a.jsxs("button",{className:"row__main",style:my,"aria-expanded":r,title:`${h} — ${o}`,onClick:f,children:[a.jsx(md,{open:r}),a.jsx("span",{style:xy,children:l}),a.jsx("span",{className:"sidebar__count",children:s})]})})}function Mc(l,s,r,c,o){const f=["row"];return o&&f.push("row--session"),c&&f.push("row--foldered"),l&&f.push("row--active"),s&&f.push("row--selected"),r&&f.push("row--antigravity"),f.join(" ")}function ou(l,s,r=o=>o.folderId,c=!1){const o=new Map(s.map(g=>[g.id,g])),f=new Map,h=[];for(const g of l){const x=r(g),y=x?o.get(x):void 0;if(!y){h.push(g);continue}const j=f.get(y.id);j?j.push(g):f.set(y.id,[g])}if(c)for(const g of s)f.has(g.id)||f.set(g.id,[]);return{groups:[...f.entries()].map(([g,x])=>({folder:o.get(g),items:x})).sort((g,x)=>g.folder.name.localeCompare(x.folder.name,"ru")),ungrouped:h}}function Bw(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const Jf="\0ungrouped";function Iw(l,s,r){const c=new Map;for(const o of l)for(const f of o.items)c.set(r(f),o.folder.id);for(const o of s)c.set(r(o),Jf);return c}function ap(l,s,r,c,o){const f=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!f)return null;const h=f.findIndex(m=>c(m)===l);return o==="up"?h<=0?null:{target:c(f[h-1]),position:"before"}:h===-1||h>=f.length-1?null:{target:c(f[h+1]),position:"after"}}function Pf(l){const[s,r]=b.useState(null),[c,o]=b.useState(null),[f,h]=b.useState(null),m=l.onMoveToGroup,g=b.useMemo(()=>Bw(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),x=b.useMemo(()=>Iw(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),y=b.useRef({raf:0,el:null,x:0,y:0}),j=b.useRef(()=>{});function v(){window.cancelAnimationFrame(y.current.raf),y.current.raf=0,y.current.el=null}function T(G){v();const Z=y.current;if(Z.el=G.closest(".sidebar__scroll"),!Z.el)return;const ge=56,ye=16,Ne=()=>{const z=Z.el;if(!z)return;const I=z.getBoundingClientRect();let V=0;if(Z.y<I.top+ge?V=-ye*Math.min(1,(I.top+ge-Z.y)/ge):Z.y>I.bottom-ge&&(V=ye*Math.min(1,(Z.y-(I.bottom-ge))/ge)),V!==0){const pe=z.scrollTop;z.scrollTop=pe+V,z.scrollTop!==pe&&j.current(Z.x,Z.y)}Z.raf=window.requestAnimationFrame(Ne)};Z.raf=window.requestAnimationFrame(Ne)}b.useEffect(()=>v,[]);function S(){v(),r(null),o(null),h(null)}function A(G,Z){l.enabled&&(Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId),y.current.x=Z.clientX,y.current.y=Z.clientY,T(Z.currentTarget),r(G),o(null),h(null))}function C(G,Z){if(!s)return;const ge=document.elementFromPoint(G,Z),ye=x.get(s);if(m){const Se=ge==null?void 0:ge.closest("[data-drop-folder]"),N=Se?null:ge==null?void 0:ge.closest("[data-drop-zone]");if(Se||N){const ee=Se?Se.dataset.dropFolder:null,U=ee??Jf;o(null),h(U===ye?null:{folderId:ee});return}}const Ne=ge==null?void 0:ge.closest("[data-row-key]"),z=(Ne==null?void 0:Ne.dataset.rowScope)===l.scope?Ne.dataset.rowKey:void 0,I=z?x.get(z):void 0;if(h(null),!z||z===s||I===void 0||!m&&I!==ye){o(null);return}const V=Ne.getBoundingClientRect(),pe=Z-V.top<V.height/2?"before":"after";o(Se=>(Se==null?void 0:Se.key)===z&&Se.position===pe?Se:{key:z,position:pe})}j.current=C;function J(G){y.current.x=G.clientX,y.current.y=G.clientY,C(G.clientX,G.clientY)}function le(){if(s&&f&&m)m(s,{folderId:f.folderId,order:null});else if(s&&c){const G=Uf(g,s,c.key,c.position),Z=x.get(c.key);m&&Z!==x.get(s)?m(s,{folderId:Z===Jf?null:Z??null,order:G}):G&&l.onReorder(l.scope,G,l.workspaceId)}S()}function Y(G,Z){if(!l.enabled)return;const ge=ap(G,l.groups,l.ungrouped,l.itemKey,Z);if(!ge)return;const ye=Uf(g,G,ge.target,ge.position);ye&&l.onReorder(l.scope,ye,l.workspaceId)}function H(G,Z){const ge=ap(G,l.groups,l.ungrouped,l.itemKey,"up"),ye=ap(G,l.groups,l.ungrouped,l.itemKey,"down"),Ne=[{id:"move-up",label:"Переместить выше",disabled:!ge,onSelect:()=>{if(!ge)return;const z=Uf(g,G,ge.target,ge.position);z&&l.onReorder(l.scope,z,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!ye,onSelect:()=>{if(!ye)return;const z=Uf(g,G,ye.target,ye.position);z&&l.onReorder(l.scope,z,l.workspaceId)}}];return Z&&Ne.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),Ne}function q(G){return s===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function B(G){return{onPointerDown:Z=>A(G,Z),onPointerMove:J,onPointerUp:le,onPointerCancel:S,onLostPointerCapture:S}}function M(G,Z){!Z.altKey||Z.key!=="ArrowUp"&&Z.key!=="ArrowDown"||(Z.preventDefault(),Y(G,Z.key==="ArrowUp"?"up":"down"))}const R=G=>(f==null?void 0:f.folderId)===G,W=!!m&&s!==null&&x.get(s)!==Jf,oe=f!==null&&f.folderId===null;return{dragging:s!==null,dropClass:q,gripHandlers:B,onKeyDown:M,menuItems:H,isDropFolder:R,canUngroup:W,zoneActive:oe}}function su(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function qw(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Ep(l){const[s,r]=b.useState([]),c=b.useRef(null);function o(){r([]),c.current=null}function f(m,g,x){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=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,T]=y<j?[y,j]:[j,y];r(l.slice(v,T+1).map(S=>S.id));return}}o(),c.current=g.id,x()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:f,targetsFor:h,clear:o}}const Gw={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},$w={width:22,height:22,borderRadius:6};function Hf({title:l,count:s,open:r,onToggle:c,hint:o,action:f}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:Gw,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(md,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:l}),a.jsx("span",{className:"sidebar__count",children:s})]}),f&&a.jsx("button",{className:"theme-btn",style:$w,title:f.label,"aria-label":f.label,onClick:f.onClick,children:a.jsx(Zw,{})})]})}function Tp(l){return{paddingLeft:`calc(37px + ${l} * var(--tree-indent, 24px))`}}const my={display:"flex",alignItems:"center",gap:6,width:"100%"},gy={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500},xy={...gy,color:"var(--muted)",fontSize:12.5};function Yw({folder:l,count:s,live:r,open:c,renaming:o,onToggle:f,onStartRename:h,onCommitRename:m,onCancelRename:g,onDelete:x,color:y,onPreviewColor:j,onCommitColor:v,onResetColor:T,depth:S,droppable:A,dropActive:C}){const J=b.useRef(null),le=b.useRef(v);return le.current=v,b.useEffect(()=>{const Y=J.current;if(!Y)return;const H=()=>le.current(Y.value);return Y.addEventListener("change",H),()=>Y.removeEventListener("change",H)},[o]),o?a.jsx("div",{className:"row",style:Tp(S),children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:l.name,placeholder:"Название папки",onCommit:m,onCancel:g})})}):a.jsxs("div",{className:C?"row row--drop-target":"row",style:Tp(S),"data-drop-folder":A?l.id:void 0,children:[a.jsxs("button",{className:"row__main",style:my,"aria-expanded":c,title:c?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:f,children:[a.jsx(md,{open:c}),a.jsx("span",{style:S>0?xy:gy,children:l.name}),!c&&a.jsx(_y,{agg:r}),a.jsx("span",{className:"sidebar__count",children:s})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:h,children:"✎"}),a.jsxs("label",{className:y?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:y?{background:y}:void 0}),a.jsx("input",{ref:J,type:"color",value:y??Xw(),"aria-label":`Цвет папки «${l.name}»`,onChange:Y=>j(Y.target.value)})]}),l.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${l.name}»`,onClick:T,children:"↺"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:x,children:"✕"})]})}function Xw(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function md({open:l}){return a.jsx("svg",{className:l?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Wf(){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 Vw(){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 Qw({className:l}){return a.jsxs("svg",{className:l,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 Kw(){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 Zw(){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 Fw(){try{const l=localStorage.getItem(dy);if(l===null)return["workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="pinned"||r==="live"):["workspacesArchive"]}catch{return["workspacesArchive"]}}function Bb(l){try{const s=localStorage.getItem(l);if(s===null)return[];const r=JSON.parse(s);return Array.isArray(r)?r.filter(c=>typeof c=="string"):[]}catch{return[]}}function Ib(l,s){try{localStorage.setItem(l,JSON.stringify(s))}catch{}}function Jw(){try{const l=localStorage.getItem(py);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function Pw(){try{const l=localStorage.getItem(hy);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const qb={system:"как в системе",light:"светлая",dark:"тёмная"};function Ww({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?a.jsx("svg",{...s,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"})}):l==="light"?a.jsxs("svg",{...s,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",{...s,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 Gb(l){const s=eS(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${fy(r)}`:s}function eS(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":tS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function tS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function by(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":nS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function nS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function cd({session:l,pinned:s,projectName:r,projectPath:c,archived:o}){const f=o?"closed":by(l);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`row__lead row__state--${f}`,"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?sS(l):`${Gb(l)} · ${new Date(l.updatedAt).toLocaleString()}`,children:[a.jsx(lS,{title:l.title??"Без названия",pinned:s,provider:l.provider,accountId:l.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:l.archivedAuto?"по сроку":"вручную"}),l.archivedAt?a.jsx("span",{className:"row__time",children:` · ${rp(l.archivedAt)}`}):null]}):a.jsxs("span",{className:`row__meta${f==="closed"?` row__vh${r===void 0?" row__vh--time":""}`:""}`,children:[a.jsx("span",{className:`row__state row__state--${f}${f==="closed"?" row__vh":""}`,children:Gb(l)}),r===void 0&&a.jsx("span",{className:"row__time",children:f==="closed"?rp(l.updatedAt):` · ${rp(l.updatedAt)}`})]})]})]})}const $b=["waiting","error","running","reconnecting","background","starting","halted","ready","fresh","closed"];function ip(l,s,r){const c=l.get(s);if(!c){l.set(s,{count:1,tone:r,waiting:r==="waiting"?1:0});return}c.count+=1,r==="waiting"&&(c.waiting+=1),$b.indexOf(r)<$b.indexOf(c.tone)&&(c.tone=r)}function _y({agg:l}){if(!l)return null;const s=`Запущено сессий: ${l.count}`,r=l.waiting>0?`${s}, ждут решения: ${l.waiting}`:s;return a.jsxs("span",{className:`row__live row__state--${l.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:l.count})]})}function lS({title:l,pinned:s,provider:r,accountId:c,projectName:o,projectPath:f}){const h=cv(c,r);return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[s&&a.jsx(Qw,{className:"row__pin"}),h&&a.jsx(pu,{account:h,className:"row__acct"}),r==="antigravity"&&a.jsx(Kp,{className:"row__provider"}),l]}),o!==void 0&&a.jsx("span",{className:"row__project",title:f,children:o})]})}function rp(l){const s=new Date(l);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"})}function sS(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function aS(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const Yb=3,iS=15e5;function yy(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=cp(r.content).map(f=>({type:"add",text:f}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=uS(rS(cp(r.old_string),cp(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(f=>f.type==="add").length,removed:o.filter(f=>f.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function cp(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function rS(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const f=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(f),...cS(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(f)]}function cS(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(y=>({type:"add",text:y}));if(s.length===0)return l.map(y=>({type:"del",text:y}));if((l.length+1)*(s.length+1)>iS)return[...l.map(y=>({type:"del",text:y})),...s.map(y=>({type:"add",text:y}))];const r=l.length,c=s.length,o=c+1,f=new Uint32Array((r+1)*o),h=(y,j)=>f[y*o+j]??0;for(let y=r-1;y>=0;y--)for(let j=c-1;j>=0;j--)f[y*o+j]=l[y]===s[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,x=0;for(;g<r&&x<c;){const y=l[g],j=s[x];y===j?(m.push({type:"ctx",text:y}),g++,x++):h(g+1,x)>=h(g,x+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),x++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;x<c;)m.push({type:"add",text:s[x++]});return oS(m)}function oS(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function uS(l){if(!l.some(f=>f.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((f,h)=>{if(f.type!=="ctx")for(let m=Math.max(0,h-Yb);m<=Math.min(l.length-1,h+Yb);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${fS(c.length)} без изменений`}),c=[]}return l.forEach((f,h)=>{s[h]?(o(),r.push(f)):c.push(f)}),o(),r}function fS(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function pa(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function Cp(){try{return await navigator.clipboard.readText()}catch{return null}}const Zp=1600,Cr="Копировать",zc="Скопировано";function Vc({text:l,hint:s,className:r}){const[c,o]=b.useState(!1);return b.useEffect(()=>{if(!c)return;const f=setTimeout(()=>o(!1),Zp);return()=>clearTimeout(f)},[c]),b.useEffect(()=>o(!1),[l]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?zc:`${Cr} ${s}`,title:c?zc:`${Cr} ${s}`,onClick:()=>{pa(l).then(f=>{f&&o(!0)})},children:c?zc:Cr})}function Fp({diff:l}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),a.jsxs("span",{className:"diff__stat",children:[l.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&a.jsx("div",{className:"diff__note",children:l.note}),a.jsx("div",{className:"diff__body",children:l.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>a.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function dS({waiting:l}){const[s,r]=b.useState(0);return b.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:l?"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:l?"ждёт разрешения":"думает"}),!l&&a.jsxs("span",{className:"work__time",children:[s," с"]})]})}function Jp({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:f=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=b.useRef(null),j=b.useRef(null),v=b.useRef(!0),T=b.useRef(null),S=b.useRef(null),A=b.useRef(!1);b.useEffect(()=>{v.current=!0,T.current=null,A.current=!1,S.current!==null&&(clearTimeout(S.current),S.current=null)},[m]),b.useEffect(()=>{const H=y.current,q=j.current;if(!H||!q)return;function B(W){!H||W===H.scrollTop||(A.current=!0,H.scrollTop=W)}function M(){if(!H)return;const W=T.current;if(W){const oe=Vb(H,W.id);if(oe){const G=oe.getBoundingClientRect().top-H.getBoundingClientRect().top;B(H.scrollTop+(G-W.top))}S.current!==null&&clearTimeout(S.current),S.current=setTimeout(()=>{T.current=null},500);return}v.current&&B(H.scrollHeight)}const R=new ResizeObserver(M);return R.observe(q),()=>{R.disconnect(),S.current!==null&&clearTimeout(S.current)}},[]);function C(){const H=y.current;if(H){if(A.current){A.current=!1;return}v.current=H.scrollHeight-H.scrollTop-H.clientHeight<80}}function J(){if(f)return;const H=y.current,q=c[0];if(H&&q){const B=Vb(H,q.id);B&&(T.current={id:q.id,top:B.getBoundingClientRect().top-H.getBoundingClientRect().top})}h==null||h()}let le=0;function Y(H){return H.kind==="user"?le++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:C,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:J,disabled:f,children:f?"Загружаем…":"Показать более раннее"}),c.map(H=>a.jsx(Xb,{item:H,userIndex:Y(H),onEditMessage:g},H.id)),c.length>0&&l.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&a.jsx("p",{className:"empty",children:x}),l.map(H=>a.jsx(Xb,{item:H,userIndex:Y(H),onEditMessage:g},H.id)),s&&a.jsx(dS,{waiting:r})]})})}function Xb({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return a.jsx(pS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[a.jsx(mS,{text:l.text}),l.streaming&&a.jsx("span",{className:"caret"}),l.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(Vc,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return a.jsx(xS,{item:l});case"result":return a.jsxs("div",{className:"result-line","data-item-id":l.id,children:[a.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),a.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&a.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",Kb(l.inputTokens)," ↓",Kb(l.outputTokens)]})]});case"notice":return a.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const hS=500;function pS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=b.useState(null),[f,h]=b.useState(!1),[m,g]=b.useState(l.text),x=b.useRef(null),y=b.useRef(!1),j=fd("(max-width: 860px)"),v=b.useRef(null);function T(R,W){o({x:R,y:W})}function S(R){R.preventDefault(),T(R.clientX,R.clientY)}function A(R){const W=R.touches[0];if(!W)return;const oe={timer:0,x:W.clientX,y:W.clientY,fired:!1};oe.timer=window.setTimeout(()=>{oe.fired=!0,T(oe.x,oe.y)},hS),v.current=oe}function C(R){const W=v.current,oe=R.touches[0];!W||!oe||Math.hypot(oe.clientX-W.x,oe.clientY-W.y)>10&&(window.clearTimeout(W.timer),v.current=null)}function J(R){const W=v.current;W&&(window.clearTimeout(W.timer),W.fired&&R.preventDefault())}function le(){g(l.text),h(!0)}function Y(){h(!1)}function H(){const R=m.trim();if(R===""&&!(l.images&&l.images.length>0))return;const W=r==null?void 0:r(s,R,l.images);if(W instanceof Promise){if(y.current)return;y.current=!0,W.then(oe=>{y.current=!1,oe&&h(!1)},()=>{y.current=!1});return}W!==!1&&h(!1)}b.useEffect(()=>{const R=x.current;!R||!f||(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[m,f]),b.useEffect(()=>{if(!f)return;const R=x.current;R&&(R.focus(),R.setSelectionRange(R.value.length,R.value.length))},[f]);function q(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),Y();return}R.key==="Enter"&&!R.shiftKey&&!j&&(R.preventDefault(),H())}const B=l.images&&l.images.length>0&&a.jsx("div",{className:"msg--user__images",children:l.images.map((R,W)=>a.jsx("img",{className:"msg--user__image",src:`data:${R.mediaType};base64,${R.data}`,alt:"Вложение"},W))});if(f){const R=m.trim()!==""||!!(l.images&&l.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[B,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:W=>g(W.target.value),onKeyDown:q,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:Y,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:H,disabled:!R,children:"Сохранить"})]})]})]})}const M=[{id:"copy",label:"Копировать",onSelect:()=>void pa(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:le}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:S,onTouchStart:A,onTouchMove:C,onTouchEnd:J,onTouchCancel:J,children:[B,l.text,c&&a.jsx(Ui,{x:c.x,y:c.y,items:M,onClose:()=>o(null)})]})}function Vb(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function mS({text:l}){const[s,r]=b.useState(""),c=b.useRef([]);b.useEffect(()=>{let f=!1;return pd(l).then(h=>{f||r(gS(h))}),()=>{f=!0}},[l]),b.useEffect(()=>{const f=c.current;return()=>f.forEach(h=>clearTimeout(h))},[]);function o(f){var g,x;const h=f.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";m!==""&&pa(m).then(y=>{if(!y)return;h.textContent=zc,h.setAttribute("aria-label",zc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Cr,h.setAttribute("aria-label",Ap),h.classList.remove("copybtn--done"))},Zp);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const Ap=`${Cr} блок кода`;function gS(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Ap),o.title=Ap,o.textContent=Cr,c.append(o)}return s.body.innerHTML}function xS({item:l}){const[s,r]=b.useState(!1),c=l.result===null,o=yy(l.name,l.input),f=l.name==="AskUserQuestion"?yS(l.input):null;return a.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:l.name}),a.jsx("span",{className:"tool__arg",children:f?_S(f):bS(l.input)}),a.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&a.jsxs("div",{className:"tool__body",children:[f?a.jsx(vS,{questions:f,answers:l.answers}):o?a.jsx(Fp,{diff:o}):a.jsx(Qb,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!f||l.isError)&&a.jsx(Qb,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Qb({text:l,hint:s,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:l}),a.jsx(Vc,{text:l,hint:s,className:"codeblock__copy"})]})}function bS(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function _S(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function yS(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:f,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:y,description:j,preview:v}=x;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 f=="string"?f:"",options:g,multiSelect:m===!0})}return r}function vS({questions:l,answers:s}){return a.jsx("div",{className:"tool__questions",children:l.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:s!=null&&s[r.question]?a.jsx("span",{className:"tool__answer-value",children:s[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Kb(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const jS="ccv.dictation.lang",Zb="ru-RU";function wS(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Fb(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(wS);return!r&&s.length>0&&Ls("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function vy(){var l;try{return((l=localStorage.getItem(jS))==null?void 0:l.trim())||Zb}catch{return Zb}}function Ls(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const SS=3,NS=400,kS=5,ES=250,TS=2e3,CS=2e4;async function AS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const MS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${vy()}`};function RS(l){const[s]=b.useState(()=>Fb()!==null),[r,c]=b.useState(!1),[o,f]=b.useState(null),h=b.useRef(null),m=b.useRef(!1),g=b.useRef(!1),x=b.useRef(l),y=b.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=b.useRef(null),v=b.useRef(!1),T=b.useRef(null),S=b.useCallback(()=>{T.current&&clearTimeout(T.current),T.current=null},[]),A=b.useCallback(()=>{S();const H=async q=>{if(T.current=null,!(!m.current||v.current)){if(!q&&!await AS()){if(Ls("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;T.current=setTimeout(()=>void H(!0),CS);return}Ls("движок не ответил на start()"),m.current=!1,c(!1),f("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};T.current=setTimeout(()=>void H(!1),TS)},[S]);b.useEffect(()=>{x.current=l}),b.useEffect(()=>{const H=Fb();if(!H)return;const q=new H;return q.lang=vy(),q.continuous=!0,q.interimResults=!0,q.onstart=()=>{Ls("сессия открыта"),v.current=!0,S(),c(!0)},q.onaudiostart=()=>{Ls("пошёл звук с микрофона"),y.current.audio=!0},q.onresult=B=>{var oe;if(g.current)return;let M="",R="";for(let G=B.resultIndex;G<B.results.length;G++){const Z=B.results[G];if(!Z)continue;const ge=((oe=Z[0])==null?void 0:oe.transcript)??"";Z.isFinal?M+=ge:R+=ge}const W=y.current;W.heard=!0,W.everHeard=!0,Ls("распознано",{final:M,interim:R}),x.current(M,R)},q.onerror=B=>{y.current.lastError=B.error,Ls("ошибка движка",B.error),!(B.error==="no-speech"||B.error==="aborted")&&(m.current=!1,c(!1),f(MS[B.error]??`Распознавание не работает: ${B.error}`))},q.onend=()=>{g.current=!1,v.current=!1;const B=y.current,M=Date.now()-B.openedAt;if(Ls("сессия закрыта",{мс:M,звук:B.audio,слова:B.heard,ошибка:B.lastError||null}),!m.current){c(!1);return}if(B.dead=!B.audio&&M<NS?B.dead+1:0,B.dead>=kS){m.current=!1,c(!1),f(B.lastError?`Распознавание не работает: ${B.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}B.silent=B.heard?0:B.silent+1,!B.everHeard&&!B.warned&&B.silent>=SS&&(B.warned=!0,f(B.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){B.openedAt=Date.now(),B.audio=!1,B.heard=!1,B.lastError="",A();try{q.start()}catch{}}},ES)},h.current=q,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,S(),q.onend=null,q.onresult=null,q.onerror=null,q.onstart=null,q.onaudiostart=null,q.abort(),h.current=null}},[]);const C=b.useCallback(()=>{var H;if(m.current){if(m.current=!1,Ls("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,S(),!v.current){c(!1);return}(H=h.current)==null||H.stop()}},[]),J=b.useCallback(()=>{const H=h.current;if(H){if(!window.isSecureContext){f("Микрофон доступен только по https или с localhost");return}f(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),Ls("включение микрофона",{язык:H.lang}),A();try{H.start()}catch(q){Ls("start() не прошёл",q)}}},[A]),le=b.useCallback(()=>{m.current?C():J()},[J,C]),Y=b.useCallback(()=>{var H;m.current&&v.current&&(g.current=!0,(H=h.current)==null||H.abort())},[]);return{supported:s,listening:r,error:o,toggle:le,stop:C,drop:Y}}const DS="(max-width: 860px)",Jb=/^\/(\S*)$/,OS=new Set(["model","permissions"]);function LS(l){return OS.has(l.name)||l.name.startsWith("__")}const zS=new Set(["clear","rename"]),Pb=/(?:^|\s)@([^\s@]*)$/,US=200,HS=100,BS=190,IS=5,qS=20*1024*1024,GS=1568,$S=.85;let Wb=0;async function YS(l){var j,v;if(!l.type.startsWith("image/")||l.size>qS)return null;const s=await XS(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,GS/Math.max(r,c)),f=document.createElement("canvas");f.width=Math.max(1,Math.round(r*o)),f.height=Math.max(1,Math.round(c*o));const h=f.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,f.width,f.height),(v=(j=s.image).close)==null||v.call(j);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",x=f.toDataURL(g,m?void 0:$S),y=x.slice(x.indexOf(",")+1);return y?(Wb+=1,{id:`att${Wb}`,mediaType:g,data:y,previewUrl:x}):null}async function XS(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function jy({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:f,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:x=!1,attachmentsEnabled:y=!0,sendBlocked:j=!1,onContextSearch:v,onCommand:T,onSend:S,onInterrupt:A,onEscape:C}){var rn;const J=fd(DS),[le,Y]=b.useState(()=>m?Zh(m):""),[H,q]=b.useState(!1),[B,M]=b.useState(0),R=b.useRef(null),W=b.useRef(null),oe=b.useRef(!1),G=b.useRef(null),[Z,ge]=b.useState(()=>m?Zh(m).length:0),[ye,Ne]=b.useState([]),z=b.useRef(null),I=b.useCallback(X=>{!y||X.length===0||Promise.all(X.map(YS)).then(he=>{const Re=he.filter(qe=>qe!==null);Re.length!==0&&Ne(qe=>[...qe,...Re].slice(0,IS))})},[y]);function V(X){Ne(he=>he.filter(Re=>Re.id!==X))}function pe(X){var qe;if(!y)return;const he=(qe=X.clipboardData)==null?void 0:qe.items;if(!he)return;const Re=[];for(const Mt of he){if(!Mt.type.startsWith("image/"))continue;const hn=Mt.getAsFile();hn&&Re.push(hn)}Re.length!==0&&(X.preventDefault(),I(Re))}function Se(X){const he=X.target.files?Array.from(X.target.files):[];X.target.value="",I(he)}b.useEffect(()=>{y||Ne([])},[y]);const[N,ee]=b.useState([]),[U,ve]=b.useState(-1),F=b.useRef(""),[je,Oe]=b.useState(""),$e=RS(b.useCallback((X,he)=>{X&&Y(Re=>op(Re,X)),Oe(he.trim())},[])),Be=je?op(le,je):le;b.useEffect(()=>{$e.listening||je===""||(Y(X=>op(X,je)),Oe(""))},[$e.listening,je]),b.useEffect(()=>{var X;x&&((X=R.current)==null||X.focus())},[x]);const bt=b.useRef(new Map),Qe=b.useRef(new Map),fn=b.useRef(m),We=b.useRef({text:le,caret:Z});We.current={text:le,caret:Z};const st=b.useCallback((X,he,Re)=>{he===""?(bt.current.delete(X),Qe.current.delete(X)):(bt.current.set(X,he),Qe.current.set(X,Re)),R_(X,he)},[]),ct=$e.drop;b.useLayoutEffect(()=>{const X=fn.current;if(X===m)return;fn.current=m,X&&st(X,We.current.text,We.current.caret);const he=m?bt.current.get(m)??Zh(m):"",Re=m?Qe.current.get(m):void 0,qe=Math.min(Re??he.length,he.length);Y(he),ge(qe),G.current=[qe,qe],Oe(""),M(0),q(!1),ve(-1),F.current="",Ne([]),ct()},[m,st,ct]),b.useEffect(()=>{m&&st(m,le,Z)},[m,le,Z,st]);const vt=l?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",ut=b.useRef(0),It=b.useCallback(X=>{const he=parseFloat(getComputedStyle(X).maxHeight),Re=Number.isFinite(he)&&he>0?he:BS;X.style.height="auto";const qe=X.scrollHeight;X.style.height=`${Math.min(qe,Re)}px`,X.style.overflowY=qe>Re?"auto":"hidden"},[]);b.useEffect(()=>{const X=R.current;X&&It(X)},[Be,vt,l,It]),b.useLayoutEffect(()=>{const X=R.current,he=G.current;!X||!he||(G.current=null,X.setSelectionRange(he[0],he[1]))}),b.useEffect(()=>{const X=R.current;if(!X)return;const he=new ResizeObserver(([Re])=>{const qe=Re==null?void 0:Re.contentRect.width;qe===void 0||Math.abs(qe-ut.current)<1||(ut.current=qe,It(X))});return he.observe(X),()=>he.disconnect()},[It]);const wt=$e.stop;b.useEffect(()=>{l&&wt()},[l,wt]);const Te=b.useMemo(()=>$e.error?{ok:!1,message:$e.error}:null,[$e.error]),et=b.useMemo(()=>{var Re;const X=(Re=Jb.exec(le))==null?void 0:Re[1];if(X===void 0)return[];const he=X.toLowerCase();return r.filter(qe=>!LS(qe)&&up(qe,he)<wy).sort((qe,Mt)=>up(qe,he)-up(Mt,he))},[le,r]),At=!H&&et.length>0,ft=Math.min(B,et.length-1),Fe=H?null:((rn=Pb.exec(Be.slice(0,Z)))==null?void 0:rn[1])??null,_n=b.useRef(v);_n.current=v,b.useEffect(()=>{if(Fe===null||Fe===""||Fe.endsWith("/")){_n.current(Fe);return}const X=setTimeout(()=>_n.current(Fe),US);return()=>clearTimeout(X)},[Fe]);const tl=Fe!==null&&(o==null?void 0:o.query)===Fe,Ot=tl?o.entries:[],St=Fe!==null,cl=St&&!tl,dn=Math.min(B,Math.max(Ot.length-1,0));b.useEffect(()=>{var he,Re;if(!At&&!St)return;const X=At?ft:dn;(Re=(he=W.current)==null?void 0:he.children[X])==null||Re.scrollIntoView({block:"nearest"})},[At,St,ft,dn]);function an(X,he){var Re;Y(X),ge(he),G.current=[he,he],M(0),q(!1),je!==""&&(Oe(""),$e.drop()),(Re=R.current)==null||Re.focus()}function ol(){Y(""),Oe(""),M(0),ge(0),q(!1),ve(-1),F.current="",Ne([]),$e.drop(),m&&st(m,"",0)}function yn(X){const he=X.trim();if(he===""&&ye.length===0||l||j||oe.current)return;const Re=S(he,ye.length>0?ye.map(qe=>({mediaType:qe.mediaType,data:qe.data})):void 0);if(Re instanceof Promise){oe.current=!0,Re.then(qe=>{oe.current=!1,qe&&Ft(he)},()=>{oe.current=!1});return}Re!==!1&&Ft(he)}function Ft(X){X!==""&&ee(he=>[X,...he.filter(Re=>Re!==X)].slice(0,HS)),ol()}function An(X){if(X<-1||X>=N.length)return;U===-1&&(F.current=le);const he=X===-1?F.current:N[X]??"";ve(X),an(he,he.length)}function Lt(){var qe;const X=((qe=R.current)==null?void 0:qe.selectionStart)??Be.length,Re=`${X>0&&!/\s$/.test(Be.slice(0,X))?" ":""}@`;an(Be.slice(0,X)+Re+Be.slice(X),X+Re.length)}function Et(X){var Mt;const he=(Mt=Pb.exec(Be.slice(0,Z)))==null?void 0:Mt[1];if(he===void 0)return;const Re=Z-he.length-1,qe=X.kind==="dir"?`@${X.path}/`:`@${X.path} `;an(Be.slice(0,Re)+qe+Be.slice(Z),Re+qe.length)}function ae(){var he;if(j)return;const X=(he=Jb.exec(Be.trim()))==null?void 0:he[1];if(X&&T(X)){ol();return}yn(Be)}function be(X,he){Y(X),ge(he),M(0),q(!1),ve(-1),je!==""&&(Oe(""),$e.drop())}function Ve(X){var qe;const he=zS.has(X.name)?c:null,Re=`/${X.name} `;Y(Re+(he??"")),ge(Re.length+((he==null?void 0:he.length)??0)),he&&(G.current=[Re.length,Re.length+he.length]),M(0),(qe=R.current)==null||qe.focus()}function at(X){if(T(X.name)){Y(""),M(0),q(!1);return}X.argumentHint?Ve(X):yn(`/${X.name}`)}function Je(X){if(At){if(X.key==="ArrowDown")return X.preventDefault(),M(he=>(Math.min(he,et.length-1)+1)%et.length);if(X.key==="ArrowUp"){X.preventDefault();const he=et.length-1;return M(Re=>(Math.min(Re,he)+he)%et.length)}if(X.key==="Enter"&&!X.shiftKey){X.preventDefault();const he=et[ft];he&&at(he);return}if(X.key==="Tab"){X.preventDefault();const he=et[ft];he&&Ve(he);return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),q(!0);return}}if(St){if(X.key==="ArrowDown"&&Ot.length>0)return X.preventDefault(),M(he=>(Math.min(he,Ot.length-1)+1)%Ot.length);if(X.key==="ArrowUp"&&Ot.length>0){X.preventDefault();const he=Ot.length-1;return M(Re=>(Math.min(Re,he)+he)%Ot.length)}if(X.key==="Enter"&&!X.shiftKey||X.key==="Tab"){const he=Ot[dn];if(he){X.preventDefault(),Et(he);return}if(X.key==="Tab")return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),q(!0);return}}if((X.key==="ArrowUp"||X.key==="ArrowDown")&&!X.shiftKey){const he=X.currentTarget,Re=he.selectionStart;if(he.selectionEnd===Re){const Mt=X.key==="ArrowUp"?U+1:U-1;Mt>=-1&&Mt<N.length&&requestAnimationFrame(()=>{he.selectionStart===Re&&he.selectionEnd===Re&&An(Mt)})}}if(X.key==="Escape"&&C){X.preventDefault(),X.stopPropagation(),C();return}X.key==="Enter"&&!X.shiftKey&&!J&&(X.preventDefault(),ae())}return a.jsx("div",{className:f?`composer ${f}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Rr,{result:Te}),St&&!At&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:W,children:[Ot.map((X,he)=>a.jsxs("button",{role:"option","aria-selected":he===dn,className:he===dn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(he),onMouseDown:Re=>{Re.preventDefault(),Et(X)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[X.name,X.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:X.path}),X.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},X.path)),Ot.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:cl?"ищем…":Fe?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),At&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:W,children:et.map((X,he)=>a.jsxs("button",{role:"option","aria-selected":he===ft,className:he===ft?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(he),onMouseDown:Re=>{Re.preventDefault(),at(X)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",X.name]}),X.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:X.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:X.description})]},X.name))}),ye.length>0&&a.jsx("div",{className:"composer__attachments",children:ye.map(X=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:X.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>V(X.id),children:a.jsx(JS,{})})]},X.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Lt,children:a.jsx(KS,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:z,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:Se}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var X;return(X=z.current)==null?void 0:X.click()},children:a.jsx(FS,{})})]}),a.jsx("textarea",{ref:R,value:Be,disabled:l,placeholder:vt,onChange:X=>be(X.target.value,X.target.selectionStart),onSelect:X=>ge(X.currentTarget.selectionStart),onKeyDown:Je,onPaste:pe}),$e.supported&&a.jsx("button",{type:"button",className:$e.listening?"micbtn is-on":"micbtn",title:$e.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":$e.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":$e.listening,disabled:l,onClick:$e.toggle,children:a.jsx(PS,{on:$e.listening})}),s?a.jsx("button",{className:"btn",onClick:A,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:ae,disabled:l||j||Be.trim()===""&&ye.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(ZS,{})]})]})]})})}function op(l,s){const r=s.trim();if(r==="")return l;const c=Mp(r).slice(VS(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function VS(l,s){const r=Mp(l),c=Mp(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((f,h)=>QS(f,c[h]??"")))return o;return 0}function Mp(l){return l.split(/\s+/).filter(s=>s!=="")}function QS(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function KS(){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 ZS(){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 FS(){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 JS(){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 PS({on:l}){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:l?"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 wy=4;function up(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:wy}function WS({request:l,plan:s,queued:r,collapsed:c,onCollapse:o,onAccept:f,onDecline:h}){const[m,g]=b.useState(s),[x,y]=b.useState("preview");b.useEffect(()=>{g(s),y("preview")},[l.requestId,s]);const j=m.trim().length>0;function v(){j&&f(l.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(Sy,{})}),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"+(x==="preview"?" is-on":""),role:"tab","aria-selected":x==="preview",onClick:()=>y("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(x==="source"?" is-on":""),role:"tab","aria-selected":x==="source",onClick:()=>y("source"),children:"Код"})]}),a.jsx(Pp,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[l.reason&&a.jsx("p",{className:"plansheet__reason",children:l.reason}),a.jsx("div",{className:"plansheet__content",children:x==="preview"?a.jsx(eN,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:T=>g(T.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(l.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function eN({text:l}){const[s,r]=b.useState("");return b.useEffect(()=>{let c=!1;return pd(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function Sy(){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 tN({kind:l,toolName:s,queued:r,onExpand:c}){const o=l==="question"?"Уточняющий вопрос":l==="plan"?"План на согласование":`Разрешить действие: ${s}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${l}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:l==="question"?"?":l==="plan"?a.jsx(Sy,{}):"!"}),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 Pp({onClick:l}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:l,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 nN({request:l,queued:s,collapsed:r,onCollapse:c,onDecide:o}){const f=yy(l.toolName,l.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:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),a.jsx(Pp,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&a.jsx("p",{className:"sheet__reason",children:l.reason}),f?a.jsx(Fp,{diff:f}):a.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(l.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(l.requestId,"allow"),children:"Разрешить"})]})]})})}function lN({request:l,queued:s,collapsed:r,onCollapse:c,onAnswer:o,onDecline:f}){const{questions:h}=l,[m,g]=b.useState(()=>h.map(()=>new Set)),[x,y]=b.useState(()=>h.map(()=>"")),[j,v]=b.useState(()=>e_(h));b.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(e_(h))},[l.requestId]);const T=b.useMemo(()=>aN(h,m,x),[h,m,x]),S=T!==null;function A(q,B){var M,R;(R=(M=h[q])==null?void 0:M.options[B])!=null&&R.preview&&v(W=>{const oe=W.slice();return oe[q]=B,oe})}function C(q,B,M){g(R=>{const W=R.slice(),oe=new Set(W[q]);return M?oe.has(B)?oe.delete(B):oe.add(B):oe.has(B)||(oe.clear(),oe.add(B)),W[q]=oe,W}),B!=="other"&&A(q,B)}function J(q,B){y(M=>{const R=M.slice();return R[q]=B,R})}function le(){T&&o(l.requestId,T)}function Y(q){q.key==="Enter"&&(q.target.closest("button")||S&&(q.preventDefault(),le()))}function H(q){var W;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(q.key))return;const B=Array.from(q.currentTarget.querySelectorAll("button.qsheet__option")),M=B.indexOf(document.activeElement);if(M===-1)return;q.preventDefault();const R=q.key==="ArrowDown"||q.key==="ArrowRight"?1:-1;(W=B[(M+R+B.length)%B.length])==null||W.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:Y,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})`,s>0&&` — ещё ${s} в очереди`]}),a.jsx(Pp,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[l.reason&&a.jsx("p",{className:"qsheet__reason",children:l.reason}),h.map((q,B)=>a.jsx(sN,{q,qi:B,selected:m[B]??new Set,otherText:x[B]??"",previewIndex:j[B]??null,onToggle:C,onFocusOption:A,onOtherText:J,onOptionsKeyDown:H},B))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>f(l.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:le,children:"Ответить"})]})]})})}function sN({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:f,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var T;const x=l.options.some(S=>S.preview),y=o!==null?(T=l.options[o])==null?void 0:T.preview:void 0,j=r.has("other"),v=l.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:l.header}),a.jsx("span",{className:"qsheet__qtext",children:l.question})]}),a.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((S,A)=>{const C=r.has(A);return a.jsxs("button",{type:"button",role:v,"aria-checked":C,className:"qsheet__option"+(C?" is-selected":""),onClick:()=>f(s,A,l.multiSelect),onFocus:()=>h(s,A),onMouseEnter:()=>h(s,A),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:S.label}),a.jsx("span",{className:"qsheet__opt-desc",children:S.description})]})]},A)}),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:()=>f(s,"other",l.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":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:S=>m(s,S.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function e_(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function aN(l,s,r){const c={};for(let o=0;o<l.length;o++){const f=l[o];if(!f)continue;const h=s[o]??new Set,m=[];for(let g=0;g<f.options.length;g++){const x=f.options[g];x&&h.has(g)&&m.push(x.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[f.question]=m.join(", ")}return c}function iN(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function Ny({path:l}){const[s,r]=b.useState(!1),[c,o]=b.useState(!1),f=b.useRef(null);b.useEffect(()=>{if(!s)return;function m(g){var x;(x=f.current)!=null&&x.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),b.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Zp);return()=>clearTimeout(m)},[c]),b.useEffect(()=>r(!1),[l]);async function h(){await pa(l)&&o(!0)}return a.jsxs("div",{ref:f,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(rN,{open:s}),a.jsx("span",{className:"cwd__short",children:l})]}),s&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:l}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?zc:Cr})]})]})}function rN({open:l}){return a.jsx("svg",{className:l?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const cN=["low","medium","high"];function ky({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:f,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:x,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[T,S]=b.useState(!1),[A,C]=b.useState(0),J=b.useRef(null),le=b.useRef(null),Y=l.find(R=>R.value===s)??null,H=Y&&Y.supportsEffort?Y.effortLevels.length>0?Y.effortLevels:cN:[],q=H.includes("xhigh");b.useEffect(()=>{if(!T)return;const R=l.findIndex(W=>W.value===s);C(R===-1?0:R)},[T]),b.useEffect(()=>{if(!T)return;function R(W){var oe;(oe=J.current)!=null&&oe.contains(W.target)||S(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[T]),b.useEffect(()=>{var R,W;T&&((W=(R=le.current)==null?void 0:R.querySelector(".is-cursor"))==null||W.scrollIntoView({block:"nearest"}))},[T,A]);function B(R){S(!1),R.value!==s&&g(R.value)}function M(R){if(R.key==="Escape"){if(!T)return;R.preventDefault(),R.stopPropagation(),S(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!T)return S(!0);if(l.length===0)return;const W=R.key==="ArrowDown"?1:l.length-1;return C(oe=>(oe+W)%l.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!T)return S(!0);const W=l[A];W&&B(W)}}return a.jsxs("div",{ref:J,className:"select"+(T?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":T,onClick:()=>S(R=>!R),onKeyDown:M,children:[(Y==null?void 0:Y.displayName)??s?a.jsx("span",{className:"select__value",children:(Y==null?void 0:Y.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):H.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(oN,{})]}),T&&a.jsxs("div",{ref:le,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((R,W)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===s,className:"select__option"+(W===A?" is-cursor":"")+(R.value===s?" is-on":""),onMouseEnter:()=>C(W),onClick:()=>B(R),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:R.displayName}),R.description&&a.jsx("span",{className:"select__hint",children:R.description})]},R.value)),H.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:H.map(R=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===r,className:R===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(R),children:R},R))})]}),q&&a.jsx(fp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),(Y==null?void 0:Y.supportsThinking)!==!1&&a.jsx(fp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(fp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:f,onToggle:()=>v(!f)})]})]})}function fp({label:l,desc:s,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:[l,a.jsx("span",{className:"modelmenu__desc",children:s})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function oN(){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 bl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:f}){const h=b.useRef(null);return b.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),f();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const y=x.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)},[f]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&f()},children:a.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":l,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:l}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:f,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:s}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function uN({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:f,created:h,onSearch:m,onAskAgent:g,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[T,S]=b.useState("open"),[A,C]=b.useState(""),[J,le]=b.useState(!1),[Y,H]=b.useState(""),[q,B]=b.useState(""),[M,R]=b.useState({git:!0,claudeMd:!0,readme:!0}),W=A.trim(),oe=W!=="",G=Y.trim(),Z=q.trim(),ge=G!==""&&Z!=="";b.useEffect(()=>{Y===""&&f.length>0&&H(f[0])},[f]);const ye=b.useRef(m);ye.current=m,b.useEffect(()=>{if(T!=="open")return;const V=A.trim(),pe=setTimeout(()=>ye.current(V),200);return()=>clearTimeout(pe)},[A,T]);function Ne(){oe&&y(W)}function z(){ge&&j(G,Z,M)}function I(){oe&&(le(!0),g(W))}return h?a.jsxs(bl,{title:"Новый проект",onClose:v,actions:a.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:h.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(V=>a.jsx("li",{children:V},V))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(bl,{title:"Новый проект",className:J&&T==="open"?"modal--wide":void 0,onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),T==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!oe,onClick:I,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!oe,onClick:Ne,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!ge,onClick:z,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(t_,{label:"Открыть",on:T==="open",onClick:()=>S("open")}),a.jsx(t_,{label:"Создать",on:T==="create",onClick:()=>S("create")})]}),T==="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:A,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:V=>C(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),Ne())}}),o&&a.jsx("p",{className:"modal__error",children:o}),l.length>0&&a.jsx("ul",{className:"finds",children:l.map(V=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:V.open,title:V.open?"Этот проект уже открыт":V.path,onClick:()=>C(V.path),onDoubleClick:()=>y(V.path),children:[a.jsx("span",{className:"find__name",children:V.name}),a.jsx("span",{className:"find__path",children:V.path}),a.jsx("span",{className:"find__note",children:hN(V)})]})},V.path))}),l.length===0&&oe&&!s&&!J&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),J&&a.jsx("div",{className:"finds__agent",children:a.jsx(Jp,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",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:V=>H(V.target.value)}),f.length>0&&a.jsx("div",{className:"newproj__roots",children:f.map(V=>a.jsx("button",{type:"button",className:V===G?"newproj__root is-on":"newproj__root",title:V,onClick:()=>H(V),children:dN(V)},V))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:q,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:V=>B(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),z())}}),a.jsx("p",{className:"newproj__preview",children:ge?fN(G,Z):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(dp,{label:"git init",desc:"панель истории работает сразу",on:M.git,onToggle:()=>R(V=>({...V,git:!V.git}))}),a.jsx(dp,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:M.claudeMd,onToggle:()=>R(V=>({...V,claudeMd:!V.claudeMd}))}),a.jsx(dp,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:M.readme,onToggle:()=>R(V=>({...V,readme:!V.readme}))})]})]})]})}function t_({label:l,on:s,onClick:r}){return a.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function dp({label:l,desc:s,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:[l,a.jsx("span",{className:"newproj__optdesc",children:s})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function fN(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function dN(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function hN(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${pN(l.sessions)}${mN(l.lastUsedAt)}`}function pN(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function mN(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Wp=7;function gN(l){const s=[],r=[];let c=1;for(const o of l){const f=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=n_(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const v of g){let T=s.indexOf(v);T===-1&&(T=n_(s),s[T]=v),x.push({from:h,to:T})}const y=[];for(let v=0;v<f.length;v++)f[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(s[v]=null));const j=[];for(let v=0;v<f.length;v++){const T=f[v];!T||T===o.hash||v===h||s[v]===T&&j.push(v)}xN(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:r,columns:Math.min(c,Wp)}}function n_(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function xN(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const Ey=1500;function bN(l){const s=[];let r=!1;for(const c of l.patch.split(`
119
- `)){if(s.length>=Ey){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:_N(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:yN(l,r)}}function _N(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),f=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${f} · ${o}`:`⋯ ${f}`}function yN(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${Ey} строк`),r.length>0?r.join(" · "):null}function vN({open:l,state:s,result:r,selected:c,busy:o,onRefresh:f,onShow:h,onCheckout:m,onPush:g,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:T,zoomed:S,onToggleZoom:A}){const C=gN((s==null?void 0:s.commits)??[]),J=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(le=>({value:le.name,label:le.name,hint:le.hash.slice(0,8)}))];return a.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(S?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{A&&(le.target.closest("button")||A())},children:[a.jsx(EN,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:f,children:"↻"}),A&&a.jsx("button",{className:"sidepane__btn",title:S?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":S?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":S,onClick:A,children:a.jsx(Kc,{active:S})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:T,children:"✕"})]}),s===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Hs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:J,onChange:le=>{le&&m(le,`ветку ${le}`)}}),a.jsx(Vc,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.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(MN,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(TN,{}),"Отправить",s.ahead>0&&a.jsx("span",{className:"gitbar__count",children:s.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[a.jsx(CN,{}),"Забрать",s.behind>0&&a.jsx("span",{className:"gitbar__count",children:s.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:a.jsx(AN,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(s_,{}),"Опубликовать на 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:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${LN(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(le=>ON(le.path)).join(", "):"незакоммиченных изменений нет"})]})}),C.rows.map(le=>a.jsx(wN,{row:le,columns:C.columns,head:le.commit.hash===s.head,local:s.hasRemote&&!le.commit.pushed,active:c===le.commit.hash,onOpen:()=>h(le.commit.hash)},le.commit.hash)),C.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(s_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Rr,{result:r,onDismiss:v})]})}const eu=50,l_=13,jN=500;function wN({row:l,columns:s,head:r,local:c,active:o,onOpen:f}){const{commit:h}=l,m=h.refs.map(RN).filter(Boolean),[g,x]=b.useState(null),y=b.useRef(null);function j(A){const C=A.touches[0];if(!C)return;const J={timer:0,x:C.clientX,y:C.clientY,fired:!1};J.timer=window.setTimeout(()=>{J.fired=!0,x({x:J.x,y:J.y})},jN),y.current=J}function v(A){const C=y.current,J=A.touches[0];!C||!J||Math.hypot(J.clientX-C.x,J.clientY-C.y)>10&&(window.clearTimeout(C.timer),y.current=null)}function T(A){const C=y.current;C&&(window.clearTimeout(C.timer),C.fired&&A.preventDefault())}function S(){const A=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void pa(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void pa(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void pa(h.subject)}],C=new Set;for(const J of h.refs){const le=J.startsWith("tag: "),Y=DN(J);!Y||C.has(Y)||(C.add(Y),A.push({id:`ref:${Y}`,label:le?"Копировать тег":"Копировать ветку",hint:Y,onSelect:()=>void pa(Y)}))}return A}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var A;if((A=y.current)!=null&&A.fired){y.current=null;return}f()},onContextMenu:A=>{A.preventDefault(),x({x:A.clientX,y:A.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:T,onTouchCancel:T,children:[a.jsx(SN,{row:l,columns:s,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(A=>a.jsx("span",{className:"gitrow__ref",children:A},A)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",zN(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(Ui,{x:g.x,y:g.y,items:S(),onClose:()=>x(null)})]})}function SN({row:l,columns:s,head:r,local:c}){const o=s*l_+6,f=eu/2,h=x=>8+Math.min(x,Wp-1)*l_,m=c?"3.5 2.5":void 0,g=Bf(l.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:eu,viewBox:`0 0 ${o} ${eu}`,"aria-hidden":"true",children:[l.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:eu,style:{stroke:Bf(x)}},`t${x}`)),l.up.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${f-12} L${h(x.to)} ${f}`,fill:"none",style:{stroke:Bf(x.from),strokeDasharray:m}},`u${y}`)),l.down.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} ${f} L${h(x.to)} ${f+12} L${h(x.to)} ${eu}`,fill:"none",style:{stroke:Bf(x.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:f,r:l.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:f,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Bf(l){return`var(--lane-${l%Wp})`}function NN({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return a.jsxs(bl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.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:l.subject}),a.jsx(Vc,{text:l.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",UN(l.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:l.hash}),a.jsx(Vc,{text:l.hash,hint:"хеш коммита"})]}),s&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(f=>f.slice(0,8)).join(", ")]}),l.body&&a.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(f=>a.jsx(kN,{file:f,defaultOpen:l.files.length<=3},f.path+f.oldPath))]})}function kN({file:l,defaultOpen:s}){const[r,c]=b.useState(s);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:l.path||l.oldPath}),a.jsxs("span",{className:"diff__stat",children:[l.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),a.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&a.jsx(Fp,{diff:bN(l)})]})}function EN(){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 TN(){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 CN(){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 AN(){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 s_(){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 MN(){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 RN(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function DN(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function ON(l){const s=l.split("/");return s[s.length-1]??l}function LN(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function zN(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(s).toLocaleDateString()}function UN(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function a_(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function HN({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:f,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:x,onDismissResult:y,onClose:j}){var V;const[v,T]=b.useState(()=>a_(c)),[S,A]=b.useState(""),[C,J]=b.useState(""),[le,Y]=b.useState(!0),[H,q]=b.useState("Первый коммит"),[B,M]=b.useState(null),[R,W]=b.useState("");b.useEffect(()=>{!S&&s.length>0&&A(s[0].login)},[S,s]),b.useEffect(()=>{r&&B===null&&M(new Set(r.files))},[r,B]);const oe=(l==null?void 0:l.connected)===!0,G=s.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),Z=b.useMemo(()=>{if(!r)return[];const pe=R.trim().toLowerCase();return pe?r.files.filter(Se=>Se.toLowerCase().includes(pe)):r.files},[r,R]),ge=(B==null?void 0:B.size)??0,ye=oe&&v.trim()!==""&&S!==""&&f===""&&(o||ge>0);function Ne(pe){M(Se=>{const N=new Set(Se??[]);return N.has(pe)?N.delete(pe):N.add(pe),N})}function z(pe){M(Se=>{const N=new Set(Se??[]);for(const ee of Z)pe?N.add(ee):N.delete(ee);return N})}function I(){if(!ye)return;const pe=(r==null?void 0:r.files)??[];x({owner:S,name:v.trim(),description:C.trim(),private:le,include:o?[]:pe.filter(Se=>B==null?void 0:B.has(Se)),ignore:o?[]:pe.filter(Se=>!(B!=null&&B.has(Se))),message:o?"":H.trim()||"Первый коммит"})}return a.jsxs(bl,{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:!ye,onClick:I,children:f||"Опубликовать"})]}),children:[a.jsx(BN,{status:l,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=>T(a_(pe.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),s.length>1?a.jsx(Hs,{className:"settings__select",value:S,options:G,onChange:A,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((V=s[0])==null?void 0:V.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:C,placeholder:"о чём проект — одной строкой",onChange:pe=>J(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(i_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:le,onClick:()=>Y(!0)}),a.jsx(i_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!le,onClick:()=>Y(!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:[ge," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>z(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>z(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:R,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>W(pe.target.value)}),a.jsx("div",{className:"publish__filelist",children:Z.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):Z.map(pe=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(B==null?void 0:B.has(pe))===!0,className:"publish__file",onClick:()=>Ne(pe),children:[a.jsx("span",{className:"publish__box"+(B!=null&&B.has(pe)?" is-on":""),"aria-hidden":"true",children:(B==null?void 0:B.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:H,onChange:pe=>q(pe.target.value)})]})]})]}),a.jsx(Rr,{result:h,onDismiss:y})]})}function i_({title:l,desc:s,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:[l,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:s})]})]})}function BN({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=b.useState(""),[f,h]=b.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:l.login}),a.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[l.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(IN,{value:c,onChange:o,visible:f,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 ↗"})]}),l.message&&a.jsx("p",{className:"modal__error",children:l.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function IN({value:l,onChange:s,visible:r,onToggleVisible:c,placeholder:o,autoFocus:f}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:f,onChange:h=>s(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(GN,{}):a.jsx(qN,{})})]})}function qN(){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 GN(){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 $N({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[f,h]=b.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(f.trim())||/^[\w.-]+@[\w.-]+:.+/.test(f.trim());return a.jsxs(bl,{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||l!=="",onClick:()=>r(f.trim()),children:l||"Подключить"})]}),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:f,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&l===""&&r(f.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(Rr,{result:s,onDismiss:c})]})}function YN({open:l,items:s,busy:r,ready:c,sendBlocked:o,commands:f,contextResult:h,draftKey:m,models:g,model:x,effort:y,ultracode:j,thinking:v,switchOnFlag:T,onContextSearch:S,onCommand:A,onModel:C,onEffort:J,onUltracode:le,onThinking:Y,onSwitchOnFlag:H,onAsk:q,onInterrupt:B,onReset:M,onClose:R,zoomed:W,onToggleZoom:oe}){return a.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(W?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:G=>{oe&&(G.target.closest("button")||oe())},children:[a.jsx(XN,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:M,children:"↻"}),oe&&a.jsx("button",{className:"sidepane__btn",title:W?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":W?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":W,onClick:oe,children:a.jsx(Kc,{active:W})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:R,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(ky,{className:"select--compact",models:g,value:x,effort:y,ultracode:j,thinking:v,switchOnFlag:T,onModel:C,onEffort:J,onUltracode:le,onThinking:Y,onSwitchOnFlag:H}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(Jp,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(jy,{className:"composer--side",disabled:!c,busy:r,commands:f,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:S,onCommand:A,onSend:q,onInterrupt:B,onEscape:r?B:R})]})}function XN(){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 VN=75,QN=90;function Ty({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return a.jsx("div",{className:"usage",title:FN(l,s),"aria-label":c,children:r.map(o=>a.jsx(KN,{label:o.label,window:o.window},o.key))})}function KN({label:l,window:s}){const r=Math.round(s.utilization),c=PN(s.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:l}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${ZN(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:em(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function ZN(l){return l>=QN?" usage__fill--over":l>=VN?" usage__fill--warn":""}function FN(l,s){if(s.length>0)return JN(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,f)=>{if(!f)return;const h=em(f.resetsAt);r.push(`${o}: ${Math.round(f.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
120
- `)}function JN(l){const s=["Квота Antigravity"];for(const r of l){const c=em(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
121
- `)}function Cy(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function Ay(l){return l.getTime()-Date.now()<1440*60*1e3}function PN(l){const s=Cy(l);return s?Ay(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function em(l){const s=Cy(l);return s?`обнулится ${Ay(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function My(){const[l,s]=b.useState(()=>new Date);return b.useEffect(()=>{let r=0;const c=()=>{const f=new Date;s(f),r=window.setTimeout(c,6e4-(f.getSeconds()*1e3+f.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:l.toISOString(),title:WN(l),children:[a.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function WN(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function ek({onClose:l,permission:s,model:r,account:c,usage:o,cwd:f,costLabel:h,onRefresh:m,refreshing:g,metersFetchedAt:x,onRename:y,onHandoff:j,onFreshSession:v,handoffWriting:T,onStop:S}){const A=I_({onLongPress:()=>v==null?void 0:v(),onClick:()=>j==null?void 0:j(),disabled:T});return a.jsx(bl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:a.jsxs("div",{className:"sessionmenu",children:[s&&a.jsx(br,{label:"Режим прав",children:s}),a.jsx(br,{label:"Модель",children:r}),c&&a.jsx(br,{label:"Аккаунт",children:c}),(o==null?void 0:o.available)&&(o.fiveHour||o.sevenDay||o.buckets&&o.buckets.length>0)&&a.jsx(br,{label:"Лимиты плана",children:a.jsx(Ty,{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(tk,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",x&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(x).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(br,{label:"Время",children:a.jsx(My,{})}),h&&a.jsx(br,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:h})}),f&&a.jsx(br,{label:"Каталог проекта",children:a.jsx(Ny,{path:f})}),y&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:y,children:"Переименовать сессию"}),j&&a.jsxs("button",{type:"button",className:T?"sessionmenu__handoff is-busy":A.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${A.thresholdMs}ms`},"aria-busy":T,disabled:T,...A.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[T?"Пишется хэндофф…":"Хэндофф и новая сессия",!T&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),S&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:S,children:"Остановить сессию"})]})})}function br({label:l,children:s}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function tk(){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 nk({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:f,auth:h,remote:m,actions:g,onTab:x,onClose:y}){const j=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(bl,{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":l===v.id,className:l===v.id?"tabs__tab is-on":"tabs__tab",onClick:()=>x(v.id),children:[v.label,a.jsx("span",{className:"tabs__count",children:v.count})]},v.id))}),l==="mcp"&&a.jsx(lk,{servers:s,auth:h,remote:m,actions:g}),l==="plugins"&&a.jsx(ok,{plugins:r,marketplaces:c,actions:g}),l==="catalog"&&a.jsx(uk,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(Rr,{result:f})]})}function lk({servers:l,auth:s,remote:r,actions:c}){const[o,f]=b.useState(!1);return a.jsxs(a.Fragment,{children:[l.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:l.map(h=>{const m=(s==null?void 0:s.name)===h.name?s:null,g=m!==null&&m.active&&m.url==="",x=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--${ik(h.status)}`,children:ak[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:x?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":x?"Начать заново":"Авторизовать"}),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(sk,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(rk,{onCancel:()=>f(!1),onSubmit:(h,m)=>{c.mcpAdd(h,m),f(!1)}}):a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn btn--primary",onClick:()=>f(!0),children:"+ Сервер"})})]})}function sk({auth:l,remote:s,actions:r}){const[c,o]=b.useState("");function f(){const g=c.trim();g!==""&&(r.mcpAuthCallback(l.name,g),o(""))}if(!l.active)return l.error?a.jsx("div",{className:"extlist__error",children:l.error}):l.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:[s&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${l.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${l.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(),f())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:f,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:s?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=l.callbackExpected&&(s?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[l.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:l.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!s&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,l.error&&a.jsx("div",{className:"extlist__error",children:l.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const ak={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function ik(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function rk({onSubmit:l,onCancel:s}){const[r,c]=b.useState(""),[o,f]=b.useState("stdio"),[h,m]=b.useState(""),[g,x]=b.useState(""),[y,j]=b.useState(""),v=o==="stdio",T=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function S(){if(T)if(v){const[A,...C]=ck(h);l(r.trim(),{transport:"stdio",command:A??"",args:C,env:r_(y)})}else l(r.trim(),{transport:o,url:g.trim(),headers:r_(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:A=>c(A.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Hs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:A=>f(A)}),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:A=>m(A.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:A=>x(A.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:A=>j(A.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!T,onClick:S,children:"Подключить"})]})]})}function r_(l){const s={};for(const r of l.split(`
122
- `)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),f=c.indexOf(":"),h=o===-1?f:f===-1?o:Math.min(o,f);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function ck(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function ok({plugins:l,marketplaces:s,actions:r}){const[c,o]=b.useState("");return a.jsxs(a.Fragment,{children:[l.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:l.map(f=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:f.name}),a.jsx("span",{className:f.enabled?"chip chip--ok":"chip chip--mute",children:f.enabled?"включён":"выключен"}),f.version&&f.version!=="unknown"&&a.jsx("span",{className:"chip",children:f.version}),f.scope&&a.jsx("span",{className:"chip",children:f.scope})]}),f.marketplace&&a.jsx("div",{className:"extlist__meta",children:f.marketplace}),f.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",f.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(f.id,!f.enabled),children:f.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(f.id),children:"Удалить"})]})]},f.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:s.map(f=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:f.name})}),f.source&&a.jsx("div",{className:"extlist__meta",children:f.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(f.name),children:"Отключить"})})]},f.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:f=>o(f.target.value),onKeyDown:f=>{f.key!=="Enter"||c.trim()===""||(f.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const tu=30;function uk({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,f]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(tu),[y,j]=b.useState(""),v=b.useMemo(()=>[...new Set(l.map(A=>A.category).filter(Boolean))].sort(),[l]),T=b.useMemo(()=>{const S=o.trim().toLowerCase();return l.filter(A=>h&&A.category!==h?!1:S?`${A.name} ${A.displayName} ${A.description} ${A.author}`.toLowerCase().includes(S):!0)},[l,o,h]);return l.length===0?a.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",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:S=>{f(S.target.value),x(tu)}}),a.jsx(Hs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(S=>({value:S,label:S}))],onChange:S=>{m(S),x(tu)}})]}),T.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:T.slice(0,g).map(S=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:S.name}),S.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),S.version&&a.jsx("span",{className:"chip",children:S.version}),S.category&&a.jsx("span",{className:"chip",children:S.category})]}),S.description&&a.jsx("div",{className:"catalog__desc",children:S.description}),a.jsxs("div",{className:"extlist__meta",children:[S.author&&`${S.author} · `,S.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:S.installed,onClick:()=>r.pluginInstall(S.id),children:S.installed?"Уже стоит":"Установить"}),S.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:S.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},S.id))}),T.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(S=>S+tu),children:["Ещё ",Math.min(tu,T.length-g)," из ",T.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:S=>j(S.target.value),onKeyDown:S=>{S.key!=="Enter"||y.trim()===""||(S.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function fk({accounts:l,auth:s,logins:r,actions:c,remote:o,runningByAccount:f,activeAccountId:h,error:m,onReconnect:g,reconnectBlocked:x,reconnectHint:y,onClose:j}){const v=l.length>1,[T,S]=b.useState(!1),A=b.useRef(l.length);return b.useEffect(()=>{l.length>A.current&&S(!1),A.current=l.length},[l.length]),a.jsxs(bl,{title:v?"Аккаунты":"Аккаунт",className:"modal--accounts",onClose:j,children:[l.map(C=>a.jsx(hk,{account:C,multi:v,status:s[C.id]??null,login:r[C.id]??dk,actions:c,remote:o,running:f[C.id]??0,takenColors:l.filter(J=>J.id!==C.id).map(J=>J.color),onReconnect:C.id===h?g:null,reconnectBlocked:x,reconnectHint:y},C.id)),m&&a.jsx("p",{className:"account__warn",role:"alert",children:m}),T?a.jsx(mk,{accounts:l,onAdd:c.add,onCancel:()=>S(!1)}):a.jsx("button",{type:"button",className:"btn account__add",onClick:()=>S(!0),children:"+ Добавить аккаунт"})]})}const dk={active:!1,url:"",awaitingCode:!1,output:"",error:null};function hk({account:l,multi:s,status:r,login:c,actions:o,remote:f,running:h,takenColors:m,onReconnect:g,reconnectBlocked:x,reconnectHint:y}){const[j,v]=b.useState(""),[T,S]=b.useState(!1),[A,C]=b.useState(!1),[J,le]=b.useState(!1),[Y,H]=b.useState(!1),q=l.id,B=g!==null&&(r==null?void 0:r.loggedIn)===!0&&!A&&!T,M=b.useMemo(()=>{if(c.error)return{ok:!1,message:c.error};const ge=c.output.trim();return ge===""?null:{ok:!0,message:ge}},[c.error,c.output]);function R(ge=j){const ye=ge.trim();ye!==""&&(o.submitCode(q,ye),v(""))}function W(){if(h>0){S(!1),C(!0);return}o.login(q,"claudeai",!0)}const oe=!s,G=!l.main,Z=l.liveSessions>0;return a.jsxs("section",{className:`acctcard acct--${l.color}${oe?" acctcard--single":""}`,"aria-label":s?`Аккаунт «${l.name}»`:void 0,children:[s&&a.jsxs("header",{className:"acctcard__head",children:[a.jsx(pu,{account:l,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:l.name}),l.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),!Y&&!c.active&&a.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>H(!0),"aria-label":`Изменить имя и цвет аккаунта «${l.name}»`,children:"Изменить"})]}),Y?a.jsx(pk,{account:l,takenColors:m,onSave:ge=>{o.update(q,ge),H(!1)},onCancel:()=>H(!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:bk[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})]}):s?a.jsx("p",{className:"modal__text",children:"Вход не выполнен. Сессии этого аккаунта не запустятся, пока вы в него не войдёте."}):a.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",a.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s&&a.jsx("div",{className:"acctcard__dir",title:"Каталог конфигурации: вход, тариф, лимиты и транскрипты этого аккаунта",children:l.configDir??"Каталог конфигурации хоста по умолчанию"}),c.active?a.jsx(_k,{login:c,remote:f,code:j,onCode:v,onSubmit:R,onCancel:()=>o.cancel(q),inputId:`auth-code-${q}`}):a.jsxs(a.Fragment,{children:[a.jsx(Rr,{result:M}),A&&a.jsx("p",{className:"account__warn",role:"alert",children:gk(h)}),B&&x&&a.jsx("p",{className:"account__note",children:y}),!Y&&a.jsx("div",{className:`extbar${r!=null&&r.loggedIn?" account__bar":""}`,children:r!=null&&r.loggedIn?a.jsxs(a.Fragment,{children:[B&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
- ${y}`,"aria-label":"Переподключить сессию",disabled:x,onClick:g??void 0,children:[a.jsx(xk,{}),"Переподключить"]}),A?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>C(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{C(!1),o.login(q,"claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:W,children:"Сменить аккаунт"}),T?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{S(!1),o.logout(q)},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{C(!1),S(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>o.login(q,"console",!1),children:"Через Console"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>o.login(q,"claudeai",!1),children:"Войти"})]})}),G&&!Y&&a.jsx("div",{className:"acctcard__remove",children:Z?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",disabled:!0,children:"Удалить аккаунт"}),a.jsx("span",{className:"account__note acctcard__why",children:`Сначала закройте сессии этого аккаунта (${l.liveSessions}).`})]}):J?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>le(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>o.remove(q),children:"Точно удалить?"}),a.jsx("span",{className:"account__note acctcard__why",children:"Из списка пропадёт только аккаунт — каталог с его данными останется на диске."})]}):a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",onClick:()=>le(!0),children:"Удалить аккаунт"})})]})]})}function Ry({value:l,taken:s,onChange:r}){function c(o){const f=o.key==="ArrowRight"||o.key==="ArrowDown"?1:o.key==="ArrowLeft"||o.key==="ArrowUp"?-1:0;if(f===0)return;o.preventDefault();const h=yr.indexOf(l),m=yr[(h+f+yr.length)%yr.length];if(m){r(m);const g=o.currentTarget;window.requestAnimationFrame(()=>{var x;return(x=g.querySelector(`[data-color="${m}"]`))==null?void 0:x.focus()})}}return a.jsx("div",{className:"colorpick",role:"radiogroup","aria-label":"Цвет аккаунта",onKeyDown:c,children:yr.map(o=>{const f=o===l;return a.jsx("button",{type:"button",role:"radio","aria-checked":f,"aria-label":Yf[o],title:s.includes(o)?`${Yf[o]} — уже у другого аккаунта`:Yf[o],"data-color":o,tabIndex:f?0:-1,className:`colorpick__item acct--${o}${f?" is-selected":""}`,onClick:()=>r(o),children:f&&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 Dy=40;function pk({account:l,takenColors:s,onSave:r,onCancel:c}){const[o,f]=b.useState(l.name),[h,m]=b.useState(l.color),g=o.trim(),x=g!==l.name||h!==l.color;function y(j){j.preventDefault(),!(g===""||!x)&&r({...g!==l.name?{name:g}:{},...h!==l.color?{color:h}:{}})}return a.jsxs("form",{className:"extform acctform",onSubmit:y,children:[a.jsx("label",{className:"field",htmlFor:`acct-name-${l.id}`,children:"Имя"}),a.jsx("input",{id:`acct-name-${l.id}`,className:"input",value:o,maxLength:Dy,autoFocus:!0,autoComplete:"off",onChange:j=>f(j.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(Ry,{value:h,taken:s,onChange:m}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:c,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:g===""||!x,children:"Сохранить"})]})]})}function mk({accounts:l,onAdd:s,onCancel:r}){const c=l.map(S=>S.color),[o,f]=b.useState(""),[h,m]=b.useState(()=>yr.find(S=>!c.includes(S))??yr[1]),[g,x]=b.useState(""),[y,j]=b.useState(!0),v=o.trim();function T(S){S.preventDefault(),v!==""&&s(v,h,g.trim()===""?null:g.trim(),y)}return a.jsxs("form",{className:"extform extform--card acctform",onSubmit:T,children:[a.jsx("label",{className:"field",htmlFor:"acct-new-name",children:"Название аккаунта"}),a.jsx("input",{id:"acct-new-name",className:"input",value:o,maxLength:Dy,placeholder:"Например, Работа",autoFocus:!0,autoComplete:"off",onChange:S=>f(S.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(Ry,{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:S=>x(S.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:S=>j(S.target.checked)}),a.jsxs("span",{children:["Общие скиллы, агенты, хуки, команды, плагины, настройки и CLAUDE.md",a.jsxs("span",{className:"account__step acctform__checkhint",children:["Аккаунт получит ссылки на общую папку ",a.jsx("code",{children:"~/.claude-shared"}),", а не копии. Вход, лимиты, переписка и MCP-серверы из ",a.jsx("code",{children:".claude.json"})," остаются отдельными. Внимание: настройки (модель, разрешения, хуки) и данные плагинов, включая то, что плагины хранят (например, токены), станут общими с другими аккаунтами."]})]})]}),a.jsxs("p",{className:"account__step",children:[y?"Новый аккаунт начнётся с общей конфигурации.":"Новый аккаунт начнётся с чистого листа: свои настройки, плагины и CLAUDE.md."," ","Сразу после добавления в него нужно войти отдельно."]}),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 gk(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function xk(){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 bk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function _k({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:f,inputId:h}){var A;const[m,g]=b.useState(null),x=b.useRef(""),y=b.useRef({code:r,onCode:c,onSubmit:o});y.current={code:r,onCode:c,onSubmit:o};const j=b.useCallback(async C=>{const{code:J,onCode:le,onSubmit:Y}=y.current;if(C&&J.trim()!=="")return;const H=await Cp();if(H===null){C||g("Не получилось прочитать буфер — вставьте код в поле руками.");return}const q=H.trim();if(!c_(q)){C||g("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(x.current===q)return;x.current=q}g(null),le(q),Y(q)},[]);b.useEffect(()=>{if(!l.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&j(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[l.awaitingCode,j]);const v=typeof((A=navigator.clipboard)==null?void 0:A.readText)=="function",T=r.trim()!==""&&!c_(r),S=m??(T?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[l.url?s?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:l.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:l.url}),a.jsx(Vc,{text:l.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:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.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:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:C=>{g(null),c(C.target.value)},onKeyDown:C=>{C.key==="Enter"&&(C.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:"Готово"})]}),S&&a.jsx("p",{className:"account__note account__note--code",children:S})]}),l.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:l.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:f,children:"Отменить вход"})})]})}function c_(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function yk({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,f]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(!1),y=b.useRef(null),j=(l==null?void 0:l.paired)===!0;b.useEffect(()=>{var T;j||(T=y.current)==null||T.focus()},[j]),b.useEffect(()=>{x(!1),j&&f("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return a.jsx(bl,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:o_(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&a.jsx("p",{className:"relay__error",children:l.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:o_(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:T=>{T.preventDefault(),o.trim()&&(x(!0),s(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:T=>f(T.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:T=>m(T.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&a.jsx("p",{className:"relay__error",children:l.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function o_(l){try{return new URL(l).host}catch{return l}}const u_=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],hp="",vk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],jk=z_.map(l=>({value:l.value,label:l.value,hint:l.hint})),If=3600*1e3,wk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Rc={"6h":6*If,"24h":24*If,"48h":48*If,"168h":168*If,never:0};function Sk(l){return Rc[l]??Rc["48h"]}const Nk=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],qf=60*1e3,Dc={"5m":5*qf,"10m":10*qf,"30m":30*qf,"60m":60*qf,never:0};function kk(l){return Dc[l]??Dc["10m"]}function Ek(l){const s=Object.entries(Dc).find(([,r])=>r===l);return s?s[0]:Object.keys(Dc).reduce((r,c)=>Math.abs(Dc[c]-l)<Math.abs(Dc[r]-l)?c:r)}function Tk(l){const s=Object.entries(Rc).find(([,r])=>r===l);return s?s[0]:Object.keys(Rc).reduce((r,c)=>Math.abs(Rc[c]-l)<Math.abs(Rc[r]-l)?c:r)}const Ck=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Oc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Ak(l){return Oc[l]??Oc.off}function f_(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function Mk(l){const s=Object.entries(Oc).find(([,r])=>r===l);return s?s[0]:Object.keys(Oc).reduce((r,c)=>Math.abs(Oc[c]-l)<Math.abs(Oc[r]-l)?c:r)}const Rk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Dk({settings:l,models:s,relayState:r,networkState:c,local:o,onChange:f,onEnableShell:h,onDisableShell:m,onOpenRelay:g,onClose:x}){const y=l===null,[j,v]=b.useState(""),[T,S]=b.useState(null),A=!y&&l.networkGuardEnabled,C=(l==null?void 0:l.networkGuardBlockedCountries)??[];function J(){const M=j.trim().toUpperCase();if(M!==""){if(!/^[A-Z]{2}$/.test(M)){S("Нужен код из двух латинских букв, например RU или CN.");return}if(C.includes(M)){S(`Код ${M} уже в списке.`);return}S(null),v(""),f({networkGuardBlockedCountries:[...C,M]})}}const le=!y&&l.terminalEnabled===!0,Y=!y&&l.liveSessionsFirst===!0,H=!le,q=b.useMemo(()=>{const M=[{value:hp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(R=>({value:R.value,label:R.displayName,hint:R.description})):vk];return l&&l.startModel!==null&&!M.some(R=>R.value===l.startModel)&&M.push({value:l.startModel,label:l.startModel}),M},[s,l]);function B(){var M,R;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:H,onClick:g,children:"Связать компьютер"})]}):(M=r.shell)!=null&&M.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:H,onClick:m,children:"Запретить"})]}):(R=r.shell)!=null&&R.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:H,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:H,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(bl,{title:"Настройки",onClose:x,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:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Hs,{className:"settings__select",value:Tk(l.autoArchiveAfterMs),options:wk,onChange:M=>f({autoArchiveAfterMs:Sk(M)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Hs,{className:"settings__select",value:Ek(l.autoStopAfterMs),options:Nk,onChange:M=>f({autoStopAfterMs:kk(M)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),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-часового лимита, %"}),y?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:l.limitStopFiveHourPct,onChange:M=>f({limitStopFiveHourPct:f_(M.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:"Остановка у недельного лимита, %"}),y?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:l.limitStopSevenDayPct,onChange:M=>f({limitStopSevenDayPct:f_(M.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-клиента это не заменяет — его тоже стоит включить."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":A,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:A?"switch is-on":"switch",onClick:()=>f({networkGuardEnabled:!A}),children:a.jsx("span",{className:"switch__knob"})})]}),A&&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:A?"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:[C.map(M=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:M}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${M} из списка`,disabled:!A,onClick:()=>f({networkGuardBlockedCountries:C.filter(R=>R!==M)}),children:"×"})]},M)),C.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:M=>{M.preventDefault(),J()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:j,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!A,"aria-label":"Код страны, две буквы","aria-invalid":T!==null,onChange:M=>{v(M.target.value.toUpperCase()),S(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!A||j.trim()==="",children:"Добавить"})]}),T&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:T})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Hs,{className:"settings__select",value:Mk(l.autoSaveAfterPauseMs),options:Ck,onChange:M=>f({autoSaveAfterPauseMs:Ak(M)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),u_.map(M=>{const R=(l==null?void 0:l.enabledProviders)??["claude","antigravity"],W=!y&&R.includes(M.id),oe=W&&R.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${M.id}`,"aria-hidden":"true",children:M.id==="antigravity"?a.jsx(Kp,{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:M.label}),a.jsx("span",{className:"settings__hint",children:oe?"Хотя бы один агент должен остаться включённым":M.hint})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":W,"aria-label":M.label,disabled:oe,title:oe?"Хотя бы один агент должен остаться включённым":void 0,className:W?"switch is-on":"switch",onClick:()=>{const G=u_.map(Z=>Z.id).filter(Z=>Z===M.id?!W:R.includes(Z));f({enabledProviders:G})},children:a.jsx("span",{className:"switch__knob"})})]},M.id)})]}),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:"Модель"}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Hs,{className:"settings__select",value:l.startModel??hp,options:q,onChange:M=>f({startModel:M===hp?null:M}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Hs,{className:"settings__select",value:l.startPermissionMode,options:jk,onChange:M=>f({startPermissionMode:M}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Y,"aria-label":"Запущенные сессии сверху",className:Y?"switch is-on":"switch",onClick:()=>f({liveSessionsFirst:!Y}),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:Rk.map(M=>{const R=!y&&l.folderAccess===M.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":R,disabled:y,className:"access__card"+(R?" is-on":"")+(M.risky?" access__card--risky":""),onClick:()=>f({folderAccess:M.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:[M.title,M.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:M.description})]})]},M.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":le,"aria-label":"Терминал",className:le?"switch is-on":"switch",onClick:()=>f({terminalEnabled:!le}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(H?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),y?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[H&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),B()]})]})]})]})})}const d_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Ok(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function Lk({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${d_[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.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(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.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("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}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:[l.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[d_[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",Ok(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,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:"Скрыть"})]})]})}function zk({handoff:l,onClose:s}){const[r,c]=b.useState("");return b.useEffect(()=>{let o=!1;return pd(l.text).then(f=>{o||c(f)}),()=>{o=!0}},[l.text]),a.jsx(bl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function Uk({state:l}){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:l.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const od={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Hk=12e3;function Bk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function Ik({notices:l,onDismiss:s}){return l.length===0?null:a.jsx("div",{className:"limittoasts",children:l.map(r=>a.jsx(qk,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function qk({notice:l,onDismiss:s}){return b.useEffect(()=>{const r=window.setTimeout(s,Hk);return()=>window.clearTimeout(r)},[s]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:l.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",od[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",Bk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",od[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}function Gk(l,s,r=Date.now()){if(!l||!l.available||!s)return null;const c=[["fiveHour",l.fiveHour,s.limitStopFiveHourPct],["sevenDay",l.sevenDay,s.limitStopSevenDayPct]];for(const[o,f,h]of c){if(!f||h<=0||f.utilization<h)continue;const m=Date.parse(f.resetsAt);if(!(!Number.isFinite(m)||m<=r))return{limit:o,utilization:f.utilization,resetsAt:m}}return null}function $k(l,s=Date.now()){const r=new Date(l),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(s).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const Yk=16;function Xk({pane:l,width:s,onResize:r,onReset:c}){const o=Er[l],f=b.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-Dv):0;f.current={x:y.clientX,width:s,max:Math.min(o.max,s+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=f.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){f.current&&(f.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function x(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(s+j*Yk*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:x,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Vk=16;function Qk({height:l,onResize:s,onReset:r}){const c=b.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-Uv;return Math.round(l+Math.max(0,y))}function f(x){x.button===0&&(c.current={y:x.clientY,height:l,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const y=c.current;if(!y)return;const j=y.y-x.clientY;s(y.height+j,y.max)}function m(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),s(l+y*Vk,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":B_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:f,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function h_(){const l=document.documentElement,s=getComputedStyle(l),r=le=>s.getPropertyValue(le).trim(),c=r("--surface"),o=r("--text"),f=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),x=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),T=r("--cm-fn"),S=r("--cm-key"),A=r("--cm-type"),C=p_(o,c,55),J=le=>p_(le,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:C,brightBlack:h,red:y,brightRed:J(y),green:j,brightGreen:J(j),yellow:v,brightYellow:J(v),blue:T,brightBlue:J(T),magenta:S,brightMagenta:J(S),cyan:A,brightCyan:J(A),white:f,brightWhite:o}}function Kk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ia=null;function Zk(l){return ia||(ia=document.createElement("span"),ia.style.position="fixed",ia.style.width="0",ia.style.height="0",ia.style.opacity="0",ia.style.pointerEvents="none",document.body.appendChild(ia)),ia.style.color=l,getComputedStyle(ia).color}function p_(l,s,r){return Zk(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Gf=null;function Fk(){return Gf||(Gf=Promise.all([lt(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),lt(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),lt(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),lt(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Gf=null,l})),Gf}function Jk({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:f,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:T,onResize:S,onAttach:A,onHide:C,registerSink:J}){const[le,Y]=b.useState(()=>h_());return b.useEffect(()=>{const H=new MutationObserver(()=>Y(h_()));return H.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>H.disconnect()},[]),a.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:f,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:f},children:[a.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:H=>{x&&(H.target.closest("button")||x())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(H=>a.jsxs("div",{role:"tab","aria-selected":H.id===s,className:"termtab"+(H.id===s?" is-on":"")+(H.exitCode!==null?" termtab--exited":""),onDoubleClick:q=>{x&&(q.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:H.cwd,onClick:()=>y(H.id),children:H.title}),H.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${H.exitCode}`,children:H.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${H.title}»`,onClick:()=>v(H.id),children:"✕"})]},H.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),x&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:x,children:a.jsx(Kc,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:C,children:"✕"})]}),c&&l.length>0&&a.jsx(m_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?a.jsx(m_,{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:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(H=>a.jsx(Wk,{id:H.id,exitCode:H.exitCode,active:H.id===s,theme:le,mobile:m,onInput:T,onResize:S,onAttach:A,registerSink:J},H.id))]})]})}function m_({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:f,details:h}=Pk(l);return a.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),f&&a.jsx("p",{className:"termfail__hint",children:f}),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 Pk(l){const[s="",...r]=l.trim().split(`
124
-
125
- `),c=s.split(`
126
- `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??l.trim(),hint:c.slice(1).join(" "),details:r.join(`
127
-
128
- `).trim()}}function Wk({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:f,onResize:h,onAttach:m,registerSink:g}){const x=b.useRef(null),y=b.useRef(null),j=b.useRef(!1),v=b.useRef(o);v.current=o;const T=b.useRef(c),S=b.useRef(s),[A,C]=b.useState("loading"),[J,le]=b.useState(!1);return b.useEffect(()=>{if(!x.current)return;let H=!1,q=null;C("loading"),le(!1);const B=window.setTimeout(()=>{H||le(!0)},200);return(async()=>{var Se;let M;try{M=await Fk()}catch{window.clearTimeout(B),H||C("error");return}if(H||!x.current)return;window.clearTimeout(B);const{Terminal:R,FitAddon:W,WebLinksAddon:oe}=M,G=new R({fontFamily:Kk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:T.current}),Z=new W;G.loadAddon(Z),G.loadAddon(new oe),G.open(x.current),y.current=G,G.attachCustomKeyEventHandler(N=>{if(N.type!=="keydown"||!(N.ctrlKey||N.metaKey))return!0;if(N.key==="`")return N.preventDefault(),!1;if(N.key==="c"||N.key==="C"){const U=G.getSelection();return U?(N.preventDefault(),pa(U),!1):!N.shiftKey}return N.key==="v"||N.key==="V"?(N.preventDefault(),Cp().then(U=>{U&&G.paste(U)}),!1):!0});const ge=N=>{N.preventDefault();const ee=G.getSelection();if(ee){pa(ee),G.clearSelection();return}Cp().then(U=>{U&&G.paste(U)})};(Se=G.element)==null||Se.addEventListener("contextmenu",ge);const ye=G.onData(N=>f(l,N));let Ne={cols:G.cols,rows:G.rows},z=null;const I=G.onResize(({cols:N,rows:ee})=>{z!==null&&window.clearTimeout(z),z=window.setTimeout(()=>{z=null,!(N===Ne.cols&&ee===Ne.rows)&&(Ne={cols:N,rows:ee},h(l,N,ee))},100)}),V=new ResizeObserver(()=>{try{Z.fit()}catch{return}v.current&&G.scrollToBottom()});V.observe(x.current);const pe=g(l,N=>{N.kind==="buffer"&&G.reset(),G.write(N.data)});m(l),S.current!==null&&!j.current&&(j.current=!0,G.write(`\r
129
- \x1B[2m— Процесс завершён (код ${S.current}) —\x1B[0m\r
130
- `)),r&&G.focus(),q=()=>{var N;z!==null&&window.clearTimeout(z),V.disconnect(),(N=G.element)==null||N.removeEventListener("contextmenu",ge),ye.dispose(),I.dispose(),pe(),G.dispose(),y.current=null},C("ready")})(),()=>{H=!0,window.clearTimeout(B),q==null||q(),q=null}},[l]),b.useEffect(()=>{if(!o)return;const Y=x.current;if(!Y)return;let H=null,q=0,B=!1;const M=G=>{G.pointerType==="mouse"||H!==null||(H=G.pointerId,q=G.clientY,B=!1)},R=G=>{if(G.pointerId!==H)return;const Z=q-G.clientY;if(!B){if(Math.abs(Z)<4)return;B=!0,Y.setPointerCapture(G.pointerId)}q=G.clientY;const ge=Y.querySelector(".xterm-viewport");ge&&(ge.scrollTop+=Z)},W=G=>{G.pointerId===H&&(Y.hasPointerCapture(G.pointerId)&&Y.releasePointerCapture(G.pointerId),H=null,B=!1)},oe=G=>G.stopPropagation();return Y.addEventListener("pointerdown",M),Y.addEventListener("pointermove",R),Y.addEventListener("pointerup",W),Y.addEventListener("pointercancel",W),Y.addEventListener("touchmove",oe,{capture:!0}),()=>{Y.removeEventListener("pointerdown",M),Y.removeEventListener("pointermove",R),Y.removeEventListener("pointerup",W),Y.removeEventListener("pointercancel",W),Y.removeEventListener("touchmove",oe,{capture:!0}),H!==null&&Y.hasPointerCapture(H)&&Y.releasePointerCapture(H)}},[o]),b.useEffect(()=>{T.current=c,y.current&&(y.current.options.theme=c)},[c]),b.useEffect(()=>{var Y;r&&((Y=y.current)==null||Y.focus())},[r]),b.useEffect(()=>{if(S.current=s,s===null){j.current=!1;return}if(j.current)return;const Y=y.current;Y&&(j.current=!0,Y.write(`\r
131
- \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
132
- `))},[s]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:x,className:"termview__surface"+(A==="ready"?"":" is-hidden")}),A==="loading"&&J&&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:"Загружается терминал…"})]}),A==="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 eE=2e5,tE=75,nE=90;function lE({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??eE,o=Math.min(100,Math.round(l/c*100)),f=`${l.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
133
- обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return a.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:f,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${sE(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function sE(l){return l>=nE?" contextbar__fill--over":l>=tE?" contextbar__fill--warn":""}const Oy="ccv:last-session",aE=300*1e3,iE=1e4;function rE(){try{const l=localStorage.getItem(Oy);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function cE(l,s){const r=l.find(o=>o.id===s);if(r)return r;const c=l.filter(o=>iv(o.path).includes(s));return c.length===1?c[0]:void 0}function oE(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const uE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},g_=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],x_=[{id:Ac,name:"Основной",color:"orange",configDir:null,main:!0,liveSessions:0}];function b_(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const f=l.slice(c+1).toLowerCase();return f===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(f)).sort((h,m)=>__(h.name,f)-__(m.name,f))}}function __(l,s){return l.toLowerCase().startsWith(s)?0:1}function y_(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function fE(){var wo,Ha;const l=b.useRef(null),[s,r]=b.useState(!1),[c,o]=b.useState("Нет связи с хостом"),[f,h]=b.useState(null),[m,g]=b.useState(null),x=(m==null?void 0:m.status)==="blocked",[y,j]=b.useState(!1),v=b.useMemo(()=>Vf()==="relay",[]),[T,S]=b.useState([]),[A,C]=b.useState([]),[J,le]=b.useState([]),[Y,H]=b.useState([]),[q,B]=b.useState([]),[M,R]=b.useState([]),[W,oe]=b.useState([]),[G,Z]=b.useState({}),[ge,ye]=b.useState([]),[Ne,z]=b.useState([]),[I,V]=b.useState(null),[pe,Se]=b.useState(null),[N,ee]=b.useState(null),[U,ve]=b.useState(null),[F,je]=b.useState(null),[Oe,$e]=b.useState(null),[Be,bt]=b.useState(El),[Qe,fn]=b.useState(Fh),[We,st]=b.useState(!1),[ct,vt]=b.useState(!1),ut=fd("(max-width: 860px)"),[It,wt]=b.useState(!1);b.useEffect(()=>{ut||wt(!1)},[ut]);const[Te,et]=b.useState(!1),[At,ft]=b.useState([]),[Fe,_n]=b.useState(!1),[tl,Ot]=b.useState(El),[St,cl]=b.useState(null),[dn,an]=b.useState(null),[ol,yn]=b.useState([]),[Ft,An]=b.useState(null),[Lt,Et]=b.useState(null),[ae,be]=b.useState([]),[Ve,at]=b.useState([]),[Je,rn]=b.useState([]),[X,he]=b.useState([]),[Re,qe]=b.useState(null),[Mt,hn]=b.useState(null),[Mn,Xl]=b.useState({}),[vn,ls]=b.useState(null),[vl,nl]=b.useState({}),[Is,jl]=b.useState(null),[Cl,cn]=b.useState([]),[tt,jn]=b.useState(!1),[Xn,ma]=b.useState(x_),[ss,qs]=b.useState({}),[as,zn]=b.useState(null),[ul,wl]=b.useState(()=>uv()??Ac),[zt,Jt]=b.useState(null),Pe=(zt==null?void 0:zt.enabledProviders)??["claude","antigravity"],[fl,pn]=b.useState(!1),[ll,Rn]=b.useState({}),[Un,Jn]=b.useState(null),[Xt,Sl]=b.useState(null),[wn,Sn]=b.useState(!1),[Vt,,jt]=Av(),gs=zv(),[Nl,Al]=b.useState(!1),[mn,xs]=b.useState(null),[Gs,Dn]=b.useState(null),[ga,Vl]=b.useState(null),[dl,Pt]=b.useState(null),[_e,k]=b.useState(null),[K,xe]=b.useState(""),[ke,Ge]=b.useState(null),[Le,qt]=b.useState([]),[Nn,on]=b.useState(!1),[Ut,kn]=b.useState(null),[gn,hl]=b.useState(!1),[xn,E]=b.useState(!1),[re,we]=b.useState({}),[Ye,ot]=b.useState([""]),[Hn,Wt]=b.useState([]),[Vn,bs]=b.useState(null),[Dr,_s]=b.useState(null),[$s,xa]=b.useState(null),[Wa,Qn]=b.useState(null),[ba,ei]=b.useState(null),[Ys,gu]=b.useState({}),[ti,Or]=b.useState({}),[Ql,Xs]=b.useState(!1),[xu,Zc]=b.useState(null),[Lr,Fc]=b.useState(null),zr=b.useRef(0),Ur=b.useRef(null),[ni,Jc]=b.useState(!1),[Hr,Bi]=b.useState([]),[bu,Br]=b.useState(null),[gd,Ir]=b.useState(null),qr=Hv(),Ii=Gv(ut&&ni),qi=b.useRef(new Map),_a=(zt==null?void 0:zt.terminalEnabled)===!0,Gr=Vf()==="relay"&&((wo=f==null?void 0:f.shell)==null?void 0:wo.enabled)!==!0,$r=b.useRef(!1),xd=b.useCallback((p,O)=>(qi.current.set(p,O),()=>{qi.current.get(p)===O&&qi.current.delete(p)}),[]),[ya,Yr]=b.useState(!1),[_u,Xr]=b.useState(null),[yu,Vr]=b.useState(El),[ys,Qr]=b.useState(null),[va,Kl]=b.useState({}),Gi=b.useRef([]),[en,Kr]=b.useState(null);function vu(p){Kr(O=>O===p?null:p)}b.useEffect(()=>{(ut||en==="terminal"&&!ni||en==="files"&&!xn||en==="search"&&!Ql||en==="git"&&!Nl||en==="ask"&&!ya||en==="main"&&Hn.length===0)&&Kr(null)},[en,ut,ni,xn,Ql,Nl,ya,Hn.length]);const[ju]=b.useState(rE),Zr=b.useRef(ju),vs=b.useRef(!1),Bn=b.useRef(null),$i=b.useRef(null),Yi=b.useRef(null),Pc=b.useRef(0),On=b.useRef(null),li=b.useRef(0);Bn.current=F,On.current=U,li.current=Be.lastSeq;const si=b.useRef(Qe);si.current=Qe;const js=b.useRef(null),Xi=b.useRef(0);Xi.current=yu.lastSeq;const Vi=b.useRef(null),Qi=b.useRef(""),ja=b.useRef(null),ws=b.useRef([]),Wc=b.useRef([""]);ws.current=Hn,Wc.current=Ye;const ai=b.useRef(new Map),Ki=b.useRef(new Set),Zi=b.useRef(null),Fi=b.useRef(null),wu=b.useRef(0),Ji=b.useRef(new Set);b.useEffect(()=>{const p=bv();if(!p)return;l.current=p;const O=()=>{r(p.connected),o(p.statusText)};p.onStatus(O),p.onReconnect(()=>{O(),nl({});const it=Bn.current;it&&p.send({type:"session.sync",sessionId:it,sinceSeq:li.current});const Rt=js.current;Rt&&p.send({type:"session.sync",sessionId:Rt,sinceSeq:Xi.current})});const ce=p.on(it=>bd(it));p.connect();const Ae=window.setInterval(()=>{O(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(Ae),p.close()}},[]);const bd=b.useCallback(p=>{var O,ce,Ae,it,Rt,In,Ba,So,Rs,gl;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{S(p.workspaces),C(p.archived),ve(ze=>{var ht;if(ze)return ze;const Ce=Zr.current,Ue=Ce&&cE(p.workspaces,Ce.workspaceId);return Ce&&Ue&&Ue.id!==Ce.workspaceId&&(Zr.current={...Ce,workspaceId:Ue.id}),(Ue==null?void 0:Ue.id)??((ht=p.workspaces[0])==null?void 0:ht.id)??null});const fe=ja.current;if(!fe)break;const Ee=p.workspaces.find(ze=>xE(ze.path,fe));if(!Ee)break;ja.current=null,et(!1),ve(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==Qi.current)break;ft(p.candidates),p.source==="host"&&_n(!1);break;case"finder.opened":Vi.current=p.sessionId;break;case"workspace.roots":yn(p.roots);break;case"workspace.created":if(ve(p.workspace.id),p.warnings.length===0){et(!1),an(null);break}An({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(Z(fe=>({...fe,[p.workspaceId]:{sessions:p.sessions??[],archived:p.archived??[]}})),p.workspaceId!==On.current)break;R(p.sessions),oe(p.archived);break;case"folder.list":le(p.workspaceFolders),H(p.sessionFolders),B(p.pinnedFolders??[]);break;case"session.pinned":ye(p.sessions);break;case"session.live":z(p.sessions);break;case"order.state":ee(p.order);break;case"session.summary":if(p.session.id===Vi.current){cl(p.session);break}if(p.session.parentSessionId){p.session.id===js.current&&Qr(p.session);break}if(z(fe=>{const Ee=fe.findIndex(Ce=>Ce.id===p.session.id);if(p.session.state==="closed")return Ee===-1?fe:fe.filter(Ce=>Ce.id!==p.session.id);if(Ee===-1)return[...fe,p.session];const ze=fe.slice();return ze[Ee]=p.session,ze}),R(fe=>{const Ee=fe.findIndex(Ce=>Ce.id===p.session.id);if(Ee===-1)return[p.session,...fe];const ze=fe.slice();return ze[Ee]=p.session,ze}),Z(fe=>{const Ee=fe[p.session.workspaceId];if(!Ee)return fe;const ze=Ee.sessions.findIndex(Ue=>Ue.id===p.session.id);let Ce;if(ze!==-1)Ce=Ee.sessions.slice(),Ce[ze]=p.session;else{if(Ee.archived.some(Ue=>Ue.id===p.session.id))return fe;Ce=[p.session,...Ee.sessions]}return{...fe,[p.session.workspaceId]:{...Ee,sessions:Ce}}}),ye(fe=>{const Ee=fe.findIndex(Ce=>Ce.id===p.session.id);if(Ee===-1)return fe;const ze=fe.slice();return ze[Ee]={...p.session,pinned:!0,...fe[Ee].pinnedAt?{pinnedAt:fe[Ee].pinnedAt}:{}},ze}),Bn.current===null&&Yi.current&&Yi.current.workspaceId===p.session.workspaceId&&(R_(p.session.id,Yi.current.text),Yi.current=null),je(fe=>fe??p.session.id),((O=$i.current)==null?void 0:O.sessionId)===p.session.id){const fe=$i.current;p.session.state==="error"?$i.current=null:p.session.state!=="closed"&&($i.current=null,(ce=l.current)==null||ce.send({type:"prompt.send",sessionId:fe.sessionId,text:fe.text,images:fe.images}))}break;case"usage.state":p.sessionId===Bn.current&&(Jn(p.usage),Sn(!1));break;case"context.state":p.sessionId===Bn.current&&(Sl(p.context),Sn(!1));break;case"session.capabilities":p.sessionId===Bn.current&&$e(p.capabilities);break;case"session.events":if(p.sessionId===js.current){Vr(fe=>Qf(fe,p.entries));break}if(p.sessionId===Vi.current){Ot(fe=>Qf(fe,p.entries));break}if(p.sessionId!==Bn.current)break;for(const fe of p.entries){if(fe.event.kind!=="rewound")continue;const Ee=fe.event.toUserIndex,ze=Tv(si.current.entries,Ee),Ce=ze.reduce((Ue,ht)=>ht.event.kind==="user.message"?Ue+1:Ue,0);fn(Ue=>({...Ue,entries:ze})),bt(Ue=>({...Ue,items:Cv(Ue.items,Ee,Ce)}))}bt(fe=>Qf(fe,p.entries));break;case"session.history":if(p.sessionId!==Bn.current)break;fn(fe=>Nv(fe,p));break;case"side.opened":{if(p.parentSessionId!==Bn.current)break;js.current=p.sessionId,Xr(p.sessionId);const fe=Gi.current;Gi.current=[];for(const Ee of fe)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Bn.current)break;js.current=null,Xr(null),Vr(El),Qr(null);break;case"git.state":if(p.workspaceId!==On.current)break;xs(p.state);break;case"git.commit":if(p.workspaceId!==On.current)break;Dn(p.detail);break;case"git.result":if(p.workspaceId!==On.current)break;Pt({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Dn(null),Vl(null),on(!1),hl(!1));break;case"git.busy":if(p.workspaceId!==On.current)break;xe(p.label);break;case"git.files":if(p.workspaceId!==On.current)break;kn({files:p.files,truncated:p.truncated});break;case"github.status":Ge(p.status);break;case"github.owners":qt(p.owners);break;case"fs.dir":if(p.workspaceId!==On.current)break;we(fe=>({...fe,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==On.current)break;if(p.scope!=="tree"){const fe=p.scope;Or(Ee=>({...Ee,[fe]:{query:p.query,entries:p.entries}}));break}ei({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==On.current)break;Zc({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==On.current)break;const fe=Ki.current.delete(p.file.path);Wt(ze=>{const Ce=ze.findIndex(oc=>oc.path===p.file.path);if(Ce===-1)return[...ze,Rb(p.file,++wu.current)];const Ue=ze[Ce],ht=ze.slice();return ht[Ce]=Ue.saved===p.file.content&&!Fa(Ue)?{...Ue,mtime:p.file.mtime,size:p.file.size,stale:!1}:Rb(p.file,++wu.current),ht}),fe&&bs(p.file.path);const Ee=Ur.current;Ee&&Ee.path===p.file.path&&(Ur.current=null,Fc({...Ee,token:++zr.current}));break}case"fs.media":{if(p.workspaceId!==On.current)break;Ji.current.delete(p.path),Wt(fe=>fe.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==On.current)break;Ji.current.delete(p.path),Wt(fe=>fe.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==On.current)break;const fe=ai.current.get(p.path);ai.current.delete(p.path);const Ee=fe!==void 0;Wt(Ce=>Ce.map(Ue=>Ue.path!==p.path?Ue:Ee?{...Ue,saved:fe,mtime:p.mtime,size:p.size,stale:!1}:{...Ue,stale:!0}));const ze=ws.current.find(Ce=>Ce.path===p.path);!Ee&&ze&&!Fa(ze)&&((Ae=l.current)==null||Ae.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(it=l.current)==null||it.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==On.current)break;if(_s({ok:p.ok,message:p.message}),p.ok||ai.current.delete(p.path),p.conflict&&Wt(Ee=>Ee.map(ze=>ze.path===p.path?{...ze,stale:!0}:ze)),Fi.current===p.path){const Ee=Fi.current;Fi.current=null,p.ok&&(Ki.current.add(Ee),(Rt=l.current)==null||Rt.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const fe=Zi.current;if(p.ok&&fe&&fe.to===p.path){Zi.current=null;const Ee=ze=>ze===fe.from?fe.to:ze.startsWith(`${fe.from}/`)?fe.to+ze.slice(fe.from.length):ze;Wt(ze=>ze.map(Ce=>({...Ce,path:Ee(Ce.path)}))),bs(ze=>ze===null?null:Ee(ze)),ot(ze=>ze.map(Ee)),we(ze=>{const Ce={};for(const[Ue,ht]of Object.entries(ze))Ue===fe.from||Ue.startsWith(`${fe.from}/`)||(Ce[Ue]=ht);return Ce})}p.ok&&((In=l.current)==null||In.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==On.current)break;Bi(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==On.current)break;Ir(null),Bi(fe=>{const Ee=fe.findIndex(Ce=>Ce.id===p.terminal.id);if(Ee===-1)return[...fe,p.terminal];const ze=fe.slice();return ze[Ee]=p.terminal,ze}),$r.current&&($r.current=!1,Br(p.terminal.id));break;case"term.buffer":(Ba=qi.current.get(p.id))==null||Ba({kind:"buffer",data:p.data});break;case"term.data":(So=qi.current.get(p.id))==null||So({kind:"data",data:p.data});break;case"term.exit":Bi(fe=>fe.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":Bi(fe=>fe.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===Bn.current&&be(p.servers);break;case"mcp.auth":p.sessionId===Bn.current&&hn(p.state);break;case"plugin.list":if(p.sessionId!==Bn.current)break;at(p.plugins),rn(p.marketplaces),he(p.catalog);break;case"operation.result":p.sessionId===Bn.current&&qe(p.result);break;case"auth.status":qs(fe=>({...fe,[p.accountId]:p.status}));break;case"accounts.state":ma(p.accounts.length>0?p.accounts:x_),zn(null),qs(fe=>{const Ee={};for(const ze of p.accounts)Ee[ze.id]=p.auth[ze.id]??fe[ze.id]??null;return Ee});break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":Jt(p.settings);break;case"handoff.state":Xl(fe=>{if(!p.handoff){if(!(p.sessionId in fe))return fe;const Ee={...fe};return delete Ee[p.sessionId],Ee}return{...fe,[p.sessionId]:p.handoff}});break;case"handoff.written":nl(fe=>{if(!(p.sessionId in fe))return fe;const Ee={...fe};return delete Ee[p.sessionId],Ee}),p.handoff&&Bn.current===p.sessionId?jl(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Pc.current+=1,cn(fe=>[...fe,{id:Pc.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Rn(fe=>({...fe,[p.accountId]:p.state})),p.state.active&&jn(!0);break;case"session.closed":z(fe=>fe.filter(Ee=>Ee.id!==p.sessionId)),R(fe=>fe.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee)),Z(fe=>{let Ee=!1;const ze={};for(const[Ce,Ue]of Object.entries(fe))Ue.sessions.some(ht=>ht.id===p.sessionId&&ht.state!=="closed")?(Ee=!0,ze[Ce]={...Ue,sessions:Ue.sessions.map(ht=>ht.id===p.sessionId?{...ht,state:"closed"}:ht)}):ze[Ce]=Ue;return Ee?ze:fe});break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(ja.current=null,an(p.message)),(Rs=p.context)!=null&&Rs.startsWith("term.")&&Ir(p.message),(gl=p.context)!=null&&gl.startsWith("accounts.")&&zn(p.message);break}},[]),te=b.useCallback(p=>{var O;(O=l.current)==null||O.send(p)},[]);b.useEffect(()=>{U&&te({type:"session.list",workspaceId:U})},[U,te]),b.useEffect(()=>{s&&te({type:"session.pins"})},[s,te]),b.useEffect(()=>{s&&te({type:"settings.get"})},[s,te]),b.useEffect(()=>{if(s)return te({type:"session.drafts",sessionIds:D_()}),jv(p=>te({type:"session.drafts",sessionIds:p}))},[s,te]),b.useEffect(()=>{if(vs.current)return;const p=Zr.current;if(!p||!U)return;if(U!==p.workspaceId){vs.current=!0;return}if(F){vs.current=!0;return}if(M.length===0)return;const O=M.find(ce=>oE(ce,p));vs.current=!0,O&&O.state!=="closed"&&Vs(O)},[M,U,F]),b.useEffect(()=>{!U||Gr||!_a||te({type:"term.list",workspaceId:U})},[U,Gr,_a,te]),b.useEffect(()=>{Br(p=>{var O;return p&&Hr.some(ce=>ce.id===p)?p:((O=Hr[0])==null?void 0:O.id)??null})},[Hr]),b.useEffect(()=>{Te&&te({type:"workspace.roots"})},[Te,te]);const is=b.useCallback(()=>{const p=Bn.current;p&&(Sn(!0),te({type:"usage.get",sessionId:p}),te({type:"context.get",sessionId:p}))},[te]);b.useEffect(()=>{if(!wn)return;const p=window.setTimeout(()=>Sn(!1),iE);return()=>window.clearTimeout(p)},[wn]);const Fr=b.useMemo(()=>{const p=Math.max((Un==null?void 0:Un.fetchedAt)??0,(Xt==null?void 0:Xt.fetchedAt)??0);return p>0?p:null},[Un==null?void 0:Un.fetchedAt,Xt==null?void 0:Xt.fetchedAt]);b.useEffect(()=>{if(Sl(null),!F)return;is();const p=()=>{document.hidden||is()},O=window.setInterval(p,aE),ce=()=>{document.hidden||is()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(O),document.removeEventListener("visibilitychange",ce)}},[F,is]),b.useEffect(()=>{if(!F){fn(Fh);return}fn({...Fh,loading:!0}),te({type:"session.history",sessionId:F})},[F,te]);const Su=b.useCallback(()=>{!F||Qe.loading||!Kx(Qe)||(fn(p=>({...p,loading:!0})),te({type:"session.history",sessionId:F,before:L_(Qe)}))},[F,Qe,te]),Nu=b.useMemo(()=>kv(Qe.entries),[Qe.entries]),Q=b.useMemo(()=>M.find(p=>p.id===F)??null,[M,F]),wa=F?(Q==null?void 0:Q.claudeSessionId)??F:null,Pi=wa?Mn[wa]??null:null;b.useEffect(()=>{wa&&te({type:"handoff.get",sessionId:wa})},[wa,te]),b.useEffect(()=>{vn&&!(vn.sessionId in Mn)&&ls(null)},[Mn,vn]);const Sa=b.useMemo(()=>{var ce;if(!Un)return null;const p=(((ce=Un.buckets)==null?void 0:ce.length)??0)>0,O=(Q==null?void 0:Q.provider)==="antigravity";return p===O?Un:null},[Un,Q==null?void 0:Q.provider]),Wi=Xn.length>1;function ii(p){return Xn.some(O=>O.id===p)?p:Ac}const eo=b.useMemo(()=>({accounts:Xn,auth:ss,multi:Xn.length>1}),[Xn,ss]),Ml=Wi&&Q&&Q.provider!=="antigravity"?Xn.find(p=>p.id===Q.accountId)??null:null,Na=b.useMemo(()=>{const p={};for(const O of M)O.provider!=="antigravity"&&(O.state!=="running"&&O.state!=="waiting_permission"||(p[O.accountId]=(p[O.accountId]??0)+1));return p},[M]),ka="Обновить лимиты и контекст",to=ka+(Fr?`
134
- обновлено в ${new Date(Fr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");b.useEffect(()=>{document.documentElement.dataset.provider=(Q==null?void 0:Q.provider)??"claude"},[Q==null?void 0:Q.provider]),b.useEffect(()=>{(Q==null?void 0:Q.provider)==="antigravity"&&Yr(!1)},[Q==null?void 0:Q.provider]);const Ea=T.find(p=>p.id===U)??A.find(p=>p.id===U)??null;b.useEffect(()=>{if(!U||!F)return;const p={workspaceId:U,sessionId:F,claudeSessionId:(Q==null?void 0:Q.claudeSessionId)??null};try{localStorage.setItem(Oy,JSON.stringify(p))}catch{}},[U,F,Q==null?void 0:Q.claudeSessionId]);function Ta(p){ja.current=p,an(null),te({type:"workspace.open",path:p})}function ku(p,O,ce){an(null),te({type:"workspace.create",parent:p,name:O,init:ce})}function Eu(p){if(Qi.current=p,!p){ft([]),_n(!1);return}_n(!0),te({type:"workspace.find",query:p})}function Tu(p){Qi.current=p,Ot(El),te({type:"workspace.find.agent",query:p})}function _d(){et(!1),an(null),An(null),ft([]),Ot(El),cl(null),Qi.current="",ja.current=null}function ri(){const p=Bn.current;p&&js.current&&te({type:"side.reset",sessionId:p}),js.current=null,Xr(null),Vr(El),Qr(null),Kl({}),Gi.current=[]}function yd(p){te({type:"workspace.close",workspaceIds:p}),!(!U||!p.includes(U))&&(ri(),ve(null),je(null),R([]),oe([]),bt(El),$e(null),vt(!1))}function Cu(p,O){te({type:"session.archive",workspaceId:p,sessionIds:O}),F&&(O.includes(F)||Q!=null&&Q.claudeSessionId&&O.includes(Q.claudeSessionId))&&(ri(),je(null),bt(El),$e(null),vt(!1))}function Au(p){te({type:"workspace.restore",workspaceIds:p})}function no(p,O,ce){te({type:"folder.create",scope:p,name:O,workspaceId:ce})}function Zl(p,O){te({type:"folder.rename",folderId:p,name:O})}function Jr(p,O){te({type:"folder.setColor",folderId:p,color:O})}function Rl(p){te({type:"folder.delete",folderId:p})}function ci(p,O,ce,Ae){te({type:"folder.assign",scope:p,itemId:O,folderId:ce,workspaceId:Ae})}function lo(p=Pe[0]??"claude",O){if(!U)return;let ce;p==="claude"&&Wi&&(ce=O??ii(ul),wl(ce),fv(ce)),ri(),je(null),$e(null),bt(El),vt(!1),te({type:"session.start",workspaceId:U,provider:p,...ce?{accountId:ce}:{}}),st(!1)}function oi(p){ri(),zu(),ve(p),je(null),bt(El),$e(null),vt(!1),xs(null),Dn(null),Vl(null),Pt(null),xe(""),on(!1),kn(null),hl(!1),Bi([]),Br(null)}function Pr(p,O,ce){te({type:"session.pin",workspaceId:p,sessionIds:O,pinned:ce})}function so(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Ss(p){if(so(p)){V(p);return}te({type:"session.close",sessionId:p.id})}function Mu(p,O,ce){ee(Ae=>{const it=Ae??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!ce)return Ae;const Rt={...it.sessions};return O&&O.length>0?Rt[ce]=O:delete Rt[ce],{...it,sessions:Rt}}return{...it,[p]:O??[]}}),te({type:"order.set",scope:p,ids:O,...ce?{workspaceId:ce}:{}})}function Wr(p){p.workspaceId!==U&&oi(p.workspaceId),Vs(p)}function Vs(p){if(st(!1),ri(),bt(El),$e(null),vt(!1),p.state==="closed"){je(null),te({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}je(p.id),te({type:"session.sync",sessionId:p.id,sinceSeq:0})}function vd(p,O){if(!F||x)return!1;const ce=F,Ae=Q;return pl(()=>{if((Ae==null?void 0:Ae.state)==="closed"){$i.current={sessionId:Ae.id,text:p,images:O},Vs(Ae);return}te({type:"prompt.send",sessionId:ce,text:p,images:O})})}function pl(p){const O=(Q==null?void 0:Q.provider)==="antigravity"?null:Gk(Un,zt);return O?new Promise(ce=>{Se(Ae=>(Ae==null||Ae.resolve(!1),{warning:O,resolve:ce}))}).then(ce=>(ce&&p(),ce)):(p(),!0)}function er(p){pe&&(pe.resolve(p),Se(null))}function rs(p){const O=Ne.find(ce=>(ce.claudeSessionId??ce.id)===p.sessionId&&ce.state!=="closed");tr(p.workspaceId,p.sessionId,p.text,O==null?void 0:O.accountId),O&&te({type:"session.close",sessionId:O.id})}function ao(p){tr(p.workspaceId,p.claudeSessionId??p.id,null,p.accountId)}function tr(p,O,ce,Ae){Yi.current=ce===null?null:{workspaceId:p,text:ce},p!==U?oi(p):(ri(),je(null),$e(null),bt(El),vt(!1)),te({type:"session.start",workspaceId:p,provider:"claude",...Wi&&Ae?{accountId:Ae}:{},continuesFrom:O,...ce===null?{}:{fromHandoff:!0}}),st(!1)}b.useEffect(()=>{Is&&(jl(null),rs(Is))},[Is]);function Qs(p){vl[p.id]||(nl(O=>({...O,[p.id]:!0})),te({type:"session.handoff",sessionId:p.id}))}function io(p){te({type:"handoff.dismiss",sessionId:p})}function ro(p,O){te({type:"session.rename",sessionId:p.id,title:O,workspaceId:p.workspaceId}),R(ce=>ce.map(Ae=>Ae.id===p.id?{...Ae,title:O}:Ae)),Z(ce=>{const Ae=ce[p.workspaceId];return Ae?{...ce,[p.workspaceId]:{...Ae,sessions:Ae.sessions.map(it=>it.id===p.id?{...it,title:O}:it)}}:ce})}function ec(p){F&&(st(!1),qe(null),hn(null),Et(p),te({type:"mcp.list",sessionId:F}),te({type:"plugin.list",sessionId:F}))}const Ru={mcpAction:(p,O)=>{F&&(qe(null),te({type:"mcp.action",sessionId:F,name:p,action:O}))},mcpAuth:p=>{F&&(qe(null),hn({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),te({type:"mcp.auth",sessionId:F,name:p}))},mcpAuthCallback:(p,O)=>{F&&te({type:"mcp.auth_callback",sessionId:F,name:p,callbackUrl:O})},mcpAdd:(p,O)=>{F&&te({type:"mcp.add",sessionId:F,name:p,draft:O})},mcpRemove:p=>{F&&te({type:"mcp.remove",sessionId:F,name:p})},pluginInstall:p=>{F&&te({type:"plugin.install",sessionId:F,spec:p})},pluginUninstall:p=>{F&&te({type:"plugin.uninstall",sessionId:F,id:p})},pluginToggle:(p,O)=>{F&&te({type:"plugin.toggle",sessionId:F,id:p,enabled:O})},marketplaceAdd:p=>{F&&te({type:"marketplace.add",sessionId:F,source:p})},marketplaceRemove:p=>{F&&te({type:"marketplace.remove",sessionId:F,name:p})}};function ml(){st(!1),jn(!0),zn(null);for(const p of Xn)te({type:"auth.status",accountId:p.id})}const Ks={login:(p,O,ce)=>te({type:"auth.login",mode:O,switchAccount:ce,accountId:p}),submitCode:(p,O)=>te({type:"auth.code",code:O,accountId:p}),cancel:p=>te({type:"auth.cancel",accountId:p}),logout:p=>te({type:"auth.logout",accountId:p}),add:(p,O,ce,Ae)=>{zn(null),te({type:"accounts.add",name:p,color:O,...ce?{configDir:ce}:{},...Ae?{shareConfig:!0}:{}})},update:(p,O)=>{zn(null),te({type:"accounts.update",accountId:p,...O})},remove:p=>{zn(null),te({type:"accounts.remove",accountId:p})}};function ui(p){jn(!0),te({type:"auth.status",accountId:p})}function tc(){st(!1),pn(!0),te({type:"settings.get"})}function nr(p){Jt(O=>O&&{...O,...p}),te({type:"settings.update",settings:p})}function Dl(p){!F||x||te({type:"side.ask",sessionId:F,text:p})}function Ol(){F&&(te({type:"side.reset",sessionId:F}),js.current=null,Xr(null),Vr(El),Qr(null),Kl({}),Gi.current=[])}function Ll(p){const O=js.current;if(O){p(O);return}const ce=Bn.current;ce&&(Gi.current.push(p),te({type:"side.open",sessionId:ce}))}function Fl(){U&&te({type:"git.state",workspaceId:U})}function cs(p){U&&(Vl(p),te({type:"git.show",workspaceId:U,ref:p}))}function os(p,O){Pt(null),k({target:p,label:O})}function Du(){!U||!_e||(te({type:"git.checkout",workspaceId:U,target:_e.target}),k(null))}function co(){U&&(Pt(null),te({type:"git.push",workspaceId:U}))}function oo(p){U&&(Pt(null),te({type:"git.pull",workspaceId:U,merge:p}))}function Ou(){U&&(Pt(null),kn(null),on(!0),te({type:"github.status"}),te({type:"github.owners"}),te({type:"git.files",workspaceId:U}))}function Kn(p){U&&(Pt(null),te({type:"git.publish",workspaceId:U,...p}))}function Qt(p){U&&(Pt(null),te({type:"git.remote",workspaceId:U,url:p}))}function dt(){Pt(null),hl(!0)}function Zs(p){te({type:"github.token",token:p}),te({type:"github.owners"})}function zl(){te({type:"github.status"}),te({type:"github.owners"})}b.useEffect(()=>{if(!(!xn||!U))for(const p of Ye)p in re||te({type:"fs.list",workspaceId:U,path:p})},[xn,Ye,re,U,te]);function uo(p){ot(O=>O.includes(p)?O.filter(ce=>ce!==p):[...O,p])}function Fs(p){if(!p){ei(null);return}U&&te({type:"fs.search",workspaceId:U,query:p})}function Lu(p){if(!p){Zc(null);return}U&&te({type:"fs.grep",workspaceId:U,query:p})}const fo=b.useCallback((p,O)=>{gu(it=>({...it,[p]:O}));const ce=On.current;if(O===null||!ce)return;const Ae=O.lastIndexOf("/");if(Ae!==-1){te({type:"fs.list",workspaceId:ce,path:O.slice(0,Ae)});return}if(O===""){te({type:"fs.list",workspaceId:ce,path:""});return}te({type:"fs.search",workspaceId:ce,query:O,scope:p})},[te]),fi=b.useMemo(()=>b_(Ys.mention??null,ti.mention??null,re),[Ys.mention,ti.mention,re]),Ca=b.useMemo(()=>b_(Ys.side??null,ti.side??null,re),[Ys.side,ti.side,re]);function ho(p){sr(p.path,{line:p.line,column:p.column})}function lr(p){const O=[];let ce=Tr(p.path);for(;O.push(ce),!!ce;)ce=Tr(ce);ot(Ae=>{const it=new Set(Ae);for(const Rt of O)it.add(Rt);return p.kind==="dir"&&it.add(p.path),[...it]}),p.kind==="file"&&sr(p.path)}function sr(p,O){if(ws.current.find(Ae=>Ae.path===p)){bs(p),O&&Fc({path:p,...O,token:++zr.current});return}U&&(O&&(Ur.current={path:p,...O}),Ki.current.add(p),te({type:"fs.read",workspaceId:U,path:p}))}function Ns(p,O=!1){const ce=ws.current,Ae=ce.find(In=>In.path===p);if(Ae&&Fa(Ae)&&!O){Qn(p);return}Qn(null);const it=ce.findIndex(In=>In.path===p),Rt=ce.filter(In=>In.path!==p);Wt(Rt),bs(In=>{var Ba;return In===p?((Ba=Rt[Math.min(it,Rt.length-1)])==null?void 0:Ba.path)??null:In})}function Ul(p,O=!1){const ce=ws.current.find(Ae=>Ae.path===p);!ce||!U||!O&&!Fa(ce)||(ai.current.set(p,ce.text),te({type:"fs.write",workspaceId:U,path:p,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...O?{force:!0}:{}}))}function Js(p){U&&te({type:"fs.read",workspaceId:U,path:p})}function ks(p){U&&(Ji.current.has(p)||(Ji.current.add(p),te({type:"fs.readMedia",workspaceId:U,path:p})))}const po=b.useRef(new Map);function mo(p){const O=po.current,ce=O.get(p);ce&&clearTimeout(ce);const Ae=(zt==null?void 0:zt.autoSaveAfterPauseMs)??0;Ae<=0||O.set(p,setTimeout(()=>{O.delete(p);const it=ws.current.find(Rt=>Rt.path===p);it&&Fa(it)&&!it.stale&&Ul(p)},Ae))}function di(p,O,ce){if(!U)return;const Ae=p?`${p}/${ce}`:ce;_s(null),O==="file"&&(Fi.current=Ae),te({type:"fs.create",workspaceId:U,path:Ae,kind:O})}function nc(p,O){if(!U)return;const ce=Tr(p),Ae=ce?`${ce}/${O}`:O;_s(null),Zi.current={from:p,to:Ae},te({type:"fs.rename",workspaceId:U,path:p,to:Ae})}function Aa(p,O){if(!U)return;const ce=p.slice(p.lastIndexOf("/")+1),Ae=O?`${O}/${ce}`:ce;Ae!==p&&(_s(null),Zi.current={from:p,to:Ae},te({type:"fs.rename",workspaceId:U,path:p,to:Ae}))}function Zn(p,O){U&&(_s(null),te({type:"fs.copy",workspaceId:U,path:p,toDir:O}))}function lc(p){U&&(_s(null),xa(null),te({type:"fs.delete",workspaceId:U,path:p.path}),Wt(O=>O.filter(ce=>ce.path!==p.path&&!ce.path.startsWith(`${p.path}/`))),bs(O=>O&&(O===p.path||O.startsWith(`${p.path}/`))?null:O))}function zu(){we({}),ot([""]),Wt([]),bs(null),_s(null),ei(null),Zc(null),gu({}),Or({}),Fc(null),Ki.current.clear(),ai.current.clear(),Ji.current.clear(),Ur.current=null,Zi.current=null,Fi.current=null}function jd(){!U||Gr||!_a||(Ir(null),$r.current=!0,te({type:"term.open",workspaceId:U,cols:80,rows:24}))}function wd(p){te({type:"term.close",id:p})}function Sd(p,O){F&&te({type:"permission.respond",sessionId:F,requestId:p,decision:O})}function En(p,O){F&&te({type:"permission.respond",sessionId:F,requestId:p,decision:"allow",answers:O})}function go(p){F&&te({type:"permission.respond",sessionId:F,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function ar(p,O){F&&te({type:"permission.respond",sessionId:F,requestId:p,decision:"allow",plan:O})}function ir(p){F&&te({type:"permission.respond",sessionId:F,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}b.useEffect(()=>{function p(O){if(O.key!=="Escape")return;if(en!==null){const Ae=O.target;if(!(Ae instanceof HTMLElement&&Ae.closest(".termview, .editor, .sidepane"))){Kr(null);return}}if(!F||Be.pending.length>0)return;const ce=O.target;ce instanceof HTMLElement&&ce.closest(".sidepane, .editor")||te({type:"control.interrupt",sessionId:F})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[F,Be.pending.length,te,en]),b.useEffect(()=>{function p(O){O.key!=="`"||!(O.ctrlKey||O.metaKey)||_a&&(O.preventDefault(),Jc(ce=>!ce))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[_a]);const sc=b.useMemo(()=>{const p=(Oe==null?void 0:Oe.commands)??[];return p.length===0||(Q==null?void 0:Q.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...g_]},[Oe,Q==null?void 0:Q.provider]);function Ma(p){const O=uE[p];if(O&&(Q==null?void 0:Q.provider)!=="antigravity")return ec(O),!0;if((Q==null?void 0:Q.provider)==="antigravity"||!g_.some(Ae=>Ae.name===p))return!1;ml();const ce=(Q==null?void 0:Q.accountId)??Ac;return p==="logout"&&Ks.logout(ce),p==="switch-account"&&Ks.login(ce,"claudeai",!0),!0}const Es=(Q==null?void 0:Q.state)==="waiting_permission",Jl=(Q==null?void 0:Q.state)==="reconnecting",Hl=(Q==null?void 0:Q.state)==="running"||Jl||Es,Zt=Be.pending[0]??null,ac=Zt?iN(Zt.toolName,Zt.input):null,[Ra,xo]=b.useState(()=>new Set),Da=Zt?Ra.has(Zt.requestId):!1,bo=Zt?Zt.questions&&Zt.questions.length>0?"question":ac!==null?"plan":"permission":null;function Ts(p,O){xo(ce=>{if(ce.has(p)===O)return ce;const Ae=new Set(ce);return O?Ae.add(p):Ae.delete(p),Ae})}b.useEffect(()=>{!Nl&&!xn||!U||Hl||te({type:"git.state",workspaceId:U})},[Nl,xn,U,Hl,te]),b.useEffect(()=>{if(!(Hl||!U)){xn&&we(p=>{const O={};for(const[ce,Ae]of Object.entries(p))Wc.current.includes(ce)||(O[ce]=Ae);return O});for(const p of ws.current)Fa(p)||te({type:"fs.read",workspaceId:U,path:p.path})}},[Hl,U,xn,te]);const rr=(Q==null?void 0:Q.cwd)??(Oe==null?void 0:Oe.cwd)??null,cr=(Oe==null?void 0:Oe.models)??[],Oa=(Q==null?void 0:Q.model)??(Oe==null?void 0:Oe.model)??null,{rows:_o,selected:Uu}=y_(cr,Oa),Pl=ys?{model:ys.model,effort:ys.effort,ultracode:ys.ultracode,thinking:ys.thinking,switchOnFlag:ys.switchModelsOnFlag}:{model:va.model??Oa,effort:va.effort??(Q==null?void 0:Q.effort)??null,ultracode:va.ultracode??(Q==null?void 0:Q.ultracode)??!1,thinking:va.thinking??(Q==null?void 0:Q.thinking)??!0,switchOnFlag:va.switchOnFlag??(Q==null?void 0:Q.switchModelsOnFlag)??!0},Ps=y_(cr,Pl.model),Hu=(ys==null?void 0:ys.state)==="running",ic=Vn?Hn.find(p=>p.path===Vn)??null:null,hi=new Set(Hn.filter(Fa).map(p=>p.path)),Cs=p=>a.jsx(Xk,{pane:p,width:gs.widths[p],onResize:O=>gs.setWidth(p,O),onReset:()=>gs.reset(p)}),As=p=>ut?null:()=>vu(p),or=(Q==null?void 0:Q.provider)==="antigravity"?Rv:z_,ur=Oe&&a.jsx(Hs,{title:"Режим прав",value:(Q==null?void 0:Q.permissionMode)??"default",options:or.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{F&&te({type:"control.set_mode",sessionId:F,mode:p})}}),yo=_o.length>0?a.jsx(ky,{models:_o,value:Uu,effort:(Q==null?void 0:Q.effort)??null,ultracode:(Q==null?void 0:Q.ultracode)??!1,thinking:(Q==null?void 0:Q.thinking)??!0,switchOnFlag:(Q==null?void 0:Q.switchModelsOnFlag)??!0,showSwitchOnFlag:(Q==null?void 0:Q.provider)!=="antigravity",onModel:p=>{!F||!p||te({type:"control.set_model",sessionId:F,model:p})},onEffort:p=>{F&&te({type:"control.set_effort",sessionId:F,effort:p})},onUltracode:p=>{F&&te({type:"control.set_ultracode",sessionId:F,enabled:p})},onThinking:p=>{F&&te({type:"control.set_thinking",sessionId:F,enabled:p})},onSwitchOnFlag:p=>{F&&te({type:"control.set_flag_switch",sessionId:F,enabled:p})}}):Oa&&a.jsx("span",{className:"badge",children:Oa}),La=Hl&&a.jsx("span",{className:Es?"badge badge--wait":"badge badge--live",children:Es?"ждёт":Jl?"переподключается":"работает"}),Bu=(Q==null?void 0:Q.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Ms=La||Bu,rc=()=>{F&&te({type:"session.reconnect",sessionId:F})},vo=Jl?"Сессия уже поднимает новый процесс":Hl?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Ws=F&&(Jl||(Q==null?void 0:Q.state)==="error")?a.jsxs("div",{className:Jl?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),Jl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:Jl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:rc,children:Jl?"Переподключить сейчас":"Переподключить"})]}):null,ea=Pi?a.jsx(Lk,{handoff:Pi,onContinue:()=>rs(Pi),onShow:()=>ls(Pi),onDismiss:()=>io(Pi.sessionId)}):null,za=Q&&Q.totalCostUsd>0?`$${Q.totalCostUsd.toFixed(3)}`:null,cc=(Q==null?void 0:Q.provider)!=="antigravity"&&a.jsx("button",{className:ya?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":ya,onClick:()=>Yr(p=>!p),children:a.jsx(_E,{})}),jo=Q&&Q.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Ss(Q),children:a.jsx(mE,{})}),us=Q?vl[Q.id]===!0:!1,Ua=I_({onLongPress:()=>{Q&&ao(Q)},onClick:()=>{Q&&Qs(Q)},disabled:us}),Iu=Q&&Q.state!=="closed"&&Q.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:us?"pane-btn pane-btn--handoff is-busy":Ua.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${Ua.thresholdMs}ms`},title:us?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":us,disabled:us,...Ua.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(gE,{})]});return a.jsx(Dp.Provider,{value:eo,children:a.jsxs("div",{className:"app",style:gs.style,children:[a.jsx(zw,{open:We,connected:s,status:c,workspaces:T,archivedWorkspaces:A,workspaceFolders:J,sessionFolders:Y,pinnedFolders:q,projectSessions:G,onRequestSessions:p=>te({type:"session.list",workspaceId:p}),pinned:ge,live:Ne,listOrder:N,liveSessionsFirst:(zt==null?void 0:zt.liveSessionsFirst)===!0,onReorder:Mu,activeWorkspaceId:U,activeSessionId:F,onPinSessions:Pr,onSelectPinned:Wr,onCloseWorkspaces:yd,onRestoreWorkspaces:Au,onArchiveSessions:Cu,onUnarchiveSessions:(p,O)=>{te({type:"session.unarchive",workspaceId:p,sessionIds:O})},onCreateFolder:no,onRenameFolder:Zl,onSetFolderColor:Jr,onDeleteFolder:Rl,onAssignToFolder:ci,onSelectWorkspace:oi,onRenameSession:ro,onStopSession:Ss,onOpenWorkspace:()=>et(!0),onNewSession:lo,enabledProviders:Pe,lastAccountId:ii(ul),onSignInAccount:ui,onOpenExtensions:F&&(Q==null?void 0:Q.provider)!=="antigravity"?()=>ec("mcp"):null,account:ss[Ac]??null,onOpenAccount:ml,relay:f,onOpenRelay:v?null:()=>j(!0),onOpenSettings:tc,themeMode:Vt,onCycleTheme:jt}),Cs("sidebar"),We&&a.jsx("div",{className:"scrim",onClick:()=>st(!1)}),a.jsx(Qj,{open:xn,tree:re,expanded:new Set(Ye),activePath:Vn,dirty:hi,gitChanges:(mn==null?void 0:mn.changed)??[],result:Dr,searchResult:ba,onSearch:Fs,onReveal:lr,onToggle:uo,onOpen:sr,onCreate:di,onRename:nc,onMove:Aa,onCopy:Zn,onDelete:xa,onRefresh:()=>{_s(null),we({}),Fl()},onClose:()=>E(!1),zoomed:en==="files",onToggleZoom:As("files")}),xn&&en!=="files"&&Cs("files"),a.jsx(lw,{open:Ql,result:xu,onSearch:Lu,onOpenMatch:ho,onClose:()=>Xs(!1),zoomed:en==="search",onToggleZoom:As("search")}),Ql&&en!=="search"&&Cs("search"),a.jsx(vN,{open:Nl,state:mn,result:dl,selected:ga,busy:K,onRefresh:Fl,onShow:cs,onCheckout:os,onPush:co,onPull:oo,onPublish:Ou,onConnectRemote:dt,onDismissResult:()=>Pt(null),onClose:()=>Al(!1),zoomed:en==="git",onToggleZoom:As("git")}),Nl&&en!=="git"&&Cs("git"),a.jsxs("main",{className:(en==="main"||en==="terminal"?"main main--zoomed":"main")+(Ml?` main--acct acct--${Ml.color}`:""),children:[m&&x&&a.jsx(Uk,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>st(!0),children:"☰"}),a.jsx("button",{className:xn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":xn,onClick:()=>{E(p=>!p),Al(!1),Xs(!1)},children:a.jsx(dE,{})}),a.jsx("button",{className:Ql?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Ql,onClick:()=>{Xs(p=>!p),E(!1),Al(!1)},children:a.jsx(hE,{})}),a.jsx("button",{className:Nl?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Nl,onClick:()=>{Al(p=>!p),E(!1),Xs(!1)},children:a.jsx(pE,{})}),_a&&a.jsx("button",{className:ni?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ni,onClick:()=>Jc(p=>!p),children:a.jsx(bE,{})}),ut&&cc,ut&&a.jsx("button",{className:It?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":It,onClick:()=>wt(!0),children:a.jsx(yE,{})}),a.jsxs("div",{className:"topbar__id",children:[ct&&Q?a.jsx(ha,{className:"rename--title",value:Q.title??"",onCommit:p=>{ro(Q,p),vt(!1)},onCancel:()=>vt(!1)}):a.jsxs("div",{className:"topbar__head",children:[ut&&Ml&&a.jsx(pu,{account:Ml}),a.jsx("button",{className:"topbar__title",disabled:!Q||ut,title:Q&&!ut?"Переименовать сессию":void 0,onClick:()=>vt(!0),children:(Q==null?void 0:Q.title)??"Claude Code Visual"}),Ea&&a.jsx("span",{className:"topbar__project",title:Ea.path,children:Ea.name})]}),ut?Ms:rr&&a.jsx(Ny,{path:rr})]}),!ut&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:wn?"meters-refresh is-busy":"meters-refresh",title:to,"aria-label":ka,"aria-busy":wn,disabled:!F||wn,onClick:is,children:a.jsx(vE,{})}),Ml&&a.jsx(Vx,{account:Ml,onClick:ml}),a.jsx(Ty,{usage:Sa}),a.jsx(My,{}),ur,yo,Ms,za&&a.jsx("span",{className:"badge badge--cost",children:za}),Iu,jo,cc]})]}),a.jsx(lE,{tokens:(Xt==null?void 0:Xt.tokens)??Be.contextTokens,maxTokens:(Xt==null?void 0:Xt.maxTokens)??null,fetchedAt:(Xt==null?void 0:Xt.fetchedAt)??null}),ut&&It&&a.jsx(ek,{onClose:()=>wt(!1),permission:ur,model:yo,account:Ml&&a.jsx(Vx,{account:Ml}),usage:Sa,cwd:rr,costLabel:za,onRefresh:is,refreshing:wn,metersFetchedAt:Fr,onRename:Q?()=>{vt(!0),wt(!1)}:null,onHandoff:Q&&Q.state!=="closed"&&Q.provider!=="antigravity"?()=>{Qs(Q),wt(!1)}:null,onFreshSession:Q&&Q.state!=="closed"&&Q.provider!=="antigravity"?()=>{ao(Q),wt(!1)}:null,handoffWriting:us,onStop:Q&&Q.state!=="closed"?()=>{Ss(Q),wt(!1)}:null}),Hn.length>0&&a.jsx(jw,{files:Hn,activePath:Vn,busy:Hl,onSelect:bs,onClose:p=>Ns(p),zoomed:en==="main",onToggleZoom:As("main")}),ic?a.jsx(yw,{file:ic,goto:(Lr==null?void 0:Lr.path)===ic.path?Lr:null,onChange:(p,O)=>{Wt(ce=>ce.map(Ae=>Ae.path===p?{...Ae,text:O}:Ae)),mo(p)},onSave:p=>Ul(p),onReload:Js,onOverwrite:p=>Ul(p,!0),onRequestMedia:ks,onTogglePreview:p=>Wt(O=>O.map(ce=>ce.path===p?{...ce,previewMode:!ce.previewMode}:ce))}):a.jsxs(a.Fragment,{children:[a.jsx(Jp,{items:Be.items,busy:Hl&&!Jl,waiting:Es,empty:(Q==null?void 0:Q.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:Nu,historyHasMore:Kx(Qe),historyLoading:Qe.loading,onLoadHistory:Su,sessionId:F??void 0,onEditMessage:(Q==null?void 0:Q.provider)==="antigravity"?void 0:(p,O,ce)=>{if(!F||x)return!1;const Ae=F;return pl(()=>te({type:"prompt.edit",sessionId:Ae,userIndex:p,text:O,images:ce}))}}),Ws,ea,F&&((Ha=Q==null?void 0:Q.tasks)!=null&&Ha.length)?a.jsx(Ew,{tasks:Q.tasks,onStop:p=>te({type:"task.stop",sessionId:F,taskId:p})}):null,Zt&&bo&&Da&&a.jsx(tN,{kind:bo,toolName:Zt.toolName,queued:Be.pending.length-1,onExpand:()=>Ts(Zt.requestId,!1)}),a.jsx(jy,{disabled:!F,busy:Hl&&!Jl,sendBlocked:x,placeholder:Jl?"Промпт уйдёт, как только связь вернётся":(Q==null?void 0:Q.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:sc,sessionTitle:(Q==null?void 0:Q.title)??null,contextResult:fi,draftKey:F,onContextSearch:p=>fo("mention",p),onCommand:Ma,onSend:vd,onInterrupt:()=>{F&&te({type:"control.interrupt",sessionId:F})}})]}),ni&&_a&&a.jsxs(a.Fragment,{children:[!ut&&en!=="terminal"&&a.jsx(Qk,{height:qr.height,onResize:qr.setHeight,onReset:qr.reset}),a.jsx(Jk,{mobile:ut,zoomed:en==="terminal",onToggleZoom:As("terminal"),terminals:Hr,activeId:bu,blocked:Gr,error:gd,onDismissError:()=>Ir(null),height:ut?Ii.height:qr.height,offset:ut?{top:Ii.offsetTop,left:Ii.offsetLeft}:void 0,onSelect:Br,onOpen:jd,onClose:wd,onInput:(p,O)=>te({type:"term.input",id:p,data:O}),onResize:(p,O,ce)=>te({type:"term.resize",id:p,cols:O,rows:ce}),onAttach:p=>te({type:"term.attach",id:p}),onHide:()=>Jc(!1),registerSink:xd})]})]}),a.jsx(YN,{open:ya,items:yu.items,busy:Hu,ready:F!==null,sendBlocked:x,commands:sc,contextResult:Ca,draftKey:F,models:Ps.rows,model:Ps.selected,effort:Pl.effort,ultracode:Pl.ultracode,thinking:Pl.thinking,switchOnFlag:Pl.switchOnFlag,onContextSearch:p=>fo("side",p),onCommand:Ma,onModel:p=>{p&&(Kl(O=>({...O,model:p})),Ll(O=>te({type:"control.set_model",sessionId:O,model:p})))},onEffort:p=>{Kl(O=>({...O,effort:p,ultracode:!1})),Ll(O=>te({type:"control.set_effort",sessionId:O,effort:p}))},onUltracode:p=>{Kl(O=>({...O,ultracode:p,...p?{effort:"xhigh"}:{}})),Ll(O=>te({type:"control.set_ultracode",sessionId:O,enabled:p}))},onThinking:p=>{Kl(O=>({...O,thinking:p})),Ll(O=>te({type:"control.set_thinking",sessionId:O,enabled:p}))},onSwitchOnFlag:p=>{Kl(O=>({...O,switchOnFlag:p})),Ll(O=>te({type:"control.set_flag_switch",sessionId:O,enabled:p}))},onAsk:Dl,onInterrupt:()=>{_u&&te({type:"control.interrupt",sessionId:_u})},onReset:Ol,onClose:()=>Yr(!1),zoomed:en==="ask",onToggleZoom:As("ask")}),ya&&en!=="ask"&&Cs("ask"),(Nl||ya||xn||Ql)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{Al(!1),Yr(!1),E(!1),Xs(!1)}}),Gs&&a.jsx(NN,{detail:Gs,local:((mn==null?void 0:mn.hasRemote)??!1)&&(mn==null?void 0:mn.commits.some(p=>p.hash===Gs.hash&&!p.pushed))===!0,onCheckout:os,onClose:()=>{Dn(null),Vl(null)}}),pe&&a.jsxs(bl,{title:"Лимит плана почти исчерпан",onClose:()=>er(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>er(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>er(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[od[pe.warning.limit][0].toUpperCase(),od[pe.warning.limit].slice(1)," использован на"," ",Math.round(pe.warning.utilization)," %, сброс в"," ",$k(pe.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),I&&a.jsx(bl,{title:"Остановить сессию?",onClose:()=>V(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>V(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{te({type:"session.close",sessionId:I.id}),V(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),_e&&a.jsxs(bl,{title:"Переключить рабочее дерево?",onClose:()=>k(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>k(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:Du,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",_e.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Hl&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),mn&&mn.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",mn.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Nn&&a.jsx(HN,{status:ke,owners:Le,files:Ut,defaultName:(Ea==null?void 0:Ea.name)??"",hasCommits:mn===null||mn.head!=="",busy:K,result:dl,onRefreshStatus:zl,onSaveToken:Zs,onPublish:Kn,onDismissResult:()=>Pt(null),onClose:()=>on(!1)}),gn&&a.jsx($N,{busy:K,result:dl,onSubmit:Qt,onDismissResult:()=>Pt(null),onClose:()=>hl(!1)}),$s&&a.jsx(bl,{title:$s.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>xa(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>xa(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>lc($s),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[$s.path," будет удалён с диска",$s.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Wa&&a.jsx(bl,{title:"Закрыть без сохранения?",onClose:()=>Qn(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Qn(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Ns(Wa,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Ul(Wa),Ns(Wa,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Wa," есть несохранённые правки."]})}),Lt&&a.jsx(nk,{tab:Lt,servers:ae,plugins:Ve,marketplaces:Je,catalog:X,result:Re,auth:Mt,remote:v,actions:Ru,onTab:Et,onClose:()=>Et(null)}),tt&&a.jsx(fk,{accounts:Xn,auth:ss,logins:ll,actions:Ks,activeAccountId:(Ml==null?void 0:Ml.id)??null,error:as,remote:v,runningByAccount:Na,onReconnect:F?()=>{rc(),jn(!1)}:null,reconnectBlocked:Hl,reconnectHint:vo,onClose:()=>jn(!1)}),y&&a.jsx(yk,{state:f,onPair:(p,O)=>te({type:"relay.pair",code:p,...O?{name:O}:{}}),onUnpair:()=>te({type:"relay.unpair"}),onClose:()=>j(!1)}),fl&&a.jsx(Dk,{settings:zt,models:(Oe==null?void 0:Oe.models)??[],relayState:f,networkState:m,local:Vf()==="local",onChange:nr,onEnableShell:()=>te({type:"relay.shell.enable"}),onDisableShell:()=>te({type:"relay.shell.disable"}),onOpenRelay:()=>{pn(!1),j(!0)},onClose:()=>pn(!1)}),Te&&a.jsx(uN,{candidates:At,searching:Fe,agentItems:tl.items,agentBusy:(St==null?void 0:St.state)==="running",error:dn,roots:ol,created:Ft,onSearch:Eu,onAskAgent:Tu,onInterrupt:()=>{const p=Vi.current;p&&te({type:"control.interrupt",sessionId:p})},onSubmit:Ta,onCreate:ku,onClose:_d}),Zt!=null&&Zt.questions&&Zt.questions.length>0?a.jsx(lN,{request:{...Zt,questions:Zt.questions},queued:Be.pending.length-1,collapsed:Da,onCollapse:()=>Ts(Zt.requestId,!0),onAnswer:En,onDecline:go}):Zt&&ac!==null?a.jsx(WS,{request:Zt,plan:ac,queued:Be.pending.length-1,collapsed:Da,onCollapse:()=>Ts(Zt.requestId,!0),onAccept:ar,onDecline:ir}):Zt&&a.jsx(nN,{request:Zt,queued:Be.pending.length-1,collapsed:Da,onCollapse:()=>Ts(Zt.requestId,!0),onDecide:Sd}),vn&&a.jsx(zk,{handoff:vn,onClose:()=>ls(null)}),a.jsx(Ik,{notices:Cl,onDismiss:p=>cn(O=>O.filter(ce=>ce.id!==p))})]})})}function dE(){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 hE(){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 pE(){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 mE(){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 gE(){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 xE(l,s){return v_(l)===v_(s)}function v_(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function bE(){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 _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:"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 yE(){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 vE(){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 Ly=document.getElementById("root");if(!Ly)throw new Error("#root not found");sv.createRoot(Ly).render(a.jsx(b.StrictMode,{children:a.jsx(fE,{})}));export{fj as D,nn as I,sn as N,SE as P,ps as T,Bs as a,ey as b,Yl as c,wE as d,ay as e,fu as f,Aj as h,NE as p,kE as s,De as t};