@i14ks/ccv 0.17.2 → 0.18.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 +37 -7
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-lu8HamKP.js → codemirror-Xlc7emp4.js} +1 -1
  4. package/web/assets/{index-CqZsTMCh.js → index-B-bp9mCT.js} +1 -1
  5. package/web/assets/{index-DmaRIPd6.js → index-B59yN5CT.js} +1 -1
  6. package/web/assets/{index-Drc8TpEz.js → index-BHPUdhIS.js} +1 -1
  7. package/web/assets/{index-ChuReHk_.css → index-BRCAbil3.css} +1 -1
  8. package/web/assets/{index-BuyfXyo4.js → index-Bfg1ojRW.js} +1 -1
  9. package/web/assets/{index-DNoT5Ala.js → index-BiADfWp_.js} +1 -1
  10. package/web/assets/{index-3sshvreD.js → index-Bn6m7y1f.js} +1 -1
  11. package/web/assets/{index-Cc7JijiI.js → index-C9wRY7OB.js} +1 -1
  12. package/web/assets/{index-CcKtEXQw.js → index-CATqSzDf.js} +1 -1
  13. package/web/assets/{index-DIGg_HG2.js → index-COjrz9O3.js} +1 -1
  14. package/web/assets/{index-C4wYlk_J.js → index-CRr2Y5uA.js} +41 -41
  15. package/web/assets/{index-Dj1v9Gkj.js → index-CcRfA6wX.js} +1 -1
  16. package/web/assets/{index-C13Jucn1.js → index-CgJ8kt13.js} +1 -1
  17. package/web/assets/{index-BUWJHuYf.js → index-CmWfuvMB.js} +1 -1
  18. package/web/assets/{index-BfxQTveJ.js → index-CyvkCV_I.js} +1 -1
  19. package/web/assets/{index-D5k_lqHb.js → index-DD9jOM3u.js} +1 -1
  20. package/web/assets/{index-D9R4w6Zg.js → index-DGIVHKoZ.js} +1 -1
  21. package/web/assets/{index-B7ozEwgu.js → index-DPFqYXoR.js} +1 -1
  22. package/web/assets/{index-BJqZWIPR.js → index-DriANGJp.js} +1 -1
  23. package/web/assets/{index-D37eFo7a.js → index-GPJsAXZm.js} +1 -1
  24. package/web/assets/{index-Dvlp7Iqq.js → index-Rdr8VKHz.js} +1 -1
  25. package/web/index.html +2 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-D5k_lqHb.js","./index-CcKtEXQw.js","./index-Cc7JijiI.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-DIGg_HG2.js","./index-C13Jucn1.js","./index-D37eFo7a.js","./index-BUWJHuYf.js","./index-Dj1v9Gkj.js","./index-BfxQTveJ.js","./index-DmaRIPd6.js","./index-BJqZWIPR.js","./index-BuyfXyo4.js","./index-Dvlp7Iqq.js","./index-DNoT5Ala.js","./index-3sshvreD.js","./index-Drc8TpEz.js","./index-B7ozEwgu.js","./index-D9R4w6Zg.js","./index-CqZsTMCh.js","./codemirror-lu8HamKP.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 g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in l?g0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Lt=(l,s,r)=>b0(l,typeof s!="symbol"?s+"":s,r),Eh=(l,s,r)=>s.has(l)||vb("Cannot "+r);var Ge=(l,s,r)=>(Eh(l,s,"read from private field"),r?r.call(l):s.get(l)),hn=(l,s,r)=>s.has(l)?vb("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),St=(l,s,r,c)=>(Eh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),qn=(l,s,r)=>(Eh(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Ch={exports:{}},To={};/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DD9jOM3u.js","./index-CATqSzDf.js","./index-C9wRY7OB.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-COjrz9O3.js","./index-CgJ8kt13.js","./index-GPJsAXZm.js","./index-CmWfuvMB.js","./index-CcRfA6wX.js","./index-CyvkCV_I.js","./index-B59yN5CT.js","./index-DriANGJp.js","./index-Bfg1ojRW.js","./index-Rdr8VKHz.js","./index-BiADfWp_.js","./index-Bn6m7y1f.js","./index-BHPUdhIS.js","./index-DPFqYXoR.js","./index-DGIVHKoZ.js","./index-B-bp9mCT.js","./codemirror-Xlc7emp4.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 g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in l?g0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Lt=(l,s,r)=>b0(l,typeof s!="symbol"?s+"":s,r),Ch=(l,s,r)=>s.has(l)||vb("Cannot "+r);var Ge=(l,s,r)=>(Ch(l,s,"read from private field"),r?r.call(l):s.get(l)),hn=(l,s,r)=>s.has(l)?vb("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),St=(l,s,r,c)=>(Ch(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),qn=(l,s,r)=>(Ch(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Ah={exports:{}},Eo={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@ var g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var jb;function x0(){if(jb)return To;jb=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:l,type:c,key:h,ref:o!==void 0?o:null,props:d}}return To.Fragment=s,To.jsx=r,To.jsxs=r,To}var Sb;function y0(){return Sb||(Sb=1,Ch.exports=x0()),Ch.exports}var i=y0(),Ah={exports:{}},Ve={};/**
10
+ */var jb;function x0(){if(jb)return Eo;jb=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:l,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Eo.Fragment=s,Eo.jsx=r,Eo.jsxs=r,Eo}var Sb;function y0(){return Sb||(Sb=1,Ah.exports=x0()),Ah.exports}var i=y0(),Mh={exports:{}},Ve={};/**
11
11
  * @license React
12
12
  * react.production.js
13
13
  *
@@ -15,7 +15,7 @@ var g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var wb;function _0(){if(wb)return Ve;wb=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,L={};function $(k,V,ce){this.props=k,this.context=V,this.refs=L,this.updater=ce||T}$.prototype.isReactComponent={},$.prototype.setState=function(k,V){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,V,"setState")},$.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function J(){}J.prototype=$.prototype;function G(k,V,ce){this.props=k,this.context=V,this.refs=L,this.updater=ce||T}var O=G.prototype=new J;O.constructor=G,E(O,$.prototype),O.isPureReactComponent=!0;var Z=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function ne(k,V,ce){var ge=ce.ref;return{$$typeof:l,type:k,key:V,ref:ge!==void 0?ge:null,props:ce}}function he(k,V){return ne(k.type,V,k.props)}function P(k){return typeof k=="object"&&k!==null&&k.$$typeof===l}function ue(k){var V={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ce){return V[ce]})}var _e=/\/+/g;function De(k,V){return typeof k=="object"&&k!==null&&k.key!=null?ue(""+k.key):V.toString(36)}function Ne(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(M,M):(k.status="pending",k.then(function(V){k.status==="pending"&&(k.status="fulfilled",k.value=V)},function(V){k.status==="pending"&&(k.status="rejected",k.reason=V)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function A(k,V,ce,ge,Ae){var Se=typeof k;(Se==="undefined"||Se==="boolean")&&(k=null);var Te=!1;if(k===null)Te=!0;else switch(Se){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(k.$$typeof){case l:case s:Te=!0;break;case _:return Te=k._init,A(Te(k._payload),V,ce,ge,Ae)}}if(Te)return Ae=Ae(k),Te=ge===""?"."+De(k,0):ge,Z(Ae)?(ce="",Te!=null&&(ce=Te.replace(_e,"$&/")+"/"),A(Ae,V,ce,"",function(et){return et})):Ae!=null&&(P(Ae)&&(Ae=he(Ae,ce+(Ae.key==null||k&&k.key===Ae.key?"":(""+Ae.key).replace(_e,"$&/")+"/")+Te)),V.push(Ae)),1;Te=0;var Tt=ge===""?".":ge+":";if(Z(k))for(var Ye=0;Ye<k.length;Ye++)ge=k[Ye],Se=Tt+De(ge,Ye),Te+=A(ge,V,ce,Se,Ae);else if(Ye=C(k),typeof Ye=="function")for(k=Ye.call(k),Ye=0;!(ge=k.next()).done;)ge=ge.value,Se=Tt+De(ge,Ye++),Te+=A(ge,V,ce,Se,Ae);else if(Se==="object"){if(typeof k.then=="function")return A(Ne(k),V,ce,ge,Ae);throw V=String(k),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Te}function fe(k,V,ce){if(k==null)return k;var ge=[],Ae=0;return A(k,ge,"","",function(Se){return V.call(ce,Se,Ae++)}),ge}function z(k){if(k._status===-1){var V=k._result;V=V(),V.then(function(ce){(k._status===0||k._status===-1)&&(k._status=1,k._result=ce)},function(ce){(k._status===0||k._status===-1)&&(k._status=2,k._result=ce)}),k._status===-1&&(k._status=0,k._result=V)}if(k._status===1)return k._result.default;throw k._result}var pe=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ke={map:fe,forEach:function(k,V,ce){fe(k,function(){V.apply(this,arguments)},ce)},count:function(k){var V=0;return fe(k,function(){V++}),V},toArray:function(k){return fe(k,function(V){return V})||[]},only:function(k){if(!P(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ve.Activity=j,Ve.Children=ke,Ve.Component=$,Ve.Fragment=r,Ve.Profiler=o,Ve.PureComponent=G,Ve.StrictMode=c,Ve.Suspense=g,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Ve.cache=function(k){return function(){return k.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(k,V,ce){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ge=E({},k.props),Ae=k.key;if(V!=null)for(Se in V.key!==void 0&&(Ae=""+V.key),V)!B.call(V,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&V.ref===void 0||(ge[Se]=V[Se]);var Se=arguments.length-2;if(Se===1)ge.children=ce;else if(1<Se){for(var Te=Array(Se),Tt=0;Tt<Se;Tt++)Te[Tt]=arguments[Tt+2];ge.children=Te}return ne(k.type,Ae,ge)},Ve.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Ve.createElement=function(k,V,ce){var ge,Ae={},Se=null;if(V!=null)for(ge in V.key!==void 0&&(Se=""+V.key),V)B.call(V,ge)&&ge!=="key"&&ge!=="__self"&&ge!=="__source"&&(Ae[ge]=V[ge]);var Te=arguments.length-2;if(Te===1)Ae.children=ce;else if(1<Te){for(var Tt=Array(Te),Ye=0;Ye<Te;Ye++)Tt[Ye]=arguments[Ye+2];Ae.children=Tt}if(k&&k.defaultProps)for(ge in Te=k.defaultProps,Te)Ae[ge]===void 0&&(Ae[ge]=Te[ge]);return ne(k,Se,Ae)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(k){return{$$typeof:m,render:k}},Ve.isValidElement=P,Ve.lazy=function(k){return{$$typeof:_,_payload:{_status:-1,_result:k},_init:z}},Ve.memo=function(k,V){return{$$typeof:b,type:k,compare:V===void 0?null:V}},Ve.startTransition=function(k){var V=D.T,ce={};D.T=ce;try{var ge=k(),Ae=D.S;Ae!==null&&Ae(ce,ge),typeof ge=="object"&&ge!==null&&typeof ge.then=="function"&&ge.then(M,pe)}catch(Se){pe(Se)}finally{V!==null&&ce.types!==null&&(V.types=ce.types),D.T=V}},Ve.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ve.use=function(k){return D.H.use(k)},Ve.useActionState=function(k,V,ce){return D.H.useActionState(k,V,ce)},Ve.useCallback=function(k,V){return D.H.useCallback(k,V)},Ve.useContext=function(k){return D.H.useContext(k)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(k,V){return D.H.useDeferredValue(k,V)},Ve.useEffect=function(k,V){return D.H.useEffect(k,V)},Ve.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Ve.useId=function(){return D.H.useId()},Ve.useImperativeHandle=function(k,V,ce){return D.H.useImperativeHandle(k,V,ce)},Ve.useInsertionEffect=function(k,V){return D.H.useInsertionEffect(k,V)},Ve.useLayoutEffect=function(k,V){return D.H.useLayoutEffect(k,V)},Ve.useMemo=function(k,V){return D.H.useMemo(k,V)},Ve.useOptimistic=function(k,V){return D.H.useOptimistic(k,V)},Ve.useReducer=function(k,V,ce){return D.H.useReducer(k,V,ce)},Ve.useRef=function(k){return D.H.useRef(k)},Ve.useState=function(k){return D.H.useState(k)},Ve.useSyncExternalStore=function(k,V,ce){return D.H.useSyncExternalStore(k,V,ce)},Ve.useTransition=function(){return D.H.useTransition()},Ve.version="19.2.8",Ve}var kb;function gp(){return kb||(kb=1,Ah.exports=_0()),Ah.exports}var y=gp(),Mh={exports:{}},Eo={},Rh={exports:{}},Dh={};/**
18
+ */var wb;function _0(){if(wb)return Ve;wb=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,M={};function G(k,V,ce){this.props=k,this.context=V,this.refs=M,this.updater=ce||T}G.prototype.isReactComponent={},G.prototype.setState=function(k,V){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,V,"setState")},G.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function F(){}F.prototype=G.prototype;function q(k,V,ce){this.props=k,this.context=V,this.refs=M,this.updater=ce||T}var L=q.prototype=new F;L.constructor=q,E(L,G.prototype),L.isPureReactComponent=!0;var Z=Array.isArray;function R(){}var O={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function ne(k,V,ce){var ge=ce.ref;return{$$typeof:l,type:k,key:V,ref:ge!==void 0?ge:null,props:ce}}function he(k,V){return ne(k.type,V,k.props)}function P(k){return typeof k=="object"&&k!==null&&k.$$typeof===l}function ue(k){var V={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ce){return V[ce]})}var _e=/\/+/g;function De(k,V){return typeof k=="object"&&k!==null&&k.key!=null?ue(""+k.key):V.toString(36)}function Ne(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(R,R):(k.status="pending",k.then(function(V){k.status==="pending"&&(k.status="fulfilled",k.value=V)},function(V){k.status==="pending"&&(k.status="rejected",k.reason=V)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function A(k,V,ce,ge,Ae){var Se=typeof k;(Se==="undefined"||Se==="boolean")&&(k=null);var Te=!1;if(k===null)Te=!0;else switch(Se){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(k.$$typeof){case l:case s:Te=!0;break;case _:return Te=k._init,A(Te(k._payload),V,ce,ge,Ae)}}if(Te)return Ae=Ae(k),Te=ge===""?"."+De(k,0):ge,Z(Ae)?(ce="",Te!=null&&(ce=Te.replace(_e,"$&/")+"/"),A(Ae,V,ce,"",function(et){return et})):Ae!=null&&(P(Ae)&&(Ae=he(Ae,ce+(Ae.key==null||k&&k.key===Ae.key?"":(""+Ae.key).replace(_e,"$&/")+"/")+Te)),V.push(Ae)),1;Te=0;var Tt=ge===""?".":ge+":";if(Z(k))for(var Ye=0;Ye<k.length;Ye++)ge=k[Ye],Se=Tt+De(ge,Ye),Te+=A(ge,V,ce,Se,Ae);else if(Ye=C(k),typeof Ye=="function")for(k=Ye.call(k),Ye=0;!(ge=k.next()).done;)ge=ge.value,Se=Tt+De(ge,Ye++),Te+=A(ge,V,ce,Se,Ae);else if(Se==="object"){if(typeof k.then=="function")return A(Ne(k),V,ce,ge,Ae);throw V=String(k),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Te}function fe(k,V,ce){if(k==null)return k;var ge=[],Ae=0;return A(k,ge,"","",function(Se){return V.call(ce,Se,Ae++)}),ge}function z(k){if(k._status===-1){var V=k._result;V=V(),V.then(function(ce){(k._status===0||k._status===-1)&&(k._status=1,k._result=ce)},function(ce){(k._status===0||k._status===-1)&&(k._status=2,k._result=ce)}),k._status===-1&&(k._status=0,k._result=V)}if(k._status===1)return k._result.default;throw k._result}var pe=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ke={map:fe,forEach:function(k,V,ce){fe(k,function(){V.apply(this,arguments)},ce)},count:function(k){var V=0;return fe(k,function(){V++}),V},toArray:function(k){return fe(k,function(V){return V})||[]},only:function(k){if(!P(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ve.Activity=j,Ve.Children=ke,Ve.Component=G,Ve.Fragment=r,Ve.Profiler=o,Ve.PureComponent=q,Ve.StrictMode=c,Ve.Suspense=g,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(k){return O.H.useMemoCache(k)}},Ve.cache=function(k){return function(){return k.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(k,V,ce){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ge=E({},k.props),Ae=k.key;if(V!=null)for(Se in V.key!==void 0&&(Ae=""+V.key),V)!B.call(V,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&V.ref===void 0||(ge[Se]=V[Se]);var Se=arguments.length-2;if(Se===1)ge.children=ce;else if(1<Se){for(var Te=Array(Se),Tt=0;Tt<Se;Tt++)Te[Tt]=arguments[Tt+2];ge.children=Te}return ne(k.type,Ae,ge)},Ve.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Ve.createElement=function(k,V,ce){var ge,Ae={},Se=null;if(V!=null)for(ge in V.key!==void 0&&(Se=""+V.key),V)B.call(V,ge)&&ge!=="key"&&ge!=="__self"&&ge!=="__source"&&(Ae[ge]=V[ge]);var Te=arguments.length-2;if(Te===1)Ae.children=ce;else if(1<Te){for(var Tt=Array(Te),Ye=0;Ye<Te;Ye++)Tt[Ye]=arguments[Ye+2];Ae.children=Tt}if(k&&k.defaultProps)for(ge in Te=k.defaultProps,Te)Ae[ge]===void 0&&(Ae[ge]=Te[ge]);return ne(k,Se,Ae)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(k){return{$$typeof:m,render:k}},Ve.isValidElement=P,Ve.lazy=function(k){return{$$typeof:_,_payload:{_status:-1,_result:k},_init:z}},Ve.memo=function(k,V){return{$$typeof:b,type:k,compare:V===void 0?null:V}},Ve.startTransition=function(k){var V=O.T,ce={};O.T=ce;try{var ge=k(),Ae=O.S;Ae!==null&&Ae(ce,ge),typeof ge=="object"&&ge!==null&&typeof ge.then=="function"&&ge.then(R,pe)}catch(Se){pe(Se)}finally{V!==null&&ce.types!==null&&(V.types=ce.types),O.T=V}},Ve.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ve.use=function(k){return O.H.use(k)},Ve.useActionState=function(k,V,ce){return O.H.useActionState(k,V,ce)},Ve.useCallback=function(k,V){return O.H.useCallback(k,V)},Ve.useContext=function(k){return O.H.useContext(k)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(k,V){return O.H.useDeferredValue(k,V)},Ve.useEffect=function(k,V){return O.H.useEffect(k,V)},Ve.useEffectEvent=function(k){return O.H.useEffectEvent(k)},Ve.useId=function(){return O.H.useId()},Ve.useImperativeHandle=function(k,V,ce){return O.H.useImperativeHandle(k,V,ce)},Ve.useInsertionEffect=function(k,V){return O.H.useInsertionEffect(k,V)},Ve.useLayoutEffect=function(k,V){return O.H.useLayoutEffect(k,V)},Ve.useMemo=function(k,V){return O.H.useMemo(k,V)},Ve.useOptimistic=function(k,V){return O.H.useOptimistic(k,V)},Ve.useReducer=function(k,V,ce){return O.H.useReducer(k,V,ce)},Ve.useRef=function(k){return O.H.useRef(k)},Ve.useState=function(k){return O.H.useState(k)},Ve.useSyncExternalStore=function(k,V,ce){return O.H.useSyncExternalStore(k,V,ce)},Ve.useTransition=function(){return O.H.useTransition()},Ve.version="19.2.8",Ve}var kb;function bp(){return kb||(kb=1,Mh.exports=_0()),Mh.exports}var y=bp(),Rh={exports:{}},Co={},Dh={exports:{}},Oh={};/**
19
19
  * @license React
20
20
  * scheduler.production.js
21
21
  *
@@ -23,7 +23,7 @@ var g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */var Nb;function v0(){return Nb||(Nb=1,(function(l){function s(A,fe){var z=A.length;A.push(fe);e:for(;0<z;){var pe=z-1>>>1,ke=A[pe];if(0<o(ke,fe))A[pe]=fe,A[z]=ke,z=pe;else break e}}function r(A){return A.length===0?null:A[0]}function c(A){if(A.length===0)return null;var fe=A[0],z=A.pop();if(z!==fe){A[0]=z;e:for(var pe=0,ke=A.length,k=ke>>>1;pe<k;){var V=2*(pe+1)-1,ce=A[V],ge=V+1,Ae=A[ge];if(0>o(ce,z))ge<ke&&0>o(Ae,ce)?(A[pe]=Ae,A[ge]=z,pe=ge):(A[pe]=ce,A[V]=z,pe=V);else if(ge<ke&&0>o(Ae,z))A[pe]=Ae,A[ge]=z,pe=ge;else break e}}return fe}function o(A,fe){var z=A.sortIndex-fe.sortIndex;return z!==0?z:A.id-fe.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],b=[],_=1,j=null,v=3,C=!1,T=!1,E=!1,L=!1,$=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function O(A){for(var fe=r(b);fe!==null;){if(fe.callback===null)c(b);else if(fe.startTime<=A)c(b),fe.sortIndex=fe.expirationTime,s(g,fe);else break;fe=r(b)}}function Z(A){if(E=!1,O(A),!T)if(r(g)!==null)T=!0,M||(M=!0,ue());else{var fe=r(b);fe!==null&&Ne(Z,fe.startTime-A)}}var M=!1,D=-1,B=5,ne=-1;function he(){return L?!0:!(l.unstable_now()-ne<B)}function P(){if(L=!1,M){var A=l.unstable_now();ne=A;var fe=!0;try{e:{T=!1,E&&(E=!1,J(D),D=-1),C=!0;var z=v;try{t:{for(O(A),j=r(g);j!==null&&!(j.expirationTime>A&&he());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var ke=pe(j.expirationTime<=A);if(A=l.unstable_now(),typeof ke=="function"){j.callback=ke,O(A),fe=!0;break t}j===r(g)&&c(g),O(A)}else c(g);j=r(g)}if(j!==null)fe=!0;else{var k=r(b);k!==null&&Ne(Z,k.startTime-A),fe=!1}}break e}finally{j=null,v=z,C=!1}fe=void 0}}finally{fe?ue():M=!1}}}var ue;if(typeof G=="function")ue=function(){G(P)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,De=_e.port2;_e.port1.onmessage=P,ue=function(){De.postMessage(null)}}else ue=function(){$(P,0)};function Ne(A,fe){D=$(function(){A(l.unstable_now())},fe)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(A){A.callback=null},l.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<A?Math.floor(1e3/A):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(A){switch(v){case 1:case 2:case 3:var fe=3;break;default:fe=v}var z=v;v=fe;try{return A()}finally{v=z}},l.unstable_requestPaint=function(){L=!0},l.unstable_runWithPriority=function(A,fe){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var z=v;v=A;try{return fe()}finally{v=z}},l.unstable_scheduleCallback=function(A,fe,z){var pe=l.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?pe+z:pe):z=pe,A){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=z+ke,A={id:_++,callback:fe,priorityLevel:A,startTime:z,expirationTime:ke,sortIndex:-1},z>pe?(A.sortIndex=z,s(b,A),r(g)===null&&A===r(b)&&(E?(J(D),D=-1):E=!0,Ne(Z,z-pe))):(A.sortIndex=ke,s(g,A),T||C||(T=!0,M||(M=!0,ue()))),A},l.unstable_shouldYield=he,l.unstable_wrapCallback=function(A){var fe=v;return function(){var z=v;v=fe;try{return A.apply(this,arguments)}finally{v=z}}}})(Dh)),Dh}var Tb;function j0(){return Tb||(Tb=1,Rh.exports=v0()),Rh.exports}var Oh={exports:{}},hl={};/**
26
+ */var Nb;function v0(){return Nb||(Nb=1,(function(l){function s(A,fe){var z=A.length;A.push(fe);e:for(;0<z;){var pe=z-1>>>1,ke=A[pe];if(0<o(ke,fe))A[pe]=fe,A[z]=ke,z=pe;else break e}}function r(A){return A.length===0?null:A[0]}function c(A){if(A.length===0)return null;var fe=A[0],z=A.pop();if(z!==fe){A[0]=z;e:for(var pe=0,ke=A.length,k=ke>>>1;pe<k;){var V=2*(pe+1)-1,ce=A[V],ge=V+1,Ae=A[ge];if(0>o(ce,z))ge<ke&&0>o(Ae,ce)?(A[pe]=Ae,A[ge]=z,pe=ge):(A[pe]=ce,A[V]=z,pe=V);else if(ge<ke&&0>o(Ae,z))A[pe]=Ae,A[ge]=z,pe=ge;else break e}}return fe}function o(A,fe){var z=A.sortIndex-fe.sortIndex;return z!==0?z:A.id-fe.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],b=[],_=1,j=null,v=3,C=!1,T=!1,E=!1,M=!1,G=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function L(A){for(var fe=r(b);fe!==null;){if(fe.callback===null)c(b);else if(fe.startTime<=A)c(b),fe.sortIndex=fe.expirationTime,s(g,fe);else break;fe=r(b)}}function Z(A){if(E=!1,L(A),!T)if(r(g)!==null)T=!0,R||(R=!0,ue());else{var fe=r(b);fe!==null&&Ne(Z,fe.startTime-A)}}var R=!1,O=-1,B=5,ne=-1;function he(){return M?!0:!(l.unstable_now()-ne<B)}function P(){if(M=!1,R){var A=l.unstable_now();ne=A;var fe=!0;try{e:{T=!1,E&&(E=!1,F(O),O=-1),C=!0;var z=v;try{t:{for(L(A),j=r(g);j!==null&&!(j.expirationTime>A&&he());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var ke=pe(j.expirationTime<=A);if(A=l.unstable_now(),typeof ke=="function"){j.callback=ke,L(A),fe=!0;break t}j===r(g)&&c(g),L(A)}else c(g);j=r(g)}if(j!==null)fe=!0;else{var k=r(b);k!==null&&Ne(Z,k.startTime-A),fe=!1}}break e}finally{j=null,v=z,C=!1}fe=void 0}}finally{fe?ue():R=!1}}}var ue;if(typeof q=="function")ue=function(){q(P)};else if(typeof MessageChannel<"u"){var _e=new MessageChannel,De=_e.port2;_e.port1.onmessage=P,ue=function(){De.postMessage(null)}}else ue=function(){G(P,0)};function Ne(A,fe){O=G(function(){A(l.unstable_now())},fe)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(A){A.callback=null},l.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<A?Math.floor(1e3/A):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(A){switch(v){case 1:case 2:case 3:var fe=3;break;default:fe=v}var z=v;v=fe;try{return A()}finally{v=z}},l.unstable_requestPaint=function(){M=!0},l.unstable_runWithPriority=function(A,fe){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var z=v;v=A;try{return fe()}finally{v=z}},l.unstable_scheduleCallback=function(A,fe,z){var pe=l.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?pe+z:pe):z=pe,A){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=z+ke,A={id:_++,callback:fe,priorityLevel:A,startTime:z,expirationTime:ke,sortIndex:-1},z>pe?(A.sortIndex=z,s(b,A),r(g)===null&&A===r(b)&&(E?(F(O),O=-1):E=!0,Ne(Z,z-pe))):(A.sortIndex=ke,s(g,A),T||C||(T=!0,R||(R=!0,ue()))),A},l.unstable_shouldYield=he,l.unstable_wrapCallback=function(A){var fe=v;return function(){var z=v;v=fe;try{return A.apply(this,arguments)}finally{v=z}}}})(Oh)),Oh}var Tb;function j0(){return Tb||(Tb=1,Dh.exports=v0()),Dh.exports}var Lh={exports:{}},hl={};/**
27
27
  * @license React
28
28
  * react-dom.production.js
29
29
  *
@@ -31,7 +31,7 @@ var g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var Eb;function S0(){if(Eb)return hl;Eb=1;var l=gp();function s(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)b+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,b,_){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:b,implementation:_}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return hl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,hl.createPortal=function(g,b){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(s(299));return d(g,b,null,_)},hl.flushSync=function(g){var b=h.T,_=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=_,c.d.f()}},hl.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(g,b))},hl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},hl.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var _=b.as,j=m(_,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,C=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;_==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):_==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},hl.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var _=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(g)},hl.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var _=b.as,j=m(_,b.crossOrigin);c.d.L(g,_,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},hl.preloadModule=function(g,b){if(typeof g=="string")if(b){var _=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},hl.requestFormReset=function(g){c.d.r(g)},hl.unstable_batchedUpdates=function(g,b){return g(b)},hl.useFormState=function(g,b,_){return h.H.useFormState(g,b,_)},hl.useFormStatus=function(){return h.H.useHostTransitionStatus()},hl.version="19.2.8",hl}var Cb;function w0(){if(Cb)return Oh.exports;Cb=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Oh.exports=S0(),Oh.exports}/**
34
+ */var Eb;function S0(){if(Eb)return hl;Eb=1;var l=bp();function s(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)b+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+g+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,b,_){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:b,implementation:_}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return hl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,hl.createPortal=function(g,b){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(s(299));return d(g,b,null,_)},hl.flushSync=function(g){var b=h.T,_=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=_,c.d.f()}},hl.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(g,b))},hl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},hl.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var _=b.as,j=m(_,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,C=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;_==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):_==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},hl.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var _=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(g)},hl.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var _=b.as,j=m(_,b.crossOrigin);c.d.L(g,_,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},hl.preloadModule=function(g,b){if(typeof g=="string")if(b){var _=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:_,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},hl.requestFormReset=function(g){c.d.r(g)},hl.unstable_batchedUpdates=function(g,b){return g(b)},hl.useFormState=function(g,b,_){return h.H.useFormState(g,b,_)},hl.useFormStatus=function(){return h.H.useHostTransitionStatus()},hl.version="19.2.8",hl}var Cb;function w0(){if(Cb)return Lh.exports;Cb=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Lh.exports=S0(),Lh.exports}/**
35
35
  * @license React
36
36
  * react-dom-client.production.js
37
37
  *
@@ -39,23 +39,23 @@ var g0=Object.defineProperty;var vb=l=>{throw TypeError(l)};var b0=(l,s,r)=>s in
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */var Ab;function k0(){if(Ab)return Eo;Ab=1;var l=j0(),s=gp(),r=w0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===a)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var x=!1,S=u.child;S;){if(S===n){x=!0,n=u,a=f;break}if(S===a){x=!0,a=u,n=f;break}S=S.sibling}if(!x){for(S=f.child;S;){if(S===n){x=!0,n=f,a=u;break}if(S===a){x=!0,a=f,n=u;break}S=S.sibling}if(!x)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),G=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var _e=Symbol.for("react.client.reference");function De(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_e?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case $:return"Profiler";case L:return"StrictMode";case Z:return"Suspense";case M:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case G:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:De(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return De(e(t))}catch{}}return null}var Ne=Array.isArray,A=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},pe=[],ke=-1;function k(e){return{current:e}}function V(e){0>ke||(e.current=pe[ke],pe[ke]=null,ke--)}function ce(e,t){ke++,pe[ke]=e.current,e.current=t}var ge=k(null),Ae=k(null),Se=k(null),Te=k(null);function Tt(e,t){switch(ce(Se,t),ce(Ae,e),ce(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$g(t),e=Xg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(ge),ce(ge,e)}function Ye(){V(ge),V(Ae),V(Se)}function et(e){e.memoizedState!==null&&ce(Te,e);var t=ge.current,n=Xg(t,e.type);t!==n&&(ce(Ae,e),ce(ge,n))}function Xe(e){Ae.current===e&&(V(ge),V(Ae)),Te.current===e&&(V(Te),So._currentValue=z)}var Qt,tt;function Yt(e){if(Qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qt=t&&t[1]||"",tt=-1<n.stack.indexOf(`
42
+ */var Ab;function k0(){if(Ab)return Co;Ab=1;var l=j0(),s=bp(),r=w0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===a)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var x=!1,S=u.child;S;){if(S===n){x=!0,n=u,a=f;break}if(S===a){x=!0,a=u,n=f;break}S=S.sibling}if(!x){for(S=f.child;S;){if(S===n){x=!0,n=f,a=u;break}if(S===a){x=!0,a=f,n=u;break}S=S.sibling}if(!x)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),q=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var _e=Symbol.for("react.client.reference");function De(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_e?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case G:return"Profiler";case M:return"StrictMode";case Z:return"Suspense";case R:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case q:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return t=e.displayName||null,t!==null?t:De(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return De(e(t))}catch{}}return null}var Ne=Array.isArray,A=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},pe=[],ke=-1;function k(e){return{current:e}}function V(e){0>ke||(e.current=pe[ke],pe[ke]=null,ke--)}function ce(e,t){ke++,pe[ke]=e.current,e.current=t}var ge=k(null),Ae=k(null),Se=k(null),Te=k(null);function Tt(e,t){switch(ce(Se,t),ce(Ae,e),ce(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$g(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$g(t),e=Xg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(ge),ce(ge,e)}function Ye(){V(ge),V(Ae),V(Se)}function et(e){e.memoizedState!==null&&ce(Te,e);var t=ge.current,n=Xg(t,e.type);t!==n&&(ce(Ae,e),ce(ge,n))}function Xe(e){Ae.current===e&&(V(ge),V(Ae)),Te.current===e&&(V(Te),wo._currentValue=z)}var Qt,tt;function Yt(e){if(Qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qt=t&&t[1]||"",tt=-1<n.stack.indexOf(`
43
43
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Qt+e+tt}var nt=!1;function en(e,t){if(!e||nt)return"";nt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(te){var F=te}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(te){F=te}e.call(oe.prototype)}}else{try{throw Error()}catch(te){F=te}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(te){if(te&&F&&typeof te.stack=="string")return[te.stack,F.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),x=f[0],S=f[1];if(x&&S){var R=x.split(`
44
+ `+Qt+e+tt}var nt=!1;function en(e,t){if(!e||nt)return"";nt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(te){var J=te}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(te){J=te}e.call(oe.prototype)}}else{try{throw Error()}catch(te){J=te}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(te){if(te&&J&&typeof te.stack=="string")return[te.stack,J.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),x=f[0],S=f[1];if(x&&S){var D=x.split(`
45
45
  `),K=S.split(`
46
- `);for(u=a=0;a<R.length&&!R[a].includes("DetermineComponentFrameRoot");)a++;for(;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;if(a===R.length||u===K.length)for(a=R.length-1,u=K.length-1;1<=a&&0<=u&&R[a]!==K[u];)u--;for(;1<=a&&0<=u;a--,u--)if(R[a]!==K[u]){if(a!==1||u!==1)do if(a--,u--,0>u||R[a]!==K[u]){var se=`
47
- `+R[a].replace(" at new "," at ");return e.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",e.displayName)),se}while(1<=a&&0<=u);break}}}finally{nt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Yt(n):""}function $t(e,t){switch(e.tag){case 26:case 27:case 5:return Yt(e.type);case 16:return Yt("Lazy");case 13:return e.child!==t&&t!==null?Yt("Suspense Fallback"):Yt("Suspense");case 19:return Yt("SuspenseList");case 0:case 15:return en(e.type,!1);case 11:return en(e.type.render,!1);case 1:return en(e.type,!0);case 31:return Yt("Activity");default:return""}}function tn(e){try{var t="",n=null;do t+=$t(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
46
+ `);for(u=a=0;a<D.length&&!D[a].includes("DetermineComponentFrameRoot");)a++;for(;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;if(a===D.length||u===K.length)for(a=D.length-1,u=K.length-1;1<=a&&0<=u&&D[a]!==K[u];)u--;for(;1<=a&&0<=u;a--,u--)if(D[a]!==K[u]){if(a!==1||u!==1)do if(a--,u--,0>u||D[a]!==K[u]){var se=`
47
+ `+D[a].replace(" at new "," at ");return e.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",e.displayName)),se}while(1<=a&&0<=u);break}}}finally{nt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Yt(n):""}function $t(e,t){switch(e.tag){case 26:case 27:case 5:return Yt(e.type);case 16:return Yt("Lazy");case 13:return e.child!==t&&t!==null?Yt("Suspense Fallback"):Yt("Suspense");case 19:return Yt("SuspenseList");case 0:case 15:return en(e.type,!1);case 11:return en(e.type.render,!1);case 1:return en(e.type,!0);case 31:return Yt("Activity");default:return""}}function tn(e){try{var t="",n=null;do t+=$t(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
48
48
  Error generating stack: `+a.message+`
49
- `+a.stack}}var nn=Object.prototype.hasOwnProperty,pn=l.unstable_scheduleCallback,Sn=l.unstable_cancelCallback,mn=l.unstable_shouldYield,cn=l.unstable_requestPaint,Ke=l.unstable_now,zt=l.unstable_getCurrentPriorityLevel,gn=l.unstable_ImmediatePriority,ft=l.unstable_UserBlockingPriority,Je=l.unstable_NormalPriority,An=l.unstable_LowPriority,on=l.unstable_IdlePriority,wn=l.log,Pn=l.unstable_setDisableYieldValue,Xt=null,wt=null;function Kt(e){if(typeof wn=="function"&&Pn(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Xt,e)}catch{}}var Et=Math.clz32?Math.clz32:be,Yn=Math.log,le=Math.LN2;function be(e){return e>>>=0,e===0?32:31-(Yn(e)/le|0)|0}var Le=256,H=262144,W=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 Be(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=a&134217727;return S!==0?(a=S&~f,a!==0?u=xe(a):(x&=S,x!==0?u=xe(x):n||(n=S&~e,n!==0&&(u=xe(n))))):(S=a&~f,S!==0?u=xe(S):x!==0?u=xe(x):n||(n=a&~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 gt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Mn(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 bn(){var e=W;return W<<=1,(W&62914560)===0&&(W=4194304),e}function Rn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ul(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gl(e,t,n,a,u,f){var x=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,K=e.hiddenUpdates;for(n=x&~n;0<n;){var se=31-Et(n),oe=1<<se;S[se]=0,R[se]=-1;var F=K[se];if(F!==null)for(K[se]=null,se=0;se<F.length;se++){var te=F[se];te!==null&&(te.lane&=-536870913)}n&=~oe}a!==0&&ra(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function ra(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Et(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Ql(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Et(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function ps(e,t){var n=t&-t;return n=(n&42)!==0?1:Ms(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ms(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 Dn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kl(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:pb(e.type))}function bl(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var $n=Math.random().toString(36).slice(2),Vt="__reactFiber$"+$n,$e="__reactProps$"+$n,vt="__reactContainer$"+$n,xl="__reactEvents$"+$n,lt="__reactListeners$"+$n,Zl="__reactHandles$"+$n,Ut="__reactResources$"+$n,el="__reactMarker$"+$n;function kt(e){delete e[Vt],delete e[$e],delete e[xl],delete e[lt],delete e[Zl]}function Tl(e){var t=e[Vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[Vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wg(e);e!==null;){if(n=e[Vt])return n;e=Wg(e)}return t}e=n,n=e.parentNode}return null}function ln(e){if(e=e[Vt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function bt(e){var t=e[Ut];return t||(t=e[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ze(e){e[el]=!0}var On=new Set,El={};function xn(e,t){Nn(e,t),Nn(e+"Capture",t)}function Nn(e,t){for(El[e]=t,e=0;e<t.length;e++)On.add(t[e])}var tl=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]*$"),ms={},yn={};function Fl(e){return nn.call(yn,e)?!0:nn.call(ms,e)?!1:tl.test(e)?yn[e]=!0:(ms[e]=!0,!1)}function fl(e,t,n){if(Fl(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function nl(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 Ln(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ia(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hi(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(x){n=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){if(!e._valueTracker){var t=Ia(e)?"checked":"value";e._valueTracker=Hi(e,t,""+e[t])}}function Ds(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Ia(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function yl(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 qa=/[\n"\\]/g;function zn(e){return e.replace(qa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gs(e,t,n,a,u,f,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?sn(e,x,Ht(t)):n!=null?sn(e,x,Ht(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Ht(S):e.removeAttribute("name")}function Jl(e,t,n,a,u,f,x,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)){Rs(e);return}n=n!=null?""+Ht(n):"",t=t!=null?""+Ht(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=S?e.checked:!!a,e.defaultChecked=!!a,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Rs(e)}function sn(e,t,n){t==="number"&&yl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Bt(e,t,n,a){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Ht(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function me(e,t,n){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ht(n):""}function N(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(Ne(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Ht(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Rs(e)}function Y(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ae=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function we(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||ae.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ve(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&we(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&we(e,f,t[f])}function ze(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ot=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"]]),un=/^[\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 Mt(e){return un.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function mt(){}var fn=null;function It(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ll=null,bs=null;function w(e){var t=ln(e);if(t&&(e=t.stateNode)){var n=e[$e]||null;e:switch(e=t.stateNode,t.type){case"input":if(gs(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="'+zn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[$e]||null;if(!u)throw Error(c(90));gs(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Ds(a)}break e;case"textarea":me(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var ie=!1;function Me(e,t,n){if(ie)return e(t,n);ie=!0;try{var a=e(t);return a}finally{if(ie=!1,(ll!==null||bs!==null)&&(qu(),ll&&(t=ll,e=bs,bs=ll=null,w(t),e)))for(t=0;t<e.length;t++)w(e[t])}}function Fe(e,t){var n=e.stateNode;if(n===null)return null;var a=n[$e]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xs=!1;if(_n)try{var ys={};Object.defineProperty(ys,"passive",{get:function(){xs=!0}}),window.addEventListener("test",ys,ys),window.removeEventListener("test",ys,ys)}catch{xs=!1}var Os=null,Bi=null,ca=null;function vr(){if(ca)return ca;var e,t=Bi,n=t.length,a,u="value"in Os?Os.value:Os.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var x=n-e;for(a=1;a<=x&&t[n-a]===u[f-a];a++);return ca=u.slice(e,1<a?1-a:void 0)}function Ii(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 oa(){return!0}function ua(){return!1}function Zn(e){function t(n,a,u,f,x){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var 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)?oa:ua,this.isPropagationStopped=ua,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=oa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=oa)},persist:function(){},isPersistent:oa}),t}var Wl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ls=Zn(Wl),qi=j({},Wl,{view:0,detail:0}),jr=Zn(qi),Nc,Ga,zs,Ya=j({},qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pa,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!==zs&&(zs&&e.type==="mousemove"?(Nc=e.screenX-zs.screenX,Ga=e.screenY-zs.screenY):Ga=Nc=0,zs=e),Nc)},movementY:function(e){return"movementY"in e?e.movementY:Ga}}),$a=Zn(Ya),fa=j({},Ya,{dataTransfer:0}),Sr=Zn(fa),Tc=j({},qi,{relatedTarget:0}),Ec=Zn(Tc),da=j({},Wl,{animationName:0,elapsedTime:0,pseudoElement:0}),wr=Zn(da),Vo=j({},Wl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kr=Zn(Vo),Qo=j({},Wl,{data:0}),Gi=Zn(Qo),_s={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nr={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"},Yi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ha(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yi[e])?!!t[e]:!1}function pa(){return ha}var an=j({},qi,{key:function(e){if(e.key){var t=_s[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pa,charCode:function(e){return e.type==="keypress"?Ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cc=Zn(an),Kf=j({},Ya,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ko=Zn(Kf),Ac=j({},qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pa}),Tr=Zn(Ac),Xn=j({},Wl,{propertyName:0,elapsedTime:0,pseudoElement:0}),$i=Zn(Xn),Xi=j({},Ya,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Zo=Zn(Xi),Un=j({},Wl,{newState:0,oldState:0}),Fo=Zn(Un),Jo=[9,13,27,32],Il=_n&&"CompositionEvent"in window,Xa=null;_n&&"documentMode"in document&&(Xa=document.documentMode);var Er=_n&&"TextEvent"in window&&!Xa,Vi=_n&&(!Il||Xa&&8<Xa&&11>=Xa),Va=" ",Us=!1;function Mc(e,t){switch(e){case"keyup":return Jo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vs=!1;function Qi(e,t){switch(e){case"compositionend":return Qa(t);case"keypress":return t.which!==32?null:(Us=!0,Va);case"textInput":return e=t.data,e===Va&&Us?null:e;default:return null}}function Ki(e,t){if(vs)return e==="compositionend"||!Il&&Mc(e,t)?(e=vr(),ca=Bi=Os=null,vs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Vi&&t.locale!=="ko"?null:t.data;default:return null}}var Wo={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ka(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wo[e.type]:t==="textarea"}function Po(e,t,n,a){ll?bs?bs.push(a):bs=[a]:ll=a,t=Ku(t,"onChange"),0<t.length&&(n=new Ls("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ee=null,Pl=null;function Rc(e){Hg(e,0)}function Cr(e){var t=kn(e);if(Ds(t))return e}function eu(e,t){if(e==="change")return t}var X=!1;if(_n){var ma;if(_n){var ga="oninput"in document;if(!ga){var Dc=document.createElement("div");Dc.setAttribute("oninput","return;"),ga=typeof Dc.oninput=="function"}ma=ga}else ma=!1;X=ma&&(!document.documentMode||9<document.documentMode)}function Oc(){ee&&(ee.detachEvent("onpropertychange",tu),Pl=ee=null)}function tu(e){if(e.propertyName==="value"&&Cr(Pl)){var t=[];Po(t,Pl,e,It(e)),Me(Rc,t)}}function Za(e,t,n){e==="focusin"?(Oc(),ee=t,Pl=n,ee.attachEvent("onpropertychange",tu)):e==="focusout"&&Oc()}function Zf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cr(Pl)}function Ff(e,t){if(e==="click")return Cr(t)}function Jf(e,t){if(e==="input"||e==="change")return Cr(t)}function Wf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _l=typeof Object.is=="function"?Object.is:Wf;function es(e,t){if(_l(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!nn.call(t,u)||!_l(e[u],t[u]))return!1}return!0}function nu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lu(e,t){var n=nu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=nu(n)}}function su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function au(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=yl(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=yl(e.document)}return t}function Lc(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=_n&&"documentMode"in document&&11>=document.documentMode,Fa=null,zc=null,Zi=null,Fi=!1;function iu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fi||Fa==null||Fa!==yl(a)||(a=Fa,"selectionStart"in a&&Lc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Zi&&es(Zi,a)||(Zi=a,a=Ku(zc,"onSelect"),0<a.length&&(t=new Ls("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Fa)))}function ba(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Hs={animationend:ba("Animation","AnimationEnd"),animationiteration:ba("Animation","AnimationIteration"),animationstart:ba("Animation","AnimationStart"),transitionrun:ba("Transition","TransitionRun"),transitionstart:ba("Transition","TransitionStart"),transitioncancel:ba("Transition","TransitionCancel"),transitionend:ba("Transition","TransitionEnd")},Uc={},ru={};_n&&(ru=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function ts(e){if(Uc[e])return Uc[e];if(!Hs[e])return e;var t=Hs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ru)return Uc[e]=t[n];return e}var cu=ts("animationend"),Hc=ts("animationiteration"),Bc=ts("animationstart"),ou=ts("transitionrun"),uu=ts("transitionstart"),ed=ts("transitioncancel"),Ic=ts("transitionend"),qc=new Map,Gc="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(" ");Gc.push("scrollEnd");function Cl(e,t){qc.set(e,t),xn(t,[e])}var Ja=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)},Al=[],Wa=0,Yc=0;function Ar(){for(var e=Wa,t=Yc=Wa=0;t<e;){var n=Al[t];Al[t++]=null;var a=Al[t];Al[t++]=null;var u=Al[t];Al[t++]=null;var f=Al[t];if(Al[t++]=null,a!==null&&u!==null){var x=a.pending;x===null?u.next=u:(u.next=x.next,x.next=u),a.pending=u}f!==0&&$c(n,u,f)}}function Bs(e,t,n,a){Al[Wa++]=e,Al[Wa++]=t,Al[Wa++]=n,Al[Wa++]=a,Yc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Mr(e,t,n,a){return Bs(e,t,n,a),Rr(e)}function xa(e,t){return Bs(e,null,null,t),Rr(e)}function $c(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,a=f.alternate,a!==null&&(a.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Et(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function Rr(e){if(50<go)throw go=0,Wd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pa={};function td(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vl(e,t,n,a){return new td(e,t,n,a)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function js(e,t){var n=e.alternate;return n===null?(n=vl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fu(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Dr(e,t,n,a,u,f){var x=0;if(a=e,typeof e=="function")Xc(e)&&(x=1);else if(typeof e=="string")x=s0(e,n,ge.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=vl(31,n,t,u),e.elementType=ne,e.lanes=f,e;case E:return ya(n.children,u,f,t);case L:x=8,u|=24;break;case $:return e=vl(12,n,t,u|2),e.elementType=$,e.lanes=f,e;case Z:return e=vl(13,n,t,u),e.elementType=Z,e.lanes=f,e;case M:return e=vl(19,n,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:x=10;break e;case J:x=9;break e;case O:x=11;break e;case D:x=14;break e;case B:x=16,a=null;break e}x=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=vl(x,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function ya(e,t,n,a){return e=vl(7,e,a,t),e.lanes=n,e}function Vc(e,t,n){return e=vl(6,e,null,t),e.lanes=n,e}function du(e){var t=vl(18,null,null,0);return t.stateNode=e,t}function Qc(e,t,n){return t=vl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Kc=new WeakMap;function Ml(e,t){if(typeof e=="object"&&e!==null){var n=Kc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:tn(t)},Kc.set(e,t),t)}return{value:e,source:t,stack:tn(t)}}var ei=[],ti=0,Or=null,_a=0,dl=[],sl=0,Is=null,ns=1,ls="";function Ss(e,t){ei[ti++]=_a,ei[ti++]=Or,Or=e,_a=t}function hu(e,t,n){dl[sl++]=ns,dl[sl++]=ls,dl[sl++]=Is,Is=e;var a=ns;e=ls;var u=32-Et(a)-1;a&=~(1<<u),n+=1;var f=32-Et(t)+u;if(30<f){var x=u-u%5;f=(a&(1<<x)-1).toString(32),a>>=x,u-=x,ns=1<<32-Et(t)+u|n<<u|a,ls=f+e}else ns=1<<f|n<<u|a,ls=e}function Zc(e){e.return!==null&&(Ss(e,1),hu(e,1,0))}function Fc(e){for(;e===Or;)Or=ei[--ti],ei[ti]=null,_a=ei[--ti],ei[ti]=null;for(;e===Is;)Is=dl[--sl],dl[sl]=null,ls=dl[--sl],dl[sl]=null,ns=dl[--sl],dl[sl]=null}function pu(e,t){dl[sl++]=ns,dl[sl++]=ls,dl[sl++]=Is,ns=t.id,ls=t.overflow,Is=e}var Vn=null,qt=null,st=!1,qs=null,Rl=!1,Jc=Error(c(519));function Gs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw al(Ml(t,e)),Jc}function mu(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Vt]=e,t[$e]=a,n){case"dialog":it("cancel",t),it("close",t);break;case"iframe":case"object":case"embed":it("load",t);break;case"video":case"audio":for(n=0;n<xo.length;n++)it(xo[n],t);break;case"source":it("error",t);break;case"img":case"image":case"link":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"input":it("invalid",t),Jl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":it("invalid",t);break;case"textarea":it("invalid",t),N(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Gg(t.textContent,n)?(a.popover!=null&&(it("beforetoggle",t),it("toggle",t)),a.onScroll!=null&&it("scroll",t),a.onScrollEnd!=null&&it("scrollend",t),a.onClick!=null&&(t.onclick=mt),t=!0):t=!1,t||Gs(e,!0)}function gu(e){for(Vn=e.return;Vn;)switch(Vn.tag){case 5:case 31:case 13:Rl=!1;return;case 27:case 3:Rl=!0;return;default:Vn=Vn.return}}function va(e){if(e!==Vn)return!1;if(!st)return gu(e),st=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||hh(e.type,e.memoizedProps)),n=!n),n&&qt&&Gs(e),gu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));qt=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));qt=Jg(e)}else t===27?(t=qt,ji(e.type)?(e=xh,xh=null,qt=e):qt=t):qt=Vn?os(e.stateNode.nextSibling):null;return!0}function Ys(){qt=Vn=null,st=!1}function ni(){var e=qs;return e!==null&&(Ul===null?Ul=e:Ul.push.apply(Ul,e),qs=null),e}function al(e){qs===null?qs=[e]:qs.push(e)}var jl=k(null),Tn=null,ss=null;function as(e,t,n){ce(jl,t._currentValue),t._currentValue=n}function is(e){e._currentValue=jl.current,V(jl)}function li(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Lr(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=u.child;f=f.firstContext;e:for(;f!==null;){var 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),li(f.return,n,e),a||(x=null);break e}f=S.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(c(341));x.lanes|=n,f=x.alternate,f!==null&&(f.lanes|=n),li(x,n,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function si(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var S=u.type;_l(u.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(u===Te.current){if(x=u.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(So):e=[So])}u=u.return}e!==null&&Lr(t,e,n,a),t.flags|=262144}function $s(e){for(e=e.firstContext;e!==null;){if(!_l(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xs(e){Tn=e,ss=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qn(e){return bu(Tn,e)}function ai(e,t){return Tn===null&&Xs(e),bu(e,t)}function bu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ss===null){if(e===null)throw Error(c(308));ss=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ss=ss.next=t;return n}var Ji=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},ii=l.unstable_scheduleCallback,nd=l.unstable_NormalPriority,dn={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zr(){return{controller:new Ji,data:new Map,refCount:0}}function Wi(e){e.refCount--,e.refCount===0&&ii(nd,function(){e.controller.abort()})}var Pi=null,Ur=0,ja=0,ri=null;function ld(e,t){if(Pi===null){var n=Pi=[];Ur=0,ja=sh(),ri={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Ur++,t.then(xu,xu),t}function xu(){if(--Ur===0&&Pi!==null){ri!==null&&(ri.status="fulfilled");var e=Pi;Pi=null,ja=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wc(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),a}var Pc=A.S;A.S=function(e,t){dg=Ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ld(e,t),Pc!==null&&Pc(e,t)};var Sa=k(null);function Vs(){var e=Sa.current;return e!==null?e:Gt.pooledCache}function ci(e,t){t===null?ce(Sa,Sa.current):ce(Sa,t.pool)}function yu(){var e=Vs();return e===null?null:{parent:dn._currentValue,pool:e}}var wa=Error(c(460)),Hr=Error(c(474)),p=Error(c(542)),I={then:function(){}};function de(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ie(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mt,mt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oi(e),e;default:if(typeof t.status=="string")t.then(mt,mt);else{if(e=Gt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oi(e),e}throw Zt=t,wa}}function xt(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zt=n,wa):n}}var Zt=null;function Dl(){if(Zt===null)throw Error(c(459));var e=Zt;return Zt=null,e}function oi(e){if(e===wa||e===p)throw Error(c(483))}var ka=null,ui=0;function ye(e){var t=ui;return ui+=1,ka===null&&(ka=[]),Ie(ka,e,t)}function Ee(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qe(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 dt(e){function t(q,U){if(e){var Q=q.deletions;Q===null?(q.deletions=[U],q.flags|=16):Q.push(U)}}function n(q,U){if(!e)return null;for(;U!==null;)t(q,U),U=U.sibling;return null}function a(q){for(var U=new Map;q!==null;)q.key!==null?U.set(q.key,q):U.set(q.index,q),q=q.sibling;return U}function u(q,U){return q=js(q,U),q.index=0,q.sibling=null,q}function f(q,U,Q){return q.index=Q,e?(Q=q.alternate,Q!==null?(Q=Q.index,Q<U?(q.flags|=67108866,U):Q):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function x(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function S(q,U,Q,re){return U===null||U.tag!==6?(U=Vc(Q,q.mode,re),U.return=q,U):(U=u(U,Q),U.return=q,U)}function R(q,U,Q,re){var Ue=Q.type;return Ue===E?se(q,U,Q.props.children,re,Q.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===B&&xt(Ue)===U.type)?(U=u(U,Q.props),Ee(U,Q),U.return=q,U):(U=Dr(Q.type,Q.key,Q.props,null,q.mode,re),Ee(U,Q),U.return=q,U)}function K(q,U,Q,re){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Qc(Q,q.mode,re),U.return=q,U):(U=u(U,Q.children||[]),U.return=q,U)}function se(q,U,Q,re,Ue){return U===null||U.tag!==7?(U=ya(Q,q.mode,re,Ue),U.return=q,U):(U=u(U,Q),U.return=q,U)}function oe(q,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Vc(""+U,q.mode,Q),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case C:return Q=Dr(U.type,U.key,U.props,null,q.mode,Q),Ee(Q,U),Q.return=q,Q;case T:return U=Qc(U,q.mode,Q),U.return=q,U;case B:return U=xt(U),oe(q,U,Q)}if(Ne(U)||ue(U))return U=ya(U,q.mode,Q,null),U.return=q,U;if(typeof U.then=="function")return oe(q,ye(U),Q);if(U.$$typeof===G)return oe(q,ai(q,U),Q);qe(q,U)}return null}function F(q,U,Q,re){var Ue=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:S(q,U,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:return Q.key===Ue?R(q,U,Q,re):null;case T:return Q.key===Ue?K(q,U,Q,re):null;case B:return Q=xt(Q),F(q,U,Q,re)}if(Ne(Q)||ue(Q))return Ue!==null?null:se(q,U,Q,re,null);if(typeof Q.then=="function")return F(q,U,ye(Q),re);if(Q.$$typeof===G)return F(q,U,ai(q,Q),re);qe(q,Q)}return null}function te(q,U,Q,re,Ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return q=q.get(Q)||null,S(U,q,""+re,Ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case C:return q=q.get(re.key===null?Q:re.key)||null,R(U,q,re,Ue);case T:return q=q.get(re.key===null?Q:re.key)||null,K(U,q,re,Ue);case B:return re=xt(re),te(q,U,Q,re,Ue)}if(Ne(re)||ue(re))return q=q.get(Q)||null,se(U,q,re,Ue,null);if(typeof re.then=="function")return te(q,U,Q,ye(re),Ue);if(re.$$typeof===G)return te(q,U,Q,ai(U,re),Ue);qe(U,re)}return null}function Re(q,U,Q,re){for(var Ue=null,yt=null,Oe=U,Pe=U=0,ct=null;Oe!==null&&Pe<Q.length;Pe++){Oe.index>Pe?(ct=Oe,Oe=null):ct=Oe.sibling;var _t=F(q,Oe,Q[Pe],re);if(_t===null){Oe===null&&(Oe=ct);break}e&&Oe&&_t.alternate===null&&t(q,Oe),U=f(_t,U,Pe),yt===null?Ue=_t:yt.sibling=_t,yt=_t,Oe=ct}if(Pe===Q.length)return n(q,Oe),st&&Ss(q,Pe),Ue;if(Oe===null){for(;Pe<Q.length;Pe++)Oe=oe(q,Q[Pe],re),Oe!==null&&(U=f(Oe,U,Pe),yt===null?Ue=Oe:yt.sibling=Oe,yt=Oe);return st&&Ss(q,Pe),Ue}for(Oe=a(Oe);Pe<Q.length;Pe++)ct=te(Oe,q,Pe,Q[Pe],re),ct!==null&&(e&&ct.alternate!==null&&Oe.delete(ct.key===null?Pe:ct.key),U=f(ct,U,Pe),yt===null?Ue=ct:yt.sibling=ct,yt=ct);return e&&Oe.forEach(function(Ti){return t(q,Ti)}),st&&Ss(q,Pe),Ue}function He(q,U,Q,re){if(Q==null)throw Error(c(151));for(var Ue=null,yt=null,Oe=U,Pe=U=0,ct=null,_t=Q.next();Oe!==null&&!_t.done;Pe++,_t=Q.next()){Oe.index>Pe?(ct=Oe,Oe=null):ct=Oe.sibling;var Ti=F(q,Oe,_t.value,re);if(Ti===null){Oe===null&&(Oe=ct);break}e&&Oe&&Ti.alternate===null&&t(q,Oe),U=f(Ti,U,Pe),yt===null?Ue=Ti:yt.sibling=Ti,yt=Ti,Oe=ct}if(_t.done)return n(q,Oe),st&&Ss(q,Pe),Ue;if(Oe===null){for(;!_t.done;Pe++,_t=Q.next())_t=oe(q,_t.value,re),_t!==null&&(U=f(_t,U,Pe),yt===null?Ue=_t:yt.sibling=_t,yt=_t);return st&&Ss(q,Pe),Ue}for(Oe=a(Oe);!_t.done;Pe++,_t=Q.next())_t=te(Oe,q,Pe,_t.value,re),_t!==null&&(e&&_t.alternate!==null&&Oe.delete(_t.key===null?Pe:_t.key),U=f(_t,U,Pe),yt===null?Ue=_t:yt.sibling=_t,yt=_t);return e&&Oe.forEach(function(m0){return t(q,m0)}),st&&Ss(q,Pe),Ue}function Ot(q,U,Q,re){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:e:{for(var Ue=Q.key;U!==null;){if(U.key===Ue){if(Ue=Q.type,Ue===E){if(U.tag===7){n(q,U.sibling),re=u(U,Q.props.children),re.return=q,q=re;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===B&&xt(Ue)===U.type){n(q,U.sibling),re=u(U,Q.props),Ee(re,Q),re.return=q,q=re;break e}n(q,U);break}else t(q,U);U=U.sibling}Q.type===E?(re=ya(Q.props.children,q.mode,re,Q.key),re.return=q,q=re):(re=Dr(Q.type,Q.key,Q.props,null,q.mode,re),Ee(re,Q),re.return=q,q=re)}return x(q);case T:e:{for(Ue=Q.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){n(q,U.sibling),re=u(U,Q.children||[]),re.return=q,q=re;break e}else{n(q,U);break}else t(q,U);U=U.sibling}re=Qc(Q,q.mode,re),re.return=q,q=re}return x(q);case B:return Q=xt(Q),Ot(q,U,Q,re)}if(Ne(Q))return Re(q,U,Q,re);if(ue(Q)){if(Ue=ue(Q),typeof Ue!="function")throw Error(c(150));return Q=Ue.call(Q),He(q,U,Q,re)}if(typeof Q.then=="function")return Ot(q,U,ye(Q),re);if(Q.$$typeof===G)return Ot(q,U,ai(q,Q),re);qe(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(n(q,U.sibling),re=u(U,Q),re.return=q,q=re):(n(q,U),re=Vc(Q,q.mode,re),re.return=q,q=re),x(q)):n(q,U)}return function(q,U,Q,re){try{ui=0;var Ue=Ot(q,U,Q,re);return ka=null,Ue}catch(Oe){if(Oe===wa||Oe===p)throw Oe;var yt=vl(29,Oe,null,q.mode);return yt.lanes=re,yt.return=q,yt}finally{}}}var ut=dt(!0),rs=dt(!1),Qs=!1;function sd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ad(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function di(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(jt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Rr(e),$c(e,null,n),t}return Bs(e,a,t,n),Rr(e)}function eo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ql(e,n)}}function id(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var x={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var rd=!1;function to(){if(rd){var e=ri;if(e!==null)throw e}}function no(e,t,n,a){rd=!1;var u=e.updateQueue;Qs=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,K=R.next;R.next=null,x===null?f=K:x.next=K,x=R;var se=e.alternate;se!==null&&(se=se.updateQueue,S=se.lastBaseUpdate,S!==x&&(S===null?se.firstBaseUpdate=K:S.next=K,se.lastBaseUpdate=R))}if(f!==null){var oe=u.baseState;x=0,se=K=R=null,S=f;do{var F=S.lane&-536870913,te=F!==S.lane;if(te?(rt&F)===F:(a&F)===F){F!==0&&F===ja&&(rd=!0),se!==null&&(se=se.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Re=e,He=S;F=t;var Ot=n;switch(He.tag){case 1:if(Re=He.payload,typeof Re=="function"){oe=Re.call(Ot,oe,F);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=He.payload,F=typeof Re=="function"?Re.call(Ot,oe,F):Re,F==null)break e;oe=j({},oe,F);break e;case 2:Qs=!0}}F=S.callback,F!==null&&(e.flags|=64,te&&(e.flags|=8192),te=u.callbacks,te===null?u.callbacks=[F]:te.push(F))}else te={lane:F,tag:S.tag,payload:S.payload,callback:S.callback,next:null},se===null?(K=se=te,R=oe):se=se.next=te,x|=F;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;te=S,S=te.next,te.next=null,u.lastBaseUpdate=te,u.shared.pending=null}}while(!0);se===null&&(R=oe),u.baseState=R,u.firstBaseUpdate=K,u.lastBaseUpdate=se,f===null&&(u.shared.lanes=0),bi|=x,e.lanes=x,e.memoizedState=oe}}function Up(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Hp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Up(n[e],t)}var Br=k(null),_u=k(0);function Bp(e,t){e=Oa,ce(_u,e),ce(Br,t),Oa=e|t.baseLanes}function cd(){ce(_u,Oa),ce(Br,Br.current)}function od(){Oa=_u.current,V(Br),V(_u)}var ql=k(null),cs=null;function hi(e){var t=e.alternate;ce(En,En.current&1),ce(ql,e),cs===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(cs=e)}function ud(e){ce(En,En.current),ce(ql,e),cs===null&&(cs=e)}function Ip(e){e.tag===22?(ce(En,En.current),ce(ql,e),cs===null&&(cs=e)):pi()}function pi(){ce(En,En.current),ce(ql,ql.current)}function Gl(e){V(ql),cs===e&&(cs=null),V(En)}var En=k(0);function vu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gh(n)||bh(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Na=0,We=null,Rt=null,Hn=null,ju=!1,Ir=!1,er=!1,Su=0,lo=0,qr=null,a_=0;function vn(){throw Error(c(321))}function fd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_l(e[n],t[n]))return!1;return!0}function dd(e,t,n,a,u,f){return Na=f,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Sm:Td,er=!1,f=n(a,u),er=!1,Ir&&(f=Gp(t,n,a,u)),qp(e),f}function qp(e){A.H=io;var t=Rt!==null&&Rt.next!==null;if(Na=0,Hn=Rt=We=null,ju=!1,lo=0,qr=null,t)throw Error(c(300));e===null||Bn||(e=e.dependencies,e!==null&&$s(e)&&(Bn=!0))}function Gp(e,t,n,a){We=e;var u=0;do{if(Ir&&(qr=null),lo=0,Ir=!1,25<=u)throw Error(c(301));if(u+=1,Hn=Rt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=wm,f=t(n,a)}while(Ir);return f}function i_(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?so(t):t,e=e.useState()[0],(Rt!==null?Rt.memoizedState:null)!==e&&(We.flags|=1024),t}function hd(){var e=Su!==0;return Su=0,e}function pd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function md(e){if(ju){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ju=!1}Na=0,Hn=Rt=We=null,Ir=!1,lo=Su=0,qr=null}function Sl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e,Hn}function Cn(){if(Rt===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Rt.next;var t=Hn===null?We.memoizedState:Hn.next;if(t!==null)Hn=t,Rt=e;else{if(e===null)throw We.alternate===null?Error(c(467)):Error(c(310));Rt=e,e={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e}return Hn}function wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(e){var t=lo;return lo+=1,qr===null&&(qr=[]),e=Ie(qr,e,t),t=We,(Hn===null?t.memoizedState:Hn.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Sm:Td),e}function ku(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return so(e);if(e.$$typeof===G)return Qn(e)}throw Error(c(438,String(e)))}function gd(e){var t=null,n=We.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=We.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=wu(),We.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=he;return t.index++,n}function Ta(e,t){return typeof t=="function"?t(e):t}function Nu(e){var t=Cn();return bd(t,Rt,e)}function bd(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var x=u.next;u.next=f.next,f.next=x}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=x=null,R=null,K=t,se=!1;do{var oe=K.lane&-536870913;if(oe!==K.lane?(rt&oe)===oe:(Na&oe)===oe){var F=K.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),oe===ja&&(se=!0);else if((Na&F)===F){K=K.next,F===ja&&(se=!0);continue}else oe={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(S=R=oe,x=f):R=R.next=oe,We.lanes|=F,bi|=F;oe=K.action,er&&n(f,oe),f=K.hasEagerState?K.eagerState:n(f,oe)}else F={lane:oe,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(S=R=F,x=f):R=R.next=F,We.lanes|=oe,bi|=oe;K=K.next}while(K!==null&&K!==t);if(R===null?x=f:R.next=S,!_l(f,e.memoizedState)&&(Bn=!0,se&&(n=ri,n!==null)))throw n;e.memoizedState=f,e.baseState=x,e.baseQueue=R,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function xd(e){var t=Cn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);_l(f,t.memoizedState)||(Bn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Yp(e,t,n){var a=We,u=Cn(),f=st;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var x=!_l((Rt||u).memoizedState,n);if(x&&(u.memoizedState=n,Bn=!0),u=u.queue,vd(Vp.bind(null,a,u,e),[e]),u.getSnapshot!==t||x||Hn!==null&&Hn.memoizedState.tag&1){if(a.flags|=2048,Gr(9,{destroy:void 0},Xp.bind(null,a,u,n,t),null),Gt===null)throw Error(c(349));f||(Na&127)!==0||$p(a,t,n)}return n}function $p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t=wu(),We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xp(e,t,n,a){t.value=n,t.getSnapshot=a,Qp(t)&&Kp(e)}function Vp(e,t,n){return n(function(){Qp(t)&&Kp(e)})}function Qp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_l(e,n)}catch{return!0}}function Kp(e){var t=xa(e,2);t!==null&&Hl(t,e,2)}function yd(e){var t=Sl();if(typeof e=="function"){var n=e;if(e=n(),er){Kt(!0);try{n()}finally{Kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:e},t}function Zp(e,t,n,a){return e.baseState=n,bd(e,Rt,typeof a=="function"?a:Ta)}function r_(e,t,n,a,u){if(Cu(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};A.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Fp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Fp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=A.T,x={};A.T=x;try{var S=n(u,a),R=A.S;R!==null&&R(x,S),Jp(e,t,S)}catch(K){_d(e,t,K)}finally{f!==null&&x.types!==null&&(f.types=x.types),A.T=f}}else try{f=n(u,a),Jp(e,t,f)}catch(K){_d(e,t,K)}}function Jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Wp(e,t,a)},function(a){return _d(e,t,a)}):Wp(e,t,n)}function Wp(e,t,n){t.status="fulfilled",t.value=n,Pp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Fp(e,n)))}function _d(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Pp(t),t=t.next;while(t!==a)}e.action=null}function Pp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function em(e,t){return t}function tm(e,t){if(st){var n=Gt.formState;if(n!==null){e:{var a=We;if(st){if(qt){t:{for(var u=qt,f=Rl;u.nodeType!==8;){if(!f){u=null;break t}if(u=os(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){qt=os(u.nextSibling),a=u.data==="F!";break e}}Gs(a)}a=!1}a&&(t=n[0])}}return n=Sl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:t},n.queue=a,n=_m.bind(null,We,a),a.dispatch=n,a=yd(!1),f=Nd.bind(null,We,!1,a.queue),a=Sl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=r_.bind(null,We,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function nm(e){var t=Cn();return lm(t,Rt,e)}function lm(e,t,n){if(t=bd(e,t,em)[0],e=Nu(Ta)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=so(t)}catch(x){throw x===wa?p:x}else a=t;t=Cn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(We.flags|=2048,Gr(9,{destroy:void 0},c_.bind(null,u,n),null)),[a,f,e]}function c_(e,t){e.action=t}function sm(e){var t=Cn(),n=Rt;if(n!==null)return lm(t,n,e);Cn(),t=t.memoizedState,n=Cn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Gr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=We.updateQueue,t===null&&(t=wu(),We.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function am(){return Cn().memoizedState}function Tu(e,t,n,a){var u=Sl();We.flags|=e,u.memoizedState=Gr(1|t,{destroy:void 0},n,a===void 0?null:a)}function Eu(e,t,n,a){var u=Cn();a=a===void 0?null:a;var f=u.memoizedState.inst;Rt!==null&&a!==null&&fd(a,Rt.memoizedState.deps)?u.memoizedState=Gr(t,f,n,a):(We.flags|=e,u.memoizedState=Gr(1|t,f,n,a))}function im(e,t){Tu(8390656,8,e,t)}function vd(e,t){Eu(2048,8,e,t)}function o_(e){We.flags|=4;var t=We.updateQueue;if(t===null)t=wu(),We.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function rm(e){var t=Cn().memoizedState;return o_({ref:t,nextImpl:e}),function(){if((jt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function cm(e,t){return Eu(4,2,e,t)}function om(e,t){return Eu(4,4,e,t)}function um(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fm(e,t,n){n=n!=null?n.concat([e]):null,Eu(4,4,um.bind(null,t,e),n)}function jd(){}function dm(e,t){var n=Cn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&fd(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function hm(e,t){var n=Cn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&fd(t,a[1]))return a[0];if(a=e(),er){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[a,t],a}function Sd(e,t,n){return n===void 0||(Na&1073741824)!==0&&(rt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=pg(),We.lanes|=e,bi|=e,n)}function pm(e,t,n,a){return _l(n,t)?n:Br.current!==null?(e=Sd(e,n,a),_l(e,t)||(Bn=!0),e):(Na&42)===0||(Na&1073741824)!==0&&(rt&261930)===0?(Bn=!0,e.memoizedState=n):(e=pg(),We.lanes|=e,bi|=e,t)}function mm(e,t,n,a,u){var f=fe.p;fe.p=f!==0&&8>f?f:8;var x=A.T,S={};A.T=S,Nd(e,!1,t,n);try{var R=u(),K=A.S;if(K!==null&&K(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var se=Wc(R,a);ao(e,t,se,Xl(e))}else ao(e,t,a,Xl(e))}catch(oe){ao(e,t,{then:function(){},status:"rejected",reason:oe},Xl())}finally{fe.p=f,x!==null&&S.types!==null&&(x.types=S.types),A.T=x}}function u_(){}function wd(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=gm(e).queue;mm(e,u,t,z,n===null?u_:function(){return bm(e),n(a)})}function gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:z},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bm(e){var t=gm(e);t.next===null&&(t=e.alternate.memoizedState),ao(e,t.next.queue,{},Xl())}function kd(){return Qn(So)}function xm(){return Cn().memoizedState}function ym(){return Cn().memoizedState}function f_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Xl();e=fi(n);var a=di(t,e,n);a!==null&&(Hl(a,t,n),eo(a,t,n)),t={cache:zr()},e.payload=t;return}t=t.return}}function d_(e,t,n){var a=Xl();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cu(e)?vm(t,n):(n=Mr(e,t,n,a),n!==null&&(Hl(n,e,a),jm(n,t,a)))}function _m(e,t,n){var a=Xl();ao(e,t,n,a)}function ao(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))vm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var x=t.lastRenderedState,S=f(x,n);if(u.hasEagerState=!0,u.eagerState=S,_l(S,x))return Bs(e,t,u,0),Gt===null&&Ar(),!1}catch{}finally{}if(n=Mr(e,t,u,a),n!==null)return Hl(n,e,a),jm(n,t,a),!0}return!1}function Nd(e,t,n,a){if(a={lane:2,revertLane:sh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(t)throw Error(c(479))}else t=Mr(e,n,a,2),t!==null&&Hl(t,e,2)}function Cu(e){var t=e.alternate;return e===We||t!==null&&t===We}function vm(e,t){Ir=ju=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ql(e,n)}}var io={readContext:Qn,use:ku,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};io.useEffectEvent=vn;var Sm={readContext:Qn,use:ku,useCallback:function(e,t){return Sl().memoizedState=[e,t===void 0?null:t],e},useContext:Qn,useEffect:im,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Tu(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Tu(4194308,4,e,t)},useInsertionEffect:function(e,t){Tu(4,2,e,t)},useMemo:function(e,t){var n=Sl();t=t===void 0?null:t;var a=e();if(er){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Sl();if(n!==void 0){var u=n(t);if(er){Kt(!0);try{n(t)}finally{Kt(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=d_.bind(null,We,e),[a.memoizedState,e]},useRef:function(e){var t=Sl();return e={current:e},t.memoizedState=e},useState:function(e){e=yd(e);var t=e.queue,n=_m.bind(null,We,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:jd,useDeferredValue:function(e,t){var n=Sl();return Sd(n,e,t)},useTransition:function(){var e=yd(!1);return e=mm.bind(null,We,e.queue,!0,!1),Sl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=We,u=Sl();if(st){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Gt===null)throw Error(c(349));(rt&127)!==0||$p(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,im(Vp.bind(null,a,f,e),[e]),a.flags|=2048,Gr(9,{destroy:void 0},Xp.bind(null,a,f,n,t),null),n},useId:function(){var e=Sl(),t=Gt.identifierPrefix;if(st){var n=ls,a=ns;n=(a&~(1<<32-Et(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Su++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=a_++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kd,useFormState:tm,useActionState:tm,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=Nd.bind(null,We,!0,n),n.dispatch=t,[e,t]},useMemoCache:gd,useCacheRefresh:function(){return Sl().memoizedState=f_.bind(null,We)},useEffectEvent:function(e){var t=Sl(),n={impl:e};return t.memoizedState=n,function(){if((jt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Td={readContext:Qn,use:ku,useCallback:dm,useContext:Qn,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:Nu,useRef:am,useState:function(){return Nu(Ta)},useDebugValue:jd,useDeferredValue:function(e,t){var n=Cn();return pm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=Nu(Ta)[0],t=Cn().memoizedState;return[typeof e=="boolean"?e:so(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:kd,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=Cn();return Zp(n,Rt,e,t)},useMemoCache:gd,useCacheRefresh:ym};Td.useEffectEvent=rm;var wm={readContext:Qn,use:ku,useCallback:dm,useContext:Qn,useEffect:vd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:xd,useRef:am,useState:function(){return xd(Ta)},useDebugValue:jd,useDeferredValue:function(e,t){var n=Cn();return Rt===null?Sd(n,e,t):pm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=xd(Ta)[0],t=Cn().memoizedState;return[typeof e=="boolean"?e:so(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:kd,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=Cn();return Rt!==null?Zp(n,Rt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:gd,useCacheRefresh:ym};wm.useEffectEvent=rm;function Ed(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cd={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Xl(),u=fi(a);u.payload=t,n!=null&&(u.callback=n),t=di(e,u,a),t!==null&&(Hl(t,e,a),eo(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Xl(),u=fi(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=di(e,u,a),t!==null&&(Hl(t,e,a),eo(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),a=fi(n);a.tag=2,t!=null&&(a.callback=t),t=di(e,a,n),t!==null&&(Hl(t,e,n),eo(t,e,n))}};function km(e,t,n,a,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,x):t.prototype&&t.prototype.isPureReactComponent?!es(n,a)||!es(u,f):!0}function Nm(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Cd.enqueueReplaceState(t,t.state,null)}function tr(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Tm(e){Ja(e)}function Em(e){console.error(e)}function Cm(e){Ja(e)}function Au(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Am(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ad(e,t,n){return n=fi(n),n.tag=3,n.payload={element:null},n.callback=function(){Au(e,t)},n}function Mm(e){return e=fi(e),e.tag=3,e}function Rm(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){Am(t,n,a)}}var x=n.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Am(t,n,a),typeof u!="function"&&(xi===null?xi=new Set([this]):xi.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})})}function h_(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&si(t,n,u,!0),n=ql.current,n!==null){switch(n.tag){case 31:case 13:return cs===null?Gu():n.alternate===null&&jn===0&&(jn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===I?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),th(e,a,u)),!1;case 22:return n.flags|=65536,a===I?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),th(e,a,u)),!1}throw Error(c(435,n.tag))}return th(e,a,u),Gu(),!1}if(st)return t=ql.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==Jc&&(e=Error(c(422),{cause:a}),al(Ml(e,n)))):(a!==Jc&&(t=Error(c(423),{cause:a}),al(Ml(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Ml(a,n),u=Ad(e.stateNode,a,u),id(e,u),jn!==4&&(jn=2)),!1;var f=Error(c(520),{cause:a});if(f=Ml(f,n),mo===null?mo=[f]:mo.push(f),jn!==4&&(jn=2),t===null)return!0;a=Ml(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Ad(n.stateNode,a,e),id(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(xi===null||!xi.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Mm(u),Rm(u,e,n,a),id(n,u),!1}n=n.return}while(n!==null);return!1}var Md=Error(c(461)),Bn=!1;function il(e,t,n,a){t.child=e===null?rs(t,null,n,a):ut(t,e.child,n,a)}function Dm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var x={};for(var S in a)S!=="ref"&&(x[S]=a[S])}else x=a;return Xs(t),a=dd(e,t,n,x,f,u),S=hd(),e!==null&&!Bn?(pd(e,t,u),Ea(e,t,u)):(st&&S&&Zc(t),t.flags|=1,il(e,t,a,u),t.child)}function Om(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!Xc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Lm(e,t,f,a,u)):(e=Dr(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Bd(e,u)){var x=f.memoizedProps;if(n=n.compare,n=n!==null?n:es,n(x,a)&&e.ref===t.ref)return Ea(e,t,u)}return t.flags|=1,e=js(f,a),e.ref=t.ref,e.return=t,t.child=e}function Lm(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(es(f,a)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=a=f,Bd(e,u))(e.flags&131072)!==0&&(Bn=!0);else return t.lanes=e.lanes,Ea(e,t,u)}return Rd(e,t,n,a,u)}function zm(e,t,n,a){var u=a.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~f}else a=0,t.child=null;return Um(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ci(t,f!==null?f.cachePool:null),f!==null?Bp(t,f):cd(),Ip(t);else return a=t.lanes=536870912,Um(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(ci(t,f.cachePool),Bp(t,f),pi(),t.memoizedState=null):(e!==null&&ci(t,null),cd(),pi());return il(e,t,u,n),t.child}function ro(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Um(e,t,n,a,u){var f=Vs();return f=f===null?null:{parent:dn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&ci(t,null),cd(),Ip(t),e!==null&&si(e,t,a,!0),t.childLanes=u,null}function Mu(e,t){return t=Du({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hm(e,t,n){return ut(t,e.child,null,n),e=Mu(t,t.pendingProps),e.flags|=2,Gl(t),t.memoizedState=null,e}function p_(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(st){if(a.mode==="hidden")return e=Mu(t,a),t.lanes=536870912,ro(null,e);if(ud(t),(e=qt)?(e=Fg(e,Rl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Is!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=du(e),n.return=t,t.child=n,Vn=t,qt=null)):e=null,e===null)throw Gs(t);return t.lanes=536870912,null}return Mu(t,a)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(ud(t),u)if(t.flags&256)t.flags&=-257,t=Hm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Bn||si(e,t,n,!1),u=(n&e.childLanes)!==0,Bn||u){if(a=Gt,a!==null&&(x=ps(a,n),x!==0&&x!==f.retryLane))throw f.retryLane=x,xa(e,x),Hl(a,e,x),Md;Gu(),t=Hm(e,t,n)}else e=f.treeContext,qt=os(x.nextSibling),Vn=t,st=!0,qs=null,Rl=!1,e!==null&&pu(t,e),t=Mu(t,a),t.flags|=4096;return t}return e=js(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ru(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rd(e,t,n,a,u){return Xs(t),n=dd(e,t,n,a,void 0,u),a=hd(),e!==null&&!Bn?(pd(e,t,u),Ea(e,t,u)):(st&&a&&Zc(t),t.flags|=1,il(e,t,n,u),t.child)}function Bm(e,t,n,a,u,f){return Xs(t),t.updateQueue=null,n=Gp(t,a,n,u),qp(e),a=hd(),e!==null&&!Bn?(pd(e,t,f),Ea(e,t,f)):(st&&a&&Zc(t),t.flags|=1,il(e,t,n,f),t.child)}function Im(e,t,n,a,u){if(Xs(t),t.stateNode===null){var f=Pa,x=n.contextType;typeof x=="object"&&x!==null&&(f=Qn(x)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Cd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},sd(t),x=n.contextType,f.context=typeof x=="object"&&x!==null?Qn(x):Pa,f.state=t.memoizedState,x=n.getDerivedStateFromProps,typeof x=="function"&&(Ed(t,n,x,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Cd.enqueueReplaceState(f,f.state,null),no(t,a,f,u),to(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,R=tr(n,S);f.props=R;var K=f.context,se=n.contextType;x=Pa,typeof se=="object"&&se!==null&&(x=Qn(se));var oe=n.getDerivedStateFromProps;se=typeof oe=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,se||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||K!==x)&&Nm(t,f,a,x),Qs=!1;var F=t.memoizedState;f.state=F,no(t,a,f,u),to(),K=t.memoizedState,S||F!==K||Qs?(typeof oe=="function"&&(Ed(t,n,oe,a),K=t.memoizedState),(R=Qs||km(t,n,R,a,F,K,x))?(se||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=K),f.props=a,f.state=K,f.context=x,a=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,ad(e,t),x=t.memoizedProps,se=tr(n,x),f.props=se,oe=t.pendingProps,F=f.context,K=n.contextType,R=Pa,typeof K=="object"&&K!==null&&(R=Qn(K)),S=n.getDerivedStateFromProps,(K=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==oe||F!==R)&&Nm(t,f,a,R),Qs=!1,F=t.memoizedState,f.state=F,no(t,a,f,u),to();var te=t.memoizedState;x!==oe||F!==te||Qs||e!==null&&e.dependencies!==null&&$s(e.dependencies)?(typeof S=="function"&&(Ed(t,n,S,a),te=t.memoizedState),(se=Qs||km(t,n,se,a,F,te,R)||e!==null&&e.dependencies!==null&&$s(e.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,te,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,te,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=te),f.props=a,f.state=te,f.context=R,a=se):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,Ru(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=ut(t,e.child,null,u),t.child=ut(t,null,n,u)):il(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ea(e,t,u),e}function qm(e,t,n,a){return Ys(),t.flags|=256,il(e,t,n,a),t.child}var Dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Od(e){return{baseLanes:e,cachePool:yu()}}function Ld(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$l),e}function Gm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(En.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(u?hi(t):pi(),(e=qt)?(e=Fg(e,Rl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Is!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=du(e),n.return=t,t.child=n,Vn=t,qt=null)):e=null,e===null)throw Gs(t);return bh(e)?t.lanes=32:t.lanes=536870912,null}var S=a.children;return a=a.fallback,u?(pi(),u=t.mode,S=Du({mode:"hidden",children:S},u),a=ya(a,u,n,null),S.return=t,a.return=t,S.sibling=a,t.child=S,a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,x,n),t.memoizedState=Dd,ro(null,a)):(hi(t),zd(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(f)t.flags&256?(hi(t),t.flags&=-257,t=Ud(e,t,n)):t.memoizedState!==null?(pi(),t.child=e.child,t.flags|=128,t=null):(pi(),S=a.fallback,u=t.mode,a=Du({mode:"visible",children:a.children},u),S=ya(S,u,n,null),S.flags|=2,a.return=t,S.return=t,a.sibling=S,t.child=a,ut(t,e.child,null,n),a=t.child,a.memoizedState=Od(n),a.childLanes=Ld(e,x,n),t.memoizedState=Dd,t=ro(null,a));else if(hi(t),bh(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var K=x.dgst;x=K,a=Error(c(419)),a.stack="",a.digest=x,al({value:a,source:null,stack:null}),t=Ud(e,t,n)}else if(Bn||si(e,t,n,!1),x=(n&e.childLanes)!==0,Bn||x){if(x=Gt,x!==null&&(a=ps(x,n),a!==0&&a!==R.retryLane))throw R.retryLane=a,xa(e,a),Hl(x,e,a),Md;gh(S)||Gu(),t=Ud(e,t,n)}else gh(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,qt=os(S.nextSibling),Vn=t,st=!0,qs=null,Rl=!1,e!==null&&pu(t,e),t=zd(t,a.children),t.flags|=4096);return t}return u?(pi(),S=a.fallback,u=t.mode,R=e.child,K=R.sibling,a=js(R,{mode:"hidden",children:a.children}),a.subtreeFlags=R.subtreeFlags&65011712,K!==null?S=js(K,S):(S=ya(S,u,n,null),S.flags|=2),S.return=t,a.return=t,a.sibling=S,t.child=a,ro(null,a),a=t.child,S=e.child.memoizedState,S===null?S=Od(n):(u=S.cachePool,u!==null?(R=dn._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=yu(),S={baseLanes:S.baseLanes|n,cachePool:u}),a.memoizedState=S,a.childLanes=Ld(e,x,n),t.memoizedState=Dd,ro(e.child,a)):(hi(t),n=e.child,e=n.sibling,n=js(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=n,t.memoizedState=null,n)}function zd(e,t){return t=Du({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Du(e,t){return e=vl(22,e,null,t),e.lanes=0,e}function Ud(e,t,n){return ut(t,e.child,null,n),e=zd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ym(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),li(e.return,t,n)}function Hd(e,t,n,a,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=a,x.tail=n,x.tailMode=u,x.treeForkCount=f)}function $m(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var x=En.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,ce(En,x),il(e,t,a,n),a=st?_a: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&&vu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Hd(t,!1,u,n,f,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&vu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Hd(t,!0,n,null,f,a);break;case"together":Hd(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ea(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(si(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=js(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=js(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Bd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&$s(e)))}function m_(e,t,n){switch(t.tag){case 3:Tt(t,t.stateNode.containerInfo),as(t,dn,e.memoizedState.cache),Ys();break;case 27:case 5:et(t);break;case 4:Tt(t,t.stateNode.containerInfo);break;case 10:as(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ud(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(hi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Gm(e,t,n):(hi(t),e=Ea(e,t,n),e!==null?e.sibling:null);hi(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(si(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return $m(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ce(En,En.current),a)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:as(t,dn,e.memoizedState.cache)}return Ea(e,t,n)}function Xm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Bn=!0;else{if(!Bd(e,n)&&(t.flags&128)===0)return Bn=!1,m_(e,t,n);Bn=(e.flags&131072)!==0}else Bn=!1,st&&(t.flags&1048576)!==0&&hu(t,_a,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=xt(t.elementType),t.type=e,typeof e=="function")Xc(e)?(a=tr(e,a),t.tag=1,t=Im(null,t,e,a,n)):(t.tag=0,t=Rd(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===O){t.tag=11,t=Dm(null,t,e,a,n);break e}else if(u===D){t.tag=14,t=Om(null,t,e,a,n);break e}}throw t=De(e)||e,Error(c(306,t,""))}}return t;case 0:return Rd(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=tr(a,t.pendingProps),Im(e,t,a,u,n);case 3:e:{if(Tt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,ad(e,t),no(t,a,null,n);var x=t.memoizedState;if(a=x.cache,as(t,dn,a),a!==f.cache&&Lr(t,[dn],n,!0),to(),a=x.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=qm(e,t,a,n);break e}else if(a!==u){u=Ml(Error(c(424)),t),al(u),t=qm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(qt=os(e.firstChild),Vn=t,st=!0,qs=null,Rl=!0,n=rs(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ys(),a===u){t=Ea(e,t,n);break e}il(e,t,a,n)}t=t.child}return t;case 26:return Ru(e,t),e===null?(n=nb(t.type,null,t.pendingProps,null))?t.memoizedState=n:st||(n=t.type,e=t.pendingProps,a=Zu(Se.current).createElement(n),a[Vt]=t,a[$e]=e,rl(a,n,e),Ze(a),t.stateNode=a):t.memoizedState=nb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return et(t),e===null&&st&&(a=t.stateNode=Pg(t.type,t.pendingProps,Se.current),Vn=t,Rl=!0,u=qt,ji(t.type)?(xh=u,qt=os(a.firstChild)):qt=u),il(e,t,t.pendingProps.children,n),Ru(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((u=a=qt)&&(a=X_(a,t.type,t.pendingProps,Rl),a!==null?(t.stateNode=a,Vn=t,qt=os(a.firstChild),Rl=!1,u=!0):u=!1),u||Gs(t)),et(t),u=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,a=f.children,hh(u,f)?a=null:x!==null&&hh(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=dd(e,t,i_,null,null,n),So._currentValue=u),Ru(e,t),il(e,t,a,n),t.child;case 6:return e===null&&st&&((e=n=qt)&&(n=V_(n,t.pendingProps,Rl),n!==null?(t.stateNode=n,Vn=t,qt=null,e=!0):e=!1),e||Gs(t)),null;case 13:return Gm(e,t,n);case 4:return Tt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ut(t,null,a,n):il(e,t,a,n),t.child;case 11:return Dm(e,t,t.type,t.pendingProps,n);case 7:return il(e,t,t.pendingProps,n),t.child;case 8:return il(e,t,t.pendingProps.children,n),t.child;case 12:return il(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,as(t,t.type,a.value),il(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,Xs(t),u=Qn(u),a=a(u),t.flags|=1,il(e,t,a,n),t.child;case 14:return Om(e,t,t.type,t.pendingProps,n);case 15:return Lm(e,t,t.type,t.pendingProps,n);case 19:return $m(e,t,n);case 31:return p_(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return Xs(t),a=Qn(dn),e===null?(u=Vs(),u===null&&(u=Gt,f=zr(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},sd(t),as(t,dn,u)):((e.lanes&n)!==0&&(ad(e,t),no(t,null,null,n),to()),u=e.memoizedState,f=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),as(t,dn,a)):(a=f.cache,as(t,dn,a),a!==u.cache&&Lr(t,[dn],n,!0))),il(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ca(e){e.flags|=4}function Id(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(xg())e.flags|=8192;else throw Zt=I,Hr}else e.flags&=-16777217}function Vm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rb(t))if(xg())e.flags|=8192;else throw Zt=I,Hr}function Ou(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bn():536870912,e.lanes|=t,Vr|=t)}function co(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function g_(e,t,n){var a=t.pendingProps;switch(Fc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return Ft(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),is(dn),Ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(va(t)?Ca(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ni())),Ft(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ca(t),f!==null?(Ft(t),Vm(t,f)):(Ft(t),Id(t,u,null,a,n))):f?f!==e.memoizedState?(Ca(t),Ft(t),Vm(t,f)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ca(t),Ft(t),Id(t,u,e,a,n)),null;case 27:if(Xe(t),n=Se.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ca(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}e=ge.current,va(t)?mu(t):(e=Pg(u,a,n),t.stateNode=e,Ca(t))}return Ft(t),null;case 5:if(Xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ca(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}if(f=ge.current,va(t))mu(t);else{var x=Zu(Se.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?x.createElement("select",{is:a.is}):x.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?x.createElement(u,{is:a.is}):x.createElement(u)}}f[Vt]=t,f[$e]=a;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=f;e:switch(rl(f,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ca(t)}}return Ft(t),Id(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ca(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=Se.current,va(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Vn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Vt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Gg(e.nodeValue,n)),e||Gs(t,!0)}else e=Zu(e).createTextNode(a),e[Vt]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=va(t),n!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Vt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ft(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=va(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[Vt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),u=!1}else u=ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ou(t,t.updateQueue),Ft(t),null);case 4:return Ye(),e===null&&ch(t.stateNode.containerInfo),Ft(t),null;case 10:return is(t.type),Ft(t),null;case 19:if(V(En),a=t.memoizedState,a===null)return Ft(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)co(a,!1);else{if(jn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=vu(e),f!==null){for(t.flags|=128,co(a,!1),e=f.updateQueue,t.updateQueue=e,Ou(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fu(n,e),n=n.sibling;return ce(En,En.current&1|2),st&&Ss(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ke()>Bu&&(t.flags|=128,u=!0,co(a,!1),t.lanes=4194304)}else{if(!u)if(e=vu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ou(t,e),co(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!st)return Ft(t),null}else 2*Ke()-a.renderingStartTime>Bu&&n!==536870912&&(t.flags|=128,u=!0,co(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Ke(),e.sibling=null,n=En.current,ce(En,u?n&1|2:n&1),st&&Ss(t,a.treeForkCount),e):(Ft(t),null);case 22:case 23:return Gl(t),od(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),n=t.updateQueue,n!==null&&Ou(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&V(Sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),is(dn),Ft(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function b_(e,t){switch(Fc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return is(dn),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Xe(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(c(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(En),null;case 4:return Ye(),null;case 10:return is(t.type),null;case 22:case 23:return Gl(t),od(),e!==null&&V(Sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return is(dn),null;case 25:return null;default:return null}}function Qm(e,t){switch(Fc(t),t.tag){case 3:is(dn),Ye();break;case 26:case 27:case 5:Xe(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:V(En);break;case 10:is(t.type);break;case 22:case 23:Gl(t),od(),e!==null&&V(Sa);break;case 24:is(dn)}}function oo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,x=n.inst;a=f(),x.destroy=a}n=n.next}while(n!==u)}}catch(S){At(t,t.return,S)}}function mi(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var x=a.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,u=t;var R=n,K=S;try{K()}catch(se){At(u,R,se)}}}a=a.next}while(a!==f)}}catch(se){At(t,t.return,se)}}function Km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hp(t,n)}catch(a){At(e,e.return,a)}}}function Zm(e,t,n){n.props=tr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){At(e,t,a)}}function uo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){At(e,t,u)}}function Ks(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){At(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){At(e,t,u)}else n.current=null}function Fm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){At(e,e.return,u)}}function qd(e,t,n){try{var a=e.stateNode;B_(a,e.type,n,t),a[$e]=t}catch(u){At(e,e.return,u)}}function Jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ji(e.type)||e.tag===4}function Gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ji(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yd(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mt));else if(a!==4&&(a===27&&ji(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yd(e,t,n),e=e.sibling;e!==null;)Yd(e,t,n),e=e.sibling}function Lu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&ji(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}function Wm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);rl(t,a,n),t[Vt]=e,t[$e]=n}catch(f){At(e,e.return,f)}}var Aa=!1,In=!1,$d=!1,Pm=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function x_(e,t){if(e=e.containerInfo,fh=nf,e=au(e),Lc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var x=0,S=-1,R=-1,K=0,se=0,oe=e,F=null;t:for(;;){for(var te;oe!==n||u!==0&&oe.nodeType!==3||(S=x+u),oe!==f||a!==0&&oe.nodeType!==3||(R=x+a),oe.nodeType===3&&(x+=oe.nodeValue.length),(te=oe.firstChild)!==null;)F=oe,oe=te;for(;;){if(oe===e)break t;if(F===n&&++K===u&&(S=x),F===f&&++se===a&&(R=x),(te=oe.nextSibling)!==null)break;oe=F,F=oe.parentNode}oe=te}n=S===-1||R===-1?null:{start:S,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(dh={focusedElem:e,selectionRange:n},nf=!1,Fn=t;Fn!==null;)if(t=Fn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fn=e;else for(;Fn!==null;){switch(t=Fn,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,a=n.stateNode;try{var Re=tr(n.type,u);e=a.getSnapshotBeforeUpdate(Re,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(He){At(n,n.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Fn=e;break}Fn=t.return}}function eg(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Ra(e,n),a&4&&oo(5,n);break;case 1:if(Ra(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(x){At(n,n.return,x)}else{var u=tr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){At(n,n.return,x)}}a&64&&Km(n),a&512&&uo(n,n.return);break;case 3:if(Ra(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Hp(e,t)}catch(x){At(n,n.return,x)}}break;case 27:t===null&&a&4&&Wm(n);case 26:case 5:Ra(e,n),t===null&&a&4&&Fm(n),a&512&&uo(n,n.return);break;case 12:Ra(e,n);break;case 31:Ra(e,n),a&4&&lg(e,n);break;case 13:Ra(e,n),a&4&&sg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=T_.bind(null,n),Q_(e,n))));break;case 22:if(a=n.memoizedState!==null||Aa,!a){t=t!==null&&t.memoizedState!==null||In,u=Aa;var f=In;Aa=a,(In=t)&&!f?Da(e,n,(n.subtreeFlags&8772)!==0):Ra(e,n),Aa=u,In=f}break;case 30:break;default:Ra(e,n)}}function tg(e){var t=e.alternate;t!==null&&(e.alternate=null,tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rn=null,Ol=!1;function Ma(e,t,n){for(n=n.child;n!==null;)ng(e,t,n),n=n.sibling}function ng(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:In||Ks(n,t),Ma(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:In||Ks(n,t);var a=rn,u=Ol;ji(n.type)&&(rn=n.stateNode,Ol=!1),Ma(e,t,n),_o(n.stateNode),rn=a,Ol=u;break;case 5:In||Ks(n,t);case 6:if(a=rn,u=Ol,rn=null,Ma(e,t,n),rn=a,Ol=u,rn!==null)if(Ol)try{(rn.nodeType===9?rn.body:rn.nodeName==="HTML"?rn.ownerDocument.body:rn).removeChild(n.stateNode)}catch(f){At(n,t,f)}else try{rn.removeChild(n.stateNode)}catch(f){At(n,t,f)}break;case 18:rn!==null&&(Ol?(e=rn,Kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ec(e)):Kg(rn,n.stateNode));break;case 4:a=rn,u=Ol,rn=n.stateNode.containerInfo,Ol=!0,Ma(e,t,n),rn=a,Ol=u;break;case 0:case 11:case 14:case 15:mi(2,n,t),In||mi(4,n,t),Ma(e,t,n);break;case 1:In||(Ks(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Zm(n,t,a)),Ma(e,t,n);break;case 21:Ma(e,t,n);break;case 22:In=(a=In)||n.memoizedState!==null,Ma(e,t,n),In=a;break;default:Ma(e,t,n)}}function lg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ec(e)}catch(n){At(t,t.return,n)}}}function sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ec(e)}catch(n){At(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 Pm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pm),t;default:throw Error(c(435,e.tag))}}function zu(e,t){var n=y_(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=E_.bind(null,e,a);a.then(u,u)}})}function Ll(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(ji(S.type)){rn=S.stateNode,Ol=!1;break e}break;case 5:rn=S.stateNode,Ol=!1;break e;case 3:case 4:rn=S.stateNode.containerInfo,Ol=!0;break e}S=S.return}if(rn===null)throw Error(c(160));ng(f,x,u),rn=null,Ol=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ag(t,e),t=t.sibling}var ws=null;function ag(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ll(t,e),zl(e),a&4&&(mi(3,e,e.return),oo(3,e),mi(5,e,e.return));break;case 1:Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),a&64&&Aa&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var u=ws;if(Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),a&4){var f=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(a){case"title":f=u.getElementsByTagName("title")[0],(!f||f[el]||f[Vt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),rl(f,a,n),f[Vt]=e,Ze(f),a=f;break e;case"link":var x=ab("link","href",u).get(a+(n.href||""));if(x){for(var S=0;S<x.length;S++)if(f=x[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)){x.splice(S,1);break t}}f=u.createElement(a),rl(f,a,n),u.head.appendChild(f);break;case"meta":if(x=ab("meta","content",u).get(a+(n.content||""))){for(S=0;S<x.length;S++)if(f=x[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)){x.splice(S,1);break t}}f=u.createElement(a),rl(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Vt]=e,Ze(f),a=f}e.stateNode=a}else ib(u,e.type,e.stateNode);else e.stateNode=sb(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?ib(u,e.type,e.stateNode):sb(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&qd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),n!==null&&a&4&&qd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),e.flags&32){u=e.stateNode;try{Y(u,"")}catch(Re){At(e,e.return,Re)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,qd(e,u,n!==null?n.memoizedProps:u)),a&1024&&($d=!0);break;case 6:if(Ll(t,e),zl(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Re){At(e,e.return,Re)}}break;case 3:if(Wu=null,u=ws,ws=Fu(t.containerInfo),Ll(t,e),ws=u,zl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ec(t.containerInfo)}catch(Re){At(e,e.return,Re)}$d&&($d=!1,ig(e));break;case 4:a=ws,ws=Fu(e.stateNode.containerInfo),Ll(t,e),zl(e),ws=a;break;case 12:Ll(t,e),zl(e);break;case 31:Ll(t,e),zl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 13:Ll(t,e),zl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Hu=Ke()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 22:u=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,K=Aa,se=In;if(Aa=K||u,In=se||R,Ll(t,e),In=se,Aa=K,zl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||Aa||In||nr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=R.stateNode;var oe=R.memoizedProps.style,F=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;S.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(Re){At(R,R.return,Re)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(Re){At(R,R.return,Re)}}}else if(t.tag===18){if(n===null){R=t;try{var te=R.stateNode;u?Zg(te,!0):Zg(R.stateNode,!1)}catch(Re){At(R,R.return,Re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,zu(e,n))));break;case 19:Ll(t,e),zl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,zu(e,a)));break;case 30:break;case 21:break;default:Ll(t,e),zl(e)}}function zl(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Jm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Gd(e);Lu(e,f,u);break;case 5:var x=n.stateNode;n.flags&32&&(Y(x,""),n.flags&=-33);var S=Gd(e);Lu(e,S,x);break;case 3:case 4:var R=n.stateNode.containerInfo,K=Gd(e);Yd(e,K,R);break;default:throw Error(c(161))}}catch(se){At(e,e.return,se)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ig(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ig(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)eg(e,t.alternate,t),t=t.sibling}function nr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:mi(4,t,t.return),nr(t);break;case 1:Ks(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zm(t,t.return,n),nr(t);break;case 27:_o(t.stateNode);case 26:case 5:Ks(t,t.return),nr(t);break;case 22:t.memoizedState===null&&nr(t);break;case 30:nr(t);break;default:nr(t)}e=e.sibling}}function Da(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:Da(u,f,n),oo(4,f);break;case 1:if(Da(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(K){At(a,a.return,K)}if(a=f,u=a.updateQueue,u!==null){var S=a.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Up(R[u],S)}catch(K){At(a,a.return,K)}}n&&x&64&&Km(f),uo(f,f.return);break;case 27:Wm(f);case 26:case 5:Da(u,f,n),n&&a===null&&x&4&&Fm(f),uo(f,f.return);break;case 12:Da(u,f,n);break;case 31:Da(u,f,n),n&&x&4&&lg(u,f);break;case 13:Da(u,f,n),n&&x&4&&sg(u,f);break;case 22:f.memoizedState===null&&Da(u,f,n),uo(f,f.return);break;case 30:break;default:Da(u,f,n)}t=t.sibling}}function Xd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Wi(n))}function Vd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wi(e))}function ks(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rg(e,t,n,a),t=t.sibling}function rg(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ks(e,t,n,a),u&2048&&oo(9,t);break;case 1:ks(e,t,n,a);break;case 3:ks(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wi(e)));break;case 12:if(u&2048){ks(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,S=f.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){At(t,t.return,R)}}else ks(e,t,n,a);break;case 31:ks(e,t,n,a);break;case 13:ks(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?ks(e,t,n,a):fo(e,t):f._visibility&2?ks(e,t,n,a):(f._visibility|=2,Yr(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Xd(x,t);break;case 24:ks(e,t,n,a),u&2048&&Vd(t.alternate,t);break;default:ks(e,t,n,a)}}function Yr(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,x=t,S=n,R=a,K=x.flags;switch(x.tag){case 0:case 11:case 15:Yr(f,x,S,R,u),oo(8,x);break;case 23:break;case 22:var se=x.stateNode;x.memoizedState!==null?se._visibility&2?Yr(f,x,S,R,u):fo(f,x):(se._visibility|=2,Yr(f,x,S,R,u)),u&&K&2048&&Xd(x.alternate,x);break;case 24:Yr(f,x,S,R,u),u&&K&2048&&Vd(x.alternate,x);break;default:Yr(f,x,S,R,u)}t=t.sibling}}function fo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:fo(n,a),u&2048&&Xd(a.alternate,a);break;case 24:fo(n,a),u&2048&&Vd(a.alternate,a);break;default:fo(n,a)}t=t.sibling}}var ho=8192;function $r(e,t,n){if(e.subtreeFlags&ho)for(e=e.child;e!==null;)cg(e,t,n),e=e.sibling}function cg(e,t,n){switch(e.tag){case 26:$r(e,t,n),e.flags&ho&&e.memoizedState!==null&&a0(n,ws,e.memoizedState,e.memoizedProps);break;case 5:$r(e,t,n);break;case 3:case 4:var a=ws;ws=Fu(e.stateNode.containerInfo),$r(e,t,n),ws=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ho,ho=16777216,$r(e,t,n),ho=a):$r(e,t,n));break;default:$r(e,t,n)}}function og(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fn=a,fg(a,e)}og(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ug(e),e=e.sibling}function ug(e){switch(e.tag){case 0:case 11:case 15:po(e),e.flags&2048&&mi(9,e,e.return);break;case 3:po(e);break;case 12:po(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uu(e)):po(e);break;default:po(e)}}function Uu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fn=a,fg(a,e)}og(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:mi(8,t,t.return),Uu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Uu(t));break;default:Uu(t)}e=e.sibling}}function fg(e,t){for(;Fn!==null;){var n=Fn;switch(n.tag){case 0:case 11:case 15:mi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Wi(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Fn=a;else e:for(n=e;Fn!==null;){a=Fn;var u=a.sibling,f=a.return;if(tg(a),a===n){Fn=null;break e}if(u!==null){u.return=f,Fn=u;break e}Fn=f}}}var __={getCacheForType:function(e){var t=Qn(dn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qn(dn).controller.signal}},v_=typeof WeakMap=="function"?WeakMap:Map,jt=0,Gt=null,at=null,rt=0,Ct=0,Yl=null,gi=!1,Xr=!1,Qd=!1,Oa=0,jn=0,bi=0,lr=0,Kd=0,$l=0,Vr=0,mo=null,Ul=null,Zd=!1,Hu=0,dg=0,Bu=1/0,Iu=null,xi=null,Kn=0,yi=null,Qr=null,La=0,Fd=0,Jd=null,hg=null,go=0,Wd=null;function Xl(){return(jt&2)!==0&&rt!==0?rt&-rt:A.T!==null?sh():Kl()}function pg(){if($l===0)if((rt&536870912)===0||st){var e=H;H<<=1,(H&3932160)===0&&(H=262144),$l=e}else $l=536870912;return e=ql.current,e!==null&&(e.flags|=32),$l}function Hl(e,t,n){(e===Gt&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)&&(Kr(e,0),_i(e,rt,$l,!1)),ul(e,n),((jt&2)===0||e!==Gt)&&(e===Gt&&((jt&2)===0&&(lr|=n),jn===4&&_i(e,rt,$l,!1)),Zs(e))}function mg(e,t,n){if((jt&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||gt(e,t),u=a?w_(e,t):eh(e,t,!0),f=a;do{if(u===0){Xr&&!a&&_i(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!j_(n)){u=eh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;u=mo;var R=S.current.memoizedState.isDehydrated;if(R&&(Kr(S,x).flags|=256),x=eh(S,x,!1),x!==2){if(Qd&&!R){S.errorRecoveryDisabledLanes|=f,lr|=f,u=4;break e}f=Ul,Ul=u,f!==null&&(Ul===null?Ul=f:Ul.push.apply(Ul,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){Kr(e,0),_i(e,t,0,!0);break}e:{switch(a=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:_i(a,t,$l,!gi);break e;case 2:Ul=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Hu+300-Ke(),10<u)){if(_i(a,t,$l,!gi),Be(a,0,!0)!==0)break e;La=t,a.timeoutHandle=Vg(gg.bind(null,a,n,Ul,Iu,Zd,t,$l,lr,Vr,gi,f,"Throttled",-0,0),u);break e}gg(a,n,Ul,Iu,Zd,t,$l,lr,Vr,gi,f,null,-0,0)}}break}while(!0);Zs(e)}function gg(e,t,n,a,u,f,x,S,R,K,se,oe,F,te){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mt},cg(t,f,oe);var Re=(f&62914560)===f?Hu-Ke():(f&4194048)===f?dg-Ke():0;if(Re=i0(oe,Re),Re!==null){La=f,e.cancelPendingCommit=Re(wg.bind(null,e,t,f,n,a,u,x,S,R,se,oe,null,F,te)),_i(e,f,x,!K);return}}wg(e,t,f,n,a,u,x,S,R)}function j_(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],f=u.getSnapshot;u=u.value;try{if(!_l(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 _i(e,t,n,a){t&=~Kd,t&=~lr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-Et(u),x=1<<f;a[f]=-1,u&=~x}n!==0&&ra(e,n,t)}function qu(){return(jt&6)===0?(bo(0),!1):!0}function Pd(){if(at!==null){if(Ct===0)var e=at.return;else e=at,ss=Tn=null,md(e),ka=null,ui=0,e=at;for(;e!==null;)Qm(e.alternate,e),e=e.return;at=null}}function Kr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,G_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),La=0,Pd(),Gt=e,at=n=js(e.current,null),rt=t,Ct=0,Yl=null,gi=!1,Xr=gt(e,t),Qd=!1,Vr=$l=Kd=lr=bi=jn=0,Ul=mo=null,Zd=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-Et(a),f=1<<u;t|=e[u],a&=~f}return Oa=t,Ar(),n}function bg(e,t){We=null,A.H=io,t===wa||t===p?(t=Dl(),Ct=3):t===Hr?(t=Dl(),Ct=4):Ct=t===Md?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yl=t,at===null&&(jn=1,Au(e,Ml(t,e.current)))}function xg(){var e=ql.current;return e===null?!0:(rt&4194048)===rt?cs===null:(rt&62914560)===rt||(rt&536870912)!==0?e===cs:!1}function yg(){var e=A.H;return A.H=io,e===null?io:e}function _g(){var e=A.A;return A.A=__,e}function Gu(){jn=4,gi||(rt&4194048)!==rt&&ql.current!==null||(Xr=!0),(bi&134217727)===0&&(lr&134217727)===0||Gt===null||_i(Gt,rt,$l,!1)}function eh(e,t,n){var a=jt;jt|=2;var u=yg(),f=_g();(Gt!==e||rt!==t)&&(Iu=null,Kr(e,t)),t=!1;var x=jn;e:do try{if(Ct!==0&&at!==null){var S=at,R=Yl;switch(Ct){case 8:Pd(),x=6;break e;case 3:case 2:case 9:case 6:ql.current===null&&(t=!0);var K=Ct;if(Ct=0,Yl=null,Zr(e,S,R,K),n&&Xr){x=0;break e}break;default:K=Ct,Ct=0,Yl=null,Zr(e,S,R,K)}}S_(),x=jn;break}catch(se){bg(e,se)}while(!0);return t&&e.shellSuspendCounter++,ss=Tn=null,jt=a,A.H=u,A.A=f,at===null&&(Gt=null,rt=0,Ar()),x}function S_(){for(;at!==null;)vg(at)}function w_(e,t){var n=jt;jt|=2;var a=yg(),u=_g();Gt!==e||rt!==t?(Iu=null,Bu=Ke()+500,Kr(e,t)):Xr=gt(e,t);e:do try{if(Ct!==0&&at!==null){t=at;var f=Yl;t:switch(Ct){case 1:Ct=0,Yl=null,Zr(e,t,f,1);break;case 2:case 9:if(de(f)){Ct=0,Yl=null,jg(t);break}t=function(){Ct!==2&&Ct!==9||Gt!==e||(Ct=7),Zs(e)},f.then(t,t);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:de(f)?(Ct=0,Yl=null,jg(t)):(Ct=0,Yl=null,Zr(e,t,f,7));break;case 5:var x=null;switch(at.tag){case 26:x=at.memoizedState;case 5:case 27:var S=at;if(x?rb(x):S.stateNode.complete){Ct=0,Yl=null;var R=S.sibling;if(R!==null)at=R;else{var K=S.return;K!==null?(at=K,Yu(K)):at=null}break t}}Ct=0,Yl=null,Zr(e,t,f,5);break;case 6:Ct=0,Yl=null,Zr(e,t,f,6);break;case 8:Pd(),jn=6;break e;default:throw Error(c(462))}}k_();break}catch(se){bg(e,se)}while(!0);return ss=Tn=null,A.H=a,A.A=u,jt=n,at!==null?0:(Gt=null,rt=0,Ar(),jn)}function k_(){for(;at!==null&&!mn();)vg(at)}function vg(e){var t=Xm(e.alternate,e,Oa);e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function jg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bm(n,t,t.pendingProps,t.type,void 0,rt);break;case 11:t=Bm(n,t,t.pendingProps,t.type.render,t.ref,rt);break;case 5:md(t);default:Qm(n,t),t=at=fu(t,Oa),t=Xm(n,t,Oa)}e.memoizedProps=e.pendingProps,t===null?Yu(e):at=t}function Zr(e,t,n,a){ss=Tn=null,md(t),ka=null,ui=0;var u=t.return;try{if(h_(e,u,t,n,rt)){jn=1,Au(e,Ml(n,e.current)),at=null;return}}catch(f){if(u!==null)throw at=u,f;jn=1,Au(e,Ml(n,e.current)),at=null;return}t.flags&32768?(st||a===1?e=!0:Xr||(rt&536870912)!==0?e=!1:(gi=e=!0,(a===2||a===9||a===3||a===6)&&(a=ql.current,a!==null&&a.tag===13&&(a.flags|=16384))),Sg(t,e)):Yu(t)}function Yu(e){var t=e;do{if((t.flags&32768)!==0){Sg(t,gi);return}e=t.return;var n=g_(t.alternate,t,Oa);if(n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);jn===0&&(jn=5)}function Sg(e,t){do{var n=b_(e.alternate,e);if(n!==null){n.flags&=32767,at=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){at=e;return}at=e=n}while(e!==null);jn=6,at=null}function wg(e,t,n,a,u,f,x,S,R){e.cancelPendingCommit=null;do $u();while(Kn!==0);if((jt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Yc,gl(e,n,f,x,S,R),e===Gt&&(at=Gt=null,rt=0),Qr=t,yi=e,La=n,Fd=f,Jd=u,hg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,C_(Je,function(){return Cg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null,u=fe.p,fe.p=2,x=jt,jt|=4;try{x_(e,t,n)}finally{jt=x,fe.p=u,A.T=a}}Kn=1,kg(),Ng(),Tg()}}function kg(){if(Kn===1){Kn=0;var e=yi,t=Qr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var a=fe.p;fe.p=2;var u=jt;jt|=4;try{ag(t,e);var f=dh,x=au(e.containerInfo),S=f.focusedElem,R=f.selectionRange;if(x!==S&&S&&S.ownerDocument&&su(S.ownerDocument.documentElement,S)){if(R!==null&&Lc(S)){var K=R.start,se=R.end;if(se===void 0&&(se=K),"selectionStart"in S)S.selectionStart=K,S.selectionEnd=Math.min(se,S.value.length);else{var oe=S.ownerDocument||document,F=oe&&oe.defaultView||window;if(F.getSelection){var te=F.getSelection(),Re=S.textContent.length,He=Math.min(R.start,Re),Ot=R.end===void 0?He:Math.min(R.end,Re);!te.extend&&He>Ot&&(x=Ot,Ot=He,He=x);var q=lu(S,He),U=lu(S,Ot);if(q&&U&&(te.rangeCount!==1||te.anchorNode!==q.node||te.anchorOffset!==q.offset||te.focusNode!==U.node||te.focusOffset!==U.offset)){var Q=oe.createRange();Q.setStart(q.node,q.offset),te.removeAllRanges(),He>Ot?(te.addRange(Q),te.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),te.addRange(Q))}}}}for(oe=[],te=S;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<oe.length;S++){var re=oe[S];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}nf=!!fh,dh=fh=null}finally{jt=u,fe.p=a,A.T=n}}e.current=t,Kn=2}}function Ng(){if(Kn===2){Kn=0;var e=yi,t=Qr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var a=fe.p;fe.p=2;var u=jt;jt|=4;try{eg(e,t.alternate,t)}finally{jt=u,fe.p=a,A.T=n}}Kn=3}}function Tg(){if(Kn===4||Kn===3){Kn=0,cn();var e=yi,t=Qr,n=La,a=hg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Kn=5:(Kn=0,Qr=yi=null,Eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(xi=null),Dn(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=A.T,u=fe.p,fe.p=2,A.T=null;try{for(var f=e.onRecoverableError,x=0;x<a.length;x++){var S=a[x];f(S.value,{componentStack:S.stack})}}finally{A.T=t,fe.p=u}}(La&3)!==0&&$u(),Zs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Wd?go++:(go=0,Wd=e):go=0,bo(0)}}function Eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wi(t)))}function $u(){return kg(),Ng(),Tg(),Cg()}function Cg(){if(Kn!==5)return!1;var e=yi,t=Fd;Fd=0;var n=Dn(La),a=A.T,u=fe.p;try{fe.p=32>n?32:n,A.T=null,n=Jd,Jd=null;var f=yi,x=La;if(Kn=0,Qr=yi=null,La=0,(jt&6)!==0)throw Error(c(331));var S=jt;if(jt|=4,ug(f.current),rg(f,f.current,x,n),jt=S,bo(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Xt,f)}catch{}return!0}finally{fe.p=u,A.T=a,Eg(e,t)}}function Ag(e,t,n){t=Ml(n,t),t=Ad(e.stateNode,t,2),e=di(e,t,2),e!==null&&(ul(e,2),Zs(e))}function At(e,t,n){if(e.tag===3)Ag(e,e,n);else for(;t!==null;){if(t.tag===3){Ag(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(xi===null||!xi.has(a))){e=Ml(n,e),n=Mm(2),a=di(t,n,2),a!==null&&(Rm(n,a,t,e),ul(a,2),Zs(a));break}}t=t.return}}function th(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new v_;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(Qd=!0,u.add(n),e=N_.bind(null,e,t,n),t.then(e,e))}function N_(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gt===e&&(rt&n)===n&&(jn===4||jn===3&&(rt&62914560)===rt&&300>Ke()-Hu?(jt&2)===0&&Kr(e,0):Kd|=n,Vr===rt&&(Vr=0)),Zs(e)}function Mg(e,t){t===0&&(t=bn()),e=xa(e,t),e!==null&&(ul(e,t),Zs(e))}function T_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mg(e,n)}function E_(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),Mg(e,n)}function C_(e,t){return pn(e,t)}var Xu=null,Fr=null,nh=!1,Vu=!1,lh=!1,vi=0;function Zs(e){e!==Fr&&e.next===null&&(Fr===null?Xu=Fr=e:Fr=Fr.next=e),Vu=!0,nh||(nh=!0,M_())}function bo(e,t){if(!lh&&Vu){lh=!0;do for(var n=!1,a=Xu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var x=a.suspendedLanes,S=a.pingedLanes;f=(1<<31-Et(42|e)+1)-1,f&=u&~(x&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Lg(a,f))}else f=rt,f=Be(a,a===Gt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||gt(a,f)||(n=!0,Lg(a,f));a=a.next}while(n);lh=!1}}function A_(){Rg()}function Rg(){Vu=nh=!1;var e=0;vi!==0&&q_()&&(e=vi);for(var t=Ke(),n=null,a=Xu;a!==null;){var u=a.next,f=Dg(a,t);f===0?(a.next=null,n===null?Xu=u:n.next=u,u===null&&(Fr=n)):(n=a,(e!==0||(f&3)!==0)&&(Vu=!0)),a=u}Kn!==0&&Kn!==5||bo(e),vi!==0&&(vi=0)}function Dg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Et(f),S=1<<x,R=u[x];R===-1?((S&n)===0||(S&a)!==0)&&(u[x]=Mn(S,t)):R<=t&&(e.expiredLanes|=S),f&=~S}if(t=Gt,n=rt,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Sn(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||gt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Sn(a),Dn(n)){case 2:case 8:n=ft;break;case 32:n=Je;break;case 268435456:n=on;break;default:n=Je}return a=Og.bind(null,e),n=pn(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Sn(a),e.callbackPriority=2,e.callbackNode=null,2}function Og(e,t){if(Kn!==0&&Kn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var a=rt;return a=Be(e,e===Gt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(mg(e,a,t),Dg(e,Ke()),e.callbackNode!=null&&e.callbackNode===n?Og.bind(null,e):null)}function Lg(e,t){if($u())return null;mg(e,t,!0)}function M_(){Y_(function(){(jt&6)!==0?pn(gn,A_):Rg()})}function sh(){if(vi===0){var e=ja;e===0&&(e=Le,Le<<=1,(Le&261888)===0&&(Le=256)),vi=e}return vi}function zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Mt(""+e)}function Ug(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function R_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=zg((u[$e]||null).action),x=a.submitter;x&&(t=(t=x[$e]||null)?zg(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var S=new Ls("action","action",null,a,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(vi!==0){var R=x?Ug(u,x):new FormData(u);wd(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(S.preventDefault(),R=x?Ug(u,x):new FormData(u),wd(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var ah=0;ah<Gc.length;ah++){var ih=Gc[ah],D_=ih.toLowerCase(),O_=ih[0].toUpperCase()+ih.slice(1);Cl(D_,"on"+O_)}Cl(cu,"onAnimationEnd"),Cl(Hc,"onAnimationIteration"),Cl(Bc,"onAnimationStart"),Cl("dblclick","onDoubleClick"),Cl("focusin","onFocus"),Cl("focusout","onBlur"),Cl(ou,"onTransitionRun"),Cl(uu,"onTransitionStart"),Cl(ed,"onTransitionCancel"),Cl(Ic,"onTransitionEnd"),Nn("onMouseEnter",["mouseout","mouseover"]),Nn("onMouseLeave",["mouseout","mouseover"]),Nn("onPointerEnter",["pointerout","pointerover"]),Nn("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xo="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(" "),L_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xo));function Hg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var x=a.length-1;0<=x;x--){var S=a[x],R=S.instance,K=S.currentTarget;if(S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=K;try{f(u)}catch(se){Ja(se)}u.currentTarget=null,f=R}else for(x=0;x<a.length;x++){if(S=a[x],R=S.instance,K=S.currentTarget,S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=K;try{f(u)}catch(se){Ja(se)}u.currentTarget=null,f=R}}}}function it(e,t){var n=t[xl];n===void 0&&(n=t[xl]=new Set);var a=e+"__bubble";n.has(a)||(Bg(t,e,2,!1),n.add(a))}function rh(e,t,n){var a=0;t&&(a|=4),Bg(n,e,a,t)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function ch(e){if(!e[Qu]){e[Qu]=!0,On.forEach(function(n){n!=="selectionchange"&&(L_.has(n)||rh(n,!1,e),rh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qu]||(t[Qu]=!0,rh("selectionchange",!1,t))}}function Bg(e,t,n,a){switch(pb(t)){case 2:var u=o0;break;case 8:u=u0;break;default:u=Sh}n=u.bind(null,t,n,e),u=void 0,!xs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function oh(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var x=a.tag;if(x===3||x===4){var S=a.stateNode.containerInfo;if(S===u)break;if(x===4)for(x=a.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;S!==null;){if(x=Tl(S),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){a=f=x;continue e}S=S.parentNode}}a=a.return}Me(function(){var K=f,se=It(n),oe=[];e:{var F=qc.get(e);if(F!==void 0){var te=Ls,Re=e;switch(e){case"keypress":if(Ii(n)===0)break e;case"keydown":case"keyup":te=Cc;break;case"focusin":Re="focus",te=Ec;break;case"focusout":Re="blur",te=Ec;break;case"beforeblur":case"afterblur":te=Ec;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=$a;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Sr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Tr;break;case cu:case Hc:case Bc:te=wr;break;case Ic:te=$i;break;case"scroll":case"scrollend":te=jr;break;case"wheel":te=Zo;break;case"copy":case"cut":case"paste":te=kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Ko;break;case"toggle":case"beforetoggle":te=Fo}var He=(t&4)!==0,Ot=!He&&(e==="scroll"||e==="scrollend"),q=He?F!==null?F+"Capture":null:F;He=[];for(var U=K,Q;U!==null;){var re=U;if(Q=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Q===null||q===null||(re=Fe(U,q),re!=null&&He.push(yo(U,re,Q))),Ot)break;U=U.return}0<He.length&&(F=new te(F,Re,null,n,se),oe.push({event:F,listeners:He}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",F&&n!==fn&&(Re=n.relatedTarget||n.fromElement)&&(Tl(Re)||Re[vt]))break e;if((te||F)&&(F=se.window===se?se:(F=se.ownerDocument)?F.defaultView||F.parentWindow:window,te?(Re=n.relatedTarget||n.toElement,te=K,Re=Re?Tl(Re):null,Re!==null&&(Ot=d(Re),He=Re.tag,Re!==Ot||He!==5&&He!==27&&He!==6)&&(Re=null)):(te=null,Re=K),te!==Re)){if(He=$a,re="onMouseLeave",q="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(He=Ko,re="onPointerLeave",q="onPointerEnter",U="pointer"),Ot=te==null?F:kn(te),Q=Re==null?F:kn(Re),F=new He(re,U+"leave",te,n,se),F.target=Ot,F.relatedTarget=Q,re=null,Tl(se)===K&&(He=new He(q,U+"enter",Re,n,se),He.target=Q,He.relatedTarget=Ot,re=He),Ot=re,te&&Re)t:{for(He=z_,q=te,U=Re,Q=0,re=q;re;re=He(re))Q++;re=0;for(var Ue=U;Ue;Ue=He(Ue))re++;for(;0<Q-re;)q=He(q),Q--;for(;0<re-Q;)U=He(U),re--;for(;Q--;){if(q===U||U!==null&&q===U.alternate){He=q;break t}q=He(q),U=He(U)}He=null}else He=null;te!==null&&Ig(oe,F,te,He,!1),Re!==null&&Ot!==null&&Ig(oe,Ot,Re,He,!0)}}e:{if(F=K?kn(K):window,te=F.nodeName&&F.nodeName.toLowerCase(),te==="select"||te==="input"&&F.type==="file")var yt=eu;else if(Ka(F))if(X)yt=Jf;else{yt=Zf;var Oe=Za}else te=F.nodeName,!te||te.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?K&&ze(K.elementType)&&(yt=eu):yt=Ff;if(yt&&(yt=yt(e,K))){Po(oe,yt,n,se);break e}Oe&&Oe(e,F,K),e==="focusout"&&K&&F.type==="number"&&K.memoizedProps.value!=null&&sn(F,"number",F.value)}switch(Oe=K?kn(K):window,e){case"focusin":(Ka(Oe)||Oe.contentEditable==="true")&&(Fa=Oe,zc=K,Zi=null);break;case"focusout":Zi=zc=Fa=null;break;case"mousedown":Fi=!0;break;case"contextmenu":case"mouseup":case"dragend":Fi=!1,iu(oe,n,se);break;case"selectionchange":if(Pf)break;case"keydown":case"keyup":iu(oe,n,se)}var Pe;if(Il)e:{switch(e){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else vs?Mc(e,n)&&(ct="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ct="onCompositionStart");ct&&(Vi&&n.locale!=="ko"&&(vs||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&vs&&(Pe=vr()):(Os=se,Bi="value"in Os?Os.value:Os.textContent,vs=!0)),Oe=Ku(K,ct),0<Oe.length&&(ct=new Gi(ct,e,null,n,se),oe.push({event:ct,listeners:Oe}),Pe?ct.data=Pe:(Pe=Qa(n),Pe!==null&&(ct.data=Pe)))),(Pe=Er?Qi(e,n):Ki(e,n))&&(ct=Ku(K,"onBeforeInput"),0<ct.length&&(Oe=new Gi("onBeforeInput","beforeinput",null,n,se),oe.push({event:Oe,listeners:ct}),Oe.data=Pe)),R_(oe,e,K,n,se)}Hg(oe,t)})}function yo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ku(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Fe(e,n),u!=null&&a.unshift(yo(e,u,f)),u=Fe(e,t),u!=null&&a.push(yo(e,u,f))),e.tag===3)return a;e=e.return}return[]}function z_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ig(e,t,n,a,u){for(var f=t._reactName,x=[];n!==null&&n!==a;){var S=n,R=S.alternate,K=S.stateNode;if(S=S.tag,R!==null&&R===a)break;S!==5&&S!==26&&S!==27||K===null||(R=K,u?(K=Fe(n,f),K!=null&&x.unshift(yo(n,K,R))):u||(K=Fe(n,f),K!=null&&x.push(yo(n,K,R)))),n=n.return}x.length!==0&&e.push({event:t,listeners:x})}var U_=/\r\n?/g,H_=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(U_,`
50
- `).replace(H_,"")}function Gg(e,t){return t=qg(t),qg(e)===t}function Dt(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Y(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Y(e,""+a);break;case"className":nl(e,"class",a);break;case"tabIndex":nl(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":nl(e,n,a);break;case"style":ve(e,a,f);break;case"data":if(t!=="object"){nl(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Mt(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Dt(e,t,"name",u.name,u,null),Dt(e,t,"formEncType",u.formEncType,u,null),Dt(e,t,"formMethod",u.formMethod,u,null),Dt(e,t,"formTarget",u.formTarget,u,null)):(Dt(e,t,"encType",u.encType,u,null),Dt(e,t,"method",u.method,u,null),Dt(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Mt(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=mt);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Mt(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":it("beforetoggle",e),it("toggle",e),fl(e,"popover",a);break;case"xlinkActuate":Ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ln(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ln(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ln(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ln(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":fl(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=ot.get(n)||n,fl(e,n,a))}}function uh(e,t,n,a,u,f){switch(n){case"style":ve(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Y(e,a):(typeof a=="number"||typeof a=="bigint")&&Y(e,""+a);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"onClick":a!=null&&(e.onclick=mt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!El.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[$e]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof a=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,u);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):fl(e,n,a)}}}function rl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var x=n[f];if(x!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Dt(e,t,f,x,n,null)}}u&&Dt(e,t,"srcSet",n.srcSet,n,null),a&&Dt(e,t,"src",n.src,n,null);return;case"input":it("invalid",e);var S=f=x=u=null,R=null,K=null;for(a in n)if(n.hasOwnProperty(a)){var se=n[a];if(se!=null)switch(a){case"name":u=se;break;case"type":x=se;break;case"checked":R=se;break;case"defaultChecked":K=se;break;case"value":f=se;break;case"defaultValue":S=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Dt(e,t,a,se,n,null)}}Jl(e,f,S,R,K,x,u,!1);return;case"select":it("invalid",e),a=x=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":x=S;break;case"multiple":a=S;default:Dt(e,t,u,S,n,null)}t=f,n=x,e.multiple=!!a,t!=null?Bt(e,!!a,t,!1):n!=null&&Bt(e,!!a,n,!0);return;case"textarea":it("invalid",e),f=u=a=null;for(x in n)if(n.hasOwnProperty(x)&&(S=n[x],S!=null))switch(x){case"value":a=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Dt(e,t,x,S,n,null)}N(e,a,u,f);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(a=n[R],a!=null))switch(R){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Dt(e,t,R,a,n,null)}return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(a=0;a<xo.length;a++)it(xo[a],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in n)if(n.hasOwnProperty(K)&&(a=n[K],a!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Dt(e,t,K,a,n,null)}return;default:if(ze(t)){for(se in n)n.hasOwnProperty(se)&&(a=n[se],a!==void 0&&uh(e,t,se,a,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(a=n[S],a!=null&&Dt(e,t,S,a,n,null))}function B_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,x=null,S=null,R=null,K=null,se=null;for(te in n){var oe=n[te];if(n.hasOwnProperty(te)&&oe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":R=oe;default:a.hasOwnProperty(te)||Dt(e,t,te,null,a,oe)}}for(var F in a){var te=a[F];if(oe=n[F],a.hasOwnProperty(F)&&(te!=null||oe!=null))switch(F){case"type":f=te;break;case"name":u=te;break;case"checked":K=te;break;case"defaultChecked":se=te;break;case"value":x=te;break;case"defaultValue":S=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(c(137,t));break;default:te!==oe&&Dt(e,t,F,te,a,oe)}}gs(e,x,S,R,K,se,f,u);return;case"select":te=x=S=F=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":te=R;default:a.hasOwnProperty(f)||Dt(e,t,f,null,a,R)}for(u in a)if(f=a[u],R=n[u],a.hasOwnProperty(u)&&(f!=null||R!=null))switch(u){case"value":F=f;break;case"defaultValue":S=f;break;case"multiple":x=f;default:f!==R&&Dt(e,t,u,f,a,R)}t=S,n=x,a=te,F!=null?Bt(e,!!n,F,!1):!!a!=!!n&&(t!=null?Bt(e,!!n,t,!0):Bt(e,!!n,n?[]:"",!1));return;case"textarea":te=F=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!a.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Dt(e,t,S,null,a,u)}for(x in a)if(u=a[x],f=n[x],a.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":F=u;break;case"defaultValue":te=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Dt(e,t,x,u,a,f)}me(e,F,te);return;case"option":for(var Re in n)if(F=n[Re],n.hasOwnProperty(Re)&&F!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Dt(e,t,Re,null,a,F)}for(R in a)if(F=a[R],te=n[R],a.hasOwnProperty(R)&&F!==te&&(F!=null||te!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Dt(e,t,R,F,a,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in n)F=n[He],n.hasOwnProperty(He)&&F!=null&&!a.hasOwnProperty(He)&&Dt(e,t,He,null,a,F);for(K in a)if(F=a[K],te=n[K],a.hasOwnProperty(K)&&F!==te&&(F!=null||te!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(c(137,t));break;default:Dt(e,t,K,F,a,te)}return;default:if(ze(t)){for(var Ot in n)F=n[Ot],n.hasOwnProperty(Ot)&&F!==void 0&&!a.hasOwnProperty(Ot)&&uh(e,t,Ot,void 0,a,F);for(se in a)F=a[se],te=n[se],!a.hasOwnProperty(se)||F===te||F===void 0&&te===void 0||uh(e,t,se,F,a,te);return}}for(var q in n)F=n[q],n.hasOwnProperty(q)&&F!=null&&!a.hasOwnProperty(q)&&Dt(e,t,q,null,a,F);for(oe in a)F=a[oe],te=n[oe],!a.hasOwnProperty(oe)||F===te||F==null&&te==null||Dt(e,t,oe,F,a,te)}function Yg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function I_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,x=u.initiatorType,S=u.duration;if(f&&S&&Yg(x)){for(x=0,S=u.responseEnd,a+=1;a<n.length;a++){var R=n[a],K=R.startTime;if(K>S)break;var se=R.transferSize,oe=R.initiatorType;se&&Yg(oe)&&(R=R.responseEnd,x+=se*(R<S?1:(S-K)/(R-K)))}if(--a,t+=8*(f+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var fh=null,dh=null;function Zu(e){return e.nodeType===9?e:e.ownerDocument}function $g(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function hh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ph=null;function q_(){var e=window.event;return e&&e.type==="popstate"?e===ph?!1:(ph=e,!0):(ph=null,!1)}var Vg=typeof setTimeout=="function"?setTimeout:void 0,G_=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,Y_=typeof queueMicrotask=="function"?queueMicrotask:typeof Qg<"u"?function(e){return Qg.resolve(null).then(e).catch($_)}:Vg;function $_(e){setTimeout(function(){throw e})}function ji(e){return e==="head"}function Kg(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),ec(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")_o(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,_o(n);for(var f=n.firstChild;f;){var x=f.nextSibling,S=f.nodeName;f[el]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=x}}else n==="body"&&_o(e.ownerDocument.body);n=u}while(n);ec(t)}function Zg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function mh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":mh(n),kt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function X_(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[el])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=os(e.nextSibling),e===null)break}return null}function V_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=os(e.nextSibling),e===null))return null;return e}function Fg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=os(e.nextSibling),e===null))return null;return e}function gh(e){return e.data==="$?"||e.data==="$~"}function bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Q_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function os(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var xh=null;function Jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return os(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Wg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Pg(e,t,n){switch(t=Zu(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function _o(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var us=new Map,eb=new Set;function Fu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var za=fe.d;fe.d={f:K_,r:Z_,D:F_,C:J_,L:W_,m:P_,X:t0,S:e0,M:n0};function K_(){var e=za.f(),t=qu();return e||t}function Z_(e){var t=ln(e);t!==null&&t.tag===5&&t.type==="form"?bm(t):za.r(e)}var Jr=typeof document>"u"?null:document;function tb(e,t,n){var a=Jr;if(a&&typeof t=="string"&&t){var u=zn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),eb.has(u)||(eb.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),rl(t,"link",e),Ze(t),a.head.appendChild(t)))}}function F_(e){za.D(e),tb("dns-prefetch",e,null)}function J_(e,t){za.C(e,t),tb("preconnect",e,t)}function W_(e,t,n){za.L(e,t,n);var a=Jr;if(a&&e&&t){var u='link[rel="preload"][as="'+zn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+zn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+zn(n.imageSizes)+'"]')):u+='[href="'+zn(e)+'"]';var f=u;switch(t){case"style":f=Wr(e);break;case"script":f=Pr(e)}us.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),us.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(vo(f))||t==="script"&&a.querySelector(jo(f))||(t=a.createElement("link"),rl(t,"link",e),Ze(t),a.head.appendChild(t)))}}function P_(e,t){za.m(e,t);var n=Jr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+zn(a)+'"][href="'+zn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Pr(e)}if(!us.has(f)&&(e=j({rel:"modulepreload",href:e},t),us.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(jo(f)))return}a=n.createElement("link"),rl(a,"link",e),Ze(a),n.head.appendChild(a)}}}function e0(e,t,n){za.S(e,t,n);var a=Jr;if(a&&e){var u=bt(a).hoistableStyles,f=Wr(e);t=t||"default";var x=u.get(f);if(!x){var S={loading:0,preload:null};if(x=a.querySelector(vo(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=us.get(f))&&yh(e,n);var R=x=a.createElement("link");Ze(R),rl(R,"link",e),R._p=new Promise(function(K,se){R.onload=K,R.onerror=se}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ju(x,t,a)}x={type:"stylesheet",instance:x,count:1,state:S},u.set(f,x)}}}function t0(e,t){za.X(e,t);var n=Jr;if(n&&e){var a=bt(n).hoistableScripts,u=Pr(e),f=a.get(u);f||(f=n.querySelector(jo(u)),f||(e=j({src:e,async:!0},t),(t=us.get(u))&&_h(e,t),f=n.createElement("script"),Ze(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function n0(e,t){za.M(e,t);var n=Jr;if(n&&e){var a=bt(n).hoistableScripts,u=Pr(e),f=a.get(u);f||(f=n.querySelector(jo(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=us.get(u))&&_h(e,t),f=n.createElement("script"),Ze(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function nb(e,t,n,a){var u=(u=Se.current)?Fu(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Wr(n.href),n=bt(u).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Wr(n.href);var f=bt(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(vo(e)))&&!f._p&&(x.instance=f,x.state.loading=5),us.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},us.set(e,n),f||l0(u,e,n,x.state))),t&&a===null)throw Error(c(528,""));return x}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pr(n),n=bt(u).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Wr(e){return'href="'+zn(e)+'"'}function vo(e){return'link[rel="stylesheet"]['+e+"]"}function lb(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function l0(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),rl(t,"link",n),Ze(t),e.head.appendChild(t))}function Pr(e){return'[src="'+zn(e)+'"]'}function jo(e){return"script[async]"+e}function sb(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+zn(n.href)+'"]');if(a)return t.instance=a,Ze(a),a;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ze(a),rl(a,"style",u),Ju(a,n.precedence,e),t.instance=a;case"stylesheet":u=Wr(n.href);var f=e.querySelector(vo(u));if(f)return t.state.loading|=4,t.instance=f,Ze(f),f;a=lb(n),(u=us.get(u))&&yh(a,u),f=(e.ownerDocument||e).createElement("link"),Ze(f);var x=f;return x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),rl(f,"link",a),t.state.loading|=4,Ju(f,n.precedence,e),t.instance=f;case"script":return f=Pr(n.src),(u=e.querySelector(jo(f)))?(t.instance=u,Ze(u),u):(a=n,(u=us.get(f))&&(a=j({},n),_h(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ze(u),rl(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ju(a,n.precedence,e));return t.instance}function Ju(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,x=0;x<a.length;x++){var S=a[x];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 yh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wu=null;function ab(e,t,n){if(Wu===null){var a=new Map,u=Wu=new Map;u.set(n,a)}else u=Wu,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[el]||f[Vt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var S=a.get(x);S?S.push(f):a.set(x,[f])}}return a}function ib(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function s0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a0(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=Wr(a.href),f=t.querySelector(vo(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Ze(f);return}f=t.ownerDocument||t,a=lb(a),(u=us.get(u))&&yh(a,u),f=f.createElement("link"),Ze(f);var x=f;x._p=new Promise(function(S,R){x.onload=S,x.onerror=R}),rl(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Pu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var vh=0;function i0(e,t){return e.stylesheets&&e.count===0&&tf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&tf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&vh===0&&(vh=62500*I_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>vh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ef=null;function tf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ef=new Map,t.forEach(r0,e),ef=null,Pu.call(e))}function r0(e,t){if(!(t.state.loading&4)){var n=ef.get(e);if(n)var a=n.get(null);else{n=new Map,ef.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(n.set(x.dataset.precedence,x),a=x)}a&&n.set(null,a)}u=t.instance,x=u.getAttribute("data-precedence"),f=n.get(x)||a,f===a&&n.set(null,u),n.set(x,u),this.count++,a=Pu.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var So={$$typeof:G,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function c0(e,t,n,a,u,f,x,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=Rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rn(0),this.hiddenUpdates=Rn(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function cb(e,t,n,a,u,f,x,S,R,K,se,oe){return e=new c0(e,t,n,x,R,K,se,oe,S),t=1,f===!0&&(t|=24),f=vl(3,null,null,t),e.current=f,f.stateNode=e,t=zr(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},sd(f),e}function ob(e){return e?(e=Pa,e):Pa}function ub(e,t,n,a,u,f){u=ob(u),a.context===null?a.context=u:a.pendingContext=u,a=fi(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=di(e,a,t),n!==null&&(Hl(n,e,t),eo(n,e,t))}function fb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jh(e,t){fb(e,t),(e=e.alternate)&&fb(e,t)}function db(e){if(e.tag===13||e.tag===31){var t=xa(e,67108864);t!==null&&Hl(t,e,67108864),jh(e,67108864)}}function hb(e){if(e.tag===13||e.tag===31){var t=Xl();t=Ms(t);var n=xa(e,t);n!==null&&Hl(n,e,t),jh(e,t)}}var nf=!0;function o0(e,t,n,a){var u=A.T;A.T=null;var f=fe.p;try{fe.p=2,Sh(e,t,n,a)}finally{fe.p=f,A.T=u}}function u0(e,t,n,a){var u=A.T;A.T=null;var f=fe.p;try{fe.p=8,Sh(e,t,n,a)}finally{fe.p=f,A.T=u}}function Sh(e,t,n,a){if(nf){var u=wh(a);if(u===null)oh(e,t,a,lf,n),mb(e,a);else if(d0(u,e,t,n,a))a.stopPropagation();else if(mb(e,a),t&4&&-1<f0.indexOf(e)){for(;u!==null;){var f=ln(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=xe(f.pendingLanes);if(x!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var R=1<<31-Et(x);S.entanglements[1]|=R,x&=~R}Zs(f),(jt&6)===0&&(Bu=Ke()+500,bo(0))}}break;case 31:case 13:S=xa(f,2),S!==null&&Hl(S,f,2),qu(),jh(f,2)}if(f=wh(a),f===null&&oh(e,t,a,lf,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else oh(e,t,a,null,n)}}function wh(e){return e=It(e),kh(e)}var lf=null;function kh(e){if(lf=null,e=Tl(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return lf=e,null}function pb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(zt()){case gn:return 2;case ft:return 8;case Je:case An:return 32;case on:return 268435456;default:return 32}default:return 32}}var Nh=!1,Si=null,wi=null,ki=null,wo=new Map,ko=new Map,Ni=[],f0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function mb(e,t){switch(e){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":wo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ko.delete(t.pointerId)}}function No(e,t,n,a,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:f,targetContainers:[u]},t!==null&&(t=ln(t),t!==null&&db(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function d0(e,t,n,a,u){switch(t){case"focusin":return Si=No(Si,e,t,n,a,u),!0;case"dragenter":return wi=No(wi,e,t,n,a,u),!0;case"mouseover":return ki=No(ki,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return wo.set(f,No(wo.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,ko.set(f,No(ko.get(f)||null,e,t,n,a,u)),!0}return!1}function gb(e){var t=Tl(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,bl(e.priority,function(){hb(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,bl(e.priority,function(){hb(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function sf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);fn=a,n.target.dispatchEvent(a),fn=null}else return t=ln(n),t!==null&&db(t),e.blockedOn=n,!1;t.shift()}return!0}function bb(e,t,n){sf(e)&&n.delete(t)}function h0(){Nh=!1,Si!==null&&sf(Si)&&(Si=null),wi!==null&&sf(wi)&&(wi=null),ki!==null&&sf(ki)&&(ki=null),wo.forEach(bb),ko.forEach(bb)}function af(e,t){e.blockedOn===t&&(e.blockedOn=null,Nh||(Nh=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,h0)))}var rf=null;function xb(e){rf!==e&&(rf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){rf===e&&(rf=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(kh(a||n)===null)continue;break}var f=ln(n);f!==null&&(e.splice(t,3),t-=3,wd(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function ec(e){function t(R){return af(R,e)}Si!==null&&af(Si,e),wi!==null&&af(wi,e),ki!==null&&af(ki,e),wo.forEach(t),ko.forEach(t);for(var n=0;n<Ni.length;n++){var a=Ni[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ni.length&&(n=Ni[0],n.blockedOn===null);)gb(n),n.blockedOn===null&&Ni.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],x=u[$e]||null;if(typeof f=="function")x||xb(n);else if(x){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[$e]||null)S=x.formAction;else if(kh(u)!==null)continue}else S=x.action;typeof S=="function"?n[a+1]=S:(n.splice(a,3),a-=3),xb(n)}}}function yb(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Th(e){this._internalRoot=e}cf.prototype.render=Th.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=Xl();ub(n,a,e,t,null,null)},cf.prototype.unmount=Th.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ub(e.current,2,null,e,null,null),qu(),t[vt]=null}};function cf(e){this._internalRoot=e}cf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ni.length&&t!==0&&t<Ni[n].priority;n++);Ni.splice(n,0,e),n===0&&gb(e)}};var _b=s.version;if(_b!=="19.2.8")throw Error(c(527,_b,"19.2.8"));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=b(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var p0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!of.isDisabled&&of.supportsFiber)try{Xt=of.inject(p0),wt=of}catch{}}return Eo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Tm,f=Em,x=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=cb(e,1,!1,null,null,n,a,null,u,f,x,yb),e[vt]=t.current,ch(e),new Th(t)},Eo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Tm,x=Em,S=Cm,R=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=cb(e,1,!0,t,n??null,a,u,R,f,x,S,yb),t.context=ob(null),n=t.current,a=Xl(),a=Ms(a),u=fi(a),u.callback=null,di(n,u,a),n=a,t.current.lanes=n,ul(t,n),Zs(t),e[vt]=t.current,ch(e),new cf(t)},Eo.version="19.2.8",Eo}var Mb;function N0(){if(Mb)return Mh.exports;Mb=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Mh.exports=k0(),Mh.exports}var T0=N0();const ty=1;function E0(l){return`${l.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${ny(l)}`}function C0(l){const s=l.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${s.replace(/^-+|-+$/g,"")||"project"}-${ny(l)}`,c=E0(l);return[s,r].filter(o=>o!==c)}function ny(l){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(l);return A0(s?l.toLowerCase():l)}function A0(l){let s=3735928559,r=1103547991;for(let c=0;c<l.length;c++){const o=l.charCodeAt(c);s=Math.imul(s^o,2654435761),r=Math.imul(r^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&r)+(s>>>0)).toString(36)}var Ba,pc,mc,gc,bc,$o,xc,Yf,ly;class M0{constructor(s){hn(this,Yf);hn(this,Ba,null);hn(this,pc,new Set);hn(this,mc,500);hn(this,gc,null);hn(this,bc,!1);hn(this,$o,null);hn(this,xc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){St(this,xc,s)}connect(){if(Ge(this,bc))return;const s=new WebSocket(this.url);St(this,Ba,s),s.addEventListener("open",()=>{var r,c;St(this,mc,500),this.send({type:"hello",protocol:ty,clientName:"ccv-web"}),(r=Ge(this,$o))==null||r.call(this),(c=Ge(this,xc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ge(this,pc))o(c)}),s.addEventListener("close",()=>{var r;St(this,Ba,null),(r=Ge(this,xc))==null||r.call(this),qn(this,Yf,ly).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){St(this,$o,s)}on(s){return Ge(this,pc).add(s),()=>Ge(this,pc).delete(s)}send(s){var r;((r=Ge(this,Ba))==null?void 0:r.readyState)===WebSocket.OPEN&&Ge(this,Ba).send(JSON.stringify(s))}get connected(){var s;return((s=Ge(this,Ba))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;St(this,bc,!0),(s=Ge(this,Ba))==null||s.close()}}Ba=new WeakMap,pc=new WeakMap,mc=new WeakMap,gc=new WeakMap,bc=new WeakMap,$o=new WeakMap,xc=new WeakMap,Yf=new WeakSet,ly=function(){if(Ge(this,bc)||Ge(this,gc)!==null)return;const s=Ge(this,mc);St(this,mc,Math.min(s*2,1e4)),St(this,gc,window.setTimeout(()=>{St(this,gc,null),this.connect()},s))};const R0=1,sy="ccv:relay",Af="ccv:relay.host";function D0(){try{const l=localStorage.getItem(sy);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function ay(){localStorage.removeItem(sy)}var la,yc,sa,_c,vc,Li,ur,fr,zi,dr,jc,hr,pr,Wt,Ai,tp,iy,rr,np;class O0{constructor(s){hn(this,Wt);hn(this,la,null);hn(this,yc,new Set);hn(this,sa,null);hn(this,_c,null);hn(this,vc,500);hn(this,Li,null);hn(this,ur,!1);hn(this,fr,!1);hn(this,zi,!1);hn(this,dr,null);hn(this,jc,"Подключаемся…");hn(this,hr,0);hn(this,pr,[]);this.session=s}get connected(){return Ge(this,fr)&&Ge(this,zi)}get statusText(){return Ge(this,jc)}get hostId(){return Ge(this,dr)}on(s){return Ge(this,yc).add(s),()=>Ge(this,yc).delete(s)}onReconnect(s){St(this,_c,s)}onStatus(s){St(this,sa,s)}connect(){Ge(this,ur)||qn(this,Wt,tp).call(this)}send(s){if(!Ge(this,fr)){Ge(this,pr).length<64&&Ge(this,pr).push(s);return}qn(this,Wt,rr).call(this,{t:"client.frame",body:s})}close(){var s;St(this,ur,!0),Ge(this,Li)!==null&&window.clearTimeout(Ge(this,Li)),(s=Ge(this,la))==null||s.close()}}la=new WeakMap,yc=new WeakMap,sa=new WeakMap,_c=new WeakMap,vc=new WeakMap,Li=new WeakMap,ur=new WeakMap,fr=new WeakMap,zi=new WeakMap,dr=new WeakMap,jc=new WeakMap,hr=new WeakMap,pr=new WeakMap,Wt=new WeakSet,Ai=function(s){var r;Ge(this,jc)!==s&&(St(this,jc,s),(r=Ge(this,sa))==null||r.call(this))},tp=async function(){if(Ge(this,la))return;if(!Ge(this,dr))try{St(this,dr,await L0(this.session.token))}catch(c){qn(this,Wt,Ai).call(this,c instanceof Error?c.message:String(c)),qn(this,Wt,np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);St(this,la,r),r.addEventListener("open",()=>{qn(this,Wt,rr).call(this,{t:"client.hello",protocol:R0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}qn(this,Wt,iy).call(this,o)}),r.addEventListener("close",()=>{var c;St(this,la,null),St(this,fr,!1),St(this,zi,!1),qn(this,Wt,Ai).call(this,"Нет связи с сервером"),(c=Ge(this,sa))==null||c.call(this),qn(this,Wt,np).call(this)}),r.addEventListener("error",()=>r.close())},iy=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":St(this,vc,500),qn(this,Wt,rr).call(this,{t:"client.attach",hostId:Ge(this,dr)??"",...Ge(this,hr)>0?{sinceRseq:Ge(this,hr)}:{}});return;case"client.attached":St(this,fr,!0),St(this,zi,s.online),St(this,hr,s.rseq),qn(this,Wt,Ai).call(this,s.online?"Хост на связи":"Компьютер не на связи"),qn(this,Wt,rr).call(this,{t:"client.frame",body:{type:"hello",protocol:ty,clientName:"ccv-web-relay"}});const b=Ge(this,pr);St(this,pr,[]);for(const _ of b)qn(this,Wt,rr).call(this,{t:"client.frame",body:_});(r=Ge(this,_c))==null||r.call(this),(c=Ge(this,sa))==null||c.call(this);return;case"host.frame":{s.rseq>0&&St(this,hr,s.rseq);const _=s.body;for(const j of Ge(this,yc))j(_);return}case"host.online":St(this,zi,!0),qn(this,Wt,Ai).call(this,"Хост на связи"),(o=Ge(this,_c))==null||o.call(this),(d=Ge(this,sa))==null||d.call(this);return;case"host.offline":St(this,zi,!1),qn(this,Wt,Ai).call(this,"Компьютер не на связи"),(h=Ge(this,sa))==null||h.call(this);return;case"ping":qn(this,Wt,rr).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){ay(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Af),qn(this,Wt,Ai).call(this,"Этот компьютер отвязан от аккаунта"),St(this,ur,!0),(m=Ge(this,la))==null||m.close();return}s.code!=="offline"&&qn(this,Wt,Ai).call(this,s.message),(g=Ge(this,sa))==null||g.call(this);return}},rr=function(s){var r;((r=Ge(this,la))==null?void 0:r.readyState)===WebSocket.OPEN&&Ge(this,la).send(JSON.stringify(s))},np=function(){if(Ge(this,ur)||Ge(this,Li)!==null)return;const s=Ge(this,vc);St(this,vc,Math.min(s*2,1e4)),St(this,Li,window.setTimeout(()=>{St(this,Li,null),qn(this,Wt,tp).call(this)},s))};async function L0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Af,s),s;const r=localStorage.getItem(Af);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw ay(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Af,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Mf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const z0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function U0(){if(Mf()==="local")return new M0(z0);const l=D0();return l?new O0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const ry="ccv:drafts",H0=40,B0=2e4,I0=500;let Bo=null,Io=null;function bp(){if(Bo)return Bo;const l=new Map;try{const s=localStorage.getItem(ry);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return Bo=l,window.addEventListener("pagehide",uy),l}function Lh(l){return bp().get(l)??""}function cy(l,s){const r=bp(),c=s.slice(0,B0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>H0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Y0(),G0()}function oy(){const l=new Set;for(const s of bp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const lp=new Set;let Rb="";function q0(l){return lp.add(l),()=>lp.delete(l)}function G0(){const l=oy(),s=l.join(`
51
- `);if(s!==Rb){Rb=s;for(const r of lp)r(l)}}function Y0(){Io===null&&(Io=window.setTimeout(uy,I0))}function uy(){if(Io!==null&&window.clearTimeout(Io),Io=null,!!Bo)try{localStorage.setItem(ry,JSON.stringify(Object.fromEntries(Bo)))}catch{}}const wl={items:[],pending:[],lastSeq:0,contextTokens:null},zh={entries:[],total:0,loading:!1};function fy(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Db(l){return l.total>0&&fy(l)>1}function $0(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:s.total,loading:!1}}function X0(l){return Rf(wl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Rf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...V0(r,c.event,c.seq),lastSeq:c.seq});return r}function V0(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return Fs(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Fs(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return tc(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?Fs(l,m):tc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Fs(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return tc(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?Fs(l,m):tc(l,h,m)}case"tool.use":return Fs(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return tc(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(g!==-1){const b=c[g];return tc({...l,pending:m},g,{...b,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:Fs({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return Fs({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=s.usage)==null?void 0:d.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:Fs(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Fs(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Q0(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function K0(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let d=0;d<l.length;d++)if(l[d].kind==="user"){if(o===c)return l.slice(0,d);o++}return l}function Fs(l,s){return{...l,items:[...l.items,s]}}function tc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const sp="ccv:theme",Uh=["system","light","dark"];function Z0(){const[l,s]=y.useState(F0);y.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=y.useCallback(o=>{try{localStorage.setItem(sp,o)}catch{}s(o)},[]),c=y.useCallback(()=>{s(o=>{const d=Uh[(Uh.indexOf(o)+1)%Uh.length];try{localStorage.setItem(sp,d)}catch{}return d})},[]);return[l,r,c]}function F0(){try{const l=localStorage.getItem(sp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const dy=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],J0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],mr={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:"вопроса"}},W0=320,hy="ccv:panes";function P0(l){return`--${l}-w`}function py(l,s){const r=mr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function ev(){const l={};for(const s of Object.keys(mr))l[s]=mr[s].width;try{const s=localStorage.getItem(hy);if(s){const r=JSON.parse(s);for(const c of Object.keys(mr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=py(c,o))}}}catch{}return l}function tv(){const[l,s]=y.useState(ev),r=y.useCallback(h=>{try{localStorage.setItem(hy,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,m)=>{s(g=>{const b=py(h,m);if(g[h]===b)return g;const _={...g,[h]:b};return r(_),_})},[r]),o=y.useCallback(h=>{s(m=>{const g={...m,[h]:mr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(mr))d[P0(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Hh=260,my=120,nv=200,Ob="ccv:terminal-h";function Lb(l,s){return Math.round(Math.min(s,Math.max(my,l)))}function lv(){const[l,s]=y.useState(()=>{try{const d=localStorage.getItem(Ob);if(d){const h=Number(d);if(Number.isFinite(h))return Lb(h,1/0)}}catch{}return Hh}),r=y.useCallback(d=>{try{localStorage.setItem(Ob,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const m=Lb(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=y.useCallback(()=>{s(Hh),r(Hh)},[r]);return{height:l,setHeight:c,reset:o}}function $f(l){const[s,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return y.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const sv=500,av=6;function gy({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=sv,moveCancelPx:o=av}){const d=y.useRef(null),[h,m]=y.useState(!1),g=y.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=y.useCallback(E=>{if(r||E.button!==0)return;const L={timer:0,x:E.clientX,y:E.clientY,fired:!1};L.timer=window.setTimeout(()=>{L.fired=!0,m(!1),l()},c),d.current=L,m(!0)},[r,c,l]),_=y.useCallback(E=>{const L=d.current;!L||L.fired||Math.hypot(E.clientX-L.x,E.clientY-L.y)>o&&g()},[o,g]),j=y.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=y.useCallback(E=>{var L;if((L=d.current)!=null&&L.fired){d.current=null,E.preventDefault();return}if(!r){if(E.shiftKey){l();return}s()}},[r,s,l]),C=y.useCallback(E=>{E.preventDefault()},[]),T=y.useCallback(E=>{r||E.shiftKey&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:_,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:C,onKeyDown:T}}}const iv={height:0,offsetTop:0,offsetLeft:0};function zb(){if(typeof window>"u")return iv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function rv(l){const[s,r]=y.useState(zb);return y.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=zb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[l]),s}function xp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yr=xp();function by(l){yr=l}var cr={exec:()=>null};function nc(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function pt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(pl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var cv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),pl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:nc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:nc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:nc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:nc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:nc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:nc(l=>new RegExp(`^ {0,${l}}>`))},ov=/^(?:[ \t]*(?:\n|$))+/,uv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yy=pt(xy).replace(/bull/g,yp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),hv=pt(xy).replace(/bull/g,yp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_p=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,pv=/^[^\n]+/,vp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mv=pt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gv=pt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,yp).getRegex(),Xf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",jp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,bv=pt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",jp).replace("tag",Xf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_y=l=>pt(_p).replace("hr",Xo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex(),xv=_y(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),yv=_y(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),_v=pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yv).getRegex(),Sp={blockquote:_v,code:uv,def:mv,fences:fv,heading:dv,hr:Xo,html:bv,lheading:yy,list:gv,newline:ov,paragraph:xv,table:cr,text:pv},Ub=pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex(),vv={...Sp,lheading:hv,table:Ub,paragraph:pt(_p).replace("hr",Xo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ub).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xf).getRegex()},jv={...Sp,html:pt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pt(_p).replace("hr",Xo).replace("heading",` *#{1,6} *[^
52
- ]`).replace("lheading",yy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vy=/^( {2,}|\\)\n(?!\s*$)/,kv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wc=/[\p{P}\p{S}]/u,Vf=/[\s\p{P}\p{S}]/u,wp=/[^\s\p{P}\p{S}]/u,Nv=pt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vf).getRegex(),jy=/(?!~)[\p{P}\p{S}]/u,Tv=/(?!~)[\s\p{P}\p{S}]/u,Ev=/(?:[^\s\p{P}\p{S}]|~)/u,Cv=pt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",cv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Sy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Av=pt(Sy,"u").replace(/punct/g,wc).getRegex(),Mv=pt(Sy,"u").replace(/punct/g,jy).getRegex(),wy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rv=pt(wy,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,wc).getRegex(),Dv=pt(wy,"gu").replace(/notPunctSpace/g,Ev).replace(/punctSpace/g,Tv).replace(/punct/g,jy).getRegex(),Ov=pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,wc).getRegex(),Lv=pt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,wc).getRegex(),zv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Uv=pt(zv,"gu").replace(/notPunctSpace/g,wp).replace(/punctSpace/g,Vf).replace(/punct/g,wc).getRegex(),Hv=pt(/\\(punct)/,"gu").replace(/punct/g,wc).getRegex(),Bv=pt(/^<(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(),Iv=pt(jp).replace("(?:-->|$)","-->").getRegex(),qv=pt("^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",Iv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Gv=pt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Lf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ky=pt(/^!?\[(label)\]\[(ref)\]/).replace("label",Lf).replace("ref",vp).getRegex(),Ny=pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",vp).getRegex(),Yv=pt("reflink|nolink(?!\\()","g").replace("reflink",ky).replace("nolink",Ny).getRegex(),Hb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kp={_backpedal:cr,anyPunctuation:Hv,autolink:Bv,blockSkip:Cv,br:vy,code:wv,del:cr,delLDelim:cr,delRDelim:cr,emStrongLDelim:Av,emStrongRDelimAst:Rv,emStrongRDelimUnd:Ov,escape:Sv,link:Gv,nolink:Ny,punctuation:Nv,reflink:ky,reflinkSearch:Yv,tag:qv,text:kv,url:cr},$v={...kp,link:pt(/^!?\[(label)\]\((.*?)\)/).replace("label",Lf).getRegex(),reflink:pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lf).getRegex()},ap={...kp,emStrongRDelimAst:Dv,emStrongLDelim:Mv,delLDelim:Lv,delRDelim:Uv,url:pt(/^((?: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:pt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {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()},Xv={...ap,br:pt(vy).replace("{2,}","*").getRegex(),text:pt(ap.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uf={normal:Sp,gfm:vv,pedantic:jv},Co={normal:kp,gfm:ap,breaks:Xv,pedantic:$v},Vv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Bb=l=>Vv[l];function ea(l,s){if(s){if(pl.escapeTest.test(l))return l.replace(pl.escapeReplace,Bb)}else if(pl.escapeTestNoEncode.test(l))return l.replace(pl.escapeReplaceNoEncode,Bb);return l}function Ib(l){try{l=encodeURI(l).replace(pl.percentDecode,"%")}catch{return null}return l}function qb(l,s){var d;let r=l.replace(pl.findPipe,(h,m,g)=>{let b=!1,_=m;for(;--_>=0&&g[_]==="\\";)b=!b;return b?"|":" |"}),c=r.split(pl.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(pl.slashPipe,"|");return c}function Ei(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function Gb(l){let s=l.split(`
49
+ `+a.stack}}var nn=Object.prototype.hasOwnProperty,pn=l.unstable_scheduleCallback,Sn=l.unstable_cancelCallback,mn=l.unstable_shouldYield,cn=l.unstable_requestPaint,Ke=l.unstable_now,zt=l.unstable_getCurrentPriorityLevel,gn=l.unstable_ImmediatePriority,ft=l.unstable_UserBlockingPriority,Je=l.unstable_NormalPriority,An=l.unstable_LowPriority,on=l.unstable_IdlePriority,wn=l.log,Pn=l.unstable_setDisableYieldValue,Xt=null,wt=null;function Kt(e){if(typeof wn=="function"&&Pn(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Xt,e)}catch{}}var Et=Math.clz32?Math.clz32:be,Yn=Math.log,le=Math.LN2;function be(e){return e>>>=0,e===0?32:31-(Yn(e)/le|0)|0}var Le=256,H=262144,W=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 Be(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var S=a&134217727;return S!==0?(a=S&~f,a!==0?u=xe(a):(x&=S,x!==0?u=xe(x):n||(n=S&~e,n!==0&&(u=xe(n))))):(S=a&~f,S!==0?u=xe(S):x!==0?u=xe(x):n||(n=a&~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 gt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Mn(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 bn(){var e=W;return W<<=1,(W&62914560)===0&&(W=4194304),e}function Rn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ul(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gl(e,t,n,a,u,f){var x=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,D=e.expirationTimes,K=e.hiddenUpdates;for(n=x&~n;0<n;){var se=31-Et(n),oe=1<<se;S[se]=0,D[se]=-1;var J=K[se];if(J!==null)for(K[se]=null,se=0;se<J.length;se++){var te=J[se];te!==null&&(te.lane&=-536870913)}n&=~oe}a!==0&&ca(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(x&~t))}function ca(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Et(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Ql(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Et(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function ps(e,t){var n=t&-t;return n=(n&42)!==0?1:Ms(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ms(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 Dn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kl(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:pb(e.type))}function bl(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var $n=Math.random().toString(36).slice(2),Vt="__reactFiber$"+$n,$e="__reactProps$"+$n,vt="__reactContainer$"+$n,xl="__reactEvents$"+$n,lt="__reactListeners$"+$n,Zl="__reactHandles$"+$n,Ut="__reactResources$"+$n,el="__reactMarker$"+$n;function kt(e){delete e[Vt],delete e[$e],delete e[xl],delete e[lt],delete e[Zl]}function Tl(e){var t=e[Vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[Vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wg(e);e!==null;){if(n=e[Vt])return n;e=Wg(e)}return t}e=n,n=e.parentNode}return null}function ln(e){if(e=e[Vt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function bt(e){var t=e[Ut];return t||(t=e[Ut]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ze(e){e[el]=!0}var On=new Set,El={};function xn(e,t){Nn(e,t),Nn(e+"Capture",t)}function Nn(e,t){for(El[e]=t,e=0;e<t.length;e++)On.add(t[e])}var tl=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]*$"),ms={},yn={};function Fl(e){return nn.call(yn,e)?!0:nn.call(ms,e)?!1:tl.test(e)?yn[e]=!0:(ms[e]=!0,!1)}function fl(e,t,n){if(Fl(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function nl(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 Ln(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ii(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(x){n=""+x,f.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){if(!e._valueTracker){var t=qa(e)?"checked":"value";e._valueTracker=Ii(e,t,""+e[t])}}function Ds(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=qa(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function yl(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 Ga=/[\n"\\]/g;function zn(e){return e.replace(Ga,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gs(e,t,n,a,u,f,x,S){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?sn(e,x,Ht(t)):n!=null?sn(e,x,Ht(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Ht(S):e.removeAttribute("name")}function Jl(e,t,n,a,u,f,x,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)){Rs(e);return}n=n!=null?""+Ht(n):"",t=t!=null?""+Ht(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=S?e.checked:!!a,e.defaultChecked=!!a,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Rs(e)}function sn(e,t,n){t==="number"&&yl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Bt(e,t,n,a){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Ht(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function me(e,t,n){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ht(n):""}function N(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(Ne(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Ht(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Rs(e)}function $(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ae=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function we(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||ae.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ve(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&we(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&we(e,f,t[f])}function ze(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ot=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"]]),un=/^[\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 Mt(e){return un.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function mt(){}var fn=null;function It(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ll=null,bs=null;function w(e){var t=ln(e);if(t&&(e=t.stateNode)){var n=e[$e]||null;e:switch(e=t.stateNode,t.type){case"input":if(gs(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="'+zn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[$e]||null;if(!u)throw Error(c(90));gs(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Ds(a)}break e;case"textarea":me(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var ie=!1;function Me(e,t,n){if(ie)return e(t,n);ie=!0;try{var a=e(t);return a}finally{if(ie=!1,(ll!==null||bs!==null)&&(Gu(),ll&&(t=ll,e=bs,bs=ll=null,w(t),e)))for(t=0;t<e.length;t++)w(e[t])}}function Fe(e,t){var n=e.stateNode;if(n===null)return null;var a=n[$e]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xs=!1;if(_n)try{var ys={};Object.defineProperty(ys,"passive",{get:function(){xs=!0}}),window.addEventListener("test",ys,ys),window.removeEventListener("test",ys,ys)}catch{xs=!1}var Os=null,qi=null,oa=null;function jr(){if(oa)return oa;var e,t=qi,n=t.length,a,u="value"in Os?Os.value:Os.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var x=n-e;for(a=1;a<=x&&t[n-a]===u[f-a];a++);return oa=u.slice(e,1<a?1-a:void 0)}function Gi(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 ua(){return!0}function fa(){return!1}function Zn(e){function t(n,a,u,f,x){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=x,this.currentTarget=null;for(var 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)?ua:fa,this.isPropagationStopped=fa,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=ua)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ua)},persist:function(){},isPersistent:ua}),t}var Wl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ls=Zn(Wl),Yi=j({},Wl,{view:0,detail:0}),Sr=Zn(Yi),Tc,Ya,zs,$a=j({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ma,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!==zs&&(zs&&e.type==="mousemove"?(Tc=e.screenX-zs.screenX,Ya=e.screenY-zs.screenY):Ya=Tc=0,zs=e),Tc)},movementY:function(e){return"movementY"in e?e.movementY:Ya}}),Xa=Zn($a),da=j({},$a,{dataTransfer:0}),wr=Zn(da),Ec=j({},Yi,{relatedTarget:0}),Cc=Zn(Ec),ha=j({},Wl,{animationName:0,elapsedTime:0,pseudoElement:0}),kr=Zn(ha),Qo=j({},Wl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nr=Zn(Qo),Ko=j({},Wl,{data:0}),$i=Zn(Ko),_s={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tr={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"},Xi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pa(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xi[e])?!!t[e]:!1}function ma(){return pa}var an=j({},Yi,{key:function(e){if(e.key){var t=_s[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ma,charCode:function(e){return e.type==="keypress"?Gi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ac=Zn(an),Zf=j({},$a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zo=Zn(Zf),Mc=j({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ma}),Er=Zn(Mc),Xn=j({},Wl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vi=Zn(Xn),Qi=j({},$a,{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}),Fo=Zn(Qi),Un=j({},Wl,{newState:0,oldState:0}),Jo=Zn(Un),Wo=[9,13,27,32],Il=_n&&"CompositionEvent"in window,Va=null;_n&&"documentMode"in document&&(Va=document.documentMode);var Cr=_n&&"TextEvent"in window&&!Va,Ki=_n&&(!Il||Va&&8<Va&&11>=Va),Qa=" ",Us=!1;function Rc(e,t){switch(e){case"keyup":return Wo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ka(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vs=!1;function Zi(e,t){switch(e){case"compositionend":return Ka(t);case"keypress":return t.which!==32?null:(Us=!0,Qa);case"textInput":return e=t.data,e===Qa&&Us?null:e;default:return null}}function Fi(e,t){if(vs)return e==="compositionend"||!Il&&Rc(e,t)?(e=jr(),oa=qi=Os=null,vs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ki&&t.locale!=="ko"?null:t.data;default:return null}}var Po={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 Za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Po[e.type]:t==="textarea"}function eu(e,t,n,a){ll?bs?bs.push(a):bs=[a]:ll=a,t=Zu(t,"onChange"),0<t.length&&(n=new Ls("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ee=null,Pl=null;function Dc(e){Hg(e,0)}function Ar(e){var t=kn(e);if(Ds(t))return e}function tu(e,t){if(e==="change")return t}var X=!1;if(_n){var ga;if(_n){var ba="oninput"in document;if(!ba){var Oc=document.createElement("div");Oc.setAttribute("oninput","return;"),ba=typeof Oc.oninput=="function"}ga=ba}else ga=!1;X=ga&&(!document.documentMode||9<document.documentMode)}function Lc(){ee&&(ee.detachEvent("onpropertychange",nu),Pl=ee=null)}function nu(e){if(e.propertyName==="value"&&Ar(Pl)){var t=[];eu(t,Pl,e,It(e)),Me(Dc,t)}}function Fa(e,t,n){e==="focusin"?(Lc(),ee=t,Pl=n,ee.attachEvent("onpropertychange",nu)):e==="focusout"&&Lc()}function Ff(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ar(Pl)}function Jf(e,t){if(e==="click")return Ar(t)}function Wf(e,t){if(e==="input"||e==="change")return Ar(t)}function Pf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _l=typeof Object.is=="function"?Object.is:Pf;function es(e,t){if(_l(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!nn.call(t,u)||!_l(e[u],t[u]))return!1}return!0}function lu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function su(e,t){var n=lu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lu(n)}}function au(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?au(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=yl(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=yl(e.document)}return t}function zc(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 ed=_n&&"documentMode"in document&&11>=document.documentMode,Ja=null,Uc=null,Ji=null,Wi=!1;function ru(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wi||Ja==null||Ja!==yl(a)||(a=Ja,"selectionStart"in a&&zc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ji&&es(Ji,a)||(Ji=a,a=Zu(Uc,"onSelect"),0<a.length&&(t=new Ls("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ja)))}function xa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Hs={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionrun:xa("Transition","TransitionRun"),transitionstart:xa("Transition","TransitionStart"),transitioncancel:xa("Transition","TransitionCancel"),transitionend:xa("Transition","TransitionEnd")},Hc={},cu={};_n&&(cu=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function ts(e){if(Hc[e])return Hc[e];if(!Hs[e])return e;var t=Hs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cu)return Hc[e]=t[n];return e}var ou=ts("animationend"),Bc=ts("animationiteration"),Ic=ts("animationstart"),uu=ts("transitionrun"),fu=ts("transitionstart"),td=ts("transitioncancel"),qc=ts("transitionend"),Gc=new Map,Yc="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(" ");Yc.push("scrollEnd");function Cl(e,t){Gc.set(e,t),xn(t,[e])}var Wa=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)},Al=[],Pa=0,$c=0;function Mr(){for(var e=Pa,t=$c=Pa=0;t<e;){var n=Al[t];Al[t++]=null;var a=Al[t];Al[t++]=null;var u=Al[t];Al[t++]=null;var f=Al[t];if(Al[t++]=null,a!==null&&u!==null){var x=a.pending;x===null?u.next=u:(u.next=x.next,x.next=u),a.pending=u}f!==0&&Xc(n,u,f)}}function Bs(e,t,n,a){Al[Pa++]=e,Al[Pa++]=t,Al[Pa++]=n,Al[Pa++]=a,$c|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Rr(e,t,n,a){return Bs(e,t,n,a),Dr(e)}function ya(e,t){return Bs(e,null,null,t),Dr(e)}function Xc(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,a=f.alternate,a!==null&&(a.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Et(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function Dr(e){if(50<bo)throw bo=0,Pd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function nd(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vl(e,t,n,a){return new nd(e,t,n,a)}function Vc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function js(e,t){var n=e.alternate;return n===null?(n=vl(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 du(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 Or(e,t,n,a,u,f){var x=0;if(a=e,typeof e=="function")Vc(e)&&(x=1);else if(typeof e=="string")x=s0(e,n,ge.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=vl(31,n,t,u),e.elementType=ne,e.lanes=f,e;case E:return _a(n.children,u,f,t);case M:x=8,u|=24;break;case G:return e=vl(12,n,t,u|2),e.elementType=G,e.lanes=f,e;case Z:return e=vl(13,n,t,u),e.elementType=Z,e.lanes=f,e;case R:return e=vl(19,n,t,u),e.elementType=R,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:x=10;break e;case F:x=9;break e;case L:x=11;break e;case O:x=14;break e;case B:x=16,a=null;break e}x=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=vl(x,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function _a(e,t,n,a){return e=vl(7,e,a,t),e.lanes=n,e}function Qc(e,t,n){return e=vl(6,e,null,t),e.lanes=n,e}function hu(e){var t=vl(18,null,null,0);return t.stateNode=e,t}function Kc(e,t,n){return t=vl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zc=new WeakMap;function Ml(e,t){if(typeof e=="object"&&e!==null){var n=Zc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:tn(t)},Zc.set(e,t),t)}return{value:e,source:t,stack:tn(t)}}var ti=[],ni=0,Lr=null,va=0,dl=[],sl=0,Is=null,ns=1,ls="";function Ss(e,t){ti[ni++]=va,ti[ni++]=Lr,Lr=e,va=t}function pu(e,t,n){dl[sl++]=ns,dl[sl++]=ls,dl[sl++]=Is,Is=e;var a=ns;e=ls;var u=32-Et(a)-1;a&=~(1<<u),n+=1;var f=32-Et(t)+u;if(30<f){var x=u-u%5;f=(a&(1<<x)-1).toString(32),a>>=x,u-=x,ns=1<<32-Et(t)+u|n<<u|a,ls=f+e}else ns=1<<f|n<<u|a,ls=e}function Fc(e){e.return!==null&&(Ss(e,1),pu(e,1,0))}function Jc(e){for(;e===Lr;)Lr=ti[--ni],ti[ni]=null,va=ti[--ni],ti[ni]=null;for(;e===Is;)Is=dl[--sl],dl[sl]=null,ls=dl[--sl],dl[sl]=null,ns=dl[--sl],dl[sl]=null}function mu(e,t){dl[sl++]=ns,dl[sl++]=ls,dl[sl++]=Is,ns=t.id,ls=t.overflow,Is=e}var Vn=null,qt=null,st=!1,qs=null,Rl=!1,Wc=Error(c(519));function Gs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw al(Ml(t,e)),Wc}function gu(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Vt]=e,t[$e]=a,n){case"dialog":it("cancel",t),it("close",t);break;case"iframe":case"object":case"embed":it("load",t);break;case"video":case"audio":for(n=0;n<yo.length;n++)it(yo[n],t);break;case"source":it("error",t);break;case"img":case"image":case"link":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"input":it("invalid",t),Jl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":it("invalid",t);break;case"textarea":it("invalid",t),N(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Gg(t.textContent,n)?(a.popover!=null&&(it("beforetoggle",t),it("toggle",t)),a.onScroll!=null&&it("scroll",t),a.onScrollEnd!=null&&it("scrollend",t),a.onClick!=null&&(t.onclick=mt),t=!0):t=!1,t||Gs(e,!0)}function bu(e){for(Vn=e.return;Vn;)switch(Vn.tag){case 5:case 31:case 13:Rl=!1;return;case 27:case 3:Rl=!0;return;default:Vn=Vn.return}}function ja(e){if(e!==Vn)return!1;if(!st)return bu(e),st=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||ph(e.type,e.memoizedProps)),n=!n),n&&qt&&Gs(e),bu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));qt=Jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));qt=Jg(e)}else t===27?(t=qt,Si(e.type)?(e=yh,yh=null,qt=e):qt=t):qt=Vn?os(e.stateNode.nextSibling):null;return!0}function Ys(){qt=Vn=null,st=!1}function li(){var e=qs;return e!==null&&(Ul===null?Ul=e:Ul.push.apply(Ul,e),qs=null),e}function al(e){qs===null?qs=[e]:qs.push(e)}var jl=k(null),Tn=null,ss=null;function as(e,t,n){ce(jl,t._currentValue),t._currentValue=n}function is(e){e._currentValue=jl.current,V(jl)}function si(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function zr(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var x=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var D=0;D<t.length;D++)if(S.context===t[D]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),si(f.return,n,e),a||(x=null);break e}f=S.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(c(341));x.lanes|=n,f=x.alternate,f!==null&&(f.lanes|=n),si(x,n,e),x=null}else x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function ai(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var S=u.type;_l(u.pendingProps.value,x.value)||(e!==null?e.push(S):e=[S])}}else if(u===Te.current){if(x=u.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(wo):e=[wo])}u=u.return}e!==null&&zr(t,e,n,a),t.flags|=262144}function $s(e){for(e=e.firstContext;e!==null;){if(!_l(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xs(e){Tn=e,ss=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qn(e){return xu(Tn,e)}function ii(e,t){return Tn===null&&Xs(e),xu(e,t)}function xu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ss===null){if(e===null)throw Error(c(308));ss=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ss=ss.next=t;return n}var Pi=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},ri=l.unstable_scheduleCallback,ld=l.unstable_NormalPriority,dn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ur(){return{controller:new Pi,data:new Map,refCount:0}}function er(e){e.refCount--,e.refCount===0&&ri(ld,function(){e.controller.abort()})}var tr=null,Hr=0,Sa=0,ci=null;function sd(e,t){if(tr===null){var n=tr=[];Hr=0,Sa=ah(),ci={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Hr++,t.then(yu,yu),t}function yu(){if(--Hr===0&&tr!==null){ci!==null&&(ci.status="fulfilled");var e=tr;tr=null,Sa=0,ci=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pc(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),a}var eo=A.S;A.S=function(e,t){dg=Ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&sd(e,t),eo!==null&&eo(e,t)};var wa=k(null);function Vs(){var e=wa.current;return e!==null?e:Gt.pooledCache}function oi(e,t){t===null?ce(wa,wa.current):ce(wa,t.pool)}function _u(){var e=Vs();return e===null?null:{parent:dn._currentValue,pool:e}}var ka=Error(c(460)),Br=Error(c(474)),p=Error(c(542)),I={then:function(){}};function de(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ie(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mt,mt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ui(e),e;default:if(typeof t.status=="string")t.then(mt,mt);else{if(e=Gt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ui(e),e}throw Zt=t,ka}}function xt(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Zt=n,ka):n}}var Zt=null;function Dl(){if(Zt===null)throw Error(c(459));var e=Zt;return Zt=null,e}function ui(e){if(e===ka||e===p)throw Error(c(483))}var Na=null,fi=0;function ye(e){var t=fi;return fi+=1,Na===null&&(Na=[]),Ie(Na,e,t)}function Ee(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qe(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 dt(e){function t(Y,U){if(e){var Q=Y.deletions;Q===null?(Y.deletions=[U],Y.flags|=16):Q.push(U)}}function n(Y,U){if(!e)return null;for(;U!==null;)t(Y,U),U=U.sibling;return null}function a(Y){for(var U=new Map;Y!==null;)Y.key!==null?U.set(Y.key,Y):U.set(Y.index,Y),Y=Y.sibling;return U}function u(Y,U){return Y=js(Y,U),Y.index=0,Y.sibling=null,Y}function f(Y,U,Q){return Y.index=Q,e?(Q=Y.alternate,Q!==null?(Q=Q.index,Q<U?(Y.flags|=67108866,U):Q):(Y.flags|=67108866,U)):(Y.flags|=1048576,U)}function x(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function S(Y,U,Q,re){return U===null||U.tag!==6?(U=Qc(Q,Y.mode,re),U.return=Y,U):(U=u(U,Q),U.return=Y,U)}function D(Y,U,Q,re){var Ue=Q.type;return Ue===E?se(Y,U,Q.props.children,re,Q.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===B&&xt(Ue)===U.type)?(U=u(U,Q.props),Ee(U,Q),U.return=Y,U):(U=Or(Q.type,Q.key,Q.props,null,Y.mode,re),Ee(U,Q),U.return=Y,U)}function K(Y,U,Q,re){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Kc(Q,Y.mode,re),U.return=Y,U):(U=u(U,Q.children||[]),U.return=Y,U)}function se(Y,U,Q,re,Ue){return U===null||U.tag!==7?(U=_a(Q,Y.mode,re,Ue),U.return=Y,U):(U=u(U,Q),U.return=Y,U)}function oe(Y,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Qc(""+U,Y.mode,Q),U.return=Y,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case C:return Q=Or(U.type,U.key,U.props,null,Y.mode,Q),Ee(Q,U),Q.return=Y,Q;case T:return U=Kc(U,Y.mode,Q),U.return=Y,U;case B:return U=xt(U),oe(Y,U,Q)}if(Ne(U)||ue(U))return U=_a(U,Y.mode,Q,null),U.return=Y,U;if(typeof U.then=="function")return oe(Y,ye(U),Q);if(U.$$typeof===q)return oe(Y,ii(Y,U),Q);qe(Y,U)}return null}function J(Y,U,Q,re){var Ue=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:S(Y,U,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:return Q.key===Ue?D(Y,U,Q,re):null;case T:return Q.key===Ue?K(Y,U,Q,re):null;case B:return Q=xt(Q),J(Y,U,Q,re)}if(Ne(Q)||ue(Q))return Ue!==null?null:se(Y,U,Q,re,null);if(typeof Q.then=="function")return J(Y,U,ye(Q),re);if(Q.$$typeof===q)return J(Y,U,ii(Y,Q),re);qe(Y,Q)}return null}function te(Y,U,Q,re,Ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Y=Y.get(Q)||null,S(U,Y,""+re,Ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case C:return Y=Y.get(re.key===null?Q:re.key)||null,D(U,Y,re,Ue);case T:return Y=Y.get(re.key===null?Q:re.key)||null,K(U,Y,re,Ue);case B:return re=xt(re),te(Y,U,Q,re,Ue)}if(Ne(re)||ue(re))return Y=Y.get(Q)||null,se(U,Y,re,Ue,null);if(typeof re.then=="function")return te(Y,U,Q,ye(re),Ue);if(re.$$typeof===q)return te(Y,U,Q,ii(U,re),Ue);qe(U,re)}return null}function Re(Y,U,Q,re){for(var Ue=null,yt=null,Oe=U,Pe=U=0,ct=null;Oe!==null&&Pe<Q.length;Pe++){Oe.index>Pe?(ct=Oe,Oe=null):ct=Oe.sibling;var _t=J(Y,Oe,Q[Pe],re);if(_t===null){Oe===null&&(Oe=ct);break}e&&Oe&&_t.alternate===null&&t(Y,Oe),U=f(_t,U,Pe),yt===null?Ue=_t:yt.sibling=_t,yt=_t,Oe=ct}if(Pe===Q.length)return n(Y,Oe),st&&Ss(Y,Pe),Ue;if(Oe===null){for(;Pe<Q.length;Pe++)Oe=oe(Y,Q[Pe],re),Oe!==null&&(U=f(Oe,U,Pe),yt===null?Ue=Oe:yt.sibling=Oe,yt=Oe);return st&&Ss(Y,Pe),Ue}for(Oe=a(Oe);Pe<Q.length;Pe++)ct=te(Oe,Y,Pe,Q[Pe],re),ct!==null&&(e&&ct.alternate!==null&&Oe.delete(ct.key===null?Pe:ct.key),U=f(ct,U,Pe),yt===null?Ue=ct:yt.sibling=ct,yt=ct);return e&&Oe.forEach(function(Ei){return t(Y,Ei)}),st&&Ss(Y,Pe),Ue}function He(Y,U,Q,re){if(Q==null)throw Error(c(151));for(var Ue=null,yt=null,Oe=U,Pe=U=0,ct=null,_t=Q.next();Oe!==null&&!_t.done;Pe++,_t=Q.next()){Oe.index>Pe?(ct=Oe,Oe=null):ct=Oe.sibling;var Ei=J(Y,Oe,_t.value,re);if(Ei===null){Oe===null&&(Oe=ct);break}e&&Oe&&Ei.alternate===null&&t(Y,Oe),U=f(Ei,U,Pe),yt===null?Ue=Ei:yt.sibling=Ei,yt=Ei,Oe=ct}if(_t.done)return n(Y,Oe),st&&Ss(Y,Pe),Ue;if(Oe===null){for(;!_t.done;Pe++,_t=Q.next())_t=oe(Y,_t.value,re),_t!==null&&(U=f(_t,U,Pe),yt===null?Ue=_t:yt.sibling=_t,yt=_t);return st&&Ss(Y,Pe),Ue}for(Oe=a(Oe);!_t.done;Pe++,_t=Q.next())_t=te(Oe,Y,Pe,_t.value,re),_t!==null&&(e&&_t.alternate!==null&&Oe.delete(_t.key===null?Pe:_t.key),U=f(_t,U,Pe),yt===null?Ue=_t:yt.sibling=_t,yt=_t);return e&&Oe.forEach(function(m0){return t(Y,m0)}),st&&Ss(Y,Pe),Ue}function Ot(Y,U,Q,re){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:e:{for(var Ue=Q.key;U!==null;){if(U.key===Ue){if(Ue=Q.type,Ue===E){if(U.tag===7){n(Y,U.sibling),re=u(U,Q.props.children),re.return=Y,Y=re;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===B&&xt(Ue)===U.type){n(Y,U.sibling),re=u(U,Q.props),Ee(re,Q),re.return=Y,Y=re;break e}n(Y,U);break}else t(Y,U);U=U.sibling}Q.type===E?(re=_a(Q.props.children,Y.mode,re,Q.key),re.return=Y,Y=re):(re=Or(Q.type,Q.key,Q.props,null,Y.mode,re),Ee(re,Q),re.return=Y,Y=re)}return x(Y);case T:e:{for(Ue=Q.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){n(Y,U.sibling),re=u(U,Q.children||[]),re.return=Y,Y=re;break e}else{n(Y,U);break}else t(Y,U);U=U.sibling}re=Kc(Q,Y.mode,re),re.return=Y,Y=re}return x(Y);case B:return Q=xt(Q),Ot(Y,U,Q,re)}if(Ne(Q))return Re(Y,U,Q,re);if(ue(Q)){if(Ue=ue(Q),typeof Ue!="function")throw Error(c(150));return Q=Ue.call(Q),He(Y,U,Q,re)}if(typeof Q.then=="function")return Ot(Y,U,ye(Q),re);if(Q.$$typeof===q)return Ot(Y,U,ii(Y,Q),re);qe(Y,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(n(Y,U.sibling),re=u(U,Q),re.return=Y,Y=re):(n(Y,U),re=Qc(Q,Y.mode,re),re.return=Y,Y=re),x(Y)):n(Y,U)}return function(Y,U,Q,re){try{fi=0;var Ue=Ot(Y,U,Q,re);return Na=null,Ue}catch(Oe){if(Oe===ka||Oe===p)throw Oe;var yt=vl(29,Oe,null,Y.mode);return yt.lanes=re,yt.return=Y,yt}finally{}}}var ut=dt(!0),rs=dt(!1),Qs=!1;function ad(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function id(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 di(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hi(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(jt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Dr(e),Xc(e,null,n),t}return Bs(e,a,t,n),Dr(e)}function to(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ql(e,n)}}function rd(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var x={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=x:f=f.next=x,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var cd=!1;function no(){if(cd){var e=ci;if(e!==null)throw e}}function lo(e,t,n,a){cd=!1;var u=e.updateQueue;Qs=!1;var f=u.firstBaseUpdate,x=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var D=S,K=D.next;D.next=null,x===null?f=K:x.next=K,x=D;var se=e.alternate;se!==null&&(se=se.updateQueue,S=se.lastBaseUpdate,S!==x&&(S===null?se.firstBaseUpdate=K:S.next=K,se.lastBaseUpdate=D))}if(f!==null){var oe=u.baseState;x=0,se=K=D=null,S=f;do{var J=S.lane&-536870913,te=J!==S.lane;if(te?(rt&J)===J:(a&J)===J){J!==0&&J===Sa&&(cd=!0),se!==null&&(se=se.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Re=e,He=S;J=t;var Ot=n;switch(He.tag){case 1:if(Re=He.payload,typeof Re=="function"){oe=Re.call(Ot,oe,J);break e}oe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=He.payload,J=typeof Re=="function"?Re.call(Ot,oe,J):Re,J==null)break e;oe=j({},oe,J);break e;case 2:Qs=!0}}J=S.callback,J!==null&&(e.flags|=64,te&&(e.flags|=8192),te=u.callbacks,te===null?u.callbacks=[J]:te.push(J))}else te={lane:J,tag:S.tag,payload:S.payload,callback:S.callback,next:null},se===null?(K=se=te,D=oe):se=se.next=te,x|=J;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;te=S,S=te.next,te.next=null,u.lastBaseUpdate=te,u.shared.pending=null}}while(!0);se===null&&(D=oe),u.baseState=D,u.firstBaseUpdate=K,u.lastBaseUpdate=se,f===null&&(u.shared.lanes=0),xi|=x,e.lanes=x,e.memoizedState=oe}}function Up(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Hp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Up(n[e],t)}var Ir=k(null),vu=k(0);function Bp(e,t){e=La,ce(vu,e),ce(Ir,t),La=e|t.baseLanes}function od(){ce(vu,La),ce(Ir,Ir.current)}function ud(){La=vu.current,V(Ir),V(vu)}var ql=k(null),cs=null;function pi(e){var t=e.alternate;ce(En,En.current&1),ce(ql,e),cs===null&&(t===null||Ir.current!==null||t.memoizedState!==null)&&(cs=e)}function fd(e){ce(En,En.current),ce(ql,e),cs===null&&(cs=e)}function Ip(e){e.tag===22?(ce(En,En.current),ce(ql,e),cs===null&&(cs=e)):mi()}function mi(){ce(En,En.current),ce(ql,ql.current)}function Gl(e){V(ql),cs===e&&(cs=null),V(En)}var En=k(0);function ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||bh(n)||xh(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 Ta=0,We=null,Rt=null,Hn=null,Su=!1,qr=!1,nr=!1,wu=0,so=0,Gr=null,a_=0;function vn(){throw Error(c(321))}function dd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_l(e[n],t[n]))return!1;return!0}function hd(e,t,n,a,u,f){return Ta=f,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Sm:Ed,nr=!1,f=n(a,u),nr=!1,qr&&(f=Gp(t,n,a,u)),qp(e),f}function qp(e){A.H=ro;var t=Rt!==null&&Rt.next!==null;if(Ta=0,Hn=Rt=We=null,Su=!1,so=0,Gr=null,t)throw Error(c(300));e===null||Bn||(e=e.dependencies,e!==null&&$s(e)&&(Bn=!0))}function Gp(e,t,n,a){We=e;var u=0;do{if(qr&&(Gr=null),so=0,qr=!1,25<=u)throw Error(c(301));if(u+=1,Hn=Rt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=wm,f=t(n,a)}while(qr);return f}function i_(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?ao(t):t,e=e.useState()[0],(Rt!==null?Rt.memoizedState:null)!==e&&(We.flags|=1024),t}function pd(){var e=wu!==0;return wu=0,e}function md(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function gd(e){if(Su){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Su=!1}Ta=0,Hn=Rt=We=null,qr=!1,so=wu=0,Gr=null}function Sl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e,Hn}function Cn(){if(Rt===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Rt.next;var t=Hn===null?We.memoizedState:Hn.next;if(t!==null)Hn=t,Rt=e;else{if(e===null)throw We.alternate===null?Error(c(467)):Error(c(310));Rt=e,e={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e}return Hn}function ku(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ao(e){var t=so;return so+=1,Gr===null&&(Gr=[]),e=Ie(Gr,e,t),t=We,(Hn===null?t.memoizedState:Hn.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Sm:Ed),e}function Nu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ao(e);if(e.$$typeof===q)return Qn(e)}throw Error(c(438,String(e)))}function bd(e){var t=null,n=We.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=We.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ku(),We.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=he;return t.index++,n}function Ea(e,t){return typeof t=="function"?t(e):t}function Tu(e){var t=Cn();return xd(t,Rt,e)}function xd(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var x=u.next;u.next=f.next,f.next=x}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=x=null,D=null,K=t,se=!1;do{var oe=K.lane&-536870913;if(oe!==K.lane?(rt&oe)===oe:(Ta&oe)===oe){var J=K.revertLane;if(J===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),oe===Sa&&(se=!0);else if((Ta&J)===J){K=K.next,J===Sa&&(se=!0);continue}else oe={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(S=D=oe,x=f):D=D.next=oe,We.lanes|=J,xi|=J;oe=K.action,nr&&n(f,oe),f=K.hasEagerState?K.eagerState:n(f,oe)}else J={lane:oe,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(S=D=J,x=f):D=D.next=J,We.lanes|=oe,xi|=oe;K=K.next}while(K!==null&&K!==t);if(D===null?x=f:D.next=S,!_l(f,e.memoizedState)&&(Bn=!0,se&&(n=ci,n!==null)))throw n;e.memoizedState=f,e.baseState=x,e.baseQueue=D,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function yd(e){var t=Cn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var x=u=u.next;do f=e(f,x.action),x=x.next;while(x!==u);_l(f,t.memoizedState)||(Bn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function Yp(e,t,n){var a=We,u=Cn(),f=st;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var x=!_l((Rt||u).memoizedState,n);if(x&&(u.memoizedState=n,Bn=!0),u=u.queue,jd(Vp.bind(null,a,u,e),[e]),u.getSnapshot!==t||x||Hn!==null&&Hn.memoizedState.tag&1){if(a.flags|=2048,Yr(9,{destroy:void 0},Xp.bind(null,a,u,n,t),null),Gt===null)throw Error(c(349));f||(Ta&127)!==0||$p(a,t,n)}return n}function $p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t=ku(),We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xp(e,t,n,a){t.value=n,t.getSnapshot=a,Qp(t)&&Kp(e)}function Vp(e,t,n){return n(function(){Qp(t)&&Kp(e)})}function Qp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_l(e,n)}catch{return!0}}function Kp(e){var t=ya(e,2);t!==null&&Hl(t,e,2)}function _d(e){var t=Sl();if(typeof e=="function"){var n=e;if(e=n(),nr){Kt(!0);try{n()}finally{Kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:e},t}function Zp(e,t,n,a){return e.baseState=n,xd(e,Rt,typeof a=="function"?a:Ea)}function r_(e,t,n,a,u){if(Au(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){f.listeners.push(x)}};A.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Fp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Fp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=A.T,x={};A.T=x;try{var S=n(u,a),D=A.S;D!==null&&D(x,S),Jp(e,t,S)}catch(K){vd(e,t,K)}finally{f!==null&&x.types!==null&&(f.types=x.types),A.T=f}}else try{f=n(u,a),Jp(e,t,f)}catch(K){vd(e,t,K)}}function Jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Wp(e,t,a)},function(a){return vd(e,t,a)}):Wp(e,t,n)}function Wp(e,t,n){t.status="fulfilled",t.value=n,Pp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Fp(e,n)))}function vd(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Pp(t),t=t.next;while(t!==a)}e.action=null}function Pp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function em(e,t){return t}function tm(e,t){if(st){var n=Gt.formState;if(n!==null){e:{var a=We;if(st){if(qt){t:{for(var u=qt,f=Rl;u.nodeType!==8;){if(!f){u=null;break t}if(u=os(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){qt=os(u.nextSibling),a=u.data==="F!";break e}}Gs(a)}a=!1}a&&(t=n[0])}}return n=Sl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:t},n.queue=a,n=_m.bind(null,We,a),a.dispatch=n,a=_d(!1),f=Td.bind(null,We,!1,a.queue),a=Sl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=r_.bind(null,We,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function nm(e){var t=Cn();return lm(t,Rt,e)}function lm(e,t,n){if(t=xd(e,t,em)[0],e=Tu(Ea)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=ao(t)}catch(x){throw x===ka?p:x}else a=t;t=Cn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(We.flags|=2048,Yr(9,{destroy:void 0},c_.bind(null,u,n),null)),[a,f,e]}function c_(e,t){e.action=t}function sm(e){var t=Cn(),n=Rt;if(n!==null)return lm(t,n,e);Cn(),t=t.memoizedState,n=Cn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Yr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=We.updateQueue,t===null&&(t=ku(),We.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function am(){return Cn().memoizedState}function Eu(e,t,n,a){var u=Sl();We.flags|=e,u.memoizedState=Yr(1|t,{destroy:void 0},n,a===void 0?null:a)}function Cu(e,t,n,a){var u=Cn();a=a===void 0?null:a;var f=u.memoizedState.inst;Rt!==null&&a!==null&&dd(a,Rt.memoizedState.deps)?u.memoizedState=Yr(t,f,n,a):(We.flags|=e,u.memoizedState=Yr(1|t,f,n,a))}function im(e,t){Eu(8390656,8,e,t)}function jd(e,t){Cu(2048,8,e,t)}function o_(e){We.flags|=4;var t=We.updateQueue;if(t===null)t=ku(),We.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function rm(e){var t=Cn().memoizedState;return o_({ref:t,nextImpl:e}),function(){if((jt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function cm(e,t){return Cu(4,2,e,t)}function om(e,t){return Cu(4,4,e,t)}function um(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fm(e,t,n){n=n!=null?n.concat([e]):null,Cu(4,4,um.bind(null,t,e),n)}function Sd(){}function dm(e,t){var n=Cn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&dd(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function hm(e,t){var n=Cn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&dd(t,a[1]))return a[0];if(a=e(),nr){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[a,t],a}function wd(e,t,n){return n===void 0||(Ta&1073741824)!==0&&(rt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=pg(),We.lanes|=e,xi|=e,n)}function pm(e,t,n,a){return _l(n,t)?n:Ir.current!==null?(e=wd(e,n,a),_l(e,t)||(Bn=!0),e):(Ta&42)===0||(Ta&1073741824)!==0&&(rt&261930)===0?(Bn=!0,e.memoizedState=n):(e=pg(),We.lanes|=e,xi|=e,t)}function mm(e,t,n,a,u){var f=fe.p;fe.p=f!==0&&8>f?f:8;var x=A.T,S={};A.T=S,Td(e,!1,t,n);try{var D=u(),K=A.S;if(K!==null&&K(S,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var se=Pc(D,a);io(e,t,se,Xl(e))}else io(e,t,a,Xl(e))}catch(oe){io(e,t,{then:function(){},status:"rejected",reason:oe},Xl())}finally{fe.p=f,x!==null&&S.types!==null&&(x.types=S.types),A.T=x}}function u_(){}function kd(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=gm(e).queue;mm(e,u,t,z,n===null?u_:function(){return bm(e),n(a)})}function gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:z},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bm(e){var t=gm(e);t.next===null&&(t=e.alternate.memoizedState),io(e,t.next.queue,{},Xl())}function Nd(){return Qn(wo)}function xm(){return Cn().memoizedState}function ym(){return Cn().memoizedState}function f_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Xl();e=di(n);var a=hi(t,e,n);a!==null&&(Hl(a,t,n),to(a,t,n)),t={cache:Ur()},e.payload=t;return}t=t.return}}function d_(e,t,n){var a=Xl();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Au(e)?vm(t,n):(n=Rr(e,t,n,a),n!==null&&(Hl(n,e,a),jm(n,t,a)))}function _m(e,t,n){var a=Xl();io(e,t,n,a)}function io(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Au(e))vm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var x=t.lastRenderedState,S=f(x,n);if(u.hasEagerState=!0,u.eagerState=S,_l(S,x))return Bs(e,t,u,0),Gt===null&&Mr(),!1}catch{}finally{}if(n=Rr(e,t,u,a),n!==null)return Hl(n,e,a),jm(n,t,a),!0}return!1}function Td(e,t,n,a){if(a={lane:2,revertLane:ah(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Au(e)){if(t)throw Error(c(479))}else t=Rr(e,n,a,2),t!==null&&Hl(t,e,2)}function Au(e){var t=e.alternate;return e===We||t!==null&&t===We}function vm(e,t){qr=Su=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ql(e,n)}}var ro={readContext:Qn,use:Nu,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};ro.useEffectEvent=vn;var Sm={readContext:Qn,use:Nu,useCallback:function(e,t){return Sl().memoizedState=[e,t===void 0?null:t],e},useContext:Qn,useEffect:im,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Eu(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eu(4194308,4,e,t)},useInsertionEffect:function(e,t){Eu(4,2,e,t)},useMemo:function(e,t){var n=Sl();t=t===void 0?null:t;var a=e();if(nr){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Sl();if(n!==void 0){var u=n(t);if(nr){Kt(!0);try{n(t)}finally{Kt(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=d_.bind(null,We,e),[a.memoizedState,e]},useRef:function(e){var t=Sl();return e={current:e},t.memoizedState=e},useState:function(e){e=_d(e);var t=e.queue,n=_m.bind(null,We,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Sd,useDeferredValue:function(e,t){var n=Sl();return wd(n,e,t)},useTransition:function(){var e=_d(!1);return e=mm.bind(null,We,e.queue,!0,!1),Sl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=We,u=Sl();if(st){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Gt===null)throw Error(c(349));(rt&127)!==0||$p(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,im(Vp.bind(null,a,f,e),[e]),a.flags|=2048,Yr(9,{destroy:void 0},Xp.bind(null,a,f,n,t),null),n},useId:function(){var e=Sl(),t=Gt.identifierPrefix;if(st){var n=ls,a=ns;n=(a&~(1<<32-Et(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=wu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=a_++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Nd,useFormState:tm,useActionState:tm,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=Td.bind(null,We,!0,n),n.dispatch=t,[e,t]},useMemoCache:bd,useCacheRefresh:function(){return Sl().memoizedState=f_.bind(null,We)},useEffectEvent:function(e){var t=Sl(),n={impl:e};return t.memoizedState=n,function(){if((jt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Ed={readContext:Qn,use:Nu,useCallback:dm,useContext:Qn,useEffect:jd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:Tu,useRef:am,useState:function(){return Tu(Ea)},useDebugValue:Sd,useDeferredValue:function(e,t){var n=Cn();return pm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=Tu(Ea)[0],t=Cn().memoizedState;return[typeof e=="boolean"?e:ao(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:Nd,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=Cn();return Zp(n,Rt,e,t)},useMemoCache:bd,useCacheRefresh:ym};Ed.useEffectEvent=rm;var wm={readContext:Qn,use:Nu,useCallback:dm,useContext:Qn,useEffect:jd,useImperativeHandle:fm,useInsertionEffect:cm,useLayoutEffect:om,useMemo:hm,useReducer:yd,useRef:am,useState:function(){return yd(Ea)},useDebugValue:Sd,useDeferredValue:function(e,t){var n=Cn();return Rt===null?wd(n,e,t):pm(n,Rt.memoizedState,e,t)},useTransition:function(){var e=yd(Ea)[0],t=Cn().memoizedState;return[typeof e=="boolean"?e:ao(e),t]},useSyncExternalStore:Yp,useId:xm,useHostTransitionStatus:Nd,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=Cn();return Rt!==null?Zp(n,Rt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:bd,useCacheRefresh:ym};wm.useEffectEvent=rm;function Cd(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ad={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Xl(),u=di(a);u.payload=t,n!=null&&(u.callback=n),t=hi(e,u,a),t!==null&&(Hl(t,e,a),to(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Xl(),u=di(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=hi(e,u,a),t!==null&&(Hl(t,e,a),to(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),a=di(n);a.tag=2,t!=null&&(a.callback=t),t=hi(e,a,n),t!==null&&(Hl(t,e,n),to(t,e,n))}};function km(e,t,n,a,u,f,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,x):t.prototype&&t.prototype.isPureReactComponent?!es(n,a)||!es(u,f):!0}function Nm(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Ad.enqueueReplaceState(t,t.state,null)}function lr(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Tm(e){Wa(e)}function Em(e){console.error(e)}function Cm(e){Wa(e)}function Mu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Am(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Md(e,t,n){return n=di(n),n.tag=3,n.payload={element:null},n.callback=function(){Mu(e,t)},n}function Mm(e){return e=di(e),e.tag=3,e}function Rm(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){Am(t,n,a)}}var x=n.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Am(t,n,a),typeof u!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})})}function h_(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&ai(t,n,u,!0),n=ql.current,n!==null){switch(n.tag){case 31:case 13:return cs===null?Yu():n.alternate===null&&jn===0&&(jn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===I?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),nh(e,a,u)),!1;case 22:return n.flags|=65536,a===I?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),nh(e,a,u)),!1}throw Error(c(435,n.tag))}return nh(e,a,u),Yu(),!1}if(st)return t=ql.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==Wc&&(e=Error(c(422),{cause:a}),al(Ml(e,n)))):(a!==Wc&&(t=Error(c(423),{cause:a}),al(Ml(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Ml(a,n),u=Md(e.stateNode,a,u),rd(e,u),jn!==4&&(jn=2)),!1;var f=Error(c(520),{cause:a});if(f=Ml(f,n),go===null?go=[f]:go.push(f),jn!==4&&(jn=2),t===null)return!0;a=Ml(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Md(n.stateNode,a,e),rd(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"&&(yi===null||!yi.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Mm(u),Rm(u,e,n,a),rd(n,u),!1}n=n.return}while(n!==null);return!1}var Rd=Error(c(461)),Bn=!1;function il(e,t,n,a){t.child=e===null?rs(t,null,n,a):ut(t,e.child,n,a)}function Dm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var x={};for(var S in a)S!=="ref"&&(x[S]=a[S])}else x=a;return Xs(t),a=hd(e,t,n,x,f,u),S=pd(),e!==null&&!Bn?(md(e,t,u),Ca(e,t,u)):(st&&S&&Fc(t),t.flags|=1,il(e,t,a,u),t.child)}function Om(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!Vc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Lm(e,t,f,a,u)):(e=Or(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Id(e,u)){var x=f.memoizedProps;if(n=n.compare,n=n!==null?n:es,n(x,a)&&e.ref===t.ref)return Ca(e,t,u)}return t.flags|=1,e=js(f,a),e.ref=t.ref,e.return=t,t.child=e}function Lm(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(es(f,a)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=a=f,Id(e,u))(e.flags&131072)!==0&&(Bn=!0);else return t.lanes=e.lanes,Ca(e,t,u)}return Dd(e,t,n,a,u)}function zm(e,t,n,a){var u=a.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~f}else a=0,t.child=null;return Um(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oi(t,f!==null?f.cachePool:null),f!==null?Bp(t,f):od(),Ip(t);else return a=t.lanes=536870912,Um(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(oi(t,f.cachePool),Bp(t,f),mi(),t.memoizedState=null):(e!==null&&oi(t,null),od(),mi());return il(e,t,u,n),t.child}function co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Um(e,t,n,a,u){var f=Vs();return f=f===null?null:{parent:dn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&oi(t,null),od(),Ip(t),e!==null&&ai(e,t,a,!0),t.childLanes=u,null}function Ru(e,t){return t=Ou({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hm(e,t,n){return ut(t,e.child,null,n),e=Ru(t,t.pendingProps),e.flags|=2,Gl(t),t.memoizedState=null,e}function p_(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(st){if(a.mode==="hidden")return e=Ru(t,a),t.lanes=536870912,co(null,e);if(fd(t),(e=qt)?(e=Fg(e,Rl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Is!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=hu(e),n.return=t,t.child=n,Vn=t,qt=null)):e=null,e===null)throw Gs(t);return t.lanes=536870912,null}return Ru(t,a)}var f=e.memoizedState;if(f!==null){var x=f.dehydrated;if(fd(t),u)if(t.flags&256)t.flags&=-257,t=Hm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Bn||ai(e,t,n,!1),u=(n&e.childLanes)!==0,Bn||u){if(a=Gt,a!==null&&(x=ps(a,n),x!==0&&x!==f.retryLane))throw f.retryLane=x,ya(e,x),Hl(a,e,x),Rd;Yu(),t=Hm(e,t,n)}else e=f.treeContext,qt=os(x.nextSibling),Vn=t,st=!0,qs=null,Rl=!1,e!==null&&mu(t,e),t=Ru(t,a),t.flags|=4096;return t}return e=js(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Du(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 Dd(e,t,n,a,u){return Xs(t),n=hd(e,t,n,a,void 0,u),a=pd(),e!==null&&!Bn?(md(e,t,u),Ca(e,t,u)):(st&&a&&Fc(t),t.flags|=1,il(e,t,n,u),t.child)}function Bm(e,t,n,a,u,f){return Xs(t),t.updateQueue=null,n=Gp(t,a,n,u),qp(e),a=pd(),e!==null&&!Bn?(md(e,t,f),Ca(e,t,f)):(st&&a&&Fc(t),t.flags|=1,il(e,t,n,f),t.child)}function Im(e,t,n,a,u){if(Xs(t),t.stateNode===null){var f=ei,x=n.contextType;typeof x=="object"&&x!==null&&(f=Qn(x)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Ad,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},ad(t),x=n.contextType,f.context=typeof x=="object"&&x!==null?Qn(x):ei,f.state=t.memoizedState,x=n.getDerivedStateFromProps,typeof x=="function"&&(Cd(t,n,x,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(x=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),x!==f.state&&Ad.enqueueReplaceState(f,f.state,null),lo(t,a,f,u),no(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,D=lr(n,S);f.props=D;var K=f.context,se=n.contextType;x=ei,typeof se=="object"&&se!==null&&(x=Qn(se));var oe=n.getDerivedStateFromProps;se=typeof oe=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,se||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||K!==x)&&Nm(t,f,a,x),Qs=!1;var J=t.memoizedState;f.state=J,lo(t,a,f,u),no(),K=t.memoizedState,S||J!==K||Qs?(typeof oe=="function"&&(Cd(t,n,oe,a),K=t.memoizedState),(D=Qs||km(t,n,D,a,J,K,x))?(se||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=K),f.props=a,f.state=K,f.context=x,a=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,id(e,t),x=t.memoizedProps,se=lr(n,x),f.props=se,oe=t.pendingProps,J=f.context,K=n.contextType,D=ei,typeof K=="object"&&K!==null&&(D=Qn(K)),S=n.getDerivedStateFromProps,(K=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x!==oe||J!==D)&&Nm(t,f,a,D),Qs=!1,J=t.memoizedState,f.state=J,lo(t,a,f,u),no();var te=t.memoizedState;x!==oe||J!==te||Qs||e!==null&&e.dependencies!==null&&$s(e.dependencies)?(typeof S=="function"&&(Cd(t,n,S,a),te=t.memoizedState),(se=Qs||km(t,n,se,a,J,te,D)||e!==null&&e.dependencies!==null&&$s(e.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,te,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,te,D)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=te),f.props=a,f.state=te,f.context=D,a=se):(typeof f.componentDidUpdate!="function"||x===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,Du(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=ut(t,e.child,null,u),t.child=ut(t,null,n,u)):il(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ca(e,t,u),e}function qm(e,t,n,a){return Ys(),t.flags|=256,il(e,t,n,a),t.child}var Od={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ld(e){return{baseLanes:e,cachePool:_u()}}function zd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=$l),e}function Gm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,x;if((x=f)||(x=e!==null&&e.memoizedState===null?!1:(En.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(u?pi(t):mi(),(e=qt)?(e=Fg(e,Rl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Is!==null?{id:ns,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},n=hu(e),n.return=t,t.child=n,Vn=t,qt=null)):e=null,e===null)throw Gs(t);return xh(e)?t.lanes=32:t.lanes=536870912,null}var S=a.children;return a=a.fallback,u?(mi(),u=t.mode,S=Ou({mode:"hidden",children:S},u),a=_a(a,u,n,null),S.return=t,a.return=t,S.sibling=a,t.child=S,a=t.child,a.memoizedState=Ld(n),a.childLanes=zd(e,x,n),t.memoizedState=Od,co(null,a)):(pi(t),Ud(t,S))}var D=e.memoizedState;if(D!==null&&(S=D.dehydrated,S!==null)){if(f)t.flags&256?(pi(t),t.flags&=-257,t=Hd(e,t,n)):t.memoizedState!==null?(mi(),t.child=e.child,t.flags|=128,t=null):(mi(),S=a.fallback,u=t.mode,a=Ou({mode:"visible",children:a.children},u),S=_a(S,u,n,null),S.flags|=2,a.return=t,S.return=t,a.sibling=S,t.child=a,ut(t,e.child,null,n),a=t.child,a.memoizedState=Ld(n),a.childLanes=zd(e,x,n),t.memoizedState=Od,t=co(null,a));else if(pi(t),xh(S)){if(x=S.nextSibling&&S.nextSibling.dataset,x)var K=x.dgst;x=K,a=Error(c(419)),a.stack="",a.digest=x,al({value:a,source:null,stack:null}),t=Hd(e,t,n)}else if(Bn||ai(e,t,n,!1),x=(n&e.childLanes)!==0,Bn||x){if(x=Gt,x!==null&&(a=ps(x,n),a!==0&&a!==D.retryLane))throw D.retryLane=a,ya(e,a),Hl(x,e,a),Rd;bh(S)||Yu(),t=Hd(e,t,n)}else bh(S)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,qt=os(S.nextSibling),Vn=t,st=!0,qs=null,Rl=!1,e!==null&&mu(t,e),t=Ud(t,a.children),t.flags|=4096);return t}return u?(mi(),S=a.fallback,u=t.mode,D=e.child,K=D.sibling,a=js(D,{mode:"hidden",children:a.children}),a.subtreeFlags=D.subtreeFlags&65011712,K!==null?S=js(K,S):(S=_a(S,u,n,null),S.flags|=2),S.return=t,a.return=t,a.sibling=S,t.child=a,co(null,a),a=t.child,S=e.child.memoizedState,S===null?S=Ld(n):(u=S.cachePool,u!==null?(D=dn._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=_u(),S={baseLanes:S.baseLanes|n,cachePool:u}),a.memoizedState=S,a.childLanes=zd(e,x,n),t.memoizedState=Od,co(e.child,a)):(pi(t),n=e.child,e=n.sibling,n=js(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=n,t.memoizedState=null,n)}function Ud(e,t){return t=Ou({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ou(e,t){return e=vl(22,e,null,t),e.lanes=0,e}function Hd(e,t,n){return ut(t,e.child,null,n),e=Ud(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ym(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),si(e.return,t,n)}function Bd(e,t,n,a,u,f){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=a,x.tail=n,x.tailMode=u,x.treeForkCount=f)}function $m(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var x=En.current,S=(x&2)!==0;if(S?(x=x&1|2,t.flags|=128):x&=1,ce(En,x),il(e,t,a,n),a=st?va: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&&ju(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Bd(t,!1,u,n,f,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ju(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Bd(t,!0,n,null,f,a);break;case"together":Bd(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ai(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=js(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=js(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Id(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&$s(e)))}function m_(e,t,n){switch(t.tag){case 3:Tt(t,t.stateNode.containerInfo),as(t,dn,e.memoizedState.cache),Ys();break;case 27:case 5:et(t);break;case 4:Tt(t,t.stateNode.containerInfo);break;case 10:as(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,fd(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(pi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Gm(e,t,n):(pi(t),e=Ca(e,t,n),e!==null?e.sibling:null);pi(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(ai(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return $m(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ce(En,En.current),a)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:as(t,dn,e.memoizedState.cache)}return Ca(e,t,n)}function Xm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Bn=!0;else{if(!Id(e,n)&&(t.flags&128)===0)return Bn=!1,m_(e,t,n);Bn=(e.flags&131072)!==0}else Bn=!1,st&&(t.flags&1048576)!==0&&pu(t,va,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=xt(t.elementType),t.type=e,typeof e=="function")Vc(e)?(a=lr(e,a),t.tag=1,t=Im(null,t,e,a,n)):(t.tag=0,t=Dd(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===L){t.tag=11,t=Dm(null,t,e,a,n);break e}else if(u===O){t.tag=14,t=Om(null,t,e,a,n);break e}}throw t=De(e)||e,Error(c(306,t,""))}}return t;case 0:return Dd(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=lr(a,t.pendingProps),Im(e,t,a,u,n);case 3:e:{if(Tt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,id(e,t),lo(t,a,null,n);var x=t.memoizedState;if(a=x.cache,as(t,dn,a),a!==f.cache&&zr(t,[dn],n,!0),no(),a=x.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=qm(e,t,a,n);break e}else if(a!==u){u=Ml(Error(c(424)),t),al(u),t=qm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(qt=os(e.firstChild),Vn=t,st=!0,qs=null,Rl=!0,n=rs(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ys(),a===u){t=Ca(e,t,n);break e}il(e,t,a,n)}t=t.child}return t;case 26:return Du(e,t),e===null?(n=nb(t.type,null,t.pendingProps,null))?t.memoizedState=n:st||(n=t.type,e=t.pendingProps,a=Fu(Se.current).createElement(n),a[Vt]=t,a[$e]=e,rl(a,n,e),Ze(a),t.stateNode=a):t.memoizedState=nb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return et(t),e===null&&st&&(a=t.stateNode=Pg(t.type,t.pendingProps,Se.current),Vn=t,Rl=!0,u=qt,Si(t.type)?(yh=u,qt=os(a.firstChild)):qt=u),il(e,t,t.pendingProps.children,n),Du(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((u=a=qt)&&(a=X_(a,t.type,t.pendingProps,Rl),a!==null?(t.stateNode=a,Vn=t,qt=os(a.firstChild),Rl=!1,u=!0):u=!1),u||Gs(t)),et(t),u=t.type,f=t.pendingProps,x=e!==null?e.memoizedProps:null,a=f.children,ph(u,f)?a=null:x!==null&&ph(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=hd(e,t,i_,null,null,n),wo._currentValue=u),Du(e,t),il(e,t,a,n),t.child;case 6:return e===null&&st&&((e=n=qt)&&(n=V_(n,t.pendingProps,Rl),n!==null?(t.stateNode=n,Vn=t,qt=null,e=!0):e=!1),e||Gs(t)),null;case 13:return Gm(e,t,n);case 4:return Tt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ut(t,null,a,n):il(e,t,a,n),t.child;case 11:return Dm(e,t,t.type,t.pendingProps,n);case 7:return il(e,t,t.pendingProps,n),t.child;case 8:return il(e,t,t.pendingProps.children,n),t.child;case 12:return il(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,as(t,t.type,a.value),il(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,Xs(t),u=Qn(u),a=a(u),t.flags|=1,il(e,t,a,n),t.child;case 14:return Om(e,t,t.type,t.pendingProps,n);case 15:return Lm(e,t,t.type,t.pendingProps,n);case 19:return $m(e,t,n);case 31:return p_(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return Xs(t),a=Qn(dn),e===null?(u=Vs(),u===null&&(u=Gt,f=Ur(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},ad(t),as(t,dn,u)):((e.lanes&n)!==0&&(id(e,t),lo(t,null,null,n),no()),u=e.memoizedState,f=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),as(t,dn,a)):(a=f.cache,as(t,dn,a),a!==u.cache&&zr(t,[dn],n,!0))),il(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Aa(e){e.flags|=4}function qd(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(xg())e.flags|=8192;else throw Zt=I,Br}else e.flags&=-16777217}function Vm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rb(t))if(xg())e.flags|=8192;else throw Zt=I,Br}function Lu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bn():536870912,e.lanes|=t,Qr|=t)}function oo(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function g_(e,t,n){var a=t.pendingProps;switch(Jc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return Ft(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),is(dn),Ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ja(t)?Aa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,li())),Ft(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Aa(t),f!==null?(Ft(t),Vm(t,f)):(Ft(t),qd(t,u,null,a,n))):f?f!==e.memoizedState?(Aa(t),Ft(t),Vm(t,f)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Aa(t),Ft(t),qd(t,u,e,a,n)),null;case 27:if(Xe(t),n=Se.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Aa(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}e=ge.current,ja(t)?gu(t):(e=Pg(u,a,n),t.stateNode=e,Aa(t))}return Ft(t),null;case 5:if(Xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Aa(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Ft(t),null}if(f=ge.current,ja(t))gu(t);else{var x=Fu(Se.current);switch(f){case 1:f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=x.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?x.createElement("select",{is:a.is}):x.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?x.createElement(u,{is:a.is}):x.createElement(u)}}f[Vt]=t,f[$e]=a;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)f.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=f;e:switch(rl(f,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Aa(t)}}return Ft(t),qd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Aa(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=Se.current,ja(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Vn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Vt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Gg(e.nodeValue,n)),e||Gs(t,!0)}else e=Fu(e).createTextNode(a),e[Vt]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=ja(t),n!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Vt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ft(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ja(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[Vt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),u=!1}else u=li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lu(t,t.updateQueue),Ft(t),null);case 4:return Ye(),e===null&&oh(t.stateNode.containerInfo),Ft(t),null;case 10:return is(t.type),Ft(t),null;case 19:if(V(En),a=t.memoizedState,a===null)return Ft(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)oo(a,!1);else{if(jn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ju(e),f!==null){for(t.flags|=128,oo(a,!1),e=f.updateQueue,t.updateQueue=e,Lu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)du(n,e),n=n.sibling;return ce(En,En.current&1|2),st&&Ss(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ke()>Iu&&(t.flags|=128,u=!0,oo(a,!1),t.lanes=4194304)}else{if(!u)if(e=ju(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Lu(t,e),oo(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!st)return Ft(t),null}else 2*Ke()-a.renderingStartTime>Iu&&n!==536870912&&(t.flags|=128,u=!0,oo(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Ke(),e.sibling=null,n=En.current,ce(En,u?n&1|2:n&1),st&&Ss(t,a.treeForkCount),e):(Ft(t),null);case 22:case 23:return Gl(t),ud(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),n=t.updateQueue,n!==null&&Lu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&V(wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),is(dn),Ft(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function b_(e,t){switch(Jc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return is(dn),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Xe(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(c(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(En),null;case 4:return Ye(),null;case 10:return is(t.type),null;case 22:case 23:return Gl(t),ud(),e!==null&&V(wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return is(dn),null;case 25:return null;default:return null}}function Qm(e,t){switch(Jc(t),t.tag){case 3:is(dn),Ye();break;case 26:case 27:case 5:Xe(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:V(En);break;case 10:is(t.type);break;case 22:case 23:Gl(t),ud(),e!==null&&V(wa);break;case 24:is(dn)}}function uo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,x=n.inst;a=f(),x.destroy=a}n=n.next}while(n!==u)}}catch(S){At(t,t.return,S)}}function gi(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var x=a.inst,S=x.destroy;if(S!==void 0){x.destroy=void 0,u=t;var D=n,K=S;try{K()}catch(se){At(u,D,se)}}}a=a.next}while(a!==f)}}catch(se){At(t,t.return,se)}}function Km(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hp(t,n)}catch(a){At(e,e.return,a)}}}function Zm(e,t,n){n.props=lr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){At(e,t,a)}}function fo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){At(e,t,u)}}function Ks(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){At(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){At(e,t,u)}else n.current=null}function Fm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){At(e,e.return,u)}}function Gd(e,t,n){try{var a=e.stateNode;B_(a,e.type,n,t),a[$e]=t}catch(u){At(e,e.return,u)}}function Jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Si(e.type)||e.tag===4}function Yd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Si(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 $d(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mt));else if(a!==4&&(a===27&&Si(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($d(e,t,n),e=e.sibling;e!==null;)$d(e,t,n),e=e.sibling}function zu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Si(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}function Wm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);rl(t,a,n),t[Vt]=e,t[$e]=n}catch(f){At(e,e.return,f)}}var Ma=!1,In=!1,Xd=!1,Pm=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function x_(e,t){if(e=e.containerInfo,dh=lf,e=iu(e),zc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var x=0,S=-1,D=-1,K=0,se=0,oe=e,J=null;t:for(;;){for(var te;oe!==n||u!==0&&oe.nodeType!==3||(S=x+u),oe!==f||a!==0&&oe.nodeType!==3||(D=x+a),oe.nodeType===3&&(x+=oe.nodeValue.length),(te=oe.firstChild)!==null;)J=oe,oe=te;for(;;){if(oe===e)break t;if(J===n&&++K===u&&(S=x),J===f&&++se===a&&(D=x),(te=oe.nextSibling)!==null)break;oe=J,J=oe.parentNode}oe=te}n=S===-1||D===-1?null:{start:S,end:D}}else n=null}n=n||{start:0,end:0}}else n=null;for(hh={focusedElem:e,selectionRange:n},lf=!1,Fn=t;Fn!==null;)if(t=Fn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fn=e;else for(;Fn!==null;){switch(t=Fn,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,a=n.stateNode;try{var Re=lr(n.type,u);e=a.getSnapshotBeforeUpdate(Re,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(He){At(n,n.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)gh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":gh(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,Fn=e;break}Fn=t.return}}function eg(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Da(e,n),a&4&&uo(5,n);break;case 1:if(Da(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(x){At(n,n.return,x)}else{var u=lr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){At(n,n.return,x)}}a&64&&Km(n),a&512&&fo(n,n.return);break;case 3:if(Da(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Hp(e,t)}catch(x){At(n,n.return,x)}}break;case 27:t===null&&a&4&&Wm(n);case 26:case 5:Da(e,n),t===null&&a&4&&Fm(n),a&512&&fo(n,n.return);break;case 12:Da(e,n);break;case 31:Da(e,n),a&4&&lg(e,n);break;case 13:Da(e,n),a&4&&sg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=T_.bind(null,n),Q_(e,n))));break;case 22:if(a=n.memoizedState!==null||Ma,!a){t=t!==null&&t.memoizedState!==null||In,u=Ma;var f=In;Ma=a,(In=t)&&!f?Oa(e,n,(n.subtreeFlags&8772)!==0):Da(e,n),Ma=u,In=f}break;case 30:break;default:Da(e,n)}}function tg(e){var t=e.alternate;t!==null&&(e.alternate=null,tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rn=null,Ol=!1;function Ra(e,t,n){for(n=n.child;n!==null;)ng(e,t,n),n=n.sibling}function ng(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Xt,n)}catch{}switch(n.tag){case 26:In||Ks(n,t),Ra(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:In||Ks(n,t);var a=rn,u=Ol;Si(n.type)&&(rn=n.stateNode,Ol=!1),Ra(e,t,n),vo(n.stateNode),rn=a,Ol=u;break;case 5:In||Ks(n,t);case 6:if(a=rn,u=Ol,rn=null,Ra(e,t,n),rn=a,Ol=u,rn!==null)if(Ol)try{(rn.nodeType===9?rn.body:rn.nodeName==="HTML"?rn.ownerDocument.body:rn).removeChild(n.stateNode)}catch(f){At(n,t,f)}else try{rn.removeChild(n.stateNode)}catch(f){At(n,t,f)}break;case 18:rn!==null&&(Ol?(e=rn,Kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),tc(e)):Kg(rn,n.stateNode));break;case 4:a=rn,u=Ol,rn=n.stateNode.containerInfo,Ol=!0,Ra(e,t,n),rn=a,Ol=u;break;case 0:case 11:case 14:case 15:gi(2,n,t),In||gi(4,n,t),Ra(e,t,n);break;case 1:In||(Ks(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Zm(n,t,a)),Ra(e,t,n);break;case 21:Ra(e,t,n);break;case 22:In=(a=In)||n.memoizedState!==null,Ra(e,t,n),In=a;break;default:Ra(e,t,n)}}function lg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{tc(e)}catch(n){At(t,t.return,n)}}}function sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{tc(e)}catch(n){At(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 Pm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pm),t;default:throw Error(c(435,e.tag))}}function Uu(e,t){var n=y_(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=E_.bind(null,e,a);a.then(u,u)}})}function Ll(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,x=t,S=x;e:for(;S!==null;){switch(S.tag){case 27:if(Si(S.type)){rn=S.stateNode,Ol=!1;break e}break;case 5:rn=S.stateNode,Ol=!1;break e;case 3:case 4:rn=S.stateNode.containerInfo,Ol=!0;break e}S=S.return}if(rn===null)throw Error(c(160));ng(f,x,u),rn=null,Ol=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ag(t,e),t=t.sibling}var ws=null;function ag(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ll(t,e),zl(e),a&4&&(gi(3,e,e.return),uo(3,e),gi(5,e,e.return));break;case 1:Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),a&64&&Ma&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var u=ws;if(Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),a&4){var f=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(a){case"title":f=u.getElementsByTagName("title")[0],(!f||f[el]||f[Vt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),rl(f,a,n),f[Vt]=e,Ze(f),a=f;break e;case"link":var x=ab("link","href",u).get(a+(n.href||""));if(x){for(var S=0;S<x.length;S++)if(f=x[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)){x.splice(S,1);break t}}f=u.createElement(a),rl(f,a,n),u.head.appendChild(f);break;case"meta":if(x=ab("meta","content",u).get(a+(n.content||""))){for(S=0;S<x.length;S++)if(f=x[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)){x.splice(S,1);break t}}f=u.createElement(a),rl(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Vt]=e,Ze(f),a=f}e.stateNode=a}else ib(u,e.type,e.stateNode);else e.stateNode=sb(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?ib(u,e.type,e.stateNode):sb(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Gd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),n!==null&&a&4&&Gd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ll(t,e),zl(e),a&512&&(In||n===null||Ks(n,n.return)),e.flags&32){u=e.stateNode;try{$(u,"")}catch(Re){At(e,e.return,Re)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Gd(e,u,n!==null?n.memoizedProps:u)),a&1024&&(Xd=!0);break;case 6:if(Ll(t,e),zl(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Re){At(e,e.return,Re)}}break;case 3:if(Pu=null,u=ws,ws=Ju(t.containerInfo),Ll(t,e),ws=u,zl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{tc(t.containerInfo)}catch(Re){At(e,e.return,Re)}Xd&&(Xd=!1,ig(e));break;case 4:a=ws,ws=Ju(e.stateNode.containerInfo),Ll(t,e),zl(e),ws=a;break;case 12:Ll(t,e),zl(e);break;case 31:Ll(t,e),zl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Uu(e,a)));break;case 13:Ll(t,e),zl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Bu=Ke()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Uu(e,a)));break;case 22:u=e.memoizedState!==null;var D=n!==null&&n.memoizedState!==null,K=Ma,se=In;if(Ma=K||u,In=se||D,Ll(t,e),In=se,Ma=K,zl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||D||Ma||In||sr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){D=n=t;try{if(f=D.stateNode,u)x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{S=D.stateNode;var oe=D.memoizedProps.style,J=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;S.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Re){At(D,D.return,Re)}}}else if(t.tag===6){if(n===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(Re){At(D,D.return,Re)}}}else if(t.tag===18){if(n===null){D=t;try{var te=D.stateNode;u?Zg(te,!0):Zg(D.stateNode,!1)}catch(Re){At(D,D.return,Re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Uu(e,n))));break;case 19:Ll(t,e),zl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Uu(e,a)));break;case 30:break;case 21:break;default:Ll(t,e),zl(e)}}function zl(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Jm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Yd(e);zu(e,f,u);break;case 5:var x=n.stateNode;n.flags&32&&($(x,""),n.flags&=-33);var S=Yd(e);zu(e,S,x);break;case 3:case 4:var D=n.stateNode.containerInfo,K=Yd(e);$d(e,K,D);break;default:throw Error(c(161))}}catch(se){At(e,e.return,se)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ig(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ig(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Da(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)eg(e,t.alternate,t),t=t.sibling}function sr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:gi(4,t,t.return),sr(t);break;case 1:Ks(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Zm(t,t.return,n),sr(t);break;case 27:vo(t.stateNode);case 26:case 5:Ks(t,t.return),sr(t);break;case 22:t.memoizedState===null&&sr(t);break;case 30:sr(t);break;default:sr(t)}e=e.sibling}}function Oa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,x=f.flags;switch(f.tag){case 0:case 11:case 15:Oa(u,f,n),uo(4,f);break;case 1:if(Oa(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(K){At(a,a.return,K)}if(a=f,u=a.updateQueue,u!==null){var S=a.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)Up(D[u],S)}catch(K){At(a,a.return,K)}}n&&x&64&&Km(f),fo(f,f.return);break;case 27:Wm(f);case 26:case 5:Oa(u,f,n),n&&a===null&&x&4&&Fm(f),fo(f,f.return);break;case 12:Oa(u,f,n);break;case 31:Oa(u,f,n),n&&x&4&&lg(u,f);break;case 13:Oa(u,f,n),n&&x&4&&sg(u,f);break;case 22:f.memoizedState===null&&Oa(u,f,n),fo(f,f.return);break;case 30:break;default:Oa(u,f,n)}t=t.sibling}}function Vd(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&&er(n))}function Qd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&er(e))}function ks(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rg(e,t,n,a),t=t.sibling}function rg(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ks(e,t,n,a),u&2048&&uo(9,t);break;case 1:ks(e,t,n,a);break;case 3:ks(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&er(e)));break;case 12:if(u&2048){ks(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,x=f.id,S=f.onPostCommit;typeof S=="function"&&S(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){At(t,t.return,D)}}else ks(e,t,n,a);break;case 31:ks(e,t,n,a);break;case 13:ks(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?f._visibility&2?ks(e,t,n,a):ho(e,t):f._visibility&2?ks(e,t,n,a):(f._visibility|=2,$r(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Vd(x,t);break;case 24:ks(e,t,n,a),u&2048&&Qd(t.alternate,t);break;default:ks(e,t,n,a)}}function $r(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,x=t,S=n,D=a,K=x.flags;switch(x.tag){case 0:case 11:case 15:$r(f,x,S,D,u),uo(8,x);break;case 23:break;case 22:var se=x.stateNode;x.memoizedState!==null?se._visibility&2?$r(f,x,S,D,u):ho(f,x):(se._visibility|=2,$r(f,x,S,D,u)),u&&K&2048&&Vd(x.alternate,x);break;case 24:$r(f,x,S,D,u),u&&K&2048&&Qd(x.alternate,x);break;default:$r(f,x,S,D,u)}t=t.sibling}}function ho(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:ho(n,a),u&2048&&Vd(a.alternate,a);break;case 24:ho(n,a),u&2048&&Qd(a.alternate,a);break;default:ho(n,a)}t=t.sibling}}var po=8192;function Xr(e,t,n){if(e.subtreeFlags&po)for(e=e.child;e!==null;)cg(e,t,n),e=e.sibling}function cg(e,t,n){switch(e.tag){case 26:Xr(e,t,n),e.flags&po&&e.memoizedState!==null&&a0(n,ws,e.memoizedState,e.memoizedProps);break;case 5:Xr(e,t,n);break;case 3:case 4:var a=ws;ws=Ju(e.stateNode.containerInfo),Xr(e,t,n),ws=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=po,po=16777216,Xr(e,t,n),po=a):Xr(e,t,n));break;default:Xr(e,t,n)}}function og(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function mo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fn=a,fg(a,e)}og(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ug(e),e=e.sibling}function ug(e){switch(e.tag){case 0:case 11:case 15:mo(e),e.flags&2048&&gi(9,e,e.return);break;case 3:mo(e);break;case 12:mo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hu(e)):mo(e);break;default:mo(e)}}function Hu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fn=a,fg(a,e)}og(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gi(8,t,t.return),Hu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hu(t));break;default:Hu(t)}e=e.sibling}}function fg(e,t){for(;Fn!==null;){var n=Fn;switch(n.tag){case 0:case 11:case 15:gi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:er(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Fn=a;else e:for(n=e;Fn!==null;){a=Fn;var u=a.sibling,f=a.return;if(tg(a),a===n){Fn=null;break e}if(u!==null){u.return=f,Fn=u;break e}Fn=f}}}var __={getCacheForType:function(e){var t=Qn(dn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qn(dn).controller.signal}},v_=typeof WeakMap=="function"?WeakMap:Map,jt=0,Gt=null,at=null,rt=0,Ct=0,Yl=null,bi=!1,Vr=!1,Kd=!1,La=0,jn=0,xi=0,ar=0,Zd=0,$l=0,Qr=0,go=null,Ul=null,Fd=!1,Bu=0,dg=0,Iu=1/0,qu=null,yi=null,Kn=0,_i=null,Kr=null,za=0,Jd=0,Wd=null,hg=null,bo=0,Pd=null;function Xl(){return(jt&2)!==0&&rt!==0?rt&-rt:A.T!==null?ah():Kl()}function pg(){if($l===0)if((rt&536870912)===0||st){var e=H;H<<=1,(H&3932160)===0&&(H=262144),$l=e}else $l=536870912;return e=ql.current,e!==null&&(e.flags|=32),$l}function Hl(e,t,n){(e===Gt&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)&&(Zr(e,0),vi(e,rt,$l,!1)),ul(e,n),((jt&2)===0||e!==Gt)&&(e===Gt&&((jt&2)===0&&(ar|=n),jn===4&&vi(e,rt,$l,!1)),Zs(e))}function mg(e,t,n){if((jt&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||gt(e,t),u=a?w_(e,t):th(e,t,!0),f=a;do{if(u===0){Vr&&!a&&vi(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!j_(n)){u=th(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var S=e;u=go;var D=S.current.memoizedState.isDehydrated;if(D&&(Zr(S,x).flags|=256),x=th(S,x,!1),x!==2){if(Kd&&!D){S.errorRecoveryDisabledLanes|=f,ar|=f,u=4;break e}f=Ul,Ul=u,f!==null&&(Ul===null?Ul=f:Ul.push.apply(Ul,f))}u=x}if(f=!1,u!==2)continue}}if(u===1){Zr(e,0),vi(e,t,0,!0);break}e:{switch(a=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:vi(a,t,$l,!bi);break e;case 2:Ul=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Bu+300-Ke(),10<u)){if(vi(a,t,$l,!bi),Be(a,0,!0)!==0)break e;za=t,a.timeoutHandle=Vg(gg.bind(null,a,n,Ul,qu,Fd,t,$l,ar,Qr,bi,f,"Throttled",-0,0),u);break e}gg(a,n,Ul,qu,Fd,t,$l,ar,Qr,bi,f,null,-0,0)}}break}while(!0);Zs(e)}function gg(e,t,n,a,u,f,x,S,D,K,se,oe,J,te){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mt},cg(t,f,oe);var Re=(f&62914560)===f?Bu-Ke():(f&4194048)===f?dg-Ke():0;if(Re=i0(oe,Re),Re!==null){za=f,e.cancelPendingCommit=Re(wg.bind(null,e,t,f,n,a,u,x,S,D,se,oe,null,J,te)),vi(e,f,x,!K);return}}wg(e,t,f,n,a,u,x,S,D)}function j_(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],f=u.getSnapshot;u=u.value;try{if(!_l(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 vi(e,t,n,a){t&=~Zd,t&=~ar,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-Et(u),x=1<<f;a[f]=-1,u&=~x}n!==0&&ca(e,n,t)}function Gu(){return(jt&6)===0?(xo(0),!1):!0}function eh(){if(at!==null){if(Ct===0)var e=at.return;else e=at,ss=Tn=null,gd(e),Na=null,fi=0,e=at;for(;e!==null;)Qm(e.alternate,e),e=e.return;at=null}}function Zr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,G_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),za=0,eh(),Gt=e,at=n=js(e.current,null),rt=t,Ct=0,Yl=null,bi=!1,Vr=gt(e,t),Kd=!1,Qr=$l=Zd=ar=xi=jn=0,Ul=go=null,Fd=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-Et(a),f=1<<u;t|=e[u],a&=~f}return La=t,Mr(),n}function bg(e,t){We=null,A.H=ro,t===ka||t===p?(t=Dl(),Ct=3):t===Br?(t=Dl(),Ct=4):Ct=t===Rd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yl=t,at===null&&(jn=1,Mu(e,Ml(t,e.current)))}function xg(){var e=ql.current;return e===null?!0:(rt&4194048)===rt?cs===null:(rt&62914560)===rt||(rt&536870912)!==0?e===cs:!1}function yg(){var e=A.H;return A.H=ro,e===null?ro:e}function _g(){var e=A.A;return A.A=__,e}function Yu(){jn=4,bi||(rt&4194048)!==rt&&ql.current!==null||(Vr=!0),(xi&134217727)===0&&(ar&134217727)===0||Gt===null||vi(Gt,rt,$l,!1)}function th(e,t,n){var a=jt;jt|=2;var u=yg(),f=_g();(Gt!==e||rt!==t)&&(qu=null,Zr(e,t)),t=!1;var x=jn;e:do try{if(Ct!==0&&at!==null){var S=at,D=Yl;switch(Ct){case 8:eh(),x=6;break e;case 3:case 2:case 9:case 6:ql.current===null&&(t=!0);var K=Ct;if(Ct=0,Yl=null,Fr(e,S,D,K),n&&Vr){x=0;break e}break;default:K=Ct,Ct=0,Yl=null,Fr(e,S,D,K)}}S_(),x=jn;break}catch(se){bg(e,se)}while(!0);return t&&e.shellSuspendCounter++,ss=Tn=null,jt=a,A.H=u,A.A=f,at===null&&(Gt=null,rt=0,Mr()),x}function S_(){for(;at!==null;)vg(at)}function w_(e,t){var n=jt;jt|=2;var a=yg(),u=_g();Gt!==e||rt!==t?(qu=null,Iu=Ke()+500,Zr(e,t)):Vr=gt(e,t);e:do try{if(Ct!==0&&at!==null){t=at;var f=Yl;t:switch(Ct){case 1:Ct=0,Yl=null,Fr(e,t,f,1);break;case 2:case 9:if(de(f)){Ct=0,Yl=null,jg(t);break}t=function(){Ct!==2&&Ct!==9||Gt!==e||(Ct=7),Zs(e)},f.then(t,t);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:de(f)?(Ct=0,Yl=null,jg(t)):(Ct=0,Yl=null,Fr(e,t,f,7));break;case 5:var x=null;switch(at.tag){case 26:x=at.memoizedState;case 5:case 27:var S=at;if(x?rb(x):S.stateNode.complete){Ct=0,Yl=null;var D=S.sibling;if(D!==null)at=D;else{var K=S.return;K!==null?(at=K,$u(K)):at=null}break t}}Ct=0,Yl=null,Fr(e,t,f,5);break;case 6:Ct=0,Yl=null,Fr(e,t,f,6);break;case 8:eh(),jn=6;break e;default:throw Error(c(462))}}k_();break}catch(se){bg(e,se)}while(!0);return ss=Tn=null,A.H=a,A.A=u,jt=n,at!==null?0:(Gt=null,rt=0,Mr(),jn)}function k_(){for(;at!==null&&!mn();)vg(at)}function vg(e){var t=Xm(e.alternate,e,La);e.memoizedProps=e.pendingProps,t===null?$u(e):at=t}function jg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bm(n,t,t.pendingProps,t.type,void 0,rt);break;case 11:t=Bm(n,t,t.pendingProps,t.type.render,t.ref,rt);break;case 5:gd(t);default:Qm(n,t),t=at=du(t,La),t=Xm(n,t,La)}e.memoizedProps=e.pendingProps,t===null?$u(e):at=t}function Fr(e,t,n,a){ss=Tn=null,gd(t),Na=null,fi=0;var u=t.return;try{if(h_(e,u,t,n,rt)){jn=1,Mu(e,Ml(n,e.current)),at=null;return}}catch(f){if(u!==null)throw at=u,f;jn=1,Mu(e,Ml(n,e.current)),at=null;return}t.flags&32768?(st||a===1?e=!0:Vr||(rt&536870912)!==0?e=!1:(bi=e=!0,(a===2||a===9||a===3||a===6)&&(a=ql.current,a!==null&&a.tag===13&&(a.flags|=16384))),Sg(t,e)):$u(t)}function $u(e){var t=e;do{if((t.flags&32768)!==0){Sg(t,bi);return}e=t.return;var n=g_(t.alternate,t,La);if(n!==null){at=n;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);jn===0&&(jn=5)}function Sg(e,t){do{var n=b_(e.alternate,e);if(n!==null){n.flags&=32767,at=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){at=e;return}at=e=n}while(e!==null);jn=6,at=null}function wg(e,t,n,a,u,f,x,S,D){e.cancelPendingCommit=null;do Xu();while(Kn!==0);if((jt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=$c,gl(e,n,f,x,S,D),e===Gt&&(at=Gt=null,rt=0),Kr=t,_i=e,za=n,Jd=f,Wd=u,hg=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,C_(Je,function(){return Cg(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null,u=fe.p,fe.p=2,x=jt,jt|=4;try{x_(e,t,n)}finally{jt=x,fe.p=u,A.T=a}}Kn=1,kg(),Ng(),Tg()}}function kg(){if(Kn===1){Kn=0;var e=_i,t=Kr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var a=fe.p;fe.p=2;var u=jt;jt|=4;try{ag(t,e);var f=hh,x=iu(e.containerInfo),S=f.focusedElem,D=f.selectionRange;if(x!==S&&S&&S.ownerDocument&&au(S.ownerDocument.documentElement,S)){if(D!==null&&zc(S)){var K=D.start,se=D.end;if(se===void 0&&(se=K),"selectionStart"in S)S.selectionStart=K,S.selectionEnd=Math.min(se,S.value.length);else{var oe=S.ownerDocument||document,J=oe&&oe.defaultView||window;if(J.getSelection){var te=J.getSelection(),Re=S.textContent.length,He=Math.min(D.start,Re),Ot=D.end===void 0?He:Math.min(D.end,Re);!te.extend&&He>Ot&&(x=Ot,Ot=He,He=x);var Y=su(S,He),U=su(S,Ot);if(Y&&U&&(te.rangeCount!==1||te.anchorNode!==Y.node||te.anchorOffset!==Y.offset||te.focusNode!==U.node||te.focusOffset!==U.offset)){var Q=oe.createRange();Q.setStart(Y.node,Y.offset),te.removeAllRanges(),He>Ot?(te.addRange(Q),te.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),te.addRange(Q))}}}}for(oe=[],te=S;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<oe.length;S++){var re=oe[S];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}lf=!!dh,hh=dh=null}finally{jt=u,fe.p=a,A.T=n}}e.current=t,Kn=2}}function Ng(){if(Kn===2){Kn=0;var e=_i,t=Kr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var a=fe.p;fe.p=2;var u=jt;jt|=4;try{eg(e,t.alternate,t)}finally{jt=u,fe.p=a,A.T=n}}Kn=3}}function Tg(){if(Kn===4||Kn===3){Kn=0,cn();var e=_i,t=Kr,n=za,a=hg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Kn=5:(Kn=0,Kr=_i=null,Eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(yi=null),Dn(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=A.T,u=fe.p,fe.p=2,A.T=null;try{for(var f=e.onRecoverableError,x=0;x<a.length;x++){var S=a[x];f(S.value,{componentStack:S.stack})}}finally{A.T=t,fe.p=u}}(za&3)!==0&&Xu(),Zs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Pd?bo++:(bo=0,Pd=e):bo=0,xo(0)}}function Eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,er(t)))}function Xu(){return kg(),Ng(),Tg(),Cg()}function Cg(){if(Kn!==5)return!1;var e=_i,t=Jd;Jd=0;var n=Dn(za),a=A.T,u=fe.p;try{fe.p=32>n?32:n,A.T=null,n=Wd,Wd=null;var f=_i,x=za;if(Kn=0,Kr=_i=null,za=0,(jt&6)!==0)throw Error(c(331));var S=jt;if(jt|=4,ug(f.current),rg(f,f.current,x,n),jt=S,xo(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Xt,f)}catch{}return!0}finally{fe.p=u,A.T=a,Eg(e,t)}}function Ag(e,t,n){t=Ml(n,t),t=Md(e.stateNode,t,2),e=hi(e,t,2),e!==null&&(ul(e,2),Zs(e))}function At(e,t,n){if(e.tag===3)Ag(e,e,n);else for(;t!==null;){if(t.tag===3){Ag(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(yi===null||!yi.has(a))){e=Ml(n,e),n=Mm(2),a=hi(t,n,2),a!==null&&(Rm(n,a,t,e),ul(a,2),Zs(a));break}}t=t.return}}function nh(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new v_;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(Kd=!0,u.add(n),e=N_.bind(null,e,t,n),t.then(e,e))}function N_(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gt===e&&(rt&n)===n&&(jn===4||jn===3&&(rt&62914560)===rt&&300>Ke()-Bu?(jt&2)===0&&Zr(e,0):Zd|=n,Qr===rt&&(Qr=0)),Zs(e)}function Mg(e,t){t===0&&(t=bn()),e=ya(e,t),e!==null&&(ul(e,t),Zs(e))}function T_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mg(e,n)}function E_(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),Mg(e,n)}function C_(e,t){return pn(e,t)}var Vu=null,Jr=null,lh=!1,Qu=!1,sh=!1,ji=0;function Zs(e){e!==Jr&&e.next===null&&(Jr===null?Vu=Jr=e:Jr=Jr.next=e),Qu=!0,lh||(lh=!0,M_())}function xo(e,t){if(!sh&&Qu){sh=!0;do for(var n=!1,a=Vu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var x=a.suspendedLanes,S=a.pingedLanes;f=(1<<31-Et(42|e)+1)-1,f&=u&~(x&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Lg(a,f))}else f=rt,f=Be(a,a===Gt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||gt(a,f)||(n=!0,Lg(a,f));a=a.next}while(n);sh=!1}}function A_(){Rg()}function Rg(){Qu=lh=!1;var e=0;ji!==0&&q_()&&(e=ji);for(var t=Ke(),n=null,a=Vu;a!==null;){var u=a.next,f=Dg(a,t);f===0?(a.next=null,n===null?Vu=u:n.next=u,u===null&&(Jr=n)):(n=a,(e!==0||(f&3)!==0)&&(Qu=!0)),a=u}Kn!==0&&Kn!==5||xo(e),ji!==0&&(ji=0)}function Dg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var x=31-Et(f),S=1<<x,D=u[x];D===-1?((S&n)===0||(S&a)!==0)&&(u[x]=Mn(S,t)):D<=t&&(e.expiredLanes|=S),f&=~S}if(t=Gt,n=rt,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ct===2||Ct===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Sn(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||gt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Sn(a),Dn(n)){case 2:case 8:n=ft;break;case 32:n=Je;break;case 268435456:n=on;break;default:n=Je}return a=Og.bind(null,e),n=pn(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Sn(a),e.callbackPriority=2,e.callbackNode=null,2}function Og(e,t){if(Kn!==0&&Kn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var a=rt;return a=Be(e,e===Gt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(mg(e,a,t),Dg(e,Ke()),e.callbackNode!=null&&e.callbackNode===n?Og.bind(null,e):null)}function Lg(e,t){if(Xu())return null;mg(e,t,!0)}function M_(){Y_(function(){(jt&6)!==0?pn(gn,A_):Rg()})}function ah(){if(ji===0){var e=Sa;e===0&&(e=Le,Le<<=1,(Le&261888)===0&&(Le=256)),ji=e}return ji}function zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Mt(""+e)}function Ug(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function R_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=zg((u[$e]||null).action),x=a.submitter;x&&(t=(t=x[$e]||null)?zg(t.formAction):x.getAttribute("formAction"),t!==null&&(f=t,x=null));var S=new Ls("action","action",null,a,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ji!==0){var D=x?Ug(u,x):new FormData(u);kd(n,{pending:!0,data:D,method:u.method,action:f},null,D)}}else typeof f=="function"&&(S.preventDefault(),D=x?Ug(u,x):new FormData(u),kd(n,{pending:!0,data:D,method:u.method,action:f},f,D))},currentTarget:u}]})}}for(var ih=0;ih<Yc.length;ih++){var rh=Yc[ih],D_=rh.toLowerCase(),O_=rh[0].toUpperCase()+rh.slice(1);Cl(D_,"on"+O_)}Cl(ou,"onAnimationEnd"),Cl(Bc,"onAnimationIteration"),Cl(Ic,"onAnimationStart"),Cl("dblclick","onDoubleClick"),Cl("focusin","onFocus"),Cl("focusout","onBlur"),Cl(uu,"onTransitionRun"),Cl(fu,"onTransitionStart"),Cl(td,"onTransitionCancel"),Cl(qc,"onTransitionEnd"),Nn("onMouseEnter",["mouseout","mouseover"]),Nn("onMouseLeave",["mouseout","mouseover"]),Nn("onPointerEnter",["pointerout","pointerover"]),Nn("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yo="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(" "),L_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yo));function Hg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var x=a.length-1;0<=x;x--){var S=a[x],D=S.instance,K=S.currentTarget;if(S=S.listener,D!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=K;try{f(u)}catch(se){Wa(se)}u.currentTarget=null,f=D}else for(x=0;x<a.length;x++){if(S=a[x],D=S.instance,K=S.currentTarget,S=S.listener,D!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=K;try{f(u)}catch(se){Wa(se)}u.currentTarget=null,f=D}}}}function it(e,t){var n=t[xl];n===void 0&&(n=t[xl]=new Set);var a=e+"__bubble";n.has(a)||(Bg(t,e,2,!1),n.add(a))}function ch(e,t,n){var a=0;t&&(a|=4),Bg(n,e,a,t)}var Ku="_reactListening"+Math.random().toString(36).slice(2);function oh(e){if(!e[Ku]){e[Ku]=!0,On.forEach(function(n){n!=="selectionchange"&&(L_.has(n)||ch(n,!1,e),ch(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ku]||(t[Ku]=!0,ch("selectionchange",!1,t))}}function Bg(e,t,n,a){switch(pb(t)){case 2:var u=o0;break;case 8:u=u0;break;default:u=wh}n=u.bind(null,t,n,e),u=void 0,!xs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function uh(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var x=a.tag;if(x===3||x===4){var S=a.stateNode.containerInfo;if(S===u)break;if(x===4)for(x=a.return;x!==null;){var D=x.tag;if((D===3||D===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;S!==null;){if(x=Tl(S),x===null)return;if(D=x.tag,D===5||D===6||D===26||D===27){a=f=x;continue e}S=S.parentNode}}a=a.return}Me(function(){var K=f,se=It(n),oe=[];e:{var J=Gc.get(e);if(J!==void 0){var te=Ls,Re=e;switch(e){case"keypress":if(Gi(n)===0)break e;case"keydown":case"keyup":te=Ac;break;case"focusin":Re="focus",te=Cc;break;case"focusout":Re="blur",te=Cc;break;case"beforeblur":case"afterblur":te=Cc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Xa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=wr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Er;break;case ou:case Bc:case Ic:te=kr;break;case qc:te=Vi;break;case"scroll":case"scrollend":te=Sr;break;case"wheel":te=Fo;break;case"copy":case"cut":case"paste":te=Nr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Zo;break;case"toggle":case"beforetoggle":te=Jo}var He=(t&4)!==0,Ot=!He&&(e==="scroll"||e==="scrollend"),Y=He?J!==null?J+"Capture":null:J;He=[];for(var U=K,Q;U!==null;){var re=U;if(Q=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Q===null||Y===null||(re=Fe(U,Y),re!=null&&He.push(_o(U,re,Q))),Ot)break;U=U.return}0<He.length&&(J=new te(J,Re,null,n,se),oe.push({event:J,listeners:He}))}}if((t&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",J&&n!==fn&&(Re=n.relatedTarget||n.fromElement)&&(Tl(Re)||Re[vt]))break e;if((te||J)&&(J=se.window===se?se:(J=se.ownerDocument)?J.defaultView||J.parentWindow:window,te?(Re=n.relatedTarget||n.toElement,te=K,Re=Re?Tl(Re):null,Re!==null&&(Ot=d(Re),He=Re.tag,Re!==Ot||He!==5&&He!==27&&He!==6)&&(Re=null)):(te=null,Re=K),te!==Re)){if(He=Xa,re="onMouseLeave",Y="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(He=Zo,re="onPointerLeave",Y="onPointerEnter",U="pointer"),Ot=te==null?J:kn(te),Q=Re==null?J:kn(Re),J=new He(re,U+"leave",te,n,se),J.target=Ot,J.relatedTarget=Q,re=null,Tl(se)===K&&(He=new He(Y,U+"enter",Re,n,se),He.target=Q,He.relatedTarget=Ot,re=He),Ot=re,te&&Re)t:{for(He=z_,Y=te,U=Re,Q=0,re=Y;re;re=He(re))Q++;re=0;for(var Ue=U;Ue;Ue=He(Ue))re++;for(;0<Q-re;)Y=He(Y),Q--;for(;0<re-Q;)U=He(U),re--;for(;Q--;){if(Y===U||U!==null&&Y===U.alternate){He=Y;break t}Y=He(Y),U=He(U)}He=null}else He=null;te!==null&&Ig(oe,J,te,He,!1),Re!==null&&Ot!==null&&Ig(oe,Ot,Re,He,!0)}}e:{if(J=K?kn(K):window,te=J.nodeName&&J.nodeName.toLowerCase(),te==="select"||te==="input"&&J.type==="file")var yt=tu;else if(Za(J))if(X)yt=Wf;else{yt=Ff;var Oe=Fa}else te=J.nodeName,!te||te.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?K&&ze(K.elementType)&&(yt=tu):yt=Jf;if(yt&&(yt=yt(e,K))){eu(oe,yt,n,se);break e}Oe&&Oe(e,J,K),e==="focusout"&&K&&J.type==="number"&&K.memoizedProps.value!=null&&sn(J,"number",J.value)}switch(Oe=K?kn(K):window,e){case"focusin":(Za(Oe)||Oe.contentEditable==="true")&&(Ja=Oe,Uc=K,Ji=null);break;case"focusout":Ji=Uc=Ja=null;break;case"mousedown":Wi=!0;break;case"contextmenu":case"mouseup":case"dragend":Wi=!1,ru(oe,n,se);break;case"selectionchange":if(ed)break;case"keydown":case"keyup":ru(oe,n,se)}var Pe;if(Il)e:{switch(e){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else vs?Rc(e,n)&&(ct="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ct="onCompositionStart");ct&&(Ki&&n.locale!=="ko"&&(vs||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&vs&&(Pe=jr()):(Os=se,qi="value"in Os?Os.value:Os.textContent,vs=!0)),Oe=Zu(K,ct),0<Oe.length&&(ct=new $i(ct,e,null,n,se),oe.push({event:ct,listeners:Oe}),Pe?ct.data=Pe:(Pe=Ka(n),Pe!==null&&(ct.data=Pe)))),(Pe=Cr?Zi(e,n):Fi(e,n))&&(ct=Zu(K,"onBeforeInput"),0<ct.length&&(Oe=new $i("onBeforeInput","beforeinput",null,n,se),oe.push({event:Oe,listeners:ct}),Oe.data=Pe)),R_(oe,e,K,n,se)}Hg(oe,t)})}function _o(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zu(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Fe(e,n),u!=null&&a.unshift(_o(e,u,f)),u=Fe(e,t),u!=null&&a.push(_o(e,u,f))),e.tag===3)return a;e=e.return}return[]}function z_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ig(e,t,n,a,u){for(var f=t._reactName,x=[];n!==null&&n!==a;){var S=n,D=S.alternate,K=S.stateNode;if(S=S.tag,D!==null&&D===a)break;S!==5&&S!==26&&S!==27||K===null||(D=K,u?(K=Fe(n,f),K!=null&&x.unshift(_o(n,K,D))):u||(K=Fe(n,f),K!=null&&x.push(_o(n,K,D)))),n=n.return}x.length!==0&&e.push({event:t,listeners:x})}var U_=/\r\n?/g,H_=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(U_,`
50
+ `).replace(H_,"")}function Gg(e,t){return t=qg(t),qg(e)===t}function Dt(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||$(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&$(e,""+a);break;case"className":nl(e,"class",a);break;case"tabIndex":nl(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":nl(e,n,a);break;case"style":ve(e,a,f);break;case"data":if(t!=="object"){nl(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Mt(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Dt(e,t,"name",u.name,u,null),Dt(e,t,"formEncType",u.formEncType,u,null),Dt(e,t,"formMethod",u.formMethod,u,null),Dt(e,t,"formTarget",u.formTarget,u,null)):(Dt(e,t,"encType",u.encType,u,null),Dt(e,t,"method",u.method,u,null),Dt(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Mt(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=mt);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Mt(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":it("beforetoggle",e),it("toggle",e),fl(e,"popover",a);break;case"xlinkActuate":Ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ln(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ln(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ln(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ln(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":fl(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=ot.get(n)||n,fl(e,n,a))}}function fh(e,t,n,a,u,f){switch(n){case"style":ve(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?$(e,a):(typeof a=="number"||typeof a=="bigint")&&$(e,""+a);break;case"onScroll":a!=null&&it("scroll",e);break;case"onScrollEnd":a!=null&&it("scrollend",e);break;case"onClick":a!=null&&(e.onclick=mt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!El.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[$e]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof a=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,u);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):fl(e,n,a)}}}function rl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var x=n[f];if(x!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Dt(e,t,f,x,n,null)}}u&&Dt(e,t,"srcSet",n.srcSet,n,null),a&&Dt(e,t,"src",n.src,n,null);return;case"input":it("invalid",e);var S=f=x=u=null,D=null,K=null;for(a in n)if(n.hasOwnProperty(a)){var se=n[a];if(se!=null)switch(a){case"name":u=se;break;case"type":x=se;break;case"checked":D=se;break;case"defaultChecked":K=se;break;case"value":f=se;break;case"defaultValue":S=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Dt(e,t,a,se,n,null)}}Jl(e,f,S,D,K,x,u,!1);return;case"select":it("invalid",e),a=x=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":x=S;break;case"multiple":a=S;default:Dt(e,t,u,S,n,null)}t=f,n=x,e.multiple=!!a,t!=null?Bt(e,!!a,t,!1):n!=null&&Bt(e,!!a,n,!0);return;case"textarea":it("invalid",e),f=u=a=null;for(x in n)if(n.hasOwnProperty(x)&&(S=n[x],S!=null))switch(x){case"value":a=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Dt(e,t,x,S,n,null)}N(e,a,u,f);return;case"option":for(D in n)if(n.hasOwnProperty(D)&&(a=n[D],a!=null))switch(D){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Dt(e,t,D,a,n,null)}return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(a=0;a<yo.length;a++)it(yo[a],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in n)if(n.hasOwnProperty(K)&&(a=n[K],a!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Dt(e,t,K,a,n,null)}return;default:if(ze(t)){for(se in n)n.hasOwnProperty(se)&&(a=n[se],a!==void 0&&fh(e,t,se,a,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(a=n[S],a!=null&&Dt(e,t,S,a,n,null))}function B_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,x=null,S=null,D=null,K=null,se=null;for(te in n){var oe=n[te];if(n.hasOwnProperty(te)&&oe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":D=oe;default:a.hasOwnProperty(te)||Dt(e,t,te,null,a,oe)}}for(var J in a){var te=a[J];if(oe=n[J],a.hasOwnProperty(J)&&(te!=null||oe!=null))switch(J){case"type":f=te;break;case"name":u=te;break;case"checked":K=te;break;case"defaultChecked":se=te;break;case"value":x=te;break;case"defaultValue":S=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(c(137,t));break;default:te!==oe&&Dt(e,t,J,te,a,oe)}}gs(e,x,S,D,K,se,f,u);return;case"select":te=x=S=J=null;for(f in n)if(D=n[f],n.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":te=D;default:a.hasOwnProperty(f)||Dt(e,t,f,null,a,D)}for(u in a)if(f=a[u],D=n[u],a.hasOwnProperty(u)&&(f!=null||D!=null))switch(u){case"value":J=f;break;case"defaultValue":S=f;break;case"multiple":x=f;default:f!==D&&Dt(e,t,u,f,a,D)}t=S,n=x,a=te,J!=null?Bt(e,!!n,J,!1):!!a!=!!n&&(t!=null?Bt(e,!!n,t,!0):Bt(e,!!n,n?[]:"",!1));return;case"textarea":te=J=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!a.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Dt(e,t,S,null,a,u)}for(x in a)if(u=a[x],f=n[x],a.hasOwnProperty(x)&&(u!=null||f!=null))switch(x){case"value":J=u;break;case"defaultValue":te=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Dt(e,t,x,u,a,f)}me(e,J,te);return;case"option":for(var Re in n)if(J=n[Re],n.hasOwnProperty(Re)&&J!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:Dt(e,t,Re,null,a,J)}for(D in a)if(J=a[D],te=n[D],a.hasOwnProperty(D)&&J!==te&&(J!=null||te!=null))switch(D){case"selected":e.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:Dt(e,t,D,J,a,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in n)J=n[He],n.hasOwnProperty(He)&&J!=null&&!a.hasOwnProperty(He)&&Dt(e,t,He,null,a,J);for(K in a)if(J=a[K],te=n[K],a.hasOwnProperty(K)&&J!==te&&(J!=null||te!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(c(137,t));break;default:Dt(e,t,K,J,a,te)}return;default:if(ze(t)){for(var Ot in n)J=n[Ot],n.hasOwnProperty(Ot)&&J!==void 0&&!a.hasOwnProperty(Ot)&&fh(e,t,Ot,void 0,a,J);for(se in a)J=a[se],te=n[se],!a.hasOwnProperty(se)||J===te||J===void 0&&te===void 0||fh(e,t,se,J,a,te);return}}for(var Y in n)J=n[Y],n.hasOwnProperty(Y)&&J!=null&&!a.hasOwnProperty(Y)&&Dt(e,t,Y,null,a,J);for(oe in a)J=a[oe],te=n[oe],!a.hasOwnProperty(oe)||J===te||J==null&&te==null||Dt(e,t,oe,J,a,te)}function Yg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function I_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,x=u.initiatorType,S=u.duration;if(f&&S&&Yg(x)){for(x=0,S=u.responseEnd,a+=1;a<n.length;a++){var D=n[a],K=D.startTime;if(K>S)break;var se=D.transferSize,oe=D.initiatorType;se&&Yg(oe)&&(D=D.responseEnd,x+=se*(D<S?1:(S-K)/(D-K)))}if(--a,t+=8*(f+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var dh=null,hh=null;function Fu(e){return e.nodeType===9?e:e.ownerDocument}function $g(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ph(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 mh=null;function q_(){var e=window.event;return e&&e.type==="popstate"?e===mh?!1:(mh=e,!0):(mh=null,!1)}var Vg=typeof setTimeout=="function"?setTimeout:void 0,G_=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,Y_=typeof queueMicrotask=="function"?queueMicrotask:typeof Qg<"u"?function(e){return Qg.resolve(null).then(e).catch($_)}:Vg;function $_(e){setTimeout(function(){throw e})}function Si(e){return e==="head"}function Kg(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),tc(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")vo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,vo(n);for(var f=n.firstChild;f;){var x=f.nextSibling,S=f.nodeName;f[el]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=x}}else n==="body"&&vo(e.ownerDocument.body);n=u}while(n);tc(t)}function Zg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function gh(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":gh(n),kt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function X_(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[el])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=os(e.nextSibling),e===null)break}return null}function V_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=os(e.nextSibling),e===null))return null;return e}function Fg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=os(e.nextSibling),e===null))return null;return e}function bh(e){return e.data==="$?"||e.data==="$~"}function xh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Q_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function os(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 yh=null;function Jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return os(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Wg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Pg(e,t,n){switch(t=Fu(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 vo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var us=new Map,eb=new Set;function Ju(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ua=fe.d;fe.d={f:K_,r:Z_,D:F_,C:J_,L:W_,m:P_,X:t0,S:e0,M:n0};function K_(){var e=Ua.f(),t=Gu();return e||t}function Z_(e){var t=ln(e);t!==null&&t.tag===5&&t.type==="form"?bm(t):Ua.r(e)}var Wr=typeof document>"u"?null:document;function tb(e,t,n){var a=Wr;if(a&&typeof t=="string"&&t){var u=zn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),eb.has(u)||(eb.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),rl(t,"link",e),Ze(t),a.head.appendChild(t)))}}function F_(e){Ua.D(e),tb("dns-prefetch",e,null)}function J_(e,t){Ua.C(e,t),tb("preconnect",e,t)}function W_(e,t,n){Ua.L(e,t,n);var a=Wr;if(a&&e&&t){var u='link[rel="preload"][as="'+zn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+zn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+zn(n.imageSizes)+'"]')):u+='[href="'+zn(e)+'"]';var f=u;switch(t){case"style":f=Pr(e);break;case"script":f=ec(e)}us.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),us.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(jo(f))||t==="script"&&a.querySelector(So(f))||(t=a.createElement("link"),rl(t,"link",e),Ze(t),a.head.appendChild(t)))}}function P_(e,t){Ua.m(e,t);var n=Wr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+zn(a)+'"][href="'+zn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=ec(e)}if(!us.has(f)&&(e=j({rel:"modulepreload",href:e},t),us.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(So(f)))return}a=n.createElement("link"),rl(a,"link",e),Ze(a),n.head.appendChild(a)}}}function e0(e,t,n){Ua.S(e,t,n);var a=Wr;if(a&&e){var u=bt(a).hoistableStyles,f=Pr(e);t=t||"default";var x=u.get(f);if(!x){var S={loading:0,preload:null};if(x=a.querySelector(jo(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=us.get(f))&&_h(e,n);var D=x=a.createElement("link");Ze(D),rl(D,"link",e),D._p=new Promise(function(K,se){D.onload=K,D.onerror=se}),D.addEventListener("load",function(){S.loading|=1}),D.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Wu(x,t,a)}x={type:"stylesheet",instance:x,count:1,state:S},u.set(f,x)}}}function t0(e,t){Ua.X(e,t);var n=Wr;if(n&&e){var a=bt(n).hoistableScripts,u=ec(e),f=a.get(u);f||(f=n.querySelector(So(u)),f||(e=j({src:e,async:!0},t),(t=us.get(u))&&vh(e,t),f=n.createElement("script"),Ze(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function n0(e,t){Ua.M(e,t);var n=Wr;if(n&&e){var a=bt(n).hoistableScripts,u=ec(e),f=a.get(u);f||(f=n.querySelector(So(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=us.get(u))&&vh(e,t),f=n.createElement("script"),Ze(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function nb(e,t,n,a){var u=(u=Se.current)?Ju(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=Pr(n.href),n=bt(u).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Pr(n.href);var f=bt(u).hoistableStyles,x=f.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,x),(f=u.querySelector(jo(e)))&&!f._p&&(x.instance=f,x.state.loading=5),us.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},us.set(e,n),f||l0(u,e,n,x.state))),t&&a===null)throw Error(c(528,""));return x}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ec(n),n=bt(u).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Pr(e){return'href="'+zn(e)+'"'}function jo(e){return'link[rel="stylesheet"]['+e+"]"}function lb(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function l0(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),rl(t,"link",n),Ze(t),e.head.appendChild(t))}function ec(e){return'[src="'+zn(e)+'"]'}function So(e){return"script[async]"+e}function sb(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+zn(n.href)+'"]');if(a)return t.instance=a,Ze(a),a;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ze(a),rl(a,"style",u),Wu(a,n.precedence,e),t.instance=a;case"stylesheet":u=Pr(n.href);var f=e.querySelector(jo(u));if(f)return t.state.loading|=4,t.instance=f,Ze(f),f;a=lb(n),(u=us.get(u))&&_h(a,u),f=(e.ownerDocument||e).createElement("link"),Ze(f);var x=f;return x._p=new Promise(function(S,D){x.onload=S,x.onerror=D}),rl(f,"link",a),t.state.loading|=4,Wu(f,n.precedence,e),t.instance=f;case"script":return f=ec(n.src),(u=e.querySelector(So(f)))?(t.instance=u,Ze(u),u):(a=n,(u=us.get(f))&&(a=j({},n),vh(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ze(u),rl(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Wu(a,n.precedence,e));return t.instance}function Wu(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,x=0;x<a.length;x++){var S=a[x];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 _h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pu=null;function ab(e,t,n){if(Pu===null){var a=new Map,u=Pu=new Map;u.set(n,a)}else u=Pu,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[el]||f[Vt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var x=f.getAttribute(t)||"";x=e+x;var S=a.get(x);S?S.push(f):a.set(x,[f])}}return a}function ib(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function s0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function rb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a0(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=Pr(a.href),f=t.querySelector(jo(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ef.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Ze(f);return}f=t.ownerDocument||t,a=lb(a),(u=us.get(u))&&_h(a,u),f=f.createElement("link"),Ze(f);var x=f;x._p=new Promise(function(S,D){x.onload=S,x.onerror=D}),rl(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ef.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var jh=0;function i0(e,t){return e.stylesheets&&e.count===0&&nf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&nf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&jh===0&&(jh=62500*I_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&nf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>jh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function ef(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tf=null;function nf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tf=new Map,t.forEach(r0,e),tf=null,ef.call(e))}function r0(e,t){if(!(t.state.loading&4)){var n=tf.get(e);if(n)var a=n.get(null);else{n=new Map,tf.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var x=u[f];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(n.set(x.dataset.precedence,x),a=x)}a&&n.set(null,a)}u=t.instance,x=u.getAttribute("data-precedence"),f=n.get(x)||a,f===a&&n.set(null,u),n.set(x,u),this.count++,a=ef.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var wo={$$typeof:q,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function c0(e,t,n,a,u,f,x,S,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rn(0),this.hiddenUpdates=Rn(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function cb(e,t,n,a,u,f,x,S,D,K,se,oe){return e=new c0(e,t,n,x,D,K,se,oe,S),t=1,f===!0&&(t|=24),f=vl(3,null,null,t),e.current=f,f.stateNode=e,t=Ur(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},ad(f),e}function ob(e){return e?(e=ei,e):ei}function ub(e,t,n,a,u,f){u=ob(u),a.context===null?a.context=u:a.pendingContext=u,a=di(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=hi(e,a,t),n!==null&&(Hl(n,e,t),to(n,e,t))}function fb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sh(e,t){fb(e,t),(e=e.alternate)&&fb(e,t)}function db(e){if(e.tag===13||e.tag===31){var t=ya(e,67108864);t!==null&&Hl(t,e,67108864),Sh(e,67108864)}}function hb(e){if(e.tag===13||e.tag===31){var t=Xl();t=Ms(t);var n=ya(e,t);n!==null&&Hl(n,e,t),Sh(e,t)}}var lf=!0;function o0(e,t,n,a){var u=A.T;A.T=null;var f=fe.p;try{fe.p=2,wh(e,t,n,a)}finally{fe.p=f,A.T=u}}function u0(e,t,n,a){var u=A.T;A.T=null;var f=fe.p;try{fe.p=8,wh(e,t,n,a)}finally{fe.p=f,A.T=u}}function wh(e,t,n,a){if(lf){var u=kh(a);if(u===null)uh(e,t,a,sf,n),mb(e,a);else if(d0(u,e,t,n,a))a.stopPropagation();else if(mb(e,a),t&4&&-1<f0.indexOf(e)){for(;u!==null;){var f=ln(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var x=xe(f.pendingLanes);if(x!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;x;){var D=1<<31-Et(x);S.entanglements[1]|=D,x&=~D}Zs(f),(jt&6)===0&&(Iu=Ke()+500,xo(0))}}break;case 31:case 13:S=ya(f,2),S!==null&&Hl(S,f,2),Gu(),Sh(f,2)}if(f=kh(a),f===null&&uh(e,t,a,sf,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else uh(e,t,a,null,n)}}function kh(e){return e=It(e),Nh(e)}var sf=null;function Nh(e){if(sf=null,e=Tl(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return sf=e,null}function pb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(zt()){case gn:return 2;case ft:return 8;case Je:case An:return 32;case on:return 268435456;default:return 32}default:return 32}}var Th=!1,wi=null,ki=null,Ni=null,ko=new Map,No=new Map,Ti=[],f0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function mb(e,t){switch(e){case"focusin":case"focusout":wi=null;break;case"dragenter":case"dragleave":ki=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":ko.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":No.delete(t.pointerId)}}function To(e,t,n,a,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:f,targetContainers:[u]},t!==null&&(t=ln(t),t!==null&&db(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function d0(e,t,n,a,u){switch(t){case"focusin":return wi=To(wi,e,t,n,a,u),!0;case"dragenter":return ki=To(ki,e,t,n,a,u),!0;case"mouseover":return Ni=To(Ni,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return ko.set(f,To(ko.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,No.set(f,To(No.get(f)||null,e,t,n,a,u)),!0}return!1}function gb(e){var t=Tl(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,bl(e.priority,function(){hb(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,bl(e.priority,function(){hb(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function af(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);fn=a,n.target.dispatchEvent(a),fn=null}else return t=ln(n),t!==null&&db(t),e.blockedOn=n,!1;t.shift()}return!0}function bb(e,t,n){af(e)&&n.delete(t)}function h0(){Th=!1,wi!==null&&af(wi)&&(wi=null),ki!==null&&af(ki)&&(ki=null),Ni!==null&&af(Ni)&&(Ni=null),ko.forEach(bb),No.forEach(bb)}function rf(e,t){e.blockedOn===t&&(e.blockedOn=null,Th||(Th=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,h0)))}var cf=null;function xb(e){cf!==e&&(cf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){cf===e&&(cf=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(Nh(a||n)===null)continue;break}var f=ln(n);f!==null&&(e.splice(t,3),t-=3,kd(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function tc(e){function t(D){return rf(D,e)}wi!==null&&rf(wi,e),ki!==null&&rf(ki,e),Ni!==null&&rf(Ni,e),ko.forEach(t),No.forEach(t);for(var n=0;n<Ti.length;n++){var a=Ti[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ti.length&&(n=Ti[0],n.blockedOn===null);)gb(n),n.blockedOn===null&&Ti.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],x=u[$e]||null;if(typeof f=="function")x||xb(n);else if(x){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,x=f[$e]||null)S=x.formAction;else if(Nh(u)!==null)continue}else S=x.action;typeof S=="function"?n[a+1]=S:(n.splice(a,3),a-=3),xb(n)}}}function yb(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Eh(e){this._internalRoot=e}of.prototype.render=Eh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=Xl();ub(n,a,e,t,null,null)},of.prototype.unmount=Eh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ub(e.current,2,null,e,null,null),Gu(),t[vt]=null}};function of(e){this._internalRoot=e}of.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ti.length&&t!==0&&t<Ti[n].priority;n++);Ti.splice(n,0,e),n===0&&gb(e)}};var _b=s.version;if(_b!=="19.2.8")throw Error(c(527,_b,"19.2.8"));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=b(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var p0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uf.isDisabled&&uf.supportsFiber)try{Xt=uf.inject(p0),wt=uf}catch{}}return Co.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=Tm,f=Em,x=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=cb(e,1,!1,null,null,n,a,null,u,f,x,yb),e[vt]=t.current,oh(e),new Eh(t)},Co.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=Tm,x=Em,S=Cm,D=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(D=n.formState)),t=cb(e,1,!0,t,n??null,a,u,D,f,x,S,yb),t.context=ob(null),n=t.current,a=Xl(),a=Ms(a),u=di(a),u.callback=null,hi(n,u,a),n=a,t.current.lanes=n,ul(t,n),Zs(t),e[vt]=t.current,oh(e),new of(t)},Co.version="19.2.8",Co}var Mb;function N0(){if(Mb)return Rh.exports;Mb=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Rh.exports=k0(),Rh.exports}var T0=N0();const ty=1;function E0(l){return`${l.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${ny(l)}`}function C0(l){const s=l.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${s.replace(/^-+|-+$/g,"")||"project"}-${ny(l)}`,c=E0(l);return[s,r].filter(o=>o!==c)}function ny(l){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(l);return A0(s?l.toLowerCase():l)}function A0(l){let s=3735928559,r=1103547991;for(let c=0;c<l.length;c++){const o=l.charCodeAt(c);s=Math.imul(s^o,2654435761),r=Math.imul(r^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&r)+(s>>>0)).toString(36)}var Ia,mc,gc,bc,xc,Xo,yc,$f,ly;class M0{constructor(s){hn(this,$f);hn(this,Ia,null);hn(this,mc,new Set);hn(this,gc,500);hn(this,bc,null);hn(this,xc,!1);hn(this,Xo,null);hn(this,yc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){St(this,yc,s)}connect(){if(Ge(this,xc))return;const s=new WebSocket(this.url);St(this,Ia,s),s.addEventListener("open",()=>{var r,c;St(this,gc,500),this.send({type:"hello",protocol:ty,clientName:"ccv-web"}),(r=Ge(this,Xo))==null||r.call(this),(c=Ge(this,yc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ge(this,mc))o(c)}),s.addEventListener("close",()=>{var r;St(this,Ia,null),(r=Ge(this,yc))==null||r.call(this),qn(this,$f,ly).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){St(this,Xo,s)}on(s){return Ge(this,mc).add(s),()=>Ge(this,mc).delete(s)}send(s){var r;((r=Ge(this,Ia))==null?void 0:r.readyState)===WebSocket.OPEN&&Ge(this,Ia).send(JSON.stringify(s))}get connected(){var s;return((s=Ge(this,Ia))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;St(this,xc,!0),(s=Ge(this,Ia))==null||s.close()}}Ia=new WeakMap,mc=new WeakMap,gc=new WeakMap,bc=new WeakMap,xc=new WeakMap,Xo=new WeakMap,yc=new WeakMap,$f=new WeakSet,ly=function(){if(Ge(this,xc)||Ge(this,bc)!==null)return;const s=Ge(this,gc);St(this,gc,Math.min(s*2,1e4)),St(this,bc,window.setTimeout(()=>{St(this,bc,null),this.connect()},s))};const R0=1,sy="ccv:relay",Mf="ccv:relay.host";function D0(){try{const l=localStorage.getItem(sy);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function ay(){localStorage.removeItem(sy)}var la,_c,sa,vc,jc,Ui,fr,dr,Hi,hr,Sc,pr,mr,Wt,Mi,np,iy,or,lp;class O0{constructor(s){hn(this,Wt);hn(this,la,null);hn(this,_c,new Set);hn(this,sa,null);hn(this,vc,null);hn(this,jc,500);hn(this,Ui,null);hn(this,fr,!1);hn(this,dr,!1);hn(this,Hi,!1);hn(this,hr,null);hn(this,Sc,"Подключаемся…");hn(this,pr,0);hn(this,mr,[]);this.session=s}get connected(){return Ge(this,dr)&&Ge(this,Hi)}get statusText(){return Ge(this,Sc)}get hostId(){return Ge(this,hr)}on(s){return Ge(this,_c).add(s),()=>Ge(this,_c).delete(s)}onReconnect(s){St(this,vc,s)}onStatus(s){St(this,sa,s)}connect(){Ge(this,fr)||qn(this,Wt,np).call(this)}send(s){if(!Ge(this,dr)){Ge(this,mr).length<64&&Ge(this,mr).push(s);return}qn(this,Wt,or).call(this,{t:"client.frame",body:s})}close(){var s;St(this,fr,!0),Ge(this,Ui)!==null&&window.clearTimeout(Ge(this,Ui)),(s=Ge(this,la))==null||s.close()}}la=new WeakMap,_c=new WeakMap,sa=new WeakMap,vc=new WeakMap,jc=new WeakMap,Ui=new WeakMap,fr=new WeakMap,dr=new WeakMap,Hi=new WeakMap,hr=new WeakMap,Sc=new WeakMap,pr=new WeakMap,mr=new WeakMap,Wt=new WeakSet,Mi=function(s){var r;Ge(this,Sc)!==s&&(St(this,Sc,s),(r=Ge(this,sa))==null||r.call(this))},np=async function(){if(Ge(this,la))return;if(!Ge(this,hr))try{St(this,hr,await L0(this.session.token))}catch(c){qn(this,Wt,Mi).call(this,c instanceof Error?c.message:String(c)),qn(this,Wt,lp).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);St(this,la,r),r.addEventListener("open",()=>{qn(this,Wt,or).call(this,{t:"client.hello",protocol:R0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}qn(this,Wt,iy).call(this,o)}),r.addEventListener("close",()=>{var c;St(this,la,null),St(this,dr,!1),St(this,Hi,!1),qn(this,Wt,Mi).call(this,"Нет связи с сервером"),(c=Ge(this,sa))==null||c.call(this),qn(this,Wt,lp).call(this)}),r.addEventListener("error",()=>r.close())},iy=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":St(this,jc,500),qn(this,Wt,or).call(this,{t:"client.attach",hostId:Ge(this,hr)??"",...Ge(this,pr)>0?{sinceRseq:Ge(this,pr)}:{}});return;case"client.attached":St(this,dr,!0),St(this,Hi,s.online),St(this,pr,s.rseq),qn(this,Wt,Mi).call(this,s.online?"Хост на связи":"Компьютер не на связи"),qn(this,Wt,or).call(this,{t:"client.frame",body:{type:"hello",protocol:ty,clientName:"ccv-web-relay"}});const b=Ge(this,mr);St(this,mr,[]);for(const _ of b)qn(this,Wt,or).call(this,{t:"client.frame",body:_});(r=Ge(this,vc))==null||r.call(this),(c=Ge(this,sa))==null||c.call(this);return;case"host.frame":{s.rseq>0&&St(this,pr,s.rseq);const _=s.body;for(const j of Ge(this,_c))j(_);return}case"host.online":St(this,Hi,!0),qn(this,Wt,Mi).call(this,"Хост на связи"),(o=Ge(this,vc))==null||o.call(this),(d=Ge(this,sa))==null||d.call(this);return;case"host.offline":St(this,Hi,!1),qn(this,Wt,Mi).call(this,"Компьютер не на связи"),(h=Ge(this,sa))==null||h.call(this);return;case"ping":qn(this,Wt,or).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){ay(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Mf),qn(this,Wt,Mi).call(this,"Этот компьютер отвязан от аккаунта"),St(this,fr,!0),(m=Ge(this,la))==null||m.close();return}s.code!=="offline"&&qn(this,Wt,Mi).call(this,s.message),(g=Ge(this,sa))==null||g.call(this);return}},or=function(s){var r;((r=Ge(this,la))==null?void 0:r.readyState)===WebSocket.OPEN&&Ge(this,la).send(JSON.stringify(s))},lp=function(){if(Ge(this,fr)||Ge(this,Ui)!==null)return;const s=Ge(this,jc);St(this,jc,Math.min(s*2,1e4)),St(this,Ui,window.setTimeout(()=>{St(this,Ui,null),qn(this,Wt,np).call(this)},s))};async function L0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Mf,s),s;const r=localStorage.getItem(Mf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw ay(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Mf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Rf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const z0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function U0(){if(Rf()==="local")return new M0(z0);const l=D0();return l?new O0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const ry="ccv:drafts",H0=40,B0=2e4,I0=500;let Io=null,qo=null;function xp(){if(Io)return Io;const l=new Map;try{const s=localStorage.getItem(ry);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return Io=l,window.addEventListener("pagehide",uy),l}function zh(l){return xp().get(l)??""}function cy(l,s){const r=xp(),c=s.slice(0,B0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>H0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Y0(),G0()}function oy(){const l=new Set;for(const s of xp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const sp=new Set;let Rb="";function q0(l){return sp.add(l),()=>sp.delete(l)}function G0(){const l=oy(),s=l.join(`
51
+ `);if(s!==Rb){Rb=s;for(const r of sp)r(l)}}function Y0(){qo===null&&(qo=window.setTimeout(uy,I0))}function uy(){if(qo!==null&&window.clearTimeout(qo),qo=null,!!Io)try{localStorage.setItem(ry,JSON.stringify(Object.fromEntries(Io)))}catch{}}const wl={items:[],pending:[],lastSeq:0,contextTokens:null},Uh={entries:[],total:0,loading:!1};function fy(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Db(l){return l.total>0&&fy(l)>1}function $0(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:s.total,loading:!1}}function X0(l){return Df(wl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Df(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...V0(r,c.event,c.seq),lastSeq:c.seq});return r}function V0(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return Fs(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Fs(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return nc(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?Fs(l,m):nc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Fs(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return nc(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?Fs(l,m):nc(l,h,m)}case"tool.use":return Fs(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return nc(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(g!==-1){const b=c[g];return nc({...l,pending:m},g,{...b,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:Fs({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return Fs({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=s.usage)==null?void 0:d.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:Fs(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Fs(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Q0(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function K0(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let d=0;d<l.length;d++)if(l[d].kind==="user"){if(o===c)return l.slice(0,d);o++}return l}function Fs(l,s){return{...l,items:[...l.items,s]}}function nc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const ap="ccv:theme",Hh=["system","light","dark"];function Z0(){const[l,s]=y.useState(F0);y.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=y.useCallback(o=>{try{localStorage.setItem(ap,o)}catch{}s(o)},[]),c=y.useCallback(()=>{s(o=>{const d=Hh[(Hh.indexOf(o)+1)%Hh.length];try{localStorage.setItem(ap,d)}catch{}return d})},[]);return[l,r,c]}function F0(){try{const l=localStorage.getItem(ap);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const dy=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],J0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],gr={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:"вопроса"}},W0=320,hy="ccv:panes";function P0(l){return`--${l}-w`}function py(l,s){const r=gr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function ev(){const l={};for(const s of Object.keys(gr))l[s]=gr[s].width;try{const s=localStorage.getItem(hy);if(s){const r=JSON.parse(s);for(const c of Object.keys(gr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=py(c,o))}}}catch{}return l}function tv(){const[l,s]=y.useState(ev),r=y.useCallback(h=>{try{localStorage.setItem(hy,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,m)=>{s(g=>{const b=py(h,m);if(g[h]===b)return g;const _={...g,[h]:b};return r(_),_})},[r]),o=y.useCallback(h=>{s(m=>{const g={...m,[h]:gr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(gr))d[P0(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Bh=260,my=120,nv=200,Ob="ccv:terminal-h";function Lb(l,s){return Math.round(Math.min(s,Math.max(my,l)))}function lv(){const[l,s]=y.useState(()=>{try{const d=localStorage.getItem(Ob);if(d){const h=Number(d);if(Number.isFinite(h))return Lb(h,1/0)}}catch{}return Bh}),r=y.useCallback(d=>{try{localStorage.setItem(Ob,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const m=Lb(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=y.useCallback(()=>{s(Bh),r(Bh)},[r]);return{height:l,setHeight:c,reset:o}}function Xf(l){const[s,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return y.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const sv=500,av=6;function gy({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=sv,moveCancelPx:o=av}){const d=y.useRef(null),[h,m]=y.useState(!1),g=y.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=y.useCallback(E=>{if(r||E.button!==0)return;const M={timer:0,x:E.clientX,y:E.clientY,fired:!1};M.timer=window.setTimeout(()=>{M.fired=!0,m(!1),l()},c),d.current=M,m(!0)},[r,c,l]),_=y.useCallback(E=>{const M=d.current;!M||M.fired||Math.hypot(E.clientX-M.x,E.clientY-M.y)>o&&g()},[o,g]),j=y.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=y.useCallback(E=>{var M;if((M=d.current)!=null&&M.fired){d.current=null,E.preventDefault();return}if(!r){if(E.shiftKey){l();return}s()}},[r,s,l]),C=y.useCallback(E=>{E.preventDefault()},[]),T=y.useCallback(E=>{r||E.shiftKey&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:_,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:C,onKeyDown:T}}}const iv={height:0,offsetTop:0,offsetLeft:0};function zb(){if(typeof window>"u")return iv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function rv(l){const[s,r]=y.useState(zb);return y.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=zb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[l]),s}function yp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _r=yp();function by(l){_r=l}var ur={exec:()=>null};function lc(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function pt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(pl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var cv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),pl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:lc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:lc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:lc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:lc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:lc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:lc(l=>new RegExp(`^ {0,${l}}>`))},ov=/^(?:[ \t]*(?:\n|$))+/,uv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yy=pt(xy).replace(/bull/g,_p).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(),hv=pt(xy).replace(/bull/g,_p).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(),vp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,pv=/^[^\n]+/,jp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mv=pt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gv=pt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_p).getRegex(),Vf="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",Sp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,bv=pt("^ {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",Sp).replace("tag",Vf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_y=l=>pt(vp).replace("hr",Vo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vf).getRegex(),xv=_y(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),yv=_y(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),_v=pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yv).getRegex(),wp={blockquote:_v,code:uv,def:mv,fences:fv,heading:dv,hr:Vo,html:bv,lheading:yy,list:gv,newline:ov,paragraph:xv,table:ur,text:pv},Ub=pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vo).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",Vf).getRegex(),vv={...wp,lheading:hv,table:Ub,paragraph:pt(vp).replace("hr",Vo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ub).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Vf).getRegex()},jv={...wp,html:pt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Sp).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:ur,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pt(vp).replace("hr",Vo).replace("heading",` *#{1,6} *[^
52
+ ]`).replace("lheading",yy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vy=/^( {2,}|\\)\n(?!\s*$)/,kv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kc=/[\p{P}\p{S}]/u,Qf=/[\s\p{P}\p{S}]/u,kp=/[^\s\p{P}\p{S}]/u,Nv=pt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Qf).getRegex(),jy=/(?!~)[\p{P}\p{S}]/u,Tv=/(?!~)[\s\p{P}\p{S}]/u,Ev=/(?:[^\s\p{P}\p{S}]|~)/u,Cv=pt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",cv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Sy=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Av=pt(Sy,"u").replace(/punct/g,kc).getRegex(),Mv=pt(Sy,"u").replace(/punct/g,jy).getRegex(),wy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rv=pt(wy,"gu").replace(/notPunctSpace/g,kp).replace(/punctSpace/g,Qf).replace(/punct/g,kc).getRegex(),Dv=pt(wy,"gu").replace(/notPunctSpace/g,Ev).replace(/punctSpace/g,Tv).replace(/punct/g,jy).getRegex(),Ov=pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kp).replace(/punctSpace/g,Qf).replace(/punct/g,kc).getRegex(),Lv=pt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,kc).getRegex(),zv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Uv=pt(zv,"gu").replace(/notPunctSpace/g,kp).replace(/punctSpace/g,Qf).replace(/punct/g,kc).getRegex(),Hv=pt(/\\(punct)/,"gu").replace(/punct/g,kc).getRegex(),Bv=pt(/^<(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(),Iv=pt(Sp).replace("(?:-->|$)","-->").getRegex(),qv=pt("^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",Iv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Gv=pt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",zf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ky=pt(/^!?\[(label)\]\[(ref)\]/).replace("label",zf).replace("ref",jp).getRegex(),Ny=pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",jp).getRegex(),Yv=pt("reflink|nolink(?!\\()","g").replace("reflink",ky).replace("nolink",Ny).getRegex(),Hb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Np={_backpedal:ur,anyPunctuation:Hv,autolink:Bv,blockSkip:Cv,br:vy,code:wv,del:ur,delLDelim:ur,delRDelim:ur,emStrongLDelim:Av,emStrongRDelimAst:Rv,emStrongRDelimUnd:Ov,escape:Sv,link:Gv,nolink:Ny,punctuation:Nv,reflink:ky,reflinkSearch:Yv,tag:qv,text:kv,url:ur},$v={...Np,link:pt(/^!?\[(label)\]\((.*?)\)/).replace("label",zf).getRegex(),reflink:pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zf).getRegex()},ip={...Np,emStrongRDelimAst:Dv,emStrongLDelim:Mv,delLDelim:Lv,delRDelim:Uv,url:pt(/^((?: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:pt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {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()},Xv={...ip,br:pt(vy).replace("{2,}","*").getRegex(),text:pt(ip.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ff={normal:wp,gfm:vv,pedantic:jv},Ao={normal:Np,gfm:ip,breaks:Xv,pedantic:$v},Vv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Bb=l=>Vv[l];function ea(l,s){if(s){if(pl.escapeTest.test(l))return l.replace(pl.escapeReplace,Bb)}else if(pl.escapeTestNoEncode.test(l))return l.replace(pl.escapeReplaceNoEncode,Bb);return l}function Ib(l){try{l=encodeURI(l).replace(pl.percentDecode,"%")}catch{return null}return l}function qb(l,s){var d;let r=l.replace(pl.findPipe,(h,m,g)=>{let b=!1,_=m;for(;--_>=0&&g[_]==="\\";)b=!b;return b?"|":" |"}),c=r.split(pl.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(pl.slashPipe,"|");return c}function Ci(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function Gb(l){let s=l.split(`
53
53
  `),r=s.length-1;for(;r>=0&&pl.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
54
  `)}function Qv(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function Kv(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Yb(l,s,r,c,o){let d=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Zv(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
55
55
  `).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
56
- `)}var zf=class{constructor(l){Lt(this,"options");Lt(this,"rules");Lt(this,"lexer");this.options=l||yr}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:Gb(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=Zv(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Ei(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Ei(s[0],`
57
- `),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:Ei(s[0],`
58
- `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Ei(s[0],`
56
+ `)}var Uf=class{constructor(l){Lt(this,"options");Lt(this,"rules");Lt(this,"lexer");this.options=l||_r}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:Gb(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=Zv(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Ci(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Ci(s[0],`
57
+ `),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:Ci(s[0],`
58
+ `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Ci(s[0],`
59
59
  `).split(`
60
60
  `),c="",o="",d=[];for(;r.length>0;){let h=!1,m=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))m.push(r[g]),h=!0;else if(!h)m.push(r[g]);else break;r=r.slice(g);let b=m.join(`
61
61
  `),_=b.replace(this.rules.other.blockquoteSetextReplace,`
@@ -69,16 +69,16 @@ ${_}`:_;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
69
69
  `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;l;){let g=!1,b="",_="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;b=s[0],l=l.substring(b.length);let j=Kv(s[2].split(`
70
70
  `,1)[0],s[1].length),v=l.split(`
71
71
  `,1)[0],C=!j.trim(),T=0;if(this.options.pedantic?(T=2,_=j.trimStart()):C?T=s[1].length+1:(T=j.search(this.rules.other.nonSpaceChar),T=T>4?1:T,_=j.slice(T),T+=s[1].length),C&&this.rules.other.blankLine.test(v)&&(b+=v+`
72
- `,l=l.substring(v.length+1),g=!0),!g){let E=this.rules.other.nextBulletRegex(T),L=this.rules.other.hrRegex(T),$=this.rules.other.fencesBeginRegex(T),J=this.rules.other.headingBeginRegex(T),G=this.rules.other.htmlBeginRegex(T),O=this.rules.other.blockquoteBeginRegex(T);for(;l;){let Z=l.split(`
73
- `,1)[0],M;if(v=Z,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),$.test(v)||J.test(v)||G.test(v)||O.test(v)||E.test(v)||L.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=T||!v.trim())_+=`
74
- `+M.slice(T);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(j)||J.test(j)||L.test(j))break;_+=`
72
+ `,l=l.substring(v.length+1),g=!0),!g){let E=this.rules.other.nextBulletRegex(T),M=this.rules.other.hrRegex(T),G=this.rules.other.fencesBeginRegex(T),F=this.rules.other.headingBeginRegex(T),q=this.rules.other.htmlBeginRegex(T),L=this.rules.other.blockquoteBeginRegex(T);for(;l;){let Z=l.split(`
73
+ `,1)[0],R;if(v=Z,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),R=v):R=v.replace(this.rules.other.tabCharGlobal," "),G.test(v)||F.test(v)||q.test(v)||L.test(v)||E.test(v)||M.test(v))break;if(R.search(this.rules.other.nonSpaceChar)>=T||!v.trim())_+=`
74
+ `+R.slice(T);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(j)||F.test(j)||M.test(j))break;_+=`
75
75
  `+v}C=!v.trim(),b+=Z+`
76
- `,l=l.substring(Z.length+1),j=M.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=b}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(g.raw);if(_){let j={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let _=g.tokens.filter(v=>v.type==="space"),j=_.length>0&&_.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=Gb(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Ei(s[0],`
76
+ `,l=l.substring(Z.length+1),j=R.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=b}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(g.raw);if(_){let j={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let _=g.tokens.filter(v=>v.type==="space"),j=_.length>0&&_.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=Gb(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Ci(s[0],`
77
77
  `),href:c,title:o}}}table(l){var h;let s=this.rules.block.table.exec(l);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let r=qb(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
78
- `):[],d={type:"table",raw:Ei(s[0],`
79
- `),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(qb(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Ei(s[0],`
78
+ `):[],d={type:"table",raw:Ci(s[0],`
79
+ `),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(qb(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Ci(s[0],`
80
80
  `),depth:s[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(l){let s=this.rules.block.paragraph.exec(l);if(s){let r=s[1].charAt(s[1].length-1)===`
81
- `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Ei(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Qv(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Yb(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Yb(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,b=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,s=s.slice(-1*l.length+o);(c=b.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let _=[...c[0]][0].length,j=l.slice(0,o+c.index+_+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(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,s=s.slice(-1*l.length+o);(c=g.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let b=[...c[0]][0].length,_=l.slice(0,o+c.index+b+h),j=_.slice(o,-o);return{type:"del",raw:_,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let d;do d=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(d!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Ts=class ip{constructor(s){Lt(this,"tokens");Lt(this,"options");Lt(this,"state");Lt(this,"inlineQueue");Lt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||yr,this.options.tokenizer=this.options.tokenizer||new zf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:pl,block:uf.normal,inline:Co.normal};this.options.pedantic?(r.block=uf.pedantic,r.inline=Co.pedantic):this.options.gfm&&(r.block=uf.gfm,this.options.breaks?r.inline=Co.breaks:r.inline=Co.gfm),this.tokenizer.rules=r}static get rules(){return{block:uf,inline:Co}}static lex(s,r){return new ip(r).lex(s)}static lexInline(s,r){return new ip(r).inlineTokens(s)}lex(s){s=s.replace(pl.carriageReturn,`
81
+ `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Ci(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Qv(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Yb(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Yb(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,b=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,s=s.slice(-1*l.length+o);(c=b.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let _=[...c[0]][0].length,j=l.slice(0,o+c.index+_+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(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,s=s.slice(-1*l.length+o);(c=g.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let b=[...c[0]][0].length,_=l.slice(0,o+c.index+b+h),j=_.slice(o,-o);return{type:"del",raw:_,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let d;do d=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(d!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Ts=class rp{constructor(s){Lt(this,"tokens");Lt(this,"options");Lt(this,"state");Lt(this,"inlineQueue");Lt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||_r,this.options.tokenizer=this.options.tokenizer||new Uf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:pl,block:ff.normal,inline:Ao.normal};this.options.pedantic?(r.block=ff.pedantic,r.inline=Ao.pedantic):this.options.gfm&&(r.block=ff.gfm,this.options.breaks?r.inline=Ao.breaks:r.inline=Ao.gfm),this.tokenizer.rules=r}static get rules(){return{block:ff,inline:Ao}}static lex(s,r){return new rp(r).lex(s)}static lexInline(s,r){return new rp(r).inlineTokens(s)}lex(s){s=s.replace(pl.carriageReturn,`
82
82
  `),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(pl.tabCharGlobal," ").replace(pl.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(_=>(g=_.call({lexer:this},s,r))?(s=s.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.substring(g.raw.length);let _=r.at(-1);g.raw.length===1&&_!==void 0?_.raw+=`
83
83
  `:r.push(g);continue}if(g=this.tokenizer.code(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
84
84
  `)?"":`
@@ -92,7 +92,7 @@ ${_}`:_;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
92
92
  `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(g),c=b.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.substring(g.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
93
93
  `)?"":`
94
94
  `)+g.raw,_.text+=`
95
- `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(g);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,b,_,j;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,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,T)=>{let E=T?T.length:0;return v.slice(0,E)+"["+"a".repeat(v.length-E-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((_=(b=this.options.extensions)==null?void 0:b.inline)!=null&&_.some(T=>(v=T.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let T=r.at(-1);v.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let C=s;if((j=this.options.extensions)!=null&&j.startInline){let T=1/0,E=s.slice(1),L;this.options.extensions.startInline.forEach($=>{L=$.call({lexer:this},E),typeof L=="number"&&L>=0&&(T=Math.min(T,L))}),T<1/0&&T>=0&&(C=s.substring(0,T+1))}if(v=this.tokenizer.inlineText(C)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let T=r.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},Uf=class{constructor(l){Lt(this,"options");Lt(this,"parser");this.options=l||yr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(pl.notSpaceStart))==null?void 0:d[0],o=l.replace(pl.endingNewline,"")+`
95
+ `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(g);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,b,_,j;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,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,T)=>{let E=T?T.length:0;return v.slice(0,E)+"["+"a".repeat(v.length-E-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((_=(b=this.options.extensions)==null?void 0:b.inline)!=null&&_.some(T=>(v=T.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let T=r.at(-1);v.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let C=s;if((j=this.options.extensions)!=null&&j.startInline){let T=1/0,E=s.slice(1),M;this.options.extensions.startInline.forEach(G=>{M=G.call({lexer:this},E),typeof M=="number"&&M>=0&&(T=Math.min(T,M))}),T<1/0&&T>=0&&(C=s.substring(0,T+1))}if(v=this.tokenizer.inlineText(C)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let T=r.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},Hf=class{constructor(l){Lt(this,"options");Lt(this,"parser");this.options=l||_r}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(pl.notSpaceStart))==null?void 0:d[0],o=l.replace(pl.endingNewline,"")+`
96
96
  `;return c?'<pre><code class="language-'+ea(c)+'">'+(r?o:ea(o,!0))+`</code></pre>
97
97
  `:"<pre><code>"+(r?o:ea(o,!0))+`</code></pre>
98
98
  `}blockquote({tokens:l}){return`<blockquote>
@@ -110,25 +110,25 @@ ${this.parser.parse(l)}</blockquote>
110
110
  `}tablerow({text:l}){return`<tr>
111
111
  ${l}</tr>
112
112
  `}tablecell(l){let s=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+s+`</${r}>
113
- `}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${ea(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=Ib(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+ea(s)+'"'),d+=">"+c+"</a>",d}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Ib(l);if(o===null)return ea(r);l=o;let d=`<img src="${l}" alt="${ea(r)}"`;return s&&(d+=` title="${ea(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:ea(l.text)}},Np=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Es=class rp{constructor(s){Lt(this,"options");Lt(this,"renderer");Lt(this,"textRenderer");this.options=s||yr,this.options.renderer=this.options.renderer||new Uf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Np}static parse(s,r){return new rp(r).parse(s)}static parseInline(s,r){return new rp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=b||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(s,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=b||"";continue}}let g=m;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let b='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return c}},Cf,Uo=(Cf=class{constructor(l){Lt(this,"options");Lt(this,"block");this.options=l||yr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Ts.lex:Ts.lexInline}provideParser(l=this.block){return l?Es.parse:Es.parseInline}},Lt(Cf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Lt(Cf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Cf),Fv=class{constructor(...l){Lt(this,"defaults",xp());Lt(this,"options",this.setOptions);Lt(this,"parse",this.parseMarkdown(!0));Lt(this,"parseInline",this.parseMarkdown(!1));Lt(this,"Parser",Es);Lt(this,"Renderer",Uf);Lt(this,"TextRenderer",Np);Lt(this,"Lexer",Ts);Lt(this,"Tokenizer",zf);Lt(this,"Hooks",Uo);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let d of l)switch(r=r.concat(s.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,s));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=s.renderers[o.name];d?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=s[o.level];d?d.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new Uf(this.defaults);for(let d in r.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=r.renderer[h],g=o[h];o[h]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new zf(this.defaults);for(let d in r.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=r.tokenizer[h],g=o[h];o[h]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Uo;for(let d in r.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=r.hooks[h],g=o[h];Uo.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&Uo.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,b);return g.call(o,j)})();let _=m.call(o,b);return g.call(o,_)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,b);return j===!1&&(j=await g.apply(o,b)),j})();let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return Ts.lex(l,s??this.defaults)}parser(l,s){return Es.parse(l,s??this.defaults)}parseMarkdown(l){return(s,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(l,s){return r=>{if(r.message+=`
114
- Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+ea(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},xr=new Fv;function Nt(l,s){return xr.parse(l,s)}Nt.options=Nt.setOptions=function(l){return xr.setOptions(l),Nt.defaults=xr.defaults,by(Nt.defaults),Nt};Nt.getDefaults=xp;Nt.defaults=yr;Nt.use=function(...l){return xr.use(...l),Nt.defaults=xr.defaults,by(Nt.defaults),Nt};Nt.walkTokens=function(l,s){return xr.walkTokens(l,s)};Nt.parseInline=xr.parseInline;Nt.Parser=Es;Nt.parser=Es.parse;Nt.Renderer=Uf;Nt.TextRenderer=Np;Nt.Lexer=Ts;Nt.lexer=Ts.lex;Nt.Tokenizer=zf;Nt.Hooks=Uo;Nt.parse=Nt;Nt.options;Nt.setOptions;Nt.use;Nt.walkTokens;Nt.parseInline;Es.parse;Ts.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function $b(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function Jv(l){if(Array.isArray(l))return l}function Wv(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,b=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(_){b=!0,o=_}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function Pv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
115
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e1(l,s){return Jv(l)||Wv(l,s)||t1(l,s)||Pv()}function t1(l,s){if(l){if(typeof l=="string")return $b(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$b(l,s):void 0}}const Ty=Object.entries,Xb=Object.setPrototypeOf,n1=Object.isFrozen,l1=Object.getPrototypeOf,s1=Object.getOwnPropertyDescriptor;let cl=Object.freeze,ol=Object.seal,cc=Object.create,Ey=typeof Reflect<"u"&&Reflect,cp=Ey.apply,op=Ey.construct;cl||(cl=function(s){return s});ol||(ol=function(s){return s});cp||(cp=function(s,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return s.apply(r,o)});op||(op=function(s){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new s(...c)});const lc=Gn(Array.prototype.forEach),a1=Gn(Array.prototype.lastIndexOf),Vb=Gn(Array.prototype.pop),sc=Gn(Array.prototype.push),i1=Gn(Array.prototype.splice),Oi=Array.isArray,Ho=Gn(String.prototype.toLowerCase),Bh=Gn(String.prototype.toString),Qb=Gn(String.prototype.match),Ao=Gn(String.prototype.replace),Kb=Gn(String.prototype.indexOf),r1=Gn(String.prototype.trim),c1=Gn(Number.prototype.toString),o1=Gn(Boolean.prototype.toString),Zb=typeof BigInt>"u"?null:Gn(BigInt.prototype.toString),Fb=typeof Symbol>"u"?null:Gn(Symbol.prototype.toString),Wn=Gn(Object.prototype.hasOwnProperty),Mo=Gn(Object.prototype.toString),Jn=Gn(RegExp.prototype.test),sr=u1(TypeError);function Gn(l){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return cp(l,s,c)}}function u1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return op(l,r)}}function ht(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ho;if(Xb&&Xb(l,null),!Oi(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(n1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function f1(l){for(let s=0;s<l.length;s++)Wn(l,s)||(l[s]=null);return l}function kl(l){const s=cc(null);for(const c of Ty(l)){var r=e1(c,2);const o=r[0],d=r[1];Wn(l,o)&&(Oi(d)?s[o]=f1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=kl(d):s[o]=d)}return s}function d1(l){switch(typeof l){case"string":return l;case"number":return c1(l);case"boolean":return o1(l);case"bigint":return Zb?Zb(l):"0";case"symbol":return Fb?Fb(l):"Symbol()";case"undefined":return Mo(l);case"function":case"object":{if(l===null)return Mo(l);const s=l,r=ta(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Mo(c)}return Mo(l)}default:return Mo(l)}}function ta(l,s){for(;l!==null;){const c=s1(l,s);if(c){if(c.get)return Gn(c.get);if(typeof c.value=="function")return Gn(c.value)}l=l1(l)}function r(){return null}return r}function h1(l){try{return Jn(l,""),!0}catch{return!1}}const Jb=cl(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ih=cl(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qh=cl(["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"]),p1=cl(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Gh=cl(["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"]),m1=cl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wb=cl(["#text"]),Pb=cl(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Yh=cl(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ex=cl(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ff=cl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g1=ol(/{{[\w\W]*|^[\w\W]*}}/g),b1=ol(/<%[\w\W]*|^[\w\W]*%>/g),x1=ol(/\${[\w\W]*/g),y1=ol(/^data-[\-\w.\u00B7-\uFFFF]+$/),_1=ol(/^aria-[\-\w]+$/),tx=ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),v1=ol(/^(?:\w+script|data):/i),j1=ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),S1=ol(/^html$/i),w1=ol(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=ol(/<[/\w!]/g),lx=ol(/<[/\w]/g),k1=ol(/<\/no(script|embed|frames)/i),N1=ol(/\/>/i),Vl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},T1=function(){return typeof window>"u"?null:window},E1=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},sx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ci=function(s,r,c,o){return Wn(s,r)&&Oi(s[r])?ht(o.base?kl(o.base):{},s[r],o.transform):c};function Cy(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T1();const s=me=>Cy(me);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==Vl.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const d=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,b=l.NamedNodeMap;b===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const _=l.DOMParser,j=l.trustedTypes,v=m.prototype,C=ta(v,"cloneNode"),T=ta(v,"remove"),E=ta(v,"nextSibling"),L=ta(v,"childNodes"),$=ta(v,"parentNode"),J=ta(v,"shadowRoot"),G=ta(v,"attributes"),O=h&&h.prototype?ta(h.prototype,"nodeType"):null,Z=h&&h.prototype?ta(h.prototype,"nodeName"):null;if(typeof d=="function"){const me=r.createElement("template");me.content&&me.content.ownerDocument&&(r=me.content.ownerDocument)}let M,D="",B,ne=!1,he=0;const P=function(){if(he>0)throw sr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ue=function(N){P(),he++;try{return M.createHTML(N)}finally{he--}},_e=function(N){P(),he++;try{return M.createScriptURL(N)}finally{he--}},De=function(){return ne||(B=E1(j,o),ne=!0),B},Ne=r,A=Ne.implementation,fe=Ne.createNodeIterator,z=Ne.createDocumentFragment,pe=Ne.getElementsByTagName,ke=c.importNode;let k=sx();s.isSupported=typeof Ty=="function"&&typeof $=="function"&&A&&A.createHTMLDocument!==void 0;const V=g1,ce=b1,ge=x1,Ae=y1,Se=_1,Te=v1,Tt=j1,Ye=w1;let et=tx,Xe=null;const Qt=ht({},[...Jb,...Ih,...qh,...Gh,...Wb]);let tt=null;const Yt=ht({},[...Pb,...Yh,...ex,...ff]);let nt=Object.seal(cc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),en=null,$t=null;const tn=Object.seal(cc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,pn=!0,Sn=!1,mn=!0,cn=!1,Ke=!0,zt=!1,gn=!1,ft=null,Je=null,An=!1,on=!1,wn=!1,Pn=!1,Xt=!0,wt=!1;const Kt="user-content-";let Et=!0,Yn=!1,le={},be=null;const Le=ht({},["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 H=null;const W=ht({},["audio","video","img","source","image","track"]);let xe=null;const Be=ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gt="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",bn="http://www.w3.org/1999/xhtml";let Rn=bn,ul=!1,gl=null;const ra=ht({},[gt,Mn,bn],Bh),Ql=cl(["mi","mo","mn","ms","mtext"]);let ps=ht({},Ql);const Ms=cl(["annotation-xml"]);let Dn=ht({},Ms);const Kl=ht({},["title","style","font","a","script"]);let bl=null;const $n=["application/xhtml+xml","text/html"],Vt="text/html";let $e=null,vt=null;const xl=r.createElement("form"),lt=function(N){return N instanceof RegExp||N instanceof Function},Zl=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vt&&vt===N)return;(!N||typeof N!="object")&&(N={}),N=kl(N),bl=$n.indexOf(N.PARSER_MEDIA_TYPE)===-1?Vt:N.PARSER_MEDIA_TYPE,$e=bl==="application/xhtml+xml"?Bh:Ho,Xe=Ci(N,"ALLOWED_TAGS",Qt,{transform:$e}),tt=Ci(N,"ALLOWED_ATTR",Yt,{transform:$e}),gl=Ci(N,"ALLOWED_NAMESPACES",ra,{transform:Bh}),xe=Ci(N,"ADD_URI_SAFE_ATTR",Be,{transform:$e,base:Be}),H=Ci(N,"ADD_DATA_URI_TAGS",W,{transform:$e,base:W}),be=Ci(N,"FORBID_CONTENTS",Le,{transform:$e}),en=Ci(N,"FORBID_TAGS",kl({}),{transform:$e}),$t=Ci(N,"FORBID_ATTR",kl({}),{transform:$e}),le=Wn(N,"USE_PROFILES")?N.USE_PROFILES&&typeof N.USE_PROFILES=="object"?kl(N.USE_PROFILES):N.USE_PROFILES:!1,nn=N.ALLOW_ARIA_ATTR!==!1,pn=N.ALLOW_DATA_ATTR!==!1,Sn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,mn=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,cn=N.SAFE_FOR_TEMPLATES||!1,Ke=N.SAFE_FOR_XML!==!1,zt=N.WHOLE_DOCUMENT||!1,on=N.RETURN_DOM||!1,wn=N.RETURN_DOM_FRAGMENT||!1,Pn=N.RETURN_TRUSTED_TYPE||!1,An=N.FORCE_BODY||!1,Xt=N.SANITIZE_DOM!==!1,wt=N.SANITIZE_NAMED_PROPS||!1,Et=N.KEEP_CONTENT!==!1,Yn=N.IN_PLACE||!1,et=h1(N.ALLOWED_URI_REGEXP)?N.ALLOWED_URI_REGEXP:tx,Rn=typeof N.NAMESPACE=="string"?N.NAMESPACE:bn,ps=Wn(N,"MATHML_TEXT_INTEGRATION_POINTS")&&N.MATHML_TEXT_INTEGRATION_POINTS&&typeof N.MATHML_TEXT_INTEGRATION_POINTS=="object"?kl(N.MATHML_TEXT_INTEGRATION_POINTS):ht({},Ql),Dn=Wn(N,"HTML_INTEGRATION_POINTS")&&N.HTML_INTEGRATION_POINTS&&typeof N.HTML_INTEGRATION_POINTS=="object"?kl(N.HTML_INTEGRATION_POINTS):ht({},Ms);const Y=Wn(N,"CUSTOM_ELEMENT_HANDLING")&&N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING=="object"?kl(N.CUSTOM_ELEMENT_HANDLING):cc(null);if(nt=cc(null),Wn(Y,"tagNameCheck")&&lt(Y.tagNameCheck)&&(nt.tagNameCheck=Y.tagNameCheck),Wn(Y,"attributeNameCheck")&&lt(Y.attributeNameCheck)&&(nt.attributeNameCheck=Y.attributeNameCheck),Wn(Y,"allowCustomizedBuiltInElements")&&typeof Y.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=Y.allowCustomizedBuiltInElements),ol(nt),cn&&(pn=!1),wn&&(on=!0),le&&(Xe=ht({},Wb),tt=cc(null),le.html===!0&&(ht(Xe,Jb),ht(tt,Pb)),le.svg===!0&&(ht(Xe,Ih),ht(tt,Yh),ht(tt,ff)),le.svgFilters===!0&&(ht(Xe,qh),ht(tt,Yh),ht(tt,ff)),le.mathMl===!0&&(ht(Xe,Gh),ht(tt,ex),ht(tt,ff))),tn.tagCheck=null,tn.attributeCheck=null,Wn(N,"ADD_TAGS")&&(typeof N.ADD_TAGS=="function"?tn.tagCheck=N.ADD_TAGS:Oi(N.ADD_TAGS)&&(Xe===Qt&&(Xe=kl(Xe)),ht(Xe,N.ADD_TAGS,$e))),Wn(N,"ADD_ATTR")&&(typeof N.ADD_ATTR=="function"?tn.attributeCheck=N.ADD_ATTR:Oi(N.ADD_ATTR)&&(tt===Yt&&(tt=kl(tt)),ht(tt,N.ADD_ATTR,$e))),Wn(N,"ADD_URI_SAFE_ATTR")&&Oi(N.ADD_URI_SAFE_ATTR)&&ht(xe,N.ADD_URI_SAFE_ATTR,$e),Wn(N,"FORBID_CONTENTS")&&Oi(N.FORBID_CONTENTS)&&(be===Le&&(be=kl(be)),ht(be,N.FORBID_CONTENTS,$e)),Wn(N,"ADD_FORBID_CONTENTS")&&Oi(N.ADD_FORBID_CONTENTS)&&(be===Le&&(be=kl(be)),ht(be,N.ADD_FORBID_CONTENTS,$e)),Et&&(Xe["#text"]=!0),zt&&ht(Xe,["html","head","body"]),Xe.table&&(ht(Xe,["tbody"]),delete en.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw sr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ae=M;M=N.TRUSTED_TYPES_POLICY;try{D=ue("")}catch(we){throw M=ae,we}}else N.TRUSTED_TYPES_POLICY===null?(M=void 0,D=""):(M===void 0&&(M=De()),M&&typeof D=="string"&&(D=ue("")));cl&&cl(N),vt=N},Ut=ht({},[...Ih,...qh,...p1]),el=ht({},[...Gh,...m1]),kt=function(N,Y,ae){return Y.namespaceURI===bn?N==="svg":Y.namespaceURI===gt?N==="svg"&&(ae==="annotation-xml"||ps[ae]):!!Ut[N]},Tl=function(N,Y,ae){return Y.namespaceURI===bn?N==="math":Y.namespaceURI===Mn?N==="math"&&Dn[ae]:!!el[N]},ln=function(N,Y,ae){return Y.namespaceURI===Mn&&!Dn[ae]||Y.namespaceURI===gt&&!ps[ae]?!1:!el[N]&&(Kl[N]||!Ut[N])},kn=function(N){let Y=$(N);(!Y||!Y.tagName)&&(Y={namespaceURI:Rn,tagName:"template"});const ae=Ho(N.tagName),we=Ho(Y.tagName);return gl[N.namespaceURI]?N.namespaceURI===Mn?kt(ae,Y,we):N.namespaceURI===gt?Tl(ae,Y,we):N.namespaceURI===bn?ln(ae,Y,we):!!(bl==="application/xhtml+xml"&&gl[N.namespaceURI]):!1},bt=function(N){sc(s.removed,{element:N});try{$(N).removeChild(N)}catch{if(T(N),!$(N))throw sr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ze=function(N){xn(N);const Y=L(N);if(Y){const we=[];lc(Y,ve=>{sc(we,ve)}),lc(we,ve=>{try{T(ve)}catch{}})}const ae=G(N);if(ae)for(let we=ae.length-1;we>=0;--we){const ve=ae[we],ze=ve&&ve.name;if(typeof ze=="string")try{N.removeAttribute(ze)}catch{}}},On=function(N,Y){try{sc(s.removed,{attribute:Y.getAttributeNode(N),from:Y})}catch{sc(s.removed,{attribute:null,from:Y})}if(Y.removeAttribute(N),N==="is")if(on||wn)try{bt(Y)}catch{}else try{Y.setAttribute(N,"")}catch{}},El=function(N){const Y=G(N);if(Y)for(let ae=Y.length-1;ae>=0;--ae){const we=Y[ae],ve=we&&we.name;if(!(typeof ve!="string"||tt[$e(ve)]))try{N.removeAttribute(ve)}catch{}}},xn=function(N){const Y=[N];for(;Y.length>0;){const ae=Y.pop();(O?O(ae):ae.nodeType)===Vl.element&&El(ae);const ve=L(ae);if(ve)for(let ze=ve.length-1;ze>=0;--ze)Y.push(ve[ze])}},Nn=function(N){if(!Ke)return;const Y=[N];for(;Y.length>0;){const ae=Y.pop(),we=O?O(ae):ae.nodeType;if(we===Vl.processingInstruction||we===Vl.comment&&Jn(lx,ae.data)){try{T(ae)}catch{}continue}if(we===Vl.element){const ze=ae,ot=$e(Z?Z(ae):ae.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&ot!=="label"&&ot!=="output"&&ze.removeAttribute("for")}catch{}}const ve=L(ae);if(ve)for(let ze=ve.length-1;ze>=0;--ze)Y.push(ve[ze])}},tl=function(N){let Y=null,ae=null;if(An)N="<remove></remove>"+N;else{const ze=Qb(N,/^[\r\n\t ]+/);ae=ze&&ze[0]}bl==="application/xhtml+xml"&&Rn===bn&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const we=M?ue(N):N;if(Rn===bn)try{Y=new _().parseFromString(we,bl)}catch{}if(!Y||!Y.documentElement){Y=A.createDocument(Rn,"template",null);try{Y.documentElement.innerHTML=ul?D:we}catch{}}const ve=Y.body||Y.documentElement;return N&&ae&&ve.insertBefore(r.createTextNode(ae),ve.childNodes[0]||null),Rn===bn?pe.call(Y,zt?"html":"body")[0]:zt?Y.documentElement:ve},ms=function(N){return fe.call(N.ownerDocument||N,N,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},yn=function(N){return N=Ao(N,V," "),N=Ao(N,ce," "),N=Ao(N,ge," "),N},Fl=function(N){var Y;N.normalize();const ae=fe.call(N.ownerDocument||N,N,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let we=ae.nextNode();for(;we;)we.data=yn(we.data),we=ae.nextNode();const ve=(Y=N.querySelectorAll)===null||Y===void 0?void 0:Y.call(N,"template");ve&&lc(ve,ze=>{nl(ze.content)&&Fl(ze.content)})},fl=function(N){const Y=Z?Z(N):null;return typeof Y!="string"||$e(Y)!=="form"?!1:typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||N.attributes!==G(N)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function"||N.nodeType!==O(N)||N.childNodes!==L(N)},nl=function(N){if(!O||typeof N!="object"||N===null)return!1;try{return O(N)===Vl.documentFragment}catch{return!1}},Ln=function(N){if(!O||typeof N!="object"||N===null)return!1;try{return typeof O(N)=="number"}catch{return!1}};function Ht(me,N,Y){me.length!==0&&lc(me,ae=>{ae.call(s,N,Y,vt)})}const Ia=function(N,Y){return!!(Ke&&N.hasChildNodes()&&!Ln(N.firstElementChild)&&Jn(nx,N.textContent)&&Jn(nx,N.innerHTML)||Ke&&N.namespaceURI===bn&&Y==="style"&&Ln(N.firstElementChild)||N.nodeType===Vl.processingInstruction||Ke&&N.nodeType===Vl.comment&&Jn(lx,N.data))},Hi=function(N,Y){if(!en[Y]&&qa(Y)&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,Y)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(Y)))return!1;if(Et&&!be[Y]){const ae=$(N),we=L(N);if(we&&ae){const ve=we.length;for(let ze=ve-1;ze>=0;--ze){const ot=Yn?we[ze]:C(we[ze],!0);ae.insertBefore(ot,E(N))}}}return bt(N),!0},Rs=function(N,Y){if(Ht(k.beforeSanitizeElements,N,null),N!==Y&&$(N)===null)return!0;if(fl(N))return bt(N),!0;const ae=$e(Z?Z(N):N.nodeName);if(Ht(k.uponSanitizeElement,N,{tagName:ae,allowedTags:Xe}),N!==Y&&$(N)===null)return!0;if(Ia(N,ae))return bt(N),!0;if(en[ae]||!(tn.tagCheck instanceof Function&&tn.tagCheck(ae))&&!Xe[ae]){const ve=Hi(N,ae);return ve===!1&&Ht(k.afterSanitizeElements,N,null),ve}if((O?O(N):N.nodeType)===Vl.element&&!kn(N)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&Jn(k1,N.innerHTML))return bt(N),!0;if(cn&&N.nodeType===Vl.text){const ve=yn(N.textContent);N.textContent!==ve&&(sc(s.removed,{element:N.cloneNode()}),N.textContent=ve)}return Ht(k.afterSanitizeElements,N,null),!1},Ds=function(N,Y,ae){if($t[Y]||Ke&&Y==="patchsrc"||Ke&&Y==="for"&&N!=="label"&&N!=="output"||Xt&&(Y==="id"||Y==="name")&&(ae in r||ae in xl))return!1;const we=tt[Y]||tn.attributeCheck instanceof Function&&tn.attributeCheck(Y,N);if(!(pn&&Jn(Ae,Y))){if(!(nn&&Jn(Se,Y))){if(we){if(!xe[Y]){if(!Jn(et,Ao(ae,Tt,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&N!=="script"&&Kb(ae,"data:")===0&&H[N])){if(!(Sn&&!Jn(Te,Ao(ae,Tt,"")))){if(ae)return!1}}}}}else if(!(qa(N)&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,N)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(N))&&(nt.attributeNameCheck instanceof RegExp&&Jn(nt.attributeNameCheck,Y)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(Y,N))||Y==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,ae)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(ae))))return!1}}return!0},yl=ht({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),qa=function(N){return!yl[Ho(N)]&&Jn(Ye,N)},zn=function(N,Y,ae,we){if(M&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ae)switch(j.getAttributeType(N,Y)){case"TrustedHTML":return ue(we);case"TrustedScriptURL":return _e(we)}return we},gs=function(N,Y,ae,we){try{ae?N.setAttributeNS(ae,Y,we):N.setAttribute(Y,we),fl(N)?bt(N):Vb(s.removed)}catch{On(Y,N)}},Jl=function(N){Ht(k.beforeSanitizeAttributes,N,null);const Y=N.attributes;if(!Y||fl(N))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:tt,forceKeepAttr:void 0};let we=Y.length;const ve=$e(N.nodeName);for(;we--;){const ze=Y[we],ot=ze.name,un=ze.namespaceURI,Mt=ze.value,mt=$e(ot),fn=Mt;let It=ot==="value"?fn:r1(fn);if(ae.attrName=mt,ae.attrValue=It,ae.keepAttr=!0,ae.forceKeepAttr=void 0,Ht(k.uponSanitizeAttribute,N,ae),It=ae.attrValue,wt&&(mt==="id"||mt==="name")&&Kb(It,Kt)!==0&&(On(ot,N),It=Kt+It),Ke&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){On(ot,N);continue}if(mt==="attributename"&&Qb(It,"href")){On(ot,N);continue}if(!ae.forceKeepAttr){if(!ae.keepAttr){On(ot,N);continue}if(!mn&&Jn(N1,It)){On(ot,N);continue}if(cn&&(It=yn(It)),!Ds(ve,mt,It)){On(ot,N);continue}It=zn(ve,mt,un,It),It!==fn&&gs(N,ot,un,It)}}Ht(k.afterSanitizeAttributes,N,null)},sn=function(N){let Y=null;const ae=ms(N);for(Ht(k.beforeSanitizeShadowDOM,N,null);Y=ae.nextNode();)if(Ht(k.uponSanitizeShadowNode,Y,null),Rs(Y,N),Jl(Y),nl(Y.content)&&sn(Y.content),(O?O(Y):Y.nodeType)===Vl.element){const ve=J(Y);nl(ve)&&(Bt(ve),sn(ve))}Ht(k.afterSanitizeShadowDOM,N,null)},Bt=function(N){const Y=[{node:N,shadow:null}];for(;Y.length>0;){const ae=Y.pop();if(ae.shadow){sn(ae.shadow);continue}const we=ae.node,ze=(O?O(we):we.nodeType)===Vl.element,ot=L(we);if(ot)for(let un=ot.length-1;un>=0;--un)Y.push({node:ot[un],shadow:null});if(ze){const un=Z?Z(we):null;if(typeof un=="string"&&$e(un)==="template"){const Mt=we.content;nl(Mt)&&Y.push({node:Mt,shadow:null})}}if(ze){const un=J(we);nl(un)&&Y.push({node:null,shadow:un},{node:un,shadow:null})}}};return s.sanitize=function(me){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,ae=null,we=null,ve=null;if(ul=!me,ul&&(me="<!-->"),typeof me!="string"&&!Ln(me)&&(me=d1(me),typeof me!="string"))throw sr("dirty is not a string, aborting");if(!s.isSupported)return me;gn?(Xe=ft,tt=Je):Zl(N),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(Xe=kl(Xe)),k.uponSanitizeAttribute.length>0&&(tt=kl(tt)),s.removed=[];const ze=Yn&&typeof me!="string"&&Ln(me);if(ze){Nn(me);const mt=Z?Z(me):me.nodeName;if(typeof mt=="string"){const fn=$e(mt);if(!Xe[fn]||en[fn])throw Ze(me),sr("root node is forbidden and cannot be sanitized in-place")}if(fl(me))throw Ze(me),sr("root node is clobbered and cannot be sanitized in-place");try{Bt(me)}catch(fn){throw Ze(me),fn}}else if(Ln(me))Y=tl("<!---->"),ae=Y.ownerDocument.importNode(me,!0),ae.nodeType===Vl.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?Y=ae:Y.appendChild(ae),Bt(ae);else{if(!on&&!cn&&!zt&&me.indexOf("<")===-1)return M&&Pn?ue(me):me;if(Y=tl(me),!Y)return on?null:Pn?D:""}Y&&An&&bt(Y.firstChild);const ot=ze?me:Y,un=ms(ot);try{for(;we=un.nextNode();)Rs(we,ot),Jl(we),nl(we.content)&&sn(we.content)}catch(mt){throw ze&&(Ze(me),lc(s.removed,fn=>{fn.element&&xn(fn.element)})),mt}if(ze)return lc(s.removed,mt=>{mt.element&&xn(mt.element)}),cn&&Fl(me),me;if(on){if(cn&&Fl(Y),wn)for(ve=z.call(Y.ownerDocument);Y.firstChild;)ve.appendChild(Y.firstChild);else ve=Y;return(tt.shadowroot||tt.shadowrootmode)&&(ve=ke.call(c,ve,!0)),ve}let Mt=zt?Y.outerHTML:Y.innerHTML;return zt&&Xe["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Jn(S1,Y.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
116
- `+Mt),cn&&(Mt=yn(Mt)),M&&Pn?ue(Mt):Mt},s.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zl(me),gn=!0,ft=Xe,Je=tt},s.clearConfig=function(){vt=null,gn=!1,ft=null,Je=null,M=B,D=""},s.isValidAttribute=function(me,N,Y){vt||Zl({});const ae=$e(me),we=$e(N);return Ds(ae,we,Y)},s.addHook=function(me,N){typeof N=="function"&&Wn(k,me)&&sc(k[me],N)},s.removeHook=function(me,N){if(Wn(k,me)){if(N!==void 0){const Y=a1(k[me],N);return Y===-1?void 0:i1(k[me],Y,1)[0]}return Vb(k[me])}},s.removeHooks=function(me){Wn(k,me)&&(k[me]=[])},s.removeAllHooks=function(){k=sx()},s}var C1=Cy();const A1=1024;let M1=0;class hs{constructor(s,r){this.from=s,this.to=r}}class Pt{constructor(s={}){this.id=M1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=As.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}Pt.closedBy=new Pt({deserialize:l=>l.split(" ")});Pt.openedBy=new Pt({deserialize:l=>l.split(" ")});Pt.group=new Pt({deserialize:l=>l.split(" ")});Pt.isolate=new Pt({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});Pt.contextHash=new Pt({perNode:!0});Pt.lookAhead=new Pt({perNode:!0});Pt.mounted=new Pt({perNode:!0});class dc{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[Pt.mounted.id]}}const R1=Object.create(null);class As{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):R1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new As(s.name||"",r,s.id,c);if(s.props){for(let d of s.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(Pt.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(Pt.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}As.none=new As("",Object.create(null),0,8);class Ay{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let d of s){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new As(c.name,o,c.id,c.flags):c)}return new Ay(r)}}const df=new WeakMap,ax=new WeakMap;var Jt;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(Jt||(Jt={}));class Bl{constructor(s,r,c,o,d){if(this.type=s,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let s=dc.get(this);if(s&&!s.overlay)return s.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(s=0){return new Hf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=df.get(this)||this.topNode,d=new Hf(o);return d.moveTo(s,r),df.set(this,d._tree),d}get topNode(){return new ml(this,0,0,null)}resolve(s,r=0){let c=qo(df.get(this)||this.topNode,s,r,!1);return df.set(this,c),c}resolveInner(s,r=0){let c=qo(ax.get(this)||this.topNode,s,r,!0);return ax.set(this,c),c}resolveStack(s,r=0){return L1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&Jt.IncludeAnonymous)>0;for(let g=this.cursor(h|Jt.IncludeAnonymous);;){let b=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;b=!0}for(;b&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;b=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Cp(As.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Bl(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Bl(As.none,r,c,o)))}static build(s){return z1(s)}}Bl.empty=new Bl(As.none,[],[],0);class Tp{constructor(s,r){this.buffer=s,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tp(this.buffer,this.index)}}class Ui{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return As.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),s+=4,c==s)return d;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return d+"("+h.join(",")+")"}findChild(s,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(My(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,d=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let b=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,b)}return new Ui(d,h,this.set)}}function My(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function qo(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof ml&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:Jt.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof ml&&h.index<0&&((o=m.enter(s,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,d);if(!h)return l;l=h}}class Ry{cursor(s=0){return new Hf(this,s)}getChild(s,r=null,c=null){let o=ix(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return ix(this,s,r,c)}resolve(s,r=0){return qo(this,s,r,!1)}resolveInner(s,r=0){return qo(this,s,r,!0)}matchContext(s){return up(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class ml extends Ry{constructor(s,r,c,o){super(),this._tree=s,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(s,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,b=r>0?m.length:-1;s!=b;s+=r){let _=m[s],j=g[s]+h.from,v;if(!(!(d&Jt.EnterBracketed&&_ instanceof Bl&&(v=dc.get(_))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+_.length)&&!My(o,c,j,j+_.length))){if(_ instanceof Ui){if(d&Jt.ExcludeBuffers)continue;let C=_.findChild(0,_.buffer.length,r,c-j,o);if(C>-1)return new ia(new D1(h,_,s,j),null,C)}else if(d&Jt.IncludeAnonymous||!_.type.isAnonymous||Ep(_)){let C;if(!(d&Jt.IgnoreMounts)&&(C=dc.get(_))&&!C.overlay)return new ml(C.tree,j,s,h);let T=new ml(_,j,s,h);return d&Jt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?_.children.length-1:0,r,c,o,d)}}}if(d&Jt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&Jt.IgnoreOverlays)&&(o=dc.get(this._tree))&&o.overlay){let d=s-this.from,h=c&Jt.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=d:m<d)&&(r<0||h?g>=d:g>d))return new ml(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ix(l,s,r,c){let o=l.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(s)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function up(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class D1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class ia extends Ry{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return d<0?null:new ia(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&Jt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return d<0?null:new ia(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new ia(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new ia(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];s.push(c.slice(o,d,h)),r.push(0)}return new Bl(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Dy(l){if(!l.length)return null;let s=0,r=l[0];for(let d=1;d<l.length;d++){let h=l[d];(h.from>r.from||h.to<r.to)&&(r=h,s=d)}let c=r instanceof ml&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new O1(o,r)}class O1{constructor(s,r){this.heads=s,this.node=r}get next(){return Dy(this.heads)}}function L1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof ml?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(s,r)),d=h}else{let h=dc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new ml(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(qo(m,s,r,!1))}}return o?Dy(o):c}class Hf{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Jt.EnterBracketed,s instanceof ml)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof ml?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&Jt.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&Jt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+s,h=s<0?-1:c._tree.children.length;d!=h;d+=s){let m=c._tree.children[d];if(this.mode&Jt.IncludeAnonymous||m instanceof Ui||!m.type.isAnonymous||Ep(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new ia(this.buffer,r,this.stack[o]);return this.bufferNode=new ia(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return up(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return up(this._tree,s,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Ep(l){return l.children.some(s=>s instanceof Ui||!s.type.isAnonymous||Ep(s))}function z1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=A1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Tp(r,r.length):r,g=c.types,b=0,_=0;function j(Z,M,D,B,ne,he){let{id:P,start:ue,end:_e,size:De}=m,Ne=_,A=b;if(De<0)if(m.next(),De==-1){let k=d[P];D.push(k),B.push(ue-Z);return}else if(De==-3){b=P;return}else if(De==-4){_=P;return}else throw new RangeError(`Unrecognized record size: ${De}`);let fe=g[P],z,pe,ke=ue-Z;if(_e-ue<=o&&(pe=L(m.pos-M,ne))){let k=new Uint16Array(pe.size-pe.skip),V=m.pos-pe.size,ce=k.length;for(;m.pos>V;)ce=$(pe.start,k,ce);z=new Ui(k,_e-pe.start,c),ke=pe.start-Z}else{let k=m.pos-De;m.next();let V=[],ce=[],ge=P>=h?P:-1,Ae=0,Se=_e;for(;m.pos>k;)ge>=0&&m.id==ge&&m.size>=0?(m.end<=Se-o&&(T(V,ce,ue,Ae,m.end,Se,ge,Ne,A),Ae=V.length,Se=m.end),m.next()):he>2500?v(ue,k,V,ce):j(ue,k,V,ce,ge,he+1);if(ge>=0&&Ae>0&&Ae<V.length&&T(V,ce,ue,Ae,ue,Se,ge,Ne,A),V.reverse(),ce.reverse(),ge>-1&&Ae>0){let Te=C(fe,A);z=Cp(fe,V,ce,0,V.length,0,_e-ue,Te,Te)}else z=E(fe,V,ce,_e-ue,Ne-_e,A)}D.push(z),B.push(ke)}function v(Z,M,D,B){let ne=[],he=0,P=-1;for(;m.pos>M;){let{id:ue,start:_e,end:De,size:Ne}=m;if(Ne>4)m.next();else{if(P>-1&&_e<P)break;P<0&&(P=De-o),ne.push(ue,_e,De),he++,m.next()}}if(he){let ue=new Uint16Array(he*4),_e=ne[ne.length-2];for(let De=ne.length-3,Ne=0;De>=0;De-=3)ue[Ne++]=ne[De],ue[Ne++]=ne[De+1]-_e,ue[Ne++]=ne[De+2]-_e,ue[Ne++]=Ne;D.push(new Ui(ue,ne[2]-_e,c)),B.push(_e-Z)}}function C(Z,M){return(D,B,ne)=>{let he=0,P=D.length-1,ue,_e;if(P>=0&&(ue=D[P])instanceof Bl){if(!P&&ue.type==Z&&ue.length==ne)return ue;(_e=ue.prop(Pt.lookAhead))&&(he=B[P]+ue.length+_e)}return E(Z,D,B,ne,he,M)}}function T(Z,M,D,B,ne,he,P,ue,_e){let De=[],Ne=[];for(;Z.length>B;)De.push(Z.pop()),Ne.push(M.pop()+D-ne);Z.push(E(c.types[P],De,Ne,he-ne,ue-he,_e)),M.push(ne-D)}function E(Z,M,D,B,ne,he,P){if(he){let ue=[Pt.contextHash,he];P=P?[ue].concat(P):[ue]}if(ne>25){let ue=[Pt.lookAhead,ne];P=P?[ue].concat(P):[ue]}return new Bl(Z,M,D,B,P)}function L(Z,M){let D=m.fork(),B=0,ne=0,he=0,P=D.end-o,ue={size:0,start:0,skip:0};e:for(let _e=D.pos-Z;D.pos>_e;){let De=D.size;if(D.id==M&&De>=0){ue.size=B,ue.start=ne,ue.skip=he,he+=4,B+=4,D.next();continue}let Ne=D.pos-De;if(De<0||Ne<_e||D.start<P)break;let A=D.id>=h?4:0,fe=D.start;for(D.next();D.pos>Ne;){if(D.size<0)if(D.size==-3||D.size==-4)A+=4;else break e;else D.id>=h&&(A+=4);D.next()}ne=fe,B+=De,he+=A}return(M<0||B==Z)&&(ue.size=B,ue.start=ne,ue.skip=he),ue.size>4?ue:void 0}function $(Z,M,D){let{id:B,start:ne,end:he,size:P}=m;if(m.next(),P>=0&&B<h){let ue=D;if(P>4){let _e=m.pos-(P-4);for(;m.pos>_e;)D=$(Z,M,D)}M[--D]=ue,M[--D]=he-Z,M[--D]=ne-Z,M[--D]=B}else P==-3?b=B:P==-4&&(_=B);return D}let J=[],G=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,J,G,-1,0);let O=(s=l.length)!==null&&s!==void 0?s:J.length?G[0]+J[0].length:0;return new Bl(g[l.topID],J.reverse(),G.reverse(),O)}const rx=new WeakMap;function Df(l,s){if(!l.isAnonymous||s instanceof Ui||s.type!=l)return 1;let r=rx.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof Bl)){r=1;break}r+=Df(l,c)}rx.set(s,r)}return r}function Cp(l,s,r,c,o,d,h,m,g){let b=0;for(let T=c;T<o;T++)b+=Df(l,s[T]);let _=Math.ceil(b*1.5/8),j=[],v=[];function C(T,E,L,$,J){for(let G=L;G<$;){let O=G,Z=E[G],M=Df(l,T[G]);for(G++;G<$;G++){let D=Df(l,T[G]);if(M+D>=_)break;M+=D}if(G==O+1){if(M>_){let D=T[O];C(D.children,D.positions,0,D.children.length,E[O]+J);continue}j.push(T[O])}else{let D=E[G-1]+T[G-1].length-Z;j.push(Cp(l,T,E,O,G,Z,D,null,g))}v.push(Z+J-d)}}return C(s,r,c,o,0),(m||g)(j,v,h)}class ON{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof ia?this.setBuffer(s.context.buffer,s.index,r):s instanceof ml&&this.map.set(s.tree,r)}get(s){return s instanceof ia?this.getBuffer(s.context.buffer,s.index):s instanceof ml?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class Go{constructor(s,r,c,o,d=!1,h=!1){this.from=s,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,r=[],c=!1){let o=[new Go(0,s.length,s,0,!1,c)];for(let d of r)d.to>s.length&&o.push(d);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],d=1,h=s.length?s[0]:null;for(let m=0,g=0,b=0;;m++){let _=m<r.length?r[m]:null,j=_?_.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||b){let C=Math.max(v.from,g)-b,T=Math.min(v.to,j)-b;v=C>=T?null:new Go(C,T,v.tree,v.offset+b,m>0,!!_)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!_)break;g=_.toA,b=_.toA-_.toB}return o}}class LN{startParse(s,r,c){return typeof s=="string"&&(s=new U1(s)),c=c?c.length?c.map(o=>new hs(o.from,o.to)):[new hs(0,0)]:[new hs(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class U1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function zN(l){return(s,r,c,o)=>new B1(s,l,r,c,o)}class cx{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function ox(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class H1{constructor(s,r,c,o,d,h,m,g){this.parser=s,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const fp=new Pt({perNode:!0});class B1{constructor(s,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Bl(c.type,c.children,c.positions,c.length,c.propValues.concat([[fp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[Pt.mounted.id]=new dc(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new G1(this.fragments),r=null,c=null,o=new Hf(new ml(this.baseTree,this.ranges[0].from,0,null),Jt.IncludeAnonymous|Jt.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(r){let b=r.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(b)for(let _ of b.mount.overlay){let j=_.from+b.pos,v=_.to+b.pos;j>=o.from&&v<=o.to&&!r.ranges.some(C=>C.from<v&&C.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=I1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(q1(o),r&&r.depth++,c&&c.depth++);let b=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new H1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=dx(this.ranges,d.overlay||(o.from<o.to?[new hs(o.from,o.to)]:[]));_.length&&ox(_),(_.length||!d.overlay)&&this.inner.push(new cx(d.parser,_.length?d.parser.startParse(this.input,hx(b,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new hs(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new hs(o.from,o.to)),g.from<g.to)){let b=r.ranges.length-1;b>=0&&r.ranges[b].to==g.from?r.ranges[b]={from:r.ranges[b].from,to:g.to}:r.ranges.push(g)}if(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let b=dx(this.ranges,r.ranges);b.length&&(ox(b),this.inner.splice(r.index,0,new cx(r.parser,r.parser.startParse(this.input,hx(r.mounts,b),b),r.ranges.map(_=>new hs(_.from-r.start,_.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function I1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function ux(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function q1(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function b(_,j,v,C,T,E){let L=r[E],$=[],J=[];ux(h,_,L,$,J,C);let G=m[L+1],O=m[L+2];g.push($.length);let Z=E?b(L+4,m[L+3],h.set.types[m[L]],G,O-G,E-1):s.toTree();return $.push(Z),J.push(G-C),ux(h,m[L+3],j,$,J,C),new Bl(v,$,J,T)}o.children[d]=b(0,m.length,As.none,0,h.length,r.length-1);for(let _ of g){let j=l.tree.children[_],v=l.tree.positions[_];l.yield(new ml(j,v+l.from,_,l._tree))}}class fx{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(Jt.IncludeAnonymous|Jt.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,Jt.IgnoreOverlays|Jt.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Bl)r=r.children[0];else break}return!1}}class G1{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(fp))!==null&&r!==void 0?r:c.to,this.inner=new fx(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(fp))!==null&&s!==void 0?s:r.to,this.inner=new fx(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Pt.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=d.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:d.from-g.offset,mount:h})}}}return o}}function dx(l,s){let r=null,c=s;for(let o=1,d=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[d]=new hs(g.from,h),g.to>m&&r.splice(d+1,0,new hs(m,g.to))):g.to>m?r[d--]=new hs(m,g.to):r.splice(d--,1))}}return c}function Y1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let _=o==l.length?1e9:h?l[o].to:l[o].from,j=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),C=Math.min(_,j,c);v<C&&b.push(new hs(v,C))}if(g=Math.min(_,j),g==1e9)break;_==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return b}function hx(l,s){let r=[];for(let{pos:c,mount:o,frag:d}of l){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),b=Math.min(d.to,m);if(o.overlay){let _=o.overlay.map(v=>new hs(v.from+c,v.to+c)),j=Y1(s,_,g,b);for(let v=0,C=g;;v++){let T=v==j.length,E=T?b:j[v].from;if(E>C&&r.push(new Go(C,E,o.tree,-h,d.from>=C||d.openStart,d.to<=E||d.openEnd)),T)break;C=j[v].to}}else r.push(new Go(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let $1=0;class ds{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=$1++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof ds&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new ds(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(s){let r=new Bf(s);return c=>c.modified.indexOf(r)>-1?c:Bf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let X1=0;class Bf{constructor(s){this.name=s,this.instances=[],this.id=X1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&V1(r,m.modified));if(c)return c;let o=[],d=new ds(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=Q1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Bf.get(m,g));return d}}function V1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Q1(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function UN(l){let s=Object.create(null);for(let r in l){let c=l[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let _=new Yo(c,h,g>0?d.slice(0,g):null);s[b]=_.sort(s[b])}}return Oy.add(s)}const Oy=new Pt({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new Yo(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Yo{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}Yo.empty=new Yo([],2,null);function Ly(l,s){let r=Object.create(null);for(let d of l)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=s||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let b=r[g.id];if(b){h=h?h+" "+b:b;break}}return h},scope:c}}function K1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function Z1(l,s,r,c=0,o=l.length){let d=new J1(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function F1(l,s,r,c,o,d=0,h=l.length){let m=d;function g(b,_){if(!(b<=m)){for(let j=l.slice(m,b),v=0;;){let C=j.indexOf(`
117
- `,v),T=C<0?j.length:C;if(T>v&&c(j.slice(v,T),_),C<0)break;o(),v=C+1}m=b}}Z1(s,r,(b,_,j)=>{g(b,""),g(_,j)},d,h),g(h,"")}class J1{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,d){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(C=>!C.scope||C.scope(h)));let b=o,_=W1(s)||Yo.empty,j=K1(d,_.tags);if(j&&(b&&(b+=" "),b+=j,_.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),b),_.opaque)return;let v=s.tree&&s.tree.prop(Pt.mounted);if(v&&v.overlay){let C=s.node.enter(v.overlay[0].from+m,1),T=this.highlighters.filter(L=>!L.scope||L.scope(v.tree.type)),E=s.firstChild();for(let L=0,$=m;;L++){let J=L<v.overlay.length?v.overlay[L]:null,G=J?J.from+m:g,O=Math.max(r,$),Z=Math.min(c,G);if(O<Z&&E)for(;s.from<Z&&(this.highlightRange(s,O,Z,o,d),this.startSpan(Math.min(Z,s.to),b),!(s.to>=G||!s.nextSibling())););if(!J||G>c)break;$=J.to+m,$>r&&(this.highlightRange(C.cursor(),Math.max(r,J.from+m),Math.min(c,$),"",T),this.startSpan(Math.min(c,$),b))}E&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),b)}while(s.nextSibling());s.parent()}}}function W1(l){let s=l.type.prop(Oy);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const je=ds.define,hf=je(),Ri=je(),px=je(Ri),mx=je(Ri),Di=je(),pf=je(Di),$h=je(Di),na=je(),ar=je(na),Js=je(),Ws=je(),dp=je(),Ro=je(dp),mf=je(),Ce={comment:hf,lineComment:je(hf),blockComment:je(hf),docComment:je(hf),name:Ri,variableName:je(Ri),typeName:px,tagName:je(px),propertyName:mx,attributeName:je(mx),className:je(Ri),labelName:je(Ri),namespace:je(Ri),macroName:je(Ri),literal:Di,string:pf,docString:je(pf),character:je(pf),attributeValue:je(pf),number:$h,integer:je($h),float:je($h),bool:je(Di),regexp:je(Di),escape:je(Di),color:je(Di),url:je(Di),keyword:Js,self:je(Js),null:je(Js),atom:je(Js),unit:je(Js),modifier:je(Js),operatorKeyword:je(Js),controlKeyword:je(Js),definitionKeyword:je(Js),moduleKeyword:je(Js),operator:Ws,derefOperator:je(Ws),arithmeticOperator:je(Ws),logicOperator:je(Ws),bitwiseOperator:je(Ws),compareOperator:je(Ws),updateOperator:je(Ws),definitionOperator:je(Ws),typeOperator:je(Ws),controlOperator:je(Ws),punctuation:dp,separator:je(dp),bracket:Ro,angleBracket:je(Ro),squareBracket:je(Ro),paren:je(Ro),brace:je(Ro),content:na,heading:ar,heading1:je(ar),heading2:je(ar),heading3:je(ar),heading4:je(ar),heading5:je(ar),heading6:je(ar),contentSeparator:je(na),list:je(na),quote:je(na),emphasis:je(na),strong:je(na),link:je(na),monospace:je(na),strikethrough:je(na),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:mf,documentMeta:je(mf),annotation:je(mf),processingInstruction:je(mf),definition:ds.defineModifier("definition"),constant:ds.defineModifier("constant"),function:ds.defineModifier("function"),standard:ds.defineModifier("standard"),local:ds.defineModifier("local"),special:ds.defineModifier("special")};for(let l in Ce){let s=Ce[l];s instanceof ds&&(s.name=l)}Ly([{tag:Ce.link,class:"tok-link"},{tag:Ce.heading,class:"tok-heading"},{tag:Ce.emphasis,class:"tok-emphasis"},{tag:Ce.strong,class:"tok-strong"},{tag:Ce.keyword,class:"tok-keyword"},{tag:Ce.atom,class:"tok-atom"},{tag:Ce.bool,class:"tok-bool"},{tag:Ce.url,class:"tok-url"},{tag:Ce.labelName,class:"tok-labelName"},{tag:Ce.inserted,class:"tok-inserted"},{tag:Ce.deleted,class:"tok-deleted"},{tag:Ce.literal,class:"tok-literal"},{tag:Ce.string,class:"tok-string"},{tag:Ce.number,class:"tok-number"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],class:"tok-string2"},{tag:Ce.variableName,class:"tok-variableName"},{tag:Ce.local(Ce.variableName),class:"tok-variableName tok-local"},{tag:Ce.definition(Ce.variableName),class:"tok-variableName tok-definition"},{tag:Ce.special(Ce.variableName),class:"tok-variableName2"},{tag:Ce.definition(Ce.propertyName),class:"tok-propertyName tok-definition"},{tag:Ce.typeName,class:"tok-typeName"},{tag:Ce.namespace,class:"tok-namespace"},{tag:Ce.className,class:"tok-className"},{tag:Ce.macroName,class:"tok-macroName"},{tag:Ce.propertyName,class:"tok-propertyName"},{tag:Ce.operator,class:"tok-operator"},{tag:Ce.comment,class:"tok-comment"},{tag:Ce.meta,class:"tok-meta"},{tag:Ce.invalid,class:"tok-invalid"},{tag:Ce.punctuation,class:"tok-punctuation"}]);const P1="modulepreload",ej=function(l,s){return new URL(l,s).href},gx={},Qe=function(s,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(_=>{if(_=ej(_,c),_ in gx)return;gx[_]=!0;const j=_.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let E=m.length-1;E>=0;E--){const L=m[E];if(L.href===_&&(!j||L.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":P1,j||(T.as="script"),T.crossOrigin="",T.href=_,b&&T.setAttribute("nonce",b),document.head.appendChild(T),j)return new Promise((E,L)=>{T.addEventListener("load",E),T.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${_}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return s().catch(d)})},zy={js:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-D5k_lqHb.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Qe(async()=>{const{json:l}=await import("./index-C13Jucn1.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Qe(async()=>{const{json:l}=await import("./index-C13Jucn1.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Qe(async()=>{const{css:l}=await import("./index-D37eFo7a.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Qe(async()=>{const{css:l}=await import("./index-D37eFo7a.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Qe(async()=>{const{css:l}=await import("./index-D37eFo7a.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Qe(async()=>{const{html:l}=await import("./index-BUWJHuYf.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Qe(async()=>{const{html:l}=await import("./index-BUWJHuYf.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Qe(async()=>{const{html:l}=await import("./index-BUWJHuYf.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Qe(async()=>{const{html:l}=await import("./index-BUWJHuYf.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Qe(async()=>{const{markdown:l}=await import("./index-Dj1v9Gkj.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Qe(async()=>{const{markdown:l}=await import("./index-Dj1v9Gkj.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Qe(async()=>{const{python:l}=await import("./index-BfxQTveJ.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Qe(async()=>{const{python:l}=await import("./index-BfxQTveJ.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Qe(async()=>{const{yaml:l}=await import("./index-DmaRIPd6.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Qe(async()=>{const{yaml:l}=await import("./index-DmaRIPd6.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Qe(async()=>{const{rust:l}=await import("./index-BJqZWIPR.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-BuyfXyo4.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-BuyfXyo4.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-BuyfXyo4.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-BuyfXyo4.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-BuyfXyo4.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Qe(async()=>{const{java:l}=await import("./index-Dvlp7Iqq.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Qe(async()=>{const{go:l}=await import("./index-DNoT5Ala.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Qe(async()=>{const{php:l}=await import("./index-3sshvreD.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Qe(async()=>{const{sql:l}=await import("./index-Drc8TpEz.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Qe(async()=>{const{xml:l}=await import("./index-B7ozEwgu.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Qe(async()=>{const{xml:l}=await import("./index-B7ozEwgu.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},tj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},nj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function lj(l){const s=nj[l.toLowerCase()]??l.toLowerCase(),r=zy[s];return r?r().catch(()=>null):null}async function sj(l){const s=(l.split("/").pop()??"").toLowerCase(),r=tj[s]??s.split(".").pop()??"",c=zy[r];return c?c().catch(()=>null):null}const aj=Ly([{tag:[Ce.keyword,Ce.modifier,Ce.controlKeyword,Ce.moduleKeyword],class:"cmh-key"},{tag:[Ce.propertyName],class:"cmh-prop"},{tag:[Ce.function(Ce.variableName),Ce.labelName],class:"cmh-fn"},{tag:[Ce.color,Ce.constant(Ce.name),Ce.standard(Ce.name),Ce.bool],class:"cmh-const"},{tag:[Ce.typeName,Ce.className,Ce.changed,Ce.annotation,Ce.self,Ce.namespace],class:"cmh-type"},{tag:[Ce.number,Ce.integer,Ce.float],class:"cmh-num"},{tag:[Ce.string,Ce.special(Ce.string),Ce.regexp],class:"cmh-str"},{tag:[Ce.operator,Ce.operatorKeyword,Ce.escape],class:"cmh-op"},{tag:[Ce.meta,Ce.comment],class:"cmh-comment"},{tag:Ce.invalid,class:"cmh-invalid"}]);function gf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function ij(l,s){const r=s?await lj(s):null;if(!r)return gf(l);try{const c=r.language.parser.parse(l);let o="";return F1(l,c,aj,(d,h)=>{o+=h?`<span class="${h}">${gf(d)}</span>`:gf(d)},()=>{o+=`
118
- `}),o}catch{return gf(l)}}Nt.setOptions({gfm:!0,breaks:!1});function Uy(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function Qf(l){const s=await Nt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await ij(c.text,c.lang??""),c.escaped=!0}});return C1.sanitize(s)}function bx(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:Uy(l.path)}}function Ua(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function rj(l){return l.split("/").pop()??l}function gr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Of(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function or({x:l,y:s,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,m]=y.useState({left:l,top:s}),[g,b]=y.useState(()=>{const v=r.findIndex(C=>!C.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),T=8,E=Math.max(T,Math.min(l,window.innerWidth-C.width-T)),L=Math.max(T,Math.min(s,window.innerHeight-C.height-T));m({left:E,top:L})},[l,s]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(T){var E;(E=d.current)!=null&&E.contains(T.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 _(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=r.map((T,E)=>({item:T,index:E})).filter(T=>!T.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,E=C.findIndex($=>$.index===g),L=C[(((E===-1?0:E)+T)%C.length+C.length)%C.length];L&&b(L.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=r[g];T&&_(T)}}}return i.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,C)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===g?" is-cursor":""),onMouseEnter:()=>b(C),onClick:()=>_(v),children:[i.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&i.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const cj=3500,oj=9e3,xx=220;function _r({result:l,onDismiss:s}){const[r,c]=y.useState(l),[o,d]=y.useState(!1);if(y.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?cj:oj,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+xx);return()=>{clearTimeout(g),clearTimeout(b)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},xx)};return i.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&i.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&s&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function aa({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=y.useState(l),m=y.useRef(null);y.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===l)return o();c(b)}return i.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:b=>h(b.target.value),onBlur:g,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),o())}})}function kc({active:l}){return l?i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 5h3V2"}),i.jsx("path",{d:"M14 5h-3V2"}),i.jsx("path",{d:"M2 11h3v3"}),i.jsx("path",{d:"M14 11h-3v3"})]}):i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 2H2v3"}),i.jsx("path",{d:"M11 2h3v3"}),i.jsx("path",{d:"M2 11v3h3"}),i.jsx("path",{d:"M14 11v3h-3"})]})}const uj=500,ir="application/x-ccv-fs-path",fj=200;function dj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:_,onOpen:j,onCreate:v,onRename:C,onMove:T,onCopy:E,onDelete:L,onRefresh:$,onClose:J,zoomed:G,onToggleZoom:O}){const[Z,M]=y.useState(""),[D,B]=y.useState(null),[ne,he]=y.useState(null),[P,ue]=y.useState(null),[_e,De]=y.useState(null),[Ne,A]=y.useState(null),[fe,z]=y.useState(null),pe=$f("(hover: hover)"),ke=y.useRef(null),k=y.useMemo(()=>mj(d),[d]);function V(le){return!(!P||le===P.path||P.kind==="dir"&&le.startsWith(`${P.path}/`)||le===gr(P.path))}function ce(le){return!(!Ne||le===Ne.path||Ne.kind==="dir"&&le.startsWith(`${Ne.path}/`)||Ne.mode==="cut"&&le===gr(Ne.path))}function ge(le){A({path:le.path,kind:le.kind,mode:"copy"})}function Ae(le){A({path:le.path,kind:le.kind,mode:"cut"})}function Se(le){!Ne||!ce(le)||(le&&!r.has(le)&&_(le),Ne.mode==="cut"?(T(Ne.path,le),A(null)):E(Ne.path,le))}function Te(le,be){const Le=le.touches[0];if(!Le)return;const H={timer:0,x:Le.clientX,y:Le.clientY,el:le.currentTarget,fired:!1};H.timer=window.setTimeout(()=>{H.fired=!0,be(H.x,H.y,H.el)},uj),ke.current=H}function Tt(le){const be=ke.current,Le=le.touches[0];!be||!Le||Math.hypot(Le.clientX-be.x,Le.clientY-be.y)>10&&(window.clearTimeout(be.timer),ke.current=null)}function Ye(le){const be=ke.current;be&&(window.clearTimeout(be.timer),be.fired&&le.preventDefault())}function et(){var le;return(le=ke.current)!=null&&le.fired?(ke.current=null,!0):!1}function Xe(le,be,Le,H){M((H==null?void 0:H.path)??""),z({x:le,y:be,opener:Le,entry:H})}function Qt(){const le=fe==null?void 0:fe.opener;z(null),le!=null&&le.isConnected&&le.focus()}function tt(le){return{onContextMenu:be=>{be.preventDefault(),Xe(be.clientX,be.clientY,be.currentTarget,le)},onTouchStart:be=>Te(be,(Le,H,W)=>Xe(Le,H,W,le)),onTouchMove:Tt,onTouchEnd:Ye,onTouchCancel:Ye}}function Yt(le){le.target===le.currentTarget&&(le.preventDefault(),Xe(le.clientX,le.clientY,le.currentTarget,null))}function nt(le){le.target===le.currentTarget&&Te(le,(be,Le,H)=>Xe(be,Le,H,null))}function en(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const be=le.key.toLowerCase();if(be==="v"){le.preventDefault(),Se(Pn());return}if(!Z)return;const Le=yx(s,Z);Le&&(be==="c"?(le.preventDefault(),ge(Le)):be==="x"&&(le.preventDefault(),Ae(Le)))}function $t(le){return be=>{be.dataTransfer.effectAllowed="move",be.dataTransfer.setData(ir,le.path),ue({path:le.path,kind:le.kind})}}function tn(){ue(null),De(null)}function nn(le){return be=>{be.dataTransfer.types.includes(ir)&&(be.stopPropagation(),!(le.kind!=="dir"||!V(le.path))&&(be.preventDefault(),De(le.path)))}}function pn(le){return be=>{if(!be.dataTransfer.types.includes(ir)||(be.stopPropagation(),le.kind!=="dir"||!V(le.path)))return;be.preventDefault();const Le=be.dataTransfer.getData(ir);De(null),Le&&T(Le,le.path)}}function Sn(le){!le.dataTransfer.types.includes(ir)||!V("")||(le.preventDefault(),De(""))}function mn(le){if(!le.dataTransfer.types.includes(ir)||!V(""))return;le.preventDefault();const be=le.dataTransfer.getData(ir);De(null),be&&T(be,"")}const[cn,Ke]=y.useState(""),zt=cn.trim(),gn=zt.length>0,ft=y.useRef(null),Je=y.useRef(g);Je.current=g;function An(le){Ke(le),ft.current&&clearTimeout(ft.current);const be=le.trim();if(!be){Je.current("");return}ft.current=setTimeout(()=>Je.current(be),fj)}function on(le){ft.current&&clearTimeout(ft.current),Ke(""),Je.current(""),M(le.path),b(le)}const wn=gn&&(m==null?void 0:m.query)===zt?m:null;function Pn(){if(Z==="")return"";const le=yx(s,Z);if((le==null?void 0:le.kind)==="dir")return Z;const be=Z.lastIndexOf("/");return be===-1?"":Z.slice(0,be)}function Xt(le,be){const Le=be??Pn();Le&&!r.has(Le)&&_(Le),he({parent:Le,kind:le})}function wt(){if(!fe)return[];const le=H=>pe?H:void 0;if(!fe.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:le("Ctrl+V"),disabled:!ce(""),onSelect:()=>Se("")},{id:"new-file",label:"Создать файл",onSelect:()=>Xt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Xt("dir","")}];const be=fe.entry,Le=[be.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(be.path)}:{id:"toggle",label:r.has(be.path)?"Свернуть":"Развернуть",onSelect:()=>_(be.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>ge(be)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>Ae(be)}];return be.kind==="dir"&&(Le.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!ce(be.path),onSelect:()=>Se(be.path)}),Le.push({id:"new-file",label:"Создать файл",onSelect:()=>Xt("file",be.path)}),Le.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Xt("dir",be.path)})),Le.push({id:"rename",label:"Переименовать",onSelect:()=>B(be.path)}),Le.push({id:"delete",label:"Удалить",onSelect:()=>L(be)}),Le}const Kt=gn?[]:Et("",0);function Et(le,be){const Le=s[le],H=[];if(ne&&ne.parent===le&&H.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:Ha(be),children:[i.jsx("span",{className:"fsrow__icon",children:ne.kind==="dir"?i.jsx(qf,{}):i.jsx(Gf,{})}),i.jsx(aa,{className:"rename--file",value:"",placeholder:ne.kind==="dir"?"имя каталога":"имя файла",onCommit:W=>{he(null),v(le,ne.kind,W)},onCancel:()=>he(null)})]},`draft:${le}`)),!Le)return H.push(i.jsx("p",{className:"fsrow__pending",style:Ha(be),children:"читаем…"},`wait:${le}`)),H;Le.length===0&&!ne&&H.push(i.jsx("p",{className:"fsrow__pending",style:Ha(be),children:"пусто"},`empty:${le}`));for(const W of Le){const xe=W.kind==="dir"&&r.has(W.path);H.push(D===W.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:Ha(be),children:[i.jsx("span",{className:"fsrow__icon",children:W.kind==="dir"?i.jsx(qf,{open:xe}):i.jsx(Gf,{})}),i.jsx(aa,{className:"rename--file",value:W.name,placeholder:"новое имя",onCommit:Be=>{B(null),C(W.path,Be)},onCancel:()=>B(null)})]},W.path):i.jsx(hj,{entry:W,depth:be,open:xe,active:W.path===c,selected:W.path===Z,dirty:o.has(W.path),gitStatus:k.get(W.path),dragging:(P==null?void 0:P.path)===W.path,dropTarget:_e===W.path,cut:(Ne==null?void 0:Ne.mode)==="cut"&&Ne.path===W.path,onClick:()=>{et()||(M(W.path),W.kind==="dir"?_(W.path):j(W.path))},onRename:()=>B(W.path),onDelete:()=>L(W),onDragStart:$t(W),onDragEnd:tn,onDragOver:nn(W),onDrop:pn(W),...tt(W)},W.path)),xe&&H.push(...Et(W.path,be+1))}return H}function Yn(){if(!wn)return[i.jsx("p",{className:"fsrow__pending",style:Ha(0),children:"ищем…"},"search:wait")];if(wn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:Ha(0),children:"ничего не найдено"},"search:empty")];const le=wn.entries.map(be=>i.jsx(pj,{entry:be,gitStatus:k.get(be.path),onClick:()=>on(be)},be.path));return wn.truncated&&le.push(i.jsxs("p",{className:"fsrow__pending",style:Ha(0),children:["показаны первые ",wn.entries.length," — уточните запрос"]},"search:truncated")),le}return i.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(G?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:en,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{O&&(le.target.closest("button")||O())},children:[i.jsx(yj,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Xt("file"),children:i.jsx(bj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Xt("dir"),children:i.jsx(xj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:$,children:"↻"}),O&&i.jsx("button",{className:"sidepane__btn",title:G?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":G?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":G,onClick:O,children:i.jsx(kc,{active:G})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:J,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(_j,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:cn,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>An(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),cn?An(""):le.currentTarget.blur())}}),cn&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>An(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(_e===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Sn,onDrop:mn,onContextMenu:Yt,onTouchStart:nt,onTouchMove:Tt,onTouchEnd:Ye,onTouchCancel:Ye,children:gn?Yn():Kt}),i.jsx(_r,{result:h}),fe&&i.jsx(or,{x:fe.x,y:fe.y,items:wt(),onClose:Qt})]})}function hj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:_,onRename:j,onDelete:v,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:L,onContextMenu:$,onTouchStart:J,onTouchMove:G,onTouchEnd:O,onTouchCancel:Z}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return i.jsxs("div",{className:M,style:Ha(s),draggable:!0,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:L,onContextMenu:$,onTouchStart:J,onTouchMove:G,onTouchEnd:O,onTouchCancel:Z,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:Hy(l),children:[i.jsx("span",{className:"fsrow__icon"+If("fsrow__icon",h),children:l.kind==="dir"?i.jsx(qf,{open:r}):i.jsx(Gf,{})}),i.jsx("span",{className:"fsrow__name"+If("fsrow__name",h),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&i.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),i.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${l.name}`,onClick:j,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function pj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Ha(0),onClick:r,title:Hy(l),children:[i.jsx("span",{className:"fsrow__icon"+If("fsrow__icon",s),children:l.kind==="dir"?i.jsx(qf,{}):i.jsx(Gf,{})}),i.jsx("span",{className:"fsrow__name"+If("fsrow__name",s),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function Hy(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Ha(l){return{"--depth":l}}function yx(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function mj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=gj(o.status);if(!d)continue;c(o.path,d);let h=gr(o.path);for(;c(h,d),!!h;)h=gr(h)}return s}function gj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function If(l,s){return s?` ${l}--git-${s}`:""}function qf({open:l=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?i.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):i.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function Gf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]})}function bj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function xj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:i.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function yj(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),i.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function _j(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const vj=200;function jj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=y.useState(""),b=m.trim(),_=b.length>0,j=y.useRef(null),v=y.useRef(r);v.current=r;function C(L){g(L),j.current&&clearTimeout(j.current);const $=L.trim();if(!$){v.current("");return}j.current=setTimeout(()=>v.current($),vj)}const T=_&&(s==null?void 0:s.query)===b?s:null;function E(){if(!T)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(T.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const L=[];let $="";for(const J of T.matches)J.path!==$&&($=J.path,L.push(i.jsx("p",{className:"searchgroup__path",title:J.path,children:J.path},`path:${J.path}`))),L.push(i.jsx(Sj,{match:J,onClick:()=>c(J)},`${J.path}:${J.line}:${J.column}`));return T.truncated&&L.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),L}return i.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:L=>{h&&(L.target.closest("button")||h())},children:[i.jsx(wj,{}),i.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&i.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:i.jsx(kc,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(kj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:L=>C(L.target.value),onKeyDown:L=>{L.stopPropagation(),L.key==="Escape"&&(L.preventDefault(),m?C(""):L.currentTarget.blur())}}),m&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?E():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Sj({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return i.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:l.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function wj(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function kj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let bf=null;function Nj(){return bf||(bf=Promise.all([Qe(()=>import("./index-D9R4w6Zg.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Qe(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Qe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Qe(()=>import("./index-CqZsTMCh.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Qe(()=>import("./codemirror-lu8HamKP.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw bf=null,l})),bf}function Tj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),m=y.useRef(null),g=y.useRef(null),b=y.useRef(new Map),_=y.useRef(new Map),j=y.useRef(new Set),v=y.useRef(null),C=y.useRef(o),T=y.useRef(d),E=y.useRef(l),L=y.useRef(r),$=y.useRef(s);C.current=o,T.current=d,E.current=l,L.current=r,$.current=s;const[J,G]=y.useState("loading"),[O,Z]=y.useState(!1);function M(B,ne,he,P,ue){const _e=b.current.get(P),De=_.current.get(P)===ue;if(_e&&De)he.setState(_e);else{const A=B.EditorState.create({doc:$.current,extensions:[B.basicSetup,B.Prec.highest(B.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(E.current),!0)}])),B.keymap.of([B.indentWithTab]),ne.of([]),B.editorTheme,B.editorHighlight,B.EditorView.updateListener.of(fe=>{fe.docChanged&&C.current(E.current,fe.state.doc.toString())})]});b.current.set(P,A),_.current.set(P,ue),he.setState(A),j.current.delete(P)}if(j.current.has(P))return()=>{};let Ne=!1;return sj(P).then(A=>{Ne||!A||E.current!==P||(he.dispatch({effects:ne.reconfigure(A)}),b.current.set(P,he.state),j.current.add(P))}),()=>{Ne=!0}}y.useEffect(()=>{if(!h.current)return;let ne=!1,he=null,P=null;G("loading"),Z(!1);const ue=window.setTimeout(()=>{ne||Z(!0)},200);return(async()=>{let _e;try{_e=await Nj()}catch{window.clearTimeout(ue),ne||G("error");return}if(ne||!h.current)return;window.clearTimeout(ue);const De=new _e.Compartment;v.current=De,g.current=_e,P=new _e.EditorView({parent:h.current}),m.current=P,he=M(_e,De,P,E.current,L.current),G("ready")})(),()=>{ne=!0,window.clearTimeout(ue),he==null||he(),P==null||P.destroy(),m.current===P&&(m.current=null),g.current=null,v.current=null}},[]),y.useEffect(()=>{const B=g.current,ne=m.current,he=v.current;if(!(!B||!ne||!he))return M(B,he,ne,l,r)},[l,r]);const D=y.useRef(0);return y.useEffect(()=>{const B=m.current,ne=g.current;if(!B||!ne||!c||c.token===D.current)return;D.current=c.token;const he=B.state.doc.lines,P=Math.min(Math.max(c.line,1),he),ue=B.state.doc.line(P),_e=Math.min(ue.from+Math.max(c.column-1,0),ue.to);B.dispatch({selection:ne.EditorSelection.cursor(_e),effects:ne.EditorView.scrollIntoView(_e,{y:"center"})}),B.focus()},[c]),y.useEffect(()=>()=>{const B=m.current;B&&b.current.set(l,B.state)},[l]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(J==="ready"?"":" is-hidden")}),J==="loading"&&O&&i.jsxs("div",{className:"editor__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),J==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:s})]})]})}function Cs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=y.useState(!1),[b,_]=y.useState(0),j=y.useRef(null),v=y.useRef(null),C=s.find(L=>L.value===l)??null;y.useEffect(()=>{if(!m)return;const L=s.findIndex($=>$.value===l);_(L===-1?0:L)},[m]),y.useEffect(()=>{if(!m)return;function L($){var J;(J=j.current)!=null&&J.contains($.target)||g(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[m]),y.useEffect(()=>{var L,$;m&&(($=(L=v.current)==null?void 0:L.querySelector(".is-cursor"))==null||$.scrollIntoView({block:"nearest"}))},[m,b]),y.useEffect(()=>{if(!m)return;const L=v.current,$=Ej(j.current);if(!L||!$)return;const J=L.getBoundingClientRect().bottom-$.getBoundingClientRect().bottom;J>0&&($.scrollTop+=Math.min(J+8,L.offsetHeight))},[m]);function T(L){g(!1),L.value!==l&&r(L.value)}function E(L){if(L.key==="Escape"){if(!m)return;L.preventDefault(),L.stopPropagation(),g(!1);return}if(L.key==="ArrowDown"||L.key==="ArrowUp"){if(L.preventDefault(),!m)return g(!0);const $=L.key==="ArrowDown"?1:s.length-1;return _(J=>(J+$)%s.length)}if(L.key==="Enter"||L.key===" "){if(L.preventDefault(),!m)return g(!0);const $=s[b];$&&T($)}}return i.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(L=>!L),onKeyDown:E,children:[i.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),i.jsx(Cj,{})]}),m&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((L,$)=>i.jsxs("button",{type:"button",role:"option","aria-selected":L.value===l,className:"select__option"+($===b?" is-cursor":"")+(L.value===l?" is-on":""),onMouseEnter:()=>_($),onClick:()=>T(L),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:L.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:L.label}),L.hint&&i.jsx("span",{className:"select__hint",children:L.hint})]},L.value))})]})}function Ej(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function Cj(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Aj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function Mj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M4.6 6.6h4"})]})}function Rj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),i.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function Dj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){y.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=Oj(r,s);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Of(d),"). Лимит — 64 МБ."]})}):c?i.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[i.jsx("p",{className:"mediaview__error",children:c}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(l),children:"Повторить"})]}):m?s.startsWith("image/")?i.jsx(zj,{url:m}):s.startsWith("video/")?i.jsx(Hj,{url:m}):null:i.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[i.jsx("div",{className:"mediaview__progress",children:i.jsx("div",{className:"mediaview__progress-fill"})}),i.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function Oj(l,s){const[r,c]=y.useState(null);return y.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Mi=1,By=8,xf=1.25;function Lj(l){return Math.min(By,Math.max(Mi,l))}function zj({url:l}){const[s,r]=y.useState({scale:Mi,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function m(C,T,E){r(L=>{const $=Lj(L.scale*C);if($===L.scale)return L;if($<=Mi)return{scale:Mi,x:0,y:0};const J=(T-L.x)/L.scale,G=(E-L.y)/L.scale;return{scale:$,x:T-$*J,y:E-$*G}})}y.useEffect(()=>{const C=d.current;if(!C)return;function T(E){E.preventDefault();const L=C.getBoundingClientRect(),$=E.clientX-L.left-L.width/2,J=E.clientY-L.top-L.height/2;m(E.deltaY<0?xf:1/xf,$,J)}return C.addEventListener("wheel",T,{passive:!1}),()=>C.removeEventListener("wheel",T)},[]);function g(C){s.scale<=Mi||(C.currentTarget.setPointerCapture(C.pointerId),h.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,origX:s.x,origY:s.y},o(!0))}function b(C){const T=h.current;!T||T.pointerId!==C.pointerId||r(E=>({...E,x:T.origX+(C.clientX-T.startX),y:T.origY+(C.clientY-T.startY)}))}function _(){h.current=null,o(!1)}const j=s.scale>Mi,v=!j&&s.x===0&&s.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:b,onPointerUp:_,onPointerCancel:_,children:i.jsx("img",{src:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Mi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/xf,0,0),children:i.jsx(Mj,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:s.scale>=By,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(xf,0,0),children:i.jsx(Aj,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Mi,x:0,y:0}),children:i.jsx(Rj,{})})]})]})}const Uj=[{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 Hj({url:l}){const s=y.useRef(null),[r,c]=y.useState("1");return y.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(Cs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Uj})]})]})}function Bj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=Ua(l),b=Uy(l.path)&&!l.binary&&!l.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:l.path,children:l.path}),i.jsxs("span",{className:"editor__meta",children:[Of(l.size),l.eol==="crlf"&&" · CRLF"]}),b&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?i.jsx(Dj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Of(l.size)," на диске."]}):l.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Of(l.size),"). Такие правит агент, а не браузер."]}):b&&l.previewMode?i.jsx(Ij,{text:l.text}):i.jsx(Tj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Ij({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Qf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function qj({files:l,activePath:s,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[i.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&i.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),l.map(m=>i.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:rj(m.path)}),Ua(m)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:i.jsx(kc,{active:d})})]})}function fs(l){return l.claudeSessionId??l.id}function yf(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),d=[],h=[];for(const m of l)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function _x(l){return l.state!=="closed"}function vx(l){return[...l.filter(_x),...l.filter(s=>!_x(s))]}function _f(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),s,...o.slice(d)];return h.every((m,g)=>m===l[g])?null:h}function Ap(l,s,r,c){const o=l%10,d=l%100;return o===1&&d!==11?s:o>=2&&o<=4&&(d<12||d>14)?r:c}function Iy(l){return`${l} ${Ap(l,"агент","агента","агентов")}`}function Gj(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(Iy(s)),r>0&&c.push(`${r} ${Ap(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Yj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function $j(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function Xj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Vj({tasks:l,onStop:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(()=>Date.now()),[h,m]=y.useState(()=>new Set);y.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),y.useEffect(()=>{m(b=>{const _=new Set(l.map(v=>v.id)),j=new Set([...b].filter(v=>_.has(v)));return j.size===b.size?b:j})},[l]);const g=b=>{m(_=>new Set(_).add(b)),s(b),window.setTimeout(()=>{m(_=>{if(!_.has(b))return _;const j=new Set(_);return j.delete(b),j})},1e4)};return i.jsxs("div",{className:r?"tasks is-open":"tasks",children:[i.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(b=>!b),children:[i.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),i.jsx("span",{className:"tasks__summary",children:Gj(l)}),i.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&i.jsx("ul",{className:"tasks__list",id:"tasks-list",children:l.map(b=>{const _=h.has(b.id);return i.jsxs("li",{className:_?"task is-stopping":"task",children:[i.jsxs("div",{className:"task__main",children:[i.jsxs("div",{className:"task__head",children:[i.jsx("span",{className:"task__kind",children:Yj(b)}),b.background&&i.jsx("span",{className:"task__bg",children:"фон"}),i.jsx("span",{className:"task__time",children:$j(o-b.startedAt)})]}),i.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&i.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),i.jsxs("div",{className:"task__stats",children:[Xj(b.tokens)," · ",b.toolUses," ",Ap(b.toolUses,"вызов","вызова","вызовов")]})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:_?"Останавливается":"Стоп"})]},b.id)})})]})}const Qj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function qy({className:l}){return i.jsx("img",{src:Qj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Kj=450,Zj=6,vf=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Fj({disabled:l,onStart:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(0),[h,m]=y.useState({left:0,top:0}),g=y.useRef(null),b=y.useRef(null),_=y.useRef(null);function j(){_.current&&window.clearTimeout(_.current.timer),_.current=null}function v(){j(),d(0),c(!0)}function C(M){var D;c(!1),M&&((D=g.current)==null||D.focus())}function T(M){if(l||M.button!==0)return;const D={timer:0,x:M.clientX,y:M.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,v()},Kj),_.current=D}function E(M){const D=_.current;!D||D.fired||Math.hypot(M.clientX-D.x,M.clientY-D.y)>Zj&&j()}function L(){_.current&&!_.current.fired&&j()}function $(M){var D;if((D=_.current)!=null&&D.fired){_.current=null,M.preventDefault();return}l||s("claude")}function J(M){M.preventDefault(),!l&&v()}function G(M){if(l)return;(M.key==="ArrowDown"||M.key==="ArrowUp"||M.key==="Enter"&&M.shiftKey)&&(M.preventDefault(),v())}y.useLayoutEffect(()=>{if(!r)return;const M=g.current,D=b.current;if(!M||!D)return;const B=M.getBoundingClientRect(),ne=D.getBoundingClientRect(),he=8,P=Math.max(he,Math.min(B.right-ne.width,window.innerWidth-ne.width-he));let ue=B.top-ne.height-8;ue<he&&(ue=Math.min(B.bottom+8,window.innerHeight-ne.height-he)),m({left:P,top:ue})},[r]),y.useLayoutEffect(()=>{var M;r&&((M=b.current)==null||M.focus())},[r]),y.useLayoutEffect(()=>{if(!r)return;function M(D){var ne,he;const B=D.target;!((ne=b.current)!=null&&ne.contains(B))&&!((he=g.current)!=null&&he.contains(B))&&C(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[r]);function O(M){C(!1),s(M.id)}function Z(M){if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),C(!0);return}if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const D=M.key==="ArrowDown"?1:-1;d(B=>(B+D+vf.length)%vf.length);return}if(M.key==="Enter"||M.key===" "){M.preventDefault();const D=vf[o];D&&O(D);return}M.key==="Tab"&&C(!1)}return i.jsxs("div",{className:"newsession",children:[i.jsxs("button",{ref:g,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:"Удерживайте, чтобы выбрать агента","aria-haspopup":"menu","aria-expanded":r,onClick:$,onContextMenu:J,onPointerDown:T,onPointerMove:E,onPointerUp:L,onPointerCancel:L,onPointerLeave:L,onKeyDown:G,children:["+ Сессия",i.jsx(Jj,{})]}),r&&i.jsx("div",{ref:b,className:"newsession__menu",style:{left:h.left,top:h.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Z,children:vf.map((M,D)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(D===o?" is-cursor":""),onMouseEnter:()=>d(D),onClick:()=>O(M),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${M.id}`,"aria-hidden":"true",children:M.id==="antigravity"?i.jsx(qy,{className:"newsession__mark-logo"}):i.jsx(Wj,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:M.label}),i.jsx("span",{className:"newsession__hint",children:M.hint})]})]},M.id))})]})}function Jj(){return i.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wj(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const Gy="ccv:sidebar.collapsed",Yy="ccv:sidebar.mode",$y="ccv:sidebar.foldersCollapsed",Pj=500,Xh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function eS({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,sessions:g,archived:b,pinned:_,live:j,listOrder:v,liveSessionsFirst:C,onReorder:T,activeWorkspaceId:E,activeSessionId:L,onSelectWorkspace:$,onSelectSession:J,onRenameSession:G,onStopSession:O,onPinSessions:Z,onSelectPinned:M,onCloseWorkspaces:D,onRestoreWorkspaces:B,onArchiveSessions:ne,onUnarchiveSessions:he,onCreateFolder:P,onRenameFolder:ue,onSetFolderColor:_e,onDeleteFolder:De,onAssignToFolder:Ne,onOpenWorkspace:A,onNewSession:fe,onOpenExtensions:z,account:pe,onOpenAccount:ke,relay:k,onOpenRelay:V,onOpenSettings:ce,themeMode:ge,onCycleTheme:Ae}){var bs;const[Se,Te]=y.useState(null),[Tt,Ye]=y.useState(null),[et,Xe]=y.useState(null);function Qt(w){return(et==null?void 0:et.folderId)===w.id?et.color??void 0:w.color}function tt(w){const ie=w&&Qt(w);return ie?{"--folder-color":ie}:void 0}function Yt(w){return w?i.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const nt=y.useRef(void 0),[en,$t]=y.useState(null),[tn,nn]=y.useState(""),[pn,Sn]=y.useState(mS),[mn,cn]=y.useState(gS),[Ke,zt]=y.useState(bS);function gn(w){zt(w);try{localStorage.setItem(Yy,w)}catch{}}const ft=tn.trim().toLowerCase(),Je=ft!=="",An=y.useMemo(()=>yf(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),on=y.useMemo(()=>{const w=yf(g,E?v==null?void 0:v.sessions[E]:void 0,fs,"top");return C?vx(w):w},[g,v,E,C]),wn=y.useMemo(()=>{const w=yf(_,v==null?void 0:v.pinned,fs,"bottom");return C?vx(w):w},[_,v,C]),Pn=y.useMemo(()=>yf(j,v==null?void 0:v.live,fs,"bottom"),[j,v]),Xt=y.useMemo(()=>Je?An.filter(w=>w.name.toLowerCase().includes(ft)||w.path.toLowerCase().includes(ft)):An,[An,ft,Je]),wt=y.useMemo(()=>Je?o.filter(w=>w.name.toLowerCase().includes(ft)||w.path.toLowerCase().includes(ft)):o,[o,ft,Je]),Kt=y.useMemo(()=>Je?on.filter(w=>(w.title??"").toLowerCase().includes(ft)):on,[on,ft,Je]),Et=y.useMemo(()=>Je?b.filter(w=>(w.title??"").toLowerCase().includes(ft)):b,[b,ft,Je]),Yn=w=>{var ie;return((ie=c.find(Me=>Me.id===w))==null?void 0:ie.name)??"—"},le=w=>{var ie;return(ie=c.find(Me=>Me.id===w))==null?void 0:ie.path},be=y.useMemo(()=>Je?wn.filter(w=>(w.title??"").toLowerCase().includes(ft)||Yn(w.workspaceId).toLowerCase().includes(ft)):wn,[wn,c,ft,Je]),Le=y.useMemo(()=>Je?Pn.filter(w=>(w.title??"").toLowerCase().includes(ft)||Yn(w.workspaceId).toLowerCase().includes(ft)):Pn,[Pn,c,ft,Je]),H=!Je;function W(w){Sn(ie=>{const Me=ie.includes(w)?ie.filter(Fe=>Fe!==w):[...ie,w];try{localStorage.setItem(Gy,JSON.stringify(Me))}catch{}return Me})}const xe=w=>!pn.includes(w);function Be(w){cn(ie=>{const Me=ie.includes(w)?ie.filter(Fe=>Fe!==w):[...ie,w];try{localStorage.setItem($y,JSON.stringify(Me))}catch{}return Me})}const gt=w=>!mn.includes(w),Mn=y.useMemo(()=>Do(Xt,d),[Xt,d]),bn=y.useMemo(()=>Do(wt,d),[wt,d]),Rn=y.useMemo(()=>Do(Kt,h),[Kt,h]),ul=y.useMemo(()=>Do(Et,h),[Et,h]),gl=y.useMemo(()=>Do(be,m,w=>w.pinnedFolderId),[be,m]),ra=y.useMemo(()=>({groups:[],ungrouped:Le}),[Le]),Ql=((v==null?void 0:v.workspaces.length)??0)>0,ps=E?(((bs=v==null?void 0:v.sessions[E])==null?void 0:bs.length)??0)>0:!1,Ms=((v==null?void 0:v.pinned.length)??0)>0,Dn=((v==null?void 0:v.live.length)??0)>0,Kl=jf({enabled:H,scope:"workspaces",itemKey:w=>w.id,groups:Mn.groups,ungrouped:Mn.ungrouped,onReorder:T}),bl=jf({enabled:H,scope:"sessions",workspaceId:E??void 0,itemKey:fs,groups:Rn.groups,ungrouped:Rn.ungrouped,onReorder:T}),$n=jf({enabled:H,scope:"pinned",itemKey:fs,groups:gl.groups,ungrouped:gl.ungrouped,onReorder:T}),Vt=jf({enabled:H,scope:"live",itemKey:fs,groups:ra.groups,ungrouped:ra.ungrouped,onReorder:T});y.useEffect(()=>{var Me;if(!et)return;const ie=(Me=[...gl.groups,...Mn.groups,...bn.groups,...Rn.groups,...ul.groups].find(Fe=>Fe.folder.id===et.folderId))==null?void 0:Me.folder;ie&&ie.color===(et.color??void 0)&&Xe(null)},[et,gl,Mn,bn,Rn,ul]),y.useEffect(()=>()=>window.clearTimeout(nt.current),[]);const $e=Qh(Xt),vt=Qh(wt),xl=Qh(Kt),[lt,Zl]=y.useState(null),[Ut,el]=y.useState(null),[kt,Tl]=y.useState(null),[ln,kn]=y.useState(null),[bt,Ze]=y.useState(null),On=y.useRef(null);function El(w,ie){const Me=w.touches[0];if(!Me)return;const Fe={timer:0,x:Me.clientX,y:Me.clientY,el:w.currentTarget,fired:!1};Fe.timer=window.setTimeout(()=>{Fe.fired=!0,ie(Fe.x,Fe.y,Fe.el)},Pj),On.current=Fe}function xn(w){const ie=On.current,Me=w.touches[0];!ie||!Me||Math.hypot(Me.clientX-ie.x,Me.clientY-ie.y)>10&&(window.clearTimeout(ie.timer),On.current=null)}function Nn(w){const ie=On.current;ie&&(window.clearTimeout(ie.timer),ie.fired&&w.preventDefault())}function tl(){var w;return(w=On.current)!=null&&w.fired?(On.current=null,!0):!1}function ms(){const w=lt==null?void 0:lt.opener;Zl(null),w!=null&&w.isConnected&&w.focus()}function yn(){const w=Ut==null?void 0:Ut.opener;el(null),w!=null&&w.isConnected&&w.focus()}function Fl(){const w=kt==null?void 0:kt.opener;Tl(null),w!=null&&w.isConnected&&w.focus()}function fl(){const w=ln==null?void 0:ln.opener;kn(null),w!=null&&w.isConnected&&w.focus()}function nl(){const w=bt==null?void 0:bt.opener;Ze(null),w!=null&&w.isConnected&&w.focus()}function Ln(w){return{onContextMenu:ie=>{ie.preventDefault(),Zl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:$e.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Zl({x:Me,y:Fe,opener:_n,ids:$e.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ht(w){return{onContextMenu:ie=>{ie.preventDefault(),el({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:vt.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>el({x:Me,y:Fe,opener:_n,ids:vt.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ia(w){return{onContextMenu:ie=>{ie.preventDefault(),Tl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:xl.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Tl({x:Me,y:Fe,opener:_n,ids:xl.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Hi(w){return{onContextMenu:ie=>{ie.preventDefault(),kn({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>kn({x:Me,y:Fe,opener:_n,ids:[w.id]})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Rs(w){return{onContextMenu:ie=>{ie.preventDefault(),Ze({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Ze({x:Me,y:Fe,opener:_n,ids:[w.id]})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}const Ds=g.filter(w=>w.state!=="closed").length,yl=lt?Xt.find(w=>w.id===lt.ids[0]):void 0,qa=lt?[{id:"close",label:lt.ids.length>1?`Закрыть проекты (${lt.ids.length})`:"Закрыть проект",onSelect:()=>{D(lt.ids),$e.clear()}},...Oo({folders:d,ids:lt.ids,hasFolder:(yl==null?void 0:yl.folderId)!=null,assign:(w,ie)=>Ne("workspace",w,ie),onClear:()=>$e.clear(),onNewFolder:()=>$t("workspace")}),...lt.ids.length===1&&H?Kl.menuItems(lt.ids[0],Ql):[]]:[],zn=lt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(E&&lt.ids.includes(E)&&Ds>0?` в нём сейчас незавершённых сессий: ${Ds} — при закрытии они остановятся на хосте.`:""):void 0,gs=Ut?wt.find(w=>w.id===Ut.ids[0]):void 0,Jl=Ut?[{id:"restore",label:Ut.ids.length>1?`Вернуть проекты (${Ut.ids.length})`:"Вернуть проект",onSelect:()=>{B(Ut.ids),vt.clear()}},...Oo({folders:d,ids:Ut.ids,hasFolder:(gs==null?void 0:gs.folderId)!=null,assign:(w,ie)=>Ne("workspace",w,ie),onClear:()=>vt.clear(),onNewFolder:()=>$t("workspace")})]:[],sn=Ut?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Bt=kt?Kt.find(w=>w.id===kt.ids[0]):void 0,me=(Bt==null?void 0:Bt.pinned)!==!0,N=kt?[...kt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Te(kt.ids[0])}]:[],{id:"pin",label:me?kt.ids.length>1?`Закрепить (${kt.ids.length})`:"Закрепить":kt.ids.length>1?`Открепить (${kt.ids.length})`:"Открепить",onSelect:()=>{Bt&&Z(Bt.workspaceId,kt.ids,me),xl.clear()}},{id:"archive",label:kt.ids.length>1?`Убрать в архив (${kt.ids.length})`:"Убрать в архив",onSelect:()=>{ne(E,kt.ids),xl.clear()}},...Oo({folders:h,ids:kt.ids,hasFolder:(Bt==null?void 0:Bt.folderId)!=null,assign:(w,ie)=>Ne("session",w,ie,E),onClear:()=>xl.clear(),onNewFolder:()=>$t("session")}),...kt.ids.length===1&&H&&Bt?bl.menuItems(fs(Bt),ps):[]]:[],Y=kt?Xh:void 0,ae=ln?be.find(w=>w.id===ln.ids[0]):void 0,we=ln?[{id:"rename",label:"Переименовать",onSelect:()=>Te(ln.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ae&&Z(ae.workspaceId,[ae.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ae&&ne(ae.workspaceId,[ae.id])}},...ae&&ae.workspaceId===E?Oo({folders:h,ids:[ae.id],hasFolder:ae.folderId!=null,assign:(w,ie)=>Ne("session",w,ie,ae.workspaceId),onClear:()=>{},onNewFolder:()=>$t("session")}):[],...sS(ae?Oo({folders:m,ids:[ae.id],hasFolder:ae.pinnedFolderId!=null,assign:(w,ie)=>Ne("pinned",w,ie),onClear:()=>{},onNewFolder:()=>$t("pinned")}):[]),...H&&ae?$n.menuItems(fs(ae),Ms):[]]:[],ve=bt?Le.find(w=>w.id===bt.ids[0]):void 0,ze=bt?[{id:"stop",label:"Остановить",onSelect:()=>{ve&&O(ve)}},{id:"rename",label:"Переименовать",onSelect:()=>Te(bt.ids[0])},{id:"pin",label:(ve==null?void 0:ve.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{ve&&Z(ve.workspaceId,[ve.id],ve.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ve&&ne(ve.workspaceId,[ve.id])}},...H&&ve?Vt.menuItems(fs(ve),Dn):[]]:[];function ot(w,ie){return i.jsxs("div",{"data-row-key":w.id,className:ac(w.id===E,$e.selected.includes(w.id),!1,!!ie)+Kl.dropClass(w.id),style:tt(ie),...Ln(w),children:[Yt(ie),H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...Kl.gripHandlers(w.id),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:Me=>{tl()||$e.click(Me,w,()=>$(w.id))},onKeyDown:Me=>Kl.onKeyDown(w.id,Me),children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",title:w.path,children:w.path})]})]},w.id)}function un(w,ie){return i.jsxs("div",{className:ac(w.id===E,vt.selected.includes(w.id),!1,!!ie),style:tt(ie),...Ht(w),children:[Yt(ie),i.jsxs("button",{className:"row__main",onClick:Me=>{tl()||vt.click(Me,w,()=>$(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:kS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>B([w.id]),children:"Вернуть"})]},w.id)}function Mt(w,ie){const Me=fs(w);return i.jsxs("div",{"data-row-key":Me,className:ac(w.id===L,xl.selected.includes(w.id),w.provider==="antigravity",!!ie)+bl.dropClass(Me),style:tt(ie),...Se===w.id?{}:Ia(w),children:[Yt(ie),Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Fe=>{G(w,Fe),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...bl.gripHandlers(Me),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:Fe=>{tl()||xl.click(Fe,w,()=>J(w))},onKeyDown:Fe=>bl.onKeyDown(Me,Fe),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{tl()||Te(w.id)},children:"✎"})]})]},w.id)}function mt(w,ie){return i.jsxs("div",{className:ac(w.id===L,!1,w.provider==="antigravity",!!ie),style:tt(ie),children:[Yt(ie),i.jsxs("button",{className:"row__main",onClick:()=>J(w),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:wS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>he([w.id]),children:"Вернуть"})]},w.id)}function fn(w,ie){const Me=fs(w);return i.jsxs("div",{"data-row-key":Me,className:ac(w.id===L,!1,w.provider==="antigravity",!!ie)+$n.dropClass(Me),style:tt(ie),...Se===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Hi(w)},children:[Yt(ie),Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Fe=>{G(w,Fe),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...$n.gripHandlers(Me),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{tl()||M(w)},onKeyDown:Fe=>$n.onKeyDown(Me,Fe),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})]},w.id)}function It(w){const ie=fs(w);return i.jsx("div",{"data-row-key":ie,className:ac(w.id===L,!1,w.provider==="antigravity")+Vt.dropClass(ie),...Se===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Rs(w)},children:Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Me=>{G(w,Me),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Vt.gripHandlers(ie),children:i.jsx(Sf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{tl()||M(w)},onKeyDown:Me=>Vt.onKeyDown(ie,Me),children:[i.jsx(wf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Kh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Me=>{Me.stopPropagation(),!tl()&&O(w)},children:i.jsx(fS,{})})]})},w.id)}function ll(w,ie){return i.jsx(oS,{folder:w,count:ie,open:gt(w.id),renaming:Tt===w.id,onToggle:()=>Be(w.id),onStartRename:()=>Ye(w.id),onCommitRename:Me=>{ue(w.id,Me),Ye(null)},onCancelRename:()=>Ye(null),onDelete:()=>De(w.id),color:Qt(w),onPreviewColor:Me=>{window.clearTimeout(nt.current),Xe({folderId:w.id,color:Me})},onCommitColor:Me=>{Xe({folderId:w.id,color:Me}),_e(w.id,Me),window.clearTimeout(nt.current),nt.current=window.setTimeout(()=>Xe(null),4e3)},onResetColor:()=>{window.clearTimeout(nt.current),Xe(null),_e(w.id,null)}},w.id)}return i.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:s?"dot dot--on":"dot",title:r}),i.jsx("span",{className:"brand",children:"Claude Code Visual"}),i.jsx("button",{className:"theme-btn",title:`Тема: ${Sx[ge]}`,"aria-label":`Тема: ${Sx[ge]}. Переключить`,onClick:Ae,children:i.jsx(xS,{mode:ge})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":Ke==="default",className:Ke==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":Ke==="pinned",className:Ke==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":Ke==="live",className:Ke==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("live"),children:[i.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&i.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(hS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:tn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>nn(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),tn?nn(""):w.currentTarget.blur())}}),tn&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>nn(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:Ke==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Закреплённые",count:be.length,open:xe("pinned"),onToggle:()=>W("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{$t("pinned"),xe("pinned")||W("pinned")}}}),xe("pinned")&&i.jsxs(i.Fragment,{children:[en==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("pinned",w),$t(null)},onCancel:()=>$t(null)})})}),be.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),gl.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>fn(ie,w.folder))]},w.folder.id)),gl.ungrouped.map(w=>fn(w))]})]}):Ke==="live"?i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Запущенные",count:Le.length,open:xe("live"),onToggle:()=>W("live")}),xe("live")&&i.jsxs(i.Fragment,{children:[Le.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Нет запущенных сессий"})}),Le.map(w=>It(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Проекты",count:Xt.length,open:xe("workspaces"),onToggle:()=>W("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{$t("workspace"),xe("workspaces")||W("workspaces")}}}),xe("workspaces")&&i.jsxs(i.Fragment,{children:[en==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("workspace",w),$t(null)},onCancel:()=>$t(null)})})}),Xt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока ни одного"})}),Mn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>ot(ie,w.folder))]},w.folder.id)),Mn.ungrouped.map(w=>ot(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Архив проектов",count:wt.length,open:xe("workspacesArchive"),onToggle:()=>W("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),xe("workspacesArchive")&&i.jsxs(i.Fragment,{children:[wt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока пусто"})}),bn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>un(ie,w.folder))]},w.folder.id)),bn.ungrouped.map(w=>un(w))]})]}),E&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Сессии",count:Kt.length,open:xe("sessions"),onToggle:()=>W("sessions"),action:{label:"Новая папка сессий",onClick:()=>{$t("session"),xe("sessions")||W("sessions")}}}),xe("sessions")&&i.jsxs(i.Fragment,{children:[en==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("session",w,E),$t(null)},onCancel:()=>$t(null)})})}),Kt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока ни одной"})}),Rn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>Mt(ie,w.folder))]},w.folder.id)),Rn.ungrouped.map(w=>Mt(w))]}),b.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ic,{title:"Архив",count:Et.length,open:xe("archive"),onToggle:()=>W("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),xe("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),Et.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока пусто"})}),ul.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>mt(ie,w.folder))]},w.folder.id)),ul.ungrouped.map(w=>mt(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:ke,children:[i.jsx("span",{className:pe!=null&&pe.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:pe===null?"Аккаунт":pe.loggedIn?pe.email||"Вход выполнен":"Войти в аккаунт"}),(pe==null?void 0:pe.plan)&&i.jsx("span",{className:"chip",children:pe.plan})]}),V&&i.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:V,children:[i.jsx("span",{className:k!=null&&k.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:k===null?"Удалённый доступ":k.paired?k.connected?k.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(k==null?void 0:k.connected)&&k.clients>0&&i.jsx("span",{className:"chip",children:k.clients})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",disabled:!z,title:"MCP-серверы и плагины",onClick:()=>z==null?void 0:z(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:ce,children:"Настройки"})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",onClick:A,children:"+ Проект"}),i.jsx(Fj,{disabled:!E,onStart:fe})]})]}),lt&&i.jsx(or,{x:lt.x,y:lt.y,items:qa,note:zn,onClose:ms}),Ut&&i.jsx(or,{x:Ut.x,y:Ut.y,items:Jl,note:sn,onClose:yn}),kt&&i.jsx(or,{x:kt.x,y:kt.y,items:N,note:Y,onClose:Fl}),ln&&i.jsx(or,{x:ln.x,y:ln.y,items:we,note:Xh,onClose:fl}),bt&&i.jsx(or,{x:bt.x,y:bt.y,items:ze,note:Xh,onClose:nl})]})}function ac(l,s,r,c){const o=["row"];return c&&o.push("row--foldered"),l&&o.push("row--active"),s&&o.push("row--selected"),r&&o.push("row--antigravity"),o.join(" ")}function Do(l,s,r=c=>c.folderId){const c=new Map(s.map(m=>[m.id,m])),o=new Map,d=[];for(const m of l){const g=r(m),b=g?c.get(g):void 0;if(!b){d.push(m);continue}const _=o.get(b.id);_?_.push(m):o.set(b.id,[m])}return{groups:[...o.entries()].map(([m,g])=>({folder:c.get(m),items:g})).sort((m,g)=>m.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:d}}function tS(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const nS="\0ungrouped";function lS(l,s,r){const c=new Map;for(const o of l)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of s)c.set(r(o),nS);return c}function Vh(l,s,r,c,o){const d=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!d)return null;const h=d.findIndex(m=>c(m)===l);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function jf(l){const[s,r]=y.useState(null),[c,o]=y.useState(null),d=y.useMemo(()=>tS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=y.useMemo(()=>lS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g($,J){l.enabled&&(J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId),r($),o(null))}function b($,J){var D;if(!s)return;const G=(D=document.elementFromPoint($,J))==null?void 0:D.closest("[data-row-key]"),O=G==null?void 0:G.dataset.rowKey;if(!O||O===s||h.get(O)!==h.get(s)){o(null);return}const Z=G.getBoundingClientRect(),M=J-Z.top<Z.height/2?"before":"after";o(B=>(B==null?void 0:B.key)===O&&B.position===M?B:{key:O,position:M})}function _($){b($.clientX,$.clientY)}function j(){if(s&&c){const $=_f(d,s,c.key,c.position);$&&l.onReorder(l.scope,$,l.workspaceId)}m()}function v($,J){if(!l.enabled)return;const G=Vh($,l.groups,l.ungrouped,l.itemKey,J);if(!G)return;const O=_f(d,$,G.target,G.position);O&&l.onReorder(l.scope,O,l.workspaceId)}function C($,J){const G=Vh($,l.groups,l.ungrouped,l.itemKey,"up"),O=Vh($,l.groups,l.ungrouped,l.itemKey,"down"),Z=[{id:"move-up",label:"Переместить выше",disabled:!G,onSelect:()=>{if(!G)return;const M=_f(d,$,G.target,G.position);M&&l.onReorder(l.scope,M,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!O,onSelect:()=>{if(!O)return;const M=_f(d,$,O.target,O.position);M&&l.onReorder(l.scope,M,l.workspaceId)}}];return J&&Z.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),Z}function T($){return s===$?" row--dragging":(c==null?void 0:c.key)===$?c.position==="before"?" row--drop-before":" row--drop-after":""}function E($){return{onPointerDown:J=>g($,J),onPointerMove:_,onPointerUp:j,onPointerCancel:m}}function L($,J){!J.altKey||J.key!=="ArrowUp"&&J.key!=="ArrowDown"||(J.preventDefault(),v($,J.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:T,gripHandlers:E,onKeyDown:L,menuItems:C}}function Oo(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function sS(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Qh(l){const[s,r]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(_=>_.includes(g.id)?_.filter(j=>j!==g.id):[..._,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const _=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(_!==-1&&j!==-1){const[v,C]=_<j?[_,j]:[j,_];r(l.slice(v,C+1).map(T=>T.id));return}}o(),c.current=g.id,b()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const aS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},iS={width:22,height:22,borderRadius:6};function ic({title:l,count:s,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:aS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(Xy,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:l}),i.jsx("span",{className:"sidebar__count",children:s})]}),d&&i.jsx("button",{className:"theme-btn",style:iS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(pS,{})})]})}const jx={paddingLeft:22},rS={display:"flex",alignItems:"center",gap:6,width:"100%"},cS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function oS({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g,color:b,onPreviewColor:_,onCommitColor:j,onResetColor:v}){const C=y.useRef(null),T=y.useRef(j);return T.current=j,y.useEffect(()=>{const E=C.current;if(!E)return;const L=()=>T.current(E.value);return E.addEventListener("change",L),()=>E.removeEventListener("change",L)},[c]),c?i.jsx("div",{className:"row",style:jx,children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):i.jsxs("div",{className:"row",style:jx,children:[i.jsxs("button",{className:"row__main",style:rS,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[i.jsx(Xy,{open:r}),i.jsx("span",{style:cS,children:l.name}),i.jsx("span",{className:"sidebar__count",children:s})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:d,children:"✎"}),i.jsxs("label",{className:b?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[i.jsx("span",{className:"row__swatch-dot",style:b?{background:b}:void 0}),i.jsx("input",{ref:C,type:"color",value:b??uS(),"aria-label":`Цвет папки «${l.name}»`,onChange:E=>_(E.target.value)})]}),l.color&&i.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${l.name}»`,onClick:v,children:"↺"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:g,children:"✕"})]})}function uS(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function Xy({open:l}){return i.jsx("svg",{className:l?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Sf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function fS(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:i.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function dS({className:l}){return i.jsxs("svg",{className:l,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),i.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),i.jsx("path",{d:"M8 12.2v1.4"})]})}function hS(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function pS(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function mS(){try{const l=localStorage.getItem(Gy);if(l===null)return["archive","workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function gS(){try{const l=localStorage.getItem($y);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function bS(){try{const l=localStorage.getItem(Yy);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Sx={system:"как в системе",light:"светлая",dark:"тёмная"};function xS({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?i.jsx("svg",{...s,children:i.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):l==="light"?i.jsxs("svg",{...s,children:[i.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),i.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):i.jsxs("svg",{...s,children:[i.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),i.jsx("path",{d:"M5.6 13.4h4.8"})]})}function yS(l){const s=_S(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${Iy(r)}`:s}function _S(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":vS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function vS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function jS(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":SS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function SS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Kh({session:l,tail:s}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${jS(l)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),yS(l)]})," · ",s]})}function wf({title:l,pinned:s,provider:r,projectName:c,projectPath:o}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[s&&i.jsx(dS,{className:"row__pin"}),r==="antigravity"&&i.jsx(qy,{className:"row__provider"}),l]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function wS(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function kS(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const wx=3,NS=15e5;function Vy(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=Zh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=AS(TS(Zh(r.old_string),Zh(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function Zh(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function TS(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(d),...ES(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function ES(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(_=>({type:"add",text:_}));if(s.length===0)return l.map(_=>({type:"del",text:_}));if((l.length+1)*(s.length+1)>NS)return[...l.map(_=>({type:"del",text:_})),...s.map(_=>({type:"add",text:_}))];const r=l.length,c=s.length,o=c+1,d=new Uint32Array((r+1)*o),h=(_,j)=>d[_*o+j]??0;for(let _=r-1;_>=0;_--)for(let j=c-1;j>=0;j--)d[_*o+j]=l[_]===s[j]?h(_+1,j+1)+1:Math.max(h(_+1,j),h(_,j+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const _=l[g],j=s[b];_===j?(m.push({type:"ctx",text:_}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:_}),g++):(m.push({type:"add",text:j}),b++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;b<c;)m.push({type:"add",text:s[b++]});return CS(m)}function CS(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function AS(l){if(!l.some(d=>d.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-wx);m<=Math.min(l.length-1,h+wx);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${MS(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function MS(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Sc(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function hp(){try{return await navigator.clipboard.readText()}catch{return null}}const Mp=1600,br="Копировать",hc="Скопировано";function Rp({text:l,hint:s,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Mp);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[l]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?hc:`${br} ${s}`,title:c?hc:`${br} ${s}`,onClick:()=>{Sc(l).then(d=>{d&&o(!0)})},children:c?hc:br})}function Dp({diff:l}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&i.jsx("div",{className:"diff__note",children:l.note}),i.jsx("div",{className:"diff__body",children:l.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>i.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function RS({waiting:l}){const[s,r]=y.useState(0);return y.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),i.jsxs("div",{className:l?"work work--wait":"work",children:[i.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:l?"ждёт разрешения":"думает"}),!l&&i.jsxs("span",{className:"work__time",children:[s," с"]})]})}function Op({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),j=y.useRef(null),v=y.useRef(!0),C=y.useRef(null),T=y.useRef(null),E=y.useRef(!1);y.useEffect(()=>{v.current=!0,C.current=null,E.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[m]),y.useEffect(()=>{const O=_.current,Z=j.current;if(!O||!Z)return;function M(ne){!O||ne===O.scrollTop||(E.current=!0,O.scrollTop=ne)}function D(){if(!O)return;const ne=C.current;if(ne){const he=Nx(O,ne.id);if(he){const P=he.getBoundingClientRect().top-O.getBoundingClientRect().top;M(O.scrollTop+(P-ne.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{C.current=null},500);return}v.current&&M(O.scrollHeight)}const B=new ResizeObserver(D);return B.observe(Z),()=>{B.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function L(){const O=_.current;if(O){if(E.current){E.current=!1;return}v.current=O.scrollHeight-O.scrollTop-O.clientHeight<80}}function $(){if(d)return;const O=_.current,Z=c[0];if(O&&Z){const M=Nx(O,Z.id);M&&(C.current={id:Z.id,top:M.getBoundingClientRect().top-O.getBoundingClientRect().top})}h==null||h()}let J=0;function G(O){return O.kind==="user"?J++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:L,children:i.jsxs("div",{className:"stream",ref:j,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:$,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(O=>i.jsx(kx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),c.length>0&&l.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&i.jsx("p",{className:"empty",children:b}),l.map(O=>i.jsx(kx,{item:O,userIndex:G(O),onEditMessage:g},O.id)),s&&i.jsx(RS,{waiting:r})]})})}function kx({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return i.jsx(OS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[i.jsx(LS,{text:l.text}),l.streaming&&i.jsx("span",{className:"caret"}),l.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(Rp,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return i.jsx(US,{item:l});case"result":return i.jsxs("div",{className:"result-line","data-item-id":l.id,children:[i.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),i.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&i.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",Ex(l.inputTokens)," ↓",Ex(l.outputTokens)]})]});case"notice":return i.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const DS=500;function OS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[m,g]=y.useState(l.text),b=y.useRef(null),_=$f("(max-width: 860px)"),j=y.useRef(null);function v(D,B){o({x:D,y:B})}function C(D){D.preventDefault(),v(D.clientX,D.clientY)}function T(D){const B=D.touches[0];if(!B)return;const ne={timer:0,x:B.clientX,y:B.clientY,fired:!1};ne.timer=window.setTimeout(()=>{ne.fired=!0,v(ne.x,ne.y)},DS),j.current=ne}function E(D){const B=j.current,ne=D.touches[0];!B||!ne||Math.hypot(ne.clientX-B.x,ne.clientY-B.y)>10&&(window.clearTimeout(B.timer),j.current=null)}function L(D){const B=j.current;B&&(window.clearTimeout(B.timer),B.fired&&D.preventDefault())}function $(){g(l.text),h(!0)}function J(){h(!1)}function G(){const D=m.trim();D===""&&!(l.images&&l.images.length>0)||(r==null||r(s,D,l.images),h(!1))}y.useEffect(()=>{const D=b.current;!D||!d||(D.style.height="auto",D.style.height=`${D.scrollHeight}px`)},[m,d]),y.useEffect(()=>{if(!d)return;const D=b.current;D&&(D.focus(),D.setSelectionRange(D.value.length,D.value.length))},[d]);function O(D){if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),J();return}D.key==="Enter"&&!D.shiftKey&&!_&&(D.preventDefault(),G())}const Z=l.images&&l.images.length>0&&i.jsx("div",{className:"msg--user__images",children:l.images.map((D,B)=>i.jsx("img",{className:"msg--user__image",src:`data:${D.mediaType};base64,${D.data}`,alt:"Вложение"},B))});if(d){const D=m.trim()!==""||!!(l.images&&l.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[Z,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:B=>g(B.target.value),onKeyDown:O,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:J,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:G,disabled:!D,children:"Сохранить"})]})]})]})}const M=[{id:"copy",label:"Копировать",onSelect:()=>void Sc(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:$}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:C,onTouchStart:T,onTouchMove:E,onTouchEnd:L,onTouchCancel:L,children:[Z,l.text,c&&i.jsx(or,{x:c.x,y:c.y,items:M,onClose:()=>o(null)})]})}function Nx(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function LS({text:l}){const[s,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return Qf(l).then(h=>{d||r(zS(h))}),()=>{d=!0}},[l]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((b=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:b.textContent)??"";m!==""&&Sc(m).then(_=>{if(!_)return;h.textContent=hc,h.setAttribute("aria-label",hc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=br,h.setAttribute("aria-label",pp),h.classList.remove("copybtn--done"))},Mp);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const pp=`${br} блок кода`;function zS(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",pp),o.title=pp,o.textContent=br,c.append(o)}return s.body.innerHTML}function US({item:l}){const[s,r]=y.useState(!1),c=l.result===null,o=Vy(l.name,l.input),d=l.name==="AskUserQuestion"?IS(l.input):null;return i.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[i.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__name",children:l.name}),i.jsx("span",{className:"tool__arg",children:d?BS(d):HS(l.input)}),i.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(qS,{questions:d,answers:l.answers}):o?i.jsx(Dp,{diff:o}):i.jsx(Tx,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&i.jsx(Tx,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Tx({text:l,hint:s,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:l}),i.jsx(Rp,{text:l,hint:s,className:"codeblock__copy"})]})}function HS(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function BS(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function IS(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const b of h){if(typeof b!="object"||b===null)return null;const{label:_,description:j,preview:v}=b;if(typeof _!="string"||typeof j!="string")return null;g.push({label:_,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function qS({questions:l,answers:s}){return i.jsx("div",{className:"tool__questions",children:l.map((r,c)=>i.jsxs("div",{className:"tool__question",children:[i.jsxs("div",{className:"tool__question-head",children:[r.header&&i.jsx("span",{className:"chip chip--accent",children:r.header}),i.jsx("span",{className:"tool__question-text",children:r.question})]}),i.jsx("div",{className:"tool__question-answer",children:s!=null&&s[r.question]?i.jsx("span",{className:"tool__answer-value",children:s[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Ex(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const GS="ccv.dictation.lang",Cx="ru-RU";function YS(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Ax(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(YS);return!r&&s.length>0&&Ns("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function Qy(){var l;try{return((l=localStorage.getItem(GS))==null?void 0:l.trim())||Cx}catch{return Cx}}function Ns(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const $S=3,XS=400,VS=5,QS=250,KS=2e3,ZS=2e4;async function FS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const JS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Qy()}`};function WS(l){const[s]=y.useState(()=>Ax()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),m=y.useRef(!1),g=y.useRef(!1),b=y.useRef(l),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=y.useRef(null),v=y.useRef(!1),C=y.useRef(null),T=y.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),E=y.useCallback(()=>{T();const O=async Z=>{if(C.current=null,!(!m.current||v.current)){if(!Z&&!await FS()){if(Ns("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void O(!0),ZS);return}Ns("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void O(!1),KS)},[T]);y.useEffect(()=>{b.current=l}),y.useEffect(()=>{const O=Ax();if(!O)return;const Z=new O;return Z.lang=Qy(),Z.continuous=!0,Z.interimResults=!0,Z.onstart=()=>{Ns("сессия открыта"),v.current=!0,T(),c(!0)},Z.onaudiostart=()=>{Ns("пошёл звук с микрофона"),_.current.audio=!0},Z.onresult=M=>{var he;if(g.current)return;let D="",B="";for(let P=M.resultIndex;P<M.results.length;P++){const ue=M.results[P];if(!ue)continue;const _e=((he=ue[0])==null?void 0:he.transcript)??"";ue.isFinal?D+=_e:B+=_e}const ne=_.current;ne.heard=!0,ne.everHeard=!0,Ns("распознано",{final:D,interim:B}),b.current(D,B)},Z.onerror=M=>{_.current.lastError=M.error,Ns("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(JS[M.error]??`Распознавание не работает: ${M.error}`))},Z.onend=()=>{g.current=!1,v.current=!1;const M=_.current,D=Date.now()-M.openedAt;if(Ns("сессия закрыта",{мс:D,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&D<XS?M.dead+1:0,M.dead>=VS){m.current=!1,c(!1),d(M.lastError?`Распознавание не работает: ${M.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}M.silent=M.heard?0:M.silent+1,!M.everHeard&&!M.warned&&M.silent>=$S&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",E();try{Z.start()}catch{}}},QS)},h.current=Z,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,T(),Z.onend=null,Z.onresult=null,Z.onerror=null,Z.onstart=null,Z.onaudiostart=null,Z.abort(),h.current=null}},[]);const L=y.useCallback(()=>{var O;if(m.current){if(m.current=!1,Ns("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,T(),!v.current){c(!1);return}(O=h.current)==null||O.stop()}},[]),$=y.useCallback(()=>{const O=h.current;if(O){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Ns("включение микрофона",{язык:O.lang}),E();try{O.start()}catch(Z){Ns("start() не прошёл",Z)}}},[E]),J=y.useCallback(()=>{m.current?L():$()},[$,L]),G=y.useCallback(()=>{var O;m.current&&v.current&&(g.current=!0,(O=h.current)==null||O.abort())},[]);return{supported:s,listening:r,error:o,toggle:J,stop:L,drop:G}}const PS="(max-width: 860px)",Mx=/^\/(\S*)$/,ew=new Set(["model","permissions"]);function tw(l){return ew.has(l.name)||l.name.startsWith("__")}const nw=new Set(["clear","rename"]),Rx=/(?:^|\s)@([^\s@]*)$/,lw=200,sw=100,aw=190,iw=5,rw=20*1024*1024,cw=1568,ow=.85;let Dx=0;async function uw(l){var j,v;if(!l.type.startsWith("image/")||l.size>rw)return null;const s=await fw(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,cw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,d.width,d.height),(v=(j=s.image).close)==null||v.call(j);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",b=d.toDataURL(g,m?void 0:ow),_=b.slice(b.indexOf(",")+1);return _?(Dx+=1,{id:`att${Dx}`,mediaType:g,data:_,previewUrl:b}):null}async function fw(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function Ky({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:_=!0,onContextSearch:j,onCommand:v,onSend:C,onInterrupt:T,onEscape:E}){var Le;const L=$f(PS),[$,J]=y.useState(()=>m?Lh(m):""),[G,O]=y.useState(!1),[Z,M]=y.useState(0),D=y.useRef(null),B=y.useRef(null),ne=y.useRef(null),[he,P]=y.useState(()=>m?Lh(m).length:0),[ue,_e]=y.useState([]),De=y.useRef(null),Ne=y.useCallback(H=>{!_||H.length===0||Promise.all(H.map(uw)).then(W=>{const xe=W.filter(Be=>Be!==null);xe.length!==0&&_e(Be=>[...Be,...xe].slice(0,iw))})},[_]);function A(H){_e(W=>W.filter(xe=>xe.id!==H))}function fe(H){var Be;if(!_)return;const W=(Be=H.clipboardData)==null?void 0:Be.items;if(!W)return;const xe=[];for(const gt of W){if(!gt.type.startsWith("image/"))continue;const Mn=gt.getAsFile();Mn&&xe.push(Mn)}xe.length!==0&&(H.preventDefault(),Ne(xe))}function z(H){const W=H.target.files?Array.from(H.target.files):[];H.target.value="",Ne(W)}y.useEffect(()=>{_||_e([])},[_]);const[pe,ke]=y.useState([]),[k,V]=y.useState(-1),ce=y.useRef(""),[ge,Ae]=y.useState(""),Se=WS(y.useCallback((H,W)=>{H&&J(xe=>Fh(xe,H)),Ae(W.trim())},[])),Te=ge?Fh($,ge):$;y.useEffect(()=>{Se.listening||ge===""||(J(H=>Fh(H,ge)),Ae(""))},[Se.listening,ge]),y.useEffect(()=>{var H;b&&((H=D.current)==null||H.focus())},[b]);const Tt=y.useRef(new Map),Ye=y.useRef(new Map),et=y.useRef(m),Xe=y.useRef({text:$,caret:he});Xe.current={text:$,caret:he};const Qt=y.useCallback((H,W,xe)=>{W===""?(Tt.current.delete(H),Ye.current.delete(H)):(Tt.current.set(H,W),Ye.current.set(H,xe)),cy(H,W)},[]),tt=Se.drop;y.useLayoutEffect(()=>{const H=et.current;if(H===m)return;et.current=m,H&&Qt(H,Xe.current.text,Xe.current.caret);const W=m?Tt.current.get(m)??Lh(m):"",xe=m?Ye.current.get(m):void 0,Be=Math.min(xe??W.length,W.length);J(W),P(Be),ne.current=[Be,Be],Ae(""),M(0),O(!1),V(-1),ce.current="",_e([]),tt()},[m,Qt,tt]),y.useEffect(()=>{m&&Qt(m,$,he)},[m,$,he,Qt]);const Yt=l?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",nt=y.useRef(0),en=y.useCallback(H=>{const W=parseFloat(getComputedStyle(H).maxHeight),xe=Number.isFinite(W)&&W>0?W:aw;H.style.height="auto";const Be=H.scrollHeight;H.style.height=`${Math.min(Be,xe)}px`,H.style.overflowY=Be>xe?"auto":"hidden"},[]);y.useEffect(()=>{const H=D.current;H&&en(H)},[Te,Yt,l,en]),y.useLayoutEffect(()=>{const H=D.current,W=ne.current;!H||!W||(ne.current=null,H.setSelectionRange(W[0],W[1]))}),y.useEffect(()=>{const H=D.current;if(!H)return;const W=new ResizeObserver(([xe])=>{const Be=xe==null?void 0:xe.contentRect.width;Be===void 0||Math.abs(Be-nt.current)<1||(nt.current=Be,en(H))});return W.observe(H),()=>W.disconnect()},[en]);const $t=Se.stop;y.useEffect(()=>{l&&$t()},[l,$t]);const tn=y.useMemo(()=>Se.error?{ok:!1,message:Se.error}:null,[Se.error]),nn=y.useMemo(()=>{var xe;const H=(xe=Mx.exec($))==null?void 0:xe[1];if(H===void 0)return[];const W=H.toLowerCase();return r.filter(Be=>!tw(Be)&&Jh(Be,W)<Zy).sort((Be,gt)=>Jh(Be,W)-Jh(gt,W))},[$,r]),pn=!G&&nn.length>0,Sn=Math.min(Z,nn.length-1),mn=G?null:((Le=Rx.exec(Te.slice(0,he)))==null?void 0:Le[1])??null,cn=y.useRef(j);cn.current=j,y.useEffect(()=>{if(mn===null||mn===""||mn.endsWith("/")){cn.current(mn);return}const H=setTimeout(()=>cn.current(mn),lw);return()=>clearTimeout(H)},[mn]);const Ke=mn!==null&&(o==null?void 0:o.query)===mn,zt=Ke?o.entries:[],gn=mn!==null,ft=gn&&!Ke,Je=Math.min(Z,Math.max(zt.length-1,0));y.useEffect(()=>{var W,xe;if(!pn&&!gn)return;const H=pn?Sn:Je;(xe=(W=B.current)==null?void 0:W.children[H])==null||xe.scrollIntoView({block:"nearest"})},[pn,gn,Sn,Je]);function An(H,W){var xe;J(H),P(W),ne.current=[W,W],M(0),O(!1),ge!==""&&(Ae(""),Se.drop()),(xe=D.current)==null||xe.focus()}function on(){J(""),Ae(""),M(0),P(0),O(!1),V(-1),ce.current="",_e([]),Se.drop(),m&&Qt(m,"",0)}function wn(H){const W=H.trim();W===""&&ue.length===0||l||(C(W,ue.length>0?ue.map(xe=>({mediaType:xe.mediaType,data:xe.data})):void 0),W!==""&&ke(xe=>[W,...xe.filter(Be=>Be!==W)].slice(0,sw)),on())}function Pn(H){if(H<-1||H>=pe.length)return;k===-1&&(ce.current=$);const W=H===-1?ce.current:pe[H]??"";V(H),An(W,W.length)}function Xt(){var Be;const H=((Be=D.current)==null?void 0:Be.selectionStart)??Te.length,xe=`${H>0&&!/\s$/.test(Te.slice(0,H))?" ":""}@`;An(Te.slice(0,H)+xe+Te.slice(H),H+xe.length)}function wt(H){var gt;const W=(gt=Rx.exec(Te.slice(0,he)))==null?void 0:gt[1];if(W===void 0)return;const xe=he-W.length-1,Be=H.kind==="dir"?`@${H.path}/`:`@${H.path} `;An(Te.slice(0,xe)+Be+Te.slice(he),xe+Be.length)}function Kt(){var W;const H=(W=Mx.exec(Te.trim()))==null?void 0:W[1];if(H&&v(H)){on();return}wn(Te)}function Et(H,W){J(H),P(W),M(0),O(!1),V(-1),ge!==""&&(Ae(""),Se.drop())}function Yn(H){var Be;const W=nw.has(H.name)?c:null,xe=`/${H.name} `;J(xe+(W??"")),P(xe.length+((W==null?void 0:W.length)??0)),W&&(ne.current=[xe.length,xe.length+W.length]),M(0),(Be=D.current)==null||Be.focus()}function le(H){if(v(H.name)){J(""),M(0),O(!1);return}H.argumentHint?Yn(H):wn(`/${H.name}`)}function be(H){if(pn){if(H.key==="ArrowDown")return H.preventDefault(),M(W=>(Math.min(W,nn.length-1)+1)%nn.length);if(H.key==="ArrowUp"){H.preventDefault();const W=nn.length-1;return M(xe=>(Math.min(xe,W)+W)%nn.length)}if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const W=nn[Sn];W&&le(W);return}if(H.key==="Tab"){H.preventDefault();const W=nn[Sn];W&&Yn(W);return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),O(!0);return}}if(gn){if(H.key==="ArrowDown"&&zt.length>0)return H.preventDefault(),M(W=>(Math.min(W,zt.length-1)+1)%zt.length);if(H.key==="ArrowUp"&&zt.length>0){H.preventDefault();const W=zt.length-1;return M(xe=>(Math.min(xe,W)+W)%zt.length)}if(H.key==="Enter"&&!H.shiftKey||H.key==="Tab"){const W=zt[Je];if(W){H.preventDefault(),wt(W);return}if(H.key==="Tab")return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),O(!0);return}}if((H.key==="ArrowUp"||H.key==="ArrowDown")&&!H.shiftKey){const W=H.currentTarget,xe=W.selectionStart;if(W.selectionEnd===xe){const gt=H.key==="ArrowUp"?k+1:k-1;gt>=-1&&gt<pe.length&&requestAnimationFrame(()=>{W.selectionStart===xe&&W.selectionEnd===xe&&Pn(gt)})}}if(H.key==="Escape"&&E){H.preventDefault(),H.stopPropagation(),E();return}H.key==="Enter"&&!H.shiftKey&&!L&&(H.preventDefault(),Kt())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(_r,{result:tn}),gn&&!pn&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:B,children:[zt.map((H,W)=>i.jsxs("button",{role:"option","aria-selected":W===Je,className:W===Je?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(W),onMouseDown:xe=>{xe.preventDefault(),wt(H)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[H.name,H.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:H.path}),H.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},H.path)),zt.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:ft?"ищем…":mn?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),pn&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:B,children:nn.map((H,W)=>i.jsxs("button",{role:"option","aria-selected":W===Sn,className:W===Sn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>M(W),onMouseDown:xe=>{xe.preventDefault(),le(H)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",H.name]}),H.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:H.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:H.description})]},H.name))}),ue.length>0&&i.jsx("div",{className:"composer__attachments",children:ue.map(H=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:H.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>A(H.id),children:i.jsx(bw,{})})]},H.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Xt,children:i.jsx(pw,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:De,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:z}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var H;return(H=De.current)==null?void 0:H.click()},children:i.jsx(gw,{})})]}),i.jsx("textarea",{ref:D,value:Te,disabled:l,placeholder:Yt,onChange:H=>Et(H.target.value,H.target.selectionStart),onSelect:H=>P(H.currentTarget.selectionStart),onKeyDown:be,onPaste:fe}),Se.supported&&i.jsx("button",{type:"button",className:Se.listening?"micbtn is-on":"micbtn",title:Se.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Se.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Se.listening,disabled:l,onClick:Se.toggle,children:i.jsx(xw,{on:Se.listening})}),s?i.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Kt,disabled:l||Te.trim()===""&&ue.length===0,"aria-label":g,title:g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(mw,{})]})]})]})})}function Fh(l,s){const r=s.trim();if(r==="")return l;const c=mp(r).slice(dw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function dw(l,s){const r=mp(l),c=mp(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>hw(d,c[h]??"")))return o;return 0}function mp(l){return l.split(/\s+/).filter(s=>s!=="")}function hw(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function pw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function mw(){return i.jsx("svg",{className:"sendbtn__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function gw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"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 bw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function xw({on:l}){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:l?"currentColor":"none"}),i.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),i.jsx("path",{d:"M8 12.8v1.5"})]})}const Zy=4;function Jh(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:Zy}function yw({request:l,queued:s,onDecide:r}){const c=Vy(l.toolName,l.input);return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[i.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&i.jsx("p",{className:"sheet__reason",children:l.reason}),c?i.jsx(Dp,{diff:c}):i.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>r(l.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>r(l.requestId,"allow"),children:"Разрешить"})]})]})})}function _w({request:l,queued:s,onAnswer:r,onDecline:c}){const{questions:o}=l,[d,h]=y.useState(()=>o.map(()=>new Set)),[m,g]=y.useState(()=>o.map(()=>"")),[b,_]=y.useState(()=>Ox(o));y.useEffect(()=>{h(o.map(()=>new Set)),g(o.map(()=>"")),_(Ox(o))},[l.requestId]);const j=y.useMemo(()=>jw(o,d,m),[o,d,m]),v=j!==null;function C(G,O){var Z,M;(M=(Z=o[G])==null?void 0:Z.options[O])!=null&&M.preview&&_(D=>{const B=D.slice();return B[G]=O,B})}function T(G,O,Z){h(M=>{const D=M.slice(),B=new Set(D[G]);return Z?B.has(O)?B.delete(O):B.add(O):B.has(O)||(B.clear(),B.add(O)),D[G]=B,D}),O!=="other"&&C(G,O)}function E(G,O){g(Z=>{const M=Z.slice();return M[G]=O,M})}function L(){j&&r(l.requestId,j)}function $(G){G.key==="Enter"&&(G.target.closest("button")||v&&(G.preventDefault(),L()))}function J(G){var D;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(G.key))return;const O=Array.from(G.currentTarget.querySelectorAll("button.qsheet__option")),Z=O.indexOf(document.activeElement);if(Z===-1)return;G.preventDefault();const M=G.key==="ArrowDown"||G.key==="ArrowRight"?1:-1;(D=O[(Z+M+O.length)%O.length])==null||D.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:$,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,s>0&&` — ещё ${s} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[l.reason&&i.jsx("p",{className:"qsheet__reason",children:l.reason}),o.map((G,O)=>i.jsx(vw,{q:G,qi:O,selected:d[O]??new Set,otherText:m[O]??"",previewIndex:b[O]??null,onToggle:T,onFocusOption:C,onOtherText:E,onOptionsKeyDown:J},O))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>c(l.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:L,children:"Ответить"})]})]})})}function vw({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var C;const b=l.options.some(T=>T.preview),_=o!==null?(C=l.options[o])==null?void 0:C.preview:void 0,j=r.has("other"),v=l.multiSelect?"checkbox":"radio";return i.jsxs("div",{className:"qsheet__question",children:[i.jsxs("div",{className:"qsheet__qhead",children:[i.jsx("span",{className:"chip chip--accent",children:l.header}),i.jsx("span",{className:"qsheet__qtext",children:l.question})]}),i.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((T,E)=>{const L=r.has(E);return i.jsxs("button",{type:"button",role:v,"aria-checked":L,className:"qsheet__option"+(L?" is-selected":""),onClick:()=>d(s,E,l.multiSelect),onFocus:()=>h(s,E),onMouseEnter:()=>h(s,E),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:T.label}),i.jsx("span",{className:"qsheet__opt-desc",children:T.description})]})]},E)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(s,"other",l.multiSelect),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),i.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&i.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:T=>m(s,T.target.value),autoFocus:!0})]})]}),b&&i.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Ox(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function jw(l,s,r){const c={};for(let o=0;o<l.length;o++){const d=l[o];if(!d)continue;const h=s[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const b=d.options[g];b&&h.has(g)&&m.push(b.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function Sw({request:l,plan:s,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(s),[m,g]=y.useState("preview");y.useEffect(()=>{h(s),g("preview")},[l.requestId,s]);const b=d.trim().length>0;function _(){b&&c(l.requestId,d)}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[i.jsxs("div",{className:"plansheet__head",children:[i.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:i.jsx(kw,{})}),i.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),i.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(m==="preview"?" is-on":""),role:"tab","aria-selected":m==="preview",onClick:()=>g("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(m==="source"?" is-on":""),role:"tab","aria-selected":m==="source",onClick:()=>g("source"),children:"Код"})]})]}),i.jsxs("div",{className:"plansheet__body",children:[l.reason&&i.jsx("p",{className:"plansheet__reason",children:l.reason}),i.jsx("div",{className:"plansheet__content",children:m==="preview"?i.jsx(ww,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(l.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!b,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function ww({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Qf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function kw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M4.4 2.5h5.6L13 5.5v7.4a.6.6 0 0 1-.6.6H4.4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z"}),i.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),i.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function Nw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function Fy({path:l}){const[s,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!s)return;function m(g){var b;(b=d.current)!=null&&b.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),y.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Mp);return()=>clearTimeout(m)},[c]),y.useEffect(()=>r(!1),[l]);async function h(){await Sc(l)&&o(!0)}return i.jsxs("div",{ref:d,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[i.jsx(Tw,{open:s}),i.jsx("span",{className:"cwd__short",children:l})]}),s&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:l}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?hc:br})]})]})}function Tw({open:l}){return i.jsx("svg",{className:l?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const Ew=["low","medium","high"];function Jy({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:_,onThinking:j,onSwitchOnFlag:v}){const[C,T]=y.useState(!1),[E,L]=y.useState(0),$=y.useRef(null),J=y.useRef(null),G=l.find(B=>B.value===s)??null,O=G&&G.supportsEffort?G.effortLevels.length>0?G.effortLevels:Ew:[],Z=O.includes("xhigh");y.useEffect(()=>{if(!C)return;const B=l.findIndex(ne=>ne.value===s);L(B===-1?0:B)},[C]),y.useEffect(()=>{if(!C)return;function B(ne){var he;(he=$.current)!=null&&he.contains(ne.target)||T(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[C]),y.useEffect(()=>{var B,ne;C&&((ne=(B=J.current)==null?void 0:B.querySelector(".is-cursor"))==null||ne.scrollIntoView({block:"nearest"}))},[C,E]);function M(B){T(!1),B.value!==s&&g(B.value)}function D(B){if(B.key==="Escape"){if(!C)return;B.preventDefault(),B.stopPropagation(),T(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!C)return T(!0);if(l.length===0)return;const ne=B.key==="ArrowDown"?1:l.length-1;return L(he=>(he+ne)%l.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!C)return T(!0);const ne=l[E];ne&&M(ne)}}return i.jsxs("div",{ref:$,className:"select"+(C?" select--open":"")+(m?` ${m}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":C,onClick:()=>T(B=>!B),onKeyDown:D,children:[(G==null?void 0:G.displayName)??s?i.jsx("span",{className:"select__value",children:(G==null?void 0:G.displayName)??s}):i.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):O.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(Cw,{})]}),C&&i.jsxs("div",{ref:J,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((B,ne)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":B.value===s,className:"select__option"+(ne===E?" is-cursor":"")+(B.value===s?" is-on":""),onMouseEnter:()=>L(ne),onClick:()=>M(B),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:B.displayName}),B.description&&i.jsx("span",{className:"select__hint",children:B.description})]},B.value)),O.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"modelmenu__sep",role:"separator"}),i.jsxs("div",{className:"modelmenu__row",children:[i.jsxs("span",{className:"modelmenu__label",children:["Усилие",i.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),i.jsx("span",{className:"modelmenu__levels",children:O.map(B=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":B===r,className:B===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(B),children:B},B))})]}),Z&&i.jsx(Wh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>_(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(G==null?void 0:G.supportsThinking)!==!1&&i.jsx(Wh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&i.jsx(Wh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function Wh({label:l,desc:s,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[i.jsxs("span",{className:"modelmenu__label",children:[l,i.jsx("span",{className:"modelmenu__desc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Cw(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const b=h.current;if(!b)return;const _=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=_[0],v=_[_.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":l,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:l}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:s}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function Aw({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:b,onSubmit:_,onCreate:j,onClose:v}){const[C,T]=y.useState("open"),[E,L]=y.useState(""),[$,J]=y.useState(!1),[G,O]=y.useState(""),[Z,M]=y.useState(""),[D,B]=y.useState({git:!0,claudeMd:!0,readme:!0}),ne=E.trim(),he=ne!=="",P=G.trim(),ue=Z.trim(),_e=P!==""&&ue!=="";y.useEffect(()=>{G===""&&d.length>0&&O(d[0])},[d]);const De=y.useRef(m);De.current=m,y.useEffect(()=>{if(C!=="open")return;const z=E.trim(),pe=setTimeout(()=>De.current(z),200);return()=>clearTimeout(pe)},[E,C]);function Ne(){he&&_(ne)}function A(){_e&&j(P,ue,D)}function fe(){he&&(J(!0),g(ne))}return h?i.jsxs(Nl,{title:"Новый проект",onClose:v,actions:i.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[i.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),i.jsx("p",{className:"newproj__preview",children:h.path}),i.jsx("div",{className:"modal__error",children:i.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(z=>i.jsx("li",{children:z},z))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Nl,{title:"Новый проект",className:$&&C==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:b,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!he,onClick:fe,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!he,onClick:Ne,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!_e,onClick:A,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Lx,{label:"Открыть",on:C==="open",onClick:()=>T("open")}),i.jsx(Lx,{label:"Создать",on:C==="create",onClick:()=>T("create")})]}),C==="open"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),i.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),i.jsx("input",{id:"workspace-path",className:"input input--mono",value:E,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:z=>L(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),Ne())}}),o&&i.jsx("p",{className:"modal__error",children:o}),l.length>0&&i.jsx("ul",{className:"finds",children:l.map(z=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:z.open,title:z.open?"Этот проект уже открыт":z.path,onClick:()=>L(z.path),onDoubleClick:()=>_(z.path),children:[i.jsx("span",{className:"find__name",children:z.name}),i.jsx("span",{className:"find__path",children:z.path}),i.jsx("span",{className:"find__note",children:Dw(z)})]})},z.path))}),l.length===0&&he&&!s&&!$&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),$&&i.jsx("div",{className:"finds__agent",children:i.jsx(Op,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),i.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),i.jsx("input",{id:"workspace-parent",className:"input input--mono",value:G,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:z=>O(z.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(z=>i.jsx("button",{type:"button",className:z===P?"newproj__root is-on":"newproj__root",title:z,onClick:()=>O(z),children:Rw(z)},z))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:Z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:z=>M(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),A())}}),i.jsx("p",{className:"newproj__preview",children:_e?Mw(P,ue):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Ph,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>B(z=>({...z,git:!z.git}))}),i.jsx(Ph,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>B(z=>({...z,claudeMd:!z.claudeMd}))}),i.jsx(Ph,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>B(z=>({...z,readme:!z.readme}))})]})]})]})}function Lx({label:l,on:s,onClick:r}){return i.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function Ph({label:l,desc:s,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[i.jsxs("span",{className:"newproj__optlabel",children:[l,i.jsx("span",{className:"newproj__optdesc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Mw(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Rw(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function Dw(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Ow(l.sessions)}${Lw(l.lastUsedAt)}`}function Ow(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function Lw(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Lp=7;function zw(l){const s=[],r=[];let c=1;for(const o of l){const d=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=zx(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let C=s.indexOf(v);C===-1&&(C=zx(s),s[C]=v),b.push({from:h,to:C})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.push({from:v,to:h}),v!==h&&(s[v]=null));const j=[];for(let v=0;v<d.length;v++){const C=d[v];!C||C===o.hash||v===h||s[v]===C&&j.push(v)}Uw(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:_,down:b,through:j})}return{rows:r,columns:Math.min(c,Lp)}}function zx(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Uw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const Wy=1500;function Hw(l){const s=[];let r=!1;for(const c of l.patch.split(`
119
- `)){if(s.length>=Wy){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:Bw(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:Iw(l,r)}}function Bw(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Iw(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${Wy} строк`),r.length>0?r.join(" · "):null}function qw({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:_,onConnectRemote:j,onDismissResult:v,onClose:C,zoomed:T,onToggleZoom:E}){const L=zw((s==null?void 0:s.commits)??[]),$=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(J=>({value:J.name,label:J.name,hint:J.hash.slice(0,8)}))];return i.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:J=>{E&&(J.target.closest("button")||E())},children:[i.jsx(Vw,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),E&&i.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:E,children:i.jsx(kc,{active:T})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:C,children:"✕"})]}),s===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"gitbar",children:i.jsx(Cs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:$,onChange:J=>{J&&m(J,`ветку ${J}`)}})}),s.detached&&i.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),i.jsx("div",{className:"gitbar__actions",children:o?i.jsxs("p",{className:"gitbar__busy",children:[i.jsx(Fw,{}),o]}):s.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(Qw,{}),"Отправить",s.ahead>0&&i.jsx("span",{className:"gitbar__count",children:s.ahead})]}),i.jsxs("div",{className:"gitbar__group",children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>b(!0),children:[i.jsx(Kw,{}),"Забрать",s.behind>0&&i.jsx("span",{className:"gitbar__count",children:s.behind})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>b(!1),children:i.jsx(Zw,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${Pw(s.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(J=>Ww(J.path)).join(", "):"незакоммиченных изменений нет"})]})}),L.rows.map(J=>i.jsx(Gw,{row:J,columns:L.columns,head:J.commit.hash===s.head,local:s.hasRemote&&!J.commit.pushed,active:c===J.commit.hash,onOpen:()=>h(J.commit.hash)},J.commit.hash)),L.rows.length===0&&i.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):i.jsxs("div",{className:"gitempty",children:[i.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(_r,{result:r,onDismiss:v})]})}const Lo=50,Ux=13;function Gw({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(Jw).filter(Boolean);return i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[i.jsx(Yw,{row:l,columns:s,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[m.map(g=>i.jsx("span",{className:"gitrow__ref",children:g},g)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",ek(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function Yw({row:l,columns:s,head:r,local:c}){const o=s*Ux+6,d=Lo/2,h=b=>8+Math.min(b,Lp-1)*Ux,m=c?"3.5 2.5":void 0,g=kf(l.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:Lo,viewBox:`0 0 ${o} ${Lo}`,"aria-hidden":"true",children:[l.through.map(b=>i.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:Lo,style:{stroke:kf(b)}},`t${b}`)),l.up.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:kf(b.from),strokeDasharray:m}},`u${_}`)),l.down.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${Lo}`,fill:"none",style:{stroke:kf(b.to),strokeDasharray:m}},`d${_}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:d,r:l.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:d,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function kf(l){return`var(--lane-${l%Lp})`}function $w({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return i.jsxs(Nl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),i.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&i.jsxs("div",{className:"commit__head",children:[i.jsx("p",{className:"commit__subject",children:l.subject}),i.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",tk(l.date)," ·"," ",i.jsx("span",{className:"commit__hash",children:l.hash})]}),s&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(d=>d.slice(0,8)).join(", ")]}),l.body&&i.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(d=>i.jsx(Xw,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function Xw({file:l,defaultOpen:s}){const[r,c]=y.useState(s);return i.jsxs("div",{className:"commit__file",children:[i.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"commit__filepath",children:l.path||l.oldPath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(Dp,{diff:Hw(l)})]})}function Vw(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Qw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function Kw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function Zw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"m13 13-2.6-2.6"})]})}function Hx(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function Fw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Jw(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Ww(l){const s=l.split("/");return s[s.length-1]??l}function Pw(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function ek(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(s).toLocaleDateString()}function tk(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function Bx(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function nk({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:_,onClose:j}){var z;const[v,C]=y.useState(()=>Bx(c)),[T,E]=y.useState(""),[L,$]=y.useState(""),[J,G]=y.useState(!0),[O,Z]=y.useState("Первый коммит"),[M,D]=y.useState(null),[B,ne]=y.useState("");y.useEffect(()=>{!T&&s.length>0&&E(s[0].login)},[T,s]),y.useEffect(()=>{r&&M===null&&D(new Set(r.files))},[r,M]);const he=(l==null?void 0:l.connected)===!0,P=s.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),ue=y.useMemo(()=>{if(!r)return[];const pe=B.trim().toLowerCase();return pe?r.files.filter(ke=>ke.toLowerCase().includes(pe)):r.files},[r,B]),_e=(M==null?void 0:M.size)??0,De=he&&v.trim()!==""&&T!==""&&d===""&&(o||_e>0);function Ne(pe){D(ke=>{const k=new Set(ke??[]);return k.has(pe)?k.delete(pe):k.add(pe),k})}function A(pe){D(ke=>{const k=new Set(ke??[]);for(const V of ue)pe?k.add(V):k.delete(V);return k})}function fe(){if(!De)return;const pe=(r==null?void 0:r.files)??[];b({owner:T,name:v.trim(),description:L.trim(),private:J,include:o?[]:pe.filter(ke=>M==null?void 0:M.has(ke)),ignore:o?[]:pe.filter(ke=>!(M!=null&&M.has(ke))),message:o?"":O.trim()||"Первый коммит"})}return i.jsxs(Nl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!De,onClick:fe,children:d||"Опубликовать"})]}),children:[i.jsx(lk,{status:l,onRefreshStatus:m,onSaveToken:g}),i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Имя"}),i.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:pe=>C(Bx(pe.target.value))})]}),v.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),s.length>1?i.jsx(Cs,{className:"settings__select",value:T,options:P,onChange:E,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((z=s[0])==null?void 0:z.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:L,placeholder:"о чём проект — одной строкой",onChange:pe=>$(pe.target.value)})]}),i.jsxs("div",{className:"field publish__field",children:[i.jsx("span",{children:"Видимость"}),i.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[i.jsx(Ix,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:J,onClick:()=>G(!0)}),i.jsx(Ix,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!J,onClick:()=>G(!1)})]})]})]}),!o&&i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?i.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"publish__filehead",children:[i.jsxs("span",{className:"publish__filecount",children:[_e," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:B,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>ne(pe.target.value)}),i.jsx("div",{className:"publish__filelist",children:ue.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ue.map(pe=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(pe))===!0,className:"publish__file",onClick:()=>Ne(pe),children:[i.jsx("span",{className:"publish__box"+(M!=null&&M.has(pe)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(pe))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),r.truncated&&i.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Сообщение коммита"}),i.jsx("input",{className:"input",value:O,onChange:pe=>Z(pe.target.value)})]})]})]}),i.jsx(_r,{result:h,onDismiss:_})]})}function Ix({title:l,desc:s,on:r,risky:c,onClick:o}){return i.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[l,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:s})]})]})}function lk({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=y.useState(""),[d,h]=y.useState(!1);return i.jsxs("div",{className:"publish__section publish__section--first",children:[i.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:l.login}),i.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[l.ghInstalled&&i.jsxs("p",{className:"modal__text",children:["В системе установлен ",i.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",i.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Личный токен GitHub"}),i.jsx(sk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),i.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",i.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",i.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),l.message&&i.jsx("p",{className:"modal__error",children:l.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function sk({value:l,onChange:s,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return i.jsxs("div",{className:"pwfield",children:[i.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>s(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(ik,{}):i.jsx(ak,{})})]})}function ak(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function ik(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),i.jsx("path",{d:"M2 14 14 2"})]})}function rk({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=y.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(Nl,{title:"Подключить существующий репозиторий",onClose:o,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||l!=="",onClick:()=>r(d.trim()),children:l||"Подключить"})]}),children:[i.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",i.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Адрес репозитория"}),i.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&l===""&&r(d.trim())}})]}),i.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",i.jsx("code",{children:"https://…"}),", ",i.jsx("code",{children:"ssh://…"}),", ",i.jsx("code",{children:"git://…"})," и"," ",i.jsx("code",{children:"git@host:path"}),"."]}),i.jsx(_r,{result:s,onDismiss:c})]})}function ck({open:l,items:s,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:g,effort:b,ultracode:_,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:T,onModel:E,onEffort:L,onUltracode:$,onThinking:J,onSwitchOnFlag:G,onAsk:O,onInterrupt:Z,onReset:M,onClose:D,zoomed:B,onToggleZoom:ne}){return i.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(B?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:he=>{ne&&(he.target.closest("button")||ne())},children:[i.jsx(ok,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:M,children:"↻"}),ne&&i.jsx("button",{className:"sidepane__btn",title:B?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":B?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":B,onClick:ne,children:i.jsx(kc,{active:B})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),m.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Jy,{className:"select--compact",models:m,value:g,effort:b,ultracode:_,thinking:j,switchOnFlag:v,onModel:E,onEffort:L,onUltracode:$,onThinking:J,onSwitchOnFlag:G}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(Op,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(Ky,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,onContextSearch:C,onCommand:T,onSend:O,onInterrupt:Z,onEscape:r?Z:D})]})}function ok(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const uk=75,fk=90;function Py({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return i.jsx("div",{className:"usage",title:pk(l,s),"aria-label":c,children:r.map(o=>i.jsx(dk,{label:o.label,window:o.window},o.key))})}function dk({label:l,window:s}){const r=Math.round(s.utilization),c=gk(s.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:l}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${hk(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:zp(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function hk(l){return l>=fk?" usage__fill--over":l>=uk?" usage__fill--warn":""}function pk(l,s){if(s.length>0)return mk(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=zp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
120
- `)}function mk(l){const s=["Квота Antigravity"];for(const r of l){const c=zp(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
121
- `)}function e_(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function t_(l){return l.getTime()-Date.now()<1440*60*1e3}function gk(l){const s=e_(l);return s?t_(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function zp(l){const s=e_(l);return s?`обнулится ${t_(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function n_(){const[l,s]=y.useState(()=>new Date);return y.useEffect(()=>{let r=0;const c=()=>{const d=new Date;s(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),i.jsxs("time",{className:"clock",dateTime:l.toISOString(),title:bk(l),children:[i.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function bk(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function xk({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:b,onHandoff:_,onFreshSession:j,handoffWriting:v,onStop:C}){const T=gy({onLongPress:()=>j==null?void 0:j(),onClick:()=>_==null?void 0:_(),disabled:v});return i.jsx(Nl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:i.jsxs("div",{className:"sessionmenu",children:[s&&i.jsx(rc,{label:"Режим прав",children:s}),i.jsx(rc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&i.jsx(rc,{label:"Лимиты плана",children:i.jsx(Py,{usage:c})}),i.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[i.jsx(yk,{}),i.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",g&&i.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsx(rc,{label:"Время",children:i.jsx(n_,{})}),d&&i.jsx(rc,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(rc,{label:"Каталог проекта",children:i.jsx(Fy,{path:o})}),b&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:b,children:"Переименовать сессию"}),_&&i.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":T.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${T.thresholdMs}ms`},"aria-busy":v,disabled:v,...T.handlers,children:[i.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),i.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&i.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),C&&i.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function rc({label:l,children:s}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function yk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function _k({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:m,onClose:g}){const b=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Nl,{title:"Расширения",className:"modal--wide",onClose:g,children:[i.jsx("div",{className:"tabs",role:"tablist",children:b.map(_=>i.jsxs("button",{role:"tab","aria-selected":l===_.id,className:l===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>m(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),l==="mcp"&&i.jsx(vk,{servers:s,actions:h}),l==="plugins"&&i.jsx(Nk,{plugins:r,marketplaces:c,actions:h}),l==="catalog"&&i.jsx(Tk,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>m("plugins")}),i.jsx(_r,{result:d})]})}function vk({servers:l,actions:s}){const[r,c]=y.useState(!1);return i.jsxs(i.Fragment,{children:[l.length===0&&!r&&i.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",i.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",i.jsx("code",{children:"claude mcp list"}),"."]}),i.jsx("ul",{className:"extlist",children:l.map(o=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:o.name}),i.jsx("span",{className:`chip chip--${Sk(o.status)}`,children:jk[o.status]}),o.scope&&i.jsx("span",{className:"chip",children:o.scope}),o.transport&&i.jsx("span",{className:"chip",children:o.transport})]}),o.target&&i.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&i.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&i.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>s.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),r?i.jsx(wk,{onCancel:()=>c(!1),onSubmit:(o,d)=>{s.mcpAdd(o,d),c(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const jk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Sk(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function wk({onSubmit:l,onCancel:s}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,m]=y.useState(""),[g,b]=y.useState(""),[_,j]=y.useState(""),v=o==="stdio",C=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function T(){if(C)if(v){const[E,...L]=kk(h);l(r.trim(),{transport:"stdio",command:E??"",args:L,env:qx(_)})}else l(r.trim(),{transport:o,url:g.trim(),headers:qx(_)})}return i.jsxs("div",{className:"extform extform--card",children:[i.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),i.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:E=>c(E.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Cs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:E=>d(E)}),v?i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),i.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:E=>m(E.target.value)})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),i.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:E=>b(E.target.value)})]}),i.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),i.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:_,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:E=>j(E.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:T,children:"Подключить"})]})]})}function qx(l){const s={};for(const r of l.split(`
122
- `)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function kk(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function Nk({plugins:l,marketplaces:s,actions:r}){const[c,o]=y.useState("");return i.jsxs(i.Fragment,{children:[l.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:l.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:d.name}),i.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&i.jsx("span",{className:"chip",children:d.version}),d.scope&&i.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&i.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&i.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),i.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),i.jsx("ul",{className:"extlist",children:s.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsx("div",{className:"extlist__head",children:i.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&i.jsx("div",{className:"extlist__meta",children:d.source}),i.jsx("div",{className:"extlist__actions",children:i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),i.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const zo=30;function Tk({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(zo),[_,j]=y.useState(""),v=y.useMemo(()=>[...new Set(l.map(E=>E.category).filter(Boolean))].sort(),[l]),C=y.useMemo(()=>{const T=o.trim().toLowerCase();return l.filter(E=>h&&E.category!==h?!1:T?`${E.name} ${E.displayName} ${E.description} ${E.author}`.toLowerCase().includes(T):!0)},[l,o,h]);return l.length===0?i.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",i.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"catalog__filters",children:[i.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:T=>{d(T.target.value),b(zo)}}),i.jsx(Cs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{m(T),b(zo)}})]}),C.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:C.slice(0,g).map(T=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&i.jsx("span",{className:"chip",children:T.version}),T.category&&i.jsx("span",{className:"chip",children:T.category})]}),T.description&&i.jsx("div",{className:"catalog__desc",children:T.description}),i.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>r.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),C.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>b(T=>T+zo),children:["Ещё ",Math.min(zo,C.length-g)," из ",C.length-g]})}),i.jsxs("div",{className:"extform",children:[i.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>j(T.target.value),onKeyDown:T=>{T.key!=="Enter"||_.trim()===""||(T.preventDefault(),r.pluginInstall(_.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),j("")},children:"Установить"})]})]})]})}function Ek({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[b,_]=y.useState(""),[j,v]=y.useState(!1),[C,T]=y.useState(!1),E=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!C&&!j,L=y.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const G=s.output.trim();return G===""?null:{ok:!0,message:G}},[s.error,s.output]);function $(G=b){const O=G.trim();O!==""&&(r.submitCode(O),_(""))}function J(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return i.jsxs(Nl,{title:"Аккаунт",onClose:g,children:[l===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):l.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:l.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:Mk[l.method]??l.method}),l.plan&&i.jsx("span",{className:"chip",children:l.plan})]}),l.organization&&i.jsx("div",{className:"extlist__meta",children:l.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?i.jsx(Rk,{login:s,remote:c,code:b,onCode:_,onSubmit:$,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(_r,{result:L}),C&&i.jsx("p",{className:"account__warn",role:"alert",children:Ck(o)}),E&&h&&i.jsx("p",{className:"account__note",children:m}),i.jsx("div",{className:`extbar${l!=null&&l.loggedIn?" account__bar":""}`,children:l!=null&&l.loggedIn?i.jsxs(i.Fragment,{children:[E&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
- ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(Ak,{}),"Переподключить"]}),C?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>T(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{T(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:J,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{T(!1),v(!0)},children:"Выйти"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function Ck(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function Ak(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Mk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Rk({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,m]=y.useState(null),g=y.useRef(""),b=y.useRef({code:r,onCode:c,onSubmit:o});b.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async E=>{const{code:L,onCode:$,onSubmit:J}=b.current;if(E&&L.trim()!=="")return;const G=await hp();if(G===null){E||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const O=G.trim();if(!Gx(O)){E||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(E){if(g.current===O)return;g.current=O}m(null),$(O),J(O)},[]);y.useEffect(()=>{if(!l.awaitingCode)return;const E=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[l.awaitingCode,_]);const j=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!Gx(r),C=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[l.url?s?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:l.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),i.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),i.jsxs("div",{className:"account__raw",children:[i.jsx("span",{className:"account__rawurl",children:l.url}),i.jsx(Rp,{text:l.url,hint:"ссылку входа"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),i.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),i.jsxs("details",{className:"account__fallback",children:[i.jsx("summary",{children:"Браузер не открылся"}),i.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),i.jsx("a",{className:"account__link",href:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.awaitingCode&&i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),i.jsxs("div",{className:"extform__row account__coderow",children:[i.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:E=>{m(null),c(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),C&&i.jsx("p",{className:"account__note account__note--code",children:C})]}),l.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:l.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function Gx(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function Dk({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(!1),_=y.useRef(null),j=(l==null?void 0:l.paired)===!0;y.useEffect(()=>{var C;j||(C=_.current)==null||C.focus()},[j]),y.useEffect(()=>{b(!1),j&&d("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return i.jsx(Nl,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Yx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),i.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),i.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):i.jsxs("div",{className:"relay",children:[i.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),i.jsxs("ol",{className:"relay__steps",children:[i.jsxs("li",{children:["Откройте ",i.jsx("b",{children:Yx(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:C=>{C.preventDefault(),o.trim()&&(b(!0),s(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:C=>d(C.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Как назвать этот компьютер"}),i.jsx("input",{className:"input",value:h,onChange:C=>m(C.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function Yx(l){try{return new URL(l).host}catch{return l}}const ep="",Ok=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Lk=dy.map(l=>({value:l.value,label:l.value,hint:l.hint})),Nf=3600*1e3,zk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],oc={"6h":6*Nf,"24h":24*Nf,"48h":48*Nf,"168h":168*Nf,never:0};function Uk(l){return oc[l]??oc["48h"]}const Hk=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Tf=60*1e3,uc={"5m":5*Tf,"10m":10*Tf,"30m":30*Tf,"60m":60*Tf,never:0};function Bk(l){return uc[l]??uc["10m"]}function Ik(l){const s=Object.entries(uc).find(([,r])=>r===l);return s?s[0]:Object.keys(uc).reduce((r,c)=>Math.abs(uc[c]-l)<Math.abs(uc[r]-l)?c:r)}function qk(l){const s=Object.entries(oc).find(([,r])=>r===l);return s?s[0]:Object.keys(oc).reduce((r,c)=>Math.abs(oc[c]-l)<Math.abs(oc[r]-l)?c:r)}const Gk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],fc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Yk(l){return fc[l]??fc.off}function $x(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function $k(l){const s=Object.entries(fc).find(([,r])=>r===l);return s?s[0]:Object.keys(fc).reduce((r,c)=>Math.abs(fc[c]-l)<Math.abs(fc[r]-l)?c:r)}const Xk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Vk({settings:l,models:s,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:g}){const b=l===null,_=!b&&l.terminalEnabled===!0,j=!b&&l.liveSessionsFirst===!0,v=!_,C=y.useMemo(()=>{const E=[{value:ep,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(L=>({value:L.value,label:L.displayName,hint:L.description})):Ok];return l&&l.startModel!==null&&!E.some(L=>L.value===l.startModel)&&E.push({value:l.startModel,label:l.startModel}),E},[s,l]);function T(){var E,L;return(r==null?void 0:r.paired)!==!0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:m,children:"Связать компьютер"})]}):(E=r.shell)!=null&&E.enabled?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),i.jsx("button",{type:"button",className:"btn btn--danger",disabled:v,onClick:h,children:"Запретить"})]}):(L=r.shell)!=null&&L.pending?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",i.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),i.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Отправить письмо ещё раз"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Разрешить с телефона"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Прислать письмо"})]})]})}return i.jsx(Nl,{title:"Настройки",onClose:g,children:i.jsxs("div",{className:"settings",children:[i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),i.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:qk(l.autoArchiveAfterMs),options:zk,onChange:E=>o({autoArchiveAfterMs:Uk(E)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:Ik(l.autoStopAfterMs),options:Hk,onChange:E=>o({autoStopAfterMs:Bk(E)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),i.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopFiveHourPct,onChange:E=>o({limitStopFiveHourPct:$x(E.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopSevenDayPct,onChange:E=>o({limitStopSevenDayPct:$x(E.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:$k(l.autoSaveAfterPauseMs),options:Gk,onChange:E=>o({autoSaveAfterPauseMs:Yk(E)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),i.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Модель"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:l.startModel??ep,options:C,onChange:E=>o({startModel:E===ep?null:E}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:l.startPermissionMode,options:Lk,onChange:E=>o({startPermissionMode:E}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsx("section",{className:"settings__section",children:i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),i.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":j,"aria-label":"Запущенные сессии сверху",className:j?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!j}),children:i.jsx("span",{className:"switch__knob"})})]})}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),i.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),i.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:Xk.map(E=>{const L=!b&&l.folderAccess===E.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:b,className:"access__card"+(L?" is-on":"")+(E.risky?" access__card--risky":""),onClick:()=>o({folderAccess:E.value}),children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[E.title,E.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:E.description})]})]},E.value)})})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Терминал"}),i.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-label":"Терминал",className:_?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!_}),children:i.jsx("span",{className:"switch__knob"})})]}),i.jsxs("div",{className:"settings__nested"+(v?" is-disabled":""),children:[i.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),b?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[v&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),T()]})]})]})]})})}const Xx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Qk(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function Kk({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${Xx[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.stoppedAt).toLocaleString()}`;return i.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[i.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}return i.jsxs("div",{className:"handoff",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[l.limit===null?i.jsxs(i.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):i.jsxs(i.Fragment,{children:[Xx[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",Qk(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,children:"Продолжить в новой сессии"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function Zk({handoff:l,onClose:s}){const[r,c]=y.useState("");return y.useEffect(()=>{let o=!1;return Qf(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),i.jsx(Nl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Vx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Fk=12e3;function Jk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function Wk({notices:l,onDismiss:s}){return l.length===0?null:i.jsx("div",{className:"limittoasts",children:l.map(r=>i.jsx(Pk,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function Pk({notice:l,onDismiss:s}){return y.useEffect(()=>{const r=window.setTimeout(s,Fk);return()=>window.clearTimeout(r)},[s]),i.jsxs("div",{className:"limittoast",role:"status",children:[i.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),i.jsx("span",{className:"limittoast__body",children:l.stopped>0?i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",Jk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}const eN=16;function tN({pane:l,width:s,onResize:r,onReset:c}){const o=mr[l],d=y.useRef(null);function h(_){if(_.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-W0):0;d.current={x:_.clientX,width:s,max:Math.min(o.max,s+v)},_.currentTarget.setPointerCapture(_.pointerId),document.body.classList.add("is-resizing"),_.preventDefault()}function m(_){const j=d.current;if(!j)return;const v=o.side==="left"?_.clientX-j.x:j.x-_.clientX;r(Math.min(j.max,j.width+v))}function g(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function b(_){const j=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;j!==0&&(_.preventDefault(),r(s+j*eN*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:b,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const nN=16;function lN({height:l,onResize:s,onReset:r}){const c=y.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const _=b.getBoundingClientRect().height-nv;return Math.round(l+Math.max(0,_))}function d(b){b.button===0&&(c.current={y:b.clientY,height:l,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const _=c.current;if(!_)return;const j=_.y-b.clientY;s(_.height+j,_.max)}function m(b){c.current&&(c.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function g(b){const _=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;_!==0&&(b.preventDefault(),s(l+_*nN,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":my,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function Qx(){const l=document.documentElement,s=getComputedStyle(l),r=J=>s.getPropertyValue(J).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),_=r("--danger"),j=r("--ok"),v=r("--warn"),C=r("--cm-fn"),T=r("--cm-key"),E=r("--cm-type"),L=Kx(o,c,55),$=J=>Kx(J,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:L,brightBlack:h,red:_,brightRed:$(_),green:j,brightGreen:$(j),yellow:v,brightYellow:$(v),blue:C,brightBlue:$(C),magenta:T,brightMagenta:$(T),cyan:E,brightCyan:$(E),white:d,brightWhite:o}}function sN(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Ps=null;function aN(l){return Ps||(Ps=document.createElement("span"),Ps.style.position="fixed",Ps.style.width="0",Ps.style.height="0",Ps.style.opacity="0",Ps.style.pointerEvents="none",document.body.appendChild(Ps)),Ps.style.color=l,getComputedStyle(Ps).color}function Kx(l,s,r){return aN(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Ef=null;function iN(){return Ef||(Ef=Promise.all([Qe(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Qe(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Qe(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Qe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Ef=null,l})),Ef}function rN({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:_,onOpen:j,onClose:v,onInput:C,onResize:T,onAttach:E,onHide:L,registerSink:$}){const[J,G]=y.useState(()=>Qx());return y.useEffect(()=>{const O=new MutationObserver(()=>G(Qx()));return O.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>O.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:d},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:O=>{b&&(O.target.closest("button")||b())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(O=>i.jsxs("div",{role:"tab","aria-selected":O.id===s,className:"termtab"+(O.id===s?" is-on":"")+(O.exitCode!==null?" termtab--exited":""),onDoubleClick:Z=>{b&&(Z.target.closest(".termtab__close")||b())},children:[i.jsx("button",{className:"termtab__name",title:O.cwd,onClick:()=>_(O.id),children:O.title}),O.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${O.exitCode}`,children:O.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${O.title}»`,onClick:()=>v(O.id),children:"✕"})]},O.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),b&&i.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:i.jsx(kc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:L,children:"✕"})]}),c&&l.length>0&&i.jsx(Zx,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?i.jsx(Zx,{message:c,onRetry:r?null:j,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(O=>i.jsx(oN,{id:O.id,exitCode:O.exitCode,active:O.id===s,theme:J,mobile:m,onInput:C,onResize:T,onAttach:E,registerSink:$},O.id))]})]})}function Zx({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=cN(l);return i.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),d&&i.jsx("p",{className:"termfail__hint",children:d}),h&&i.jsxs("details",{className:"termfail__details",children:[i.jsx("summary",{children:"Подробности"}),i.jsx("pre",{children:h})]})]}),i.jsxs("div",{className:"termfail__bar",children:[r&&i.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),i.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function cN(l){const[s="",...r]=l.trim().split(`
113
+ `}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${ea(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=Ib(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+ea(s)+'"'),d+=">"+c+"</a>",d}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Ib(l);if(o===null)return ea(r);l=o;let d=`<img src="${l}" alt="${ea(r)}"`;return s&&(d+=` title="${ea(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:ea(l.text)}},Tp=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Es=class cp{constructor(s){Lt(this,"options");Lt(this,"renderer");Lt(this,"textRenderer");this.options=s||_r,this.options.renderer=this.options.renderer||new Hf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tp}static parse(s,r){return new cp(r).parse(s)}static parseInline(s,r){return new cp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=b||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(s,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=b||"";continue}}let g=m;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let b='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return c}},Af,Ho=(Af=class{constructor(l){Lt(this,"options");Lt(this,"block");this.options=l||_r}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Ts.lex:Ts.lexInline}provideParser(l=this.block){return l?Es.parse:Es.parseInline}},Lt(Af,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Lt(Af,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Af),Fv=class{constructor(...l){Lt(this,"defaults",yp());Lt(this,"options",this.setOptions);Lt(this,"parse",this.parseMarkdown(!0));Lt(this,"parseInline",this.parseMarkdown(!1));Lt(this,"Parser",Es);Lt(this,"Renderer",Hf);Lt(this,"TextRenderer",Tp);Lt(this,"Lexer",Ts);Lt(this,"Tokenizer",Uf);Lt(this,"Hooks",Ho);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let d of l)switch(r=r.concat(s.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,s));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=s.renderers[o.name];d?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=s[o.level];d?d.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new Hf(this.defaults);for(let d in r.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=r.renderer[h],g=o[h];o[h]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Uf(this.defaults);for(let d in r.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=r.tokenizer[h],g=o[h];o[h]=(...b)=>{let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Ho;for(let d in r.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=r.hooks[h],g=o[h];Ho.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&Ho.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,b);return g.call(o,j)})();let _=m.call(o,b);return g.call(o,_)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,b);return j===!1&&(j=await g.apply(o,b)),j})();let _=m.apply(o,b);return _===!1&&(_=g.apply(o,b)),_}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return Ts.lex(l,s??this.defaults)}parser(l,s){return Es.parse(l,s??this.defaults)}parseMarkdown(l){return(s,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(l,s){return r=>{if(r.message+=`
114
+ Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+ea(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},yr=new Fv;function Nt(l,s){return yr.parse(l,s)}Nt.options=Nt.setOptions=function(l){return yr.setOptions(l),Nt.defaults=yr.defaults,by(Nt.defaults),Nt};Nt.getDefaults=yp;Nt.defaults=_r;Nt.use=function(...l){return yr.use(...l),Nt.defaults=yr.defaults,by(Nt.defaults),Nt};Nt.walkTokens=function(l,s){return yr.walkTokens(l,s)};Nt.parseInline=yr.parseInline;Nt.Parser=Es;Nt.parser=Es.parse;Nt.Renderer=Hf;Nt.TextRenderer=Tp;Nt.Lexer=Ts;Nt.lexer=Ts.lex;Nt.Tokenizer=Uf;Nt.Hooks=Ho;Nt.parse=Nt;Nt.options;Nt.setOptions;Nt.use;Nt.walkTokens;Nt.parseInline;Es.parse;Ts.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function $b(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function Jv(l){if(Array.isArray(l))return l}function Wv(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,b=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(_){b=!0,o=_}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function Pv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
115
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e1(l,s){return Jv(l)||Wv(l,s)||t1(l,s)||Pv()}function t1(l,s){if(l){if(typeof l=="string")return $b(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$b(l,s):void 0}}const Ty=Object.entries,Xb=Object.setPrototypeOf,n1=Object.isFrozen,l1=Object.getPrototypeOf,s1=Object.getOwnPropertyDescriptor;let cl=Object.freeze,ol=Object.seal,oc=Object.create,Ey=typeof Reflect<"u"&&Reflect,op=Ey.apply,up=Ey.construct;cl||(cl=function(s){return s});ol||(ol=function(s){return s});op||(op=function(s,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return s.apply(r,o)});up||(up=function(s){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new s(...c)});const sc=Gn(Array.prototype.forEach),a1=Gn(Array.prototype.lastIndexOf),Vb=Gn(Array.prototype.pop),ac=Gn(Array.prototype.push),i1=Gn(Array.prototype.splice),Li=Array.isArray,Bo=Gn(String.prototype.toLowerCase),Ih=Gn(String.prototype.toString),Qb=Gn(String.prototype.match),Mo=Gn(String.prototype.replace),Kb=Gn(String.prototype.indexOf),r1=Gn(String.prototype.trim),c1=Gn(Number.prototype.toString),o1=Gn(Boolean.prototype.toString),Zb=typeof BigInt>"u"?null:Gn(BigInt.prototype.toString),Fb=typeof Symbol>"u"?null:Gn(Symbol.prototype.toString),Wn=Gn(Object.prototype.hasOwnProperty),Ro=Gn(Object.prototype.toString),Jn=Gn(RegExp.prototype.test),ir=u1(TypeError);function Gn(l){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return op(l,s,c)}}function u1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return up(l,r)}}function ht(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bo;if(Xb&&Xb(l,null),!Li(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(n1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function f1(l){for(let s=0;s<l.length;s++)Wn(l,s)||(l[s]=null);return l}function kl(l){const s=oc(null);for(const c of Ty(l)){var r=e1(c,2);const o=r[0],d=r[1];Wn(l,o)&&(Li(d)?s[o]=f1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=kl(d):s[o]=d)}return s}function d1(l){switch(typeof l){case"string":return l;case"number":return c1(l);case"boolean":return o1(l);case"bigint":return Zb?Zb(l):"0";case"symbol":return Fb?Fb(l):"Symbol()";case"undefined":return Ro(l);case"function":case"object":{if(l===null)return Ro(l);const s=l,r=ta(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Ro(c)}return Ro(l)}default:return Ro(l)}}function ta(l,s){for(;l!==null;){const c=s1(l,s);if(c){if(c.get)return Gn(c.get);if(typeof c.value=="function")return Gn(c.value)}l=l1(l)}function r(){return null}return r}function h1(l){try{return Jn(l,""),!0}catch{return!1}}const Jb=cl(["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"]),qh=cl(["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"]),Gh=cl(["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"]),p1=cl(["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"]),Yh=cl(["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"]),m1=cl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wb=cl(["#text"]),Pb=cl(["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"]),$h=cl(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ex=cl(["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"]),df=cl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g1=ol(/{{[\w\W]*|^[\w\W]*}}/g),b1=ol(/<%[\w\W]*|^[\w\W]*%>/g),x1=ol(/\${[\w\W]*/g),y1=ol(/^data-[\-\w.\u00B7-\uFFFF]+$/),_1=ol(/^aria-[\-\w]+$/),tx=ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),v1=ol(/^(?:\w+script|data):/i),j1=ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),S1=ol(/^html$/i),w1=ol(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=ol(/<[/\w!]/g),lx=ol(/<[/\w]/g),k1=ol(/<\/no(script|embed|frames)/i),N1=ol(/\/>/i),Vl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},T1=function(){return typeof window>"u"?null:window},E1=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},sx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ai=function(s,r,c,o){return Wn(s,r)&&Li(s[r])?ht(o.base?kl(o.base):{},s[r],o.transform):c};function Cy(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T1();const s=me=>Cy(me);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==Vl.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const d=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,b=l.NamedNodeMap;b===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const _=l.DOMParser,j=l.trustedTypes,v=m.prototype,C=ta(v,"cloneNode"),T=ta(v,"remove"),E=ta(v,"nextSibling"),M=ta(v,"childNodes"),G=ta(v,"parentNode"),F=ta(v,"shadowRoot"),q=ta(v,"attributes"),L=h&&h.prototype?ta(h.prototype,"nodeType"):null,Z=h&&h.prototype?ta(h.prototype,"nodeName"):null;if(typeof d=="function"){const me=r.createElement("template");me.content&&me.content.ownerDocument&&(r=me.content.ownerDocument)}let R,O="",B,ne=!1,he=0;const P=function(){if(he>0)throw ir('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ue=function(N){P(),he++;try{return R.createHTML(N)}finally{he--}},_e=function(N){P(),he++;try{return R.createScriptURL(N)}finally{he--}},De=function(){return ne||(B=E1(j,o),ne=!0),B},Ne=r,A=Ne.implementation,fe=Ne.createNodeIterator,z=Ne.createDocumentFragment,pe=Ne.getElementsByTagName,ke=c.importNode;let k=sx();s.isSupported=typeof Ty=="function"&&typeof G=="function"&&A&&A.createHTMLDocument!==void 0;const V=g1,ce=b1,ge=x1,Ae=y1,Se=_1,Te=v1,Tt=j1,Ye=w1;let et=tx,Xe=null;const Qt=ht({},[...Jb,...qh,...Gh,...Yh,...Wb]);let tt=null;const Yt=ht({},[...Pb,...$h,...ex,...df]);let nt=Object.seal(oc(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}})),en=null,$t=null;const tn=Object.seal(oc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,pn=!0,Sn=!1,mn=!0,cn=!1,Ke=!0,zt=!1,gn=!1,ft=null,Je=null,An=!1,on=!1,wn=!1,Pn=!1,Xt=!0,wt=!1;const Kt="user-content-";let Et=!0,Yn=!1,le={},be=null;const Le=ht({},["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 H=null;const W=ht({},["audio","video","img","source","image","track"]);let xe=null;const Be=ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gt="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",bn="http://www.w3.org/1999/xhtml";let Rn=bn,ul=!1,gl=null;const ca=ht({},[gt,Mn,bn],Ih),Ql=cl(["mi","mo","mn","ms","mtext"]);let ps=ht({},Ql);const Ms=cl(["annotation-xml"]);let Dn=ht({},Ms);const Kl=ht({},["title","style","font","a","script"]);let bl=null;const $n=["application/xhtml+xml","text/html"],Vt="text/html";let $e=null,vt=null;const xl=r.createElement("form"),lt=function(N){return N instanceof RegExp||N instanceof Function},Zl=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vt&&vt===N)return;(!N||typeof N!="object")&&(N={}),N=kl(N),bl=$n.indexOf(N.PARSER_MEDIA_TYPE)===-1?Vt:N.PARSER_MEDIA_TYPE,$e=bl==="application/xhtml+xml"?Ih:Bo,Xe=Ai(N,"ALLOWED_TAGS",Qt,{transform:$e}),tt=Ai(N,"ALLOWED_ATTR",Yt,{transform:$e}),gl=Ai(N,"ALLOWED_NAMESPACES",ca,{transform:Ih}),xe=Ai(N,"ADD_URI_SAFE_ATTR",Be,{transform:$e,base:Be}),H=Ai(N,"ADD_DATA_URI_TAGS",W,{transform:$e,base:W}),be=Ai(N,"FORBID_CONTENTS",Le,{transform:$e}),en=Ai(N,"FORBID_TAGS",kl({}),{transform:$e}),$t=Ai(N,"FORBID_ATTR",kl({}),{transform:$e}),le=Wn(N,"USE_PROFILES")?N.USE_PROFILES&&typeof N.USE_PROFILES=="object"?kl(N.USE_PROFILES):N.USE_PROFILES:!1,nn=N.ALLOW_ARIA_ATTR!==!1,pn=N.ALLOW_DATA_ATTR!==!1,Sn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,mn=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,cn=N.SAFE_FOR_TEMPLATES||!1,Ke=N.SAFE_FOR_XML!==!1,zt=N.WHOLE_DOCUMENT||!1,on=N.RETURN_DOM||!1,wn=N.RETURN_DOM_FRAGMENT||!1,Pn=N.RETURN_TRUSTED_TYPE||!1,An=N.FORCE_BODY||!1,Xt=N.SANITIZE_DOM!==!1,wt=N.SANITIZE_NAMED_PROPS||!1,Et=N.KEEP_CONTENT!==!1,Yn=N.IN_PLACE||!1,et=h1(N.ALLOWED_URI_REGEXP)?N.ALLOWED_URI_REGEXP:tx,Rn=typeof N.NAMESPACE=="string"?N.NAMESPACE:bn,ps=Wn(N,"MATHML_TEXT_INTEGRATION_POINTS")&&N.MATHML_TEXT_INTEGRATION_POINTS&&typeof N.MATHML_TEXT_INTEGRATION_POINTS=="object"?kl(N.MATHML_TEXT_INTEGRATION_POINTS):ht({},Ql),Dn=Wn(N,"HTML_INTEGRATION_POINTS")&&N.HTML_INTEGRATION_POINTS&&typeof N.HTML_INTEGRATION_POINTS=="object"?kl(N.HTML_INTEGRATION_POINTS):ht({},Ms);const $=Wn(N,"CUSTOM_ELEMENT_HANDLING")&&N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING=="object"?kl(N.CUSTOM_ELEMENT_HANDLING):oc(null);if(nt=oc(null),Wn($,"tagNameCheck")&&lt($.tagNameCheck)&&(nt.tagNameCheck=$.tagNameCheck),Wn($,"attributeNameCheck")&&lt($.attributeNameCheck)&&(nt.attributeNameCheck=$.attributeNameCheck),Wn($,"allowCustomizedBuiltInElements")&&typeof $.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=$.allowCustomizedBuiltInElements),ol(nt),cn&&(pn=!1),wn&&(on=!0),le&&(Xe=ht({},Wb),tt=oc(null),le.html===!0&&(ht(Xe,Jb),ht(tt,Pb)),le.svg===!0&&(ht(Xe,qh),ht(tt,$h),ht(tt,df)),le.svgFilters===!0&&(ht(Xe,Gh),ht(tt,$h),ht(tt,df)),le.mathMl===!0&&(ht(Xe,Yh),ht(tt,ex),ht(tt,df))),tn.tagCheck=null,tn.attributeCheck=null,Wn(N,"ADD_TAGS")&&(typeof N.ADD_TAGS=="function"?tn.tagCheck=N.ADD_TAGS:Li(N.ADD_TAGS)&&(Xe===Qt&&(Xe=kl(Xe)),ht(Xe,N.ADD_TAGS,$e))),Wn(N,"ADD_ATTR")&&(typeof N.ADD_ATTR=="function"?tn.attributeCheck=N.ADD_ATTR:Li(N.ADD_ATTR)&&(tt===Yt&&(tt=kl(tt)),ht(tt,N.ADD_ATTR,$e))),Wn(N,"ADD_URI_SAFE_ATTR")&&Li(N.ADD_URI_SAFE_ATTR)&&ht(xe,N.ADD_URI_SAFE_ATTR,$e),Wn(N,"FORBID_CONTENTS")&&Li(N.FORBID_CONTENTS)&&(be===Le&&(be=kl(be)),ht(be,N.FORBID_CONTENTS,$e)),Wn(N,"ADD_FORBID_CONTENTS")&&Li(N.ADD_FORBID_CONTENTS)&&(be===Le&&(be=kl(be)),ht(be,N.ADD_FORBID_CONTENTS,$e)),Et&&(Xe["#text"]=!0),zt&&ht(Xe,["html","head","body"]),Xe.table&&(ht(Xe,["tbody"]),delete en.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw ir('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ir('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ae=R;R=N.TRUSTED_TYPES_POLICY;try{O=ue("")}catch(we){throw R=ae,we}}else N.TRUSTED_TYPES_POLICY===null?(R=void 0,O=""):(R===void 0&&(R=De()),R&&typeof O=="string"&&(O=ue("")));cl&&cl(N),vt=N},Ut=ht({},[...qh,...Gh,...p1]),el=ht({},[...Yh,...m1]),kt=function(N,$,ae){return $.namespaceURI===bn?N==="svg":$.namespaceURI===gt?N==="svg"&&(ae==="annotation-xml"||ps[ae]):!!Ut[N]},Tl=function(N,$,ae){return $.namespaceURI===bn?N==="math":$.namespaceURI===Mn?N==="math"&&Dn[ae]:!!el[N]},ln=function(N,$,ae){return $.namespaceURI===Mn&&!Dn[ae]||$.namespaceURI===gt&&!ps[ae]?!1:!el[N]&&(Kl[N]||!Ut[N])},kn=function(N){let $=G(N);(!$||!$.tagName)&&($={namespaceURI:Rn,tagName:"template"});const ae=Bo(N.tagName),we=Bo($.tagName);return gl[N.namespaceURI]?N.namespaceURI===Mn?kt(ae,$,we):N.namespaceURI===gt?Tl(ae,$,we):N.namespaceURI===bn?ln(ae,$,we):!!(bl==="application/xhtml+xml"&&gl[N.namespaceURI]):!1},bt=function(N){ac(s.removed,{element:N});try{G(N).removeChild(N)}catch{if(T(N),!G(N))throw ir("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ze=function(N){xn(N);const $=M(N);if($){const we=[];sc($,ve=>{ac(we,ve)}),sc(we,ve=>{try{T(ve)}catch{}})}const ae=q(N);if(ae)for(let we=ae.length-1;we>=0;--we){const ve=ae[we],ze=ve&&ve.name;if(typeof ze=="string")try{N.removeAttribute(ze)}catch{}}},On=function(N,$){try{ac(s.removed,{attribute:$.getAttributeNode(N),from:$})}catch{ac(s.removed,{attribute:null,from:$})}if($.removeAttribute(N),N==="is")if(on||wn)try{bt($)}catch{}else try{$.setAttribute(N,"")}catch{}},El=function(N){const $=q(N);if($)for(let ae=$.length-1;ae>=0;--ae){const we=$[ae],ve=we&&we.name;if(!(typeof ve!="string"||tt[$e(ve)]))try{N.removeAttribute(ve)}catch{}}},xn=function(N){const $=[N];for(;$.length>0;){const ae=$.pop();(L?L(ae):ae.nodeType)===Vl.element&&El(ae);const ve=M(ae);if(ve)for(let ze=ve.length-1;ze>=0;--ze)$.push(ve[ze])}},Nn=function(N){if(!Ke)return;const $=[N];for(;$.length>0;){const ae=$.pop(),we=L?L(ae):ae.nodeType;if(we===Vl.processingInstruction||we===Vl.comment&&Jn(lx,ae.data)){try{T(ae)}catch{}continue}if(we===Vl.element){const ze=ae,ot=$e(Z?Z(ae):ae.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&ot!=="label"&&ot!=="output"&&ze.removeAttribute("for")}catch{}}const ve=M(ae);if(ve)for(let ze=ve.length-1;ze>=0;--ze)$.push(ve[ze])}},tl=function(N){let $=null,ae=null;if(An)N="<remove></remove>"+N;else{const ze=Qb(N,/^[\r\n\t ]+/);ae=ze&&ze[0]}bl==="application/xhtml+xml"&&Rn===bn&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const we=R?ue(N):N;if(Rn===bn)try{$=new _().parseFromString(we,bl)}catch{}if(!$||!$.documentElement){$=A.createDocument(Rn,"template",null);try{$.documentElement.innerHTML=ul?O:we}catch{}}const ve=$.body||$.documentElement;return N&&ae&&ve.insertBefore(r.createTextNode(ae),ve.childNodes[0]||null),Rn===bn?pe.call($,zt?"html":"body")[0]:zt?$.documentElement:ve},ms=function(N){return fe.call(N.ownerDocument||N,N,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},yn=function(N){return N=Mo(N,V," "),N=Mo(N,ce," "),N=Mo(N,ge," "),N},Fl=function(N){var $;N.normalize();const ae=fe.call(N.ownerDocument||N,N,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let we=ae.nextNode();for(;we;)we.data=yn(we.data),we=ae.nextNode();const ve=($=N.querySelectorAll)===null||$===void 0?void 0:$.call(N,"template");ve&&sc(ve,ze=>{nl(ze.content)&&Fl(ze.content)})},fl=function(N){const $=Z?Z(N):null;return typeof $!="string"||$e($)!=="form"?!1:typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||N.attributes!==q(N)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function"||N.nodeType!==L(N)||N.childNodes!==M(N)},nl=function(N){if(!L||typeof N!="object"||N===null)return!1;try{return L(N)===Vl.documentFragment}catch{return!1}},Ln=function(N){if(!L||typeof N!="object"||N===null)return!1;try{return typeof L(N)=="number"}catch{return!1}};function Ht(me,N,$){me.length!==0&&sc(me,ae=>{ae.call(s,N,$,vt)})}const qa=function(N,$){return!!(Ke&&N.hasChildNodes()&&!Ln(N.firstElementChild)&&Jn(nx,N.textContent)&&Jn(nx,N.innerHTML)||Ke&&N.namespaceURI===bn&&$==="style"&&Ln(N.firstElementChild)||N.nodeType===Vl.processingInstruction||Ke&&N.nodeType===Vl.comment&&Jn(lx,N.data))},Ii=function(N,$){if(!en[$]&&Ga($)&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,$)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck($)))return!1;if(Et&&!be[$]){const ae=G(N),we=M(N);if(we&&ae){const ve=we.length;for(let ze=ve-1;ze>=0;--ze){const ot=Yn?we[ze]:C(we[ze],!0);ae.insertBefore(ot,E(N))}}}return bt(N),!0},Rs=function(N,$){if(Ht(k.beforeSanitizeElements,N,null),N!==$&&G(N)===null)return!0;if(fl(N))return bt(N),!0;const ae=$e(Z?Z(N):N.nodeName);if(Ht(k.uponSanitizeElement,N,{tagName:ae,allowedTags:Xe}),N!==$&&G(N)===null)return!0;if(qa(N,ae))return bt(N),!0;if(en[ae]||!(tn.tagCheck instanceof Function&&tn.tagCheck(ae))&&!Xe[ae]){const ve=Ii(N,ae);return ve===!1&&Ht(k.afterSanitizeElements,N,null),ve}if((L?L(N):N.nodeType)===Vl.element&&!kn(N)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&Jn(k1,N.innerHTML))return bt(N),!0;if(cn&&N.nodeType===Vl.text){const ve=yn(N.textContent);N.textContent!==ve&&(ac(s.removed,{element:N.cloneNode()}),N.textContent=ve)}return Ht(k.afterSanitizeElements,N,null),!1},Ds=function(N,$,ae){if($t[$]||Ke&&$==="patchsrc"||Ke&&$==="for"&&N!=="label"&&N!=="output"||Xt&&($==="id"||$==="name")&&(ae in r||ae in xl))return!1;const we=tt[$]||tn.attributeCheck instanceof Function&&tn.attributeCheck($,N);if(!(pn&&Jn(Ae,$))){if(!(nn&&Jn(Se,$))){if(we){if(!xe[$]){if(!Jn(et,Mo(ae,Tt,""))){if(!(($==="src"||$==="xlink:href"||$==="href")&&N!=="script"&&Kb(ae,"data:")===0&&H[N])){if(!(Sn&&!Jn(Te,Mo(ae,Tt,"")))){if(ae)return!1}}}}}else if(!(Ga(N)&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,N)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(N))&&(nt.attributeNameCheck instanceof RegExp&&Jn(nt.attributeNameCheck,$)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck($,N))||$==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&Jn(nt.tagNameCheck,ae)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(ae))))return!1}}return!0},yl=ht({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ga=function(N){return!yl[Bo(N)]&&Jn(Ye,N)},zn=function(N,$,ae,we){if(R&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ae)switch(j.getAttributeType(N,$)){case"TrustedHTML":return ue(we);case"TrustedScriptURL":return _e(we)}return we},gs=function(N,$,ae,we){try{ae?N.setAttributeNS(ae,$,we):N.setAttribute($,we),fl(N)?bt(N):Vb(s.removed)}catch{On($,N)}},Jl=function(N){Ht(k.beforeSanitizeAttributes,N,null);const $=N.attributes;if(!$||fl(N))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:tt,forceKeepAttr:void 0};let we=$.length;const ve=$e(N.nodeName);for(;we--;){const ze=$[we],ot=ze.name,un=ze.namespaceURI,Mt=ze.value,mt=$e(ot),fn=Mt;let It=ot==="value"?fn:r1(fn);if(ae.attrName=mt,ae.attrValue=It,ae.keepAttr=!0,ae.forceKeepAttr=void 0,Ht(k.uponSanitizeAttribute,N,ae),It=ae.attrValue,wt&&(mt==="id"||mt==="name")&&Kb(It,Kt)!==0&&(On(ot,N),It=Kt+It),Ke&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){On(ot,N);continue}if(mt==="attributename"&&Qb(It,"href")){On(ot,N);continue}if(!ae.forceKeepAttr){if(!ae.keepAttr){On(ot,N);continue}if(!mn&&Jn(N1,It)){On(ot,N);continue}if(cn&&(It=yn(It)),!Ds(ve,mt,It)){On(ot,N);continue}It=zn(ve,mt,un,It),It!==fn&&gs(N,ot,un,It)}}Ht(k.afterSanitizeAttributes,N,null)},sn=function(N){let $=null;const ae=ms(N);for(Ht(k.beforeSanitizeShadowDOM,N,null);$=ae.nextNode();)if(Ht(k.uponSanitizeShadowNode,$,null),Rs($,N),Jl($),nl($.content)&&sn($.content),(L?L($):$.nodeType)===Vl.element){const ve=F($);nl(ve)&&(Bt(ve),sn(ve))}Ht(k.afterSanitizeShadowDOM,N,null)},Bt=function(N){const $=[{node:N,shadow:null}];for(;$.length>0;){const ae=$.pop();if(ae.shadow){sn(ae.shadow);continue}const we=ae.node,ze=(L?L(we):we.nodeType)===Vl.element,ot=M(we);if(ot)for(let un=ot.length-1;un>=0;--un)$.push({node:ot[un],shadow:null});if(ze){const un=Z?Z(we):null;if(typeof un=="string"&&$e(un)==="template"){const Mt=we.content;nl(Mt)&&$.push({node:Mt,shadow:null})}}if(ze){const un=F(we);nl(un)&&$.push({node:null,shadow:un},{node:un,shadow:null})}}};return s.sanitize=function(me){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,ae=null,we=null,ve=null;if(ul=!me,ul&&(me="<!-->"),typeof me!="string"&&!Ln(me)&&(me=d1(me),typeof me!="string"))throw ir("dirty is not a string, aborting");if(!s.isSupported)return me;gn?(Xe=ft,tt=Je):Zl(N),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(Xe=kl(Xe)),k.uponSanitizeAttribute.length>0&&(tt=kl(tt)),s.removed=[];const ze=Yn&&typeof me!="string"&&Ln(me);if(ze){Nn(me);const mt=Z?Z(me):me.nodeName;if(typeof mt=="string"){const fn=$e(mt);if(!Xe[fn]||en[fn])throw Ze(me),ir("root node is forbidden and cannot be sanitized in-place")}if(fl(me))throw Ze(me),ir("root node is clobbered and cannot be sanitized in-place");try{Bt(me)}catch(fn){throw Ze(me),fn}}else if(Ln(me))$=tl("<!---->"),ae=$.ownerDocument.importNode(me,!0),ae.nodeType===Vl.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?$=ae:$.appendChild(ae),Bt(ae);else{if(!on&&!cn&&!zt&&me.indexOf("<")===-1)return R&&Pn?ue(me):me;if($=tl(me),!$)return on?null:Pn?O:""}$&&An&&bt($.firstChild);const ot=ze?me:$,un=ms(ot);try{for(;we=un.nextNode();)Rs(we,ot),Jl(we),nl(we.content)&&sn(we.content)}catch(mt){throw ze&&(Ze(me),sc(s.removed,fn=>{fn.element&&xn(fn.element)})),mt}if(ze)return sc(s.removed,mt=>{mt.element&&xn(mt.element)}),cn&&Fl(me),me;if(on){if(cn&&Fl($),wn)for(ve=z.call($.ownerDocument);$.firstChild;)ve.appendChild($.firstChild);else ve=$;return(tt.shadowroot||tt.shadowrootmode)&&(ve=ke.call(c,ve,!0)),ve}let Mt=zt?$.outerHTML:$.innerHTML;return zt&&Xe["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Jn(S1,$.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
116
+ `+Mt),cn&&(Mt=yn(Mt)),R&&Pn?ue(Mt):Mt},s.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zl(me),gn=!0,ft=Xe,Je=tt},s.clearConfig=function(){vt=null,gn=!1,ft=null,Je=null,R=B,O=""},s.isValidAttribute=function(me,N,$){vt||Zl({});const ae=$e(me),we=$e(N);return Ds(ae,we,$)},s.addHook=function(me,N){typeof N=="function"&&Wn(k,me)&&ac(k[me],N)},s.removeHook=function(me,N){if(Wn(k,me)){if(N!==void 0){const $=a1(k[me],N);return $===-1?void 0:i1(k[me],$,1)[0]}return Vb(k[me])}},s.removeHooks=function(me){Wn(k,me)&&(k[me]=[])},s.removeAllHooks=function(){k=sx()},s}var C1=Cy();const A1=1024;let M1=0;class hs{constructor(s,r){this.from=s,this.to=r}}class Pt{constructor(s={}){this.id=M1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=As.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}Pt.closedBy=new Pt({deserialize:l=>l.split(" ")});Pt.openedBy=new Pt({deserialize:l=>l.split(" ")});Pt.group=new Pt({deserialize:l=>l.split(" ")});Pt.isolate=new Pt({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});Pt.contextHash=new Pt({perNode:!0});Pt.lookAhead=new Pt({perNode:!0});Pt.mounted=new Pt({perNode:!0});class hc{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[Pt.mounted.id]}}const R1=Object.create(null);class As{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):R1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new As(s.name||"",r,s.id,c);if(s.props){for(let d of s.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(Pt.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(Pt.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}As.none=new As("",Object.create(null),0,8);class Ay{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let d of s){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new As(c.name,o,c.id,c.flags):c)}return new Ay(r)}}const hf=new WeakMap,ax=new WeakMap;var Jt;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(Jt||(Jt={}));class Bl{constructor(s,r,c,o,d){if(this.type=s,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let s=hc.get(this);if(s&&!s.overlay)return s.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(s=0){return new Bf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=hf.get(this)||this.topNode,d=new Bf(o);return d.moveTo(s,r),hf.set(this,d._tree),d}get topNode(){return new ml(this,0,0,null)}resolve(s,r=0){let c=Go(hf.get(this)||this.topNode,s,r,!1);return hf.set(this,c),c}resolveInner(s,r=0){let c=Go(ax.get(this)||this.topNode,s,r,!0);return ax.set(this,c),c}resolveStack(s,r=0){return L1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&Jt.IncludeAnonymous)>0;for(let g=this.cursor(h|Jt.IncludeAnonymous);;){let b=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;b=!0}for(;b&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;b=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Ap(As.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Bl(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Bl(As.none,r,c,o)))}static build(s){return z1(s)}}Bl.empty=new Bl(As.none,[],[],0);class Ep{constructor(s,r){this.buffer=s,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ep(this.buffer,this.index)}}class Bi{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return As.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),s+=4,c==s)return d;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return d+"("+h.join(",")+")"}findChild(s,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(My(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,d=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let b=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,b)}return new Bi(d,h,this.set)}}function My(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function Go(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof ml&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:Jt.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof ml&&h.index<0&&((o=m.enter(s,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,d);if(!h)return l;l=h}}class Ry{cursor(s=0){return new Bf(this,s)}getChild(s,r=null,c=null){let o=ix(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return ix(this,s,r,c)}resolve(s,r=0){return Go(this,s,r,!1)}resolveInner(s,r=0){return Go(this,s,r,!0)}matchContext(s){return fp(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class ml extends Ry{constructor(s,r,c,o){super(),this._tree=s,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(s,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,b=r>0?m.length:-1;s!=b;s+=r){let _=m[s],j=g[s]+h.from,v;if(!(!(d&Jt.EnterBracketed&&_ instanceof Bl&&(v=hc.get(_))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+_.length)&&!My(o,c,j,j+_.length))){if(_ instanceof Bi){if(d&Jt.ExcludeBuffers)continue;let C=_.findChild(0,_.buffer.length,r,c-j,o);if(C>-1)return new ia(new D1(h,_,s,j),null,C)}else if(d&Jt.IncludeAnonymous||!_.type.isAnonymous||Cp(_)){let C;if(!(d&Jt.IgnoreMounts)&&(C=hc.get(_))&&!C.overlay)return new ml(C.tree,j,s,h);let T=new ml(_,j,s,h);return d&Jt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?_.children.length-1:0,r,c,o,d)}}}if(d&Jt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&Jt.IgnoreOverlays)&&(o=hc.get(this._tree))&&o.overlay){let d=s-this.from,h=c&Jt.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=d:m<d)&&(r<0||h?g>=d:g>d))return new ml(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ix(l,s,r,c){let o=l.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(s)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function fp(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class D1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class ia extends Ry{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return d<0?null:new ia(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&Jt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return d<0?null:new ia(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new ia(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new ia(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];s.push(c.slice(o,d,h)),r.push(0)}return new Bl(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Dy(l){if(!l.length)return null;let s=0,r=l[0];for(let d=1;d<l.length;d++){let h=l[d];(h.from>r.from||h.to<r.to)&&(r=h,s=d)}let c=r instanceof ml&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new O1(o,r)}class O1{constructor(s,r){this.heads=s,this.node=r}get next(){return Dy(this.heads)}}function L1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof ml?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(s,r)),d=h}else{let h=hc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new ml(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Go(m,s,r,!1))}}return o?Dy(o):c}class Bf{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Jt.EnterBracketed,s instanceof ml)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof ml?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&Jt.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&Jt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+s,h=s<0?-1:c._tree.children.length;d!=h;d+=s){let m=c._tree.children[d];if(this.mode&Jt.IncludeAnonymous||m instanceof Bi||!m.type.isAnonymous||Cp(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new ia(this.buffer,r,this.stack[o]);return this.bufferNode=new ia(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return fp(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return fp(this._tree,s,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Cp(l){return l.children.some(s=>s instanceof Bi||!s.type.isAnonymous||Cp(s))}function z1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=A1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Ep(r,r.length):r,g=c.types,b=0,_=0;function j(Z,R,O,B,ne,he){let{id:P,start:ue,end:_e,size:De}=m,Ne=_,A=b;if(De<0)if(m.next(),De==-1){let k=d[P];O.push(k),B.push(ue-Z);return}else if(De==-3){b=P;return}else if(De==-4){_=P;return}else throw new RangeError(`Unrecognized record size: ${De}`);let fe=g[P],z,pe,ke=ue-Z;if(_e-ue<=o&&(pe=M(m.pos-R,ne))){let k=new Uint16Array(pe.size-pe.skip),V=m.pos-pe.size,ce=k.length;for(;m.pos>V;)ce=G(pe.start,k,ce);z=new Bi(k,_e-pe.start,c),ke=pe.start-Z}else{let k=m.pos-De;m.next();let V=[],ce=[],ge=P>=h?P:-1,Ae=0,Se=_e;for(;m.pos>k;)ge>=0&&m.id==ge&&m.size>=0?(m.end<=Se-o&&(T(V,ce,ue,Ae,m.end,Se,ge,Ne,A),Ae=V.length,Se=m.end),m.next()):he>2500?v(ue,k,V,ce):j(ue,k,V,ce,ge,he+1);if(ge>=0&&Ae>0&&Ae<V.length&&T(V,ce,ue,Ae,ue,Se,ge,Ne,A),V.reverse(),ce.reverse(),ge>-1&&Ae>0){let Te=C(fe,A);z=Ap(fe,V,ce,0,V.length,0,_e-ue,Te,Te)}else z=E(fe,V,ce,_e-ue,Ne-_e,A)}O.push(z),B.push(ke)}function v(Z,R,O,B){let ne=[],he=0,P=-1;for(;m.pos>R;){let{id:ue,start:_e,end:De,size:Ne}=m;if(Ne>4)m.next();else{if(P>-1&&_e<P)break;P<0&&(P=De-o),ne.push(ue,_e,De),he++,m.next()}}if(he){let ue=new Uint16Array(he*4),_e=ne[ne.length-2];for(let De=ne.length-3,Ne=0;De>=0;De-=3)ue[Ne++]=ne[De],ue[Ne++]=ne[De+1]-_e,ue[Ne++]=ne[De+2]-_e,ue[Ne++]=Ne;O.push(new Bi(ue,ne[2]-_e,c)),B.push(_e-Z)}}function C(Z,R){return(O,B,ne)=>{let he=0,P=O.length-1,ue,_e;if(P>=0&&(ue=O[P])instanceof Bl){if(!P&&ue.type==Z&&ue.length==ne)return ue;(_e=ue.prop(Pt.lookAhead))&&(he=B[P]+ue.length+_e)}return E(Z,O,B,ne,he,R)}}function T(Z,R,O,B,ne,he,P,ue,_e){let De=[],Ne=[];for(;Z.length>B;)De.push(Z.pop()),Ne.push(R.pop()+O-ne);Z.push(E(c.types[P],De,Ne,he-ne,ue-he,_e)),R.push(ne-O)}function E(Z,R,O,B,ne,he,P){if(he){let ue=[Pt.contextHash,he];P=P?[ue].concat(P):[ue]}if(ne>25){let ue=[Pt.lookAhead,ne];P=P?[ue].concat(P):[ue]}return new Bl(Z,R,O,B,P)}function M(Z,R){let O=m.fork(),B=0,ne=0,he=0,P=O.end-o,ue={size:0,start:0,skip:0};e:for(let _e=O.pos-Z;O.pos>_e;){let De=O.size;if(O.id==R&&De>=0){ue.size=B,ue.start=ne,ue.skip=he,he+=4,B+=4,O.next();continue}let Ne=O.pos-De;if(De<0||Ne<_e||O.start<P)break;let A=O.id>=h?4:0,fe=O.start;for(O.next();O.pos>Ne;){if(O.size<0)if(O.size==-3||O.size==-4)A+=4;else break e;else O.id>=h&&(A+=4);O.next()}ne=fe,B+=De,he+=A}return(R<0||B==Z)&&(ue.size=B,ue.start=ne,ue.skip=he),ue.size>4?ue:void 0}function G(Z,R,O){let{id:B,start:ne,end:he,size:P}=m;if(m.next(),P>=0&&B<h){let ue=O;if(P>4){let _e=m.pos-(P-4);for(;m.pos>_e;)O=G(Z,R,O)}R[--O]=ue,R[--O]=he-Z,R[--O]=ne-Z,R[--O]=B}else P==-3?b=B:P==-4&&(_=B);return O}let F=[],q=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,F,q,-1,0);let L=(s=l.length)!==null&&s!==void 0?s:F.length?q[0]+F[0].length:0;return new Bl(g[l.topID],F.reverse(),q.reverse(),L)}const rx=new WeakMap;function Of(l,s){if(!l.isAnonymous||s instanceof Bi||s.type!=l)return 1;let r=rx.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof Bl)){r=1;break}r+=Of(l,c)}rx.set(s,r)}return r}function Ap(l,s,r,c,o,d,h,m,g){let b=0;for(let T=c;T<o;T++)b+=Of(l,s[T]);let _=Math.ceil(b*1.5/8),j=[],v=[];function C(T,E,M,G,F){for(let q=M;q<G;){let L=q,Z=E[q],R=Of(l,T[q]);for(q++;q<G;q++){let O=Of(l,T[q]);if(R+O>=_)break;R+=O}if(q==L+1){if(R>_){let O=T[L];C(O.children,O.positions,0,O.children.length,E[L]+F);continue}j.push(T[L])}else{let O=E[q-1]+T[q-1].length-Z;j.push(Ap(l,T,E,L,q,Z,O,null,g))}v.push(Z+F-d)}}return C(s,r,c,o,0),(m||g)(j,v,h)}class zN{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof ia?this.setBuffer(s.context.buffer,s.index,r):s instanceof ml&&this.map.set(s.tree,r)}get(s){return s instanceof ia?this.getBuffer(s.context.buffer,s.index):s instanceof ml?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class Yo{constructor(s,r,c,o,d=!1,h=!1){this.from=s,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,r=[],c=!1){let o=[new Yo(0,s.length,s,0,!1,c)];for(let d of r)d.to>s.length&&o.push(d);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],d=1,h=s.length?s[0]:null;for(let m=0,g=0,b=0;;m++){let _=m<r.length?r[m]:null,j=_?_.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||b){let C=Math.max(v.from,g)-b,T=Math.min(v.to,j)-b;v=C>=T?null:new Yo(C,T,v.tree,v.offset+b,m>0,!!_)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!_)break;g=_.toA,b=_.toA-_.toB}return o}}class UN{startParse(s,r,c){return typeof s=="string"&&(s=new U1(s)),c=c?c.length?c.map(o=>new hs(o.from,o.to)):[new hs(0,0)]:[new hs(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class U1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function HN(l){return(s,r,c,o)=>new B1(s,l,r,c,o)}class cx{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function ox(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class H1{constructor(s,r,c,o,d,h,m,g){this.parser=s,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const dp=new Pt({perNode:!0});class B1{constructor(s,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Bl(c.type,c.children,c.positions,c.length,c.propValues.concat([[dp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[Pt.mounted.id]=new hc(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new G1(this.fragments),r=null,c=null,o=new Bf(new ml(this.baseTree,this.ranges[0].from,0,null),Jt.IncludeAnonymous|Jt.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(r){let b=r.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(b)for(let _ of b.mount.overlay){let j=_.from+b.pos,v=_.to+b.pos;j>=o.from&&v<=o.to&&!r.ranges.some(C=>C.from<v&&C.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=I1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(q1(o),r&&r.depth++,c&&c.depth++);let b=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new H1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=dx(this.ranges,d.overlay||(o.from<o.to?[new hs(o.from,o.to)]:[]));_.length&&ox(_),(_.length||!d.overlay)&&this.inner.push(new cx(d.parser,_.length?d.parser.startParse(this.input,hx(b,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new hs(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new hs(o.from,o.to)),g.from<g.to)){let b=r.ranges.length-1;b>=0&&r.ranges[b].to==g.from?r.ranges[b]={from:r.ranges[b].from,to:g.to}:r.ranges.push(g)}if(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let b=dx(this.ranges,r.ranges);b.length&&(ox(b),this.inner.splice(r.index,0,new cx(r.parser,r.parser.startParse(this.input,hx(r.mounts,b),b),r.ranges.map(_=>new hs(_.from-r.start,_.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function I1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function ux(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function q1(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function b(_,j,v,C,T,E){let M=r[E],G=[],F=[];ux(h,_,M,G,F,C);let q=m[M+1],L=m[M+2];g.push(G.length);let Z=E?b(M+4,m[M+3],h.set.types[m[M]],q,L-q,E-1):s.toTree();return G.push(Z),F.push(q-C),ux(h,m[M+3],j,G,F,C),new Bl(v,G,F,T)}o.children[d]=b(0,m.length,As.none,0,h.length,r.length-1);for(let _ of g){let j=l.tree.children[_],v=l.tree.positions[_];l.yield(new ml(j,v+l.from,_,l._tree))}}class fx{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(Jt.IncludeAnonymous|Jt.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,Jt.IgnoreOverlays|Jt.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Bl)r=r.children[0];else break}return!1}}class G1{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(dp))!==null&&r!==void 0?r:c.to,this.inner=new fx(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(dp))!==null&&s!==void 0?s:r.to,this.inner=new fx(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Pt.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=d.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:d.from-g.offset,mount:h})}}}return o}}function dx(l,s){let r=null,c=s;for(let o=1,d=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[d]=new hs(g.from,h),g.to>m&&r.splice(d+1,0,new hs(m,g.to))):g.to>m?r[d--]=new hs(m,g.to):r.splice(d--,1))}}return c}function Y1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let _=o==l.length?1e9:h?l[o].to:l[o].from,j=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),C=Math.min(_,j,c);v<C&&b.push(new hs(v,C))}if(g=Math.min(_,j),g==1e9)break;_==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return b}function hx(l,s){let r=[];for(let{pos:c,mount:o,frag:d}of l){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),b=Math.min(d.to,m);if(o.overlay){let _=o.overlay.map(v=>new hs(v.from+c,v.to+c)),j=Y1(s,_,g,b);for(let v=0,C=g;;v++){let T=v==j.length,E=T?b:j[v].from;if(E>C&&r.push(new Yo(C,E,o.tree,-h,d.from>=C||d.openStart,d.to<=E||d.openEnd)),T)break;C=j[v].to}}else r.push(new Yo(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let $1=0;class ds{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=$1++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof ds&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new ds(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(s){let r=new If(s);return c=>c.modified.indexOf(r)>-1?c:If.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let X1=0;class If{constructor(s){this.name=s,this.instances=[],this.id=X1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&V1(r,m.modified));if(c)return c;let o=[],d=new ds(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=Q1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(If.get(m,g));return d}}function V1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Q1(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function BN(l){let s=Object.create(null);for(let r in l){let c=l[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let _=new $o(c,h,g>0?d.slice(0,g):null);s[b]=_.sort(s[b])}}return Oy.add(s)}const Oy=new Pt({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new $o(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class $o{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}$o.empty=new $o([],2,null);function Ly(l,s){let r=Object.create(null);for(let d of l)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=s||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let b=r[g.id];if(b){h=h?h+" "+b:b;break}}return h},scope:c}}function K1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function Z1(l,s,r,c=0,o=l.length){let d=new J1(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function F1(l,s,r,c,o,d=0,h=l.length){let m=d;function g(b,_){if(!(b<=m)){for(let j=l.slice(m,b),v=0;;){let C=j.indexOf(`
117
+ `,v),T=C<0?j.length:C;if(T>v&&c(j.slice(v,T),_),C<0)break;o(),v=C+1}m=b}}Z1(s,r,(b,_,j)=>{g(b,""),g(_,j)},d,h),g(h,"")}class J1{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,d){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(C=>!C.scope||C.scope(h)));let b=o,_=W1(s)||$o.empty,j=K1(d,_.tags);if(j&&(b&&(b+=" "),b+=j,_.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),b),_.opaque)return;let v=s.tree&&s.tree.prop(Pt.mounted);if(v&&v.overlay){let C=s.node.enter(v.overlay[0].from+m,1),T=this.highlighters.filter(M=>!M.scope||M.scope(v.tree.type)),E=s.firstChild();for(let M=0,G=m;;M++){let F=M<v.overlay.length?v.overlay[M]:null,q=F?F.from+m:g,L=Math.max(r,G),Z=Math.min(c,q);if(L<Z&&E)for(;s.from<Z&&(this.highlightRange(s,L,Z,o,d),this.startSpan(Math.min(Z,s.to),b),!(s.to>=q||!s.nextSibling())););if(!F||q>c)break;G=F.to+m,G>r&&(this.highlightRange(C.cursor(),Math.max(r,F.from+m),Math.min(c,G),"",T),this.startSpan(Math.min(c,G),b))}E&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),b)}while(s.nextSibling());s.parent()}}}function W1(l){let s=l.type.prop(Oy);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const je=ds.define,pf=je(),Di=je(),px=je(Di),mx=je(Di),Oi=je(),mf=je(Oi),Xh=je(Oi),na=je(),rr=je(na),Js=je(),Ws=je(),hp=je(),Do=je(hp),gf=je(),Ce={comment:pf,lineComment:je(pf),blockComment:je(pf),docComment:je(pf),name:Di,variableName:je(Di),typeName:px,tagName:je(px),propertyName:mx,attributeName:je(mx),className:je(Di),labelName:je(Di),namespace:je(Di),macroName:je(Di),literal:Oi,string:mf,docString:je(mf),character:je(mf),attributeValue:je(mf),number:Xh,integer:je(Xh),float:je(Xh),bool:je(Oi),regexp:je(Oi),escape:je(Oi),color:je(Oi),url:je(Oi),keyword:Js,self:je(Js),null:je(Js),atom:je(Js),unit:je(Js),modifier:je(Js),operatorKeyword:je(Js),controlKeyword:je(Js),definitionKeyword:je(Js),moduleKeyword:je(Js),operator:Ws,derefOperator:je(Ws),arithmeticOperator:je(Ws),logicOperator:je(Ws),bitwiseOperator:je(Ws),compareOperator:je(Ws),updateOperator:je(Ws),definitionOperator:je(Ws),typeOperator:je(Ws),controlOperator:je(Ws),punctuation:hp,separator:je(hp),bracket:Do,angleBracket:je(Do),squareBracket:je(Do),paren:je(Do),brace:je(Do),content:na,heading:rr,heading1:je(rr),heading2:je(rr),heading3:je(rr),heading4:je(rr),heading5:je(rr),heading6:je(rr),contentSeparator:je(na),list:je(na),quote:je(na),emphasis:je(na),strong:je(na),link:je(na),monospace:je(na),strikethrough:je(na),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:gf,documentMeta:je(gf),annotation:je(gf),processingInstruction:je(gf),definition:ds.defineModifier("definition"),constant:ds.defineModifier("constant"),function:ds.defineModifier("function"),standard:ds.defineModifier("standard"),local:ds.defineModifier("local"),special:ds.defineModifier("special")};for(let l in Ce){let s=Ce[l];s instanceof ds&&(s.name=l)}Ly([{tag:Ce.link,class:"tok-link"},{tag:Ce.heading,class:"tok-heading"},{tag:Ce.emphasis,class:"tok-emphasis"},{tag:Ce.strong,class:"tok-strong"},{tag:Ce.keyword,class:"tok-keyword"},{tag:Ce.atom,class:"tok-atom"},{tag:Ce.bool,class:"tok-bool"},{tag:Ce.url,class:"tok-url"},{tag:Ce.labelName,class:"tok-labelName"},{tag:Ce.inserted,class:"tok-inserted"},{tag:Ce.deleted,class:"tok-deleted"},{tag:Ce.literal,class:"tok-literal"},{tag:Ce.string,class:"tok-string"},{tag:Ce.number,class:"tok-number"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],class:"tok-string2"},{tag:Ce.variableName,class:"tok-variableName"},{tag:Ce.local(Ce.variableName),class:"tok-variableName tok-local"},{tag:Ce.definition(Ce.variableName),class:"tok-variableName tok-definition"},{tag:Ce.special(Ce.variableName),class:"tok-variableName2"},{tag:Ce.definition(Ce.propertyName),class:"tok-propertyName tok-definition"},{tag:Ce.typeName,class:"tok-typeName"},{tag:Ce.namespace,class:"tok-namespace"},{tag:Ce.className,class:"tok-className"},{tag:Ce.macroName,class:"tok-macroName"},{tag:Ce.propertyName,class:"tok-propertyName"},{tag:Ce.operator,class:"tok-operator"},{tag:Ce.comment,class:"tok-comment"},{tag:Ce.meta,class:"tok-meta"},{tag:Ce.invalid,class:"tok-invalid"},{tag:Ce.punctuation,class:"tok-punctuation"}]);const P1="modulepreload",ej=function(l,s){return new URL(l,s).href},gx={},Qe=function(s,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(_=>{if(_=ej(_,c),_ in gx)return;gx[_]=!0;const j=_.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let E=m.length-1;E>=0;E--){const M=m[E];if(M.href===_&&(!j||M.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":P1,j||(T.as="script"),T.crossOrigin="",T.href=_,b&&T.setAttribute("nonce",b),document.head.appendChild(T),j)return new Promise((E,M)=>{T.addEventListener("load",E),T.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${_}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return s().catch(d)})},zy={js:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Qe(async()=>{const{javascript:l}=await import("./index-DD9jOM3u.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Qe(async()=>{const{json:l}=await import("./index-CgJ8kt13.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Qe(async()=>{const{json:l}=await import("./index-CgJ8kt13.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Qe(async()=>{const{css:l}=await import("./index-GPJsAXZm.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Qe(async()=>{const{css:l}=await import("./index-GPJsAXZm.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Qe(async()=>{const{css:l}=await import("./index-GPJsAXZm.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Qe(async()=>{const{html:l}=await import("./index-CmWfuvMB.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Qe(async()=>{const{html:l}=await import("./index-CmWfuvMB.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Qe(async()=>{const{html:l}=await import("./index-CmWfuvMB.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Qe(async()=>{const{html:l}=await import("./index-CmWfuvMB.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Qe(async()=>{const{markdown:l}=await import("./index-CcRfA6wX.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Qe(async()=>{const{markdown:l}=await import("./index-CcRfA6wX.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Qe(async()=>{const{python:l}=await import("./index-CyvkCV_I.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Qe(async()=>{const{python:l}=await import("./index-CyvkCV_I.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Qe(async()=>{const{yaml:l}=await import("./index-B59yN5CT.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Qe(async()=>{const{yaml:l}=await import("./index-B59yN5CT.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Qe(async()=>{const{rust:l}=await import("./index-DriANGJp.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bfg1ojRW.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bfg1ojRW.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bfg1ojRW.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bfg1ojRW.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Qe(async()=>{const{cpp:l}=await import("./index-Bfg1ojRW.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Qe(async()=>{const{java:l}=await import("./index-Rdr8VKHz.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Qe(async()=>{const{go:l}=await import("./index-BiADfWp_.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Qe(async()=>{const{php:l}=await import("./index-Bn6m7y1f.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Qe(async()=>{const{sql:l}=await import("./index-BHPUdhIS.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Qe(async()=>{const{xml:l}=await import("./index-DPFqYXoR.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Qe(async()=>{const{xml:l}=await import("./index-DPFqYXoR.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},tj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},nj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function lj(l){const s=nj[l.toLowerCase()]??l.toLowerCase(),r=zy[s];return r?r().catch(()=>null):null}async function sj(l){const s=(l.split("/").pop()??"").toLowerCase(),r=tj[s]??s.split(".").pop()??"",c=zy[r];return c?c().catch(()=>null):null}const aj=Ly([{tag:[Ce.keyword,Ce.modifier,Ce.controlKeyword,Ce.moduleKeyword],class:"cmh-key"},{tag:[Ce.propertyName],class:"cmh-prop"},{tag:[Ce.function(Ce.variableName),Ce.labelName],class:"cmh-fn"},{tag:[Ce.color,Ce.constant(Ce.name),Ce.standard(Ce.name),Ce.bool],class:"cmh-const"},{tag:[Ce.typeName,Ce.className,Ce.changed,Ce.annotation,Ce.self,Ce.namespace],class:"cmh-type"},{tag:[Ce.number,Ce.integer,Ce.float],class:"cmh-num"},{tag:[Ce.string,Ce.special(Ce.string),Ce.regexp],class:"cmh-str"},{tag:[Ce.operator,Ce.operatorKeyword,Ce.escape],class:"cmh-op"},{tag:[Ce.meta,Ce.comment],class:"cmh-comment"},{tag:Ce.invalid,class:"cmh-invalid"}]);function bf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function ij(l,s){const r=s?await lj(s):null;if(!r)return bf(l);try{const c=r.language.parser.parse(l);let o="";return F1(l,c,aj,(d,h)=>{o+=h?`<span class="${h}">${bf(d)}</span>`:bf(d)},()=>{o+=`
118
+ `}),o}catch{return bf(l)}}Nt.setOptions({gfm:!0,breaks:!1});function Uy(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function Kf(l){const s=await Nt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await ij(c.text,c.lang??""),c.escaped=!0}});return C1.sanitize(s)}function bx(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:Uy(l.path)}}function Ha(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function rj(l){return l.split("/").pop()??l}function br(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Lf(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function zi({x:l,y:s,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,m]=y.useState({left:l,top:s}),[g,b]=y.useState(()=>{const v=r.findIndex(C=>!C.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),T=8,E=Math.max(T,Math.min(l,window.innerWidth-C.width-T)),M=Math.max(T,Math.min(s,window.innerHeight-C.height-T));m({left:E,top:M})},[l,s]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(T){var E;(E=d.current)!=null&&E.contains(T.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 _(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=r.map((T,E)=>({item:T,index:E})).filter(T=>!T.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,E=C.findIndex(G=>G.index===g),M=C[(((E===-1?0:E)+T)%C.length+C.length)%C.length];M&&b(M.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=r[g];T&&_(T)}}}return i.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,C)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===g?" is-cursor":""),onMouseEnter:()=>b(C),onClick:()=>_(v),children:[i.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&i.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const cj=3500,oj=9e3,xx=220;function vr({result:l,onDismiss:s}){const[r,c]=y.useState(l),[o,d]=y.useState(!1);if(y.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?cj:oj,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+xx);return()=>{clearTimeout(g),clearTimeout(b)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},xx)};return i.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&i.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&s&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function aa({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=y.useState(l),m=y.useRef(null);y.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===l)return o();c(b)}return i.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:b=>h(b.target.value),onBlur:g,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),o())}})}function Nc({active:l}){return l?i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 5h3V2"}),i.jsx("path",{d:"M14 5h-3V2"}),i.jsx("path",{d:"M2 11h3v3"}),i.jsx("path",{d:"M14 11h-3v3"})]}):i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 2H2v3"}),i.jsx("path",{d:"M11 2h3v3"}),i.jsx("path",{d:"M2 11v3h3"}),i.jsx("path",{d:"M14 11v3h-3"})]})}const uj=500,cr="application/x-ccv-fs-path",fj=200;function dj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:_,onOpen:j,onCreate:v,onRename:C,onMove:T,onCopy:E,onDelete:M,onRefresh:G,onClose:F,zoomed:q,onToggleZoom:L}){const[Z,R]=y.useState(""),[O,B]=y.useState(null),[ne,he]=y.useState(null),[P,ue]=y.useState(null),[_e,De]=y.useState(null),[Ne,A]=y.useState(null),[fe,z]=y.useState(null),pe=Xf("(hover: hover)"),ke=y.useRef(null),k=y.useMemo(()=>mj(d),[d]);function V(le){return!(!P||le===P.path||P.kind==="dir"&&le.startsWith(`${P.path}/`)||le===br(P.path))}function ce(le){return!(!Ne||le===Ne.path||Ne.kind==="dir"&&le.startsWith(`${Ne.path}/`)||Ne.mode==="cut"&&le===br(Ne.path))}function ge(le){A({path:le.path,kind:le.kind,mode:"copy"})}function Ae(le){A({path:le.path,kind:le.kind,mode:"cut"})}function Se(le){!Ne||!ce(le)||(le&&!r.has(le)&&_(le),Ne.mode==="cut"?(T(Ne.path,le),A(null)):E(Ne.path,le))}function Te(le,be){const Le=le.touches[0];if(!Le)return;const H={timer:0,x:Le.clientX,y:Le.clientY,el:le.currentTarget,fired:!1};H.timer=window.setTimeout(()=>{H.fired=!0,be(H.x,H.y,H.el)},uj),ke.current=H}function Tt(le){const be=ke.current,Le=le.touches[0];!be||!Le||Math.hypot(Le.clientX-be.x,Le.clientY-be.y)>10&&(window.clearTimeout(be.timer),ke.current=null)}function Ye(le){const be=ke.current;be&&(window.clearTimeout(be.timer),be.fired&&le.preventDefault())}function et(){var le;return(le=ke.current)!=null&&le.fired?(ke.current=null,!0):!1}function Xe(le,be,Le,H){R((H==null?void 0:H.path)??""),z({x:le,y:be,opener:Le,entry:H})}function Qt(){const le=fe==null?void 0:fe.opener;z(null),le!=null&&le.isConnected&&le.focus()}function tt(le){return{onContextMenu:be=>{be.preventDefault(),Xe(be.clientX,be.clientY,be.currentTarget,le)},onTouchStart:be=>Te(be,(Le,H,W)=>Xe(Le,H,W,le)),onTouchMove:Tt,onTouchEnd:Ye,onTouchCancel:Ye}}function Yt(le){le.target===le.currentTarget&&(le.preventDefault(),Xe(le.clientX,le.clientY,le.currentTarget,null))}function nt(le){le.target===le.currentTarget&&Te(le,(be,Le,H)=>Xe(be,Le,H,null))}function en(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const be=le.key.toLowerCase();if(be==="v"){le.preventDefault(),Se(Pn());return}if(!Z)return;const Le=yx(s,Z);Le&&(be==="c"?(le.preventDefault(),ge(Le)):be==="x"&&(le.preventDefault(),Ae(Le)))}function $t(le){return be=>{be.dataTransfer.effectAllowed="move",be.dataTransfer.setData(cr,le.path),ue({path:le.path,kind:le.kind})}}function tn(){ue(null),De(null)}function nn(le){return be=>{be.dataTransfer.types.includes(cr)&&(be.stopPropagation(),!(le.kind!=="dir"||!V(le.path))&&(be.preventDefault(),De(le.path)))}}function pn(le){return be=>{if(!be.dataTransfer.types.includes(cr)||(be.stopPropagation(),le.kind!=="dir"||!V(le.path)))return;be.preventDefault();const Le=be.dataTransfer.getData(cr);De(null),Le&&T(Le,le.path)}}function Sn(le){!le.dataTransfer.types.includes(cr)||!V("")||(le.preventDefault(),De(""))}function mn(le){if(!le.dataTransfer.types.includes(cr)||!V(""))return;le.preventDefault();const be=le.dataTransfer.getData(cr);De(null),be&&T(be,"")}const[cn,Ke]=y.useState(""),zt=cn.trim(),gn=zt.length>0,ft=y.useRef(null),Je=y.useRef(g);Je.current=g;function An(le){Ke(le),ft.current&&clearTimeout(ft.current);const be=le.trim();if(!be){Je.current("");return}ft.current=setTimeout(()=>Je.current(be),fj)}function on(le){ft.current&&clearTimeout(ft.current),Ke(""),Je.current(""),R(le.path),b(le)}const wn=gn&&(m==null?void 0:m.query)===zt?m:null;function Pn(){if(Z==="")return"";const le=yx(s,Z);if((le==null?void 0:le.kind)==="dir")return Z;const be=Z.lastIndexOf("/");return be===-1?"":Z.slice(0,be)}function Xt(le,be){const Le=be??Pn();Le&&!r.has(Le)&&_(Le),he({parent:Le,kind:le})}function wt(){if(!fe)return[];const le=H=>pe?H:void 0;if(!fe.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:le("Ctrl+V"),disabled:!ce(""),onSelect:()=>Se("")},{id:"new-file",label:"Создать файл",onSelect:()=>Xt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Xt("dir","")}];const be=fe.entry,Le=[be.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(be.path)}:{id:"toggle",label:r.has(be.path)?"Свернуть":"Развернуть",onSelect:()=>_(be.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>ge(be)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>Ae(be)}];return be.kind==="dir"&&(Le.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!ce(be.path),onSelect:()=>Se(be.path)}),Le.push({id:"new-file",label:"Создать файл",onSelect:()=>Xt("file",be.path)}),Le.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Xt("dir",be.path)})),Le.push({id:"rename",label:"Переименовать",onSelect:()=>B(be.path)}),Le.push({id:"delete",label:"Удалить",onSelect:()=>M(be)}),Le}const Kt=gn?[]:Et("",0);function Et(le,be){const Le=s[le],H=[];if(ne&&ne.parent===le&&H.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:Ba(be),children:[i.jsx("span",{className:"fsrow__icon",children:ne.kind==="dir"?i.jsx(Gf,{}):i.jsx(Yf,{})}),i.jsx(aa,{className:"rename--file",value:"",placeholder:ne.kind==="dir"?"имя каталога":"имя файла",onCommit:W=>{he(null),v(le,ne.kind,W)},onCancel:()=>he(null)})]},`draft:${le}`)),!Le)return H.push(i.jsx("p",{className:"fsrow__pending",style:Ba(be),children:"читаем…"},`wait:${le}`)),H;Le.length===0&&!ne&&H.push(i.jsx("p",{className:"fsrow__pending",style:Ba(be),children:"пусто"},`empty:${le}`));for(const W of Le){const xe=W.kind==="dir"&&r.has(W.path);H.push(O===W.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:Ba(be),children:[i.jsx("span",{className:"fsrow__icon",children:W.kind==="dir"?i.jsx(Gf,{open:xe}):i.jsx(Yf,{})}),i.jsx(aa,{className:"rename--file",value:W.name,placeholder:"новое имя",onCommit:Be=>{B(null),C(W.path,Be)},onCancel:()=>B(null)})]},W.path):i.jsx(hj,{entry:W,depth:be,open:xe,active:W.path===c,selected:W.path===Z,dirty:o.has(W.path),gitStatus:k.get(W.path),dragging:(P==null?void 0:P.path)===W.path,dropTarget:_e===W.path,cut:(Ne==null?void 0:Ne.mode)==="cut"&&Ne.path===W.path,onClick:()=>{et()||(R(W.path),W.kind==="dir"?_(W.path):j(W.path))},onRename:()=>B(W.path),onDelete:()=>M(W),onDragStart:$t(W),onDragEnd:tn,onDragOver:nn(W),onDrop:pn(W),...tt(W)},W.path)),xe&&H.push(...Et(W.path,be+1))}return H}function Yn(){if(!wn)return[i.jsx("p",{className:"fsrow__pending",style:Ba(0),children:"ищем…"},"search:wait")];if(wn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:Ba(0),children:"ничего не найдено"},"search:empty")];const le=wn.entries.map(be=>i.jsx(pj,{entry:be,gitStatus:k.get(be.path),onClick:()=>on(be)},be.path));return wn.truncated&&le.push(i.jsxs("p",{className:"fsrow__pending",style:Ba(0),children:["показаны первые ",wn.entries.length," — уточните запрос"]},"search:truncated")),le}return i.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(q?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:en,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{L&&(le.target.closest("button")||L())},children:[i.jsx(yj,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Xt("file"),children:i.jsx(bj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Xt("dir"),children:i.jsx(xj,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:G,children:"↻"}),L&&i.jsx("button",{className:"sidepane__btn",title:q?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":q?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":q,onClick:L,children:i.jsx(Nc,{active:q})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:F,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(_j,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:cn,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>An(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),cn?An(""):le.currentTarget.blur())}}),cn&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>An(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(_e===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Sn,onDrop:mn,onContextMenu:Yt,onTouchStart:nt,onTouchMove:Tt,onTouchEnd:Ye,onTouchCancel:Ye,children:gn?Yn():Kt}),i.jsx(vr,{result:h}),fe&&i.jsx(zi,{x:fe.x,y:fe.y,items:wt(),onClose:Qt})]})}function hj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:_,onRename:j,onDelete:v,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:M,onContextMenu:G,onTouchStart:F,onTouchMove:q,onTouchEnd:L,onTouchCancel:Z}){const R="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return i.jsxs("div",{className:R,style:Ba(s),draggable:!0,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:M,onContextMenu:G,onTouchStart:F,onTouchMove:q,onTouchEnd:L,onTouchCancel:Z,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:Hy(l),children:[i.jsx("span",{className:"fsrow__icon"+qf("fsrow__icon",h),children:l.kind==="dir"?i.jsx(Gf,{open:r}):i.jsx(Yf,{})}),i.jsx("span",{className:"fsrow__name"+qf("fsrow__name",h),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&i.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),i.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${l.name}`,onClick:j,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function pj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Ba(0),onClick:r,title:Hy(l),children:[i.jsx("span",{className:"fsrow__icon"+qf("fsrow__icon",s),children:l.kind==="dir"?i.jsx(Gf,{}):i.jsx(Yf,{})}),i.jsx("span",{className:"fsrow__name"+qf("fsrow__name",s),children:l.name}),l.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function Hy(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Ba(l){return{"--depth":l}}function yx(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function mj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=gj(o.status);if(!d)continue;c(o.path,d);let h=br(o.path);for(;c(h,d),!!h;)h=br(h)}return s}function gj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function qf(l,s){return s?` ${l}--git-${s}`:""}function Gf({open:l=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?i.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):i.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function Yf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]})}function bj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function xj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:i.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function yj(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),i.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function _j(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const vj=200;function jj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=y.useState(""),b=m.trim(),_=b.length>0,j=y.useRef(null),v=y.useRef(r);v.current=r;function C(M){g(M),j.current&&clearTimeout(j.current);const G=M.trim();if(!G){v.current("");return}j.current=setTimeout(()=>v.current(G),vj)}const T=_&&(s==null?void 0:s.query)===b?s:null;function E(){if(!T)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(T.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const M=[];let G="";for(const F of T.matches)F.path!==G&&(G=F.path,M.push(i.jsx("p",{className:"searchgroup__path",title:F.path,children:F.path},`path:${F.path}`))),M.push(i.jsx(Sj,{match:F,onClick:()=>c(F)},`${F.path}:${F.line}:${F.column}`));return T.truncated&&M.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),M}return i.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:M=>{h&&(M.target.closest("button")||h())},children:[i.jsx(wj,{}),i.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&i.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Nc,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(kj,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:M=>C(M.target.value),onKeyDown:M=>{M.stopPropagation(),M.key==="Escape"&&(M.preventDefault(),m?C(""):M.currentTarget.blur())}}),m&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?E():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Sj({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return i.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:l.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function wj(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function kj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let xf=null;function Nj(){return xf||(xf=Promise.all([Qe(()=>import("./index-DGIVHKoZ.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Qe(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Qe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Qe(()=>import("./index-B-bp9mCT.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Qe(()=>import("./codemirror-Xlc7emp4.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw xf=null,l})),xf}function Tj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),m=y.useRef(null),g=y.useRef(null),b=y.useRef(new Map),_=y.useRef(new Map),j=y.useRef(new Set),v=y.useRef(null),C=y.useRef(o),T=y.useRef(d),E=y.useRef(l),M=y.useRef(r),G=y.useRef(s);C.current=o,T.current=d,E.current=l,M.current=r,G.current=s;const[F,q]=y.useState("loading"),[L,Z]=y.useState(!1);function R(B,ne,he,P,ue){const _e=b.current.get(P),De=_.current.get(P)===ue;if(_e&&De)he.setState(_e);else{const A=B.EditorState.create({doc:G.current,extensions:[B.basicSetup,B.Prec.highest(B.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(E.current),!0)}])),B.keymap.of([B.indentWithTab]),ne.of([]),B.editorTheme,B.editorHighlight,B.EditorView.updateListener.of(fe=>{fe.docChanged&&C.current(E.current,fe.state.doc.toString())})]});b.current.set(P,A),_.current.set(P,ue),he.setState(A),j.current.delete(P)}if(j.current.has(P))return()=>{};let Ne=!1;return sj(P).then(A=>{Ne||!A||E.current!==P||(he.dispatch({effects:ne.reconfigure(A)}),b.current.set(P,he.state),j.current.add(P))}),()=>{Ne=!0}}y.useEffect(()=>{if(!h.current)return;let ne=!1,he=null,P=null;q("loading"),Z(!1);const ue=window.setTimeout(()=>{ne||Z(!0)},200);return(async()=>{let _e;try{_e=await Nj()}catch{window.clearTimeout(ue),ne||q("error");return}if(ne||!h.current)return;window.clearTimeout(ue);const De=new _e.Compartment;v.current=De,g.current=_e,P=new _e.EditorView({parent:h.current}),m.current=P,he=R(_e,De,P,E.current,M.current),q("ready")})(),()=>{ne=!0,window.clearTimeout(ue),he==null||he(),P==null||P.destroy(),m.current===P&&(m.current=null),g.current=null,v.current=null}},[]),y.useEffect(()=>{const B=g.current,ne=m.current,he=v.current;if(!(!B||!ne||!he))return R(B,he,ne,l,r)},[l,r]);const O=y.useRef(0);return y.useEffect(()=>{const B=m.current,ne=g.current;if(!B||!ne||!c||c.token===O.current)return;O.current=c.token;const he=B.state.doc.lines,P=Math.min(Math.max(c.line,1),he),ue=B.state.doc.line(P),_e=Math.min(ue.from+Math.max(c.column-1,0),ue.to);B.dispatch({selection:ne.EditorSelection.cursor(_e),effects:ne.EditorView.scrollIntoView(_e,{y:"center"})}),B.focus()},[c]),y.useEffect(()=>()=>{const B=m.current;B&&b.current.set(l,B.state)},[l]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(F==="ready"?"":" is-hidden")}),F==="loading"&&L&&i.jsxs("div",{className:"editor__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),F==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:s})]})]})}function Cs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=y.useState(!1),[b,_]=y.useState(0),j=y.useRef(null),v=y.useRef(null),C=s.find(M=>M.value===l)??null;y.useEffect(()=>{if(!m)return;const M=s.findIndex(G=>G.value===l);_(M===-1?0:M)},[m]),y.useEffect(()=>{if(!m)return;function M(G){var F;(F=j.current)!=null&&F.contains(G.target)||g(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[m]),y.useEffect(()=>{var M,G;m&&((G=(M=v.current)==null?void 0:M.querySelector(".is-cursor"))==null||G.scrollIntoView({block:"nearest"}))},[m,b]),y.useEffect(()=>{if(!m)return;const M=v.current,G=Ej(j.current);if(!M||!G)return;const F=M.getBoundingClientRect().bottom-G.getBoundingClientRect().bottom;F>0&&(G.scrollTop+=Math.min(F+8,M.offsetHeight))},[m]);function T(M){g(!1),M.value!==l&&r(M.value)}function E(M){if(M.key==="Escape"){if(!m)return;M.preventDefault(),M.stopPropagation(),g(!1);return}if(M.key==="ArrowDown"||M.key==="ArrowUp"){if(M.preventDefault(),!m)return g(!0);const G=M.key==="ArrowDown"?1:s.length-1;return _(F=>(F+G)%s.length)}if(M.key==="Enter"||M.key===" "){if(M.preventDefault(),!m)return g(!0);const G=s[b];G&&T(G)}}return i.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(M=>!M),onKeyDown:E,children:[i.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),i.jsx(Cj,{})]}),m&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((M,G)=>i.jsxs("button",{type:"button",role:"option","aria-selected":M.value===l,className:"select__option"+(G===b?" is-cursor":"")+(M.value===l?" is-on":""),onMouseEnter:()=>_(G),onClick:()=>T(M),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:M.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:M.label}),M.hint&&i.jsx("span",{className:"select__hint",children:M.hint})]},M.value))})]})}function Ej(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function Cj(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Aj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function Mj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M4.6 6.6h4"})]})}function Rj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),i.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function Dj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){y.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=Oj(r,s);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Lf(d),"). Лимит — 64 МБ."]})}):c?i.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[i.jsx("p",{className:"mediaview__error",children:c}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(l),children:"Повторить"})]}):m?s.startsWith("image/")?i.jsx(zj,{url:m}):s.startsWith("video/")?i.jsx(Hj,{url:m}):null:i.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[i.jsx("div",{className:"mediaview__progress",children:i.jsx("div",{className:"mediaview__progress-fill"})}),i.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function Oj(l,s){const[r,c]=y.useState(null);return y.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Ri=1,By=8,yf=1.25;function Lj(l){return Math.min(By,Math.max(Ri,l))}function zj({url:l}){const[s,r]=y.useState({scale:Ri,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function m(C,T,E){r(M=>{const G=Lj(M.scale*C);if(G===M.scale)return M;if(G<=Ri)return{scale:Ri,x:0,y:0};const F=(T-M.x)/M.scale,q=(E-M.y)/M.scale;return{scale:G,x:T-G*F,y:E-G*q}})}y.useEffect(()=>{const C=d.current;if(!C)return;function T(E){E.preventDefault();const M=C.getBoundingClientRect(),G=E.clientX-M.left-M.width/2,F=E.clientY-M.top-M.height/2;m(E.deltaY<0?yf:1/yf,G,F)}return C.addEventListener("wheel",T,{passive:!1}),()=>C.removeEventListener("wheel",T)},[]);function g(C){s.scale<=Ri||(C.currentTarget.setPointerCapture(C.pointerId),h.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,origX:s.x,origY:s.y},o(!0))}function b(C){const T=h.current;!T||T.pointerId!==C.pointerId||r(E=>({...E,x:T.origX+(C.clientX-T.startX),y:T.origY+(C.clientY-T.startY)}))}function _(){h.current=null,o(!1)}const j=s.scale>Ri,v=!j&&s.x===0&&s.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:b,onPointerUp:_,onPointerCancel:_,children:i.jsx("img",{src:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Ri,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/yf,0,0),children:i.jsx(Mj,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:s.scale>=By,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(yf,0,0),children:i.jsx(Aj,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Ri,x:0,y:0}),children:i.jsx(Rj,{})})]})]})}const Uj=[{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 Hj({url:l}){const s=y.useRef(null),[r,c]=y.useState("1");return y.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(Cs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Uj})]})]})}function Bj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=Ha(l),b=Uy(l.path)&&!l.binary&&!l.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:l.path,children:l.path}),i.jsxs("span",{className:"editor__meta",children:[Lf(l.size),l.eol==="crlf"&&" · CRLF"]}),b&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?i.jsx(Dj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Lf(l.size)," на диске."]}):l.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Lf(l.size),"). Такие правит агент, а не браузер."]}):b&&l.previewMode?i.jsx(Ij,{text:l.text}):i.jsx(Tj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Ij({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Kf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function qj({files:l,activePath:s,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[i.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&i.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),l.map(m=>i.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:rj(m.path)}),Ha(m)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Nc,{active:d})})]})}function fs(l){return l.claudeSessionId??l.id}function _f(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),d=[],h=[];for(const m of l)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function _x(l){return l.state!=="closed"}function vx(l){return[...l.filter(_x),...l.filter(s=>!_x(s))]}function vf(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),s,...o.slice(d)];return h.every((m,g)=>m===l[g])?null:h}function Mp(l,s,r,c){const o=l%10,d=l%100;return o===1&&d!==11?s:o>=2&&o<=4&&(d<12||d>14)?r:c}function Iy(l){return`${l} ${Mp(l,"агент","агента","агентов")}`}function Gj(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(Iy(s)),r>0&&c.push(`${r} ${Mp(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Yj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function $j(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function Xj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Vj({tasks:l,onStop:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(()=>Date.now()),[h,m]=y.useState(()=>new Set);y.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),y.useEffect(()=>{m(b=>{const _=new Set(l.map(v=>v.id)),j=new Set([...b].filter(v=>_.has(v)));return j.size===b.size?b:j})},[l]);const g=b=>{m(_=>new Set(_).add(b)),s(b),window.setTimeout(()=>{m(_=>{if(!_.has(b))return _;const j=new Set(_);return j.delete(b),j})},1e4)};return i.jsxs("div",{className:r?"tasks is-open":"tasks",children:[i.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(b=>!b),children:[i.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),i.jsx("span",{className:"tasks__summary",children:Gj(l)}),i.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&i.jsx("ul",{className:"tasks__list",id:"tasks-list",children:l.map(b=>{const _=h.has(b.id);return i.jsxs("li",{className:_?"task is-stopping":"task",children:[i.jsxs("div",{className:"task__main",children:[i.jsxs("div",{className:"task__head",children:[i.jsx("span",{className:"task__kind",children:Yj(b)}),b.background&&i.jsx("span",{className:"task__bg",children:"фон"}),i.jsx("span",{className:"task__time",children:$j(o-b.startedAt)})]}),i.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&i.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),i.jsxs("div",{className:"task__stats",children:[Xj(b.tokens)," · ",b.toolUses," ",Mp(b.toolUses,"вызов","вызова","вызовов")]})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:_?"Останавливается":"Стоп"})]},b.id)})})]})}const Qj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function qy({className:l}){return i.jsx("img",{src:Qj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Kj=450,Zj=6,jf=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Fj({disabled:l,onStart:s}){const[r,c]=y.useState(!1),[o,d]=y.useState(0),[h,m]=y.useState({left:0,top:0}),g=y.useRef(null),b=y.useRef(null),_=y.useRef(null);function j(){_.current&&window.clearTimeout(_.current.timer),_.current=null}function v(){j(),d(0),c(!0)}function C(R){var O;c(!1),R&&((O=g.current)==null||O.focus())}function T(R){if(l||R.button!==0)return;const O={timer:0,x:R.clientX,y:R.clientY,fired:!1};O.timer=window.setTimeout(()=>{O.fired=!0,v()},Kj),_.current=O}function E(R){const O=_.current;!O||O.fired||Math.hypot(R.clientX-O.x,R.clientY-O.y)>Zj&&j()}function M(){_.current&&!_.current.fired&&j()}function G(R){var O;if((O=_.current)!=null&&O.fired){_.current=null,R.preventDefault();return}l||s("claude")}function F(R){R.preventDefault(),!l&&v()}function q(R){if(l)return;(R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="Enter"&&R.shiftKey)&&(R.preventDefault(),v())}y.useLayoutEffect(()=>{if(!r)return;const R=g.current,O=b.current;if(!R||!O)return;const B=R.getBoundingClientRect(),ne=O.getBoundingClientRect(),he=8,P=Math.max(he,Math.min(B.right-ne.width,window.innerWidth-ne.width-he));let ue=B.top-ne.height-8;ue<he&&(ue=Math.min(B.bottom+8,window.innerHeight-ne.height-he)),m({left:P,top:ue})},[r]),y.useLayoutEffect(()=>{var R;r&&((R=b.current)==null||R.focus())},[r]),y.useLayoutEffect(()=>{if(!r)return;function R(O){var ne,he;const B=O.target;!((ne=b.current)!=null&&ne.contains(B))&&!((he=g.current)!=null&&he.contains(B))&&C(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[r]);function L(R){C(!1),s(R.id)}function Z(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),C(!0);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();const O=R.key==="ArrowDown"?1:-1;d(B=>(B+O+jf.length)%jf.length);return}if(R.key==="Enter"||R.key===" "){R.preventDefault();const O=jf[o];O&&L(O);return}R.key==="Tab"&&C(!1)}return i.jsxs("div",{className:"newsession",children:[i.jsxs("button",{ref:g,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:"Удерживайте, чтобы выбрать агента","aria-haspopup":"menu","aria-expanded":r,onClick:G,onContextMenu:F,onPointerDown:T,onPointerMove:E,onPointerUp:M,onPointerCancel:M,onPointerLeave:M,onKeyDown:q,children:["+ Сессия",i.jsx(Jj,{})]}),r&&i.jsx("div",{ref:b,className:"newsession__menu",style:{left:h.left,top:h.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Z,children:jf.map((R,O)=>i.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(O===o?" is-cursor":""),onMouseEnter:()=>d(O),onClick:()=>L(R),children:[i.jsx("span",{className:`newsession__mark newsession__mark--${R.id}`,"aria-hidden":"true",children:R.id==="antigravity"?i.jsx(qy,{className:"newsession__mark-logo"}):i.jsx(Wj,{})}),i.jsxs("span",{className:"newsession__text",children:[i.jsx("span",{className:"newsession__label",children:R.label}),i.jsx("span",{className:"newsession__hint",children:R.hint})]})]},R.id))})]})}function Jj(){return i.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wj(){return i.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:i.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const Gy="ccv:sidebar.collapsed",Yy="ccv:sidebar.mode",$y="ccv:sidebar.foldersCollapsed",Pj=500,Vh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function eS({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,sessions:g,archived:b,pinned:_,live:j,listOrder:v,liveSessionsFirst:C,onReorder:T,activeWorkspaceId:E,activeSessionId:M,onSelectWorkspace:G,onSelectSession:F,onRenameSession:q,onStopSession:L,onPinSessions:Z,onSelectPinned:R,onCloseWorkspaces:O,onRestoreWorkspaces:B,onArchiveSessions:ne,onUnarchiveSessions:he,onCreateFolder:P,onRenameFolder:ue,onSetFolderColor:_e,onDeleteFolder:De,onAssignToFolder:Ne,onOpenWorkspace:A,onNewSession:fe,onOpenExtensions:z,account:pe,onOpenAccount:ke,relay:k,onOpenRelay:V,onOpenSettings:ce,themeMode:ge,onCycleTheme:Ae}){var bs;const[Se,Te]=y.useState(null),[Tt,Ye]=y.useState(null),[et,Xe]=y.useState(null);function Qt(w){return(et==null?void 0:et.folderId)===w.id?et.color??void 0:w.color}function tt(w){const ie=w&&Qt(w);return ie?{"--folder-color":ie}:void 0}function Yt(w){return w?i.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const nt=y.useRef(void 0),[en,$t]=y.useState(null),[tn,nn]=y.useState(""),[pn,Sn]=y.useState(mS),[mn,cn]=y.useState(gS),[Ke,zt]=y.useState(bS);function gn(w){zt(w);try{localStorage.setItem(Yy,w)}catch{}}const ft=tn.trim().toLowerCase(),Je=ft!=="",An=y.useMemo(()=>_f(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),on=y.useMemo(()=>{const w=_f(g,E?v==null?void 0:v.sessions[E]:void 0,fs,"top");return C?vx(w):w},[g,v,E,C]),wn=y.useMemo(()=>{const w=_f(_,v==null?void 0:v.pinned,fs,"bottom");return C?vx(w):w},[_,v,C]),Pn=y.useMemo(()=>_f(j,v==null?void 0:v.live,fs,"bottom"),[j,v]),Xt=y.useMemo(()=>Je?An.filter(w=>w.name.toLowerCase().includes(ft)||w.path.toLowerCase().includes(ft)):An,[An,ft,Je]),wt=y.useMemo(()=>Je?o.filter(w=>w.name.toLowerCase().includes(ft)||w.path.toLowerCase().includes(ft)):o,[o,ft,Je]),Kt=y.useMemo(()=>Je?on.filter(w=>(w.title??"").toLowerCase().includes(ft)):on,[on,ft,Je]),Et=y.useMemo(()=>Je?b.filter(w=>(w.title??"").toLowerCase().includes(ft)):b,[b,ft,Je]),Yn=w=>{var ie;return((ie=c.find(Me=>Me.id===w))==null?void 0:ie.name)??"—"},le=w=>{var ie;return(ie=c.find(Me=>Me.id===w))==null?void 0:ie.path},be=y.useMemo(()=>Je?wn.filter(w=>(w.title??"").toLowerCase().includes(ft)||Yn(w.workspaceId).toLowerCase().includes(ft)):wn,[wn,c,ft,Je]),Le=y.useMemo(()=>Je?Pn.filter(w=>(w.title??"").toLowerCase().includes(ft)||Yn(w.workspaceId).toLowerCase().includes(ft)):Pn,[Pn,c,ft,Je]),H=!Je;function W(w){Sn(ie=>{const Me=ie.includes(w)?ie.filter(Fe=>Fe!==w):[...ie,w];try{localStorage.setItem(Gy,JSON.stringify(Me))}catch{}return Me})}const xe=w=>!pn.includes(w);function Be(w){cn(ie=>{const Me=ie.includes(w)?ie.filter(Fe=>Fe!==w):[...ie,w];try{localStorage.setItem($y,JSON.stringify(Me))}catch{}return Me})}const gt=w=>!mn.includes(w),Mn=y.useMemo(()=>Oo(Xt,d),[Xt,d]),bn=y.useMemo(()=>Oo(wt,d),[wt,d]),Rn=y.useMemo(()=>Oo(Kt,h),[Kt,h]),ul=y.useMemo(()=>Oo(Et,h),[Et,h]),gl=y.useMemo(()=>Oo(be,m,w=>w.pinnedFolderId),[be,m]),ca=y.useMemo(()=>({groups:[],ungrouped:Le}),[Le]),Ql=((v==null?void 0:v.workspaces.length)??0)>0,ps=E?(((bs=v==null?void 0:v.sessions[E])==null?void 0:bs.length)??0)>0:!1,Ms=((v==null?void 0:v.pinned.length)??0)>0,Dn=((v==null?void 0:v.live.length)??0)>0,Kl=Sf({enabled:H,scope:"workspaces",itemKey:w=>w.id,groups:Mn.groups,ungrouped:Mn.ungrouped,onReorder:T}),bl=Sf({enabled:H,scope:"sessions",workspaceId:E??void 0,itemKey:fs,groups:Rn.groups,ungrouped:Rn.ungrouped,onReorder:T}),$n=Sf({enabled:H,scope:"pinned",itemKey:fs,groups:gl.groups,ungrouped:gl.ungrouped,onReorder:T}),Vt=Sf({enabled:H,scope:"live",itemKey:fs,groups:ca.groups,ungrouped:ca.ungrouped,onReorder:T});y.useEffect(()=>{var Me;if(!et)return;const ie=(Me=[...gl.groups,...Mn.groups,...bn.groups,...Rn.groups,...ul.groups].find(Fe=>Fe.folder.id===et.folderId))==null?void 0:Me.folder;ie&&ie.color===(et.color??void 0)&&Xe(null)},[et,gl,Mn,bn,Rn,ul]),y.useEffect(()=>()=>window.clearTimeout(nt.current),[]);const $e=Kh(Xt),vt=Kh(wt),xl=Kh(Kt),[lt,Zl]=y.useState(null),[Ut,el]=y.useState(null),[kt,Tl]=y.useState(null),[ln,kn]=y.useState(null),[bt,Ze]=y.useState(null),On=y.useRef(null);function El(w,ie){const Me=w.touches[0];if(!Me)return;const Fe={timer:0,x:Me.clientX,y:Me.clientY,el:w.currentTarget,fired:!1};Fe.timer=window.setTimeout(()=>{Fe.fired=!0,ie(Fe.x,Fe.y,Fe.el)},Pj),On.current=Fe}function xn(w){const ie=On.current,Me=w.touches[0];!ie||!Me||Math.hypot(Me.clientX-ie.x,Me.clientY-ie.y)>10&&(window.clearTimeout(ie.timer),On.current=null)}function Nn(w){const ie=On.current;ie&&(window.clearTimeout(ie.timer),ie.fired&&w.preventDefault())}function tl(){var w;return(w=On.current)!=null&&w.fired?(On.current=null,!0):!1}function ms(){const w=lt==null?void 0:lt.opener;Zl(null),w!=null&&w.isConnected&&w.focus()}function yn(){const w=Ut==null?void 0:Ut.opener;el(null),w!=null&&w.isConnected&&w.focus()}function Fl(){const w=kt==null?void 0:kt.opener;Tl(null),w!=null&&w.isConnected&&w.focus()}function fl(){const w=ln==null?void 0:ln.opener;kn(null),w!=null&&w.isConnected&&w.focus()}function nl(){const w=bt==null?void 0:bt.opener;Ze(null),w!=null&&w.isConnected&&w.focus()}function Ln(w){return{onContextMenu:ie=>{ie.preventDefault(),Zl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:$e.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Zl({x:Me,y:Fe,opener:_n,ids:$e.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ht(w){return{onContextMenu:ie=>{ie.preventDefault(),el({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:vt.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>el({x:Me,y:Fe,opener:_n,ids:vt.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function qa(w){return{onContextMenu:ie=>{ie.preventDefault(),Tl({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:xl.targetsFor(w)})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Tl({x:Me,y:Fe,opener:_n,ids:xl.targetsFor(w)})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Ii(w){return{onContextMenu:ie=>{ie.preventDefault(),kn({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>kn({x:Me,y:Fe,opener:_n,ids:[w.id]})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}function Rs(w){return{onContextMenu:ie=>{ie.preventDefault(),Ze({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[w.id]})},onTouchStart:ie=>El(ie,(Me,Fe,_n)=>Ze({x:Me,y:Fe,opener:_n,ids:[w.id]})),onTouchMove:xn,onTouchEnd:Nn,onTouchCancel:Nn}}const Ds=g.filter(w=>w.state!=="closed").length,yl=lt?Xt.find(w=>w.id===lt.ids[0]):void 0,Ga=lt?[{id:"close",label:lt.ids.length>1?`Закрыть проекты (${lt.ids.length})`:"Закрыть проект",onSelect:()=>{O(lt.ids),$e.clear()}},...Lo({folders:d,ids:lt.ids,hasFolder:(yl==null?void 0:yl.folderId)!=null,assign:(w,ie)=>Ne("workspace",w,ie),onClear:()=>$e.clear(),onNewFolder:()=>$t("workspace")}),...lt.ids.length===1&&H?Kl.menuItems(lt.ids[0],Ql):[]]:[],zn=lt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(E&&lt.ids.includes(E)&&Ds>0?` в нём сейчас незавершённых сессий: ${Ds} — при закрытии они остановятся на хосте.`:""):void 0,gs=Ut?wt.find(w=>w.id===Ut.ids[0]):void 0,Jl=Ut?[{id:"restore",label:Ut.ids.length>1?`Вернуть проекты (${Ut.ids.length})`:"Вернуть проект",onSelect:()=>{B(Ut.ids),vt.clear()}},...Lo({folders:d,ids:Ut.ids,hasFolder:(gs==null?void 0:gs.folderId)!=null,assign:(w,ie)=>Ne("workspace",w,ie),onClear:()=>vt.clear(),onNewFolder:()=>$t("workspace")})]:[],sn=Ut?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Bt=kt?Kt.find(w=>w.id===kt.ids[0]):void 0,me=(Bt==null?void 0:Bt.pinned)!==!0,N=kt?[...kt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Te(kt.ids[0])}]:[],{id:"pin",label:me?kt.ids.length>1?`Закрепить (${kt.ids.length})`:"Закрепить":kt.ids.length>1?`Открепить (${kt.ids.length})`:"Открепить",onSelect:()=>{Bt&&Z(Bt.workspaceId,kt.ids,me),xl.clear()}},{id:"archive",label:kt.ids.length>1?`Убрать в архив (${kt.ids.length})`:"Убрать в архив",onSelect:()=>{ne(E,kt.ids),xl.clear()}},...Lo({folders:h,ids:kt.ids,hasFolder:(Bt==null?void 0:Bt.folderId)!=null,assign:(w,ie)=>Ne("session",w,ie,E),onClear:()=>xl.clear(),onNewFolder:()=>$t("session")}),...kt.ids.length===1&&H&&Bt?bl.menuItems(fs(Bt),ps):[]]:[],$=kt?Vh:void 0,ae=ln?be.find(w=>w.id===ln.ids[0]):void 0,we=ln?[{id:"rename",label:"Переименовать",onSelect:()=>Te(ln.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ae&&Z(ae.workspaceId,[ae.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ae&&ne(ae.workspaceId,[ae.id])}},...ae&&ae.workspaceId===E?Lo({folders:h,ids:[ae.id],hasFolder:ae.folderId!=null,assign:(w,ie)=>Ne("session",w,ie,ae.workspaceId),onClear:()=>{},onNewFolder:()=>$t("session")}):[],...sS(ae?Lo({folders:m,ids:[ae.id],hasFolder:ae.pinnedFolderId!=null,assign:(w,ie)=>Ne("pinned",w,ie),onClear:()=>{},onNewFolder:()=>$t("pinned")}):[]),...H&&ae?$n.menuItems(fs(ae),Ms):[]]:[],ve=bt?Le.find(w=>w.id===bt.ids[0]):void 0,ze=bt?[{id:"stop",label:"Остановить",onSelect:()=>{ve&&L(ve)}},{id:"rename",label:"Переименовать",onSelect:()=>Te(bt.ids[0])},{id:"pin",label:(ve==null?void 0:ve.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{ve&&Z(ve.workspaceId,[ve.id],ve.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ve&&ne(ve.workspaceId,[ve.id])}},...H&&ve?Vt.menuItems(fs(ve),Dn):[]]:[];function ot(w,ie){return i.jsxs("div",{"data-row-key":w.id,className:ic(w.id===E,$e.selected.includes(w.id),!1,!!ie)+Kl.dropClass(w.id),style:tt(ie),...Ln(w),children:[Yt(ie),H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...Kl.gripHandlers(w.id),children:i.jsx(wf,{})}),i.jsxs("button",{className:"row__main",onClick:Me=>{tl()||$e.click(Me,w,()=>G(w.id))},onKeyDown:Me=>Kl.onKeyDown(w.id,Me),children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",title:w.path,children:w.path})]})]},w.id)}function un(w,ie){return i.jsxs("div",{className:ic(w.id===E,vt.selected.includes(w.id),!1,!!ie),style:tt(ie),...Ht(w),children:[Yt(ie),i.jsxs("button",{className:"row__main",onClick:Me=>{tl()||vt.click(Me,w,()=>G(w.id))},children:[i.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:kS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>B([w.id]),children:"Вернуть"})]},w.id)}function Mt(w,ie){const Me=fs(w);return i.jsxs("div",{"data-row-key":Me,className:ic(w.id===M,xl.selected.includes(w.id),w.provider==="antigravity",!!ie)+bl.dropClass(Me),style:tt(ie),...Se===w.id?{}:qa(w),children:[Yt(ie),Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Fe=>{q(w,Fe),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...bl.gripHandlers(Me),children:i.jsx(wf,{})}),i.jsxs("button",{className:"row__main",onClick:Fe=>{tl()||xl.click(Fe,w,()=>F(w))},onKeyDown:Fe=>bl.onKeyDown(Me,Fe),children:[i.jsx(kf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Zh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{tl()||Te(w.id)},children:"✎"})]})]},w.id)}function mt(w,ie){return i.jsxs("div",{className:ic(w.id===M,!1,w.provider==="antigravity",!!ie),style:tt(ie),children:[Yt(ie),i.jsxs("button",{className:"row__main",onClick:()=>F(w),children:[i.jsx(kf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx("span",{className:"row__meta",children:wS(w)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>he([w.id]),children:"Вернуть"})]},w.id)}function fn(w,ie){const Me=fs(w);return i.jsxs("div",{"data-row-key":Me,className:ic(w.id===M,!1,w.provider==="antigravity",!!ie)+$n.dropClass(Me),style:tt(ie),...Se===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ii(w)},children:[Yt(ie),Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Fe=>{q(w,Fe),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...$n.gripHandlers(Me),children:i.jsx(wf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{tl()||R(w)},onKeyDown:Fe=>$n.onKeyDown(Me,Fe),children:[i.jsx(kf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Zh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})]},w.id)}function It(w){const ie=fs(w);return i.jsx("div",{"data-row-key":ie,className:ic(w.id===M,!1,w.provider==="antigravity")+Vt.dropClass(ie),...Se===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Rs(w)},children:Se===w.id?i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:w.title??"",onCommit:Me=>{q(w,Me),Te(null)},onCancel:()=>Te(null)})}):i.jsxs(i.Fragment,{children:[H&&i.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Vt.gripHandlers(ie),children:i.jsx(wf,{})}),i.jsxs("button",{className:"row__main",onClick:()=>{tl()||R(w)},onKeyDown:Me=>Vt.onKeyDown(ie,Me),children:[i.jsx(kf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:Yn(w.workspaceId),projectPath:le(w.workspaceId)}),i.jsx(Zh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),i.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Me=>{Me.stopPropagation(),!tl()&&L(w)},children:i.jsx(fS,{})})]})},w.id)}function ll(w,ie){return i.jsx(oS,{folder:w,count:ie,open:gt(w.id),renaming:Tt===w.id,onToggle:()=>Be(w.id),onStartRename:()=>Ye(w.id),onCommitRename:Me=>{ue(w.id,Me),Ye(null)},onCancelRename:()=>Ye(null),onDelete:()=>De(w.id),color:Qt(w),onPreviewColor:Me=>{window.clearTimeout(nt.current),Xe({folderId:w.id,color:Me})},onCommitColor:Me=>{Xe({folderId:w.id,color:Me}),_e(w.id,Me),window.clearTimeout(nt.current),nt.current=window.setTimeout(()=>Xe(null),4e3)},onResetColor:()=>{window.clearTimeout(nt.current),Xe(null),_e(w.id,null)}},w.id)}return i.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:s?"dot dot--on":"dot",title:r}),i.jsx("span",{className:"brand",children:"Claude Code Visual"}),i.jsx("button",{className:"theme-btn",title:`Тема: ${Sx[ge]}`,"aria-label":`Тема: ${Sx[ge]}. Переключить`,onClick:Ae,children:i.jsx(xS,{mode:ge})})]}),i.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":Ke==="default",className:Ke==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("default"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),i.jsx("button",{type:"button",role:"tab","aria-selected":Ke==="pinned",className:Ke==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("pinned"),children:i.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),i.jsxs("button",{type:"button",role:"tab","aria-selected":Ke==="live",className:Ke==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>gn("live"),children:[i.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&i.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(hS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:tn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>nn(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),tn?nn(""):w.currentTarget.blur())}}),tn&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>nn(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:Ke==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(rc,{title:"Закреплённые",count:be.length,open:xe("pinned"),onToggle:()=>W("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{$t("pinned"),xe("pinned")||W("pinned")}}}),xe("pinned")&&i.jsxs(i.Fragment,{children:[en==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("pinned",w),$t(null)},onCancel:()=>$t(null)})})}),be.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),gl.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>fn(ie,w.folder))]},w.folder.id)),gl.ungrouped.map(w=>fn(w))]})]}):Ke==="live"?i.jsxs(i.Fragment,{children:[i.jsx(rc,{title:"Запущенные",count:Le.length,open:xe("live"),onToggle:()=>W("live")}),xe("live")&&i.jsxs(i.Fragment,{children:[Le.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Нет запущенных сессий"})}),Le.map(w=>It(w))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(rc,{title:"Проекты",count:Xt.length,open:xe("workspaces"),onToggle:()=>W("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{$t("workspace"),xe("workspaces")||W("workspaces")}}}),xe("workspaces")&&i.jsxs(i.Fragment,{children:[en==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("workspace",w),$t(null)},onCancel:()=>$t(null)})})}),Xt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока ни одного"})}),Mn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>ot(ie,w.folder))]},w.folder.id)),Mn.ungrouped.map(w=>ot(w))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(rc,{title:"Архив проектов",count:wt.length,open:xe("workspacesArchive"),onToggle:()=>W("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),xe("workspacesArchive")&&i.jsxs(i.Fragment,{children:[wt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока пусто"})}),bn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>un(ie,w.folder))]},w.folder.id)),bn.ungrouped.map(w=>un(w))]})]}),E&&i.jsxs(i.Fragment,{children:[i.jsx(rc,{title:"Сессии",count:Kt.length,open:xe("sessions"),onToggle:()=>W("sessions"),action:{label:"Новая папка сессий",onClick:()=>{$t("session"),xe("sessions")||W("sessions")}}}),xe("sessions")&&i.jsxs(i.Fragment,{children:[en==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:"",placeholder:"Название папки",onCommit:w=>{P("session",w,E),$t(null)},onCancel:()=>$t(null)})})}),Kt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока ни одной"})}),Rn.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>Mt(ie,w.folder))]},w.folder.id)),Rn.ungrouped.map(w=>Mt(w))]}),b.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(rc,{title:"Архив",count:Et.length,open:xe("archive"),onToggle:()=>W("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),xe("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),Et.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:Je?"Ничего не найдено":"Пока пусто"})}),ul.groups.map(w=>i.jsxs(y.Fragment,{children:[ll(w.folder,w.items.length),gt(w.folder.id)&&w.items.map(ie=>mt(ie,w.folder))]},w.folder.id)),ul.ungrouped.map(w=>mt(w))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:ke,children:[i.jsx("span",{className:pe!=null&&pe.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:pe===null?"Аккаунт":pe.loggedIn?pe.email||"Вход выполнен":"Войти в аккаунт"}),(pe==null?void 0:pe.plan)&&i.jsx("span",{className:"chip",children:pe.plan})]}),V&&i.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:V,children:[i.jsx("span",{className:k!=null&&k.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:k===null?"Удалённый доступ":k.paired?k.connected?k.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(k==null?void 0:k.connected)&&k.clients>0&&i.jsx("span",{className:"chip",children:k.clients})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",disabled:!z,title:"MCP-серверы и плагины",onClick:()=>z==null?void 0:z(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:ce,children:"Настройки"})]}),i.jsxs("div",{className:"sidebar__foot-row",children:[i.jsx("button",{className:"btn btn--ghost",onClick:A,children:"+ Проект"}),i.jsx(Fj,{disabled:!E,onStart:fe})]})]}),lt&&i.jsx(zi,{x:lt.x,y:lt.y,items:Ga,note:zn,onClose:ms}),Ut&&i.jsx(zi,{x:Ut.x,y:Ut.y,items:Jl,note:sn,onClose:yn}),kt&&i.jsx(zi,{x:kt.x,y:kt.y,items:N,note:$,onClose:Fl}),ln&&i.jsx(zi,{x:ln.x,y:ln.y,items:we,note:Vh,onClose:fl}),bt&&i.jsx(zi,{x:bt.x,y:bt.y,items:ze,note:Vh,onClose:nl})]})}function ic(l,s,r,c){const o=["row"];return c&&o.push("row--foldered"),l&&o.push("row--active"),s&&o.push("row--selected"),r&&o.push("row--antigravity"),o.join(" ")}function Oo(l,s,r=c=>c.folderId){const c=new Map(s.map(m=>[m.id,m])),o=new Map,d=[];for(const m of l){const g=r(m),b=g?c.get(g):void 0;if(!b){d.push(m);continue}const _=o.get(b.id);_?_.push(m):o.set(b.id,[m])}return{groups:[...o.entries()].map(([m,g])=>({folder:c.get(m),items:g})).sort((m,g)=>m.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:d}}function tS(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const nS="\0ungrouped";function lS(l,s,r){const c=new Map;for(const o of l)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of s)c.set(r(o),nS);return c}function Qh(l,s,r,c,o){const d=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!d)return null;const h=d.findIndex(m=>c(m)===l);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function Sf(l){const[s,r]=y.useState(null),[c,o]=y.useState(null),d=y.useMemo(()=>tS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=y.useMemo(()=>lS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g(G,F){l.enabled&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),r(G),o(null))}function b(G,F){var O;if(!s)return;const q=(O=document.elementFromPoint(G,F))==null?void 0:O.closest("[data-row-key]"),L=q==null?void 0:q.dataset.rowKey;if(!L||L===s||h.get(L)!==h.get(s)){o(null);return}const Z=q.getBoundingClientRect(),R=F-Z.top<Z.height/2?"before":"after";o(B=>(B==null?void 0:B.key)===L&&B.position===R?B:{key:L,position:R})}function _(G){b(G.clientX,G.clientY)}function j(){if(s&&c){const G=vf(d,s,c.key,c.position);G&&l.onReorder(l.scope,G,l.workspaceId)}m()}function v(G,F){if(!l.enabled)return;const q=Qh(G,l.groups,l.ungrouped,l.itemKey,F);if(!q)return;const L=vf(d,G,q.target,q.position);L&&l.onReorder(l.scope,L,l.workspaceId)}function C(G,F){const q=Qh(G,l.groups,l.ungrouped,l.itemKey,"up"),L=Qh(G,l.groups,l.ungrouped,l.itemKey,"down"),Z=[{id:"move-up",label:"Переместить выше",disabled:!q,onSelect:()=>{if(!q)return;const R=vf(d,G,q.target,q.position);R&&l.onReorder(l.scope,R,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!L,onSelect:()=>{if(!L)return;const R=vf(d,G,L.target,L.position);R&&l.onReorder(l.scope,R,l.workspaceId)}}];return F&&Z.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),Z}function T(G){return s===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function E(G){return{onPointerDown:F=>g(G,F),onPointerMove:_,onPointerUp:j,onPointerCancel:m}}function M(G,F){!F.altKey||F.key!=="ArrowUp"&&F.key!=="ArrowDown"||(F.preventDefault(),v(G,F.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:T,gripHandlers:E,onKeyDown:M,menuItems:C}}function Lo(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function sS(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Kh(l){const[s,r]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(_=>_.includes(g.id)?_.filter(j=>j!==g.id):[..._,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const _=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(_!==-1&&j!==-1){const[v,C]=_<j?[_,j]:[j,_];r(l.slice(v,C+1).map(T=>T.id));return}}o(),c.current=g.id,b()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const aS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},iS={width:22,height:22,borderRadius:6};function rc({title:l,count:s,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:aS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(Xy,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:l}),i.jsx("span",{className:"sidebar__count",children:s})]}),d&&i.jsx("button",{className:"theme-btn",style:iS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(pS,{})})]})}const jx={paddingLeft:22},rS={display:"flex",alignItems:"center",gap:6,width:"100%"},cS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function oS({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g,color:b,onPreviewColor:_,onCommitColor:j,onResetColor:v}){const C=y.useRef(null),T=y.useRef(j);return T.current=j,y.useEffect(()=>{const E=C.current;if(!E)return;const M=()=>T.current(E.value);return E.addEventListener("change",M),()=>E.removeEventListener("change",M)},[c]),c?i.jsx("div",{className:"row",style:jx,children:i.jsx("div",{className:"row__main",children:i.jsx(aa,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):i.jsxs("div",{className:"row",style:jx,children:[i.jsxs("button",{className:"row__main",style:rS,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[i.jsx(Xy,{open:r}),i.jsx("span",{style:cS,children:l.name}),i.jsx("span",{className:"sidebar__count",children:s})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:d,children:"✎"}),i.jsxs("label",{className:b?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[i.jsx("span",{className:"row__swatch-dot",style:b?{background:b}:void 0}),i.jsx("input",{ref:C,type:"color",value:b??uS(),"aria-label":`Цвет папки «${l.name}»`,onChange:E=>_(E.target.value)})]}),l.color&&i.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${l.name}»`,onClick:v,children:"↺"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:g,children:"✕"})]})}function uS(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function Xy({open:l}){return i.jsx("svg",{className:l?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function wf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),i.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function fS(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:i.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function dS({className:l}){return i.jsxs("svg",{className:l,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),i.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),i.jsx("path",{d:"M8 12.2v1.4"})]})}function hS(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function pS(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function mS(){try{const l=localStorage.getItem(Gy);if(l===null)return["archive","workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function gS(){try{const l=localStorage.getItem($y);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function bS(){try{const l=localStorage.getItem(Yy);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Sx={system:"как в системе",light:"светлая",dark:"тёмная"};function xS({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?i.jsx("svg",{...s,children:i.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):l==="light"?i.jsxs("svg",{...s,children:[i.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),i.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):i.jsxs("svg",{...s,children:[i.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),i.jsx("path",{d:"M5.6 13.4h4.8"})]})}function yS(l){const s=_S(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${Iy(r)}`:s}function _S(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":vS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function vS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function jS(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":SS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function SS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Zh({session:l,tail:s}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${jS(l)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),yS(l)]})," · ",s]})}function kf({title:l,pinned:s,provider:r,projectName:c,projectPath:o}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[s&&i.jsx(dS,{className:"row__pin"}),r==="antigravity"&&i.jsx(qy,{className:"row__provider"}),l]}),i.jsx("span",{className:"row__project",title:o,children:c})]})}function wS(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function kS(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const wx=3,NS=15e5;function Vy(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=Fh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=AS(TS(Fh(r.old_string),Fh(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function Fh(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function TS(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(d),...ES(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function ES(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(_=>({type:"add",text:_}));if(s.length===0)return l.map(_=>({type:"del",text:_}));if((l.length+1)*(s.length+1)>NS)return[...l.map(_=>({type:"del",text:_})),...s.map(_=>({type:"add",text:_}))];const r=l.length,c=s.length,o=c+1,d=new Uint32Array((r+1)*o),h=(_,j)=>d[_*o+j]??0;for(let _=r-1;_>=0;_--)for(let j=c-1;j>=0;j--)d[_*o+j]=l[_]===s[j]?h(_+1,j+1)+1:Math.max(h(_+1,j),h(_,j+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const _=l[g],j=s[b];_===j?(m.push({type:"ctx",text:_}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:_}),g++):(m.push({type:"add",text:j}),b++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;b<c;)m.push({type:"add",text:s[b++]});return CS(m)}function CS(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function AS(l){if(!l.some(d=>d.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-wx);m<=Math.min(l.length-1,h+wx);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${MS(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function MS(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function ra(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function pp(){try{return await navigator.clipboard.readText()}catch{return null}}const Rp=1600,xr="Копировать",pc="Скопировано";function wc({text:l,hint:s,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Rp);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[l]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?pc:`${xr} ${s}`,title:c?pc:`${xr} ${s}`,onClick:()=>{ra(l).then(d=>{d&&o(!0)})},children:c?pc:xr})}function Dp({diff:l}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&i.jsx("div",{className:"diff__note",children:l.note}),i.jsx("div",{className:"diff__body",children:l.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>i.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function RS({waiting:l}){const[s,r]=y.useState(0);return y.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),i.jsxs("div",{className:l?"work work--wait":"work",children:[i.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:l?"ждёт разрешения":"думает"}),!l&&i.jsxs("span",{className:"work__time",children:[s," с"]})]})}function Op({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),j=y.useRef(null),v=y.useRef(!0),C=y.useRef(null),T=y.useRef(null),E=y.useRef(!1);y.useEffect(()=>{v.current=!0,C.current=null,E.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[m]),y.useEffect(()=>{const L=_.current,Z=j.current;if(!L||!Z)return;function R(ne){!L||ne===L.scrollTop||(E.current=!0,L.scrollTop=ne)}function O(){if(!L)return;const ne=C.current;if(ne){const he=Nx(L,ne.id);if(he){const P=he.getBoundingClientRect().top-L.getBoundingClientRect().top;R(L.scrollTop+(P-ne.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{C.current=null},500);return}v.current&&R(L.scrollHeight)}const B=new ResizeObserver(O);return B.observe(Z),()=>{B.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function M(){const L=_.current;if(L){if(E.current){E.current=!1;return}v.current=L.scrollHeight-L.scrollTop-L.clientHeight<80}}function G(){if(d)return;const L=_.current,Z=c[0];if(L&&Z){const R=Nx(L,Z.id);R&&(C.current={id:Z.id,top:R.getBoundingClientRect().top-L.getBoundingClientRect().top})}h==null||h()}let F=0;function q(L){return L.kind==="user"?F++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:M,children:i.jsxs("div",{className:"stream",ref:j,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:G,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(L=>i.jsx(kx,{item:L,userIndex:q(L),onEditMessage:g},L.id)),c.length>0&&l.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&i.jsx("p",{className:"empty",children:b}),l.map(L=>i.jsx(kx,{item:L,userIndex:q(L),onEditMessage:g},L.id)),s&&i.jsx(RS,{waiting:r})]})})}function kx({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return i.jsx(OS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[i.jsx(LS,{text:l.text}),l.streaming&&i.jsx("span",{className:"caret"}),l.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(wc,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return i.jsx(US,{item:l});case"result":return i.jsxs("div",{className:"result-line","data-item-id":l.id,children:[i.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),i.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&i.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",Ex(l.inputTokens)," ↓",Ex(l.outputTokens)]})]});case"notice":return i.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const DS=500;function OS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[m,g]=y.useState(l.text),b=y.useRef(null),_=Xf("(max-width: 860px)"),j=y.useRef(null);function v(O,B){o({x:O,y:B})}function C(O){O.preventDefault(),v(O.clientX,O.clientY)}function T(O){const B=O.touches[0];if(!B)return;const ne={timer:0,x:B.clientX,y:B.clientY,fired:!1};ne.timer=window.setTimeout(()=>{ne.fired=!0,v(ne.x,ne.y)},DS),j.current=ne}function E(O){const B=j.current,ne=O.touches[0];!B||!ne||Math.hypot(ne.clientX-B.x,ne.clientY-B.y)>10&&(window.clearTimeout(B.timer),j.current=null)}function M(O){const B=j.current;B&&(window.clearTimeout(B.timer),B.fired&&O.preventDefault())}function G(){g(l.text),h(!0)}function F(){h(!1)}function q(){const O=m.trim();O===""&&!(l.images&&l.images.length>0)||(r==null||r(s,O,l.images),h(!1))}y.useEffect(()=>{const O=b.current;!O||!d||(O.style.height="auto",O.style.height=`${O.scrollHeight}px`)},[m,d]),y.useEffect(()=>{if(!d)return;const O=b.current;O&&(O.focus(),O.setSelectionRange(O.value.length,O.value.length))},[d]);function L(O){if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),F();return}O.key==="Enter"&&!O.shiftKey&&!_&&(O.preventDefault(),q())}const Z=l.images&&l.images.length>0&&i.jsx("div",{className:"msg--user__images",children:l.images.map((O,B)=>i.jsx("img",{className:"msg--user__image",src:`data:${O.mediaType};base64,${O.data}`,alt:"Вложение"},B))});if(d){const O=m.trim()!==""||!!(l.images&&l.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[Z,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:B=>g(B.target.value),onKeyDown:L,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:F,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:q,disabled:!O,children:"Сохранить"})]})]})]})}const R=[{id:"copy",label:"Копировать",onSelect:()=>void ra(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:G}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:C,onTouchStart:T,onTouchMove:E,onTouchEnd:M,onTouchCancel:M,children:[Z,l.text,c&&i.jsx(zi,{x:c.x,y:c.y,items:R,onClose:()=>o(null)})]})}function Nx(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function LS({text:l}){const[s,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return Kf(l).then(h=>{d||r(zS(h))}),()=>{d=!0}},[l]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((b=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:b.textContent)??"";m!==""&&ra(m).then(_=>{if(!_)return;h.textContent=pc,h.setAttribute("aria-label",pc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=xr,h.setAttribute("aria-label",mp),h.classList.remove("copybtn--done"))},Rp);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const mp=`${xr} блок кода`;function zS(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",mp),o.title=mp,o.textContent=xr,c.append(o)}return s.body.innerHTML}function US({item:l}){const[s,r]=y.useState(!1),c=l.result===null,o=Vy(l.name,l.input),d=l.name==="AskUserQuestion"?IS(l.input):null;return i.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[i.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__name",children:l.name}),i.jsx("span",{className:"tool__arg",children:d?BS(d):HS(l.input)}),i.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(qS,{questions:d,answers:l.answers}):o?i.jsx(Dp,{diff:o}):i.jsx(Tx,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&i.jsx(Tx,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Tx({text:l,hint:s,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:l}),i.jsx(wc,{text:l,hint:s,className:"codeblock__copy"})]})}function HS(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function BS(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function IS(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const b of h){if(typeof b!="object"||b===null)return null;const{label:_,description:j,preview:v}=b;if(typeof _!="string"||typeof j!="string")return null;g.push({label:_,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function qS({questions:l,answers:s}){return i.jsx("div",{className:"tool__questions",children:l.map((r,c)=>i.jsxs("div",{className:"tool__question",children:[i.jsxs("div",{className:"tool__question-head",children:[r.header&&i.jsx("span",{className:"chip chip--accent",children:r.header}),i.jsx("span",{className:"tool__question-text",children:r.question})]}),i.jsx("div",{className:"tool__question-answer",children:s!=null&&s[r.question]?i.jsx("span",{className:"tool__answer-value",children:s[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Ex(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const GS="ccv.dictation.lang",Cx="ru-RU";function YS(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Ax(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(YS);return!r&&s.length>0&&Ns("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function Qy(){var l;try{return((l=localStorage.getItem(GS))==null?void 0:l.trim())||Cx}catch{return Cx}}function Ns(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const $S=3,XS=400,VS=5,QS=250,KS=2e3,ZS=2e4;async function FS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const JS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Qy()}`};function WS(l){const[s]=y.useState(()=>Ax()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),m=y.useRef(!1),g=y.useRef(!1),b=y.useRef(l),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=y.useRef(null),v=y.useRef(!1),C=y.useRef(null),T=y.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),E=y.useCallback(()=>{T();const L=async Z=>{if(C.current=null,!(!m.current||v.current)){if(!Z&&!await FS()){if(Ns("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void L(!0),ZS);return}Ns("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void L(!1),KS)},[T]);y.useEffect(()=>{b.current=l}),y.useEffect(()=>{const L=Ax();if(!L)return;const Z=new L;return Z.lang=Qy(),Z.continuous=!0,Z.interimResults=!0,Z.onstart=()=>{Ns("сессия открыта"),v.current=!0,T(),c(!0)},Z.onaudiostart=()=>{Ns("пошёл звук с микрофона"),_.current.audio=!0},Z.onresult=R=>{var he;if(g.current)return;let O="",B="";for(let P=R.resultIndex;P<R.results.length;P++){const ue=R.results[P];if(!ue)continue;const _e=((he=ue[0])==null?void 0:he.transcript)??"";ue.isFinal?O+=_e:B+=_e}const ne=_.current;ne.heard=!0,ne.everHeard=!0,Ns("распознано",{final:O,interim:B}),b.current(O,B)},Z.onerror=R=>{_.current.lastError=R.error,Ns("ошибка движка",R.error),!(R.error==="no-speech"||R.error==="aborted")&&(m.current=!1,c(!1),d(JS[R.error]??`Распознавание не работает: ${R.error}`))},Z.onend=()=>{g.current=!1,v.current=!1;const R=_.current,O=Date.now()-R.openedAt;if(Ns("сессия закрыта",{мс:O,звук:R.audio,слова:R.heard,ошибка:R.lastError||null}),!m.current){c(!1);return}if(R.dead=!R.audio&&O<XS?R.dead+1:0,R.dead>=VS){m.current=!1,c(!1),d(R.lastError?`Распознавание не работает: ${R.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}R.silent=R.heard?0:R.silent+1,!R.everHeard&&!R.warned&&R.silent>=$S&&(R.warned=!0,d(R.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){R.openedAt=Date.now(),R.audio=!1,R.heard=!1,R.lastError="",E();try{Z.start()}catch{}}},QS)},h.current=Z,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,T(),Z.onend=null,Z.onresult=null,Z.onerror=null,Z.onstart=null,Z.onaudiostart=null,Z.abort(),h.current=null}},[]);const M=y.useCallback(()=>{var L;if(m.current){if(m.current=!1,Ns("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,T(),!v.current){c(!1);return}(L=h.current)==null||L.stop()}},[]),G=y.useCallback(()=>{const L=h.current;if(L){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Ns("включение микрофона",{язык:L.lang}),E();try{L.start()}catch(Z){Ns("start() не прошёл",Z)}}},[E]),F=y.useCallback(()=>{m.current?M():G()},[G,M]),q=y.useCallback(()=>{var L;m.current&&v.current&&(g.current=!0,(L=h.current)==null||L.abort())},[]);return{supported:s,listening:r,error:o,toggle:F,stop:M,drop:q}}const PS="(max-width: 860px)",Mx=/^\/(\S*)$/,ew=new Set(["model","permissions"]);function tw(l){return ew.has(l.name)||l.name.startsWith("__")}const nw=new Set(["clear","rename"]),Rx=/(?:^|\s)@([^\s@]*)$/,lw=200,sw=100,aw=190,iw=5,rw=20*1024*1024,cw=1568,ow=.85;let Dx=0;async function uw(l){var j,v;if(!l.type.startsWith("image/")||l.size>rw)return null;const s=await fw(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,cw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,d.width,d.height),(v=(j=s.image).close)==null||v.call(j);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",b=d.toDataURL(g,m?void 0:ow),_=b.slice(b.indexOf(",")+1);return _?(Dx+=1,{id:`att${Dx}`,mediaType:g,data:_,previewUrl:b}):null}async function fw(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function Ky({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:_=!0,onContextSearch:j,onCommand:v,onSend:C,onInterrupt:T,onEscape:E}){var Le;const M=Xf(PS),[G,F]=y.useState(()=>m?zh(m):""),[q,L]=y.useState(!1),[Z,R]=y.useState(0),O=y.useRef(null),B=y.useRef(null),ne=y.useRef(null),[he,P]=y.useState(()=>m?zh(m).length:0),[ue,_e]=y.useState([]),De=y.useRef(null),Ne=y.useCallback(H=>{!_||H.length===0||Promise.all(H.map(uw)).then(W=>{const xe=W.filter(Be=>Be!==null);xe.length!==0&&_e(Be=>[...Be,...xe].slice(0,iw))})},[_]);function A(H){_e(W=>W.filter(xe=>xe.id!==H))}function fe(H){var Be;if(!_)return;const W=(Be=H.clipboardData)==null?void 0:Be.items;if(!W)return;const xe=[];for(const gt of W){if(!gt.type.startsWith("image/"))continue;const Mn=gt.getAsFile();Mn&&xe.push(Mn)}xe.length!==0&&(H.preventDefault(),Ne(xe))}function z(H){const W=H.target.files?Array.from(H.target.files):[];H.target.value="",Ne(W)}y.useEffect(()=>{_||_e([])},[_]);const[pe,ke]=y.useState([]),[k,V]=y.useState(-1),ce=y.useRef(""),[ge,Ae]=y.useState(""),Se=WS(y.useCallback((H,W)=>{H&&F(xe=>Jh(xe,H)),Ae(W.trim())},[])),Te=ge?Jh(G,ge):G;y.useEffect(()=>{Se.listening||ge===""||(F(H=>Jh(H,ge)),Ae(""))},[Se.listening,ge]),y.useEffect(()=>{var H;b&&((H=O.current)==null||H.focus())},[b]);const Tt=y.useRef(new Map),Ye=y.useRef(new Map),et=y.useRef(m),Xe=y.useRef({text:G,caret:he});Xe.current={text:G,caret:he};const Qt=y.useCallback((H,W,xe)=>{W===""?(Tt.current.delete(H),Ye.current.delete(H)):(Tt.current.set(H,W),Ye.current.set(H,xe)),cy(H,W)},[]),tt=Se.drop;y.useLayoutEffect(()=>{const H=et.current;if(H===m)return;et.current=m,H&&Qt(H,Xe.current.text,Xe.current.caret);const W=m?Tt.current.get(m)??zh(m):"",xe=m?Ye.current.get(m):void 0,Be=Math.min(xe??W.length,W.length);F(W),P(Be),ne.current=[Be,Be],Ae(""),R(0),L(!1),V(-1),ce.current="",_e([]),tt()},[m,Qt,tt]),y.useEffect(()=>{m&&Qt(m,G,he)},[m,G,he,Qt]);const Yt=l?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",nt=y.useRef(0),en=y.useCallback(H=>{const W=parseFloat(getComputedStyle(H).maxHeight),xe=Number.isFinite(W)&&W>0?W:aw;H.style.height="auto";const Be=H.scrollHeight;H.style.height=`${Math.min(Be,xe)}px`,H.style.overflowY=Be>xe?"auto":"hidden"},[]);y.useEffect(()=>{const H=O.current;H&&en(H)},[Te,Yt,l,en]),y.useLayoutEffect(()=>{const H=O.current,W=ne.current;!H||!W||(ne.current=null,H.setSelectionRange(W[0],W[1]))}),y.useEffect(()=>{const H=O.current;if(!H)return;const W=new ResizeObserver(([xe])=>{const Be=xe==null?void 0:xe.contentRect.width;Be===void 0||Math.abs(Be-nt.current)<1||(nt.current=Be,en(H))});return W.observe(H),()=>W.disconnect()},[en]);const $t=Se.stop;y.useEffect(()=>{l&&$t()},[l,$t]);const tn=y.useMemo(()=>Se.error?{ok:!1,message:Se.error}:null,[Se.error]),nn=y.useMemo(()=>{var xe;const H=(xe=Mx.exec(G))==null?void 0:xe[1];if(H===void 0)return[];const W=H.toLowerCase();return r.filter(Be=>!tw(Be)&&Wh(Be,W)<Zy).sort((Be,gt)=>Wh(Be,W)-Wh(gt,W))},[G,r]),pn=!q&&nn.length>0,Sn=Math.min(Z,nn.length-1),mn=q?null:((Le=Rx.exec(Te.slice(0,he)))==null?void 0:Le[1])??null,cn=y.useRef(j);cn.current=j,y.useEffect(()=>{if(mn===null||mn===""||mn.endsWith("/")){cn.current(mn);return}const H=setTimeout(()=>cn.current(mn),lw);return()=>clearTimeout(H)},[mn]);const Ke=mn!==null&&(o==null?void 0:o.query)===mn,zt=Ke?o.entries:[],gn=mn!==null,ft=gn&&!Ke,Je=Math.min(Z,Math.max(zt.length-1,0));y.useEffect(()=>{var W,xe;if(!pn&&!gn)return;const H=pn?Sn:Je;(xe=(W=B.current)==null?void 0:W.children[H])==null||xe.scrollIntoView({block:"nearest"})},[pn,gn,Sn,Je]);function An(H,W){var xe;F(H),P(W),ne.current=[W,W],R(0),L(!1),ge!==""&&(Ae(""),Se.drop()),(xe=O.current)==null||xe.focus()}function on(){F(""),Ae(""),R(0),P(0),L(!1),V(-1),ce.current="",_e([]),Se.drop(),m&&Qt(m,"",0)}function wn(H){const W=H.trim();W===""&&ue.length===0||l||(C(W,ue.length>0?ue.map(xe=>({mediaType:xe.mediaType,data:xe.data})):void 0),W!==""&&ke(xe=>[W,...xe.filter(Be=>Be!==W)].slice(0,sw)),on())}function Pn(H){if(H<-1||H>=pe.length)return;k===-1&&(ce.current=G);const W=H===-1?ce.current:pe[H]??"";V(H),An(W,W.length)}function Xt(){var Be;const H=((Be=O.current)==null?void 0:Be.selectionStart)??Te.length,xe=`${H>0&&!/\s$/.test(Te.slice(0,H))?" ":""}@`;An(Te.slice(0,H)+xe+Te.slice(H),H+xe.length)}function wt(H){var gt;const W=(gt=Rx.exec(Te.slice(0,he)))==null?void 0:gt[1];if(W===void 0)return;const xe=he-W.length-1,Be=H.kind==="dir"?`@${H.path}/`:`@${H.path} `;An(Te.slice(0,xe)+Be+Te.slice(he),xe+Be.length)}function Kt(){var W;const H=(W=Mx.exec(Te.trim()))==null?void 0:W[1];if(H&&v(H)){on();return}wn(Te)}function Et(H,W){F(H),P(W),R(0),L(!1),V(-1),ge!==""&&(Ae(""),Se.drop())}function Yn(H){var Be;const W=nw.has(H.name)?c:null,xe=`/${H.name} `;F(xe+(W??"")),P(xe.length+((W==null?void 0:W.length)??0)),W&&(ne.current=[xe.length,xe.length+W.length]),R(0),(Be=O.current)==null||Be.focus()}function le(H){if(v(H.name)){F(""),R(0),L(!1);return}H.argumentHint?Yn(H):wn(`/${H.name}`)}function be(H){if(pn){if(H.key==="ArrowDown")return H.preventDefault(),R(W=>(Math.min(W,nn.length-1)+1)%nn.length);if(H.key==="ArrowUp"){H.preventDefault();const W=nn.length-1;return R(xe=>(Math.min(xe,W)+W)%nn.length)}if(H.key==="Enter"&&!H.shiftKey){H.preventDefault();const W=nn[Sn];W&&le(W);return}if(H.key==="Tab"){H.preventDefault();const W=nn[Sn];W&&Yn(W);return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),L(!0);return}}if(gn){if(H.key==="ArrowDown"&&zt.length>0)return H.preventDefault(),R(W=>(Math.min(W,zt.length-1)+1)%zt.length);if(H.key==="ArrowUp"&&zt.length>0){H.preventDefault();const W=zt.length-1;return R(xe=>(Math.min(xe,W)+W)%zt.length)}if(H.key==="Enter"&&!H.shiftKey||H.key==="Tab"){const W=zt[Je];if(W){H.preventDefault(),wt(W);return}if(H.key==="Tab")return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),L(!0);return}}if((H.key==="ArrowUp"||H.key==="ArrowDown")&&!H.shiftKey){const W=H.currentTarget,xe=W.selectionStart;if(W.selectionEnd===xe){const gt=H.key==="ArrowUp"?k+1:k-1;gt>=-1&&gt<pe.length&&requestAnimationFrame(()=>{W.selectionStart===xe&&W.selectionEnd===xe&&Pn(gt)})}}if(H.key==="Escape"&&E){H.preventDefault(),H.stopPropagation(),E();return}H.key==="Enter"&&!H.shiftKey&&!M&&(H.preventDefault(),Kt())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(vr,{result:tn}),gn&&!pn&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:B,children:[zt.map((H,W)=>i.jsxs("button",{role:"option","aria-selected":W===Je,className:W===Je?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>R(W),onMouseDown:xe=>{xe.preventDefault(),wt(H)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[H.name,H.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:H.path}),H.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},H.path)),zt.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:ft?"ищем…":mn?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),pn&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:B,children:nn.map((H,W)=>i.jsxs("button",{role:"option","aria-selected":W===Sn,className:W===Sn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>R(W),onMouseDown:xe=>{xe.preventDefault(),le(H)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",H.name]}),H.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:H.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:H.description})]},H.name))}),ue.length>0&&i.jsx("div",{className:"composer__attachments",children:ue.map(H=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:H.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>A(H.id),children:i.jsx(bw,{})})]},H.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Xt,children:i.jsx(pw,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:De,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:z}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var H;return(H=De.current)==null?void 0:H.click()},children:i.jsx(gw,{})})]}),i.jsx("textarea",{ref:O,value:Te,disabled:l,placeholder:Yt,onChange:H=>Et(H.target.value,H.target.selectionStart),onSelect:H=>P(H.currentTarget.selectionStart),onKeyDown:be,onPaste:fe}),Se.supported&&i.jsx("button",{type:"button",className:Se.listening?"micbtn is-on":"micbtn",title:Se.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Se.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Se.listening,disabled:l,onClick:Se.toggle,children:i.jsx(xw,{on:Se.listening})}),s?i.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Kt,disabled:l||Te.trim()===""&&ue.length===0,"aria-label":g,title:g,children:[i.jsx("span",{className:"sendbtn__label",children:g}),i.jsx(mw,{})]})]})]})})}function Jh(l,s){const r=s.trim();if(r==="")return l;const c=gp(r).slice(dw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function dw(l,s){const r=gp(l),c=gp(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>hw(d,c[h]??"")))return o;return 0}function gp(l){return l.split(/\s+/).filter(s=>s!=="")}function hw(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function pw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function mw(){return i.jsx("svg",{className:"sendbtn__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function gw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"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 bw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function xw({on:l}){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:l?"currentColor":"none"}),i.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),i.jsx("path",{d:"M8 12.8v1.5"})]})}const Zy=4;function Wh(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:Zy}function yw({request:l,queued:s,onDecide:r}){const c=Vy(l.toolName,l.input);return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[i.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&i.jsx("p",{className:"sheet__reason",children:l.reason}),c?i.jsx(Dp,{diff:c}):i.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>r(l.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>r(l.requestId,"allow"),children:"Разрешить"})]})]})})}function _w({request:l,queued:s,onAnswer:r,onDecline:c}){const{questions:o}=l,[d,h]=y.useState(()=>o.map(()=>new Set)),[m,g]=y.useState(()=>o.map(()=>"")),[b,_]=y.useState(()=>Ox(o));y.useEffect(()=>{h(o.map(()=>new Set)),g(o.map(()=>"")),_(Ox(o))},[l.requestId]);const j=y.useMemo(()=>jw(o,d,m),[o,d,m]),v=j!==null;function C(q,L){var Z,R;(R=(Z=o[q])==null?void 0:Z.options[L])!=null&&R.preview&&_(O=>{const B=O.slice();return B[q]=L,B})}function T(q,L,Z){h(R=>{const O=R.slice(),B=new Set(O[q]);return Z?B.has(L)?B.delete(L):B.add(L):B.has(L)||(B.clear(),B.add(L)),O[q]=B,O}),L!=="other"&&C(q,L)}function E(q,L){g(Z=>{const R=Z.slice();return R[q]=L,R})}function M(){j&&r(l.requestId,j)}function G(q){q.key==="Enter"&&(q.target.closest("button")||v&&(q.preventDefault(),M()))}function F(q){var O;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(q.key))return;const L=Array.from(q.currentTarget.querySelectorAll("button.qsheet__option")),Z=L.indexOf(document.activeElement);if(Z===-1)return;q.preventDefault();const R=q.key==="ArrowDown"||q.key==="ArrowRight"?1:-1;(O=L[(Z+R+L.length)%L.length])==null||O.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:G,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,s>0&&` — ещё ${s} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[l.reason&&i.jsx("p",{className:"qsheet__reason",children:l.reason}),o.map((q,L)=>i.jsx(vw,{q,qi:L,selected:d[L]??new Set,otherText:m[L]??"",previewIndex:b[L]??null,onToggle:T,onFocusOption:C,onOtherText:E,onOptionsKeyDown:F},L))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>c(l.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:M,children:"Ответить"})]})]})})}function vw({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var C;const b=l.options.some(T=>T.preview),_=o!==null?(C=l.options[o])==null?void 0:C.preview:void 0,j=r.has("other"),v=l.multiSelect?"checkbox":"radio";return i.jsxs("div",{className:"qsheet__question",children:[i.jsxs("div",{className:"qsheet__qhead",children:[i.jsx("span",{className:"chip chip--accent",children:l.header}),i.jsx("span",{className:"qsheet__qtext",children:l.question})]}),i.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((T,E)=>{const M=r.has(E);return i.jsxs("button",{type:"button",role:v,"aria-checked":M,className:"qsheet__option"+(M?" is-selected":""),onClick:()=>d(s,E,l.multiSelect),onFocus:()=>h(s,E),onMouseEnter:()=>h(s,E),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:T.label}),i.jsx("span",{className:"qsheet__opt-desc",children:T.description})]})]},E)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(s,"other",l.multiSelect),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),i.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&i.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:T=>m(s,T.target.value),autoFocus:!0})]})]}),b&&i.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Ox(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function jw(l,s,r){const c={};for(let o=0;o<l.length;o++){const d=l[o];if(!d)continue;const h=s[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const b=d.options[g];b&&h.has(g)&&m.push(b.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function Sw({request:l,plan:s,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(s),[m,g]=y.useState("preview");y.useEffect(()=>{h(s),g("preview")},[l.requestId,s]);const b=d.trim().length>0;function _(){b&&c(l.requestId,d)}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[i.jsxs("div",{className:"plansheet__head",children:[i.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:i.jsx(kw,{})}),i.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),i.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(m==="preview"?" is-on":""),role:"tab","aria-selected":m==="preview",onClick:()=>g("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(m==="source"?" is-on":""),role:"tab","aria-selected":m==="source",onClick:()=>g("source"),children:"Код"})]})]}),i.jsxs("div",{className:"plansheet__body",children:[l.reason&&i.jsx("p",{className:"plansheet__reason",children:l.reason}),i.jsx("div",{className:"plansheet__content",children:m==="preview"?i.jsx(ww,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(l.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!b,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function ww({text:l}){const[s,r]=y.useState("");return y.useEffect(()=>{let c=!1;return Kf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function kw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M4.4 2.5h5.6L13 5.5v7.4a.6.6 0 0 1-.6.6H4.4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z"}),i.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),i.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function Nw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function Fy({path:l}){const[s,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!s)return;function m(g){var b;(b=d.current)!=null&&b.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),y.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Rp);return()=>clearTimeout(m)},[c]),y.useEffect(()=>r(!1),[l]);async function h(){await ra(l)&&o(!0)}return i.jsxs("div",{ref:d,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[i.jsx(Tw,{open:s}),i.jsx("span",{className:"cwd__short",children:l})]}),s&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:l}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?pc:xr})]})]})}function Tw({open:l}){return i.jsx("svg",{className:l?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const Ew=["low","medium","high"];function Jy({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:_,onThinking:j,onSwitchOnFlag:v}){const[C,T]=y.useState(!1),[E,M]=y.useState(0),G=y.useRef(null),F=y.useRef(null),q=l.find(B=>B.value===s)??null,L=q&&q.supportsEffort?q.effortLevels.length>0?q.effortLevels:Ew:[],Z=L.includes("xhigh");y.useEffect(()=>{if(!C)return;const B=l.findIndex(ne=>ne.value===s);M(B===-1?0:B)},[C]),y.useEffect(()=>{if(!C)return;function B(ne){var he;(he=G.current)!=null&&he.contains(ne.target)||T(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[C]),y.useEffect(()=>{var B,ne;C&&((ne=(B=F.current)==null?void 0:B.querySelector(".is-cursor"))==null||ne.scrollIntoView({block:"nearest"}))},[C,E]);function R(B){T(!1),B.value!==s&&g(B.value)}function O(B){if(B.key==="Escape"){if(!C)return;B.preventDefault(),B.stopPropagation(),T(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!C)return T(!0);if(l.length===0)return;const ne=B.key==="ArrowDown"?1:l.length-1;return M(he=>(he+ne)%l.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!C)return T(!0);const ne=l[E];ne&&R(ne)}}return i.jsxs("div",{ref:G,className:"select"+(C?" select--open":"")+(m?` ${m}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":C,onClick:()=>T(B=>!B),onKeyDown:O,children:[(q==null?void 0:q.displayName)??s?i.jsx("span",{className:"select__value",children:(q==null?void 0:q.displayName)??s}):i.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):L.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(Cw,{})]}),C&&i.jsxs("div",{ref:F,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((B,ne)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":B.value===s,className:"select__option"+(ne===E?" is-cursor":"")+(B.value===s?" is-on":""),onMouseEnter:()=>M(ne),onClick:()=>R(B),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:B.displayName}),B.description&&i.jsx("span",{className:"select__hint",children:B.description})]},B.value)),L.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"modelmenu__sep",role:"separator"}),i.jsxs("div",{className:"modelmenu__row",children:[i.jsxs("span",{className:"modelmenu__label",children:["Усилие",i.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),i.jsx("span",{className:"modelmenu__levels",children:L.map(B=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":B===r,className:B===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(B),children:B},B))})]}),Z&&i.jsx(Ph,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>_(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(q==null?void 0:q.supportsThinking)!==!1&&i.jsx(Ph,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&i.jsx(Ph,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function Ph({label:l,desc:s,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[i.jsxs("span",{className:"modelmenu__label",children:[l,i.jsx("span",{className:"modelmenu__desc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Cw(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const b=h.current;if(!b)return;const _=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=_[0],v=_[_.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":l,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:l}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:s}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function Aw({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:b,onSubmit:_,onCreate:j,onClose:v}){const[C,T]=y.useState("open"),[E,M]=y.useState(""),[G,F]=y.useState(!1),[q,L]=y.useState(""),[Z,R]=y.useState(""),[O,B]=y.useState({git:!0,claudeMd:!0,readme:!0}),ne=E.trim(),he=ne!=="",P=q.trim(),ue=Z.trim(),_e=P!==""&&ue!=="";y.useEffect(()=>{q===""&&d.length>0&&L(d[0])},[d]);const De=y.useRef(m);De.current=m,y.useEffect(()=>{if(C!=="open")return;const z=E.trim(),pe=setTimeout(()=>De.current(z),200);return()=>clearTimeout(pe)},[E,C]);function Ne(){he&&_(ne)}function A(){_e&&j(P,ue,O)}function fe(){he&&(F(!0),g(ne))}return h?i.jsxs(Nl,{title:"Новый проект",onClose:v,actions:i.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[i.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),i.jsx("p",{className:"newproj__preview",children:h.path}),i.jsx("div",{className:"modal__error",children:i.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(z=>i.jsx("li",{children:z},z))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Nl,{title:"Новый проект",className:G&&C==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:b,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!he,onClick:fe,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!he,onClick:Ne,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!_e,onClick:A,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(Lx,{label:"Открыть",on:C==="open",onClick:()=>T("open")}),i.jsx(Lx,{label:"Создать",on:C==="create",onClick:()=>T("create")})]}),C==="open"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),i.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),i.jsx("input",{id:"workspace-path",className:"input input--mono",value:E,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:z=>M(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),Ne())}}),o&&i.jsx("p",{className:"modal__error",children:o}),l.length>0&&i.jsx("ul",{className:"finds",children:l.map(z=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:z.open,title:z.open?"Этот проект уже открыт":z.path,onClick:()=>M(z.path),onDoubleClick:()=>_(z.path),children:[i.jsx("span",{className:"find__name",children:z.name}),i.jsx("span",{className:"find__path",children:z.path}),i.jsx("span",{className:"find__note",children:Dw(z)})]})},z.path))}),l.length===0&&he&&!s&&!G&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),G&&i.jsx("div",{className:"finds__agent",children:i.jsx(Op,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),i.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),i.jsx("input",{id:"workspace-parent",className:"input input--mono",value:q,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:z=>L(z.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(z=>i.jsx("button",{type:"button",className:z===P?"newproj__root is-on":"newproj__root",title:z,onClick:()=>L(z),children:Rw(z)},z))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:Z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:z=>R(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),A())}}),i.jsx("p",{className:"newproj__preview",children:_e?Mw(P,ue):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(ep,{label:"git init",desc:"панель истории работает сразу",on:O.git,onToggle:()=>B(z=>({...z,git:!z.git}))}),i.jsx(ep,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:O.claudeMd,onToggle:()=>B(z=>({...z,claudeMd:!z.claudeMd}))}),i.jsx(ep,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:O.readme,onToggle:()=>B(z=>({...z,readme:!z.readme}))})]})]})]})}function Lx({label:l,on:s,onClick:r}){return i.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function ep({label:l,desc:s,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[i.jsxs("span",{className:"newproj__optlabel",children:[l,i.jsx("span",{className:"newproj__optdesc",children:s})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Mw(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Rw(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function Dw(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Ow(l.sessions)}${Lw(l.lastUsedAt)}`}function Ow(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function Lw(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Lp=7;function zw(l){const s=[],r=[];let c=1;for(const o of l){const d=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=zx(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let C=s.indexOf(v);C===-1&&(C=zx(s),s[C]=v),b.push({from:h,to:C})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.push({from:v,to:h}),v!==h&&(s[v]=null));const j=[];for(let v=0;v<d.length;v++){const C=d[v];!C||C===o.hash||v===h||s[v]===C&&j.push(v)}Uw(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:_,down:b,through:j})}return{rows:r,columns:Math.min(c,Lp)}}function zx(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Uw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const Wy=1500;function Hw(l){const s=[];let r=!1;for(const c of l.patch.split(`
119
+ `)){if(s.length>=Wy){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:Bw(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:Iw(l,r)}}function Bw(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Iw(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${Wy} строк`),r.length>0?r.join(" · "):null}function qw({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:_,onConnectRemote:j,onDismissResult:v,onClose:C,zoomed:T,onToggleZoom:E}){const M=zw((s==null?void 0:s.commits)??[]),G=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(F=>({value:F.name,label:F.name,hint:F.hash.slice(0,8)}))];return i.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:F=>{E&&(F.target.closest("button")||E())},children:[i.jsx(Qw,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),E&&i.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:E,children:i.jsx(Nc,{active:T})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:C,children:"✕"})]}),s===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"gitbar",children:[i.jsx(Cs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:G,onChange:F=>{F&&m(F,`ветку ${F}`)}}),i.jsx(wc,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.detached&&i.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),i.jsx("div",{className:"gitbar__actions",children:o?i.jsxs("p",{className:"gitbar__busy",children:[i.jsx(Jw,{}),o]}):s.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[i.jsx(Kw,{}),"Отправить",s.ahead>0&&i.jsx("span",{className:"gitbar__count",children:s.ahead})]}),i.jsxs("div",{className:"gitbar__group",children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>b(!0),children:[i.jsx(Zw,{}),"Забрать",s.behind>0&&i.jsx("span",{className:"gitbar__count",children:s.behind})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>b(!1),children:i.jsx(Fw,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${tk(s.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(F=>ek(F.path)).join(", "):"незакоммиченных изменений нет"})]})}),M.rows.map(F=>i.jsx(Yw,{row:F,columns:M.columns,head:F.commit.hash===s.head,local:s.hasRemote&&!F.commit.pushed,active:c===F.commit.hash,onOpen:()=>h(F.commit.hash)},F.commit.hash)),M.rows.length===0&&i.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):i.jsxs("div",{className:"gitempty",children:[i.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[i.jsx(Hx,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(vr,{result:r,onDismiss:v})]})}const zo=50,Ux=13,Gw=500;function Yw({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(Ww).filter(Boolean),[g,b]=y.useState(null),_=y.useRef(null);function j(E){const M=E.touches[0];if(!M)return;const G={timer:0,x:M.clientX,y:M.clientY,fired:!1};G.timer=window.setTimeout(()=>{G.fired=!0,b({x:G.x,y:G.y})},Gw),_.current=G}function v(E){const M=_.current,G=E.touches[0];!M||!G||Math.hypot(G.clientX-M.x,G.clientY-M.y)>10&&(window.clearTimeout(M.timer),_.current=null)}function C(E){const M=_.current;M&&(window.clearTimeout(M.timer),M.fired&&E.preventDefault())}function T(){const E=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void ra(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void ra(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void ra(h.subject)}],M=new Set;for(const G of h.refs){const F=G.startsWith("tag: "),q=Pw(G);!q||M.has(q)||(M.add(q),E.push({id:`ref:${q}`,label:F?"Копировать тег":"Копировать ветку",hint:q,onSelect:()=>void ra(q)}))}return E}return i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var E;if((E=_.current)!=null&&E.fired){_.current=null;return}d()},onContextMenu:E=>{E.preventDefault(),b({x:E.clientX,y:E.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:C,onTouchCancel:C,children:[i.jsx($w,{row:l,columns:s,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[m.map(E=>i.jsx("span",{className:"gitrow__ref",children:E},E)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",nk(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&i.jsx(zi,{x:g.x,y:g.y,items:T(),onClose:()=>b(null)})]})}function $w({row:l,columns:s,head:r,local:c}){const o=s*Ux+6,d=zo/2,h=b=>8+Math.min(b,Lp-1)*Ux,m=c?"3.5 2.5":void 0,g=Nf(l.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:zo,viewBox:`0 0 ${o} ${zo}`,"aria-hidden":"true",children:[l.through.map(b=>i.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:zo,style:{stroke:Nf(b)}},`t${b}`)),l.up.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:Nf(b.from),strokeDasharray:m}},`u${_}`)),l.down.map((b,_)=>i.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${zo}`,fill:"none",style:{stroke:Nf(b.to),strokeDasharray:m}},`d${_}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:d,r:l.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:d,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Nf(l){return`var(--lane-${l%Lp})`}function Xw({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return i.jsxs(Nl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),i.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&i.jsxs("div",{className:"commit__head",children:[i.jsxs("div",{className:"commit__line",children:[i.jsx("p",{className:"commit__subject",children:l.subject}),i.jsx(wc,{text:l.subject,hint:"сообщение коммита"})]}),i.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",lk(l.date)]}),i.jsxs("div",{className:"commit__line commit__line--hash",children:[i.jsx("span",{className:"commit__hash",children:l.hash}),i.jsx(wc,{text:l.hash,hint:"хеш коммита"})]}),s&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(d=>d.slice(0,8)).join(", ")]}),l.body&&i.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(d=>i.jsx(Vw,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function Vw({file:l,defaultOpen:s}){const[r,c]=y.useState(s);return i.jsxs("div",{className:"commit__file",children:[i.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"commit__filepath",children:l.path||l.oldPath}),i.jsxs("span",{className:"diff__stat",children:[l.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(Dp,{diff:Hw(l)})]})}function Qw(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Kw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function Zw(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function Fw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"m13 13-2.6-2.6"})]})}function Hx(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function Jw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Ww(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Pw(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function ek(l){const s=l.split("/");return s[s.length-1]??l}function tk(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function nk(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(s).toLocaleDateString()}function lk(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function Bx(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function sk({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:_,onClose:j}){var z;const[v,C]=y.useState(()=>Bx(c)),[T,E]=y.useState(""),[M,G]=y.useState(""),[F,q]=y.useState(!0),[L,Z]=y.useState("Первый коммит"),[R,O]=y.useState(null),[B,ne]=y.useState("");y.useEffect(()=>{!T&&s.length>0&&E(s[0].login)},[T,s]),y.useEffect(()=>{r&&R===null&&O(new Set(r.files))},[r,R]);const he=(l==null?void 0:l.connected)===!0,P=s.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),ue=y.useMemo(()=>{if(!r)return[];const pe=B.trim().toLowerCase();return pe?r.files.filter(ke=>ke.toLowerCase().includes(pe)):r.files},[r,B]),_e=(R==null?void 0:R.size)??0,De=he&&v.trim()!==""&&T!==""&&d===""&&(o||_e>0);function Ne(pe){O(ke=>{const k=new Set(ke??[]);return k.has(pe)?k.delete(pe):k.add(pe),k})}function A(pe){O(ke=>{const k=new Set(ke??[]);for(const V of ue)pe?k.add(V):k.delete(V);return k})}function fe(){if(!De)return;const pe=(r==null?void 0:r.files)??[];b({owner:T,name:v.trim(),description:M.trim(),private:F,include:o?[]:pe.filter(ke=>R==null?void 0:R.has(ke)),ignore:o?[]:pe.filter(ke=>!(R!=null&&R.has(ke))),message:o?"":L.trim()||"Первый коммит"})}return i.jsxs(Nl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!De,onClick:fe,children:d||"Опубликовать"})]}),children:[i.jsx(ak,{status:l,onRefreshStatus:m,onSaveToken:g}),i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Имя"}),i.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:pe=>C(Bx(pe.target.value))})]}),v.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),s.length>1?i.jsx(Cs,{className:"settings__select",value:T,options:P,onChange:E,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((z=s[0])==null?void 0:z.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:M,placeholder:"о чём проект — одной строкой",onChange:pe=>G(pe.target.value)})]}),i.jsxs("div",{className:"field publish__field",children:[i.jsx("span",{children:"Видимость"}),i.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[i.jsx(Ix,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:F,onClick:()=>q(!0)}),i.jsx(Ix,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!F,onClick:()=>q(!1)})]})]})]}),!o&&i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?i.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"publish__filehead",children:[i.jsxs("span",{className:"publish__filecount",children:[_e," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>A(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:B,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>ne(pe.target.value)}),i.jsx("div",{className:"publish__filelist",children:ue.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ue.map(pe=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(R==null?void 0:R.has(pe))===!0,className:"publish__file",onClick:()=>Ne(pe),children:[i.jsx("span",{className:"publish__box"+(R!=null&&R.has(pe)?" is-on":""),"aria-hidden":"true",children:(R==null?void 0:R.has(pe))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),r.truncated&&i.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Сообщение коммита"}),i.jsx("input",{className:"input",value:L,onChange:pe=>Z(pe.target.value)})]})]})]}),i.jsx(vr,{result:h,onDismiss:_})]})}function Ix({title:l,desc:s,on:r,risky:c,onClick:o}){return i.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[l,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:s})]})]})}function ak({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=y.useState(""),[d,h]=y.useState(!1);return i.jsxs("div",{className:"publish__section publish__section--first",children:[i.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:l.login}),i.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[l.ghInstalled&&i.jsxs("p",{className:"modal__text",children:["В системе установлен ",i.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",i.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Личный токен GitHub"}),i.jsx(ik,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),i.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",i.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",i.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),l.message&&i.jsx("p",{className:"modal__error",children:l.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function ik({value:l,onChange:s,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return i.jsxs("div",{className:"pwfield",children:[i.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>s(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(ck,{}):i.jsx(rk,{})})]})}function rk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function ck(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),i.jsx("path",{d:"M2 14 14 2"})]})}function ok({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=y.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(Nl,{title:"Подключить существующий репозиторий",onClose:o,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||l!=="",onClick:()=>r(d.trim()),children:l||"Подключить"})]}),children:[i.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",i.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Адрес репозитория"}),i.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&l===""&&r(d.trim())}})]}),i.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",i.jsx("code",{children:"https://…"}),", ",i.jsx("code",{children:"ssh://…"}),", ",i.jsx("code",{children:"git://…"})," и"," ",i.jsx("code",{children:"git@host:path"}),"."]}),i.jsx(vr,{result:s,onDismiss:c})]})}function uk({open:l,items:s,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:g,effort:b,ultracode:_,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:T,onModel:E,onEffort:M,onUltracode:G,onThinking:F,onSwitchOnFlag:q,onAsk:L,onInterrupt:Z,onReset:R,onClose:O,zoomed:B,onToggleZoom:ne}){return i.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(B?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:he=>{ne&&(he.target.closest("button")||ne())},children:[i.jsx(fk,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:R,children:"↻"}),ne&&i.jsx("button",{className:"sidepane__btn",title:B?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":B?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":B,onClick:ne,children:i.jsx(Nc,{active:B})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:O,children:"✕"})]}),m.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(Jy,{className:"select--compact",models:m,value:g,effort:b,ultracode:_,thinking:j,switchOnFlag:v,onModel:E,onEffort:M,onUltracode:G,onThinking:F,onSwitchOnFlag:q}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(Op,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(Ky,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,onContextSearch:C,onCommand:T,onSend:L,onInterrupt:Z,onEscape:r?Z:O})]})}function fk(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const dk=75,hk=90;function Py({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return i.jsx("div",{className:"usage",title:gk(l,s),"aria-label":c,children:r.map(o=>i.jsx(pk,{label:o.label,window:o.window},o.key))})}function pk({label:l,window:s}){const r=Math.round(s.utilization),c=xk(s.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:l}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${mk(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:zp(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function mk(l){return l>=hk?" usage__fill--over":l>=dk?" usage__fill--warn":""}function gk(l,s){if(s.length>0)return bk(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=zp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
120
+ `)}function bk(l){const s=["Квота Antigravity"];for(const r of l){const c=zp(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
121
+ `)}function e_(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function t_(l){return l.getTime()-Date.now()<1440*60*1e3}function xk(l){const s=e_(l);return s?t_(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function zp(l){const s=e_(l);return s?`обнулится ${t_(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function n_(){const[l,s]=y.useState(()=>new Date);return y.useEffect(()=>{let r=0;const c=()=>{const d=new Date;s(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),i.jsxs("time",{className:"clock",dateTime:l.toISOString(),title:yk(l),children:[i.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function yk(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function _k({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:b,onHandoff:_,onFreshSession:j,handoffWriting:v,onStop:C}){const T=gy({onLongPress:()=>j==null?void 0:j(),onClick:()=>_==null?void 0:_(),disabled:v});return i.jsx(Nl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:i.jsxs("div",{className:"sessionmenu",children:[s&&i.jsx(cc,{label:"Режим прав",children:s}),i.jsx(cc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&i.jsx(cc,{label:"Лимиты плана",children:i.jsx(Py,{usage:c})}),i.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[i.jsx(vk,{}),i.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",g&&i.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsx(cc,{label:"Время",children:i.jsx(n_,{})}),d&&i.jsx(cc,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(cc,{label:"Каталог проекта",children:i.jsx(Fy,{path:o})}),b&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:b,children:"Переименовать сессию"}),_&&i.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":T.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${T.thresholdMs}ms`},"aria-busy":v,disabled:v,...T.handlers,children:[i.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),i.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&i.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),C&&i.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function cc({label:l,children:s}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function vk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function jk({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:m,onClose:g}){const b=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Nl,{title:"Расширения",className:"modal--wide",onClose:g,children:[i.jsx("div",{className:"tabs",role:"tablist",children:b.map(_=>i.jsxs("button",{role:"tab","aria-selected":l===_.id,className:l===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>m(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),l==="mcp"&&i.jsx(Sk,{servers:s,actions:h}),l==="plugins"&&i.jsx(Ek,{plugins:r,marketplaces:c,actions:h}),l==="catalog"&&i.jsx(Ck,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>m("plugins")}),i.jsx(vr,{result:d})]})}function Sk({servers:l,actions:s}){const[r,c]=y.useState(!1);return i.jsxs(i.Fragment,{children:[l.length===0&&!r&&i.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",i.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",i.jsx("code",{children:"claude mcp list"}),"."]}),i.jsx("ul",{className:"extlist",children:l.map(o=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:o.name}),i.jsx("span",{className:`chip chip--${kk(o.status)}`,children:wk[o.status]}),o.scope&&i.jsx("span",{className:"chip",children:o.scope}),o.transport&&i.jsx("span",{className:"chip",children:o.transport})]}),o.target&&i.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&i.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&i.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>s.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>s.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),r?i.jsx(Nk,{onCancel:()=>c(!1),onSubmit:(o,d)=>{s.mcpAdd(o,d),c(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const wk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function kk(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function Nk({onSubmit:l,onCancel:s}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,m]=y.useState(""),[g,b]=y.useState(""),[_,j]=y.useState(""),v=o==="stdio",C=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function T(){if(C)if(v){const[E,...M]=Tk(h);l(r.trim(),{transport:"stdio",command:E??"",args:M,env:qx(_)})}else l(r.trim(),{transport:o,url:g.trim(),headers:qx(_)})}return i.jsxs("div",{className:"extform extform--card",children:[i.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),i.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:E=>c(E.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Cs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:E=>d(E)}),v?i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),i.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:E=>m(E.target.value)})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),i.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:E=>b(E.target.value)})]}),i.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),i.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:_,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:E=>j(E.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:T,children:"Подключить"})]})]})}function qx(l){const s={};for(const r of l.split(`
122
+ `)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function Tk(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function Ek({plugins:l,marketplaces:s,actions:r}){const[c,o]=y.useState("");return i.jsxs(i.Fragment,{children:[l.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:l.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:d.name}),i.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&i.jsx("span",{className:"chip",children:d.version}),d.scope&&i.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&i.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&i.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),i.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),i.jsx("ul",{className:"extlist",children:s.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsx("div",{className:"extlist__head",children:i.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&i.jsx("div",{className:"extlist__meta",children:d.source}),i.jsx("div",{className:"extlist__actions",children:i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),i.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const Uo=30;function Ck({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(Uo),[_,j]=y.useState(""),v=y.useMemo(()=>[...new Set(l.map(E=>E.category).filter(Boolean))].sort(),[l]),C=y.useMemo(()=>{const T=o.trim().toLowerCase();return l.filter(E=>h&&E.category!==h?!1:T?`${E.name} ${E.displayName} ${E.description} ${E.author}`.toLowerCase().includes(T):!0)},[l,o,h]);return l.length===0?i.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",i.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"catalog__filters",children:[i.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:T=>{d(T.target.value),b(Uo)}}),i.jsx(Cs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{m(T),b(Uo)}})]}),C.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:C.slice(0,g).map(T=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&i.jsx("span",{className:"chip",children:T.version}),T.category&&i.jsx("span",{className:"chip",children:T.category})]}),T.description&&i.jsx("div",{className:"catalog__desc",children:T.description}),i.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>r.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),C.length>g&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>b(T=>T+Uo),children:["Ещё ",Math.min(Uo,C.length-g)," из ",C.length-g]})}),i.jsxs("div",{className:"extform",children:[i.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>j(T.target.value),onKeyDown:T=>{T.key!=="Enter"||_.trim()===""||(T.preventDefault(),r.pluginInstall(_.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),j("")},children:"Установить"})]})]})]})}function Ak({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[b,_]=y.useState(""),[j,v]=y.useState(!1),[C,T]=y.useState(!1),E=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!C&&!j,M=y.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const q=s.output.trim();return q===""?null:{ok:!0,message:q}},[s.error,s.output]);function G(q=b){const L=q.trim();L!==""&&(r.submitCode(L),_(""))}function F(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return i.jsxs(Nl,{title:"Аккаунт",onClose:g,children:[l===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):l.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:l.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:Dk[l.method]??l.method}),l.plan&&i.jsx("span",{className:"chip",children:l.plan})]}),l.organization&&i.jsx("div",{className:"extlist__meta",children:l.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?i.jsx(Ok,{login:s,remote:c,code:b,onCode:_,onSubmit:G,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(vr,{result:M}),C&&i.jsx("p",{className:"account__warn",role:"alert",children:Mk(o)}),E&&h&&i.jsx("p",{className:"account__note",children:m}),i.jsx("div",{className:`extbar${l!=null&&l.loggedIn?" account__bar":""}`,children:l!=null&&l.loggedIn?i.jsxs(i.Fragment,{children:[E&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
+ ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(Rk,{}),"Переподключить"]}),C?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>T(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{T(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:F,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{T(!1),v(!0)},children:"Выйти"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function Mk(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function Rk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Dk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Ok({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,m]=y.useState(null),g=y.useRef(""),b=y.useRef({code:r,onCode:c,onSubmit:o});b.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async E=>{const{code:M,onCode:G,onSubmit:F}=b.current;if(E&&M.trim()!=="")return;const q=await pp();if(q===null){E||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const L=q.trim();if(!Gx(L)){E||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(E){if(g.current===L)return;g.current=L}m(null),G(L),F(L)},[]);y.useEffect(()=>{if(!l.awaitingCode)return;const E=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[l.awaitingCode,_]);const j=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!Gx(r),C=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[l.url?s?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:l.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),i.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),i.jsxs("div",{className:"account__raw",children:[i.jsx("span",{className:"account__rawurl",children:l.url}),i.jsx(wc,{text:l.url,hint:"ссылку входа"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),i.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),i.jsxs("details",{className:"account__fallback",children:[i.jsx("summary",{children:"Браузер не открылся"}),i.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),i.jsx("a",{className:"account__link",href:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.awaitingCode&&i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),i.jsxs("div",{className:"extform__row account__coderow",children:[i.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:E=>{m(null),c(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),C&&i.jsx("p",{className:"account__note account__note--code",children:C})]}),l.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:l.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function Gx(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function Lk({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,m]=y.useState(""),[g,b]=y.useState(!1),_=y.useRef(null),j=(l==null?void 0:l.paired)===!0;y.useEffect(()=>{var C;j||(C=_.current)==null||C.focus()},[j]),y.useEffect(()=>{b(!1),j&&d("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return i.jsx(Nl,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Yx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),i.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),i.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):i.jsxs("div",{className:"relay",children:[i.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),i.jsxs("ol",{className:"relay__steps",children:[i.jsxs("li",{children:["Откройте ",i.jsx("b",{children:Yx(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:C=>{C.preventDefault(),o.trim()&&(b(!0),s(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:C=>d(C.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Как назвать этот компьютер"}),i.jsx("input",{className:"input",value:h,onChange:C=>m(C.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&i.jsx("p",{className:"relay__error",children:l.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function Yx(l){try{return new URL(l).host}catch{return l}}const tp="",zk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Uk=dy.map(l=>({value:l.value,label:l.value,hint:l.hint})),Tf=3600*1e3,Hk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],uc={"6h":6*Tf,"24h":24*Tf,"48h":48*Tf,"168h":168*Tf,never:0};function Bk(l){return uc[l]??uc["48h"]}const Ik=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Ef=60*1e3,fc={"5m":5*Ef,"10m":10*Ef,"30m":30*Ef,"60m":60*Ef,never:0};function qk(l){return fc[l]??fc["10m"]}function Gk(l){const s=Object.entries(fc).find(([,r])=>r===l);return s?s[0]:Object.keys(fc).reduce((r,c)=>Math.abs(fc[c]-l)<Math.abs(fc[r]-l)?c:r)}function Yk(l){const s=Object.entries(uc).find(([,r])=>r===l);return s?s[0]:Object.keys(uc).reduce((r,c)=>Math.abs(uc[c]-l)<Math.abs(uc[r]-l)?c:r)}const $k=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],dc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Xk(l){return dc[l]??dc.off}function $x(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function Vk(l){const s=Object.entries(dc).find(([,r])=>r===l);return s?s[0]:Object.keys(dc).reduce((r,c)=>Math.abs(dc[c]-l)<Math.abs(dc[r]-l)?c:r)}const Qk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Kk({settings:l,models:s,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:g}){const b=l===null,_=!b&&l.terminalEnabled===!0,j=!b&&l.liveSessionsFirst===!0,v=!_,C=y.useMemo(()=>{const E=[{value:tp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(M=>({value:M.value,label:M.displayName,hint:M.description})):zk];return l&&l.startModel!==null&&!E.some(M=>M.value===l.startModel)&&E.push({value:l.startModel,label:l.startModel}),E},[s,l]);function T(){var E,M;return(r==null?void 0:r.paired)!==!0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:m,children:"Связать компьютер"})]}):(E=r.shell)!=null&&E.enabled?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),i.jsx("button",{type:"button",className:"btn btn--danger",disabled:v,onClick:h,children:"Запретить"})]}):(M=r.shell)!=null&&M.pending?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",i.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),i.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Отправить письмо ещё раз"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Разрешить с телефона"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),i.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Прислать письмо"})]})]})}return i.jsx(Nl,{title:"Настройки",onClose:g,children:i.jsxs("div",{className:"settings",children:[i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),i.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:Yk(l.autoArchiveAfterMs),options:Hk,onChange:E=>o({autoArchiveAfterMs:Bk(E)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),i.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:Gk(l.autoStopAfterMs),options:Ik,onChange:E=>o({autoStopAfterMs:qk(E)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),i.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopFiveHourPct,onChange:E=>o({limitStopFiveHourPct:$x(E.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsxs("div",{className:"settings__pct",children:[i.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopSevenDayPct,onChange:E=>o({limitStopSevenDayPct:$x(E.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),i.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),i.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:Vk(l.autoSaveAfterPauseMs),options:$k,onChange:E=>o({autoSaveAfterPauseMs:Xk(E)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),i.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Модель"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:l.startModel??tp,options:C,onChange:E=>o({startModel:E===tp?null:E}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),b?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Cs,{className:"settings__select",value:l.startPermissionMode,options:Uk,onChange:E=>o({startPermissionMode:E}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsx("section",{className:"settings__section",children:i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),i.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":j,"aria-label":"Запущенные сессии сверху",className:j?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!j}),children:i.jsx("span",{className:"switch__knob"})})]})}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),i.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),i.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:Qk.map(E=>{const M=!b&&l.folderAccess===E.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":M,disabled:b,className:"access__card"+(M?" is-on":"")+(E.risky?" access__card--risky":""),onClick:()=>o({folderAccess:E.value}),children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[E.title,E.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:E.description})]})]},E.value)})})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Терминал"}),i.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),b?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-label":"Терминал",className:_?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!_}),children:i.jsx("span",{className:"switch__knob"})})]}),i.jsxs("div",{className:"settings__nested"+(v?" is-disabled":""),children:[i.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),b?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[v&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),T()]})]})]})]})})}const Xx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Zk(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function Fk({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${Xx[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.stoppedAt).toLocaleString()}`;return i.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[i.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}return i.jsxs("div",{className:"handoff",role:"status",children:[i.jsxs("div",{className:"handoff__msg",children:[i.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),i.jsxs("span",{children:[l.limit===null?i.jsxs(i.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):i.jsxs(i.Fragment,{children:[Xx[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",Zk(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),i.jsxs("div",{className:"handoff__actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,children:"Продолжить в новой сессии"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),i.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function Jk({handoff:l,onClose:s}){const[r,c]=y.useState("");return y.useEffect(()=>{let o=!1;return Kf(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),i.jsx(Nl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Vx={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},Wk=12e3;function Pk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function eN({notices:l,onDismiss:s}){return l.length===0?null:i.jsx("div",{className:"limittoasts",children:l.map(r=>i.jsx(tN,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function tN({notice:l,onDismiss:s}){return y.useEffect(()=>{const r=window.setTimeout(s,Wk);return()=>window.clearTimeout(r)},[s]),i.jsxs("div",{className:"limittoast",role:"status",children:[i.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),i.jsx("span",{className:"limittoast__body",children:l.stopped>0?i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",Pk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):i.jsxs(i.Fragment,{children:["Достигнут ",Vx[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),i.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}const nN=16;function lN({pane:l,width:s,onResize:r,onReset:c}){const o=gr[l],d=y.useRef(null);function h(_){if(_.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-W0):0;d.current={x:_.clientX,width:s,max:Math.min(o.max,s+v)},_.currentTarget.setPointerCapture(_.pointerId),document.body.classList.add("is-resizing"),_.preventDefault()}function m(_){const j=d.current;if(!j)return;const v=o.side==="left"?_.clientX-j.x:j.x-_.clientX;r(Math.min(j.max,j.width+v))}function g(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function b(_){const j=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;j!==0&&(_.preventDefault(),r(s+j*nN*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:b,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const sN=16;function aN({height:l,onResize:s,onReset:r}){const c=y.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const _=b.getBoundingClientRect().height-nv;return Math.round(l+Math.max(0,_))}function d(b){b.button===0&&(c.current={y:b.clientY,height:l,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const _=c.current;if(!_)return;const j=_.y-b.clientY;s(_.height+j,_.max)}function m(b){c.current&&(c.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function g(b){const _=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;_!==0&&(b.preventDefault(),s(l+_*sN,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":my,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function Qx(){const l=document.documentElement,s=getComputedStyle(l),r=F=>s.getPropertyValue(F).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),_=r("--danger"),j=r("--ok"),v=r("--warn"),C=r("--cm-fn"),T=r("--cm-key"),E=r("--cm-type"),M=Kx(o,c,55),G=F=>Kx(F,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:M,brightBlack:h,red:_,brightRed:G(_),green:j,brightGreen:G(j),yellow:v,brightYellow:G(v),blue:C,brightBlue:G(C),magenta:T,brightMagenta:G(T),cyan:E,brightCyan:G(E),white:d,brightWhite:o}}function iN(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Ps=null;function rN(l){return Ps||(Ps=document.createElement("span"),Ps.style.position="fixed",Ps.style.width="0",Ps.style.height="0",Ps.style.opacity="0",Ps.style.pointerEvents="none",document.body.appendChild(Ps)),Ps.style.color=l,getComputedStyle(Ps).color}function Kx(l,s,r){return rN(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Cf=null;function cN(){return Cf||(Cf=Promise.all([Qe(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Qe(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Qe(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Qe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Cf=null,l})),Cf}function oN({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:_,onOpen:j,onClose:v,onInput:C,onResize:T,onAttach:E,onHide:M,registerSink:G}){const[F,q]=y.useState(()=>Qx());return y.useEffect(()=>{const L=new MutationObserver(()=>q(Qx()));return L.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>L.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:d},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:L=>{b&&(L.target.closest("button")||b())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(L=>i.jsxs("div",{role:"tab","aria-selected":L.id===s,className:"termtab"+(L.id===s?" is-on":"")+(L.exitCode!==null?" termtab--exited":""),onDoubleClick:Z=>{b&&(Z.target.closest(".termtab__close")||b())},children:[i.jsx("button",{className:"termtab__name",title:L.cwd,onClick:()=>_(L.id),children:L.title}),L.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${L.exitCode}`,children:L.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${L.title}»`,onClick:()=>v(L.id),children:"✕"})]},L.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),b&&i.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:i.jsx(Nc,{active:g})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:M,children:"✕"})]}),c&&l.length>0&&i.jsx(Zx,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?i.jsx(Zx,{message:c,onRetry:r?null:j,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(L=>i.jsx(fN,{id:L.id,exitCode:L.exitCode,active:L.id===s,theme:F,mobile:m,onInput:C,onResize:T,onAttach:E,registerSink:G},L.id))]})]})}function Zx({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=uN(l);return i.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),d&&i.jsx("p",{className:"termfail__hint",children:d}),h&&i.jsxs("details",{className:"termfail__details",children:[i.jsx("summary",{children:"Подробности"}),i.jsx("pre",{children:h})]})]}),i.jsxs("div",{className:"termfail__bar",children:[r&&i.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),i.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function uN(l){const[s="",...r]=l.trim().split(`
124
124
 
125
125
  `),c=s.split(`
126
126
  `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??l.trim(),hint:c.slice(1).join(" "),details:r.join(`
127
127
 
128
- `).trim()}}function oN({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=y.useRef(null),_=y.useRef(null),j=y.useRef(!1),v=y.useRef(o);v.current=o;const C=y.useRef(c),T=y.useRef(s),[E,L]=y.useState("loading"),[$,J]=y.useState(!1);return y.useEffect(()=>{if(!b.current)return;let O=!1,Z=null;L("loading"),J(!1);const M=window.setTimeout(()=>{O||J(!0)},200);return(async()=>{var ke;let D;try{D=await iN()}catch{window.clearTimeout(M),O||L("error");return}if(O||!b.current)return;window.clearTimeout(M);const{Terminal:B,FitAddon:ne,WebLinksAddon:he}=D,P=new B({fontFamily:sN()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ue=new ne;P.loadAddon(ue),P.loadAddon(new he),P.open(b.current),_.current=P,P.attachCustomKeyEventHandler(k=>{if(k.type!=="keydown"||!(k.ctrlKey||k.metaKey))return!0;if(k.key==="`")return k.preventDefault(),!1;if(k.key==="c"||k.key==="C"){const ce=P.getSelection();return ce?(k.preventDefault(),Sc(ce),!1):!k.shiftKey}return k.key==="v"||k.key==="V"?(k.preventDefault(),hp().then(ce=>{ce&&P.paste(ce)}),!1):!0});const _e=k=>{k.preventDefault();const V=P.getSelection();if(V){Sc(V),P.clearSelection();return}hp().then(ce=>{ce&&P.paste(ce)})};(ke=P.element)==null||ke.addEventListener("contextmenu",_e);const De=P.onData(k=>d(l,k));let Ne={cols:P.cols,rows:P.rows},A=null;const fe=P.onResize(({cols:k,rows:V})=>{A!==null&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,!(k===Ne.cols&&V===Ne.rows)&&(Ne={cols:k,rows:V},h(l,k,V))},100)}),z=new ResizeObserver(()=>{try{ue.fit()}catch{return}v.current&&P.scrollToBottom()});z.observe(b.current);const pe=g(l,k=>{k.kind==="buffer"&&P.reset(),P.write(k.data)});m(l),T.current!==null&&!j.current&&(j.current=!0,P.write(`\r
128
+ `).trim()}}function fN({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=y.useRef(null),_=y.useRef(null),j=y.useRef(!1),v=y.useRef(o);v.current=o;const C=y.useRef(c),T=y.useRef(s),[E,M]=y.useState("loading"),[G,F]=y.useState(!1);return y.useEffect(()=>{if(!b.current)return;let L=!1,Z=null;M("loading"),F(!1);const R=window.setTimeout(()=>{L||F(!0)},200);return(async()=>{var ke;let O;try{O=await cN()}catch{window.clearTimeout(R),L||M("error");return}if(L||!b.current)return;window.clearTimeout(R);const{Terminal:B,FitAddon:ne,WebLinksAddon:he}=O,P=new B({fontFamily:iN()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ue=new ne;P.loadAddon(ue),P.loadAddon(new he),P.open(b.current),_.current=P,P.attachCustomKeyEventHandler(k=>{if(k.type!=="keydown"||!(k.ctrlKey||k.metaKey))return!0;if(k.key==="`")return k.preventDefault(),!1;if(k.key==="c"||k.key==="C"){const ce=P.getSelection();return ce?(k.preventDefault(),ra(ce),!1):!k.shiftKey}return k.key==="v"||k.key==="V"?(k.preventDefault(),pp().then(ce=>{ce&&P.paste(ce)}),!1):!0});const _e=k=>{k.preventDefault();const V=P.getSelection();if(V){ra(V),P.clearSelection();return}pp().then(ce=>{ce&&P.paste(ce)})};(ke=P.element)==null||ke.addEventListener("contextmenu",_e);const De=P.onData(k=>d(l,k));let Ne={cols:P.cols,rows:P.rows},A=null;const fe=P.onResize(({cols:k,rows:V})=>{A!==null&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,!(k===Ne.cols&&V===Ne.rows)&&(Ne={cols:k,rows:V},h(l,k,V))},100)}),z=new ResizeObserver(()=>{try{ue.fit()}catch{return}v.current&&P.scrollToBottom()});z.observe(b.current);const pe=g(l,k=>{k.kind==="buffer"&&P.reset(),P.write(k.data)});m(l),T.current!==null&&!j.current&&(j.current=!0,P.write(`\r
129
129
  \x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
130
- `)),r&&P.focus(),Z=()=>{var k;A!==null&&window.clearTimeout(A),z.disconnect(),(k=P.element)==null||k.removeEventListener("contextmenu",_e),De.dispose(),fe.dispose(),pe(),P.dispose(),_.current=null},L("ready")})(),()=>{O=!0,window.clearTimeout(M),Z==null||Z(),Z=null}},[l]),y.useEffect(()=>{if(!o)return;const G=b.current;if(!G)return;let O=null,Z=0,M=!1;const D=P=>{P.pointerType==="mouse"||O!==null||(O=P.pointerId,Z=P.clientY,M=!1)},B=P=>{if(P.pointerId!==O)return;const ue=Z-P.clientY;if(!M){if(Math.abs(ue)<4)return;M=!0,G.setPointerCapture(P.pointerId)}Z=P.clientY;const _e=G.querySelector(".xterm-viewport");_e&&(_e.scrollTop+=ue)},ne=P=>{P.pointerId===O&&(G.hasPointerCapture(P.pointerId)&&G.releasePointerCapture(P.pointerId),O=null,M=!1)},he=P=>P.stopPropagation();return G.addEventListener("pointerdown",D),G.addEventListener("pointermove",B),G.addEventListener("pointerup",ne),G.addEventListener("pointercancel",ne),G.addEventListener("touchmove",he,{capture:!0}),()=>{G.removeEventListener("pointerdown",D),G.removeEventListener("pointermove",B),G.removeEventListener("pointerup",ne),G.removeEventListener("pointercancel",ne),G.removeEventListener("touchmove",he,{capture:!0}),O!==null&&G.hasPointerCapture(O)&&G.releasePointerCapture(O)}},[o]),y.useEffect(()=>{C.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var G;r&&((G=_.current)==null||G.focus())},[r]),y.useEffect(()=>{if(T.current=s,s===null){j.current=!1;return}if(j.current)return;const G=_.current;G&&(j.current=!0,G.write(`\r
130
+ `)),r&&P.focus(),Z=()=>{var k;A!==null&&window.clearTimeout(A),z.disconnect(),(k=P.element)==null||k.removeEventListener("contextmenu",_e),De.dispose(),fe.dispose(),pe(),P.dispose(),_.current=null},M("ready")})(),()=>{L=!0,window.clearTimeout(R),Z==null||Z(),Z=null}},[l]),y.useEffect(()=>{if(!o)return;const q=b.current;if(!q)return;let L=null,Z=0,R=!1;const O=P=>{P.pointerType==="mouse"||L!==null||(L=P.pointerId,Z=P.clientY,R=!1)},B=P=>{if(P.pointerId!==L)return;const ue=Z-P.clientY;if(!R){if(Math.abs(ue)<4)return;R=!0,q.setPointerCapture(P.pointerId)}Z=P.clientY;const _e=q.querySelector(".xterm-viewport");_e&&(_e.scrollTop+=ue)},ne=P=>{P.pointerId===L&&(q.hasPointerCapture(P.pointerId)&&q.releasePointerCapture(P.pointerId),L=null,R=!1)},he=P=>P.stopPropagation();return q.addEventListener("pointerdown",O),q.addEventListener("pointermove",B),q.addEventListener("pointerup",ne),q.addEventListener("pointercancel",ne),q.addEventListener("touchmove",he,{capture:!0}),()=>{q.removeEventListener("pointerdown",O),q.removeEventListener("pointermove",B),q.removeEventListener("pointerup",ne),q.removeEventListener("pointercancel",ne),q.removeEventListener("touchmove",he,{capture:!0}),L!==null&&q.hasPointerCapture(L)&&q.releasePointerCapture(L)}},[o]),y.useEffect(()=>{C.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var q;r&&((q=_.current)==null||q.focus())},[r]),y.useEffect(()=>{if(T.current=s,s===null){j.current=!1;return}if(j.current)return;const q=_.current;q&&(j.current=!0,q.write(`\r
131
131
  \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
132
- `))},[s]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:b,className:"termview__surface"+(E==="ready"?"":" is-hidden")}),E==="loading"&&$&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),E==="error"&&i.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[i.jsx("p",{children:"Не удалось загрузить терминал"}),i.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),i.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const uN=2e5,fN=75,dN=90;function hN({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??uN,o=Math.min(100,Math.round(l/c*100)),d=`${l.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
133
- обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return i.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[i.jsx("span",{className:"contextbar__label",children:"контекст"}),i.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`contextbar__fill${pN(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function pN(l){return l>=dN?" contextbar__fill--over":l>=fN?" contextbar__fill--warn":""}const l_="ccv:last-session",mN=300*1e3,gN=1e4;function bN(){try{const l=localStorage.getItem(l_);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function xN(l,s){const r=l.find(o=>o.id===s);if(r)return r;const c=l.filter(o=>C0(o.path).includes(s));return c.length===1?c[0]:void 0}function yN(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const _N={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Fx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],vN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Jx(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const d=l.slice(c+1).toLowerCase();return d===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>Wx(h.name,d)-Wx(m.name,d))}}function Wx(l,s){return l.toLowerCase().startsWith(s)?0:1}function Px(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function jN(){var wa,Hr;const l=y.useRef(null),[s,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[m,g]=y.useState(!1),b=y.useMemo(()=>Mf()==="relay",[]),[_,j]=y.useState([]),[v,C]=y.useState([]),[T,E]=y.useState([]),[L,$]=y.useState([]),[J,G]=y.useState([]),[O,Z]=y.useState([]),[M,D]=y.useState([]),[B,ne]=y.useState([]),[he,P]=y.useState([]),[ue,_e]=y.useState(null),[De,Ne]=y.useState(null),[A,fe]=y.useState(null),[z,pe]=y.useState(null),[ke,k]=y.useState(null),[V,ce]=y.useState(wl),[ge,Ae]=y.useState(zh),[Se,Te]=y.useState(!1),[Tt,Ye]=y.useState(!1),et=$f("(max-width: 860px)"),[Xe,Qt]=y.useState(!1);y.useEffect(()=>{et||Qt(!1)},[et]);const[tt,Yt]=y.useState(!1),[nt,en]=y.useState([]),[$t,tn]=y.useState(!1),[nn,pn]=y.useState(wl),[Sn,mn]=y.useState(null),[cn,Ke]=y.useState(null),[zt,gn]=y.useState([]),[ft,Je]=y.useState(null),[An,on]=y.useState(null),[wn,Pn]=y.useState([]),[Xt,wt]=y.useState([]),[Kt,Et]=y.useState([]),[Yn,le]=y.useState([]),[be,Le]=y.useState(null),[H,W]=y.useState({}),[xe,Be]=y.useState(null),[gt,Mn]=y.useState({}),[bn,Rn]=y.useState(null),[ul,gl]=y.useState([]),[ra,Ql]=y.useState(!1),[ps,Ms]=y.useState(null),[Dn,Kl]=y.useState(null),[bl,$n]=y.useState(!1),[Vt,$e]=y.useState(vN),[vt,xl]=y.useState(null),[lt,Zl]=y.useState(null),[Ut,el]=y.useState(!1),[kt,,Tl]=Z0(),ln=tv(),[kn,bt]=y.useState(!1),[Ze,On]=y.useState(null),[El,xn]=y.useState(null),[Nn,tl]=y.useState(null),[ms,yn]=y.useState(null),[Fl,fl]=y.useState(null),[nl,Ln]=y.useState(""),[Ht,Ia]=y.useState(null),[Hi,Rs]=y.useState([]),[Ds,yl]=y.useState(!1),[qa,zn]=y.useState(null),[gs,Jl]=y.useState(!1),[sn,Bt]=y.useState(!1),[me,N]=y.useState({}),[Y,ae]=y.useState([""]),[we,ve]=y.useState([]),[ze,ot]=y.useState(null),[un,Mt]=y.useState(null),[mt,fn]=y.useState(null),[It,ll]=y.useState(null),[bs,w]=y.useState(null),[ie,Me]=y.useState({}),[Fe,_n]=y.useState({}),[xs,ys]=y.useState(!1),[Os,Bi]=y.useState(null),[ca,vr]=y.useState(null),Ii=y.useRef(0),oa=y.useRef(null),[ua,Zn]=y.useState(!1),[Wl,Ls]=y.useState([]),[qi,jr]=y.useState(null),[Nc,Ga]=y.useState(null),zs=lv(),Ya=rv(et&&ua),$a=y.useRef(new Map),fa=(Dn==null?void 0:Dn.terminalEnabled)===!0,Sr=Mf()==="relay"&&((wa=d==null?void 0:d.shell)==null?void 0:wa.enabled)!==!0,Tc=y.useRef(!1),Ec=y.useCallback((p,I)=>($a.current.set(p,I),()=>{$a.current.get(p)===I&&$a.current.delete(p)}),[]),[da,wr]=y.useState(!1),[Vo,kr]=y.useState(null),[Qo,Gi]=y.useState(wl),[_s,Nr]=y.useState(null),[Yi,ha]=y.useState({}),pa=y.useRef([]),[an,Cc]=y.useState(null);function Kf(p){Cc(I=>I===p?null:p)}y.useEffect(()=>{(et||an==="terminal"&&!ua||an==="files"&&!sn||an==="search"&&!xs||an==="git"&&!kn||an==="ask"&&!da||an==="main"&&we.length===0)&&Cc(null)},[an,et,ua,sn,xs,kn,da,we.length]);const[Ko]=y.useState(bN),Ac=y.useRef(Ko),Tr=y.useRef(!1),Xn=y.useRef(null),$i=y.useRef(null),Xi=y.useRef(null),Zo=y.useRef(0),Un=y.useRef(null),Fo=y.useRef(0);Xn.current=z,Un.current=A,Fo.current=V.lastSeq;const Jo=y.useRef(ge);Jo.current=ge;const Il=y.useRef(null),Xa=y.useRef(0);Xa.current=Qo.lastSeq;const Er=y.useRef(null),Vi=y.useRef(""),Va=y.useRef(null),Us=y.useRef([]),Mc=y.useRef([""]);Us.current=we,Mc.current=Y;const Qa=y.useRef(new Map),vs=y.useRef(new Set),Qi=y.useRef(null),Ki=y.useRef(null),Wo=y.useRef(0),Ka=y.useRef(new Set);y.useEffect(()=>{const p=U0();if(!p)return;l.current=p;const I=()=>{r(p.connected),o(p.statusText)};p.onStatus(I),p.onReconnect(()=>{I(),Mn({});const xt=Xn.current;xt&&p.send({type:"session.sync",sessionId:xt,sinceSeq:Fo.current});const Zt=Il.current;Zt&&p.send({type:"session.sync",sessionId:Zt,sinceSeq:Xa.current})});const de=p.on(xt=>Po(xt));p.connect();const Ie=window.setInterval(()=>{I(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{de(),window.clearInterval(Ie),p.close()}},[]);const Po=y.useCallback(p=>{var I,de,Ie,xt,Zt,Dl,oi,ka,ui;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{j(p.workspaces),C(p.archived),fe(qe=>{var rs;if(qe)return qe;const dt=Ac.current,ut=dt&&xN(p.workspaces,dt.workspaceId);return dt&&ut&&ut.id!==dt.workspaceId&&(Ac.current={...dt,workspaceId:ut.id}),(ut==null?void 0:ut.id)??((rs=p.workspaces[0])==null?void 0:rs.id)??null});const ye=Va.current;if(!ye)break;const Ee=p.workspaces.find(qe=>EN(qe.path,ye));if(!Ee)break;Va.current=null,Yt(!1),fe(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==Vi.current)break;en(p.candidates),p.source==="host"&&tn(!1);break;case"finder.opened":Er.current=p.sessionId;break;case"workspace.roots":gn(p.roots);break;case"workspace.created":if(fe(p.workspace.id),p.warnings.length===0){Yt(!1),Ke(null);break}Je({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Un.current)break;Z(p.sessions),D(p.archived);break;case"folder.list":E(p.workspaceFolders),$(p.sessionFolders),G(p.pinnedFolders??[]);break;case"session.pinned":ne(p.sessions);break;case"session.live":P(p.sessions);break;case"order.state":Ne(p.order);break;case"session.summary":if(p.session.id===Er.current){mn(p.session);break}if(p.session.parentSessionId){p.session.id===Il.current&&Nr(p.session);break}if(P(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.session.id);if(p.session.state==="closed")return Ee===-1?ye:ye.filter(dt=>dt.id!==p.session.id);if(Ee===-1)return[...ye,p.session];const qe=ye.slice();return qe[Ee]=p.session,qe}),Z(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.session.id);if(Ee===-1)return[p.session,...ye];const qe=ye.slice();return qe[Ee]=p.session,qe}),ne(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.session.id);if(Ee===-1)return ye;const qe=ye.slice();return qe[Ee]={...p.session,pinned:!0,...ye[Ee].pinnedAt?{pinnedAt:ye[Ee].pinnedAt}:{}},qe}),Xn.current===null&&Xi.current&&Xi.current.workspaceId===p.session.workspaceId&&(cy(p.session.id,Xi.current.text),Xi.current=null),pe(ye=>ye??p.session.id),((I=$i.current)==null?void 0:I.sessionId)===p.session.id){const ye=$i.current;p.session.state==="error"?$i.current=null:p.session.state!=="closed"&&($i.current=null,(de=l.current)==null||de.send({type:"prompt.send",sessionId:ye.sessionId,text:ye.text,images:ye.images}))}break;case"usage.state":p.sessionId===Xn.current&&(xl(p.usage),el(!1));break;case"context.state":p.sessionId===Xn.current&&(Zl(p.context),el(!1));break;case"session.capabilities":p.sessionId===Xn.current&&k(p.capabilities);break;case"session.events":if(p.sessionId===Il.current){Gi(ye=>Rf(ye,p.entries));break}if(p.sessionId===Er.current){pn(ye=>Rf(ye,p.entries));break}if(p.sessionId!==Xn.current)break;for(const ye of p.entries){if(ye.event.kind!=="rewound")continue;const Ee=ye.event.toUserIndex,qe=Q0(Jo.current.entries,Ee),dt=qe.reduce((ut,rs)=>rs.event.kind==="user.message"?ut+1:ut,0);Ae(ut=>({...ut,entries:qe})),ce(ut=>({...ut,items:K0(ut.items,Ee,dt)}))}ce(ye=>Rf(ye,p.entries));break;case"session.history":if(p.sessionId!==Xn.current)break;Ae(ye=>$0(ye,p));break;case"side.opened":{if(p.parentSessionId!==Xn.current)break;Il.current=p.sessionId,kr(p.sessionId);const ye=pa.current;pa.current=[];for(const Ee of ye)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Xn.current)break;Il.current=null,kr(null),Gi(wl),Nr(null);break;case"git.state":if(p.workspaceId!==Un.current)break;On(p.state);break;case"git.commit":if(p.workspaceId!==Un.current)break;xn(p.detail);break;case"git.result":if(p.workspaceId!==Un.current)break;yn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(xn(null),tl(null),yl(!1),Jl(!1));break;case"git.busy":if(p.workspaceId!==Un.current)break;Ln(p.label);break;case"git.files":if(p.workspaceId!==Un.current)break;zn({files:p.files,truncated:p.truncated});break;case"github.status":Ia(p.status);break;case"github.owners":Rs(p.owners);break;case"fs.dir":if(p.workspaceId!==Un.current)break;N(ye=>({...ye,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Un.current)break;if(p.scope!=="tree"){const ye=p.scope;_n(Ee=>({...Ee,[ye]:{query:p.query,entries:p.entries}}));break}w({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Un.current)break;Bi({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Un.current)break;const ye=vs.current.delete(p.file.path);ve(qe=>{const dt=qe.findIndex(Qs=>Qs.path===p.file.path);if(dt===-1)return[...qe,bx(p.file,++Wo.current)];const ut=qe[dt],rs=qe.slice();return rs[dt]=ut.saved===p.file.content&&!Ua(ut)?{...ut,mtime:p.file.mtime,size:p.file.size,stale:!1}:bx(p.file,++Wo.current),rs}),ye&&ot(p.file.path);const Ee=oa.current;Ee&&Ee.path===p.file.path&&(oa.current=null,vr({...Ee,token:++Ii.current}));break}case"fs.media":{if(p.workspaceId!==Un.current)break;Ka.current.delete(p.path),ve(ye=>ye.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==Un.current)break;Ka.current.delete(p.path),ve(ye=>ye.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==Un.current)break;const ye=Qa.current.get(p.path);Qa.current.delete(p.path);const Ee=ye!==void 0;ve(dt=>dt.map(ut=>ut.path!==p.path?ut:Ee?{...ut,saved:ye,mtime:p.mtime,size:p.size,stale:!1}:{...ut,stale:!0}));const qe=Us.current.find(dt=>dt.path===p.path);!Ee&&qe&&!Ua(qe)&&((Ie=l.current)==null||Ie.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(xt=l.current)==null||xt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Un.current)break;if(Mt({ok:p.ok,message:p.message}),p.ok||Qa.current.delete(p.path),p.conflict&&ve(Ee=>Ee.map(qe=>qe.path===p.path?{...qe,stale:!0}:qe)),Ki.current===p.path){const Ee=Ki.current;Ki.current=null,p.ok&&(vs.current.add(Ee),(Zt=l.current)==null||Zt.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const ye=Qi.current;if(p.ok&&ye&&ye.to===p.path){Qi.current=null;const Ee=qe=>qe===ye.from?ye.to:qe.startsWith(`${ye.from}/`)?ye.to+qe.slice(ye.from.length):qe;ve(qe=>qe.map(dt=>({...dt,path:Ee(dt.path)}))),ot(qe=>qe===null?null:Ee(qe)),ae(qe=>qe.map(Ee)),N(qe=>{const dt={};for(const[ut,rs]of Object.entries(qe))ut===ye.from||ut.startsWith(`${ye.from}/`)||(dt[ut]=rs);return dt})}p.ok&&((Dl=l.current)==null||Dl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Un.current)break;Ls(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Un.current)break;Ga(null),Ls(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.terminal.id);if(Ee===-1)return[...ye,p.terminal];const qe=ye.slice();return qe[Ee]=p.terminal,qe}),Tc.current&&(Tc.current=!1,jr(p.terminal.id));break;case"term.buffer":(oi=$a.current.get(p.id))==null||oi({kind:"buffer",data:p.data});break;case"term.data":(ka=$a.current.get(p.id))==null||ka({kind:"data",data:p.data});break;case"term.exit":Ls(ye=>ye.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":Ls(ye=>ye.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===Xn.current&&Pn(p.servers);break;case"plugin.list":if(p.sessionId!==Xn.current)break;wt(p.plugins),Et(p.marketplaces),le(p.catalog);break;case"operation.result":p.sessionId===Xn.current&&Le(p.result);break;case"auth.status":Ms(p.status);break;case"relay.state":h(p.state);break;case"settings.state":Kl(p.settings);break;case"handoff.state":W(ye=>{if(!p.handoff){if(!(p.sessionId in ye))return ye;const Ee={...ye};return delete Ee[p.sessionId],Ee}return{...ye,[p.sessionId]:p.handoff}});break;case"handoff.written":Mn(ye=>{if(!(p.sessionId in ye))return ye;const Ee={...ye};return delete Ee[p.sessionId],Ee}),p.handoff&&Xn.current===p.sessionId?Rn(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Zo.current+=1,gl(ye=>[...ye,{id:Zo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":$e(p.state),p.state.active&&Ql(!0);break;case"session.closed":P(ye=>ye.filter(Ee=>Ee.id!==p.sessionId)),Z(ye=>ye.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Va.current=null,Ke(p.message)),(ui=p.context)!=null&&ui.startsWith("term.")&&Ga(p.message);break}},[]),ee=y.useCallback(p=>{var I;(I=l.current)==null||I.send(p)},[]);y.useEffect(()=>{A&&ee({type:"session.list",workspaceId:A})},[A,ee]),y.useEffect(()=>{s&&ee({type:"session.pins"})},[s,ee]),y.useEffect(()=>{s&&ee({type:"settings.get"})},[s,ee]),y.useEffect(()=>{if(s)return ee({type:"session.drafts",sessionIds:oy()}),q0(p=>ee({type:"session.drafts",sessionIds:p}))},[s,ee]),y.useEffect(()=>{if(Tr.current)return;const p=Ac.current;if(!p||!A)return;if(A!==p.workspaceId){Tr.current=!0;return}if(z){Tr.current=!0;return}if(O.length===0)return;const I=O.find(de=>yN(de,p));Tr.current=!0,I&&I.state!=="closed"&&ts(I)},[O,A,z]),y.useEffect(()=>{!A||Sr||!fa||ee({type:"term.list",workspaceId:A})},[A,Sr,fa,ee]),y.useEffect(()=>{jr(p=>{var I;return p&&Wl.some(de=>de.id===p)?p:((I=Wl[0])==null?void 0:I.id)??null})},[Wl]),y.useEffect(()=>{tt&&ee({type:"workspace.roots"})},[tt,ee]);const Pl=y.useCallback(()=>{const p=Xn.current;p&&(el(!0),ee({type:"usage.get",sessionId:p}),ee({type:"context.get",sessionId:p}))},[ee]);y.useEffect(()=>{if(!Ut)return;const p=window.setTimeout(()=>el(!1),gN);return()=>window.clearTimeout(p)},[Ut]);const Rc=y.useMemo(()=>{const p=Math.max((vt==null?void 0:vt.fetchedAt)??0,(lt==null?void 0:lt.fetchedAt)??0);return p>0?p:null},[vt==null?void 0:vt.fetchedAt,lt==null?void 0:lt.fetchedAt]);y.useEffect(()=>{if(Zl(null),!z)return;Pl();const p=()=>{document.hidden||Pl()},I=window.setInterval(p,mN),de=()=>{document.hidden||Pl()};return document.addEventListener("visibilitychange",de),()=>{window.clearInterval(I),document.removeEventListener("visibilitychange",de)}},[z,Pl]),y.useEffect(()=>{if(!z){Ae(zh);return}Ae({...zh,loading:!0}),ee({type:"session.history",sessionId:z})},[z,ee]);const Cr=y.useCallback(()=>{!z||ge.loading||!Db(ge)||(Ae(p=>({...p,loading:!0})),ee({type:"session.history",sessionId:z,before:fy(ge)}))},[z,ge,ee]),eu=y.useMemo(()=>X0(ge.entries),[ge.entries]),X=y.useMemo(()=>O.find(p=>p.id===z)??null,[O,z]),ma=z?(X==null?void 0:X.claudeSessionId)??z:null,ga=ma?H[ma]??null:null;y.useEffect(()=>{ma&&ee({type:"handoff.get",sessionId:ma})},[ma,ee]),y.useEffect(()=>{xe&&!(xe.sessionId in H)&&Be(null)},[H,xe]);const Dc=y.useMemo(()=>{var de;if(!vt)return null;const p=(((de=vt.buckets)==null?void 0:de.length)??0)>0,I=(X==null?void 0:X.provider)==="antigravity";return p===I?vt:null},[vt,X==null?void 0:X.provider]),Oc="Обновить лимиты и контекст",tu=Oc+(Rc?`
134
- обновлено в ${new Date(Rc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{document.documentElement.dataset.provider=(X==null?void 0:X.provider)??"claude"},[X==null?void 0:X.provider]),y.useEffect(()=>{(X==null?void 0:X.provider)==="antigravity"&&wr(!1)},[X==null?void 0:X.provider]);const Za=_.find(p=>p.id===A)??v.find(p=>p.id===A)??null;y.useEffect(()=>{if(!A||!z)return;const p={workspaceId:A,sessionId:z,claudeSessionId:(X==null?void 0:X.claudeSessionId)??null};try{localStorage.setItem(l_,JSON.stringify(p))}catch{}},[A,z,X==null?void 0:X.claudeSessionId]);function Zf(p){Va.current=p,Ke(null),ee({type:"workspace.open",path:p})}function Ff(p,I,de){Ke(null),ee({type:"workspace.create",parent:p,name:I,init:de})}function Jf(p){if(Vi.current=p,!p){en([]),tn(!1);return}tn(!0),ee({type:"workspace.find",query:p})}function Wf(p){Vi.current=p,pn(wl),ee({type:"workspace.find.agent",query:p})}function _l(){Yt(!1),Ke(null),Je(null),en([]),pn(wl),mn(null),Vi.current="",Va.current=null}function es(){const p=Xn.current;p&&Il.current&&ee({type:"side.reset",sessionId:p}),Il.current=null,kr(null),Gi(wl),Nr(null),ha({}),pa.current=[]}function nu(p){ee({type:"workspace.close",workspaceIds:p}),!(!A||!p.includes(A))&&(es(),fe(null),pe(null),Z([]),D([]),ce(wl),k(null),Ye(!1))}function lu(p,I){ee({type:"session.archive",workspaceId:p,sessionIds:I}),z&&(I.includes(z)||X!=null&&X.claudeSessionId&&I.includes(X.claudeSessionId))&&(es(),pe(null),ce(wl),k(null),Ye(!1))}function su(p){ee({type:"workspace.restore",workspaceIds:p})}function au(p,I,de){ee({type:"folder.create",scope:p,name:I,workspaceId:de})}function Lc(p,I){ee({type:"folder.rename",folderId:p,name:I})}function Pf(p,I){ee({type:"folder.setColor",folderId:p,color:I})}function Fa(p){ee({type:"folder.delete",folderId:p})}function zc(p,I,de,Ie){ee({type:"folder.assign",scope:p,itemId:I,folderId:de,workspaceId:Ie})}function Zi(p="claude"){A&&(es(),pe(null),k(null),ce(wl),Ye(!1),ee({type:"session.start",workspaceId:A,provider:p}),Te(!1))}function Fi(p){es(),qt(),fe(p),pe(null),ce(wl),k(null),Ye(!1),On(null),xn(null),tl(null),yn(null),Ln(""),yl(!1),zn(null),Jl(!1),Ls([]),jr(null)}function iu(p,I,de){ee({type:"session.pin",workspaceId:p,sessionIds:I,pinned:de})}function ba(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Hs(p){if(ba(p)){_e(p);return}ee({type:"session.close",sessionId:p.id})}function Uc(p,I,de){Ne(Ie=>{const xt=Ie??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!de)return Ie;const Zt={...xt.sessions};return I&&I.length>0?Zt[de]=I:delete Zt[de],{...xt,sessions:Zt}}return{...xt,[p]:I??[]}}),ee({type:"order.set",scope:p,ids:I,...de?{workspaceId:de}:{}})}function ru(p){p.workspaceId!==A&&Fi(p.workspaceId),ts(p)}function ts(p){if(Te(!1),es(),ce(wl),k(null),Ye(!1),p.state==="closed"){pe(null),ee({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}pe(p.id),ee({type:"session.sync",sessionId:p.id,sinceSeq:0})}function cu(p,I){if(z){if((X==null?void 0:X.state)==="closed"){$i.current={sessionId:X.id,text:p,images:I},ts(X);return}ee({type:"prompt.send",sessionId:z,text:p,images:I})}}function Hc(p){const I=he.find(de=>(de.claudeSessionId??de.id)===p.sessionId&&de.state!=="closed");ou(p.workspaceId,p.sessionId,p.text),I&&ee({type:"session.close",sessionId:I.id})}function Bc(p){ou(p.workspaceId,p.claudeSessionId??p.id,null)}function ou(p,I,de){Xi.current=de===null?null:{workspaceId:p,text:de},p!==A?Fi(p):(es(),pe(null),k(null),ce(wl),Ye(!1)),ee({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:I,...de===null?{}:{fromHandoff:!0}}),Te(!1)}y.useEffect(()=>{bn&&(Rn(null),Hc(bn))},[bn]);function uu(p){gt[p.id]||(Mn(I=>({...I,[p.id]:!0})),ee({type:"session.handoff",sessionId:p.id}))}function ed(p){ee({type:"handoff.dismiss",sessionId:p})}function Ic(p,I){ee({type:"session.rename",sessionId:p.id,title:I,workspaceId:p.workspaceId}),Z(de=>de.map(Ie=>Ie.id===p.id?{...Ie,title:I}:Ie))}function qc(p){z&&(Te(!1),Le(null),on(p),ee({type:"mcp.list",sessionId:z}),ee({type:"plugin.list",sessionId:z}))}const Gc={mcpAction:(p,I)=>{z&&(ee({type:"mcp.action",sessionId:z,name:p,action:I}),on(null))},mcpAdd:(p,I)=>{z&&ee({type:"mcp.add",sessionId:z,name:p,draft:I})},mcpRemove:p=>{z&&ee({type:"mcp.remove",sessionId:z,name:p})},pluginInstall:p=>{z&&ee({type:"plugin.install",sessionId:z,spec:p})},pluginUninstall:p=>{z&&ee({type:"plugin.uninstall",sessionId:z,id:p})},pluginToggle:(p,I)=>{z&&ee({type:"plugin.toggle",sessionId:z,id:p,enabled:I})},marketplaceAdd:p=>{z&&ee({type:"marketplace.add",sessionId:z,source:p})},marketplaceRemove:p=>{z&&ee({type:"marketplace.remove",sessionId:z,name:p})}};function Cl(){Te(!1),Ql(!0),ee({type:"auth.status"})}const Ja={login:(p,I)=>ee({type:"auth.login",mode:p,switchAccount:I}),submitCode:p=>ee({type:"auth.code",code:p}),cancel:()=>ee({type:"auth.cancel"}),logout:()=>ee({type:"auth.logout"})};function Al(){Te(!1),$n(!0),ee({type:"settings.get"})}function Wa(p){Kl(I=>I&&{...I,...p}),ee({type:"settings.update",settings:p})}function Yc(p){z&&ee({type:"side.ask",sessionId:z,text:p})}function Ar(){z&&(ee({type:"side.reset",sessionId:z}),Il.current=null,kr(null),Gi(wl),Nr(null),ha({}),pa.current=[])}function Bs(p){const I=Il.current;if(I){p(I);return}const de=Xn.current;de&&(pa.current.push(p),ee({type:"side.open",sessionId:de}))}function Mr(){A&&ee({type:"git.state",workspaceId:A})}function xa(p){A&&(tl(p),ee({type:"git.show",workspaceId:A,ref:p}))}function $c(p,I){yn(null),fl({target:p,label:I})}function Rr(){!A||!Fl||(ee({type:"git.checkout",workspaceId:A,target:Fl.target}),fl(null))}function Pa(){A&&(yn(null),ee({type:"git.push",workspaceId:A}))}function td(p){A&&(yn(null),ee({type:"git.pull",workspaceId:A,merge:p}))}function vl(){A&&(yn(null),zn(null),yl(!0),ee({type:"github.status"}),ee({type:"github.owners"}),ee({type:"git.files",workspaceId:A}))}function Xc(p){A&&(yn(null),ee({type:"git.publish",workspaceId:A,...p}))}function js(p){A&&(yn(null),ee({type:"git.remote",workspaceId:A,url:p}))}function fu(){yn(null),Jl(!0)}function Dr(p){ee({type:"github.token",token:p}),ee({type:"github.owners"})}function ya(){ee({type:"github.status"}),ee({type:"github.owners"})}y.useEffect(()=>{if(!(!sn||!A))for(const p of Y)p in me||ee({type:"fs.list",workspaceId:A,path:p})},[sn,Y,me,A,ee]);function Vc(p){ae(I=>I.includes(p)?I.filter(de=>de!==p):[...I,p])}function du(p){if(!p){w(null);return}A&&ee({type:"fs.search",workspaceId:A,query:p})}function Qc(p){if(!p){Bi(null);return}A&&ee({type:"fs.grep",workspaceId:A,query:p})}const Kc=y.useCallback((p,I)=>{Me(xt=>({...xt,[p]:I}));const de=Un.current;if(I===null||!de)return;const Ie=I.lastIndexOf("/");if(Ie!==-1){ee({type:"fs.list",workspaceId:de,path:I.slice(0,Ie)});return}if(I===""){ee({type:"fs.list",workspaceId:de,path:""});return}ee({type:"fs.search",workspaceId:de,query:I,scope:p})},[ee]),Ml=y.useMemo(()=>Jx(ie.mention??null,Fe.mention??null,me),[ie.mention,Fe.mention,me]),ei=y.useMemo(()=>Jx(ie.side??null,Fe.side??null,me),[ie.side,Fe.side,me]);function ti(p){_a(p.path,{line:p.line,column:p.column})}function Or(p){const I=[];let de=gr(p.path);for(;I.push(de),!!de;)de=gr(de);ae(Ie=>{const xt=new Set(Ie);for(const Zt of I)xt.add(Zt);return p.kind==="dir"&&xt.add(p.path),[...xt]}),p.kind==="file"&&_a(p.path)}function _a(p,I){if(Us.current.find(Ie=>Ie.path===p)){ot(p),I&&vr({path:p,...I,token:++Ii.current});return}A&&(I&&(oa.current={path:p,...I}),vs.current.add(p),ee({type:"fs.read",workspaceId:A,path:p}))}function dl(p,I=!1){const de=Us.current,Ie=de.find(Dl=>Dl.path===p);if(Ie&&Ua(Ie)&&!I){ll(p);return}ll(null);const xt=de.findIndex(Dl=>Dl.path===p),Zt=de.filter(Dl=>Dl.path!==p);ve(Zt),ot(Dl=>{var oi;return Dl===p?((oi=Zt[Math.min(xt,Zt.length-1)])==null?void 0:oi.path)??null:Dl})}function sl(p,I=!1){const de=Us.current.find(Ie=>Ie.path===p);!de||!A||!I&&!Ua(de)||(Qa.current.set(p,de.text),ee({type:"fs.write",workspaceId:A,path:p,content:de.text,eol:de.eol,encoding:de.encoding,baseMtime:de.mtime,...I?{force:!0}:{}}))}function Is(p){A&&ee({type:"fs.read",workspaceId:A,path:p})}function ns(p){A&&(Ka.current.has(p)||(Ka.current.add(p),ee({type:"fs.readMedia",workspaceId:A,path:p})))}const ls=y.useRef(new Map);function Ss(p){const I=ls.current,de=I.get(p);de&&clearTimeout(de);const Ie=(Dn==null?void 0:Dn.autoSaveAfterPauseMs)??0;Ie<=0||I.set(p,setTimeout(()=>{I.delete(p);const xt=Us.current.find(Zt=>Zt.path===p);xt&&Ua(xt)&&!xt.stale&&sl(p)},Ie))}function hu(p,I,de){if(!A)return;const Ie=p?`${p}/${de}`:de;Mt(null),I==="file"&&(Ki.current=Ie),ee({type:"fs.create",workspaceId:A,path:Ie,kind:I})}function Zc(p,I){if(!A)return;const de=gr(p),Ie=de?`${de}/${I}`:I;Mt(null),Qi.current={from:p,to:Ie},ee({type:"fs.rename",workspaceId:A,path:p,to:Ie})}function Fc(p,I){if(!A)return;const de=p.slice(p.lastIndexOf("/")+1),Ie=I?`${I}/${de}`:de;Ie!==p&&(Mt(null),Qi.current={from:p,to:Ie},ee({type:"fs.rename",workspaceId:A,path:p,to:Ie}))}function pu(p,I){A&&(Mt(null),ee({type:"fs.copy",workspaceId:A,path:p,toDir:I}))}function Vn(p){A&&(Mt(null),fn(null),ee({type:"fs.delete",workspaceId:A,path:p.path}),ve(I=>I.filter(de=>de.path!==p.path&&!de.path.startsWith(`${p.path}/`))),ot(I=>I&&(I===p.path||I.startsWith(`${p.path}/`))?null:I))}function qt(){N({}),ae([""]),ve([]),ot(null),Mt(null),w(null),Bi(null),Me({}),_n({}),vr(null),vs.current.clear(),Qa.current.clear(),Ka.current.clear(),oa.current=null,Qi.current=null,Ki.current=null}function st(){!A||Sr||!fa||(Ga(null),Tc.current=!0,ee({type:"term.open",workspaceId:A,cols:80,rows:24}))}function qs(p){ee({type:"term.close",id:p})}function Rl(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:I})}function Jc(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",answers:I})}function Gs(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function mu(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",plan:I})}function gu(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function p(I){if(I.key!=="Escape")return;if(an!==null){const Ie=I.target;if(!(Ie instanceof HTMLElement&&Ie.closest(".termview, .editor, .sidepane"))){Cc(null);return}}if(!z||V.pending.length>0)return;const de=I.target;de instanceof HTMLElement&&de.closest(".sidepane, .editor")||ee({type:"control.interrupt",sessionId:z})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[z,V.pending.length,ee,an]),y.useEffect(()=>{function p(I){I.key!=="`"||!(I.ctrlKey||I.metaKey)||fa&&(I.preventDefault(),Zn(de=>!de))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[fa]);const va=y.useMemo(()=>{const p=(ke==null?void 0:ke.commands)??[];return p.length===0||(X==null?void 0:X.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Fx]},[ke,X==null?void 0:X.provider]);function Ys(p){const I=_N[p];return I&&(X==null?void 0:X.provider)!=="antigravity"?(qc(I),!0):(X==null?void 0:X.provider)==="antigravity"||!Fx.some(de=>de.name===p)?!1:(Cl(),p==="logout"&&Ja.logout(),p==="switch-account"&&Ja.login("claudeai",!0),!0)}const ni=(X==null?void 0:X.state)==="waiting_permission",al=(X==null?void 0:X.state)==="reconnecting",jl=(X==null?void 0:X.state)==="running"||al||ni,Tn=V.pending[0]??null,ss=Tn?Nw(Tn.toolName,Tn.input):null;y.useEffect(()=>{!kn&&!sn||!A||jl||ee({type:"git.state",workspaceId:A})},[kn,sn,A,jl,ee]),y.useEffect(()=>{if(!(jl||!A)){sn&&N(p=>{const I={};for(const[de,Ie]of Object.entries(p))Mc.current.includes(de)||(I[de]=Ie);return I});for(const p of Us.current)Ua(p)||ee({type:"fs.read",workspaceId:A,path:p.path})}},[jl,A,sn,ee]);const as=(X==null?void 0:X.cwd)??(ke==null?void 0:ke.cwd)??null,is=(ke==null?void 0:ke.models)??[],li=(X==null?void 0:X.model)??(ke==null?void 0:ke.model)??null,{rows:Lr,selected:si}=Px(is,li),$s=_s?{model:_s.model,effort:_s.effort,ultracode:_s.ultracode,thinking:_s.thinking,switchOnFlag:_s.switchModelsOnFlag}:{model:Yi.model??li,effort:Yi.effort??(X==null?void 0:X.effort)??null,ultracode:Yi.ultracode??(X==null?void 0:X.ultracode)??!1,thinking:Yi.thinking??(X==null?void 0:X.thinking)??!0,switchOnFlag:Yi.switchOnFlag??(X==null?void 0:X.switchModelsOnFlag)??!0},Xs=Px(is,$s.model),Qn=(_s==null?void 0:_s.state)==="running",ai=ze?we.find(p=>p.path===ze)??null:null,bu=new Set(we.filter(Ua).map(p=>p.path)),Ji=p=>i.jsx(tN,{pane:p,width:ln.widths[p],onResize:I=>ln.setWidth(p,I),onReset:()=>ln.reset(p)}),ii=p=>et?null:()=>Kf(p),nd=(X==null?void 0:X.provider)==="antigravity"?J0:dy,dn=ke&&i.jsx(Cs,{title:"Режим прав",value:(X==null?void 0:X.permissionMode)??"default",options:nd.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{z&&ee({type:"control.set_mode",sessionId:z,mode:p})}}),zr=Lr.length>0?i.jsx(Jy,{models:Lr,value:si,effort:(X==null?void 0:X.effort)??null,ultracode:(X==null?void 0:X.ultracode)??!1,thinking:(X==null?void 0:X.thinking)??!0,switchOnFlag:(X==null?void 0:X.switchModelsOnFlag)??!0,showSwitchOnFlag:(X==null?void 0:X.provider)!=="antigravity",onModel:p=>{!z||!p||ee({type:"control.set_model",sessionId:z,model:p})},onEffort:p=>{z&&ee({type:"control.set_effort",sessionId:z,effort:p})},onUltracode:p=>{z&&ee({type:"control.set_ultracode",sessionId:z,enabled:p})},onThinking:p=>{z&&ee({type:"control.set_thinking",sessionId:z,enabled:p})},onSwitchOnFlag:p=>{z&&ee({type:"control.set_flag_switch",sessionId:z,enabled:p})}}):li&&i.jsx("span",{className:"badge",children:li}),Wi=jl&&i.jsx("span",{className:ni?"badge badge--wait":"badge badge--live",children:ni?"ждёт":al?"переподключается":"работает"}),Pi=(X==null?void 0:X.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Ur=Wi||Pi,ja=()=>{z&&ee({type:"session.reconnect",sessionId:z})},ri=al?"Сессия уже поднимает новый процесс":jl?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",ld=z&&(al||(X==null?void 0:X.state)==="error")?i.jsxs("div",{className:al?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),al?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:al?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ja,children:al?"Переподключить сейчас":"Переподключить"})]}):null,xu=ga?i.jsx(Kk,{handoff:ga,onContinue:()=>Hc(ga),onShow:()=>Be(ga),onDismiss:()=>ed(ga.sessionId)}):null,Wc=X&&X.totalCostUsd>0?`$${X.totalCostUsd.toFixed(3)}`:null,Pc=(X==null?void 0:X.provider)!=="antigravity"&&i.jsx("button",{className:da?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":da,onClick:()=>wr(p=>!p),children:i.jsx(AN,{})}),Sa=X&&X.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Hs(X),children:i.jsx(NN,{})}),Vs=X?gt[X.id]===!0:!1,ci=gy({onLongPress:()=>{X&&Bc(X)},onClick:()=>{X&&uu(X)},disabled:Vs}),yu=X&&X.state!=="closed"&&X.provider!=="antigravity"&&i.jsxs("button",{type:"button",className:Vs?"pane-btn pane-btn--handoff is-busy":ci.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${ci.thresholdMs}ms`},title:Vs?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Vs,disabled:Vs,...ci.handlers,children:[i.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),i.jsx(TN,{})]});return i.jsxs("div",{className:"app",style:ln.style,children:[i.jsx(eS,{open:Se,connected:s,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:T,sessionFolders:L.filter(p=>p.workspaceId===A),pinnedFolders:J,sessions:O.filter(p=>p.workspaceId===A),archived:M.filter(p=>p.workspaceId===A),pinned:B,live:he,listOrder:De,liveSessionsFirst:(Dn==null?void 0:Dn.liveSessionsFirst)===!0,onReorder:Uc,activeWorkspaceId:A,activeSessionId:z,onPinSessions:iu,onSelectPinned:ru,onCloseWorkspaces:nu,onRestoreWorkspaces:su,onArchiveSessions:lu,onUnarchiveSessions:p=>{A&&ee({type:"session.unarchive",workspaceId:A,sessionIds:p})},onCreateFolder:au,onRenameFolder:Lc,onSetFolderColor:Pf,onDeleteFolder:Fa,onAssignToFolder:zc,onSelectWorkspace:Fi,onSelectSession:ts,onRenameSession:Ic,onStopSession:Hs,onOpenWorkspace:()=>Yt(!0),onNewSession:Zi,onOpenExtensions:z&&(X==null?void 0:X.provider)!=="antigravity"?()=>qc("mcp"):null,account:ps,onOpenAccount:Cl,relay:d,onOpenRelay:b?null:()=>g(!0),onOpenSettings:Al,themeMode:kt,onCycleTheme:Tl}),Ji("sidebar"),Se&&i.jsx("div",{className:"scrim",onClick:()=>Te(!1)}),i.jsx(dj,{open:sn,tree:me,expanded:new Set(Y),activePath:ze,dirty:bu,gitChanges:(Ze==null?void 0:Ze.changed)??[],result:un,searchResult:bs,onSearch:du,onReveal:Or,onToggle:Vc,onOpen:_a,onCreate:hu,onRename:Zc,onMove:Fc,onCopy:pu,onDelete:fn,onRefresh:()=>{Mt(null),N({}),Mr()},onClose:()=>Bt(!1),zoomed:an==="files",onToggleZoom:ii("files")}),sn&&an!=="files"&&Ji("files"),i.jsx(jj,{open:xs,result:Os,onSearch:Qc,onOpenMatch:ti,onClose:()=>ys(!1),zoomed:an==="search",onToggleZoom:ii("search")}),xs&&an!=="search"&&Ji("search"),i.jsx(qw,{open:kn,state:Ze,result:ms,selected:Nn,busy:nl,onRefresh:Mr,onShow:xa,onCheckout:$c,onPush:Pa,onPull:td,onPublish:vl,onConnectRemote:fu,onDismissResult:()=>yn(null),onClose:()=>bt(!1),zoomed:an==="git",onToggleZoom:ii("git")}),kn&&an!=="git"&&Ji("git"),i.jsxs("main",{className:an==="main"||an==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Te(!0),children:"☰"}),i.jsx("button",{className:sn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":sn,onClick:()=>{Bt(p=>!p),bt(!1),ys(!1)},children:i.jsx(SN,{})}),i.jsx("button",{className:xs?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":xs,onClick:()=>{ys(p=>!p),Bt(!1),bt(!1)},children:i.jsx(wN,{})}),i.jsx("button",{className:kn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":kn,onClick:()=>{bt(p=>!p),Bt(!1),ys(!1)},children:i.jsx(kN,{})}),fa&&i.jsx("button",{className:ua?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ua,onClick:()=>Zn(p=>!p),children:i.jsx(CN,{})}),et&&Pc,et&&i.jsx("button",{className:Xe?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Xe,onClick:()=>Qt(!0),children:i.jsx(MN,{})}),i.jsxs("div",{className:"topbar__id",children:[Tt&&X?i.jsx(aa,{className:"rename--title",value:X.title??"",onCommit:p=>{Ic(X,p),Ye(!1)},onCancel:()=>Ye(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!X||et,title:X&&!et?"Переименовать сессию":void 0,onClick:()=>Ye(!0),children:(X==null?void 0:X.title)??"Claude Code Visual"}),Za&&i.jsx("span",{className:"topbar__project",title:Za.path,children:Za.name})]}),et?Ur:as&&i.jsx(Fy,{path:as})]}),!et&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:Ut?"meters-refresh is-busy":"meters-refresh",title:tu,"aria-label":Oc,"aria-busy":Ut,disabled:!z||Ut,onClick:Pl,children:i.jsx(RN,{})}),i.jsx(Py,{usage:Dc}),i.jsx(n_,{}),dn,zr,Ur,Wc&&i.jsx("span",{className:"badge badge--cost",children:Wc}),yu,Sa,Pc]})]}),i.jsx(hN,{tokens:(lt==null?void 0:lt.tokens)??V.contextTokens,maxTokens:(lt==null?void 0:lt.maxTokens)??null,fetchedAt:(lt==null?void 0:lt.fetchedAt)??null}),et&&Xe&&i.jsx(xk,{onClose:()=>Qt(!1),permission:dn,model:zr,usage:Dc,cwd:as,costLabel:Wc,onRefresh:Pl,refreshing:Ut,metersFetchedAt:Rc,onRename:X?()=>{Ye(!0),Qt(!1)}:null,onHandoff:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{uu(X),Qt(!1)}:null,onFreshSession:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{Bc(X),Qt(!1)}:null,handoffWriting:Vs,onStop:X&&X.state!=="closed"?()=>{Hs(X),Qt(!1)}:null}),we.length>0&&i.jsx(qj,{files:we,activePath:ze,busy:jl,onSelect:ot,onClose:p=>dl(p),zoomed:an==="main",onToggleZoom:ii("main")}),ai?i.jsx(Bj,{file:ai,goto:(ca==null?void 0:ca.path)===ai.path?ca:null,onChange:(p,I)=>{ve(de=>de.map(Ie=>Ie.path===p?{...Ie,text:I}:Ie)),Ss(p)},onSave:p=>sl(p),onReload:Is,onOverwrite:p=>sl(p,!0),onRequestMedia:ns,onTogglePreview:p=>ve(I=>I.map(de=>de.path===p?{...de,previewMode:!de.previewMode}:de))}):i.jsxs(i.Fragment,{children:[i.jsx(Op,{items:V.items,busy:jl&&!al,waiting:ni,empty:(X==null?void 0:X.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:eu,historyHasMore:Db(ge),historyLoading:ge.loading,onLoadHistory:Cr,sessionId:z??void 0,onEditMessage:(X==null?void 0:X.provider)==="antigravity"?void 0:(p,I,de)=>{z&&ee({type:"prompt.edit",sessionId:z,userIndex:p,text:I,images:de})}}),ld,xu,z&&((Hr=X==null?void 0:X.tasks)!=null&&Hr.length)?i.jsx(Vj,{tasks:X.tasks,onStop:p=>ee({type:"task.stop",sessionId:z,taskId:p})}):null,i.jsx(Ky,{disabled:!z,busy:jl&&!al,placeholder:al?"Промпт уйдёт, как только связь вернётся":(X==null?void 0:X.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:va,sessionTitle:(X==null?void 0:X.title)??null,contextResult:Ml,draftKey:z,onContextSearch:p=>Kc("mention",p),onCommand:Ys,onSend:cu,onInterrupt:()=>{z&&ee({type:"control.interrupt",sessionId:z})}})]}),ua&&fa&&i.jsxs(i.Fragment,{children:[!et&&an!=="terminal"&&i.jsx(lN,{height:zs.height,onResize:zs.setHeight,onReset:zs.reset}),i.jsx(rN,{mobile:et,zoomed:an==="terminal",onToggleZoom:ii("terminal"),terminals:Wl,activeId:qi,blocked:Sr,error:Nc,onDismissError:()=>Ga(null),height:et?Ya.height:zs.height,offset:et?{top:Ya.offsetTop,left:Ya.offsetLeft}:void 0,onSelect:jr,onOpen:st,onClose:qs,onInput:(p,I)=>ee({type:"term.input",id:p,data:I}),onResize:(p,I,de)=>ee({type:"term.resize",id:p,cols:I,rows:de}),onAttach:p=>ee({type:"term.attach",id:p}),onHide:()=>Zn(!1),registerSink:Ec})]})]}),i.jsx(ck,{open:da,items:Qo.items,busy:Qn,ready:z!==null,commands:va,contextResult:ei,draftKey:z,models:Xs.rows,model:Xs.selected,effort:$s.effort,ultracode:$s.ultracode,thinking:$s.thinking,switchOnFlag:$s.switchOnFlag,onContextSearch:p=>Kc("side",p),onCommand:Ys,onModel:p=>{p&&(ha(I=>({...I,model:p})),Bs(I=>ee({type:"control.set_model",sessionId:I,model:p})))},onEffort:p=>{ha(I=>({...I,effort:p,ultracode:!1})),Bs(I=>ee({type:"control.set_effort",sessionId:I,effort:p}))},onUltracode:p=>{ha(I=>({...I,ultracode:p,...p?{effort:"xhigh"}:{}})),Bs(I=>ee({type:"control.set_ultracode",sessionId:I,enabled:p}))},onThinking:p=>{ha(I=>({...I,thinking:p})),Bs(I=>ee({type:"control.set_thinking",sessionId:I,enabled:p}))},onSwitchOnFlag:p=>{ha(I=>({...I,switchOnFlag:p})),Bs(I=>ee({type:"control.set_flag_switch",sessionId:I,enabled:p}))},onAsk:Yc,onInterrupt:()=>{Vo&&ee({type:"control.interrupt",sessionId:Vo})},onReset:Ar,onClose:()=>wr(!1),zoomed:an==="ask",onToggleZoom:ii("ask")}),da&&an!=="ask"&&Ji("ask"),(kn||da||sn||xs)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{bt(!1),wr(!1),Bt(!1),ys(!1)}}),El&&i.jsx($w,{detail:El,local:((Ze==null?void 0:Ze.hasRemote)??!1)&&(Ze==null?void 0:Ze.commits.some(p=>p.hash===El.hash&&!p.pushed))===!0,onCheckout:$c,onClose:()=>{xn(null),tl(null)}}),ue&&i.jsx(Nl,{title:"Остановить сессию?",onClose:()=>_e(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>_e(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{ee({type:"session.close",sessionId:ue.id}),_e(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Fl&&i.jsxs(Nl,{title:"Переключить рабочее дерево?",onClose:()=>fl(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>fl(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:Rr,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",Fl.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),jl&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Ze&&Ze.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Ze.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Ds&&i.jsx(nk,{status:Ht,owners:Hi,files:qa,defaultName:(Za==null?void 0:Za.name)??"",hasCommits:Ze===null||Ze.head!=="",busy:nl,result:ms,onRefreshStatus:ya,onSaveToken:Dr,onPublish:Xc,onDismissResult:()=>yn(null),onClose:()=>yl(!1)}),gs&&i.jsx(rk,{busy:nl,result:ms,onSubmit:js,onDismissResult:()=>yn(null),onClose:()=>Jl(!1)}),mt&&i.jsx(Nl,{title:mt.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>fn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>fn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Vn(mt),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[mt.path," будет удалён с диска",mt.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),It&&i.jsx(Nl,{title:"Закрыть без сохранения?",onClose:()=>ll(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>ll(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>dl(It,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{sl(It),dl(It,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",It," есть несохранённые правки."]})}),An&&i.jsx(_k,{tab:An,servers:wn,plugins:Xt,marketplaces:Kt,catalog:Yn,result:be,actions:Gc,onTab:on,onClose:()=>on(null)}),ra&&i.jsx(Ek,{status:ps,login:Vt,actions:Ja,remote:b,runningSessions:O.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:z?()=>{ja(),Ql(!1)}:null,reconnectBlocked:jl,reconnectHint:ri,onClose:()=>Ql(!1)}),m&&i.jsx(Dk,{state:d,onPair:(p,I)=>ee({type:"relay.pair",code:p,...I?{name:I}:{}}),onUnpair:()=>ee({type:"relay.unpair"}),onClose:()=>g(!1)}),bl&&i.jsx(Vk,{settings:Dn,models:(ke==null?void 0:ke.models)??[],relayState:d,local:Mf()==="local",onChange:Wa,onEnableShell:()=>ee({type:"relay.shell.enable"}),onDisableShell:()=>ee({type:"relay.shell.disable"}),onOpenRelay:()=>{$n(!1),g(!0)},onClose:()=>$n(!1)}),tt&&i.jsx(Aw,{candidates:nt,searching:$t,agentItems:nn.items,agentBusy:(Sn==null?void 0:Sn.state)==="running",error:cn,roots:zt,created:ft,onSearch:Jf,onAskAgent:Wf,onInterrupt:()=>{const p=Er.current;p&&ee({type:"control.interrupt",sessionId:p})},onSubmit:Zf,onCreate:Ff,onClose:_l}),Tn!=null&&Tn.questions&&Tn.questions.length>0?i.jsx(_w,{request:{...Tn,questions:Tn.questions},queued:V.pending.length-1,onAnswer:Jc,onDecline:Gs}):Tn&&ss!==null?i.jsx(Sw,{request:Tn,plan:ss,queued:V.pending.length-1,onAccept:mu,onDecline:gu}):Tn&&i.jsx(yw,{request:Tn,queued:V.pending.length-1,onDecide:Rl}),xe&&i.jsx(Zk,{handoff:xe,onClose:()=>Be(null)}),i.jsx(Wk,{notices:ul,onDismiss:p=>gl(I=>I.filter(de=>de.id!==p))})]})}function SN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),i.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function wN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function kN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function NN(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:i.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function TN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),i.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),i.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function EN(l,s){return ey(l)===ey(s)}function ey(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function CN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),i.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),i.jsx("path",{d:"M8.2 10h3.1"})]})}function AN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function MN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function RN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const s_=document.getElementById("root");if(!s_)throw new Error("#root not found");T0.createRoot(s_).render(i.jsx(y.StrictMode,{children:i.jsx(jN,{})}));export{A1 as D,Jt as I,Pt as N,LN as P,ds as T,As as a,Ay as b,Bl as c,ON as d,Ly as e,Go as f,Z1 as h,zN as p,UN as s,Ce as t};
132
+ `))},[s]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:b,className:"termview__surface"+(E==="ready"?"":" is-hidden")}),E==="loading"&&G&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),E==="error"&&i.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[i.jsx("p",{children:"Не удалось загрузить терминал"}),i.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),i.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const dN=2e5,hN=75,pN=90;function mN({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??dN,o=Math.min(100,Math.round(l/c*100)),d=`${l.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
133
+ обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return i.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[i.jsx("span",{className:"contextbar__label",children:"контекст"}),i.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`contextbar__fill${gN(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function gN(l){return l>=pN?" contextbar__fill--over":l>=hN?" contextbar__fill--warn":""}const l_="ccv:last-session",bN=300*1e3,xN=1e4;function yN(){try{const l=localStorage.getItem(l_);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function _N(l,s){const r=l.find(o=>o.id===s);if(r)return r;const c=l.filter(o=>C0(o.path).includes(s));return c.length===1?c[0]:void 0}function vN(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const jN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Fx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],SN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Jx(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const d=l.slice(c+1).toLowerCase();return d===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>Wx(h.name,d)-Wx(m.name,d))}}function Wx(l,s){return l.toLowerCase().startsWith(s)?0:1}function Px(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function wN(){var ka,Br;const l=y.useRef(null),[s,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[m,g]=y.useState(!1),b=y.useMemo(()=>Rf()==="relay",[]),[_,j]=y.useState([]),[v,C]=y.useState([]),[T,E]=y.useState([]),[M,G]=y.useState([]),[F,q]=y.useState([]),[L,Z]=y.useState([]),[R,O]=y.useState([]),[B,ne]=y.useState([]),[he,P]=y.useState([]),[ue,_e]=y.useState(null),[De,Ne]=y.useState(null),[A,fe]=y.useState(null),[z,pe]=y.useState(null),[ke,k]=y.useState(null),[V,ce]=y.useState(wl),[ge,Ae]=y.useState(Uh),[Se,Te]=y.useState(!1),[Tt,Ye]=y.useState(!1),et=Xf("(max-width: 860px)"),[Xe,Qt]=y.useState(!1);y.useEffect(()=>{et||Qt(!1)},[et]);const[tt,Yt]=y.useState(!1),[nt,en]=y.useState([]),[$t,tn]=y.useState(!1),[nn,pn]=y.useState(wl),[Sn,mn]=y.useState(null),[cn,Ke]=y.useState(null),[zt,gn]=y.useState([]),[ft,Je]=y.useState(null),[An,on]=y.useState(null),[wn,Pn]=y.useState([]),[Xt,wt]=y.useState([]),[Kt,Et]=y.useState([]),[Yn,le]=y.useState([]),[be,Le]=y.useState(null),[H,W]=y.useState({}),[xe,Be]=y.useState(null),[gt,Mn]=y.useState({}),[bn,Rn]=y.useState(null),[ul,gl]=y.useState([]),[ca,Ql]=y.useState(!1),[ps,Ms]=y.useState(null),[Dn,Kl]=y.useState(null),[bl,$n]=y.useState(!1),[Vt,$e]=y.useState(SN),[vt,xl]=y.useState(null),[lt,Zl]=y.useState(null),[Ut,el]=y.useState(!1),[kt,,Tl]=Z0(),ln=tv(),[kn,bt]=y.useState(!1),[Ze,On]=y.useState(null),[El,xn]=y.useState(null),[Nn,tl]=y.useState(null),[ms,yn]=y.useState(null),[Fl,fl]=y.useState(null),[nl,Ln]=y.useState(""),[Ht,qa]=y.useState(null),[Ii,Rs]=y.useState([]),[Ds,yl]=y.useState(!1),[Ga,zn]=y.useState(null),[gs,Jl]=y.useState(!1),[sn,Bt]=y.useState(!1),[me,N]=y.useState({}),[$,ae]=y.useState([""]),[we,ve]=y.useState([]),[ze,ot]=y.useState(null),[un,Mt]=y.useState(null),[mt,fn]=y.useState(null),[It,ll]=y.useState(null),[bs,w]=y.useState(null),[ie,Me]=y.useState({}),[Fe,_n]=y.useState({}),[xs,ys]=y.useState(!1),[Os,qi]=y.useState(null),[oa,jr]=y.useState(null),Gi=y.useRef(0),ua=y.useRef(null),[fa,Zn]=y.useState(!1),[Wl,Ls]=y.useState([]),[Yi,Sr]=y.useState(null),[Tc,Ya]=y.useState(null),zs=lv(),$a=rv(et&&fa),Xa=y.useRef(new Map),da=(Dn==null?void 0:Dn.terminalEnabled)===!0,wr=Rf()==="relay"&&((ka=d==null?void 0:d.shell)==null?void 0:ka.enabled)!==!0,Ec=y.useRef(!1),Cc=y.useCallback((p,I)=>(Xa.current.set(p,I),()=>{Xa.current.get(p)===I&&Xa.current.delete(p)}),[]),[ha,kr]=y.useState(!1),[Qo,Nr]=y.useState(null),[Ko,$i]=y.useState(wl),[_s,Tr]=y.useState(null),[Xi,pa]=y.useState({}),ma=y.useRef([]),[an,Ac]=y.useState(null);function Zf(p){Ac(I=>I===p?null:p)}y.useEffect(()=>{(et||an==="terminal"&&!fa||an==="files"&&!sn||an==="search"&&!xs||an==="git"&&!kn||an==="ask"&&!ha||an==="main"&&we.length===0)&&Ac(null)},[an,et,fa,sn,xs,kn,ha,we.length]);const[Zo]=y.useState(yN),Mc=y.useRef(Zo),Er=y.useRef(!1),Xn=y.useRef(null),Vi=y.useRef(null),Qi=y.useRef(null),Fo=y.useRef(0),Un=y.useRef(null),Jo=y.useRef(0);Xn.current=z,Un.current=A,Jo.current=V.lastSeq;const Wo=y.useRef(ge);Wo.current=ge;const Il=y.useRef(null),Va=y.useRef(0);Va.current=Ko.lastSeq;const Cr=y.useRef(null),Ki=y.useRef(""),Qa=y.useRef(null),Us=y.useRef([]),Rc=y.useRef([""]);Us.current=we,Rc.current=$;const Ka=y.useRef(new Map),vs=y.useRef(new Set),Zi=y.useRef(null),Fi=y.useRef(null),Po=y.useRef(0),Za=y.useRef(new Set);y.useEffect(()=>{const p=U0();if(!p)return;l.current=p;const I=()=>{r(p.connected),o(p.statusText)};p.onStatus(I),p.onReconnect(()=>{I(),Mn({});const xt=Xn.current;xt&&p.send({type:"session.sync",sessionId:xt,sinceSeq:Jo.current});const Zt=Il.current;Zt&&p.send({type:"session.sync",sessionId:Zt,sinceSeq:Va.current})});const de=p.on(xt=>eu(xt));p.connect();const Ie=window.setInterval(()=>{I(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{de(),window.clearInterval(Ie),p.close()}},[]);const eu=y.useCallback(p=>{var I,de,Ie,xt,Zt,Dl,ui,Na,fi;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{j(p.workspaces),C(p.archived),fe(qe=>{var rs;if(qe)return qe;const dt=Mc.current,ut=dt&&_N(p.workspaces,dt.workspaceId);return dt&&ut&&ut.id!==dt.workspaceId&&(Mc.current={...dt,workspaceId:ut.id}),(ut==null?void 0:ut.id)??((rs=p.workspaces[0])==null?void 0:rs.id)??null});const ye=Qa.current;if(!ye)break;const Ee=p.workspaces.find(qe=>AN(qe.path,ye));if(!Ee)break;Qa.current=null,Yt(!1),fe(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==Ki.current)break;en(p.candidates),p.source==="host"&&tn(!1);break;case"finder.opened":Cr.current=p.sessionId;break;case"workspace.roots":gn(p.roots);break;case"workspace.created":if(fe(p.workspace.id),p.warnings.length===0){Yt(!1),Ke(null);break}Je({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Un.current)break;Z(p.sessions),O(p.archived);break;case"folder.list":E(p.workspaceFolders),G(p.sessionFolders),q(p.pinnedFolders??[]);break;case"session.pinned":ne(p.sessions);break;case"session.live":P(p.sessions);break;case"order.state":Ne(p.order);break;case"session.summary":if(p.session.id===Cr.current){mn(p.session);break}if(p.session.parentSessionId){p.session.id===Il.current&&Tr(p.session);break}if(P(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.session.id);if(p.session.state==="closed")return Ee===-1?ye:ye.filter(dt=>dt.id!==p.session.id);if(Ee===-1)return[...ye,p.session];const qe=ye.slice();return qe[Ee]=p.session,qe}),Z(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.session.id);if(Ee===-1)return[p.session,...ye];const qe=ye.slice();return qe[Ee]=p.session,qe}),ne(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.session.id);if(Ee===-1)return ye;const qe=ye.slice();return qe[Ee]={...p.session,pinned:!0,...ye[Ee].pinnedAt?{pinnedAt:ye[Ee].pinnedAt}:{}},qe}),Xn.current===null&&Qi.current&&Qi.current.workspaceId===p.session.workspaceId&&(cy(p.session.id,Qi.current.text),Qi.current=null),pe(ye=>ye??p.session.id),((I=Vi.current)==null?void 0:I.sessionId)===p.session.id){const ye=Vi.current;p.session.state==="error"?Vi.current=null:p.session.state!=="closed"&&(Vi.current=null,(de=l.current)==null||de.send({type:"prompt.send",sessionId:ye.sessionId,text:ye.text,images:ye.images}))}break;case"usage.state":p.sessionId===Xn.current&&(xl(p.usage),el(!1));break;case"context.state":p.sessionId===Xn.current&&(Zl(p.context),el(!1));break;case"session.capabilities":p.sessionId===Xn.current&&k(p.capabilities);break;case"session.events":if(p.sessionId===Il.current){$i(ye=>Df(ye,p.entries));break}if(p.sessionId===Cr.current){pn(ye=>Df(ye,p.entries));break}if(p.sessionId!==Xn.current)break;for(const ye of p.entries){if(ye.event.kind!=="rewound")continue;const Ee=ye.event.toUserIndex,qe=Q0(Wo.current.entries,Ee),dt=qe.reduce((ut,rs)=>rs.event.kind==="user.message"?ut+1:ut,0);Ae(ut=>({...ut,entries:qe})),ce(ut=>({...ut,items:K0(ut.items,Ee,dt)}))}ce(ye=>Df(ye,p.entries));break;case"session.history":if(p.sessionId!==Xn.current)break;Ae(ye=>$0(ye,p));break;case"side.opened":{if(p.parentSessionId!==Xn.current)break;Il.current=p.sessionId,Nr(p.sessionId);const ye=ma.current;ma.current=[];for(const Ee of ye)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Xn.current)break;Il.current=null,Nr(null),$i(wl),Tr(null);break;case"git.state":if(p.workspaceId!==Un.current)break;On(p.state);break;case"git.commit":if(p.workspaceId!==Un.current)break;xn(p.detail);break;case"git.result":if(p.workspaceId!==Un.current)break;yn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(xn(null),tl(null),yl(!1),Jl(!1));break;case"git.busy":if(p.workspaceId!==Un.current)break;Ln(p.label);break;case"git.files":if(p.workspaceId!==Un.current)break;zn({files:p.files,truncated:p.truncated});break;case"github.status":qa(p.status);break;case"github.owners":Rs(p.owners);break;case"fs.dir":if(p.workspaceId!==Un.current)break;N(ye=>({...ye,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Un.current)break;if(p.scope!=="tree"){const ye=p.scope;_n(Ee=>({...Ee,[ye]:{query:p.query,entries:p.entries}}));break}w({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Un.current)break;qi({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Un.current)break;const ye=vs.current.delete(p.file.path);ve(qe=>{const dt=qe.findIndex(Qs=>Qs.path===p.file.path);if(dt===-1)return[...qe,bx(p.file,++Po.current)];const ut=qe[dt],rs=qe.slice();return rs[dt]=ut.saved===p.file.content&&!Ha(ut)?{...ut,mtime:p.file.mtime,size:p.file.size,stale:!1}:bx(p.file,++Po.current),rs}),ye&&ot(p.file.path);const Ee=ua.current;Ee&&Ee.path===p.file.path&&(ua.current=null,jr({...Ee,token:++Gi.current}));break}case"fs.media":{if(p.workspaceId!==Un.current)break;Za.current.delete(p.path),ve(ye=>ye.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==Un.current)break;Za.current.delete(p.path),ve(ye=>ye.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==Un.current)break;const ye=Ka.current.get(p.path);Ka.current.delete(p.path);const Ee=ye!==void 0;ve(dt=>dt.map(ut=>ut.path!==p.path?ut:Ee?{...ut,saved:ye,mtime:p.mtime,size:p.size,stale:!1}:{...ut,stale:!0}));const qe=Us.current.find(dt=>dt.path===p.path);!Ee&&qe&&!Ha(qe)&&((Ie=l.current)==null||Ie.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(xt=l.current)==null||xt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Un.current)break;if(Mt({ok:p.ok,message:p.message}),p.ok||Ka.current.delete(p.path),p.conflict&&ve(Ee=>Ee.map(qe=>qe.path===p.path?{...qe,stale:!0}:qe)),Fi.current===p.path){const Ee=Fi.current;Fi.current=null,p.ok&&(vs.current.add(Ee),(Zt=l.current)==null||Zt.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const ye=Zi.current;if(p.ok&&ye&&ye.to===p.path){Zi.current=null;const Ee=qe=>qe===ye.from?ye.to:qe.startsWith(`${ye.from}/`)?ye.to+qe.slice(ye.from.length):qe;ve(qe=>qe.map(dt=>({...dt,path:Ee(dt.path)}))),ot(qe=>qe===null?null:Ee(qe)),ae(qe=>qe.map(Ee)),N(qe=>{const dt={};for(const[ut,rs]of Object.entries(qe))ut===ye.from||ut.startsWith(`${ye.from}/`)||(dt[ut]=rs);return dt})}p.ok&&((Dl=l.current)==null||Dl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Un.current)break;Ls(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Un.current)break;Ya(null),Ls(ye=>{const Ee=ye.findIndex(dt=>dt.id===p.terminal.id);if(Ee===-1)return[...ye,p.terminal];const qe=ye.slice();return qe[Ee]=p.terminal,qe}),Ec.current&&(Ec.current=!1,Sr(p.terminal.id));break;case"term.buffer":(ui=Xa.current.get(p.id))==null||ui({kind:"buffer",data:p.data});break;case"term.data":(Na=Xa.current.get(p.id))==null||Na({kind:"data",data:p.data});break;case"term.exit":Ls(ye=>ye.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":Ls(ye=>ye.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===Xn.current&&Pn(p.servers);break;case"plugin.list":if(p.sessionId!==Xn.current)break;wt(p.plugins),Et(p.marketplaces),le(p.catalog);break;case"operation.result":p.sessionId===Xn.current&&Le(p.result);break;case"auth.status":Ms(p.status);break;case"relay.state":h(p.state);break;case"settings.state":Kl(p.settings);break;case"handoff.state":W(ye=>{if(!p.handoff){if(!(p.sessionId in ye))return ye;const Ee={...ye};return delete Ee[p.sessionId],Ee}return{...ye,[p.sessionId]:p.handoff}});break;case"handoff.written":Mn(ye=>{if(!(p.sessionId in ye))return ye;const Ee={...ye};return delete Ee[p.sessionId],Ee}),p.handoff&&Xn.current===p.sessionId?Rn(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Fo.current+=1,gl(ye=>[...ye,{id:Fo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":$e(p.state),p.state.active&&Ql(!0);break;case"session.closed":P(ye=>ye.filter(Ee=>Ee.id!==p.sessionId)),Z(ye=>ye.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Qa.current=null,Ke(p.message)),(fi=p.context)!=null&&fi.startsWith("term.")&&Ya(p.message);break}},[]),ee=y.useCallback(p=>{var I;(I=l.current)==null||I.send(p)},[]);y.useEffect(()=>{A&&ee({type:"session.list",workspaceId:A})},[A,ee]),y.useEffect(()=>{s&&ee({type:"session.pins"})},[s,ee]),y.useEffect(()=>{s&&ee({type:"settings.get"})},[s,ee]),y.useEffect(()=>{if(s)return ee({type:"session.drafts",sessionIds:oy()}),q0(p=>ee({type:"session.drafts",sessionIds:p}))},[s,ee]),y.useEffect(()=>{if(Er.current)return;const p=Mc.current;if(!p||!A)return;if(A!==p.workspaceId){Er.current=!0;return}if(z){Er.current=!0;return}if(L.length===0)return;const I=L.find(de=>vN(de,p));Er.current=!0,I&&I.state!=="closed"&&ts(I)},[L,A,z]),y.useEffect(()=>{!A||wr||!da||ee({type:"term.list",workspaceId:A})},[A,wr,da,ee]),y.useEffect(()=>{Sr(p=>{var I;return p&&Wl.some(de=>de.id===p)?p:((I=Wl[0])==null?void 0:I.id)??null})},[Wl]),y.useEffect(()=>{tt&&ee({type:"workspace.roots"})},[tt,ee]);const Pl=y.useCallback(()=>{const p=Xn.current;p&&(el(!0),ee({type:"usage.get",sessionId:p}),ee({type:"context.get",sessionId:p}))},[ee]);y.useEffect(()=>{if(!Ut)return;const p=window.setTimeout(()=>el(!1),xN);return()=>window.clearTimeout(p)},[Ut]);const Dc=y.useMemo(()=>{const p=Math.max((vt==null?void 0:vt.fetchedAt)??0,(lt==null?void 0:lt.fetchedAt)??0);return p>0?p:null},[vt==null?void 0:vt.fetchedAt,lt==null?void 0:lt.fetchedAt]);y.useEffect(()=>{if(Zl(null),!z)return;Pl();const p=()=>{document.hidden||Pl()},I=window.setInterval(p,bN),de=()=>{document.hidden||Pl()};return document.addEventListener("visibilitychange",de),()=>{window.clearInterval(I),document.removeEventListener("visibilitychange",de)}},[z,Pl]),y.useEffect(()=>{if(!z){Ae(Uh);return}Ae({...Uh,loading:!0}),ee({type:"session.history",sessionId:z})},[z,ee]);const Ar=y.useCallback(()=>{!z||ge.loading||!Db(ge)||(Ae(p=>({...p,loading:!0})),ee({type:"session.history",sessionId:z,before:fy(ge)}))},[z,ge,ee]),tu=y.useMemo(()=>X0(ge.entries),[ge.entries]),X=y.useMemo(()=>L.find(p=>p.id===z)??null,[L,z]),ga=z?(X==null?void 0:X.claudeSessionId)??z:null,ba=ga?H[ga]??null:null;y.useEffect(()=>{ga&&ee({type:"handoff.get",sessionId:ga})},[ga,ee]),y.useEffect(()=>{xe&&!(xe.sessionId in H)&&Be(null)},[H,xe]);const Oc=y.useMemo(()=>{var de;if(!vt)return null;const p=(((de=vt.buckets)==null?void 0:de.length)??0)>0,I=(X==null?void 0:X.provider)==="antigravity";return p===I?vt:null},[vt,X==null?void 0:X.provider]),Lc="Обновить лимиты и контекст",nu=Lc+(Dc?`
134
+ обновлено в ${new Date(Dc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{document.documentElement.dataset.provider=(X==null?void 0:X.provider)??"claude"},[X==null?void 0:X.provider]),y.useEffect(()=>{(X==null?void 0:X.provider)==="antigravity"&&kr(!1)},[X==null?void 0:X.provider]);const Fa=_.find(p=>p.id===A)??v.find(p=>p.id===A)??null;y.useEffect(()=>{if(!A||!z)return;const p={workspaceId:A,sessionId:z,claudeSessionId:(X==null?void 0:X.claudeSessionId)??null};try{localStorage.setItem(l_,JSON.stringify(p))}catch{}},[A,z,X==null?void 0:X.claudeSessionId]);function Ff(p){Qa.current=p,Ke(null),ee({type:"workspace.open",path:p})}function Jf(p,I,de){Ke(null),ee({type:"workspace.create",parent:p,name:I,init:de})}function Wf(p){if(Ki.current=p,!p){en([]),tn(!1);return}tn(!0),ee({type:"workspace.find",query:p})}function Pf(p){Ki.current=p,pn(wl),ee({type:"workspace.find.agent",query:p})}function _l(){Yt(!1),Ke(null),Je(null),en([]),pn(wl),mn(null),Ki.current="",Qa.current=null}function es(){const p=Xn.current;p&&Il.current&&ee({type:"side.reset",sessionId:p}),Il.current=null,Nr(null),$i(wl),Tr(null),pa({}),ma.current=[]}function lu(p){ee({type:"workspace.close",workspaceIds:p}),!(!A||!p.includes(A))&&(es(),fe(null),pe(null),Z([]),O([]),ce(wl),k(null),Ye(!1))}function su(p,I){ee({type:"session.archive",workspaceId:p,sessionIds:I}),z&&(I.includes(z)||X!=null&&X.claudeSessionId&&I.includes(X.claudeSessionId))&&(es(),pe(null),ce(wl),k(null),Ye(!1))}function au(p){ee({type:"workspace.restore",workspaceIds:p})}function iu(p,I,de){ee({type:"folder.create",scope:p,name:I,workspaceId:de})}function zc(p,I){ee({type:"folder.rename",folderId:p,name:I})}function ed(p,I){ee({type:"folder.setColor",folderId:p,color:I})}function Ja(p){ee({type:"folder.delete",folderId:p})}function Uc(p,I,de,Ie){ee({type:"folder.assign",scope:p,itemId:I,folderId:de,workspaceId:Ie})}function Ji(p="claude"){A&&(es(),pe(null),k(null),ce(wl),Ye(!1),ee({type:"session.start",workspaceId:A,provider:p}),Te(!1))}function Wi(p){es(),qt(),fe(p),pe(null),ce(wl),k(null),Ye(!1),On(null),xn(null),tl(null),yn(null),Ln(""),yl(!1),zn(null),Jl(!1),Ls([]),Sr(null)}function ru(p,I,de){ee({type:"session.pin",workspaceId:p,sessionIds:I,pinned:de})}function xa(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Hs(p){if(xa(p)){_e(p);return}ee({type:"session.close",sessionId:p.id})}function Hc(p,I,de){Ne(Ie=>{const xt=Ie??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!de)return Ie;const Zt={...xt.sessions};return I&&I.length>0?Zt[de]=I:delete Zt[de],{...xt,sessions:Zt}}return{...xt,[p]:I??[]}}),ee({type:"order.set",scope:p,ids:I,...de?{workspaceId:de}:{}})}function cu(p){p.workspaceId!==A&&Wi(p.workspaceId),ts(p)}function ts(p){if(Te(!1),es(),ce(wl),k(null),Ye(!1),p.state==="closed"){pe(null),ee({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}pe(p.id),ee({type:"session.sync",sessionId:p.id,sinceSeq:0})}function ou(p,I){if(z){if((X==null?void 0:X.state)==="closed"){Vi.current={sessionId:X.id,text:p,images:I},ts(X);return}ee({type:"prompt.send",sessionId:z,text:p,images:I})}}function Bc(p){const I=he.find(de=>(de.claudeSessionId??de.id)===p.sessionId&&de.state!=="closed");uu(p.workspaceId,p.sessionId,p.text),I&&ee({type:"session.close",sessionId:I.id})}function Ic(p){uu(p.workspaceId,p.claudeSessionId??p.id,null)}function uu(p,I,de){Qi.current=de===null?null:{workspaceId:p,text:de},p!==A?Wi(p):(es(),pe(null),k(null),ce(wl),Ye(!1)),ee({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:I,...de===null?{}:{fromHandoff:!0}}),Te(!1)}y.useEffect(()=>{bn&&(Rn(null),Bc(bn))},[bn]);function fu(p){gt[p.id]||(Mn(I=>({...I,[p.id]:!0})),ee({type:"session.handoff",sessionId:p.id}))}function td(p){ee({type:"handoff.dismiss",sessionId:p})}function qc(p,I){ee({type:"session.rename",sessionId:p.id,title:I,workspaceId:p.workspaceId}),Z(de=>de.map(Ie=>Ie.id===p.id?{...Ie,title:I}:Ie))}function Gc(p){z&&(Te(!1),Le(null),on(p),ee({type:"mcp.list",sessionId:z}),ee({type:"plugin.list",sessionId:z}))}const Yc={mcpAction:(p,I)=>{z&&(ee({type:"mcp.action",sessionId:z,name:p,action:I}),on(null))},mcpAdd:(p,I)=>{z&&ee({type:"mcp.add",sessionId:z,name:p,draft:I})},mcpRemove:p=>{z&&ee({type:"mcp.remove",sessionId:z,name:p})},pluginInstall:p=>{z&&ee({type:"plugin.install",sessionId:z,spec:p})},pluginUninstall:p=>{z&&ee({type:"plugin.uninstall",sessionId:z,id:p})},pluginToggle:(p,I)=>{z&&ee({type:"plugin.toggle",sessionId:z,id:p,enabled:I})},marketplaceAdd:p=>{z&&ee({type:"marketplace.add",sessionId:z,source:p})},marketplaceRemove:p=>{z&&ee({type:"marketplace.remove",sessionId:z,name:p})}};function Cl(){Te(!1),Ql(!0),ee({type:"auth.status"})}const Wa={login:(p,I)=>ee({type:"auth.login",mode:p,switchAccount:I}),submitCode:p=>ee({type:"auth.code",code:p}),cancel:()=>ee({type:"auth.cancel"}),logout:()=>ee({type:"auth.logout"})};function Al(){Te(!1),$n(!0),ee({type:"settings.get"})}function Pa(p){Kl(I=>I&&{...I,...p}),ee({type:"settings.update",settings:p})}function $c(p){z&&ee({type:"side.ask",sessionId:z,text:p})}function Mr(){z&&(ee({type:"side.reset",sessionId:z}),Il.current=null,Nr(null),$i(wl),Tr(null),pa({}),ma.current=[])}function Bs(p){const I=Il.current;if(I){p(I);return}const de=Xn.current;de&&(ma.current.push(p),ee({type:"side.open",sessionId:de}))}function Rr(){A&&ee({type:"git.state",workspaceId:A})}function ya(p){A&&(tl(p),ee({type:"git.show",workspaceId:A,ref:p}))}function Xc(p,I){yn(null),fl({target:p,label:I})}function Dr(){!A||!Fl||(ee({type:"git.checkout",workspaceId:A,target:Fl.target}),fl(null))}function ei(){A&&(yn(null),ee({type:"git.push",workspaceId:A}))}function nd(p){A&&(yn(null),ee({type:"git.pull",workspaceId:A,merge:p}))}function vl(){A&&(yn(null),zn(null),yl(!0),ee({type:"github.status"}),ee({type:"github.owners"}),ee({type:"git.files",workspaceId:A}))}function Vc(p){A&&(yn(null),ee({type:"git.publish",workspaceId:A,...p}))}function js(p){A&&(yn(null),ee({type:"git.remote",workspaceId:A,url:p}))}function du(){yn(null),Jl(!0)}function Or(p){ee({type:"github.token",token:p}),ee({type:"github.owners"})}function _a(){ee({type:"github.status"}),ee({type:"github.owners"})}y.useEffect(()=>{if(!(!sn||!A))for(const p of $)p in me||ee({type:"fs.list",workspaceId:A,path:p})},[sn,$,me,A,ee]);function Qc(p){ae(I=>I.includes(p)?I.filter(de=>de!==p):[...I,p])}function hu(p){if(!p){w(null);return}A&&ee({type:"fs.search",workspaceId:A,query:p})}function Kc(p){if(!p){qi(null);return}A&&ee({type:"fs.grep",workspaceId:A,query:p})}const Zc=y.useCallback((p,I)=>{Me(xt=>({...xt,[p]:I}));const de=Un.current;if(I===null||!de)return;const Ie=I.lastIndexOf("/");if(Ie!==-1){ee({type:"fs.list",workspaceId:de,path:I.slice(0,Ie)});return}if(I===""){ee({type:"fs.list",workspaceId:de,path:""});return}ee({type:"fs.search",workspaceId:de,query:I,scope:p})},[ee]),Ml=y.useMemo(()=>Jx(ie.mention??null,Fe.mention??null,me),[ie.mention,Fe.mention,me]),ti=y.useMemo(()=>Jx(ie.side??null,Fe.side??null,me),[ie.side,Fe.side,me]);function ni(p){va(p.path,{line:p.line,column:p.column})}function Lr(p){const I=[];let de=br(p.path);for(;I.push(de),!!de;)de=br(de);ae(Ie=>{const xt=new Set(Ie);for(const Zt of I)xt.add(Zt);return p.kind==="dir"&&xt.add(p.path),[...xt]}),p.kind==="file"&&va(p.path)}function va(p,I){if(Us.current.find(Ie=>Ie.path===p)){ot(p),I&&jr({path:p,...I,token:++Gi.current});return}A&&(I&&(ua.current={path:p,...I}),vs.current.add(p),ee({type:"fs.read",workspaceId:A,path:p}))}function dl(p,I=!1){const de=Us.current,Ie=de.find(Dl=>Dl.path===p);if(Ie&&Ha(Ie)&&!I){ll(p);return}ll(null);const xt=de.findIndex(Dl=>Dl.path===p),Zt=de.filter(Dl=>Dl.path!==p);ve(Zt),ot(Dl=>{var ui;return Dl===p?((ui=Zt[Math.min(xt,Zt.length-1)])==null?void 0:ui.path)??null:Dl})}function sl(p,I=!1){const de=Us.current.find(Ie=>Ie.path===p);!de||!A||!I&&!Ha(de)||(Ka.current.set(p,de.text),ee({type:"fs.write",workspaceId:A,path:p,content:de.text,eol:de.eol,encoding:de.encoding,baseMtime:de.mtime,...I?{force:!0}:{}}))}function Is(p){A&&ee({type:"fs.read",workspaceId:A,path:p})}function ns(p){A&&(Za.current.has(p)||(Za.current.add(p),ee({type:"fs.readMedia",workspaceId:A,path:p})))}const ls=y.useRef(new Map);function Ss(p){const I=ls.current,de=I.get(p);de&&clearTimeout(de);const Ie=(Dn==null?void 0:Dn.autoSaveAfterPauseMs)??0;Ie<=0||I.set(p,setTimeout(()=>{I.delete(p);const xt=Us.current.find(Zt=>Zt.path===p);xt&&Ha(xt)&&!xt.stale&&sl(p)},Ie))}function pu(p,I,de){if(!A)return;const Ie=p?`${p}/${de}`:de;Mt(null),I==="file"&&(Fi.current=Ie),ee({type:"fs.create",workspaceId:A,path:Ie,kind:I})}function Fc(p,I){if(!A)return;const de=br(p),Ie=de?`${de}/${I}`:I;Mt(null),Zi.current={from:p,to:Ie},ee({type:"fs.rename",workspaceId:A,path:p,to:Ie})}function Jc(p,I){if(!A)return;const de=p.slice(p.lastIndexOf("/")+1),Ie=I?`${I}/${de}`:de;Ie!==p&&(Mt(null),Zi.current={from:p,to:Ie},ee({type:"fs.rename",workspaceId:A,path:p,to:Ie}))}function mu(p,I){A&&(Mt(null),ee({type:"fs.copy",workspaceId:A,path:p,toDir:I}))}function Vn(p){A&&(Mt(null),fn(null),ee({type:"fs.delete",workspaceId:A,path:p.path}),ve(I=>I.filter(de=>de.path!==p.path&&!de.path.startsWith(`${p.path}/`))),ot(I=>I&&(I===p.path||I.startsWith(`${p.path}/`))?null:I))}function qt(){N({}),ae([""]),ve([]),ot(null),Mt(null),w(null),qi(null),Me({}),_n({}),jr(null),vs.current.clear(),Ka.current.clear(),Za.current.clear(),ua.current=null,Zi.current=null,Fi.current=null}function st(){!A||wr||!da||(Ya(null),Ec.current=!0,ee({type:"term.open",workspaceId:A,cols:80,rows:24}))}function qs(p){ee({type:"term.close",id:p})}function Rl(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:I})}function Wc(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",answers:I})}function Gs(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function gu(p,I){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",plan:I})}function bu(p){z&&ee({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function p(I){if(I.key!=="Escape")return;if(an!==null){const Ie=I.target;if(!(Ie instanceof HTMLElement&&Ie.closest(".termview, .editor, .sidepane"))){Ac(null);return}}if(!z||V.pending.length>0)return;const de=I.target;de instanceof HTMLElement&&de.closest(".sidepane, .editor")||ee({type:"control.interrupt",sessionId:z})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[z,V.pending.length,ee,an]),y.useEffect(()=>{function p(I){I.key!=="`"||!(I.ctrlKey||I.metaKey)||da&&(I.preventDefault(),Zn(de=>!de))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[da]);const ja=y.useMemo(()=>{const p=(ke==null?void 0:ke.commands)??[];return p.length===0||(X==null?void 0:X.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Fx]},[ke,X==null?void 0:X.provider]);function Ys(p){const I=jN[p];return I&&(X==null?void 0:X.provider)!=="antigravity"?(Gc(I),!0):(X==null?void 0:X.provider)==="antigravity"||!Fx.some(de=>de.name===p)?!1:(Cl(),p==="logout"&&Wa.logout(),p==="switch-account"&&Wa.login("claudeai",!0),!0)}const li=(X==null?void 0:X.state)==="waiting_permission",al=(X==null?void 0:X.state)==="reconnecting",jl=(X==null?void 0:X.state)==="running"||al||li,Tn=V.pending[0]??null,ss=Tn?Nw(Tn.toolName,Tn.input):null;y.useEffect(()=>{!kn&&!sn||!A||jl||ee({type:"git.state",workspaceId:A})},[kn,sn,A,jl,ee]),y.useEffect(()=>{if(!(jl||!A)){sn&&N(p=>{const I={};for(const[de,Ie]of Object.entries(p))Rc.current.includes(de)||(I[de]=Ie);return I});for(const p of Us.current)Ha(p)||ee({type:"fs.read",workspaceId:A,path:p.path})}},[jl,A,sn,ee]);const as=(X==null?void 0:X.cwd)??(ke==null?void 0:ke.cwd)??null,is=(ke==null?void 0:ke.models)??[],si=(X==null?void 0:X.model)??(ke==null?void 0:ke.model)??null,{rows:zr,selected:ai}=Px(is,si),$s=_s?{model:_s.model,effort:_s.effort,ultracode:_s.ultracode,thinking:_s.thinking,switchOnFlag:_s.switchModelsOnFlag}:{model:Xi.model??si,effort:Xi.effort??(X==null?void 0:X.effort)??null,ultracode:Xi.ultracode??(X==null?void 0:X.ultracode)??!1,thinking:Xi.thinking??(X==null?void 0:X.thinking)??!0,switchOnFlag:Xi.switchOnFlag??(X==null?void 0:X.switchModelsOnFlag)??!0},Xs=Px(is,$s.model),Qn=(_s==null?void 0:_s.state)==="running",ii=ze?we.find(p=>p.path===ze)??null:null,xu=new Set(we.filter(Ha).map(p=>p.path)),Pi=p=>i.jsx(lN,{pane:p,width:ln.widths[p],onResize:I=>ln.setWidth(p,I),onReset:()=>ln.reset(p)}),ri=p=>et?null:()=>Zf(p),ld=(X==null?void 0:X.provider)==="antigravity"?J0:dy,dn=ke&&i.jsx(Cs,{title:"Режим прав",value:(X==null?void 0:X.permissionMode)??"default",options:ld.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{z&&ee({type:"control.set_mode",sessionId:z,mode:p})}}),Ur=zr.length>0?i.jsx(Jy,{models:zr,value:ai,effort:(X==null?void 0:X.effort)??null,ultracode:(X==null?void 0:X.ultracode)??!1,thinking:(X==null?void 0:X.thinking)??!0,switchOnFlag:(X==null?void 0:X.switchModelsOnFlag)??!0,showSwitchOnFlag:(X==null?void 0:X.provider)!=="antigravity",onModel:p=>{!z||!p||ee({type:"control.set_model",sessionId:z,model:p})},onEffort:p=>{z&&ee({type:"control.set_effort",sessionId:z,effort:p})},onUltracode:p=>{z&&ee({type:"control.set_ultracode",sessionId:z,enabled:p})},onThinking:p=>{z&&ee({type:"control.set_thinking",sessionId:z,enabled:p})},onSwitchOnFlag:p=>{z&&ee({type:"control.set_flag_switch",sessionId:z,enabled:p})}}):si&&i.jsx("span",{className:"badge",children:si}),er=jl&&i.jsx("span",{className:li?"badge badge--wait":"badge badge--live",children:li?"ждёт":al?"переподключается":"работает"}),tr=(X==null?void 0:X.state)==="closed"&&i.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Hr=er||tr,Sa=()=>{z&&ee({type:"session.reconnect",sessionId:z})},ci=al?"Сессия уже поднимает новый процесс":jl?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",sd=z&&(al||(X==null?void 0:X.state)==="error")?i.jsxs("div",{className:al?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),al?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:al?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Sa,children:al?"Переподключить сейчас":"Переподключить"})]}):null,yu=ba?i.jsx(Fk,{handoff:ba,onContinue:()=>Bc(ba),onShow:()=>Be(ba),onDismiss:()=>td(ba.sessionId)}):null,Pc=X&&X.totalCostUsd>0?`$${X.totalCostUsd.toFixed(3)}`:null,eo=(X==null?void 0:X.provider)!=="antigravity"&&i.jsx("button",{className:ha?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":ha,onClick:()=>kr(p=>!p),children:i.jsx(RN,{})}),wa=X&&X.state!=="closed"&&i.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Hs(X),children:i.jsx(EN,{})}),Vs=X?gt[X.id]===!0:!1,oi=gy({onLongPress:()=>{X&&Ic(X)},onClick:()=>{X&&fu(X)},disabled:Vs}),_u=X&&X.state!=="closed"&&X.provider!=="antigravity"&&i.jsxs("button",{type:"button",className:Vs?"pane-btn pane-btn--handoff is-busy":oi.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${oi.thresholdMs}ms`},title:Vs?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Vs,disabled:Vs,...oi.handlers,children:[i.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),i.jsx(CN,{})]});return i.jsxs("div",{className:"app",style:ln.style,children:[i.jsx(eS,{open:Se,connected:s,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:T,sessionFolders:M.filter(p=>p.workspaceId===A),pinnedFolders:F,sessions:L.filter(p=>p.workspaceId===A),archived:R.filter(p=>p.workspaceId===A),pinned:B,live:he,listOrder:De,liveSessionsFirst:(Dn==null?void 0:Dn.liveSessionsFirst)===!0,onReorder:Hc,activeWorkspaceId:A,activeSessionId:z,onPinSessions:ru,onSelectPinned:cu,onCloseWorkspaces:lu,onRestoreWorkspaces:au,onArchiveSessions:su,onUnarchiveSessions:p=>{A&&ee({type:"session.unarchive",workspaceId:A,sessionIds:p})},onCreateFolder:iu,onRenameFolder:zc,onSetFolderColor:ed,onDeleteFolder:Ja,onAssignToFolder:Uc,onSelectWorkspace:Wi,onSelectSession:ts,onRenameSession:qc,onStopSession:Hs,onOpenWorkspace:()=>Yt(!0),onNewSession:Ji,onOpenExtensions:z&&(X==null?void 0:X.provider)!=="antigravity"?()=>Gc("mcp"):null,account:ps,onOpenAccount:Cl,relay:d,onOpenRelay:b?null:()=>g(!0),onOpenSettings:Al,themeMode:kt,onCycleTheme:Tl}),Pi("sidebar"),Se&&i.jsx("div",{className:"scrim",onClick:()=>Te(!1)}),i.jsx(dj,{open:sn,tree:me,expanded:new Set($),activePath:ze,dirty:xu,gitChanges:(Ze==null?void 0:Ze.changed)??[],result:un,searchResult:bs,onSearch:hu,onReveal:Lr,onToggle:Qc,onOpen:va,onCreate:pu,onRename:Fc,onMove:Jc,onCopy:mu,onDelete:fn,onRefresh:()=>{Mt(null),N({}),Rr()},onClose:()=>Bt(!1),zoomed:an==="files",onToggleZoom:ri("files")}),sn&&an!=="files"&&Pi("files"),i.jsx(jj,{open:xs,result:Os,onSearch:Kc,onOpenMatch:ni,onClose:()=>ys(!1),zoomed:an==="search",onToggleZoom:ri("search")}),xs&&an!=="search"&&Pi("search"),i.jsx(qw,{open:kn,state:Ze,result:ms,selected:Nn,busy:nl,onRefresh:Rr,onShow:ya,onCheckout:Xc,onPush:ei,onPull:nd,onPublish:vl,onConnectRemote:du,onDismissResult:()=>yn(null),onClose:()=>bt(!1),zoomed:an==="git",onToggleZoom:ri("git")}),kn&&an!=="git"&&Pi("git"),i.jsxs("main",{className:an==="main"||an==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Te(!0),children:"☰"}),i.jsx("button",{className:sn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":sn,onClick:()=>{Bt(p=>!p),bt(!1),ys(!1)},children:i.jsx(kN,{})}),i.jsx("button",{className:xs?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":xs,onClick:()=>{ys(p=>!p),Bt(!1),bt(!1)},children:i.jsx(NN,{})}),i.jsx("button",{className:kn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":kn,onClick:()=>{bt(p=>!p),Bt(!1),ys(!1)},children:i.jsx(TN,{})}),da&&i.jsx("button",{className:fa?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":fa,onClick:()=>Zn(p=>!p),children:i.jsx(MN,{})}),et&&eo,et&&i.jsx("button",{className:Xe?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Xe,onClick:()=>Qt(!0),children:i.jsx(DN,{})}),i.jsxs("div",{className:"topbar__id",children:[Tt&&X?i.jsx(aa,{className:"rename--title",value:X.title??"",onCommit:p=>{qc(X,p),Ye(!1)},onCancel:()=>Ye(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!X||et,title:X&&!et?"Переименовать сессию":void 0,onClick:()=>Ye(!0),children:(X==null?void 0:X.title)??"Claude Code Visual"}),Fa&&i.jsx("span",{className:"topbar__project",title:Fa.path,children:Fa.name})]}),et?Hr:as&&i.jsx(Fy,{path:as})]}),!et&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:Ut?"meters-refresh is-busy":"meters-refresh",title:nu,"aria-label":Lc,"aria-busy":Ut,disabled:!z||Ut,onClick:Pl,children:i.jsx(ON,{})}),i.jsx(Py,{usage:Oc}),i.jsx(n_,{}),dn,Ur,Hr,Pc&&i.jsx("span",{className:"badge badge--cost",children:Pc}),_u,wa,eo]})]}),i.jsx(mN,{tokens:(lt==null?void 0:lt.tokens)??V.contextTokens,maxTokens:(lt==null?void 0:lt.maxTokens)??null,fetchedAt:(lt==null?void 0:lt.fetchedAt)??null}),et&&Xe&&i.jsx(_k,{onClose:()=>Qt(!1),permission:dn,model:Ur,usage:Oc,cwd:as,costLabel:Pc,onRefresh:Pl,refreshing:Ut,metersFetchedAt:Dc,onRename:X?()=>{Ye(!0),Qt(!1)}:null,onHandoff:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{fu(X),Qt(!1)}:null,onFreshSession:X&&X.state!=="closed"&&X.provider!=="antigravity"?()=>{Ic(X),Qt(!1)}:null,handoffWriting:Vs,onStop:X&&X.state!=="closed"?()=>{Hs(X),Qt(!1)}:null}),we.length>0&&i.jsx(qj,{files:we,activePath:ze,busy:jl,onSelect:ot,onClose:p=>dl(p),zoomed:an==="main",onToggleZoom:ri("main")}),ii?i.jsx(Bj,{file:ii,goto:(oa==null?void 0:oa.path)===ii.path?oa:null,onChange:(p,I)=>{ve(de=>de.map(Ie=>Ie.path===p?{...Ie,text:I}:Ie)),Ss(p)},onSave:p=>sl(p),onReload:Is,onOverwrite:p=>sl(p,!0),onRequestMedia:ns,onTogglePreview:p=>ve(I=>I.map(de=>de.path===p?{...de,previewMode:!de.previewMode}:de))}):i.jsxs(i.Fragment,{children:[i.jsx(Op,{items:V.items,busy:jl&&!al,waiting:li,empty:(X==null?void 0:X.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:tu,historyHasMore:Db(ge),historyLoading:ge.loading,onLoadHistory:Ar,sessionId:z??void 0,onEditMessage:(X==null?void 0:X.provider)==="antigravity"?void 0:(p,I,de)=>{z&&ee({type:"prompt.edit",sessionId:z,userIndex:p,text:I,images:de})}}),sd,yu,z&&((Br=X==null?void 0:X.tasks)!=null&&Br.length)?i.jsx(Vj,{tasks:X.tasks,onStop:p=>ee({type:"task.stop",sessionId:z,taskId:p})}):null,i.jsx(Ky,{disabled:!z,busy:jl&&!al,placeholder:al?"Промпт уйдёт, как только связь вернётся":(X==null?void 0:X.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:ja,sessionTitle:(X==null?void 0:X.title)??null,contextResult:Ml,draftKey:z,onContextSearch:p=>Zc("mention",p),onCommand:Ys,onSend:ou,onInterrupt:()=>{z&&ee({type:"control.interrupt",sessionId:z})}})]}),fa&&da&&i.jsxs(i.Fragment,{children:[!et&&an!=="terminal"&&i.jsx(aN,{height:zs.height,onResize:zs.setHeight,onReset:zs.reset}),i.jsx(oN,{mobile:et,zoomed:an==="terminal",onToggleZoom:ri("terminal"),terminals:Wl,activeId:Yi,blocked:wr,error:Tc,onDismissError:()=>Ya(null),height:et?$a.height:zs.height,offset:et?{top:$a.offsetTop,left:$a.offsetLeft}:void 0,onSelect:Sr,onOpen:st,onClose:qs,onInput:(p,I)=>ee({type:"term.input",id:p,data:I}),onResize:(p,I,de)=>ee({type:"term.resize",id:p,cols:I,rows:de}),onAttach:p=>ee({type:"term.attach",id:p}),onHide:()=>Zn(!1),registerSink:Cc})]})]}),i.jsx(uk,{open:ha,items:Ko.items,busy:Qn,ready:z!==null,commands:ja,contextResult:ti,draftKey:z,models:Xs.rows,model:Xs.selected,effort:$s.effort,ultracode:$s.ultracode,thinking:$s.thinking,switchOnFlag:$s.switchOnFlag,onContextSearch:p=>Zc("side",p),onCommand:Ys,onModel:p=>{p&&(pa(I=>({...I,model:p})),Bs(I=>ee({type:"control.set_model",sessionId:I,model:p})))},onEffort:p=>{pa(I=>({...I,effort:p,ultracode:!1})),Bs(I=>ee({type:"control.set_effort",sessionId:I,effort:p}))},onUltracode:p=>{pa(I=>({...I,ultracode:p,...p?{effort:"xhigh"}:{}})),Bs(I=>ee({type:"control.set_ultracode",sessionId:I,enabled:p}))},onThinking:p=>{pa(I=>({...I,thinking:p})),Bs(I=>ee({type:"control.set_thinking",sessionId:I,enabled:p}))},onSwitchOnFlag:p=>{pa(I=>({...I,switchOnFlag:p})),Bs(I=>ee({type:"control.set_flag_switch",sessionId:I,enabled:p}))},onAsk:$c,onInterrupt:()=>{Qo&&ee({type:"control.interrupt",sessionId:Qo})},onReset:Mr,onClose:()=>kr(!1),zoomed:an==="ask",onToggleZoom:ri("ask")}),ha&&an!=="ask"&&Pi("ask"),(kn||ha||sn||xs)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{bt(!1),kr(!1),Bt(!1),ys(!1)}}),El&&i.jsx(Xw,{detail:El,local:((Ze==null?void 0:Ze.hasRemote)??!1)&&(Ze==null?void 0:Ze.commits.some(p=>p.hash===El.hash&&!p.pushed))===!0,onCheckout:Xc,onClose:()=>{xn(null),tl(null)}}),ue&&i.jsx(Nl,{title:"Остановить сессию?",onClose:()=>_e(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>_e(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>{ee({type:"session.close",sessionId:ue.id}),_e(null)},children:"Остановить"})]}),children:i.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Fl&&i.jsxs(Nl,{title:"Переключить рабочее дерево?",onClose:()=>fl(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>fl(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:Dr,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",Fl.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),jl&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Ze&&Ze.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Ze.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Ds&&i.jsx(sk,{status:Ht,owners:Ii,files:Ga,defaultName:(Fa==null?void 0:Fa.name)??"",hasCommits:Ze===null||Ze.head!=="",busy:nl,result:ms,onRefreshStatus:_a,onSaveToken:Or,onPublish:Vc,onDismissResult:()=>yn(null),onClose:()=>yl(!1)}),gs&&i.jsx(ok,{busy:nl,result:ms,onSubmit:js,onDismissResult:()=>yn(null),onClose:()=>Jl(!1)}),mt&&i.jsx(Nl,{title:mt.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>fn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>fn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Vn(mt),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[mt.path," будет удалён с диска",mt.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),It&&i.jsx(Nl,{title:"Закрыть без сохранения?",onClose:()=>ll(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>ll(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>dl(It,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{sl(It),dl(It,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",It," есть несохранённые правки."]})}),An&&i.jsx(jk,{tab:An,servers:wn,plugins:Xt,marketplaces:Kt,catalog:Yn,result:be,actions:Yc,onTab:on,onClose:()=>on(null)}),ca&&i.jsx(Ak,{status:ps,login:Vt,actions:Wa,remote:b,runningSessions:L.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:z?()=>{Sa(),Ql(!1)}:null,reconnectBlocked:jl,reconnectHint:ci,onClose:()=>Ql(!1)}),m&&i.jsx(Lk,{state:d,onPair:(p,I)=>ee({type:"relay.pair",code:p,...I?{name:I}:{}}),onUnpair:()=>ee({type:"relay.unpair"}),onClose:()=>g(!1)}),bl&&i.jsx(Kk,{settings:Dn,models:(ke==null?void 0:ke.models)??[],relayState:d,local:Rf()==="local",onChange:Pa,onEnableShell:()=>ee({type:"relay.shell.enable"}),onDisableShell:()=>ee({type:"relay.shell.disable"}),onOpenRelay:()=>{$n(!1),g(!0)},onClose:()=>$n(!1)}),tt&&i.jsx(Aw,{candidates:nt,searching:$t,agentItems:nn.items,agentBusy:(Sn==null?void 0:Sn.state)==="running",error:cn,roots:zt,created:ft,onSearch:Wf,onAskAgent:Pf,onInterrupt:()=>{const p=Cr.current;p&&ee({type:"control.interrupt",sessionId:p})},onSubmit:Ff,onCreate:Jf,onClose:_l}),Tn!=null&&Tn.questions&&Tn.questions.length>0?i.jsx(_w,{request:{...Tn,questions:Tn.questions},queued:V.pending.length-1,onAnswer:Wc,onDecline:Gs}):Tn&&ss!==null?i.jsx(Sw,{request:Tn,plan:ss,queued:V.pending.length-1,onAccept:gu,onDecline:bu}):Tn&&i.jsx(yw,{request:Tn,queued:V.pending.length-1,onDecide:Rl}),xe&&i.jsx(Jk,{handoff:xe,onClose:()=>Be(null)}),i.jsx(eN,{notices:ul,onDismiss:p=>gl(I=>I.filter(de=>de.id!==p))})]})}function kN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),i.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function NN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function TN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function EN(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:i.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function CN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),i.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),i.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function AN(l,s){return ey(l)===ey(s)}function ey(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function MN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),i.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),i.jsx("path",{d:"M8.2 10h3.1"})]})}function RN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function DN(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function ON(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const s_=document.getElementById("root");if(!s_)throw new Error("#root not found");T0.createRoot(s_).render(i.jsx(y.StrictMode,{children:i.jsx(wN,{})}));export{A1 as D,Jt as I,Pt as N,UN as P,ds as T,As as a,Ay as b,Bl as c,zN as d,Ly as e,Yo as f,Z1 as h,HN as p,BN as s,Ce as t};