@i14ks/ccv 0.10.0 → 0.11.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 (25) hide show
  1. package/bundle/ccv.mjs +359 -121
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-DKsnpugS.js → codemirror-BVMwXG_R.js} +1 -1
  4. package/web/assets/{index-cSZKYcZu.js → index-AByrn5FE.js} +1 -1
  5. package/web/assets/{index-NZmn_bzd.js → index-BCAmULlL.js} +1 -1
  6. package/web/assets/{index-yzGIJ5xe.js → index-BFLfK-j6.js} +1 -1
  7. package/web/assets/{index-AUibZMHd.js → index-BZ8Mi5_8.js} +1 -1
  8. package/web/assets/{index-C3yVGgV2.js → index-BlZDoET-.js} +1 -1
  9. package/web/assets/{index-u3kUuJkV.js → index-BsH-IJBy.js} +1 -1
  10. package/web/assets/{index-MFoRbG31.js → index-Bu_Ukh1_.js} +1 -1
  11. package/web/assets/{index-CT4Ig6AX.js → index-C-geC5VJ.js} +1 -1
  12. package/web/assets/{index-ClY-NTKp.js → index-C1BT9XMC.js} +1 -1
  13. package/web/assets/{index-Cw4Jg8_d.js → index-C59fVtiO.js} +1 -1
  14. package/web/assets/{index-CNmvdMxt.js → index-CPWAVXhz.js} +1 -1
  15. package/web/assets/{index-nV6tsVmQ.js → index-CrW8SGCA.js} +1 -1
  16. package/web/assets/{index-BCiq-pRA.js → index-DAjl7nVl.js} +1 -1
  17. package/web/assets/{index-B7Kjuy7B.js → index-DJYXqBtm.js} +1 -1
  18. package/web/assets/{index-BwqyDurx.js → index-DKofSKA7.js} +1 -1
  19. package/web/assets/{index-vmz_RdEe.js → index-DLDXVZaf.js} +1 -1
  20. package/web/assets/index-DRlKZHMW.js +132 -0
  21. package/web/assets/{index-BaxFm2-f.js → index-Ey94wZ1k.js} +1 -1
  22. package/web/assets/{index-CiZ3hw4e.js → index-gl1MvN4b.js} +1 -1
  23. package/web/assets/{index-CZMbzOzb.js → index-mnefozuu.js} +1 -1
  24. package/web/index.html +1 -1
  25. package/web/assets/index-BVL_B_hC.js +0 -132
@@ -1,132 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-NZmn_bzd.js","./index-CiZ3hw4e.js","./index-BwqyDurx.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-MFoRbG31.js","./index-yzGIJ5xe.js","./index-CNmvdMxt.js","./index-cSZKYcZu.js","./index-C3yVGgV2.js","./index-ClY-NTKp.js","./index-AUibZMHd.js","./index-u3kUuJkV.js","./index-B7Kjuy7B.js","./index-CZMbzOzb.js","./index-vmz_RdEe.js","./index-nV6tsVmQ.js","./index-BCiq-pRA.js","./index-CT4Ig6AX.js","./index-Cw4Jg8_d.js","./index-BaxFm2-f.js","./codemirror-DKsnpugS.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 Y_=Object.defineProperty;var Fg=a=>{throw TypeError(a)};var X_=(a,l,i)=>l in a?Y_(a,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[l]=i;var kt=(a,l,i)=>X_(a,typeof l!="symbol"?l+"":l,i),Fd=(a,l,i)=>l.has(a)||Fg("Cannot "+i);var Be=(a,l,i)=>(Fd(a,l,"read from private field"),i?i.call(a):l.get(a)),$t=(a,l,i)=>l.has(a)?Fg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,i),dt=(a,l,i,c)=>(Fd(a,l,"write to private field"),c?c.call(a,i):l.set(a,i),i),yn=(a,l,i)=>(Fd(a,l,"access private method"),i);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=i(o);fetch(o.href,d)}})();var Wd={exports:{}},Dc={};/**
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 Wg;function V_(){if(Wg)return Dc;Wg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var p in o)p!=="key"&&(d[p]=o[p])}else d=o;return o=d.ref,{$$typeof:a,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Dc.Fragment=l,Dc.jsx=i,Dc.jsxs=i,Dc}var Pg;function $_(){return Pg||(Pg=1,Wd.exports=V_()),Wd.exports}var r=$_(),Pd={exports:{}},Ge={};/**
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 eb;function Q_(){if(eb)return Ge;eb=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,U={};function P(N,$,ce){this.props=N,this.context=$,this.refs=U,this.updater=ce||k}P.prototype.isReactComponent={},P.prototype.setState=function(N,$){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,$,"setState")},P.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function M(){}M.prototype=P.prototype;function Q(N,$,ce){this.props=N,this.context=$,this.refs=U,this.updater=ce||k}var w=Q.prototype=new M;w.constructor=Q,L(w,P.prototype),w.isPureReactComponent=!0;var K=Array.isArray;function z(){}var A={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function te(N,$,ce){var he=ce.ref;return{$$typeof:a,type:N,key:$,ref:he!==void 0?he:null,props:ce}}function oe(N,$){return te(N.type,$,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===a}function ae(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ce){return $[ce]})}var me=/\/+/g;function Ae(N,$){return typeof N=="object"&&N!==null&&N.key!=null?ae(""+N.key):$.toString(36)}function be(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(z,z):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function H(N,$,ce,he,we){var ye=typeof N;(ye==="undefined"||ye==="boolean")&&(N=null);var Me=!1;if(N===null)Me=!0;else switch(ye){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(N.$$typeof){case a:case l:Me=!0;break;case y:return Me=N._init,H(Me(N._payload),$,ce,he,we)}}if(Me)return we=we(N),Me=he===""?"."+Ae(N,0):he,K(we)?(ce="",Me!=null&&(ce=Me.replace(me,"$&/")+"/"),H(we,$,ce,"",function(Mt){return Mt})):we!=null&&(F(we)&&(we=oe(we,ce+(we.key==null||N&&N.key===we.key?"":(""+we.key).replace(me,"$&/")+"/")+Me)),$.push(we)),1;Me=0;var at=he===""?".":he+":";if(K(N))for(var Ve=0;Ve<N.length;Ve++)he=N[Ve],ye=at+Ae(he,Ve),Me+=H(he,$,ce,ye,we);else if(Ve=C(N),typeof Ve=="function")for(N=Ve.call(N),Ve=0;!(he=N.next()).done;)he=he.value,ye=at+Ae(he,Ve++),Me+=H(he,$,ce,ye,we);else if(ye==="object"){if(typeof N.then=="function")return H(be(N),$,ce,he,we);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Me}function re(N,$,ce){if(N==null)return N;var he=[],we=0;return H(N,he,"","",function(ye){return $.call(ce,ye,we++)}),he}function se(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(ce){(N._status===0||N._status===-1)&&(N._status=1,N._result=ce)},function(ce){(N._status===0||N._status===-1)&&(N._status=2,N._result=ce)}),N._status===-1&&(N._status=0,N._result=$)}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 $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Ne={map:re,forEach:function(N,$,ce){re(N,function(){$.apply(this,arguments)},ce)},count:function(N){var $=0;return re(N,function(){$++}),$},toArray:function(N){return re(N,function($){return $})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ge.Activity=j,Ge.Children=Ne,Ge.Component=P,Ge.Fragment=i,Ge.Profiler=o,Ge.PureComponent=Q,Ge.StrictMode=c,Ge.Suspense=m,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(N){return A.H.useMemoCache(N)}},Ge.cache=function(N){return function(){return N.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(N,$,ce){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var he=L({},N.props),we=N.key;if($!=null)for(ye in $.key!==void 0&&(we=""+$.key),$)!V.call($,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&$.ref===void 0||(he[ye]=$[ye]);var ye=arguments.length-2;if(ye===1)he.children=ce;else if(1<ye){for(var Me=Array(ye),at=0;at<ye;at++)Me[at]=arguments[at+2];he.children=Me}return te(N.type,we,he)},Ge.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:d,_context:N},N},Ge.createElement=function(N,$,ce){var he,we={},ye=null;if($!=null)for(he in $.key!==void 0&&(ye=""+$.key),$)V.call($,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(we[he]=$[he]);var Me=arguments.length-2;if(Me===1)we.children=ce;else if(1<Me){for(var at=Array(Me),Ve=0;Ve<Me;Ve++)at[Ve]=arguments[Ve+2];we.children=at}if(N&&N.defaultProps)for(he in Me=N.defaultProps,Me)we[he]===void 0&&(we[he]=Me[he]);return te(N,ye,we)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(N){return{$$typeof:p,render:N}},Ge.isValidElement=F,Ge.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:se}},Ge.memo=function(N,$){return{$$typeof:x,type:N,compare:$===void 0?null:$}},Ge.startTransition=function(N){var $=A.T,ce={};A.T=ce;try{var he=N(),we=A.S;we!==null&&we(ce,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(z,pe)}catch(ye){pe(ye)}finally{$!==null&&ce.types!==null&&($.types=ce.types),A.T=$}},Ge.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ge.use=function(N){return A.H.use(N)},Ge.useActionState=function(N,$,ce){return A.H.useActionState(N,$,ce)},Ge.useCallback=function(N,$){return A.H.useCallback(N,$)},Ge.useContext=function(N){return A.H.useContext(N)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(N,$){return A.H.useDeferredValue(N,$)},Ge.useEffect=function(N,$){return A.H.useEffect(N,$)},Ge.useEffectEvent=function(N){return A.H.useEffectEvent(N)},Ge.useId=function(){return A.H.useId()},Ge.useImperativeHandle=function(N,$,ce){return A.H.useImperativeHandle(N,$,ce)},Ge.useInsertionEffect=function(N,$){return A.H.useInsertionEffect(N,$)},Ge.useLayoutEffect=function(N,$){return A.H.useLayoutEffect(N,$)},Ge.useMemo=function(N,$){return A.H.useMemo(N,$)},Ge.useOptimistic=function(N,$){return A.H.useOptimistic(N,$)},Ge.useReducer=function(N,$,ce){return A.H.useReducer(N,$,ce)},Ge.useRef=function(N){return A.H.useRef(N)},Ge.useState=function(N){return A.H.useState(N)},Ge.useSyncExternalStore=function(N,$,ce){return A.H.useSyncExternalStore(N,$,ce)},Ge.useTransition=function(){return A.H.useTransition()},Ge.version="19.2.8",Ge}var tb;function Lh(){return tb||(tb=1,Pd.exports=Q_()),Pd.exports}var _=Lh(),eh={exports:{}},zc={},th={exports:{}},nh={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var nb;function Z_(){return nb||(nb=1,(function(a){function l(H,re){var se=H.length;H.push(re);e:for(;0<se;){var pe=se-1>>>1,Ne=H[pe];if(0<o(Ne,re))H[pe]=re,H[se]=Ne,se=pe;else break e}}function i(H){return H.length===0?null:H[0]}function c(H){if(H.length===0)return null;var re=H[0],se=H.pop();if(se!==re){H[0]=se;e:for(var pe=0,Ne=H.length,N=Ne>>>1;pe<N;){var $=2*(pe+1)-1,ce=H[$],he=$+1,we=H[he];if(0>o(ce,se))he<Ne&&0>o(we,ce)?(H[pe]=we,H[he]=se,pe=he):(H[pe]=ce,H[$]=se,pe=$);else if(he<Ne&&0>o(we,se))H[pe]=we,H[he]=se,pe=he;else break e}}return re}function o(H,re){var se=H.sortIndex-re.sortIndex;return se!==0?se:H.id-re.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var m=[],x=[],y=1,j=null,v=3,C=!1,k=!1,L=!1,U=!1,P=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function w(H){for(var re=i(x);re!==null;){if(re.callback===null)c(x);else if(re.startTime<=H)c(x),re.sortIndex=re.expirationTime,l(m,re);else break;re=i(x)}}function K(H){if(L=!1,w(H),!k)if(i(m)!==null)k=!0,z||(z=!0,ae());else{var re=i(x);re!==null&&be(K,re.startTime-H)}}var z=!1,A=-1,V=5,te=-1;function oe(){return U?!0:!(a.unstable_now()-te<V)}function F(){if(U=!1,z){var H=a.unstable_now();te=H;var re=!0;try{e:{k=!1,L&&(L=!1,M(A),A=-1),C=!0;var se=v;try{t:{for(w(H),j=i(m);j!==null&&!(j.expirationTime>H&&oe());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var Ne=pe(j.expirationTime<=H);if(H=a.unstable_now(),typeof Ne=="function"){j.callback=Ne,w(H),re=!0;break t}j===i(m)&&c(m),w(H)}else c(m);j=i(m)}if(j!==null)re=!0;else{var N=i(x);N!==null&&be(K,N.startTime-H),re=!1}}break e}finally{j=null,v=se,C=!1}re=void 0}}finally{re?ae():z=!1}}}var ae;if(typeof Q=="function")ae=function(){Q(F)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,Ae=me.port2;me.port1.onmessage=F,ae=function(){Ae.postMessage(null)}}else ae=function(){P(F,0)};function be(H,re){A=P(function(){H(a.unstable_now())},re)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(H){H.callback=null},a.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<H?Math.floor(1e3/H):5},a.unstable_getCurrentPriorityLevel=function(){return v},a.unstable_next=function(H){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var se=v;v=re;try{return H()}finally{v=se}},a.unstable_requestPaint=function(){U=!0},a.unstable_runWithPriority=function(H,re){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var se=v;v=H;try{return re()}finally{v=se}},a.unstable_scheduleCallback=function(H,re,se){var pe=a.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?pe+se:pe):se=pe,H){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=se+Ne,H={id:y++,callback:re,priorityLevel:H,startTime:se,expirationTime:Ne,sortIndex:-1},se>pe?(H.sortIndex=se,l(x,H),i(m)===null&&H===i(x)&&(L?(M(A),A=-1):L=!0,be(K,se-pe))):(H.sortIndex=Ne,l(m,H),k||C||(k=!0,z||(z=!0,ae()))),H},a.unstable_shouldYield=oe,a.unstable_wrapCallback=function(H){var re=v;return function(){var se=v;v=re;try{return H.apply(this,arguments)}finally{v=se}}}})(nh)),nh}var lb;function K_(){return lb||(lb=1,th.exports=Z_()),th.exports}var lh={exports:{}},Qn={};/**
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 ab;function J_(){if(ab)return Qn;ab=1;var a=Lh();function l(m){var x="https://react.dev/errors/"+m;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 #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var c={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(m,x,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:m,containerInfo:x,implementation:y}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,x){if(m==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Qn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Qn.createPortal=function(m,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(l(299));return d(m,x,null,y)},Qn.flushSync=function(m){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,m)return m()}finally{h.T=x,c.p=y,c.d.f()}},Qn.preconnect=function(m,x){typeof m=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(m,x))},Qn.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},Qn.preinit=function(m,x){if(typeof m=="string"&&x&&typeof x.as=="string"){var y=x.as,j=p(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,C=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(m,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):y==="script"&&c.d.X(m,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Qn.preinitModule=function(m,x){if(typeof m=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=p(x.as,x.crossOrigin);c.d.M(m,{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(m)},Qn.preload=function(m,x){if(typeof m=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=p(y,x.crossOrigin);c.d.L(m,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})}},Qn.preloadModule=function(m,x){if(typeof m=="string")if(x){var y=p(x.as,x.crossOrigin);c.d.m(m,{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(m)},Qn.requestFormReset=function(m){c.d.r(m)},Qn.unstable_batchedUpdates=function(m,x){return m(x)},Qn.useFormState=function(m,x,y){return h.H.useFormState(m,x,y)},Qn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Qn.version="19.2.8",Qn}var sb;function F_(){if(sb)return lh.exports;sb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),lh.exports=J_(),lh.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 ib;function W_(){if(ib)return zc;ib=1;var a=K_(),l=Lh(),i=F_();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(d(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,s=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){n=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return m(u),e;if(f===s)return m(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==s.return)n=u,s=f;else{for(var b=!1,S=u.child;S;){if(S===n){b=!0,n=u,s=f;break}if(S===s){b=!0,s=u,n=f;break}S=S.sibling}if(!b){for(S=f.child;S;){if(S===n){b=!0,n=f,s=u;break}if(S===s){b=!0,s=f,n=u;break}S=S.sibling}if(!b)throw Error(c(189))}}if(n.alternate!==s)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"),C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case P:return"Profiler";case U:return"StrictMode";case K:return"Suspense";case z:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case Q:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case w:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A:return t=e.displayName||null,t!==null?t:Ae(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return Ae(e(t))}catch{}}return null}var be=Array.isArray,H=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},pe=[],Ne=-1;function N(e){return{current:e}}function $(e){0>Ne||(e.current=pe[Ne],pe[Ne]=null,Ne--)}function ce(e,t){Ne++,pe[Ne]=e.current,e.current=t}var he=N(null),we=N(null),ye=N(null),Me=N(null);function at(e,t){switch(ce(ye,t),ce(we,e),ce(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_g(t),e=vg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(he),ce(he,e)}function Ve(){$(he),$(we),$(ye)}function Mt(e){e.memoizedState!==null&&ce(Me,e);var t=he.current,n=vg(t,e.type);t!==n&&(ce(we,e),ce(he,n))}function Ie(e){we.current===e&&($(he),$(we)),Me.current===e&&($(Me),Cc._currentValue=se)}var bt,We;function Ze(e){if(bt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);bt=t&&t[1]||"",We=-1<n.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+bt+e+We}var Ke=!1;function st(e,t){if(!e||Ke)return"";Ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(W){var Z=W}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(W){Z=W}e.call(ie.prototype)}}else{try{throw Error()}catch(W){Z=W}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(W){if(W&&Z&&typeof W.stack=="string")return[W.stack,Z.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),b=f[0],S=f[1];if(b&&S){var R=b.split(`
45
- `),X=S.split(`
46
- `);for(u=s=0;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;for(;u<X.length&&!X[u].includes("DetermineComponentFrameRoot");)u++;if(s===R.length||u===X.length)for(s=R.length-1,u=X.length-1;1<=s&&0<=u&&R[s]!==X[u];)u--;for(;1<=s&&0<=u;s--,u--)if(R[s]!==X[u]){if(s!==1||u!==1)do if(s--,u--,0>u||R[s]!==X[u]){var ee=`
47
- `+R[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=u);break}}}finally{Ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ze(n):""}function Jn(e,t){switch(e.tag){case 26:case 27:case 5:return Ze(e.type);case 16:return Ze("Lazy");case 13:return e.child!==t&&t!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return st(e.type,!1);case 11:return st(e.type.render,!1);case 1:return st(e.type,!0);case 31:return Ze("Activity");default:return""}}function Ht(e){try{var t="",n=null;do t+=Jn(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
48
- Error generating stack: `+s.message+`
49
- `+s.stack}}var Bt=Object.prototype.hasOwnProperty,Qt=a.unstable_scheduleCallback,qt=a.unstable_cancelCallback,It=a.unstable_shouldYield,Xt=a.unstable_requestPaint,it=a.unstable_now,Nt=a.unstable_getCurrentPriorityLevel,Pt=a.unstable_ImmediatePriority,wn=a.unstable_UserBlockingPriority,At=a.unstable_NormalPriority,vn=a.unstable_LowPriority,Tn=a.unstable_IdlePriority,Ot=a.log,cn=a.unstable_setDisableYieldValue,Zt=null,wt=null;function un(e){if(typeof Ot=="function"&&cn(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Zt,e)}catch{}}var ut=Math.clz32?Math.clz32:Y,en=Math.log,E=Math.LN2;function Y(e){return e>>>=0,e===0?32:31-(en(e)/E|0)|0}var _e=256,O=262144,J=4194304;function xe(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 qe(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var u=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~f,s!==0?u=xe(s):(b&=S,b!==0?u=xe(b):n||(n=S&~e,n!==0&&(u=xe(n))))):(S=s&~f,S!==0?u=xe(S):b!==0?u=xe(b):n||(n=s&~e,n!==0&&(u=xe(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function Tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Sn(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 jn(){var e=J;return J<<=1,(J&62914560)===0&&(J=4194304),e}function Ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Al(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ka(e,t,n,s,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,X=e.hiddenUpdates;for(n=b&~n;0<n;){var ee=31-ut(n),ie=1<<ee;S[ee]=0,R[ee]=-1;var Z=X[ee];if(Z!==null)for(X[ee]=null,ee=0;ee<Z.length;ee++){var W=Z[ee];W!==null&&(W.lane&=-536870913)}n&=~ie}s!==0&&Na(e,s,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function Na(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ut(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function $s(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ut(n),u=1<<s;u&t|e[s]&t&&(e[s]|=t),n&=~u}}function Ul(e,t){var n=t&-t;return n=(n&42)!==0?1:Kl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Kl(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 on(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wa(){var e=re.p;return e!==0?e:(e=window.event,e===void 0?32:Xg(e.type))}function gl(e,t){var n=re.p;try{return re.p=e,t()}finally{re.p=n}}var rl=Math.random().toString(36).slice(2),Kt="__reactFiber$"+rl,Qe="__reactProps$"+rl,Fn="__reactContainer$"+rl,Qs="__reactEvents$"+rl,Bi="__reactListeners$"+rl,Zs="__reactHandles$"+rl,Jl="__reactResources$"+rl,Fl="__reactMarker$"+rl;function Ta(e){delete e[Kt],delete e[Qe],delete e[Qs],delete e[Bi],delete e[Zs]}function Wl(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Eg(e);e!==null;){if(n=e[Kt])return n;e=Eg(e)}return t}e=n,n=e.parentNode}return null}function bl(e){if(e=e[Kt]||e[Fn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function tn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function nn(e){var t=e[Jl];return t||(t=e[Jl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[Fl]=!0}var In=new Set,Ea={};function Gn(e,t){Yn(e,t),Yn(e+"Capture",t)}function Yn(e,t){for(Ea[e]=t,e=0;e<t.length;e++)In.add(t[e])}var Xn=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]*$"),Pl={},Wn={};function Ks(e){return Bt.call(Wn,e)?!0:Bt.call(Pl,e)?!1:Xn.test(e)?Wn[e]=!0:(Pl[e]=!0,!1)}function En(e,t,n){if(Ks(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function On(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 fn(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Aa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gr(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ea(e){if(!e._valueTracker){var t=Aa(e)?"checked":"value";e._valueTracker=Gr(e,t,""+e[t])}}function ta(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Aa(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ca(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 Ra=/[\n"\\]/g;function Dn(e){return e.replace(Ra,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xl(e,t,n,s,u,f,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?na(e,b,xt(t)):n!=null?na(e,b,xt(n)):s!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+xt(S):e.removeAttribute("name")}function Hl(e,t,n,s,u,f,b,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){ea(e);return}n=n!=null?""+xt(n):"",t=t!=null?""+xt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),ea(e)}function na(e,t,n){t==="number"&&Ca(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function cl(e,t,n,s){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&&s&&(e[n].defaultSelected=!0)}else{for(n=""+xt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,s&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function fe(e,t,n){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xt(n):""}function T(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(c(92));if(be(s)){if(1<s.length)throw Error(c(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=xt(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),ea(e)}function I(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ue=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 ve(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||ue.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function De(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var u in t)s=t[u],t.hasOwnProperty(u)&&n[u]!==s&&ve(e,u,s)}else for(var f in t)t.hasOwnProperty(f)&&ve(e,f,t[f])}function Le(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ht=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ln(e){return dn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rt(){}var hn=null;function Gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var la=null,Cl=null;function aa(e){var t=bl(e);if(t&&(e=t.stateNode)){var n=e[Qe]||null;e:switch(e=t.stateNode,t.type){case"input":if(xl(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 s=n[t];if(s!==e&&s.form===e.form){var u=s[Qe]||null;if(!u)throw Error(c(90));xl(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&ta(s)}break e;case"textarea":fe(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&cl(e,!!n.multiple,t,!1)}}}var as=!1;function qi(e,t,n){if(as)return e(t,n);as=!0;try{var s=e(t);return s}finally{if(as=!1,(la!==null||Cl!==null)&&(Wu(),la&&(t=la,e=Cl,Cl=la=null,aa(t),e)))for(t=0;t<e.length;t++)aa(e[t])}}function Js(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Qe]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fs=!1;if(zn)try{var ss={};Object.defineProperty(ss,"passive",{get:function(){Fs=!0}}),window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{Fs=!1}var yl=null,Ii=null,Ma=null;function Rl(){if(Ma)return Ma;var e,t=Ii,n=t.length,s,u="value"in yl?yl.value:yl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var b=n-e;for(s=1;s<=b&&t[n-s]===u[f-s];s++);return Ma=u.slice(e,1<s?1-s:void 0)}function Oa(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 sa(){return!0}function ia(){return!1}function pn(e){function t(n,s,u,f,b){this._reactName=n,this._targetInst=u,this.type=s,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?sa:ia,this.isPropagationStopped=ia,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=sa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sa)},persist:function(){},isPersistent:sa}),t}var pt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},is=pn(pt),Ws=j({},pt,{view:0,detail:0}),Fo=pn(Ws),Gi,rs,an,Vt=j({},Ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xr,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!==an&&(an&&e.type==="mousemove"?(Gi=e.screenX-an.screenX,rs=e.screenY-an.screenY):rs=Gi=0,an=e),Gi)},movementY:function(e){return"movementY"in e?e.movementY:rs}}),Yr=pn(Vt),Pc=j({},Vt,{dataTransfer:0}),Bl=pn(Pc),eu=j({},Ws,{relatedTarget:0}),cs=pn(eu),Yi=j({},pt,{animationName:0,elapsedTime:0,pseudoElement:0}),Ps=pn(Yi),Da=j({},pt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tu=pn(Da),ei=j({},pt,{data:0}),ti=pn(ei),ni={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},li={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"},nu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ai(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nu[e])?!!t[e]:!1}function Xr(){return ai}var ne=j({},Ws,{key:function(e){if(e.key){var t=ni[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?li[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xr,charCode:function(e){return e.type==="keypress"?Oa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),us=pn(ne),Vr=j({},Vt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lu=pn(Vr),Wo=j({},Ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xr}),Po=pn(Wo),Se=j({},pt,{propertyName:0,elapsedTime:0,pseudoElement:0}),os=pn(Se),ef=j({},Vt,{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}),tf=pn(ef),nf=j({},pt,{newState:0,oldState:0}),lf=pn(nf),af=[9,13,27,32],za=zn&&"CompositionEvent"in window,si=null;zn&&"documentMode"in document&&(si=document.documentMode);var sf=zn&&"TextEvent"in window&&!si,au=zn&&(!za||si&&8<si&&11>=si),$r=" ",su=!1;function iu(e,t){switch(e){case"keyup":return af.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xi(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var La=!1;function ru(e,t){switch(e){case"compositionend":return Xi(t);case"keypress":return t.which!==32?null:(su=!0,$r);case"textInput":return e=t.data,e===$r&&su?null:e;default:return null}}function rf(e,t){if(La)return e==="compositionend"||!za&&iu(e,t)?(e=Rl(),Ma=Ii=yl=null,La=!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 au&&t.locale!=="ko"?null:t.data;default:return null}}var cu={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 Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cu[e.type]:t==="textarea"}function uu(e,t,n,s){la?Cl?Cl.push(s):Cl=[s]:la=s,t=so(t,"onChange"),0<t.length&&(n=new is("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ii=null,ri=null;function cf(e){pg(e,0)}function ra(e){var t=tn(e);if(ta(t))return e}function Qr(e,t){if(e==="change")return t}var ou=!1;if(zn){var $i;if(zn){var Zr="oninput"in document;if(!Zr){var fu=document.createElement("div");fu.setAttribute("oninput","return;"),Zr=typeof fu.oninput=="function"}$i=Zr}else $i=!1;ou=$i&&(!document.documentMode||9<document.documentMode)}function du(){ii&&(ii.detachEvent("onpropertychange",hu),ri=ii=null)}function hu(e){if(e.propertyName==="value"&&ra(ri)){var t=[];uu(t,ri,e,Gt(e)),qi(cf,t)}}function uf(e,t,n){e==="focusin"?(du(),ii=t,ri=n,ii.attachEvent("onpropertychange",hu)):e==="focusout"&&du()}function of(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ra(ri)}function ff(e,t){if(e==="click")return ra(t)}function df(e,t){if(e==="input"||e==="change")return ra(t)}function hf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:hf;function ci(e,t){if(Pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var u=n[s];if(!Bt.call(t,u)||!Pn(e[u],t[u]))return!1}return!0}function pu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=pu(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pu(n)}}function mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ca(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=Ca(e.document)}return t}function Jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var pf=zn&&"documentMode"in document&&11>=document.documentMode,ca=null,ui=null,ua=null,Fr=!1;function bu(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||ca==null||ca!==Ca(s)||(s=ca,"selectionStart"in s&&Jr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ua&&ci(ua,s)||(ua=s,s=so(ui,"onSelect"),0<s.length&&(t=new is("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ca)))}function Ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var fs={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionrun:Ua("Transition","TransitionRun"),transitionstart:Ua("Transition","TransitionStart"),transitioncancel:Ua("Transition","TransitionCancel"),transitionend:Ua("Transition","TransitionEnd")},Wr={},xu={};zn&&(xu=document.createElement("div").style,"AnimationEvent"in window||(delete fs.animationend.animation,delete fs.animationiteration.animation,delete fs.animationstart.animation),"TransitionEvent"in window||delete fs.transitionend.transition);function Ha(e){if(Wr[e])return Wr[e];if(!fs[e])return e;var t=fs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in xu)return Wr[e]=t[n];return e}var yu=Ha("animationend"),_u=Ha("animationiteration"),vu=Ha("animationstart"),mf=Ha("transitionrun"),gf=Ha("transitionstart"),bf=Ha("transitioncancel"),Su=Ha("transitionend"),ju=new Map,Pr="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(" ");Pr.push("scrollEnd");function _l(e,t){ju.set(e,t),Gn(t,[e])}var oi=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)},el=[],ql=0,tl=0;function Vn(){for(var e=ql,t=tl=ql=0;t<e;){var n=el[t];el[t++]=null;var s=el[t];el[t++]=null;var u=el[t];el[t++]=null;var f=el[t];if(el[t++]=null,s!==null&&u!==null){var b=s.pending;b===null?u.next=u:(u.next=b.next,b.next=u),s.pending=u}f!==0&&ec(n,u,f)}}function An(e,t,n,s){el[ql++]=e,el[ql++]=t,el[ql++]=n,el[ql++]=s,tl|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Qi(e,t,n,s){return An(e,t,n,s),Ba(e)}function Il(e,t){return An(e,null,null,t),Ba(e)}function ec(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,s=f.alternate,s!==null&&(s.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-ut(n),e=f.hiddenUpdates,s=e[u],s===null?e[u]=[t]:s.push(t),t.lane=n|536870912),f):null}function Ba(e){if(50<jc)throw jc=0,vd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var qa={};function xf(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kn(e,t,n,s){return new xf(e,t,n,s)}function Zi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gl(e,t){var n=e.alternate;return n===null?(n=kn(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 Ki(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 Ji(e,t,n,s,u,f){var b=0;if(s=e,typeof e=="function")Zi(e)&&(b=1);else if(typeof e=="string")b=R_(e,n,he.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=kn(31,n,t,u),e.elementType=te,e.lanes=f,e;case L:return vl(n.children,u,f,t);case U:b=8,u|=24;break;case P:return e=kn(12,n,t,u|2),e.elementType=P,e.lanes=f,e;case K:return e=kn(13,n,t,u),e.elementType=K,e.lanes=f,e;case z:return e=kn(19,n,t,u),e.elementType=z,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:b=10;break e;case M:b=9;break e;case w:b=11;break e;case A:b=14;break e;case V:b=16,s=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),s=null}return t=kn(b,n,t,u),t.elementType=e,t.type=s,t.lanes=f,t}function vl(e,t,n,s){return e=kn(7,e,s,t),e.lanes=n,e}function oa(e,t,n){return e=kn(6,e,null,t),e.lanes=n,e}function tc(e){var t=kn(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var nc=new WeakMap;function nl(e,t){if(typeof e=="object"&&e!==null){var n=nc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ht(t)},nc.set(e,t),t)}return{value:e,source:t,stack:Ht(t)}}var ds=[],hs=0,ps=null,ms=0,ll=[],g=0,q=null,de=1,Ue="";function mt(e,t){ds[hs++]=ms,ds[hs++]=ps,ps=e,ms=t}function $n(e,t,n){ll[g++]=de,ll[g++]=Ue,ll[g++]=q,q=e;var s=de;e=Ue;var u=32-ut(s)-1;s&=~(1<<u),n+=1;var f=32-ut(t)+u;if(30<f){var b=u-u%5;f=(s&(1<<b)-1).toString(32),s>>=b,u-=b,de=1<<32-ut(t)+u|n<<u|s,Ue=f+e}else de=1<<f|n<<u|s,Ue=e}function al(e){e.return!==null&&(mt(e,1),$n(e,1,0))}function Ia(e){for(;e===ps;)ps=ds[--hs],ds[hs]=null,ms=ds[--hs],ds[hs]=null;for(;e===q;)q=ll[--g],ll[g]=null,Ue=ll[--g],ll[g]=null,de=ll[--g],ll[g]=null}function Ce(e,t){ll[g++]=de,ll[g++]=Ue,ll[g++]=q,de=t.id,Ue=t.overflow,q=e}var je=null,Te=null,Oe=!1,lt=null,Jt=!1,fi=Error(c(519));function gs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lc(nl(t,e)),fi}function tp(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Kt]=e,t[Qe]=s,n){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(n=0;n<Nc.length;n++)Fe(Nc[n],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),Hl(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),T(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||xg(t.textContent,n)?(s.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),s.onScroll!=null&&Fe("scroll",t),s.onScrollEnd!=null&&Fe("scrollend",t),s.onClick!=null&&(t.onclick=Rt),t=!0):t=!1,t||gs(e,!0)}function np(e){for(je=e.return;je;)switch(je.tag){case 5:case 31:case 13:Jt=!1;return;case 27:case 3:Jt=!0;return;default:je=je.return}}function Wi(e){if(e!==je)return!1;if(!Oe)return np(e),Oe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Ld(e.type,e.memoizedProps)),n=!n),n&&Te&&gs(e),np(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Te=Tg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Te=Tg(e)}else t===27?(t=Te,Cs(e.type)?(e=Id,Id=null,Te=e):Te=t):Te=je?Ol(e.stateNode.nextSibling):null;return!0}function di(){Te=je=null,Oe=!1}function yf(){var e=lt;return e!==null&&(dl===null?dl=e:dl.push.apply(dl,e),lt=null),e}function lc(e){lt===null?lt=[e]:lt.push(e)}var _f=N(null),hi=null,Ga=null;function bs(e,t,n){ce(_f,t._currentValue),t._currentValue=n}function Ya(e){e._currentValue=_f.current,$(_f)}function vf(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Sf(e,t,n,s){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var R=0;R<t.length;R++)if(S.context===t[R]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),vf(f.return,n,e),s||(b=null);break e}f=S.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(c(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),vf(b,n,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function Pi(e,t,n,s){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(c(387));if(b=b.memoizedProps,b!==null){var S=u.type;Pn(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(u===Me.current){if(b=u.alternate,b===null)throw Error(c(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Cc):e=[Cc])}u=u.return}e!==null&&Sf(t,e,n,s),t.flags|=262144}function ku(e){for(e=e.firstContext;e!==null;){if(!Pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pi(e){hi=e,Ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ln(e){return lp(hi,e)}function Nu(e,t){return hi===null&&pi(e),lp(e,t)}function lp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ga===null){if(e===null)throw Error(c(308));Ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ga=Ga.next=t;return n}var Ty=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ey=a.unstable_scheduleCallback,Ay=a.unstable_NormalPriority,mn={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jf(){return{controller:new Ty,data:new Map,refCount:0}}function ac(e){e.refCount--,e.refCount===0&&Ey(Ay,function(){e.controller.abort()})}var sc=null,kf=0,er=0,tr=null;function Cy(e,t){if(sc===null){var n=sc=[];kf=0,er=Td(),tr={status:"pending",value:void 0,then:function(s){n.push(s)}}}return kf++,t.then(ap,ap),t}function ap(){if(--kf===0&&sc!==null){tr!==null&&(tr.status="fulfilled");var e=sc;sc=null,er=0,tr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ry(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(s.status="rejected",s.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),s}var sp=H.S;H.S=function(e,t){Gm=it(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Cy(e,t),sp!==null&&sp(e,t)};var mi=N(null);function Nf(){var e=mi.current;return e!==null?e:Et.pooledCache}function wu(e,t){t===null?ce(mi,mi.current):ce(mi,t.pool)}function ip(){var e=Nf();return e===null?null:{parent:mn._currentValue,pool:e}}var nr=Error(c(460)),wf=Error(c(474)),Tu=Error(c(542)),Eu={then:function(){}};function rp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function cp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Rt,Rt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,op(e),e;default:if(typeof t.status=="string")t.then(Rt,Rt);else{if(e=Et,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=s}},function(s){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,op(e),e}throw bi=t,nr}}function gi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(bi=n,nr):n}}var bi=null;function up(){if(bi===null)throw Error(c(459));var e=bi;return bi=null,e}function op(e){if(e===nr||e===Tu)throw Error(c(483))}var lr=null,ic=0;function Au(e){var t=ic;return ic+=1,lr===null&&(lr=[]),cp(lr,e,t)}function rc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cu(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 fp(e){function t(B,D){if(e){var G=B.deletions;G===null?(B.deletions=[D],B.flags|=16):G.push(D)}}function n(B,D){if(!e)return null;for(;D!==null;)t(B,D),D=D.sibling;return null}function s(B){for(var D=new Map;B!==null;)B.key!==null?D.set(B.key,B):D.set(B.index,B),B=B.sibling;return D}function u(B,D){return B=Gl(B,D),B.index=0,B.sibling=null,B}function f(B,D,G){return B.index=G,e?(G=B.alternate,G!==null?(G=G.index,G<D?(B.flags|=67108866,D):G):(B.flags|=67108866,D)):(B.flags|=1048576,D)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function S(B,D,G,le){return D===null||D.tag!==6?(D=oa(G,B.mode,le),D.return=B,D):(D=u(D,G),D.return=B,D)}function R(B,D,G,le){var ze=G.type;return ze===L?ee(B,D,G.props.children,le,G.key):D!==null&&(D.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===V&&gi(ze)===D.type)?(D=u(D,G.props),rc(D,G),D.return=B,D):(D=Ji(G.type,G.key,G.props,null,B.mode,le),rc(D,G),D.return=B,D)}function X(B,D,G,le){return D===null||D.tag!==4||D.stateNode.containerInfo!==G.containerInfo||D.stateNode.implementation!==G.implementation?(D=Fi(G,B.mode,le),D.return=B,D):(D=u(D,G.children||[]),D.return=B,D)}function ee(B,D,G,le,ze){return D===null||D.tag!==7?(D=vl(G,B.mode,le,ze),D.return=B,D):(D=u(D,G),D.return=B,D)}function ie(B,D,G){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=oa(""+D,B.mode,G),D.return=B,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case C:return G=Ji(D.type,D.key,D.props,null,B.mode,G),rc(G,D),G.return=B,G;case k:return D=Fi(D,B.mode,G),D.return=B,D;case V:return D=gi(D),ie(B,D,G)}if(be(D)||ae(D))return D=vl(D,B.mode,G,null),D.return=B,D;if(typeof D.then=="function")return ie(B,Au(D),G);if(D.$$typeof===Q)return ie(B,Nu(B,D),G);Cu(B,D)}return null}function Z(B,D,G,le){var ze=D!==null?D.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return ze!==null?null:S(B,D,""+G,le);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case C:return G.key===ze?R(B,D,G,le):null;case k:return G.key===ze?X(B,D,G,le):null;case V:return G=gi(G),Z(B,D,G,le)}if(be(G)||ae(G))return ze!==null?null:ee(B,D,G,le,null);if(typeof G.then=="function")return Z(B,D,Au(G),le);if(G.$$typeof===Q)return Z(B,D,Nu(B,G),le);Cu(B,G)}return null}function W(B,D,G,le,ze){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return B=B.get(G)||null,S(D,B,""+le,ze);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return B=B.get(le.key===null?G:le.key)||null,R(D,B,le,ze);case k:return B=B.get(le.key===null?G:le.key)||null,X(D,B,le,ze);case V:return le=gi(le),W(B,D,G,le,ze)}if(be(le)||ae(le))return B=B.get(G)||null,ee(D,B,le,ze,null);if(typeof le.then=="function")return W(B,D,G,Au(le),ze);if(le.$$typeof===Q)return W(B,D,G,Nu(D,le),ze);Cu(D,le)}return null}function Ee(B,D,G,le){for(var ze=null,rt=null,Re=D,$e=D=0,et=null;Re!==null&&$e<G.length;$e++){Re.index>$e?(et=Re,Re=null):et=Re.sibling;var ct=Z(B,Re,G[$e],le);if(ct===null){Re===null&&(Re=et);break}e&&Re&&ct.alternate===null&&t(B,Re),D=f(ct,D,$e),rt===null?ze=ct:rt.sibling=ct,rt=ct,Re=et}if($e===G.length)return n(B,Re),Oe&&mt(B,$e),ze;if(Re===null){for(;$e<G.length;$e++)Re=ie(B,G[$e],le),Re!==null&&(D=f(Re,D,$e),rt===null?ze=Re:rt.sibling=Re,rt=Re);return Oe&&mt(B,$e),ze}for(Re=s(Re);$e<G.length;$e++)et=W(Re,B,$e,G[$e],le),et!==null&&(e&&et.alternate!==null&&Re.delete(et.key===null?$e:et.key),D=f(et,D,$e),rt===null?ze=et:rt.sibling=et,rt=et);return e&&Re.forEach(function(zs){return t(B,zs)}),Oe&&mt(B,$e),ze}function He(B,D,G,le){if(G==null)throw Error(c(151));for(var ze=null,rt=null,Re=D,$e=D=0,et=null,ct=G.next();Re!==null&&!ct.done;$e++,ct=G.next()){Re.index>$e?(et=Re,Re=null):et=Re.sibling;var zs=Z(B,Re,ct.value,le);if(zs===null){Re===null&&(Re=et);break}e&&Re&&zs.alternate===null&&t(B,Re),D=f(zs,D,$e),rt===null?ze=zs:rt.sibling=zs,rt=zs,Re=et}if(ct.done)return n(B,Re),Oe&&mt(B,$e),ze;if(Re===null){for(;!ct.done;$e++,ct=G.next())ct=ie(B,ct.value,le),ct!==null&&(D=f(ct,D,$e),rt===null?ze=ct:rt.sibling=ct,rt=ct);return Oe&&mt(B,$e),ze}for(Re=s(Re);!ct.done;$e++,ct=G.next())ct=W(Re,B,$e,ct.value,le),ct!==null&&(e&&ct.alternate!==null&&Re.delete(ct.key===null?$e:ct.key),D=f(ct,D,$e),rt===null?ze=ct:rt.sibling=ct,rt=ct);return e&&Re.forEach(function(G_){return t(B,G_)}),Oe&&mt(B,$e),ze}function jt(B,D,G,le){if(typeof G=="object"&&G!==null&&G.type===L&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case C:e:{for(var ze=G.key;D!==null;){if(D.key===ze){if(ze=G.type,ze===L){if(D.tag===7){n(B,D.sibling),le=u(D,G.props.children),le.return=B,B=le;break e}}else if(D.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===V&&gi(ze)===D.type){n(B,D.sibling),le=u(D,G.props),rc(le,G),le.return=B,B=le;break e}n(B,D);break}else t(B,D);D=D.sibling}G.type===L?(le=vl(G.props.children,B.mode,le,G.key),le.return=B,B=le):(le=Ji(G.type,G.key,G.props,null,B.mode,le),rc(le,G),le.return=B,B=le)}return b(B);case k:e:{for(ze=G.key;D!==null;){if(D.key===ze)if(D.tag===4&&D.stateNode.containerInfo===G.containerInfo&&D.stateNode.implementation===G.implementation){n(B,D.sibling),le=u(D,G.children||[]),le.return=B,B=le;break e}else{n(B,D);break}else t(B,D);D=D.sibling}le=Fi(G,B.mode,le),le.return=B,B=le}return b(B);case V:return G=gi(G),jt(B,D,G,le)}if(be(G))return Ee(B,D,G,le);if(ae(G)){if(ze=ae(G),typeof ze!="function")throw Error(c(150));return G=ze.call(G),He(B,D,G,le)}if(typeof G.then=="function")return jt(B,D,Au(G),le);if(G.$$typeof===Q)return jt(B,D,Nu(B,G),le);Cu(B,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,D!==null&&D.tag===6?(n(B,D.sibling),le=u(D,G),le.return=B,B=le):(n(B,D),le=oa(G,B.mode,le),le.return=B,B=le),b(B)):n(B,D)}return function(B,D,G,le){try{ic=0;var ze=jt(B,D,G,le);return lr=null,ze}catch(Re){if(Re===nr||Re===Tu)throw Re;var rt=kn(29,Re,null,B.mode);return rt.lanes=le,rt.return=B,rt}finally{}}}var xi=fp(!0),dp=fp(!1),xs=!1;function Tf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(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 ys(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _s(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ft&2)!==0){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,t=Ba(e),ec(e,null,n),t}return An(e,s,t,n),Ba(e)}function cc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$s(e,n)}}function Af(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Cf=!1;function uc(){if(Cf){var e=tr;if(e!==null)throw e}}function oc(e,t,n,s){Cf=!1;var u=e.updateQueue;xs=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,X=R.next;R.next=null,b===null?f=X:b.next=X,b=R;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,S=ee.lastBaseUpdate,S!==b&&(S===null?ee.firstBaseUpdate=X:S.next=X,ee.lastBaseUpdate=R))}if(f!==null){var ie=u.baseState;b=0,ee=X=R=null,S=f;do{var Z=S.lane&-536870913,W=Z!==S.lane;if(W?(Pe&Z)===Z:(s&Z)===Z){Z!==0&&Z===er&&(Cf=!0),ee!==null&&(ee=ee.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Ee=e,He=S;Z=t;var jt=n;switch(He.tag){case 1:if(Ee=He.payload,typeof Ee=="function"){ie=Ee.call(jt,ie,Z);break e}ie=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=He.payload,Z=typeof Ee=="function"?Ee.call(jt,ie,Z):Ee,Z==null)break e;ie=j({},ie,Z);break e;case 2:xs=!0}}Z=S.callback,Z!==null&&(e.flags|=64,W&&(e.flags|=8192),W=u.callbacks,W===null?u.callbacks=[Z]:W.push(Z))}else W={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ee===null?(X=ee=W,R=ie):ee=ee.next=W,b|=Z;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;W=S,S=W.next,W.next=null,u.lastBaseUpdate=W,u.shared.pending=null}}while(!0);ee===null&&(R=ie),u.baseState=R,u.firstBaseUpdate=X,u.lastBaseUpdate=ee,f===null&&(u.shared.lanes=0),Ns|=b,e.lanes=b,e.memoizedState=ie}}function hp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function pp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)hp(n[e],t)}var ar=N(null),Ru=N(0);function mp(e,t){e=Wa,ce(Ru,e),ce(ar,t),Wa=e|t.baseLanes}function Rf(){ce(Ru,Wa),ce(ar,ar.current)}function Mf(){Wa=Ru.current,$(ar),$(Ru)}var Sl=N(null),Ml=null;function vs(e){var t=e.alternate;ce(sn,sn.current&1),ce(Sl,e),Ml===null&&(t===null||ar.current!==null||t.memoizedState!==null)&&(Ml=e)}function Of(e){ce(sn,sn.current),ce(Sl,e),Ml===null&&(Ml=e)}function gp(e){e.tag===22?(ce(sn,sn.current),ce(Sl,e),Ml===null&&(Ml=e)):Ss()}function Ss(){ce(sn,sn.current),ce(Sl,Sl.current)}function jl(e){$(Sl),Ml===e&&(Ml=null),$(sn)}var sn=N(0);function Mu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Bd(n)||qd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xa=0,Xe=null,vt=null,gn=null,Ou=!1,sr=!1,yi=!1,Du=0,fc=0,ir=null,My=0;function Ft(){throw Error(c(321))}function Df(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pn(e[n],t[n]))return!1;return!0}function zf(e,t,n,s,u,f){return Xa=f,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?Pp:Jf,yi=!1,f=n(s,u),yi=!1,sr&&(f=xp(t,n,s,u)),bp(e),f}function bp(e){H.H=pc;var t=vt!==null&&vt.next!==null;if(Xa=0,gn=vt=Xe=null,Ou=!1,fc=0,ir=null,t)throw Error(c(300));e===null||bn||(e=e.dependencies,e!==null&&ku(e)&&(bn=!0))}function xp(e,t,n,s){Xe=e;var u=0;do{if(sr&&(ir=null),fc=0,sr=!1,25<=u)throw Error(c(301));if(u+=1,gn=vt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}H.H=em,f=t(n,s)}while(sr);return f}function Oy(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?dc(t):t,e=e.useState()[0],(vt!==null?vt.memoizedState:null)!==e&&(Xe.flags|=1024),t}function Lf(){var e=Du!==0;return Du=0,e}function Uf(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Hf(e){if(Ou){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ou=!1}Xa=0,gn=vt=Xe=null,sr=!1,fc=Du=0,ir=null}function sl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?Xe.memoizedState=gn=e:gn=gn.next=e,gn}function rn(){if(vt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var t=gn===null?Xe.memoizedState:gn.next;if(t!==null)gn=t,vt=e;else{if(e===null)throw Xe.alternate===null?Error(c(467)):Error(c(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},gn===null?Xe.memoizedState=gn=e:gn=gn.next=e}return gn}function zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dc(e){var t=fc;return fc+=1,ir===null&&(ir=[]),e=cp(ir,e,t),t=Xe,(gn===null?t.memoizedState:gn.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?Pp:Jf),e}function Lu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return dc(e);if(e.$$typeof===Q)return Ln(e)}throw Error(c(438,String(e)))}function Bf(e){var t=null,n=Xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Xe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=zu(),Xe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=oe;return t.index++,n}function Va(e,t){return typeof t=="function"?t(e):t}function Uu(e){var t=rn();return qf(t,vt,e)}function qf(e,t,n){var s=e.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=n;var u=e.baseQueue,f=s.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,s.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,R=null,X=t,ee=!1;do{var ie=X.lane&-536870913;if(ie!==X.lane?(Pe&ie)===ie:(Xa&ie)===ie){var Z=X.revertLane;if(Z===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ie===er&&(ee=!0);else if((Xa&Z)===Z){X=X.next,Z===er&&(ee=!0);continue}else ie={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},R===null?(S=R=ie,b=f):R=R.next=ie,Xe.lanes|=Z,Ns|=Z;ie=X.action,yi&&n(f,ie),f=X.hasEagerState?X.eagerState:n(f,ie)}else Z={lane:ie,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},R===null?(S=R=Z,b=f):R=R.next=Z,Xe.lanes|=ie,Ns|=ie;X=X.next}while(X!==null&&X!==t);if(R===null?b=f:R.next=S,!Pn(f,e.memoizedState)&&(bn=!0,ee&&(n=tr,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=R,s.lastRenderedState=f}return u===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function If(e){var t=rn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var s=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var b=u=u.next;do f=e(f,b.action),b=b.next;while(b!==u);Pn(f,t.memoizedState)||(bn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,s]}function yp(e,t,n){var s=Xe,u=rn(),f=Oe;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!Pn((vt||u).memoizedState,n);if(b&&(u.memoizedState=n,bn=!0),u=u.queue,Xf(Sp.bind(null,s,u,e),[e]),u.getSnapshot!==t||b||gn!==null&&gn.memoizedState.tag&1){if(s.flags|=2048,rr(9,{destroy:void 0},vp.bind(null,s,u,n,t),null),Et===null)throw Error(c(349));f||(Xa&127)!==0||_p(s,t,n)}return n}function _p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xe.updateQueue,t===null?(t=zu(),Xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vp(e,t,n,s){t.value=n,t.getSnapshot=s,jp(t)&&kp(e)}function Sp(e,t,n){return n(function(){jp(t)&&kp(e)})}function jp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pn(e,n)}catch{return!0}}function kp(e){var t=Il(e,2);t!==null&&hl(t,e,2)}function Gf(e){var t=sl();if(typeof e=="function"){var n=e;if(e=n(),yi){un(!0);try{n()}finally{un(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:e},t}function Np(e,t,n,s){return e.baseState=n,qf(e,vt,typeof s=="function"?s:Va)}function Dy(e,t,n,s,u){if(qu(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};H.T!==null?n(!0):f.isTransition=!1,s(f),n=t.pending,n===null?(f.next=t.pending=f,wp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function wp(e,t){var n=t.action,s=t.payload,u=e.state;if(t.isTransition){var f=H.T,b={};H.T=b;try{var S=n(u,s),R=H.S;R!==null&&R(b,S),Tp(e,t,S)}catch(X){Yf(e,t,X)}finally{f!==null&&b.types!==null&&(f.types=b.types),H.T=f}}else try{f=n(u,s),Tp(e,t,f)}catch(X){Yf(e,t,X)}}function Tp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Ep(e,t,s)},function(s){return Yf(e,t,s)}):Ep(e,t,n)}function Ep(e,t,n){t.status="fulfilled",t.value=n,Ap(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,wp(e,n)))}function Yf(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Ap(t),t=t.next;while(t!==s)}e.action=null}function Ap(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cp(e,t){return t}function Rp(e,t){if(Oe){var n=Et.formState;if(n!==null){e:{var s=Xe;if(Oe){if(Te){t:{for(var u=Te,f=Jt;u.nodeType!==8;){if(!f){u=null;break t}if(u=Ol(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Te=Ol(u.nextSibling),s=u.data==="F!";break e}}gs(s)}s=!1}s&&(t=n[0])}}return n=sl(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cp,lastRenderedState:t},n.queue=s,n=Jp.bind(null,Xe,s),s.dispatch=n,s=Gf(!1),f=Kf.bind(null,Xe,!1,s.queue),s=sl(),u={state:t,dispatch:null,action:e,pending:null},s.queue=u,n=Dy.bind(null,Xe,u,f,n),u.dispatch=n,s.memoizedState=e,[t,n,!1]}function Mp(e){var t=rn();return Op(t,vt,e)}function Op(e,t,n){if(t=qf(e,t,Cp)[0],e=Uu(Va)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=dc(t)}catch(b){throw b===nr?Tu:b}else s=t;t=rn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Xe.flags|=2048,rr(9,{destroy:void 0},zy.bind(null,u,n),null)),[s,f,e]}function zy(e,t){e.action=t}function Dp(e){var t=rn(),n=vt;if(n!==null)return Op(t,n,e);rn(),t=t.memoizedState,n=rn();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function rr(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Xe.updateQueue,t===null&&(t=zu(),Xe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function zp(){return rn().memoizedState}function Hu(e,t,n,s){var u=sl();Xe.flags|=e,u.memoizedState=rr(1|t,{destroy:void 0},n,s===void 0?null:s)}function Bu(e,t,n,s){var u=rn();s=s===void 0?null:s;var f=u.memoizedState.inst;vt!==null&&s!==null&&Df(s,vt.memoizedState.deps)?u.memoizedState=rr(t,f,n,s):(Xe.flags|=e,u.memoizedState=rr(1|t,f,n,s))}function Lp(e,t){Hu(8390656,8,e,t)}function Xf(e,t){Bu(2048,8,e,t)}function Ly(e){Xe.flags|=4;var t=Xe.updateQueue;if(t===null)t=zu(),Xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Up(e){var t=rn().memoizedState;return Ly({ref:t,nextImpl:e}),function(){if((ft&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Hp(e,t){return Bu(4,2,e,t)}function Bp(e,t){return Bu(4,4,e,t)}function qp(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 Ip(e,t,n){n=n!=null?n.concat([e]):null,Bu(4,4,qp.bind(null,t,e),n)}function Vf(){}function Gp(e,t){var n=rn();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Df(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Yp(e,t){var n=rn();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Df(t,s[1]))return s[0];if(s=e(),yi){un(!0);try{e()}finally{un(!1)}}return n.memoizedState=[s,t],s}function $f(e,t,n){return n===void 0||(Xa&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Xm(),Xe.lanes|=e,Ns|=e,n)}function Xp(e,t,n,s){return Pn(n,t)?n:ar.current!==null?(e=$f(e,n,s),Pn(e,t)||(bn=!0),e):(Xa&42)===0||(Xa&1073741824)!==0&&(Pe&261930)===0?(bn=!0,e.memoizedState=n):(e=Xm(),Xe.lanes|=e,Ns|=e,t)}function Vp(e,t,n,s,u){var f=re.p;re.p=f!==0&&8>f?f:8;var b=H.T,S={};H.T=S,Kf(e,!1,t,n);try{var R=u(),X=H.S;if(X!==null&&X(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ee=Ry(R,s);hc(e,t,ee,wl(e))}else hc(e,t,s,wl(e))}catch(ie){hc(e,t,{then:function(){},status:"rejected",reason:ie},wl())}finally{re.p=f,b!==null&&S.types!==null&&(b.types=S.types),H.T=b}}function Uy(){}function Qf(e,t,n,s){if(e.tag!==5)throw Error(c(476));var u=$p(e).queue;Vp(e,u,t,se,n===null?Uy:function(){return Qp(e),n(s)})}function $p(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qp(e){var t=$p(e);t.next===null&&(t=e.alternate.memoizedState),hc(e,t.next.queue,{},wl())}function Zf(){return Ln(Cc)}function Zp(){return rn().memoizedState}function Kp(){return rn().memoizedState}function Hy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wl();e=ys(n);var s=_s(t,e,n);s!==null&&(hl(s,t,n),cc(s,t,n)),t={cache:jf()},e.payload=t;return}t=t.return}}function By(e,t,n){var s=wl();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qu(e)?Fp(t,n):(n=Qi(e,t,n,s),n!==null&&(hl(n,e,s),Wp(n,t,s)))}function Jp(e,t,n){var s=wl();hc(e,t,n,s)}function hc(e,t,n,s){var u={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qu(e))Fp(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,S=f(b,n);if(u.hasEagerState=!0,u.eagerState=S,Pn(S,b))return An(e,t,u,0),Et===null&&Vn(),!1}catch{}finally{}if(n=Qi(e,t,u,s),n!==null)return hl(n,e,s),Wp(n,t,s),!0}return!1}function Kf(e,t,n,s){if(s={lane:2,revertLane:Td(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},qu(e)){if(t)throw Error(c(479))}else t=Qi(e,n,s,2),t!==null&&hl(t,e,2)}function qu(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function Fp(e,t){sr=Ou=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Wp(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$s(e,n)}}var pc={readContext:Ln,use:Lu,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};pc.useEffectEvent=Ft;var Pp={readContext:Ln,use:Lu,useCallback:function(e,t){return sl().memoizedState=[e,t===void 0?null:t],e},useContext:Ln,useEffect:Lp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Hu(4194308,4,qp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hu(4194308,4,e,t)},useInsertionEffect:function(e,t){Hu(4,2,e,t)},useMemo:function(e,t){var n=sl();t=t===void 0?null:t;var s=e();if(yi){un(!0);try{e()}finally{un(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=sl();if(n!==void 0){var u=n(t);if(yi){un(!0);try{n(t)}finally{un(!1)}}}else u=t;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=By.bind(null,Xe,e),[s.memoizedState,e]},useRef:function(e){var t=sl();return e={current:e},t.memoizedState=e},useState:function(e){e=Gf(e);var t=e.queue,n=Jp.bind(null,Xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vf,useDeferredValue:function(e,t){var n=sl();return $f(n,e,t)},useTransition:function(){var e=Gf(!1);return e=Vp.bind(null,Xe,e.queue,!0,!1),sl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Xe,u=sl();if(Oe){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Et===null)throw Error(c(349));(Pe&127)!==0||_p(s,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,Lp(Sp.bind(null,s,f,e),[e]),s.flags|=2048,rr(9,{destroy:void 0},vp.bind(null,s,f,n,t),null),n},useId:function(){var e=sl(),t=Et.identifierPrefix;if(Oe){var n=Ue,s=de;n=(s&~(1<<32-ut(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Du++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=My++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zf,useFormState:Rp,useActionState:Rp,useOptimistic:function(e){var t=sl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Kf.bind(null,Xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bf,useCacheRefresh:function(){return sl().memoizedState=Hy.bind(null,Xe)},useEffectEvent:function(e){var t=sl(),n={impl:e};return t.memoizedState=n,function(){if((ft&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Jf={readContext:Ln,use:Lu,useCallback:Gp,useContext:Ln,useEffect:Xf,useImperativeHandle:Ip,useInsertionEffect:Hp,useLayoutEffect:Bp,useMemo:Yp,useReducer:Uu,useRef:zp,useState:function(){return Uu(Va)},useDebugValue:Vf,useDeferredValue:function(e,t){var n=rn();return Xp(n,vt.memoizedState,e,t)},useTransition:function(){var e=Uu(Va)[0],t=rn().memoizedState;return[typeof e=="boolean"?e:dc(e),t]},useSyncExternalStore:yp,useId:Zp,useHostTransitionStatus:Zf,useFormState:Mp,useActionState:Mp,useOptimistic:function(e,t){var n=rn();return Np(n,vt,e,t)},useMemoCache:Bf,useCacheRefresh:Kp};Jf.useEffectEvent=Up;var em={readContext:Ln,use:Lu,useCallback:Gp,useContext:Ln,useEffect:Xf,useImperativeHandle:Ip,useInsertionEffect:Hp,useLayoutEffect:Bp,useMemo:Yp,useReducer:If,useRef:zp,useState:function(){return If(Va)},useDebugValue:Vf,useDeferredValue:function(e,t){var n=rn();return vt===null?$f(n,e,t):Xp(n,vt.memoizedState,e,t)},useTransition:function(){var e=If(Va)[0],t=rn().memoizedState;return[typeof e=="boolean"?e:dc(e),t]},useSyncExternalStore:yp,useId:Zp,useHostTransitionStatus:Zf,useFormState:Dp,useActionState:Dp,useOptimistic:function(e,t){var n=rn();return vt!==null?Np(n,vt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Bf,useCacheRefresh:Kp};em.useEffectEvent=Up;function Ff(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Wf={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=wl(),u=ys(s);u.payload=t,n!=null&&(u.callback=n),t=_s(e,u,s),t!==null&&(hl(t,e,s),cc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=wl(),u=ys(s);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=_s(e,u,s),t!==null&&(hl(t,e,s),cc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wl(),s=ys(n);s.tag=2,t!=null&&(s.callback=t),t=_s(e,s,n),t!==null&&(hl(t,e,n),cc(t,e,n))}};function tm(e,t,n,s,u,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,b):t.prototype&&t.prototype.isPureReactComponent?!ci(n,s)||!ci(u,f):!0}function nm(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Wf.enqueueReplaceState(t,t.state,null)}function _i(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}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 lm(e){oi(e)}function am(e){console.error(e)}function sm(e){oi(e)}function Iu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function im(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Pf(e,t,n){return n=ys(n),n.tag=3,n.payload={element:null},n.callback=function(){Iu(e,t)},n}function rm(e){return e=ys(e),e.tag=3,e}function cm(e,t,n,s){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;e.payload=function(){return u(f)},e.callback=function(){im(t,n,s)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){im(t,n,s),typeof u!="function"&&(ws===null?ws=new Set([this]):ws.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function qy(e,t,n,s,u){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Pi(t,n,u,!0),n=Sl.current,n!==null){switch(n.tag){case 31:case 13:return Ml===null?Pu():n.alternate===null&&Wt===0&&(Wt=3),n.flags&=-257,n.flags|=65536,n.lanes=u,s===Eu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),kd(e,s,u)),!1;case 22:return n.flags|=65536,s===Eu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),kd(e,s,u)),!1}throw Error(c(435,n.tag))}return kd(e,s,u),Pu(),!1}if(Oe)return t=Sl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,s!==fi&&(e=Error(c(422),{cause:s}),lc(nl(e,n)))):(s!==fi&&(t=Error(c(423),{cause:s}),lc(nl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,s=nl(s,n),u=Pf(e.stateNode,s,u),Af(e,u),Wt!==4&&(Wt=2)),!1;var f=Error(c(520),{cause:s});if(f=nl(f,n),Sc===null?Sc=[f]:Sc.push(f),Wt!==4&&(Wt=2),t===null)return!0;s=nl(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Pf(n.stateNode,s,e),Af(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ws===null||!ws.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=rm(u),cm(u,e,n,s),Af(n,u),!1}n=n.return}while(n!==null);return!1}var ed=Error(c(461)),bn=!1;function Un(e,t,n,s){t.child=e===null?dp(t,null,n,s):xi(t,e.child,n,s)}function um(e,t,n,s,u){n=n.render;var f=t.ref;if("ref"in s){var b={};for(var S in s)S!=="ref"&&(b[S]=s[S])}else b=s;return pi(t),s=zf(e,t,n,b,f,u),S=Lf(),e!==null&&!bn?(Uf(e,t,u),$a(e,t,u)):(Oe&&S&&al(t),t.flags|=1,Un(e,t,s,u),t.child)}function om(e,t,n,s,u){if(e===null){var f=n.type;return typeof f=="function"&&!Zi(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,fm(e,t,f,s,u)):(e=Ji(n.type,null,s,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!cd(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:ci,n(b,s)&&e.ref===t.ref)return $a(e,t,u)}return t.flags|=1,e=Gl(f,s),e.ref=t.ref,e.return=t,t.child=e}function fm(e,t,n,s,u){if(e!==null){var f=e.memoizedProps;if(ci(f,s)&&e.ref===t.ref)if(bn=!1,t.pendingProps=s=f,cd(e,u))(e.flags&131072)!==0&&(bn=!0);else return t.lanes=e.lanes,$a(e,t,u)}return td(e,t,n,s,u)}function dm(e,t,n,s){var u=s.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(s=t.child=e.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~f}else s=0,t.child=null;return hm(e,t,f,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&wu(t,f!==null?f.cachePool:null),f!==null?mp(t,f):Rf(),gp(t);else return s=t.lanes=536870912,hm(e,t,f!==null?f.baseLanes|n:n,n,s)}else f!==null?(wu(t,f.cachePool),mp(t,f),Ss(),t.memoizedState=null):(e!==null&&wu(t,null),Rf(),Ss());return Un(e,t,u,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hm(e,t,n,s,u){var f=Nf();return f=f===null?null:{parent:mn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&wu(t,null),Rf(),gp(t),e!==null&&Pi(e,t,s,!0),t.childLanes=u,null}function Gu(e,t){return t=Xu({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 xi(t,e.child,null,n),e=Gu(t,t.pendingProps),e.flags|=2,jl(t),t.memoizedState=null,e}function Iy(e,t,n){var s=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(s.mode==="hidden")return e=Gu(t,s),t.lanes=536870912,mc(null,e);if(Of(t),(e=Te)?(e=wg(e,Jt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:q!==null?{id:de,overflow:Ue}:null,retryLane:536870912,hydrationErrors:null},n=tc(e),n.return=t,t.child=n,je=t,Te=null)):e=null,e===null)throw gs(t);return t.lanes=536870912,null}return Gu(t,s)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(Of(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(bn||Pi(e,t,n,!1),u=(n&e.childLanes)!==0,bn||u){if(s=Et,s!==null&&(b=Ul(s,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Il(e,b),hl(s,e,b),ed;Pu(),t=pm(e,t,n)}else e=f.treeContext,Te=Ol(b.nextSibling),je=t,Oe=!0,lt=null,Jt=!1,e!==null&&Ce(t,e),t=Gu(t,s),t.flags|=4096;return t}return e=Gl(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yu(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 td(e,t,n,s,u){return pi(t),n=zf(e,t,n,s,void 0,u),s=Lf(),e!==null&&!bn?(Uf(e,t,u),$a(e,t,u)):(Oe&&s&&al(t),t.flags|=1,Un(e,t,n,u),t.child)}function mm(e,t,n,s,u,f){return pi(t),t.updateQueue=null,n=xp(t,s,n,u),bp(e),s=Lf(),e!==null&&!bn?(Uf(e,t,f),$a(e,t,f)):(Oe&&s&&al(t),t.flags|=1,Un(e,t,n,f),t.child)}function gm(e,t,n,s,u){if(pi(t),t.stateNode===null){var f=qa,b=n.contextType;typeof b=="object"&&b!==null&&(f=Ln(b)),f=new n(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Wf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},Tf(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?Ln(b):qa,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(Ff(t,n,b,s),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&Wf.enqueueReplaceState(f,f.state,null),oc(t,s,f,u),uc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,R=_i(n,S);f.props=R;var X=f.context,ee=n.contextType;b=qa,typeof ee=="object"&&ee!==null&&(b=Ln(ee));var ie=n.getDerivedStateFromProps;ee=typeof ie=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ee||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||X!==b)&&nm(t,f,s,b),xs=!1;var Z=t.memoizedState;f.state=Z,oc(t,s,f,u),uc(),X=t.memoizedState,S||Z!==X||xs?(typeof ie=="function"&&(Ff(t,n,ie,s),X=t.memoizedState),(R=xs||tm(t,n,R,s,Z,X,b))?(ee||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=X),f.props=s,f.state=X,f.context=b,s=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,Ef(e,t),b=t.memoizedProps,ee=_i(n,b),f.props=ee,ie=t.pendingProps,Z=f.context,X=n.contextType,R=qa,typeof X=="object"&&X!==null&&(R=Ln(X)),S=n.getDerivedStateFromProps,(X=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==ie||Z!==R)&&nm(t,f,s,R),xs=!1,Z=t.memoizedState,f.state=Z,oc(t,s,f,u),uc();var W=t.memoizedState;b!==ie||Z!==W||xs||e!==null&&e.dependencies!==null&&ku(e.dependencies)?(typeof S=="function"&&(Ff(t,n,S,s),W=t.memoizedState),(ee=xs||tm(t,n,ee,s,Z,W,R)||e!==null&&e.dependencies!==null&&ku(e.dependencies))?(X||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,W,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,W,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=W),f.props=s,f.state=W,f.context=R,s=ee):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,Yu(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=xi(t,e.child,null,u),t.child=xi(t,null,n,u)):Un(e,t,n,u),t.memoizedState=f.state,e=t.child):e=$a(e,t,u),e}function bm(e,t,n,s){return di(),t.flags|=256,Un(e,t,n,s),t.child}var nd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ld(e){return{baseLanes:e,cachePool:ip()}}function ad(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Nl),e}function xm(e,t,n){var s=t.pendingProps,u=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(sn.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(u?vs(t):Ss(),(e=Te)?(e=wg(e,Jt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:q!==null?{id:de,overflow:Ue}:null,retryLane:536870912,hydrationErrors:null},n=tc(e),n.return=t,t.child=n,je=t,Te=null)):e=null,e===null)throw gs(t);return qd(e)?t.lanes=32:t.lanes=536870912,null}var S=s.children;return s=s.fallback,u?(Ss(),u=t.mode,S=Xu({mode:"hidden",children:S},u),s=vl(s,u,n,null),S.return=t,s.return=t,S.sibling=s,t.child=S,s=t.child,s.memoizedState=ld(n),s.childLanes=ad(e,b,n),t.memoizedState=nd,mc(null,s)):(vs(t),sd(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(f)t.flags&256?(vs(t),t.flags&=-257,t=id(e,t,n)):t.memoizedState!==null?(Ss(),t.child=e.child,t.flags|=128,t=null):(Ss(),S=s.fallback,u=t.mode,s=Xu({mode:"visible",children:s.children},u),S=vl(S,u,n,null),S.flags|=2,s.return=t,S.return=t,s.sibling=S,t.child=s,xi(t,e.child,null,n),s=t.child,s.memoizedState=ld(n),s.childLanes=ad(e,b,n),t.memoizedState=nd,t=mc(null,s));else if(vs(t),qd(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var X=b.dgst;b=X,s=Error(c(419)),s.stack="",s.digest=b,lc({value:s,source:null,stack:null}),t=id(e,t,n)}else if(bn||Pi(e,t,n,!1),b=(n&e.childLanes)!==0,bn||b){if(b=Et,b!==null&&(s=Ul(b,n),s!==0&&s!==R.retryLane))throw R.retryLane=s,Il(e,s),hl(b,e,s),ed;Bd(S)||Pu(),t=id(e,t,n)}else Bd(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,Te=Ol(S.nextSibling),je=t,Oe=!0,lt=null,Jt=!1,e!==null&&Ce(t,e),t=sd(t,s.children),t.flags|=4096);return t}return u?(Ss(),S=s.fallback,u=t.mode,R=e.child,X=R.sibling,s=Gl(R,{mode:"hidden",children:s.children}),s.subtreeFlags=R.subtreeFlags&65011712,X!==null?S=Gl(X,S):(S=vl(S,u,n,null),S.flags|=2),S.return=t,s.return=t,s.sibling=S,t.child=s,mc(null,s),s=t.child,S=e.child.memoizedState,S===null?S=ld(n):(u=S.cachePool,u!==null?(R=mn._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=ip(),S={baseLanes:S.baseLanes|n,cachePool:u}),s.memoizedState=S,s.childLanes=ad(e,b,n),t.memoizedState=nd,mc(e.child,s)):(vs(t),n=e.child,e=n.sibling,n=Gl(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function sd(e,t){return t=Xu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xu(e,t){return e=kn(22,e,null,t),e.lanes=0,e}function id(e,t,n){return xi(t,e.child,null,n),e=sd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ym(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),vf(e.return,t,n)}function rd(e,t,n,s,u,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:u,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=n,b.tailMode=u,b.treeForkCount=f)}function _m(e,t,n){var s=t.pendingProps,u=s.revealOrder,f=s.tail;s=s.children;var b=sn.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,ce(sn,b),Un(e,t,s,n),s=Oe?ms:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ym(e,n,t);else if(e.tag===19)ym(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&Mu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),rd(t,!1,u,n,f,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Mu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}rd(t,!0,n,null,f,s);break;case"together":rd(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function $a(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ns|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Pi(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=Gl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ku(e)))}function Gy(e,t,n){switch(t.tag){case 3:at(t,t.stateNode.containerInfo),bs(t,mn,e.memoizedState.cache),di();break;case 27:case 5:Mt(t);break;case 4:at(t,t.stateNode.containerInfo);break;case 10:bs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Of(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(vs(t),t.flags|=128,null):(n&t.child.childLanes)!==0?xm(e,t,n):(vs(t),e=$a(e,t,n),e!==null?e.sibling:null);vs(t);break;case 19:var u=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Pi(e,t,n,!1),s=(n&t.childLanes)!==0),u){if(s)return _m(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ce(sn,sn.current),s)break;return null;case 22:return t.lanes=0,dm(e,t,n,t.pendingProps);case 24:bs(t,mn,e.memoizedState.cache)}return $a(e,t,n)}function vm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bn=!0;else{if(!cd(e,n)&&(t.flags&128)===0)return bn=!1,Gy(e,t,n);bn=(e.flags&131072)!==0}else bn=!1,Oe&&(t.flags&1048576)!==0&&$n(t,ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=gi(t.elementType),t.type=e,typeof e=="function")Zi(e)?(s=_i(e,s),t.tag=1,t=gm(null,t,e,s,n)):(t.tag=0,t=td(null,t,e,s,n));else{if(e!=null){var u=e.$$typeof;if(u===w){t.tag=11,t=um(null,t,e,s,n);break e}else if(u===A){t.tag=14,t=om(null,t,e,s,n);break e}}throw t=Ae(e)||e,Error(c(306,t,""))}}return t;case 0:return td(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,u=_i(s,t.pendingProps),gm(e,t,s,u,n);case 3:e:{if(at(t,t.stateNode.containerInfo),e===null)throw Error(c(387));s=t.pendingProps;var f=t.memoizedState;u=f.element,Ef(e,t),oc(t,s,null,n);var b=t.memoizedState;if(s=b.cache,bs(t,mn,s),s!==f.cache&&Sf(t,[mn],n,!0),uc(),s=b.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=bm(e,t,s,n);break e}else if(s!==u){u=nl(Error(c(424)),t),lc(u),t=bm(e,t,s,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(Te=Ol(e.firstChild),je=t,Oe=!0,lt=null,Jt=!0,n=dp(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(di(),s===u){t=$a(e,t,n);break e}Un(e,t,s,n)}t=t.child}return t;case 26:return Yu(e,t),e===null?(n=Mg(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oe||(n=t.type,e=t.pendingProps,s=io(ye.current).createElement(n),s[Kt]=t,s[Qe]=e,Hn(s,n,e),ot(s),t.stateNode=s):t.memoizedState=Mg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Mt(t),e===null&&Oe&&(s=t.stateNode=Ag(t.type,t.pendingProps,ye.current),je=t,Jt=!0,u=Te,Cs(t.type)?(Id=u,Te=Ol(s.firstChild)):Te=u),Un(e,t,t.pendingProps.children,n),Yu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((u=s=Te)&&(s=x_(s,t.type,t.pendingProps,Jt),s!==null?(t.stateNode=s,je=t,Te=Ol(s.firstChild),Jt=!1,u=!0):u=!1),u||gs(t)),Mt(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,s=f.children,Ld(u,f)?s=null:b!==null&&Ld(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=zf(e,t,Oy,null,null,n),Cc._currentValue=u),Yu(e,t),Un(e,t,s,n),t.child;case 6:return e===null&&Oe&&((e=n=Te)&&(n=y_(n,t.pendingProps,Jt),n!==null?(t.stateNode=n,je=t,Te=null,e=!0):e=!1),e||gs(t)),null;case 13:return xm(e,t,n);case 4:return at(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=xi(t,null,s,n):Un(e,t,s,n),t.child;case 11:return um(e,t,t.type,t.pendingProps,n);case 7:return Un(e,t,t.pendingProps,n),t.child;case 8:return Un(e,t,t.pendingProps.children,n),t.child;case 12:return Un(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,bs(t,t.type,s.value),Un(e,t,s.children,n),t.child;case 9:return u=t.type._context,s=t.pendingProps.children,pi(t),u=Ln(u),s=s(u),t.flags|=1,Un(e,t,s,n),t.child;case 14:return om(e,t,t.type,t.pendingProps,n);case 15:return fm(e,t,t.type,t.pendingProps,n);case 19:return _m(e,t,n);case 31:return Iy(e,t,n);case 22:return dm(e,t,n,t.pendingProps);case 24:return pi(t),s=Ln(mn),e===null?(u=Nf(),u===null&&(u=Et,f=jf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:s,cache:u},Tf(t),bs(t,mn,u)):((e.lanes&n)!==0&&(Ef(e,t),oc(t,null,null,n),uc()),u=e.memoizedState,f=t.memoizedState,u.parent!==s?(u={parent:s,cache:s},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),bs(t,mn,s)):(s=f.cache,bs(t,mn,s),s!==u.cache&&Sf(t,[mn],n,!0))),Un(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Qa(e){e.flags|=4}function ud(e,t,n,s,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(Zm())e.flags|=8192;else throw bi=Eu,wf}else e.flags&=-16777217}function Sm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ug(t))if(Zm())e.flags|=8192;else throw bi=Eu,wf}function Vu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?jn():536870912,e.lanes|=t,fr|=t)}function gc(e,t){if(!Oe)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Yy(e,t,n){var s=t.pendingProps;switch(Ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(t),null;case 1:return Dt(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ya(mn),Ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Qa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yf())),Dt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Qa(t),f!==null?(Dt(t),Sm(t,f)):(Dt(t),ud(t,u,null,s,n))):f?f!==e.memoizedState?(Qa(t),Dt(t),Sm(t,f)):(Dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Qa(t),Dt(t),ud(t,u,e,s,n)),null;case 27:if(Ie(t),n=ye.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Qa(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return Dt(t),null}e=he.current,Wi(t)?tp(t):(e=Ag(u,s,n),t.stateNode=e,Qa(t))}return Dt(t),null;case 5:if(Ie(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Qa(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return Dt(t),null}if(f=he.current,Wi(t))tp(t);else{var b=io(ye.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?b.createElement(u,{is:s.is}):b.createElement(u)}}f[Kt]=t,f[Qe]=s;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(Hn(f,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Qa(t)}}return Dt(t),ud(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Qa(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(c(166));if(e=ye.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,u=je,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[Kt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||xg(e.nodeValue,n)),e||gs(t,!0)}else e=io(e).createTextNode(s),e[Kt]=t,t.stateNode=e}return Dt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Wi(t),n!==null){if(e===null){if(!s)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Kt]=t}else di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Dt(t),e=!1}else n=yf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jl(t),t):(jl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Dt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Wi(t),s!==null&&s.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[Kt]=t}else di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Dt(t),u=!1}else u=yf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(jl(t),t):(jl(t),null)}return jl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vu(t,t.updateQueue),Dt(t),null);case 4:return Ve(),e===null&&Rd(t.stateNode.containerInfo),Dt(t),null;case 10:return Ya(t.type),Dt(t),null;case 19:if($(sn),s=t.memoizedState,s===null)return Dt(t),null;if(u=(t.flags&128)!==0,f=s.rendering,f===null)if(u)gc(s,!1);else{if(Wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Mu(e),f!==null){for(t.flags|=128,gc(s,!1),e=f.updateQueue,t.updateQueue=e,Vu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ki(n,e),n=n.sibling;return ce(sn,sn.current&1|2),Oe&&mt(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&it()>Ju&&(t.flags|=128,u=!0,gc(s,!1),t.lanes=4194304)}else{if(!u)if(e=Mu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Vu(t,e),gc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Oe)return Dt(t),null}else 2*it()-s.renderingStartTime>Ju&&n!==536870912&&(t.flags|=128,u=!0,gc(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=it(),e.sibling=null,n=sn.current,ce(sn,u?n&1|2:n&1),Oe&&mt(t,s.treeForkCount),e):(Dt(t),null);case 22:case 23:return jl(t),Mf(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(Dt(t),t.subtreeFlags&6&&(t.flags|=8192)):Dt(t),n=t.updateQueue,n!==null&&Vu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&$(mi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ya(mn),Dt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Xy(e,t){switch(Ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ya(mn),Ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ie(t),null;case 31:if(t.memoizedState!==null){if(jl(t),t.alternate===null)throw Error(c(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(sn),null;case 4:return Ve(),null;case 10:return Ya(t.type),null;case 22:case 23:return jl(t),Mf(),e!==null&&$(mi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ya(mn),null;case 25:return null;default:return null}}function jm(e,t){switch(Ia(t),t.tag){case 3:Ya(mn),Ve();break;case 26:case 27:case 5:Ie(t);break;case 4:Ve();break;case 31:t.memoizedState!==null&&jl(t);break;case 13:jl(t);break;case 19:$(sn);break;case 10:Ya(t.type);break;case 22:case 23:jl(t),Mf(),e!==null&&$(mi);break;case 24:Ya(mn)}}function bc(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var u=s.next;n=u;do{if((n.tag&e)===e){s=void 0;var f=n.create,b=n.inst;s=f(),b.destroy=s}n=n.next}while(n!==u)}}catch(S){_t(t,t.return,S)}}function js(e,t,n){try{var s=t.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&e)===e){var b=s.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var R=n,X=S;try{X()}catch(ee){_t(u,R,ee)}}}s=s.next}while(s!==f)}}catch(ee){_t(t,t.return,ee)}}function km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{pp(t,n)}catch(s){_t(e,e.return,s)}}}function Nm(e,t,n){n.props=_i(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){_t(e,t,s)}}function xc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(u){_t(e,t,u)}}function fa(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(u){_t(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){_t(e,t,u)}else n.current=null}function wm(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(u){_t(e,e.return,u)}}function od(e,t,n){try{var s=e.stateNode;d_(s,e.type,n,t),s[Qe]=t}catch(u){_t(e,e.return,u)}}function Tm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cs(e.type)||e.tag===4}function fd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tm(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&&Cs(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 dd(e,t,n){var s=e.tag;if(s===5||s===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=Rt));else if(s!==4&&(s===27&&Cs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(dd(e,t,n),e=e.sibling;e!==null;)dd(e,t,n),e=e.sibling}function $u(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Cs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($u(e,t,n),e=e.sibling;e!==null;)$u(e,t,n),e=e.sibling}function Em(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Hn(t,s,n),t[Kt]=e,t[Qe]=n}catch(f){_t(e,e.return,f)}}var Za=!1,xn=!1,hd=!1,Am=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function Vy(e,t){if(e=e.containerInfo,Dd=po,e=gu(e),Jr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,S=-1,R=-1,X=0,ee=0,ie=e,Z=null;t:for(;;){for(var W;ie!==n||u!==0&&ie.nodeType!==3||(S=b+u),ie!==f||s!==0&&ie.nodeType!==3||(R=b+s),ie.nodeType===3&&(b+=ie.nodeValue.length),(W=ie.firstChild)!==null;)Z=ie,ie=W;for(;;){if(ie===e)break t;if(Z===n&&++X===u&&(S=b),Z===f&&++ee===s&&(R=b),(W=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=W}n=S===-1||R===-1?null:{start:S,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},po=!1,Cn=t;Cn!==null;)if(t=Cn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Cn=e;else for(;Cn!==null;){switch(t=Cn,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,s=n.stateNode;try{var Ee=_i(n.type,u);e=s.getSnapshotBeforeUpdate(Ee,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(He){_t(n,n.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Hd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hd(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,Cn=e;break}Cn=t.return}}function Cm(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Ja(e,n),s&4&&bc(5,n);break;case 1:if(Ja(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){_t(n,n.return,b)}else{var u=_i(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){_t(n,n.return,b)}}s&64&&km(n),s&512&&xc(n,n.return);break;case 3:if(Ja(e,n),s&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{pp(e,t)}catch(b){_t(n,n.return,b)}}break;case 27:t===null&&s&4&&Em(n);case 26:case 5:Ja(e,n),t===null&&s&4&&wm(n),s&512&&xc(n,n.return);break;case 12:Ja(e,n);break;case 31:Ja(e,n),s&4&&Om(e,n);break;case 13:Ja(e,n),s&4&&Dm(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=e_.bind(null,n),__(e,n))));break;case 22:if(s=n.memoizedState!==null||Za,!s){t=t!==null&&t.memoizedState!==null||xn,u=Za;var f=xn;Za=s,(xn=t)&&!f?Fa(e,n,(n.subtreeFlags&8772)!==0):Ja(e,n),Za=u,xn=f}break;case 30:break;default:Ja(e,n)}}function Rm(e){var t=e.alternate;t!==null&&(e.alternate=null,Rm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ta(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 Yt=null,ul=!1;function Ka(e,t,n){for(n=n.child;n!==null;)Mm(e,t,n),n=n.sibling}function Mm(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Zt,n)}catch{}switch(n.tag){case 26:xn||fa(n,t),Ka(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:xn||fa(n,t);var s=Yt,u=ul;Cs(n.type)&&(Yt=n.stateNode,ul=!1),Ka(e,t,n),Tc(n.stateNode),Yt=s,ul=u;break;case 5:xn||fa(n,t);case 6:if(s=Yt,u=ul,Yt=null,Ka(e,t,n),Yt=s,ul=u,Yt!==null)if(ul)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(n.stateNode)}catch(f){_t(n,t,f)}else try{Yt.removeChild(n.stateNode)}catch(f){_t(n,t,f)}break;case 18:Yt!==null&&(ul?(e=Yt,kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),yr(e)):kg(Yt,n.stateNode));break;case 4:s=Yt,u=ul,Yt=n.stateNode.containerInfo,ul=!0,Ka(e,t,n),Yt=s,ul=u;break;case 0:case 11:case 14:case 15:js(2,n,t),xn||js(4,n,t),Ka(e,t,n);break;case 1:xn||(fa(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&Nm(n,t,s)),Ka(e,t,n);break;case 21:Ka(e,t,n);break;case 22:xn=(s=xn)||n.memoizedState!==null,Ka(e,t,n),xn=s;break;default:Ka(e,t,n)}}function Om(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yr(e)}catch(n){_t(t,t.return,n)}}}function Dm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yr(e)}catch(n){_t(t,t.return,n)}}function $y(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Am),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Am),t;default:throw Error(c(435,e.tag))}}function Qu(e,t){var n=$y(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var u=t_.bind(null,e,s);s.then(u,u)}})}function ol(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var u=n[s],f=e,b=t,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(Cs(S.type)){Yt=S.stateNode,ul=!1;break e}break;case 5:Yt=S.stateNode,ul=!1;break e;case 3:case 4:Yt=S.stateNode.containerInfo,ul=!0;break e}S=S.return}if(Yt===null)throw Error(c(160));Mm(f,b,u),Yt=null,ul=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zm(t,e),t=t.sibling}var Yl=null;function zm(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ol(t,e),fl(e),s&4&&(js(3,e,e.return),bc(3,e),js(5,e,e.return));break;case 1:ol(t,e),fl(e),s&512&&(xn||n===null||fa(n,n.return)),s&64&&Za&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var u=Yl;if(ol(t,e),fl(e),s&512&&(xn||n===null||fa(n,n.return)),s&4){var f=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Fl]||f[Kt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(s),u.head.insertBefore(f,u.querySelector("head > title"))),Hn(f,s,n),f[Kt]=e,ot(f),s=f;break e;case"link":var b=zg("link","href",u).get(s+(n.href||""));if(b){for(var S=0;S<b.length;S++)if(f=b[S],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(S,1);break t}}f=u.createElement(s),Hn(f,s,n),u.head.appendChild(f);break;case"meta":if(b=zg("meta","content",u).get(s+(n.content||""))){for(S=0;S<b.length;S++)if(f=b[S],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(S,1);break t}}f=u.createElement(s),Hn(f,s,n),u.head.appendChild(f);break;default:throw Error(c(468,s))}f[Kt]=e,ot(f),s=f}e.stateNode=s}else Lg(u,e.type,e.stateNode);else e.stateNode=Dg(u,s,e.memoizedProps);else f!==s?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,s===null?Lg(u,e.type,e.stateNode):Dg(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&od(e,e.memoizedProps,n.memoizedProps)}break;case 27:ol(t,e),fl(e),s&512&&(xn||n===null||fa(n,n.return)),n!==null&&s&4&&od(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ol(t,e),fl(e),s&512&&(xn||n===null||fa(n,n.return)),e.flags&32){u=e.stateNode;try{I(u,"")}catch(Ee){_t(e,e.return,Ee)}}s&4&&e.stateNode!=null&&(u=e.memoizedProps,od(e,u,n!==null?n.memoizedProps:u)),s&1024&&(hd=!0);break;case 6:if(ol(t,e),fl(e),s&4){if(e.stateNode===null)throw Error(c(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(Ee){_t(e,e.return,Ee)}}break;case 3:if(uo=null,u=Yl,Yl=ro(t.containerInfo),ol(t,e),Yl=u,fl(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{yr(t.containerInfo)}catch(Ee){_t(e,e.return,Ee)}hd&&(hd=!1,Lm(e));break;case 4:s=Yl,Yl=ro(e.stateNode.containerInfo),ol(t,e),fl(e),Yl=s;break;case 12:ol(t,e),fl(e);break;case 31:ol(t,e),fl(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 13:ol(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ku=it()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 22:u=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,X=Za,ee=xn;if(Za=X||u,xn=ee||R,ol(t,e),xn=ee,Za=X,fl(e),s&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||Za||xn||vi(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=R.stateNode;var ie=R.memoizedProps.style,Z=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;S.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(Ee){_t(R,R.return,Ee)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(Ee){_t(R,R.return,Ee)}}}else if(t.tag===18){if(n===null){R=t;try{var W=R.stateNode;u?Ng(W,!0):Ng(R.stateNode,!1)}catch(Ee){_t(R,R.return,Ee)}}}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}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Qu(e,n))));break;case 19:ol(t,e),fl(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 30:break;case 21:break;default:ol(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(Tm(s)){n=s;break}s=s.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=fd(e);$u(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(I(b,""),n.flags&=-33);var S=fd(e);$u(e,S,b);break;case 3:case 4:var R=n.stateNode.containerInfo,X=fd(e);dd(e,X,R);break;default:throw Error(c(161))}}catch(ee){_t(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Lm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Cm(e,t.alternate,t),t=t.sibling}function vi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:js(4,t,t.return),vi(t);break;case 1:fa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Nm(t,t.return,n),vi(t);break;case 27:Tc(t.stateNode);case 26:case 5:fa(t,t.return),vi(t);break;case 22:t.memoizedState===null&&vi(t);break;case 30:vi(t);break;default:vi(t)}e=e.sibling}}function Fa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,u=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:Fa(u,f,n),bc(4,f);break;case 1:if(Fa(u,f,n),s=f,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(X){_t(s,s.return,X)}if(s=f,u=s.updateQueue,u!==null){var S=s.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)hp(R[u],S)}catch(X){_t(s,s.return,X)}}n&&b&64&&km(f),xc(f,f.return);break;case 27:Em(f);case 26:case 5:Fa(u,f,n),n&&s===null&&b&4&&wm(f),xc(f,f.return);break;case 12:Fa(u,f,n);break;case 31:Fa(u,f,n),n&&b&4&&Om(u,f);break;case 13:Fa(u,f,n),n&&b&4&&Dm(u,f);break;case 22:f.memoizedState===null&&Fa(u,f,n),xc(f,f.return);break;case 30:break;default:Fa(u,f,n)}t=t.sibling}}function pd(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&&ac(n))}function md(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ac(e))}function Xl(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Um(e,t,n,s),t=t.sibling}function Um(e,t,n,s){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Xl(e,t,n,s),u&2048&&bc(9,t);break;case 1:Xl(e,t,n,s);break;case 3:Xl(e,t,n,s),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ac(e)));break;case 12:if(u&2048){Xl(e,t,n,s),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){_t(t,t.return,R)}}else Xl(e,t,n,s);break;case 31:Xl(e,t,n,s);break;case 13:Xl(e,t,n,s);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?Xl(e,t,n,s):yc(e,t):f._visibility&2?Xl(e,t,n,s):(f._visibility|=2,cr(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),u&2048&&pd(b,t);break;case 24:Xl(e,t,n,s),u&2048&&md(t.alternate,t);break;default:Xl(e,t,n,s)}}function cr(e,t,n,s,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=n,R=s,X=b.flags;switch(b.tag){case 0:case 11:case 15:cr(f,b,S,R,u),bc(8,b);break;case 23:break;case 22:var ee=b.stateNode;b.memoizedState!==null?ee._visibility&2?cr(f,b,S,R,u):yc(f,b):(ee._visibility|=2,cr(f,b,S,R,u)),u&&X&2048&&pd(b.alternate,b);break;case 24:cr(f,b,S,R,u),u&&X&2048&&md(b.alternate,b);break;default:cr(f,b,S,R,u)}t=t.sibling}}function yc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,u=s.flags;switch(s.tag){case 22:yc(n,s),u&2048&&pd(s.alternate,s);break;case 24:yc(n,s),u&2048&&md(s.alternate,s);break;default:yc(n,s)}t=t.sibling}}var _c=8192;function ur(e,t,n){if(e.subtreeFlags&_c)for(e=e.child;e!==null;)Hm(e,t,n),e=e.sibling}function Hm(e,t,n){switch(e.tag){case 26:ur(e,t,n),e.flags&_c&&e.memoizedState!==null&&M_(n,Yl,e.memoizedState,e.memoizedProps);break;case 5:ur(e,t,n);break;case 3:case 4:var s=Yl;Yl=ro(e.stateNode.containerInfo),ur(e,t,n),Yl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=_c,_c=16777216,ur(e,t,n),_c=s):ur(e,t,n));break;default:ur(e,t,n)}}function Bm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function vc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Cn=s,Im(s,e)}Bm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qm(e),e=e.sibling}function qm(e){switch(e.tag){case 0:case 11:case 15:vc(e),e.flags&2048&&js(9,e,e.return);break;case 3:vc(e);break;case 12:vc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):vc(e);break;default:vc(e)}}function Zu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Cn=s,Im(s,e)}Bm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:js(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Im(e,t){for(;Cn!==null;){var n=Cn;switch(n.tag){case 0:case 11:case 15:js(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ac(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Cn=s;else e:for(n=e;Cn!==null;){s=Cn;var u=s.sibling,f=s.return;if(Rm(s),s===n){Cn=null;break e}if(u!==null){u.return=f,Cn=u;break e}Cn=f}}}var Qy={getCacheForType:function(e){var t=Ln(mn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ln(mn).controller.signal}},Zy=typeof WeakMap=="function"?WeakMap:Map,ft=0,Et=null,Je=null,Pe=0,yt=0,kl=null,ks=!1,or=!1,gd=!1,Wa=0,Wt=0,Ns=0,Si=0,bd=0,Nl=0,fr=0,Sc=null,dl=null,xd=!1,Ku=0,Gm=0,Ju=1/0,Fu=null,ws=null,Nn=0,Ts=null,dr=null,Pa=0,yd=0,_d=null,Ym=null,jc=0,vd=null;function wl(){return(ft&2)!==0&&Pe!==0?Pe&-Pe:H.T!==null?Td():wa()}function Xm(){if(Nl===0)if((Pe&536870912)===0||Oe){var e=O;O<<=1,(O&3932160)===0&&(O=262144),Nl=e}else Nl=536870912;return e=Sl.current,e!==null&&(e.flags|=32),Nl}function hl(e,t,n){(e===Et&&(yt===2||yt===9)||e.cancelPendingCommit!==null)&&(hr(e,0),Es(e,Pe,Nl,!1)),Al(e,n),((ft&2)===0||e!==Et)&&(e===Et&&((ft&2)===0&&(Si|=n),Wt===4&&Es(e,Pe,Nl,!1)),da(e))}function Vm(e,t,n){if((ft&6)!==0)throw Error(c(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Tt(e,t),u=s?Fy(e,t):jd(e,t,!0),f=s;do{if(u===0){or&&!s&&Es(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!Ky(n)){u=jd(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var S=e;u=Sc;var R=S.current.memoizedState.isDehydrated;if(R&&(hr(S,b).flags|=256),b=jd(S,b,!1),b!==2){if(gd&&!R){S.errorRecoveryDisabledLanes|=f,Si|=f,u=4;break e}f=dl,dl=u,f!==null&&(dl===null?dl=f:dl.push.apply(dl,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){hr(e,0),Es(e,t,0,!0);break}e:{switch(s=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Es(s,t,Nl,!ks);break e;case 2:dl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Ku+300-it(),10<u)){if(Es(s,t,Nl,!ks),qe(s,0,!0)!==0)break e;Pa=t,s.timeoutHandle=Sg($m.bind(null,s,n,dl,Fu,xd,t,Nl,Si,fr,ks,f,"Throttled",-0,0),u);break e}$m(s,n,dl,Fu,xd,t,Nl,Si,fr,ks,f,null,-0,0)}}break}while(!0);da(e)}function $m(e,t,n,s,u,f,b,S,R,X,ee,ie,Z,W){if(e.timeoutHandle=-1,ie=t.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rt},Hm(t,f,ie);var Ee=(f&62914560)===f?Ku-it():(f&4194048)===f?Gm-it():0;if(Ee=O_(ie,Ee),Ee!==null){Pa=f,e.cancelPendingCommit=Ee(eg.bind(null,e,t,f,n,s,u,b,S,R,ee,ie,null,Z,W)),Es(e,f,b,!X);return}}eg(e,t,f,n,s,u,b,S,R)}function Ky(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 s=0;s<n.length;s++){var u=n[s],f=u.getSnapshot;u=u.value;try{if(!Pn(f(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Es(e,t,n,s){t&=~bd,t&=~Si,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var u=t;0<u;){var f=31-ut(u),b=1<<f;s[f]=-1,u&=~b}n!==0&&Na(e,n,t)}function Wu(){return(ft&6)===0?(kc(0),!1):!0}function Sd(){if(Je!==null){if(yt===0)var e=Je.return;else e=Je,Ga=hi=null,Hf(e),lr=null,ic=0,e=Je;for(;e!==null;)jm(e.alternate,e),e=e.return;Je=null}}function hr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,m_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pa=0,Sd(),Et=e,Je=n=Gl(e.current,null),Pe=t,yt=0,kl=null,ks=!1,or=Tt(e,t),gd=!1,fr=Nl=bd=Si=Ns=Wt=0,dl=Sc=null,xd=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var u=31-ut(s),f=1<<u;t|=e[u],s&=~f}return Wa=t,Vn(),n}function Qm(e,t){Xe=null,H.H=pc,t===nr||t===Tu?(t=up(),yt=3):t===wf?(t=up(),yt=4):yt=t===ed?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,kl=t,Je===null&&(Wt=1,Iu(e,nl(t,e.current)))}function Zm(){var e=Sl.current;return e===null?!0:(Pe&4194048)===Pe?Ml===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===Ml:!1}function Km(){var e=H.H;return H.H=pc,e===null?pc:e}function Jm(){var e=H.A;return H.A=Qy,e}function Pu(){Wt=4,ks||(Pe&4194048)!==Pe&&Sl.current!==null||(or=!0),(Ns&134217727)===0&&(Si&134217727)===0||Et===null||Es(Et,Pe,Nl,!1)}function jd(e,t,n){var s=ft;ft|=2;var u=Km(),f=Jm();(Et!==e||Pe!==t)&&(Fu=null,hr(e,t)),t=!1;var b=Wt;e:do try{if(yt!==0&&Je!==null){var S=Je,R=kl;switch(yt){case 8:Sd(),b=6;break e;case 3:case 2:case 9:case 6:Sl.current===null&&(t=!0);var X=yt;if(yt=0,kl=null,pr(e,S,R,X),n&&or){b=0;break e}break;default:X=yt,yt=0,kl=null,pr(e,S,R,X)}}Jy(),b=Wt;break}catch(ee){Qm(e,ee)}while(!0);return t&&e.shellSuspendCounter++,Ga=hi=null,ft=s,H.H=u,H.A=f,Je===null&&(Et=null,Pe=0,Vn()),b}function Jy(){for(;Je!==null;)Fm(Je)}function Fy(e,t){var n=ft;ft|=2;var s=Km(),u=Jm();Et!==e||Pe!==t?(Fu=null,Ju=it()+500,hr(e,t)):or=Tt(e,t);e:do try{if(yt!==0&&Je!==null){t=Je;var f=kl;t:switch(yt){case 1:yt=0,kl=null,pr(e,t,f,1);break;case 2:case 9:if(rp(f)){yt=0,kl=null,Wm(t);break}t=function(){yt!==2&&yt!==9||Et!==e||(yt=7),da(e)},f.then(t,t);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:rp(f)?(yt=0,kl=null,Wm(t)):(yt=0,kl=null,pr(e,t,f,7));break;case 5:var b=null;switch(Je.tag){case 26:b=Je.memoizedState;case 5:case 27:var S=Je;if(b?Ug(b):S.stateNode.complete){yt=0,kl=null;var R=S.sibling;if(R!==null)Je=R;else{var X=S.return;X!==null?(Je=X,eo(X)):Je=null}break t}}yt=0,kl=null,pr(e,t,f,5);break;case 6:yt=0,kl=null,pr(e,t,f,6);break;case 8:Sd(),Wt=6;break e;default:throw Error(c(462))}}Wy();break}catch(ee){Qm(e,ee)}while(!0);return Ga=hi=null,H.H=s,H.A=u,ft=n,Je!==null?0:(Et=null,Pe=0,Vn(),Wt)}function Wy(){for(;Je!==null&&!It();)Fm(Je)}function Fm(e){var t=vm(e.alternate,e,Wa);e.memoizedProps=e.pendingProps,t===null?eo(e):Je=t}function Wm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mm(n,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=mm(n,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:Hf(t);default:jm(n,t),t=Je=Ki(t,Wa),t=vm(n,t,Wa)}e.memoizedProps=e.pendingProps,t===null?eo(e):Je=t}function pr(e,t,n,s){Ga=hi=null,Hf(t),lr=null,ic=0;var u=t.return;try{if(qy(e,u,t,n,Pe)){Wt=1,Iu(e,nl(n,e.current)),Je=null;return}}catch(f){if(u!==null)throw Je=u,f;Wt=1,Iu(e,nl(n,e.current)),Je=null;return}t.flags&32768?(Oe||s===1?e=!0:or||(Pe&536870912)!==0?e=!1:(ks=e=!0,(s===2||s===9||s===3||s===6)&&(s=Sl.current,s!==null&&s.tag===13&&(s.flags|=16384))),Pm(t,e)):eo(t)}function eo(e){var t=e;do{if((t.flags&32768)!==0){Pm(t,ks);return}e=t.return;var n=Yy(t.alternate,t,Wa);if(n!==null){Je=n;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);Wt===0&&(Wt=5)}function Pm(e,t){do{var n=Xy(e.alternate,e);if(n!==null){n.flags&=32767,Je=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Je=e;return}Je=e=n}while(e!==null);Wt=6,Je=null}function eg(e,t,n,s,u,f,b,S,R){e.cancelPendingCommit=null;do to();while(Nn!==0);if((ft&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=tl,ka(e,n,f,b,S,R),e===Et&&(Je=Et=null,Pe=0),dr=t,Ts=e,Pa=n,yd=f,_d=u,Ym=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,n_(At,function(){return sg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=H.T,H.T=null,u=re.p,re.p=2,b=ft,ft|=4;try{Vy(e,t,n)}finally{ft=b,re.p=u,H.T=s}}Nn=1,tg(),ng(),lg()}}function tg(){if(Nn===1){Nn=0;var e=Ts,t=dr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=H.T,H.T=null;var s=re.p;re.p=2;var u=ft;ft|=4;try{zm(t,e);var f=zd,b=gu(e.containerInfo),S=f.focusedElem,R=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&mu(S.ownerDocument.documentElement,S)){if(R!==null&&Jr(S)){var X=R.start,ee=R.end;if(ee===void 0&&(ee=X),"selectionStart"in S)S.selectionStart=X,S.selectionEnd=Math.min(ee,S.value.length);else{var ie=S.ownerDocument||document,Z=ie&&ie.defaultView||window;if(Z.getSelection){var W=Z.getSelection(),Ee=S.textContent.length,He=Math.min(R.start,Ee),jt=R.end===void 0?He:Math.min(R.end,Ee);!W.extend&&He>jt&&(b=jt,jt=He,He=b);var B=Kr(S,He),D=Kr(S,jt);if(B&&D&&(W.rangeCount!==1||W.anchorNode!==B.node||W.anchorOffset!==B.offset||W.focusNode!==D.node||W.focusOffset!==D.offset)){var G=ie.createRange();G.setStart(B.node,B.offset),W.removeAllRanges(),He>jt?(W.addRange(G),W.extend(D.node,D.offset)):(G.setEnd(D.node,D.offset),W.addRange(G))}}}}for(ie=[],W=S;W=W.parentNode;)W.nodeType===1&&ie.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ie.length;S++){var le=ie[S];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}po=!!Dd,zd=Dd=null}finally{ft=u,re.p=s,H.T=n}}e.current=t,Nn=2}}function ng(){if(Nn===2){Nn=0;var e=Ts,t=dr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=H.T,H.T=null;var s=re.p;re.p=2;var u=ft;ft|=4;try{Cm(e,t.alternate,t)}finally{ft=u,re.p=s,H.T=n}}Nn=3}}function lg(){if(Nn===4||Nn===3){Nn=0,Xt();var e=Ts,t=dr,n=Pa,s=Ym;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nn=5:(Nn=0,dr=Ts=null,ag(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ws=null),on(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Zt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=H.T,u=re.p,re.p=2,H.T=null;try{for(var f=e.onRecoverableError,b=0;b<s.length;b++){var S=s[b];f(S.value,{componentStack:S.stack})}}finally{H.T=t,re.p=u}}(Pa&3)!==0&&to(),da(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===vd?jc++:(jc=0,vd=e):jc=0,kc(0)}}function ag(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ac(t)))}function to(){return tg(),ng(),lg(),sg()}function sg(){if(Nn!==5)return!1;var e=Ts,t=yd;yd=0;var n=on(Pa),s=H.T,u=re.p;try{re.p=32>n?32:n,H.T=null,n=_d,_d=null;var f=Ts,b=Pa;if(Nn=0,dr=Ts=null,Pa=0,(ft&6)!==0)throw Error(c(331));var S=ft;if(ft|=4,qm(f.current),Um(f,f.current,b,n),ft=S,kc(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Zt,f)}catch{}return!0}finally{re.p=u,H.T=s,ag(e,t)}}function ig(e,t,n){t=nl(n,t),t=Pf(e.stateNode,t,2),e=_s(e,t,2),e!==null&&(Al(e,2),da(e))}function _t(e,t,n){if(e.tag===3)ig(e,e,n);else for(;t!==null;){if(t.tag===3){ig(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ws===null||!ws.has(s))){e=nl(n,e),n=rm(2),s=_s(t,n,2),s!==null&&(cm(n,s,t,e),Al(s,2),da(s));break}}t=t.return}}function kd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Zy;var u=new Set;s.set(t,u)}else u=s.get(t),u===void 0&&(u=new Set,s.set(t,u));u.has(n)||(gd=!0,u.add(n),e=Py.bind(null,e,t,n),t.then(e,e))}function Py(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Et===e&&(Pe&n)===n&&(Wt===4||Wt===3&&(Pe&62914560)===Pe&&300>it()-Ku?(ft&2)===0&&hr(e,0):bd|=n,fr===Pe&&(fr=0)),da(e)}function rg(e,t){t===0&&(t=jn()),e=Il(e,t),e!==null&&(Al(e,t),da(e))}function e_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rg(e,n)}function t_(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(c(314))}s!==null&&s.delete(t),rg(e,n)}function n_(e,t){return Qt(e,t)}var no=null,mr=null,Nd=!1,lo=!1,wd=!1,As=0;function da(e){e!==mr&&e.next===null&&(mr===null?no=mr=e:mr=mr.next=e),lo=!0,Nd||(Nd=!0,a_())}function kc(e,t){if(!wd&&lo){wd=!0;do for(var n=!1,s=no;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var f=0;else{var b=s.suspendedLanes,S=s.pingedLanes;f=(1<<31-ut(42|e)+1)-1,f&=u&~(b&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,fg(s,f))}else f=Pe,f=qe(s,s===Et?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Tt(s,f)||(n=!0,fg(s,f));s=s.next}while(n);wd=!1}}function l_(){cg()}function cg(){lo=Nd=!1;var e=0;As!==0&&p_()&&(e=As);for(var t=it(),n=null,s=no;s!==null;){var u=s.next,f=ug(s,t);f===0?(s.next=null,n===null?no=u:n.next=u,u===null&&(mr=n)):(n=s,(e!==0||(f&3)!==0)&&(lo=!0)),s=u}Nn!==0&&Nn!==5||kc(e),As!==0&&(As=0)}function ug(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-ut(f),S=1<<b,R=u[b];R===-1?((S&n)===0||(S&s)!==0)&&(u[b]=Sn(S,t)):R<=t&&(e.expiredLanes|=S),f&=~S}if(t=Et,n=Pe,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(yt===2||yt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&qt(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&qt(s),on(n)){case 2:case 8:n=wn;break;case 32:n=At;break;case 268435456:n=Tn;break;default:n=At}return s=og.bind(null,e),n=Qt(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&qt(s),e.callbackPriority=2,e.callbackNode=null,2}function og(e,t){if(Nn!==0&&Nn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(to()&&e.callbackNode!==n)return null;var s=Pe;return s=qe(e,e===Et?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Vm(e,s,t),ug(e,it()),e.callbackNode!=null&&e.callbackNode===n?og.bind(null,e):null)}function fg(e,t){if(to())return null;Vm(e,t,!0)}function a_(){g_(function(){(ft&6)!==0?Qt(Pt,l_):cg()})}function Td(){if(As===0){var e=er;e===0&&(e=_e,_e<<=1,(_e&261888)===0&&(_e=256)),As=e}return As}function dg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ln(""+e)}function hg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function s_(e,t,n,s,u){if(t==="submit"&&n&&n.stateNode===u){var f=dg((u[Qe]||null).action),b=s.submitter;b&&(t=(t=b[Qe]||null)?dg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new is("action","action",null,s,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(As!==0){var R=b?hg(u,b):new FormData(u);Qf(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(S.preventDefault(),R=b?hg(u,b):new FormData(u),Qf(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var Ed=0;Ed<Pr.length;Ed++){var Ad=Pr[Ed],i_=Ad.toLowerCase(),r_=Ad[0].toUpperCase()+Ad.slice(1);_l(i_,"on"+r_)}_l(yu,"onAnimationEnd"),_l(_u,"onAnimationIteration"),_l(vu,"onAnimationStart"),_l("dblclick","onDoubleClick"),_l("focusin","onFocus"),_l("focusout","onBlur"),_l(mf,"onTransitionRun"),_l(gf,"onTransitionStart"),_l(bf,"onTransitionCancel"),_l(Su,"onTransitionEnd"),Yn("onMouseEnter",["mouseout","mouseover"]),Yn("onMouseLeave",["mouseout","mouseover"]),Yn("onPointerEnter",["pointerout","pointerover"]),Yn("onPointerLeave",["pointerout","pointerover"]),Gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),c_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function pg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],u=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var b=s.length-1;0<=b;b--){var S=s[b],R=S.instance,X=S.currentTarget;if(S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=X;try{f(u)}catch(ee){oi(ee)}u.currentTarget=null,f=R}else for(b=0;b<s.length;b++){if(S=s[b],R=S.instance,X=S.currentTarget,S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=X;try{f(u)}catch(ee){oi(ee)}u.currentTarget=null,f=R}}}}function Fe(e,t){var n=t[Qs];n===void 0&&(n=t[Qs]=new Set);var s=e+"__bubble";n.has(s)||(mg(t,e,2,!1),n.add(s))}function Cd(e,t,n){var s=0;t&&(s|=4),mg(n,e,s,t)}var ao="_reactListening"+Math.random().toString(36).slice(2);function Rd(e){if(!e[ao]){e[ao]=!0,In.forEach(function(n){n!=="selectionchange"&&(c_.has(n)||Cd(n,!1,e),Cd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ao]||(t[ao]=!0,Cd("selectionchange",!1,t))}}function mg(e,t,n,s){switch(Xg(t)){case 2:var u=L_;break;case 8:u=U_;break;default:u=$d}n=u.bind(null,t,n,e),u=void 0,!Fs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),s?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 Md(e,t,n,s,u){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var S=s.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=s.return;b!==null;){var R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=Wl(S),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){s=f=b;continue e}S=S.parentNode}}s=s.return}qi(function(){var X=f,ee=Gt(n),ie=[];e:{var Z=ju.get(e);if(Z!==void 0){var W=is,Ee=e;switch(e){case"keypress":if(Oa(n)===0)break e;case"keydown":case"keyup":W=us;break;case"focusin":Ee="focus",W=cs;break;case"focusout":Ee="blur",W=cs;break;case"beforeblur":case"afterblur":W=cs;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":W=Yr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=Bl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=Po;break;case yu:case _u:case vu:W=Ps;break;case Su:W=os;break;case"scroll":case"scrollend":W=Fo;break;case"wheel":W=tf;break;case"copy":case"cut":case"paste":W=tu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=lu;break;case"toggle":case"beforetoggle":W=lf}var He=(t&4)!==0,jt=!He&&(e==="scroll"||e==="scrollend"),B=He?Z!==null?Z+"Capture":null:Z;He=[];for(var D=X,G;D!==null;){var le=D;if(G=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||G===null||B===null||(le=Js(D,B),le!=null&&He.push(wc(D,le,G))),jt)break;D=D.return}0<He.length&&(Z=new W(Z,Ee,null,n,ee),ie.push({event:Z,listeners:He}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",Z&&n!==hn&&(Ee=n.relatedTarget||n.fromElement)&&(Wl(Ee)||Ee[Fn]))break e;if((W||Z)&&(Z=ee.window===ee?ee:(Z=ee.ownerDocument)?Z.defaultView||Z.parentWindow:window,W?(Ee=n.relatedTarget||n.toElement,W=X,Ee=Ee?Wl(Ee):null,Ee!==null&&(jt=d(Ee),He=Ee.tag,Ee!==jt||He!==5&&He!==27&&He!==6)&&(Ee=null)):(W=null,Ee=X),W!==Ee)){if(He=Yr,le="onMouseLeave",B="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(He=lu,le="onPointerLeave",B="onPointerEnter",D="pointer"),jt=W==null?Z:tn(W),G=Ee==null?Z:tn(Ee),Z=new He(le,D+"leave",W,n,ee),Z.target=jt,Z.relatedTarget=G,le=null,Wl(ee)===X&&(He=new He(B,D+"enter",Ee,n,ee),He.target=G,He.relatedTarget=jt,le=He),jt=le,W&&Ee)t:{for(He=u_,B=W,D=Ee,G=0,le=B;le;le=He(le))G++;le=0;for(var ze=D;ze;ze=He(ze))le++;for(;0<G-le;)B=He(B),G--;for(;0<le-G;)D=He(D),le--;for(;G--;){if(B===D||D!==null&&B===D.alternate){He=B;break t}B=He(B),D=He(D)}He=null}else He=null;W!==null&&gg(ie,Z,W,He,!1),Ee!==null&&jt!==null&&gg(ie,jt,Ee,He,!0)}}e:{if(Z=X?tn(X):window,W=Z.nodeName&&Z.nodeName.toLowerCase(),W==="select"||W==="input"&&Z.type==="file")var rt=Qr;else if(Vi(Z))if(ou)rt=df;else{rt=of;var Re=uf}else W=Z.nodeName,!W||W.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?X&&Le(X.elementType)&&(rt=Qr):rt=ff;if(rt&&(rt=rt(e,X))){uu(ie,rt,n,ee);break e}Re&&Re(e,Z,X),e==="focusout"&&X&&Z.type==="number"&&X.memoizedProps.value!=null&&na(Z,"number",Z.value)}switch(Re=X?tn(X):window,e){case"focusin":(Vi(Re)||Re.contentEditable==="true")&&(ca=Re,ui=X,ua=null);break;case"focusout":ua=ui=ca=null;break;case"mousedown":Fr=!0;break;case"contextmenu":case"mouseup":case"dragend":Fr=!1,bu(ie,n,ee);break;case"selectionchange":if(pf)break;case"keydown":case"keyup":bu(ie,n,ee)}var $e;if(za)e:{switch(e){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else La?iu(e,n)&&(et="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(et="onCompositionStart");et&&(au&&n.locale!=="ko"&&(La||et!=="onCompositionStart"?et==="onCompositionEnd"&&La&&($e=Rl()):(yl=ee,Ii="value"in yl?yl.value:yl.textContent,La=!0)),Re=so(X,et),0<Re.length&&(et=new ti(et,e,null,n,ee),ie.push({event:et,listeners:Re}),$e?et.data=$e:($e=Xi(n),$e!==null&&(et.data=$e)))),($e=sf?ru(e,n):rf(e,n))&&(et=so(X,"onBeforeInput"),0<et.length&&(Re=new ti("onBeforeInput","beforeinput",null,n,ee),ie.push({event:Re,listeners:et}),Re.data=$e)),s_(ie,e,X,n,ee)}pg(ie,t)})}function wc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function so(e,t){for(var n=t+"Capture",s=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Js(e,n),u!=null&&s.unshift(wc(e,u,f)),u=Js(e,t),u!=null&&s.push(wc(e,u,f))),e.tag===3)return s;e=e.return}return[]}function u_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gg(e,t,n,s,u){for(var f=t._reactName,b=[];n!==null&&n!==s;){var S=n,R=S.alternate,X=S.stateNode;if(S=S.tag,R!==null&&R===s)break;S!==5&&S!==26&&S!==27||X===null||(R=X,u?(X=Js(n,f),X!=null&&b.unshift(wc(n,X,R))):u||(X=Js(n,f),X!=null&&b.push(wc(n,X,R)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var o_=/\r\n?/g,f_=/\u0000|\uFFFD/g;function bg(e){return(typeof e=="string"?e:""+e).replace(o_,`
50
- `).replace(f_,"")}function xg(e,t){return t=bg(t),bg(e)===t}function St(e,t,n,s,u,f){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||I(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&I(e,""+s);break;case"className":On(e,"class",s);break;case"tabIndex":On(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":On(e,n,s);break;case"style":De(e,s,f);break;case"data":if(t!=="object"){On(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=ln(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&St(e,t,"name",u.name,u,null),St(e,t,"formEncType",u.formEncType,u,null),St(e,t,"formMethod",u.formMethod,u,null),St(e,t,"formTarget",u.formTarget,u,null)):(St(e,t,"encType",u.encType,u,null),St(e,t,"method",u.method,u,null),St(e,t,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=ln(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Rt);break;case"onScroll":s!=null&&Fe("scroll",e);break;case"onScrollEnd":s!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=ln(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),En(e,"popover",s);break;case"xlinkActuate":fn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":fn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":fn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":fn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":fn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":fn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":fn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":fn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":fn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":En(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=ht.get(n)||n,En(e,n,s))}}function Od(e,t,n,s,u,f){switch(n){case"style":De(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof s=="string"?I(e,s):(typeof s=="number"||typeof s=="bigint")&&I(e,""+s);break;case"onScroll":s!=null&&Fe("scroll",e);break;case"onScrollEnd":s!=null&&Fe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Rt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ea.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),f=e[Qe]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof s=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,u);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):En(e,n,s)}}}function Hn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var s=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:St(e,t,f,b,n,null)}}u&&St(e,t,"srcSet",n.srcSet,n,null),s&&St(e,t,"src",n.src,n,null);return;case"input":Fe("invalid",e);var S=f=b=u=null,R=null,X=null;for(s in n)if(n.hasOwnProperty(s)){var ee=n[s];if(ee!=null)switch(s){case"name":u=ee;break;case"type":b=ee;break;case"checked":R=ee;break;case"defaultChecked":X=ee;break;case"value":f=ee;break;case"defaultValue":S=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:St(e,t,s,ee,n,null)}}Hl(e,f,S,R,X,b,u,!1);return;case"select":Fe("invalid",e),s=b=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":s=S;default:St(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!s,t!=null?cl(e,!!s,t,!1):n!=null&&cl(e,!!s,n,!0);return;case"textarea":Fe("invalid",e),f=u=s=null;for(b in n)if(n.hasOwnProperty(b)&&(S=n[b],S!=null))switch(b){case"value":s=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:St(e,t,b,S,n,null)}T(e,s,u,f);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(s=n[R],s!=null))switch(R){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:St(e,t,R,s,n,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(s=0;s<Nc.length;s++)Fe(Nc[s],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("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(X in n)if(n.hasOwnProperty(X)&&(s=n[X],s!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:St(e,t,X,s,n,null)}return;default:if(Le(t)){for(ee in n)n.hasOwnProperty(ee)&&(s=n[ee],s!==void 0&&Od(e,t,ee,s,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(s=n[S],s!=null&&St(e,t,S,s,n,null))}function d_(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,R=null,X=null,ee=null;for(W in n){var ie=n[W];if(n.hasOwnProperty(W)&&ie!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":R=ie;default:s.hasOwnProperty(W)||St(e,t,W,null,s,ie)}}for(var Z in s){var W=s[Z];if(ie=n[Z],s.hasOwnProperty(Z)&&(W!=null||ie!=null))switch(Z){case"type":f=W;break;case"name":u=W;break;case"checked":X=W;break;case"defaultChecked":ee=W;break;case"value":b=W;break;case"defaultValue":S=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(c(137,t));break;default:W!==ie&&St(e,t,Z,W,s,ie)}}xl(e,b,S,R,X,ee,f,u);return;case"select":W=b=S=Z=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":W=R;default:s.hasOwnProperty(f)||St(e,t,f,null,s,R)}for(u in s)if(f=s[u],R=n[u],s.hasOwnProperty(u)&&(f!=null||R!=null))switch(u){case"value":Z=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==R&&St(e,t,u,f,s,R)}t=S,n=b,s=W,Z!=null?cl(e,!!n,Z,!1):!!s!=!!n&&(t!=null?cl(e,!!n,t,!0):cl(e,!!n,n?[]:"",!1));return;case"textarea":W=Z=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:St(e,t,S,null,s,u)}for(b in s)if(u=s[b],f=n[b],s.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":Z=u;break;case"defaultValue":W=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&St(e,t,b,u,s,f)}fe(e,Z,W);return;case"option":for(var Ee in n)if(Z=n[Ee],n.hasOwnProperty(Ee)&&Z!=null&&!s.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:St(e,t,Ee,null,s,Z)}for(R in s)if(Z=s[R],W=n[R],s.hasOwnProperty(R)&&Z!==W&&(Z!=null||W!=null))switch(R){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:St(e,t,R,Z,s,W)}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 He in n)Z=n[He],n.hasOwnProperty(He)&&Z!=null&&!s.hasOwnProperty(He)&&St(e,t,He,null,s,Z);for(X in s)if(Z=s[X],W=n[X],s.hasOwnProperty(X)&&Z!==W&&(Z!=null||W!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:St(e,t,X,Z,s,W)}return;default:if(Le(t)){for(var jt in n)Z=n[jt],n.hasOwnProperty(jt)&&Z!==void 0&&!s.hasOwnProperty(jt)&&Od(e,t,jt,void 0,s,Z);for(ee in s)Z=s[ee],W=n[ee],!s.hasOwnProperty(ee)||Z===W||Z===void 0&&W===void 0||Od(e,t,ee,Z,s,W);return}}for(var B in n)Z=n[B],n.hasOwnProperty(B)&&Z!=null&&!s.hasOwnProperty(B)&&St(e,t,B,null,s,Z);for(ie in s)Z=s[ie],W=n[ie],!s.hasOwnProperty(ie)||Z===W||Z==null&&W==null||St(e,t,ie,Z,s,W)}function yg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var u=n[s],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&yg(b)){for(b=0,S=u.responseEnd,s+=1;s<n.length;s++){var R=n[s],X=R.startTime;if(X>S)break;var ee=R.transferSize,ie=R.initiatorType;ee&&yg(ie)&&(R=R.responseEnd,b+=ee*(R<S?1:(S-X)/(R-X)))}if(--s,t+=8*(f+b)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Dd=null,zd=null;function io(e){return e.nodeType===9?e:e.ownerDocument}function _g(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vg(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 Ld(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 Ud=null;function p_(){var e=window.event;return e&&e.type==="popstate"?e===Ud?!1:(Ud=e,!0):(Ud=null,!1)}var Sg=typeof setTimeout=="function"?setTimeout:void 0,m_=typeof clearTimeout=="function"?clearTimeout:void 0,jg=typeof Promise=="function"?Promise:void 0,g_=typeof queueMicrotask=="function"?queueMicrotask:typeof jg<"u"?function(e){return jg.resolve(null).then(e).catch(b_)}:Sg;function b_(e){setTimeout(function(){throw e})}function Cs(e){return e==="head"}function kg(e,t){var n=t,s=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(u),yr(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")Tc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Tc(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[Fl]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&Tc(e.ownerDocument.body);n=u}while(n);yr(t)}function Ng(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Hd(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":Hd(n),Ta(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function x_(e,t,n,s){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Fl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Ol(e.nextSibling),e===null)break}return null}function y_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ol(e.nextSibling),e===null))return null;return e}function wg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ol(e.nextSibling),e===null))return null;return e}function Bd(e){return e.data==="$?"||e.data==="$~"}function qd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function __(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ol(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 Id=null;function Tg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ol(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Eg(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 Ag(e,t,n){switch(t=io(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 Tc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ta(e)}var Dl=new Map,Cg=new Set;function ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var es=re.d;re.d={f:v_,r:S_,D:j_,C:k_,L:N_,m:w_,X:E_,S:T_,M:A_};function v_(){var e=es.f(),t=Wu();return e||t}function S_(e){var t=bl(e);t!==null&&t.tag===5&&t.type==="form"?Qp(t):es.r(e)}var gr=typeof document>"u"?null:document;function Rg(e,t,n){var s=gr;if(s&&typeof t=="string"&&t){var u=Dn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Cg.has(u)||(Cg.add(u),e={rel:e,crossOrigin:n,href:t},s.querySelector(u)===null&&(t=s.createElement("link"),Hn(t,"link",e),ot(t),s.head.appendChild(t)))}}function j_(e){es.D(e),Rg("dns-prefetch",e,null)}function k_(e,t){es.C(e,t),Rg("preconnect",e,t)}function N_(e,t,n){es.L(e,t,n);var s=gr;if(s&&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 f=u;switch(t){case"style":f=br(e);break;case"script":f=xr(e)}Dl.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Dl.set(f,e),s.querySelector(u)!==null||t==="style"&&s.querySelector(Ec(f))||t==="script"&&s.querySelector(Ac(f))||(t=s.createElement("link"),Hn(t,"link",e),ot(t),s.head.appendChild(t)))}}function w_(e,t){es.m(e,t);var n=gr;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Dn(s)+'"][href="'+Dn(e)+'"]',f=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=xr(e)}if(!Dl.has(f)&&(e=j({rel:"modulepreload",href:e},t),Dl.set(f,e),n.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ac(f)))return}s=n.createElement("link"),Hn(s,"link",e),ot(s),n.head.appendChild(s)}}}function T_(e,t,n){es.S(e,t,n);var s=gr;if(s&&e){var u=nn(s).hoistableStyles,f=br(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=s.querySelector(Ec(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Dl.get(f))&&Gd(e,n);var R=b=s.createElement("link");ot(R),Hn(R,"link",e),R._p=new Promise(function(X,ee){R.onload=X,R.onerror=ee}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,co(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function E_(e,t){es.X(e,t);var n=gr;if(n&&e){var s=nn(n).hoistableScripts,u=xr(e),f=s.get(u);f||(f=n.querySelector(Ac(u)),f||(e=j({src:e,async:!0},t),(t=Dl.get(u))&&Yd(e,t),f=n.createElement("script"),ot(f),Hn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function A_(e,t){es.M(e,t);var n=gr;if(n&&e){var s=nn(n).hoistableScripts,u=xr(e),f=s.get(u);f||(f=n.querySelector(Ac(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=Dl.get(u))&&Yd(e,t),f=n.createElement("script"),ot(f),Hn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function Mg(e,t,n,s){var u=(u=ye.current)?ro(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=br(n.href),n=nn(u).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=br(n.href);var f=nn(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(Ec(e)))&&!f._p&&(b.instance=f,b.state.loading=5),Dl.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},Dl.set(e,n),f||C_(u,e,n,b.state))),t&&s===null)throw Error(c(528,""));return b}if(t&&s!==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=xr(n),n=nn(u).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function br(e){return'href="'+Dn(e)+'"'}function Ec(e){return'link[rel="stylesheet"]['+e+"]"}function Og(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function C_(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Hn(t,"link",n),ot(t),e.head.appendChild(t))}function xr(e){return'[src="'+Dn(e)+'"]'}function Ac(e){return"script[async]"+e}function Dg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Dn(n.href)+'"]');if(s)return t.instance=s,ot(s),s;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ot(s),Hn(s,"style",u),co(s,n.precedence,e),t.instance=s;case"stylesheet":u=br(n.href);var f=e.querySelector(Ec(u));if(f)return t.state.loading|=4,t.instance=f,ot(f),f;s=Og(n),(u=Dl.get(u))&&Gd(s,u),f=(e.ownerDocument||e).createElement("link"),ot(f);var b=f;return b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),Hn(f,"link",s),t.state.loading|=4,co(f,n.precedence,e),t.instance=f;case"script":return f=xr(n.src),(u=e.querySelector(Ac(f)))?(t.instance=u,ot(u),u):(s=n,(u=Dl.get(f))&&(s=j({},n),Yd(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),ot(u),Hn(u,"link",s),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&&(s=t.instance,t.state.loading|=4,co(s,n.precedence,e));return t.instance}function co(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,f=u,b=0;b<s.length;b++){var S=s[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Gd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var uo=null;function zg(e,t,n){if(uo===null){var s=new Map,u=uo=new Map;u.set(n,s)}else u=uo,s=u.get(n),s||(s=new Map,u.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Fl]||f[Kt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=s.get(b);S?S.push(f):s.set(b,[f])}}return s}function Lg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function R_(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 Ug(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function M_(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=br(s.href),f=t.querySelector(Ec(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=oo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,ot(f);return}f=t.ownerDocument||t,s=Og(s),(u=Dl.get(u))&&Gd(s,u),f=f.createElement("link"),ot(f);var b=f;b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),Hn(f,"link",s),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=oo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Xd=0;function O_(e,t){return e.stylesheets&&e.count===0&&ho(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Xd===0&&(Xd=62500*h_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Xd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function oo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ho(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fo=null;function ho(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fo=new Map,t.forEach(D_,e),fo=null,oo.call(e))}function D_(e,t){if(!(t.state.loading&4)){var n=fo.get(e);if(n)var s=n.get(null);else{n=new Map,fo.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),s=b)}s&&n.set(null,s)}u=t.instance,b=u.getAttribute("data-precedence"),f=n.get(b)||s,f===s&&n.set(null,u),n.set(b,u),this.count++,s=oo.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Cc={$$typeof:Q,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function z_(e,t,n,s,u,f,b,S,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ct(0),this.hiddenUpdates=Ct(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Hg(e,t,n,s,u,f,b,S,R,X,ee,ie){return e=new z_(e,t,n,b,R,X,ee,ie,S),t=1,f===!0&&(t|=24),f=kn(3,null,null,t),e.current=f,f.stateNode=e,t=jf(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:n,cache:t},Tf(f),e}function Bg(e){return e?(e=qa,e):qa}function qg(e,t,n,s,u,f){u=Bg(u),s.context===null?s.context=u:s.pendingContext=u,s=ys(t),s.payload={element:n},f=f===void 0?null:f,f!==null&&(s.callback=f),n=_s(e,s,t),n!==null&&(hl(n,e,t),cc(n,e,t))}function Ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vd(e,t){Ig(e,t),(e=e.alternate)&&Ig(e,t)}function Gg(e){if(e.tag===13||e.tag===31){var t=Il(e,67108864);t!==null&&hl(t,e,67108864),Vd(e,67108864)}}function Yg(e){if(e.tag===13||e.tag===31){var t=wl();t=Kl(t);var n=Il(e,t);n!==null&&hl(n,e,t),Vd(e,t)}}var po=!0;function L_(e,t,n,s){var u=H.T;H.T=null;var f=re.p;try{re.p=2,$d(e,t,n,s)}finally{re.p=f,H.T=u}}function U_(e,t,n,s){var u=H.T;H.T=null;var f=re.p;try{re.p=8,$d(e,t,n,s)}finally{re.p=f,H.T=u}}function $d(e,t,n,s){if(po){var u=Qd(s);if(u===null)Md(e,t,s,mo,n),Vg(e,s);else if(B_(u,e,t,n,s))s.stopPropagation();else if(Vg(e,s),t&4&&-1<H_.indexOf(e)){for(;u!==null;){var f=bl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=xe(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var R=1<<31-ut(b);S.entanglements[1]|=R,b&=~R}da(f),(ft&6)===0&&(Ju=it()+500,kc(0))}}break;case 31:case 13:S=Il(f,2),S!==null&&hl(S,f,2),Wu(),Vd(f,2)}if(f=Qd(s),f===null&&Md(e,t,s,mo,n),f===u)break;u=f}u!==null&&s.stopPropagation()}else Md(e,t,s,null,n)}}function Qd(e){return e=Gt(e),Zd(e)}var mo=null;function Zd(e){if(mo=null,e=Wl(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return mo=e,null}function Xg(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(Nt()){case Pt:return 2;case wn:return 8;case At:case vn:return 32;case Tn:return 268435456;default:return 32}default:return 32}}var Kd=!1,Rs=null,Ms=null,Os=null,Rc=new Map,Mc=new Map,Ds=[],H_="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 Vg(e,t){switch(e){case"focusin":case"focusout":Rs=null;break;case"dragenter":case"dragleave":Ms=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":Rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mc.delete(t.pointerId)}}function Oc(e,t,n,s,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:f,targetContainers:[u]},t!==null&&(t=bl(t),t!==null&&Gg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function B_(e,t,n,s,u){switch(t){case"focusin":return Rs=Oc(Rs,e,t,n,s,u),!0;case"dragenter":return Ms=Oc(Ms,e,t,n,s,u),!0;case"mouseover":return Os=Oc(Os,e,t,n,s,u),!0;case"pointerover":var f=u.pointerId;return Rc.set(f,Oc(Rc.get(f)||null,e,t,n,s,u)),!0;case"gotpointercapture":return f=u.pointerId,Mc.set(f,Oc(Mc.get(f)||null,e,t,n,s,u)),!0}return!1}function $g(e){var t=Wl(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,gl(e.priority,function(){Yg(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,gl(e.priority,function(){Yg(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 go(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qd(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);hn=s,n.target.dispatchEvent(s),hn=null}else return t=bl(n),t!==null&&Gg(t),e.blockedOn=n,!1;t.shift()}return!0}function Qg(e,t,n){go(e)&&n.delete(t)}function q_(){Kd=!1,Rs!==null&&go(Rs)&&(Rs=null),Ms!==null&&go(Ms)&&(Ms=null),Os!==null&&go(Os)&&(Os=null),Rc.forEach(Qg),Mc.forEach(Qg)}function bo(e,t){e.blockedOn===t&&(e.blockedOn=null,Kd||(Kd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,q_)))}var xo=null;function Zg(e){xo!==e&&(xo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){xo===e&&(xo=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],u=e[t+2];if(typeof s!="function"){if(Zd(s||n)===null)continue;break}var f=bl(n);f!==null&&(e.splice(t,3),t-=3,Qf(f,{pending:!0,data:u,method:n.method,action:s},s,u))}}))}function yr(e){function t(R){return bo(R,e)}Rs!==null&&bo(Rs,e),Ms!==null&&bo(Ms,e),Os!==null&&bo(Os,e),Rc.forEach(t),Mc.forEach(t);for(var n=0;n<Ds.length;n++){var s=Ds[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ds.length&&(n=Ds[0],n.blockedOn===null);)$g(n),n.blockedOn===null&&Ds.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var u=n[s],f=n[s+1],b=u[Qe]||null;if(typeof f=="function")b||Zg(n);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Qe]||null)S=b.formAction;else if(Zd(u)!==null)continue}else S=b.action;typeof S=="function"?n[s+1]=S:(n.splice(s,3),s-=3),Zg(n)}}}function Kg(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Jd(e){this._internalRoot=e}yo.prototype.render=Jd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,s=wl();qg(n,s,e,t,null,null)},yo.prototype.unmount=Jd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qg(e.current,2,null,e,null,null),Wu(),t[Fn]=null}};function yo(e){this._internalRoot=e}yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=wa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ds.length&&t!==0&&t<Ds[n].priority;n++);Ds.splice(n,0,e),n===0&&$g(e)}};var Jg=l.version;if(Jg!=="19.2.8")throw Error(c(527,Jg,"19.2.8"));re.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var I_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_o.isDisabled&&_o.supportsFiber)try{Zt=_o.inject(I_),wt=_o}catch{}}return zc.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,s="",u=lm,f=am,b=sm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Hg(e,1,!1,null,null,n,s,null,u,f,b,Kg),e[Fn]=t.current,Rd(e),new Jd(t)},zc.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var s=!1,u="",f=lm,b=am,S=sm,R=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=Hg(e,1,!0,t,n??null,s,u,R,f,b,S,Kg),t.context=Bg(null),n=t.current,s=wl(),s=Kl(s),u=ys(s),u.callback=null,_s(n,u,s),n=s,t.current.lanes=n,Al(t,n),da(t),e[Fn]=t.current,Rd(e),new yo(t)},zc.version="19.2.8",zc}var rb;function P_(){if(rb)return eh.exports;rb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),eh.exports=W_(),eh.exports}var e0=P_();const Ex=1;var ls,Cr,Rr,Mr,Or,Fc,Dr,Qo,Ax;class t0{constructor(l){$t(this,Qo);$t(this,ls,null);$t(this,Cr,new Set);$t(this,Rr,500);$t(this,Mr,null);$t(this,Or,!1);$t(this,Fc,null);$t(this,Dr,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){dt(this,Dr,l)}connect(){if(Be(this,Or))return;const l=new WebSocket(this.url);dt(this,ls,l),l.addEventListener("open",()=>{var i,c;dt(this,Rr,500),this.send({type:"hello",protocol:Ex,clientName:"ccv-web"}),(i=Be(this,Fc))==null||i.call(this),(c=Be(this,Dr))==null||c.call(this)}),l.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of Be(this,Cr))o(c)}),l.addEventListener("close",()=>{var i;dt(this,ls,null),(i=Be(this,Dr))==null||i.call(this),yn(this,Qo,Ax).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){dt(this,Fc,l)}on(l){return Be(this,Cr).add(l),()=>Be(this,Cr).delete(l)}send(l){var i;((i=Be(this,ls))==null?void 0:i.readyState)===WebSocket.OPEN&&Be(this,ls).send(JSON.stringify(l))}get connected(){var l;return((l=Be(this,ls))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;dt(this,Or,!0),(l=Be(this,ls))==null||l.close()}}ls=new WeakMap,Cr=new WeakMap,Rr=new WeakMap,Mr=new WeakMap,Or=new WeakMap,Fc=new WeakMap,Dr=new WeakMap,Qo=new WeakSet,Ax=function(){if(Be(this,Or)||Be(this,Mr)!==null)return;const l=Be(this,Rr);dt(this,Rr,Math.min(l*2,1e4)),dt(this,Mr,window.setTimeout(()=>{dt(this,Mr,null),this.connect()},l))};const n0=1,Cx="ccv:relay",Do="ccv:relay.host";function l0(){try{const a=localStorage.getItem(Cx);if(!a)return null;const l=JSON.parse(a);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function Rx(){localStorage.removeItem(Cx)}var _a,zr,va,Lr,Ur,Ys,Ei,Ai,Xs,Ci,Hr,Ri,Mi,Lt,Hs,Sh,Mx,wi,jh;class a0{constructor(l){$t(this,Lt);$t(this,_a,null);$t(this,zr,new Set);$t(this,va,null);$t(this,Lr,null);$t(this,Ur,500);$t(this,Ys,null);$t(this,Ei,!1);$t(this,Ai,!1);$t(this,Xs,!1);$t(this,Ci,null);$t(this,Hr,"Подключаемся…");$t(this,Ri,0);$t(this,Mi,[]);this.session=l}get connected(){return Be(this,Ai)&&Be(this,Xs)}get statusText(){return Be(this,Hr)}get hostId(){return Be(this,Ci)}on(l){return Be(this,zr).add(l),()=>Be(this,zr).delete(l)}onReconnect(l){dt(this,Lr,l)}onStatus(l){dt(this,va,l)}connect(){Be(this,Ei)||yn(this,Lt,Sh).call(this)}send(l){if(!Be(this,Ai)){Be(this,Mi).length<64&&Be(this,Mi).push(l);return}yn(this,Lt,wi).call(this,{t:"client.frame",body:l})}close(){var l;dt(this,Ei,!0),Be(this,Ys)!==null&&window.clearTimeout(Be(this,Ys)),(l=Be(this,_a))==null||l.close()}}_a=new WeakMap,zr=new WeakMap,va=new WeakMap,Lr=new WeakMap,Ur=new WeakMap,Ys=new WeakMap,Ei=new WeakMap,Ai=new WeakMap,Xs=new WeakMap,Ci=new WeakMap,Hr=new WeakMap,Ri=new WeakMap,Mi=new WeakMap,Lt=new WeakSet,Hs=function(l){var i;Be(this,Hr)!==l&&(dt(this,Hr,l),(i=Be(this,va))==null||i.call(this))},Sh=async function(){if(Be(this,_a))return;if(!Be(this,Ci))try{dt(this,Ci,await s0(this.session.token))}catch(c){yn(this,Lt,Hs).call(this,c instanceof Error?c.message:String(c)),yn(this,Lt,jh).call(this);return}const l=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${l}://${location.host}/relay/client`);dt(this,_a,i),i.addEventListener("open",()=>{yn(this,Lt,wi).call(this,{t:"client.hello",protocol:n0,token:this.session.token})}),i.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}yn(this,Lt,Mx).call(this,o)}),i.addEventListener("close",()=>{var c;dt(this,_a,null),dt(this,Ai,!1),dt(this,Xs,!1),yn(this,Lt,Hs).call(this,"Нет связи с сервером"),(c=Be(this,va))==null||c.call(this),yn(this,Lt,jh).call(this)}),i.addEventListener("error",()=>i.close())},Mx=function(l){var i,c,o,d,h,p,m;switch(l.t){case"client.ok":dt(this,Ur,500),yn(this,Lt,wi).call(this,{t:"client.attach",hostId:Be(this,Ci)??"",...Be(this,Ri)>0?{sinceRseq:Be(this,Ri)}:{}});return;case"client.attached":dt(this,Ai,!0),dt(this,Xs,l.online),dt(this,Ri,l.rseq),yn(this,Lt,Hs).call(this,l.online?"Хост на связи":"Компьютер не на связи"),yn(this,Lt,wi).call(this,{t:"client.frame",body:{type:"hello",protocol:Ex,clientName:"ccv-web-relay"}});const x=Be(this,Mi);dt(this,Mi,[]);for(const y of x)yn(this,Lt,wi).call(this,{t:"client.frame",body:y});(i=Be(this,Lr))==null||i.call(this),(c=Be(this,va))==null||c.call(this);return;case"host.frame":{l.rseq>0&&dt(this,Ri,l.rseq);const y=l.body;for(const j of Be(this,zr))j(y);return}case"host.online":dt(this,Xs,!0),yn(this,Lt,Hs).call(this,"Хост на связи"),(o=Be(this,Lr))==null||o.call(this),(d=Be(this,va))==null||d.call(this);return;case"host.offline":dt(this,Xs,!1),yn(this,Lt,Hs).call(this,"Компьютер не на связи"),(h=Be(this,va))==null||h.call(this);return;case"ping":yn(this,Lt,wi).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){Rx(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Do),yn(this,Lt,Hs).call(this,"Этот компьютер отвязан от аккаунта"),dt(this,Ei,!0),(p=Be(this,_a))==null||p.close();return}l.code!=="offline"&&yn(this,Lt,Hs).call(this,l.message),(m=Be(this,va))==null||m.call(this);return}},wi=function(l){var i;((i=Be(this,_a))==null?void 0:i.readyState)===WebSocket.OPEN&&Be(this,_a).send(JSON.stringify(l))},jh=function(){if(Be(this,Ei)||Be(this,Ys)!==null)return;const l=Be(this,Ur);dt(this,Ur,Math.min(l*2,1e4)),dt(this,Ys,window.setTimeout(()=>{dt(this,Ys,null),yn(this,Lt,Sh).call(this)},l))};async function s0(a){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Do,l),l;const i=localStorage.getItem(Do);if(i)return i;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${a}`}});if(c.status===401)throw Rx(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Do,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function zo(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const i0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function r0(){if(zo()==="local")return new t0(i0);const a=l0();return a?new a0(a):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const pl={items:[],pending:[],lastSeq:0,contextTokens:null},ah={entries:[],total:0,loading:!1};function Ox(a){var l;return((l=a.entries[0])==null?void 0:l.seq)??1}function cb(a){return a.total>0&&Ox(a)>1}function c0(a,l){const i=new Set(a.entries.map(o=>o.seq));return{entries:[...a.entries,...l.entries.filter(o=>!i.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function u0(a){return Lo(pl,a).items.map(l=>({...l,id:`h:${l.id}`}))}function Lo(a,l){let i=a;for(const c of l)c.seq<=i.lastSeq||(i={...o0(i,c.event,c.seq),lastSeq:c.seq});return i}function o0(a,l,i){var o,d;const c=a.items;switch(l.kind){case"user.message":return ha(a,{id:`u${i}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return ha(a,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return _r(a,h,{...p,text:p.text+l.text})}case"assistant.text":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?ha(a,p):_r(a,h,p)}case"thinking.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return ha(a,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return _r(a,h,{...p,text:p.text+l.text})}case"assistant.thinking":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"thinking",text:l.text};return h===-1?ha(a,p):_r(a,h,p)}case"tool.use":return ha(a,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(m=>m.kind==="tool"&&m.toolUseId===l.toolUseId);if(h===-1)return a;const p=c[h];return _r(a,h,{...p,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...a,pending:[...a.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=a.pending.find(m=>m.requestId===l.requestId),p=a.pending.filter(m=>m.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const m=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(m!==-1){const x=c[m];return _r({...a,pending:p},m,{...x,answers:l.answers})}}return l.decision==="allow"?{...a,pending:p}:ha({...a,pending:p},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=a.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),p=l.contextTokens??a.contextTokens;return ha({...a,items:h,contextTokens:p},{id:`r${i}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?a:ha(a,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ha(a,{id:`e${i}`,kind:"notice",tone:"error",text:l.message});case"state":return a;case"rewound":return a;default:return a}}function f0(a,l){let i=0;for(let c=0;c<a.length;c++)if(a[c].event.kind==="user.message"){if(i===l)return a.slice(0,c);i++}return a}function d0(a,l,i){const c=l-i;if(c<=0)return[];let o=0;for(let d=0;d<a.length;d++)if(a[d].kind==="user"){if(o===c)return a.slice(0,d);o++}return a}function ha(a,l){return{...a,items:[...a.items,l]}}function _r(a,l,i){const c=a.items.slice();return c[l]=i,{...a,items:c}}const kh="ccv:theme",sh=["system","light","dark"];function h0(){const[a,l]=_.useState(p0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=a==="dark"||a==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[a]);const i=_.useCallback(o=>{try{localStorage.setItem(kh,o)}catch{}l(o)},[]),c=_.useCallback(()=>{l(o=>{const d=sh[(sh.indexOf(o)+1)%sh.length];try{localStorage.setItem(kh,d)}catch{}return d})},[]);return[a,i,c]}function p0(){try{const a=localStorage.getItem(kh);if(a==="light"||a==="dark"||a==="system")return a}catch{}return"system"}const Dx=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Oi={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:"вопроса"}},m0=320,zx="ccv:panes";function g0(a){return`--${a}-w`}function Lx(a,l){const i=Oi[a];return Math.round(Math.min(i.max,Math.max(i.min,l)))}function b0(){const a={};for(const l of Object.keys(Oi))a[l]=Oi[l].width;try{const l=localStorage.getItem(zx);if(l){const i=JSON.parse(l);for(const c of Object.keys(Oi)){const o=i[c];typeof o=="number"&&Number.isFinite(o)&&(a[c]=Lx(c,o))}}}catch{}return a}function x0(){const[a,l]=_.useState(b0),i=_.useCallback(h=>{try{localStorage.setItem(zx,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,p)=>{l(m=>{const x=Lx(h,p);if(m[h]===x)return m;const y={...m,[h]:x};return i(y),y})},[i]),o=_.useCallback(h=>{l(p=>{const m={...p,[h]:Oi[h].width};return i(m),m})},[i]),d={};for(const h of Object.keys(Oi))d[g0(h)]=`${a[h]}px`;return{widths:a,style:d,setWidth:c,reset:o}}const ih=260,Ux=120,y0=200,ub="ccv:terminal-h";function ob(a,l){return Math.round(Math.min(l,Math.max(Ux,a)))}function _0(){const[a,l]=_.useState(()=>{try{const d=localStorage.getItem(ub);if(d){const h=Number(d);if(Number.isFinite(h))return ob(h,1/0)}}catch{}return ih}),i=_.useCallback(d=>{try{localStorage.setItem(ub,String(d))}catch{}},[]),c=_.useCallback((d,h)=>{const p=ob(d,h);l(m=>m===p?m:(i(p),p))},[i]),o=_.useCallback(()=>{l(ih),i(ih)},[i]);return{height:a,setHeight:c,reset:o}}function Zo(a){const[l,i]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(a).matches);return _.useEffect(()=>{const c=window.matchMedia(a),o=()=>i(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[a]),l}const v0={height:0,offsetTop:0,offsetLeft:0};function fb(){if(typeof window>"u")return v0;const a=window.visualViewport;return a?{height:a.height,offsetTop:a.offsetTop,offsetLeft:a.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function S0(a){const[l,i]=_.useState(fb);return _.useEffect(()=>{if(!a)return;const c=window.visualViewport,o=()=>{const d=fb();i(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[a]),l}function Uh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ui=Uh();function Hx(a){Ui=a}var Ti={exec:()=>null};function vr(a){let l=[];return i=>{let c=Math.max(0,Math.min(3,i-1)),o=l[c];return o||(o=a(c),l[c]=o),o}}function nt(a,l=""){let i=typeof a=="string"?a:a.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(Zn.caret,"$1"),i=i.replace(o,h),c},getRegex:()=>new RegExp(i,l)};return c}var j0=((a="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+a)}catch{return!1}})(),Zn={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:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:vr(a=>new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:vr(a=>new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:vr(a=>new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),headingBeginRegex:vr(a=>new RegExp(`^ {0,${a}}#`)),htmlBeginRegex:vr(a=>new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:vr(a=>new RegExp(`^ {0,${a}}>`))},k0=/^(?:[ \t]*(?:\n|$))+/,N0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,w0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,T0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Bx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qx=nt(Bx).replace(/bull/g,Hh).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(),E0=nt(Bx).replace(/bull/g,Hh).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(),Bh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,A0=/^[^\n]+/,qh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,C0=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),R0=nt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Hh).getRegex(),Ko="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",Ih=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,M0=nt("^ {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",Ih).replace("tag",Ko).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ix=a=>nt(Bh).replace("hr",Wc).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",a).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),O0=Ix(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),D0=Ix(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),z0=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",D0).getRegex(),Gh={blockquote:z0,code:N0,def:C0,fences:w0,heading:T0,hr:Wc,html:M0,lheading:qx,list:R0,newline:k0,paragraph:O0,table:Ti,text:A0},db=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Wc).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",Ko).getRegex(),L0={...Gh,lheading:E0,table:db,paragraph:nt(Bh).replace("hr",Wc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",db).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",Ko).getRegex()},U0={...Gh,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ih).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:Ti,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(Bh).replace("hr",Wc).replace("heading",` *#{1,6} *[^
51
- ]`).replace("lheading",qx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,B0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gx=/^( {2,}|\\)\n(?!\s*$)/,q0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qr=/[\p{P}\p{S}]/u,Jo=/[\s\p{P}\p{S}]/u,Yh=/[^\s\p{P}\p{S}]/u,I0=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Jo).getRegex(),Yx=/(?!~)[\p{P}\p{S}]/u,G0=/(?!~)[\s\p{P}\p{S}]/u,Y0=/(?:[^\s\p{P}\p{S}]|~)/u,X0=nt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",j0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Xx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,V0=nt(Xx,"u").replace(/punct/g,qr).getRegex(),$0=nt(Xx,"u").replace(/punct/g,Yx).getRegex(),Vx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Q0=nt(Vx,"gu").replace(/notPunctSpace/g,Yh).replace(/punctSpace/g,Jo).replace(/punct/g,qr).getRegex(),Z0=nt(Vx,"gu").replace(/notPunctSpace/g,Y0).replace(/punctSpace/g,G0).replace(/punct/g,Yx).getRegex(),K0=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yh).replace(/punctSpace/g,Jo).replace(/punct/g,qr).getRegex(),J0=nt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,qr).getRegex(),F0="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",W0=nt(F0,"gu").replace(/notPunctSpace/g,Yh).replace(/punctSpace/g,Jo).replace(/punct/g,qr).getRegex(),P0=nt(/\\(punct)/,"gu").replace(/punct/g,qr).getRegex(),ev=nt(/^<(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(),tv=nt(Ih).replace("(?:-->|$)","-->").getRegex(),nv=nt("^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",tv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,lv=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Bo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$x=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",Bo).replace("ref",qh).getRegex(),Qx=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",qh).getRegex(),av=nt("reflink|nolink(?!\\()","g").replace("reflink",$x).replace("nolink",Qx).getRegex(),hb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xh={_backpedal:Ti,anyPunctuation:P0,autolink:ev,blockSkip:X0,br:Gx,code:B0,del:Ti,delLDelim:Ti,delRDelim:Ti,emStrongLDelim:V0,emStrongRDelimAst:Q0,emStrongRDelimUnd:K0,escape:H0,link:lv,nolink:Qx,punctuation:I0,reflink:$x,reflinkSearch:av,tag:nv,text:q0,url:Ti},sv={...Xh,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Bo).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bo).getRegex()},Nh={...Xh,emStrongRDelimAst:Z0,emStrongLDelim:$0,delLDelim:J0,delRDelim:W0,url:nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",hb).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:nt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",hb).getRegex()},iv={...Nh,br:nt(Gx).replace("{2,}","*").getRegex(),text:nt(Nh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vo={normal:Gh,gfm:L0,pedantic:U0},Lc={normal:Xh,gfm:Nh,breaks:iv,pedantic:sv},rv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pb=a=>rv[a];function ba(a,l){if(l){if(Zn.escapeTest.test(a))return a.replace(Zn.escapeReplace,pb)}else if(Zn.escapeTestNoEncode.test(a))return a.replace(Zn.escapeReplaceNoEncode,pb);return a}function mb(a){try{a=encodeURI(a).replace(Zn.percentDecode,"%")}catch{return null}return a}function gb(a,l){var d;let i=a.replace(Zn.findPipe,(h,p,m)=>{let x=!1,y=p;for(;--y>=0&&m[y]==="\\";)x=!x;return x?"|":" |"}),c=i.split(Zn.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(Zn.slashPipe,"|");return c}function Ls(a,l,i){let c=a.length;if(c===0)return"";let o=0;for(;o<c&&a.charAt(c-o-1)===l;)o++;return a.slice(0,c-o)}function bb(a){let l=a.split(`
52
- `),i=l.length-1;for(;i>=0&&Zn.blankLine.test(l[i]);)i--;return l.length-i<=2?a:l.slice(0,i+1).join(`
53
- `)}function cv(a,l){if(a.indexOf(l[1])===-1)return-1;let i=0;for(let c=0;c<a.length;c++)if(a[c]==="\\")c++;else if(a[c]===l[0])i++;else if(a[c]===l[1]&&(i--,i<0))return c;return i>0?-2:-1}function uv(a,l=0){let i=l,c="";for(let o of a)if(o===" "){let d=4-i%4;c+=" ".repeat(d),i+=d}else c+=o,i++;return c}function xb(a,l,i,c,o){let d=l.href,h=l.title||null,p=a[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let m={type:a[0].charAt(0)==="!"?"image":"link",raw:i,href:d,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,m}function ov(a,l,i){let c=a.match(i.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
54
- `).map(d=>{let h=d.match(i.other.beginningSpace);if(h===null)return d;let[p]=h;return p.length>=o.length?d.slice(o.length):d}).join(`
55
- `)}var qo=class{constructor(a){kt(this,"options");kt(this,"rules");kt(this,"lexer");this.options=a||Ui}space(a){let l=this.rules.block.newline.exec(a);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(a){let l=this.rules.block.code.exec(a);if(l){let i=this.options.pedantic?l[0]:bb(l[0]),c=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:c}}}fences(a){let l=this.rules.block.fences.exec(a);if(l){let i=l[0],c=ov(i,l[3]||"",this.rules);return{type:"code",raw:i,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(a){let l=this.rules.block.heading.exec(a);if(l){let i=l[2].trim();if(this.rules.other.endingHash.test(i)){let c=Ls(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:Ls(l[0],`
56
- `),depth:l[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(a){let l=this.rules.block.hr.exec(a);if(l)return{type:"hr",raw:Ls(l[0],`
57
- `)}}blockquote(a){let l=this.rules.block.blockquote.exec(a);if(l){let i=Ls(l[0],`
58
- `).split(`
59
- `),c="",o="",d=[];for(;i.length>0;){let h=!1,p=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))p.push(i[m]),h=!0;else if(!h)p.push(i[m]);else break;i=i.slice(m);let x=p.join(`
60
- `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
61
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
62
- ${x}`:x,o=o?`${o}
63
- ${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,d,!0),this.lexer.state.top=j,i.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let C=v,k=C.raw+`
64
- `+i.join(`
65
- `),L=this.blockquote(k);d[d.length-1]=L,c=c.substring(0,c.length-C.raw.length)+L.raw,o=o.substring(0,o.length-C.text.length)+L.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,k=C.raw+`
66
- `+i.join(`
67
- `),L=this.list(k);d[d.length-1]=L,c=c.substring(0,c.length-v.raw.length)+L.raw,o=o.substring(0,o.length-C.raw.length)+L.raw,i=k.substring(d.at(-1).raw.length).split(`
68
- `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(a){let l=this.rules.block.list.exec(a);if(l){let i=l[1].trim(),c=i.length>1,o={type:"list",raw:"",ordered:c,start:c?+i.slice(0,-1):"",loose:!1,items:[]};i=c?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=c?i:"[*+-]");let d=this.rules.other.listItemRegex(i),h=!1;for(;a;){let m=!1,x="",y="";if(!(l=d.exec(a))||this.rules.block.hr.test(a))break;x=l[0],a=a.substring(x.length);let j=uv(l[2].split(`
69
- `,1)[0],l[1].length),v=a.split(`
70
- `,1)[0],C=!j.trim(),k=0;if(this.options.pedantic?(k=2,y=j.trimStart()):C?k=l[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,y=j.slice(k),k+=l[1].length),C&&this.rules.other.blankLine.test(v)&&(x+=v+`
71
- `,a=a.substring(v.length+1),m=!0),!m){let L=this.rules.other.nextBulletRegex(k),U=this.rules.other.hrRegex(k),P=this.rules.other.fencesBeginRegex(k),M=this.rules.other.headingBeginRegex(k),Q=this.rules.other.htmlBeginRegex(k),w=this.rules.other.blockquoteBeginRegex(k);for(;a;){let K=a.split(`
72
- `,1)[0],z;if(v=K,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),z=v):z=v.replace(this.rules.other.tabCharGlobal," "),P.test(v)||M.test(v)||Q.test(v)||w.test(v)||L.test(v)||U.test(v))break;if(z.search(this.rules.other.nonSpaceChar)>=k||!v.trim())y+=`
73
- `+z.slice(k);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||P.test(j)||M.test(j)||U.test(j))break;y+=`
74
- `+v}C=!v.trim(),x+=K+`
75
- `,a=a.substring(K.length+1),j=z.slice(k)}}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 p=o.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let m of o.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let x=m.tokens[0];if(m.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let y=this.rules.other.listTaskCheckbox.exec(m.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};m.checked=j.checked,o.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=j.raw+m.tokens[0].raw,m.tokens[0].text=j.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(j)):m.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):m.tokens.unshift(j)}}else m.task&&(m.task=!1);if(!o.loose){let y=m.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 m of o.items){m.loose=!0;for(let x of m.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(a){let l=this.rules.block.html.exec(a);if(l){let i=bb(l[0]);return{type:"html",block:!0,raw:i,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:i}}}def(a){let l=this.rules.block.def.exec(a);if(l){let i=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:i,raw:Ls(l[0],`
76
- `),href:c,title:o}}}table(a){var h;let l=this.rules.block.table.exec(a);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let i=gb(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
77
- `):[],d={type:"table",raw:Ls(l[0],`
78
- `),header:[],align:[],rows:[]};if(i.length===c.length){for(let p of c)this.rules.other.tableAlignRight.test(p)?d.align.push("right"):this.rules.other.tableAlignCenter.test(p)?d.align.push("center"):this.rules.other.tableAlignLeft.test(p)?d.align.push("left"):d.align.push(null);for(let p=0;p<i.length;p++)d.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:d.align[p]});for(let p of o)d.rows.push(gb(p,d.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:d.align[x]})));return d}}lheading(a){let l=this.rules.block.lheading.exec(a);if(l){let i=l[1].trim();return{type:"heading",raw:Ls(l[0],`
79
- `),depth:l[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(a){let l=this.rules.block.paragraph.exec(a);if(l){let i=l[1].charAt(l[1].length-1)===`
80
- `?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:i,tokens:this.lexer.inline(i)}}}text(a){let l=this.rules.block.text.exec(a);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(a){let l=this.rules.inline.escape.exec(a);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(a){let l=this.rules.inline.tag.exec(a);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(a){let l=this.rules.inline.link.exec(a);if(l){let i=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let d=Ls(i.slice(0,-1),"\\");if((i.length-d.length)%2===0)return}else{let d=cv(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?c=c.slice(1):c=c.slice(1,-1)),xb(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(a,l){let i;if((i=this.rules.inline.reflink.exec(a))||(i=this.rules.inline.nolink.exec(a))){let c=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=i[0].charAt(0);return{type:"text",raw:d,text:d}}return xb(i,o,i[0],this.lexer,this.rules)}}emStrong(a,l,i=""){let c=this.rules.inline.emStrongLDelim.exec(a);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,p=o,m=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*a.length+o);(c=x.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){p+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){m+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p+m);let y=[...c[0]][0].length,j=a.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let C=j.slice(1,-1);return{type:"em",raw:j,text:C,tokens:this.lexer.inlineTokens(C)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(a){let l=this.rules.inline.code.exec(a);if(l){let i=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return c&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:l[0],text:i}}}br(a){let l=this.rules.inline.br.exec(a);if(l)return{type:"br",raw:l[0]}}del(a,l,i=""){let c=this.rules.inline.delLDelim.exec(a);if(c&&(!c[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,p=o,m=this.rules.inline.delRDelim;for(m.lastIndex=0,l=l.slice(-1*a.length+o);(c=m.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){p+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p);let x=[...c[0]][0].length,y=a.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(a){let l=this.rules.inline.autolink.exec(a);if(l){let i,c;return l[2]==="@"?(i=l[1],c="mailto:"+i):(i=l[1],c=i),{type:"link",raw:l[0],text:i,href:c,tokens:[{type:"text",raw:i,text:i}]}}}url(a){var i;let l;if(l=this.rules.inline.url.exec(a)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((i=this.rules.inline._backpedal.exec(l[0]))==null?void 0:i[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(a){let l=this.rules.inline.text.exec(a);if(l){let i=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:i}}}},$l=class wh{constructor(l){kt(this,"tokens");kt(this,"options");kt(this,"state");kt(this,"inlineQueue");kt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Ui,this.options.tokenizer=this.options.tokenizer||new qo,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 i={other:Zn,block:vo.normal,inline:Lc.normal};this.options.pedantic?(i.block=vo.pedantic,i.inline=Lc.pedantic):this.options.gfm&&(i.block=vo.gfm,this.options.breaks?i.inline=Lc.breaks:i.inline=Lc.gfm),this.tokenizer.rules=i}static get rules(){return{block:vo,inline:Lc}}static lex(l,i){return new wh(i).lex(l)}static lexInline(l,i){return new wh(i).inlineTokens(l)}lex(l){l=l.replace(Zn.carriageReturn,`
81
- `),this.blockTokens(l,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let c=this.inlineQueue[i];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,i=[],c=!1){var d,h,p;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(Zn.tabCharGlobal," ").replace(Zn.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let m;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(m=y.call({lexer:this},l,i))?(l=l.substring(m.raw.length),i.push(m),!0):!1))continue;if(m=this.tokenizer.space(l)){l=l.substring(m.raw.length);let y=i.at(-1);m.raw.length===1&&y!==void 0?y.raw+=`
82
- `:i.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
83
- `)?"":`
84
- `)+m.raw,y.text+=`
85
- `+m.text,this.inlineQueue.at(-1).src=y.text):i.push(m);continue}if(m=this.tokenizer.fences(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.heading(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.hr(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.blockquote(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.list(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.html(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.def(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
86
- `)?"":`
87
- `)+m.raw,y.text+=`
88
- `+m.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title},i.push(m));continue}if(m=this.tokenizer.table(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.lheading(l)){l=l.substring(m.raw.length),i.push(m);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(C=>{v=C.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=l.substring(0,y+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){let y=i.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
89
- `)?"":`
90
- `)+m.raw,y.text+=`
91
- `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(m),c=x.length!==l.length,l=l.substring(m.raw.length);continue}if(m=this.tokenizer.text(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
92
- `)?"":`
93
- `)+m.raw,y.text+=`
94
- `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(m);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,i}inline(l,i=[]){return this.inlineQueue.push({src:l,tokens:i}),i}inlineTokens(l,i=[]){var p,m,x,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,C=>v.includes(C.slice(C.lastIndexOf("[")+1,-1))?"["+"a".repeat(C.length-2)+"]":C))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,C,k)=>{let L=k?k.length:0;return v.slice(0,L)+"["+"a".repeat(v.length-L-2)+"]"}),c=((m=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:m.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(k=>(v=k.call({lexer:this},l,i))?(l=l.substring(v.raw.length),i.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let k=i.at(-1);v.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):i.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),i.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),i.push(v);continue}let C=l;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,L=l.slice(1),U;this.options.extensions.startInline.forEach(P=>{U=P.call({lexer:this},L),typeof U=="number"&&U>=0&&(k=Math.min(k,U))}),k<1/0&&k>=0&&(C=l.substring(0,k+1))}if(v=this.tokenizer.inlineText(C)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let k=i.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):i.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return i}infiniteLoopError(l){let i="Infinite loop on byte: "+l;if(this.options.silent)console.error(i);else throw new Error(i)}},Io=class{constructor(a){kt(this,"options");kt(this,"parser");this.options=a||Ui}space(a){return""}code({text:a,lang:l,escaped:i}){var d;let c=(d=(l||"").match(Zn.notSpaceStart))==null?void 0:d[0],o=a.replace(Zn.endingNewline,"")+`
95
- `;return c?'<pre><code class="language-'+ba(c)+'">'+(i?o:ba(o,!0))+`</code></pre>
96
- `:"<pre><code>"+(i?o:ba(o,!0))+`</code></pre>
97
- `}blockquote({tokens:a}){return`<blockquote>
98
- ${this.parser.parse(a)}</blockquote>
99
- `}html({text:a}){return a}def(a){return""}heading({tokens:a,depth:l}){return`<h${l}>${this.parser.parseInline(a)}</h${l}>
100
- `}hr(a){return`<hr>
101
- `}list(a){let l=a.ordered,i=a.start,c="";for(let h=0;h<a.items.length;h++){let p=a.items[h];c+=this.listitem(p)}let o=l?"ol":"ul",d=l&&i!==1?' start="'+i+'"':"";return"<"+o+d+`>
102
- `+c+"</"+o+`>
103
- `}listitem(a){return`<li>${this.parser.parse(a.tokens)}</li>
104
- `}checkbox({checked:a}){return"<input "+(a?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:a}){return`<p>${this.parser.parseInline(a)}</p>
105
- `}table(a){let l="",i="";for(let o=0;o<a.header.length;o++)i+=this.tablecell(a.header[o]);l+=this.tablerow({text:i});let c="";for(let o=0;o<a.rows.length;o++){let d=a.rows[o];i="";for(let h=0;h<d.length;h++)i+=this.tablecell(d[h]);c+=this.tablerow({text:i})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
106
- <thead>
107
- `+l+`</thead>
108
- `+c+`</table>
109
- `}tablerow({text:a}){return`<tr>
110
- ${a}</tr>
111
- `}tablecell(a){let l=this.parser.parseInline(a.tokens),i=a.header?"th":"td";return(a.align?`<${i} align="${a.align}">`:`<${i}>`)+l+`</${i}>
112
- `}strong({tokens:a}){return`<strong>${this.parser.parseInline(a)}</strong>`}em({tokens:a}){return`<em>${this.parser.parseInline(a)}</em>`}codespan({text:a}){return`<code>${ba(a,!0)}</code>`}br(a){return"<br>"}del({tokens:a}){return`<del>${this.parser.parseInline(a)}</del>`}link({href:a,title:l,tokens:i}){let c=this.parser.parseInline(i),o=mb(a);if(o===null)return c;a=o;let d='<a href="'+a+'"';return l&&(d+=' title="'+ba(l)+'"'),d+=">"+c+"</a>",d}image({href:a,title:l,text:i,tokens:c}){c&&(i=this.parser.parseInline(c,this.parser.textRenderer));let o=mb(a);if(o===null)return ba(i);a=o;let d=`<img src="${a}" alt="${ba(i)}"`;return l&&(d+=` title="${ba(l)}"`),d+=">",d}text(a){return"tokens"in a&&a.tokens?this.parser.parseInline(a.tokens):"escaped"in a&&a.escaped?a.text:ba(a.text)}},Vh=class{strong({text:a}){return a}em({text:a}){return a}codespan({text:a}){return a}del({text:a}){return a}html({text:a}){return a}text({text:a}){return a}link({text:a}){return""+a}image({text:a}){return""+a}br(){return""}checkbox({raw:a}){return a}},Ql=class Th{constructor(l){kt(this,"options");kt(this,"renderer");kt(this,"textRenderer");this.options=l||Ui,this.options.renderer=this.options.renderer||new Io,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vh}static parse(l,i){return new Th(i).parse(l)}static parseInline(l,i){return new Th(i).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let i="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let m=h,x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(m.type)){i+=x||"";continue}}let p=h;switch(p.type){case"space":{i+=this.renderer.space(p);break}case"hr":{i+=this.renderer.hr(p);break}case"heading":{i+=this.renderer.heading(p);break}case"code":{i+=this.renderer.code(p);break}case"table":{i+=this.renderer.table(p);break}case"blockquote":{i+=this.renderer.blockquote(p);break}case"list":{i+=this.renderer.list(p);break}case"checkbox":{i+=this.renderer.checkbox(p);break}case"html":{i+=this.renderer.html(p);break}case"def":{i+=this.renderer.def(p);break}case"paragraph":{i+=this.renderer.paragraph(p);break}case"text":{i+=this.renderer.text(p);break}default:{let m='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}parseInline(l,i=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let p=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[p.type]){let x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){c+=x||"";continue}}let m=p;switch(m.type){case"escape":{c+=i.text(m);break}case"html":{c+=i.html(m);break}case"link":{c+=i.link(m);break}case"image":{c+=i.image(m);break}case"checkbox":{c+=i.checkbox(m);break}case"strong":{c+=i.strong(m);break}case"em":{c+=i.em(m);break}case"codespan":{c+=i.codespan(m);break}case"br":{c+=i.br(m);break}case"del":{c+=i.del(m);break}case"text":{c+=i.text(m);break}default:{let x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Oo,Gc=(Oo=class{constructor(a){kt(this,"options");kt(this,"block");this.options=a||Ui}preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}emStrongMask(a){return a}provideLexer(a=this.block){return a?$l.lex:$l.lexInline}provideParser(a=this.block){return a?Ql.parse:Ql.parseInline}},kt(Oo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),kt(Oo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Oo),fv=class{constructor(...a){kt(this,"defaults",Uh());kt(this,"options",this.setOptions);kt(this,"parse",this.parseMarkdown(!0));kt(this,"parseInline",this.parseMarkdown(!1));kt(this,"Parser",Ql);kt(this,"Renderer",Io);kt(this,"TextRenderer",Vh);kt(this,"Lexer",$l);kt(this,"Tokenizer",qo);kt(this,"Hooks",Gc);this.use(...a)}walkTokens(a,l){var c,o;let i=[];for(let d of a)switch(i=i.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let p of h.header)i=i.concat(this.walkTokens(p.tokens,l));for(let p of h.rows)for(let m of p)i=i.concat(this.walkTokens(m.tokens,l));break}case"list":{let h=d;i=i.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(p=>{let m=h[p].flat(1/0);i=i.concat(this.walkTokens(m,l))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,l)))}}return i}use(...a){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(i=>{let c={...i};if(c.async=this.defaults.async||c.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let p=o.renderer.apply(this,h);return p===!1&&(p=d.apply(this,h)),p}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),i.renderer){let o=this.defaults.renderer||new Io(this.defaults);for(let d in i.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,p=i.renderer[h],m=o[h];o[h]=(...x)=>{let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new qo(this.defaults);for(let d in i.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,p=i.tokenizer[h],m=o[h];o[h]=(...x)=>{let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new Gc;for(let d in i.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,p=i.hooks[h],m=o[h];Gc.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Gc.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await p.call(o,x);return m.call(o,j)})();let y=p.call(o,x);return m.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await p.apply(o,x);return j===!1&&(j=await m.apply(o,x)),j})();let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,d=i.walkTokens;c.walkTokens=function(h){let p=[];return p.push(d.call(this,h)),o&&(p=p.concat(o.call(this,h))),p}}this.defaults={...this.defaults,...c}}),this}setOptions(a){return this.defaults={...this.defaults,...a},this}lexer(a,l){return $l.lex(a,l??this.defaults)}parser(a,l){return Ql.parse(a,l??this.defaults)}parseMarkdown(a){return(l,i)=>{let c={...i},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=a),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,p=await(o.hooks?await o.hooks.provideLexer(a):a?$l.lex:$l.lexInline)(h,o),m=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(m,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(a):a?Ql.parse:Ql.parseInline)(m,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(a):a?$l.lex:$l.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let p=(o.hooks?o.hooks.provideParser(a):a?Ql.parse:Ql.parseInline)(h,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(h){return d(h)}}}onError(a,l){return i=>{if(i.message+=`
113
- Please report this to https://github.com/markedjs/marked.`,a){let c="<p>An error occurred:</p><pre>"+ba(i.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(i);throw i}}},Li=new fv;function gt(a,l){return Li.parse(a,l)}gt.options=gt.setOptions=function(a){return Li.setOptions(a),gt.defaults=Li.defaults,Hx(gt.defaults),gt};gt.getDefaults=Uh;gt.defaults=Ui;gt.use=function(...a){return Li.use(...a),gt.defaults=Li.defaults,Hx(gt.defaults),gt};gt.walkTokens=function(a,l){return Li.walkTokens(a,l)};gt.parseInline=Li.parseInline;gt.Parser=Ql;gt.parser=Ql.parse;gt.Renderer=Io;gt.TextRenderer=Vh;gt.Lexer=$l;gt.lexer=$l.lex;gt.Tokenizer=qo;gt.Hooks=Gc;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;Ql.parse;$l.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function yb(a,l){(l==null||l>a.length)&&(l=a.length);for(var i=0,c=Array(l);i<l;i++)c[i]=a[i];return c}function dv(a){if(Array.isArray(a))return a}function hv(a,l){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var c,o,d,h,p=[],m=!0,x=!1;try{if(d=(i=i.call(a)).next,l!==0)for(;!(m=(c=d.call(i)).done)&&(p.push(c.value),p.length!==l);m=!0);}catch(y){x=!0,o=y}finally{try{if(!m&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function pv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
114
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mv(a,l){return dv(a)||hv(a,l)||gv(a,l)||pv()}function gv(a,l){if(a){if(typeof a=="string")return yb(a,l);var i={}.toString.call(a).slice(8,-1);return i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set"?Array.from(a):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?yb(a,l):void 0}}const Zx=Object.entries,_b=Object.setPrototypeOf,bv=Object.isFrozen,xv=Object.getPrototypeOf,yv=Object.getOwnPropertyDescriptor;let Bn=Object.freeze,qn=Object.seal,Nr=Object.create,Kx=typeof Reflect<"u"&&Reflect,Eh=Kx.apply,Ah=Kx.construct;Bn||(Bn=function(l){return l});qn||(qn=function(l){return l});Eh||(Eh=function(l,i){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(i,o)});Ah||(Ah=function(l){for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return new l(...c)});const Sr=_n(Array.prototype.forEach),_v=_n(Array.prototype.lastIndexOf),vb=_n(Array.prototype.pop),jr=_n(Array.prototype.push),vv=_n(Array.prototype.splice),Gs=Array.isArray,Yc=_n(String.prototype.toLowerCase),rh=_n(String.prototype.toString),Sb=_n(String.prototype.match),Uc=_n(String.prototype.replace),jb=_n(String.prototype.indexOf),Sv=_n(String.prototype.trim),jv=_n(Number.prototype.toString),kv=_n(Boolean.prototype.toString),kb=typeof BigInt>"u"?null:_n(BigInt.prototype.toString),Nb=typeof Symbol>"u"?null:_n(Symbol.prototype.toString),Mn=_n(Object.prototype.hasOwnProperty),Hc=_n(Object.prototype.toString),Rn=_n(RegExp.prototype.test),ji=Nv(TypeError);function _n(a){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return Eh(a,l,c)}}function Nv(a){return function(){for(var l=arguments.length,i=new Array(l),c=0;c<l;c++)i[c]=arguments[c];return Ah(a,i)}}function tt(a,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yc;if(_b&&_b(a,null),!Gs(l))return a;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=i(o);d!==o&&(bv(l)||(l[c]=d),o=d)}a[o]=!0}return a}function wv(a){for(let l=0;l<a.length;l++)Mn(a,l)||(a[l]=null);return a}function il(a){const l=Nr(null);for(const c of Zx(a)){var i=mv(c,2);const o=i[0],d=i[1];Mn(a,o)&&(Gs(d)?l[o]=wv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=il(d):l[o]=d)}return l}function Tv(a){switch(typeof a){case"string":return a;case"number":return jv(a);case"boolean":return kv(a);case"bigint":return kb?kb(a):"0";case"symbol":return Nb?Nb(a):"Symbol()";case"undefined":return Hc(a);case"function":case"object":{if(a===null)return Hc(a);const l=a,i=xa(l,"toString");if(typeof i=="function"){const c=i(l);return typeof c=="string"?c:Hc(c)}return Hc(a)}default:return Hc(a)}}function xa(a,l){for(;a!==null;){const c=yv(a,l);if(c){if(c.get)return _n(c.get);if(typeof c.value=="function")return _n(c.value)}a=xv(a)}function i(){return null}return i}function Ev(a){try{return Rn(a,""),!0}catch{return!1}}const wb=Bn(["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"]),ch=Bn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uh=Bn(["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"]),Av=Bn(["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"]),oh=Bn(["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"]),Cv=Bn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Tb=Bn(["#text"]),Eb=Bn(["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"]),fh=Bn(["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"]),Ab=Bn(["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"]),So=Bn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Rv=qn(/{{[\w\W]*|^[\w\W]*}}/g),Mv=qn(/<%[\w\W]*|^[\w\W]*%>/g),Ov=qn(/\${[\w\W]*/g),Dv=qn(/^data-[\-\w.\u00B7-\uFFFF]+$/),zv=qn(/^aria-[\-\w]+$/),Cb=qn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Lv=qn(/^(?:\w+script|data):/i),Uv=qn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hv=qn(/^html$/i),Bv=qn(/^[a-z][.\w]*(-[.\w]+)+$/i),Rb=qn(/<[/\w!]/g),Mb=qn(/<[/\w]/g),qv=qn(/<\/no(script|embed|frames)/i),Iv=qn(/\/>/i),Tl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gv=function(){return typeof window>"u"?null:window},Yv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(c=i.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Ob=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Us=function(l,i,c,o){return Mn(l,i)&&Gs(l[i])?tt(o.base?il(o.base):{},l[i],o.transform):c};function Jx(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gv();const l=fe=>Jx(fe);if(l.version="3.4.12",l.removed=[],!a||!a.document||a.document.nodeType!==Tl.document||!a.Element)return l.isSupported=!1,l;let i=a.document;const c=i,o=c.currentScript;a.DocumentFragment;const d=a.HTMLTemplateElement,h=a.Node,p=a.Element,m=a.NodeFilter,x=a.NamedNodeMap;x===void 0&&(a.NamedNodeMap||a.MozNamedAttrMap),a.HTMLFormElement;const y=a.DOMParser,j=a.trustedTypes,v=p.prototype,C=xa(v,"cloneNode"),k=xa(v,"remove"),L=xa(v,"nextSibling"),U=xa(v,"childNodes"),P=xa(v,"parentNode"),M=xa(v,"shadowRoot"),Q=xa(v,"attributes"),w=h&&h.prototype?xa(h.prototype,"nodeType"):null,K=h&&h.prototype?xa(h.prototype,"nodeName"):null;if(typeof d=="function"){const fe=i.createElement("template");fe.content&&fe.content.ownerDocument&&(i=fe.content.ownerDocument)}let z,A="",V,te=!1,oe=0;const F=function(){if(oe>0)throw ji('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.')},ae=function(T){F(),oe++;try{return z.createHTML(T)}finally{oe--}},me=function(T){F(),oe++;try{return z.createScriptURL(T)}finally{oe--}},Ae=function(){return te||(V=Yv(j,o),te=!0),V},be=i,H=be.implementation,re=be.createNodeIterator,se=be.createDocumentFragment,pe=be.getElementsByTagName,Ne=c.importNode;let N=Ob();l.isSupported=typeof Zx=="function"&&typeof P=="function"&&H&&H.createHTMLDocument!==void 0;const $=Rv,ce=Mv,he=Ov,we=Dv,ye=zv,Me=Lv,at=Uv,Ve=Bv;let Mt=Cb,Ie=null;const bt=tt({},[...wb,...ch,...uh,...oh,...Tb]);let We=null;const Ze=tt({},[...Eb,...fh,...Ab,...So]);let Ke=Object.seal(Nr(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}})),st=null,Jn=null;const Ht=Object.seal(Nr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Bt=!0,Qt=!0,qt=!1,It=!0,Xt=!1,it=!0,Nt=!1,Pt=!1,wn=null,At=null,vn=!1,Tn=!1,Ot=!1,cn=!1,Zt=!0,wt=!1;const un="user-content-";let ut=!0,en=!1,E={},Y=null;const _e=tt({},["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 O=null;const J=tt({},["audio","video","img","source","image","track"]);let xe=null;const qe=tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tt="http://www.w3.org/1998/Math/MathML",Sn="http://www.w3.org/2000/svg",jn="http://www.w3.org/1999/xhtml";let Ct=jn,Al=!1,ka=null;const Na=tt({},[Tt,Sn,jn],rh),$s=Bn(["mi","mo","mn","ms","mtext"]);let Ul=tt({},$s);const Kl=Bn(["annotation-xml"]);let on=tt({},Kl);const wa=tt({},["title","style","font","a","script"]);let gl=null;const rl=["application/xhtml+xml","text/html"],Kt="text/html";let Qe=null,Fn=null;const Qs=i.createElement("form"),Bi=function(T){return T instanceof RegExp||T instanceof Function},Zs=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fn&&Fn===T)return;(!T||typeof T!="object")&&(T={}),T=il(T),gl=rl.indexOf(T.PARSER_MEDIA_TYPE)===-1?Kt:T.PARSER_MEDIA_TYPE,Qe=gl==="application/xhtml+xml"?rh:Yc,Ie=Us(T,"ALLOWED_TAGS",bt,{transform:Qe}),We=Us(T,"ALLOWED_ATTR",Ze,{transform:Qe}),ka=Us(T,"ALLOWED_NAMESPACES",Na,{transform:rh}),xe=Us(T,"ADD_URI_SAFE_ATTR",qe,{transform:Qe,base:qe}),O=Us(T,"ADD_DATA_URI_TAGS",J,{transform:Qe,base:J}),Y=Us(T,"FORBID_CONTENTS",_e,{transform:Qe}),st=Us(T,"FORBID_TAGS",il({}),{transform:Qe}),Jn=Us(T,"FORBID_ATTR",il({}),{transform:Qe}),E=Mn(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?il(T.USE_PROFILES):T.USE_PROFILES:!1,Bt=T.ALLOW_ARIA_ATTR!==!1,Qt=T.ALLOW_DATA_ATTR!==!1,qt=T.ALLOW_UNKNOWN_PROTOCOLS||!1,It=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xt=T.SAFE_FOR_TEMPLATES||!1,it=T.SAFE_FOR_XML!==!1,Nt=T.WHOLE_DOCUMENT||!1,Tn=T.RETURN_DOM||!1,Ot=T.RETURN_DOM_FRAGMENT||!1,cn=T.RETURN_TRUSTED_TYPE||!1,vn=T.FORCE_BODY||!1,Zt=T.SANITIZE_DOM!==!1,wt=T.SANITIZE_NAMED_PROPS||!1,ut=T.KEEP_CONTENT!==!1,en=T.IN_PLACE||!1,Mt=Ev(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:Cb,Ct=typeof T.NAMESPACE=="string"?T.NAMESPACE:jn,Ul=Mn(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?il(T.MATHML_TEXT_INTEGRATION_POINTS):tt({},$s),on=Mn(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?il(T.HTML_INTEGRATION_POINTS):tt({},Kl);const I=Mn(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?il(T.CUSTOM_ELEMENT_HANDLING):Nr(null);if(Ke=Nr(null),Mn(I,"tagNameCheck")&&Bi(I.tagNameCheck)&&(Ke.tagNameCheck=I.tagNameCheck),Mn(I,"attributeNameCheck")&&Bi(I.attributeNameCheck)&&(Ke.attributeNameCheck=I.attributeNameCheck),Mn(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),qn(Ke),Xt&&(Qt=!1),Ot&&(Tn=!0),E&&(Ie=tt({},Tb),We=Nr(null),E.html===!0&&(tt(Ie,wb),tt(We,Eb)),E.svg===!0&&(tt(Ie,ch),tt(We,fh),tt(We,So)),E.svgFilters===!0&&(tt(Ie,uh),tt(We,fh),tt(We,So)),E.mathMl===!0&&(tt(Ie,oh),tt(We,Ab),tt(We,So))),Ht.tagCheck=null,Ht.attributeCheck=null,Mn(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?Ht.tagCheck=T.ADD_TAGS:Gs(T.ADD_TAGS)&&(Ie===bt&&(Ie=il(Ie)),tt(Ie,T.ADD_TAGS,Qe))),Mn(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?Ht.attributeCheck=T.ADD_ATTR:Gs(T.ADD_ATTR)&&(We===Ze&&(We=il(We)),tt(We,T.ADD_ATTR,Qe))),Mn(T,"ADD_URI_SAFE_ATTR")&&Gs(T.ADD_URI_SAFE_ATTR)&&tt(xe,T.ADD_URI_SAFE_ATTR,Qe),Mn(T,"FORBID_CONTENTS")&&Gs(T.FORBID_CONTENTS)&&(Y===_e&&(Y=il(Y)),tt(Y,T.FORBID_CONTENTS,Qe)),Mn(T,"ADD_FORBID_CONTENTS")&&Gs(T.ADD_FORBID_CONTENTS)&&(Y===_e&&(Y=il(Y)),tt(Y,T.ADD_FORBID_CONTENTS,Qe)),ut&&(Ie["#text"]=!0),Nt&&tt(Ie,["html","head","body"]),Ie.table&&(tt(Ie,["tbody"]),delete st.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw ji('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ji('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ue=z;z=T.TRUSTED_TYPES_POLICY;try{A=ae("")}catch(ve){throw z=ue,ve}}else T.TRUSTED_TYPES_POLICY===null?(z=void 0,A=""):(z===void 0&&(z=Ae()),z&&typeof A=="string"&&(A=ae("")));Bn&&Bn(T),Fn=T},Jl=tt({},[...ch,...uh,...Av]),Fl=tt({},[...oh,...Cv]),Ta=function(T,I,ue){return I.namespaceURI===jn?T==="svg":I.namespaceURI===Tt?T==="svg"&&(ue==="annotation-xml"||Ul[ue]):!!Jl[T]},Wl=function(T,I,ue){return I.namespaceURI===jn?T==="math":I.namespaceURI===Sn?T==="math"&&on[ue]:!!Fl[T]},bl=function(T,I,ue){return I.namespaceURI===Sn&&!on[ue]||I.namespaceURI===Tt&&!Ul[ue]?!1:!Fl[T]&&(wa[T]||!Jl[T])},tn=function(T){let I=P(T);(!I||!I.tagName)&&(I={namespaceURI:Ct,tagName:"template"});const ue=Yc(T.tagName),ve=Yc(I.tagName);return ka[T.namespaceURI]?T.namespaceURI===Sn?Ta(ue,I,ve):T.namespaceURI===Tt?Wl(ue,I,ve):T.namespaceURI===jn?bl(ue,I,ve):!!(gl==="application/xhtml+xml"&&ka[T.namespaceURI]):!1},nn=function(T){jr(l.removed,{element:T});try{P(T).removeChild(T)}catch{if(k(T),!P(T))throw ji("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ot=function(T){Gn(T);const I=U(T);if(I){const ve=[];Sr(I,De=>{jr(ve,De)}),Sr(ve,De=>{try{k(De)}catch{}})}const ue=Q(T);if(ue)for(let ve=ue.length-1;ve>=0;--ve){const De=ue[ve],Le=De&&De.name;if(typeof Le=="string")try{T.removeAttribute(Le)}catch{}}},In=function(T,I){try{jr(l.removed,{attribute:I.getAttributeNode(T),from:I})}catch{jr(l.removed,{attribute:null,from:I})}if(I.removeAttribute(T),T==="is")if(Tn||Ot)try{nn(I)}catch{}else try{I.setAttribute(T,"")}catch{}},Ea=function(T){const I=Q(T);if(I)for(let ue=I.length-1;ue>=0;--ue){const ve=I[ue],De=ve&&ve.name;if(!(typeof De!="string"||We[Qe(De)]))try{T.removeAttribute(De)}catch{}}},Gn=function(T){const I=[T];for(;I.length>0;){const ue=I.pop();(w?w(ue):ue.nodeType)===Tl.element&&Ea(ue);const De=U(ue);if(De)for(let Le=De.length-1;Le>=0;--Le)I.push(De[Le])}},Yn=function(T){if(!it)return;const I=[T];for(;I.length>0;){const ue=I.pop(),ve=w?w(ue):ue.nodeType;if(ve===Tl.processingInstruction||ve===Tl.comment&&Rn(Mb,ue.data)){try{k(ue)}catch{}continue}if(ve===Tl.element){const Le=ue,ht=Qe(K?K(ue):ue.nodeName);try{Le.hasAttribute&&Le.hasAttribute("patchsrc")&&Le.removeAttribute("patchsrc"),Le.hasAttribute&&Le.hasAttribute("for")&&ht!=="label"&&ht!=="output"&&Le.removeAttribute("for")}catch{}}const De=U(ue);if(De)for(let Le=De.length-1;Le>=0;--Le)I.push(De[Le])}},Xn=function(T){let I=null,ue=null;if(vn)T="<remove></remove>"+T;else{const Le=Sb(T,/^[\r\n\t ]+/);ue=Le&&Le[0]}gl==="application/xhtml+xml"&&Ct===jn&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ve=z?ae(T):T;if(Ct===jn)try{I=new y().parseFromString(ve,gl)}catch{}if(!I||!I.documentElement){I=H.createDocument(Ct,"template",null);try{I.documentElement.innerHTML=Al?A:ve}catch{}}const De=I.body||I.documentElement;return T&&ue&&De.insertBefore(i.createTextNode(ue),De.childNodes[0]||null),Ct===jn?pe.call(I,Nt?"html":"body")[0]:Nt?I.documentElement:De},Pl=function(T){return re.call(T.ownerDocument||T,T,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Wn=function(T){return T=Uc(T,$," "),T=Uc(T,ce," "),T=Uc(T,he," "),T},Ks=function(T){var I;T.normalize();const ue=re.call(T.ownerDocument||T,T,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let ve=ue.nextNode();for(;ve;)ve.data=Wn(ve.data),ve=ue.nextNode();const De=(I=T.querySelectorAll)===null||I===void 0?void 0:I.call(T,"template");De&&Sr(De,Le=>{On(Le.content)&&Ks(Le.content)})},En=function(T){const I=K?K(T):null;return typeof I!="string"||Qe(I)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==Q(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==w(T)||T.childNodes!==U(T)},On=function(T){if(!w||typeof T!="object"||T===null)return!1;try{return w(T)===Tl.documentFragment}catch{return!1}},fn=function(T){if(!w||typeof T!="object"||T===null)return!1;try{return typeof w(T)=="number"}catch{return!1}};function xt(fe,T,I){fe.length!==0&&Sr(fe,ue=>{ue.call(l,T,I,Fn)})}const Aa=function(T,I){return!!(it&&T.hasChildNodes()&&!fn(T.firstElementChild)&&Rn(Rb,T.textContent)&&Rn(Rb,T.innerHTML)||it&&T.namespaceURI===jn&&I==="style"&&fn(T.firstElementChild)||T.nodeType===Tl.processingInstruction||it&&T.nodeType===Tl.comment&&Rn(Mb,T.data))},Gr=function(T,I){if(!st[I]&&Ra(I)&&(Ke.tagNameCheck instanceof RegExp&&Rn(Ke.tagNameCheck,I)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(I)))return!1;if(ut&&!Y[I]){const ue=P(T),ve=U(T);if(ve&&ue){const De=ve.length;for(let Le=De-1;Le>=0;--Le){const ht=en?ve[Le]:C(ve[Le],!0);ue.insertBefore(ht,L(T))}}}return nn(T),!0},ea=function(T,I){if(xt(N.beforeSanitizeElements,T,null),T!==I&&P(T)===null)return!0;if(En(T))return nn(T),!0;const ue=Qe(K?K(T):T.nodeName);if(xt(N.uponSanitizeElement,T,{tagName:ue,allowedTags:Ie}),T!==I&&P(T)===null)return!0;if(Aa(T,ue))return nn(T),!0;if(st[ue]||!(Ht.tagCheck instanceof Function&&Ht.tagCheck(ue))&&!Ie[ue]){const De=Gr(T,ue);return De===!1&&xt(N.afterSanitizeElements,T,null),De}if((w?w(T):T.nodeType)===Tl.element&&!tn(T)||(ue==="noscript"||ue==="noembed"||ue==="noframes")&&Rn(qv,T.innerHTML))return nn(T),!0;if(Xt&&T.nodeType===Tl.text){const De=Wn(T.textContent);T.textContent!==De&&(jr(l.removed,{element:T.cloneNode()}),T.textContent=De)}return xt(N.afterSanitizeElements,T,null),!1},ta=function(T,I,ue){if(Jn[I]||it&&I==="patchsrc"||it&&I==="for"&&T!=="label"&&T!=="output"||Zt&&(I==="id"||I==="name")&&(ue in i||ue in Qs))return!1;const ve=We[I]||Ht.attributeCheck instanceof Function&&Ht.attributeCheck(I,T);if(!(Qt&&Rn(we,I))){if(!(Bt&&Rn(ye,I))){if(ve){if(!xe[I]){if(!Rn(Mt,Uc(ue,at,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&T!=="script"&&jb(ue,"data:")===0&&O[T])){if(!(qt&&!Rn(Me,Uc(ue,at,"")))){if(ue)return!1}}}}}else if(!(Ra(T)&&(Ke.tagNameCheck instanceof RegExp&&Rn(Ke.tagNameCheck,T)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(T))&&(Ke.attributeNameCheck instanceof RegExp&&Rn(Ke.attributeNameCheck,I)||Ke.attributeNameCheck instanceof Function&&Ke.attributeNameCheck(I,T))||I==="is"&&Ke.allowCustomizedBuiltInElements&&(Ke.tagNameCheck instanceof RegExp&&Rn(Ke.tagNameCheck,ue)||Ke.tagNameCheck instanceof Function&&Ke.tagNameCheck(ue))))return!1}}return!0},Ca=tt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ra=function(T){return!Ca[Yc(T)]&&Rn(Ve,T)},Dn=function(T,I,ue,ve){if(z&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ue)switch(j.getAttributeType(T,I)){case"TrustedHTML":return ae(ve);case"TrustedScriptURL":return me(ve)}return ve},xl=function(T,I,ue,ve){try{ue?T.setAttributeNS(ue,I,ve):T.setAttribute(I,ve),En(T)?nn(T):vb(l.removed)}catch{In(I,T)}},Hl=function(T){xt(N.beforeSanitizeAttributes,T,null);const I=T.attributes;if(!I||En(T))return;const ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:We,forceKeepAttr:void 0};let ve=I.length;const De=Qe(T.nodeName);for(;ve--;){const Le=I[ve],ht=Le.name,dn=Le.namespaceURI,ln=Le.value,Rt=Qe(ht),hn=ln;let Gt=ht==="value"?hn:Sv(hn);if(ue.attrName=Rt,ue.attrValue=Gt,ue.keepAttr=!0,ue.forceKeepAttr=void 0,xt(N.uponSanitizeAttribute,T,ue),Gt=ue.attrValue,wt&&(Rt==="id"||Rt==="name")&&jb(Gt,un)!==0&&(In(ht,T),Gt=un+Gt),it&&Rn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Gt)){In(ht,T);continue}if(Rt==="attributename"&&Sb(Gt,"href")){In(ht,T);continue}if(!ue.forceKeepAttr){if(!ue.keepAttr){In(ht,T);continue}if(!It&&Rn(Iv,Gt)){In(ht,T);continue}if(Xt&&(Gt=Wn(Gt)),!ta(De,Rt,Gt)){In(ht,T);continue}Gt=Dn(De,Rt,dn,Gt),Gt!==hn&&xl(T,ht,dn,Gt)}}xt(N.afterSanitizeAttributes,T,null)},na=function(T){let I=null;const ue=Pl(T);for(xt(N.beforeSanitizeShadowDOM,T,null);I=ue.nextNode();)if(xt(N.uponSanitizeShadowNode,I,null),ea(I,T),Hl(I),On(I.content)&&na(I.content),(w?w(I):I.nodeType)===Tl.element){const De=M(I);On(De)&&(cl(De),na(De))}xt(N.afterSanitizeShadowDOM,T,null)},cl=function(T){const I=[{node:T,shadow:null}];for(;I.length>0;){const ue=I.pop();if(ue.shadow){na(ue.shadow);continue}const ve=ue.node,Le=(w?w(ve):ve.nodeType)===Tl.element,ht=U(ve);if(ht)for(let dn=ht.length-1;dn>=0;--dn)I.push({node:ht[dn],shadow:null});if(Le){const dn=K?K(ve):null;if(typeof dn=="string"&&Qe(dn)==="template"){const ln=ve.content;On(ln)&&I.push({node:ln,shadow:null})}}if(Le){const dn=M(ve);On(dn)&&I.push({node:null,shadow:dn},{node:dn,shadow:null})}}};return l.sanitize=function(fe){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,ue=null,ve=null,De=null;if(Al=!fe,Al&&(fe="<!-->"),typeof fe!="string"&&!fn(fe)&&(fe=Tv(fe),typeof fe!="string"))throw ji("dirty is not a string, aborting");if(!l.isSupported)return fe;Pt?(Ie=wn,We=At):Zs(T),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(Ie=il(Ie)),N.uponSanitizeAttribute.length>0&&(We=il(We)),l.removed=[];const Le=en&&typeof fe!="string"&&fn(fe);if(Le){Yn(fe);const Rt=K?K(fe):fe.nodeName;if(typeof Rt=="string"){const hn=Qe(Rt);if(!Ie[hn]||st[hn])throw ot(fe),ji("root node is forbidden and cannot be sanitized in-place")}if(En(fe))throw ot(fe),ji("root node is clobbered and cannot be sanitized in-place");try{cl(fe)}catch(hn){throw ot(fe),hn}}else if(fn(fe))I=Xn("<!---->"),ue=I.ownerDocument.importNode(fe,!0),ue.nodeType===Tl.element&&ue.nodeName==="BODY"||ue.nodeName==="HTML"?I=ue:I.appendChild(ue),cl(ue);else{if(!Tn&&!Xt&&!Nt&&fe.indexOf("<")===-1)return z&&cn?ae(fe):fe;if(I=Xn(fe),!I)return Tn?null:cn?A:""}I&&vn&&nn(I.firstChild);const ht=Le?fe:I,dn=Pl(ht);try{for(;ve=dn.nextNode();)ea(ve,ht),Hl(ve),On(ve.content)&&na(ve.content)}catch(Rt){throw Le&&(ot(fe),Sr(l.removed,hn=>{hn.element&&Gn(hn.element)})),Rt}if(Le)return Sr(l.removed,Rt=>{Rt.element&&Gn(Rt.element)}),Xt&&Ks(fe),fe;if(Tn){if(Xt&&Ks(I),Ot)for(De=se.call(I.ownerDocument);I.firstChild;)De.appendChild(I.firstChild);else De=I;return(We.shadowroot||We.shadowrootmode)&&(De=Ne.call(c,De,!0)),De}let ln=Nt?I.outerHTML:I.innerHTML;return Nt&&Ie["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Rn(Hv,I.ownerDocument.doctype.name)&&(ln="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
115
- `+ln),Xt&&(ln=Wn(ln)),z&&cn?ae(ln):ln},l.setConfig=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zs(fe),Pt=!0,wn=Ie,At=We},l.clearConfig=function(){Fn=null,Pt=!1,wn=null,At=null,z=V,A=""},l.isValidAttribute=function(fe,T,I){Fn||Zs({});const ue=Qe(fe),ve=Qe(T);return ta(ue,ve,I)},l.addHook=function(fe,T){typeof T=="function"&&Mn(N,fe)&&jr(N[fe],T)},l.removeHook=function(fe,T){if(Mn(N,fe)){if(T!==void 0){const I=_v(N[fe],T);return I===-1?void 0:vv(N[fe],I,1)[0]}return vb(N[fe])}},l.removeHooks=function(fe){Mn(N,fe)&&(N[fe]=[])},l.removeAllHooks=function(){N=Ob()},l}var Xv=Jx();const Vv=1024;let $v=0;class Ll{constructor(l,i){this.from=l,this.to=i}}class Ut{constructor(l={}){this.id=$v++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Zl.match(l)),i=>{let c=l(i);return c===void 0?null:[this,c]}}}Ut.closedBy=new Ut({deserialize:a=>a.split(" ")});Ut.openedBy=new Ut({deserialize:a=>a.split(" ")});Ut.group=new Ut({deserialize:a=>a.split(" ")});Ut.isolate=new Ut({deserialize:a=>{if(a&&a!="rtl"&&a!="ltr"&&a!="auto")throw new RangeError("Invalid value for isolate: "+a);return a||"auto"}});Ut.contextHash=new Ut({perNode:!0});Ut.lookAhead=new Ut({perNode:!0});Ut.mounted=new Ut({perNode:!0});class Er{constructor(l,i,c,o=!1){this.tree=l,this.overlay=i,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[Ut.mounted.id]}}const Qv=Object.create(null);class Zl{constructor(l,i,c,o=0){this.name=l,this.props=i,this.id=c,this.flags=o}static define(l){let i=l.props&&l.props.length?Object.create(null):Qv,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Zl(l.name||"",i,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[d[0].id]=d[1]}}return o}prop(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let i=this.prop(Ut.group);return i?i.indexOf(l)>-1:!1}return this.id==l}static match(l){let i=Object.create(null);for(let c in l)for(let o of c.split(" "))i[o]=l[c];return c=>{for(let o=c.prop(Ut.group),d=-1;d<(o?o.length:0);d++){let h=i[d<0?c.name:o[d]];if(h)return h}}}}Zl.none=new Zl("",Object.create(null),0,8);class Fx{constructor(l){this.types=l;for(let i=0;i<l.length;i++)if(l[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let i=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let p=h[1],m=h[0];m.combine&&m.id in o&&(p=m.combine(o[m.id],p)),o[m.id]=p}}i.push(o?new Zl(c.name,o,c.id,c.flags):c)}return new Fx(i)}}const jo=new WeakMap,Db=new WeakMap;var zt;(function(a){a[a.ExcludeBuffers=1]="ExcludeBuffers",a[a.IncludeAnonymous=2]="IncludeAnonymous",a[a.IgnoreMounts=4]="IgnoreMounts",a[a.IgnoreOverlays=8]="IgnoreOverlays",a[a.EnterBracketed=16]="EnterBracketed"})(zt||(zt={}));class ml{constructor(l,i,c,o,d){if(this.type=l,this.children=i,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,p]of d)this.props[typeof h=="number"?h:h.id]=p}}toString(){let l=Er.get(this);if(l&&!l.overlay)return l.tree.toString();let i="";for(let c of this.children){let o=c.toString();o&&(i&&(i+=","),i+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(l=0){return new Go(this.topNode,l)}cursorAt(l,i=0,c=0){let o=jo.get(this)||this.topNode,d=new Go(o);return d.moveTo(l,i),jo.set(this,d._tree),d}get topNode(){return new Kn(this,0,0,null)}resolve(l,i=0){let c=Qc(jo.get(this)||this.topNode,l,i,!1);return jo.set(this,c),c}resolveInner(l,i=0){let c=Qc(Db.get(this)||this.topNode,l,i,!0);return Db.set(this,c),c}resolveStack(l,i=0){return Jv(this,l,i)}iterate(l){let{enter:i,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,p=(h&zt.IncludeAnonymous)>0;for(let m=this.cursor(h|zt.IncludeAnonymous);;){let x=!1;if(m.from<=d&&m.to>=o&&(!p&&m.type.isAnonymous||i(m)!==!1)){if(m.firstChild())continue;x=!0}for(;x&&c&&(p||!m.type.isAnonymous)&&c(m),!m.nextSibling();){if(!m.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let i in this.props)l.push([+i,this.props[i]]);return l}balance(l={}){return this.children.length<=8?this:Zh(Zl.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new ml(this.type,i,c,o,this.propValues),l.makeTree||((i,c,o)=>new ml(Zl.none,i,c,o)))}static build(l){return Fv(l)}}ml.empty=new ml(Zl.none,[],[],0);class $h{constructor(l,i){this.buffer=l,this.index=i}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 $h(this.buffer,this.index)}}class Vs{constructor(l,i,c){this.buffer=l,this.length=i,this.set=c}get type(){return Zl.none}toString(){let l=[];for(let i=0;i<this.buffer.length;)l.push(this.childString(i)),i=this.buffer[i+3];return l.join(",")}childString(l){let i=this.buffer[l],c=this.buffer[l+3],o=this.set.types[i],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,i,c,o,d){let{buffer:h}=this,p=-1;for(let m=l;m!=i&&!(Wx(d,o,h[m+1],h[m+2])&&(p=m,c>0));m=h[m+3]);return p}slice(l,i,c){let o=this.buffer,d=new Uint16Array(i-l),h=0;for(let p=l,m=0;p<i;){d[m++]=o[p++],d[m++]=o[p++]-c;let x=d[m++]=o[p++]-c;d[m++]=o[p++]-l,h=Math.max(h,x)}return new Vs(d,h,this.set)}}function Wx(a,l,i,c){switch(a){case-2:return i<l;case-1:return c>=l&&i<l;case 0:return i<l&&c>l;case 1:return i<=l&&c>l;case 2:return c>l;case 4:return!0}}function Qc(a,l,i,c){for(var o;a.from==a.to||(i<1?a.from>=l:a.from>l)||(i>-1?a.to<=l:a.to<l);){let h=!c&&a instanceof Kn&&a.index<0?null:a.parent;if(!h)return a;a=h}let d=c?0:zt.IgnoreOverlays;if(c)for(let h=a,p=h.parent;p;h=p,p=h.parent)h instanceof Kn&&h.index<0&&((o=p.enter(l,i,d))===null||o===void 0?void 0:o.from)!=h.from&&(a=p);for(;;){let h=a.enter(l,i,d);if(!h)return a;a=h}}class Px{cursor(l=0){return new Go(this,l)}getChild(l,i=null,c=null){let o=zb(this,l,i,c);return o.length?o[0]:null}getChildren(l,i=null,c=null){return zb(this,l,i,c)}resolve(l,i=0){return Qc(this,l,i,!1)}resolveInner(l,i=0){return Qc(this,l,i,!0)}matchContext(l){return Ch(this.parent,l)}enterUnfinishedNodesBefore(l){let i=this.childBefore(l),c=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(c=i,i=o.prevSibling):i=o}return c}get node(){return this}get next(){return this.parent}}class Kn extends Px{constructor(l,i,c,o){super(),this._tree=l,this.from=i,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,i,c,o,d=0){for(let h=this;;){for(let{children:p,positions:m}=h._tree,x=i>0?p.length:-1;l!=x;l+=i){let y=p[l],j=m[l]+h.from,v;if(!(!(d&zt.EnterBracketed&&y instanceof ml&&(v=Er.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!Wx(o,c,j,j+y.length))){if(y instanceof Vs){if(d&zt.ExcludeBuffers)continue;let C=y.findChild(0,y.buffer.length,i,c-j,o);if(C>-1)return new Sa(new Zv(h,y,l,j),null,C)}else if(d&zt.IncludeAnonymous||!y.type.isAnonymous||Qh(y)){let C;if(!(d&zt.IgnoreMounts)&&(C=Er.get(y))&&!C.overlay)return new Kn(C.tree,j,l,h);let k=new Kn(y,j,l,h);return d&zt.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(i<0?y.children.length-1:0,i,c,o,d)}}}if(d&zt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+i:l=i<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,i,c=0){let o;if(!(c&zt.IgnoreOverlays)&&(o=Er.get(this._tree))&&o.overlay){let d=l-this.from,h=c&zt.EnterBracketed&&o.bracketed;for(let{from:p,to:m}of o.overlay)if((i>0||h?p<=d:p<d)&&(i<0||h?m>=d:m>d))return new Kn(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,i,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function zb(a,l,i,c){let o=a.cursor(),d=[];if(!o.firstChild())return d;if(i!=null){for(let h=!1;!h;)if(h=o.type.is(i),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function Ch(a,l,i=l.length-1){for(let c=a;i>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[i]&&l[i]!=c.name)return!1;i--}}return!0}class Zv{constructor(l,i,c,o){this.parent=l,this.buffer=i,this.index=c,this.start=o}}class Sa extends Px{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,i,c){super(),this.context=l,this._parent=i,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,i,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.context.start,c);return d<0?null:new Sa(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,i,c=0){if(c&zt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],i>0?1:-1,l-this.context.start,i);return d<0?null:new Sa(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,i=l.buffer[this.index+3];return i<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new Sa(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new Sa(this.context,this._parent,l.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],i=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),i.push(0)}return new ml(this.type,l,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ey(a){if(!a.length)return null;let l=0,i=a[0];for(let d=1;d<a.length;d++){let h=a[d];(h.from>i.from||h.to<i.to)&&(i=h,l=d)}let c=i instanceof Kn&&i.index<0?null:i.parent,o=a.slice();return c?o[l]=c:o.splice(l,1),new Kv(o,i)}class Kv{constructor(l,i){this.heads=l,this.node=i}get next(){return ey(this.heads)}}function Jv(a,l,i){let c=a.resolveInner(l,i),o=null;for(let d=c instanceof Kn?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,i)),d=h}else{let h=Er.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new Kn(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Qc(p,l,i,!1))}}return o?ey(o):c}class Go{get name(){return this.type.name}constructor(l,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~zt.EnterBracketed,l instanceof Kn)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,i){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=i||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof Kn?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,i,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,i,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,i,c=this.mode){return this.buffer?c&zt.ExcludeBuffers?!1:this.enterChild(1,l,i):this.yield(this._tree.enter(l,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&zt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&zt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:i}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(i.findChild(o,this.index,-1,0,4))}else{let o=i.buffer[this.index+3];if(o<(c<0?i.buffer.length:i.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let i,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:i,parent:c}=o)}else({index:i,_parent:c}=this._tree);for(;c;{index:i,_parent:c}=c)if(i>-1)for(let d=i+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let p=c._tree.children[d];if(this.mode&zt.IncludeAnonymous||p instanceof Vs||!p.type.isAnonymous||Qh(p))return!1}return!0}move(l,i){if(i&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,i=0){for(;(this.from==this.to||(i<1?this.from>=l:this.from>l)||(i>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,i););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,i=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;i=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)i=new Sa(this.buffer,i,this.stack[o]);return this.bufferNode=new Sa(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,i){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&i&&i(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Ch(this.node.parent,l);let{buffer:i}=this.buffer,{types:c}=i.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return Ch(this._tree,l,o);let h=c[i.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Qh(a){return a.children.some(l=>l instanceof Vs||!l.type.isAnonymous||Qh(l))}function Fv(a){var l;let{buffer:i,nodeSet:c,maxBufferLength:o=Vv,reused:d=[],minRepeatType:h=c.types.length}=a,p=Array.isArray(i)?new $h(i,i.length):i,m=c.types,x=0,y=0;function j(K,z,A,V,te,oe){let{id:F,start:ae,end:me,size:Ae}=p,be=y,H=x;if(Ae<0)if(p.next(),Ae==-1){let N=d[F];A.push(N),V.push(ae-K);return}else if(Ae==-3){x=F;return}else if(Ae==-4){y=F;return}else throw new RangeError(`Unrecognized record size: ${Ae}`);let re=m[F],se,pe,Ne=ae-K;if(me-ae<=o&&(pe=U(p.pos-z,te))){let N=new Uint16Array(pe.size-pe.skip),$=p.pos-pe.size,ce=N.length;for(;p.pos>$;)ce=P(pe.start,N,ce);se=new Vs(N,me-pe.start,c),Ne=pe.start-K}else{let N=p.pos-Ae;p.next();let $=[],ce=[],he=F>=h?F:-1,we=0,ye=me;for(;p.pos>N;)he>=0&&p.id==he&&p.size>=0?(p.end<=ye-o&&(k($,ce,ae,we,p.end,ye,he,be,H),we=$.length,ye=p.end),p.next()):oe>2500?v(ae,N,$,ce):j(ae,N,$,ce,he,oe+1);if(he>=0&&we>0&&we<$.length&&k($,ce,ae,we,ae,ye,he,be,H),$.reverse(),ce.reverse(),he>-1&&we>0){let Me=C(re,H);se=Zh(re,$,ce,0,$.length,0,me-ae,Me,Me)}else se=L(re,$,ce,me-ae,be-me,H)}A.push(se),V.push(Ne)}function v(K,z,A,V){let te=[],oe=0,F=-1;for(;p.pos>z;){let{id:ae,start:me,end:Ae,size:be}=p;if(be>4)p.next();else{if(F>-1&&me<F)break;F<0&&(F=Ae-o),te.push(ae,me,Ae),oe++,p.next()}}if(oe){let ae=new Uint16Array(oe*4),me=te[te.length-2];for(let Ae=te.length-3,be=0;Ae>=0;Ae-=3)ae[be++]=te[Ae],ae[be++]=te[Ae+1]-me,ae[be++]=te[Ae+2]-me,ae[be++]=be;A.push(new Vs(ae,te[2]-me,c)),V.push(me-K)}}function C(K,z){return(A,V,te)=>{let oe=0,F=A.length-1,ae,me;if(F>=0&&(ae=A[F])instanceof ml){if(!F&&ae.type==K&&ae.length==te)return ae;(me=ae.prop(Ut.lookAhead))&&(oe=V[F]+ae.length+me)}return L(K,A,V,te,oe,z)}}function k(K,z,A,V,te,oe,F,ae,me){let Ae=[],be=[];for(;K.length>V;)Ae.push(K.pop()),be.push(z.pop()+A-te);K.push(L(c.types[F],Ae,be,oe-te,ae-oe,me)),z.push(te-A)}function L(K,z,A,V,te,oe,F){if(oe){let ae=[Ut.contextHash,oe];F=F?[ae].concat(F):[ae]}if(te>25){let ae=[Ut.lookAhead,te];F=F?[ae].concat(F):[ae]}return new ml(K,z,A,V,F)}function U(K,z){let A=p.fork(),V=0,te=0,oe=0,F=A.end-o,ae={size:0,start:0,skip:0};e:for(let me=A.pos-K;A.pos>me;){let Ae=A.size;if(A.id==z&&Ae>=0){ae.size=V,ae.start=te,ae.skip=oe,oe+=4,V+=4,A.next();continue}let be=A.pos-Ae;if(Ae<0||be<me||A.start<F)break;let H=A.id>=h?4:0,re=A.start;for(A.next();A.pos>be;){if(A.size<0)if(A.size==-3||A.size==-4)H+=4;else break e;else A.id>=h&&(H+=4);A.next()}te=re,V+=Ae,oe+=H}return(z<0||V==K)&&(ae.size=V,ae.start=te,ae.skip=oe),ae.size>4?ae:void 0}function P(K,z,A){let{id:V,start:te,end:oe,size:F}=p;if(p.next(),F>=0&&V<h){let ae=A;if(F>4){let me=p.pos-(F-4);for(;p.pos>me;)A=P(K,z,A)}z[--A]=ae,z[--A]=oe-K,z[--A]=te-K,z[--A]=V}else F==-3?x=V:F==-4&&(y=V);return A}let M=[],Q=[];for(;p.pos>0;)j(a.start||0,a.bufferStart||0,M,Q,-1,0);let w=(l=a.length)!==null&&l!==void 0?l:M.length?Q[0]+M[0].length:0;return new ml(m[a.topID],M.reverse(),Q.reverse(),w)}const Lb=new WeakMap;function Uo(a,l){if(!a.isAnonymous||l instanceof Vs||l.type!=a)return 1;let i=Lb.get(l);if(i==null){i=1;for(let c of l.children){if(c.type!=a||!(c instanceof ml)){i=1;break}i+=Uo(a,c)}Lb.set(l,i)}return i}function Zh(a,l,i,c,o,d,h,p,m){let x=0;for(let k=c;k<o;k++)x+=Uo(a,l[k]);let y=Math.ceil(x*1.5/8),j=[],v=[];function C(k,L,U,P,M){for(let Q=U;Q<P;){let w=Q,K=L[Q],z=Uo(a,k[Q]);for(Q++;Q<P;Q++){let A=Uo(a,k[Q]);if(z+A>=y)break;z+=A}if(Q==w+1){if(z>y){let A=k[w];C(A.children,A.positions,0,A.children.length,L[w]+M);continue}j.push(k[w])}else{let A=L[Q-1]+k[Q-1].length-K;j.push(Zh(a,k,L,w,Q,K,A,null,m))}v.push(K+M-d)}}return C(l,i,c,o,0),(p||m)(j,v,h)}class pN{constructor(){this.map=new WeakMap}setBuffer(l,i,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(i,c)}getBuffer(l,i){let c=this.map.get(l);return c&&c.get(i)}set(l,i){l instanceof Sa?this.setBuffer(l.context.buffer,l.index,i):l instanceof Kn&&this.map.set(l.tree,i)}get(l){return l instanceof Sa?this.getBuffer(l.context.buffer,l.index):l instanceof Kn?this.map.get(l.tree):void 0}cursorSet(l,i){l.buffer?this.setBuffer(l.buffer.buffer,l.index,i):this.map.set(l.tree,i)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Zc{constructor(l,i,c,o,d=!1,h=!1){this.from=l,this.to=i,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,i=[],c=!1){let o=[new Zc(0,l.length,l,0,!1,c)];for(let d of i)d.to>l.length&&o.push(d);return o}static applyChanges(l,i,c=128){if(!i.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let p=0,m=0,x=0;;p++){let y=p<i.length?i[p]:null,j=y?y.fromA:1e9;if(j-m>=c)for(;h&&h.from<j;){let v=h;if(m>=v.from||j<=v.to||x){let C=Math.max(v.from,m)-x,k=Math.min(v.to,j)-x;v=C>=k?null:new Zc(C,k,v.tree,v.offset+x,p>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;m=y.toA,x=y.toA-y.toB}return o}}class mN{startParse(l,i,c){return typeof l=="string"&&(l=new Wv(l)),c=c?c.length?c.map(o=>new Ll(o.from,o.to)):[new Ll(0,0)]:[new Ll(0,l.length)],this.createParse(l,i||[],c)}parse(l,i,c){let o=this.startParse(l,i,c);for(;;){let d=o.advance();if(d)return d}}}class Wv{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,i){return this.string.slice(l,i)}}function gN(a){return(l,i,c,o)=>new e1(l,a,i,c,o)}class Ub{constructor(l,i,c,o,d,h){this.parser=l,this.parse=i,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Hb(a){if(!a.length||a.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(a))}class Pv{constructor(l,i,c,o,d,h,p,m){this.parser=l,this.predicate=i,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=p,this.prev=m,this.depth=0,this.ranges=[]}}const Rh=new Ut({perNode:!0});class e1{constructor(l,i,c,o,d){this.nest=i,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new ml(c.type,c.children,c.positions,c.length,c.propValues.concat([[Rh,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],i=l.parse.advance();if(i){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[Ut.mounted.id]=new Er(i,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<l&&(l=Math.min(l,this.inner[i].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(l)}startInner(){let l=new l1(this.fragments),i=null,c=null,o=new Go(new Kn(this.baseTree,this.ranges[0].from,0,null),zt.IncludeAnonymous|zt.IgnoreMounts);e:for(let d,h;;){let p=!0,m;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)p=!1;else if(l.hasNode(o)){if(i){let x=i.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&&!i.ranges.some(C=>C.from<v&&C.to>j)&&i.ranges.push({from:j,to:v})}}p=!1}else if(c&&(h=t1(c.ranges,o.from,o.to)))p=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(n1(o),i&&i.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")i=new Pv(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,i);else{let y=Ib(this.ranges,d.overlay||(o.from<o.to?[new Ll(o.from,o.to)]:[]));y.length&&Hb(y),(y.length||!d.overlay)&&this.inner.push(new Ub(d.parser,y.length?d.parser.startParse(this.input,Gb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Ll(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,y.length?y[0].from:o.from)),d.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):p=!1}}else if(i&&(m=i.predicate(o))&&(m===!0&&(m=new Ll(o.from,o.to)),m.from<m.to)){let x=i.ranges.length-1;x>=0&&i.ranges[x].to==m.from?i.ranges[x]={from:i.ranges[x].from,to:m.to}:i.ranges.push(m)}if(p&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let x=Ib(this.ranges,i.ranges);x.length&&(Hb(x),this.inner.splice(i.index,0,new Ub(i.parser,i.parser.startParse(this.input,Gb(i.mounts,x),x),i.ranges.map(y=>new Ll(y.from-i.start,y.to-i.start)),i.bracketed,i.target,x[0].from))),i=i.prev}c&&!--c.depth&&(c=c.prev)}}}}function t1(a,l,i){for(let c of a){if(c.from>=i)break;if(c.to>l)return c.from<=l&&c.to>=i?2:1}return 0}function Bb(a,l,i,c,o,d){if(l<i){let h=a.buffer[l+1];c.push(a.slice(l,i,h)),o.push(h-d)}}function n1(a){let{node:l}=a,i=[],c=l.context.buffer;do i.push(a.index),a.parent();while(!a.tree);let o=a.tree,d=o.children.indexOf(c),h=o.children[d],p=h.buffer,m=[d];function x(y,j,v,C,k,L){let U=i[L],P=[],M=[];Bb(h,y,U,P,M,C);let Q=p[U+1],w=p[U+2];m.push(P.length);let K=L?x(U+4,p[U+3],h.set.types[p[U]],Q,w-Q,L-1):l.toTree();return P.push(K),M.push(Q-C),Bb(h,p[U+3],j,P,M,C),new ml(v,P,M,k)}o.children[d]=x(0,p.length,Zl.none,0,h.length,i.length-1);for(let y of m){let j=a.tree.children[y],v=a.tree.positions[y];a.yield(new Kn(j,v+a.from,y,a._tree))}}class qb{constructor(l,i){this.offset=i,this.done=!1,this.cursor=l.cursor(zt.IncludeAnonymous|zt.IgnoreMounts)}moveTo(l){let{cursor:i}=this,c=l-this.offset;for(;!this.done&&i.from<c;)if(!(i.to>=l&&i.enter(c,1,zt.IgnoreOverlays|zt.ExcludeBuffers)))if(i.to<=l)i.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==l.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof ml)i=i.children[0];else break}return!1}}class l1{constructor(l){var i;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(i=c.tree.prop(Rh))!==null&&i!==void 0?i:c.to,this.inner=new qb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(l=i.tree.prop(Rh))!==null&&l!==void 0?l:i.to,this.inner=new qb(i.tree,-i.offset)}}findMounts(l,i){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Ut.mounted);if(h&&h.parser==i)for(let p=this.fragI;p<this.fragments.length;p++){let m=this.fragments[p];if(m.from>=d.to)break;m.tree==this.curFrag.tree&&o.push({frag:m,pos:d.from-m.offset,mount:h})}}}return o}}function Ib(a,l){let i=null,c=l;for(let o=1,d=0;o<a.length;o++){let h=a[o-1].to,p=a[o].from;for(;d<c.length;d++){let m=c[d];if(m.from>=p)break;m.to<=h||(i||(c=i=l.slice()),m.from<h?(i[d]=new Ll(m.from,h),m.to>p&&i.splice(d+1,0,new Ll(p,m.to))):m.to>p?i[d--]=new Ll(p,m.to):i.splice(d--,1))}}return c}function a1(a,l,i,c){let o=0,d=0,h=!1,p=!1,m=-1e9,x=[];for(;;){let y=o==a.length?1e9:h?a[o].to:a[o].from,j=d==l.length?1e9:p?l[d].to:l[d].from;if(h!=p){let v=Math.max(m,i),C=Math.min(y,j,c);v<C&&x.push(new Ll(v,C))}if(m=Math.min(y,j),m==1e9)break;y==m&&(h?(h=!1,o++):h=!0),j==m&&(p?(p=!1,d++):p=!0)}return x}function Gb(a,l){let i=[];for(let{pos:c,mount:o,frag:d}of a){let h=c+(o.overlay?o.overlay[0].from:0),p=h+o.tree.length,m=Math.max(d.from,h),x=Math.min(d.to,p);if(o.overlay){let y=o.overlay.map(v=>new Ll(v.from+c,v.to+c)),j=a1(l,y,m,x);for(let v=0,C=m;;v++){let k=v==j.length,L=k?x:j[v].from;if(L>C&&i.push(new Zc(C,L,o.tree,-h,d.from>=C||d.openStart,d.to<=L||d.openEnd)),k)break;C=j[v].to}}else i.push(new Zc(m,x,o.tree,-h,d.from>=h||d.openStart,d.to<=p||d.openEnd))}return i}let s1=0;class zl{constructor(l,i,c,o){this.name=l,this.set=i,this.base=c,this.modified=o,this.id=s1++}toString(){let{name:l}=this;for(let i of this.modified)i.name&&(l=`${i.name}(${l})`);return l}static define(l,i){let c=typeof l=="string"?l:"?";if(l instanceof zl&&(i=l),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new zl(c,[],null,[]);if(o.set.push(o),i)for(let d of i.set)o.set.push(d);return o}static defineModifier(l){let i=new Yo(l);return c=>c.modified.indexOf(i)>-1?c:Yo.get(c.base||c,c.modified.concat(i).sort((o,d)=>o.id-d.id))}}let i1=0;class Yo{constructor(l){this.name=l,this.instances=[],this.id=i1++}static get(l,i){if(!i.length)return l;let c=i[0].instances.find(p=>p.base==l&&r1(i,p.modified));if(c)return c;let o=[],d=new zl(l.name,o,l,i);for(let p of i)p.instances.push(d);let h=c1(i);for(let p of l.set)if(!p.modified.length)for(let m of h)o.push(Yo.get(p,m));return d}}function r1(a,l){return a.length==l.length&&a.every((i,c)=>i==l[c])}function c1(a){let l=[[]];for(let i=0;i<a.length;i++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(a[i]));return l.sort((i,c)=>c.length-i.length)}function bN(a){let l=Object.create(null);for(let i in a){let c=a[i];Array.isArray(c)||(c=[c]);for(let o of i.split(" "))if(o){let d=[],h=2,p=o;for(let j=0;;){if(p=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(p);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")throw new RangeError("Invalid path: "+o);p=o.slice(j)}let m=d.length-1,x=d[m];if(!x)throw new RangeError("Invalid path: "+o);let y=new Kc(c,h,m>0?d.slice(0,m):null);l[x]=y.sort(l[x])}}return ty.add(l)}const ty=new Ut({combine(a,l){let i,c,o;for(;a||l;){if(!a||l&&a.depth>=l.depth?(o=l,l=l.next):(o=a,a=a.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let d=new Kc(o.tags,o.mode,o.context);i?i.next=d:c=d,i=d}return c}});class Kc{constructor(l,i,c,o){this.tags=l,this.mode=i,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}Kc.empty=new Kc([],2,null);function ny(a,l){let i=Object.create(null);for(let d of a)if(!Array.isArray(d.tag))i[d.tag.id]=d.class;else for(let h of d.tag)i[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let p of d)for(let m of p.set){let x=i[m.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function u1(a,l){let i=null;for(let c of a){let o=c.style(l);o&&(i=i?i+" "+o:o)}return i}function o1(a,l,i,c=0,o=a.length){let d=new d1(c,Array.isArray(l)?l:[l],i);d.highlightRange(a.cursor(),c,o,"",d.highlighters),d.flush(o)}function f1(a,l,i,c,o,d=0,h=a.length){let p=d;function m(x,y){if(!(x<=p)){for(let j=a.slice(p,x),v=0;;){let C=j.indexOf(`
116
- `,v),k=C<0?j.length:C;if(k>v&&c(j.slice(v,k),y),C<0)break;o(),v=C+1}p=x}}o1(l,i,(x,y,j)=>{m(x,""),m(y,j)},d,h),m(h,"")}class d1{constructor(l,i,c){this.at=l,this.highlighters=i,this.span=c,this.class=""}startSpan(l,i){i!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=i)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,i,c,o,d){let{type:h,from:p,to:m}=l;if(p>=c||m<=i)return;h.isTop&&(d=this.highlighters.filter(C=>!C.scope||C.scope(h)));let x=o,y=h1(l)||Kc.empty,j=u1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(i,p),x),y.opaque)return;let v=l.tree&&l.tree.prop(Ut.mounted);if(v&&v.overlay){let C=l.node.enter(v.overlay[0].from+p,1),k=this.highlighters.filter(U=>!U.scope||U.scope(v.tree.type)),L=l.firstChild();for(let U=0,P=p;;U++){let M=U<v.overlay.length?v.overlay[U]:null,Q=M?M.from+p:m,w=Math.max(i,P),K=Math.min(c,Q);if(w<K&&L)for(;l.from<K&&(this.highlightRange(l,w,K,o,d),this.startSpan(Math.min(K,l.to),x),!(l.to>=Q||!l.nextSibling())););if(!M||Q>c)break;P=M.to+p,P>i&&(this.highlightRange(C.cursor(),Math.max(i,M.from+p),Math.min(c,P),"",k),this.startSpan(Math.min(c,P),x))}L&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=i)){if(l.from>=c)break;this.highlightRange(l,i,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function h1(a){let l=a.type.prop(ty);for(;l&&l.context&&!a.matchContext(l.context);)l=l.next;return l||null}const ge=zl.define,ko=ge(),qs=ge(),Yb=ge(qs),Xb=ge(qs),Is=ge(),No=ge(Is),dh=ge(Is),ya=ge(),ki=ge(ya),pa=ge(),ma=ge(),Mh=ge(),Bc=ge(Mh),wo=ge(),ke={comment:ko,lineComment:ge(ko),blockComment:ge(ko),docComment:ge(ko),name:qs,variableName:ge(qs),typeName:Yb,tagName:ge(Yb),propertyName:Xb,attributeName:ge(Xb),className:ge(qs),labelName:ge(qs),namespace:ge(qs),macroName:ge(qs),literal:Is,string:No,docString:ge(No),character:ge(No),attributeValue:ge(No),number:dh,integer:ge(dh),float:ge(dh),bool:ge(Is),regexp:ge(Is),escape:ge(Is),color:ge(Is),url:ge(Is),keyword:pa,self:ge(pa),null:ge(pa),atom:ge(pa),unit:ge(pa),modifier:ge(pa),operatorKeyword:ge(pa),controlKeyword:ge(pa),definitionKeyword:ge(pa),moduleKeyword:ge(pa),operator:ma,derefOperator:ge(ma),arithmeticOperator:ge(ma),logicOperator:ge(ma),bitwiseOperator:ge(ma),compareOperator:ge(ma),updateOperator:ge(ma),definitionOperator:ge(ma),typeOperator:ge(ma),controlOperator:ge(ma),punctuation:Mh,separator:ge(Mh),bracket:Bc,angleBracket:ge(Bc),squareBracket:ge(Bc),paren:ge(Bc),brace:ge(Bc),content:ya,heading:ki,heading1:ge(ki),heading2:ge(ki),heading3:ge(ki),heading4:ge(ki),heading5:ge(ki),heading6:ge(ki),contentSeparator:ge(ya),list:ge(ya),quote:ge(ya),emphasis:ge(ya),strong:ge(ya),link:ge(ya),monospace:ge(ya),strikethrough:ge(ya),inserted:ge(),deleted:ge(),changed:ge(),invalid:ge(),meta:wo,documentMeta:ge(wo),annotation:ge(wo),processingInstruction:ge(wo),definition:zl.defineModifier("definition"),constant:zl.defineModifier("constant"),function:zl.defineModifier("function"),standard:zl.defineModifier("standard"),local:zl.defineModifier("local"),special:zl.defineModifier("special")};for(let a in ke){let l=ke[a];l instanceof zl&&(l.name=a)}ny([{tag:ke.link,class:"tok-link"},{tag:ke.heading,class:"tok-heading"},{tag:ke.emphasis,class:"tok-emphasis"},{tag:ke.strong,class:"tok-strong"},{tag:ke.keyword,class:"tok-keyword"},{tag:ke.atom,class:"tok-atom"},{tag:ke.bool,class:"tok-bool"},{tag:ke.url,class:"tok-url"},{tag:ke.labelName,class:"tok-labelName"},{tag:ke.inserted,class:"tok-inserted"},{tag:ke.deleted,class:"tok-deleted"},{tag:ke.literal,class:"tok-literal"},{tag:ke.string,class:"tok-string"},{tag:ke.number,class:"tok-number"},{tag:[ke.regexp,ke.escape,ke.special(ke.string)],class:"tok-string2"},{tag:ke.variableName,class:"tok-variableName"},{tag:ke.local(ke.variableName),class:"tok-variableName tok-local"},{tag:ke.definition(ke.variableName),class:"tok-variableName tok-definition"},{tag:ke.special(ke.variableName),class:"tok-variableName2"},{tag:ke.definition(ke.propertyName),class:"tok-propertyName tok-definition"},{tag:ke.typeName,class:"tok-typeName"},{tag:ke.namespace,class:"tok-namespace"},{tag:ke.className,class:"tok-className"},{tag:ke.macroName,class:"tok-macroName"},{tag:ke.propertyName,class:"tok-propertyName"},{tag:ke.operator,class:"tok-operator"},{tag:ke.comment,class:"tok-comment"},{tag:ke.meta,class:"tok-meta"},{tag:ke.invalid,class:"tok-invalid"},{tag:ke.punctuation,class:"tok-punctuation"}]);const p1="modulepreload",m1=function(a,l){return new URL(a,l).href},Vb={},Ye=function(l,i,c){let o=Promise.resolve();if(i&&i.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 p=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),x=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(i.map(y=>{if(y=m1(y,c),y in Vb)return;Vb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let L=p.length-1;L>=0;L--){const U=p[L];if(U.href===y&&(!j||U.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":p1,j||(k.as="script"),k.crossOrigin="",k.href=y,x&&k.setAttribute("nonce",x),document.head.appendChild(k),j)return new Promise((L,U)=>{k.addEventListener("load",L),k.addEventListener("error",()=>U(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return o.then(h=>{for(const p of h||[])p.status==="rejected"&&d(p.reason);return l().catch(d)})},ly={js:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Ye(async()=>{const{javascript:a}=await import("./index-NZmn_bzd.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Ye(async()=>{const{json:a}=await import("./index-yzGIJ5xe.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Ye(async()=>{const{json:a}=await import("./index-yzGIJ5xe.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Ye(async()=>{const{css:a}=await import("./index-CNmvdMxt.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Ye(async()=>{const{css:a}=await import("./index-CNmvdMxt.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Ye(async()=>{const{css:a}=await import("./index-CNmvdMxt.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Ye(async()=>{const{html:a}=await import("./index-cSZKYcZu.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Ye(async()=>{const{html:a}=await import("./index-cSZKYcZu.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Ye(async()=>{const{html:a}=await import("./index-cSZKYcZu.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Ye(async()=>{const{html:a}=await import("./index-cSZKYcZu.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Ye(async()=>{const{markdown:a}=await import("./index-C3yVGgV2.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Ye(async()=>{const{markdown:a}=await import("./index-C3yVGgV2.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Ye(async()=>{const{python:a}=await import("./index-ClY-NTKp.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Ye(async()=>{const{python:a}=await import("./index-ClY-NTKp.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Ye(async()=>{const{yaml:a}=await import("./index-AUibZMHd.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Ye(async()=>{const{yaml:a}=await import("./index-AUibZMHd.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Ye(async()=>{const{rust:a}=await import("./index-u3kUuJkV.js");return{rust:a}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Ye(async()=>{const{cpp:a}=await import("./index-B7Kjuy7B.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Ye(async()=>{const{cpp:a}=await import("./index-B7Kjuy7B.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Ye(async()=>{const{cpp:a}=await import("./index-B7Kjuy7B.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Ye(async()=>{const{cpp:a}=await import("./index-B7Kjuy7B.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Ye(async()=>{const{cpp:a}=await import("./index-B7Kjuy7B.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Ye(async()=>{const{java:a}=await import("./index-CZMbzOzb.js");return{java:a}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Ye(async()=>{const{go:a}=await import("./index-vmz_RdEe.js");return{go:a}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Ye(async()=>{const{php:a}=await import("./index-nV6tsVmQ.js");return{php:a}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Ye(async()=>{const{sql:a}=await import("./index-BCiq-pRA.js");return{sql:a}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Ye(async()=>{const{xml:a}=await import("./index-CT4Ig6AX.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Ye(async()=>{const{xml:a}=await import("./index-CT4Ig6AX.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},g1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},b1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function x1(a){const l=b1[a.toLowerCase()]??a.toLowerCase(),i=ly[l];return i?i().catch(()=>null):null}async function y1(a){const l=(a.split("/").pop()??"").toLowerCase(),i=g1[l]??l.split(".").pop()??"",c=ly[i];return c?c().catch(()=>null):null}const _1=ny([{tag:[ke.keyword,ke.modifier,ke.controlKeyword,ke.moduleKeyword],class:"cmh-key"},{tag:[ke.propertyName],class:"cmh-prop"},{tag:[ke.function(ke.variableName),ke.labelName],class:"cmh-fn"},{tag:[ke.color,ke.constant(ke.name),ke.standard(ke.name),ke.bool],class:"cmh-const"},{tag:[ke.typeName,ke.className,ke.changed,ke.annotation,ke.self,ke.namespace],class:"cmh-type"},{tag:[ke.number,ke.integer,ke.float],class:"cmh-num"},{tag:[ke.string,ke.special(ke.string),ke.regexp],class:"cmh-str"},{tag:[ke.operator,ke.operatorKeyword,ke.escape],class:"cmh-op"},{tag:[ke.meta,ke.comment],class:"cmh-comment"},{tag:ke.invalid,class:"cmh-invalid"}]);function To(a){return a.replace(/[&<>]/g,l=>l==="&"?"&amp;":l==="<"?"&lt;":"&gt;")}async function v1(a,l){const i=l?await x1(l):null;if(!i)return To(a);try{const c=i.language.parser.parse(a);let o="";return f1(a,c,_1,(d,h)=>{o+=h?`<span class="${h}">${To(d)}</span>`:To(d)},()=>{o+=`
117
- `}),o}catch{return To(a)}}gt.setOptions({gfm:!0,breaks:!1});function ay(a){var i;const l=(i=a.split(".").pop())==null?void 0:i.toLowerCase();return l==="md"||l==="markdown"}async function Kh(a){const l=await gt.parse(a,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const c=i;c.text=await v1(c.text,c.lang??""),c.escaped=!0}});return Xv.sanitize(l)}function $b(a,l){return{path:a.path,text:a.content,saved:a.content,eol:a.eol,encoding:a.encoding,mtime:a.mtime,size:a.size,binary:a.binary,tooLarge:a.tooLarge,mediaMime:a.mediaMime,mediaTooLarge:a.mediaTooLarge,stale:!1,revision:l,previewMode:ay(a.path)}}function ts(a){return!a.binary&&!a.tooLarge&&a.text!==a.saved}function S1(a){return a.split("/").pop()??a}function Di(a){const l=a.lastIndexOf("/");return l===-1?"":a.slice(0,l)}function Ho(a){return a<1024?`${a} Б`:a<1024*1024?`${(a/1024).toFixed(1)} КБ`:`${(a/1024/1024).toFixed(1)} МБ`}function Xc({x:a,y:l,items:i,note:c,onClose:o}){const d=_.useRef(null),[h,p]=_.useState({left:a,top:l}),[m,x]=_.useState(()=>{const v=i.findIndex(C=>!C.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),k=8,L=Math.max(k,Math.min(a,window.innerWidth-C.width-k)),U=Math.max(k,Math.min(l,window.innerHeight-C.height-k));p({left:L,top:U})},[a,l]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(k){var L;(L=d.current)!=null&&L.contains(k.target)||o()}function C(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",C,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=i.map((k,L)=>({item:k,index:L})).filter(k=>!k.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const k=v.key==="ArrowDown"?1:-1,L=C.findIndex(P=>P.index===m),U=C[(((L===-1?0:L)+k)%C.length+C.length)%C.length];U&&x(U.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const k=i[m];k&&y(k)}}}return r.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&r.jsx("div",{className:"ctxmenu__note",children:c}),i.map((v,C)=>r.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===m?" is-cursor":""),onMouseEnter:()=>x(C),onClick:()=>y(v),children:[r.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&r.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const j1=3500,k1=9e3,Qb=220;function Hi({result:a,onDismiss:l}){const[i,c]=_.useState(a),[o,d]=_.useState(!1);if(_.useEffect(()=>{if(!a){c(null),d(!1);return}if(c(a),d(!1),a.url)return;const p=a.ok?j1:k1,m=setTimeout(()=>d(!0),p),x=setTimeout(()=>c(null),p+Qb);return()=>{clearTimeout(m),clearTimeout(x)}},[a]),!i)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Qb)};return r.jsxs("div",{className:"oplog "+(i.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(i.url?" oplog--dismissible":""),role:"status","aria-live":i.ok?"polite":"assertive",children:[i.message,i.url&&r.jsxs("a",{className:"oplog__link",href:i.url,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),children:[i.url.replace(/^https?:\/\//,"")," ↗"]}),i.url&&l&&r.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Jc({value:a,className:l,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[d,h]=_.useState(a),p=_.useRef(null);_.useEffect(()=>{var x;(x=p.current)==null||x.select()},[]);function m(){const x=d.trim();if(!x||x===a)return o();c(x)}return r.jsx("input",{ref:p,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:x=>h(x.target.value),onBlur:m,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),m()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Ir({active:a}){return a?r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M2 5h3V2"}),r.jsx("path",{d:"M14 5h-3V2"}),r.jsx("path",{d:"M2 11h3v3"}),r.jsx("path",{d:"M14 11h-3v3"})]}):r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M5 2H2v3"}),r.jsx("path",{d:"M11 2h3v3"}),r.jsx("path",{d:"M2 11v3h3"}),r.jsx("path",{d:"M14 11v3h-3"})]})}const N1=500,Ni="application/x-ccv-fs-path",w1=200;function T1({open:a,tree:l,expanded:i,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:p,onSearch:m,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:C,onMove:k,onCopy:L,onDelete:U,onRefresh:P,onClose:M,zoomed:Q,onToggleZoom:w}){const[K,z]=_.useState(""),[A,V]=_.useState(null),[te,oe]=_.useState(null),[F,ae]=_.useState(null),[me,Ae]=_.useState(null),[be,H]=_.useState(null),[re,se]=_.useState(null),pe=Zo("(hover: hover)"),Ne=_.useRef(null),N=_.useMemo(()=>C1(d),[d]);function $(E){return!(!F||E===F.path||F.kind==="dir"&&E.startsWith(`${F.path}/`)||E===Di(F.path))}function ce(E){return!(!be||E===be.path||be.kind==="dir"&&E.startsWith(`${be.path}/`)||be.mode==="cut"&&E===Di(be.path))}function he(E){H({path:E.path,kind:E.kind,mode:"copy"})}function we(E){H({path:E.path,kind:E.kind,mode:"cut"})}function ye(E){!be||!ce(E)||(E&&!i.has(E)&&y(E),be.mode==="cut"?(k(be.path,E),H(null)):L(be.path,E))}function Me(E,Y){const _e=E.touches[0];if(!_e)return;const O={timer:0,x:_e.clientX,y:_e.clientY,el:E.currentTarget,fired:!1};O.timer=window.setTimeout(()=>{O.fired=!0,Y(O.x,O.y,O.el)},N1),Ne.current=O}function at(E){const Y=Ne.current,_e=E.touches[0];!Y||!_e||Math.hypot(_e.clientX-Y.x,_e.clientY-Y.y)>10&&(window.clearTimeout(Y.timer),Ne.current=null)}function Ve(E){const Y=Ne.current;Y&&(window.clearTimeout(Y.timer),Y.fired&&E.preventDefault())}function Mt(){var E;return(E=Ne.current)!=null&&E.fired?(Ne.current=null,!0):!1}function Ie(E,Y,_e,O){z((O==null?void 0:O.path)??""),se({x:E,y:Y,opener:_e,entry:O})}function bt(){const E=re==null?void 0:re.opener;se(null),E!=null&&E.isConnected&&E.focus()}function We(E){return{onContextMenu:Y=>{Y.preventDefault(),Ie(Y.clientX,Y.clientY,Y.currentTarget,E)},onTouchStart:Y=>Me(Y,(_e,O,J)=>Ie(_e,O,J,E)),onTouchMove:at,onTouchEnd:Ve,onTouchCancel:Ve}}function Ze(E){E.target===E.currentTarget&&(E.preventDefault(),Ie(E.clientX,E.clientY,E.currentTarget,null))}function Ke(E){E.target===E.currentTarget&&Me(E,(Y,_e,O)=>Ie(Y,_e,O,null))}function st(E){if(!(E.ctrlKey||E.metaKey)||E.target instanceof HTMLInputElement)return;const Y=E.key.toLowerCase();if(Y==="v"){E.preventDefault(),ye(cn());return}if(!K)return;const _e=Zb(l,K);_e&&(Y==="c"?(E.preventDefault(),he(_e)):Y==="x"&&(E.preventDefault(),we(_e)))}function Jn(E){return Y=>{Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData(Ni,E.path),ae({path:E.path,kind:E.kind})}}function Ht(){ae(null),Ae(null)}function Bt(E){return Y=>{Y.dataTransfer.types.includes(Ni)&&(Y.stopPropagation(),!(E.kind!=="dir"||!$(E.path))&&(Y.preventDefault(),Ae(E.path)))}}function Qt(E){return Y=>{if(!Y.dataTransfer.types.includes(Ni)||(Y.stopPropagation(),E.kind!=="dir"||!$(E.path)))return;Y.preventDefault();const _e=Y.dataTransfer.getData(Ni);Ae(null),_e&&k(_e,E.path)}}function qt(E){!E.dataTransfer.types.includes(Ni)||!$("")||(E.preventDefault(),Ae(""))}function It(E){if(!E.dataTransfer.types.includes(Ni)||!$(""))return;E.preventDefault();const Y=E.dataTransfer.getData(Ni);Ae(null),Y&&k(Y,"")}const[Xt,it]=_.useState(""),Nt=Xt.trim(),Pt=Nt.length>0,wn=_.useRef(null),At=_.useRef(m);At.current=m;function vn(E){it(E),wn.current&&clearTimeout(wn.current);const Y=E.trim();if(!Y){At.current("");return}wn.current=setTimeout(()=>At.current(Y),w1)}function Tn(E){wn.current&&clearTimeout(wn.current),it(""),At.current(""),z(E.path),x(E)}const Ot=Pt&&(p==null?void 0:p.query)===Nt?p:null;function cn(){if(K==="")return"";const E=Zb(l,K);if((E==null?void 0:E.kind)==="dir")return K;const Y=K.lastIndexOf("/");return Y===-1?"":K.slice(0,Y)}function Zt(E,Y){const _e=Y??cn();_e&&!i.has(_e)&&y(_e),oe({parent:_e,kind:E})}function wt(){if(!re)return[];const E=O=>pe?O:void 0;if(!re.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:E("Ctrl+V"),disabled:!ce(""),onSelect:()=>ye("")},{id:"new-file",label:"Создать файл",onSelect:()=>Zt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Zt("dir","")}];const Y=re.entry,_e=[Y.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(Y.path)}:{id:"toggle",label:i.has(Y.path)?"Свернуть":"Развернуть",onSelect:()=>y(Y.path)},{id:"copy",label:"Копировать",hint:E("Ctrl+C"),onSelect:()=>he(Y)},{id:"cut",label:"Вырезать",hint:E("Ctrl+X"),onSelect:()=>we(Y)}];return Y.kind==="dir"&&(_e.push({id:"paste",label:"Вставить",hint:E("Ctrl+V"),disabled:!ce(Y.path),onSelect:()=>ye(Y.path)}),_e.push({id:"new-file",label:"Создать файл",onSelect:()=>Zt("file",Y.path)}),_e.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Zt("dir",Y.path)})),_e.push({id:"rename",label:"Переименовать",onSelect:()=>V(Y.path)}),_e.push({id:"delete",label:"Удалить",onSelect:()=>U(Y)}),_e}const un=Pt?[]:ut("",0);function ut(E,Y){const _e=l[E],O=[];if(te&&te.parent===E&&O.push(r.jsxs("div",{className:"fsrow fsrow--draft",style:ns(Y),children:[r.jsx("span",{className:"fsrow__icon",children:te.kind==="dir"?r.jsx(Vo,{}):r.jsx($o,{})}),r.jsx(Jc,{className:"rename--file",value:"",placeholder:te.kind==="dir"?"имя каталога":"имя файла",onCommit:J=>{oe(null),v(E,te.kind,J)},onCancel:()=>oe(null)})]},`draft:${E}`)),!_e)return O.push(r.jsx("p",{className:"fsrow__pending",style:ns(Y),children:"читаем…"},`wait:${E}`)),O;_e.length===0&&!te&&O.push(r.jsx("p",{className:"fsrow__pending",style:ns(Y),children:"пусто"},`empty:${E}`));for(const J of _e){const xe=J.kind==="dir"&&i.has(J.path);O.push(A===J.path?r.jsxs("div",{className:"fsrow fsrow--draft",style:ns(Y),children:[r.jsx("span",{className:"fsrow__icon",children:J.kind==="dir"?r.jsx(Vo,{open:xe}):r.jsx($o,{})}),r.jsx(Jc,{className:"rename--file",value:J.name,placeholder:"новое имя",onCommit:qe=>{V(null),C(J.path,qe)},onCancel:()=>V(null)})]},J.path):r.jsx(E1,{entry:J,depth:Y,open:xe,active:J.path===c,selected:J.path===K,dirty:o.has(J.path),gitStatus:N.get(J.path),dragging:(F==null?void 0:F.path)===J.path,dropTarget:me===J.path,cut:(be==null?void 0:be.mode)==="cut"&&be.path===J.path,onClick:()=>{Mt()||(z(J.path),J.kind==="dir"?y(J.path):j(J.path))},onRename:()=>V(J.path),onDelete:()=>U(J),onDragStart:Jn(J),onDragEnd:Ht,onDragOver:Bt(J),onDrop:Qt(J),...We(J)},J.path)),xe&&O.push(...ut(J.path,Y+1))}return O}function en(){if(!Ot)return[r.jsx("p",{className:"fsrow__pending",style:ns(0),children:"ищем…"},"search:wait")];if(Ot.entries.length===0)return[r.jsx("p",{className:"fsrow__pending",style:ns(0),children:"ничего не найдено"},"search:empty")];const E=Ot.entries.map(Y=>r.jsx(A1,{entry:Y,gitStatus:N.get(Y.path),onClick:()=>Tn(Y)},Y.path));return Ot.truncated&&E.push(r.jsxs("p",{className:"fsrow__pending",style:ns(0),children:["показаны первые ",Ot.entries.length," — уточните запрос"]},"search:truncated")),E}return r.jsxs("aside",{className:(a?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Q?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:st,children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:E=>{w&&(E.target.closest("button")||w())},children:[r.jsx(D1,{}),r.jsx("span",{className:"sidepane__title",children:"Файлы"}),r.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Zt("file"),children:r.jsx(M1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Zt("dir"),children:r.jsx(O1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:P,children:"↻"}),w&&r.jsx("button",{className:"sidepane__btn",title:Q?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Q?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Q,onClick:w,children:r.jsx(Ir,{active:Q})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:M,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(z1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:Xt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:E=>vn(E.target.value),onKeyDown:E=>{E.stopPropagation(),E.key==="Escape"&&(E.preventDefault(),Xt?vn(""):E.currentTarget.blur())}}),Xt&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>vn(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree"+(me===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:qt,onDrop:It,onContextMenu:Ze,onTouchStart:Ke,onTouchMove:at,onTouchEnd:Ve,onTouchCancel:Ve,children:Pt?en():un}),r.jsx(Hi,{result:h}),re&&r.jsx(Xc,{x:re.x,y:re.y,items:wt(),onClose:bt})]})}function E1({entry:a,depth:l,open:i,active:c,selected:o,dirty:d,gitStatus:h,dragging:p,dropTarget:m,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:C,onDragEnd:k,onDragOver:L,onDrop:U,onContextMenu:P,onTouchStart:M,onTouchMove:Q,onTouchEnd:w,onTouchCancel:K}){const z="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(a.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(m?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return r.jsxs("div",{className:z,style:ns(l),draggable:!0,onDragStart:C,onDragEnd:k,onDragOver:L,onDrop:U,onContextMenu:P,onTouchStart:M,onTouchMove:Q,onTouchEnd:w,onTouchCancel:K,children:[r.jsxs("button",{className:"fsrow__main",onClick:y,title:sy(a),children:[r.jsx("span",{className:"fsrow__icon"+Xo("fsrow__icon",h),children:a.kind==="dir"?r.jsx(Vo,{open:i}):r.jsx($o,{})}),r.jsx("span",{className:"fsrow__name"+Xo("fsrow__name",h),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&r.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),r.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${a.name}`,onClick:j,children:"✎"}),r.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${a.name}`,onClick:v,children:"✕"})]})}function A1({entry:a,gitStatus:l,onClick:i}){const c=a.path.slice(0,a.path.length-a.name.length-1);return r.jsxs("button",{className:"fsrow fsrow--search"+(a.ignored?" fsrow--ignored":""),style:ns(0),onClick:i,title:sy(a),children:[r.jsx("span",{className:"fsrow__icon"+Xo("fsrow__icon",l),children:a.kind==="dir"?r.jsx(Vo,{}):r.jsx($o,{})}),r.jsx("span",{className:"fsrow__name"+Xo("fsrow__name",l),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&r.jsx("span",{className:"fsrow__path",children:c})]})}function sy(a){return a.ignored?`${a.path} — игнорируется git (.gitignore)`:a.path}function ns(a){return{"--depth":a}}function Zb(a,l){var o;const i=l.lastIndexOf("/"),c=i===-1?"":l.slice(0,i);return((o=a[c])==null?void 0:o.find(d=>d.path===l))??null}function C1(a){const l=new Map,i={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||i[d]>i[h])&&l.set(o,d)};for(const o of a){const d=R1(o.status);if(!d)continue;c(o.path,d);let h=Di(o.path);for(;c(h,d),!!h;)h=Di(h)}return l}function R1(a){if(a==="??")return"added";const[l="",i=""]=a;return l==="A"||l==="R"||l==="C"?"added":l==="M"||i==="M"?"modified":null}function Xo(a,l){return l?` ${a}--git-${l}`:""}function Vo({open:a=!1}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:a?r.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"}):r.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 $o(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]})}function M1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function O1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:r.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"})}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function D1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.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"}),r.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 z1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const L1=200;function U1({open:a,result:l,onSearch:i,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[p,m]=_.useState(""),x=p.trim(),y=x.length>0,j=_.useRef(null),v=_.useRef(i);v.current=i;function C(U){m(U),j.current&&clearTimeout(j.current);const P=U.trim();if(!P){v.current("");return}j.current=setTimeout(()=>v.current(P),L1)}const k=y&&(l==null?void 0:l.query)===x?l:null;function L(){if(!k)return[r.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[r.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const U=[];let P="";for(const M of k.matches)M.path!==P&&(P=M.path,U.push(r.jsx("p",{className:"searchgroup__path",title:M.path,children:M.path},`path:${M.path}`))),U.push(r.jsx(H1,{match:M,onClick:()=>c(M)},`${M.path}:${M.line}:${M.column}`));return k.truncated&&U.push(r.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),U}return r.jsxs("aside",{className:(a?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:U=>{h&&(U.target.closest("button")||h())},children:[r.jsx(B1,{}),r.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&r.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Ir,{active:d})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(q1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:U=>C(U.target.value),onKeyDown:U=>{U.stopPropagation(),U.key==="Escape"&&(U.preventDefault(),p?C(""):U.currentTarget.blur())}}),p&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree",children:y?L():r.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function H1({match:a,onClick:l}){const i=a.lineText.slice(0,a.column-1),c=a.lineText.slice(a.column-1,a.column-1+a.matchLength),o=a.lineText.slice(a.column-1+a.matchLength);return r.jsxs("button",{className:"searchmatch",onClick:l,title:`${a.path}:${a.line}`,children:[r.jsx("span",{className:"searchmatch__line",children:a.line}),r.jsxs("span",{className:"searchmatch__text",children:[i,r.jsx("mark",{children:c}),o]})]})}function B1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function q1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Eo=null;function I1(){return Eo||(Eo=Promise.all([Ye(()=>import("./index-Cw4Jg8_d.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Ye(()=>import("./index-891wE-Rj.js").then(a=>a.v),__vite__mapDeps([4,3]),import.meta.url),Ye(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Ye(()=>import("./index-BaxFm2-f.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ye(()=>import("./codemirror-DKsnpugS.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([a,l,i,c,o])=>({EditorView:l.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:a.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(a=>{throw Eo=null,a})),Eo}function G1({path:a,doc:l,revision:i,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),p=_.useRef(null),m=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),C=_.useRef(o),k=_.useRef(d),L=_.useRef(a),U=_.useRef(i),P=_.useRef(l);C.current=o,k.current=d,L.current=a,U.current=i,P.current=l;const[M,Q]=_.useState("loading"),[w,K]=_.useState(!1);function z(V,te,oe,F,ae){const me=x.current.get(F),Ae=y.current.get(F)===ae;if(me&&Ae)oe.setState(me);else{const H=V.EditorState.create({doc:P.current,extensions:[V.basicSetup,V.Prec.highest(V.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(L.current),!0)}])),V.keymap.of([V.indentWithTab]),te.of([]),V.editorTheme,V.editorHighlight,V.EditorView.updateListener.of(re=>{re.docChanged&&C.current(L.current,re.state.doc.toString())})]});x.current.set(F,H),y.current.set(F,ae),oe.setState(H),j.current.delete(F)}if(j.current.has(F))return()=>{};let be=!1;return y1(F).then(H=>{be||!H||L.current!==F||(oe.dispatch({effects:te.reconfigure(H)}),x.current.set(F,oe.state),j.current.add(F))}),()=>{be=!0}}_.useEffect(()=>{if(!h.current)return;let te=!1,oe=null,F=null;Q("loading"),K(!1);const ae=window.setTimeout(()=>{te||K(!0)},200);return(async()=>{let me;try{me=await I1()}catch{window.clearTimeout(ae),te||Q("error");return}if(te||!h.current)return;window.clearTimeout(ae);const Ae=new me.Compartment;v.current=Ae,m.current=me,F=new me.EditorView({parent:h.current}),p.current=F,oe=z(me,Ae,F,L.current,U.current),Q("ready")})(),()=>{te=!0,window.clearTimeout(ae),oe==null||oe(),F==null||F.destroy(),p.current===F&&(p.current=null),m.current=null,v.current=null}},[]),_.useEffect(()=>{const V=m.current,te=p.current,oe=v.current;if(!(!V||!te||!oe))return z(V,oe,te,a,i)},[a,i]);const A=_.useRef(0);return _.useEffect(()=>{const V=p.current,te=m.current;if(!V||!te||!c||c.token===A.current)return;A.current=c.token;const oe=V.state.doc.lines,F=Math.min(Math.max(c.line,1),oe),ae=V.state.doc.line(F),me=Math.min(ae.from+Math.max(c.column-1,0),ae.to);V.dispatch({selection:te.EditorSelection.cursor(me),effects:te.EditorView.scrollIntoView(me,{y:"center"})}),V.focus()},[c]),_.useEffect(()=>()=>{const V=p.current;V&&x.current.set(a,V.state)},[a]),r.jsxs("div",{className:"editor__code",children:[r.jsx("div",{ref:h,className:"editor__code-surface"+(M==="ready"?"":" is-hidden")}),M==="loading"&&w&&r.jsxs("div",{className:"editor__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),M==="error"&&r.jsxs("div",{className:"editor__fallback",children:[r.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[r.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),r.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),r.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function ja({value:a,options:l,onChange:i,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[p,m]=_.useState(!1),[x,y]=_.useState(0),j=_.useRef(null),v=_.useRef(null),C=l.find(U=>U.value===a)??null;_.useEffect(()=>{if(!p)return;const U=l.findIndex(P=>P.value===a);y(U===-1?0:U)},[p]),_.useEffect(()=>{if(!p)return;function U(P){var M;(M=j.current)!=null&&M.contains(P.target)||m(!1)}return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[p]),_.useEffect(()=>{var U,P;p&&((P=(U=v.current)==null?void 0:U.querySelector(".is-cursor"))==null||P.scrollIntoView({block:"nearest"}))},[p,x]),_.useEffect(()=>{if(!p)return;const U=v.current,P=Y1(j.current);if(!U||!P)return;const M=U.getBoundingClientRect().bottom-P.getBoundingClientRect().bottom;M>0&&(P.scrollTop+=Math.min(M+8,U.offsetHeight))},[p]);function k(U){m(!1),U.value!==a&&i(U.value)}function L(U){if(U.key==="Escape"){if(!p)return;U.preventDefault(),U.stopPropagation(),m(!1);return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){if(U.preventDefault(),!p)return m(!0);const P=U.key==="ArrowDown"?1:l.length-1;return y(M=>(M+P)%l.length)}if(U.key==="Enter"||U.key===" "){if(U.preventDefault(),!p)return m(!0);const P=l[x];P&&k(P)}}return r.jsxs("div",{ref:j,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(U=>!U),onKeyDown:L,children:[r.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),r.jsx(X1,{})]}),p&&r.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((U,P)=>r.jsxs("button",{type:"button",role:"option","aria-selected":U.value===a,className:"select__option"+(P===x?" is-cursor":"")+(U.value===a?" is-on":""),onMouseEnter:()=>y(P),onClick:()=>k(U),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:U.value===a?"✓":""}),r.jsx("span",{className:"select__label",children:U.label}),U.hint&&r.jsx("span",{className:"select__hint",children:U.hint})]},U.value))})]})}function Y1(a){let l=(a==null?void 0:a.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function X1(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function V1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),r.jsx("path",{d:"M9.7 9.7 14 14"}),r.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function $1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),r.jsx("path",{d:"M9.7 9.7 14 14"}),r.jsx("path",{d:"M4.6 6.6h4"})]})}function Q1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),r.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function Z1({path:a,mime:l,base64:i,error:c,tooLarge:o,size:d,onRequestMedia:h}){_.useEffect(()=>{!o&&i===void 0&&c===void 0&&h(a)},[]);const p=K1(i,l);return o?r.jsx("div",{className:"mediaview mediaview--message",children:r.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Ho(d),"). Лимит — 64 МБ."]})}):c?r.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[r.jsx("p",{className:"mediaview__error",children:c}),r.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(a),children:"Повторить"})]}):p?l.startsWith("image/")?r.jsx(F1,{url:p}):l.startsWith("video/")?r.jsx(P1,{url:p}):null:r.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[r.jsx("div",{className:"mediaview__progress",children:r.jsx("div",{className:"mediaview__progress-fill"})}),r.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function K1(a,l){const[i,c]=_.useState(null);return _.useEffect(()=>{if(a===void 0){c(null);return}const o=atob(a),d=new Uint8Array(o.length);for(let p=0;p<o.length;p++)d[p]=o.charCodeAt(p);const h=URL.createObjectURL(new Blob([d],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[a,l]),i}const Bs=1,iy=8,Ao=1.25;function J1(a){return Math.min(iy,Math.max(Bs,a))}function F1({url:a}){const[l,i]=_.useState({scale:Bs,x:0,y:0}),[c,o]=_.useState(!1),d=_.useRef(null),h=_.useRef(null);function p(C,k,L){i(U=>{const P=J1(U.scale*C);if(P===U.scale)return U;if(P<=Bs)return{scale:Bs,x:0,y:0};const M=(k-U.x)/U.scale,Q=(L-U.y)/U.scale;return{scale:P,x:k-P*M,y:L-P*Q}})}_.useEffect(()=>{const C=d.current;if(!C)return;function k(L){L.preventDefault();const U=C.getBoundingClientRect(),P=L.clientX-U.left-U.width/2,M=L.clientY-U.top-U.height/2;p(L.deltaY<0?Ao:1/Ao,P,M)}return C.addEventListener("wheel",k,{passive:!1}),()=>C.removeEventListener("wheel",k)},[]);function m(C){l.scale<=Bs||(C.currentTarget.setPointerCapture(C.pointerId),h.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,origX:l.x,origY:l.y},o(!0))}function x(C){const k=h.current;!k||k.pointerId!==C.pointerId||i(L=>({...L,x:k.origX+(C.clientX-k.startX),y:k.origY+(C.clientY-k.startY)}))}function y(){h.current=null,o(!1)}const j=l.scale>Bs,v=!j&&l.x===0&&l.y===0;return r.jsxs("div",{className:"mediaview mediaview--image",children:[r.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:m,onPointerMove:x,onPointerUp:y,onPointerCancel:y,children:r.jsx("img",{src:a,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),r.jsxs("div",{className:"mediaview__toolbar",children:[r.jsx("button",{className:"btn btn--sm",disabled:l.scale<=Bs,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>p(1/Ao,0,0),children:r.jsx($1,{})}),r.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),r.jsx("button",{className:"btn btn--sm",disabled:l.scale>=iy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>p(Ao,0,0),children:r.jsx(V1,{})}),r.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>i({scale:Bs,x:0,y:0}),children:r.jsx(Q1,{})})]})]})}const W1=[{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 P1({url:a}){const l=_.useRef(null),[i,c]=_.useState("1");return _.useEffect(()=>{l.current&&(l.current.playbackRate=Number(i))},[i]),r.jsxs("div",{className:"mediaview mediaview--video",children:[r.jsx("video",{ref:l,className:"mediaview__video",src:a,controls:!0}),r.jsxs("div",{className:"mediaview__speedbar",children:[r.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),r.jsx(ja,{className:"mediaview__speedselect",value:i,onChange:c,ariaLabel:"Скорость воспроизведения",options:W1})]})]})}function eS({file:a,goto:l,onChange:i,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:p}){const m=ts(a),x=ay(a.path)&&!a.binary&&!a.tooLarge;return r.jsxs("div",{className:"editor",children:[r.jsxs("div",{className:"editor__bar",children:[r.jsx("span",{className:"editor__path",title:a.path,children:a.path}),r.jsxs("span",{className:"editor__meta",children:[Ho(a.size),a.eol==="crlf"&&" · CRLF"]}),x&&r.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[r.jsx("button",{className:"btn btn--sm"+(a.previewMode?" is-on":""),role:"tab","aria-selected":a.previewMode,onClick:()=>!a.previewMode&&p(a.path),children:"Просмотр"}),r.jsx("button",{className:"btn btn--sm"+(a.previewMode?"":" is-on"),role:"tab","aria-selected":!a.previewMode,onClick:()=>a.previewMode&&p(a.path),children:"Код"})]}),r.jsx("button",{className:"btn btn--sm",disabled:!m,title:"Сохранить (Ctrl+S)",onClick:()=>c(a.path),children:m?"Сохранить":"Сохранено"})]}),a.stale&&r.jsxs("div",{className:"editor__warn",children:[r.jsxs("span",{children:["Файл изменился на диске",m?" — а здесь есть несохранённые правки.":"."]}),r.jsx("button",{className:"btn btn--sm",onClick:()=>o(a.path),children:"Взять с диска"}),m&&r.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(a.path),children:"Сохранить поверх"})]}),a.binary&&a.mediaMime?r.jsx(Z1,{path:a.path,mime:a.mediaMime,base64:a.mediaBase64,error:a.mediaError,tooLarge:a.mediaTooLarge,size:a.size,onRequestMedia:h},a.path):a.binary?r.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Ho(a.size)," на диске."]}):a.tooLarge?r.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Ho(a.size),"). Такие правит агент, а не браузер."]}):x&&a.previewMode?r.jsx(tS,{text:a.text}):r.jsx(G1,{path:a.path,doc:a.text,revision:a.revision,goto:l,onChange:i,onSave:c})]})}function tS({text:a}){const[l,i]=_.useState("");return _.useEffect(()=>{let c=!1;return Kh(a).then(o=>{c||i(o)}),()=>{c=!0}},[a]),r.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function nS({files:a,activePath:l,busy:i,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return r.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:p=>{h&&(p.target.closest("button")||h())},children:[r.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[r.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&r.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),a.map(p=>r.jsxs("div",{className:"worktab"+(p.path===l?" is-on":""),role:"tab","aria-selected":p.path===l,onDoubleClick:m=>{h&&(m.target.closest(".worktab__close, .worktab__dot")||h())},children:[r.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:S1(p.path)}),ts(p)?r.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path)}):r.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path),children:"✕"})]},p.path)),r.jsx("div",{className:"worktabs__spacer"}),h&&r.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Ir,{active:d})})]})}const ry="ccv:sidebar.collapsed",cy="ccv:sidebar.mode",lS=500,Kb="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function aS({open:a,connected:l,status:i,workspaces:c,sessions:o,archived:d,pinned:h,activeWorkspaceId:p,activeSessionId:m,onSelectWorkspace:x,onSelectSession:y,onRenameSession:j,onPinSessions:v,onSelectPinned:C,onCloseWorkspaces:k,onArchiveSessions:L,onUnarchiveSessions:U,onOpenWorkspace:P,onNewSession:M,onOpenExtensions:Q,account:w,onOpenAccount:K,relay:z,onOpenRelay:A,onOpenSettings:V,themeMode:te,onCycleTheme:oe}){const[F,ae]=_.useState(null),[me,Ae]=_.useState(""),[be,H]=_.useState(rS),[re,se]=_.useState(cS);function pe(){se(E=>{const Y=E==="pinned"?"default":"pinned";try{localStorage.setItem(cy,Y)}catch{}return Y})}const Ne=me.trim().toLowerCase(),N=Ne!=="",$=_.useMemo(()=>N?c.filter(E=>E.name.toLowerCase().includes(Ne)||E.path.toLowerCase().includes(Ne)):c,[c,Ne,N]),ce=_.useMemo(()=>N?o.filter(E=>(E.title??"").toLowerCase().includes(Ne)):o,[o,Ne,N]),he=_.useMemo(()=>N?d.filter(E=>(E.title??"").toLowerCase().includes(Ne)):d,[d,Ne,N]),we=E=>{var Y;return((Y=c.find(_e=>_e.id===E))==null?void 0:Y.name)??"—"},ye=E=>{var Y;return(Y=c.find(_e=>_e.id===E))==null?void 0:Y.path},Me=_.useMemo(()=>N?h.filter(E=>(E.title??"").toLowerCase().includes(Ne)||we(E.workspaceId).toLowerCase().includes(Ne)):h,[h,c,Ne,N]);function at(E){H(Y=>{const _e=Y.includes(E)?Y.filter(O=>O!==E):[...Y,E];try{localStorage.setItem(ry,JSON.stringify(_e))}catch{}return _e})}const Ve=E=>!be.includes(E),Mt=Fb($),Ie=Fb(ce),[bt,We]=_.useState(null),[Ze,Ke]=_.useState(null),[st,Jn]=_.useState(null),Ht=_.useRef(null);function Bt(E,Y){const _e=E.touches[0];if(!_e)return;const O={timer:0,x:_e.clientX,y:_e.clientY,el:E.currentTarget,fired:!1};O.timer=window.setTimeout(()=>{O.fired=!0,Y(O.x,O.y,O.el)},lS),Ht.current=O}function Qt(E){const Y=Ht.current,_e=E.touches[0];!Y||!_e||Math.hypot(_e.clientX-Y.x,_e.clientY-Y.y)>10&&(window.clearTimeout(Y.timer),Ht.current=null)}function qt(E){const Y=Ht.current;Y&&(window.clearTimeout(Y.timer),Y.fired&&E.preventDefault())}function It(){var E;return(E=Ht.current)!=null&&E.fired?(Ht.current=null,!0):!1}function Xt(){const E=bt==null?void 0:bt.opener;We(null),E!=null&&E.isConnected&&E.focus()}function it(){const E=Ze==null?void 0:Ze.opener;Ke(null),E!=null&&E.isConnected&&E.focus()}function Nt(){const E=st==null?void 0:st.opener;Jn(null),E!=null&&E.isConnected&&E.focus()}function Pt(E){return{onContextMenu:Y=>{Y.preventDefault(),We({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:Mt.targetsFor(E)})},onTouchStart:Y=>Bt(Y,(_e,O,J)=>We({x:_e,y:O,opener:J,ids:Mt.targetsFor(E)})),onTouchMove:Qt,onTouchEnd:qt,onTouchCancel:qt}}function wn(E){return{onContextMenu:Y=>{Y.preventDefault(),Ke({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:Ie.targetsFor(E)})},onTouchStart:Y=>Bt(Y,(_e,O,J)=>Ke({x:_e,y:O,opener:J,ids:Ie.targetsFor(E)})),onTouchMove:Qt,onTouchEnd:qt,onTouchCancel:qt}}function At(E){return{onContextMenu:Y=>{Y.preventDefault(),Jn({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:[E.id]})},onTouchStart:Y=>Bt(Y,(_e,O,J)=>Jn({x:_e,y:O,opener:J,ids:[E.id]})),onTouchMove:Qt,onTouchEnd:qt,onTouchCancel:qt}}const vn=o.filter(E=>E.state!=="closed").length,Tn=bt?[{id:"close",label:bt.ids.length>1?`Закрыть проекты (${bt.ids.length})`:"Закрыть проект",onSelect:()=>{k(bt.ids),Mt.clear()}}]:[],Ot=bt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(p&&bt.ids.includes(p)&&vn>0?` в нём сейчас незавершённых сессий: ${vn} — при закрытии они остановятся на хосте.`:""):void 0,cn=Ze?ce.find(E=>E.id===Ze.ids[0]):void 0,Zt=(cn==null?void 0:cn.pinned)!==!0,wt=Ze?[...Ze.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>ae(Ze.ids[0])}]:[],{id:"pin",label:Zt?Ze.ids.length>1?`Закрепить (${Ze.ids.length})`:"Закрепить":Ze.ids.length>1?`Открепить (${Ze.ids.length})`:"Открепить",onSelect:()=>{cn&&v(cn.workspaceId,Ze.ids,Zt),Ie.clear()}},{id:"archive",label:Ze.ids.length>1?`Убрать в архив (${Ze.ids.length})`:"Убрать в архив",onSelect:()=>{L(p,Ze.ids),Ie.clear()}}]:[],un=Ze?Kb:void 0,ut=st?Me.find(E=>E.id===st.ids[0]):void 0,en=st?[{id:"rename",label:"Переименовать",onSelect:()=>ae(st.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ut&&v(ut.workspaceId,[ut.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ut&&L(ut.workspaceId,[ut.id])}}]:[];return r.jsxs("aside",{className:a?"sidebar sidebar--open":"sidebar",children:[r.jsxs("div",{className:"sidebar__head",children:[r.jsx("span",{className:l?"dot dot--on":"dot",title:i}),r.jsx("span",{className:"brand",children:"Claude Code Visual"}),r.jsx("button",{className:"theme-btn","aria-pressed":re==="pinned",title:re==="pinned"?"Показать все проекты и сессии":"Показать только закреплённые","aria-label":re==="pinned"?"Панель закреплённых сессий включена. Показать все проекты и сессии":"Показать только закреплённые сессии",onClick:pe,children:r.jsx(uy,{})}),r.jsx("button",{className:"theme-btn",title:`Тема: ${Wb[te]}`,"aria-label":`Тема: ${Wb[te]}. Переключить`,onClick:oe,children:r.jsx(uS,{mode:te})})]}),r.jsxs("div",{className:"fssearch fssearch--sidebar",children:[r.jsx(iS,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:me,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:E=>Ae(E.target.value),onKeyDown:E=>{E.stopPropagation(),E.key==="Escape"&&(E.preventDefault(),me?Ae(""):E.currentTarget.blur())}}),me&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Ae(""),children:"✕"})]}),r.jsx("div",{className:"sidebar__scroll",children:re==="pinned"?r.jsxs(r.Fragment,{children:[Me.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Me.map(E=>r.jsx("div",{className:E.id===m?"row row--active":"row",...F===E.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...At(E)},children:F===E.id?r.jsx("div",{className:"row__main",children:r.jsx(Jc,{value:E.title??"",onCommit:Y=>{j(E,Y),ae(null)},onCancel:()=>ae(null)})}):r.jsxs("button",{className:"row__main",onClick:()=>{It()||C(E)},children:[r.jsx(ph,{title:E.title??"Без названия",pinned:!1,projectName:we(E.workspaceId),projectPath:ye(E.workspaceId)}),r.jsx(Pb,{session:E,tail:new Date(E.updatedAt).toLocaleString()})]})},E.id))]}):r.jsxs(r.Fragment,{children:[r.jsx(hh,{title:"Проекты",count:$.length,open:Ve("workspaces"),onToggle:()=>at("workspaces")}),Ve("workspaces")&&r.jsxs(r.Fragment,{children:[$.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"Пока ни одного"})}),$.map(E=>r.jsx("div",{className:Jb(E.id===p,Mt.selected.includes(E.id)),...Pt(E),children:r.jsxs("button",{className:"row__main",onClick:Y=>{It()||Mt.click(Y,E,()=>x(E.id))},children:[r.jsxs("span",{className:"row__title",children:[E.name,E.hasClaudeMd&&" ·"]}),r.jsx("span",{className:"row__meta",title:E.path,children:E.path})]})},E.id))]}),p&&r.jsxs(r.Fragment,{children:[r.jsx(hh,{title:"Сессии",count:ce.length,open:Ve("sessions"),onToggle:()=>at("sessions")}),Ve("sessions")&&r.jsxs(r.Fragment,{children:[ce.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"Пока ни одной"})}),ce.map(E=>r.jsx("div",{className:Jb(E.id===m,Ie.selected.includes(E.id)),...F===E.id?{}:wn(E),children:F===E.id?r.jsx("div",{className:"row__main",children:r.jsx(Jc,{value:E.title??"",onCommit:Y=>{j(E,Y),ae(null)},onCancel:()=>ae(null)})}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"row__main",onClick:Y=>{It()||Ie.click(Y,E,()=>y(E))},children:[r.jsx(ph,{title:E.title??"Без названия",pinned:E.pinned===!0,projectName:we(E.workspaceId),projectPath:ye(E.workspaceId)}),r.jsx(Pb,{session:E,tail:new Date(E.updatedAt).toLocaleString()})]}),r.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{It()||ae(E.id)},children:"✎"})]})},E.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(hh,{title:"Архив",count:he.length,open:Ve("archive"),onToggle:()=>at("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Ve("archive")&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),he.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"Пока пусто"})}),he.map(E=>r.jsxs("div",{className:E.id===m?"row row--active":"row",children:[r.jsxs("button",{className:"row__main",onClick:()=>y(E),children:[r.jsx(ph,{title:E.title??"Без названия",pinned:!1,projectName:we(E.workspaceId),projectPath:ye(E.workspaceId)}),r.jsx("span",{className:"row__meta",children:pS(E)})]}),r.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>U([E.id]),children:"Вернуть"})]},E.id))]})]})]})]})}),r.jsxs("div",{className:"sidebar__foot",children:[r.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:K,children:[r.jsx("span",{className:w!=null&&w.loggedIn?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:w===null?"Аккаунт":w.loggedIn?w.email||"Вход выполнен":"Войти в аккаунт"}),(w==null?void 0:w.plan)&&r.jsx("span",{className:"chip",children:w.plan})]}),A&&r.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:A,children:[r.jsx("span",{className:z!=null&&z.connected?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:z===null?"Удалённый доступ":z.paired?z.connected?z.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(z==null?void 0:z.connected)&&z.clients>0&&r.jsx("span",{className:"chip",children:z.clients})]}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!Q,title:"MCP-серверы и плагины",onClick:()=>Q==null?void 0:Q(),children:"Расширения"}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:V,children:"Настройки"}),r.jsx("button",{className:"btn btn--ghost",onClick:P,children:"+ Проект"}),r.jsx("button",{className:"btn btn--primary",onClick:M,disabled:!p,children:"+ Сессия"})]}),bt&&r.jsx(Xc,{x:bt.x,y:bt.y,items:Tn,note:Ot,onClose:Xt}),Ze&&r.jsx(Xc,{x:Ze.x,y:Ze.y,items:wt,note:un,onClose:it}),st&&r.jsx(Xc,{x:st.x,y:st.y,items:en,note:Kb,onClose:Nt})]})}function Jb(a,l){const i=["row"];return a&&i.push("row--active"),l&&i.push("row--selected"),i.join(" ")}function Fb(a){const[l,i]=_.useState([]),c=_.useRef(null);function o(){i([]),c.current=null}function d(p,m,x){if(p.ctrlKey||p.metaKey){i(y=>y.includes(m.id)?y.filter(j=>j!==m.id):[...y,m.id]),c.current=m.id;return}if(p.shiftKey&&c.current){const y=a.findIndex(v=>v.id===c.current),j=a.findIndex(v=>v.id===m.id);if(y!==-1&&j!==-1){const[v,C]=y<j?[y,j]:[j,y];i(a.slice(v,C+1).map(k=>k.id));return}}o(),c.current=m.id,x()}function h(p){return l.includes(p.id)?l:(i([p.id]),c.current=p.id,[p.id])}return{selected:l,click:d,targetsFor:h,clear:o}}function hh({title:a,count:l,open:i,onToggle:c,hint:o}){const d=i?`Свернуть «${a}»`:`Развернуть «${a}»`;return r.jsxs("button",{className:"sidebar__section sidebar__section--btn","aria-expanded":i,title:o?`${d} — ${o}`:d,onClick:c,children:[r.jsx(sS,{open:i}),r.jsx("span",{className:"sidebar__section-name",children:a}),r.jsx("span",{className:"sidebar__count",children:l})]})}function sS({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function uy({className:a}){return r.jsxs("svg",{className:a,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),r.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),r.jsx("path",{d:"M8 12.2v1.4"})]})}function iS(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function rS(){try{const a=localStorage.getItem(ry);if(a===null)return["archive"];const l=JSON.parse(a);return Array.isArray(l)?l.filter(i=>i==="workspaces"||i==="sessions"||i==="archive"):["archive"]}catch{return["archive"]}}function cS(){try{return localStorage.getItem(cy)==="pinned"?"pinned":"default"}catch{return"default"}}const Wb={system:"как в системе",light:"светлая",dark:"тёмная"};function uS({mode:a}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return a==="dark"?r.jsx("svg",{...l,children:r.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"})}):a==="light"?r.jsxs("svg",{...l,children:[r.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),r.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"})]}):r.jsxs("svg",{...l,children:[r.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),r.jsx("path",{d:"M5.6 13.4h4.8"})]})}function oS(a){switch(a.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return a.backgroundWork?"работает в фоне":fS(a.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function fS(a){switch(a){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function dS(a){switch(a.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return a.backgroundWork?"background":hS(a.lastTurn);case"error":return"error";case"closed":return"closed"}}function hS(a){switch(a){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Pb({session:a,tail:l}){return r.jsxs("span",{className:"row__meta",children:[r.jsxs("span",{className:`row__state row__state--${dS(a)}`,children:[r.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),oS(a)]})," · ",l]})}function ph({title:a,pinned:l,projectName:i,projectPath:c}){return r.jsxs("span",{className:"row__head",children:[r.jsxs("span",{className:"row__title",children:[l&&r.jsx(uy,{className:"row__pin"}),a]}),r.jsx("span",{className:"row__project",title:c,children:i})]})}function pS(a){const l=a.archivedAuto?"сама, по сроку молчания":"убрана вручную";return a.archivedAt?`${new Date(a.archivedAt).toLocaleString()} · ${l}`:l}const ex=3,mS=15e5;function oy(a,l){if(!l||typeof l!="object")return null;const i=l,c=typeof i.file_path=="string"?i.file_path:"";if(!c)return null;if(a==="Write"){if(typeof i.content!="string")return null;const o=mh(i.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(a==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=yS(gS(mh(i.old_string),mh(i.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:i.replace_all===!0?"все вхождения":null}}return null}function mh(a){if(a==="")return[];const l=a.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function gS(a,l){let i=0;for(;i<a.length&&i<l.length&&a[i]===l[i];)i++;let c=a.length,o=l.length;for(;c>i&&o>i&&a[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...a.slice(0,i).map(d),...bS(a.slice(i,c),l.slice(i,o)),...a.slice(c).map(d)]}function bS(a,l){if(a.length===0&&l.length===0)return[];if(a.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return a.map(y=>({type:"del",text:y}));if((a.length+1)*(l.length+1)>mS)return[...a.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const i=a.length,c=l.length,o=c+1,d=new Uint32Array((i+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=i-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=a[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const p=[];let m=0,x=0;for(;m<i&&x<c;){const y=a[m],j=l[x];y===j?(p.push({type:"ctx",text:y}),m++,x++):h(m+1,x)>=h(m,x+1)?(p.push({type:"del",text:y}),m++):(p.push({type:"add",text:j}),x++)}for(;m<i;)p.push({type:"del",text:a[m++]});for(;x<c;)p.push({type:"add",text:l[x++]});return xS(p)}function xS(a){const l=[];let i=[];function c(){l.push(...i.filter(o=>o.type==="del")),l.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of a)o.type==="ctx"?(c(),l.push(o)):i.push(o);return c(),l}function yS(a){if(!a.some(d=>d.type!=="ctx"))return a;const l=a.map(()=>!1);a.forEach((d,h)=>{if(d.type!=="ctx")for(let p=Math.max(0,h-ex);p<=Math.min(a.length-1,h+ex);p++)l[p]=!0});const i=[];let c=[];function o(){c.length===1?i.push(...c):c.length>1&&i.push({type:"gap",text:`⋯ ${c.length} ${_S(c.length)} без изменений`}),c=[]}return a.forEach((d,h)=>{l[h]?(o(),i.push(d)):c.push(d)}),o(),i}function _S(a){const l=a%100;if(l>=11&&l<=14)return"строк";switch(a%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Br(a){try{return await navigator.clipboard.writeText(a),!0}catch{}const l=document.createElement("textarea");l.value=a,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function Oh(){try{return await navigator.clipboard.readText()}catch{return null}}const Jh=1600,zi="Копировать",Ar="Скопировано";function Fh({text:a,hint:l,className:i}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Jh);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[a]),r.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":c?Ar:`${zi} ${l}`,title:c?Ar:`${zi} ${l}`,onClick:()=>{Br(a).then(d=>{d&&o(!0)})},children:c?Ar:zi})}function Wh({diff:a}){return r.jsxs("div",{className:"diff",children:[r.jsxs("div",{className:"diff__head",children:[r.jsx("span",{className:"diff__path",title:a.filePath,children:a.filePath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]})]}),a.note&&r.jsx("div",{className:"diff__note",children:a.note}),r.jsx("div",{className:"diff__body",children:a.rows.length===0?r.jsx("div",{className:"diff__row diff__row--gap",children:r.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):a.rows.map((l,i)=>r.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[r.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),r.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},i))})]})}function vS({waiting:a}){const[l,i]=_.useState(0);return _.useEffect(()=>{const c=window.setInterval(()=>i(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),r.jsxs("div",{className:a?"work work--wait":"work",children:[r.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:a?"ждёт разрешения":"думает"}),!a&&r.jsxs("span",{className:"work__time",children:[l," с"]})]})}function Ph({items:a,busy:l,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:p,onEditMessage:m,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=_.useRef(null),j=_.useRef(null),v=_.useRef(!0),C=_.useRef(null),k=_.useRef(null),L=_.useRef(!1);_.useEffect(()=>{v.current=!0,C.current=null,L.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[p]),_.useEffect(()=>{const w=y.current,K=j.current;if(!w||!K)return;function z(te){!w||te===w.scrollTop||(L.current=!0,w.scrollTop=te)}function A(){if(!w)return;const te=C.current;if(te){const oe=nx(w,te.id);if(oe){const F=oe.getBoundingClientRect().top-w.getBoundingClientRect().top;z(w.scrollTop+(F-te.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{C.current=null},500);return}v.current&&z(w.scrollHeight)}const V=new ResizeObserver(A);return V.observe(K),()=>{V.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function U(){const w=y.current;if(w){if(L.current){L.current=!1;return}v.current=w.scrollHeight-w.scrollTop-w.clientHeight<80}}function P(){if(d)return;const w=y.current,K=c[0];if(w&&K){const z=nx(w,K.id);z&&(C.current={id:K.id,top:z.getBoundingClientRect().top-w.getBoundingClientRect().top})}h==null||h()}let M=0;function Q(w){return w.kind==="user"?M++:-1}return r.jsx("div",{className:"transcript",ref:y,onScroll:U,children:r.jsxs("div",{className:"stream",ref:j,children:[o&&r.jsx("button",{type:"button",className:"transcript__more",onClick:P,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(w=>r.jsx(tx,{item:w,userIndex:Q(w),onEditMessage:m},w.id)),c.length>0&&a.length>0&&r.jsx("div",{className:"transcript__divider",children:r.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&a.length===0&&r.jsx("p",{className:"empty",children:x}),a.map(w=>r.jsx(tx,{item:w,userIndex:Q(w),onEditMessage:m},w.id)),l&&r.jsx(vS,{waiting:i})]})})}function tx({item:a,userIndex:l,onEditMessage:i}){switch(a.kind){case"user":return r.jsx(jS,{item:a,userIndex:l,onEditMessage:i});case"assistant":return r.jsxs("div",{className:"msg--assistant","data-item-id":a.id,children:[r.jsx(kS,{text:a.text}),a.streaming&&r.jsx("span",{className:"caret"}),a.text.trim()!==""&&r.jsx("div",{className:"msg--assistant__foot",children:r.jsx(Fh,{text:a.text,hint:"ответ целиком"})})]});case"thinking":return r.jsx("div",{className:"thinking","data-item-id":a.id,children:a.text});case"tool":return r.jsx(wS,{item:a});case"result":return r.jsxs("div",{className:"result-line","data-item-id":a.id,children:[r.jsx("span",{children:a.isError?"✗ "+a.subtype:"✓ готово"}),r.jsxs("span",{children:[(a.durationMs/1e3).toFixed(1)," с"]}),a.costUsd!==null&&r.jsxs("span",{children:["$",a.costUsd.toFixed(4)]}),r.jsxs("span",{children:["↑",ax(a.inputTokens)," ↓",ax(a.outputTokens)]})]});case"notice":return r.jsx("div",{className:a.tone==="error"?"notice notice--error":"notice","data-item-id":a.id,children:a.text})}}const SS=500;function jS({item:a,userIndex:l,onEditMessage:i}){const[c,o]=_.useState(null),[d,h]=_.useState(!1),[p,m]=_.useState(a.text),x=_.useRef(null),y=Zo("(max-width: 860px)"),j=_.useRef(null);function v(A,V){o({x:A,y:V})}function C(A){A.preventDefault(),v(A.clientX,A.clientY)}function k(A){const V=A.touches[0];if(!V)return;const te={timer:0,x:V.clientX,y:V.clientY,fired:!1};te.timer=window.setTimeout(()=>{te.fired=!0,v(te.x,te.y)},SS),j.current=te}function L(A){const V=j.current,te=A.touches[0];!V||!te||Math.hypot(te.clientX-V.x,te.clientY-V.y)>10&&(window.clearTimeout(V.timer),j.current=null)}function U(A){const V=j.current;V&&(window.clearTimeout(V.timer),V.fired&&A.preventDefault())}function P(){m(a.text),h(!0)}function M(){h(!1)}function Q(){const A=p.trim();A===""&&!(a.images&&a.images.length>0)||(i==null||i(l,A,a.images),h(!1))}_.useEffect(()=>{const A=x.current;!A||!d||(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[p,d]),_.useEffect(()=>{if(!d)return;const A=x.current;A&&(A.focus(),A.setSelectionRange(A.value.length,A.value.length))},[d]);function w(A){if(A.key==="Escape"){A.preventDefault(),A.stopPropagation(),M();return}A.key==="Enter"&&!A.shiftKey&&!y&&(A.preventDefault(),Q())}const K=a.images&&a.images.length>0&&r.jsx("div",{className:"msg--user__images",children:a.images.map((A,V)=>r.jsx("img",{className:"msg--user__image",src:`data:${A.mediaType};base64,${A.data}`,alt:"Вложение"},V))});if(d){const A=p.trim()!==""||!!(a.images&&a.images.length>0);return r.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":a.id,children:[K,r.jsxs("div",{className:"msg--user__edit",children:[r.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:p,onChange:V=>m(V.target.value),onKeyDown:w,rows:1}),r.jsxs("div",{className:"msg--user__edit-actions",children:[r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:M,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:Q,disabled:!A,children:"Сохранить"})]})]})]})}const z=[{id:"copy",label:"Копировать",onSelect:()=>void Br(a.text)},...i?[{id:"edit",label:"Изменить",onSelect:P}]:[]];return r.jsxs("div",{className:"msg--user","data-item-id":a.id,onContextMenu:C,onTouchStart:k,onTouchMove:L,onTouchEnd:U,onTouchCancel:U,children:[K,a.text,c&&r.jsx(Xc,{x:c.x,y:c.y,items:z,onClose:()=>o(null)})]})}function nx(a,l){const i=a.querySelectorAll("[data-item-id]");for(const c of i)if(c.dataset.itemId===l)return c;return null}function kS({text:a}){const[l,i]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return Kh(a).then(h=>{d||i(NS(h))}),()=>{d=!0}},[a]),_.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var m,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const p=((x=(m=h.parentElement)==null?void 0:m.querySelector("pre"))==null?void 0:x.textContent)??"";p!==""&&Br(p).then(y=>{if(!y)return;h.textContent=Ar,h.setAttribute("aria-label",Ar),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=zi,h.setAttribute("aria-label",Dh),h.classList.remove("copybtn--done"))},Jh);c.current.push(j)})}return r.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Dh=`${zi} блок кода`;function NS(a){if(!a.includes("<pre"))return a;const l=new DOMParser().parseFromString(a,"text/html");for(const i of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",i.replaceWith(c),c.append(i);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Dh),o.title=Dh,o.textContent=zi,c.append(o)}return l.body.innerHTML}function wS({item:a}){const[l,i]=_.useState(!1),c=a.result===null,o=oy(a.name,a.input),d=a.name==="AskUserQuestion"?AS(a.input):null;return r.jsxs("div",{className:"tool"+(a.isError?" tool--error":"")+(a.awaitingPermission?" tool--wait":""),"data-item-id":a.id,children:[r.jsxs("button",{className:"tool__head",onClick:()=>i(h=>!h),children:[r.jsx("span",{className:"tool__name",children:a.name}),r.jsx("span",{className:"tool__arg",children:d?ES(d):TS(a.input)}),r.jsx("span",{className:"tool__status",children:c?"…":a.isError?"ошибка":l?"▴":"▾"})]}),l&&r.jsxs("div",{className:"tool__body",children:[d?r.jsx(CS,{questions:d,answers:a.answers}):o?r.jsx(Wh,{diff:o}):r.jsx(lx,{text:JSON.stringify(a.input,null,2),hint:"аргументы вызова"}),a.result!==null&&(!d||a.isError)&&r.jsx(lx,{text:a.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function lx({text:a,hint:l,style:i}){return r.jsxs("div",{className:"codeblock",style:i,children:[r.jsx("pre",{className:"code",children:a}),r.jsx(Fh,{text:a,hint:l,className:"codeblock__copy"})]})}function TS(a){if(!a||typeof a!="object")return"";const l=a;for(const i of["file_path","command","pattern","path","url","prompt"]){const c=l[i];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function ES(a){var i;const l=a.map(c=>c.header).filter(c=>c.length>0);return l.length===a.length?l.join(" · "):((i=a[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function AS(a){if(typeof a!="object"||a===null)return null;const l=a.questions;if(!Array.isArray(l)||l.length===0)return null;const i=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:p}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const m=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:y,description:j,preview:v}=x;if(typeof y!="string"||typeof j!="string")return null;m.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}i.push({question:o,header:typeof d=="string"?d:"",options:m,multiSelect:p===!0})}return i}function CS({questions:a,answers:l}){return r.jsx("div",{className:"tool__questions",children:a.map((i,c)=>r.jsxs("div",{className:"tool__question",children:[r.jsxs("div",{className:"tool__question-head",children:[i.header&&r.jsx("span",{className:"chip chip--accent",children:i.header}),r.jsx("span",{className:"tool__question-text",children:i.question})]}),r.jsx("div",{className:"tool__question-answer",children:l!=null&&l[i.question]?r.jsx("span",{className:"tool__answer-value",children:l[i.question]}):r.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function ax(a){return a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const RS="ccv.dictation.lang",sx="ru-RU";function MS(a){try{return Function.prototype.toString.call(a).includes("[native code]")}catch{return!1}}function ix(){const a=window,l=[a.SpeechRecognition,a.webkitSpeechRecognition].filter(c=>typeof c=="function"),i=l.find(MS);return!i&&l.length>0&&Vl("распознавание подменено: родной реализации в странице нет"),i??l[0]??null}function fy(){var a;try{return((a=localStorage.getItem(RS))==null?void 0:a.trim())||sx}catch{return sx}}function Vl(a,l){l===void 0?console.debug(`[dictation] ${a}`):console.debug(`[dictation] ${a}`,l)}const OS=3,DS=400,zS=5,LS=250,US=2e3,HS=2e4;async function BS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const qS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${fy()}`};function IS(a){const[l]=_.useState(()=>ix()!==null),[i,c]=_.useState(!1),[o,d]=_.useState(null),h=_.useRef(null),p=_.useRef(!1),m=_.useRef(!1),x=_.useRef(a),y=_.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=_.useRef(null),v=_.useRef(!1),C=_.useRef(null),k=_.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),L=_.useCallback(()=>{k();const w=async K=>{if(C.current=null,!(!p.current||v.current)){if(!K&&!await BS()){if(Vl("ждём ответа на запрос доступа к микрофону"),!p.current||v.current)return;C.current=setTimeout(()=>void w(!0),HS);return}Vl("движок не ответил на start()"),p.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void w(!1),US)},[k]);_.useEffect(()=>{x.current=a}),_.useEffect(()=>{const w=ix();if(!w)return;const K=new w;return K.lang=fy(),K.continuous=!0,K.interimResults=!0,K.onstart=()=>{Vl("сессия открыта"),v.current=!0,k(),c(!0)},K.onaudiostart=()=>{Vl("пошёл звук с микрофона"),y.current.audio=!0},K.onresult=z=>{var oe;if(m.current)return;let A="",V="";for(let F=z.resultIndex;F<z.results.length;F++){const ae=z.results[F];if(!ae)continue;const me=((oe=ae[0])==null?void 0:oe.transcript)??"";ae.isFinal?A+=me:V+=me}const te=y.current;te.heard=!0,te.everHeard=!0,Vl("распознано",{final:A,interim:V}),x.current(A,V)},K.onerror=z=>{y.current.lastError=z.error,Vl("ошибка движка",z.error),!(z.error==="no-speech"||z.error==="aborted")&&(p.current=!1,c(!1),d(qS[z.error]??`Распознавание не работает: ${z.error}`))},K.onend=()=>{m.current=!1,v.current=!1;const z=y.current,A=Date.now()-z.openedAt;if(Vl("сессия закрыта",{мс:A,звук:z.audio,слова:z.heard,ошибка:z.lastError||null}),!p.current){c(!1);return}if(z.dead=!z.audio&&A<DS?z.dead+1:0,z.dead>=zS){p.current=!1,c(!1),d(z.lastError?`Распознавание не работает: ${z.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}z.silent=z.heard?0:z.silent+1,!z.everHeard&&!z.warned&&z.silent>=OS&&(z.warned=!0,d(z.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!p.current){z.openedAt=Date.now(),z.audio=!1,z.heard=!1,z.lastError="",L();try{K.start()}catch{}}},LS)},h.current=K,()=>{p.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),K.onend=null,K.onresult=null,K.onerror=null,K.onstart=null,K.onaudiostart=null,K.abort(),h.current=null}},[]);const U=_.useCallback(()=>{var w;if(p.current){if(p.current=!1,Vl("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(w=h.current)==null||w.stop()}},[]),P=_.useCallback(()=>{const w=h.current;if(w){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),p.current=!0,m.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),Vl("включение микрофона",{язык:w.lang}),L();try{w.start()}catch(K){Vl("start() не прошёл",K)}}},[L]),M=_.useCallback(()=>{p.current?U():P()},[P,U]),Q=_.useCallback(()=>{var w;p.current&&v.current&&(m.current=!0,(w=h.current)==null||w.abort())},[]);return{supported:l,listening:i,error:o,toggle:M,stop:U,drop:Q}}const dy="ccv:drafts",GS=40,YS=2e4,XS=500;let Vc=null,$c=null;function hy(){if(Vc)return Vc;const a=new Map;try{const l=localStorage.getItem(dy);if(l){const i=JSON.parse(l);if(typeof i=="object"&&i!==null)for(const[c,o]of Object.entries(i))typeof o=="string"&&o!==""&&a.set(c,o)}}catch{}return Vc=a,window.addEventListener("pagehide",py),a}function gh(a){return hy().get(a)??""}function VS(a,l){const i=hy(),c=l.slice(0,YS),o=i.has(a);if(o&&i.delete(a),c!=="")i.set(a,c);else if(!o)return;for(;i.size>GS;){const d=i.keys().next();if(d.done)break;i.delete(d.value)}$S()}function $S(){$c===null&&($c=window.setTimeout(py,XS))}function py(){if($c!==null&&window.clearTimeout($c),$c=null,!!Vc)try{localStorage.setItem(dy,JSON.stringify(Object.fromEntries(Vc)))}catch{}}const QS="(max-width: 860px)",rx=/^\/(\S*)$/,ZS=new Set(["model","permissions"]);function KS(a){return ZS.has(a.name)||a.name.startsWith("__")}const JS=new Set(["clear","rename"]),cx=/(?:^|\s)@([^\s@]*)$/,FS=200,WS=100,PS=190,ej=5,tj=20*1024*1024,nj=1568,lj=.85;let ux=0;async function aj(a){var j,v;if(!a.type.startsWith("image/")||a.size>tj)return null;const l=await sj(a);if(!l)return null;const{width:i,height:c}=l;if(i<=0||c<=0)return null;const o=Math.min(1,nj/Math.max(i,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(i*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(l.image,0,0,d.width,d.height),(v=(j=l.image).close)==null||v.call(j);const p=a.type==="image/png",m=p?"image/png":"image/jpeg",x=d.toDataURL(m,p?void 0:lj),y=x.slice(x.indexOf(",")+1);return y?(ux+=1,{id:`att${ux}`,mediaType:m,data:y,previewUrl:x}):null}async function sj(a){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(a);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const i=URL.createObjectURL(a),c=new Image;c.onload=()=>{URL.revokeObjectURL(i),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(i),l(null)},c.src=i})}function my({disabled:a,busy:l,commands:i,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:p,sendLabel:m="Отправить",autoFocus:x=!1,attachmentsEnabled:y=!0,onContextSearch:j,onCommand:v,onSend:C,onInterrupt:k,onEscape:L}){var _e;const U=Zo(QS),[P,M]=_.useState(()=>p?gh(p):""),[Q,w]=_.useState(!1),[K,z]=_.useState(0),A=_.useRef(null),V=_.useRef(null),te=_.useRef(null),[oe,F]=_.useState(()=>p?gh(p).length:0),[ae,me]=_.useState([]),Ae=_.useRef(null),be=_.useCallback(O=>{!y||O.length===0||Promise.all(O.map(aj)).then(J=>{const xe=J.filter(qe=>qe!==null);xe.length!==0&&me(qe=>[...qe,...xe].slice(0,ej))})},[y]);function H(O){me(J=>J.filter(xe=>xe.id!==O))}function re(O){var qe;if(!y)return;const J=(qe=O.clipboardData)==null?void 0:qe.items;if(!J)return;const xe=[];for(const Tt of J){if(!Tt.type.startsWith("image/"))continue;const Sn=Tt.getAsFile();Sn&&xe.push(Sn)}xe.length!==0&&(O.preventDefault(),be(xe))}function se(O){const J=O.target.files?Array.from(O.target.files):[];O.target.value="",be(J)}_.useEffect(()=>{y||me([])},[y]);const[pe,Ne]=_.useState([]),[N,$]=_.useState(-1),ce=_.useRef(""),[he,we]=_.useState(""),ye=IS(_.useCallback((O,J)=>{O&&M(xe=>bh(xe,O)),we(J.trim())},[])),Me=he?bh(P,he):P;_.useEffect(()=>{ye.listening||he===""||(M(O=>bh(O,he)),we(""))},[ye.listening,he]),_.useEffect(()=>{var O;x&&((O=A.current)==null||O.focus())},[x]);const at=_.useRef(new Map),Ve=_.useRef(new Map),Mt=_.useRef(p),Ie=_.useRef({text:P,caret:oe});Ie.current={text:P,caret:oe};const bt=_.useCallback((O,J,xe)=>{J===""?(at.current.delete(O),Ve.current.delete(O)):(at.current.set(O,J),Ve.current.set(O,xe)),VS(O,J)},[]),We=ye.drop;_.useLayoutEffect(()=>{const O=Mt.current;if(O===p)return;Mt.current=p,O&&bt(O,Ie.current.text,Ie.current.caret);const J=p?at.current.get(p)??gh(p):"",xe=p?Ve.current.get(p):void 0,qe=Math.min(xe??J.length,J.length);M(J),F(qe),te.current=[qe,qe],we(""),z(0),w(!1),$(-1),ce.current="",me([]),We()},[p,bt,We]),_.useEffect(()=>{p&&bt(p,P,oe)},[p,P,oe,bt]);const Ze=a?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",Ke=_.useRef(0),st=_.useCallback(O=>{const J=parseFloat(getComputedStyle(O).maxHeight),xe=Number.isFinite(J)&&J>0?J:PS;O.style.height="auto";const qe=O.scrollHeight;O.style.height=`${Math.min(qe,xe)}px`,O.style.overflowY=qe>xe?"auto":"hidden"},[]);_.useEffect(()=>{const O=A.current;O&&st(O)},[Me,Ze,a,st]),_.useLayoutEffect(()=>{const O=A.current,J=te.current;!O||!J||(te.current=null,O.setSelectionRange(J[0],J[1]))}),_.useEffect(()=>{const O=A.current;if(!O)return;const J=new ResizeObserver(([xe])=>{const qe=xe==null?void 0:xe.contentRect.width;qe===void 0||Math.abs(qe-Ke.current)<1||(Ke.current=qe,st(O))});return J.observe(O),()=>J.disconnect()},[st]);const Jn=ye.stop;_.useEffect(()=>{a&&Jn()},[a,Jn]);const Ht=_.useMemo(()=>ye.error?{ok:!1,message:ye.error}:null,[ye.error]),Bt=_.useMemo(()=>{var xe;const O=(xe=rx.exec(P))==null?void 0:xe[1];if(O===void 0)return[];const J=O.toLowerCase();return i.filter(qe=>!KS(qe)&&xh(qe,J)<gy).sort((qe,Tt)=>xh(qe,J)-xh(Tt,J))},[P,i]),Qt=!Q&&Bt.length>0,qt=Math.min(K,Bt.length-1),It=Q?null:((_e=cx.exec(Me.slice(0,oe)))==null?void 0:_e[1])??null,Xt=_.useRef(j);Xt.current=j,_.useEffect(()=>{if(It===null||It===""||It.endsWith("/")){Xt.current(It);return}const O=setTimeout(()=>Xt.current(It),FS);return()=>clearTimeout(O)},[It]);const it=It!==null&&(o==null?void 0:o.query)===It,Nt=it?o.entries:[],Pt=It!==null,wn=Pt&&!it,At=Math.min(K,Math.max(Nt.length-1,0));_.useEffect(()=>{var J,xe;if(!Qt&&!Pt)return;const O=Qt?qt:At;(xe=(J=V.current)==null?void 0:J.children[O])==null||xe.scrollIntoView({block:"nearest"})},[Qt,Pt,qt,At]);function vn(O,J){var xe;M(O),F(J),te.current=[J,J],z(0),w(!1),he!==""&&(we(""),ye.drop()),(xe=A.current)==null||xe.focus()}function Tn(){M(""),we(""),z(0),F(0),w(!1),$(-1),ce.current="",me([]),ye.drop(),p&&bt(p,"",0)}function Ot(O){const J=O.trim();J===""&&ae.length===0||a||(C(J,ae.length>0?ae.map(xe=>({mediaType:xe.mediaType,data:xe.data})):void 0),J!==""&&Ne(xe=>[J,...xe.filter(qe=>qe!==J)].slice(0,WS)),Tn())}function cn(O){if(O<-1||O>=pe.length)return;N===-1&&(ce.current=P);const J=O===-1?ce.current:pe[O]??"";$(O),vn(J,J.length)}function Zt(){var qe;const O=((qe=A.current)==null?void 0:qe.selectionStart)??Me.length,xe=`${O>0&&!/\s$/.test(Me.slice(0,O))?" ":""}@`;vn(Me.slice(0,O)+xe+Me.slice(O),O+xe.length)}function wt(O){var Tt;const J=(Tt=cx.exec(Me.slice(0,oe)))==null?void 0:Tt[1];if(J===void 0)return;const xe=oe-J.length-1,qe=O.kind==="dir"?`@${O.path}/`:`@${O.path} `;vn(Me.slice(0,xe)+qe+Me.slice(oe),xe+qe.length)}function un(){var J;const O=(J=rx.exec(Me.trim()))==null?void 0:J[1];if(O&&v(O)){Tn();return}Ot(Me)}function ut(O,J){M(O),F(J),z(0),w(!1),$(-1),he!==""&&(we(""),ye.drop())}function en(O){var qe;const J=JS.has(O.name)?c:null,xe=`/${O.name} `;M(xe+(J??"")),F(xe.length+((J==null?void 0:J.length)??0)),J&&(te.current=[xe.length,xe.length+J.length]),z(0),(qe=A.current)==null||qe.focus()}function E(O){if(v(O.name)){M(""),z(0),w(!1);return}O.argumentHint?en(O):Ot(`/${O.name}`)}function Y(O){if(Qt){if(O.key==="ArrowDown")return O.preventDefault(),z(J=>(Math.min(J,Bt.length-1)+1)%Bt.length);if(O.key==="ArrowUp"){O.preventDefault();const J=Bt.length-1;return z(xe=>(Math.min(xe,J)+J)%Bt.length)}if(O.key==="Enter"&&!O.shiftKey){O.preventDefault();const J=Bt[qt];J&&E(J);return}if(O.key==="Tab"){O.preventDefault();const J=Bt[qt];J&&en(J);return}if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),w(!0);return}}if(Pt){if(O.key==="ArrowDown"&&Nt.length>0)return O.preventDefault(),z(J=>(Math.min(J,Nt.length-1)+1)%Nt.length);if(O.key==="ArrowUp"&&Nt.length>0){O.preventDefault();const J=Nt.length-1;return z(xe=>(Math.min(xe,J)+J)%Nt.length)}if(O.key==="Enter"&&!O.shiftKey||O.key==="Tab"){const J=Nt[At];if(J){O.preventDefault(),wt(J);return}if(O.key==="Tab")return}if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),w(!0);return}}if((O.key==="ArrowUp"||O.key==="ArrowDown")&&!O.shiftKey){const J=O.currentTarget,xe=J.selectionStart;if(J.selectionEnd===xe){const Tt=O.key==="ArrowUp"?N+1:N-1;Tt>=-1&&Tt<pe.length&&requestAnimationFrame(()=>{J.selectionStart===xe&&J.selectionEnd===xe&&cn(Tt)})}}if(O.key==="Escape"&&L){O.preventDefault(),O.stopPropagation(),L();return}O.key==="Enter"&&!O.shiftKey&&!U&&(O.preventDefault(),un())}return r.jsx("div",{className:d?`composer ${d}`:"composer",children:r.jsxs("div",{className:"composer__inner",children:[r.jsx(Hi,{result:Ht}),Pt&&!Qt&&r.jsxs("div",{className:"cmdmenu",role:"listbox",ref:V,children:[Nt.map((O,J)=>r.jsxs("button",{role:"option","aria-selected":J===At,className:J===At?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(J),onMouseDown:xe=>{xe.preventDefault(),wt(O)},children:[r.jsxs("span",{className:"cmdmenu__name",children:[O.name,O.kind==="dir"?"/":""]}),r.jsx("span",{className:"cmdmenu__desc",children:O.path}),O.ignored&&r.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},O.path)),Nt.length===0&&r.jsx("div",{className:"cmdmenu__empty",children:wn?"ищем…":It?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),Qt&&r.jsx("div",{className:"cmdmenu",role:"listbox",ref:V,children:Bt.map((O,J)=>r.jsxs("button",{role:"option","aria-selected":J===qt,className:J===qt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(J),onMouseDown:xe=>{xe.preventDefault(),E(O)},children:[r.jsxs("span",{className:"cmdmenu__name",children:["/",O.name]}),O.argumentHint&&r.jsx("span",{className:"cmdmenu__hint",children:O.argumentHint}),r.jsx("span",{className:"cmdmenu__desc",children:O.description})]},O.name))}),ae.length>0&&r.jsx("div",{className:"composer__attachments",children:ae.map(O=>r.jsxs("div",{className:"composer__thumb",children:[r.jsx("img",{src:O.previewUrl,alt:"Вложение"}),r.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>H(O.id),children:r.jsx(fj,{})})]},O.id))}),r.jsxs("div",{className:"composer__field",children:[r.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:a,onClick:Zt,children:r.jsx(cj,{})}),y&&r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:Ae,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:se}),r.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:a,onClick:()=>{var O;return(O=Ae.current)==null?void 0:O.click()},children:r.jsx(oj,{})})]}),r.jsx("textarea",{ref:A,value:Me,disabled:a,placeholder:Ze,onChange:O=>ut(O.target.value,O.target.selectionStart),onSelect:O=>F(O.currentTarget.selectionStart),onKeyDown:Y,onPaste:re}),ye.supported&&r.jsx("button",{type:"button",className:ye.listening?"micbtn is-on":"micbtn",title:ye.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":ye.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":ye.listening,disabled:a,onClick:ye.toggle,children:r.jsx(dj,{on:ye.listening})}),l?r.jsx("button",{className:"btn",onClick:k,title:"Прервать (Esc)",children:"Стоп"}):r.jsxs("button",{className:"btn btn--primary sendbtn",onClick:un,disabled:a||Me.trim()===""&&ae.length===0,"aria-label":m,title:m,children:[r.jsx("span",{className:"sendbtn__label",children:m}),r.jsx(uj,{})]})]})]})})}function bh(a,l){const i=l.trim();if(i==="")return a;const c=zh(i).slice(ij(a,i)).join(" ");return c===""?a:a===""||/\s$/.test(a)?a+c:`${a} ${c}`}function ij(a,l){const i=zh(a),c=zh(l);for(let o=Math.min(i.length,c.length);o>0;o--)if(i.slice(i.length-o).every((d,h)=>rj(d,c[h]??"")))return o;return 0}function zh(a){return a.split(/\s+/).filter(l=>l!=="")}function rj(a,l){const i=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(a)===i(l)}function cj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function uj(){return r.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:r.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function oj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.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 fj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function dj({on:a}){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:a?"currentColor":"none"}),r.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),r.jsx("path",{d:"M8 12.8v1.5"})]})}const gy=4;function xh(a,l){const i=a.name.toLowerCase();return i===l?0:i.startsWith(l)?1:a.aliases.some(c=>c.toLowerCase().startsWith(l))?2:i.includes(l)?3:gy}function hj({request:a,queued:l,onDecide:i}){const c=oy(a.toolName,a.input);return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[r.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),r.jsxs("div",{className:"sheet__body",children:[r.jsx("div",{className:"sheet__tool",children:a.toolName}),a.reason&&r.jsx("p",{className:"sheet__reason",children:a.reason}),c?r.jsx(Wh,{diff:c}):r.jsx("pre",{className:"code",children:JSON.stringify(a.input,null,2)})]}),r.jsxs("div",{className:"sheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>i(a.requestId,"deny"),children:"Отклонить"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>i(a.requestId,"allow"),children:"Разрешить"})]})]})})}function pj({request:a,queued:l,onAnswer:i,onDecline:c}){const{questions:o}=a,[d,h]=_.useState(()=>o.map(()=>new Set)),[p,m]=_.useState(()=>o.map(()=>"")),[x,y]=_.useState(()=>ox(o));_.useEffect(()=>{h(o.map(()=>new Set)),m(o.map(()=>"")),y(ox(o))},[a.requestId]);const j=_.useMemo(()=>gj(o,d,p),[o,d,p]),v=j!==null;function C(Q,w){var K,z;(z=(K=o[Q])==null?void 0:K.options[w])!=null&&z.preview&&y(A=>{const V=A.slice();return V[Q]=w,V})}function k(Q,w,K){h(z=>{const A=z.slice(),V=new Set(A[Q]);return K?V.has(w)?V.delete(w):V.add(w):V.has(w)||(V.clear(),V.add(w)),A[Q]=V,A}),w!=="other"&&C(Q,w)}function L(Q,w){m(K=>{const z=K.slice();return z[Q]=w,z})}function U(){j&&i(a.requestId,j)}function P(Q){Q.key==="Enter"&&(Q.target.closest("button")||v&&(Q.preventDefault(),U()))}function M(Q){var A;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Q.key))return;const w=Array.from(Q.currentTarget.querySelectorAll("button.qsheet__option")),K=w.indexOf(document.activeElement);if(K===-1)return;Q.preventDefault();const z=Q.key==="ArrowDown"||Q.key==="ArrowRight"?1:-1;(A=w[(K+z+w.length)%w.length])==null||A.focus()}return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:P,children:[r.jsxs("div",{className:"qsheet__head",children:[r.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),r.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),r.jsxs("div",{className:"qsheet__body",children:[a.reason&&r.jsx("p",{className:"qsheet__reason",children:a.reason}),o.map((Q,w)=>r.jsx(mj,{q:Q,qi:w,selected:d[w]??new Set,otherText:p[w]??"",previewIndex:x[w]??null,onToggle:k,onFocusOption:C,onOtherText:L,onOptionsKeyDown:M},w))]}),r.jsxs("div",{className:"qsheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>c(a.requestId),children:"Не отвечать"}),r.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:U,children:"Ответить"})]})]})})}function mj({q:a,qi:l,selected:i,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:p,onOptionsKeyDown:m}){var C;const x=a.options.some(k=>k.preview),y=o!==null?(C=a.options[o])==null?void 0:C.preview:void 0,j=i.has("other"),v=a.multiSelect?"checkbox":"radio";return r.jsxs("div",{className:"qsheet__question",children:[r.jsxs("div",{className:"qsheet__qhead",children:[r.jsx("span",{className:"chip chip--accent",children:a.header}),r.jsx("span",{className:"qsheet__qtext",children:a.question})]}),r.jsxs("div",{className:"qsheet__options"+(a.multiSelect?"":" qsheet__options--radio"),role:a.multiSelect?"group":"radiogroup","aria-label":a.question,onKeyDown:m,children:[a.options.map((k,L)=>{const U=i.has(L);return r.jsxs("button",{type:"button",role:v,"aria-checked":U,className:"qsheet__option"+(U?" is-selected":""),onClick:()=>d(l,L,a.multiSelect),onFocus:()=>h(l,L),onMouseEnter:()=>h(l,L),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:k.label}),r.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},L)}),r.jsxs("div",{className:"qsheet__other",children:[r.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",a.multiSelect),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),r.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&r.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${a.question}»`,value:c,onChange:k=>p(l,k.target.value),autoFocus:!0})]})]}),x&&r.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function ox(a){return a.map(l=>{const i=l.options.findIndex(c=>c.preview);return i===-1?null:i})}function gj(a,l,i){const c={};for(let o=0;o<a.length;o++){const d=a[o];if(!d)continue;const h=l[o]??new Set,p=[];for(let m=0;m<d.options.length;m++){const x=d.options[m];x&&h.has(m)&&p.push(x.label)}if(h.has("other")){const m=(i[o]??"").trim();m&&p.push(m)}if(p.length===0)return null;c[d.question]=p.join(", ")}return c}function bj({request:a,plan:l,queued:i,onAccept:c,onDecline:o}){const[d,h]=_.useState(l),[p,m]=_.useState("preview");_.useEffect(()=>{h(l),m("preview")},[a.requestId,l]);const x=d.trim().length>0;function y(){x&&c(a.requestId,d)}return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[r.jsxs("div",{className:"plansheet__head",children:[r.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:r.jsx(yj,{})}),r.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",i>0&&` — ещё ${i} в очереди`]}),r.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[r.jsx("button",{className:"btn btn--sm"+(p==="preview"?" is-on":""),role:"tab","aria-selected":p==="preview",onClick:()=>m("preview"),children:"Просмотр"}),r.jsx("button",{className:"btn btn--sm"+(p==="source"?" is-on":""),role:"tab","aria-selected":p==="source",onClick:()=>m("source"),children:"Код"})]})]}),r.jsxs("div",{className:"plansheet__body",children:[a.reason&&r.jsx("p",{className:"plansheet__reason",children:a.reason}),r.jsx("div",{className:"plansheet__content",children:p==="preview"?r.jsx(xj,{text:d}):r.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),r.jsxs("div",{className:"plansheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>o(a.requestId),children:"Доработать"}),r.jsx("button",{className:"btn btn--ok",disabled:!x,autoFocus:!0,onClick:y,children:"Одобрить план"})]})]})})}function xj({text:a}){const[l,i]=_.useState("");return _.useEffect(()=>{let c=!1;return Kh(a).then(o=>{c||i(o)}),()=>{c=!0}},[a]),r.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function yj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),r.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function _j(a,l){if(a!=="ExitPlanMode"||!l||typeof l!="object")return null;const i=l.plan;return typeof i=="string"?i:null}function by({path:a}){const[l,i]=_.useState(!1),[c,o]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{if(!l)return;function p(m){var x;(x=d.current)!=null&&x.contains(m.target)||i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),_.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),Jh);return()=>clearTimeout(p)},[c]),_.useEffect(()=>i(!1),[a]);async function h(){await Br(a)&&o(!0)}return r.jsxs("div",{ref:d,className:"cwd",children:[r.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${a}`,onClick:()=>i(p=>!p),onKeyDown:p=>{p.key!=="Escape"||!l||(p.preventDefault(),p.stopPropagation(),i(!1))},children:[r.jsx(vj,{open:l}),r.jsx("span",{className:"cwd__short",children:a})]}),l&&r.jsxs("div",{className:"cwd__pop",children:[r.jsx("span",{className:"cwd__full",children:a}),r.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?Ar:zi})]})]})}function vj({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const Sj=["low","medium","high"];function xy({models:a,value:l,effort:i,ultracode:c,thinking:o,switchOnFlag:d,className:h,onModel:p,onEffort:m,onUltracode:x,onThinking:y,onSwitchOnFlag:j}){const[v,C]=_.useState(!1),[k,L]=_.useState(0),U=_.useRef(null),P=_.useRef(null),M=a.find(A=>A.value===l)??null,Q=M&&M.supportsEffort?M.effortLevels.length>0?M.effortLevels:Sj:[],w=Q.includes("xhigh");_.useEffect(()=>{if(!v)return;const A=a.findIndex(V=>V.value===l);L(A===-1?0:A)},[v]),_.useEffect(()=>{if(!v)return;function A(V){var te;(te=U.current)!=null&&te.contains(V.target)||C(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[v]),_.useEffect(()=>{var A,V;v&&((V=(A=P.current)==null?void 0:A.querySelector(".is-cursor"))==null||V.scrollIntoView({block:"nearest"}))},[v,k]);function K(A){C(!1),A.value!==l&&p(A.value)}function z(A){if(A.key==="Escape"){if(!v)return;A.preventDefault(),A.stopPropagation(),C(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!v)return C(!0);if(a.length===0)return;const V=A.key==="ArrowDown"?1:a.length-1;return L(te=>(te+V)%a.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!v)return C(!0);const V=a[k];V&&K(V)}}return r.jsxs("div",{ref:U,className:"select"+(v?" select--open":"")+(h?` ${h}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":v,onClick:()=>C(A=>!A),onKeyDown:z,children:[r.jsx("span",{className:"select__value",children:(M==null?void 0:M.displayName)??l??"—"}),c?r.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):Q.length>0&&i&&r.jsx("span",{className:"select__suffix",children:i}),r.jsx(jj,{})]}),v&&r.jsxs("div",{ref:P,className:"select__menu modelmenu",role:"menu",children:[r.jsx("div",{className:"modelmenu__head",children:"Модель"}),a.map((A,V)=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":A.value===l,className:"select__option"+(V===k?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>L(V),onClick:()=>K(A),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),r.jsx("span",{className:"select__label",children:A.displayName}),A.description&&r.jsx("span",{className:"select__hint",children:A.description})]},A.value)),Q.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"modelmenu__sep",role:"separator"}),r.jsxs("div",{className:"modelmenu__row",children:[r.jsxs("span",{className:"modelmenu__label",children:["Усилие",r.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),r.jsx("span",{className:"modelmenu__levels",children:Q.map(A=>r.jsx("button",{type:"button",role:"menuitemradio","aria-checked":A===i,className:A===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>m(A),children:A},A))})]}),w&&r.jsx(yh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>x(!c)})]}),r.jsx("div",{className:"modelmenu__sep",role:"separator"}),(M==null?void 0:M.supportsThinking)!==!1&&r.jsx(yh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>y(!o)}),r.jsx(yh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>j(!d)})]})]})}function yh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[r.jsxs("span",{className:"modelmenu__label",children:[a,r.jsx("span",{className:"modelmenu__desc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function jj(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function El({title:a,children:l,actions:i,className:c,sheet:o=!1,onClose:d}){const h=_.useRef(null);return _.useEffect(()=>{function p(m){if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),d();return}if(m.key!=="Tab")return;const x=h.current;if(!x)return;const y=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.length-1];!j||!v||(m.shiftKey&&document.activeElement===j?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),j.focus()))}return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[d]),r.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&d()},children:r.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":a,children:[r.jsxs("div",{className:"modal__head",children:[r.jsx("h2",{className:"modal__title",children:a}),r.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),r.jsx("div",{className:"modal__body",children:l}),i&&r.jsx("div",{className:"modal__actions",children:i})]})})}function kj({candidates:a,searching:l,agentItems:i,agentBusy:c,error:o,roots:d,created:h,onSearch:p,onAskAgent:m,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[C,k]=_.useState("open"),[L,U]=_.useState(""),[P,M]=_.useState(!1),[Q,w]=_.useState(""),[K,z]=_.useState(""),[A,V]=_.useState({git:!0,claudeMd:!0,readme:!0}),te=L.trim(),oe=te!=="",F=Q.trim(),ae=K.trim(),me=F!==""&&ae!=="";_.useEffect(()=>{Q===""&&d.length>0&&w(d[0])},[d]);const Ae=_.useRef(p);Ae.current=p,_.useEffect(()=>{if(C!=="open")return;const se=L.trim(),pe=setTimeout(()=>Ae.current(se),200);return()=>clearTimeout(pe)},[L,C]);function be(){oe&&y(te)}function H(){me&&j(F,ae,A)}function re(){oe&&(M(!0),m(te))}return h?r.jsxs(El,{title:"Новый проект",onClose:v,actions:r.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[r.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),r.jsx("p",{className:"newproj__preview",children:h.path}),r.jsx("div",{className:"modal__error",children:r.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(se=>r.jsx("li",{children:se},se))})}),r.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):r.jsxs(El,{title:"Новый проект",className:P&&C==="open"?"modal--wide":void 0,onClose:v,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?r.jsxs(r.Fragment,{children:[c?r.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):r.jsx("button",{className:"btn",disabled:!oe,onClick:re,title:"Найти по описанию",children:"Попросить агента"}),r.jsx("button",{className:"btn btn--primary",disabled:!oe,onClick:be,children:"Открыть"})]}):r.jsx("button",{className:"btn btn--primary",disabled:!me,onClick:H,children:"Создать"})]}),children:[r.jsxs("div",{className:"tabs",children:[r.jsx(fx,{label:"Открыть",on:C==="open",onClick:()=>k("open")}),r.jsx(fx,{label:"Создать",on:C==="create",onClick:()=>k("create")})]}),C==="open"?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),r.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),r.jsx("input",{id:"workspace-path",className:"input input--mono",value:L,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:se=>U(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),be())}}),o&&r.jsx("p",{className:"modal__error",children:o}),a.length>0&&r.jsx("ul",{className:"finds",children:a.map(se=>r.jsx("li",{children:r.jsxs("button",{className:"find",disabled:se.open,title:se.open?"Этот проект уже открыт":se.path,onClick:()=>U(se.path),onDoubleClick:()=>y(se.path),children:[r.jsx("span",{className:"find__name",children:se.name}),r.jsx("span",{className:"find__path",children:se.path}),r.jsx("span",{className:"find__note",children:Tj(se)})]})},se.path))}),a.length===0&&oe&&!l&&!P&&r.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),P&&r.jsx("div",{className:"finds__agent",children:r.jsx(Ph,{items:i,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),r.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),r.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Q,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:se=>w(se.target.value)}),d.length>0&&r.jsx("div",{className:"newproj__roots",children:d.map(se=>r.jsx("button",{type:"button",className:se===F?"newproj__root is-on":"newproj__root",title:se,onClick:()=>w(se),children:wj(se)},se))}),r.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),r.jsx("input",{id:"workspace-name",className:"input input--mono",value:K,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:se=>z(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),H())}}),r.jsx("p",{className:"newproj__preview",children:me?Nj(F,ae):"Каталог появится здесь"}),o&&r.jsx("p",{className:"modal__error",children:o}),r.jsxs("div",{className:"newproj__opts",children:[r.jsx(_h,{label:"git init",desc:"панель истории работает сразу",on:A.git,onToggle:()=>V(se=>({...se,git:!se.git}))}),r.jsx(_h,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:A.claudeMd,onToggle:()=>V(se=>({...se,claudeMd:!se.claudeMd}))}),r.jsx(_h,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:A.readme,onToggle:()=>V(se=>({...se,readme:!se.readme}))})]})]})]})}function fx({label:a,on:l,onClick:i}){return r.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:i,children:a})}function _h({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:c,children:[r.jsxs("span",{className:"newproj__optlabel",children:[a,r.jsx("span",{className:"newproj__optdesc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function Nj(a,l){const i=a.includes("\\")?"\\":"/";return a.replace(/[\\/]+$/,"")+i+l}function wj(a){const l=a.includes("\\")?"\\":"/",i=a.split(/[\\/]/).filter(Boolean);return i.length<=2?a:`…${l}${i.slice(-2).join(l)}`}function Tj(a){return a.open?"уже открыт":a.why?a.why:a.sessions===0?"рядом с вашими проектами":`${Ej(a.sessions)}${Aj(a.lastUsedAt)}`}function Ej(a){const l=a%10,i=a%100;return i>=11&&i<=14?`${a} сессий`:l===1?`${a} сессия`:l>=2&&l<=4?`${a} сессии`:`${a} сессий`}function Aj(a){if(!a)return"";const l=Math.floor((Date.now()-a)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(a).toLocaleDateString("ru-RU")}`}const ep=7;function Cj(a){const l=[],i=[];let c=1;for(const o of a){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=dx(l),l[h]=o.hash);const[p,...m]=o.parents;l[h]=p??null;const x=[];p!==void 0&&x.push({from:h,to:h});for(const v of m){let C=l.indexOf(v);C===-1&&(C=dx(l),l[C]=v),x.push({from:h,to:C})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const C=d[v];!C||C===o.hash||v===h||l[v]===C&&j.push(v)}Rj(l),c=Math.max(c,l.length,h+1),i.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:i,columns:Math.min(c,ep)}}function dx(a){const l=a.indexOf(null);return l!==-1?l:(a.push(null),a.length-1)}function Rj(a){for(;a.length>0&&a[a.length-1]===null;)a.pop()}const yy=1500;function Mj(a){const l=[];let i=!1;for(const c of a.patch.split(`
118
- `)){if(l.length>=yy){i=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:Oj(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:a.path||a.oldPath,rows:l,added:a.added,removed:a.removed,note:Dj(a,i)}}function Oj(a){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(a);if(!l)return a;const i=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${i}–${i+c-1}`:`строка ${i}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Dj(a,l){const i=[];return a.status==="added"&&i.push("новый файл"),a.status==="deleted"&&i.push("файл удалён"),a.status==="renamed"&&i.push(`переименован из ${a.oldPath}`),a.binary?i.push("двоичный файл"):a.patch===""&&i.push("содержимое не показано"),l&&i.push(`показаны первые ${yy} строк`),i.length>0?i.join(" · "):null}function zj({open:a,state:l,result:i,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:p,onPush:m,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:C,zoomed:k,onToggleZoom:L}){const U=Cj((l==null?void 0:l.commits)??[]),P=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(M=>({value:M.name,label:M.name,hint:M.hash.slice(0,8)}))];return r.jsxs("aside",{className:(a?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:M=>{L&&(M.target.closest("button")||L())},children:[r.jsx(qj,{}),r.jsx("span",{className:"sidepane__title",children:"История"}),r.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),L&&r.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:L,children:r.jsx(Ir,{active:k})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:C,children:"✕"})]}),l===null?r.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"gitbar",children:r.jsx(ja,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:P,onChange:M=>{M&&p(M,`ветку ${M}`)}})}),l.detached&&r.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),r.jsx("div",{className:"gitbar__actions",children:o?r.jsxs("p",{className:"gitbar__busy",children:[r.jsx(Xj,{}),o]}):l.hasRemote?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:m,children:[r.jsx(Ij,{}),"Отправить",l.ahead>0&&r.jsx("span",{className:"gitbar__count",children:l.ahead})]}),r.jsxs("div",{className:"gitbar__group",children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[r.jsx(Gj,{}),"Забрать",l.behind>0&&r.jsx("span",{className:"gitbar__count",children:l.behind})]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:r.jsx(Yj,{})})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[r.jsx(px,{}),"Опубликовать на GitHub"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),r.jsxs("div",{className:"sidepane__scroll",children:[r.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:r.jsxs("span",{className:"gitrow__body",children:[r.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${Qj(l.changed.length)}`:"Рабочее дерево чистое"}),r.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(M=>$j(M.path)).join(", "):"незакоммиченных изменений нет"})]})}),U.rows.map(M=>r.jsx(Lj,{row:M,columns:U.columns,head:M.commit.hash===l.head,local:l.hasRemote&&!M.commit.pushed,active:c===M.commit.hash,onOpen:()=>h(M.commit.hash)},M.commit.hash)),U.rows.length===0&&r.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):r.jsxs("div",{className:"gitempty",children:[r.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[r.jsx(px,{}),"Опубликовать на GitHub"]}),r.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),r.jsx(Hi,{result:i,onDismiss:v})]})}const qc=50,hx=13;function Lj({row:a,columns:l,head:i,local:c,active:o,onOpen:d}){const{commit:h}=a,p=h.refs.map(Vj).filter(Boolean);return r.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[r.jsx(Uj,{row:a,columns:l,head:i,local:c}),r.jsxs("span",{className:"gitrow__body",children:[r.jsxs("span",{className:"gitrow__subject",children:[p.map(m=>r.jsx("span",{className:"gitrow__ref",children:m},m)),h.subject]}),r.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Zj(h.date),c&&r.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function Uj({row:a,columns:l,head:i,local:c}){const o=l*hx+6,d=qc/2,h=x=>8+Math.min(x,ep-1)*hx,p=c?"3.5 2.5":void 0,m=Co(a.col);return r.jsxs("svg",{className:"gitgraph",width:o,height:qc,viewBox:`0 0 ${o} ${qc}`,"aria-hidden":"true",children:[a.through.map(x=>r.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:qc,style:{stroke:Co(x)}},`t${x}`)),a.up.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Co(x.from),strokeDasharray:p}},`u${y}`)),a.down.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${qc}`,fill:"none",style:{stroke:Co(x.to),strokeDasharray:p}},`d${y}`)),i&&r.jsx("circle",{className:"gitgraph__head",cx:h(a.col),cy:d,r:a.commit.parents.length>1?7.4:6.6}),r.jsx("circle",{className:"gitgraph__dot",cx:h(a.col),cy:d,r:a.commit.parents.length>1?4.6:3.6,style:{stroke:m,fill:c?void 0:m}})]})}function Co(a){return`var(--lane-${a%ep})`}function Hj({detail:a,local:l,onCheckout:i,onClose:c}){const o=a.hash==="";return r.jsxs(El,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${a.shortHash}`,onClose:c,actions:r.jsxs(r.Fragment,{children:[!o&&r.jsx("button",{className:"btn",onClick:()=>i(a.hash,`коммит ${a.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),r.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&r.jsxs("div",{className:"commit__head",children:[r.jsx("p",{className:"commit__subject",children:a.subject}),r.jsxs("p",{className:"commit__meta",children:[a.author,a.email&&` <${a.email}>`," · ",Kj(a.date)," ·"," ",r.jsx("span",{className:"commit__hash",children:a.hash})]}),l&&r.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),a.parents.length>0&&r.jsxs("p",{className:"commit__meta",children:[a.parents.length>1?"слияние: ":"родитель: ",a.parents.map(d=>d.slice(0,8)).join(", ")]}),a.body&&r.jsx("pre",{className:"commit__body",children:a.body})]}),a.truncated&&r.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),a.files.length===0?r.jsx("p",{className:"modal__text",children:"Изменений нет."}):a.files.map(d=>r.jsx(Bj,{file:d,defaultOpen:a.files.length<=3},d.path+d.oldPath))]})}function Bj({file:a,defaultOpen:l}){const[i,c]=_.useState(l);return r.jsxs("div",{className:"commit__file",children:[r.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[r.jsx("span",{className:"commit__filepath",children:a.path||a.oldPath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]}),r.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&r.jsx(Wh,{diff:Mj(a)})]})}function qj(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Ij(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function Gj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function Yj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4"}),r.jsx("path",{d:"m13 13-2.6-2.6"})]})}function px(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r.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 Xj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Vj(a){return a.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function $j(a){const l=a.split("/");return l[l.length-1]??a}function Qj(a){const l=a%100;if(l>=11&&l<=14)return"файлов";switch(a%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Zj(a){const l=Date.parse(a);if(Number.isNaN(l))return a;const i=Math.round((Date.now()-l)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const c=Math.round(i/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Kj(a){const l=Date.parse(a);return Number.isNaN(l)?a:new Date(l).toLocaleString()}function mx(a){return a.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Jj({status:a,owners:l,files:i,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:p,onSaveToken:m,onPublish:x,onDismissResult:y,onClose:j}){var se;const[v,C]=_.useState(()=>mx(c)),[k,L]=_.useState(""),[U,P]=_.useState(""),[M,Q]=_.useState(!0),[w,K]=_.useState("Первый коммит"),[z,A]=_.useState(null),[V,te]=_.useState("");_.useEffect(()=>{!k&&l.length>0&&L(l[0].login)},[k,l]),_.useEffect(()=>{i&&z===null&&A(new Set(i.files))},[i,z]);const oe=(a==null?void 0:a.connected)===!0,F=l.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),ae=_.useMemo(()=>{if(!i)return[];const pe=V.trim().toLowerCase();return pe?i.files.filter(Ne=>Ne.toLowerCase().includes(pe)):i.files},[i,V]),me=(z==null?void 0:z.size)??0,Ae=oe&&v.trim()!==""&&k!==""&&d===""&&(o||me>0);function be(pe){A(Ne=>{const N=new Set(Ne??[]);return N.has(pe)?N.delete(pe):N.add(pe),N})}function H(pe){A(Ne=>{const N=new Set(Ne??[]);for(const $ of ae)pe?N.add($):N.delete($);return N})}function re(){if(!Ae)return;const pe=(i==null?void 0:i.files)??[];x({owner:k,name:v.trim(),description:U.trim(),private:M,include:o?[]:pe.filter(Ne=>z==null?void 0:z.has(Ne)),ignore:o?[]:pe.filter(Ne=>!(z!=null&&z.has(Ne))),message:o?"":w.trim()||"Первый коммит"})}return r.jsxs(El,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!Ae,onClick:re,children:d||"Опубликовать"})]}),children:[r.jsx(Fj,{status:a,onRefreshStatus:p,onSaveToken:m}),r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Имя"}),r.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:pe=>C(mx(pe.target.value))})]}),v.trim()===""&&r.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Владелец"}),l.length>1?r.jsx(ja,{className:"settings__select",value:k,options:F,onChange:L,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):r.jsx("p",{className:"publish__static",children:((se=l[0])==null?void 0:se.login)??"—"})]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Описание (необязательно)"}),r.jsx("input",{className:"input",value:U,placeholder:"о чём проект — одной строкой",onChange:pe=>P(pe.target.value)})]}),r.jsxs("div",{className:"field publish__field",children:[r.jsx("span",{children:"Видимость"}),r.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[r.jsx(gx,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:M,onClick:()=>Q(!0)}),r.jsx(gx,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!M,onClick:()=>Q(!1)})]})]})]}),!o&&r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),i===null?r.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"publish__filehead",children:[r.jsxs("span",{className:"publish__filecount",children:[me," из ",i.files.length," файлов"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>H(!0),children:"Отметить все"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>H(!1),children:"Снять все"})]}),i.files.length>8&&r.jsx("input",{className:"input publish__filter",value:V,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>te(pe.target.value)}),r.jsx("div",{className:"publish__filelist",children:ae.length===0?r.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ae.map(pe=>r.jsxs("button",{type:"button",role:"checkbox","aria-checked":(z==null?void 0:z.has(pe))===!0,className:"publish__file",onClick:()=>be(pe),children:[r.jsx("span",{className:"publish__box"+(z!=null&&z.has(pe)?" is-on":""),"aria-hidden":"true",children:(z==null?void 0:z.has(pe))&&"✓"}),r.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),i.truncated&&r.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Сообщение коммита"}),r.jsx("input",{className:"input",value:w,onChange:pe=>K(pe.target.value)})]})]})]}),r.jsx(Hi,{result:h,onDismiss:y})]})}function gx({title:a,desc:l,on:i,risky:c,onClick:o}){return r.jsxs("button",{type:"button",role:"radio","aria-checked":i,className:"access__card"+(i?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[a,c&&r.jsx("span",{className:"access__risk",children:"видно всем"})]}),r.jsx("span",{className:"access__desc",children:l})]})]})}function Fj({status:a,onRefreshStatus:l,onSaveToken:i}){const[c,o]=_.useState(""),[d,h]=_.useState(!1);return r.jsxs("div",{className:"publish__section publish__section--first",children:[r.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),a===null?r.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):a.connected?r.jsxs("div",{className:"publish__account",children:[r.jsx("span",{className:"chip chip--ok",children:a.login}),r.jsx("span",{className:"publish__accountvia",children:a.source==="gh"?"через GitHub CLI":"по личному токену"}),a.source==="token"&&r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>i(""),children:"Отключить токен"})]}):r.jsxs("div",{className:"publish__connect",children:[a.ghInstalled&&r.jsxs("p",{className:"modal__text",children:["В системе установлен ",r.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",r.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Личный токен GitHub"}),r.jsx(Wj,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(p=>!p),placeholder:"ghp_…"})]}),r.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",r.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",r.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),a.message&&r.jsx("p",{className:"modal__error",children:a.message}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>i(c.trim()),children:"Сохранить токен"})]})]})]})}function Wj({value:a,onChange:l,visible:i,onToggleVisible:c,placeholder:o,autoFocus:d}){return r.jsxs("div",{className:"pwfield",children:[r.jsx("input",{className:"input input--mono pwfield__input",type:i?"text":"password",value:a,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),r.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":i?"Скрыть токен":"Показать токен","aria-pressed":i,onClick:c,children:i?r.jsx(ek,{}):r.jsx(Pj,{})})]})}function Pj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function ek(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),r.jsx("path",{d:"M2 14 14 2"})]})}function tk({busy:a,result:l,onSubmit:i,onDismissResult:c,onClose:o}){const[d,h]=_.useState(""),p=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return r.jsxs(El,{title:"Подключить существующий репозиторий",onClose:o,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!p||a!=="",onClick:()=>i(d.trim()),children:a||"Подключить"})]}),children:[r.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",r.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Адрес репозитория"}),r.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Enter"&&p&&a===""&&i(d.trim())}})]}),r.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",r.jsx("code",{children:"https://…"}),", ",r.jsx("code",{children:"ssh://…"}),", ",r.jsx("code",{children:"git://…"})," и"," ",r.jsx("code",{children:"git@host:path"}),"."]}),r.jsx(Hi,{result:l,onDismiss:c})]})}function nk({open:a,items:l,busy:i,ready:c,commands:o,contextResult:d,draftKey:h,models:p,model:m,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:k,onModel:L,onEffort:U,onUltracode:P,onThinking:M,onSwitchOnFlag:Q,onAsk:w,onInterrupt:K,onReset:z,onClose:A,zoomed:V,onToggleZoom:te}){return r.jsxs("aside",{className:(a?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(V?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:oe=>{te&&(oe.target.closest("button")||te())},children:[r.jsx(lk,{}),r.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),r.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:z,children:"↻"}),te&&r.jsx("button",{className:"sidepane__btn",title:V?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":V?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":V,onClick:te,children:r.jsx(Ir,{active:V})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:A,children:"✕"})]}),p.length>0&&r.jsxs("div",{className:"sidepane__tools",children:[r.jsx(xy,{className:"select--compact",models:p,value:m,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onModel:L,onEffort:U,onUltracode:P,onThinking:M,onSwitchOnFlag:Q}),r.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),r.jsx(Ph,{items:l,busy:i,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),r.jsx(my,{className:"composer--side",disabled:!c,busy:i,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:a,attachmentsEnabled:!1,onContextSearch:C,onCommand:k,onSend:w,onInterrupt:K,onEscape:i?K:A})]})}function lk(){return r.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:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const ak=75,sk=90;function _y({usage:a}){if(!(a!=null&&a.available))return null;const l=[];return a.fiveHour&&l.push({key:"five",label:"5 ч",window:a.fiveHour}),a.sevenDay&&l.push({key:"week",label:"нед",window:a.sevenDay}),l.length===0?null:r.jsx("div",{className:"usage",title:ck(a),"aria-label":`Расход лимитов плана${a.plan?` ${a.plan}`:""}`,children:l.map(i=>r.jsx(ik,{label:i.label,window:i.window},i.key))})}function ik({label:a,window:l}){const i=Math.round(l.utilization),c=uk(l.resetsAt);return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"usage__label",children:a}),r.jsx("span",{className:"usage__track",role:"progressbar","aria-label":a,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`usage__fill${rk(i)}`,style:{width:`${i}%`}})}),r.jsxs("span",{className:"usage__pct",children:[i,"%"]}),r.jsx("span",{className:"usage__reset",title:jy(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function rk(a){return a>=sk?" usage__fill--over":a>=ak?" usage__fill--warn":""}function ck(a){const l=[a.plan?`Лимиты плана ${a.plan}`:"Лимиты плана"],i=(c,o)=>{if(!o)return;const d=jy(o.resetsAt);l.push(`${c}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return i("5 часов",a.fiveHour),i("Неделя",a.sevenDay),i("Неделя, Opus",a.sevenDayOpus),l.join(`
119
- `)}function vy(a){if(!a)return null;const l=new Date(a);return Number.isNaN(l.getTime())?null:l}function Sy(a){return a.getTime()-Date.now()<1440*60*1e3}function uk(a){const l=vy(a);return l?Sy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function jy(a){const l=vy(a);return l?`обнулится ${Sy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function ky(){const[a,l]=_.useState(()=>new Date);return _.useEffect(()=>{let i=0;const c=()=>{const d=new Date;l(d),i=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(i),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(i),document.removeEventListener("visibilitychange",o)}},[]),r.jsxs("time",{className:"clock",dateTime:a.toISOString(),title:ok(a),children:[r.jsx("span",{className:"clock__time",children:a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:"clock__date",children:a.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function ok(a){return a.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function fk({onClose:a,permission:l,model:i,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:p,metersFetchedAt:m,onRename:x}){return r.jsx(El,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:a,children:r.jsxs("div",{className:"sessionmenu",children:[l&&r.jsx(kr,{label:"Режим прав",children:l}),r.jsx(kr,{label:"Модель",children:i}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay)&&r.jsx(kr,{label:"Лимиты плана",children:r.jsx(_y,{usage:c})}),r.jsxs("button",{type:"button",className:p?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":p,disabled:p,onClick:h,children:[r.jsx(dk,{}),r.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",m&&r.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(m).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),r.jsx(kr,{label:"Время",children:r.jsx(ky,{})}),d&&r.jsx(kr,{label:"Стоимость хода",children:r.jsx("span",{className:"badge badge--cost",children:d})}),o&&r.jsx(kr,{label:"Каталог проекта",children:r.jsx(by,{path:o})}),x&&r.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"})]})})}function kr({label:a,children:l}){return r.jsxs("div",{className:"sessionmenu__row",children:[r.jsx("span",{className:"sessionmenu__label",children:a}),l]})}function dk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function hk({tab:a,servers:l,plugins:i,marketplaces:c,catalog:o,result:d,actions:h,onTab:p,onClose:m}){const x=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:i.length},{id:"catalog",label:"Каталог",count:o.length}];return r.jsxs(El,{title:"Расширения",className:"modal--wide",onClose:m,children:[r.jsx("div",{className:"tabs",role:"tablist",children:x.map(y=>r.jsxs("button",{role:"tab","aria-selected":a===y.id,className:a===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>p(y.id),children:[y.label,r.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),a==="mcp"&&r.jsx(pk,{servers:l,actions:h}),a==="plugins"&&r.jsx(yk,{plugins:i,marketplaces:c,actions:h}),a==="catalog"&&r.jsx(_k,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>p("plugins")}),r.jsx(Hi,{result:d})]})}function pk({servers:a,actions:l}){const[i,c]=_.useState(!1);return r.jsxs(r.Fragment,{children:[a.length===0&&!i&&r.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",r.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",r.jsx("code",{children:"claude mcp list"}),"."]}),r.jsx("ul",{className:"extlist",children:a.map(o=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:o.name}),r.jsx("span",{className:`chip chip--${gk(o.status)}`,children:mk[o.status]}),o.scope&&r.jsx("span",{className:"chip",children:o.scope}),o.transport&&r.jsx("span",{className:"chip",children:o.transport})]}),o.target&&r.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&r.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&r.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),i?r.jsx(bk,{onCancel:()=>c(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),c(!1)}}):r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const mk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function gk(a){return a==="connected"?"ok":a==="failed"?"bad":a==="needs-auth"?"warn":"mute"}function bk({onSubmit:a,onCancel:l}){const[i,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,p]=_.useState(""),[m,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",C=i.trim()!==""&&(v?h.trim()!=="":m.trim()!=="");function k(){if(C)if(v){const[L,...U]=xk(h);a(i.trim(),{transport:"stdio",command:L??"",args:U,env:bx(y)})}else a(i.trim(),{transport:o,url:m.trim(),headers:bx(y)})}return r.jsxs("div",{className:"extform extform--card",children:[r.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),r.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:L=>c(L.target.value)}),r.jsx("label",{className:"field",children:"Транспорт"}),r.jsx(ja,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:L=>d(L)}),v?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),r.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:L=>p(L.target.value)})]}):r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),r.jsx("input",{id:"mcp-url",className:"input input--mono",value:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:L=>x(L.target.value)})]}),r.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),r.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:L=>j(L.target.value)}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),r.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:k,children:"Подключить"})]})]})}function bx(a){const l={};for(const i of a.split(`
120
- `)){const c=i.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function xk(a){return(a.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function yk({plugins:a,marketplaces:l,actions:i}){const[c,o]=_.useState("");return r.jsxs(r.Fragment,{children:[a.length===0&&r.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),r.jsx("ul",{className:"extlist",children:a.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:d.name}),r.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&r.jsx("span",{className:"chip",children:d.version}),d.scope&&r.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&r.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&r.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),r.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),r.jsx("ul",{className:"extlist",children:l.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsx("div",{className:"extlist__head",children:r.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&r.jsx("div",{className:"extlist__meta",children:d.source}),r.jsx("div",{className:"extlist__actions",children:r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),r.jsxs("div",{className:"extform__row",children:[r.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),i.marketplaceAdd(c.trim()),o(""))}}),r.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{i.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const Ic=30;function _k({catalog:a,hasMarketplaces:l,actions:i,onMarketplaces:c}){const[o,d]=_.useState(""),[h,p]=_.useState(""),[m,x]=_.useState(Ic),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(a.map(L=>L.category).filter(Boolean))].sort(),[a]),C=_.useMemo(()=>{const k=o.trim().toLowerCase();return a.filter(L=>h&&L.category!==h?!1:k?`${L.name} ${L.displayName} ${L.description} ${L.author}`.toLowerCase().includes(k):!0)},[a,o,h]);return a.length===0?r.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",r.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"catalog__filters",children:[r.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),x(Ic)}}),r.jsx(ja,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{p(k),x(Ic)}})]}),C.length===0?r.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):r.jsx("ul",{className:"extlist",children:C.slice(0,m).map(k=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&r.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&r.jsx("span",{className:"chip",children:k.version}),k.category&&r.jsx("span",{className:"chip",children:k.category})]}),k.description&&r.jsx("div",{className:"catalog__desc",children:k.description}),r.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>i.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&r.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),C.length>m&&r.jsx("div",{className:"extbar",children:r.jsxs("button",{className:"btn",onClick:()=>x(k=>k+Ic),children:["Ещё ",Math.min(Ic,C.length-m)," из ",C.length-m]})}),r.jsxs("div",{className:"extform",children:[r.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),r.jsxs("div",{className:"extform__row",children:[r.jsx("input",{id:"plugin-spec",className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||y.trim()===""||(k.preventDefault(),i.pluginInstall(y.trim()),j(""))}}),r.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{i.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function vk({status:a,login:l,actions:i,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:p,onClose:m}){const[x,y]=_.useState(""),[j,v]=_.useState(!1),[C,k]=_.useState(!1),L=d!==null&&(a==null?void 0:a.loggedIn)===!0&&!C&&!j,U=_.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const Q=l.output.trim();return Q===""?null:{ok:!0,message:Q}},[l.error,l.output]);function P(Q=x){const w=Q.trim();w!==""&&(i.submitCode(w),y(""))}function M(){if(o>0){v(!1),k(!0);return}i.login("claudeai",!0)}return r.jsxs(El,{title:"Аккаунт",onClose:m,children:[a===null?r.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):a.loggedIn?r.jsxs("div",{className:"account",children:[r.jsx("div",{className:"account__id",children:a.email||"Вход выполнен"}),r.jsxs("div",{className:"account__chips",children:[r.jsx("span",{className:"chip chip--ok",children:kk[a.method]??a.method}),a.plan&&r.jsx("span",{className:"chip",children:a.plan})]}),a.organization&&r.jsx("div",{className:"extlist__meta",children:a.organization})]}):r.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",r.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?r.jsx(Nk,{login:l,remote:c,code:x,onCode:y,onSubmit:P,onCancel:i.cancel}):r.jsxs(r.Fragment,{children:[r.jsx(Hi,{result:U}),C&&r.jsx("p",{className:"account__warn",role:"alert",children:Sk(o)}),L&&h&&r.jsx("p",{className:"account__note",children:p}),r.jsx("div",{className:`extbar${a!=null&&a.loggedIn?" account__bar":""}`,children:a!=null&&a.loggedIn?r.jsxs(r.Fragment,{children:[L&&r.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
121
- ${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[r.jsx(jk,{}),"Переподключить"]}),C?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):r.jsx("button",{className:"btn",onClick:M,children:"Сменить аккаунт"}),j?r.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),i.logout()},children:"Точно выйти?"}):r.jsx("button",{className:"btn",onClick:()=>{k(!1),v(!0)},children:"Выйти"})]}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function Sk(a){const l=a%10,i=a%100,c=l===1&&i!==11,o=c?"сессия":l>=2&&l<=4&&(i<12||i>14)?"сессии":"сессий";return`${a} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function jk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const kk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Nk({login:a,remote:l,code:i,onCode:c,onSubmit:o,onCancel:d}){var k;const[h,p]=_.useState(null),m=_.useRef(""),x=_.useRef({code:i,onCode:c,onSubmit:o});x.current={code:i,onCode:c,onSubmit:o};const y=_.useCallback(async L=>{const{code:U,onCode:P,onSubmit:M}=x.current;if(L&&U.trim()!=="")return;const Q=await Oh();if(Q===null){L||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const w=Q.trim();if(!xx(w)){L||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(L){if(m.current===w)return;m.current=w}p(null),P(w),M(w)},[]);_.useEffect(()=>{if(!a.awaitingCode)return;const L=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",L),()=>document.removeEventListener("visibilitychange",L)},[a.awaitingCode,y]);const j=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",v=i.trim()!==""&&!xx(i),C=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return r.jsxs("div",{className:"account__flow",children:[a.url?l?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),r.jsx("a",{className:"btn btn--primary account__go",href:a.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),r.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),r.jsxs("div",{className:"account__raw",children:[r.jsx("span",{className:"account__rawurl",children:a.url}),r.jsx(Fh,{text:a.url,hint:"ссылку входа"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),r.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),r.jsxs("details",{className:"account__fallback",children:[r.jsx("summary",{children:"Браузер не открылся"}),r.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),r.jsx("a",{className:"account__link",href:a.url,target:"_blank",rel:"noreferrer",children:a.url})]})]}):r.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),a.awaitingCode&&r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),r.jsxs("div",{className:"extform__row account__coderow",children:[r.jsx("input",{id:"auth-code",className:"input input--mono",value:i,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:L=>{p(null),c(L.target.value)},onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),o())}}),j&&r.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:i.trim()==="",onClick:()=>o(),children:"Готово"})]}),C&&r.jsx("p",{className:"account__note account__note--code",children:C})]}),a.output.trim()!==""&&r.jsx("pre",{className:"account__log",children:a.output.trim()}),r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function xx(a){const l=a.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[i,c]=l.split("#");return!!i&&!!c&&!/\s/.test(l)}function wk({state:a,onPair:l,onUnpair:i,onClose:c}){const[o,d]=_.useState(""),[h,p]=_.useState(""),[m,x]=_.useState(!1),y=_.useRef(null),j=(a==null?void 0:a.paired)===!0;_.useEffect(()=>{var C;j||(C=y.current)==null||C.focus()},[j]),_.useEffect(()=>{x(!1),j&&d("")},[j,a==null?void 0:a.error]);const v=(a==null?void 0:a.url)??"https://claudevisual.com";return r.jsx(El,{title:"Удалённый доступ",onClose:c,children:j?r.jsxs("div",{className:"relay",children:[r.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",r.jsx("b",{children:yx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),r.jsxs("dl",{className:"relay__facts",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Имя"}),r.jsx("dd",{children:(a==null?void 0:a.name)??"—"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Связь"}),r.jsxs("dd",{children:[r.jsx("span",{className:a!=null&&a.connected?"dot dot--on":"dot"})," ",a!=null&&a.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Подключено"}),r.jsxs("dd",{children:[(a==null?void 0:a.clients)??0," вкладок"]})]})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),r.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),r.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):r.jsxs("div",{className:"relay",children:[r.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),r.jsxs("ol",{className:"relay__steps",children:[r.jsxs("li",{children:["Откройте ",r.jsx("b",{children:yx(v)})," и войдите (или зарегистрируйтесь)."]}),r.jsxs("li",{children:["Нажмите ",r.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),r.jsx("li",{children:"Введите его сюда."})]}),r.jsxs("form",{className:"relay__form",onSubmit:C=>{C.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Код сопряжения"}),r.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:C=>d(C.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Как назвать этот компьютер"}),r.jsx("input",{className:"input",value:h,onChange:C=>p(C.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||m,children:m?"Связываем…":"Связать"})]})]})})}function yx(a){try{return new URL(a).host}catch{return a}}const vh="",Tk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Ek=Dx.map(a=>({value:a.value,label:a.value,hint:a.hint})),Ro=3600*1e3,Ak=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],wr={"6h":6*Ro,"24h":24*Ro,"48h":48*Ro,"168h":168*Ro,never:0};function Ck(a){return wr[a]??wr["48h"]}function Rk(a){const l=Object.entries(wr).find(([,i])=>i===a);return l?l[0]:Object.keys(wr).reduce((i,c)=>Math.abs(wr[c]-a)<Math.abs(wr[i]-a)?c:i)}const Mk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Tr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Ok(a){return Tr[a]??Tr.off}function Dk(a){const l=Object.entries(Tr).find(([,i])=>i===a);return l?l[0]:Object.keys(Tr).reduce((i,c)=>Math.abs(Tr[c]-a)<Math.abs(Tr[i]-a)?c:i)}const zk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Lk({settings:a,models:l,relayState:i,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:p,onClose:m}){const x=a===null,y=!x&&a.terminalEnabled===!0,j=!y,v=_.useMemo(()=>{const k=[{value:vh,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(L=>({value:L.value,label:L.displayName,hint:L.description})):Tk];return a&&a.startModel!==null&&!k.some(L=>L.value===a.startModel)&&k.push({value:a.startModel,label:a.startModel}),k},[l,a]);function C(){var k,L;return(i==null?void 0:i.paired)!==!0?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:p,children:"Связать компьютер"})]}):(k=i.shell)!=null&&k.enabled?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",i.shell.confirmedAt&&` Включено ${new Date(i.shell.confirmedAt).toLocaleString()}.`]}),r.jsx("button",{type:"button",className:"btn btn--danger",disabled:j,onClick:h,children:"Запретить"})]}):(L=i.shell)!=null&&L.pending?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",r.jsx("b",{children:i.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),r.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Отправить письмо ещё раз"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Разрешить с телефона"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Прислать письмо"})]})]})}return r.jsx(El,{title:"Настройки",onClose:m,children:r.jsxs("div",{className:"settings",children:[r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),r.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(ja,{className:"settings__select",value:Rk(a.autoArchiveAfterMs),options:Ak,onChange:k=>o({autoArchiveAfterMs:Ck(k)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),r.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(ja,{className:"settings__select",value:Dk(a.autoSaveAfterPauseMs),options:Mk,onChange:k=>o({autoSaveAfterPauseMs:Ok(k)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),r.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Модель"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(ja,{className:"settings__select",value:a.startModel??vh,options:v,onChange:k=>o({startModel:k===vh?null:k}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(ja,{className:"settings__select",value:a.startPermissionMode,options:Ek,onChange:k=>o({startPermissionMode:k}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),r.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),r.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:zk.map(k=>{const L=!x&&a.folderAccess===k.value;return r.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:x,className:"access__card"+(L?" is-on":"")+(k.risky?" access__card--risky":""),onClick:()=>o({folderAccess:k.value}),children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[k.title,k.risky&&r.jsx("span",{className:"access__risk",children:"самое широкое"})]}),r.jsx("span",{className:"access__desc",children:k.description})]})]},k.value)})})]}),r.jsxs("section",{className:"settings__section",children:[r.jsxs("div",{className:"settings__switch-row",children:[r.jsxs("div",{className:"settings__switch-copy",children:[r.jsx("h3",{className:"settings__heading",children:"Терминал"}),r.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?r.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):r.jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-label":"Терминал",className:y?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!y}),children:r.jsx("span",{className:"switch__knob"})})]}),r.jsxs("div",{className:"settings__nested"+(j?" is-disabled":""),children:[r.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?r.jsx("p",{className:"settings__hint",children:"Загрузка…"}):r.jsxs(r.Fragment,{children:[j&&r.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),C()]})]})]})]})})}const Uk=16;function Hk({pane:a,width:l,onResize:i,onReset:c}){const o=Oi[a],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-m0):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function p(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;i(Math.min(j.max,j.width+v))}function m(y){d.current&&(d.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(),i(l+j*Uk*(o.side==="left"?1:-1)))}return r.jsx("div",{className:`pane-resizer pane-resizer--${a} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:p,onPointerUp:m,onPointerCancel:m,onDoubleClick:c,onKeyDown:x,children:r.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Bk=16;function qk({height:a,onResize:l,onReset:i}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-y0;return Math.round(a+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:a,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;l(y.height+j,y.max)}function p(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function m(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),l(a+y*Bk,o()))}return r.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":a,"aria-valuemin":Ux,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:i,onKeyDown:m,children:r.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function _x(){const a=document.documentElement,l=getComputedStyle(a),i=M=>l.getPropertyValue(M).trim(),c=i("--surface"),o=i("--text"),d=i("--text-2"),h=i("--muted"),p=i("--accent"),m=i("--accent-fg"),x=i("--select"),y=i("--danger"),j=i("--ok"),v=i("--warn"),C=i("--cm-fn"),k=i("--cm-key"),L=i("--cm-type"),U=vx(o,c,55),P=M=>vx(M,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:m,selectionBackground:x,black:U,brightBlack:h,red:y,brightRed:P(y),green:j,brightGreen:P(j),yellow:v,brightYellow:P(v),blue:C,brightBlue:P(C),magenta:k,brightMagenta:P(k),cyan:L,brightCyan:P(L),white:d,brightWhite:o}}function Ik(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ga=null;function Gk(a){return ga||(ga=document.createElement("span"),ga.style.position="fixed",ga.style.width="0",ga.style.height="0",ga.style.opacity="0",ga.style.pointerEvents="none",document.body.appendChild(ga)),ga.style.color=a,getComputedStyle(ga).color}function vx(a,l,i){return Gk(`color-mix(in srgb, ${a} ${100-i}%, ${l} ${i}%)`)}let Mo=null;function Yk(){return Mo||(Mo=Promise.all([Ye(()=>import("./xterm-D6Mng-DB.js").then(a=>a.x),__vite__mapDeps([22,23]),import.meta.url),Ye(()=>import("./addon-fit-CevVMrUA.js").then(a=>a.a),__vite__mapDeps([24,23]),import.meta.url),Ye(()=>import("./addon-web-links-CnB65OV_.js").then(a=>a.a),__vite__mapDeps([25,23]),import.meta.url),Ye(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([a,l,i])=>({Terminal:a.Terminal,FitAddon:l.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(a=>{throw Mo=null,a})),Mo}function Xk({terminals:a,activeId:l,blocked:i,error:c,onDismissError:o,height:d,offset:h,mobile:p=!1,zoomed:m,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:C,onResize:k,onAttach:L,onHide:U,registerSink:P}){const[M,Q]=_.useState(()=>_x());return _.useEffect(()=>{const w=new MutationObserver(()=>Q(_x()));return w.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>w.disconnect()},[]),r.jsxs("div",{className:"termpanel"+(p?" termpanel--mobile":"")+(!p&&m?" termpanel--zoomed":""),style:p?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:m?void 0:{height:d},children:[r.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:w=>{x&&(w.target.closest("button")||x())},children:[r.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:a.map(w=>r.jsxs("div",{role:"tab","aria-selected":w.id===l,className:"termtab"+(w.id===l?" is-on":"")+(w.exitCode!==null?" termtab--exited":""),onDoubleClick:K=>{x&&(K.target.closest(".termtab__close")||x())},children:[r.jsx("button",{className:"termtab__name",title:w.cwd,onClick:()=>y(w.id),children:w.title}),w.exitCode!==null&&r.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${w.exitCode}`,children:w.exitCode}),r.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${w.title}»`,onClick:()=>v(w.id),children:"✕"})]},w.id))}),r.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:j,children:"+"}),r.jsx("div",{className:"termpanel__spacer"}),x&&r.jsx("button",{className:"termpanel__zoom",title:m?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":m?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":m,onClick:x,children:r.jsx(Ir,{active:m})}),r.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:U,children:"✕"})]}),c&&a.length>0&&r.jsx(Sx,{message:c,strip:!0,onRetry:null,onDismiss:o}),r.jsxs("div",{className:"termpanel__body",children:[c&&a.length===0?r.jsx(Sx,{message:c,onRetry:i?null:j,onDismiss:o}):i?r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминал с удалённых устройств выключен"}),r.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):a.length===0&&r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминалов не открыто"}),r.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),a.map(w=>r.jsx($k,{id:w.id,exitCode:w.exitCode,active:w.id===l,theme:M,mobile:p,onInput:C,onResize:k,onAttach:L,registerSink:P},w.id))]})]})}function Sx({message:a,strip:l=!1,onRetry:i,onDismiss:c}){const{lede:o,hint:d,details:h}=Vk(a);return r.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[r.jsxs("div",{className:"termfail__text",children:[r.jsx("p",{className:"termfail__lede",children:o}),d&&r.jsx("p",{className:"termfail__hint",children:d}),h&&r.jsxs("details",{className:"termfail__details",children:[r.jsx("summary",{children:"Подробности"}),r.jsx("pre",{children:h})]})]}),r.jsxs("div",{className:"termfail__bar",children:[i&&r.jsx("button",{className:"btn btn--primary",onClick:i,children:"Открыть терминал"}),r.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function Vk(a){const[l="",...i]=a.trim().split(`
122
-
123
- `),c=l.split(`
124
- `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??a.trim(),hint:c.slice(1).join(" "),details:i.join(`
125
-
126
- `).trim()}}function $k({id:a,exitCode:l,active:i,theme:c,mobile:o,onInput:d,onResize:h,onAttach:p,registerSink:m}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!1),v=_.useRef(o);v.current=o;const C=_.useRef(c),k=_.useRef(l),[L,U]=_.useState("loading"),[P,M]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let w=!1,K=null;U("loading"),M(!1);const z=window.setTimeout(()=>{w||M(!0)},200);return(async()=>{var Ne;let A;try{A=await Yk()}catch{window.clearTimeout(z),w||U("error");return}if(w||!x.current)return;window.clearTimeout(z);const{Terminal:V,FitAddon:te,WebLinksAddon:oe}=A,F=new V({fontFamily:Ik()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ae=new te;F.loadAddon(ae),F.loadAddon(new oe),F.open(x.current),y.current=F,F.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 ce=F.getSelection();return ce?(N.preventDefault(),Br(ce),!1):!N.shiftKey}return N.key==="v"||N.key==="V"?(N.preventDefault(),Oh().then(ce=>{ce&&F.paste(ce)}),!1):!0});const me=N=>{N.preventDefault();const $=F.getSelection();if($){Br($),F.clearSelection();return}Oh().then(ce=>{ce&&F.paste(ce)})};(Ne=F.element)==null||Ne.addEventListener("contextmenu",me);const Ae=F.onData(N=>d(a,N));let be={cols:F.cols,rows:F.rows},H=null;const re=F.onResize(({cols:N,rows:$})=>{H!==null&&window.clearTimeout(H),H=window.setTimeout(()=>{H=null,!(N===be.cols&&$===be.rows)&&(be={cols:N,rows:$},h(a,N,$))},100)}),se=new ResizeObserver(()=>{try{ae.fit()}catch{return}v.current&&F.scrollToBottom()});se.observe(x.current);const pe=m(a,N=>{N.kind==="buffer"&&F.reset(),F.write(N.data)});p(a),k.current!==null&&!j.current&&(j.current=!0,F.write(`\r
127
- \x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
128
- `)),i&&F.focus(),K=()=>{var N;H!==null&&window.clearTimeout(H),se.disconnect(),(N=F.element)==null||N.removeEventListener("contextmenu",me),Ae.dispose(),re.dispose(),pe(),F.dispose(),y.current=null},U("ready")})(),()=>{w=!0,window.clearTimeout(z),K==null||K(),K=null}},[a]),_.useEffect(()=>{if(!o)return;const Q=x.current;if(!Q)return;let w=null,K=0,z=!1;const A=F=>{F.pointerType==="mouse"||w!==null||(w=F.pointerId,K=F.clientY,z=!1)},V=F=>{if(F.pointerId!==w)return;const ae=K-F.clientY;if(!z){if(Math.abs(ae)<4)return;z=!0,Q.setPointerCapture(F.pointerId)}K=F.clientY;const me=Q.querySelector(".xterm-viewport");me&&(me.scrollTop+=ae)},te=F=>{F.pointerId===w&&(Q.hasPointerCapture(F.pointerId)&&Q.releasePointerCapture(F.pointerId),w=null,z=!1)},oe=F=>F.stopPropagation();return Q.addEventListener("pointerdown",A),Q.addEventListener("pointermove",V),Q.addEventListener("pointerup",te),Q.addEventListener("pointercancel",te),Q.addEventListener("touchmove",oe,{capture:!0}),()=>{Q.removeEventListener("pointerdown",A),Q.removeEventListener("pointermove",V),Q.removeEventListener("pointerup",te),Q.removeEventListener("pointercancel",te),Q.removeEventListener("touchmove",oe,{capture:!0}),w!==null&&Q.hasPointerCapture(w)&&Q.releasePointerCapture(w)}},[o]),_.useEffect(()=>{C.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var Q;i&&((Q=y.current)==null||Q.focus())},[i]),_.useEffect(()=>{if(k.current=l,l===null){j.current=!1;return}if(j.current)return;const Q=y.current;Q&&(j.current=!0,Q.write(`\r
129
- \x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
130
- `))},[l]),r.jsxs("div",{className:"termview"+(i?" is-active":""),children:[r.jsx("div",{ref:x,className:"termview__surface"+(L==="ready"?"":" is-hidden")}),L==="loading"&&P&&r.jsxs("div",{className:"termview__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),L==="error"&&r.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[r.jsx("p",{children:"Не удалось загрузить терминал"}),r.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),r.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const Qk=2e5,Zk=75,Kk=90;function Jk({tokens:a,maxTokens:l,fetchedAt:i}){if(a===null)return null;const c=l??Qk,o=Math.min(100,Math.round(a/c*100)),d=`${a.toLocaleString()} из ${c.toLocaleString()} токенов${i?`
131
- обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return r.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[r.jsx("span",{className:"contextbar__label",children:"контекст"}),r.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`contextbar__fill${Fk(o)}`,style:{width:`${o}%`}})}),r.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Fk(a){return a>=Kk?" contextbar__fill--over":a>=Zk?" contextbar__fill--warn":""}const Ny="ccv:last-session",Wk=300*1e3,Pk=1e4;function eN(){try{const a=localStorage.getItem(Ny);if(!a)return null;const l=JSON.parse(a);if(typeof l!="object"||l===null)return null;const{workspaceId:i,sessionId:c,claudeSessionId:o}=l;return typeof i!="string"||typeof c!="string"?null:{workspaceId:i,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function tN(a,l){return a.id===l.sessionId?!0:l.claudeSessionId?a.id===l.claudeSessionId||a.claudeSessionId===l.claudeSessionId:!1}const nN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},jx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],lN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function kx(a,l,i){if(a===null)return null;const c=a.lastIndexOf("/");if(c===-1&&a!=="")return l;const o=i[c===-1?"":a.slice(0,c)];if(!o)return null;const d=a.slice(c+1).toLowerCase();return d===""?{query:a,entries:o}:{query:a,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,p)=>Nx(h.name,d)-Nx(p.name,d))}}function Nx(a,l){return a.toLowerCase().startsWith(l)?0:1}function wx(a,l){const i=a.find(o=>o.value===l)??a.find(o=>o.resolvedModel===l),c=l&&!i?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...a],selected:(i==null?void 0:i.value)??c??(a.some(o=>o.value==="default")?"default":"")}}function aN(){var ll;const a=_.useRef(null),[l,i]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[p,m]=_.useState(!1),x=_.useMemo(()=>zo()==="relay",[]),[y,j]=_.useState([]),[v,C]=_.useState([]),[k,L]=_.useState([]),[U,P]=_.useState([]),[M,Q]=_.useState(null),[w,K]=_.useState(null),[z,A]=_.useState(null),[V,te]=_.useState(pl),[oe,F]=_.useState(ah),[ae,me]=_.useState(!1),[Ae,be]=_.useState(!1),H=Zo("(max-width: 860px)"),[re,se]=_.useState(!1);_.useEffect(()=>{H||se(!1)},[H]);const[pe,Ne]=_.useState(!1),[N,$]=_.useState([]),[ce,he]=_.useState(!1),[we,ye]=_.useState(pl),[Me,at]=_.useState(null),[Ve,Mt]=_.useState(null),[Ie,bt]=_.useState([]),[We,Ze]=_.useState(null),[Ke,st]=_.useState(null),[Jn,Ht]=_.useState([]),[Bt,Qt]=_.useState([]),[qt,It]=_.useState([]),[Xt,it]=_.useState([]),[Nt,Pt]=_.useState(null),[wn,At]=_.useState(!1),[vn,Tn]=_.useState(null),[Ot,cn]=_.useState(null),[Zt,wt]=_.useState(!1),[un,ut]=_.useState(lN),[en,E]=_.useState(null),[Y,_e]=_.useState(null),[O,J]=_.useState(!1),[xe,,qe]=h0(),Tt=x0(),[Sn,jn]=_.useState(!1),[Ct,Al]=_.useState(null),[ka,Na]=_.useState(null),[$s,Ul]=_.useState(null),[Kl,on]=_.useState(null),[wa,gl]=_.useState(null),[rl,Kt]=_.useState(""),[Qe,Fn]=_.useState(null),[Qs,Bi]=_.useState([]),[Zs,Jl]=_.useState(!1),[Fl,Ta]=_.useState(null),[Wl,bl]=_.useState(!1),[tn,nn]=_.useState(!1),[ot,In]=_.useState({}),[Ea,Gn]=_.useState([""]),[Yn,Xn]=_.useState([]),[Pl,Wn]=_.useState(null),[Ks,En]=_.useState(null),[On,fn]=_.useState(null),[xt,Aa]=_.useState(null),[Gr,ea]=_.useState(null),[ta,Ca]=_.useState({}),[Ra,Dn]=_.useState({}),[xl,Hl]=_.useState(!1),[na,cl]=_.useState(null),[fe,T]=_.useState(null),I=_.useRef(0),ue=_.useRef(null),[ve,De]=_.useState(!1),[Le,ht]=_.useState([]),[dn,ln]=_.useState(null),[Rt,hn]=_.useState(null),Gt=_0(),la=S0(H&&ve),Cl=_.useRef(new Map),aa=(Ot==null?void 0:Ot.terminalEnabled)===!0,as=zo()==="relay"&&((ll=d==null?void 0:d.shell)==null?void 0:ll.enabled)!==!0,qi=_.useRef(!1),Js=_.useCallback((g,q)=>(Cl.current.set(g,q),()=>{Cl.current.get(g)===q&&Cl.current.delete(g)}),[]),[zn,Fs]=_.useState(!1),[ss,yl]=_.useState(null),[Ii,Ma]=_.useState(pl),[Rl,Oa]=_.useState(null),[sa,ia]=_.useState({}),pn=_.useRef([]),[pt,is]=_.useState(null);function Ws(g){is(q=>q===g?null:g)}_.useEffect(()=>{(H||pt==="terminal"&&!ve||pt==="files"&&!tn||pt==="search"&&!xl||pt==="git"&&!Sn||pt==="ask"&&!zn||pt==="main"&&Yn.length===0)&&is(null)},[pt,H,ve,tn,xl,Sn,zn,Yn.length]);const[Fo]=_.useState(eN),Gi=_.useRef(Fo),rs=_.useRef(!1),an=_.useRef(null),Vt=_.useRef(null),Yr=_.useRef(0);an.current=w,Vt.current=M,Yr.current=V.lastSeq;const Pc=_.useRef(oe);Pc.current=oe;const Bl=_.useRef(null),eu=_.useRef(0);eu.current=Ii.lastSeq;const cs=_.useRef(null),Yi=_.useRef(""),Ps=_.useRef(null),Da=_.useRef([]),tu=_.useRef([""]);Da.current=Yn,tu.current=Ea;const ei=_.useRef(new Map),ti=_.useRef(new Set),ni=_.useRef(null),li=_.useRef(null),nu=_.useRef(0),ai=_.useRef(new Set);_.useEffect(()=>{const g=r0();if(!g)return;a.current=g;const q=()=>{i(g.connected),o(g.statusText)};g.onStatus(q),g.onReconnect(()=>{q();const mt=an.current;mt&&g.send({type:"session.sync",sessionId:mt,sinceSeq:Yr.current});const $n=Bl.current;$n&&g.send({type:"session.sync",sessionId:$n,sinceSeq:eu.current})});const de=g.on(mt=>Xr(mt));g.connect();const Ue=window.setInterval(()=>{q(),g.connected&&g.send({type:"ping",nonce:Date.now()})},15e3);return()=>{de(),window.clearInterval(Ue),g.close()}},[]);const Xr=_.useCallback(g=>{var q,de,Ue,mt,$n,al,Ia;switch(g.type){case"hello.ok":i(!0);break;case"workspace.list":{j(g.workspaces),Q(Te=>{var Jt;if(Te)return Te;const Oe=Gi.current,lt=Oe&&g.workspaces.find(fi=>fi.id===Oe.workspaceId);return(lt==null?void 0:lt.id)??((Jt=g.workspaces[0])==null?void 0:Jt.id)??null});const Ce=Ps.current;if(!Ce)break;const je=g.workspaces.find(Te=>cN(Te.path,Ce));if(!je)break;Ps.current=null,Ne(!1),Q(je.id);break}case"workspace.candidates":if(g.query.trim()!==Yi.current)break;$(g.candidates),g.source==="host"&&he(!1);break;case"finder.opened":cs.current=g.sessionId;break;case"workspace.roots":bt(g.roots);break;case"workspace.created":if(Q(g.workspace.id),g.warnings.length===0){Ne(!1),Mt(null);break}Ze({path:g.workspace.path,warnings:g.warnings});break;case"session.list":if(g.workspaceId!==Vt.current)break;C(g.sessions),L(g.archived);break;case"session.pinned":P(g.sessions);break;case"session.summary":if(g.session.id===cs.current){at(g.session);break}if(g.session.parentSessionId){g.session.id===Bl.current&&Oa(g.session);break}C(Ce=>{const je=Ce.findIndex(Oe=>Oe.id===g.session.id);if(je===-1)return[g.session,...Ce];const Te=Ce.slice();return Te[je]=g.session,Te}),P(Ce=>{const je=Ce.findIndex(Oe=>Oe.id===g.session.id);if(je===-1)return Ce;const Te=Ce.slice();return Te[je]={...g.session,pinned:!0,...Ce[je].pinnedAt?{pinnedAt:Ce[je].pinnedAt}:{}},Te}),K(Ce=>Ce??g.session.id);break;case"usage.state":g.sessionId===an.current&&(E(g.usage),J(!1));break;case"context.state":g.sessionId===an.current&&(_e(g.context),J(!1));break;case"session.capabilities":g.sessionId===an.current&&A(g.capabilities);break;case"session.events":if(g.sessionId===Bl.current){Ma(Ce=>Lo(Ce,g.entries));break}if(g.sessionId===cs.current){ye(Ce=>Lo(Ce,g.entries));break}if(g.sessionId!==an.current)break;for(const Ce of g.entries){if(Ce.event.kind!=="rewound")continue;const je=Ce.event.toUserIndex,Te=f0(Pc.current.entries,je),Oe=Te.reduce((lt,Jt)=>Jt.event.kind==="user.message"?lt+1:lt,0);F(lt=>({...lt,entries:Te})),te(lt=>({...lt,items:d0(lt.items,je,Oe)}))}te(Ce=>Lo(Ce,g.entries));break;case"session.history":if(g.sessionId!==an.current)break;F(Ce=>c0(Ce,g));break;case"side.opened":{if(g.parentSessionId!==an.current)break;Bl.current=g.sessionId,yl(g.sessionId);const Ce=pn.current;pn.current=[];for(const je of Ce)je(g.sessionId);break}case"side.closed":if(g.parentSessionId!==an.current)break;Bl.current=null,yl(null),Ma(pl),Oa(null);break;case"git.state":if(g.workspaceId!==Vt.current)break;Al(g.state);break;case"git.commit":if(g.workspaceId!==Vt.current)break;Na(g.detail);break;case"git.result":if(g.workspaceId!==Vt.current)break;on({ok:g.ok,message:g.message,url:g.url}),g.ok&&(Na(null),Ul(null),Jl(!1),bl(!1));break;case"git.busy":if(g.workspaceId!==Vt.current)break;Kt(g.label);break;case"git.files":if(g.workspaceId!==Vt.current)break;Ta({files:g.files,truncated:g.truncated});break;case"github.status":Fn(g.status);break;case"github.owners":Bi(g.owners);break;case"fs.dir":if(g.workspaceId!==Vt.current)break;In(Ce=>({...Ce,[g.path]:g.entries}));break;case"fs.search":if(g.workspaceId!==Vt.current)break;if(g.scope!=="tree"){const Ce=g.scope;Dn(je=>({...je,[Ce]:{query:g.query,entries:g.entries}}));break}ea({query:g.query,entries:g.entries,truncated:g.truncated});break;case"fs.grep":if(g.workspaceId!==Vt.current)break;cl({query:g.query,matches:g.matches,truncated:g.truncated});break;case"fs.file":{if(g.workspaceId!==Vt.current)break;const Ce=ti.current.delete(g.file.path);Xn(Te=>{const Oe=Te.findIndex(fi=>fi.path===g.file.path);if(Oe===-1)return[...Te,$b(g.file,++nu.current)];const lt=Te[Oe],Jt=Te.slice();return Jt[Oe]=lt.saved===g.file.content&&!ts(lt)?{...lt,mtime:g.file.mtime,size:g.file.size,stale:!1}:$b(g.file,++nu.current),Jt}),Ce&&Wn(g.file.path);const je=ue.current;je&&je.path===g.file.path&&(ue.current=null,T({...je,token:++I.current}));break}case"fs.media":{if(g.workspaceId!==Vt.current)break;ai.current.delete(g.path),Xn(Ce=>Ce.map(je=>je.path===g.path?{...je,mediaBase64:g.base64,mediaError:void 0}:je));break}case"fs.mediaFailed":{if(g.workspaceId!==Vt.current)break;ai.current.delete(g.path),Xn(Ce=>Ce.map(je=>je.path===g.path?{...je,mediaError:g.message}:je));break}case"fs.saved":{if(g.workspaceId!==Vt.current)break;const Ce=ei.current.get(g.path);ei.current.delete(g.path);const je=Ce!==void 0;Xn(Oe=>Oe.map(lt=>lt.path!==g.path?lt:je?{...lt,saved:Ce,mtime:g.mtime,size:g.size,stale:!1}:{...lt,stale:!0}));const Te=Da.current.find(Oe=>Oe.path===g.path);!je&&Te&&!ts(Te)&&((q=a.current)==null||q.send({type:"fs.read",workspaceId:g.workspaceId,path:g.path})),(de=a.current)==null||de.send({type:"git.state",workspaceId:g.workspaceId});break}case"fs.result":{if(g.workspaceId!==Vt.current)break;if(En({ok:g.ok,message:g.message}),g.ok||ei.current.delete(g.path),g.conflict&&Xn(je=>je.map(Te=>Te.path===g.path?{...Te,stale:!0}:Te)),li.current===g.path){const je=li.current;li.current=null,g.ok&&(ti.current.add(je),(Ue=a.current)==null||Ue.send({type:"fs.read",workspaceId:g.workspaceId,path:je}))}const Ce=ni.current;if(g.ok&&Ce&&Ce.to===g.path){ni.current=null;const je=Te=>Te===Ce.from?Ce.to:Te.startsWith(`${Ce.from}/`)?Ce.to+Te.slice(Ce.from.length):Te;Xn(Te=>Te.map(Oe=>({...Oe,path:je(Oe.path)}))),Wn(Te=>Te===null?null:je(Te)),Gn(Te=>Te.map(je)),In(Te=>{const Oe={};for(const[lt,Jt]of Object.entries(Te))lt===Ce.from||lt.startsWith(`${Ce.from}/`)||(Oe[lt]=Jt);return Oe})}g.ok&&((mt=a.current)==null||mt.send({type:"git.state",workspaceId:g.workspaceId}));break}case"term.list":if(g.workspaceId!==Vt.current)break;ht(g.terminals);break;case"term.opened":if(g.terminal.workspaceId!==Vt.current)break;hn(null),ht(Ce=>{const je=Ce.findIndex(Oe=>Oe.id===g.terminal.id);if(je===-1)return[...Ce,g.terminal];const Te=Ce.slice();return Te[je]=g.terminal,Te}),qi.current&&(qi.current=!1,ln(g.terminal.id));break;case"term.buffer":($n=Cl.current.get(g.id))==null||$n({kind:"buffer",data:g.data});break;case"term.data":(al=Cl.current.get(g.id))==null||al({kind:"data",data:g.data});break;case"term.exit":ht(Ce=>Ce.map(je=>je.id===g.id?{...je,exitCode:g.exitCode}:je));break;case"term.closed":ht(Ce=>Ce.filter(je=>je.id!==g.id));break;case"mcp.list":g.sessionId===an.current&&Ht(g.servers);break;case"plugin.list":if(g.sessionId!==an.current)break;Qt(g.plugins),It(g.marketplaces),it(g.catalog);break;case"operation.result":g.sessionId===an.current&&Pt(g.result);break;case"auth.status":Tn(g.status);break;case"relay.state":h(g.state);break;case"settings.state":cn(g.settings);break;case"auth.login":ut(g.state),g.state.active&&At(!0);break;case"session.closed":C(Ce=>Ce.map(je=>je.id===g.sessionId?{...je,state:"closed"}:je));break;case"error":console.error("[host]",g.message,g.context??""),(g.context==="workspace.open"||g.context==="workspace.create")&&(Ps.current=null,Mt(g.message)),(Ia=g.context)!=null&&Ia.startsWith("term.")&&hn(g.message);break}},[]),ne=_.useCallback(g=>{var q;(q=a.current)==null||q.send(g)},[]);_.useEffect(()=>{M&&ne({type:"session.list",workspaceId:M})},[M,ne]),_.useEffect(()=>{l&&ne({type:"session.pins"})},[l,ne]),_.useEffect(()=>{l&&ne({type:"settings.get"})},[l,ne]),_.useEffect(()=>{if(rs.current)return;const g=Gi.current;if(!g||!M)return;if(M!==g.workspaceId){rs.current=!0;return}if(w){rs.current=!0;return}if(v.length===0)return;const q=v.find(de=>tN(de,g));rs.current=!0,q&&Xi(q)},[v,M,w]),_.useEffect(()=>{!M||as||!aa||ne({type:"term.list",workspaceId:M})},[M,as,aa,ne]),_.useEffect(()=>{ln(g=>{var q;return g&&Le.some(de=>de.id===g)?g:((q=Le[0])==null?void 0:q.id)??null})},[Le]),_.useEffect(()=>{pe&&ne({type:"workspace.roots"})},[pe,ne]);const us=_.useCallback(()=>{const g=an.current;g&&(J(!0),ne({type:"usage.get",sessionId:g}),ne({type:"context.get",sessionId:g}))},[ne]);_.useEffect(()=>{if(!O)return;const g=window.setTimeout(()=>J(!1),Pk);return()=>window.clearTimeout(g)},[O]);const Vr=_.useMemo(()=>{const g=Math.max((en==null?void 0:en.fetchedAt)??0,(Y==null?void 0:Y.fetchedAt)??0);return g>0?g:null},[en==null?void 0:en.fetchedAt,Y==null?void 0:Y.fetchedAt]),lu="Обновить лимиты и контекст"+(Vr?`
132
- обновлено в ${new Date(Vr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{if(_e(null),!w)return;us();const g=()=>{document.hidden||us()},q=window.setInterval(g,Wk),de=()=>{document.hidden||us()};return document.addEventListener("visibilitychange",de),()=>{window.clearInterval(q),document.removeEventListener("visibilitychange",de)}},[w,us]),_.useEffect(()=>{if(!w){F(ah);return}F({...ah,loading:!0}),ne({type:"session.history",sessionId:w})},[w,ne]);const Wo=_.useCallback(()=>{!w||oe.loading||!cb(oe)||(F(g=>({...g,loading:!0})),ne({type:"session.history",sessionId:w,before:Ox(oe)}))},[w,oe,ne]),Po=_.useMemo(()=>u0(oe.entries),[oe.entries]),Se=_.useMemo(()=>v.find(g=>g.id===w)??null,[v,w]),os=y.find(g=>g.id===M)??null;_.useEffect(()=>{if(!M||!w)return;const g={workspaceId:M,sessionId:w,claudeSessionId:(Se==null?void 0:Se.claudeSessionId)??null};try{localStorage.setItem(Ny,JSON.stringify(g))}catch{}},[M,w,Se==null?void 0:Se.claudeSessionId]);function ef(g){Ps.current=g,Mt(null),ne({type:"workspace.open",path:g})}function tf(g,q,de){Mt(null),ne({type:"workspace.create",parent:g,name:q,init:de})}function nf(g){if(Yi.current=g,!g){$([]),he(!1);return}he(!0),ne({type:"workspace.find",query:g})}function lf(g){Yi.current=g,ye(pl),ne({type:"workspace.find.agent",query:g})}function af(){Ne(!1),Mt(null),Ze(null),$([]),ye(pl),at(null),Yi.current="",Ps.current=null}function za(){const g=an.current;g&&Bl.current&&ne({type:"side.reset",sessionId:g}),Bl.current=null,yl(null),Ma(pl),Oa(null),ia({}),pn.current=[]}function si(g){ne({type:"workspace.close",workspaceIds:g}),!(!M||!g.includes(M))&&(za(),Q(null),K(null),C([]),L([]),te(pl),A(null),be(!1))}function sf(g,q){ne({type:"session.archive",workspaceId:g,sessionIds:q}),w&&(q.includes(w)||Se!=null&&Se.claudeSessionId&&q.includes(Se.claudeSessionId))&&(za(),K(null),te(pl),A(null),be(!1))}function au(){M&&(za(),K(null),A(null),te(pl),be(!1),ne({type:"session.start",workspaceId:M}),me(!1))}function $r(g){za(),vu(),Q(g),K(null),te(pl),A(null),be(!1),Al(null),Na(null),Ul(null),on(null),Kt(""),Jl(!1),Ta(null),bl(!1),ht([]),ln(null)}function su(g,q,de){ne({type:"session.pin",workspaceId:g,sessionIds:q,pinned:de})}function iu(g){g.workspaceId!==M&&$r(g.workspaceId),Xi(g)}function Xi(g){if(me(!1),za(),te(pl),A(null),be(!1),g.state==="closed"){K(null),ne({type:"session.start",workspaceId:g.workspaceId,resume:g.id});return}K(g.id),ne({type:"session.sync",sessionId:g.id,sinceSeq:0})}function La(g,q){ne({type:"session.rename",sessionId:g.id,title:q,workspaceId:g.workspaceId}),C(de=>de.map(Ue=>Ue.id===g.id?{...Ue,title:q}:Ue))}function ru(g){w&&(me(!1),Pt(null),st(g),ne({type:"mcp.list",sessionId:w}),ne({type:"plugin.list",sessionId:w}))}const rf={mcpAction:(g,q)=>{w&&(ne({type:"mcp.action",sessionId:w,name:g,action:q}),st(null))},mcpAdd:(g,q)=>{w&&ne({type:"mcp.add",sessionId:w,name:g,draft:q})},mcpRemove:g=>{w&&ne({type:"mcp.remove",sessionId:w,name:g})},pluginInstall:g=>{w&&ne({type:"plugin.install",sessionId:w,spec:g})},pluginUninstall:g=>{w&&ne({type:"plugin.uninstall",sessionId:w,id:g})},pluginToggle:(g,q)=>{w&&ne({type:"plugin.toggle",sessionId:w,id:g,enabled:q})},marketplaceAdd:g=>{w&&ne({type:"marketplace.add",sessionId:w,source:g})},marketplaceRemove:g=>{w&&ne({type:"marketplace.remove",sessionId:w,name:g})}};function cu(){me(!1),At(!0),ne({type:"auth.status"})}const Vi={login:(g,q)=>ne({type:"auth.login",mode:g,switchAccount:q}),submitCode:g=>ne({type:"auth.code",code:g}),cancel:()=>ne({type:"auth.cancel"}),logout:()=>ne({type:"auth.logout"})};function uu(){me(!1),wt(!0),ne({type:"settings.get"})}function ii(g){cn(q=>q&&{...q,...g}),ne({type:"settings.update",settings:g})}function ri(g){w&&ne({type:"side.ask",sessionId:w,text:g})}function cf(){w&&(ne({type:"side.reset",sessionId:w}),Bl.current=null,yl(null),Ma(pl),Oa(null),ia({}),pn.current=[])}function ra(g){const q=Bl.current;if(q){g(q);return}const de=an.current;de&&(pn.current.push(g),ne({type:"side.open",sessionId:de}))}function Qr(){M&&ne({type:"git.state",workspaceId:M})}function ou(g){M&&(Ul(g),ne({type:"git.show",workspaceId:M,ref:g}))}function $i(g,q){on(null),gl({target:g,label:q})}function Zr(){!M||!wa||(ne({type:"git.checkout",workspaceId:M,target:wa.target}),gl(null))}function fu(){M&&(on(null),ne({type:"git.push",workspaceId:M}))}function du(g){M&&(on(null),ne({type:"git.pull",workspaceId:M,merge:g}))}function hu(){M&&(on(null),Ta(null),Jl(!0),ne({type:"github.status"}),ne({type:"github.owners"}),ne({type:"git.files",workspaceId:M}))}function uf(g){M&&(on(null),ne({type:"git.publish",workspaceId:M,...g}))}function of(g){M&&(on(null),ne({type:"git.remote",workspaceId:M,url:g}))}function ff(){on(null),bl(!0)}function df(g){ne({type:"github.token",token:g}),ne({type:"github.owners"})}function hf(){ne({type:"github.status"}),ne({type:"github.owners"})}_.useEffect(()=>{if(!(!tn||!M))for(const g of Ea)g in ot||ne({type:"fs.list",workspaceId:M,path:g})},[tn,Ea,ot,M,ne]);function Pn(g){Gn(q=>q.includes(g)?q.filter(de=>de!==g):[...q,g])}function ci(g){if(!g){ea(null);return}M&&ne({type:"fs.search",workspaceId:M,query:g})}function pu(g){if(!g){cl(null);return}M&&ne({type:"fs.grep",workspaceId:M,query:g})}const Kr=_.useCallback((g,q)=>{Ca(mt=>({...mt,[g]:q}));const de=Vt.current;if(q===null||!de)return;const Ue=q.lastIndexOf("/");if(Ue!==-1){ne({type:"fs.list",workspaceId:de,path:q.slice(0,Ue)});return}if(q===""){ne({type:"fs.list",workspaceId:de,path:""});return}ne({type:"fs.search",workspaceId:de,query:q,scope:g})},[ne]),mu=_.useMemo(()=>kx(ta.mention??null,Ra.mention??null,ot),[ta.mention,Ra.mention,ot]),gu=_.useMemo(()=>kx(ta.side??null,Ra.side??null,ot),[ta.side,Ra.side,ot]);function Jr(g){ca(g.path,{line:g.line,column:g.column})}function pf(g){const q=[];let de=Di(g.path);for(;q.push(de),!!de;)de=Di(de);Gn(Ue=>{const mt=new Set(Ue);for(const $n of q)mt.add($n);return g.kind==="dir"&&mt.add(g.path),[...mt]}),g.kind==="file"&&ca(g.path)}function ca(g,q){if(Da.current.find(Ue=>Ue.path===g)){Wn(g),q&&T({path:g,...q,token:++I.current});return}M&&(q&&(ue.current={path:g,...q}),ti.current.add(g),ne({type:"fs.read",workspaceId:M,path:g}))}function ui(g,q=!1){const de=Da.current,Ue=de.find(al=>al.path===g);if(Ue&&ts(Ue)&&!q){Aa(g);return}Aa(null);const mt=de.findIndex(al=>al.path===g),$n=de.filter(al=>al.path!==g);Xn($n),Wn(al=>{var Ia;return al===g?((Ia=$n[Math.min(mt,$n.length-1)])==null?void 0:Ia.path)??null:al})}function ua(g,q=!1){const de=Da.current.find(Ue=>Ue.path===g);!de||!M||!q&&!ts(de)||(ei.current.set(g,de.text),ne({type:"fs.write",workspaceId:M,path:g,content:de.text,eol:de.eol,encoding:de.encoding,baseMtime:de.mtime,...q?{force:!0}:{}}))}function Fr(g){M&&ne({type:"fs.read",workspaceId:M,path:g})}function bu(g){M&&(ai.current.has(g)||(ai.current.add(g),ne({type:"fs.readMedia",workspaceId:M,path:g})))}const Ua=_.useRef(new Map);function fs(g){const q=Ua.current,de=q.get(g);de&&clearTimeout(de);const Ue=(Ot==null?void 0:Ot.autoSaveAfterPauseMs)??0;Ue<=0||q.set(g,setTimeout(()=>{q.delete(g);const mt=Da.current.find($n=>$n.path===g);mt&&ts(mt)&&!mt.stale&&ua(g)},Ue))}function Wr(g,q,de){if(!M)return;const Ue=g?`${g}/${de}`:de;En(null),q==="file"&&(li.current=Ue),ne({type:"fs.create",workspaceId:M,path:Ue,kind:q})}function xu(g,q){if(!M)return;const de=Di(g),Ue=de?`${de}/${q}`:q;En(null),ni.current={from:g,to:Ue},ne({type:"fs.rename",workspaceId:M,path:g,to:Ue})}function Ha(g,q){if(!M)return;const de=g.slice(g.lastIndexOf("/")+1),Ue=q?`${q}/${de}`:de;Ue!==g&&(En(null),ni.current={from:g,to:Ue},ne({type:"fs.rename",workspaceId:M,path:g,to:Ue}))}function yu(g,q){M&&(En(null),ne({type:"fs.copy",workspaceId:M,path:g,toDir:q}))}function _u(g){M&&(En(null),fn(null),ne({type:"fs.delete",workspaceId:M,path:g.path}),Xn(q=>q.filter(de=>de.path!==g.path&&!de.path.startsWith(`${g.path}/`))),Wn(q=>q&&(q===g.path||q.startsWith(`${g.path}/`))?null:q))}function vu(){In({}),Gn([""]),Xn([]),Wn(null),En(null),ea(null),cl(null),Ca({}),Dn({}),T(null),ti.current.clear(),ei.current.clear(),ai.current.clear(),ue.current=null,ni.current=null,li.current=null}function mf(){!M||as||!aa||(hn(null),qi.current=!0,ne({type:"term.open",workspaceId:M,cols:80,rows:24}))}function gf(g){ne({type:"term.close",id:g})}function bf(g,q){w&&ne({type:"permission.respond",sessionId:w,requestId:g,decision:q})}function Su(g,q){w&&ne({type:"permission.respond",sessionId:w,requestId:g,decision:"allow",answers:q})}function ju(g){w&&ne({type:"permission.respond",sessionId:w,requestId:g,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Pr(g,q){w&&ne({type:"permission.respond",sessionId:w,requestId:g,decision:"allow",plan:q})}function _l(g){w&&ne({type:"permission.respond",sessionId:w,requestId:g,decision:"deny",reason:"Пользователь просит продолжить планирование"})}_.useEffect(()=>{function g(q){if(q.key!=="Escape")return;if(pt!==null){const Ue=q.target;if(!(Ue instanceof HTMLElement&&Ue.closest(".termview, .editor, .sidepane"))){is(null);return}}if(!w||V.pending.length>0)return;const de=q.target;de instanceof HTMLElement&&de.closest(".sidepane, .editor")||ne({type:"control.interrupt",sessionId:w})}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[w,V.pending.length,ne,pt]),_.useEffect(()=>{function g(q){q.key!=="`"||!(q.ctrlKey||q.metaKey)||aa&&(q.preventDefault(),De(de=>!de))}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[aa]);const oi=_.useMemo(()=>{const g=(z==null?void 0:z.commands)??[];return g.length===0?g:[...g,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...jx]},[z]);function el(g){const q=nN[g];return q?(ru(q),!0):jx.some(de=>de.name===g)?(cu(),g==="logout"&&Vi.logout(),g==="switch-account"&&Vi.login("claudeai",!0),!0):!1}const ql=(Se==null?void 0:Se.state)==="waiting_permission",tl=(Se==null?void 0:Se.state)==="reconnecting",Vn=(Se==null?void 0:Se.state)==="running"||tl||ql,An=V.pending[0]??null,Qi=An?_j(An.toolName,An.input):null;_.useEffect(()=>{!Sn&&!tn||!M||Vn||ne({type:"git.state",workspaceId:M})},[Sn,tn,M,Vn,ne]),_.useEffect(()=>{if(!(Vn||!M)){tn&&In(g=>{const q={};for(const[de,Ue]of Object.entries(g))tu.current.includes(de)||(q[de]=Ue);return q});for(const g of Da.current)ts(g)||ne({type:"fs.read",workspaceId:M,path:g.path})}},[Vn,M,tn,ne]);const Il=(Se==null?void 0:Se.cwd)??(z==null?void 0:z.cwd)??null,ec=(z==null?void 0:z.models)??[],Ba=(Se==null?void 0:Se.model)??(z==null?void 0:z.model)??null,{rows:qa,selected:xf}=wx(ec,Ba),kn=Rl?{model:Rl.model,effort:Rl.effort,ultracode:Rl.ultracode,thinking:Rl.thinking,switchOnFlag:Rl.switchModelsOnFlag}:{model:sa.model??Ba,effort:sa.effort??(Se==null?void 0:Se.effort)??null,ultracode:sa.ultracode??(Se==null?void 0:Se.ultracode)??!1,thinking:sa.thinking??(Se==null?void 0:Se.thinking)??!0,switchOnFlag:sa.switchOnFlag??(Se==null?void 0:Se.switchModelsOnFlag)??!0},Zi=wx(ec,kn.model),Gl=(Rl==null?void 0:Rl.state)==="running",Ki=Pl?Yn.find(g=>g.path===Pl)??null:null,Ji=new Set(Yn.filter(ts).map(g=>g.path)),vl=g=>r.jsx(Hk,{pane:g,width:Tt.widths[g],onResize:q=>Tt.setWidth(g,q),onReset:()=>Tt.reset(g)}),oa=g=>H?null:()=>Ws(g),tc=z&&r.jsx(ja,{title:"Режим прав",value:(Se==null?void 0:Se.permissionMode)??"default",options:Dx.map(g=>({value:g.value,label:g.value,hint:g.hint})),onChange:g=>{w&&ne({type:"control.set_mode",sessionId:w,mode:g})}}),Fi=qa.length>0?r.jsx(xy,{models:qa,value:xf,effort:(Se==null?void 0:Se.effort)??null,ultracode:(Se==null?void 0:Se.ultracode)??!1,thinking:(Se==null?void 0:Se.thinking)??!0,switchOnFlag:(Se==null?void 0:Se.switchModelsOnFlag)??!0,onModel:g=>{!w||!g||ne({type:"control.set_model",sessionId:w,model:g})},onEffort:g=>{w&&ne({type:"control.set_effort",sessionId:w,effort:g})},onUltracode:g=>{w&&ne({type:"control.set_ultracode",sessionId:w,enabled:g})},onThinking:g=>{w&&ne({type:"control.set_thinking",sessionId:w,enabled:g})},onSwitchOnFlag:g=>{w&&ne({type:"control.set_flag_switch",sessionId:w,enabled:g})}}):Ba&&r.jsx("span",{className:"badge",children:Ba}),nc=Vn&&r.jsx("span",{className:ql?"badge badge--wait":"badge badge--live",children:ql?"ждёт":tl?"переподключается":"работает"}),nl=()=>{w&&ne({type:"session.reconnect",sessionId:w})},ds=tl?"Сессия уже поднимает новый процесс":Vn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",hs=w&&(tl||(Se==null?void 0:Se.state)==="error")?r.jsxs("div",{className:tl?"relink":"relink relink--error",role:"status",children:[r.jsxs("span",{className:"relink__msg",children:[r.jsx("span",{className:"relink__dot","aria-hidden":"true"}),tl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),r.jsx("button",{className:"btn btn--sm",title:tl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:nl,children:tl?"Переподключить сейчас":"Переподключить"})]}):null,ps=Se&&Se.totalCostUsd>0?`$${Se.totalCostUsd.toFixed(3)}`:null,ms=r.jsx("button",{className:zn?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":zn,onClick:()=>Fs(g=>!g),children:r.jsx(oN,{})});return r.jsxs("div",{className:"app",style:Tt.style,children:[r.jsx(aS,{open:ae,connected:l,status:c,workspaces:y,sessions:v.filter(g=>g.workspaceId===M),archived:k.filter(g=>g.workspaceId===M),pinned:U,activeWorkspaceId:M,activeSessionId:w,onPinSessions:su,onSelectPinned:iu,onCloseWorkspaces:si,onArchiveSessions:sf,onUnarchiveSessions:g=>{M&&ne({type:"session.unarchive",workspaceId:M,sessionIds:g})},onSelectWorkspace:$r,onSelectSession:Xi,onRenameSession:La,onOpenWorkspace:()=>Ne(!0),onNewSession:au,onOpenExtensions:w?()=>ru("mcp"):null,account:vn,onOpenAccount:cu,relay:d,onOpenRelay:x?null:()=>m(!0),onOpenSettings:uu,themeMode:xe,onCycleTheme:qe}),vl("sidebar"),ae&&r.jsx("div",{className:"scrim",onClick:()=>me(!1)}),r.jsx(T1,{open:tn,tree:ot,expanded:new Set(Ea),activePath:Pl,dirty:Ji,gitChanges:(Ct==null?void 0:Ct.changed)??[],result:Ks,searchResult:Gr,onSearch:ci,onReveal:pf,onToggle:Pn,onOpen:ca,onCreate:Wr,onRename:xu,onMove:Ha,onCopy:yu,onDelete:fn,onRefresh:()=>{En(null),In({}),Qr()},onClose:()=>nn(!1),zoomed:pt==="files",onToggleZoom:oa("files")}),tn&&pt!=="files"&&vl("files"),r.jsx(U1,{open:xl,result:na,onSearch:pu,onOpenMatch:Jr,onClose:()=>Hl(!1),zoomed:pt==="search",onToggleZoom:oa("search")}),xl&&pt!=="search"&&vl("search"),r.jsx(zj,{open:Sn,state:Ct,result:Kl,selected:$s,busy:rl,onRefresh:Qr,onShow:ou,onCheckout:$i,onPush:fu,onPull:du,onPublish:hu,onConnectRemote:ff,onDismissResult:()=>on(null),onClose:()=>jn(!1),zoomed:pt==="git",onToggleZoom:oa("git")}),Sn&&pt!=="git"&&vl("git"),r.jsxs("main",{className:pt==="main"||pt==="terminal"?"main main--zoomed":"main",children:[r.jsxs("header",{className:"topbar",children:[r.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>me(!0),children:"☰"}),r.jsx("button",{className:tn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":tn,onClick:()=>{nn(g=>!g),jn(!1),Hl(!1)},children:r.jsx(sN,{})}),r.jsx("button",{className:xl?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":xl,onClick:()=>{Hl(g=>!g),nn(!1),jn(!1)},children:r.jsx(iN,{})}),r.jsx("button",{className:Sn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Sn,onClick:()=>{jn(g=>!g),nn(!1),Hl(!1)},children:r.jsx(rN,{})}),aa&&r.jsx("button",{className:ve?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ve,onClick:()=>De(g=>!g),children:r.jsx(uN,{})}),H&&ms,H&&r.jsx("button",{className:re?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":re,onClick:()=>se(!0),children:r.jsx(fN,{})}),r.jsxs("div",{className:"topbar__id",children:[Ae&&Se?r.jsx(Jc,{className:"rename--title",value:Se.title??"",onCommit:g=>{La(Se,g),be(!1)},onCancel:()=>be(!1)}):r.jsxs("div",{className:"topbar__head",children:[r.jsx("button",{className:"topbar__title",disabled:!Se||H,title:Se&&!H?"Переименовать сессию":void 0,onClick:()=>be(!0),children:(Se==null?void 0:Se.title)??"Claude Code Visual"}),os&&r.jsx("span",{className:"topbar__project",title:os.path,children:os.name})]}),H?nc:Il&&r.jsx(by,{path:Il})]}),!H&&r.jsxs("div",{className:"topbar__tools",children:[r.jsx("button",{type:"button",className:O?"meters-refresh is-busy":"meters-refresh",title:lu,"aria-label":"Обновить лимиты и контекст","aria-busy":O,disabled:!w||O,onClick:us,children:r.jsx(dN,{})}),r.jsx(_y,{usage:en}),r.jsx(ky,{}),tc,Fi,nc,ps&&r.jsx("span",{className:"badge badge--cost",children:ps}),ms]})]}),r.jsx(Jk,{tokens:(Y==null?void 0:Y.tokens)??V.contextTokens,maxTokens:(Y==null?void 0:Y.maxTokens)??null,fetchedAt:(Y==null?void 0:Y.fetchedAt)??null}),H&&re&&r.jsx(fk,{onClose:()=>se(!1),permission:tc,model:Fi,usage:en,cwd:Il,costLabel:ps,onRefresh:us,refreshing:O,metersFetchedAt:Vr,onRename:Se?()=>{be(!0),se(!1)}:null}),Yn.length>0&&r.jsx(nS,{files:Yn,activePath:Pl,busy:Vn,onSelect:Wn,onClose:g=>ui(g),zoomed:pt==="main",onToggleZoom:oa("main")}),Ki?r.jsx(eS,{file:Ki,goto:(fe==null?void 0:fe.path)===Ki.path?fe:null,onChange:(g,q)=>{Xn(de=>de.map(Ue=>Ue.path===g?{...Ue,text:q}:Ue)),fs(g)},onSave:g=>ua(g),onReload:Fr,onOverwrite:g=>ua(g,!0),onRequestMedia:bu,onTogglePreview:g=>Xn(q=>q.map(de=>de.path===g?{...de,previewMode:!de.previewMode}:de))}):r.jsxs(r.Fragment,{children:[r.jsx(Ph,{items:V.items,busy:Vn&&!tl,waiting:ql,history:Po,historyHasMore:cb(oe),historyLoading:oe.loading,onLoadHistory:Wo,sessionId:w??void 0,onEditMessage:(g,q,de)=>{w&&ne({type:"prompt.edit",sessionId:w,userIndex:g,text:q,images:de})}}),hs,r.jsx(my,{disabled:!w,busy:Vn&&!tl,placeholder:tl?"Промпт уйдёт, как только связь вернётся":void 0,commands:oi,sessionTitle:(Se==null?void 0:Se.title)??null,contextResult:mu,draftKey:w,onContextSearch:g=>Kr("mention",g),onCommand:el,onSend:(g,q)=>{w&&ne({type:"prompt.send",sessionId:w,text:g,images:q})},onInterrupt:()=>{w&&ne({type:"control.interrupt",sessionId:w})}})]}),ve&&aa&&r.jsxs(r.Fragment,{children:[!H&&pt!=="terminal"&&r.jsx(qk,{height:Gt.height,onResize:Gt.setHeight,onReset:Gt.reset}),r.jsx(Xk,{mobile:H,zoomed:pt==="terminal",onToggleZoom:oa("terminal"),terminals:Le,activeId:dn,blocked:as,error:Rt,onDismissError:()=>hn(null),height:H?la.height:Gt.height,offset:H?{top:la.offsetTop,left:la.offsetLeft}:void 0,onSelect:ln,onOpen:mf,onClose:gf,onInput:(g,q)=>ne({type:"term.input",id:g,data:q}),onResize:(g,q,de)=>ne({type:"term.resize",id:g,cols:q,rows:de}),onAttach:g=>ne({type:"term.attach",id:g}),onHide:()=>De(!1),registerSink:Js})]})]}),r.jsx(nk,{open:zn,items:Ii.items,busy:Gl,ready:w!==null,commands:oi,contextResult:gu,draftKey:w,models:Zi.rows,model:Zi.selected,effort:kn.effort,ultracode:kn.ultracode,thinking:kn.thinking,switchOnFlag:kn.switchOnFlag,onContextSearch:g=>Kr("side",g),onCommand:el,onModel:g=>{g&&(ia(q=>({...q,model:g})),ra(q=>ne({type:"control.set_model",sessionId:q,model:g})))},onEffort:g=>{ia(q=>({...q,effort:g,ultracode:!1})),ra(q=>ne({type:"control.set_effort",sessionId:q,effort:g}))},onUltracode:g=>{ia(q=>({...q,ultracode:g,...g?{effort:"xhigh"}:{}})),ra(q=>ne({type:"control.set_ultracode",sessionId:q,enabled:g}))},onThinking:g=>{ia(q=>({...q,thinking:g})),ra(q=>ne({type:"control.set_thinking",sessionId:q,enabled:g}))},onSwitchOnFlag:g=>{ia(q=>({...q,switchOnFlag:g})),ra(q=>ne({type:"control.set_flag_switch",sessionId:q,enabled:g}))},onAsk:ri,onInterrupt:()=>{ss&&ne({type:"control.interrupt",sessionId:ss})},onReset:cf,onClose:()=>Fs(!1),zoomed:pt==="ask",onToggleZoom:oa("ask")}),zn&&pt!=="ask"&&vl("ask"),(Sn||zn||tn||xl)&&r.jsx("div",{className:"scrim scrim--pane",onClick:()=>{jn(!1),Fs(!1),nn(!1),Hl(!1)}}),ka&&r.jsx(Hj,{detail:ka,local:((Ct==null?void 0:Ct.hasRemote)??!1)&&(Ct==null?void 0:Ct.commits.some(g=>g.hash===ka.hash&&!g.pushed))===!0,onCheckout:$i,onClose:()=>{Na(null),Ul(null)}}),wa&&r.jsxs(El,{title:"Переключить рабочее дерево?",onClose:()=>gl(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>gl(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:Zr,children:"Переключиться"})]}),children:[r.jsxs("p",{className:"modal__text",children:["git переключится на ",wa.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Vn&&r.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Ct&&Ct.changed.length>0&&r.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Ct.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Zs&&r.jsx(Jj,{status:Qe,owners:Qs,files:Fl,defaultName:(os==null?void 0:os.name)??"",hasCommits:Ct===null||Ct.head!=="",busy:rl,result:Kl,onRefreshStatus:hf,onSaveToken:df,onPublish:uf,onDismissResult:()=>on(null),onClose:()=>Jl(!1)}),Wl&&r.jsx(tk,{busy:rl,result:Kl,onSubmit:of,onDismissResult:()=>on(null),onClose:()=>bl(!1)}),On&&r.jsx(El,{title:On.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>fn(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>fn(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>_u(On),children:"Удалить"})]}),children:r.jsxs("p",{className:"modal__text",children:[On.path," будет удалён с диска",On.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),xt&&r.jsx(El,{title:"Закрыть без сохранения?",onClose:()=>Aa(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>Aa(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>ui(xt,!0),children:"Закрыть"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>{ua(xt),ui(xt,!0)},children:"Сохранить и закрыть"})]}),children:r.jsxs("p",{className:"modal__text",children:["В ",xt," есть несохранённые правки."]})}),Ke&&r.jsx(hk,{tab:Ke,servers:Jn,plugins:Bt,marketplaces:qt,catalog:Xt,result:Nt,actions:rf,onTab:st,onClose:()=>st(null)}),wn&&r.jsx(vk,{status:vn,login:un,actions:Vi,remote:x,runningSessions:v.filter(g=>g.state==="running"||g.state==="waiting_permission").length,onReconnect:w?()=>{nl(),At(!1)}:null,reconnectBlocked:Vn,reconnectHint:ds,onClose:()=>At(!1)}),p&&r.jsx(wk,{state:d,onPair:(g,q)=>ne({type:"relay.pair",code:g,...q?{name:q}:{}}),onUnpair:()=>ne({type:"relay.unpair"}),onClose:()=>m(!1)}),Zt&&r.jsx(Lk,{settings:Ot,models:(z==null?void 0:z.models)??[],relayState:d,local:zo()==="local",onChange:ii,onEnableShell:()=>ne({type:"relay.shell.enable"}),onDisableShell:()=>ne({type:"relay.shell.disable"}),onOpenRelay:()=>{wt(!1),m(!0)},onClose:()=>wt(!1)}),pe&&r.jsx(kj,{candidates:N,searching:ce,agentItems:we.items,agentBusy:(Me==null?void 0:Me.state)==="running",error:Ve,roots:Ie,created:We,onSearch:nf,onAskAgent:lf,onInterrupt:()=>{const g=cs.current;g&&ne({type:"control.interrupt",sessionId:g})},onSubmit:ef,onCreate:tf,onClose:af}),An!=null&&An.questions&&An.questions.length>0?r.jsx(pj,{request:{...An,questions:An.questions},queued:V.pending.length-1,onAnswer:Su,onDecline:ju}):An&&Qi!==null?r.jsx(bj,{request:An,plan:Qi,queued:V.pending.length-1,onAccept:Pr,onDecline:_l}):An&&r.jsx(hj,{request:An,queued:V.pending.length-1,onDecide:bf})]})}function sN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.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 iN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function rN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function cN(a,l){return Tx(a)===Tx(l)}function Tx(a){return a.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function uN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),r.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),r.jsx("path",{d:"M8.2 10h3.1"})]})}function oN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function fN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function dN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const wy=document.getElementById("root");if(!wy)throw new Error("#root not found");e0.createRoot(wy).render(r.jsx(_.StrictMode,{children:r.jsx(aN,{})}));export{Vv as D,zt as I,Ut as N,mN as P,zl as T,Zl as a,Fx as b,ml as c,pN as d,ny as e,Zc as f,o1 as h,gN as p,bN as s,ke as t};